Bug 494575

Summary: RFE: add usermod switch - prevent calling restorecon
Product: Red Hat Enterprise Linux 5 Reporter: Matěj Šusta <msusta>
Component: shadow-utilsAssignee: Peter Vrabec <pvrabec>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: low Docs Contact:
Priority: low    
Version: 5.3CC: dwalsh, jbnance, mmalik, ohudlick, rrakus, sgrubb, tmraz
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 08:14:18 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:

Description Matěj Šusta 2009-04-07 14:12:04 UTC
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.

How reproducible:
1. adduser test
2. rm -rf /home/test
3. usermod -d '/' test

Actual results:
/sbin/restorecon:  stat error on /home/test:  No such file or directory
usermod: warning: unable to relabel the homedir /home/test for test.

Expected:
It would be nice to have switch, that prevents usermod from calling restorecon.

Comment 1 Peter Vrabec 2009-04-08 09:20:35 UTC
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?

Comment 2 Daniel Walsh 2009-04-08 12:24:23 UTC
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
restorecon /home/USER

Comment 4 Subhendu Ghosh 2009-10-24 20:41:36 UTC
*** Bug 458143 has been marked as a duplicate of this bug. ***

Comment 9 errata-xmlrpc 2010-03-30 08:14:18 UTC
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.

http://rhn.redhat.com/errata/RHBA-2010-0209.html