Bug 622320
Summary: | useradd reports 'operation not supported' for /home/USER/.gnome2 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Aaron Faanes <dafrito> | ||||||
Component: | shadow-utils | Assignee: | Peter Vrabec <pvrabec> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 13 | CC: | kevin, mjhammel, pvrabec, tmraz | ||||||
Target Milestone: | --- | Keywords: | Reopened | ||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | shadow-utils-4.1.4.2-11.fc14 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2011-02-13 08:53:03 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
$ su -c 'useradd newuser' Password: $ id newuser uid=504(newuser) gid=504(newuser) groups=504(newuser) $ rpm -q shadow-utils shadow-utils-4.1.4.2-8.fc12.x86_64 $ rpm -qf /bin/su coreutils-7.6-11.fc12.x86_64 Sorry I can't reproduce the problem. If it persists feel free to reopen the bug. This bug is still in F14 but I don't have permission to reopen this bug. It is most likely the same one as Bug 648018. The problem is that when adding a new user with useradd the files from /etc/skel are not copied into the new users home directory because of the encountered error. In my case, the error is slightly different: mjhammel(tty57)$ sudo useradd -c"Matlab User" -d/home/matlab -m -s/bin/bash -g3139 matlab useradd: preserving permissions for /home/matlab/.mozilla: Operation not supported The .mozilla directory is copied to the new users home but none of the rest of the /etc/skel files have been copied into that directory. mjhammel(tty57)$ sudo ls -al /home/matlab total 16 drwx------ 3 matlab matlab 4096 Dec 9 10:13 . drwxr-xr-x. 15 root root 4096 Dec 9 10:13 .. drwxr-xr-x 2 matlab matlab 4096 Dec 9 10:13 .mozilla Running strace on the binary shows the following: access("/etc/skel", F_OK) = 0 access("/home/matlab", F_OK) = 0 open("/etc/skel", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 10 getdents(10, /* 8 entries */, 32768) = 248 lstat("/etc/skel/.mozilla", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 mkdir("/home/matlab/.mozilla", 040755) = 0 chown("/home/matlab/.mozilla", 3139, 3139) = 0 stat("/etc/skel/.mozilla", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 getxattr("/etc/skel/.mozilla", "system.posix_acl_access", 0x7fffc5542350, 132) = -1 ENODATA (No data available) stat("/etc/skel/.mozilla", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 setxattr("/home/matlab/.mozilla", "system.posix_acl_access", "\x02\x00\x00\x00\x01\x00\x07\x00\xff\xff\xff\xff\x04\x00\x05\x00\xff\xff\xff\xff \x00\x05\x00\xff\xff\xff\xff", 28, 0) = -1 EOPNOTSUPP (Operation not supported) chmod("/home/matlab/.mozilla", 040755) = 0 getxattr("/etc/skel/.mozilla", "system.posix_acl_default", 0x7fffc5542350, 132) = -1 ENODATA (No data available) stat("/etc/skel/.mozilla", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 removexattr("/home/matlab/.mozilla", "system.posix_acl_default") = -1 EOPNOTSUPP (Operation not supported) write(2, "useradd: ", 9) = 9 write(2, "preserving permissions for /home"..., 48) = 48 write(2, ": ", 2) = 2 write(2, "Operation not supported\n", 24) = 24 Is it possible this is related to the fact that I don't have SELinux enabled? If not, why are we looking for extended attributes (ACL related, apparently) on these files? Since there are no extended attributes the ENOTSUP should not cause the process to fail, but apparently it does. My system is F14 x86-64: mjhammel(tty57)$ rpm -qf /usr/sbin/useradd shadow-utils-4.1.4.2-8.fc14.x86_64 Peter's version of useradd is the same but on different Fedora releases (12 vs 13/14). Looks like F12 worked but anything after that broke. At least for some people. The workaround is to make the directory manually and then copy in the skeleton files manually: mkdir /home/blah cp -ar /etc/skel/.{a-z}* /home/blah Then change the owner/group manually: chown -R <userid>.<groupid> /home/blah Created attachment 477867 [details]
updated ACL patch
this updated solution basically ignore EOPNOTSUPP from
perm_copy_file/perm_copy_fd on both levels:
1. error message is not printed
2. return code == 0
shadow-utils-4.1.4.2-11.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/shadow-utils-4.1.4.2-11.fc14 shadow-utils-4.1.4.2-11.fc14 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update shadow-utils'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/shadow-utils-4.1.4.2-11.fc14 shadow-utils-4.1.4.2-11.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report. |
Created attachment 437490 [details] Output demonstrating this bug Description of problem: Version-Release number of selected component (if applicable): shadow-utils-4.1.4.2-8.fc13.x86_64 How reproducible: 100% Steps to Reproduce: 1. su -c 'useradd newuser' Actual results: useradd: preserving permissions for /home/maid/.gnome2: Operation not supported Expected results: no output Additional info: This appears to be a regression from shadow-utils-4.1.4.2-5.fc13.x86_64, as 'yum downgrade' fixes this issue.