ISO C.
/* 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. */
# define BSD_COMP
#endif /* __svr4__ */
-#endif /* _SUDO_CONFIG_H */
+#endif /* SUDO_CONFIG_H */
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 */])
* 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
# endif
#endif /* BYTE_ORDER */
-#endif /* _COMPAT_ENDIAN_H */
+#endif /* COMPAT_ENDIAN_H */
* 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 */
#define fnmatch(_a, _b, _c) sudo_fnmatch((_a), (_b), (_c))
-#endif /* _FNMATCH_H */
+#endif /* COMPAT_FNMATCH_H */
* work.
*/
-#ifndef _COMPAT_GETADDRINFO_H
-#define _COMPAT_GETADDRINFO_H
+#ifndef COMPAT_GETADDRINFO_H
+#define COMPAT_GETADDRINFO_H
#include <config.h>
#define gai_strerror(_a) sudo_gai_strerror((_a))
#endif /* !HAVE_GETADDRINFO */
-#endif /* _COMPAT_GETADDRINFO_H */
+#endif /* COMPAT_GETADDRINFO_H */
* 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.
extern int optopt;
extern int optreset;
-#endif /* !_SUDO_GETOPT_H_ */
+#endif /* !COMPAT_GETOPT_H */
* @(#)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 {
#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 */
* 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
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 */
* 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
#define SHA512Update sudo_SHA512Update
#define SHA512Final sudo_SHA512Final
-#endif /* _SUDOERS_SHA2_H */
+#endif /* COMPAT_SHA2_H */
* Public domain.
*/
-#ifndef _COMPAT_STDBOOL_H_
-#define _COMPAT_STDBOOL_H_
+#ifndef COMPAT_STDBOOL_H
+#define COMPAT_STDBOOL_H
#ifndef __cplusplus
/* Inform that everything is fine */
#define __bool_true_false_are_defined 1
-#endif /* _COMPAT_STDBOOL_H_ */
+#endif /* COMPAT_STDBOOL_H */
* 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 */
* 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 <stdarg.h>
#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 */
* 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 <stdio.h>
#ifdef STDC_HEADERS
# 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))
# define reallocarray(_a, _b, _c) sudo_reallocarray((_a), (_b), (_c))
#endif /* HAVE_REALLOCARRAY */
-#endif /* _SUDO_COMPAT_H */
+#endif /* SUDO_COMPAT_H */
* 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"
#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 */
* 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 <stdarg.h>
#ifdef HAVE_STDBOOL_H
#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 */
* 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
#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 */
* 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"
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 */
* 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 <stdarg.h>
#ifdef HAVE_STDBOOL_H
# define sudo_warn_gettext(_a) sudo_warn_gettext_v1(NULL, (_a))
#endif
-#endif /* _SUDO_FATAL_H_ */
+#endif /* SUDO_FATAL_H */
* 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
#endif /* HAVE_LIBINTL_H */
-#endif /* _SUDO_GETTEXT_H */
+#endif /* SUDO_GETTEXT_H */
* 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.
#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 */
* 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
int (*query)(const char *user, const char *group, const struct passwd *pwd);
};
-#endif /* _SUDO_PLUGIN_H */
+#endif /* SUDO_PLUGIN_H */
* $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,
(head)->tqh_last = last; \
} while (0)
-#endif /* !_SUDO_QUEUE_H_ */
+#endif /* !SUDO_QUEUE_H */
* 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 <stdbool.h>
__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 */
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)
va_list ap;
va_start(ap, fmt);
- _warning(errno, fmt, ap);
+ warning(errno, fmt, ap);
va_end(ap);
do_cleanup();
exit(EXIT_FAILURE);
va_list ap;
va_start(ap, fmt);
- _warning(0, fmt, ap);
+ warning(0, fmt, ap);
va_end(ap);
do_cleanup();
exit(EXIT_FAILURE);
void
sudo_vfatal_nodebug_v1(const char *fmt, va_list ap)
{
- _warning(errno, fmt, ap);
+ warning(errno, fmt, ap);
do_cleanup();
exit(EXIT_FAILURE);
}
void
sudo_vfatalx_nodebug_v1(const char *fmt, va_list ap)
{
- _warning(0, fmt, ap);
+ warning(0, fmt, ap);
do_cleanup();
exit(EXIT_FAILURE);
}
va_list ap;
va_start(ap, fmt);
- _warning(errno, fmt, ap);
+ warning(errno, fmt, ap);
va_end(ap);
}
{
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;
* 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 */
* 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
int build_timestamp(struct passwd *pw);
int timestamp_status(struct passwd *pw);
-#endif /* _SUDOERS_CHECK_H */
+#endif /* SUDOERS_CHECK_H */
* 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 <def_data.h>
extern struct sudo_defs_types sudo_defs_table[];
-#endif /* _SUDOERS_DEFAULTS_H */
+#endif /* SUDOERS_DEFAULTS_H */
* 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.
"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 */
* 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).
"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 */
* 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).
"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 */
* 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."
"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 */
* 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)
#endif /* HAL_INSULTS || GOONS_INSULTS || CLASSIC_INSULTS || CSOPS_INSULTS */
-#endif /* _SUDOERS_INSULTS_H */
+#endif /* SUDOERS_INSULTS_H */
* 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
void set_interfaces(const char *);
struct interface_list *get_interfaces(void);
-#endif /* _SUDOERS_INTERFACES_H */
+#endif /* SUDOERS_INTERFACES_H */
* 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.
{ false, NULL } /* IOFD_MAX */
};
-#endif /* _SUDOERS_IOLOG_H */
+#endif /* SUDOERS_IOLOG_H */
* 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 */
* 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 <syslog.h>
#ifdef __STDC__
*/
#define LOG_INDENT " "
-#ifndef _SUDO_MAIN
+#ifndef SUDO_MAIN
/* XXX - needed for auditing */
extern int NewArgc;
extern char **NewArgv;
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 */
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 = {
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++;
* 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:
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);
}
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);
}
* 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
/* base64.c */
size_t base64_decode(const char *str, unsigned char *dst, size_t dsize);
-#endif /* _SUDOERS_PARSE_H */
+#endif /* SUDOERS_PARSE_H */
* 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)))
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 */
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
* 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);
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;
}
* 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,
struct rbtree *rbcreate(int (*)(const void *, const void *));
void rbdestroy(struct rbtree *, void (*)(void *));
-#endif /* _SUDOERS_REDBLACK_H */
+#endif /* SUDOERS_REDBLACK_H */
#define SUDO_ERROR_WRAP 0
-#define _SUDO_MAIN
+#define SUDO_MAIN
#include "sudoers.h"
#include "def_data.c"
* 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 */
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,
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);
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);
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);
}
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,
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",
* 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;
struct sudo_nss_list *sudo_read_nss(void);
-#endif /* _SUDOERS_NSS_H */
+#endif /* SUDOERS_NSS_H */
#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;
return len;
}
-sudo_printf_t sudo_printf = _sudo_printf;
+sudo_printf_t sudo_printf = sudo_printf_int;
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/
-#define _SUDO_MAIN
+#define SUDO_MAIN
#ifdef __TANDEM
# include <floss.h>
* 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 <limits.h>
#ifdef HAVE_STDBOOL_H
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;
extern sudo_printf_t sudo_printf;
#endif
-#endif /* _SUDOERS_SUDOERS_H */
+#endif /* SUDOERS_SUDOERS_H */
* 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"
#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 */
* 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 */
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/
-#define _SUDO_MAIN
+#define SUDO_MAIN
#include <config.h>
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 *);
#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
}
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) {
* 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);
(*trace_print)(msg); \
} while (0);
-#endif /* _SUDOERS_TOKE_H */
+#endif /* SUDOERS_TOKE_H */
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 *);
#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}
}
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) {
* Lock the sudoers file for safe editing (ala vipw) and check for parse errors.
*/
-#define _SUDO_MAIN
+#define SUDO_MAIN
#ifdef __TANDEM
# include <floss.h>
# include <ifaddrs.h>
#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 */
* 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 <limits.h>
#include <pathnames.h>
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 */
* 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.
const char *user);
bool utmp_logout(const char *line, int status);
-#endif /* _SUDO_EXEC_H */
+#endif /* SUDO_EXEC_H */
* 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.
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 */
* 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
*/
#define CONFIGURE_ARGS "@CONFIGURE_ARGS@"
-#endif /* _SUDO_USAGE_H */
+#endif /* SUDO_USAGE_H */