Comment 35 for bug 16575


I can second this bug and i searched for the problem.

To see what causes this issue i modified the kdenetowrk-3.5.6 sources:

  KProcess p;
  p << "smbpasswd" << "-a" <<;

  p << password;

  connect( &p, SIGNAL(receivedStdout(KProcess*,char*,int)),
           this, SLOT(smbpasswdStdOutReceived(KProcess*,char*,int)));

  _smbpasswdOutput = "";


I changed "smbpasswd" into "smbdebug" and created a new executable /usr/bin/smbdebug file:

echo "$3" >/tmp/PASSWD
echo "$3" >>/tmp/PASSWD
smbpasswd -a $2 <</tmp/PASSWD

so smbdebug just get the user+pass and call smbpasswd itself. Using this "workaround" will at least create the new user in /etc/samba/private/smbpasswd.

When i enable "PASSWORD DEBUGGING" in the options i get this when starting kcontrol from shell after adding a new user to Samba:

 filesharing: loading /etc/samba/smb.conf
 filesharing: SambaFile::load: path=/etc/samba/smb.conf
 filesharing: Samba version = 3
 Load smb config files from /dev/null
 Loaded services file OK.
 filesharing: setOn : 2
 filesharing: setOn : 3
 filesharing: setOn : 2
 filesharing: setOn : 3
 filesharing: setOn : 2
 filesharing: setOn : 3
 filesharing: When run by root:
 smbpasswd [options] [username]
 smbpasswd [options]

 -L local mode (must be first option)
 -h print this usage message
 -s use stdin for password prompt
 -c smb.conf file Use the given path to the smb.conf file
 -D LEVEL debug level
 -r MACHINE remote machine
 -U USER remote username

 extra options when run by root or in local mode:
 -a add user
 -d disable user
 -e enable user
 -i interdomain trust account
 -m machine trust account
 -n set no password
 -W use stdin ldap admin password
 -w PASSWORD ldap admin password
 -x delete user
 -R ORDER name resolve order

 filesharing: setOn : 2
 filesharing: setOn : 3

Looks like the smbpasswd command does not work properly when called from kcontrol but it seem to work nice when called from my temp script.