[MacPorts] #59283: xinstall: Prevent the creation of pathless directories that looks like octal permission numbers, like 755

MacPorts noreply at macports.org
Sat Oct 12 16:06:09 UTC 2019


#59283: xinstall: Prevent the creation of pathless directories that looks like
octal permission numbers, like 755
-------------------------+--------------------
 Reporter:  ryandesign   |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  Normal       |  Milestone:
Component:  base         |    Version:  2.6.1
 Keywords:               |       Port:
-------------------------+--------------------
 It is an easy enough mistake for a portfile author to write something
 like:

 {{{
 xinstall -d 755 /some/directory
 }}}

 In addition to creating the directory /some/directory as the developer
 intended, it also creates the directory /opt/local/var/macports/755, which
 the developer did not intend and which is pointless.

 What they meant to write was:

 {{{
 xinstall -d -m 755 /some/directory
 }}}

 I've corrected these errors in several ports over the years, such as in
 [changeset:f1cf37b6fdbdab8f549514f9abd39a3937e802f0/macports-ports].

 To catch these errors before they get committed, it would be nice if
 `xinstall` would return an error if the directory it is being asked to
 create has no path and is named like a permission number: optional leading
 0, then three digits 0-7.

 Or possibly `xinstall` should just error out anytime a path is not
 specified, since the `cd` command was removed a looong time ago so
 installation should always be by absolute path now.

-- 
Ticket URL: <https://trac.macports.org/ticket/59283>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list