Bug 22373 - Fatal error creating user if home directory already exists and "Create home directory" is activated
Summary: Fatal error creating user if home directory already exists and "Create home d...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 6
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA6-32-OK mga6-64-ok
Keywords: advisory, has_procedure, validated_update
Depends on: 21333
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-11 13:58 CET by Mike Rambo
Modified: 2018-03-14 18:01 CET (History)
7 users (show)

See Also:
Source RPM: userdrake-2.16-1.mga6.src.rpm libuser-0.62-8.mga6.src.rpm
CVE:
Status comment:


Attachments

Description Mike Rambo 2018-01-11 13:58:38 CET
+++ This bug was initially created as a clone of Bug #21333 +++

Description of problem:
When creating a user using drakconf, a fatal error occurs if the home directory already exists and "Create home directory" is activated.

When running from Konsole I get the following output:

Error creating `/home/test': Error creating `/home/test': File already exists at /usr/libexec/drakuser line 588.
libuser fatal error: lu_mail_spool_create() called with non-NULL *error



How reproducible:
Always

Steps to Reproduce:
1. Open drakconf -> System -> Manage users
2. Create a user "testuser" and activate the option "Create home directory"
3. Remove "testuser" but do not remove home directory
4. Create "testuser" again activating the option "Create home directory"
5. Fatal error occurs.
Comment 1 Mike Rambo 2018-01-11 14:27:18 CET
Cloned from #21333 to implement the suggestions made by Thomas in #21333:C7 to Mageia 6.

Updated packages pushed for Mageia 6.

Advisory:
========================

Updated libuser and userdrake packages fixes bugs.

When creating a new user with userdrake, if a directory matching the name
supplied for the new user already exists userdrake will segfault leaving the new user created but without a home directory or mail spool. This patch fixes that by preserving the existing directory by re-naming it (appending text identifying it as a duplicate along with a date and time) if the user chooses to do so, and then proceeding to create the new home directory in the usual manner and avoiding the segfault. Ownership on the duplicate directory is also changed to root.root thus reserving the handling of security implications for an admin. This allows the new user to log in with a new, clean home directory while preserving the contents of the old directory in case data needs to be migrated. The user is also allowed to choose to not do anything with the existing directory and make different choices in how the new user account is created if they desire.

========================

Updated packages in core/updates_testing:
========================
lib64user1-0.62-8.2.mga6
lib64user-devel-0.62-8.2.mga6
libuser-0.62-8.2.mga6
libuser-ldap-0.62-8.2.mga6
libuser-python-0.62-8.2.mga6
libuser-python3-0.62-8.2.mga6

from libuser-0.62-8.2.mga6.src.rpm

perl-USER-2.17-1.mga6
userdrake-2.17-1.mga6

from userdrake-2.17-1.mga6.src.rpm

Keywords: advisory, validated_update => (none)
Assignee: bugsquad => qa-bugs

Comment 2 Thomas Backlund 2018-01-11 14:57:51 CET
If you added new strings... please update translation catalog and ask for translations on i18n
Comment 3 Mike Rambo 2018-01-11 15:29:56 CET
I'm guessing here that I've done something that is not as simple as I had thought and was not addressed in packager school. I'm not unwilling, but I don't know how to address this. Neoclust noted something wrong on the dev list too. I'm guessing I built the new version tarball in the wrong way???
Comment 4 Nicolas Lécureuil 2018-01-11 18:10:44 CET
(In reply to Mike Rambo from comment #3)
> I'm guessing here that I've done something that is not as simple as I had
> thought and was not addressed in packager school. I'm not unwilling, but I
> don't know how to address this. Neoclust noted something wrong on the dev
> list too. I'm guessing I built the new version tarball in the wrong way???

i can commit for you in the git if you want ( i just created the distro/mga6 branch ).

CC: (none) => mageia

Comment 5 Mike Rambo 2018-01-11 18:14:43 CET
That would be great. I don't know if I have rights anyway. I found three files to change. NEWS, Makefile (version), and userdrake itself with the four added lines. The change applies to both cauldron and mga6. Do you need anything more?
Mike Rambo 2018-01-11 18:58:17 CET

Assignee: qa-bugs => mrambo

Comment 6 Mike Rambo 2018-01-11 19:44:26 CET
Yuri just replied on the i18n list that he had taken care of the translations. But I think there has to be a version problem. I had assumed that this would become 2.17 and pushed the updates that way for cauldron and mga6. But it looks like userdrake is still 2.16 in git.
Comment 7 Thomas Backlund 2018-01-11 19:50:44 CET
You are expecting things to happend too fast :)

What Yuri did wat to update translation catalog:
http://gitweb.mageia.org/software/userdrake/commit/?id=a49068de12675b30832e46113a2ad922ddbedc58

