diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-06-14 02:58:03 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-06-14 02:58:03 +0000 |
commit | c264bf2ec93037d2a9927c00295fa60c88b7219d (patch) | |
tree | 562de9e4fb76dbf11ac5252f13574e0a716830a3 /source/utils/pdbedit.c | |
parent | ec4f1e9e2f6c162a475b424d63b9802387ad905e (diff) | |
download | samba-c264bf2ec93037d2a9927c00295fa60c88b7219d.tar.gz |
Patch from ctrlsoft to make the pluggable passdb subsystem use an lp_list
rather than a string when configuring mulitple backends.
Also adjust some of the users of get_global_sam_sid() to cope with the fact
that it just might not exist (uninitialised, can't access secrets.tdb).
More places need conversion.
Add some const and remove silly casts.
Andrew Bartlett
Diffstat (limited to 'source/utils/pdbedit.c')
-rw-r--r-- | source/utils/pdbedit.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source/utils/pdbedit.c b/source/utils/pdbedit.c index ed7f648f2dd..bc50c3521a9 100644 --- a/source/utils/pdbedit.c +++ b/source/utils/pdbedit.c @@ -34,7 +34,7 @@ int export_database (struct pdb_context *in, char *db){ struct pdb_context *context; SAM_ACCOUNT *user = NULL; - if (!NT_STATUS_IS_OK(make_pdb_context_name(&context, db))){ + if (!NT_STATUS_IS_OK(make_pdb_context_string(&context, db))){ fprintf(stderr, "Can't initialize %s.\n", db); return 1; } @@ -76,7 +76,7 @@ static int print_sam_info (SAM_ACCOUNT *sam_pwent, BOOL verbosity, BOOL smbpwdst if (!sam_pwent) return -1; if (verbosity) { - printf ("Unix username: %s\n", pdb_get_username(sam_pwent)); + printf ("Unix username: %s\n", pdb_get_username(sam_pwent)); printf ("NT username: %s\n", pdb_get_nt_username(sam_pwent)); if (IS_SAM_UNIX_USER(sam_pwent)) { uid = pdb_get_uid(sam_pwent); @@ -457,10 +457,6 @@ int main (int argc, char **argv) } - if (!backend_in) { - backend_in = lp_passdb_backend(); - } - setparms = (full_name || home_dir || home_drive || logon_script || profile_path); if (((add_user?1:0) + (delete_user?1:0) + (list_users?1:0) + (import?1:0) + (setparms?1:0)) + (backend_out?1:0) > 1) { @@ -468,10 +464,16 @@ int main (int argc, char **argv) exit(1); } - - if (!NT_STATUS_IS_OK(make_pdb_context_name(&in, backend_in))){ - fprintf(stderr, "Can't initialize %s.\n", backend_in); - return 1; + if (!backend_in) { + if (!NT_STATUS_IS_OK(make_pdb_context_list(&in, lp_passdb_backend()))){ + fprintf(stderr, "Can't initialize passdb backend.\n"); + return 1; + } + } else { + if (!NT_STATUS_IS_OK(make_pdb_context_string(&in, backend_in))){ + fprintf(stderr, "Can't initialize passdb backend.\n"); + return 1; + } } if (add_user) { |