The Samba-Bugzilla – Bug 6434
net ads leave documentation does not mention user/password prompt.
Last modified: 2009-06-18 10:47:36 UTC
there is an active connection between microsoft windows 2003 ADS and SAMBA on fedora core 9. When command "net ads leave" is typed it prompts for the username and password. AS per man pages of net it should not. But "net ads leave -U administrator" prompts for the windows administrator password and giving correct password leaves the connection.
"net ads leave" should not prompts for the password, and leaves the connection as soon the command is fired.
On reading the code, I realized that in the function net_ads_leave of file net_ads.c, we are setting up a password by calling function net_prompt_pass. which reads password which I passed while calling the service with command "net ads leave -U administrator%<password>". If it is failed to find the password, it will tries to read password from system environment getenv("PASSWD"). if my this parameter is not been set initially, it then prompts for the password. I still wonder why this things not been updated to any man pages of samba. Not even documented any where. Also if no user name mentioned then it prompts for the root's password and try to disconnect with root's credentials. which it fails to find on windows server. eventually my Linux box hangs. Please update the code and mention this in the man net pages.
Looks like intended behaviour for net. It has to prompt for the password if none is given, unless AD would allow any user to make a member leave the domain. Most samba command line tools take your current username if none is specified with -U, so that's certainly intended behaviour as well.
Changing component to docs and severity to normal.