tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Relative interpreter pathname on #! line



On Wed, Aug 17, 2022 at 08:29:48AM -0400, Mouse wrote:
 > > Is [#! taking a relative interpreter path] intentional?
 > 
 > > What's more, the relative interpreter filename is taken relative to
 > > the current directory, not relative to the script directory.
 > 
 > That's exactly what I'd expect, and what I'd say should happen: it's
 > consistent with ~every other use of relative pathnames.
 > 
 > > There's probably some logic to this but it seems bug-prone and I
 > > can't think of a legitimate use for it.
 > 
 > I can't offhand either, but I also don't see any real risk from it, and
 > am very far from certain there is no clever use for it.

There is a slight risk if you have untrustworthy users and you run one
of these things (perhaps by accident) while in /tmp.

However, it would be substantially more useful if relative paths were
interpreted relative to the location of the script file. I would have
to look in the exec code to be sure, but I don't think that would be
hard to arrange.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index