forked from scponly/scponly
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.in
More file actions
321 lines (284 loc) · 11.9 KB
/
configure.in
File metadata and controls
321 lines (284 loc) · 11.9 KB
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
dnl Process this file with autoconf to produce a configure script.
dnl stupid hack to properly parse $PATH for /bin
dnl if this breaks your configure, delete it
dnl all it does is append the first dir to the end
dnl first_part=`echo $PATH | cut -f1 -d\:`
dnl export PATH=$PATH:$first_part
PATH="$PATH:/usr/local/bin"
dnl
dnl Say what we are:
AC_INIT(scponly, 4.8, joe@sublimation.org)
dnl AC_CONFIG_SRCDIR([helper.c])
AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
# this temp_os is a brutal hack until i look into the proper way to do this. ie- rtfm
temp_os=`echo $host_os | cut -c-7`
if test "$temp_os" = solaris; then
AC_DEFINE(UNIX_COMPAT)
fi
temp_os=`echo $host_os | cut -c-4`
if test "$temp_os" = irix; then
AC_DEFINE(IRIX_COMPAT)
fi
temp_os=`echo $host_os | cut -c-3`
if test "$temp_os" = aix; then
AC_DEFINE(UNIX_COMPAT)
fi
AC_DEFINE(HOST_OS,$host_os)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PATH_PROG(PROG_CUT, cut)
AC_PATH_PROG(PROG_GREP, grep)
AC_PATH_PROG(PROG_SORT, sort)
AC_PATH_PROG(PROG_LDD, ldd)
AC_PATH_PROG(PROG_USERADD, useradd)
AC_PATH_PROG(PROG_CHOWN, chown)
AC_PATH_PROG(PROG_CHMOD, chmod)
AC_PATH_PROG(PROG_DIRNAME, dirname)
AC_PATH_PROG(PROG_ID, id)
AC_PATH_PROG(PROG_PW, pw)
AC_PATH_PROG(PROG_RM, rm)
AC_PATH_PROG(PROG_PWD_MKDB, pwd_mkdb)
dnl Features wanted for this installation:
dnl Command-line args to ./configure
dnl Call options "--disable-foo" if they default to on,
dnl call them "--enable-foo" otherwise.
AC_ARG_ENABLE([restrictive-names],
AC_HELP_STRING([--disable-restrictive-names], [disable restrictive filename checks]),
[
if test "x$enableval" != "xno"; then
AC_DEFINE([RESTRICTIVE_FILENAMES])
fi
],[
dnl Default clause. This one defaults to on.
AC_DEFINE([RESTRICTIVE_FILENAMES])
])
AC_ARG_ENABLE([wildcards],
AC_HELP_STRING([--disable-wildcards], [disable wildcard processing]),
[
dnl Did they say anything, including an explicit --enable-wildcards?
if test "x$enableval" != "xno"; then
AC_DEFINE([ENABLE_WILDCARDS])
fi
],[
dnl Default clause. This one defaults to on.
AC_DEFINE([ENABLE_WILDCARDS])
])
AC_ARG_ENABLE([gftp-compat],
AC_HELP_STRING([--disable-gftp-compat], [disable gftp compatibility]),
[
if test "x$enableval" != "xno"; then
AC_DEFINE([GFTP_COMPAT])
fi
],[
AC_DEFINE([GFTP_COMPAT])
])
AC_ARG_WITH([sftp-server],
AC_HELP_STRING([--with-sftp-server], [path to sftp-server binary [defaults to on+guessed]]),
[
if test "x$withval" != "xno"; then
dnl --without-sftp-server is a perfectly good
dnl way of requesting that sftp compatability *not*
dnl be present.
scponly_explicit_sftpserver_path=$withval
dnl TODO: should test viability...
AC_DEFINE([ENABLE_SFTP])
scponly_sftp_compat=1
fi
],[
AC_DEFINE([ENABLE_SFTP])
scponly_sftp_compat=1
])
AC_ARG_ENABLE([winscp-compat],
AC_HELP_STRING([--enable-winscp-compat], [enable winscp (and scp) compatibility]),
[
if test "x$enableval" != "xno"; then
scponly_scp_compat=1
AC_DEFINE([ENABLE_SCP2])
AC_DEFINE([WINSCP_COMPAT])
fi
],[
echo -n dnl Defaults to off, must be turned on explicitly
])
AC_ARG_WITH([default-chdir],
AC_HELP_STRING([--with-default-chdir=DIR], [cd to this directory after authentication (only for interactive logins)]),
[
AC_DEFINE([ENABLE_DEFAULT_CHDIR])
AC_DEFINE_UNQUOTED([DEFAULT_CHDIR], ["$withval"])
],[
echo -n dnl Defaults to off, must be turned on explicitly
])
AC_ARG_ENABLE([unison-compat],
AC_HELP_STRING([--enable-unison-compat], [enable unison compatibility]),
[
if test "x$enableval" != "xno"; then
AC_DEFINE([UNISON_COMPAT])
fi
],[
echo -n dnl Defaults to off, must be turned on explicitly
])
AC_ARG_ENABLE([scp-compat],
AC_HELP_STRING([--enable-scp-compat], [enable scp compatibility]),
[
if test "x$enableval" != "xno"; then
AC_DEFINE([ENABLE_SCP2])
scponly_scp_compat=1
fi
],[
echo -n dnl Defaults to off, must be turned on explicitly
])
AC_ARG_ENABLE([rsync-compat],
AC_HELP_STRING([--enable-rsync-compat], [enable rsync compatibility]),
[
if test "x$enableval" != "xno"; then
AC_DEFINE([RSYNC_COMPAT])
fi
],[
echo -n dnl Defaults to off, must be turned on explicitly
])
AC_ARG_ENABLE([chrooted-binary],
AC_HELP_STRING([--enable-chrooted-binary], [install chrooted binary 'scponlyc']),
[
if test "x$enableval" != "xno"; then
AC_SUBST([CHROOTED_NAME], [scponlyc])
AC_DEFINE([CHROOTED_NAME], ["scponlyc"])
fi
],[
echo -n
])
AC_ARG_ENABLE([chroot-checkdir],
AC_HELP_STRING([--disable-chroot-checkdir], [disable checking chroot dir ownership]),
[
if test "x$enableval" != "xno"; then
AC_DEFINE([CHROOT_CHECKDIR])
fi
],[
dnl Default clause. This one defaults to on.
AC_DEFINE([CHROOT_CHECKDIR])
])
AC_ARG_ENABLE([svn-compat],
AC_HELP_STRING([--enable-svn-compat], [enable subversion SCS cli compatibility]),
[
if test "x$enableval" != "xno"; then
AC_DEFINE([SVN_COMPAT])
fi
],[
echo -n dnl Defaults to off, must be turned on explicitly
])
AC_ARG_ENABLE([svnserv-compat],
AC_HELP_STRING([--enable-svnserv-compat], [enable subversion SCS svnserve compatibility]),
[
if test "x$enableval" != "xno"; then
AC_DEFINE([SVNSERV_COMPAT])
fi
],[
echo -n dnl Defaults to off, must be turned on explicitly
])
AC_ARG_ENABLE([passwd-compat],
AC_HELP_STRING([--enable-passwd-compat], [enable passwd compatibility]),
[
if test "x$enableval" != "xno"; then
AC_DEFINE([PASSWD_COMPAT])
fi
],[
echo -n dnl Defaults to off, must be turned on explicitly
])
AC_ARG_ENABLE([quota-compat],
AC_HELP_STRING([--enable-quota-compat], [enable quota compatibility]),
[
if test "x$enableval" != "xno"; then
AC_DEFINE([QUOTA_COMPAT])
fi
],[
echo -n dnl Defaults to off, must be turned on explicitly
])
if test "x$scponly_scp_compat" != "x"; then
AC_MSG_NOTICE([enabling core WinSCP and Vanilla SCP binaries...])
SCPONLY_PATH_PROG_DEFINE([PROG_SFTP_SERVER], [sftp-server],[/usr/lib:/usr/lib64:/usr/libexec:/usr/libexec/openssh:/usr/lib/ssh:/usr/lib64/ssh:/usr/local/libexec:/usr/lib/misc:/usr/lib/openssh])
SCPONLY_PATH_PROG_DEFINE([PROG_LS], [ls], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_SCP], [scp], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_RM], [rm], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_LN], [ln], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_MV], [mv], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_CHMOD], [chmod], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_CHOWN], [chown], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_CHGRP], [chgrp], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_MKDIR], [mkdir], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_RMDIR], [rmdir], [/bin:/usr/bin:/sbin:/usr/sbin])
fi
dnl Check for binaries required by the WinSCP compatibility mode
dnl winscp-compat conditionals:
if test "x$enable_winscp_compat" != "xno"; then
AC_MSG_NOTICE([enabling WinSCP compatability...])
SCPONLY_PATH_PROG_DEFINE([PROG_PWD], [pwd], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_GROUPS], [groups], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_ID], [id], [/bin:/usr/bin:/sbin:/usr/sbin])
SCPONLY_PATH_PROG_DEFINE([PROG_ECHO], [echo], [/bin:/usr/bin:/sbin:/usr/sbin])
fi
# unison-compat conditionals:
if test "x$enable_unison_compat" != "x" && test "x$enable_unison_compat" != "xno"; then
AC_MSG_WARN([read the SECURITY document before enabling unison compatibility])
AC_MSG_NOTICE([enabling unison compatability...])
SCPONLY_PATH_PROG_DEFINE([PROG_UNISON], [unison], [/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin])
fi
# rsync-compat conditionals:
if test "x$enable_rsync_compat" != "x" && test "x$enable_rsync_compat" != "xno"; then
AC_MSG_WARN([read the SECURITY document before enabling rsync compatibility])
AC_MSG_NOTICE([enabling rsync compatability...])
SCPONLY_PATH_PROG_DEFINE([PROG_RSYNC], [rsync], [/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin])
fi
dnl Find the svnserve and svn binaries
if test "x$enable_svnserv_compat" != "x" && test "x$enable_svnserv_compat" != "xno"; then
AC_MSG_WARN([read the SECURITY document before enabling svnserv compatibility])
AC_MSG_NOTICE([enabling svnserv compatibility...])
SCPONLY_PATH_PROG_DEFINE([PROG_SVNSERV], [svnserve], [/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin])
fi
if test "x$enable_svn_compat" != "x" && test "x$enable_svn_compat" != "xno"; then
AC_MSG_WARN([read the SECURITY document before enabling svn compatibility])
AC_MSG_NOTICE([enabling subversion compatability...])
SCPONLY_PATH_PROG_DEFINE([PROG_SVN], [svn], [/bin:/usr/bin:/usr/local/bin:/usr/local/bin])
fi
if test "x$enable_passwd_compat" != "x" && test "x$enable_passwd_compat" != "xno"; then
AC_MSG_NOTICE([enabling passwd compatability...])
SCPONLY_PATH_PROG_DEFINE([PROG_PASSWD], [passwd], [/bin:/usr/bin:/sbin:/usr/sbin])
fi
if test "x$enable_quota_compat" != "x" && test "x$enable_quota_compat" != "xno"; then
AC_MSG_NOTICE([enabling quota compatability...])
SCPONLY_PATH_PROG_DEFINE([PROG_QUOTA], [quota], [/bin:/usr/bin:/sbin:/usr/sbin])
fi
dnl with-sftp-server conditionals:
if test "x$scponly_sftp_compat" != "x"; then
AC_MSG_NOTICE([enabling SFTP compatability...])
if test "x$scponly_explicit_sftpserver_path" = "x"; then
dnl Informed guess:
SCPONLY_PATH_PROG_DEFINE([PROG_SFTP_SERVER], [sftp-server],
[/usr/lib:/usr/lib/ssh:/usr/libexec/openssh:/usr/libexec:/usr/local/libexec])
dnl Debian uses /usr/lib
dnl Red Hat uses /usr/libexec/openssh
dnl Many a *BSD uses $PATH itself (which is implicit + checked 1st)
dnl Lupe says FreeBSD wants /usr/[local]/libexec
dnl I've seen it in /usr/lib/ssh under Mandrake 8.1
else
dnl Do what SCPONLY_PATH_PROG_DEFINE does:
echo checking for sftp-server... $scponly_explicit_sftpserver_path
AC_DEFINE_UNQUOTED([PROG_SFTP_SERVER], ["$scponly_explicit_sftpserver_path"])
scponly_PROG_SFTP_SERVER=$scponly_explicit_sftpserver_path
fi
fi
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h syslog.h unistd.h wordexp.h glob.h libgen.h getopt.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_CHECK_FUNCS([malloc atexit bzero strchr strerror glob wordexp strspn basename getopt])
AC_CHECK_DECL(optreset,
AC_DEFINE([HAVE_OPTRESET],[1],[have optreset]),,
[#include <getopt.h>] )
dnl AC_CONFIG_FILES([Makefile])
AC_OUTPUT([Makefile setup_chroot.sh])