diff options
author | Gerald Carter <jerry@samba.org> | 2003-09-09 03:18:20 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-09-09 03:18:20 +0000 |
commit | 3cf6eaebd6c57974d33934bf9647b0ab9f50f88e (patch) | |
tree | 2fadaad0c5f22354650f4c64a07ab2c06aad0ec4 /packaging/SuSE/samba3-net_ads_password.diff | |
parent | 07643607a706464089bb4b5a8bd902742591b864 (diff) | |
download | samba-3cf6eaebd6c57974d33934bf9647b0ab9f50f88e.tar.gz samba-3cf6eaebd6c57974d33934bf9647b0ab9f50f88e.tar.bz2 samba-3cf6eaebd6c57974d33934bf9647b0ab9f50f88e.zip |
syncing packaging files from 3.0
(This used to be commit ccc2a0d3840f88625cf89d6739320728e830ef87)
Diffstat (limited to 'packaging/SuSE/samba3-net_ads_password.diff')
-rw-r--r-- | packaging/SuSE/samba3-net_ads_password.diff | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/packaging/SuSE/samba3-net_ads_password.diff b/packaging/SuSE/samba3-net_ads_password.diff new file mode 100644 index 0000000000..cc800fb7bf --- /dev/null +++ b/packaging/SuSE/samba3-net_ads_password.diff @@ -0,0 +1,58 @@ +Index: source/utils/net_ads.c +=================================================================== +RCS file: /cvsroot/samba/source/utils/net_ads.c,v +retrieving revision 1.37.2.22 +diff -u -r1.37.2.22 net_ads.c +--- source/utils/net_ads.c 10 Jun 2003 04:15:55 -0000 1.37.2.22 ++++ source/utils/net_ads.c 20 Jun 2003 19:59:36 -0000 +@@ -44,9 +44,9 @@ + "\n\tdump the machine account details to stdout\n" + "\nnet ads lookup"\ + "\n\tperform a CLDAP search on the server\n" +-"\nnet ads password <username@realm> -Uadmin_username@realm%%admin_pass"\ ++"\nnet ads password <username@realm> <password> -Uadmin_username@realm%%admin_pass"\ + "\n\tchange a user's password using an admin account"\ +-"\n\t(note: use realm in UPPERCASE)\n"\ ++"\n\t(note: use realm in UPPERCASE, prompts if password is obmitted)\n"\ + "\nnet ads changetrustpw"\ + "\n\tchange the trust account password of this machine in the AD tree\n"\ + "\nnet ads printer [info | publish | remove] <printername> <servername>"\ +@@ -909,7 +909,7 @@ + } + + +- if (argc != 1) { ++ if (argc < 1) { + d_printf("ERROR: You must say which username to change password for\n"); + return -1; + } +@@ -941,22 +941,24 @@ + return -1; + } + +- asprintf(&prompt, "Enter new password for %s:", user); +- +- new_password = getpass(prompt); ++ if (argv[1]) { ++ new_password = (char *)argv[1]; ++ } else { ++ asprintf(&prompt, "Enter new password for %s:", user); ++ new_password = getpass(prompt); ++ free(prompt); ++ } + + ret = kerberos_set_password(ads->auth.kdc_server, auth_principal, + auth_password, user, new_password, ads->auth.time_offset); + if (!ADS_ERR_OK(ret)) { + d_printf("Password change failed :-( ...\n"); + ads_destroy(&ads); +- free(prompt); + return -1; + } + + d_printf("Password change for %s completed.\n", user); + ads_destroy(&ads); +- free(prompt); + + return 0; + } |