Set default ACB attributes on 'unixsam' accounts. This means that machine
authorAndrew Bartlett <abartlet@samba.org>
Wed, 4 Sep 2002 08:08:03 +0000 (08:08 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 4 Sep 2002 08:08:03 +0000 (08:08 +0000)
accounts added first to /etc/passwd will be honered correctly.  Also, users
'upgraded' to smbpasswd will have the right flags.

Andrew Bartlett
(This used to be commit 474cc910c73e5567313bac438c7324a80e2e90d8)

source3/passdb/passdb.c

index 7a8c40346faa52b446ad4ec25e877b4d7a3b610b..05450c9f2f2360d1e4c0714771908173ed2d15c6 100644 (file)
@@ -251,6 +251,15 @@ NTSTATUS pdb_fill_sam_pw(SAM_ACCOUNT *sam_account, const struct passwd *pwd)
                                                            pwd->pw_name, global_myname, 
                                                            pwd->pw_uid, pwd->pw_gid), 
                                     False);
+               if (!pdb_set_acct_ctrl(sam_account, ACB_NORMAL)) {
+                       DEBUG(1, ("Failed to set 'normal account' flags for user %s.\n", pwd->pw_name));
+                       return NT_STATUS_UNSUCCESSFUL;
+               }
+       } else {
+               if (!pdb_set_acct_ctrl(sam_account, ACB_WSTRUST)) {
+                       DEBUG(1, ("Failed to set 'trusted workstation account' flags for user %s.\n", pwd->pw_name));
+                       return NT_STATUS_UNSUCCESSFUL;
+               }
        }
        return NT_STATUS_OK;
 }