Bug 473191 - firstboot fails when reusing home directory if immutable file encountered
Summary: firstboot fails when reusing home directory if immutable file encountered
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: firstboot
Version: 10
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Chris Lumens
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-27 00:32 UTC by Jason Farrell
Modified: 2008-12-09 22:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-12-09 18:34:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
traceback (889 bytes, text/plain)
2008-11-27 00:33 UTC, Jason Farrell
no flags Details

Description Jason Farrell 2008-11-27 00:32:46 UTC
Description of problem:
firstboot bombs when reusing a user's home directory, doing it's long chown, when it encounters an immutable file that not even root can touch.

Version-Release number of selected component (if applicable):
firstboot-1.102-1.fc10.x86_64

How reproducible:
always

Steps to Reproduce:
1. touch /home/user/foo
2. as root:  chattr +i /home/user/foo
3. reinstall, reusing /home, and during firstboot add existing username "user"
4. when prompted to reuse the existing home directory, say yes
  
Actual results:
firstboot will spend a LONG time chown'ing everything, depending on the size of the homedir (mine is approaching 1TB), until it encounters a file that not even root can read, at which point it bails out with an uncaught permission denied exception.

Expected results:
1) Catch the exception, and inform the user of files that weren't able to be chown'd
2) Progress feedback during the long chown process.

Admittedly, immutable files in a homedir isn't a common case, but it should still be caught


Additional info:
The offending code appears to be at:
/usr/share/firstboot/modules/create_user.py:153
os.path.walk("/home/%s" % username, _chown, (uidNumber, gidNumber))

Comment 1 Jason Farrell 2008-11-27 00:33:46 UTC
Created attachment 324812 [details]
traceback

Comment 2 Chris Lumens 2008-12-09 15:29:07 UTC
Okay, I'll address point (1) in this bug. Point (2) is already covered by bug 470461.

Comment 3 Chris Lumens 2008-12-09 18:34:52 UTC
Added detection of errors when we try to chown files.  Instead of displaying them in a dialog, I log them to /tmp/firstboot-homedir-* and display a dialog informing the user to look at this file.  There are two reasons for this:  (1) The list of files could potentially be very long, (2) If we make a permanent record of the files, the user can go back and refer to it later instead of having to remember or write down the contents of the dialog.

So yeah, the immutable file case is a bit uncommon but it was certainly worth taking care of.  Thanks for the report.  The next build of firstboot will include the fix.

Comment 4 Jason Farrell 2008-12-09 22:12:58 UTC
Great - no fear for F11 then.

And yeah, it was a fluke that I had an immutable file in my homedir. Usually it's a strong sign you've been rooted, but in this case it was just a bunch of testfiles with various attributes set.


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