s3-passdb: Only delete 1 entry from memcache.
authorAndreas Schneider <asn@samba.org>
Sat, 20 Aug 2011 14:19:43 +0000 (16:19 +0200)
committerSimo Sorce <idra@samba.org>
Sun, 21 Aug 2011 14:39:10 +0000 (16:39 +0200)
If we delete or update one user we shouldn't flush the complete
memcache.

Signed-off-by: Simo Sorce <idra@samba.org>
Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Sun Aug 21 16:39:10 CEST 2011 on sn-devel-104

source3/passdb/pdb_interface.c

index a74f1812d9decf7394eb97e46eb671e6e537738c..7a0279e1fb7279ff2cb0f1798b65c6d1722310a7 100644 (file)
@@ -667,8 +667,11 @@ NTSTATUS pdb_update_sam_account(struct samu *sam_acct)
 NTSTATUS pdb_delete_sam_account(struct samu *sam_acct) 
 {
        struct pdb_methods *pdb = pdb_get_methods();
+       const struct dom_sid *user_sid = pdb_get_user_sid(sam_acct);
 
-       memcache_flush(NULL, PDB_GETPWSID_CACHE);
+       memcache_delete(NULL,
+                       PDB_GETPWSID_CACHE,
+                       data_blob_const(user_sid, sizeof(*user_sid)));
 
        return pdb->delete_sam_account(pdb, sam_acct);
 }