The Samba-Bugzilla – Attachment 9789 Details for
Bug 10328
smbpasswd from 4.1.2 cannot delete root from smbpasswd file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Test patch.
look (text/plain), 1.60 KB, created by
Jeremy Allison
on 2014-03-19 00:03:10 UTC
(
hide
)
Description:
Test patch.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2014-03-19 00:03:10 UTC
Size:
1.60 KB
patch
obsolete
>diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c >index 7a0a824..1067af0 100644 >--- a/source3/passdb/pdb_interface.c >+++ b/source3/passdb/pdb_interface.c >@@ -584,6 +584,19 @@ static NTSTATUS pdb_default_delete_user(struct pdb_methods *methods, > { > NTSTATUS status; > fstring username; >+ const struct dom_sid *user_sid; >+ uid_t uid = -1; >+ >+ user_sid = pdb_get_user_sid(sam_acct); >+ if (user_sid == NULL) { >+ return NT_STATUS_NO_SUCH_USER; >+ } >+ >+ /* sanity check to make sure we don't delete root */ >+ >+ if ( !sid_to_uid(user_sid, &uid ) ) { >+ return NT_STATUS_NO_SUCH_USER; >+ } > > status = methods->delete_sam_account(methods, sam_acct); > if (!NT_STATUS_IS_OK(status)) { >@@ -597,6 +610,11 @@ static NTSTATUS pdb_default_delete_user(struct pdb_methods *methods, > * the unix side > */ > >+ if ( uid == 0 ) { >+ /* We don't want to delete root... */ >+ return status; >+ } >+ > /* always lower case the username before handing it off to > external scripts */ > >@@ -613,23 +631,12 @@ static NTSTATUS pdb_default_delete_user(struct pdb_methods *methods, > NTSTATUS pdb_delete_user(TALLOC_CTX *mem_ctx, struct samu *sam_acct) > { > 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(user_sid, &uid ) ) { >- return NT_STATUS_NO_SUCH_USER; >- } >- >- if ( uid == 0 ) { >- return NT_STATUS_ACCESS_DENIED; >- } >- > memcache_delete(NULL, > PDB_GETPWSID_CACHE, > data_blob_const(user_sid, sizeof(*user_sid)));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 10328
: 9789