groupadd_secret_option

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Subject: groupadd -o???????????????
From: "Mike A. Harris" <mharris@meteng.on.ca>
Date: Thu, 24 Aug 2000 02:19:50 -0400 (EDT)

The groupadd command lists a "-o" option.  The manpage talks
about this mythical option too.  It says:

SYNOPSIS
       groupadd [-g gid [-o]] [-r] [-f] group
[SNIP]
       -g gid The  numerical value of the group's ID.  This value
              must be unique, unless the -o option is used.   The
              value  must be non-negative.  The default is to use
[SNIP]
       -f     This  is  force  flag. This will stop groupadd exit
              with error when the group about to be added already
              exists  on  the  system.  If  that is the case, the
              group won't be altered (or added  again,  for  that
              matter).
              This  option also modifies the way -g option works.
              When you request a gid that it is  not  unique  and
              you  don't  give  -o option too, the group creation
              will fall back to the standard behavior  (adding  a



Three mentions of "-o" being used, so the manpage author
obviously knows a great deal about this "-o" option.  It appears
that he wanted to keep this secret information to himself though
as there is no actual explanation as to what -o does.

Someone tell me, and I'll do my part and submit a patch to the
maintainer.

Take care,
TTYL


===

Subject: Re: groupadd -o???????????????
From: Peter Blomgren <blomgren@monster.stanford.edu>
Date: Thu, 24 Aug 2000 00:00:35 -0700 (PDT)

Mike,

Maybe I'm too used to reading cryptic man pages, but this one
seems pretty clear to me...

> The groupadd command lists a "-o" option.
> 
> SYNOPSIS
>        groupadd [-g gid [-o]] [-r] [-f] group
> [SNIP]
>        -g gid The  numerical value of the group's ID.  This value
>               must be unique, unless the -o option is used.

Hence, 'groupadd -g 0 haXX0r' will fail (groupadd: gid 0 is not unique),
but 'groupadd -g 0 -o haXX0r' will successfully add the group haXX0r
with gid=0 (as an alias for the "root" group).

> [SNIP]
>        -f     [SNIP] This  option also modifies the way -g option works.
>               When you request a gid that it is  not  unique  and
>               you  don't  give  -o option too, the group creation
>               will fall back to the standard behavior  (adding  a
[UNSNIP]        group  as neither -g or -o options were specified).
[UNSNIP]        This is an option added by Red Hat Software.

Hence, 'groupadd -g 0 -f haxx0r' will add the group haxx0r, with
a GID is that in _new_ AND _unique_ (gid>500 unless the "-r" option
is given, in which case gid<500...).
Finally 'groupadd -g 0 -o -f haxx0r' is equivalent to
'groupadd -g 0 -o haxx0r' since there is nothing to force.

===

Subject: Re: groupadd -o???????????????
From: "Julie" <jockgrrl@ix.netcom.com>
Date: Thu, 24 Aug 2000 02:54:44 -0500

From: Mike A. Harris <mharris@meteng.on.ca>
> Three mentions of "-o" being used, so the manpage author
> obviously knows a great deal about this "-o" option.  It appears
> that he wanted to keep this secret information to himself though
> as there is no actual explanation as to what -o does.

"-o" is the "override" option for non-unique GID checks.

And last time I looked, I was a "she".

Sign me,
The woman at the bottom of this web page ...

http://nodevice.com/sections/ManIndex/man0530.html

===
Subject: Re: groupadd -o???????????????
From: kumar1@home.com (Prasanth A. Kumar)
Date: 23 Aug 2000 23:39:50 -0700

I looked at the source code for useradd in the shadow-utils package
and it appears the -o flag permits non-unique user IDs to be specified
with the -u flag so there can be multiple account names with the same
user id in the password file.

===

Subject: Re: groupadd -o???????????????
From: "Mike A. Harris" <mharris@meteng.on.ca>
Date: Thu, 24 Aug 2000 15:15:32 -0400 (EDT)

On Thu, 24 Aug 2000, Peter Blomgren wrote:

>Maybe I'm too used to reading cryptic man pages, but this one
>seems pretty clear to me...

Well it wasn't to me until someone pointed it out.  Thanks to all
that pointed this out to me.


>> The groupadd command lists a "-o" option.
>> 
>> SYNOPSIS
>>        groupadd [-g gid [-o]] [-r] [-f] group
>> [SNIP]
>>        -g gid The  numerical value of the group's ID.  This value
>>               must be unique, unless the -o option is used.
>
>Hence, 'groupadd -g 0 haXX0r' will fail (groupadd: gid 0 is not unique),
>but 'groupadd -g 0 -o haXX0r' will successfully add the group haXX0r
>with gid=0 (as an alias for the "root" group).

Right, I got it now.

>> [SNIP]
>>        -f     [SNIP] This  option also modifies the way -g option works.
>>               When you request a gid that it is  not  unique  and
>>               you  don't  give  -o option too, the group creation
>>               will fall back to the standard behavior  (adding  a
>[UNSNIP]        group  as neither -g or -o options were specified).
>[UNSNIP]        This is an option added by Red Hat Software.
>
>Hence, 'groupadd -g 0 -f haxx0r' will add the group haxx0r, with
>a GID is that in _new_ AND _unique_ (gid>500 unless the "-r" option
>is given, in which case gid<500...).
>Finally 'groupadd -g 0 -o -f haxx0r' is equivalent to
>'groupadd -g 0 -o haxx0r' since there is nothing to force.

Yep, I got that now too.  The message learned here is that just
because documentation exists, doesn't mean it is well written at
all.  The defacto standard for manpages and other documentation
when listing command line options seems to be:

-a  does this
-b  does that
-f  blah blah
-o  is this


When I saw "-o" on the commandline, I looked in the manpage.  I
read the whole thing once over, but when I spotted the
"-o" option reference in the above for -f and -g, I looked for
"-o" documentation below which was a very intuitive and natural
thing to look for.  Not finding it, means either:

1) it is not documented
2) it is documented poorly and non-intuitively.

In this case the latter is true.  Consider an application having
50 commanline options for example.  It makes the most sense
they'd be listed in the manpage in alphabetical order.  Starting
off not knowing what ANY of them do, and being told to use
"-o" you'd scroll down the page looking for "-o" most likely, and
not find it under "-z" because you weren't looking for -z.

As long as the GNU manpages and info documents expect you to read
the entire manual and then try to interpret it in 30 different
ways, people will not in general be able to grok what they are
saying.  I'm reading a lot more docs lately than normal, and I'm
finding things increasingly poorly written or referenced.

Pointing that out to people though you often get back a response
saying "why don't you fix it then?".  Pretty hard to fix
documentation that you don't understand though.  A paradox at
best... 

<sigh>

Well, thanks for your explanation..  I have it klunked into my
thinker now.  ;o)

Once again, we've proved here, the best documentation is the
human experience.  (and mailing lists).  ;o)

Take care,
TTYL

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu