Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Dec 2001 12:39:54 +0000 (GMT)
From:      Jan Grant <Jan.Grant@bristol.ac.uk>
To:        Cliff Sarginson <cliff@raggedclown.net>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Modifying only certain bits with chmod
Message-ID:  <Pine.GSO.4.31.0112061238400.323-100000@mail.ilrt.bris.ac.uk>
In-Reply-To: <20011206122233.GB1111@raggedclown.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 6 Dec 2001, Cliff Sarginson wrote:

> On Thu, Dec 06, 2001 at 10:51:28AM +0000, Jan Grant wrote:
> > On Mon, 3 Dec 2001, Anthony Atkielski wrote:
> >
> > > I ended up modifying the command, which was easier (for me) than memorizing the
> > > symbolic syntax.
> >
> > ...
> >
> > > So ... what's the safest way to make this my system-wide command
> > > without interfering with the standard chmod source and stuff?  I
> > > guess I could just copy the modified binary over to bin, no?  What
> > > do most people do when they develop their own local custom versions
> > > of a command?
> >
> > Minimum impact: stick it in /usr/local/bin and ensure that that
> > directory comes before /bin on your path.
> >
> And pray nothing else that depends on standard chmod doesn't try to use
> it.
> If you are going to do this kind of thing you really should not do it
> in such a way that the "real" system program you are replacing is not
> somehow called if the caller expects it. For example, front-ending "rm"
> with a safe version which saves the rm'ed files somewhere - a common practise - is
> one thing. But to change the command line functionality of a standard
> system program is quite another.
> Sounds like a very bad move.
> Give it another name.

It's _got_ another name; it's called "/usr/local/bin/chmod". If you're
running any scripts that don't sanitise their PATH first, then they are
broken and need fixing.

> All a mystery to me, you don't need to be Albert Einstein to learn the
> symbolic arguments for changing particular modes on a file.
> Write a little crib-sheet on the back of a postit if it's that
> difficult.

Agreed.

-- 
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287088 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk
Leverage that synergy! Ooh yeah, looking good! Now stretch - and relax.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.31.0112061238400.323-100000>