From 05a01d4c5ddd203b7592598d48605cf26a74b4d0 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 21 May 2015 11:13:20 -0600 Subject: [PATCH] Avoid using a leading underbar in defines as they are reserved in ISO C. --- config.h.in | 6 ++--- configure.ac | 6 ++--- include/compat/endian.h | 6 ++--- include/compat/fnmatch.h | 6 ++--- include/compat/getaddrinfo.h | 6 ++--- include/compat/getopt.h | 6 ++--- include/compat/glob.h | 6 ++--- include/compat/nss_dbdefs.h | 6 ++--- include/compat/sha2.h | 6 ++--- include/compat/stdbool.h | 6 ++--- include/compat/timespec.h | 6 ++--- include/sudo_alloc.h | 6 ++--- include/sudo_compat.h | 8 +++--- include/sudo_conf.h | 6 ++--- include/sudo_debug.h | 6 ++--- include/sudo_dso.h | 6 ++--- include/sudo_event.h | 6 ++--- include/sudo_fatal.h | 6 ++--- include/sudo_gettext.h | 6 ++--- include/sudo_lbuf.h | 6 ++--- include/sudo_plugin.h | 6 ++--- include/sudo_queue.h | 6 ++--- include/sudo_util.h | 6 ++--- lib/util/fatal.c | 20 +++++++------- plugins/sudoers/bsm_audit.h | 6 ++--- plugins/sudoers/check.h | 6 ++--- plugins/sudoers/defaults.h | 6 ++--- plugins/sudoers/ins_2001.h | 6 ++--- plugins/sudoers/ins_classic.h | 6 ++--- plugins/sudoers/ins_csops.h | 6 ++--- plugins/sudoers/ins_goons.h | 6 ++--- plugins/sudoers/insults.h | 6 ++--- plugins/sudoers/interfaces.h | 6 ++--- plugins/sudoers/iolog.h | 6 ++--- plugins/sudoers/linux_audit.h | 6 ++--- plugins/sudoers/logging.h | 8 +++--- plugins/sudoers/parse.c | 18 ++++++------- plugins/sudoers/parse.h | 6 ++--- plugins/sudoers/pwutil.h | 6 ++--- plugins/sudoers/redblack.c | 12 ++++----- plugins/sudoers/redblack.h | 6 ++--- .../regress/iolog_path/check_iolog_path.c | 2 +- plugins/sudoers/solaris_audit.h | 6 ++--- plugins/sudoers/sssd.c | 26 +++++++++---------- plugins/sudoers/sudo_nss.h | 6 ++--- plugins/sudoers/sudo_printf.c | 4 +-- plugins/sudoers/sudoers.c | 2 +- plugins/sudoers/sudoers.h | 8 +++--- plugins/sudoers/sudoers_debug.h | 6 ++--- plugins/sudoers/sudoers_version.h | 6 ++--- plugins/sudoers/testsudoers.c | 2 +- plugins/sudoers/toke.c | 10 +++---- plugins/sudoers/toke.h | 6 ++--- plugins/sudoers/toke.l | 10 +++---- plugins/sudoers/visudo.c | 2 +- src/net_ifs.c | 2 +- src/sudo.h | 6 ++--- src/sudo_exec.h | 6 ++--- src/sudo_plugin_int.h | 6 ++--- src/sudo_usage.h.in | 6 ++--- 60 files changed, 202 insertions(+), 202 deletions(-) diff --git a/config.h.in b/config.h.in index c84d5b1bd..dd5590ee0 100644 --- a/config.h.in +++ b/config.h.in @@ -1,7 +1,7 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -#ifndef _SUDO_CONFIG_H -#define _SUDO_CONFIG_H +#ifndef SUDO_CONFIG_H +#define SUDO_CONFIG_H /* Define to 1 if the `syslog' function returns a non-zero int to denote failure. */ @@ -1211,4 +1211,4 @@ # define BSD_COMP #endif /* __svr4__ */ -#endif /* _SUDO_CONFIG_H */ +#endif /* SUDO_CONFIG_H */ diff --git a/configure.ac b/configure.ac index fe4c1bd6e..ab879c116 100644 --- a/configure.ac +++ b/configure.ac @@ -4336,12 +4336,12 @@ AH_TEMPLATE(HAVE___NSS_XBYY_BUF_ALLOC, [Define to 1 if you have the `__nss_XbyY_ dnl dnl Bits to copy verbatim into config.h.in dnl -AH_TOP([#ifndef _SUDO_CONFIG_H -#define _SUDO_CONFIG_H]) +AH_TOP([#ifndef SUDO_CONFIG_H +#define SUDO_CONFIG_H]) AH_BOTTOM([/* BSD compatibility on some SVR4 systems. */ #ifdef __svr4__ # define BSD_COMP #endif /* __svr4__ */ -#endif /* _SUDO_CONFIG_H */]) +#endif /* SUDO_CONFIG_H */]) diff --git a/include/compat/endian.h b/include/compat/endian.h index 68880089b..4c1a739bd 100644 --- a/include/compat/endian.h +++ b/include/compat/endian.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _COMPAT_ENDIAN_H -#define _COMPAT_ENDIAN_H +#ifndef COMPAT_ENDIAN_H +#define COMPAT_ENDIAN_H #ifndef BYTE_ORDER # undef LITTLE_ENDIAN @@ -69,4 +69,4 @@ # endif #endif /* BYTE_ORDER */ -#endif /* _COMPAT_ENDIAN_H */ +#endif /* COMPAT_ENDIAN_H */ diff --git a/include/compat/fnmatch.h b/include/compat/fnmatch.h index b4c418eac..4410e65ba 100644 --- a/include/compat/fnmatch.h +++ b/include/compat/fnmatch.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _FNMATCH_H -#define _FNMATCH_H +#ifndef COMPAT_FNMATCH_H +#define COMPAT_FNMATCH_H #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)) -#endif /* _FNMATCH_H */ +#endif /* COMPAT_FNMATCH_H */ diff --git a/include/compat/getaddrinfo.h b/include/compat/getaddrinfo.h index 536d2acb7..6f2f203eb 100644 --- a/include/compat/getaddrinfo.h +++ b/include/compat/getaddrinfo.h @@ -20,8 +20,8 @@ * work. */ -#ifndef _COMPAT_GETADDRINFO_H -#define _COMPAT_GETADDRINFO_H +#ifndef COMPAT_GETADDRINFO_H +#define COMPAT_GETADDRINFO_H #include @@ -80,4 +80,4 @@ __dso_public const char *sudo_gai_strerror(int ecode); #define gai_strerror(_a) sudo_gai_strerror((_a)) #endif /* !HAVE_GETADDRINFO */ -#endif /* _COMPAT_GETADDRINFO_H */ +#endif /* COMPAT_GETADDRINFO_H */ diff --git a/include/compat/getopt.h b/include/compat/getopt.h index 9f51d3c3e..8f4951836 100644 --- a/include/compat/getopt.h +++ b/include/compat/getopt.h @@ -31,8 +31,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _SUDO_GETOPT_H_ -#define _SUDO_GETOPT_H_ +#ifndef COMPAT_GETOPT_H +#define COMPAT_GETOPT_H /* * GNU-like getopt_long()/getopt_long_only() with 4.4BSD optreset extension. @@ -78,4 +78,4 @@ extern int optind; extern int optopt; extern int optreset; -#endif /* !_SUDO_GETOPT_H_ */ +#endif /* !COMPAT_GETOPT_H */ diff --git a/include/compat/glob.h b/include/compat/glob.h index 621ead795..40f5d39e1 100644 --- a/include/compat/glob.h +++ b/include/compat/glob.h @@ -32,8 +32,8 @@ * @(#)glob.h 8.1 (Berkeley) 6/2/93 */ -#ifndef _GLOB_H_ -#define _GLOB_H_ +#ifndef COMPAT_GLOB_H +#define COMPAT_GLOB_H struct stat; 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 globfree(_a) sudo_globfree((_a)) -#endif /* !_GLOB_H_ */ +#endif /* !COMPAT_GLOB_H */ diff --git a/include/compat/nss_dbdefs.h b/include/compat/nss_dbdefs.h index 129802ba3..279fda909 100644 --- a/include/compat/nss_dbdefs.h +++ b/include/compat/nss_dbdefs.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _COMPAT_NSS_DBDEFS_H -#define _COMPAT_NSS_DBDEFS_H +#ifndef COMPAT_NSS_DBDEFS_H +#define COMPAT_NSS_DBDEFS_H /* * 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 void _nss_XbyY_buf_free(nss_XbyY_buf_t *); -#endif /* _COMPAT_NSS_DBDEFS_H */ +#endif /* COMPAT_NSS_DBDEFS_H */ diff --git a/include/compat/sha2.h b/include/compat/sha2.h index 7c189b81a..9f71e5044 100644 --- a/include/compat/sha2.h +++ b/include/compat/sha2.h @@ -19,8 +19,8 @@ * by Steve Reid and Wei Dai respectively. */ -#ifndef _SUDOERS_SHA2_H -#define _SUDOERS_SHA2_H +#ifndef COMPAT_SHA2_H +#define COMPAT_SHA2_H #define SHA224_BLOCK_LENGTH 64 #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 SHA512Final sudo_SHA512Final -#endif /* _SUDOERS_SHA2_H */ +#endif /* COMPAT_SHA2_H */ diff --git a/include/compat/stdbool.h b/include/compat/stdbool.h index a6e65ea10..b865a46c4 100644 --- a/include/compat/stdbool.h +++ b/include/compat/stdbool.h @@ -5,8 +5,8 @@ * Public domain. */ -#ifndef _COMPAT_STDBOOL_H_ -#define _COMPAT_STDBOOL_H_ +#ifndef COMPAT_STDBOOL_H +#define COMPAT_STDBOOL_H #ifndef __cplusplus @@ -41,4 +41,4 @@ typedef enum { /* Inform that everything is fine */ #define __bool_true_false_are_defined 1 -#endif /* _COMPAT_STDBOOL_H_ */ +#endif /* COMPAT_STDBOOL_H */ diff --git a/include/compat/timespec.h b/include/compat/timespec.h index 4c9dedc8e..e1378f7ec 100644 --- a/include/compat/timespec.h +++ b/include/compat/timespec.h @@ -14,12 +14,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_TIMESPEC_H -#define _SUDO_TIMESPEC_H +#ifndef COMPAT_TIMESPEC_H +#define COMPAT_TIMESPEC_H struct timespec { time_t tv_sec; long tv_nsec; }; -#endif /* _SUDO_TIMESPEC_H */ +#endif /* COMPAT_TIMESPEC_H */ diff --git a/include/sudo_alloc.h b/include/sudo_alloc.h index 96ac3b242..1ea8b4b4d 100644 --- a/include/sudo_alloc.h +++ b/include/sudo_alloc.h @@ -15,8 +15,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_ALLOC_H -#define _SUDO_ALLOC_H +#ifndef SUDO_ALLOC_H +#define SUDO_ALLOC_H #include @@ -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_estrndup(_a, _b) sudo_estrndup_v1((_a), (_b)) -#endif /* _SUDO_ALLOC_H */ +#endif /* SUDO_ALLOC_H */ diff --git a/include/sudo_compat.h b/include/sudo_compat.h index fa8d6d7ff..7f9aae68a 100644 --- a/include/sudo_compat.h +++ b/include/sudo_compat.h @@ -19,8 +19,8 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#ifndef _SUDO_COMPAT_H -#define _SUDO_COMPAT_H +#ifndef SUDO_COMPAT_H +#define SUDO_COMPAT_H #include #ifdef STDC_HEADERS @@ -464,7 +464,7 @@ __dso_public int sudo_sig2str(int signo, char *signame); # undef sig2str # define sig2str(_a, _b) sudo_sig2str((_a), (_b)) #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); # undef inet_ntop # 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)) #endif /* HAVE_REALLOCARRAY */ -#endif /* _SUDO_COMPAT_H */ +#endif /* SUDO_COMPAT_H */ diff --git a/include/sudo_conf.h b/include/sudo_conf.h index d9236deef..f916a71cc 100644 --- a/include/sudo_conf.h +++ b/include/sudo_conf.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_CONF_H -#define _SUDO_CONF_H +#ifndef SUDO_CONF_H +#define SUDO_CONF_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_max_groups() sudo_conf_max_groups_v1() -#endif /* _SUDO_CONF_H */ +#endif /* SUDO_CONF_H */ diff --git a/include/sudo_debug.h b/include/sudo_debug.h index 5d392699d..15494ec68 100644 --- a/include/sudo_debug.h +++ b/include/sudo_debug.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_DEBUG_H -#define _SUDO_DEBUG_H +#ifndef SUDO_DEBUG_H +#define SUDO_DEBUG_H #include #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_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 */ diff --git a/include/sudo_dso.h b/include/sudo_dso.h index d953d5b8d..1adbd85f7 100644 --- a/include/sudo_dso.h +++ b/include/sudo_dso.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_DSO_H -#define _SUDO_DSO_H +#ifndef SUDO_DSO_H +#define SUDO_DSO_H /* Values for sudo_dso_load() mode. */ #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_preload_table(_a) sudo_dso_preload_table_v1((_a)) -#endif /* _SUDO_DSO_H */ +#endif /* SUDO_DSO_H */ diff --git a/include/sudo_event.h b/include/sudo_event.h index a05016f0d..21b62cdfd 100644 --- a/include/sudo_event.h +++ b/include/sudo_event.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_EVENT_H -#define _SUDO_EVENT_H +#ifndef SUDO_EVENT_H +#define SUDO_EVENT_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_scan_impl(struct sudo_event_base *base, int flags); -#endif /* _SUDO_EVENT_H */ +#endif /* SUDO_EVENT_H */ diff --git a/include/sudo_fatal.h b/include/sudo_fatal.h index 4e647f601..f38b56355 100644 --- a/include/sudo_fatal.h +++ b/include/sudo_fatal.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_FATAL_H_ -#define _SUDO_FATAL_H_ +#ifndef SUDO_FATAL_H +#define SUDO_FATAL_H #include #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)) #endif -#endif /* _SUDO_FATAL_H_ */ +#endif /* SUDO_FATAL_H */ diff --git a/include/sudo_gettext.h b/include/sudo_gettext.h index 68b91c34b..bb7383280 100644 --- a/include/sudo_gettext.h +++ b/include/sudo_gettext.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_GETTEXT_H -#define _SUDO_GETTEXT_H +#ifndef SUDO_GETTEXT_H +#define SUDO_GETTEXT_H /* * Solaris locale.h includes libintl.h which causes problems when we @@ -72,4 +72,4 @@ #endif /* HAVE_LIBINTL_H */ -#endif /* _SUDO_GETTEXT_H */ +#endif /* SUDO_GETTEXT_H */ diff --git a/include/sudo_lbuf.h b/include/sudo_lbuf.h index 18cf23c99..4972905df 100644 --- a/include/sudo_lbuf.h +++ b/include/sudo_lbuf.h @@ -17,8 +17,8 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _SUDO_LBUF_H -#define _SUDO_LBUF_H +#ifndef SUDO_LBUF_H +#define SUDO_LBUF_H /* * 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_print(_a) sudo_lbuf_print_v1((_a)) -#endif /* _SUDO_LBUF_H */ +#endif /* SUDO_LBUF_H */ diff --git a/include/sudo_plugin.h b/include/sudo_plugin.h index 9d380c3c5..de1592632 100644 --- a/include/sudo_plugin.h +++ b/include/sudo_plugin.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_PLUGIN_H -#define _SUDO_PLUGIN_H +#ifndef SUDO_PLUGIN_H +#define SUDO_PLUGIN_H /* API version major/minor */ #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); }; -#endif /* _SUDO_PLUGIN_H */ +#endif /* SUDO_PLUGIN_H */ diff --git a/include/sudo_queue.h b/include/sudo_queue.h index 9392c674d..98010eecd 100644 --- a/include/sudo_queue.h +++ b/include/sudo_queue.h @@ -30,8 +30,8 @@ * $FreeBSD: head/sys/sys/queue.h 251887 2013-06-18 02:57:56Z lstewart $ */ -#ifndef _SUDO_QUEUE_H_ -#define _SUDO_QUEUE_H_ +#ifndef SUDO_QUEUE_H +#define SUDO_QUEUE_H /* * This file defines four types of data structures: singly-linked lists, @@ -803,4 +803,4 @@ struct { \ (head)->tqh_last = last; \ } while (0) -#endif /* !_SUDO_QUEUE_H_ */ +#endif /* !SUDO_QUEUE_H */ diff --git a/include/sudo_util.h b/include/sudo_util.h index 1d7fb63c3..57f1ee437 100644 --- a/include/sudo_util.h +++ b/include/sudo_util.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_UTIL_H -#define _SUDO_UTIL_H +#ifndef SUDO_UTIL_H +#define SUDO_UTIL_H #ifdef HAVE_STDBOOL_H # include @@ -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); #define sudo_get_ttysize(_a, _b) sudo_get_ttysize_v1((_a), (_b)) -#endif /* _SUDO_UTIL_H */ +#endif /* SUDO_UTIL_H */ diff --git a/lib/util/fatal.c b/lib/util/fatal.c index e4b9fc9b9..0ce1ab638 100644 --- a/lib/util/fatal.c +++ b/lib/util/fatal.c @@ -49,7 +49,7 @@ static sudo_conv_t sudo_warn_conversation; static bool (*sudo_warn_setlocale)(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 do_cleanup(void) @@ -70,7 +70,7 @@ sudo_fatal_nodebug_v1(const char *fmt, ...) va_list ap; va_start(ap, fmt); - _warning(errno, fmt, ap); + warning(errno, fmt, ap); va_end(ap); do_cleanup(); exit(EXIT_FAILURE); @@ -82,7 +82,7 @@ sudo_fatalx_nodebug_v1(const char *fmt, ...) va_list ap; va_start(ap, fmt); - _warning(0, fmt, ap); + warning(0, fmt, ap); va_end(ap); do_cleanup(); exit(EXIT_FAILURE); @@ -91,7 +91,7 @@ sudo_fatalx_nodebug_v1(const char *fmt, ...) void sudo_vfatal_nodebug_v1(const char *fmt, va_list ap) { - _warning(errno, fmt, ap); + warning(errno, fmt, ap); do_cleanup(); exit(EXIT_FAILURE); } @@ -99,7 +99,7 @@ sudo_vfatal_nodebug_v1(const char *fmt, va_list ap) void sudo_vfatalx_nodebug_v1(const char *fmt, va_list ap) { - _warning(0, fmt, ap); + warning(0, fmt, ap); do_cleanup(); exit(EXIT_FAILURE); } @@ -110,7 +110,7 @@ sudo_warn_nodebug_v1(const char *fmt, ...) va_list ap; va_start(ap, fmt); - _warning(errno, fmt, ap); + warning(errno, fmt, ap); va_end(ap); } @@ -119,24 +119,24 @@ sudo_warnx_nodebug_v1(const char *fmt, ...) { va_list ap; va_start(ap, fmt); - _warning(0, fmt, ap); + warning(0, fmt, ap); va_end(ap); } void sudo_vwarn_nodebug_v1(const char *fmt, va_list ap) { - _warning(errno, fmt, ap); + warning(errno, fmt, ap); } void sudo_vwarnx_nodebug_v1(const char *fmt, va_list ap) { - _warning(0, fmt, ap); + warning(0, fmt, ap); } static void -_warning(int errnum, const char *fmt, va_list ap) +warning(int errnum, const char *fmt, va_list ap) { int cookie; diff --git a/plugins/sudoers/bsm_audit.h b/plugins/sudoers/bsm_audit.h index 327e9f5ac..e5fe58f41 100644 --- a/plugins/sudoers/bsm_audit.h +++ b/plugins/sudoers/bsm_audit.h @@ -15,10 +15,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_BSM_AUDIT_H -#define _SUDOERS_BSM_AUDIT_H +#ifndef SUDOERS_BSM_AUDIT_H +#define SUDOERS_BSM_AUDIT_H int bsm_audit_success(char *argv[]); int bsm_audit_failure(char *argv[], char const * const, va_list); -#endif /* _SUDOERS_BSM_AUDIT_H */ +#endif /* SUDOERS_BSM_AUDIT_H */ diff --git a/plugins/sudoers/check.h b/plugins/sudoers/check.h index c28d93413..c8c48fc3c 100644 --- a/plugins/sudoers/check.h +++ b/plugins/sudoers/check.h @@ -19,8 +19,8 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#ifndef _SUDOERS_CHECK_H -#define _SUDOERS_CHECK_H +#ifndef SUDOERS_CHECK_H +#define SUDOERS_CHECK_H /* Status codes for timestamp_status() */ #define TS_CURRENT 0 @@ -65,4 +65,4 @@ bool update_timestamp(struct passwd *pw); int build_timestamp(struct passwd *pw); int timestamp_status(struct passwd *pw); -#endif /* _SUDOERS_CHECK_H */ +#endif /* SUDOERS_CHECK_H */ diff --git a/plugins/sudoers/defaults.h b/plugins/sudoers/defaults.h index 91535e590..e12f64dc7 100644 --- a/plugins/sudoers/defaults.h +++ b/plugins/sudoers/defaults.h @@ -19,8 +19,8 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#ifndef _SUDOERS_DEFAULTS_H -#define _SUDOERS_DEFAULTS_H +#ifndef SUDOERS_DEFAULTS_H +#define SUDOERS_DEFAULTS_H #include @@ -117,4 +117,4 @@ bool check_defaults(int what, bool quiet); extern struct sudo_defs_types sudo_defs_table[]; -#endif /* _SUDOERS_DEFAULTS_H */ +#endif /* SUDOERS_DEFAULTS_H */ diff --git a/plugins/sudoers/ins_2001.h b/plugins/sudoers/ins_2001.h index 604c3e437..b1fc30c0f 100644 --- a/plugins/sudoers/ins_2001.h +++ b/plugins/sudoers/ins_2001.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_INS_2001_H -#define _SUDOERS_INS_2001_H +#ifndef SUDOERS_INS_2001_H +#define SUDOERS_INS_2001_H /* * HAL insults (paraphrased) from 2001. @@ -30,4 +30,4 @@ "This mission is too important for me to allow you to jeopardize it.", "I feel much better now.", -#endif /* _SUDOERS_INS_2001_H */ +#endif /* SUDOERS_INS_2001_H */ diff --git a/plugins/sudoers/ins_classic.h b/plugins/sudoers/ins_classic.h index 3cb35ebd7..ddf27c85a 100644 --- a/plugins/sudoers/ins_classic.h +++ b/plugins/sudoers/ins_classic.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_INS_CLASSIC_H -#define _SUDOERS_INS_CLASSIC_H +#ifndef SUDOERS_INS_CLASSIC_H +#define SUDOERS_INS_CLASSIC_H /* * Insults from the original sudo(8). @@ -34,4 +34,4 @@ "Do you think like you type?", "Your mind just hasn't been the same since the electro-shock, has it?", -#endif /* _SUDOERS_INS_CLASSIC_H */ +#endif /* SUDOERS_INS_CLASSIC_H */ diff --git a/plugins/sudoers/ins_csops.h b/plugins/sudoers/ins_csops.h index f4ecabd97..5ddd126e5 100644 --- a/plugins/sudoers/ins_csops.h +++ b/plugins/sudoers/ins_csops.h @@ -15,8 +15,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_INS_CSOPS_H -#define _SUDOERS_INS_CSOPS_H +#ifndef SUDOERS_INS_CSOPS_H +#define SUDOERS_INS_CSOPS_H /* * CSOps insults (may be site dependent). @@ -36,4 +36,4 @@ "Have you considered trying to match wits with a rutabaga?", "You speak an infinite deal of nothing", -#endif /* _SUDOERS_INS_CSOPS_H */ +#endif /* SUDOERS_INS_CSOPS_H */ diff --git a/plugins/sudoers/ins_goons.h b/plugins/sudoers/ins_goons.h index 117393f42..4dbd47f70 100644 --- a/plugins/sudoers/ins_goons.h +++ b/plugins/sudoers/ins_goons.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_INS_GOONS_H -#define _SUDOERS_INS_GOONS_H +#ifndef SUDOERS_INS_GOONS_H +#define SUDOERS_INS_GOONS_H /* * Insults from the "Goon Show." @@ -45,4 +45,4 @@ "It's only your word against mine.", "I think ... err ... I think ... I think I'll go home", -#endif /* _SUDOERS_INS_GOONS_H */ +#endif /* SUDOERS_INS_GOONS_H */ diff --git a/plugins/sudoers/insults.h b/plugins/sudoers/insults.h index e5d441a7e..c54b3e409 100644 --- a/plugins/sudoers/insults.h +++ b/plugins/sudoers/insults.h @@ -15,8 +15,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_INSULTS_H -#define _SUDOERS_INSULTS_H +#ifndef SUDOERS_INSULTS_H +#define SUDOERS_INSULTS_H #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 /* _SUDOERS_INSULTS_H */ +#endif /* SUDOERS_INSULTS_H */ diff --git a/plugins/sudoers/interfaces.h b/plugins/sudoers/interfaces.h index f60ba1d7a..a0857af45 100644 --- a/plugins/sudoers/interfaces.h +++ b/plugins/sudoers/interfaces.h @@ -19,8 +19,8 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#ifndef _SUDOERS_INTERFACES_H -#define _SUDOERS_INTERFACES_H +#ifndef SUDOERS_INTERFACES_H +#define SUDOERS_INTERFACES_H /* * Union to hold either strucr in_addr or in6_add @@ -52,4 +52,4 @@ void dump_interfaces(const char *); void set_interfaces(const char *); struct interface_list *get_interfaces(void); -#endif /* _SUDOERS_INTERFACES_H */ +#endif /* SUDOERS_INTERFACES_H */ diff --git a/plugins/sudoers/iolog.h b/plugins/sudoers/iolog.h index 54d9955d8..3d1dba7c5 100644 --- a/plugins/sudoers/iolog.h +++ b/plugins/sudoers/iolog.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_IOLOG_H -#define _SUDOERS_IOLOG_H +#ifndef SUDOERS_IOLOG_H +#define SUDOERS_IOLOG_H /* * 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 */ }; -#endif /* _SUDOERS_IOLOG_H */ +#endif /* SUDOERS_IOLOG_H */ diff --git a/plugins/sudoers/linux_audit.h b/plugins/sudoers/linux_audit.h index 090de6402..07413aa53 100644 --- a/plugins/sudoers/linux_audit.h +++ b/plugins/sudoers/linux_audit.h @@ -14,9 +14,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_LINUX_AUDIT_H -#define _SUDOERS_LINUX_AUDIT_H +#ifndef SUDOERS_LINUX_AUDIT_H +#define SUDOERS_LINUX_AUDIT_H int linux_audit_command(char *argv[], int result); -#endif /* _SUDOERS_LINUX_AUDIT_H */ +#endif /* SUDOERS_LINUX_AUDIT_H */ diff --git a/plugins/sudoers/logging.h b/plugins/sudoers/logging.h index a565e1584..f5659277a 100644 --- a/plugins/sudoers/logging.h +++ b/plugins/sudoers/logging.h @@ -15,8 +15,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_LOGGING_H -#define _SUDOERS_LOGGING_H +#ifndef SUDOERS_LOGGING_H +#define SUDOERS_LOGGING_H #include #ifdef __STDC__ @@ -58,7 +58,7 @@ */ #define LOG_INDENT " " -#ifndef _SUDO_MAIN +#ifndef SUDO_MAIN /* XXX - needed for auditing */ extern int NewArgc; 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 writeln_wrap(FILE *fp, char *line, size_t len, size_t maxlen); -#endif /* _SUDOERS_LOGGING_H */ +#endif /* SUDOERS_LOGGING_H */ diff --git a/plugins/sudoers/parse.c b/plugins/sudoers/parse.c index 2feb328e6..7d28e545e 100644 --- a/plugins/sudoers/parse.c +++ b/plugins/sudoers/parse.c @@ -63,7 +63,7 @@ static int sudo_file_open(struct sudo_nss *); static int sudo_file_parse(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_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 */ 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, "\t"); - print_member2(lbuf, cs->cmnd, "\n\t", CMNDALIAS); + print_member_sep(lbuf, cs->cmnd, "\n\t", CMNDALIAS); sudo_lbuf_append(lbuf, "\n"); prev_cs = cs; nfound++; @@ -752,13 +752,13 @@ done: * Print the contents of a struct member to stdout */ 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) { struct alias *a; struct member *m; struct sudo_command *c; - debug_decl(_print_member, SUDOERS_DEBUG_NSS) + debug_decl(print_member_int, SUDOERS_DEBUG_NSS) switch (type) { case ALL: @@ -782,7 +782,7 @@ _print_member(struct sudo_lbuf *lbuf, char *name, int type, int negated, TAILQ_FOREACH(m, &a->members, entries) { if (m != TAILQ_FIRST(&a->members)) 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, alias_type); } @@ -800,12 +800,12 @@ _print_member(struct sudo_lbuf *lbuf, char *name, int type, int negated, static void 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 -print_member2(struct sudo_lbuf *lbuf, struct member *m, const char *separator, - int alias_type) +print_member_sep(struct sudo_lbuf *lbuf, struct member *m, + 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); } diff --git a/plugins/sudoers/parse.h b/plugins/sudoers/parse.h index 2be1e2743..df3440e68 100644 --- a/plugins/sudoers/parse.h +++ b/plugins/sudoers/parse.h @@ -15,8 +15,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_PARSE_H -#define _SUDOERS_PARSE_H +#ifndef SUDOERS_PARSE_H +#define SUDOERS_PARSE_H #undef UNSPEC #define UNSPEC -1 @@ -223,4 +223,4 @@ int hexchar(const char *s); /* base64.c */ size_t base64_decode(const char *str, unsigned char *dst, size_t dsize); -#endif /* _SUDOERS_PARSE_H */ +#endif /* SUDOERS_PARSE_H */ diff --git a/plugins/sudoers/pwutil.h b/plugins/sudoers/pwutil.h index 695d63db1..9b5dabd57 100644 --- a/plugins/sudoers/pwutil.h +++ b/plugins/sudoers/pwutil.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_PWUTIL_H -#define _SUDOERS_PWUTIL_H +#ifndef SUDOERS_PWUTIL_H +#define SUDOERS_PWUTIL_H #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_pwitem(uid_t uid, const char *user); -#endif /* _SUDOERS_PWUTIL_H */ +#endif /* SUDOERS_PWUTIL_H */ diff --git a/plugins/sudoers/redblack.c b/plugins/sudoers/redblack.c index 96a1165be..28b62a497 100644 --- a/plugins/sudoers/redblack.c +++ b/plugins/sudoers/redblack.c @@ -60,7 +60,7 @@ static void rbrepair(struct rbtree *, struct rbnode *); static void rotate_left(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 @@ -333,12 +333,12 @@ rbsuccessor(struct rbtree *tree, struct rbnode *node) * Recursive portion of rbdestroy(). */ 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)) { - _rbdestroy(tree, node->left, destroy); - _rbdestroy(tree, node->right, destroy); + rbdestroy_int(tree, node->left, destroy); + rbdestroy_int(tree, node->right, destroy); if (destroy != NULL) destroy(node->data); sudo_efree(node); @@ -354,7 +354,7 @@ void rbdestroy(struct rbtree *tree, void (*destroy)(void *)) { debug_decl(rbdestroy, SUDOERS_DEBUG_RBTREE) - _rbdestroy(tree, rbfirst(tree), destroy); + rbdestroy_int(tree, rbfirst(tree), destroy); sudo_efree(tree); debug_return; } diff --git a/plugins/sudoers/redblack.h b/plugins/sudoers/redblack.h index 86cc3c9e3..cc2103cb8 100644 --- a/plugins/sudoers/redblack.h +++ b/plugins/sudoers/redblack.h @@ -15,8 +15,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_REDBLACK_H -#define _SUDOERS_REDBLACK_H +#ifndef SUDOERS_REDBLACK_H +#define SUDOERS_REDBLACK_H enum rbcolor { red, @@ -55,4 +55,4 @@ struct rbnode *rbinsert(struct rbtree *, void *); struct rbtree *rbcreate(int (*)(const void *, const void *)); void rbdestroy(struct rbtree *, void (*)(void *)); -#endif /* _SUDOERS_REDBLACK_H */ +#endif /* SUDOERS_REDBLACK_H */ diff --git a/plugins/sudoers/regress/iolog_path/check_iolog_path.c b/plugins/sudoers/regress/iolog_path/check_iolog_path.c index a6b17a9ae..78c7f5aea 100644 --- a/plugins/sudoers/regress/iolog_path/check_iolog_path.c +++ b/plugins/sudoers/regress/iolog_path/check_iolog_path.c @@ -41,7 +41,7 @@ #define SUDO_ERROR_WRAP 0 -#define _SUDO_MAIN +#define SUDO_MAIN #include "sudoers.h" #include "def_data.c" diff --git a/plugins/sudoers/solaris_audit.h b/plugins/sudoers/solaris_audit.h index ed19f4e62..36a124508 100644 --- a/plugins/sudoers/solaris_audit.h +++ b/plugins/sudoers/solaris_audit.h @@ -14,10 +14,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_SOLARIS_AUDIT_H -#define _SUDOERS_SOLARIS_AUDIT_H +#ifndef SUDOERS_SOLARIS_AUDIT_H +#define SUDOERS_SOLARIS_AUDIT_H int solaris_audit_success(int argc, char *argv[]); int solaris_audit_failure(int argc, char *argv[], char const *const fmt, va_list); -#endif /* _SUDOERS_SOLARIS_AUDIT_H */ +#endif /* SUDOERS_SOLARIS_AUDIT_H */ diff --git a/plugins/sudoers/sssd.c b/plugins/sudoers/sssd.c index eeaa3d069..3f8b0b6b0 100644 --- a/plugins/sudoers/sssd.c +++ b/plugins/sudoers/sssd.c @@ -159,11 +159,11 @@ sudo_sss_rulecpy(struct sss_sudo_rule *dst, const struct sss_sudo_rule *src) debug_return; } -#define _SUDO_SSS_FILTER_INCLUDE 0 -#define _SUDO_SSS_FILTER_EXCLUDE 1 +#define SUDO_SSS_FILTER_INCLUDE 0 +#define SUDO_SSS_FILTER_EXCLUDE 1 -#define _SUDO_SSS_STATE_HOSTMATCH 0x01 -#define _SUDO_SSS_STATE_USERMATCH 0x02 +#define SUDO_SSS_STATE_HOSTMATCH 0x01 +#define SUDO_SSS_STATE_USERMATCH 0x02 static struct sss_sudo_result * 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", 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) 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) { r = filterp(handle, in_res->rules + i, filterp_arg); - if (( r && act == _SUDO_SSS_FILTER_INCLUDE) || - (!r && act == _SUDO_SSS_FILTER_EXCLUDE)) { + if (( r && act == SUDO_SSS_FILTER_INCLUDE) || + (!r && act == SUDO_SSS_FILTER_EXCLUDE)) { sudo_debug_printf(SUDO_DEBUG_DEBUG, "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); 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 (state != NULL) { 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)", 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, - 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->num_rules > 0) { if (state != NULL) { sudo_debug_printf(SUDO_DEBUG_DEBUG, "state |= HOSTMATCH"); - *state |= _SUDO_SSS_STATE_HOSTMATCH; + *state |= SUDO_SSS_STATE_HOSTMATCH; } } sudo_debug_printf(SUDO_DEBUG_DEBUG, @@ -1086,9 +1086,9 @@ done: SET(ret, FLAG_NO_CHECK); } - if (state & _SUDO_SSS_STATE_USERMATCH) + if (state & SUDO_SSS_STATE_USERMATCH) CLR(ret, FLAG_NO_USER); - if (state & _SUDO_SSS_STATE_HOSTMATCH) + if (state & SUDO_SSS_STATE_HOSTMATCH) CLR(ret, FLAG_NO_HOST); sudo_debug_printf(SUDO_DEBUG_DEBUG, "sudo_sss_lookup(%d)=0x%02x", diff --git a/plugins/sudoers/sudo_nss.h b/plugins/sudoers/sudo_nss.h index 5d6aa44ec..b67a6c9ca 100644 --- a/plugins/sudoers/sudo_nss.h +++ b/plugins/sudoers/sudo_nss.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_NSS_H -#define _SUDOERS_NSS_H +#ifndef SUDOERS_NSS_H +#define SUDOERS_NSS_H struct sudo_lbuf; struct passwd; @@ -40,4 +40,4 @@ TAILQ_HEAD(sudo_nss_list, sudo_nss); struct sudo_nss_list *sudo_read_nss(void); -#endif /* _SUDOERS_NSS_H */ +#endif /* SUDOERS_NSS_H */ diff --git a/plugins/sudoers/sudo_printf.c b/plugins/sudoers/sudo_printf.c index 474e0e2a4..0a23b234b 100644 --- a/plugins/sudoers/sudo_printf.c +++ b/plugins/sudoers/sudo_printf.c @@ -34,7 +34,7 @@ #include "sudo_debug.h" static int -_sudo_printf(int msg_type, const char *fmt, ...) +sudo_printf_int(int msg_type, const char *fmt, ...) { va_list ap; int len; @@ -59,4 +59,4 @@ _sudo_printf(int msg_type, const char *fmt, ...) return len; } -sudo_printf_t sudo_printf = _sudo_printf; +sudo_printf_t sudo_printf = sudo_printf_int; diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index 00d5ac384..0c2e5aeae 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -18,7 +18,7 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#define _SUDO_MAIN +#define SUDO_MAIN #ifdef __TANDEM # include diff --git a/plugins/sudoers/sudoers.h b/plugins/sudoers/sudoers.h index a8d22a0a7..744ea3934 100644 --- a/plugins/sudoers/sudoers.h +++ b/plugins/sudoers/sudoers.h @@ -19,8 +19,8 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#ifndef _SUDOERS_SUDOERS_H -#define _SUDOERS_SUDOERS_H +#ifndef SUDOERS_SUDOERS_H +#define SUDOERS_SUDOERS_H #include #ifdef HAVE_STDBOOL_H @@ -362,7 +362,7 @@ void group_plugin_unload(void); int group_plugin_query(const char *user, const char *group, const struct passwd *pwd); -#ifndef _SUDO_MAIN +#ifndef SUDO_MAIN extern struct sudo_user sudo_user; extern struct passwd *list_pw; extern int long_list; @@ -372,4 +372,4 @@ extern sudo_conv_t sudo_conv; extern sudo_printf_t sudo_printf; #endif -#endif /* _SUDOERS_SUDOERS_H */ +#endif /* SUDOERS_SUDOERS_H */ diff --git a/plugins/sudoers/sudoers_debug.h b/plugins/sudoers/sudoers_debug.h index 4c3ac5bc7..3cf5f42ee 100644 --- a/plugins/sudoers/sudoers_debug.h +++ b/plugins/sudoers/sudoers_debug.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_DEBUG_H -#define _SUDOERS_DEBUG_H +#ifndef SUDOERS_DEBUG_H +#define SUDOERS_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_UTIL (sudoers_subsystem_ids[17]) /* utility functions */ -#endif /* _SUDOERS_DEBUG_H */ +#endif /* SUDOERS_DEBUG_H */ diff --git a/plugins/sudoers/sudoers_version.h b/plugins/sudoers/sudoers_version.h index 84f9c5ebc..57fe1df20 100644 --- a/plugins/sudoers/sudoers_version.h +++ b/plugins/sudoers/sudoers_version.h @@ -65,9 +65,9 @@ * 44 sudo 1.8.13, added MAIL/NOMAIL tags. */ -#ifndef _SUDOERS_VERSION_H -#define _SUDOERS_VERSION_H +#ifndef SUDOERS_VERSION_H +#define SUDOERS_VERSION_H #define SUDOERS_GRAMMAR_VERSION 44 -#endif /* _SUDOERS_VERSION_H */ +#endif /* SUDOERS_VERSION_H */ diff --git a/plugins/sudoers/testsudoers.c b/plugins/sudoers/testsudoers.c index 482c24a90..72b2d2b5a 100644 --- a/plugins/sudoers/testsudoers.c +++ b/plugins/sudoers/testsudoers.c @@ -21,7 +21,7 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#define _SUDO_MAIN +#define SUDO_MAIN #include diff --git a/plugins/sudoers/toke.c b/plugins/sudoers/toke.c index a5115a1ad..184b4c986 100644 --- a/plugins/sudoers/toke.c +++ b/plugins/sudoers/toke.c @@ -2031,7 +2031,7 @@ static bool continued, sawspace; static int prev_state; static int digest_len; -static bool _push_include(char *, bool); +static bool push_include_int(char *, bool); static bool pop_include(void); 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 push_include(_p) (_push_include((_p), false)) -#define push_includedir(_p) (_push_include((_p), true)) +#define push_include(_p) (push_include_int((_p), false)) +#define push_includedir(_p) (push_include_int((_p), true)) #define YY_NO_INPUT 1 #define YY_NO_UNPUT 1 #define GOTDEFS 1 @@ -4182,11 +4182,11 @@ init_lexer(void) } static bool -_push_include(char *path, bool isdir) +push_include_int(char *path, bool isdir) { struct path_list *pl; FILE *fp; - debug_decl(_push_include, SUDOERS_DEBUG_PARSER) + debug_decl(push_include_int, SUDOERS_DEBUG_PARSER) /* push current state onto stack */ if (idepth >= istacksize) { diff --git a/plugins/sudoers/toke.h b/plugins/sudoers/toke.h index 002f8fbd6..0a870e6df 100644 --- a/plugins/sudoers/toke.h +++ b/plugins/sudoers/toke.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDOERS_TOKE_H -#define _SUDOERS_TOKE_H +#ifndef SUDOERS_TOKE_H +#define SUDOERS_TOKE_H bool append(const char *, int); bool fill_args(const char *, int, int); @@ -39,4 +39,4 @@ extern int (*trace_print)(const char *msg); (*trace_print)(msg); \ } while (0); -#endif /* _SUDOERS_TOKE_H */ +#endif /* SUDOERS_TOKE_H */ diff --git a/plugins/sudoers/toke.l b/plugins/sudoers/toke.l index 81829de99..8887d3a4f 100644 --- a/plugins/sudoers/toke.l +++ b/plugins/sudoers/toke.l @@ -97,7 +97,7 @@ static bool continued, sawspace; static int prev_state; static int digest_len; -static bool _push_include(char *, bool); +static bool push_include_int(char *, bool); static bool pop_include(void); 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 push_include(_p) (_push_include((_p), false)) -#define push_includedir(_p) (_push_include((_p), true)) +#define push_include(_p) (push_include_int((_p), false)) +#define push_includedir(_p) (push_include_int((_p), true)) %} HEX16 [0-9A-Fa-f]{1,4} @@ -911,11 +911,11 @@ init_lexer(void) } static bool -_push_include(char *path, bool isdir) +push_include_int(char *path, bool isdir) { struct path_list *pl; FILE *fp; - debug_decl(_push_include, SUDOERS_DEBUG_PARSER) + debug_decl(push_include_int, SUDOERS_DEBUG_PARSER) /* push current state onto stack */ if (idepth >= istacksize) { diff --git a/plugins/sudoers/visudo.c b/plugins/sudoers/visudo.c index 2502bfe36..ac651d0c3 100644 --- a/plugins/sudoers/visudo.c +++ b/plugins/sudoers/visudo.c @@ -23,7 +23,7 @@ * Lock the sudoers file for safe editing (ala vipw) and check for parse errors. */ -#define _SUDO_MAIN +#define SUDO_MAIN #ifdef __TANDEM # include diff --git a/src/net_ifs.c b/src/net_ifs.c index 3ee7d0069..900b99e88 100644 --- a/src/net_ifs.c +++ b/src/net_ifs.c @@ -84,7 +84,7 @@ struct rtentry; # include #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" #include "sudo_gettext.h" /* must be included before sudo_compat.h */ diff --git a/src/sudo.h b/src/sudo.h index 5d8ef53b5..5da138ab1 100644 --- a/src/sudo.h +++ b/src/sudo.h @@ -19,8 +19,8 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#ifndef _SUDO_SUDO_H -#define _SUDO_SUDO_H +#ifndef SUDO_SUDO_H +#define SUDO_SUDO_H #include #include @@ -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 parse_preserved_fds(struct preserved_fd_list *pfds, const char *fdstr); -#endif /* _SUDO_SUDO_H */ +#endif /* SUDO_SUDO_H */ diff --git a/src/sudo_exec.h b/src/sudo_exec.h index 768a06bd4..5caea05a9 100644 --- a/src/sudo_exec.h +++ b/src/sudo_exec.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_EXEC_H -#define _SUDO_EXEC_H +#ifndef SUDO_EXEC_H +#define SUDO_EXEC_H /* * 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); bool utmp_logout(const char *line, int status); -#endif /* _SUDO_EXEC_H */ +#endif /* SUDO_EXEC_H */ diff --git a/src/sudo_plugin_int.h b/src/sudo_plugin_int.h index 1cbd67383..ea2199826 100644 --- a/src/sudo_plugin_int.h +++ b/src/sudo_plugin_int.h @@ -14,8 +14,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef _SUDO_PLUGIN_INT_H -#define _SUDO_PLUGIN_INT_H +#ifndef SUDO_PLUGIN_INT_H +#define SUDO_PLUGIN_INT_H /* * 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, struct plugin_container_list *io_plugins); -#endif /* _SUDO_PLUGIN_INT_H */ +#endif /* SUDO_PLUGIN_INT_H */ diff --git a/src/sudo_usage.h.in b/src/sudo_usage.h.in index 1b0bb0c8d..afd0f05b5 100644 --- a/src/sudo_usage.h.in +++ b/src/sudo_usage.h.in @@ -16,8 +16,8 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _SUDO_USAGE_H -#define _SUDO_USAGE_H +#ifndef SUDO_USAGE_H +#define SUDO_USAGE_H /* * Usage strings for sudo. These are here because we @@ -34,4 +34,4 @@ */ #define CONFIGURE_ARGS "@CONFIGURE_ARGS@" -#endif /* _SUDO_USAGE_H */ +#endif /* SUDO_USAGE_H */ -- 2.40.0