From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 4 21:50:38 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 659E516A4CE for ; Fri, 4 Jun 2004 21:50:38 -0700 (PDT) Received: from vanilla.cyber.com.au (vanilla.cyber.com.au [203.7.155.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id E358643D5C for ; Fri, 4 Jun 2004 21:50:37 -0700 (PDT) (envelope-from army@cyber.com.au) Received: by vanilla.cyber.com.au (Postfix, from userid 1103) id 55A1157BADF; Sat, 5 Jun 2004 14:48:35 +1000 (EST) Date: Sat, 5 Jun 2004 14:48:35 +1000 From: Paul Armstrong To: Dan Rue Message-ID: <20040605044834.GP13012@vanilla.office.cyber.com.au> References: <20040603221454.GA21622@therub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040603221454.GA21622@therub.org> User-Agent: Mutt/1.4i cc: freebsd-hackers@freebsd.org Subject: Re: chmod features: +RW? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2004 04:50:38 -0000 On Thu, Jun 03, 2004 at 05:14:54PM -0500, Dan Rue wrote: > I am interested in a feature addition to chmod for the equivalent of +X > (Add x bit only if it's a dir), except for read and write (R and W?). > > I'm not sure how useful W would be - but R would be quite useful for > allowing the reading and traversing of dirs without giving read > permission to the contents of the dirs. You've got a misunderstanding here. The reason the +X feature is there is for exactly the prupose you propose above: > mkdir -p foo/bar > ls -al foo total 6 drwxr-xr-x 3 army army 512 Jun 4 21:45 . drwxr-xr-x 3 army army 512 Jun 4 21:45 .. drwxr-xr-x 2 army army 512 Jun 4 21:45 bar > chmod 111 foo > ls -al foo ls: foo: Permission denied > cd foo > ls -al . ls: .: Permission denied > ls -al bar total 4 drwxr-xr-x 2 army army 512 Jun 4 21:45 . d--x--x--x 3 army army 512 Jun 4 21:45 .. > chmod 400 bar > cd bar bar: Permission denied. > ls -al bar ls: .: Permission denied ls: ..: Permission denied > chmod 700 . > ls -al . total 6 drwx------ 3 army army 512 Jun 4 21:45 . drwxr-xr-x 3 army army 512 Jun 4 21:45 .. dr-------- 2 army army 512 Jun 4 21:45 bar