This file is indexed.

/usr/lib/ipsec/auto is in libreswan 3.23-4.

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

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
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
#! /bin/sh
# user interface to automatic keying and Pluto in general
# Copyright (C) 1998, 1999, 2000  Henry Spencer.
# Copyright (C) 2014-2017 Paul Wouters <pwouters@redhat.com>
# Copyright (C) 2015 Tuomo Soini <tis@foobar.fi>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
#
# 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.

IPSEC_RUNDIR="${IPSEC_RUNDIR:-/run/pluto}"
CTLSOCKET="${IPSEC_RUNDIR}/pluto.ctl"

me='ipsec auto'
usage="Usage:
	${me} [--showonly] [--asynchronous] --up connectionname \\
		[--remote-host ipaddr]
	${me} [--showonly] [--asynchronous] --down connectionname
	${me} [--showonly] --{add|delete|replace|start} connectionname
	${me} [--showonly] --{route|unroute|ondemand} connectionname
	${me} [--showonly] --{ready|status|rereadsecrets|rereadgroups}
	${me} [--showonly] --{rereadcrls|rereadall}
	${me} [--showonly] [--utc] --{listpubkeys|listcerts}
	${me} [--showonly] [--utc] --checkpubkeys
	${me} [--showonly] [--utc] --{listcacerts|listgroups}
	${me} [--showonly] [--utc] --{listcrls|listall}
	${me} [--showonly] [--utc] --purgeocsp

	other options: [--config ipsecconfigfile] [--verbose] [--ctlsocket <file>]"

config=
async=
op=
argc=
utc=
verbose=
remote=

for dummy
do
    case "$1" in
	--help)
	    echo "${usage}"
	    exit 0
	    ;;
	--version)
	    echo "${me} $IPSEC_VERSION"
	    exit 0
	    ;;
	--show)
	    ;;
	--showonly)
	    showonly='echo '
	    ;;
	--utc)
	    utc="$1"
	    ;;
	--config)
	    config="--config $2"
	    shift
	    ;;
	--ctlsocket)
	    CTLSOCKET="$2"
	    shift
	    ;;
	--remote-host)
	    remote="--remote-host $2"
	    shift
	    ;;
	--asynchronous)
	    async="--asynchronous"
	    ;;
	--verbose)
	    verbose=" --verbose "
	    ;;
	--up|--down|--add|--delete|--replace|--route|--unroute|\
	--start|--ondemand)
	    if [ " ${op}" != " " ]; then
		echo "${usage}" >&2
		exit 2
	    fi
	    op="$1"
	    argc=1
	    ;;
	--ready|--status|--rereadsecrets|--rereadgroups|\
	--rereadcacerts|--rereadcrls|--rereadall|\
	--listpubkeys|--listcerts|\
	--checkpubkeys|\
	--listcacerts|--listgroups|\
	--listcrls|--listall|--purgeocsp)
	    if [ " ${op}" != " " ]; then
		echo "${usage}" >&2
		exit 2
	    fi
	    op="$1"
	    argc=0
	    ;;
	--)
	    shift
	    break
	    ;;
	-*)
	    echo "${me}: unknown option \"$1\"" >&2
	    exit 2
	    ;;
	*)
	    break
	    ;;
    esac
    shift
done

names=
case "${op}$#:$1:$2" in
    2:*:up|2:*:down|2:*:add|2:*:delete|2:*:replace|2:*:start|\
    2:*:route|2:*:unroute)
	echo "${me}: warning: obsolete command syntax used" >&2
	names="$1"
	op="--$2"
	;;
    1:ready:|1:status:|1:rereadsecrets:|\
    1:rereadcacerts:|1:rereadcrls:|1:rereadall:|\
    1:listpubkeys:|1:listcerts:|\
    1:listcacerts:|1:listgroups:|\
    1:listcrls:|1:listall:)
	echo "${me}: warning: obsolete command syntax used" >&2
	op="--$1"
	;;
    --*)
	if [ " $argc" -ne $# ];	then
	    echo "${usage}" >&2
	    exit 2
	fi
	names="$*"
	;;
    *)
	echo "${usage}" >&2
	exit 2
	;;
esac

case "${op}" in
    --ready)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --listen
	exit
	;;
    --rereadsecrets)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --rereadsecrets
	exit
	;;
    --rereadgroups)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --listen
	exit
	;;
    --rereadcacerts)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --rereadcacerts
	exit
	;;
    --rereadcrls)
	echo "ipsec whack --rereadcrls has been obsoleted - please see: ipsec crls"
	exit 1
	;;
    --rereadall)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --rereadall
	exit
	;;
    --listpubkeys)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack ${utc} --listpubkeys
	exit
	;;
    --checkpubkeys)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack ${utc} --checkpubkeys
	exit
	;;
    --listcerts)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack ${utc} --listcerts
	exit
	;;
    --listcacerts)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack ${utc} --listcacerts
	exit
	;;
    --listgroups)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack ${utc} --listgroups
	exit
	;;
    --listcrls)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack ${utc} --listcrls
	exit
	;;
    --listall)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack ${utc} --listall
	exit
	;;
    --purgeocsp)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack ${utc} --listall --purgeocsp
	exit
	;;
    --up)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack ${async} --name ${names} --initiate ${remote}
	exit
	;;
    --start)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} addconn ${verbose} ${config} ${names}
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack ${async} --name ${names} --initiate ${remote}
	exit
	;;
    --down)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --name ${names} --terminate
	exit
	;;
    --delete)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --name ${names} --delete
	exit
	;;
    --route)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --name ${names} --route
	exit
	;;
    --ondemand)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} addconn ${verbose} ${config} ${names}
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --name ${names} --route
	exit
	;;
    --unroute)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --name ${names} --unroute
	exit
	;;
    --status)
	${showonly} ipsec --ctlsocket ${CTLSOCKET} whack --status
	exit
	;;
esac

${showonly} ipsec addconn --ctlsocket ${CTLSOCKET} ${verbose} ${config} ${names}