summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-01-11 12:09:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:04 -0500
commit19563e67447366364c75dbf79fff48a972669d40 (patch)
tree8f764a38a8e1255f65b935a78fd5def5fc1afe65 /source3/utils
parent933a8ec57edf38d27e6af4bb3be489efadaab713 (diff)
downloadsamba-19563e67447366364c75dbf79fff48a972669d40.tar.gz
samba-19563e67447366364c75dbf79fff48a972669d40.tar.bz2
samba-19563e67447366364c75dbf79fff48a972669d40.zip
r12840: Add -W to smbpasswd. Thanks to William Jojo <jojowil@hvcc.edu>.
Volker (This used to be commit 2942f3594ba39748dca0238f1e1a5c744a7afffb)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbpasswd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 5aba162389..7659bb2997 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -92,7 +92,7 @@ static int process_options(int argc, char **argv, int local_flags)
user_name[0] = '\0';
- while ((ch = getopt(argc, argv, "c:axdehminjr:sw:R:D:U:L")) != EOF) {
+ while ((ch = getopt(argc, argv, "c:axdehminjr:sw:R:D:U:LW")) != EOF) {
switch(ch) {
case 'L':
local_flags |= LOCAL_AM_ROOT;
@@ -153,6 +153,10 @@ static int process_options(int argc, char **argv, int local_flags)
got_username = True;
fstrcpy(user_name, optarg);
break;
+ case 'W':
+ local_flags |= LOCAL_SET_LDAP_ADMIN_PW;
+ *ldap_secret = '\0';
+ break;
}
case 'h':
default:
@@ -325,6 +329,10 @@ static int process_root(int local_flags)
if (local_flags & LOCAL_SET_LDAP_ADMIN_PW) {
printf("Setting stored password for \"%s\" in secrets.tdb\n",
lp_ldap_admin_dn());
+ if ( ! *ldap_secret ) {
+ new_passwd = prompt_for_new_password(stdin_passwd_get);
+ fstrcpy(ldap_secret, new_passwd);
+ }
if (!store_ldap_admin_pw(ldap_secret))
DEBUG(0,("ERROR: Failed to store the ldap admin password!\n"));
goto done;