From owner-freebsd-questions@FreeBSD.ORG Tue Jan 31 10:29:39 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 994F316A420 for ; Tue, 31 Jan 2006 10:29:39 +0000 (GMT) (envelope-from duane@greenmeadow.ca) Received: from smtpout.eastlink.ca (smtpout.eastlink.ca [24.222.0.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C12743D48 for ; Tue, 31 Jan 2006 10:29:39 +0000 (GMT) (envelope-from duane@greenmeadow.ca) Received: from ip04.eastlink.ca ([24.222.10.20]) by mta01.eastlink.ca (Sun Java System Messaging Server 6.2-4.03 (built Sep 22 2005)) with ESMTP id <0ITY00BXAD5TKIA2@mta01.eastlink.ca> for freebsd-questions@freebsd.org; Tue, 31 Jan 2006 06:29:53 -0400 (AST) Received: from blk-224-199-230.eastlink.ca (HELO [192.168.0.101]) ([24.224.199.230]) by ip04.eastlink.ca with ESMTP; Tue, 31 Jan 2006 06:29:38 -0400 Date: Tue, 31 Jan 2006 06:29:35 +0000 From: Duane Whitty In-reply-to: <20060131095342.GB2042@flame.pc> To: Giorgos Keramidas Message-id: <43DF03CF.8070408@greenmeadow.ca> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAQAAA+k= References: <1138676399.30955.253148220@webmail.messagingengine.com> <43DEB306.3070903@greenmeadow.ca> <20060131095342.GB2042@flame.pc> User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060120 Cc: freebsd-questions@freebsd.org Subject: Re: I'm stubborn or stupid (and that's not xor) (Was: CVS Import Permissions) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2006 10:29:39 -0000 Giorgos Keramidas wrote: > On 2006-01-31 00:44, Duane 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