This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 473191 - firstboot fails when reusing home directory if immutable file encountered
firstboot fails when reusing home directory if immutable file encountered
Product: Fedora
Classification: Fedora
Component: firstboot (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Lumens
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-11-26 19:32 EST by Jason Farrell
Modified: 2008-12-09 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-12-09 13:34:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
traceback (889 bytes, text/plain)
2008-11-26 19:33 EST, Jason Farrell
no flags Details

  None (edit)
Description Jason Farrell 2008-11-26 19:32:46 EST
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):

How reproducible:

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:
os.path.walk("/home/%s" % username, _chown, (uidNumber, gidNumber))
Comment 1 Jason Farrell 2008-11-26 19:33:46 EST
Created attachment 324812 [details]
Comment 2 Chris Lumens 2008-12-09 10:29:07 EST
Okay, I'll address point (1) in this bug. Point (2) is already covered by bug 470461.
Comment 3 Chris Lumens 2008-12-09 13:34:52 EST
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 17:12:58 EST
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.