[Top][All Lists]

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

Re: problems with users

From: Kaz Kylheku
Subject: Re: problems with users
Date: Sun, 11 Nov 2001 23:01:28 GMT
User-agent: slrn/ (Linux)

In article <address@hidden>, Jonas Meurer wrote:
>I've set up my cvs on my server, and now 5 people work at a project.
>So when max addes '', it is (also in the Archive) owned by
>max. But how can I own all files in the archive by one group (root.cvs)?

If you are on UNIX, this is achieved by turning on the setgid permission
bit on the directory. E.g.

    mkdir dir
    chgrp <some_group> dir
    chmod g+s dir

Then when a file is created under that directory directory, it will
have <some_group> as a group owner. Also, if a subdirectory is created,
it will be not only owned by that group, but it will also inherit the
setgid bit.

In the root directory of a repository I run, I have the following script
which recursively verifies that everything has correct permissions.

If someone ever messes up permissions, I just run the script to hunt down
what is wrong and fix it. I haven't had to run it in over a year, because
the setgid scheme takes care of propagating the proper permissions.


# Find any directories that are not readable, writable or searchable
# by their owning group, or which do not have the setgid bit,
# or which are not owned by the group cvsusers.
# Also find any regular files that are not readable by their group,
# or which are not owned by the group cvsusers.
# And find any files that are not regular files or directories, or
# symbolic links

CORRECT_GROUP='( -group cvsusers -or -group cvsadmin )'
CORRECT_DIR_PERMS='( -perm -g+rws )'
CORRECT_FILE_PERMS='( -perm +g+r )'

find . \( \
    -type d -and \( -not $CORRECT_GROUP -or -not $CORRECT_DIR_PERMS \) \
    -or -type f -and \( -not $CORRECT_GROUP -or -not $CORRECT_FILE_PERMS \) \
    -or -not \( -type f -or -type d -or -type l \) \) \

reply via email to

[Prev in Thread] Current Thread [Next in Thread]