* Aliases are sorted by name with the type used as a tie-breaker.
*/
int
-alias_compare(v1, v2)
- const void *v1, *v2;
+alias_compare(const void *v1, const void *v2)
{
const struct alias *a1 = (const struct alias *)v1;
const struct alias *a2 = (const struct alias *)v2;
* Returns a pointer to the alias structure or NULL if not found.
*/
struct alias *
-alias_find(name, type)
- char *name;
- int type;
+alias_find(char *name, int type)
{
struct alias key;
struct rbnode *node;
* Returns NULL on success and an error string on failure.
*/
char *
-alias_add(name, type, members)
- char *name;
- int type;
- struct member *members;
+alias_add(char *name, int type, struct member *members)
{
static char errbuf[512];
struct alias *a;
* Apply a function to each alias entry and pass in a cookie.
*/
void
-alias_apply(func, cookie)
- int (*func)(void *, void *);
- void *cookie;
+alias_apply(int (*func)(void *, void *), void *cookie)
{
rbapply(aliases, func, cookie, inorder);
}
* Returns TRUE if there are no aliases, else FALSE.
*/
int
-no_aliases()
+no_aliases(void)
{
return(rbisempty(aliases));
}
* Free memory used by an alias struct and its members.
*/
void
-alias_free(v)
- void *v;
+alias_free(void *v)
{
struct alias *a = (struct alias *)v;
struct member *m;
* Find the named alias, remove it from the tree and return it.
*/
struct alias *
-alias_remove(name, type)
- char *name;
- int type;
+alias_remove(char *name, int type)
{
struct rbnode *node;
struct alias key, *a;
}
void
-init_aliases()
+init_aliases(void)
{
if (aliases != NULL)
rbdestroy(aliases, alias_free);
* XXX - check return values
*/
int
-check_user(validated, mode)
- int validated;
- int mode;
+check_user(int validated, int mode)
{
char *timestampdir = NULL;
char *timestampfile = NULL;
* Standard sudo lecture.
*/
static void
-lecture(status)
- int status;
+lecture(int status)
{
FILE *fp;
char buf[BUFSIZ];
* Update the time on the timestamp file/dir or create it if necessary.
*/
static void
-update_timestamp(timestampdir, timestampfile)
- char *timestampdir;
- char *timestampfile;
+update_timestamp(char *timestampdir, char *timestampfile)
{
if (timestamp_uid != 0)
set_perms(PERM_TIMESTAMP);
* allocated result. Returns the same string if there are no escapes.
*/
static char *
-expand_prompt(old_prompt, user, host)
- char *old_prompt;
- char *user;
- char *host;
+expand_prompt(char *old_prompt, char *user, char *host)
{
size_t len, n;
int subst;
* Checks if the user is exempt from supplying a password.
*/
int
-user_is_exempt()
+user_is_exempt(void)
{
if (!def_exempt_group)
return(FALSE);
* Fills in timestampdir as well as timestampfile if using tty tickets.
*/
static int
-build_timestamp(timestampdir, timestampfile)
- char **timestampdir;
- char **timestampfile;
+build_timestamp(char **timestampdir, char **timestampfile)
{
char *dirparent;
int len;
* Check the timestamp file and directory and return their status.
*/
static int
-timestamp_status(timestampdir, timestampfile, user, flags)
- char *timestampdir;
- char *timestampfile;
- char *user;
- int flags;
+timestamp_status(char *timestampdir, char *timestampfile, char *user, int flags)
{
struct stat sb;
struct timeval boottime, mtime;
* Remove the timestamp ticket file/dir.
*/
void
-remove_timestamp(remove)
- int remove;
+remove_timestamp(int remove)
{
struct timeval tv;
char *timestampdir, *timestampfile, *path;
* Print version and configure info.
*/
void
-dump_defaults()
+dump_defaults(void)
{
struct sudo_defs_types *cur;
struct list_member *item;
* List each option along with its description.
*/
void
-list_options()
+list_options(void)
{
struct sudo_defs_types *cur;
char *p;
* This is only meaningful for variables that are *optional*.
*/
int
-set_default(var, val, op)
- char *var;
- char *val;
- int op; /* TRUE or FALSE */
+set_default(char *var, char *val, int op)
{
struct sudo_defs_types *cur;
int num;
* Any of these may be overridden at runtime by a "Defaults" file.
*/
void
-init_defaults()
+init_defaults(void)
{
static int firsttime = 1;
struct sudo_defs_types *def;
* Pass in a an OR'd list of which default types to update.
*/
int
-update_defaults(what)
- int what;
+update_defaults(int what)
{
struct defaults *def;
}
static int
-store_int(val, def, op)
- char *val;
- struct sudo_defs_types *def;
- int op;
+store_int(char *val, struct sudo_defs_types *def, int op)
{
char *endp;
long l;
}
static int
-store_uint(val, def, op)
- char *val;
- struct sudo_defs_types *def;
- int op;
+store_uint(char *val, struct sudo_defs_types *def, int op)
{
char *endp;
long l;
}
static int
-store_float(val, def, op)
- char *val;
- struct sudo_defs_types *def;
- int op;
+store_float(char *val, struct sudo_defs_types *def, int op)
{
char *endp;
double d;
}
static int
-store_tuple(val, def, op)
- char *val;
- struct sudo_defs_types *def;
- int op;
+store_tuple(char *val, struct sudo_defs_types *def, int op)
{
struct def_values *v;
}
static int
-store_str(val, def, op)
- char *val;
- struct sudo_defs_types *def;
- int op;
+store_str(char *val, struct sudo_defs_types *def, int op)
{
efree(def->sd_un.str);
}
static int
-store_list(str, def, op)
- char *str;
- struct sudo_defs_types *def;
- int op;
+store_list(char *str, struct sudo_defs_types *def, int op)
{
char *start, *end;
}
static int
-store_syslogfac(val, def, op)
- char *val;
- struct sudo_defs_types *def;
- int op;
+store_syslogfac(char *val, struct sudo_defs_types *def, int op)
{
struct strmap *fac;
}
static const char *
-logfac2str(n)
- int n;
+logfac2str(int n)
{
#ifdef LOG_NFACILITIES
struct strmap *fac;
}
static int
-store_syslogpri(val, def, op)
- char *val;
- struct sudo_defs_types *def;
- int op;
+store_syslogpri(char *val, struct sudo_defs_types *def, int op)
{
struct strmap *pri;
}
static const char *
-logpri2str(n)
- int n;
+logpri2str(int n)
{
struct strmap *pri;
}
static int
-store_mode(val, def, op)
- char *val;
- struct sudo_defs_types *def;
- int op;
+store_mode(char *val, struct sudo_defs_types *def, int op)
{
char *endp;
long l;
}
static void
-list_op(val, len, def, op)
- char *val;
- size_t len;
- struct sudo_defs_types *def;
- enum list_ops op;
+list_op(char *val, size_t len, struct sudo_defs_types *def, enum list_ops op)
{
struct list_member *cur, *prev, *tmp;
* but it is in '.' and IGNORE_DOT is set.
*/
int
-find_path(infile, outfile, sbp, path)
- char *infile; /* file to find */
- char **outfile; /* result parameter */
- struct stat *sbp; /* stat result parameter */
- char *path; /* path to search */
+find_path(char *infile, char **outfile, struct stat *sbp, char *path)
{
static char command[PATH_MAX]; /* qualified filename */
char *n; /* for traversing path */
* If shadow passwords are in use, look in the shadow file.
*/
char *
-sudo_getepw(pw)
- const struct passwd *pw;
+sudo_getepw(const struct passwd *pw)
{
char *epw = NULL;
}
void
-sudo_setspent()
+sudo_setspent(void)
{
#ifdef HAVE_GETPRPWNAM
setprpwent();
}
void
-sudo_endspent()
+sudo_endspent(void)
{
#ifdef HAVE_GETPRPWNAM
endprpwent();
* timespecs in struct stat or, otherwise, using time().
*/
int
-gettime(tv)
- struct timeval *tv;
+gettime(struct timeval *tv)
{
int rval;
#if defined(HAVE_GETTIMEOFDAY) && (defined(HAVE_ST_MTIM) || defined(HAVE_ST_MTIMESPEC))
* Verify that path is a normal file and executable by root.
*/
char *
-sudo_goodpath(path, sbp)
- const char *path;
- struct stat *sbp;
+sudo_goodpath(const char *path, struct stat *sbp)
{
struct stat sb;
* machine's ip addresses and netmasks.
*/
void
-load_interfaces()
+load_interfaces(void)
{
struct ifaddrs *ifa, *ifaddrs;
struct sockaddr_in *sin;
* machine's ip addresses and netmasks.
*/
void
-load_interfaces()
+load_interfaces(void)
{
struct ifconf *ifconf;
struct ifreq *ifr, ifr_tmp;
* Stub function for those without SIOCGIFCONF
*/
void
-load_interfaces()
+load_interfaces(void)
{
return;
}
#endif /* SIOCGIFCONF && !STUB_LOAD_INTERFACES */
void
-dump_interfaces()
+dump_interfaces(void)
{
int i;
#ifdef HAVE_IN6_ADDR
static union script_fd io_outfile, io_timfile;
static void
-io_nextid()
+io_nextid(void)
{
struct stat sb;
char buf[32], *ep;
* append one if we want something other than LDAP_PORT.
*/
static void
-sudo_ldap_conf_add_ports()
+sudo_ldap_conf_add_ports(void)
{
char *host, *port, defport[13];
* where the trailing slash is optional.
*/
static int
-sudo_ldap_parse_uri(uri_list)
- const char *uri_list;
+sudo_ldap_parse_uri(const char *uri_list)
{
char *buf, *uri, *host, *cp, *port;
char hostbuf[LINE_MAX];
#endif /* HAVE_LDAP_INITIALIZE */
static int
-sudo_ldap_init(ldp, host, port)
- LDAP **ldp;
- const char *host;
- int port;
+sudo_ldap_init(LDAP **ldp, const char *host, int port)
{
LDAP *ld = NULL;
int rc = LDAP_CONNECT_ERROR;
* netgroup, else FALSE.
*/
int
-sudo_ldap_check_user_netgroup(ld, entry, user)
- LDAP *ld;
- LDAPMessage *entry;
- char *user;
+sudo_ldap_check_user_netgroup(LDAP *ld, LDAPMessage *entry, char *user)
{
struct berval **bv, **p;
char *val;
* host match, else FALSE.
*/
int
-sudo_ldap_check_host(ld, entry)
- LDAP *ld;
- LDAPMessage *entry;
+sudo_ldap_check_host(LDAP *ld, LDAPMessage *entry)
{
struct berval **bv, **p;
char *val;
}
int
-sudo_ldap_check_runas_user(ld, entry)
- LDAP *ld;
- LDAPMessage *entry;
+sudo_ldap_check_runas_user(LDAP *ld, LDAPMessage *entry)
{
struct berval **bv, **p;
char *val;
}
int
-sudo_ldap_check_runas_group(ld, entry)
- LDAP *ld;
- LDAPMessage *entry;
+sudo_ldap_check_runas_group(LDAP *ld, LDAPMessage *entry)
{
struct berval **bv, **p;
char *val;
* else FALSE. RunAs info is optional.
*/
int
-sudo_ldap_check_runas(ld, entry)
- LDAP *ld;
- LDAPMessage *entry;
+sudo_ldap_check_runas(LDAP *ld, LDAPMessage *entry)
{
int ret;
* FALSE if disallowed and UNSPEC if not matched.
*/
int
-sudo_ldap_check_command(ld, entry, setenv_implied)
- LDAP *ld;
- LDAPMessage *entry;
- int *setenv_implied;
+sudo_ldap_check_command(LDAP *ld, LDAPMessage *entry, int *setenv_implied)
{
struct berval **bv, **p;
char *allowed_cmnd, *allowed_args, *val;
* Returns TRUE if found and allowed, FALSE if negated, else UNSPEC.
*/
int
-sudo_ldap_check_bool(ld, entry, option)
- LDAP *ld;
- LDAPMessage *entry;
- char *option;
+sudo_ldap_check_bool(LDAP *ld, LDAPMessage *entry, char *option)
{
struct berval **bv, **p;
char ch, *var;
* from the cn=defaults entry and also once when a final sudoRole is matched.
*/
void
-sudo_ldap_parse_options(ld, entry)
- LDAP *ld;
- LDAPMessage *entry;
+sudo_ldap_parse_options(LDAP *ld, LDAPMessage *entry)
{
struct berval **bv, **p;
char op, *var, *val;
* builds together a filter to check against ldap
*/
char *
-sudo_ldap_build_pass1(pw)
- struct passwd *pw;
+sudo_ldap_build_pass1(struct passwd *pw)
{
struct group *grp;
size_t sz;
* Map yes/true/on to TRUE, no/false/off to FALSE, else -1
*/
int
-_atobool(s)
- const char *s;
+_atobool(const char *s)
{
switch (*s) {
case 'y':
}
static void
-sudo_ldap_read_secret(path)
- const char *path;
+sudo_ldap_read_secret(const char *path)
{
FILE *fp;
char buf[LINE_MAX], *cp;
}
int
-sudo_ldap_read_config()
+sudo_ldap_read_config(void)
{
FILE *fp;
char *cp, *keyword, *value;
* Extract the dn from an entry and return the first rdn from it.
*/
static char *
-sudo_ldap_get_first_rdn(ld, entry)
- LDAP *ld;
- LDAPMessage *entry;
+sudo_ldap_get_first_rdn(LDAP *ld, LDAPMessage *entry)
{
#ifdef HAVE_LDAP_STR2DN
char *dn, *rdn = NULL;
* Fetch and display the global Options.
*/
int
-sudo_ldap_display_defaults(nss, pw, lbuf)
- struct sudo_nss *nss;
- struct passwd *pw;
- struct lbuf *lbuf;
+sudo_ldap_display_defaults(struct sudo_nss *nss, struct passwd *pw,
+ struct lbuf *lbuf)
{
struct berval **bv, **p;
LDAP *ld = (LDAP *) nss->handle;
* STUB
*/
int
-sudo_ldap_display_bound_defaults(nss, pw, lbuf)
- struct sudo_nss *nss;
- struct passwd *pw;
- struct lbuf *lbuf;
+sudo_ldap_display_bound_defaults(struct sudo_nss *nss, struct passwd *pw,
+ struct lbuf *lbuf)
{
return(0);
}
* Print a record in the short form, ala file sudoers.
*/
int
-sudo_ldap_display_entry_short(ld, entry, lbuf)
- LDAP *ld;
- LDAPMessage *entry;
- struct lbuf *lbuf;
+sudo_ldap_display_entry_short(LDAP *ld, LDAPMessage *entry, struct lbuf *lbuf)
{
struct berval **bv, **p;
int count = 0;
* Print a record in the long form.
*/
int
-sudo_ldap_display_entry_long(ld, entry, lbuf)
- LDAP *ld;
- LDAPMessage *entry;
- struct lbuf *lbuf;
+sudo_ldap_display_entry_long(LDAP *ld, LDAPMessage *entry, struct lbuf *lbuf)
{
struct berval **bv, **p;
char *rdn;
* Like sudo_ldap_lookup(), except we just print entries.
*/
int
-sudo_ldap_display_privs(nss, pw, lbuf)
- struct sudo_nss *nss;
- struct passwd *pw;
- struct lbuf *lbuf;
+sudo_ldap_display_privs(struct sudo_nss *nss, struct passwd *pw,
+ struct lbuf *lbuf)
{
LDAP *ld = (LDAP *) nss->handle;
LDAPMessage *entry = NULL, *result = NULL;
}
int
-sudo_ldap_display_cmnd(nss, pw)
- struct sudo_nss *nss;
- struct passwd *pw;
+sudo_ldap_display_cmnd(struct sudo_nss *nss, struct passwd *pw)
{
LDAP *ld = (LDAP *) nss->handle;
LDAPMessage *entry = NULL, *result = NULL; /* used for searches */
#ifdef HAVE_LDAP_SASL_INTERACTIVE_BIND_S
static int
-sudo_ldap_sasl_interact(ld, flags, _auth_id, _interact)
- LDAP *ld;
- unsigned int flags;
- void *_auth_id;
- void *_interact;
+sudo_ldap_sasl_interact(LDAP *ld, unsigned int flags, void *_auth_id,
+ void *_interact)
{
char *auth_id = (char *)_auth_id;
sasl_interact_t *interact = (sasl_interact_t *)_interact;
* Set LDAP options based on the config table.
*/
int
-sudo_ldap_set_options(ld)
- LDAP *ld;
+sudo_ldap_set_options(LDAP *ld)
{
struct ldap_config_table *cur;
int rc;
* Connect to the LDAP server specified by ld
*/
static int
-sudo_ldap_bind_s(ld)
- LDAP *ld;
+sudo_ldap_bind_s(LDAP *ld)
{
int rc;
const char *old_ccname = user_ccname;
* Returns 0 on success and non-zero on failure.
*/
int
-sudo_ldap_open(nss)
- struct sudo_nss *nss;
+sudo_ldap_open(struct sudo_nss *nss)
{
LDAP *ld;
int rc, ldapnoinit = FALSE;
}
int
-sudo_ldap_setdefs(nss)
- struct sudo_nss *nss;
+sudo_ldap_setdefs(struct sudo_nss *nss)
{
LDAP *ld = (LDAP *) nss->handle;
LDAPMessage *entry = NULL, *result = NULL; /* used for searches */
* like sudoers_lookup() - only LDAP style
*/
int
-sudo_ldap_lookup(nss, ret, pwflag)
- struct sudo_nss *nss;
- int ret;
- int pwflag;
+sudo_ldap_lookup(struct sudo_nss *nss, int ret, int pwflag)
{
LDAP *ld = (LDAP *) nss->handle;
LDAPMessage *entry = NULL, *result = NULL;
* shut down LDAP connection
*/
int
-sudo_ldap_close(nss)
- struct sudo_nss *nss;
+sudo_ldap_close(struct sudo_nss *nss)
{
if (nss->handle != NULL) {
ldap_unbind_ext_s((LDAP *) nss->handle, NULL, NULL);
* STUB
*/
int
-sudo_ldap_parse(nss)
- struct sudo_nss *nss;
+sudo_ldap_parse(struct sudo_nss *nss)
{
return(0);
}
* Sadly this is a maze of #ifdefs.
*/
static void
-#ifdef __STDC__
mysyslog(int pri, const char *fmt, ...)
-#else
-mysyslog(pri, fmt, va_alist)
- int pri;
- const char *fmt;
- va_dcl
-#endif
{
#ifdef BROKEN_SYSLOG
int i;
char buf[MAXSYSLOGLEN+1];
va_list ap;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
#ifdef LOG_NFACILITIES
openlog("sudo", 0, def_syslog);
#else
* message into parts if it is longer than MAXSYSLOGLEN.
*/
static void
-do_syslog(pri, msg)
- int pri;
- char *msg;
+do_syslog(int pri, char *msg)
{
size_t len, maxlen;
char *p, *tmp, save;
}
static void
-do_logfile(msg)
- char *msg;
+do_logfile(char *msg)
{
char *full_line;
char *beg, *oldend, *end;
* Log and mail the denial message, optionally informing the user.
*/
void
-log_denial(status, inform_user)
- int status;
- int inform_user;
+log_denial(int status, int inform_user)
{
char *message;
char *logline;
* Log and potentially mail the allowed command.
*/
void
-log_allowed(status)
- int status;
+log_allowed(int status)
{
char *logline;
}
void
-#ifdef __STDC__
log_error(int flags, const char *fmt, ...)
-#else
-log_error(flags, fmt, va_alist)
- int flags;
- const char *fmt;
- va_dcl
-#endif
{
int serrno = errno;
char *message;
char *logline;
va_list ap;
-#ifdef __STDC__
- va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
/* Expand printf-style format + args. */
+ va_start(ap, fmt);
evasprintf(&message, fmt, ap);
va_end(ap);
* Determine whether we should send mail based on "status" and defaults options.
*/
static int
-should_mail(status)
- int status;
+should_mail(int status)
{
return(def_mail_always || ISSET(status, VALIDATE_ERROR) ||
* Allocate and fill in a new logline.
*/
static char *
-new_logline(message, serrno)
- const char *message;
- int serrno;
+new_logline(const char *message, int serrno)
{
size_t len = 0;
char *evstr = NULL;
* Returns ALLOW, DENY or UNSPEC.
*/
static int
-_userlist_matches(pw, list)
- struct passwd *pw;
- struct member_list *list;
+_userlist_matches(struct passwd *pw, struct member_list *list)
{
struct member *m;
struct alias *a;
}
int
-userlist_matches(pw, list)
- struct passwd *pw;
- struct member_list *list;
+userlist_matches(struct passwd *pw, struct member_list *list)
{
alias_seqno++;
return(_userlist_matches(pw, list));
* Returns ALLOW, DENY or UNSPEC.
*/
static int
-_runaslist_matches(user_list, group_list)
- struct member_list *user_list;
- struct member_list *group_list;
+_runaslist_matches(struct member_list *user_list, struct member_list *group_list)
{
struct member *m;
struct alias *a;
}
int
-runaslist_matches(user_list, group_list)
- struct member_list *user_list;
- struct member_list *group_list;
+runaslist_matches(struct member_list *user_list, struct member_list *group_list)
{
alias_seqno++;
return(_runaslist_matches(user_list ? user_list : &empty,
* Returns ALLOW, DENY or UNSPEC.
*/
static int
-_hostlist_matches(list)
- struct member_list *list;
+_hostlist_matches(struct member_list *list)
{
struct member *m;
struct alias *a;
}
int
-hostlist_matches(list)
- struct member_list *list;
+hostlist_matches(struct member_list *list)
{
alias_seqno++;
return(_hostlist_matches(list));
* Returns ALLOW, DENY or UNSPEC.
*/
static int
-_cmndlist_matches(list)
- struct member_list *list;
+_cmndlist_matches(struct member_list *list)
{
struct member *m;
int matched = UNSPEC;
}
int
-cmndlist_matches(list)
- struct member_list *list;
+cmndlist_matches(struct member_list *list)
{
alias_seqno++;
return(_cmndlist_matches(list));
* Returns ALLOW, DENY or UNSPEC.
*/
int
-cmnd_matches(m)
- struct member *m;
+cmnd_matches(struct member *m)
{
struct alias *a;
struct sudo_command *c;
* otherwise, return TRUE if user_cmnd names one of the inodes in path.
*/
int
-command_matches(sudoers_cmnd, sudoers_args)
- char *sudoers_cmnd;
- char *sudoers_args;
+command_matches(char *sudoers_cmnd, char *sudoers_args)
{
/* Check for pseudo-commands */
if (sudoers_cmnd[0] != '/') {
}
static int
-command_matches_fnmatch(sudoers_cmnd, sudoers_args)
- char *sudoers_cmnd;
- char *sudoers_args;
+command_matches_fnmatch(char *sudoers_cmnd, char *sudoers_args)
{
/*
* Return true if fnmatch(3) succeeds AND
}
static int
-command_matches_glob(sudoers_cmnd, sudoers_args)
- char *sudoers_cmnd;
- char *sudoers_args;
+command_matches_glob(char *sudoers_cmnd, char *sudoers_args)
{
struct stat sudoers_stat;
size_t dlen;
}
static int
-command_matches_normal(sudoers_cmnd, sudoers_args)
- char *sudoers_cmnd;
- char *sudoers_args;
+command_matches_normal(char *sudoers_cmnd, char *sudoers_args)
{
struct stat sudoers_stat;
char *base;
* Return TRUE if user_cmnd names one of the inodes in dir, else FALSE.
*/
static int
-command_matches_dir(sudoers_dir, dlen)
- char *sudoers_dir;
- size_t dlen;
+command_matches_dir(char *sudoers_dir, size_t dlen)
{
struct stat sudoers_stat;
struct dirent *dent;
}
static int
-addr_matches_if(n)
- char *n;
+addr_matches_if(char *n)
{
int i;
struct in_addr addr;
}
static int
-addr_matches_if_netmask(n, m)
- char *n;
- char *m;
+addr_matches_if_netmask(char *n, char *m)
{
int i;
struct in_addr addr, mask;
* "n" is a network that we are on, else returns FALSE.
*/
int
-addr_matches(n)
- char *n;
+addr_matches(char *n)
{
char *m;
int retval;
* Returns TRUE if the hostname matches the pattern, else FALSE
*/
int
-hostname_matches(shost, lhost, pattern)
- char *shost;
- char *lhost;
- char *pattern;
+hostname_matches(char *shost, char *lhost, char *pattern)
{
if (has_meta(pattern)) {
if (strchr(pattern, '.'))
* else returns FALSE.
*/
int
-userpw_matches(sudoers_user, user, pw)
- char *sudoers_user;
- char *user;
- struct passwd *pw;
+userpw_matches(char *sudoers_user, char *user, struct passwd *pw)
{
if (pw != NULL && *sudoers_user == '#') {
uid_t uid = (uid_t) atoi(sudoers_user + 1);
* else returns FALSE.
*/
int
-group_matches(sudoers_group, gr)
- char *sudoers_group;
- struct group *gr;
+group_matches(char *sudoers_group, struct group *gr)
{
if (*sudoers_group == '#') {
gid_t gid = (gid_t) atoi(sudoers_group + 1);
* else returns FALSE.
*/
int
-usergr_matches(group, user, pw)
- char *group;
- char *user;
- struct passwd *pw;
+usergr_matches(char *group, char *user, struct passwd *pw)
{
/* make sure we have a valid usergroup, sudo style */
if (*group++ != '%')
* XXX - swap order of host & shost
*/
int
-netgr_matches(netgr, lhost, shost, user)
- char *netgr;
- char *lhost;
- char *shost;
- char *user;
+netgr_matches(char *netgr, char *lhost, char *shost, char *user)
{
static char *domain;
#ifdef HAVE_GETDOMAINNAME
#ifndef _NONUNIX_H
#define _NONUNIX_H
-void
-sudo_nonunix_groupcheck_init(void);
-
-void
-sudo_nonunix_groupcheck_cleanup(void);
-
-int
-sudo_nonunix_groupcheck( const char* group, const char* user, const struct passwd* pwd );
-
-int
-sudo_nonunix_groupcheck_available(void);
+void sudo_nonunix_groupcheck_init(void);
+void sudo_nonunix_groupcheck_cleanup(void);
+int sudo_nonunix_groupcheck(const char *group, const char *user,
+ const struct passwd *pwd);
+int sudo_nonunix_groupcheck_available(void);
#endif /* _NONUNIX_H */
static int display_bound_defaults(int, struct lbuf *);
int
-sudo_file_open(nss)
- struct sudo_nss *nss;
+sudo_file_open(struct sudo_nss *nss)
{
if (def_ignore_local_sudoers)
return(-1);
}
int
-sudo_file_close(nss)
- struct sudo_nss *nss;
+sudo_file_close(struct sudo_nss *nss)
{
/* Free parser data structures and close sudoers file. */
init_parser(NULL, 0);
* Parse the specified sudoers file.
*/
int
-sudo_file_parse(nss)
- struct sudo_nss *nss;
+sudo_file_parse(struct sudo_nss *nss)
{
if (nss->handle == NULL)
return(-1);
* Wrapper around update_defaults() for nsswitch code.
*/
int
-sudo_file_setdefs(nss)
- struct sudo_nss *nss;
+sudo_file_setdefs(struct sudo_nss *nss)
{
if (nss->handle == NULL)
return(-1);
* allowed to run the specified command on this host as the target user.
*/
int
-sudo_file_lookup(nss, validated, pwflag)
- struct sudo_nss *nss;
- int validated;
- int pwflag;
+sudo_file_lookup(struct sudo_nss *nss, int validated, int pwflag)
{
int match, host_match, runas_match, cmnd_match;
struct cmndspec *cs;
(cs->tags.t != UNSPEC && cs->tags.t != IMPLIED && cs->tags.t != tags->t)
static void
-sudo_file_append_cmnd(cs, tags, lbuf)
- struct cmndspec *cs;
- struct cmndtag *tags;
- struct lbuf *lbuf;
+sudo_file_append_cmnd(struct cmndspec *cs, struct cmndtag *tags,
+ struct lbuf *lbuf)
{
struct member *m;
}
static int
-sudo_file_display_priv_short(pw, us, lbuf)
- struct passwd *pw;
- struct userspec *us;
- struct lbuf *lbuf;
+sudo_file_display_priv_short(struct passwd *pw, struct userspec *us,
+ struct lbuf *lbuf)
{
struct cmndspec *cs;
struct member *m;
}
static int
-sudo_file_display_priv_long(pw, us, lbuf)
- struct passwd *pw;
- struct userspec *us;
- struct lbuf *lbuf;
+sudo_file_display_priv_long(struct passwd *pw, struct userspec *us,
+ struct lbuf *lbuf)
{
struct cmndspec *cs;
struct member *m;
}
int
-sudo_file_display_privs(nss, pw, lbuf)
- struct sudo_nss *nss;
- struct passwd *pw;
- struct lbuf *lbuf;
+sudo_file_display_privs(struct sudo_nss *nss, struct passwd *pw,
+ struct lbuf *lbuf)
{
struct userspec *us;
int nfound = 0;
* Display matching Defaults entries for the given user on this host.
*/
int
-sudo_file_display_defaults(nss, pw, lbuf)
- struct sudo_nss *nss;
- struct passwd *pw;
- struct lbuf *lbuf;
+sudo_file_display_defaults(struct sudo_nss *nss, struct passwd *pw,
+ struct lbuf *lbuf)
{
struct defaults *d;
char *prefix;
* Display Defaults entries that are per-runas or per-command
*/
int
-sudo_file_display_bound_defaults(nss, pw, lbuf)
- struct sudo_nss *nss;
- struct passwd *pw;
- struct lbuf *lbuf;
+sudo_file_display_bound_defaults(struct sudo_nss *nss, struct passwd *pw,
+ struct lbuf *lbuf)
{
int nfound = 0;
* Display Defaults entries of the given type.
*/
static int
-display_bound_defaults(dtype, lbuf)
- int dtype;
- struct lbuf *lbuf;
+display_bound_defaults(int dtype, struct lbuf *lbuf)
{
struct defaults *d;
struct member *m, *binding = NULL;
}
int
-sudo_file_display_cmnd(nss, pw)
- struct sudo_nss *nss;
- struct passwd *pw;
+sudo_file_display_cmnd(struct sudo_nss *nss, struct passwd *pw)
{
struct cmndspec *cs;
struct member *match;
* Print the contents of a struct member to stdout
*/
static void
-_print_member(lbuf, name, type, negated, alias_type)
- struct lbuf *lbuf;
- char *name;
- int type, negated, alias_type;
+_print_member(struct lbuf *lbuf, char *name, int type, int negated,
+ int alias_type)
{
struct alias *a;
struct member *m;
}
static void
-print_member(lbuf, name, type, negated, alias_type)
- struct lbuf *lbuf;
- char *name;
- int type, negated, alias_type;
+print_member(struct lbuf *lbuf, char *name, int type, int negated,
+ int alias_type)
{
alias_seqno++;
_print_member(lbuf, name, type, negated, alias_type);
* Compare by uid.
*/
static int
-cmp_pwuid(v1, v2)
- const void *v1;
- const void *v2;
+cmp_pwuid(const void *v1, const void *v2)
{
const struct passwd *pw1 = (const struct passwd *) v1;
const struct passwd *pw2 = (const struct passwd *) v2;
* Compare by user name.
*/
static int
-cmp_pwnam(v1, v2)
- const void *v1;
- const void *v2;
+cmp_pwnam(const void *v1, const void *v2)
{
const struct passwd *pw1 = (const struct passwd *) v1;
const struct passwd *pw2 = (const struct passwd *) v2;
* that we care about. Fills in pw_passwd from shadow file.
*/
static struct passwd *
-sudo_pwdup(pw)
- const struct passwd *pw;
+sudo_pwdup(const struct passwd *pw)
{
char *cp;
const char *pw_shell;
* Fills in pw_passwd from shadow file if necessary.
*/
struct passwd *
-sudo_getpwuid(uid)
- uid_t uid;
+sudo_getpwuid(uid_t uid)
{
struct passwd key, *pw;
struct rbnode *node;
* Fills in pw_passwd from shadow file if necessary.
*/
struct passwd *
-sudo_getpwnam(name)
- const char *name;
+sudo_getpwnam(const char *name)
{
struct passwd key, *pw;
struct rbnode *node;
* Take a uid in string form "#123" and return a faked up passwd struct.
*/
struct passwd *
-sudo_fakepwnam(user, gid)
- const char *user;
- gid_t gid;
+sudo_fakepwnam(const char *user, gid_t gid)
{
struct passwd *pw;
struct rbnode *node;
* Take a gid in string form "#123" and return a faked up group struct.
*/
struct group *
-sudo_fakegrnam(group)
- const char *group;
+sudo_fakegrnam(const char *group)
{
struct group *gr;
struct rbnode *node;
}
static void
-pw_free(v)
- void *v;
+pw_free(void *v)
{
struct passwd *pw = (struct passwd *) v;
* Compare by gid.
*/
static int
-cmp_grgid(v1, v2)
- const void *v1;
- const void *v2;
+cmp_grgid(const void *v1, const void *v2)
{
const struct group *grp1 = (const struct group *) v1;
const struct group *grp2 = (const struct group *) v2;
* Compare by group name.
*/
static int
-cmp_grnam(v1, v2)
- const void *v1;
- const void *v2;
+cmp_grnam(const void *v1, const void *v2)
{
const struct group *grp1 = (const struct group *) v1;
const struct group *grp2 = (const struct group *) v2;
}
struct group *
-sudo_grdup(gr)
- const struct group *gr;
+sudo_grdup(const struct group *gr)
{
char *cp;
size_t nsize, psize, nmem, total, len;
* Get a group entry by gid and allocate space for it.
*/
struct group *
-sudo_getgrgid(gid)
- gid_t gid;
+sudo_getgrgid(gid_t gid)
{
struct group key, *gr;
struct rbnode *node;
* Get a group entry by name and allocate space for it.
*/
struct group *
-sudo_getgrnam(name)
- const char *name;
+sudo_getgrnam(const char *name)
{
struct group key, *gr;
struct rbnode *node;
}
int
-user_in_group(pw, group)
- struct passwd *pw;
- const char *group;
+user_in_group(struct passwd *pw, const char *group)
{
#ifdef HAVE_MBR_CHECK_MEMBERSHIP
uuid_t gu, uu;
* Allocates and returns the initialized (empty) tree.
*/
struct rbtree *
-rbcreate(compar)
- int (*compar)(const void *, const void*);
+rbcreate(int (*compar)(const void *, const void*))
{
struct rbtree *tree;
* Perform a left rotation starting at node.
*/
static void
-rotate_left(tree, node)
- struct rbtree *tree;
- struct rbnode *node;
+rotate_left(struct rbtree *tree, struct rbnode *node)
{
struct rbnode *child;
* Perform a right rotation starting at node.
*/
static void
-rotate_right(tree, node)
- struct rbtree *tree;
- struct rbnode *node;
+rotate_right(struct rbtree *tree, struct rbnode *node)
{
struct rbnode *child;
* already exists, a pointer to the existant node is returned.
*/
struct rbnode *
-rbinsert(tree, data)
- struct rbtree *tree;
- void *data;
+rbinsert(struct rbtree *tree, void *data)
{
struct rbnode *node = rbfirst(tree);
struct rbnode *parent = rbroot(tree);
* Returns a pointer to the node if found, else NULL.
*/
struct rbnode *
-rbfind(tree, key)
- struct rbtree *tree;
- void *key;
+rbfind(struct rbtree *tree, void *key)
{
struct rbnode *node = rbfirst(tree);
int res;
* error value is returned. Returns 0 on successful traversal.
*/
int
-rbapply_node(tree, node, func, cookie, order)
- struct rbtree *tree;
- struct rbnode *node;
- int (*func)(void *, void *);
- void *cookie;
- enum rbtraversal order;
+rbapply_node(struct rbtree *tree, struct rbnode *node,
+ int (*func)(void *, void *), void *cookie, enum rbtraversal order)
{
int error;
* Returns the successor of node, or nil if there is none.
*/
static struct rbnode *
-rbsuccessor(tree, node)
- struct rbtree *tree;
- struct rbnode *node;
+rbsuccessor(struct rbtree *tree, struct rbnode *node)
{
struct rbnode *succ;
* Recursive portion of rbdestroy().
*/
static void
-_rbdestroy(tree, node, destroy)
- struct rbtree *tree;
- struct rbnode *node;
- void (*destroy)(void *);
+_rbdestroy(struct rbtree *tree, struct rbnode *node, void (*destroy)(void *))
{
if (node != rbnil(tree)) {
_rbdestroy(tree, node->left, destroy);
* for each node and then freeing the tree itself.
*/
void
-rbdestroy(tree, destroy)
- struct rbtree *tree;
- void (*destroy)(void *);
+rbdestroy(struct rbtree *tree, void (*destroy)(void *))
{
_rbdestroy(tree, rbfirst(tree), destroy);
efree(tree);
/*
* Delete node 'z' from the tree and return its data pointer.
*/
-void *rbdelete(tree, z)
- struct rbtree *tree;
- struct rbnode *z;
+void *rbdelete(struct rbtree *tree, struct rbnode *z)
{
struct rbnode *x, *y;
void *data = z->data;
* colors to restore the 4 properties inherent in red-black trees.
*/
static void
-rbrepair(tree, node)
- struct rbtree *tree;
- struct rbnode *node;
+rbrepair(struct rbtree *tree, struct rbnode *node)
{
struct rbnode *sibling;
* Returns a tail queue of matches.
*/
struct sudo_nss_list *
-sudo_read_nss()
+sudo_read_nss(void)
{
FILE *fp;
char *cp;
* Returns a tail queue of matches.
*/
struct sudo_nss_list *
-sudo_read_nss()
+sudo_read_nss(void)
{
FILE *fp;
char *cp, *ep;
* Non-nsswitch.conf version with hard-coded order.
*/
struct sudo_nss_list *
-sudo_read_nss()
+sudo_read_nss(void)
{
static struct sudo_nss_list snl;
/* Reset user_groups based on passwd entry. */
static void
-reset_groups(pw)
- struct passwd *pw;
+reset_groups(struct passwd *pw)
{
#if defined(HAVE_INITGROUPS) && defined(HAVE_GETGROUPS)
if (pw != sudo_user.pw) {
* We only get here if the user is allowed to run something on this host.
*/
void
-display_privs(snl, pw)
- struct sudo_nss_list *snl;
- struct passwd *pw;
+display_privs(struct sudo_nss_list *snl, struct passwd *pw)
{
struct sudo_nss *nss;
struct lbuf lbuf;
* command is allowed.
*/
int
-display_cmnd(snl, pw)
- struct sudo_nss_list *snl;
- struct passwd *pw;
+display_cmnd(struct sudo_nss_list *snl, struct passwd *pw)
{
struct sudo_nss *nss;
* and apply any command-specific defaults entries.
*/
static int
-set_cmnd(sudo_mode)
- int sudo_mode;
+set_cmnd(int sudo_mode)
{
int rval;
* Returns a handle to the sudoers file or NULL on error.
*/
FILE *
-open_sudoers(sudoers, doedit, keepopen)
- const char *sudoers;
- int doedit;
- int *keepopen;
+open_sudoers(const char *sudoers, int doedit, int *keepopen)
{
struct stat statbuf;
FILE *fp = NULL;
#ifdef HAVE_LOGIN_CAP_H
static void
-set_loginclass(pw)
- struct passwd *pw;
+set_loginclass(struct passwd *pw)
{
int errflags;
}
#else
static void
-set_loginclass(pw)
- struct passwd *pw;
+set_loginclass(struct passwd *pw)
{
}
#endif /* HAVE_LOGIN_CAP_H */
#ifdef HAVE_PROJECT_H
static void
-set_project(pw)
- struct passwd *pw;
+set_project(struct passwd *pw)
{
int errflags = NO_MAIL|MSG_ONLY|NO_EXIT;
int errval;
}
#else
static void
-set_project(pw)
- struct passwd *pw;
+set_project(struct passwd *pw)
{
}
#endif /* HAVE_PROJECT_H */
* By default, this is "root". Updates runas_pw as a side effect.
*/
static void
-set_runaspw(user)
- char *user;
+set_runaspw(char *user)
{
if (*user == '#') {
if ((runas_pw = sudo_getpwuid(atoi(user + 1))) == NULL)
* Updates runas_pw as a side effect.
*/
static void
-set_runasgr(group)
- char *group;
+set_runasgr(char *group)
{
if (*group == '#') {
if ((runas_gr = sudo_getgrgid(atoi(group + 1))) == NULL)
* case, this matches sudo_user.pw or runas_pw.
*/
static struct passwd *
-get_authpw()
+get_authpw(void)
{
struct passwd *pw;
* Cleanup hook for error()/errorx()
*/
void
-cleanup(gotsignal)
- int gotsignal;
+cleanup(int gotsignal)
{
struct sudo_nss *nss;
isalnum((s)[3]) && isalnum((s)[4]) && isalnum((s)[5]) && (s)[6] == '\0')
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch, plen, nready, interactive = 0, listonly = 0;
const char *id, *user = NULL, *pattern = NULL, *tty = NULL;
}
static void
-delay(secs)
- double secs;
+delay(double secs)
{
struct timespec ts, rts;
int rval;
* Build expression list from search args
*/
static int
-parse_expr(headp, argv)
- struct search_node **headp;
- char **argv;
+parse_expr(struct search_node **headp, char *argv[])
{
struct search_node *sn, *newsn;
char or = 0, not = 0, type, **av;
}
static int
-match_expr(head, log)
- struct search_node *head;
- struct log_info *log;
+match_expr(struct search_node *head, struct log_info *log)
{
struct search_node *sn;
int matched = 1, rc;
}
static int
-list_session_dir(pathbuf, re, user, tty)
- char *pathbuf;
- REGEX_T *re;
- const char *user;
- const char *tty;
+list_session_dir(char *pathbuf, REGEX_T *re, const char *user, const char *tty)
{
FILE *fp;
DIR *d;
}
static int
-list_sessions(argc, argv, pattern, user, tty)
- int argc;
- char **argv;
- const char *pattern;
- const char *user;
- const char *tty;
+list_sessions(int argc, char **argv, const char *pattern, const char *user,
+ const char *tty)
{
DIR *d1, *d2;
struct dirent *dp1, *dp2;
* pause, slow, fast
*/
static void
-check_input(ttyfd, speed)
- int ttyfd;
- double *speed;
+check_input(int ttyfd, double *speed)
{
fd_set *fdsr;
int nready, paused = 0;
}
static void
-usage()
+usage(void)
{
fprintf(stderr,
"usage: %s [-d directory] [-m max_wait] [-s speed_factor] ID\n",
* Cleanup hook for error()/errorx()
*/
void
-cleanup(signo)
- int signo;
+cleanup(int signo)
{
term_restore(STDOUT_FILENO, 0);
if (signo)
extern struct passwd *getpwuid(uid_t);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct cmndspec *cs;
struct privilege *priv;
}
void
-set_runaspw(user)
- char *user;
+set_runaspw(char *user)
{
if (*user == '#') {
if ((runas_pw = sudo_getpwuid(atoi(user + 1))) == NULL)
}
void
-set_runasgr(group)
- char *group;
+set_runasgr(char *group)
{
if (*group == '#') {
if ((runas_gr = sudo_getgrgid(atoi(group + 1))) == NULL)
}
void
-sudo_setspent()
+sudo_setspent(void)
{
return;
}
void
-sudo_endspent()
+sudo_endspent(void)
{
return;
}
char *
-sudo_getepw(pw)
- const struct passwd *pw;
+sudo_getepw(const struct passwd *pw)
{
return (pw->pw_passwd);
}
void
-set_fqdn()
+set_fqdn(void)
{
return;
}
FILE *
-open_sudoers(path, isdir, keepopen)
- const char *path;
- int isdir;
- int *keepopen;
+open_sudoers(const char *path, int isdir, int *keepopen)
{
return(fopen(path, "r"));
}
void
-init_envtables()
+init_envtables(void)
{
return;
}
}
void
-cleanup(gotsignal)
- int gotsignal;
+cleanup(int gotsignal)
{
if (!gotsignal) {
sudo_endpwent();
}
void
-print_member(m)
- struct member *m;
+print_member(struct member *m)
{
struct sudo_command *c;
}
void
-print_defaults()
+print_defaults(void)
{
struct defaults *d;
struct member *m;
}
int
-print_alias(v1, v2)
- void *v1, *v2;
+print_alias(void *v1, void *v2)
{
struct alias *a = (struct alias *)v1;
struct member *m;
}
void
-print_privilege(priv)
- struct privilege *priv;
+print_privilege(struct privilege *priv)
{
struct cmndspec *cs;
struct member *m;
}
void
-print_userspecs()
+print_userspecs(void)
{
struct member *m;
struct userspec *us;
}
void
-dump_sudoers()
+dump_sudoers(void)
{
print_defaults();
}
void
-usage()
+usage(void)
{
(void) fprintf(stderr, "usage: %s [-d] [-G grfile] [-g group] [-h host] [-p pwfile] [-u user] <user> <command> [args]\n", getprogname());
exit(1);
* Uses strftime() if available, else falls back to ctime().
*/
char *
-get_timestr(tstamp, log_year)
- time_t tstamp;
- int log_year;
+get_timestr(time_t tstamp, int log_year)
{
char *s;
#ifdef HAVE_STRFTIME
struct passwd *getpwuid(uid_t);
void
-setpwfile(file)
- const char *file;
+setpwfile(const char *file)
{
pwfile = file;
if (pwf != NULL)
}
void
-setpwent()
+setpwent(void)
{
if (pwf == NULL)
pwf = fopen(pwfile, "r");
}
void
-endpwent()
+endpwent(void)
{
if (pwf != NULL) {
fclose(pwf);
}
struct passwd *
-getpwent()
+getpwent(void)
{
static struct passwd pw;
static char pwbuf[LINE_MAX];
}
struct passwd *
-getpwnam(name)
- const char *name;
+getpwnam(const char *name)
{
struct passwd *pw;
}
struct passwd *
-getpwuid(uid)
- uid_t uid;
+getpwuid(uid_t uid)
{
struct passwd *pw;
}
void
-setgrfile(file)
- const char *file;
+setgrfile(const char *file)
{
grfile = file;
if (grf != NULL)
}
void
-setgrent()
+setgrent(void)
{
if (grf == NULL)
grf = fopen(grfile, "r");
}
void
-endgrent()
+endgrent(void)
{
if (grf != NULL) {
fclose(grf);
}
struct group *
-getgrent()
+getgrent(void)
{
static struct group gr;
static char grbuf[LINE_MAX], *gr_mem[GRMEM_MAX+1];
}
struct group *
-getgrnam(name)
- const char *name;
+getgrnam(const char *name)
{
struct group *gr;
}
struct group *
-getgrgid(gid)
- gid_t gid;
+getgrgid(gid_t gid)
{
struct group *gr;
* Clean up nonunix_groupcheck state.
*/
void
-sudo_nonunix_groupcheck_cleanup()
+sudo_nonunix_groupcheck_cleanup(void)
{
if (err_msg) {
free(err_msg);
static struct rbtree *alias_freelist;
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct sudoersfile *sp;
char *args, *editor, *sudoers_path;
* Returns TRUE on success, else FALSE.
*/
static int
-edit_sudoers(sp, editor, args, lineno)
- struct sudoersfile *sp;
- char *editor, *args;
- int lineno;
+edit_sudoers(struct sudoersfile *sp, char *editor, char *args, int lineno)
{
int tfd; /* sudoers temp file descriptor */
int modified; /* was the file modified? */
* Returns TRUE on success, else FALSE.
*/
static int
-reparse_sudoers(editor, args, strict, quiet)
- char *editor, *args;
- int strict, quiet;
+reparse_sudoers(char *editor, char *args, int strict, int quiet)
{
struct sudoersfile *sp, *last;
FILE *fp;
* move it into place. Returns TRUE on success, else FALSE.
*/
static int
-install_sudoers(sp, oldperms)
- struct sudoersfile *sp;
- int oldperms;
+install_sudoers(struct sudoersfile *sp, int oldperms)
{
struct stat sb;
/* STUB */
void
-set_fqdn()
+set_fqdn(void)
{
return;
}
/* STUB */
void
-init_envtables()
+init_envtables(void)
{
return;
}
/* STUB */
int
-user_is_exempt()
+user_is_exempt(void)
{
return(FALSE);
}
/* STUB */
void
-sudo_setspent()
+sudo_setspent(void)
{
return;
}
/* STUB */
void
-sudo_endspent()
+sudo_endspent(void)
{
return;
}
char *
-sudo_getepw(pw)
- const struct passwd *pw;
+sudo_getepw(const struct passwd *pw)
{
return (pw->pw_passwd);
}
* to do now. Returns the first letter of their choice.
*/
static char
-whatnow()
+whatnow(void)
{
int choice, c;
* Install signal handlers for visudo.
*/
static void
-setup_signals()
+setup_signals(void)
{
sigaction_t sa;
}
static int
-run_command(path, argv)
- char *path;
- char **argv;
+run_command(char *path, char **argv)
{
int status;
pid_t pid, rv;
}
static int
-check_syntax(sudoers_path, quiet, strict)
- char *sudoers_path;
- int quiet;
- int strict;
+check_syntax(char *sudoers_path, int quiet, int strict)
{
struct stat sb;
int error;
* any subsequent files #included via a callback from the parser.
*/
FILE *
-open_sudoers(path, doedit, keepopen)
- const char *path;
- int doedit;
- int *keepopen;
+open_sudoers(const char *path, int doedit, int *keepopen)
{
struct sudoersfile *entry;
FILE *fp;
}
static char *
-get_editor(args)
- char **args;
+get_editor(char **args)
{
char *Editor, *EditorArgs, *EditorPath, *UserEditor, *UserEditorArgs;
* Split out any command line arguments and return them.
*/
static char *
-get_args(cmnd)
- char *cmnd;
+get_args(char *cmnd)
{
char *args;
* Look up the hostname and set user_host and user_shost.
*/
static void
-get_hostname()
+get_hostname(void)
{
char *p, thost[MAXHOSTNAMELEN + 1];
}
static void
-alias_remove_recursive(name, type)
- char *name;
- int type;
+alias_remove_recursive(char *name, int type)
{
struct member *m;
struct alias *a;
* aliases or unused aliases.
*/
static int
-check_aliases(strict, quiet)
- int strict;
- int quiet;
+check_aliases(int strict, int quiet)
{
struct cmndspec *cs;
struct member *m, *binding;
}
static void
-print_undefined(name, type, strict, quiet)
- char *name;
- int type;
- int strict;
- int quiet;
+print_undefined(char *name, int type, int strict, int quiet)
{
if (!quiet) {
warningx("%s: %s_Alias `%s' referenced but not defined",
}
static int
-print_unused(v1, v2)
- void *v1;
- void *v2;
+print_unused(void *v1, void *v2)
{
struct alias *a = (struct alias *)v1;
char *prefix = (char *)v2;
* Unlink any sudoers temp files that remain.
*/
void
-cleanup(gotsignal)
- int gotsignal;
+cleanup(int gotsignal)
{
struct sudoersfile *sp;
* Unlink sudoers temp files (if any) and exit.
*/
static RETSIGTYPE
-quit(signo)
- int signo;
+quit(int signo)
{
cleanup(signo);
#define emsg " exiting due to signal.\n"
}
static void
-usage()
+usage(void)
{
(void) fprintf(stderr, "usage: %s [-c] [-q] [-s] [-V] [-f sudoers]\n",
getprogname());