Bug 480632 - usermod with -u option does not check the sanity of home directory
Summary: usermod with -u option does not check the sanity of home directory
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: shadow-utils
Version: 10
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-19 15:07 UTC by Lev Shamardin
Modified: 2009-04-14 10:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-14 10:27:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Lev Shamardin 2009-01-19 15:07:26 UTC
Description of problem:
usermod when used with -u option blindly tries to change the ownership of all files in home directory to a new uid. This is not a good idea if the home directory is set to '/'.

Version-Release number of selected component (if applicable):
shadow-utils-4.0.18.1-22.fc8

How reproducible:
Always

Steps to Reproduce:
1. usermod -d / someuser
2. usermod -u 1234 someuser
  
Actual results:
Broken system.

Expected results:
Error message or warning message and no change of ownership on files.

Additional info:
I've ran into this bug by an accident while tuning a server running Fedora 8. I was fixing uid of users for compliance to a new local policy, and tried to change the uid of the user 'pulse' which had default home directory '/' on fedora 8 installation. Fortunately hit Ctrl-C just in time.

Comment 1 Peter Vrabec 2009-04-02 09:37:22 UTC
This is not a bug, but I have suggested a small change in behaviour that could help.
See upstream: 
http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2009-April/007065.html

Comment 2 Lev Shamardin 2009-04-02 09:45:30 UTC
Well, classification of such 'features' as bugs or features is a matter of philosophy.

Anyway, I completely agree with your proposed change. I would also suggest to add some option like 'force chown_tree anyway'.


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