[OpenAFS] Perl - Determine if the shell is in a PAG

Derrick J Brashear shadow@dementia.org
Tue, 5 Dec 2006 15:46:26 -0500 (EST)

On Tue, 5 Dec 2006, Jeff Blaine wrote:

> For the next person to want to do this.  The first non-Python code
> I've written in many many years.
> #!/usr/bin/perl
> #
> # Determine if we're in a PAG.  Exit with 0 if we are, 1 if we're not.
> #
> # As of 12/5/2006, PAG membership can be determined by examining one's
> # groups.  The existence of 2 groups with GIDs greater than 30000 and
> # with no associated group names means the current shell is in a PAG.

There's no guarantee there's no groupname associated. It's jut that for 
most sites that's true. The math in curpag() is the only way to ensure 
it's true. For you, it's probably true that the comment above works.