Re: I'm stubborn or stupid (and that's not xor) (Was: CVS Import Permissions)



Giorgos Keramidas wrote:
On 2006-01-31 00:44, Duane <duane@xxxxxxxxxxxxxx> wrote:

Hi everyone,

On the CVS server machine should our CVS repository directory belong to
the cvs group, i.e. user==root, group==cvs?


It's usually a good idea.


And as for the umask, as it appears to be 027, if we give the
cvs group write permission on /usr/local/cvsrep then when we
import our projects they will be writeable by members of group
cvs and the owner of the project, in this case jim.


No.  This is not how `umask' works.  Whatever value `umask'
currently has is logically-AND-ed with 0666.  This means that by
using 027, the result is:

    $ python
    >>> print "%04o" % (066 & 027)
    0026

These are the bits that will be turned *off* for new files (see
the umask(2) manpage for details), so to find out which
permission bits are allowed, you have to use the reverse mask:

    >>> print "%04o" % (0777 & ~(066 & 027))
    0751

The 0751 allowed-bits mask is equivalent to:

    rwxr-x--x

This means that with a umask of 027, you are effectivelly
allowing only the bits in ``rwxr-x--x'' to be turned on by
default for new files, and this doesn't include write permission
for the group.

I know that the whole `umask' concept is a bit tricky to grasp,
since it depends on knowledge of numbering with an octal-base
*AND* it works in the reverse order of that people usually think
it does, but hopefully, with the help of our excellent manpages
and a bit of experimentation, it will become more obvious :)


I apologize if I am being all the things suggested in my
subject heading.


Nah!  Never apologize for a question.  There is no such thing as
a stupid question for this list (well, unless the question refers
to Windows, of course :P).

- Giorgos

______________________________________________

Thanks Giorgos.

That's an excellent explanation on computing the allowed bits. One of my mistakes was logically-AND-ing with 0777.

Sincerely

--Duane
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Fw: Problem with cvs commit failed in cvs-freebsd setup
    ... Oh, by the way, my cvs user has added into cvs group, too. ... > The user and group of CVS repository, commitcheck script and other scripts ...
    (freebsd-questions)
  • Re: follow up to setting up CVS under 5.3
    ... > For my small programming project on this home FreeBSD box I created a ... > st4nk project and added myself to the cvs group. ...
    (freebsd-newbies)
  • Re: Im stubborn or stupid (and thats not xor) (Was: CVS Import Permissions)
    ... > On the CVS server machine should our CVS repository directory belong to ... This is not how `umask' works. ... you have to use the reverse mask: ... Never apologize for a question. ...
    (freebsd-questions)
  • Re: Problem with CVS and group ownership.
    ... > The default umask on a fresh Debian install is: ... > I am running the pserver which starts up automatically but am not ... > familier with how to add user's to the CVS that are not already normal ... can have "real" passwords if you want. ...
    (Debian-User)
  • Re: Permissions, groups & CVS problems
    ... > 'nokeos' and the people that need access to the repository to the group ... > CVS the group is the user's initial group instead of 'developers'. ... umask 007 ... setenv CVSROOT $HOME/.cvsroot (.cvsroot is the main ...
    (alt.os.linux)

Quantcast