Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2006 06:29:35 +0000
From:      Duane Whitty <duane@greenmeadow.ca>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: I'm stubborn or stupid (and that's not xor) (Was: CVS Import Permissions)
Message-ID:  <43DF03CF.8070408@greenmeadow.ca>
In-Reply-To: <20060131095342.GB2042@flame.pc>
References:  <1138676399.30955.253148220@webmail.messagingengine.com> <43DEB306.3070903@greenmeadow.ca> <20060131095342.GB2042@flame.pc>

next in thread | previous in thread | raw e-mail | index | archive | help
Giorgos Keramidas wrote:
> On 2006-01-31 00:44, Duane <duane@greenmeadow.ca> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43DF03CF.8070408>