File: bastille-tmpdir.csh

package info (click to toggle)
bastille 1:1.3.0-2.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,576 kB
  • ctags: 397
  • sloc: perl: 8,407; sh: 1,879; ansic: 638; makefile: 203; csh: 17
file content (42 lines) | stat: -rw-r--r-- 1,316 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/csh
#
# bastille-tmpdir.csh
#
# version 1.6
#
# This is a stub script for calling "bastille-tmpdir.sh" to set 
# safe values for TMPDIR and TMP environment variables, creating
# directories as needed. See bastille-tmpdir.sh for more information
# including required applications.
#
# Copyright (c) 2000-2001 Peter Watkins
#
# licensed under the terms of the GNU General Public License
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

set BSCRIPT = "/etc/profile.d/bastille-tmpdir.sh"
set DEFENSE_SCRIPT = "/etc/bastille-tmpdir-defense.sh"

if ( -f $BSCRIPT ) then
	setenv TMPTMPDIR `/bin/sh $BSCRIPT echo`
	if ( $? == 0 ) then
		if ( -d "$TMPTMPDIR" ) then
			setenv TMPDIR $TMPTMPDIR
			setenv TMP $TMPTMPDIR
			if ( -f $DEFENSE_SCRIPT ) then
				$DEFENSE_SCRIPT $$ &
			endif
		endif
	else
		echo "WARNING: unable to set safe TMPDIR/TMP directory!"
	endif
	setenv TMPTMPDIR ""
endif