summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2001-12-14 14:35:38 +0000
committerJean-François Micouleau <jfm@samba.org>2001-12-14 14:35:38 +0000
commit21e3bbbea7b5545c66975624aa8554c0dd6bb14e (patch)
tree18e04f7d793564a5325e0305950e3d18a1a3edab /source3/passdb
parent14d7f43590a9384c34d49483c4ee14b4ad3d5fe7 (diff)
downloadsamba-21e3bbbea7b5545c66975624aa8554c0dd6bb14e.tar.gz
samba-21e3bbbea7b5545c66975624aa8554c0dd6bb14e.tar.bz2
samba-21e3bbbea7b5545c66975624aa8554c0dd6bb14e.zip
Rafal (mimir) patch for trusts r.
(This used to be commit c26623671e2b0b2e80c6d6383a99880c4f439f04)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index fa4946b093..4c64ad5e01 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -954,13 +954,27 @@ account without a valid local system user.\n", user_name);
return False;
}
- /* set account flags. Note that the default is non-expiring accounts */
- /*if (!pdb_set_acct_ctrl(sam_pass,((local_flags & LOCAL_TRUST_ACCOUNT) ? ACB_WSTRUST : ACB_NORMAL|ACB_PWNOEXP) )) {*/
- if (!pdb_set_acct_ctrl(sam_pass,((local_flags & LOCAL_TRUST_ACCOUNT) ? ACB_WSTRUST : ACB_NORMAL) )) {
- slprintf(err_str, err_str_len-1, "Failed to set 'trust account' flags for user %s.\n", user_name);
- pdb_free_sam(&sam_pass);
- return False;
+
+ if (local_flags & LOCAL_TRUST_ACCOUNT) {
+ if (!pdb_set_acct_ctrl(sam_pass, ACB_WSTRUST)) {
+ slprintf(err_str, err_str_len - 1, "Failed to set 'trusted workstation account' flags for user %s.\n", user_name);
+ pdb_free_sam(&sam_pass);
+ return False;
+ }
+ } else if (local_flags & LOCAL_INTERDOM_ACCOUNT) {
+ if (!pdb_set_acct_ctrl(sam_pass, ACB_DOMTRUST)) {
+ slprintf(err_str, err_str_len - 1, "Failed to set 'domain trust account' flags for user %s.\n", user_name);
+ pdb_free_sam(&sam_pass);
+ return False;
+ }
+ } else {
+ if (!pdb_set_acct_ctrl(sam_pass, ACB_NORMAL)) {
+ slprintf(err_str, err_str_len - 1, "Failed to set 'normal account' flags for user %s.\n", user_name);
+ pdb_free_sam(&sam_pass);
+ return False;
+ }
}
+
} else {
/* the entry already existed */
local_flags &= ~LOCAL_ADD_USER;