no argument sent to "check password script"

Asked by Thomas Ellingsén on 2012-06-14

Problem: "check password script" does not pass password to standard input of script

# /usr/local/samba/sbin/smbd --version
Version 3.5.12

I made a test script

#!/bin/bash
echo $1 >> /tmp/pw.log
exit 0

and with smb.conf line
check password script = /path/to/script/nameofscript.sh

just a blank line is written to log file.

check password script = /path/to/script/nameofscript.sh %u
uid is writtnen to log file, but no password.

according to the smbd manpage the function "check password script" should pass the password to standard in of the password-check-script.

When i use a script that actually checks the password it always returns false, now I know why.... :)

Is this a general bug or something in my installation?

Best regards,
Thomas

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu samba Edit question
Assignee:
No assignee Edit question
Solved by:
Thomas Ellingsén
Solved:
Last query:
Last reply:
Thomas Ellingsén (skurhinken) said : #1

i found the problem. I missunderstood the syntax for the stdin

it should be
#!/bin/bash
read PASSWORD
echo $PASSWORD >> /tmp/pw.log
exit 0

if the %u is added it could be

#!/bin/bash
read PASSWORD
echo $1 >> /tmp/pw.log
echo $PASSWORD >> /tmp/pw.log
exit 0

:)

Thomas Ellingsén (skurhinken) said : #2

i found the problem. I missunderstood the syntax for the stdin

it should be
#!/bin/bash
read PASSWORD
echo $PASSWORD >> /tmp/pw.log
exit 0

if the %u is added it could be

#!/bin/bash
read PASSWORD
echo $1 >> /tmp/pw.log
echo $PASSWORD >> /tmp/pw.log
exit 0

:)