Stephen Gran on 2 Aug 2006 22:50:17 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] does the /etc/group file need to be GID order?


On Wed, Aug 02, 2006 at 05:16:54PM -0400, George Gallen said:
> I have so far, matched up that all entries in the group file are in the gshadow file,
> and that the same persons and order of persons are the same.
> 
> Two questions.
> 
> 1. does the gshadow need to be in the same order as the group file
> 2. do both files need to be in GID order?   (and the same for passwd)

No to both questions.

Some background to your problems may be helpful.  I don't know how much
you know about programming, so I will attempt to simplify as much as I
can.

A group entry is returned as something like a record (a struct in c,
if that helps) with entries for name, password (yes groups can have
passwords - that's what gshadow is for), group number, and a reference
to a list of members of that group.  Most programs iterate over the
available records to decide things about groups, like granting access
or whatever it is that needs to be done.

The important thing is that the name and number of each record really
should be unique.  If they are not, you will run into problems.  I have
to assume you have two or more overlapping entries in your group file,
or a second way to look up groups that has overlaps.  Order does not
matter, as the order that the records are returned is not guaranteed.

Check for duplicates.  Run getent group (returns the records one per
line) - see if it has entries not in your group file.

Good luck,
-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | Think lucky. If you fall in a pond,     |
|  steve@lobefin.net             | check your pockets for fish.   --       |
|  http://www.lobefin.net/~steve | Darrell Royal                           |
 --------------------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug