~ubuntu-branches/ubuntu/quantal/sudo/quantal

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2011-11-20 12:07:45 UTC
  • mfrom: (1.3.17 sid)
  • Revision ID: package-import@ubuntu.com-20111120120745-o3qpklobmygytndc
Tags: 1.8.3p1-1ubuntu1
* Merge from debian/testing, remaining changes:
  - debian/patches/keep_home_by_default.patch:
    + Set HOME in initial_keepenv_table. (rebased for 1.8.3p1)
  - debian/patches/enable_badpass.patch: turn on "mail_badpass" by default:
    + attempting sudo without knowing a login password is as bad as not
      being listed in the sudoers file, especially if getting the password
      wrong means doing the access-check-email-notification never happens
      (rebased for 1.8.3p1)
  - debian/rules:
    + compile with --without-lecture --with-tty-tickets (Ubuntu specific)
    + install man/man8/sudo_root.8 (Ubuntu specific)
    + install apport hooks
    + The ubuntu-sudo-as-admin-successful.patch was taken upstream by
      Debian however it requires a --enable-admin-flag configure flag to
      actually enable it.
  - debian/sudoers: 
    + grant admin group sudo access
  - debian/sudo-ldap.dirs, debian/sudo.dirs: 
    + add usr/share/apport/package-hooks
  - debian/sudo.preinst:
    + avoid conffile prompt by checking for known default /etc/sudoers
      and if found installing the correct default /etc/sudoers file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl Local m4 macros for autoconf (used by sudo)
2
2
dnl
3
 
dnl Copyright (c) 1994-1996, 1998-2005, 2007-2009
 
3
dnl Copyright (c) 1994-1996, 1998-2005, 2007-2011
4
4
dnl     Todd C. Miller <Todd.Miller@courtesan.com>
5
5
dnl
6
6
dnl XXX - should cache values in all cases!!!
10
10
dnl
11
11
dnl check for sendmail in well-known locations
12
12
dnl
13
 
