Bug 94828

Summary: kcmsamba forgets newly added samba user
Product: kcontrol Reporter: Sabourin Gilles <sabourin.gilles>
Component: kcmsambaAssignee: Jan Schaefer <j_schaef>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: cimmino.marco, darkvision, ewoerner, ivanmaglica, maikoherajin, mmodem00
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: fixes bug when unable to add samba user, and another bug when unable to add samba user to a user list of a share

Description Sabourin Gilles 2004-12-10 17:54:48 UTC
Version:            (using KDE KDE 3.3.2)
Installed from:    SuSE RPMs
OS:                Linux

In KDE configuration control center, I have added my personal UNIX account into samba user list to be able to browse shared directories on the local server.

Next time, I came back into users tab. I could not see my account into samba users list. Only root user was left.

samba security level is " user ".
Comment 1 Markus Mauder 2005-04-03 16:41:21 UTC
I can reproduce this problem with KDE 3.4.0 (kubuntu)

Also, I want to add that when I add a user, apply remains disabled. This is not a problem for any other setting in this particular module, so I thought it might be related.

Thanks for this module. It's tools like this that make Linux easy to use.
Comment 2 Benjamin Bach 2005-10-09 13:28:16 UTC
I can completely confirm this. Actually I've never seen this particular feature work and I've tested it in every new KDE version since 3.3.x. Using "smbpasswd -a" from command line works no problem. The user also shows up in kcmsamba.
Comment 3 Sebastien ROHAUT 2006-05-27 09:16:58 UTC
Excactly the seame problem in KDE 3.5.1 and 3.5.2 (SUSE 10.1). Users are not added to /etc/samba/smbpasswd file and I have to use the smbpasswd command. 

I don't know if it's the same problem but you cannot modify the "passwd chat" field in advanced security options.

i hope this will be corrected soon because there is a long time this bug is present...
Comment 4 Markus 2007-02-11 18:19:37 UTC
Hi...

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:
=>kdenetwork/filesharing/advanced/kcm_sambaconf/smbpasswdfile.cpp


  KProcess p;
  p << "smbpasswd" << "-a" << user.name; 

  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:

#!/bin/sh
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:


 kcontrol
 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.
 Server role: ROLE_STANDALONE
 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]
 otherwise:
 smbpasswd [options]
 
 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:
 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. 

Markus
Comment 5 Markus 2007-02-11 18:41:41 UTC
P.S.

Sorry... i posted the wrong smbdebug script:

#!/bin/sh
echo "$0" >/root/LOGFILE
echo "$1" >>/root/LOGFILE
echo "$2" >>/root/LOGFILE
echo "$3" >>/root/LOGFILE
echo "$4" >>/root/LOGFILE
echo "$5" >>/root/LOGFILE
echo "$3" >/root/PASSWD
echo "$4" >>/root/PASSWD
smbpasswd -a $2 <</root/PASSWD

Sorry for that. But here is the output from kcontrol after using this script:

kcontrol
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.
Server role: ROLE_STANDALONE
filesharing: setOn : 2
filesharing: setOn : 3
filesharing: setOn : 2
filesharing: setOn : 3
filesharing: setOn : 2
filesharing: setOn : 3
New SMB password:
Retype new SMB password:
filesharing: Added user slacker.
filesharing:
filesharing: setOn : 2
filesharing: setOn : 3

Markus
Comment 6 Markus 2007-02-11 18:55:33 UTC
I just see that "Platform" of this bug is set to "SuSE RPMs"... i compiled KDE 3.5.6 from source on Slackware 11.0/Samba 3.0.23c. Just in case that this could be helpful to solve that issue.

Markus
Comment 7 Marco Cimmino 2007-04-01 10:20:50 UTC
Bug present also under kununtu 6.10 Edgy with KDE 3.5.6, any chance to have fixed for the last kde 3.5.7?
Comment 8 Marco Cimmino 2007-04-01 10:21:23 UTC
*** This bug has been confirmed by popular vote. ***
Comment 9 Maiko Herajin 2007-05-29 04:50:17 UTC
I have the same problem as well. This may also be related to an issue where clicking to add users to a share brings up a list of blank users. Only through the advanced button can users be added.

I can't believe this isn't a problem or a priority for anyone other than us, considering it's been around since 2005!
Comment 10 Jan Schaefer 2007-12-31 16:51:31 UTC
Sorry, the bug has been assigned to Alexander Neundorf, but I am the responsible developer. It seems that Alexander has overseen this and did not complain. 
Comment 11 Jan Schaefer 2008-01-01 21:01:04 UTC
*** Bug 137685 has been marked as a duplicate of this bug. ***
Comment 12 Jan Schaefer 2008-01-03 09:01:19 UTC
*** Bug 132557 has been marked as a duplicate of this bug. ***
Comment 13 Marco Cimmino 2008-02-08 16:33:23 UTC
is there a way to get this fixed for 3.5.9? Is 4 years old :(
Comment 14 Jan Schaefer 2008-02-18 09:35:32 UTC
No it will not be fixed in 3.5.9, I am sorry. The bug is more difficult to fix then expected. 
Comment 15 Jan Schaefer 2008-05-10 16:02:19 UTC
*** Bug 139623 has been marked as a duplicate of this bug. ***
Comment 16 Vladislav Belov 2008-10-22 21:35:20 UTC
Created attachment 28068 [details]
fixes bug when unable to add samba user, and another bug when unable to add samba user to a user list of a share

This patch fixes two bugs in samba kcontrol module.
The first one: it was impossible to add new samba user.
The second one: it was impossible to add samba users to a list of (for example rejected) users of a share.
Comment 17 Eckhart W├Ârner 2010-10-05 01:22:33 UTC
What's the status of this bug? A patch has been proposed in 2008, since then no reaction.
Comment 18 Andrew Crouthamel 2018-09-04 18:07:31 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I am closing this bug. Kcontrol has been replaced by System Settings in Plasma. Please give the latest version of that a try, and open a new bug in "systemsettings" if you continue to have an issue. Thank you!