Bug 3341 - "net rpc user add" Fails
"net rpc user add" Fails
Status: CLOSED WORKSFORME
Product: Samba 3.0
Classification: Unclassified
Component: net utility
3.0.21
Other Linux
: P3 normal
: none
Assigned To: Jim McDonough
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-12-20 00:17 UTC by John H Terpstra
Modified: 2005-12-20 09:34 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John H Terpstra 2005-12-20 00:17:38 UTC
Samba 3.0.21, SAMBA_3_RELEASE SVN Rel: 12289

Using tdbsam backend, execution of the following fails:
    net rpc user add snotty -S violetsblue -Uroot%not24get

Log level 10 snippet:
---------------------
[2005/12/20 00:10:48, 5] lib/username.c:Get_Pwnam_alloc(313)
  Finding user snotty
[2005/12/20 00:10:48, 5] lib/username.c:Get_Pwnam_internals(262)
  Trying _Get_Pwnam(), username as lowercase is snotty
[2005/12/20 00:10:48, 5] lib/username.c:Get_Pwnam_internals(278)
  Trying _Get_Pwnam(), username as uppercase is SNOTTY
[2005/12/20 00:10:48, 5] lib/username.c:Get_Pwnam_internals(286)
  Checking combinations of 0 uppercase letters in snotty
[2005/12/20 00:10:48, 5] lib/username.c:Get_Pwnam_internals(290)
  Get_Pwnam_internals didn't find user [snotty]!
[2005/12/20 00:10:48, 5] rpc_server/srv_samr_nt.c:_samr_create_user(2346)
  _samr_create_user:  can add this account : False
useradd: Invalid account name `’snotty’'.
[2005/12/20 00:10:48, 0] rpc_server/srv_samr_nt.c:_samr_create_user(2359)
  _samr_create_user: Running the command `/usr/sbin/useradd -m ’snotty’' gave 6
[2005/12/20 00:10:48, 5] lib/username.c:Get_Pwnam_alloc(313)
  Finding user snotty
[2005/12/20 00:10:48, 5] lib/username.c:Get_Pwnam_internals(262)
  Trying _Get_Pwnam(), username as lowercase is snotty
[2005/12/20 00:10:48, 5] lib/username.c:Get_Pwnam_internals(278)
  Trying _Get_Pwnam(), username as uppercase is SNOTTY
[2005/12/20 00:10:48, 5] lib/username.c:Get_Pwnam_internals(286)
  Checking combinations of 0 uppercase letters in snotty
[2005/12/20 00:10:48, 5] lib/username.c:Get_Pwnam_internals(290)
  Get_Pwnam_internals didn't find user [snotty]!



Execution of: /usr/sbin/useradd -m ’snotty’
works from the command line without problem.


The smb.conf file used:
-----------------------
[global]
	workgroup = ROSESARERED
	netbios name = VIOLETSBLUE
	passdb backend = tdbsam
	username map = /etc/samba/smbusers
	enable privileges = Yes
	log level = 10
	log file = /var/log/samba/%m.log
	max log size = 0
	add user script = /usr/sbin/useradd -m ’%u’
	delete user script = /usr/sbin/userdel -r ’%u’
	add group script = /usr/sbin/groupadd ’%g’
	delete group script = /usr/sbin/groupdel ’%g’
	add user to group script = /usr/sbin/usermod -G ’%g’ ’%u’
	set primary group script = /usr/sbin/usermod -g '%g' '%u'
	add machine script = /usr/sbin/useradd -s /bin/false -d /dev/null ’%u’
	logon script = scripts\logon.bat
	logon path = \\%L\profiles\%U
	logon drive = h:
	logon home = \\%L\%U
	domain logons = Yes
Comment 1 Gerald (Jerry) Carter 2005-12-20 07:23:42 UTC
I can't reproduce this.  

What is this log ?

  _samr_create_user:  can add this account : False
useradd: Invalid account name `’snotty’'.
  _samr_create_user: Running the command `/usr/sbin/useradd -m
’snotty’' gave 6

Seems that you don't have the SeAddUserPrivilege.  I'm assuming the 
`’snotty’' string is just a translation issue when posting 
the bug report.
Comment 2 John H Terpstra 2005-12-20 09:34:44 UTC
Your anaysis was correct on both counts.

- John T.