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: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 6
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mike Rambo
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 21333
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-11 13:58 CET by Mike Rambo
Modified: 2018-01-11 19:50 CET (History)
8 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

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

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...

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