Red Hat Bugzilla – Bug 494575
RFE: add usermod switch - prevent calling restorecon
Last modified: 2012-12-03 04:55:55 EST
Description of problem:
usermod is calling restorecon everytime you try to change user's homedir.
This causes error, because restorecon don't like files, that don't exist.
1. adduser test
2. rm -rf /home/test
3. usermod -d '/' test
/sbin/restorecon: stat error on /home/test: No such file or directory
usermod: warning: unable to relabel the homedir /home/test for test.
It would be nice to have switch, that prevents usermod from calling restorecon.
According to my last discussion with Dan Walsh I have a feeling that it might by worth to remove restorecon from usermod at all. Am I right Dan?
Yes I think that moving forward the genhomedircon should be removed from this code and restorecon should only be called when the HOMEDIR is newly created.
cp /etc/skel /home/USER
chmod UID:GID /home/USER
*** Bug 458143 has been marked as a duplicate of this bug. ***
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.