4 |
- |
1 |
#
|
|
|
2 |
# This is the configuration file for pam_env, a PAM module to load in
|
|
|
3 |
# a configurable list of environment variables for a
|
|
|
4 |
#
|
|
|
5 |
# The original idea for this came from Andrew G. Morgan ...
|
|
|
6 |
#<quote>
|
|
|
7 |
# Mmm. Perhaps you might like to write a pam_env module that reads a
|
|
|
8 |
# default environment from a file? I can see that as REALLY
|
|
|
9 |
# useful... Note it would be an "auth" module that returns PAM_IGNORE
|
|
|
10 |
# for the auth part and sets the environment returning PAM_SUCCESS in
|
|
|
11 |
# the setcred function...
|
|
|
12 |
#</quote>
|
|
|
13 |
#
|
|
|
14 |
# What I wanted was the REMOTEHOST variable set, purely for selfish
|
|
|
15 |
# reasons, and AGM didn't want it added to the SimpleApps login
|
|
|
16 |
# program (which is where I added the patch). So, my first concern is
|
|
|
17 |
# that variable, from there there are numerous others that might/would
|
|
|
18 |
# be useful to be set: NNTPSERVER, LESS, PATH, PAGER, MANPAGER .....
|
|
|
19 |
#
|
|
|
20 |
# Of course, these are a different kind of variable than REMOTEHOST in
|
|
|
21 |
# that they are things that are likely to be configured by
|
|
|
22 |
# administrators rather than set by logging in, how to treat them both
|
|
|
23 |
# in the same config file?
|
|
|
24 |
#
|
|
|
25 |
# Here is my idea:
|
|
|
26 |
#
|
|
|
27 |
# Each line starts with the variable name, there are then two possible
|
|
|
28 |
# options for each variable DEFAULT and OVERRIDE.
|
|
|
29 |
# DEFAULT allows and administrator to set the value of the
|
|
|
30 |
# variable to some default value, if none is supplied then the empty
|
|
|
31 |
# string is assumed. The OVERRIDE option tells pam_env that it should
|
|
|
32 |
# enter in its value (overriding the default value) if there is one
|
|
|
33 |
# to use. OVERRIDE is not used, "" is assumed and no override will be
|
|
|
34 |
# done.
|
|
|
35 |
#
|
|
|
36 |
# VARIABLE [DEFAULT=[value]] [OVERRIDE=[value]]
|
|
|
37 |
#
|
|
|
38 |
# (Possibly non-existent) environment variables may be used in values
|
|
|
39 |
# using the ${string} syntax and (possibly non-existent) PAM_ITEMs may
|
|
|
40 |
# be used in values using the @{string} syntax. Both the $ and @
|
|
|
41 |
# characters can be backslash escaped to be used as literal values
|
|
|
42 |
# values can be delimited with "", escaped " not supported.
|
|
|
43 |
# Note that many environment variables that you would like to use
|
|
|
44 |
# may not be set by the time the module is called.
|
|
|
45 |
# For example, HOME is used below several times, but
|
|
|
46 |
# many PAM applications don't make it available by the time you need it.
|
|
|
47 |
#
|
|
|
48 |
#
|
|
|
49 |
# First, some special variables
|
|
|
50 |
#
|
|
|
51 |
# Set the REMOTEHOST variable for any hosts that are remote, default
|
|
|
52 |
# to "localhost" rather than not being set at all
|
|
|
53 |
#REMOTEHOST DEFAULT=localhost OVERRIDE=@{PAM_RHOST}
|
|
|
54 |
#
|
|
|
55 |
# Set the DISPLAY variable if it seems reasonable
|
|
|
56 |
#DISPLAY DEFAULT=${REMOTEHOST}:0.0 OVERRIDE=${DISPLAY}
|
|
|
57 |
#
|
|
|
58 |
#
|
|
|
59 |
# Now some simple variables
|
|
|
60 |
#
|
|
|
61 |
#PAGER DEFAULT=less
|
|
|
62 |
#MANPAGER DEFAULT=less
|
|
|
63 |
#LESS DEFAULT="M q e h15 z23 b80"
|
|
|
64 |
#NNTPSERVER DEFAULT=localhost
|
|
|
65 |
#PATH DEFAULT=${HOME}/bin:/usr/local/bin:/bin\
|
|
|
66 |
#:/usr/bin:/usr/local/bin/X11:/usr/bin/X11
|
|
|
67 |
#
|
|
|
68 |
# silly examples of escaped variables, just to show how they work.
|
|
|
69 |
#
|
|
|
70 |
#DOLLAR DEFAULT=\$
|
|
|
71 |
#DOLLARDOLLAR DEFAULT= OVERRIDE=\$${DOLLAR}
|
|
|
72 |
#DOLLARPLUS DEFAULT=\${REMOTEHOST}${REMOTEHOST}
|
|
|
73 |
#ATSIGN DEFAULT="" OVERRIDE=\@
|