Bug 24377 - User group replaced by live after system installation from 7beta2 Live isos
Summary: User group replaced by live after system installation from 7beta2 Live isos
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal enhancement
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-17 10:02 CET by Len Lawrence
Modified: 2019-02-19 14:15 CET (History)
4 users (show)

See Also:
Source RPM: draklive-install (?)
CVE:
Status comment:


Attachments
Journal file from Xf86 Live installation (27.78 KB, application/octet-stream)
2019-02-17 12:52 CET, Len Lawrence
Details

Description Len Lawrence 2019-02-17 10:02:22 CET
Description of problem:
In the latest 7beta2 Live isos, creating a user to match an existing one causes the ownership of all existing user files to switch to user:live where live has a gid of 1000.  There is no "user" group in /etc/group, only live. Editing /etc/group to rectify this switches all ownerships of user files to user:user.

I get the impression that this fault causes difficulties with automounting user's removable devices.


Version-Release number of selected component (if applicable):
Mageia 7 beta2 round 3

How reproducible:
Have seen it several times so probably always.

Steps to Reproduce:
1. Either boot from Live iso and install from live session or install from boot menu.
2. In user directory after reboot execute
   $ ls -al
3. All entries will have 'user live' in the ownership fields.  e.g.
   $ ll
   drwxrwxr-x   6 lcl live     4096 May 27  2018 'VirtualBox VMs'/
   -rw-r--r--   1 lcl live    14670 Oct  2  2015 xyz.odt
   $ grep lcl /etc/group
   $
   $ grep live /etc/group
   live:x:1000:
Comment 1 Martin Whitaker 2019-02-17 10:49:16 CET
As root in a terminal, please run

  journalctl -b 2 > journal.log

and attach the resulting log file.

CC: (none) => mageia

Comment 2 Len Lawrence 2019-02-17 12:52:27 CET
Created attachment 10753 [details]
Journal file from Xf86 Live installation

# journalctl -b 2
Not sure how far back we need to go.  -3 and -4 are available.
Comment 3 Martin Whitaker 2019-02-17 16:06:15 CET
That's the one I needed. "-b 2" is the second boot from the start of the journal, which is the first boot after the install.

Looking in the log, the problem appears to be:

Feb 16 22:26:16 localhost drakx-installer-xsetup[1800]: usermod: directory /home/lcl exists

Did you by any chance create that directory before running the install?
Comment 4 Len Lawrence 2019-02-17 17:05:06 CET
Yes, lcl is me, on my home partition, which is usually a separate disk.   Have never tried creating a new user during these test installations.

So, we can infer that when installing from Live media we should either accept that some manipulation may be required at first login or else create an entirely new user?  In which case this is not a bug at all, but a feature.

Case closed?
Comment 5 Len Lawrence 2019-02-17 17:08:13 CET
On a later installation of Plasma Live the journal shows:
Feb 17 15:41:10 markab usermod[2529]: change user name 'live' to 'lcl'
Feb 17 15:41:10 markab usermod[2529]: change user 'lcl' home from '/home/live' to '/home/lcl'
Feb 17 15:41:10 markab finish-install[1922]: symlinked file /home/lcl to /home/live
Feb 17 15:41:10 markab finish-install[1922]: running: grep -D skip -rl /home/live /home/lcl/.??* | while read f; do perl -pi -e 's,/home/live,/home/lcl,g' "$f"; done
Comment 6 Len Lawrence 2019-02-17 17:10:29 CET
And I suppose it does make sense to create a new user during testing to put the system throgh its paces.
Comment 7 Martin Whitaker 2019-02-17 17:29:11 CET
The live system starts with a single user, named "live". When you install the live system, on reboot it attempts to rename that user to the name you provide, thus preserving any changes you may have made when running the live system. Of course, to people who use the classical installer, this behaviour isn't what they are used to...

Open to suggestions as to what we should do here. Maybe, if a home directory for the given name exists, just add that user and leave the old "live" user as is?
Comment 8 Len Lawrence 2019-02-17 17:48:03 CET
Yes, maybe, but creating users, apart from 'live', should be part of the testing process.  That obviously does not apply to non-testers.  By 'add that user' do you mean offering the name as a default in the 'user' field so that he/she is recreated in /etc/passwd and /etc/group?  Sounds OK to me.  'live' user would not be touched.

On second thoughts - what if there are several existing users - then you would need multiple choice.  Getting too complicated.
Comment 9 Len Lawrence 2019-02-17 17:54:21 CET
You don't want to mess with existing dialogues.  Simplest would be to add a stanza to ask "New or existing user?", maybe.
Comment 10 Len Lawrence 2019-02-17 18:04:40 CET
No, your original idea would fit the bill.  Check the name entered against existing home directories.  Leave 'live' as is and proceed as with classical install.
Comment 11 Len Lawrence 2019-02-17 19:10:26 CET
Muddy thinking again (mea culpa).  No need to distinguish between "new user" and "live"; basically the same thing.
Comment 12 Marja Van Waes 2019-02-19 08:56:25 CET
(In reply to Martin Whitaker from comment #7)
> The live system starts with a single user, named "live". When you install
> the live system, on reboot it attempts to rename that user to the name you
> provide, thus preserving any changes you may have made when running the live
> system. Of course, to people who use the classical installer, this behaviour
> isn't what they are used to...

So it's draklive-install that's the culprit, right?
> 
> Open to suggestions as to what we should do here. Maybe, if a home directory
> for the given name exists, just add that user and leave the old "live" user
> as is?

Sounds good to me.

CC: sysadmin-bugs => isobuild, marja11
Keywords: (none) => 7beta2
Assignee: bugsquad => mageiatools
Source RPM: (none) => draklive-install (?)
Component: Release (media or process) => RPM Packages

Comment 13 Dave Hodgins 2019-02-19 14:15:02 CET
The live iso images are intended for clean installs only.

This is stated at https://wiki.mageia.org/en/Installation_Media#Live_mode

It would be nice, as an enhancement to the installer, adding a warning the that
overwriting existing files will occur, if /home is not empty, that would be for
Mageia 8.

Changing the severity to enhancement.

Severity: major => enhancement
CC: (none) => davidwhodgins


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