summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJaco Kroon <jaco@iewc.co.za>2021-02-10 09:44:27 +0200
committerJoonas Niilola <juippis@gentoo.org>2021-02-10 13:11:34 +0200
commitb445c58ef8f61c4794da60af3ab18b3fec33f78c (patch)
treecfef47c59c289e58ff9ad315ccf183074dcb36f0 /bin
parentuid-gid.txt: update GUID/UID status for jenkins (diff)
downloadapi-b445c58ef8f61c4794da60af3ab18b3fec33f78c.tar.gz
api-b445c58ef8f61c4794da60af3ab18b3fec33f78c.tar.bz2
api-b445c58ef8f61c4794da60af3ab18b3fec33f78c.zip
used_free_uidgids.sh: Also count the free UID+GID pairs.
Signed-off-by: Jaco Kroon <jaco@iewc.co.za> Closes: https://github.com/gentoo/api-gentoo-org/pull/367 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/used_free_uidgids.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/used_free_uidgids.sh b/bin/used_free_uidgids.sh
index 3b43ac9..24cd682 100755
--- a/bin/used_free_uidgids.sh
+++ b/bin/used_free_uidgids.sh
@@ -174,6 +174,7 @@ gi=0 # index into gids array.
idbase=0 # "start" of range about to be output.
freeuid=0 # count number of free UIDs
freegid=0 # count number of free GIDs
+freepair=0 # count number of free UID+GID pairs.
printf "%-*s%10s%10s\n" $(( ${#max} * 2 + 5 )) "#ID" UID GID
@@ -238,6 +239,7 @@ while [[ ${idbase} -le ${max} ]]; do
if [[ "${gidstate}" == FREE ]]; then
if [[ "${uidstate}" == FREE ]]; then
uidgidboth=${re}
+ freepair=$(( freepair + re - idbase + 1 ))
else
gidonly=${re}
fi
@@ -258,3 +260,4 @@ echo "Recommended UID only: ${uidonly:=${uidgidboth:-none}}"
echo "Recommended UID+GID both: ${uidgidboth:-none}"
echo "Free UIDs: ${freeuid}"
echo "Free GIDs: ${freegid}"
+echo "Free UID+GID pairs: ${freepair}"