From owner-freebsd-questions@FreeBSD.ORG Tue Jan 31 09:54:17 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 1326A16A420 for ; Tue, 31 Jan 2006 09:54:17 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.94]) by mx1.FreeBSD.org (Postfix) with ESMTP id E530543D80 for ; Tue, 31 Jan 2006 09:54:09 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (aris.bedc.ondsl.gr [62.103.39.226]) by rosebud.otenet.gr (8.13.4/8.13.4/Debian-8) with SMTP id k0V9s7Ti030893; Tue, 31 Jan 2006 11:54:07 +0200 Received: by flame.pc (Postfix, from userid 1001) id 89660117FA; Tue, 31 Jan 2006 11:53:42 +0200 (EET) Date: Tue, 31 Jan 2006 11:53:42 +0200 From: Giorgos Keramidas To: Duane Message-ID: <20060131095342.GB2042@flame.pc> References: <1138676399.30955.253148220@webmail.messagingengine.com> <43DEB306.3070903@greenmeadow.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43DEB306.3070903@greenmeadow.ca> 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 09:54:17 -0000 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