Bug 19982 - Files in /home are destroyed during install
Summary: Files in /home are destroyed during install
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: shadow-utils
Version: 8.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Brock Organ
Keywords: Security
: 29167 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2000-10-29 07:58 UTC by vidar
Modified: 2014-01-21 22:48 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2004-05-05 03:19:42 UTC

Attachments (Terms of Use)

Description vidar 2000-10-29 07:58:21 UTC
When installing RedHat7.0 using my /home-partition from a previous install,
several files in /home/fido (fido being my username) was destroyed. The
ones I have found so far is ".bashrc" and ".emacs". The default content of
these files seems to overwrite the beginning of the existing file. Most
likely leaving the file in an incorrect state, but more importantly:
destroying the contents at the beginning of the file.

Whichever program performs this step (adduser?) should not install a
default file when a file already exists, or at the very least, back up the
old file and create a new one.

Comment 1 Michael Fulbright 2000-10-31 15:40:44 UTC
Transferring to shadow-utils package, which contains adduser.

Comment 2 Nalin Dahyabhai 2000-11-02 22:00:18 UTC
Did you select the option to create a user during installation?

Comment 3 vidar 2000-11-02 22:13:40 UTC
Yes I did choose to create the user during installation.

Comment 4 Nalin Dahyabhai 2000-11-02 22:16:39 UTC
Okay, so the account didn't exist (because the root partition was reformatted),
but shadow-utils overwrote configuration files because the home directory DID
exist, and it did so in a Very Bad way.

Comment 5 vidar 2000-11-02 22:26:34 UTC
That's correct. I would suppose this happens for the rest of the files in
/etc/skel also, but I have only found problems with these two files so far.

Comment 6 Nalin Dahyabhai 2001-03-09 06:50:16 UTC
*** Bug 29167 has been marked as a duplicate of this bug. ***

Comment 7 Seth Vidal 2001-03-09 13:12:25 UTC
I looked at the shadow utils package - and the spec file seems to say that this
package hasn't been changed in a good while. Could you test this as a problem
with adduser by adding a user dir in /home then adding a username that matches
that userdir.

And see if it munges the files.

Comment 8 Nalin Dahyabhai 2001-03-09 20:09:23 UTC
Please check if the shadow-utils-20000826-4 packages in
http://people.redhat.com/nalin/test/ fix this.  User files should no longer be
overwritten if they exist when adding users.  Files which are written are
truncated when opened, so you won't get the end of the original file tacked on
to the end of the new version of the file.

Comment 9 Seth Vidal 2001-03-10 03:47:48 UTC
That package appears to fix the problem - the RC files are not overwritten or

Comment 10 Seth Vidal 2001-03-10 04:00:57 UTC
Spoke too soon. There is still a problem. The dir is not chowned for the user.
So the user won't be able to mod the files - if the username is the same but the
uid has changed this will be a problem.

Comment 11 Alan Cox 2002-12-18 15:17:34 UTC
Still present.

Comment 12 Seth Vidal 2004-05-05 03:19:42 UTC
I'm thinking this would be reasonable to close out b/c it doesn't seem
like it's either
1. popped back up
2. going to matter.

if it happens again - open a new one, I think.

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