Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 886147

Summary: acct-user.eclass: doesn't set the home dir to the correct user:group when user removed and installed again
Product: Gentoo Linux Reporter: Ryan Tsien <i>
Component: EclassesAssignee: Michał Górny <mgorny>
Status: RESOLVED FIXED    
Severity: normal CC: floppym
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/28744
https://bugs.gentoo.org/show_bug.cgi?id=908511
Whiteboard:
Package list:
Runtime testing required: ---

Description Ryan Tsien 2022-12-15 15:21:02 UTC
When an installed acct-user removes, the user will be kept while the empty home dir will be removed.

Then if I install this acct-user again, the new created home dir will not be set to the current acct-user:group automatically.

The eclass will exit the `acct-user_pkg_preinst` function when an existing user detected:

```
 if egetent passwd "${ACCT_USER_NAME}" >/dev/null; then
     elog "User ${ACCT_USER_NAME} already exists"
     return
 fi
```

I think the owner of the new created home dir should be set to the installed acct-user:group.

Reproducible: Always
Comment 1 Larry the Git Cow gentoo-dev 2022-12-25 22:10:43 UTC
The bug has been closed via the following commit(s):

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

commit 22e986ce87b4f983e9508803b83466c5183cde65
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-12-21 19:44:58 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-12-25 22:10:41 +0000

    acct-user.eclass: always fix homedir permissions in pkg_preinst
    
    Closes: https://bugs.gentoo.org/886147
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/acct-user.eclass | 51 ++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 26 deletions(-)