🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: mod.std.unix
Article #183

Re: umask per directory?

#183
From: Moderator, John Quarterman
Date: Thu, 06 Feb 1986 12:57
35 lines
2294 bytes
Date: Tue, 4 Feb 86 14:05:09 est
>From: "Charles J. Antonelli" <cja%eecs.umich.csnet@CSNET-RELAY.ARPA>
Summary: Use an appropriate alias for `cd' [ Nope. -mod ]
Organization: University of Michigan EECS Dept.

I obtained the following idea from a colleague.  It can be used with csh
to achieve the desired effect.  Define the following alias:

alias cd 'if (-o .exit ) source .exit; chdir \!*; if (-o .enter ) source .enter'

Then create .enter and .exit files within the directories whose umasks
are to be controlled; the files contain the appropriate umask commands along
with anything else you wish to do whenever a directory is entered or exited.
In my case the new umask is echoed for verification.

The .exit file is useful mainly in those cases where only a small subset
of the directories have .enter files; if every directory has one then
.exit is not strictly necessary.

The alias checks for ownership to prevent possible corruption.

Charles J. Antonelli		Phone:  (313) 763-1563
The University of Michigan	Csnet:  cja@eecs.UMICH
1508 East Engineering		Usenet: cja@umich.UUCP
Ann Arbor, MI   48109			ihnp4!umich!cja

[ This is one of several such shell initialization schemes I've
received (and the only one I'm going to post).  They all miss the
point:  a new file should be created according to the modes of its
*parent* directory, not the creating process's *current* directory.
That is, "cat this > there/that" should create "that" with the same
modes regardless of where "." is.  (If "there" has the directory umask
feature enabled.)  -mod ]

Volume-Number: Volume 5, Number 38
Technical Details
Message-ID: <4127@ut-sally.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!gatech!ut-sally!std-unix
References: <4034@ut-sally.UUCP> <4029@ut-sally.UUCP> <4060@ut-sally.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!gatech!ut-sally!std-unix
From: std-unix@ut-sally.UUCP (Moderator, John Quarterman)
Newsgroups: mod.std.unix
Subject: Re: umask per directory?
Message-ID: <4127@ut-sally.UUCP>
Date: Thu, 6-Feb-86 07:57:07 EST
Article-I.D.: ut-sally.4127
Posted: Thu Feb  6 07:57:07 1986
Date-Received: Fri, 7-Feb-86 21:09:43 EST
References: <4034@ut-sally.UUCP> <4029@ut-sally.UUCP> <4060@ut-sally.UUCP>
Reply-To: "Charles J. Antonelli" <cja%umich.uucp@CSNET-RELAY.ARPA>
Organization: IEEE/P1003 Portable Operating System Environment Committee
Lines: 35
Approved: jsq@sally.UUCP