GID 42 matches Debian.

Signed-off-by: Mike Gilbert <[email protected]>
---
 acct-group/shadow/metadata.xml    |  7 +++++++
 acct-group/shadow/shadow-0.ebuild | 24 ++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 acct-group/shadow/metadata.xml
 create mode 100644 acct-group/shadow/shadow-0.ebuild

diff --git a/acct-group/shadow/metadata.xml b/acct-group/shadow/metadata.xml
new file mode 100644
index 000000000000..65e1fc82d859
--- /dev/null
+++ b/acct-group/shadow/metadata.xml
@@ -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>[email protected]</email>
+       </maintainer>
+</pkgmetadata>
diff --git a/acct-group/shadow/shadow-0.ebuild 
b/acct-group/shadow/shadow-0.ebuild
new file mode 100644
index 000000000000..1637461e3eb5
--- /dev/null
+++ b/acct-group/shadow/shadow-0.ebuild
@@ -0,0 +1,24 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit acct-group
+
+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
+}
-- 
2.51.0


Reply via email to