The net utility prompts for a password when -P is specified, but the machine account doesn't exist. Previously, it would exit nicely with an error status. Now it prompts for a password. For example: net ads leave -P Previously this would work as desired -- if the machine account existed, it would remove it; if not, it would continue. Now it hangs waiting for input, which is a Bad Thing in a script. This patch disables prompt if -P is specified. Index: net.h =================================================================== RCS file: /cvsroot/samba/source/utils/net.h,v retrieving revision 1.7.2.4 diff -p -u -r1.7.2.4 net.h --- net.h 21 Apr 2003 14:09:03 -0000 1.7.2.4 +++ net.h 13 Sep 2003 18:52:49 -0000 @@ -48,6 +48,7 @@ extern const char *opt_workgroup; extern int opt_long_list_entries; extern int opt_reboot; extern int opt_force; +extern int opt_machine_pass; /* KJC */ extern int opt_timeout; extern const char *opt_host; extern const char *opt_user_name; Index: net_ads.c =================================================================== RCS file: /cvsroot/samba/source/utils/net_ads.c,v retrieving revision 1.37.2.31 diff -p -u -r1.37.2.31 net_ads.c --- net_ads.c 5 Sep 2003 17:57:45 -0000 1.37.2.31 +++ net_ads.c 13 Sep 2003 18:52:49 -0000 @@ -145,7 +145,7 @@ static ADS_STRUCT *ads_startup(void) } retry: - if (!opt_password && need_password) { + if (!opt_password && need_password && !opt_machine_pass) { /* KJC */ char *prompt; asprintf(&prompt,"%s password: ", opt_user_name); opt_password = getpass(prompt);
Forgot to include this one: Index: net.c =================================================================== RCS file: /cvsroot/samba/source/utils/net.c,v retrieving revision 1.43.2.35 diff -p -u -r1.43.2.35 net.c --- net.c 7 Sep 2003 16:36:13 -0000 1.43.2.35 +++ net.c 14 Sep 2003 02:37:30 -0000 @@ -72,7 +72,7 @@ const char *opt_container = "cn=Users"; int opt_flags = -1; int opt_timeout = 0; const char *opt_target_workgroup = NULL; -static int opt_machine_pass = 0; +int opt_machine_pass = 0; /* KJC */ BOOL opt_have_ip = False; struct in_addr opt_dest_ip;
Applied something like this patch. I also expanded it to cover the RPC and RAP methods as well.
originally reported against one of the 3.0.0rc[1-4] releases. Cleaning up non-production versions.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.