[Samba] Problem with "add user script"

Jacob Martinson jmartinson at indigopool.com
Tue Oct 21 16:27:15 GMT 2003


I just realized the strace attachment didn't go through.  It looks like
smbpasswd exits as soon as it doesn't find a local account in
/etc/passwd, not even attempting to add the account with the add user
script...

execve("/usr/local/samba/bin/smbpasswd", ["smbpasswd", "-a", "testuser"], [/* 24 vars */]) = 0
uname({sys="Linux", node="kobe", ...})  = 0
brk(0)                                  = 0x8124be8
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/mmx/libcups.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i686/mmx", 0xbfffeec0) = -1 ENOENT (No such file or directory)
open("/usr/lib/i686/libcups.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i686", 0xbfffeec0)     = -1 ENOENT (No such file or directory)
open("/usr/lib/mmx/libcups.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/mmx", 0xbfffeec0)      = -1 ENOENT (No such file or directory)
open("/usr/lib/libcups.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000%\4\000"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0555, st_size=1246408, ...}) = 0
old_mmap(NULL, 927172, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40013000
mprotect(0x400e4000, 71108, PROT_NONE)  = 0
old_mmap(0x400e4000, 57344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xd0000) = 0x400e4000
old_mmap(0x400f2000, 13764, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x400f2000
close(3)                                = 0
open("/usr/lib/libnsl.so.1", O_RDONLY)  = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=41246, ...}) = 0
old_mmap(NULL, 41246, PROT_READ, MAP_PRIVATE, 3, 0) = 0x400f6000
close(3)                                = 0
open("/lib/libnsl.so.1", O_RDONLY)      = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340:\0"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=90444, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40101000
old_mmap(NULL, 84576, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40102000
mprotect(0x40114000, 10848, PROT_NONE)  = 0
old_mmap(0x40114000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12000) = 0x40114000
old_mmap(0x40115000, 6752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40115000
close(3)                                = 0
open("/usr/lib/libdl.so.2", O_RDONLY)   = -1 ENOENT (No such file or directory)
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\30"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=11314, ...}) = 0
old_mmap(NULL, 11304, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40117000
mprotect(0x40119000, 3112, PROT_NONE)   = 0
old_mmap(0x40119000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x40119000
close(3)                                = 0
open("/usr/lib/libcrypt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libcrypt.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\n\0"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=22351, ...}) = 0
old_mmap(NULL, 182044, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4011a000
mprotect(0x4011f000, 161564, PROT_NONE) = 0
old_mmap(0x4011f000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x4000) = 0x4011f000
old_mmap(0x40120000, 157468, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40120000
close(3)                                = 0
open("/usr/lib/libpopt.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\23"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=33065, ...}) = 0
old_mmap(NULL, 29748, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40147000
mprotect(0x4014e000, 1076, PROT_NONE)   = 0
old_mmap(0x4014e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x6000) = 0x4014e000
close(3)                                = 0
open("/usr/lib/libc.so.6", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/lib/i686/libc.so.6", O_RDONLY)   = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220Y\1"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1395734, ...}) = 0
old_mmap(0x42000000, 1239844, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x42000000
mprotect(0x42126000, 35620, PROT_NONE)  = 0
old_mmap(0x42126000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x126000) = 0x42126000
old_mmap(0x4212b000, 15140, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4212b000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4014f000
mprotect(0x40013000, 856064, PROT_READ|PROT_WRITE) = 0
mprotect(0x40013000, 856064, PROT_READ|PROT_EXEC) = 0
munmap(0x400f6000, 41246)               = 0
getuid32()                              = 0
time(NULL)                              = 1066235794
brk(0)                                  = 0x8124be8
brk(0x8125be8)                          = 0x8125be8
brk(0x8126000)                          = 0x8126000
open("/etc/localtime", O_RDONLY)        = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1279, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x400f6000
read(3, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\5\0"..., 4096) = 1279
close(3)                                = 0
munmap(0x400f6000, 4096)                = 0
gettimeofday({1066235794, 206381}, NULL) = 0
stat64("/usr/local/samba/lib/smb.conf", {st_mode=S_IFREG|0644, st_size=1013, ...}) = 0
open("/usr/local/samba/lib/smb.conf", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1013, ...}) = 0
read(3, "[global]\n   server string=Samba "..., 1013) = 1013
close(3)                                = 0
stat64("/usr/local/samba/lib/codepages/codepage.850", {st_mode=S_IFREG|0644, st_size=132, ...}) = 0
open("/usr/local/samba/lib/codepages/codepage.850", O_RDONLY|O_LARGEFILE) = 3
read(3, "\1\0R\3|\0\0\0", 8)            = 8
read(3, "\205\267\1\1\240\265\1\1\203\266\1\1\306\307\1\1\204\216"..., 124) = 124
close(3)                                = 0
stat64("/usr/local/samba/lib/codepages/unicode_map.850", {st_mode=S_IFREG|0644, st_size=131614, ...}) = 0
open("/usr/local/samba/lib/codepages/unicode_map.850", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=131614, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x400f6000
read(3, "\1\200850\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\0"..., 4096) = 4096
mmap2(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40150000
read(3, "_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0"..., 126976) = 126976
read(3, "_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0"..., 4096) = 542
close(3)                                = 0
munmap(0x400f6000, 4096)                = 0
stat64("/usr/local/samba/lib/codepages/unicode_map.ISO8859-1", {st_mode=S_IFREG|0644, st_size=131614, ...}) = 0
open("/usr/local/samba/lib/codepages/unicode_map.ISO8859-1", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=131614, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x400f6000
read(3, "\1\200ISO8859-1\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\0\2\0\0"..., 4096) = 4096
brk(0x8127000)                          = 0x8127000
mmap2(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40171000
read(3, "_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0"..., 126976) = 126976
read(3, "_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0_\0"..., 4096) = 542
close(3)                                = 0
munmap(0x400f6000, 4096)                = 0
geteuid32()                             = 0
getuid32()                              = 0
open("/usr/local/samba/private/secrets.tdb", O_RDWR|O_CREAT|O_LARGEFILE, 0600) = 3
fcntl64(3, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0, len=1}, 0xbffff4a0) = 0
fcntl64(3, F_SETLK64, {type=F_WRLCK, whence=SEEK_SET, start=4, len=1}, 0xbffff4a0) = 0
read(3, "TDB file\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 168) = 168
fstat64(3, {st_mode=S_IFREG|0600, st_size=696, ...}) = 0
mmap2(NULL, 696, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0x400f6000
_llseek(3, 40, [40], SEEK_SET)          = 0
write(3, "\0\0\0\0", 4)                 = 4
fcntl64(3, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=4, len=1}, 0xbffff4a0) = 0
fcntl64(3, F_SETLKW64, {type=F_RDLCK, whence=SEEK_SET, start=4, len=1}, 0xbffff4a0) = 0
fcntl64(3, F_SETLKW64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=1}, 0xbffff4a0) = 0
rt_sigaction(SIGINT, {SIG_IGN}, NULL, 8) = 0
open("/dev/tty", O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, SNDCTL_TMR_CONTINUE, {B38400 opost isig icanon -echo ...}) = 0
write(4, "New SMB password:", 17)       = 17
read(4, "a", 1)                         = 1
read(4, "s", 1)                         = 1
read(4, "d", 1)                         = 1
read(4, "f", 1)                         = 1
read(4, "\n", 1)                        = 1
ioctl(4, SNDCTL_TMR_START, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
close(4)                                = 0
rt_sigaction(SIGINT, {SIG_DFL}, NULL, 8) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x400f7000
write(1, "\n", 1)                       = 1
rt_sigaction(SIGINT, {SIG_IGN}, NULL, 8) = 0
open("/dev/tty", O_RDWR|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, SNDCTL_TMR_CONTINUE, {B38400 opost isig icanon -echo ...}) = 0
write(4, "Retype new SMB password:", 24) = 24
read(4, "a", 1)                         = 1
read(4, "s", 1)                         = 1
read(4, "d", 1)                         = 1
read(4, "f", 1)                         = 1
read(4, "\n", 1)                        = 1
ioctl(4, SNDCTL_TMR_START, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
close(4)                                = 0
rt_sigaction(SIGINT, {SIG_DFL}, NULL, 8) = 0
write(1, "\n", 1)                       = 1
socket(PF_UNIX, SOCK_STREAM, 0)         = 4
connect(4, {sin_family=AF_UNIX, path="/var/run/.nscd_socket"}, 110) = -1 ENOENT (No such file or directory)
close(4)                                = 0
open("/etc/nsswitch.conf", O_RDONLY)    = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1686, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x400f8000
read(4, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1686
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x400f8000, 4096)                = 0
open("/usr/lib/libnss_files.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=41246, ...}) = 0
old_mmap(NULL, 41246, PROT_READ, MAP_PRIVATE, 4, 0) = 0x40192000
close(4)                                = 0
open("/lib/libnss_files.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\35\0\000"..., 1024) = 1024
fstat64(4, {st_mode=S_IFREG|0755, st_size=42657, ...}) = 0
brk(0x8128000)                          = 0x8128000
old_mmap(NULL, 39448, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4019d000
mprotect(0x401a6000, 2584, PROT_NONE)   = 0
old_mmap(0x401a6000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x8000) = 0x401a6000
close(4)                                = 0
munmap(0x40192000, 41246)               = 0
open("/etc/passwd", O_RDONLY)           = 4
fcntl64(4, F_GETFD)                     = 0
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=2422, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x400f8000
read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 2422
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x400f8000, 4096)                = 0
write(2, "User testuser does not exist in "..., 130) = 130
write(2, "Failed to modify password entry "..., 50) = 50
munmap(0x400f7000, 4096)                = 0
_exit(1)                                = ?

On Mon, 2003-10-20 at 14:32, Jacob Martinson wrote:
> Problem - smbpasswd does not seem to be recognizing my "add user script"
> option to automatically create Unix users when adding a samba user.
> 
> I am running Samba version 2.2.8a (from source) on a Linux (Redhat 8.0)
> system.
> 
> Relevant lines from smb.conf:
> 
> [global]
>    server string=Samba Server
>    netbios name = smbpdc
>    security = user  
>    domain logons=yes
>    domain master = yes
>    encrypt passwords=yes
>    workgroup=TESTDOM
>    guest account = smbnobody
>    hosts allow = 127. xxx.xxx.xxx.
>    add user script=/usr/sbin/useradd -d /dev/null -g 100 -s /bin/false
> -M %u
>    domain admin group = root @domadmin
> 
> The add user script line in smb.conf is contained within a single line.
> 
> I have attached the strace output of smbpasswd when trying to add a new
> user.  This is the output at the shell:
> 
> root at kobe:/usr/local/samba
> 0 $ smbpasswd -a testuser
> New SMB password:
> Retype new SMB password:
> User testuser does not exist in system password file (usually
> /etc/passwd). Cannot add account without a valid local system user.
> Failed to modify password entry for user testuser
> 
> Running "testparm" does not indicate any problems that I can see and the
> add user script section is repeated there just as it is in the smb.conf
> as noted above.
> 
> root at kobe:/usr/local/samba
> 0 $  testparm
> Load smb config files from /usr/local/samba/lib/smb.conf
> Processing section "[netlogon]"
> Processing section "[homes]"
> Processing section "[printers]"
> Processing section "[print$]"
> Loaded services file OK.
> Press enter to see a dump of your service definitions
> 
> Does anyone see a problem with my setup?  Any input is greatly
> appreciated.
> 
> Thanks!!!
> 
> -Jacob
> ----
> 

> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba





More information about the samba mailing list