So that the new lines shows up as lines to be translated.

Then he committed the ukrainian translation:
http://gitweb.mageia.org/software/userdrake/commit/?id=12971ef508d9aa1cbd3580e178e25d780a7d3661


So now please wait some days so other translators can catch up and get their translations done...

after that, update version in git, commit it, tag it and use "make dist" to roll a new tarball...

after that upload that tarball and resubmit the package with a bumped rel/subrel...
Comment 8 Rémi Verschelde 2018-03-06 12:18:04 CET
Ping. The libuser update candidate is still sitting in core/updates_testing unattended to.
Comment 9 Mike Rambo 2018-03-06 20:56:18 CET
AFAIK we're still waiting for translations.
Lewis Smith 2018-03-07 10:13:01 CET

CC: lewyssmith => (none)

Comment 10 Lewis Smith 2018-03-07 10:27:58 CET
(In reply to Rémi Verschelde from comment #8)
> Ping. The libuser update candidate is still sitting in core/updates_testing
> unattended to.
Because it is not in the MADB list of updates to test; possibly because it is not yet assigned to QA - correctly.
I tested it previously, and have:
 lib64user1-0.62-8.1.mga6
 libuser-0.62-8.1.mga6
 perl-USER-2.16-1.mga6
 userdrake-2.16-1.mga6
but see that the versions have been bumped (comment 1), and may be bumped again (c7). Once that is finalised, and it appears as an update to re-test, that will be done.
Comment 11 Thomas Backlund 2018-03-07 10:32:34 CET
(In reply to Mike Rambo from comment #9)
> AFAIK we're still waiting for translations.

Looking here:
http://gitweb.mageia.org/software/userdrake/log/

seems many have already updated..
And I think you have waited long enough so you can roll out a new tarball for and get this moving...
Comment 12 Mike Rambo 2018-03-07 19:03:12 CET
I'm pretty sure the tarball is now generated correctly so I'm finally reassigning back to QA. Only the files list at the bottom of this advisory is different from before.

Advisory:
========================

Updated libuser and userdrake packages fix bugs.

When creating a new user with userdrake, if a directory matching the name
supplied for the new user already exists userdrake will segfault leaving the new user created but without a home directory or mail spool. This patch fixes that by preserving the existing directory by re-naming it (appending text identifying it as a duplicate along with a date and time) if the user chooses to do so, and then proceeding to create the new home directory in the usual manner and avoiding the segfault. Ownership on the duplicate directory is also changed to root.root thus reserving the handling of security implications for an admin. This allows the new user to log in with a new, clean home directory while preserving the contents of the old directory in case data needs to be migrated. The user is also allowed to choose to not do anything with the existing directory and make different choices in how the new user account is created if they desire.

========================

Updated packages in core/updates_testing:
========================
lib64user1-0.62-8.2.mga6
lib64user-devel-0.62-8.2.mga6
libuser-0.62-8.2.mga6
libuser-ldap-0.62-8.2.mga6
libuser-python-0.62-8.2.mga6
libuser-python3-0.62-8.2.mga6

from libuser-0.62-8.2.mga6.src.rpm

perl-USER-2.17-1.1.mga6
userdrake-2.17-1.1.mga6

from userdrake-2.17-1.1.mga6.src.rpm


Thomas, I tried to properly fix up git too but as this is my first experience with git I don't really know if it is correct. Feel free to contact me (IRC, email) if it is found otherwise.

Assignee: mrambo => qa-bugs

Comment 13 claire robinson 2018-03-07 20:23:35 CET
Oops, queries added to linked bug 21333
Comment 14 Herman Viaene 2018-03-08 15:53:35 CET
MGA6-32 on Dell Latitude D600 Mate
No installation issues (Dutch install)
I could not replicate the initial error as I tested already the first update in bug 21333
But tried this one again in MCC: create a new user, delete that one again preserving its home, create it again: a numbered home is newly created without warning.
After this update: now when recreating the user a dialogue asks to preserve the existing home. Choosing yes creates a xxxxrenamed-duplicate home. The original home is the default home of the user. All OK for me.

Whiteboard: (none) => MGA6-32-OK

Comment 15 claire robinson 2018-03-09 19:22:42 CET
Advisory uploaded

Keywords: (none) => advisory, has_procedure

Comment 16 claire robinson 2018-03-14 17:17:39 CET
Testing complete mga6 64

Confirmed the desired behaviour.

Validating.

Keywords: (none) => validated_update
Whiteboard: MGA6-32-OK => MGA6-32-OK mga6-64-ok

Comment 17 Mageia Robot 2018-03-14 18:01:35 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2018-0049.html

Status: NEW => RESOLVED
Resolution: (none) => FIXED


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