Red Hat Bugzilla – Bug 473191
firstboot fails when reusing home directory if immutable file encountered
Last modified: 2008-12-09 17:12:58 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):
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
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.
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
The offending code appears to be at:
os.path.walk("/home/%s" % username, _chown, (uidNumber, gidNumber))
Created attachment 324812 [details]
Okay, I'll address point (1) in this bug. Point (2) is already covered by bug 470461.
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.
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.