When installing acct-user/mythtv, it changed the home directory of an existing user mythtv on one of my machines. This was not good.
On all machines, it removed existing group memberships, also not good. I had to re-add it manually afterwards.
Since 10 years, user mythtv is the main normal user on one of my machines (dedicated mythtv machine). After installation of acct-user/mythtv, it was removed from group wheel and so I could not su anymore.
Steps to Reproduce:
1. Manually create user mythtv with group memberships
2. Install acct-user/mythtv
Home directory changed. Group memberships removed.
Leave home directory and existing group memberships alone, if the user already exists.
Did you uninstall package acct-user/mythtv at any time?
Emerge acct-user/mythtv does not alter the home directory of an existing mythtv user. Manually uninstalling acct-user removes the mythtv user. The old home directory is not deleted, but its association with mythtv user is removed. Emerge --depclean uninstalls acct-user when no installed packages depend on it.
Reinstalling/upgrading >=mythtv-30.0 does not uninstall acct-user/mythtv.
I updated the system, including mythtv (was 29.0 before). This was the first time, acct-user/mythtv was installed.
And it did change the home directory of the existing user. And it deleted group memberships.
BTW, it changed the home directory of the existing user on 2 out of 3 systems. On the 3rd one it printed something about "cannot change because in use". Maybe because I was logged in as user mythtv on the 3rd system.
Thank you for the observation. All my testing was done with a mythtv user logged in.
I will change the ebuild to check for a user named mythtv logged in or not. If found do not depend on acct-user/mythtv to insure legacy systems are not corrupted.
It did however also remove group memberships on the machine where I was logged in.
I had no luck fixing the ebuild so I asked for help:
On Sat, 2019-12-14 at 14:47 -0600, The Bit Pit wrote:
> acct-user/mythtv modifies the existing user if that user is not logged
> in. Mythtv has been around for years and users have created specialized
> configurations for the mythtv user. They do not like changes to the
> mythtv user when upgrading.
> A couple of solutions:
> the ebuild does not depend on acct-user/mythtv when the user already
> exists. This prevents both the changing and deletion of the existing user.
> What is the gentoo way to discover a preexisting user? Repoman does not
> like anything I tried using egetent passwd mythtv
> 2) Add something to the acct-user/mythtv to (conditionally) prevent any
> change if there is a preexisting user on the system. The acct-user
> unmerge would also check that the user was not modified since it was
> created by acct-user. This seems like a lot of work.
Users are supposed to create a local acct-user/mythtv override if they
want to use a custom setup.
I take this to mean that you create your own custom ebuild at /usr/local/portage/acct-user/mythtv/mythtv-0.ebuild and run "repoman manifest" get it to emerge. Another was is to use a bigger hammer and mask the package acct-user/mythtv in package.mask.
Creating a custom acct-user/mythtv ebuild means knowing in advance that the standard ebuild will destroy your existing user.
Wouldn't it be easier to modify the acct-user/mythtv ebuild (instead of mythtv itself), so that it isntalls but does NOTHING if the user mythtv already exists?
I have not figured out how to test for the existence of a preexisting user in the mythtv ebuild anymore because that functionality is deprecated.
I am a new proxy-maintainer (4 months) and can not commit any changes to the gentoo tree. One or more gentoo developers must review my pull request. They are strict and do not allow use of deprecated functionality. The deprecated code is still in portage to allow existing ebuilds to work, all new commits must use current portage constructs.
I created a bug that acct-user.eclass violated CONFIG_PROTECT, but that was shot down.
About a year ago acct-user and acct-group eclasses were added to portage. The functions to manipulate a user or group were moved to the new acct-user and acct-group eclasses. acct-user.eclass defines how a user must be configured. By default acct-user/mythtv ebuild changes an existing user to be exactly as specified. There is an option to force failure when as existing user is different. This will likely result in a different bug I can't fix. (It will however protect an existing user that has been modified)
Force the acct-user/mythtv to fail when an existing mythtv user does not match the one in gentoo (or a custom overlay). There are at least two ways to continue an emerge:
--skip-first --resume (If you didn't use first option and it failed)
Skipping the emerge is OK if you don't want to change the existing user anyway.
If you want the default, delete the user and try again. ( --resume )
A proper fix is to create a custom overlay for acct-user/mythtv for your system to prevent failing of emerge acct-user/mythtv. For new installations acct-user/mythtv will create a default and subsequent changes to mythtv user will not cause problems since acct-user/mythtv is not emerged again (unless removed/forced).
Actually the only thing I can add to cause emerge to fail is when the mythtv user does not have the default UID.
That will help, but I really can't fix this bug.
Thanks a lot for trying and the effort.