summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-10-12 03:38:07 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-10-12 03:38:07 +0000
commit4ac9ccfde4d36e3b6065c65c92dd02dddb78b4f2 (patch)
tree3a4d155eebb79435dc1b6b9493028a259bc13a30 /source3/auth
parent4920d2192206b6e0072d078cfba08f91bb03651d (diff)
downloadsamba-4ac9ccfde4d36e3b6065c65c92dd02dddb78b4f2.tar.gz
samba-4ac9ccfde4d36e3b6065c65c92dd02dddb78b4f2.tar.bz2
samba-4ac9ccfde4d36e3b6065c65c92dd02dddb78b4f2.zip
Nice *big* patch from metze.
The actual design change is relitivly small however: It all goes back to jerry's 'BOOL store', added to many of the elements in a SAM_ACCOUNT. This ensured that smb.conf defaults did not get 'fixed' into ldap. This was a great win for admins, and this patch follows in the same way. This patch extends the concept - we don't store values back into LDAP unless they have been changed. So if we read a value, but don't update it, or we read a value, find it's not there and use a default, we will not update ldap with that value. This reduced clutter in our LDAP DB, and makes it easier to change defaults later on. Metze's particular problem was that when we 'write back' an unchanged value, we would clear any muliple values in that feild. Now he can still have his mulitivalued 'uid' feild, without Samba changing it for *every* other operation. This also applies to many other attributes, and helps to eliminate a nasty race condition. (Time between get and set) This patch is big, and needs more testing, but metze has tested usrmgr, and I've fixed some pdbedit bugs, and tested domain joins, so it isn't compleatly flawed ;-). The same system will be introduced into the SAM code shortly, but this fixes bugs that people were coming across in production uses of Samba 3.0/HEAD, hence it's inclusion here. Andrew Bartlett (This used to be commit 7f237bde212eb188df84a5d8adb598a93fba8155)
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_unix.c2
-rw-r--r--source3/auth/auth_util.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/source3/auth/auth_unix.c b/source3/auth/auth_unix.c
index 6f4b3f8b15..1251432b87 100644
--- a/source3/auth/auth_unix.c
+++ b/source3/auth/auth_unix.c
@@ -49,7 +49,7 @@ static BOOL update_smbpassword_file(const char *user, const char *password)
* Remove the account disabled flag - we are updating the
* users password from a login.
*/
- if (!pdb_set_acct_ctrl(sampass, pdb_get_acct_ctrl(sampass) & ~ACB_DISABLED)) {
+ if (!pdb_set_acct_ctrl(sampass, pdb_get_acct_ctrl(sampass) & ~ACB_DISABLED, PDB_CHANGED)) {
pdb_free_sam(&sampass);
return False;
}
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index ce5fd32337..b14344ef50 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -931,47 +931,47 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
return nt_status;
}
- if (!pdb_set_user_sid(sam_account, &user_sid)) {
+ if (!pdb_set_user_sid(sam_account, &user_sid, PDB_CHANGED)) {
pdb_free_sam(&sam_account);
return NT_STATUS_UNSUCCESSFUL;
}
- if (!pdb_set_group_sid(sam_account, &group_sid)) {
+ if (!pdb_set_group_sid(sam_account, &group_sid, PDB_CHANGED)) {
pdb_free_sam(&sam_account);
return NT_STATUS_UNSUCCESSFUL;
}
- if (!pdb_set_nt_username(sam_account, nt_username)) {
+ if (!pdb_set_nt_username(sam_account, nt_username, PDB_CHANGED)) {
pdb_free_sam(&sam_account);
return NT_STATUS_NO_MEMORY;
}
- if (!pdb_set_domain(sam_account, nt_domain)) {
+ if (!pdb_set_domain(sam_account, nt_domain, PDB_CHANGED)) {
pdb_free_sam(&sam_account);
return NT_STATUS_NO_MEMORY;
}
- if (!pdb_set_fullname(sam_account, pdb_unistr2_convert(&(info3->uni_full_name)))) {
+ if (!pdb_set_fullname(sam_account, pdb_unistr2_convert(&(info3->uni_full_name)), PDB_CHANGED)) {
pdb_free_sam(&sam_account);
return NT_STATUS_NO_MEMORY;
}
- if (!pdb_set_logon_script(sam_account, pdb_unistr2_convert(&(info3->uni_logon_script)), True)) {
+ if (!pdb_set_logon_script(sam_account, pdb_unistr2_convert(&(info3->uni_logon_script)), PDB_CHANGED)) {
pdb_free_sam(&sam_account);
return NT_STATUS_NO_MEMORY;
}
- if (!pdb_set_profile_path(sam_account, pdb_unistr2_convert(&(info3->uni_profile_path)), True)) {
+ if (!pdb_set_profile_path(sam_account, pdb_unistr2_convert(&(info3->uni_profile_path)), PDB_CHANGED)) {
pdb_free_sam(&sam_account);
return NT_STATUS_NO_MEMORY;
}
- if (!pdb_set_homedir(sam_account, pdb_unistr2_convert(&(info3->uni_home_dir)), True)) {
+ if (!pdb_set_homedir(sam_account, pdb_unistr2_convert(&(info3->uni_home_dir)), PDB_CHANGED)) {
pdb_free_sam(&sam_account);
return NT_STATUS_NO_MEMORY;
}
- if (!pdb_set_dir_drive(sam_account, pdb_unistr2_convert(&(info3->uni_dir_drive)), True)) {
+ if (!pdb_set_dir_drive(sam_account, pdb_unistr2_convert(&(info3->uni_dir_drive)), PDB_CHANGED)) {
pdb_free_sam(&sam_account);
return NT_STATUS_NO_MEMORY;
}