This file is indexed.

/usr/lib/exmh/env.tcl is in exmh 1:2.8.0-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# env.tcl
#
# Grab things from the environment
#
# Copyright (c) 199 Sun Microsystems
# Use and copying of this software and preparation of derivative works based
# upon this software are permitted. Any distribution of this software or
# derivative works must comply with all applicable United States export
# control laws. This software is made available AS IS, and Sun Microsystems
# makes no warranty about the software, its performance or its conformity to
# any specification.

# Env_Init sets up:
#	MHCONTEXT	to give exmh a private MH context file
#	USER		to avoid dealing with LOGNAME
#	TMPDIR		to allow retargeting /tmp
#	PATH		to make sure the MH programs are on the path

proc Env_Init {} {
    global env
    global exmh

    # Use an alternate context to avoid conflict with command line MH
    # This has to be the same as used by exmh so that private sequences work
    # right.
    set env(MHCONTEXT) .exmhcontext

    # Merge LOGNAME into USER so we only need to look for one later
    if {[catch {set env(USER)} user]} {
	if {[catch {set env(LOGNAME)} user]} {
	    puts stderr "No USER or LOGNAME envar"
	    set user ""
	}
	set env(USER) $user
    }

    # Init TMPDIR

    if {[info exists env(EXMHTMPDIR)]} {
	set exmh(tmpdir) $env(EXMHTMPDIR)
    } elseif {[info exist env(TMPDIR)]} {
	set exmh(tmpdir) $env(TMPDIR)
    } else {
	set exmh(tmpdir) /tmp/$env(USER)
    }

    # Make sure MH is on the path
    # At install time, we may not yet know the mh_path,
    # and are just setting up the TMPDIR

    global mh_path
    if {[info exist mh_path]} {
	set hit 0
	foreach dir [split $env(PATH) :] {
	    if {[string compare $dir $mh_path] == 0} {
		set hit 1
		break
	    }
	}
	if {! $hit} {
	    set env(PATH) $mh_path:$env(PATH)
	}
    }
}

proc Env_Tmp {} {
    global exmh

    # Doing this every time we use the temp file directory ensures
    # no-one steals it without the user knowing it.
    # We only chmod the directory if it doesn't exist to avoid
    # the case where exmh is run under the root account and
    # chmods /tmp, /var/tmp, or /usr/tmp

    if {[catch {
	if {![file exists $exmh(tmpdir)]} {
	    file mkdir $exmh(tmpdir)
	    file attributes $exmh(tmpdir) -permissions 0700
	}
    } err]} {
	puts $err
	catch {puts stderr "WARNING: exmh using unsafe /tmp directory"}
	Exmh_Status "WARNING: exmh using unsafe /tmp directory" warning
	set exmh(tmpdir) /tmp
    }

    return $exmh(tmpdir)
}