diff options
author | Jean-François Micouleau <jfm@samba.org> | 2001-12-14 14:35:38 +0000 |
---|---|---|
committer | Jean-François Micouleau <jfm@samba.org> | 2001-12-14 14:35:38 +0000 |
commit | 21e3bbbea7b5545c66975624aa8554c0dd6bb14e (patch) | |
tree | 18e04f7d793564a5325e0305950e3d18a1a3edab /source3/utils/smbpasswd.c | |
parent | 14d7f43590a9384c34d49483c4ee14b4ad3d5fe7 (diff) | |
download | samba-21e3bbbea7b5545c66975624aa8554c0dd6bb14e.tar.gz samba-21e3bbbea7b5545c66975624aa8554c0dd6bb14e.tar.bz2 samba-21e3bbbea7b5545c66975624aa8554c0dd6bb14e.zip |
Rafal (mimir) patch for trusts r.
(This used to be commit c26623671e2b0b2e80c6d6383a99880c4f439f04)
Diffstat (limited to 'source3/utils/smbpasswd.c')
-rw-r--r-- | source3/utils/smbpasswd.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index 7086fbff37..3ee94661ab 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -56,6 +56,7 @@ static void usage(void) printf(" -e enable user\n"); printf(" -n set no password\n"); printf(" -m machine trust account\n"); + printf(" -i interdomain trust account\n"); #ifdef WITH_LDAP_SAM printf(" -w ldap admin password\n"); #endif @@ -213,7 +214,7 @@ static int process_root(int argc, char *argv[]) user_name[0] = '\0'; - while ((ch = getopt(argc, argv, "axdehmnjr:swR:D:U:L")) != EOF) { + while ((ch = getopt(argc, argv, "axdehmnijr:swR:D:U:L")) != EOF) { switch(ch) { case 'L': local_mode = True; @@ -236,6 +237,9 @@ static int process_root(int argc, char *argv[]) case 'm': local_flags |= LOCAL_TRUST_ACCOUNT; break; + case 'i': + local_flags |= LOCAL_INTERDOM_ACCOUNT; + break; case 'j': d_printf("See 'net rpc join' for this functionality\n"); exit(1); @@ -375,6 +379,22 @@ static int process_root(int argc, char *argv[]) slprintf(buf, sizeof(buf)-1, "%s$", user_name); fstrcpy(user_name, buf); + } else if (local_flags & LOCAL_INTERDOM_ACCOUNT) { + static fstring buf; + + if (local_flags & LOCAL_ADD_USER) { + /* + * Prompt for trusting domain's account password + */ + new_passwd = prompt_for_new_password(stdin_passwd_get); + if(!new_passwd) { + fprintf(stderr, "Unable to get newpassword.\n"); + exit(1); + } + } + slprintf(buf, sizeof(buf) - 1, "%s$", user_name); + fstrcpy(user_name, buf); + } else { if (remote_machine != NULL) { |