AC_DEFUN(SUDO_PROG_SENDMAIL, [AC_MSG_CHECKING([for sendmail])
 
13
AC_DEFUN([SUDO_PROG_SENDMAIL], [AC_MSG_CHECKING([for sendmail])
14
14
found=no
15
15
for p in "/usr/sbin/sendmail" "/usr/lib/sendmail" "/usr/etc/sendmail" "/usr/ucblib/sendmail" "/usr/local/lib/sendmail" "/usr/local/bin/sendmail"; do
16
16
    if test -f "$p"; then
28
28
dnl
29
29
dnl check for vi in well-known locations
30
30
dnl
31
 
AC_DEFUN(SUDO_PROG_VI, [AC_MSG_CHECKING([for vi])
 
31
AC_DEFUN([SUDO_PROG_VI], [AC_MSG_CHECKING([for vi])
32
32
found=no
33
33
for editor in "/usr/bin/vi" "/bin/vi" "/usr/ucb/vi" "/usr/bsd/vi" "/usr/local/bin/vi"; do
34
34
    if test -f "$editor"; then
46
46
dnl
47
47
dnl check for mv in well-known locations
48
48
dnl
49
 
AC_DEFUN(SUDO_PROG_MV, [AC_MSG_CHECKING([for mv])
 
49
AC_DEFUN([SUDO_PROG_MV], [AC_MSG_CHECKING([for mv])
50
50
found=no
51
51
for p in "/usr/bin/mv" "/bin/mv" "/usr/ucb/mv" "/usr/sbin/mv"; do
52
52
    if test -f "$p"; then
64
64
dnl
65
65
dnl check for bourne shell in well-known locations
66
66
dnl
67
 
AC_DEFUN(SUDO_PROG_BSHELL, [AC_MSG_CHECKING([for bourne shell])
 
67
AC_DEFUN([SUDO_PROG_BSHELL], [AC_MSG_CHECKING([for bourne shell])
68
68
found=no
69
69
for p in "/bin/sh" "/usr/bin/sh" "/sbin/sh" "/usr/sbin/sh" "/bin/ksh" "/usr/bin/ksh" "/bin/bash" "/usr/bin/bash"; do
70
70
    if test -f "$p"; then
80
80
])dnl
81
81
 
82
82
dnl
 
83
dnl check for utmp file
 
84
dnl
 
85
AC_DEFUN([SUDO_PATH_UTMP], [AC_MSG_CHECKING([for utmp file path])
 
86
found=no
 
87
for p in "/var/run/utmp" "/var/adm/utmp" "/etc/utmp"; do
 
88
    if test -r "$p"; then
 
89
        found=yes
 
90
        AC_MSG_RESULT([$p])
 
91
        SUDO_DEFINE_UNQUOTED(_PATH_UTMP, "$p")
 
92
        break
 
93
    fi
 
94
done
 
95
if test X"$found" != X"yes"; then
 
96
    AC_MSG_RESULT([not found])
 
97
fi
 
98
])dnl
 
99
 
 
100
dnl
83
101
dnl Where the log file goes, use /var/log if it exists, else /{var,usr}/adm
84
102
dnl
85
 
AC_DEFUN(SUDO_LOGFILE, [AC_MSG_CHECKING(for log file location)
 
103
AC_DEFUN([SUDO_LOGFILE], [AC_MSG_CHECKING(for log file location)
86
104
if test -n "$with_logpath"; then
87
105
    AC_MSG_RESULT($with_logpath)
88
106
    SUDO_DEFINE_UNQUOTED(_PATH_SUDO_LOGFILE, "$with_logpath")
103
121
dnl
104
122
dnl Where the timestamp files go.
105
123
dnl
106
 
AC_DEFUN(SUDO_TIMEDIR, [AC_MSG_CHECKING(for timestamp file location)
 
124
AC_DEFUN([SUDO_TIMEDIR], [AC_MSG_CHECKING(for timestamp file location)
107
125
timedir="$with_timedir"
108
126
if test -z "$timedir"; then
109
127
    for d in /var/db /var/lib /var/adm /usr/adm; do
121
139
dnl Where the I/O log files go, use /var/log/sudo-io if
122
140
dnl /var/log exists, else /{var,usr}/adm/sudo-io
123
141
dnl
124
 
AC_DEFUN(SUDO_IO_LOGDIR, [
 
142
AC_DEFUN([SUDO_IO_LOGDIR], [
125
143
    AC_MSG_CHECKING(for I/O log dir location)
126
144
    if test "${with_iologdir-yes}" != "yes"; then
127
 
        :
 
145
        iolog_dir="$with_iologdir"
128
146
    elif test -d "/var/log"; then
129
 
        with_iologdir="/var/log/sudo-io"
 
147
        iolog_dir="/var/log/sudo-io"
130
148
    elif test -d "/var/adm"; then
131
 
        with_iologdir="/var/adm/sudo-io"
 
149
        iolog_dir="/var/adm/sudo-io"
132
150
    else
133
 
        with_iologdir="/usr/adm/sudo-io"
134
 
    fi
135
 
    if test "${with_iologdir-yes}" != "no"; then
136
 
        SUDO_DEFINE_UNQUOTED(_PATH_SUDO_IO_LOGDIR, "$with_iologdir")
137
 
    fi
138
 
    AC_MSG_RESULT($with_iologdir)
 
151
        iolog_dir="/usr/adm/sudo-io"
 
152
    fi
 
153
    if test "${with_iologdir}" != "no"; then
 
154
        SUDO_DEFINE_UNQUOTED(_PATH_SUDO_IO_LOGDIR, "$iolog_dir")
 
155
    fi
 
156
    AC_MSG_RESULT($iolog_dir)
139
157
])dnl
140
158
 
141
159
dnl
142
160
dnl SUDO_CHECK_TYPE(TYPE, DEFAULT)
143
161
dnl XXX - should require the check for unistd.h...
144
162
dnl
145
 
AC_DEFUN(SUDO_CHECK_TYPE,
 
163
AC_DEFUN([SUDO_CHECK_TYPE],
146
164
[AC_REQUIRE([AC_HEADER_STDC])dnl
147
165
AC_MSG_CHECKING(for $1)
148
166
AC_CACHE_VAL(sudo_cv_type_$1,
163
181
dnl
164
182
dnl Check for size_t declation
165
183
dnl
166
 
AC_DEFUN(SUDO_TYPE_SIZE_T,
 
184
AC_DEFUN([SUDO_TYPE_SIZE_T],
167
185
[SUDO_CHECK_TYPE(size_t, int)])
168
186
 
169
187
dnl
170
188
dnl Check for ssize_t declation
171
189
dnl
172
 
AC_DEFUN(SUDO_TYPE_SSIZE_T,
 
190
AC_DEFUN([SUDO_TYPE_SSIZE_T],
173
191
[SUDO_CHECK_TYPE(ssize_t, int)])
174
192
 
175
193
dnl
176
194
dnl Check for dev_t declation
177
195
dnl
178
 
AC_DEFUN(SUDO_TYPE_DEV_T,
 
196
AC_DEFUN([SUDO_TYPE_DEV_T],
179
197
[SUDO_CHECK_TYPE(dev_t, int)])
180
198
 
181
199
dnl
182
200
dnl Check for ino_t declation
183
201
dnl
184
 
AC_DEFUN(SUDO_TYPE_INO_T,
 
202
AC_DEFUN([SUDO_TYPE_INO_T],
185
203
[SUDO_CHECK_TYPE(ino_t, unsigned int)])
186
204
 
187
205
dnl
188
206
dnl check for working fnmatch(3)
189
207
dnl
190
 
AC_DEFUN(SUDO_FUNC_FNMATCH,
 
208
AC_DEFUN([SUDO_FUNC_FNMATCH],
191
209
[AC_MSG_CHECKING([for working fnmatch with FNM_CASEFOLD])
192
210
AC_CACHE_VAL(sudo_cv_func_fnmatch,
193
211
[rm -f conftestdata; > conftestdata
235
253
  ])
236
254
 
237
255
dnl
238
 
dnl check putenv() argument for const
239
 
dnl
240
 
AC_DEFUN([SUDO_FUNC_PUTENV_CONST],
241
 
[AC_CACHE_CHECK([whether putenv has a const argument],
242
 
sudo_cv_func_putenv_const,
243
 
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
244
 
int putenv(const char *string) {return 0;}], [])],
245
 
    [sudo_cv_func_putenv_const=yes],
246
 
    [sudo_cv_func_putenv_const=no])
247
 
  ])
248
 
  if test $sudo_cv_func_putenv_const = yes; then
249
 
    AC_DEFINE(PUTENV_CONST, 1, [Define to 1 if the `putenv' has a const argument.])
250
 
  fi
251
 
])
252
 
 
253
 
dnl
254
256
dnl check for sa_len field in struct sockaddr
255
257
dnl
256
 
AC_DEFUN(SUDO_SOCK_SA_LEN, [
 
258
AC_DEFUN([SUDO_SOCK_SA_LEN], [
257
259
    AC_CHECK_MEMBER([struct sockaddr.sa_len], 
258
260
        [AC_DEFINE(HAVE_SA_LEN, 1, [Define if your struct sockadr has an sa_len field.])],    
259
261
        [],
266
268
dnl we can't really trust UID_MAX or MAXUID since they may exist
267
269
dnl only for backwards compatibility.
268
270
dnl
269
 
AC_DEFUN(SUDO_UID_T_LEN,
 
271
AC_DEFUN([SUDO_UID_T_LEN],
270
272
[AC_REQUIRE([AC_TYPE_UID_T])
271
273
AC_MSG_CHECKING(max length of uid_t)
272
274
AC_CACHE_VAL(sudo_cv_uid_t_len,
299
301
dnl
300
302
dnl append a libpath to an LDFLAGS style variable
301
303
dnl
302
 
AC_DEFUN(SUDO_APPEND_LIBPATH, [
 
304
AC_DEFUN([SUDO_APPEND_LIBPATH], [
303
305
    if test X"$with_rpath" = X"yes"; then
304
306
        case "$host" in
305
307
            *-*-hpux*)  $1="${$1} -L$2 -Wl,+b,$2"
319
321
dnl Determine the mail spool location
320
322
dnl NOTE: must be run *after* check for paths.h
321
323
dnl
322
 
AC_DEFUN(SUDO_MAILDIR, [
 
324
AC_DEFUN([SUDO_MAILDIR], [
323
325
maildir=no
324
326
if test X"$ac_cv_header_paths_h" = X"yes"; then
325
327
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
326
 
#include <paths.h>
327
 
int main() {char *p = _PATH_MAILDIR;}], [])], [maildir=yes], [])
 
328
#include <paths.h>],
 
329
[char *p = _PATH_MAILDIR;])], [maildir=yes], [])
328
330
fi
329
331
if test $maildir = no; then
330
332
    # Solaris has maillock.h which defines MAILDIR