summaryrefslogtreecommitdiff
path: root/source3/utils/pdbedit.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-02-23 20:12:31 +0000
committerJeremy Allison <jra@samba.org>2004-02-23 20:12:31 +0000
commitaa4abfb3b589bf5123b5d0d674c3c26ebdabe1a0 (patch)
tree9d877b7c4cf309f40a24e1cb6c57e9bb59039b5b /source3/utils/pdbedit.c
parent24df38dbc6648261f86adcffd664ffc43f8f3346 (diff)
downloadsamba-aa4abfb3b589bf5123b5d0d674c3c26ebdabe1a0.tar.gz
samba-aa4abfb3b589bf5123b5d0d674c3c26ebdabe1a0.tar.bz2
samba-aa4abfb3b589bf5123b5d0d674c3c26ebdabe1a0.zip
Fix "unable to initialize" bug when smbd hasn't been run with
new system and a user is being added via pdbedit/smbpasswd. Found at Connectathon setup. Jeremy. (This used to be commit f9c7a42e895f50e15d2f5079bfb2cb389fdf2df4)
Diffstat (limited to 'source3/utils/pdbedit.c')
-rw-r--r--source3/utils/pdbedit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index 541dc33a08..3f7aba8366 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -398,6 +398,8 @@ static int new_user (struct pdb_context *in, const char *username,
NTSTATUS nt_status;
char *password1, *password2, *staticpass;
+ get_global_sam_sid();
+
if (!NT_STATUS_IS_OK(nt_status = pdb_init_sam_new(&sam_pwent, username, 0))) {
DEBUG(0, ("could not create account to add new user %s\n", username));
return -1;
@@ -490,6 +492,8 @@ static int new_machine (struct pdb_context *in, const char *machine_in)
fstring machineaccount;
struct passwd *pwd = NULL;
+ get_global_sam_sid();
+
fstrcpy(machinename, machine_in);
machinename[15]= '\0';