Using garg, the gid is obtained. If this is less than zero, it is
possible that a group number was provided on the command line. This is
converted to an int with atoi. Only if the garg didn't correspond to a
gid is the gid then tested to see if it is the root group (gid == 0), or
as Jim said, atoi returns 0 in case the garg can't be converted to an
integer.

So if I provide on the command line -g 0,  or -g "Hey There", I will get
the Ns_Fatal called saying it is an invalid group.  The code doesn't
distinguish between the root group and an invalid input to atoi.

In the uid code section. The gid is set to the main group id. So if I
first setup my user:

# usermod -g root -G other,groups someuser

and then run the server, AOLserver happily starts up with a group of
'root'.
The code also clearly negates the use of the -g command line option.
Here is the status line of my test case:

[24/Dec/2002:09:38:49][5689.8192][-main-] Notice: nsmain: security info:
uid=504, euid=504, gid=0, egid=0

--Tom Jackson

Reply via email to