forked from dagwieers/op
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathop.conf-dist
97 lines (83 loc) · 2.67 KB
/
op.conf-dist
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
89
90
91
92
93
94
95
96
#
# A simple example config for op(1). See the man page for more information or
# op.conf.complex for a complex multi-user/multi-system configuration.
#
# Syntaxe:
# VAR=value
# DEFAULT option...
# mnemonic command [arg...] ; [option...]
#
# command : path | MAGIC_SHELL
# arg : literal | $1..$n $*
# option:
# uid=user (root) gid=group dir=dir chroot=dir umask=0### (022)
# groups=group|... users=user|... fowners=user:group fperms=0###
# password environment nolog xauth[=user] help="..."
# $VAR $VAR=... $1..$n $*
# login : $SHELL $TERM $HOME $LOGNAME $PATH $MAIL
# su : $SHELL $TERM $DISPLAY $XAUTHORITY $HOME $USER $LOGNAME $PATH
# sudo -i : $DISPLAY $PATH $TERM $HOME $MAIL $SHELL $HOME $LOGNAME
## List of privileged users
GRP_PRIVALL=root|wheel|expl|keypriv
DEFAULT $COLORS $DISPLAY $HOSTNAME $HISTSIZE $INPUTRC $KDEDIR $LS_COLORS
$MAIL $PS1 $PS2 $QTDIR $USERNAME $LANG $LC_ADDRESS $LC_CTYPE
$LC_COLLATE $LC_IDENTIFICATION $LC_MEASUREMENT $LC_MESSAGES
$LC_MONETARY $LC_NAME $LC_NUMERIC $LC_PAPER $LC_TELEPHONE
$LC_TIME $LC_ALL $LANGUAGE $LINGUAS $_XKB_CHARSET $TERM $XAUTHORITY
## List of privileged commands
id /usr/bin/id $*;
groups=GRP_PRIVALL
help="id"
env /bin/env $*;
groups=GRP_PRIVALL
environment
help="env [arg...] + env"
magic MAGIC_SHELL;
groups=GRP_PRIVALL
environment
help="magic command [arg...] + env"
sh /bin/sh $*;
groups=GRP_PRIVALL
environment
help="sh [arg...] + env"
-- /bin/su -;
groups=GRP_PRIVALL
$TERM $DISPLAY
help="su -"
- /bin/sh -c '
while [ -n "${DISPLAY}" -a -z "${XAUTHORITY}" ]; do
found=0
for xauth in /usr/bin/xauth /usr/bin/X11/xauth /usr/openwin/bin/xauth; do
[ -x ${xauth} ] && found=1 && break
done
[ ${found} = 0 ] && break
home=$(eval echo ~$(id -un))
if [ -f /stand/vmunix ]; then
export XAUTHORITY=$(mktemp -c -d "${home}" -p .xauth)
elif [ -f /proc/version ]; then
export XAUTHORITY=$(mktemp -t -p "${home}" .xauthXXXXXX)
fi
until [ -f "${XAUTHORITY}" ]; do
XAUTHORITY=${home}/.xauth$(awk \'BEGIN{srand();printf "%06.6i", int(rand()*1000000)}\' /dev/null)
touch "${XAUTHORITY}.$$" 2> /dev/null || break; break=
ln "${XAUTHORITY}.$$" "${XAUTHORITY}" 2> /dev/null && break=
rm -f "${XAUTHORITY}.$$"; $break
done
[ ! -f "${XAUTHORITY}" ] && unset XAUTHORITY && break
((sleep 5; rm -f "${XAUTHORITY}") &)
eval ${xauth} -f ~${USER}/.Xauthority extract - :${DISPLAY#*:} |
${xauth} merge -; break
done
[ -z "${XAUTHORITY}" ] && unset DISPLAY
exec /bin/su -';
groups=GRP_PRIVALL
$TERM $DISPLAY
help="su -"
su /bin/su $*;
help="su [arg...] + env"
groups=GRP_PRIVALL
environment
op /bin/su $*;
groups=GRP_PRIVALL
$TERM $DISPLAY $USER=root $LOGNAME=root
help="su [arg...] - env"