From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0BDE513835A for ; Wed, 10 Feb 2021 11:13:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 243FDE0895; Wed, 10 Feb 2021 11:13:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0B0C0E0895 for ; Wed, 10 Feb 2021 11:13:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 840A4340F6A for ; Wed, 10 Feb 2021 11:13:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D513C46F for ; Wed, 10 Feb 2021 11:13:24 +0000 (UTC) From: "Joonas Niilola" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Joonas Niilola" Message-ID: <1612955494.b445c58ef8f61c4794da60af3ab18b3fec33f78c.juippis@gentoo> Subject: [gentoo-commits] data/api:master commit in: bin/ X-VCS-Repository: data/api X-VCS-Files: bin/used_free_uidgids.sh X-VCS-Directories: bin/ X-VCS-Committer: juippis X-VCS-Committer-Name: Joonas Niilola X-VCS-Revision: b445c58ef8f61c4794da60af3ab18b3fec33f78c X-VCS-Branch: master Date: Wed, 10 Feb 2021 11:13:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7c1b0177-aba7-4fae-ba85-41ad24ece6da X-Archives-Hash: 319ae1c228bdc13f95ad4cfb82843b8b commit: b445c58ef8f61c4794da60af3ab18b3fec33f78c Author: Jaco Kroon iewc co za> AuthorDate: Wed Feb 10 07:44:27 2021 +0000 Commit: Joonas Niilola gentoo org> CommitDate: Wed Feb 10 11:11:34 2021 +0000 URL: https://gitweb.gentoo.org/data/api.git/commit/?id=b445c58e used_free_uidgids.sh: Also count the free UID+GID pairs. Signed-off-by: Jaco Kroon iewc.co.za> Closes: https://github.com/gentoo/api-gentoo-org/pull/367 Signed-off-by: Joonas Niilola gentoo.org> bin/used_free_uidgids.sh | 3 +++ 1 file changed, 3 insertions(+) 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}"