initial commit
[profile/ivi/xorg-x11-xinit.git] / privileged_startx / 10-tmpdirs.cpp
1 XCOMM!/bin/sh
2 XCOMM Copyright (c) 2008 Apple Inc.
3 XCOMM
4 XCOMM Permission is hereby granted, free of charge, to any person
5 XCOMM obtaining a copy of this software and associated documentation files
6 XCOMM (the "Software"), to deal in the Software without restriction,
7 XCOMM including without limitation the rights to use, copy, modify, merge,
8 XCOMM publish, distribute, sublicense, and/or sell copies of the Software,
9 XCOMM and to permit persons to whom the Software is furnished to do so,
10 XCOMM subject to the following conditions:
11 XCOMM
12 XCOMM The above copyright notice and this permission notice shall be
13 XCOMM included in all copies or substantial portions of the Software.
14 XCOMM
15 XCOMM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 XCOMM EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 XCOMM MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 XCOMM NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
19 XCOMM HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 XCOMM WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 XCOMM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 XCOMM DEALINGS IN THE SOFTWARE.
23 XCOMM
24 XCOMM Except as contained in this notice, the name(s) of the above
25 XCOMM copyright holders shall not be used in advertising or otherwise to
26 XCOMM promote the sale, use or other dealings in this Software without
27 XCOMM prior written authorization.
28
29 XCOMM Make sure these are owned by root
30 for dir in /tmp/.ICE-unix /tmp/.X11-unix /tmp/.font-unix ; do
31         # Use mktemp rather than mkdir to avoid possible security issue
32         # if $dir exists and is a symlink
33         if mktemp -d ${dir} >& /dev/null ; then
34                 chmod 1777 $dir
35                 chown root:wheel $dir
36         fi
37 done