When I run smbpasswd from samba 3.0.23a on a MIPSEL system running Linux 2.4.20 as root, I'm NEVER asked for a password. Even when I create a new user in smbpasswd, I'm not asked: root@HD.bei.digitalprojects.com:/etc/samba# strings smbpasswd root:0:AAD3B435B51404EEAAD3B435B51404EE:31D6CFE0D16AE931B73C59D7E0C089C0:[U ]:LCT-44D63D42: bin:1:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000: daemon:2:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000: adm:3:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000: sync:5:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000: nobody:99:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000: root@HD.bei.digitalprojects.com:/etc/samba# smbpasswd -a askwar Added user askwar. root@HD.bei.digitalprojects.com:/etc/samba# smbpasswd askwar root@HD.bei.digitalprojects.com:/etc/samba# strings smbpasswd root:0:AAD3B435B51404EEAAD3B435B51404EE:31D6CFE0D16AE931B73C59D7E0C089C0:[U ]:LCT-44D63D42: bin:1:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000: daemon:2:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000: adm:3:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000: sync:5:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000: nobody:99:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DU ]:LCT-00000000: askwar:1000:AAD3B435B51404EEAAD3B435B51404EE:31D6CFE0D16AE931B73C59D7E0C089C0:[U ]:LCT-44D63EAE: When I run smbpasswd as a user, eg. as Unix user "askwar", I AM prompted for a password. askwar@HD.bei.digitalprojects.com:~/src/samba-3.0.23a/source$ smbpasswd Old SMB password: But as I don't know the "Old SMB password", I'm somewhat at a loss... :) I also cannot feed the password over stdin as root: root@HD.bei.digitalprojects.com:/etc/samba# echo foo | smbpasswd -s askwar Mismatch - password unchanged. Unable to get new password. What's happening here? I'll attach the config.log to the report.
Created attachment 2087 [details] config.log
Problem still exists with 3.0.23b.
Created attachment 2092 [details] "strace" output of smbpasswd I don't know if it helps or not, but attached you can find the strace output of smbpasswd askwar I'll also attach /etc/samba/smbpasswd.
Created attachment 2093 [details] /etc/samba/smbpasswd /etc/samba/smbpasswd from the samba system. It only contains one entry for the "askwar" user. I don't know the password :|
I did some debugging and found, that get_pass() in utils/passwd_util.c gets executed. There, the "else" branch gets run, ie. "p = getpass( prompt);" is run. This is just a #define for getsmbpass() which resides in lib/getsmbpass.c. And in getsmbpass(), the execution differs for root and non-root users. When I'm root, the *ELSE* branch of the "if (in == NULL)" (the first if in that function) is run. This means, that in = fopen ("/dev/tty", "w+"); did NOT return NULL. Next, the test "if (tcgetattr (fileno (in), &t) == 0) {" yields FALSE for root - for non-root, this test is TRUE. Why does this happen? Does this mean, that root, for some reason, cannot open /dev/tty for writing? root@HD:/etc/samba# ls -al /dev/tty* -rw-r--r-- 1 root root 25 Aug 17 21:54 /dev/tty crw-rw-rw- 1 root root 4, 64 Aug 17 22:00 /dev/ttyS0 I'm logged in to this system over a SSH session. The SSH server is Dropbear sshd v0.46. I don't understand this.
Umm ... This is the way that "smbpasswd" is supposed to work ... the way it was designed to work in fact.
(In reply to t12nslookup from comment #6) Correct, this is by design. See -r to force a remote change.