1994-03-10 07:45:06 +00:00
|
|
|
/*
|
2014-01-30 15:50:40 -07:00
|
|
|
* Copyright (c) 1996, 1998, 1999, 2001, 2004, 2005, 2007-2014
|
2017-12-03 17:53:40 -07:00
|
|
|
* Todd C. Miller <Todd.Miller@sudo.ws>.
|
1994-03-10 07:45:06 +00:00
|
|
|
*
|
2004-02-13 21:36:43 +00:00
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
1999-07-31 16:19:50 +00:00
|
|
|
*
|
2004-02-13 21:36:43 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
1994-03-12 18:57:27 +00:00
|
|
|
*
|
2003-04-16 00:42:10 +00:00
|
|
|
* Sponsored in part by the Defense Advanced Research Projects
|
|
|
|
* Agency (DARPA) and Air Force Research Laboratory, Air Force
|
|
|
|
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
1994-03-12 18:57:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Pathnames to programs and files used by sudo.
|
1994-03-10 07:45:06 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_PATHS_H
|
2014-09-20 09:09:01 -06:00
|
|
|
# include <paths.h>
|
1994-03-10 07:45:06 +00:00
|
|
|
#endif /* HAVE_PATHS_H */
|
|
|
|
|
2010-07-22 18:44:48 -04:00
|
|
|
#ifdef HAVE_MAILLOCK_H
|
2014-09-20 09:09:01 -06:00
|
|
|
# include <maillock.h>
|
2010-07-22 18:44:48 -04:00
|
|
|
#endif /* HAVE_MAILLOCK_H */
|
|
|
|
|
1995-09-03 18:12:00 +00:00
|
|
|
#ifndef _PATH_DEV
|
2014-09-20 09:09:01 -06:00
|
|
|
# define _PATH_DEV "/dev/"
|
1995-09-03 18:12:00 +00:00
|
|
|
#endif /* _PATH_DEV */
|
|
|
|
|
1998-09-20 23:10:04 +00:00
|
|
|
#ifndef _PATH_TTY
|
2017-06-29 18:10:53 -06:00
|
|
|
# define _PATH_TTY _PATH_DEV "tty"
|
1998-09-20 23:10:04 +00:00
|
|
|
#endif /* _PATH_TTY */
|
|
|
|
|
2004-12-16 18:25:54 +00:00
|
|
|
#ifndef _PATH_DEVNULL
|
2017-06-29 18:10:53 -06:00
|
|
|
# define _PATH_DEVNULL _PATH_DEV "null"
|
2004-12-16 18:25:54 +00:00
|
|
|
#endif /* _PATH_DEVNULL */
|
|
|
|
|
2001-12-14 06:24:26 +00:00
|
|
|
#ifndef _PATH_DEFPATH
|
2014-09-20 09:09:01 -06:00
|
|
|
# define _PATH_DEFPATH "/usr/bin:/bin"
|
2001-12-14 06:24:26 +00:00
|
|
|
#endif /* _PATH_DEFPATH */
|
|
|
|
|
2010-07-12 18:07:52 -04:00
|
|
|
#ifndef _PATH_STDPATH
|
2014-09-20 09:09:01 -06:00
|
|
|
# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
|
2010-07-12 18:07:52 -04:00
|
|
|
#endif /* _PATH_STDPATH */
|
|
|
|
|
2007-12-21 21:53:32 +00:00
|
|
|
#ifndef _PATH_ENVIRONMENT
|
2014-09-20 09:09:01 -06:00
|
|
|
# define _PATH_ENVIRONMENT "/etc/environment"
|
2007-12-21 21:53:32 +00:00
|
|
|
#endif /* _PATH_ENVIRONMENT */
|
|
|
|
|
2010-02-20 09:41:49 -05:00
|
|
|
/*
|
|
|
|
* NOTE: _PATH_SUDO_CONF is usually overridden by the Makefile.
|
|
|
|
*/
|
|
|
|
#ifndef _PATH_SUDO_CONF
|
2014-09-20 09:09:01 -06:00
|
|
|
# define _PATH_SUDO_CONF "/etc/sudo.conf"
|
2010-02-20 09:41:49 -05:00
|
|
|
#endif /* _PATH_SUDO_CONF */
|
|
|
|
|
1995-11-17 02:06:25 +00:00
|
|
|
/*
|
2008-11-10 13:07:38 +00:00
|
|
|
* NOTE: _PATH_SUDOERS is usually overridden by the Makefile.
|
1995-11-17 02:06:25 +00:00
|
|
|
*/
|
1999-08-06 09:37:03 +00:00
|
|
|
#ifndef _PATH_SUDOERS
|
2014-09-20 09:09:01 -06:00
|
|
|
# define _PATH_SUDOERS "/etc/sudoers"
|
1999-08-06 09:37:03 +00:00
|
|
|
#endif /* _PATH_SUDOERS */
|
1995-01-16 21:30:48 +00:00
|
|
|
|
2018-02-24 09:23:14 -07:00
|
|
|
/*
|
|
|
|
* NOTE: _PATH_CVTSUDOERS_CONF is usually overridden by the Makefile.
|
|
|
|
*/
|
|
|
|
#ifndef _PATH_CVTSUDOERS_CONF
|
|
|
|
# define _PATH_CVTSUDOERS_CONF "/etc/cvtsudoers.conf"
|
|
|
|
#endif /* _PATH_CVTSUDOERS_CONF */
|
|
|
|
|
1998-09-20 23:10:04 +00:00
|
|
|
/*
|
|
|
|
* The following paths are controlled via the configure script.
|
|
|
|
*/
|
1994-06-05 21:17:18 +00:00
|
|
|
|
1995-01-16 21:30:48 +00:00
|
|
|
/*
|
2014-01-30 15:50:40 -07:00
|
|
|
* Where to store the time stamp files. Defaults to /var/run/sudo/ts,
|
|
|
|
* /var/db/sudo/ts, /var/lib/sudo/ts, /var/adm/sudo/ts or /usr/adm/sudo/ts
|
|
|
|
* depending on what exists on the system.
|
1995-01-16 21:30:48 +00:00
|
|
|
*/
|
1998-09-20 23:10:04 +00:00
|
|
|
#ifndef _PATH_SUDO_TIMEDIR
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_SUDO_TIMEDIR
|
1998-09-20 23:10:04 +00:00
|
|
|
#endif /* _PATH_SUDO_TIMEDIR */
|
1995-01-16 21:30:48 +00:00
|
|
|
|
2014-01-30 15:50:40 -07:00
|
|
|
/*
|
|
|
|
* Where to store the lecture status files. Defaults to /var/db/sudo/lectured,
|
|
|
|
* /var/lib/sudo/lectured, /var/adm/sudo/lectured or /usr/adm/sudo/lectured
|
|
|
|
* depending on what exists on the system.
|
|
|
|
*/
|
|
|
|
#ifndef _PATH_SUDO_LECTURE_DIR
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_SUDO_LECTURE_DIR
|
2014-01-30 15:50:40 -07:00
|
|
|
#endif /* _PATH_SUDO_LECTURE_DIR */
|
|
|
|
|
2009-08-06 00:04:14 +00:00
|
|
|
/*
|
2010-05-30 10:31:38 -04:00
|
|
|
* Where to put the I/O log files. Defaults to /var/log/sudo-io,
|
|
|
|
* /var/adm/sudo-io or /usr/adm/sudo-io depending on what exists.
|
2009-08-06 00:04:14 +00:00
|
|
|
*/
|
2010-05-30 10:31:38 -04:00
|
|
|
#ifndef _PATH_SUDO_IO_LOGDIR
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_SUDO_IO_LOGDIR
|
2010-05-30 10:31:38 -04:00
|
|
|
#endif /* _PATH_SUDO_IO_LOGDIR */
|
2009-08-06 00:04:14 +00:00
|
|
|
|
1995-03-30 02:12:36 +00:00
|
|
|
/*
|
1998-09-20 23:10:04 +00:00
|
|
|
* Where to put the sudo log file when logging to a file. Defaults to
|
|
|
|
* /var/log/sudo.log if /var/log exists, else /var/adm/sudo.log.
|
1995-03-30 02:12:36 +00:00
|
|
|
*/
|
|
|
|
#ifndef _PATH_SUDO_LOGFILE
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_SUDO_LOGFILE
|
1995-03-30 02:12:36 +00:00
|
|
|
#endif /* _PATH_SUDO_LOGFILE */
|
|
|
|
|
2001-12-14 06:17:35 +00:00
|
|
|
#ifndef _PATH_SUDO_SENDMAIL
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_SUDO_SENDMAIL
|
2001-12-14 06:17:35 +00:00
|
|
|
#endif /* _PATH_SUDO_SENDMAIL */
|
1995-01-16 21:30:48 +00:00
|
|
|
|
2004-01-05 03:58:39 +00:00
|
|
|
#ifndef _PATH_SUDO_NOEXEC
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_SUDO_NOEXEC
|
2004-01-05 03:58:39 +00:00
|
|
|
#endif /* _PATH_SUDO_NOEXEC */
|
|
|
|
|
2008-03-02 14:31:57 +00:00
|
|
|
#ifndef _PATH_SUDO_ASKPASS
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_SUDO_ASKPASS
|
2008-03-02 14:31:57 +00:00
|
|
|
#endif /* _PATH_SUDO_ASKPASS */
|
|
|
|
|
2010-02-20 09:41:49 -05:00
|
|
|
#ifndef _PATH_SUDO_PLUGIN_DIR
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_SUDO_PLUGIN_DIR
|
2010-02-20 09:41:49 -05:00
|
|
|
#endif /* _PATH_SUDO_PLUGIN_DIR */
|
|
|
|
|
2017-05-30 10:44:11 -06:00
|
|
|
#ifndef _PATH_SUDO_DEVSEARCH
|
|
|
|
# undef _PATH_SUDO_DEVSEARCH
|
|
|
|
#endif /* _PATH_SUDO_DEVSEARCH */
|
|
|
|
|
1994-03-10 07:45:06 +00:00
|
|
|
#ifndef _PATH_VI
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_VI
|
1994-03-10 07:45:06 +00:00
|
|
|
#endif /* _PATH_VI */
|
1994-06-04 18:47:00 +00:00
|
|
|
|
1995-01-13 17:45:15 +00:00
|
|
|
#ifndef _PATH_MV
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_MV
|
1995-01-13 17:45:15 +00:00
|
|
|
#endif /* _PATH_MV */
|
1996-02-05 02:58:17 +00:00
|
|
|
|
|
|
|
#ifndef _PATH_BSHELL
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_BSHELL
|
1996-02-05 02:58:17 +00:00
|
|
|
#endif /* _PATH_BSHELL */
|
2004-01-21 21:58:24 +00:00
|
|
|
|
|
|
|
#ifndef _PATH_TMP
|
2014-09-20 09:09:01 -06:00
|
|
|
# define _PATH_TMP "/tmp/"
|
2004-01-21 21:58:24 +00:00
|
|
|
#endif /* _PATH_TMP */
|
|
|
|
|
|
|
|
#ifndef _PATH_VARTMP
|
2014-09-20 09:09:01 -06:00
|
|
|
# define _PATH_VARTMP "/var/tmp/"
|
2004-01-21 21:58:24 +00:00
|
|
|
#endif /* _PATH_VARTMP */
|
|
|
|
|
|
|
|
#ifndef _PATH_USRTMP
|
2014-09-20 09:09:01 -06:00
|
|
|
# define _PATH_USRTMP "/usr/tmp/"
|
2004-01-21 21:58:24 +00:00
|
|
|
#endif /* _PATH_USRTMP */
|
2004-08-27 03:44:35 +00:00
|
|
|
|
2010-07-19 12:50:59 -04:00
|
|
|
#ifndef _PATH_MAILDIR
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_MAILDIR
|
2010-07-19 12:50:59 -04:00
|
|
|
#endif /* _PATH_MAILDIR */
|
|
|
|
|
2011-03-15 11:56:49 -04:00
|
|
|
#ifndef _PATH_UTMP
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_UTMP
|
2011-03-15 11:56:49 -04:00
|
|
|
#endif /* _PATH_UTMP */
|
|
|
|
|
2008-02-09 14:30:06 +00:00
|
|
|
#ifndef _PATH_SUDO_SESH
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_SUDO_SESH
|
2008-02-09 14:30:06 +00:00
|
|
|
#endif /* _PATH_SUDO_SESH */
|
|
|
|
|
2004-08-27 03:44:35 +00:00
|
|
|
#ifndef _PATH_LDAP_CONF
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_LDAP_CONF
|
2004-08-27 03:44:35 +00:00
|
|
|
#endif /* _PATH_LDAP_CONF */
|
2004-09-24 00:15:13 +00:00
|
|
|
|
2005-06-26 22:36:51 +00:00
|
|
|
#ifndef _PATH_LDAP_SECRET
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_LDAP_SECRET
|
2005-06-26 22:36:51 +00:00
|
|
|
#endif /* _PATH_LDAP_SECRET */
|
2007-12-28 16:20:45 +00:00
|
|
|
|
2016-06-04 19:52:10 -06:00
|
|
|
#ifndef _PATH_SSSD_CONF
|
|
|
|
# undef _PATH_SSSD_CONF
|
|
|
|
#endif /* _PATH_SSSD_CONF */
|
|
|
|
|
2012-08-10 11:59:26 -04:00
|
|
|
#ifndef _PATH_SSSD_LIB
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_SSSD_LIB
|
2012-08-10 11:59:26 -04:00
|
|
|
#endif /* _PATH_SSSD_LIB */
|
|
|
|
|
2007-12-28 16:20:45 +00:00
|
|
|
#ifndef _PATH_NSSWITCH_CONF
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_NSSWITCH_CONF
|
2007-12-28 16:20:45 +00:00
|
|
|
#endif /* _PATH_NSSWITCH_CONF */
|
2009-03-10 20:44:05 +00:00
|
|
|
|
|
|
|
#ifndef _PATH_NETSVC_CONF
|
2014-09-20 09:09:01 -06:00
|
|
|
# undef _PATH_NETSVC_CONF
|
2009-03-10 20:44:05 +00:00
|
|
|
#endif /* _PATH_NETSVC_CONF */
|
2014-09-20 09:21:51 -06:00
|
|
|
|
2015-02-06 11:01:05 -07:00
|
|
|
#ifndef _PATH_ZONEINFO
|
|
|
|
# undef _PATH_ZONEINFO
|
|
|
|
#endif /* _PATH_ZONEINFO */
|
|
|
|
|
2014-09-20 10:16:46 -06:00
|
|
|
/* On AIX, _PATH_BSHELL in paths.h is /usr/bin/bsh but we want /usr/bin/sh */
|
2014-09-20 09:21:51 -06:00
|
|
|
#ifndef _PATH_SUDO_BSHELL
|
2014-09-20 10:16:46 -06:00
|
|
|
# if defined(_AIX) && defined(HAVE_PATHS_H)
|
2014-09-20 09:21:51 -06:00
|
|
|
# define _PATH_SUDO_BSHELL "/usr/bin/sh"
|
|
|
|
# else
|
|
|
|
# define _PATH_SUDO_BSHELL _PATH_BSHELL
|
|
|
|
# endif
|
|
|
|
#endif /* _PATH_SUDO_BSHELL */
|