diff options
-rwxr-xr-x | launchd/privileged_startx/10-tmpdirs.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/launchd/privileged_startx/10-tmpdirs.cpp b/launchd/privileged_startx/10-tmpdirs.cpp index e30abac..8012597 100755 --- a/launchd/privileged_startx/10-tmpdirs.cpp +++ b/launchd/privileged_startx/10-tmpdirs.cpp @@ -27,10 +27,19 @@ XCOMM promote the sale, use or other dealings in this Software without XCOMM prior written authorization. XCOMM Make sure these are owned by root + +XCOMM Our usage of mktemp fails with GNU, so prefer /usr/bin to hopefully +XCOMM get BSD mktemp +if [ -x /usr/bin/mktemp ] ; then + MKTEMP=/usr/bin/mktemp +else + MKTEMP=mktemp +fi + for dir in /tmp/.ICE-unix /tmp/.X11-unix /tmp/.font-unix ; do - # Use mktemp rather than mkdir to avoid possible security issue - # if $dir exists and is a symlink - if mktemp -d ${dir} >& /dev/null ; then + XCOMM Use mktemp rather than mkdir to avoid possible security issue + XCOMM if $dir exists and is a symlink + if ${MKTEMP} -d ${dir} >& /dev/null ; then chmod 1777 $dir chown root:wheel $dir fi |