acct-group/shadow: new package, add 0

GID 42 matches Debian.

Signed-off-by: Mike Gilbert <floppym@gentoo.org>
This commit is contained in:
Mike Gilbert 2025-10-01 22:08:55 -04:00
parent ace8f9db48
commit 5b84adec2b
No known key found for this signature in database
GPG Key ID: 7E58A298F42F9CCD
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>base-system@gentoo.org</email>
</maintainer>
</pkgmetadata>

View File

@ -0,0 +1,24 @@
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit acct-group user-info
ACCT_GROUP_ID=42
pkg_postinst() {
# Look up the gid in ${EROOT}/etc/group.
# It may differ from the gid in /etc/group.
local gid=$(egetent group shadow | cut -d: -f3)
if [[ -z ${gid} ]]; then
eerror "Unable to determine id for shadow group"
return
fi
local db
for db in gshadow shadow; do
[[ -e ${EROOT}/etc/${db} ]] || continue
chgrp "${gid}" "${EROOT}/etc/${db}"
chmod g+r "${EROOT}/etc/${db}"
done
}