Tools to manage the group file V Advise on writing own tools

From: Denis Cross <cathars_at_dial.pipex.com>
Date: Sun, 19 Mar 2000 15:05:03 +0000

Hi

As the number of users increases, we are starting to use secondary
groups as a means of managing access to data. This is generally working
fine, however manually adding/removing user from secondary groups is
becoming a slow and error prone process.

I see two options to resolve this problem
1) find some software which add/removes users from the group file - I've
        searched the web and nothing has come up.

2) Write my own code, which is OK, but I'd like some advise before I
start:

        I know that lines in the group file lines are limited in length, and to
        get more users per group you have to create additional secondary
        groups (different name, same ID), which appears to allow you to add
        users to a group without limit.

        So I propose to use the format:
                Group1:*:45: # defines the groups exists and gives real name
        Then for every user in the group
                Group1_user:*:45:user

        This makes adding a user a case of echo "Group_user:*:GID:user" >>
/etc/group
        Removing a user from a group, grep -v "Group_user" /etc/group >
/tmp/group
        Removing a user completely grep -v "_user:" /etc/group > /tmp/group

        All of which is very easy to script/test/prove. but are there any
reasons
        NOT to format the file in this fashion?

Thanks in advance

Mike
Received on Sun Mar 19 2000 - 15:03:36 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:40 NZDT