From 2f15ccc30479d98012e3ddd595fa13c2f58d4a87 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 27 Apr 2011 18:08:50 -0700 Subject: privileged_startx: Prefer /usr/bin/mktemp This will avoid accidentally tripping over an incompatible, user-provided GNU flavor mktemp. Signed-off-by: Jeremy Huddleston --- launchd/privileged_startx/10-tmpdirs.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'launchd/privileged_startx/10-tmpdirs.cpp') 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 -- cgit v1.2.3