summaryrefslogtreecommitdiff
path: root/source3/utils/pdbedit.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-04-29 10:26:51 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-04-29 10:26:51 +0000
commit8e7525be9254402327271688ab40be874e23c1cb (patch)
tree72950bc535c52a150a18e05dc702de376d91ace5 /source3/utils/pdbedit.c
parent46eac77b3bcfec190acd738e2dfea33c70c9b9cd (diff)
downloadsamba-8e7525be9254402327271688ab40be874e23c1cb.tar.gz
samba-8e7525be9254402327271688ab40be874e23c1cb.tar.bz2
samba-8e7525be9254402327271688ab40be874e23c1cb.zip
Merge 3.0's change to how we add users onto HEAD, including a few other bits
of sync-up for the rpc_server/srv_samr_nt.c Andrew Bartlett (This used to be commit 3c867aedd9abc29389f5d049dbc94ada6738d1b0)
Diffstat (limited to 'source3/utils/pdbedit.c')
-rw-r--r--source3/utils/pdbedit.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index d7de709e21..3a3d06a645 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -351,20 +351,12 @@ static int new_user (struct pdb_context *in, const char *username,
const char *profile, char *user_sid, char *group_sid)
{
SAM_ACCOUNT *sam_pwent=NULL;
- struct passwd *pwd = NULL;
+ NTSTATUS nt_status;
char *password1, *password2, *staticpass;
- ZERO_STRUCT(sam_pwent);
-
- if ((pwd = getpwnam_alloc(username))) {
- pdb_init_sam_pw (&sam_pwent, pwd);
- passwd_free(&pwd);
- } else {
- fprintf (stderr, "WARNING: user %s does not exist in system passwd\n", username);
- pdb_init_sam(&sam_pwent);
- if (!pdb_set_username(sam_pwent, username, PDB_CHANGED)) {
- return -1;
- }
+ if (!NT_STATUS_IS_OK(nt_status = pdb_init_sam_new(&sam_pwent, username))) {
+ DEBUG(0, ("could not create account to add new user %s\n", username));
+ return -1;
}
staticpass = getpass("new password:");