Bug 170572 - useradd does not add /etc/skel dotfiles in some situations
Summary: useradd does not add /etc/skel dotfiles in some situations
Alias: None
Product: Fedora
Classification: Fedora
Component: shadow-utils   
(Show other bugs)
Version: 3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2005-10-12 22:33 UTC by Dan Hollis
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-19 14:26:08 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Dan Hollis 2005-10-12 22:33:00 UTC
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:

Steps to Reproduce:
1.script adduser from cgi
2.run cgi
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.

Comment 1 Peter Vrabec 2005-10-13 14:51:51 UTC
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)

Comment 2 Dan Hollis 2005-10-13 20:12:24 UTC
yes, useradd run from a apache cgi script.

my mistake, this is FC3.

Comment 3 Peter Vrabec 2005-10-14 09:38:26 UTC
Could u reproduce the problem with shadow-utils from devel or FC4?

Comment 4 Dan Hollis 2005-10-19 00:34:17 UTC
is it safe to use shadow-utils from FC4 on FC3?

Comment 5 Peter Vrabec 2005-10-19 09:49:50 UTC
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`
  uid=48(apache) gid=48(apache) groups=48(apache)   
  useradd: unable to lock password file

Comment 6 Dan Hollis 2005-10-19 09:51:05 UTC
it's run via sudo

Comment 7 Peter Vrabec 2005-10-19 14:26:08 UTC
It works for me.

# ls -aR /etc/skel/
.  ..  a  .bash_logout  .bash_profile  .bashrc  .gtkrc  .kde  xxx  .zshrc

.  ..  xxx

.  ..  Autostart

.  ..  .directory

# cat skript
echo "Content-type: text/html\n\n"
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
.  ..  a  .bash_logout  .bash_profile  .bashrc  .gtkrc  .kde  xxx  .zshrc

.  ..  xxx

.  ..  Autostart

.  ..  .directory

Note You need to log in before you can comment on or make changes to this bug.