Bug 494575 - RFE: add usermod switch - prevent calling restorecon
RFE: add usermod switch - prevent calling restorecon
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: shadow-utils (Show other bugs)
5.3
All Linux
low Severity low
: rc
: ---
Assigned To: Peter Vrabec
BaseOS QE
: FutureFeature
: 458143 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-07 10:12 EDT by Matěj Šusta
Modified: 2012-12-03 04:55 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-30 04:14:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matěj Šusta 2009-04-07 10:12:04 EDT
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 05:20:35 EDT
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 08:24:23 EDT
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 16:41:36 EDT
*** Bug 458143 has been marked as a duplicate of this bug. ***
Comment 9 errata-xmlrpc 2010-03-30 04:14:18 EDT
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

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