Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 689308 - acct-user.eclass: do not die during unmerge if the user does not exist
Summary: acct-user.eclass: do not die during unmerge if the user does not exist
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-05 08:12 UTC by Eray Aslan
Modified: 2019-07-05 15:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
acct-user.patch (acct-user.patch,561 bytes, patch)
2019-07-05 08:12 UTC, Eray Aslan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eray Aslan gentoo-dev 2019-07-05 08:12:40 UTC
Created attachment 581942 [details, diff]
acct-user.patch

manually deleting $user and then unmerging acct-user/$user results in:

>>> Unmerging (1 of 1) acct-user/postfix-0...
 * User does not exist, cannot set shell -- skipping.
 * User does not exist, cannot set comment -- skipping.
usermod: user 'postfix' does not exist
 * ERROR: acct-user/postfix-0::gentoo failed (prerm phase):
 *   Locking account postfix failed
[...]

I think the following behaviour is a better user experience:

>>> Unmerging (1 of 1) acct-user/postfix-0...
 * User does not exist, cannot set shell -- skipping.
 * User does not exist, cannot set comment -- skipping.
 * User does not exist, cannot lock user -- skipping.

see attached for a possible patch.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-07-05 09:14:14 UTC
Yes, that makes sense.  I suppose we can't have a cleaner implementation than that.  I'll verify it in a few minutes, and send to ml for feedback.
Comment 2 Larry the Git Cow gentoo-dev 2019-07-05 15:44:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d61d24f4818eef45f8e7ba2e4a7c508ad5bdfb43

commit d61d24f4818eef45f8e7ba2e4a7c508ad5bdfb43
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2019-07-05 10:01:39 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2019-07-05 15:44:19 +0000

    acct-user.eclass: Skip locking if account does not exist
    
    Closes: https://bugs.gentoo.org/689308
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 eclass/acct-user.eclass | 6 ++++++
 1 file changed, 6 insertions(+)