Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 886147 - acct-user.eclass: doesn't set the home dir to the correct user:group when user removed and installed again
Summary: acct-user.eclass: doesn't set the home dir to the correct user:group when use...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Michał Górny
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2022-12-15 15:21 UTC by Ryan Tsien
Modified: 2023-06-17 03:42 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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(-)