Avoid using a leading underbar in defines as they are reserved in

ISO C.
This commit is contained in:
Todd C. Miller
2015-05-21 11:13:20 -06:00
parent 1298ea9107
commit 05a01d4c5d
60 changed files with 202 additions and 202 deletions

View File

@@ -1,7 +1,7 @@
/* config.h.in. Generated from configure.ac by autoheader. */ /* config.h.in. Generated from configure.ac by autoheader. */
#ifndef _SUDO_CONFIG_H #ifndef SUDO_CONFIG_H
#define _SUDO_CONFIG_H #define SUDO_CONFIG_H
/* Define to 1 if the `syslog' function returns a non-zero int to denote /* Define to 1 if the `syslog' function returns a non-zero int to denote
failure. */ failure. */
@@ -1211,4 +1211,4 @@
# define BSD_COMP # define BSD_COMP
#endif /* __svr4__ */ #endif /* __svr4__ */
#endif /* _SUDO_CONFIG_H */ #endif /* SUDO_CONFIG_H */

View File

@@ -4336,12 +4336,12 @@ AH_TEMPLATE(HAVE___NSS_XBYY_BUF_ALLOC, [Define to 1 if you have the `__nss_XbyY_
dnl dnl
dnl Bits to copy verbatim into config.h.in dnl Bits to copy verbatim into config.h.in
dnl dnl
AH_TOP([#ifndef _SUDO_CONFIG_H AH_TOP([#ifndef SUDO_CONFIG_H
#define _SUDO_CONFIG_H]) #define SUDO_CONFIG_H])
AH_BOTTOM([/* BSD compatibility on some SVR4 systems. */ AH_BOTTOM([/* BSD compatibility on some SVR4 systems. */
#ifdef __svr4__ #ifdef __svr4__
# define BSD_COMP # define BSD_COMP
#endif /* __svr4__ */ #endif /* __svr4__ */
#endif /* _SUDO_CONFIG_H */]) #endif /* SUDO_CONFIG_H */])

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _COMPAT_ENDIAN_H #ifndef COMPAT_ENDIAN_H
#define _COMPAT_ENDIAN_H #define COMPAT_ENDIAN_H
#ifndef BYTE_ORDER #ifndef BYTE_ORDER
# undef LITTLE_ENDIAN # undef LITTLE_ENDIAN
@@ -69,4 +69,4 @@
# endif # endif
#endif /* BYTE_ORDER */ #endif /* BYTE_ORDER */
#endif /* _COMPAT_ENDIAN_H */ #endif /* COMPAT_ENDIAN_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _FNMATCH_H #ifndef COMPAT_FNMATCH_H
#define _FNMATCH_H #define COMPAT_FNMATCH_H
#define FNM_NOMATCH 1 /* String does not match pattern */ #define FNM_NOMATCH 1 /* String does not match pattern */
@@ -29,4 +29,4 @@ __dso_public int sudo_fnmatch(const char *pattern, const char *string, int flags
#define fnmatch(_a, _b, _c) sudo_fnmatch((_a), (_b), (_c)) #define fnmatch(_a, _b, _c) sudo_fnmatch((_a), (_b), (_c))
#endif /* _FNMATCH_H */ #endif /* COMPAT_FNMATCH_H */

View File

@@ -20,8 +20,8 @@
* work. * work.
*/ */
#ifndef _COMPAT_GETADDRINFO_H #ifndef COMPAT_GETADDRINFO_H
#define _COMPAT_GETADDRINFO_H #define COMPAT_GETADDRINFO_H
#include <config.h> #include <config.h>
@@ -80,4 +80,4 @@ __dso_public const char *sudo_gai_strerror(int ecode);
#define gai_strerror(_a) sudo_gai_strerror((_a)) #define gai_strerror(_a) sudo_gai_strerror((_a))
#endif /* !HAVE_GETADDRINFO */ #endif /* !HAVE_GETADDRINFO */
#endif /* _COMPAT_GETADDRINFO_H */ #endif /* COMPAT_GETADDRINFO_H */

View File

@@ -31,8 +31,8 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _SUDO_GETOPT_H_ #ifndef COMPAT_GETOPT_H
#define _SUDO_GETOPT_H_ #define COMPAT_GETOPT_H
/* /*
* GNU-like getopt_long()/getopt_long_only() with 4.4BSD optreset extension. * GNU-like getopt_long()/getopt_long_only() with 4.4BSD optreset extension.
@@ -78,4 +78,4 @@ extern int optind;
extern int optopt; extern int optopt;
extern int optreset; extern int optreset;
#endif /* !_SUDO_GETOPT_H_ */ #endif /* !COMPAT_GETOPT_H */

View File

@@ -32,8 +32,8 @@
* @(#)glob.h 8.1 (Berkeley) 6/2/93 * @(#)glob.h 8.1 (Berkeley) 6/2/93
*/ */
#ifndef _GLOB_H_ #ifndef COMPAT_GLOB_H
#define _GLOB_H_ #define COMPAT_GLOB_H
struct stat; struct stat;
typedef struct { typedef struct {
@@ -73,4 +73,4 @@ __dso_public void sudo_globfree(glob_t *);
#define glob(_a, _b, _c, _d) sudo_glob((_a), (_b), (_c), (_d)) #define glob(_a, _b, _c, _d) sudo_glob((_a), (_b), (_c), (_d))
#define globfree(_a) sudo_globfree((_a)) #define globfree(_a) sudo_globfree((_a))
#endif /* !_GLOB_H_ */ #endif /* !COMPAT_GLOB_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _COMPAT_NSS_DBDEFS_H #ifndef COMPAT_NSS_DBDEFS_H
#define _COMPAT_NSS_DBDEFS_H #define COMPAT_NSS_DBDEFS_H
/* /*
* Bits of nss_dbdefs.h and nss_common.h needed to implement * Bits of nss_dbdefs.h and nss_common.h needed to implement
@@ -103,4 +103,4 @@ extern nss_status_t nss_search(nss_db_root_t *, nss_db_initf_t, int, void *);
extern nss_XbyY_buf_t *_nss_XbyY_buf_alloc(int, int); extern nss_XbyY_buf_t *_nss_XbyY_buf_alloc(int, int);
extern void _nss_XbyY_buf_free(nss_XbyY_buf_t *); extern void _nss_XbyY_buf_free(nss_XbyY_buf_t *);
#endif /* _COMPAT_NSS_DBDEFS_H */ #endif /* COMPAT_NSS_DBDEFS_H */

View File

@@ -19,8 +19,8 @@
* by Steve Reid and Wei Dai respectively. * by Steve Reid and Wei Dai respectively.
*/ */
#ifndef _SUDOERS_SHA2_H #ifndef COMPAT_SHA2_H
#define _SUDOERS_SHA2_H #define COMPAT_SHA2_H
#define SHA224_BLOCK_LENGTH 64 #define SHA224_BLOCK_LENGTH 64
#define SHA224_DIGEST_LENGTH 28 #define SHA224_DIGEST_LENGTH 28
@@ -95,4 +95,4 @@ __dso_public void sudo_SHA512Final(uint8_t digest[SHA512_DIGEST_LENGTH], SHA2_CT
#define SHA512Update sudo_SHA512Update #define SHA512Update sudo_SHA512Update
#define SHA512Final sudo_SHA512Final #define SHA512Final sudo_SHA512Final
#endif /* _SUDOERS_SHA2_H */ #endif /* COMPAT_SHA2_H */

View File

@@ -5,8 +5,8 @@
* Public domain. * Public domain.
*/ */
#ifndef _COMPAT_STDBOOL_H_ #ifndef COMPAT_STDBOOL_H
#define _COMPAT_STDBOOL_H_ #define COMPAT_STDBOOL_H
#ifndef __cplusplus #ifndef __cplusplus
@@ -41,4 +41,4 @@ typedef enum {
/* Inform that everything is fine */ /* Inform that everything is fine */
#define __bool_true_false_are_defined 1 #define __bool_true_false_are_defined 1
#endif /* _COMPAT_STDBOOL_H_ */ #endif /* COMPAT_STDBOOL_H */

View File

@@ -14,12 +14,12 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_TIMESPEC_H #ifndef COMPAT_TIMESPEC_H
#define _SUDO_TIMESPEC_H #define COMPAT_TIMESPEC_H
struct timespec { struct timespec {
time_t tv_sec; time_t tv_sec;
long tv_nsec; long tv_nsec;
}; };
#endif /* _SUDO_TIMESPEC_H */ #endif /* COMPAT_TIMESPEC_H */

View File

@@ -15,8 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_ALLOC_H #ifndef SUDO_ALLOC_H
#define _SUDO_ALLOC_H #define SUDO_ALLOC_H
#include <stdarg.h> #include <stdarg.h>
@@ -45,4 +45,4 @@ __dso_public char *sudo_estrndup_v1(const char *src, size_t maxlen) __malloc_lik
#define sudo_estrdup(_a) sudo_estrdup_v1((_a)) #define sudo_estrdup(_a) sudo_estrdup_v1((_a))
#define sudo_estrndup(_a, _b) sudo_estrndup_v1((_a), (_b)) #define sudo_estrndup(_a, _b) sudo_estrndup_v1((_a), (_b))
#endif /* _SUDO_ALLOC_H */ #endif /* SUDO_ALLOC_H */

View File

@@ -19,8 +19,8 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512. * Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/ */
#ifndef _SUDO_COMPAT_H #ifndef SUDO_COMPAT_H
#define _SUDO_COMPAT_H #define SUDO_COMPAT_H
#include <stdio.h> #include <stdio.h>
#ifdef STDC_HEADERS #ifdef STDC_HEADERS
@@ -464,7 +464,7 @@ __dso_public int sudo_sig2str(int signo, char *signame);
# undef sig2str # undef sig2str
# define sig2str(_a, _b) sudo_sig2str((_a), (_b)) # define sig2str(_a, _b) sudo_sig2str((_a), (_b))
#endif /* HAVE_SIG2STR */ #endif /* HAVE_SIG2STR */
#if !defined(HAVE_INET_NTOP) && defined(_SUDO_NET_IFS_C) #if !defined(HAVE_INET_NTOP) && defined(SUDO_NET_IFS_C)
__dso_public char *sudo_inet_ntop(int af, const void *src, char *dst, socklen_t size); __dso_public char *sudo_inet_ntop(int af, const void *src, char *dst, socklen_t size);
# undef inet_ntop # undef inet_ntop
# define inet_ntop(_a, _b, _c, _d) sudo_inet_ntop((_a), (_b), (_c), (_d)) # define inet_ntop(_a, _b, _c, _d) sudo_inet_ntop((_a), (_b), (_c), (_d))
@@ -485,4 +485,4 @@ __dso_public void *sudo_reallocarray(void *ptr, size_t nmemb, size_t size);
# define reallocarray(_a, _b, _c) sudo_reallocarray((_a), (_b), (_c)) # define reallocarray(_a, _b, _c) sudo_reallocarray((_a), (_b), (_c))
#endif /* HAVE_REALLOCARRAY */ #endif /* HAVE_REALLOCARRAY */
#endif /* _SUDO_COMPAT_H */ #endif /* SUDO_COMPAT_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_CONF_H #ifndef SUDO_CONF_H
#define _SUDO_CONF_H #define SUDO_CONF_H
#include "sudo_queue.h" #include "sudo_queue.h"
@@ -78,4 +78,4 @@ __dso_public int sudo_conf_max_groups_v1(void);
#define sudo_conf_group_source() sudo_conf_group_source_v1() #define sudo_conf_group_source() sudo_conf_group_source_v1()
#define sudo_conf_max_groups() sudo_conf_max_groups_v1() #define sudo_conf_max_groups() sudo_conf_max_groups_v1()
#endif /* _SUDO_CONF_H */ #endif /* SUDO_CONF_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_DEBUG_H #ifndef SUDO_DEBUG_H
#define _SUDO_DEBUG_H #define SUDO_DEBUG_H
#include <stdarg.h> #include <stdarg.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
@@ -273,4 +273,4 @@ __dso_public void sudo_debug_write2_v1(int fd, const char *func, const char *fil
#define sudo_debug_vprintf2(_a, _b, _c, _d, _e, _f) sudo_debug_vprintf2_v1((_a), (_b), (_c), (_d), (_e), (_f)) #define sudo_debug_vprintf2(_a, _b, _c, _d, _e, _f) sudo_debug_vprintf2_v1((_a), (_b), (_c), (_d), (_e), (_f))
#define sudo_debug_write2(_a, _b, _c, _d, _e, _f, _g) sudo_debug_write2_v1((_a), (_b), (_c), (_d), (_e), (_f), (_g)) #define sudo_debug_write2(_a, _b, _c, _d, _e, _f, _g) sudo_debug_write2_v1((_a), (_b), (_c), (_d), (_e), (_f), (_g))
#endif /* _SUDO_DEBUG_H */ #endif /* SUDO_DEBUG_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_DSO_H #ifndef SUDO_DSO_H
#define _SUDO_DSO_H #define SUDO_DSO_H
/* Values for sudo_dso_load() mode. */ /* Values for sudo_dso_load() mode. */
#define SUDO_DSO_LAZY 0x1 #define SUDO_DSO_LAZY 0x1
@@ -52,4 +52,4 @@ __dso_public void sudo_dso_preload_table_v1(struct sudo_preload_table *table);
#define sudo_dso_load(_a, _b) sudo_dso_load_v1((_a), (_b)) #define sudo_dso_load(_a, _b) sudo_dso_load_v1((_a), (_b))
#define sudo_dso_preload_table(_a) sudo_dso_preload_table_v1((_a)) #define sudo_dso_preload_table(_a) sudo_dso_preload_table_v1((_a))
#endif /* _SUDO_DSO_H */ #endif /* SUDO_DSO_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_EVENT_H #ifndef SUDO_EVENT_H
#define _SUDO_EVENT_H #define SUDO_EVENT_H
#include "sudo_queue.h" #include "sudo_queue.h"
@@ -160,4 +160,4 @@ int sudo_ev_add_impl(struct sudo_event_base *base, struct sudo_event *ev);
int sudo_ev_del_impl(struct sudo_event_base *base, struct sudo_event *ev); int sudo_ev_del_impl(struct sudo_event_base *base, struct sudo_event *ev);
int sudo_ev_scan_impl(struct sudo_event_base *base, int flags); int sudo_ev_scan_impl(struct sudo_event_base *base, int flags);
#endif /* _SUDO_EVENT_H */ #endif /* SUDO_EVENT_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_FATAL_H_ #ifndef SUDO_FATAL_H
#define _SUDO_FATAL_H_ #define SUDO_FATAL_H
#include <stdarg.h> #include <stdarg.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
@@ -156,4 +156,4 @@ __dso_public void sudo_warn_set_conversation_v1(int (*conv)(int num_msgs, const
# define sudo_warn_gettext(_a) sudo_warn_gettext_v1(NULL, (_a)) # define sudo_warn_gettext(_a) sudo_warn_gettext_v1(NULL, (_a))
#endif #endif
#endif /* _SUDO_FATAL_H_ */ #endif /* SUDO_FATAL_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_GETTEXT_H #ifndef SUDO_GETTEXT_H
#define _SUDO_GETTEXT_H #define SUDO_GETTEXT_H
/* /*
* Solaris locale.h includes libintl.h which causes problems when we * Solaris locale.h includes libintl.h which causes problems when we
@@ -72,4 +72,4 @@
#endif /* HAVE_LIBINTL_H */ #endif /* HAVE_LIBINTL_H */
#endif /* _SUDO_GETTEXT_H */ #endif /* SUDO_GETTEXT_H */

View File

@@ -17,8 +17,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _SUDO_LBUF_H #ifndef SUDO_LBUF_H
#define _SUDO_LBUF_H #define SUDO_LBUF_H
/* /*
* Line buffer struct. * Line buffer struct.
@@ -47,4 +47,4 @@ __dso_public void sudo_lbuf_print_v1(struct sudo_lbuf *lbuf);
#define sudo_lbuf_append_quoted sudo_lbuf_append_quoted_v1 #define sudo_lbuf_append_quoted sudo_lbuf_append_quoted_v1
#define sudo_lbuf_print(_a) sudo_lbuf_print_v1((_a)) #define sudo_lbuf_print(_a) sudo_lbuf_print_v1((_a))
#endif /* _SUDO_LBUF_H */ #endif /* SUDO_LBUF_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_PLUGIN_H #ifndef SUDO_PLUGIN_H
#define _SUDO_PLUGIN_H #define SUDO_PLUGIN_H
/* API version major/minor */ /* API version major/minor */
#define SUDO_API_VERSION_MAJOR 1 #define SUDO_API_VERSION_MAJOR 1
@@ -192,4 +192,4 @@ struct sudoers_group_plugin {
int (*query)(const char *user, const char *group, const struct passwd *pwd); int (*query)(const char *user, const char *group, const struct passwd *pwd);
}; };
#endif /* _SUDO_PLUGIN_H */ #endif /* SUDO_PLUGIN_H */

View File

@@ -30,8 +30,8 @@
* $FreeBSD: head/sys/sys/queue.h 251887 2013-06-18 02:57:56Z lstewart $ * $FreeBSD: head/sys/sys/queue.h 251887 2013-06-18 02:57:56Z lstewart $
*/ */
#ifndef _SUDO_QUEUE_H_ #ifndef SUDO_QUEUE_H
#define _SUDO_QUEUE_H_ #define SUDO_QUEUE_H
/* /*
* This file defines four types of data structures: singly-linked lists, * This file defines four types of data structures: singly-linked lists,
@@ -803,4 +803,4 @@ struct { \
(head)->tqh_last = last; \ (head)->tqh_last = last; \
} while (0) } while (0)
#endif /* !_SUDO_QUEUE_H_ */ #endif /* !SUDO_QUEUE_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_UTIL_H #ifndef SUDO_UTIL_H
#define _SUDO_UTIL_H #define SUDO_UTIL_H
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
# include <stdbool.h> # include <stdbool.h>
@@ -232,4 +232,4 @@ __dso_public bool sudo_term_restore_v1(int fd, bool flush);
__dso_public void sudo_get_ttysize_v1(int *rowp, int *colp); __dso_public void sudo_get_ttysize_v1(int *rowp, int *colp);
#define sudo_get_ttysize(_a, _b) sudo_get_ttysize_v1((_a), (_b)) #define sudo_get_ttysize(_a, _b) sudo_get_ttysize_v1((_a), (_b))
#endif /* _SUDO_UTIL_H */ #endif /* SUDO_UTIL_H */

View File

@@ -49,7 +49,7 @@ static sudo_conv_t sudo_warn_conversation;
static bool (*sudo_warn_setlocale)(bool, int *); static bool (*sudo_warn_setlocale)(bool, int *);
static bool (*sudo_warn_setlocale_prev)(bool, int *); static bool (*sudo_warn_setlocale_prev)(bool, int *);
static void _warning(int errnum, const char *fmt, va_list ap); static void warning(int errnum, const char *fmt, va_list ap);
static void static void
do_cleanup(void) do_cleanup(void)
@@ -70,7 +70,7 @@ sudo_fatal_nodebug_v1(const char *fmt, ...)
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
_warning(errno, fmt, ap); warning(errno, fmt, ap);
va_end(ap); va_end(ap);
do_cleanup(); do_cleanup();
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@@ -82,7 +82,7 @@ sudo_fatalx_nodebug_v1(const char *fmt, ...)
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
_warning(0, fmt, ap); warning(0, fmt, ap);
va_end(ap); va_end(ap);
do_cleanup(); do_cleanup();
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@@ -91,7 +91,7 @@ sudo_fatalx_nodebug_v1(const char *fmt, ...)
void void
sudo_vfatal_nodebug_v1(const char *fmt, va_list ap) sudo_vfatal_nodebug_v1(const char *fmt, va_list ap)
{ {
_warning(errno, fmt, ap); warning(errno, fmt, ap);
do_cleanup(); do_cleanup();
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@@ -99,7 +99,7 @@ sudo_vfatal_nodebug_v1(const char *fmt, va_list ap)
void void
sudo_vfatalx_nodebug_v1(const char *fmt, va_list ap) sudo_vfatalx_nodebug_v1(const char *fmt, va_list ap)
{ {
_warning(0, fmt, ap); warning(0, fmt, ap);
do_cleanup(); do_cleanup();
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@@ -110,7 +110,7 @@ sudo_warn_nodebug_v1(const char *fmt, ...)
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
_warning(errno, fmt, ap); warning(errno, fmt, ap);
va_end(ap); va_end(ap);
} }
@@ -119,24 +119,24 @@ sudo_warnx_nodebug_v1(const char *fmt, ...)
{ {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
_warning(0, fmt, ap); warning(0, fmt, ap);
va_end(ap); va_end(ap);
} }
void void
sudo_vwarn_nodebug_v1(const char *fmt, va_list ap) sudo_vwarn_nodebug_v1(const char *fmt, va_list ap)
{ {
_warning(errno, fmt, ap); warning(errno, fmt, ap);
} }
void void
sudo_vwarnx_nodebug_v1(const char *fmt, va_list ap) sudo_vwarnx_nodebug_v1(const char *fmt, va_list ap)
{ {
_warning(0, fmt, ap); warning(0, fmt, ap);
} }
static void static void
_warning(int errnum, const char *fmt, va_list ap) warning(int errnum, const char *fmt, va_list ap)
{ {
int cookie; int cookie;

View File

@@ -15,10 +15,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_BSM_AUDIT_H #ifndef SUDOERS_BSM_AUDIT_H
#define _SUDOERS_BSM_AUDIT_H #define SUDOERS_BSM_AUDIT_H
int bsm_audit_success(char *argv[]); int bsm_audit_success(char *argv[]);
int bsm_audit_failure(char *argv[], char const * const, va_list); int bsm_audit_failure(char *argv[], char const * const, va_list);
#endif /* _SUDOERS_BSM_AUDIT_H */ #endif /* SUDOERS_BSM_AUDIT_H */

View File

@@ -19,8 +19,8 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512. * Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/ */
#ifndef _SUDOERS_CHECK_H #ifndef SUDOERS_CHECK_H
#define _SUDOERS_CHECK_H #define SUDOERS_CHECK_H
/* Status codes for timestamp_status() */ /* Status codes for timestamp_status() */
#define TS_CURRENT 0 #define TS_CURRENT 0
@@ -65,4 +65,4 @@ bool update_timestamp(struct passwd *pw);
int build_timestamp(struct passwd *pw); int build_timestamp(struct passwd *pw);
int timestamp_status(struct passwd *pw); int timestamp_status(struct passwd *pw);
#endif /* _SUDOERS_CHECK_H */ #endif /* SUDOERS_CHECK_H */

View File

@@ -19,8 +19,8 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512. * Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/ */
#ifndef _SUDOERS_DEFAULTS_H #ifndef SUDOERS_DEFAULTS_H
#define _SUDOERS_DEFAULTS_H #define SUDOERS_DEFAULTS_H
#include <def_data.h> #include <def_data.h>
@@ -117,4 +117,4 @@ bool check_defaults(int what, bool quiet);
extern struct sudo_defs_types sudo_defs_table[]; extern struct sudo_defs_types sudo_defs_table[];
#endif /* _SUDOERS_DEFAULTS_H */ #endif /* SUDOERS_DEFAULTS_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_INS_2001_H #ifndef SUDOERS_INS_2001_H
#define _SUDOERS_INS_2001_H #define SUDOERS_INS_2001_H
/* /*
* HAL insults (paraphrased) from 2001. * HAL insults (paraphrased) from 2001.
@@ -30,4 +30,4 @@
"This mission is too important for me to allow you to jeopardize it.", "This mission is too important for me to allow you to jeopardize it.",
"I feel much better now.", "I feel much better now.",
#endif /* _SUDOERS_INS_2001_H */ #endif /* SUDOERS_INS_2001_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_INS_CLASSIC_H #ifndef SUDOERS_INS_CLASSIC_H
#define _SUDOERS_INS_CLASSIC_H #define SUDOERS_INS_CLASSIC_H
/* /*
* Insults from the original sudo(8). * Insults from the original sudo(8).
@@ -34,4 +34,4 @@
"Do you think like you type?", "Do you think like you type?",
"Your mind just hasn't been the same since the electro-shock, has it?", "Your mind just hasn't been the same since the electro-shock, has it?",
#endif /* _SUDOERS_INS_CLASSIC_H */ #endif /* SUDOERS_INS_CLASSIC_H */

View File

@@ -15,8 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_INS_CSOPS_H #ifndef SUDOERS_INS_CSOPS_H
#define _SUDOERS_INS_CSOPS_H #define SUDOERS_INS_CSOPS_H
/* /*
* CSOps insults (may be site dependent). * CSOps insults (may be site dependent).
@@ -36,4 +36,4 @@
"Have you considered trying to match wits with a rutabaga?", "Have you considered trying to match wits with a rutabaga?",
"You speak an infinite deal of nothing", "You speak an infinite deal of nothing",
#endif /* _SUDOERS_INS_CSOPS_H */ #endif /* SUDOERS_INS_CSOPS_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_INS_GOONS_H #ifndef SUDOERS_INS_GOONS_H
#define _SUDOERS_INS_GOONS_H #define SUDOERS_INS_GOONS_H
/* /*
* Insults from the "Goon Show." * Insults from the "Goon Show."
@@ -45,4 +45,4 @@
"It's only your word against mine.", "It's only your word against mine.",
"I think ... err ... I think ... I think I'll go home", "I think ... err ... I think ... I think I'll go home",
#endif /* _SUDOERS_INS_GOONS_H */ #endif /* SUDOERS_INS_GOONS_H */

View File

@@ -15,8 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_INSULTS_H #ifndef SUDOERS_INSULTS_H
#define _SUDOERS_INSULTS_H #define SUDOERS_INSULTS_H
#if defined(HAL_INSULTS) || defined(GOONS_INSULTS) || defined(CLASSIC_INSULTS) || defined(CSOPS_INSULTS) #if defined(HAL_INSULTS) || defined(GOONS_INSULTS) || defined(CLASSIC_INSULTS) || defined(CSOPS_INSULTS)
@@ -58,4 +58,4 @@ char *insults[] = {
#endif /* HAL_INSULTS || GOONS_INSULTS || CLASSIC_INSULTS || CSOPS_INSULTS */ #endif /* HAL_INSULTS || GOONS_INSULTS || CLASSIC_INSULTS || CSOPS_INSULTS */
#endif /* _SUDOERS_INSULTS_H */ #endif /* SUDOERS_INSULTS_H */

View File

@@ -19,8 +19,8 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512. * Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/ */
#ifndef _SUDOERS_INTERFACES_H #ifndef SUDOERS_INTERFACES_H
#define _SUDOERS_INTERFACES_H #define SUDOERS_INTERFACES_H
/* /*
* Union to hold either strucr in_addr or in6_add * Union to hold either strucr in_addr or in6_add
@@ -52,4 +52,4 @@ void dump_interfaces(const char *);
void set_interfaces(const char *); void set_interfaces(const char *);
struct interface_list *get_interfaces(void); struct interface_list *get_interfaces(void);
#endif /* _SUDOERS_INTERFACES_H */ #endif /* SUDOERS_INTERFACES_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_IOLOG_H #ifndef SUDOERS_IOLOG_H
#define _SUDOERS_IOLOG_H #define SUDOERS_IOLOG_H
/* /*
* I/O log fd numbers as stored in the timing file. * I/O log fd numbers as stored in the timing file.
@@ -56,4 +56,4 @@ static struct io_log_file io_log_files[] = {
{ false, NULL } /* IOFD_MAX */ { false, NULL } /* IOFD_MAX */
}; };
#endif /* _SUDOERS_IOLOG_H */ #endif /* SUDOERS_IOLOG_H */

View File

@@ -14,9 +14,9 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_LINUX_AUDIT_H #ifndef SUDOERS_LINUX_AUDIT_H
#define _SUDOERS_LINUX_AUDIT_H #define SUDOERS_LINUX_AUDIT_H
int linux_audit_command(char *argv[], int result); int linux_audit_command(char *argv[], int result);
#endif /* _SUDOERS_LINUX_AUDIT_H */ #endif /* SUDOERS_LINUX_AUDIT_H */

View File

@@ -15,8 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_LOGGING_H #ifndef SUDOERS_LOGGING_H
#define _SUDOERS_LOGGING_H #define SUDOERS_LOGGING_H
#include <syslog.h> #include <syslog.h>
#ifdef __STDC__ #ifdef __STDC__
@@ -58,7 +58,7 @@
*/ */
#define LOG_INDENT " " #define LOG_INDENT " "
#ifndef _SUDO_MAIN #ifndef SUDO_MAIN
/* XXX - needed for auditing */ /* XXX - needed for auditing */
extern int NewArgc; extern int NewArgc;
extern char **NewArgv; extern char **NewArgv;
@@ -78,4 +78,4 @@ void log_warningx(int flags, const char *fmt, ...) __printflike(2, 3);
void sudoers_initlocale(const char *ulocale, const char *slocale); void sudoers_initlocale(const char *ulocale, const char *slocale);
void writeln_wrap(FILE *fp, char *line, size_t len, size_t maxlen); void writeln_wrap(FILE *fp, char *line, size_t len, size_t maxlen);
#endif /* _SUDOERS_LOGGING_H */ #endif /* SUDOERS_LOGGING_H */

View File

@@ -63,7 +63,7 @@ static int sudo_file_open(struct sudo_nss *);
static int sudo_file_parse(struct sudo_nss *); static int sudo_file_parse(struct sudo_nss *);
static int sudo_file_setdefs(struct sudo_nss *); static int sudo_file_setdefs(struct sudo_nss *);
static void print_member(struct sudo_lbuf *lbuf, struct member *m, int alias_type); static void print_member(struct sudo_lbuf *lbuf, struct member *m, int alias_type);
static void print_member2(struct sudo_lbuf *lbuf, struct member *m, const char *separator, int alias_type); static void print_member_sep(struct sudo_lbuf *lbuf, struct member *m, const char *separator, int alias_type);
/* sudo_nss implementation */ /* sudo_nss implementation */
struct sudo_nss sudo_nss_file = { struct sudo_nss sudo_nss_file = {
@@ -537,7 +537,7 @@ sudo_file_display_priv_long(struct passwd *pw, struct userspec *us,
sudo_lbuf_append(lbuf, _(" Commands:\n")); sudo_lbuf_append(lbuf, _(" Commands:\n"));
} }
sudo_lbuf_append(lbuf, "\t"); sudo_lbuf_append(lbuf, "\t");
print_member2(lbuf, cs->cmnd, "\n\t", CMNDALIAS); print_member_sep(lbuf, cs->cmnd, "\n\t", CMNDALIAS);
sudo_lbuf_append(lbuf, "\n"); sudo_lbuf_append(lbuf, "\n");
prev_cs = cs; prev_cs = cs;
nfound++; nfound++;
@@ -752,13 +752,13 @@ done:
* Print the contents of a struct member to stdout * Print the contents of a struct member to stdout
*/ */
static void static void
_print_member(struct sudo_lbuf *lbuf, char *name, int type, int negated, print_member_int(struct sudo_lbuf *lbuf, char *name, int type, int negated,
const char *separator, int alias_type) const char *separator, int alias_type)
{ {
struct alias *a; struct alias *a;
struct member *m; struct member *m;
struct sudo_command *c; struct sudo_command *c;
debug_decl(_print_member, SUDOERS_DEBUG_NSS) debug_decl(print_member_int, SUDOERS_DEBUG_NSS)
switch (type) { switch (type) {
case ALL: case ALL:
@@ -782,7 +782,7 @@ _print_member(struct sudo_lbuf *lbuf, char *name, int type, int negated,
TAILQ_FOREACH(m, &a->members, entries) { TAILQ_FOREACH(m, &a->members, entries) {
if (m != TAILQ_FIRST(&a->members)) if (m != TAILQ_FIRST(&a->members))
sudo_lbuf_append(lbuf, "%s", separator); sudo_lbuf_append(lbuf, "%s", separator);
_print_member(lbuf, m->name, m->type, print_member_int(lbuf, m->name, m->type,
negated ? !m->negated : m->negated, separator, negated ? !m->negated : m->negated, separator,
alias_type); alias_type);
} }
@@ -800,12 +800,12 @@ _print_member(struct sudo_lbuf *lbuf, char *name, int type, int negated,
static void static void
print_member(struct sudo_lbuf *lbuf, struct member *m, int alias_type) print_member(struct sudo_lbuf *lbuf, struct member *m, int alias_type)
{ {
_print_member(lbuf, m->name, m->type, m->negated, ", ", alias_type); print_member_int(lbuf, m->name, m->type, m->negated, ", ", alias_type);
} }
static void static void
print_member2(struct sudo_lbuf *lbuf, struct member *m, const char *separator, print_member_sep(struct sudo_lbuf *lbuf, struct member *m,
int alias_type) const char *separator, int alias_type)
{ {
_print_member(lbuf, m->name, m->type, m->negated, separator, alias_type); print_member_int(lbuf, m->name, m->type, m->negated, separator, alias_type);
} }

View File

@@ -15,8 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_PARSE_H #ifndef SUDOERS_PARSE_H
#define _SUDOERS_PARSE_H #define SUDOERS_PARSE_H
#undef UNSPEC #undef UNSPEC
#define UNSPEC -1 #define UNSPEC -1
@@ -223,4 +223,4 @@ int hexchar(const char *s);
/* base64.c */ /* base64.c */
size_t base64_decode(const char *str, unsigned char *dst, size_t dsize); size_t base64_decode(const char *str, unsigned char *dst, size_t dsize);
#endif /* _SUDOERS_PARSE_H */ #endif /* SUDOERS_PARSE_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_PWUTIL_H #ifndef SUDOERS_PWUTIL_H
#define _SUDOERS_PWUTIL_H #define SUDOERS_PWUTIL_H
#define ptr_to_item(p) ((struct cache_item *)((char *)p - offsetof(struct cache_item_##p, p))) #define ptr_to_item(p) ((struct cache_item *)((char *)p - offsetof(struct cache_item_##p, p)))
@@ -62,4 +62,4 @@ struct cache_item *sudo_make_gritem(gid_t gid, const char *group);
struct cache_item *sudo_make_grlist_item(const struct passwd *pw, char * const *groups, char * const *gids); struct cache_item *sudo_make_grlist_item(const struct passwd *pw, char * const *groups, char * const *gids);
struct cache_item *sudo_make_pwitem(uid_t uid, const char *user); struct cache_item *sudo_make_pwitem(uid_t uid, const char *user);
#endif /* _SUDOERS_PWUTIL_H */ #endif /* SUDOERS_PWUTIL_H */

View File

@@ -60,7 +60,7 @@
static void rbrepair(struct rbtree *, struct rbnode *); static void rbrepair(struct rbtree *, struct rbnode *);
static void rotate_left(struct rbtree *, struct rbnode *); static void rotate_left(struct rbtree *, struct rbnode *);
static void rotate_right(struct rbtree *, struct rbnode *); static void rotate_right(struct rbtree *, struct rbnode *);
static void _rbdestroy(struct rbtree *, struct rbnode *, void (*)(void *)); static void rbdestroy_int(struct rbtree *, struct rbnode *, void (*)(void *));
/* /*
* Red-Black tree, see http://en.wikipedia.org/wiki/Red-black_tree * Red-Black tree, see http://en.wikipedia.org/wiki/Red-black_tree
@@ -333,12 +333,12 @@ rbsuccessor(struct rbtree *tree, struct rbnode *node)
* Recursive portion of rbdestroy(). * Recursive portion of rbdestroy().
*/ */
static void static void
_rbdestroy(struct rbtree *tree, struct rbnode *node, void (*destroy)(void *)) rbdestroy_int(struct rbtree *tree, struct rbnode *node, void (*destroy)(void *))
{ {
debug_decl(_rbdestroy, SUDOERS_DEBUG_RBTREE) debug_decl(rbdestroy_int, SUDOERS_DEBUG_RBTREE)
if (node != rbnil(tree)) { if (node != rbnil(tree)) {
_rbdestroy(tree, node->left, destroy); rbdestroy_int(tree, node->left, destroy);
_rbdestroy(tree, node->right, destroy); rbdestroy_int(tree, node->right, destroy);
if (destroy != NULL) if (destroy != NULL)
destroy(node->data); destroy(node->data);
sudo_efree(node); sudo_efree(node);
@@ -354,7 +354,7 @@ void
rbdestroy(struct rbtree *tree, void (*destroy)(void *)) rbdestroy(struct rbtree *tree, void (*destroy)(void *))
{ {
debug_decl(rbdestroy, SUDOERS_DEBUG_RBTREE) debug_decl(rbdestroy, SUDOERS_DEBUG_RBTREE)
_rbdestroy(tree, rbfirst(tree), destroy); rbdestroy_int(tree, rbfirst(tree), destroy);
sudo_efree(tree); sudo_efree(tree);
debug_return; debug_return;
} }

View File

@@ -15,8 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_REDBLACK_H #ifndef SUDOERS_REDBLACK_H
#define _SUDOERS_REDBLACK_H #define SUDOERS_REDBLACK_H
enum rbcolor { enum rbcolor {
red, red,
@@ -55,4 +55,4 @@ struct rbnode *rbinsert(struct rbtree *, void *);
struct rbtree *rbcreate(int (*)(const void *, const void *)); struct rbtree *rbcreate(int (*)(const void *, const void *));
void rbdestroy(struct rbtree *, void (*)(void *)); void rbdestroy(struct rbtree *, void (*)(void *));
#endif /* _SUDOERS_REDBLACK_H */ #endif /* SUDOERS_REDBLACK_H */

View File

@@ -41,7 +41,7 @@
#define SUDO_ERROR_WRAP 0 #define SUDO_ERROR_WRAP 0
#define _SUDO_MAIN #define SUDO_MAIN
#include "sudoers.h" #include "sudoers.h"
#include "def_data.c" #include "def_data.c"

View File

@@ -14,10 +14,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_SOLARIS_AUDIT_H #ifndef SUDOERS_SOLARIS_AUDIT_H
#define _SUDOERS_SOLARIS_AUDIT_H #define SUDOERS_SOLARIS_AUDIT_H
int solaris_audit_success(int argc, char *argv[]); int solaris_audit_success(int argc, char *argv[]);
int solaris_audit_failure(int argc, char *argv[], char const *const fmt, va_list); int solaris_audit_failure(int argc, char *argv[], char const *const fmt, va_list);
#endif /* _SUDOERS_SOLARIS_AUDIT_H */ #endif /* SUDOERS_SOLARIS_AUDIT_H */

View File

@@ -159,11 +159,11 @@ sudo_sss_rulecpy(struct sss_sudo_rule *dst, const struct sss_sudo_rule *src)
debug_return; debug_return;
} }
#define _SUDO_SSS_FILTER_INCLUDE 0 #define SUDO_SSS_FILTER_INCLUDE 0
#define _SUDO_SSS_FILTER_EXCLUDE 1 #define SUDO_SSS_FILTER_EXCLUDE 1
#define _SUDO_SSS_STATE_HOSTMATCH 0x01 #define SUDO_SSS_STATE_HOSTMATCH 0x01
#define _SUDO_SSS_STATE_USERMATCH 0x02 #define SUDO_SSS_STATE_USERMATCH 0x02
static struct sss_sudo_result * static struct sss_sudo_result *
sudo_sss_filter_result(struct sudo_sss_handle *handle, sudo_sss_filter_result(struct sudo_sss_handle *handle,
@@ -178,7 +178,7 @@ sudo_sss_filter_result(struct sudo_sss_handle *handle,
sudo_debug_printf(SUDO_DEBUG_DEBUG, "in_res=%p, count=%u, act=%s", sudo_debug_printf(SUDO_DEBUG_DEBUG, "in_res=%p, count=%u, act=%s",
in_res, in_res ? in_res->num_rules : 0, in_res, in_res ? in_res->num_rules : 0,
act == _SUDO_SSS_FILTER_EXCLUDE ? "EXCLUDE" : "INCLUDE"); act == SUDO_SSS_FILTER_EXCLUDE ? "EXCLUDE" : "INCLUDE");
if (in_res == NULL) if (in_res == NULL)
debug_return_ptr(NULL); debug_return_ptr(NULL);
@@ -193,11 +193,11 @@ sudo_sss_filter_result(struct sudo_sss_handle *handle,
for (i = l = 0; i < in_res->num_rules; ++i) { for (i = l = 0; i < in_res->num_rules; ++i) {
r = filterp(handle, in_res->rules + i, filterp_arg); r = filterp(handle, in_res->rules + i, filterp_arg);
if (( r && act == _SUDO_SSS_FILTER_INCLUDE) || if (( r && act == SUDO_SSS_FILTER_INCLUDE) ||
(!r && act == _SUDO_SSS_FILTER_EXCLUDE)) { (!r && act == SUDO_SSS_FILTER_EXCLUDE)) {
sudo_debug_printf(SUDO_DEBUG_DEBUG, sudo_debug_printf(SUDO_DEBUG_DEBUG,
"COPY (%s): %p[%u] => %p[%u] (= %p)", "COPY (%s): %p[%u] => %p[%u] (= %p)",
act == _SUDO_SSS_FILTER_EXCLUDE ? "not excluded" : "included", act == SUDO_SSS_FILTER_EXCLUDE ? "not excluded" : "included",
in_res->rules, i, out_res->rules, l, in_res->rules + i); in_res->rules, i, out_res->rules, l, in_res->rules + i);
sudo_sss_rulecpy(out_res->rules + l, in_res->rules + i); sudo_sss_rulecpy(out_res->rules + l, in_res->rules + i);
@@ -683,7 +683,7 @@ sudo_sss_result_get(struct sudo_nss *nss, struct passwd *pw, uint32_t *state)
if (u_sss_result != NULL) { if (u_sss_result != NULL) {
if (state != NULL) { if (state != NULL) {
sudo_debug_printf(SUDO_DEBUG_DEBUG, "state |= USERMATCH"); sudo_debug_printf(SUDO_DEBUG_DEBUG, "state |= USERMATCH");
*state |= _SUDO_SSS_STATE_USERMATCH; *state |= SUDO_SSS_STATE_USERMATCH;
} }
sudo_debug_printf(SUDO_DEBUG_INFO, "Received %u rule(s)", sudo_debug_printf(SUDO_DEBUG_INFO, "Received %u rule(s)",
u_sss_result->num_rules); u_sss_result->num_rules);
@@ -707,13 +707,13 @@ sudo_sss_result_get(struct sudo_nss *nss, struct passwd *pw, uint32_t *state)
} }
f_sss_result = sudo_sss_filter_result(handle, u_sss_result, f_sss_result = sudo_sss_filter_result(handle, u_sss_result,
sudo_sss_result_filterp, _SUDO_SSS_FILTER_INCLUDE, NULL); sudo_sss_result_filterp, SUDO_SSS_FILTER_INCLUDE, NULL);
if (f_sss_result != NULL) { if (f_sss_result != NULL) {
if (f_sss_result->num_rules > 0) { if (f_sss_result->num_rules > 0) {
if (state != NULL) { if (state != NULL) {
sudo_debug_printf(SUDO_DEBUG_DEBUG, "state |= HOSTMATCH"); sudo_debug_printf(SUDO_DEBUG_DEBUG, "state |= HOSTMATCH");
*state |= _SUDO_SSS_STATE_HOSTMATCH; *state |= SUDO_SSS_STATE_HOSTMATCH;
} }
} }
sudo_debug_printf(SUDO_DEBUG_DEBUG, sudo_debug_printf(SUDO_DEBUG_DEBUG,
@@ -1086,9 +1086,9 @@ done:
SET(ret, FLAG_NO_CHECK); SET(ret, FLAG_NO_CHECK);
} }
if (state & _SUDO_SSS_STATE_USERMATCH) if (state & SUDO_SSS_STATE_USERMATCH)
CLR(ret, FLAG_NO_USER); CLR(ret, FLAG_NO_USER);
if (state & _SUDO_SSS_STATE_HOSTMATCH) if (state & SUDO_SSS_STATE_HOSTMATCH)
CLR(ret, FLAG_NO_HOST); CLR(ret, FLAG_NO_HOST);
sudo_debug_printf(SUDO_DEBUG_DEBUG, "sudo_sss_lookup(%d)=0x%02x", sudo_debug_printf(SUDO_DEBUG_DEBUG, "sudo_sss_lookup(%d)=0x%02x",

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_NSS_H #ifndef SUDOERS_NSS_H
#define _SUDOERS_NSS_H #define SUDOERS_NSS_H
struct sudo_lbuf; struct sudo_lbuf;
struct passwd; struct passwd;
@@ -40,4 +40,4 @@ TAILQ_HEAD(sudo_nss_list, sudo_nss);
struct sudo_nss_list *sudo_read_nss(void); struct sudo_nss_list *sudo_read_nss(void);
#endif /* _SUDOERS_NSS_H */ #endif /* SUDOERS_NSS_H */

View File

@@ -34,7 +34,7 @@
#include "sudo_debug.h" #include "sudo_debug.h"
static int static int
_sudo_printf(int msg_type, const char *fmt, ...) sudo_printf_int(int msg_type, const char *fmt, ...)
{ {
va_list ap; va_list ap;
int len; int len;
@@ -59,4 +59,4 @@ _sudo_printf(int msg_type, const char *fmt, ...)
return len; return len;
} }
sudo_printf_t sudo_printf = _sudo_printf; sudo_printf_t sudo_printf = sudo_printf_int;

View File

@@ -18,7 +18,7 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512. * Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/ */
#define _SUDO_MAIN #define SUDO_MAIN
#ifdef __TANDEM #ifdef __TANDEM
# include <floss.h> # include <floss.h>

View File

@@ -19,8 +19,8 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512. * Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/ */
#ifndef _SUDOERS_SUDOERS_H #ifndef SUDOERS_SUDOERS_H
#define _SUDOERS_SUDOERS_H #define SUDOERS_SUDOERS_H
#include <limits.h> #include <limits.h>
#ifdef HAVE_STDBOOL_H #ifdef HAVE_STDBOOL_H
@@ -362,7 +362,7 @@ void group_plugin_unload(void);
int group_plugin_query(const char *user, const char *group, int group_plugin_query(const char *user, const char *group,
const struct passwd *pwd); const struct passwd *pwd);
#ifndef _SUDO_MAIN #ifndef SUDO_MAIN
extern struct sudo_user sudo_user; extern struct sudo_user sudo_user;
extern struct passwd *list_pw; extern struct passwd *list_pw;
extern int long_list; extern int long_list;
@@ -372,4 +372,4 @@ extern sudo_conv_t sudo_conv;
extern sudo_printf_t sudo_printf; extern sudo_printf_t sudo_printf;
#endif #endif
#endif /* _SUDOERS_SUDOERS_H */ #endif /* SUDOERS_SUDOERS_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_DEBUG_H #ifndef SUDOERS_DEBUG_H
#define _SUDOERS_DEBUG_H #define SUDOERS_DEBUG_H
#include "sudo_debug.h" #include "sudo_debug.h"
@@ -43,4 +43,4 @@ extern unsigned int sudoers_subsystem_ids[];
#define SUDOERS_DEBUG_SSSD (sudoers_subsystem_ids[16]) /* sudoers SSSD */ #define SUDOERS_DEBUG_SSSD (sudoers_subsystem_ids[16]) /* sudoers SSSD */
#define SUDOERS_DEBUG_UTIL (sudoers_subsystem_ids[17]) /* utility functions */ #define SUDOERS_DEBUG_UTIL (sudoers_subsystem_ids[17]) /* utility functions */
#endif /* _SUDOERS_DEBUG_H */ #endif /* SUDOERS_DEBUG_H */

View File

@@ -65,9 +65,9 @@
* 44 sudo 1.8.13, added MAIL/NOMAIL tags. * 44 sudo 1.8.13, added MAIL/NOMAIL tags.
*/ */
#ifndef _SUDOERS_VERSION_H #ifndef SUDOERS_VERSION_H
#define _SUDOERS_VERSION_H #define SUDOERS_VERSION_H
#define SUDOERS_GRAMMAR_VERSION 44 #define SUDOERS_GRAMMAR_VERSION 44
#endif /* _SUDOERS_VERSION_H */ #endif /* SUDOERS_VERSION_H */

View File

@@ -21,7 +21,7 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512. * Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/ */
#define _SUDO_MAIN #define SUDO_MAIN
#include <config.h> #include <config.h>

View File

@@ -2031,7 +2031,7 @@ static bool continued, sawspace;
static int prev_state; static int prev_state;
static int digest_len; static int digest_len;
static bool _push_include(char *, bool); static bool push_include_int(char *, bool);
static bool pop_include(void); static bool pop_include(void);
static char *parse_include(char *); static char *parse_include(char *);
@@ -2044,8 +2044,8 @@ int (*trace_print)(const char *msg) = sudoers_trace_print;
#define ECHO ignore_result(fwrite(sudoerstext, sudoersleng, 1, sudoersout)) #define ECHO ignore_result(fwrite(sudoerstext, sudoersleng, 1, sudoersout))
#define push_include(_p) (_push_include((_p), false)) #define push_include(_p) (push_include_int((_p), false))
#define push_includedir(_p) (_push_include((_p), true)) #define push_includedir(_p) (push_include_int((_p), true))
#define YY_NO_INPUT 1 #define YY_NO_INPUT 1
#define YY_NO_UNPUT 1 #define YY_NO_UNPUT 1
#define GOTDEFS 1 #define GOTDEFS 1
@@ -4182,11 +4182,11 @@ init_lexer(void)
} }
static bool static bool
_push_include(char *path, bool isdir) push_include_int(char *path, bool isdir)
{ {
struct path_list *pl; struct path_list *pl;
FILE *fp; FILE *fp;
debug_decl(_push_include, SUDOERS_DEBUG_PARSER) debug_decl(push_include_int, SUDOERS_DEBUG_PARSER)
/* push current state onto stack */ /* push current state onto stack */
if (idepth >= istacksize) { if (idepth >= istacksize) {

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDOERS_TOKE_H #ifndef SUDOERS_TOKE_H
#define _SUDOERS_TOKE_H #define SUDOERS_TOKE_H
bool append(const char *, int); bool append(const char *, int);
bool fill_args(const char *, int, int); bool fill_args(const char *, int, int);
@@ -39,4 +39,4 @@ extern int (*trace_print)(const char *msg);
(*trace_print)(msg); \ (*trace_print)(msg); \
} while (0); } while (0);
#endif /* _SUDOERS_TOKE_H */ #endif /* SUDOERS_TOKE_H */

View File

@@ -97,7 +97,7 @@ static bool continued, sawspace;
static int prev_state; static int prev_state;
static int digest_len; static int digest_len;
static bool _push_include(char *, bool); static bool push_include_int(char *, bool);
static bool pop_include(void); static bool pop_include(void);
static char *parse_include(char *); static char *parse_include(char *);
@@ -110,8 +110,8 @@ int (*trace_print)(const char *msg) = sudoers_trace_print;
#define ECHO ignore_result(fwrite(sudoerstext, sudoersleng, 1, sudoersout)) #define ECHO ignore_result(fwrite(sudoerstext, sudoersleng, 1, sudoersout))
#define push_include(_p) (_push_include((_p), false)) #define push_include(_p) (push_include_int((_p), false))
#define push_includedir(_p) (_push_include((_p), true)) #define push_includedir(_p) (push_include_int((_p), true))
%} %}
HEX16 [0-9A-Fa-f]{1,4} HEX16 [0-9A-Fa-f]{1,4}
@@ -911,11 +911,11 @@ init_lexer(void)
} }
static bool static bool
_push_include(char *path, bool isdir) push_include_int(char *path, bool isdir)
{ {
struct path_list *pl; struct path_list *pl;
FILE *fp; FILE *fp;
debug_decl(_push_include, SUDOERS_DEBUG_PARSER) debug_decl(push_include_int, SUDOERS_DEBUG_PARSER)
/* push current state onto stack */ /* push current state onto stack */
if (idepth >= istacksize) { if (idepth >= istacksize) {

View File

@@ -23,7 +23,7 @@
* Lock the sudoers file for safe editing (ala vipw) and check for parse errors. * Lock the sudoers file for safe editing (ala vipw) and check for parse errors.
*/ */
#define _SUDO_MAIN #define SUDO_MAIN
#ifdef __TANDEM #ifdef __TANDEM
# include <floss.h> # include <floss.h>

View File

@@ -84,7 +84,7 @@ struct rtentry;
# include <ifaddrs.h> # include <ifaddrs.h>
#endif #endif
#define _SUDO_NET_IFS_C /* to expose sudo_inet_ntop in sudo_compat.h */ #define SUDO_NET_IFS_C /* to expose sudo_inet_ntop in sudo_compat.h */
#define DEFAULT_TEXT_DOMAIN "sudo" #define DEFAULT_TEXT_DOMAIN "sudo"
#include "sudo_gettext.h" /* must be included before sudo_compat.h */ #include "sudo_gettext.h" /* must be included before sudo_compat.h */

View File

@@ -19,8 +19,8 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512. * Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/ */
#ifndef _SUDO_SUDO_H #ifndef SUDO_SUDO_H
#define _SUDO_SUDO_H #define SUDO_SUDO_H
#include <limits.h> #include <limits.h>
#include <pathnames.h> #include <pathnames.h>
@@ -261,4 +261,4 @@ int add_preserved_fd(struct preserved_fd_list *pfds, int fd);
void closefrom_except(int startfd, struct preserved_fd_list *pfds); void closefrom_except(int startfd, struct preserved_fd_list *pfds);
void parse_preserved_fds(struct preserved_fd_list *pfds, const char *fdstr); void parse_preserved_fds(struct preserved_fd_list *pfds, const char *fdstr);
#endif /* _SUDO_SUDO_H */ #endif /* SUDO_SUDO_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_EXEC_H #ifndef SUDO_EXEC_H
#define _SUDO_EXEC_H #define SUDO_EXEC_H
/* /*
* Older systems may not support MSG_WAITALL but it shouldn't really be needed. * Older systems may not support MSG_WAITALL but it shouldn't really be needed.
@@ -99,4 +99,4 @@ bool utmp_login(const char *from_line, const char *to_line, int ttyfd,
const char *user); const char *user);
bool utmp_logout(const char *line, int status); bool utmp_logout(const char *line, int status);
#endif /* _SUDO_EXEC_H */ #endif /* SUDO_EXEC_H */

View File

@@ -14,8 +14,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _SUDO_PLUGIN_INT_H #ifndef SUDO_PLUGIN_INT_H
#define _SUDO_PLUGIN_INT_H #define SUDO_PLUGIN_INT_H
/* /*
* All plugin structures start with a type and a version. * All plugin structures start with a type and a version.
@@ -109,4 +109,4 @@ int sudo_conversation_printf(int msg_type, const char *fmt, ...);
bool sudo_load_plugins(struct plugin_container *policy_plugin, bool sudo_load_plugins(struct plugin_container *policy_plugin,
struct plugin_container_list *io_plugins); struct plugin_container_list *io_plugins);
#endif /* _SUDO_PLUGIN_INT_H */ #endif /* SUDO_PLUGIN_INT_H */

View File

@@ -16,8 +16,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef _SUDO_USAGE_H #ifndef SUDO_USAGE_H
#define _SUDO_USAGE_H #define SUDO_USAGE_H
/* /*
* Usage strings for sudo. These are here because we * Usage strings for sudo. These are here because we
@@ -34,4 +34,4 @@
*/ */
#define CONFIGURE_ARGS "@CONFIGURE_ARGS@" #define CONFIGURE_ARGS "@CONFIGURE_ARGS@"
#endif /* _SUDO_USAGE_H */ #endif /* SUDO_USAGE_H */