Description of problem: in some situations (scripted from cgi), useradd does not seem copy dotfiles from /etc/skel, but all other files get copied fine (eg directories). however when called from interactive shell from commandline, all files including dotfiles are copied just fine. Version-Release number of selected component (if applicable): shadow-utils 4.0.3 How reproducible: always Steps to Reproduce: 1.script adduser from cgi 2.run cgi 3. Actual results: everything _except_ dotfiles are copied successfully from /etc/skel Expected results: everything including dotfiles should be copied. Additional info: called from cgi as: /usr/sbin/useradd -d /home2/bla -u <someuserid> -g 5000 -m -s /bin/true username when called from cgi, only non-dotfiles are copied from skel. when called from interactive ssh, everything works as expected.
What do u mean by cgi? cgi script run by apache? note there is shadow-utils-4.0.12-5.FC4 in fc4 (yum update)
yes, useradd run from a apache cgi script. my mistake, this is FC3.
Could u reproduce the problem with shadow-utils from devel or FC4?
is it safe to use shadow-utils from FC4 on FC3?
There are some conflicts between FC3 and shadow-utils from FC4, but it should work when u install it with "--force" option. I still don't understand one thing. Under which user your cgi script run? It should be apache by default,but user apache is not allowed to add users. My cgi(FC4): echo `id` echo `/usr/sbin/useradd foo 2>&1` returns: uid=48(apache) gid=48(apache) groups=48(apache) context=root:system_r:httpd_sys_script_t useradd: unable to lock password file
it's run via sudo
It works for me. shadow-utils-4.0.12-5.FC4 # ls -aR /etc/skel/ /etc/skel/: . .. a .bash_logout .bash_profile .bashrc .gtkrc .kde xxx .zshrc /etc/skel/a: . .. xxx /etc/skel/.kde: . .. Autostart /etc/skel/.kde/Autostart: . .. .directory # cat skript #!/bin/bash echo "Content-type: text/html\n\n" echo echo "Hello,World." echo `id` echo `sudo useradd -d /home/foo -u 666 -g 500 -m -s /bin/true foo` # cat /etc/sudoers ... apache ALL=(ALL) NOPASSWD: ALL ... # ls -aR /home/foo /home/foo: . .. a .bash_logout .bash_profile .bashrc .gtkrc .kde xxx .zshrc /home/foo/a: . .. xxx /home/foo/.kde: . .. Autostart /home/foo/.kde/Autostart: . .. .directory