NTSTATUS status;
fstring username;
- memcache_flush(NULL, PDB_GETPWSID_CACHE);
-
status = methods->delete_sam_account(methods, sam_acct);
if (!NT_STATUS_IS_OK(status)) {
return status;
struct pdb_methods *pdb = pdb_get_methods();
uid_t uid = -1;
NTSTATUS status;
+ const struct dom_sid *user_sid;
char *msg_data;
+ user_sid = pdb_get_user_sid(sam_acct);
+
/* sanity check to make sure we don't delete root */
- if ( !sid_to_uid( pdb_get_user_sid(sam_acct), &uid ) ) {
+ if ( !sid_to_uid(user_sid, &uid ) ) {
return NT_STATUS_NO_SUCH_USER;
}
return NT_STATUS_ACCESS_DENIED;
}
+ memcache_delete(NULL,
+ PDB_GETPWSID_CACHE,
+ data_blob_const(user_sid, sizeof(*user_sid)));
+
status = pdb->delete_user(pdb, mem_ctx, sam_acct);
if (!NT_STATUS_IS_OK(status)) {
return status;