summaryrefslogtreecommitdiff
path: root/source3/utils/pdbedit.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-01-15 01:02:13 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-01-15 01:02:13 +0000
commitdbee612f7150ee2921c37fa331b38b86d2d63937 (patch)
tree3877bad9cca5ed6d1473c0ed15eb430d91fbc428 /source3/utils/pdbedit.c
parent22e7da0a3d7b71ac188d5093ff5f48a5eb6e6478 (diff)
downloadsamba-dbee612f7150ee2921c37fa331b38b86d2d63937.tar.gz
samba-dbee612f7150ee2921c37fa331b38b86d2d63937.tar.bz2
samba-dbee612f7150ee2921c37fa331b38b86d2d63937.zip
Change the passdb interface to use allocated strings.
These strings are allocated using talloc(), either using its own memory context stored on the SAM_ACCOUNT or one supplied by the caller. The pdb_init_sam() and pdb_free_sam() function have been modifed so that a call to pdb_free_sam() will either clean up (remove hashes from memory) and destroy the TALLOC_CTX or just clean up depending on who supplied it. The pdb_init_sam and pdb_free_sam functions now also return an NTSTATUS, and I have modified the 3 places that actually checked these returns. The only nasty thing about this patch is the small measure needed to maintin interface compatability - strings set to NULL are actually set to "". This is becouse there are too many places in Samba that do strlen() on these strings without checking if they are NULL pointers. A supp patch will follow to set all strings to "" in pdb_default_sam(). Andrew Bartlett (This used to be commit 144345b41d39a6f68d01f62b7aee64ca0d328085)
Diffstat (limited to 'source3/utils/pdbedit.c')
-rw-r--r--source3/utils/pdbedit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index 046d4a4ad8..ae600f6a6a 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -443,7 +443,7 @@ account without a valid local system user.\n", user_name);
return False;
}
- if (!pdb_init_sam_pw(&sam_pwent, pwd)) {
+ if (!NT_STATUS_IS_OK(pdb_init_sam_pw(&sam_pwent, pwd))) {
fprintf(stderr, "Failed initialise SAM_ACCOUNT for user %s.\n", user_name);
return False;
}