Fix a bug that was exposed by the SXEmacs configure script.
authorSteve Youngs <steve@sxemacs.org>
Tue, 11 Mar 2014 04:16:31 +0000 (14:16 +1000)
committerSteve Youngs <steve@sxemacs.org>
Tue, 11 Mar 2014 04:16:31 +0000 (14:16 +1000)
commit8ad446d5669b34095d0c0dcb099f167339ba55d1
treec3f404158383d69b949b9ea12d0298bc7ec20d54
parenta9baeb490600c1e0a64cfc1e193cc6c145327c21
Fix a bug that was exposed by the SXEmacs configure script.

Under certain conditions a directory could be created with no execute bit
set (600 instead of 700).  When the chmod wrapper (and install) encounter
symbolic permissions they are converted to octal by stat'ing a temp file
that was chmod'd with the symbolic perm.  Because of the obnoxious and
convoluted way that autoconf does things, that chmod had to be called
under an exec.

This changeset cares for that plus a couple of other tiny things like
always testing for root with `id -u' instead of $UID.

* usr/lib/pkgusr/chmod: Use id to check for root because $UID
cannot be guaranteed to exist.

Only remove real options to guard against accidently removing a
symbolic perm that begins with a dash.  I don't even know if that
is possible, I've never used symbolic perms, never will, they're a
stupid idea.

Create the hack-o-matic file with mktemp and call $DAISY_CHAIN
there via exec.

* usr/lib/pkgusr/chgrp: Use id for root check.

* usr/lib/pkgusr/chown: Ditto.

* usr/lib/pkgusr/mkdir: Ditto.

* usr/lib/pkgusr/install: Ditto.
(_perms): Use mktemp, the same as in the chmod wrapper.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
usr/lib/pkgusr/chgrp
usr/lib/pkgusr/chmod
usr/lib/pkgusr/chown
usr/lib/pkgusr/install
usr/lib/pkgusr/mkdir