mirror of
https://github.com/flatcar/scripts.git
synced 2025-12-22 17:52:12 +01:00
acct-group/shadow: Add from Gentoo
It's from Gentoo commit 5b84adec2b5de578a3fb055b5aabc2160676dda0. Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
This commit is contained in:
parent
7a5e4f365f
commit
910f1ba550
7
sdk_container/src/third_party/portage-stable/acct-group/shadow/metadata.xml
vendored
Normal file
7
sdk_container/src/third_party/portage-stable/acct-group/shadow/metadata.xml
vendored
Normal 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>
|
||||||
24
sdk_container/src/third_party/portage-stable/acct-group/shadow/shadow-0.ebuild
vendored
Normal file
24
sdk_container/src/third_party/portage-stable/acct-group/shadow/shadow-0.ebuild
vendored
Normal 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
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user