Description of problem: useradd crashes here during later installation of webalizer in the adduser step. Version-Release number of selected component (if applicable): shadow-utils-4.0.3-6 How reproducible: Always Steps to Reproduce: 1./usr/sbin/adduser -c "test" -u 700-s /sbin/nologin -r -d /tmp/test test Actual Results: segfaulting Expected Results: not segfaulting Additional info: Looks like this is a different issue than #86490 # strace -s 512 /usr/sbin/adduser -c "test" -u 700-s /sbin/nologin -r -d /tmp/test test Last strace lines: open("/var/log/faillog", O_RDWR) = -1 ENOENT (No such file or directory) open("/var/log/lastlog", O_RDWR) = 9 lseek(9, 204400, SEEK_SET) = 204400 write(9, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 292) = 292 close(9) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ gdb: This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols found)... Core was generated by `/usr/sbin/adduser -c test -u 700 -s /sbin/nologin -r -d /tmp/test test'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib/libsafe.so.2...done. Loaded symbols for /lib/libsafe.so.2 Reading symbols from /lib/libcrypt.so.1...done. Loaded symbols for /lib/libcrypt.so.1 Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libnss_files.so.2...done. Loaded symbols for /lib/libnss_files.so.2 #0 0x400be0a4 in strcmp () from /lib/libc.so.6 (gdb) bt #0 0x400be0a4 in strcmp () from /lib/libc.so.6 #1 0x0804d16e in strcpy () #2 0x0804aaf3 in strcpy () #3 0x0804be78 in strcpy () #4 0x0804c55e in strcpy () #5 0x400615cd in __libc_start_main () from /lib/libc.so.6 digging through current source in useradd.c this must happen here or later: /* * Put the new (struct passwd) in the table. */ if (!pw_update (&pwent)) { fprintf (stderr, _("%s: error adding new password entry\n"), Prog); exit (E_PW_UPDATE); } It does *not* crash, if a group id of an existing group was given with option "-g $gid"
I can't reproduce this on my full RH 9 installation.
Reproduced on another system and reason found: Both systems have libsafe installed, deinstalling libsafe bring this back to work. Therefore it looks like "useradd" contain some unclean code.