port latest changes from SAMBA_3_0 tree
[tprouty/samba.git] / source / utils / net_rpc_samsync.c
index e5e9a68b2eceece3e1752c17a7c913e129d95625..9eadbbbade6c7b7d269280503bdd415335f4451a 100644 (file)
@@ -400,8 +400,7 @@ sam_account_from_delta(SAM_ACCOUNT *account, SAM_ACCOUNT_INFO *delta)
        return NT_STATUS_OK;
 }
 
-static NTSTATUS
-fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
+static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
 {
        NTSTATUS nt_ret;
        fstring account;
@@ -429,6 +428,7 @@ fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
                            (delta->acb_info & ACB_DOMTRUST) ) {
                        pstrcpy(add_script, lp_addmachine_script());
                } else {
+                       *add_script = '\0';
                        DEBUG(1, ("Unknown user type: %s\n",
                                  smbpasswd_encode_acb_info(delta->acb_info)));
                }
@@ -439,8 +439,7 @@ fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
                        add_ret = smbrun(add_script,NULL);
                        DEBUG(1,("fetch_account: Running the command `%s' "
                                 "gave %d\n", add_script, add_ret));
-               }
-               else {
+               } else {
                        DEBUG(8,("fetch_account_info: no add user/machine script.  Asking winbindd\n"));
                        
                        /* don't need a RID allocated since the user already has a SID */
@@ -487,8 +486,8 @@ fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
        } else {
                if (map.gid != passwd->pw_gid) {
                        if (!(grp = getgrgid(map.gid))) {
-                               DEBUG(0, ("Could not find unix group %d for user %s (group SID=%s)\n", 
-                                         map.gid, pdb_get_username(sam_account), sid_string_static(&group_sid)));
+                               DEBUG(0, ("Could not find unix group %lu for user %s (group SID=%s)\n", 
+                                         (unsigned long)map.gid, pdb_get_username(sam_account), sid_string_static(&group_sid)));
                        } else {
                                smb_set_primary_group(grp->gr_name, pdb_get_username(sam_account));
                        }
@@ -585,7 +584,7 @@ fetch_group_mem_info(uint32 rid, SAM_GROUP_MEM_INFO *delta)
        }
 
        if (!(grp = getgrgid(map.gid))) {
-               DEBUG(0, ("Could not find unix group %d\n", map.gid));
+               DEBUG(0, ("Could not find unix group %lu\n", (unsigned long)map.gid));
                return NT_STATUS_NO_SUCH_GROUP;
        }