summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_get_set.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-07-05 09:46:12 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-07-05 09:46:12 +0000
commita3ddfa5069c9df07626135aa5fd2ec411c41943f (patch)
tree4c66505e3ca16e2db518143ebbf6e999f3a24b9d /source3/passdb/pdb_get_set.c
parentd809ad1d1999b097ff30952b9d14cf5aaa72562e (diff)
downloadsamba-a3ddfa5069c9df07626135aa5fd2ec411c41943f.tar.gz
samba-a3ddfa5069c9df07626135aa5fd2ec411c41943f.tar.bz2
samba-a3ddfa5069c9df07626135aa5fd2ec411c41943f.zip
Fixes to our LDAP/vampire codepaths:
- Try better to add the appropriate mapping between UID and SIDs, based on Get_Pwnam() - Look for previous users (lookup by SID) and correctly modify the existing entry in that case - Map the root user to the Admin SID as a 'well known user' - Save the LDAPMessage result on the SAM_ACCOUNT for use in the next 'update' call on that user. This means that VL's very nice work on atomic LDAP updates now really gets used properly! - This also means that we know the right DN to update, without the extra round-trips to the server. Andrew Bartlett (This used to be commit c7118cb31dac24db3b762fe68ce655b17ea102e0)
Diffstat (limited to 'source3/passdb/pdb_get_set.c')
-rw-r--r--source3/passdb/pdb_get_set.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index c95719451a..e0b9f0e0ec 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -330,6 +330,14 @@ uint32 pdb_get_unknown_6 (const SAM_ACCOUNT *sampass)
return (-1);
}
+void *pdb_get_backend_private_data (const SAM_ACCOUNT *sampass, const struct pdb_methods *my_methods)
+{
+ if (sampass && my_methods == sampass->methods)
+ return sampass->private.backend_private_data;
+ else
+ return NULL;
+}
+
/*********************************************************************
Collection of set...() functions for SAM_ACCOUNT.
********************************************************************/
@@ -1011,6 +1019,28 @@ BOOL pdb_set_hours (SAM_ACCOUNT *sampass, const uint8 *hours, enum pdb_value_sta
return pdb_set_init_flags(sampass, PDB_HOURS, flag);
}
+BOOL pdb_set_backend_private_data (SAM_ACCOUNT *sampass, void *private_data,
+ void (*free_fn)(void **),
+ const struct pdb_methods *my_methods,
+ enum pdb_value_state flag)
+{
+ if (!sampass)
+ return False;
+
+ /* does this backend 'own' this SAM_ACCOUNT? */
+ if (my_methods != sampass->methods)
+ return False;
+
+ if (sampass->private.backend_private_data && sampass->private.backend_private_data_free_fn) {
+ sampass->private.backend_private_data_free_fn(&sampass->private.backend_private_data);
+ }
+
+ sampass->private.backend_private_data = private_data;
+ sampass->private.backend_private_data_free_fn = free_fn;
+
+ return pdb_set_init_flags(sampass, PDB_BACKEND_PRIVATE_DATA, flag);
+}
+
/* Helpful interfaces to the above */