* malloc(3) fails.
*/
-VOID *emalloc(size)
+VOID *
+emalloc(size)
size_t size;
{
VOID *ptr;
* if the system realloc(3) does not support this.
*/
-VOID *erealloc(ptr, size)
+VOID *
+erealloc(ptr, size)
VOID *ptr;
size_t size;
{
* malloc(3) fails. NOTE: unlike strdup(3), estrdup(NULL) is legal.
*/
-char *estrdup(src)
+char *
+estrdup(src)
const char *src;
{
char *dst = NULL;
* verify who s/he is.
*/
-void check_user()
+void
+check_user()
{
register int rtn;
mode_t oldmask;
* this function checks the user is exempt from supplying a password.
*/
-int user_is_exempt()
+int
+user_is_exempt()
{
#ifdef EXEMPTGROUP
struct group *grp;
* TIMEOUT minutes, no password will be required
*/
-static int check_timestamp()
+static int
+check_timestamp()
{
register char *p;
struct stat statbuf;
* via utime(2).
*/
-static int touch(file)
+static int
+touch(file)
char *file;
{
#if defined(HAVE_UTIME) && !defined(HAVE_UTIME_NULL)
* This function changes the timestamp to "now"
*/
-static void update_timestamp()
+static void
+update_timestamp()
{
if (timedir_is_good) {
/* become root */
* This function removes the timestamp ticket file
*/
-void remove_timestamp()
+void
+remove_timestamp()
{
#ifdef USE_TTY_TICKETS
char *p;
*/
#ifdef HAVE_SECURID
-static void check_passwd()
+static void
+check_passwd()
{
struct SD_CLIENT sd_dat, *sd; /* SecurID data block */
register int counter = TRIES_FOR_PASSWORD;
}
#else /* !HAVE_SECURID */
#ifdef HAVE_AUTHSRV
-static void check_passwd()
+static void
+check_passwd()
{
char *pass; /* this is what gets entered */
Cfg *confp;
}
#else /* !HAVE_AUTHSRV */
-static void check_passwd()
+static void
+check_passwd()
{
char *pass; /* this is what gets entered */
int counter = TRIES_FOR_PASSWORD;
*
* Validate a user via kerberos.
*/
-static int sudo_krb_validate_user(pw, pass)
+static int
+sudo_krb_validate_user(pw, pass)
struct passwd *pw;
char *pass;
{
* OK since we're a short lived program. I'd rather do that than contort
* the code to handle the cleanup.
*/
-static int sudo_krb5_validate_user(pw, pass)
+static int
+sudo_krb5_validate_user(pw, pass)
struct passwd *pw;
char *pass;
{
*
* Returns 1 for confirmation, -1 for failure, 0 for uncertainty.
*/
-static int verify_krb_v5_tgt(ccache)
+static int
+verify_krb_v5_tgt(ccache)
krb5_ccache ccache;
{
char phost[BUFSIZ];
static char *PAM_username;
static char *PAM_password;
-static int PAM_conv(num_msg, msg, resp, appdata_ptr)
+static int
+PAM_conv(num_msg, msg, resp, appdata_ptr)
int num_msg;
PAM_CONST struct pam_message **msg;
struct pam_response **resp;
return(PAM_SUCCESS);
}
-static int pam_auth(user, password)
+static int
+pam_auth(user, password)
char *user;
char *password;
{
return(1);
}
-static void pam_attempt_auth()
+static void
+pam_attempt_auth()
{
int i = TRIES_FOR_PASSWORD;
* s/key challenge * and fills in the user's skey structure.
*/
-static char *sudo_skeyprompt(user_skey, p)
+static char *
+sudo_skeyprompt(user_skey, p)
struct skey *user_skey;
char *p;
{
* OPIE challenge * and fills in the user's opie structure.
*/
-static char *sudo_opieprompt(user_opie, p)
+static char *
+sudo_opieprompt(user_opie, p)
struct opie *user_opie;
char *p;
{
* this function just prints the the reminder message
*/
-static void reminder()
+static void
+reminder()
{
#ifdef SHORT_MESSAGE
(void) fprintf(stderr, "\n%s\n%s\n\n%s\n%s\n\n",
* (and insult them if insults are configured).
*/
-void pass_warn(fp)
+void
+pass_warn(fp)
FILE *fp;
{
* allocated result. Returns the same string if no escapes.
*/
-static char *expand_prompt(old_prompt, user, host)
+static char *
+expand_prompt(old_prompt, user, host)
char *old_prompt;
char *user;
char *host;
* Collection routine (callback) for limiting the timeouts in SIA
* prompts.
*/
-static int tcollect(timeout, rendition, title, nprompts, prompts)
+static int
+tcollect(timeout, rendition, title, nprompts, prompts)
int timeout;
int rendition;
uchar_t *title;
* Try to authenticate the user using Security Integration Architecture
* (SIA). Added 9/26/98 by Spider Boardman
*/
-void sia_attempt_auth()
+void
+sia_attempt_auth()
{
SIAENTITY *siah = NULL;
int retval;
/* returns 1 ("true") if user is a valid DCE principal, 0 otherwise */
-int dce_pwent(username, plain_pw)
+int
+dce_pwent(username, plain_pw)
char *username;
char *plain_pw;
{
}
/* returns 0 for DCE "ok" status, 1 otherwise */
-static int check_dce_status(input_status, comment)
+static int
+check_dce_status(input_status, comment)
error_status_t input_status;
char *comment;
{
* but it is in '.' and IGNORE_DOT_PATH is in effect.
*/
-int find_path(infile, outfile)
+int
+find_path(infile, outfile)
char *infile; /* file to find */
char **outfile; /* result parameter */
{
* SHELL evariable or the passwd(5) entry (in that order).
*/
-static char *sudo_getshell(pw)
+static char *
+sudo_getshell(pw)
struct passwd *pw;
{
char *pw_shell;
* normal UN*X password is returned instead.
*/
-static char *sudo_getepw(pw)
+static char *
+sudo_getepw(pw)
struct passwd *pw;
{
* are in use, it substitutes the shadow password for pw_passwd.
*/
-struct passwd *sudo_getpwuid(uid)
+struct passwd *
+sudo_getpwuid(uid)
uid_t uid;
{
struct passwd *pw, *local_pw;
* that is a normal file and executable by root.
*/
-char * sudo_goodpath(path)
+char *
+sudo_goodpath(path)
const char * path;
{
struct stat statbuf; /* for stat(2) */
* and sets the constituent ip addrs and netmasks.
*/
-void load_interfaces()
+void
+load_interfaces()
{
struct ifconf *ifconf;
struct ifreq *ifr, ifr_tmp;
* Stub function for those without SIOCGIFCONF
*/
-void load_interfaces()
+void
+load_interfaces()
{
return;
}
#endif
#line 269 "parse.lex"
-static void fill(s, len)
+static void
+fill(s, len)
char *s;
int len;
{
}
-static void fill_cmnd(s, len)
+static void
+fill_cmnd(s, len)
char *s;
int len;
{
}
-static void fill_args(s, len, addspace)
+static void
+fill_args(s, len, addspace)
char *s;
int len;
int addspace;
}
-int yywrap()
+int
+yywrap()
{
#ifdef YY_NEW_FILE
YY_NEW_FILE;
* guarantee that the syslog() operation will succeed!
*/
-static void syslog_wrapper(pri, fmt, arg1, arg2)
+static void
+syslog_wrapper(pri, fmt, arg1, arg2)
int pri;
char *fmt;
char *arg1;
* syslogs the error or writes it to the log file
*/
-void log_error(code)
+void
+log_error(code)
int code;
{
char *p;
static char *mail_argv[] = { "sendmail", "-t", (char *) NULL };
-static void send_mail()
+static void
+send_mail()
{
char *mailer = _PATH_SENDMAIL;
char *subject = MAILSUBJECT;
}
}
#else
-static void send_mail()
+static void
+send_mail()
{
/* no mailer defined */
return;
* This function gets rid of all the ugly zombies
*/
-static RETSIGTYPE reapchild(sig)
+static RETSIGTYPE
+reapchild(sig)
int sig;
{
int pid, status, save_errno = errno;
* when an error occurs
*/
-void inform_user(code)
+void
+inform_user(code)
int code;
{
switch (code) {
* This function determines whether to send mail or not...
*/
-static int appropriate(code)
+static int
+appropriate(code)
int code;
{
* This routine is called from the sudo.c module and tries to validate
* the user, host and command triplet.
*/
-int validate(check_cmnd)
+int
+validate(check_cmnd)
int check_cmnd;
{
int return_code;
* If path doesn't end in /, return TRUE iff cmnd & path name the same inode;
* otherwise, return TRUE if cmnd names one of the inodes in path.
*/
-int command_matches(cmnd, user_args, path, sudoers_args)
+int
+command_matches(cmnd, user_args, path, sudoers_args)
char *cmnd;
char *user_args;
char *path;
* Returns TRUE if "n" is one of our ip addresses or if
* "n" is a network that we are on, else returns FALSE.
*/
-int addr_matches(n)
+int
+addr_matches(n)
char *n;
{
int i;
* Returns TRUE if the given user belongs to the named group,
* else returns FALSE.
*/
-int usergr_matches(group, user)
+int
+usergr_matches(group, user)
char *group;
char *user;
{
* else return FALSE. Either of "host" or "user" may be NULL
* in which case that argument is not checked...
*/
-int netgr_matches(netgr, host, user)
+int
+netgr_matches(netgr, host, user)
char *netgr;
char *host;
char *user;
* Returns TRUE if "s" has shell meta characters in it,
* else returns FALSE.
*/
-static int has_meta(s)
+static int
+has_meta(s)
char *s;
{
register char *t;
} /* parse error */
%%
-static void fill(s, len)
+static void
+fill(s, len)
char *s;
int len;
{
}
-static void fill_cmnd(s, len)
+static void
+fill_cmnd(s, len)
char *s;
int len;
{
}
-static void fill_args(s, len, addspace)
+static void
+fill_args(s, len, addspace)
char *s;
int len;
int addspace;
}
-int yywrap()
+int
+yywrap()
{
#ifdef YY_NEW_FILE
YY_NEW_FILE;
void init_parser __P((void));
void yyerror __P((char *));
-void yyerror(s)
+void
+yyerror(s)
char *s;
{
/* save the line the first error occured on */
* This function compares two aliasinfo structures.
*/
-static int aliascmp(a1, a2)
+static int
+aliascmp(a1, a2)
const VOID *a1, *a2;
{
int r;
* This function compares two generic_alias structures.
*/
-static int genaliascmp(entry, key)
+static int
+genaliascmp(entry, key)
const VOID *entry, *key;
{
struct generic_alias *ga1 = (struct generic_alias *) key;
* aliases list.
*/
-static int add_alias(alias, type)
+static int
+add_alias(alias, type)
char *alias;
int type;
{
* This function searches for the named alias of the specified type.
*/
-static int find_alias(alias, type)
+static int
+find_alias(alias, type)
char *alias;
int type;
{
* This function allocates more space for the aliases list.
*/
-static int more_aliases()
+static int
+more_aliases()
{
nslots += MOREALIASES;
if (nslots == MOREALIASES)
* This function lists the contents of the aliases list.
*/
-void dumpaliases()
+void
+dumpaliases()
{
size_t n;
* `sudo -l'.
*/
-void list_matches()
+void
+list_matches()
{
int i;
char *p;
* a separator if one is given.
*/
-static void append(src, dstp, dst_len, dst_size, separator)
+static void
+append(src, dstp, dst_len, dst_size, separator)
char *src, **dstp;
size_t *dst_len, *dst_size;
int separator;
* the associated counters.
*/
-void reset_aliases()
+void
+reset_aliases()
{
if (aliases) {
free(aliases);
* This function increments ga_list_len, allocating more space as necesary.
*/
-static void expand_ga_list()
+static void
+expand_ga_list()
{
if (++ga_list_len >= ga_list_size) {
while ((ga_list_size += STACKINCREMENT) < ga_list_len)
* This function increments cm_list_len, allocating more space as necesary.
*/
-static void expand_match_list()
+static void
+expand_match_list()
{
if (++cm_list_len >= cm_list_size) {
while ((cm_list_size += STACKINCREMENT) < cm_list_len)
* allocates new space for various data structures.
*/
-void init_parser()
+void
+init_parser()
{
/* Free up old data structures if we run the parser more than once. */
if (match) {
* Note that this string becomes a part of the environment.
*/
-int putenv(str)
+int
+putenv(str)
const char *str;
{
char **current;
* using the SecureWare crypt functions. Returns 1 on a match, else 0.
*/
-int check_secureware(pass)
+int
+check_secureware(pass)
char *pass;
{
#ifdef __alpha
* the driving force behind sudo...
*/
-int main(argc, argv)
+int
+main(argc, argv)
int argc;
char **argv;
{
* user_pw_ent, host, cwd, interfaces.
*/
-static void load_globals(sudo_mode)
+static void
+load_globals(sudo_mode)
int sudo_mode;
{
char *p;
* this function parses the arguments to sudo
*/
-static int parse_args()
+static int
+parse_args()
{
int ret = MODE_RUN; /* what mode is suod to be run in? */
int excl = 0; /* exclusive arg, no others allowed */
* Tell which options are mutually exclusive and exit
*/
-static void usage_excl(exit_val)
+static void
+usage_excl(exit_val)
int exit_val;
{
(void) fprintf(stderr, "Only one of the -v, -k, -l, -V and -h options may be used\n");
* this function just gives you instructions and exits
*/
-static void usage(exit_val)
+static void
+usage(exit_val)
int exit_val;
{
(void) fprintf(stderr,
* this function adds sudo-specific variables into the environment
*/
-static void add_env(contiguous)
+static void
+add_env(contiguous)
int contiguous;
{
char idstr[MAX_UID_T_LEN + 1];
* Returns 1 on success, 0 on failure.
*/
-static int load_cmnd(sudo_mode)
+static int
+load_cmnd(sudo_mode)
int sudo_mode;
{
int retval;
* uid SUDOERS_UID, gid SUDOERS_GID and is mode SUDOERS_MODE.
*/
-static int check_sudoers()
+static int
+check_sudoers()
{
struct stat statbuf;
int rootstat, i;
* this function sets real and effective uids and gids based on perm.
*/
-void set_perms(perm, sudo_mode)
+void
+set_perms(perm, sudo_mode)
int perm;
int sudo_mode;
{
* variables here as well but cmnd has not been defined at this point.
*/
-static void clean_env(envp, badenv_table)
+static void
+clean_env(envp, badenv_table)
char **envp;
struct env_table *badenv_table;
{
void init_parser __P((void));
void yyerror __P((char *));
-void yyerror(s)
+void
+yyerror(s)
char *s;
{
/* save the line the first error occured on */
#endif
parse_error = TRUE;
}
-#line 172 "parse.yacc"
+#line 173 "parse.yacc"
typedef union {
char *string;
int BOOLEAN;
struct sudo_command command;
int tok;
} YYSTYPE;
-#line 196 "sudo.tab.c"
+#line 197 "sudo.tab.c"
#define ALIAS 257
#define NTWKADDR 258
#define FQHOST 259
short *yysslim;
YYSTYPE *yyvs;
int yystacksize;
-#line 661 "parse.yacc"
+#line 662 "parse.yacc"
typedef struct {
* This function compares two aliasinfo structures.
*/
-static int aliascmp(a1, a2)
+static int
+aliascmp(a1, a2)
const VOID *a1, *a2;
{
int r;
* This function compares two generic_alias structures.
*/
-static int genaliascmp(entry, key)
+static int
+genaliascmp(entry, key)
const VOID *entry, *key;
{
struct generic_alias *ga1 = (struct generic_alias *) key;
* aliases list.
*/
-static int add_alias(alias, type)
+static int
+add_alias(alias, type)
char *alias;
int type;
{
* This function searches for the named alias of the specified type.
*/
-static int find_alias(alias, type)
+static int
+find_alias(alias, type)
char *alias;
int type;
{
* This function allocates more space for the aliases list.
*/
-static int more_aliases()
+static int
+more_aliases()
{
nslots += MOREALIASES;
if (nslots == MOREALIASES)
* This function lists the contents of the aliases list.
*/
-void dumpaliases()
+void
+dumpaliases()
{
size_t n;
* `sudo -l'.
*/
-void list_matches()
+void
+list_matches()
{
int i;
char *p;
* a separator if one is given.
*/
-static void append(src, dstp, dst_len, dst_size, separator)
+static void
+append(src, dstp, dst_len, dst_size, separator)
char *src, **dstp;
size_t *dst_len, *dst_size;
int separator;
* the associated counters.
*/
-void reset_aliases()
+void
+reset_aliases()
{
if (aliases) {
free(aliases);
* This function increments ga_list_len, allocating more space as necesary.
*/
-static void expand_ga_list()
+static void
+expand_ga_list()
{
if (++ga_list_len >= ga_list_size) {
while ((ga_list_size += STACKINCREMENT) < ga_list_len)
* This function increments cm_list_len, allocating more space as necesary.
*/
-static void expand_match_list()
+static void
+expand_match_list()
{
if (++cm_list_len >= cm_list_size) {
while ((cm_list_size += STACKINCREMENT) < cm_list_len)
* allocates new space for various data structures.
*/
-void init_parser()
+void
+init_parser()
{
/* Free up old data structures if we run the parser more than once. */
if (match) {
if (printmatches == TRUE)
expand_match_list();
}
-#line 878 "sudo.tab.c"
+#line 891 "sudo.tab.c"
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
#if defined(__cplusplus) || __STDC__
static int yygrowstack(void)
switch (yyn)
{
case 3:
-#line 210 "parse.yacc"
+#line 211 "parse.yacc"
{ ; }
break;
case 4:
-#line 212 "parse.yacc"
+#line 213 "parse.yacc"
{ yyerrok; }
break;
case 5:
-#line 213 "parse.yacc"
+#line 214 "parse.yacc"
{ push; }
break;
case 6:
-#line 213 "parse.yacc"
+#line 214 "parse.yacc"
{
while (top && user_matches != TRUE) {
pop;
}
break;
case 7:
-#line 219 "parse.yacc"
+#line 220 "parse.yacc"
{ ; }
break;
case 8:
-#line 221 "parse.yacc"
+#line 222 "parse.yacc"
{ ; }
break;
case 9:
-#line 223 "parse.yacc"
+#line 224 "parse.yacc"
{ ; }
break;
case 10:
-#line 225 "parse.yacc"
+#line 226 "parse.yacc"
{ ; }
break;
case 13:
-#line 233 "parse.yacc"
+#line 234 "parse.yacc"
{
/*
* We already did a push if necessary in
}
break;
case 15:
-#line 246 "parse.yacc"
+#line 247 "parse.yacc"
{
push;
}
break;
case 16:
-#line 248 "parse.yacc"
+#line 249 "parse.yacc"
{
pop;
if (host_matched == TRUE)
}
break;
case 17:
-#line 256 "parse.yacc"
+#line 257 "parse.yacc"
{
host_matches = TRUE;
}
break;
case 18:
-#line 259 "parse.yacc"
+#line 260 "parse.yacc"
{
if (addr_matches(yyvsp[0].string))
host_matches = TRUE;
}
break;
case 19:
-#line 264 "parse.yacc"
+#line 265 "parse.yacc"
{
if (netgr_matches(yyvsp[0].string, host, NULL))
host_matches = TRUE;
}
break;
case 20:
-#line 269 "parse.yacc"
+#line 270 "parse.yacc"
{
if (strcasecmp(shost, yyvsp[0].string) == 0)
host_matches = TRUE;
}
break;
case 21:
-#line 274 "parse.yacc"
+#line 275 "parse.yacc"
{
if (strcasecmp(host, yyvsp[0].string) == 0)
host_matches = TRUE;
}
break;
case 22:
-#line 279 "parse.yacc"
+#line 280 "parse.yacc"
{
/* could be an all-caps hostname */
if (find_alias(yyvsp[0].string, HOST_ALIAS) == TRUE ||
}
break;
case 25:
-#line 292 "parse.yacc"
+#line 293 "parse.yacc"
{
if (printmatches == TRUE &&
(runas_matches == -1 || cmnd_matches == -1)) {
}
break;
case 26:
-#line 310 "parse.yacc"
+#line 311 "parse.yacc"
{ ; }
break;
case 27:
-#line 311 "parse.yacc"
+#line 312 "parse.yacc"
{
if (printmatches == TRUE && host_matches == TRUE &&
user_matches == TRUE) {
}
break;
case 28:
-#line 323 "parse.yacc"
+#line 324 "parse.yacc"
{
pop;
if (cmnd_matched == TRUE)
}
break;
case 29:
-#line 333 "parse.yacc"
+#line 334 "parse.yacc"
{
/*
* If this is the first entry in a command list
}
break;
case 30:
-#line 342 "parse.yacc"
+#line 343 "parse.yacc"
{ ; }
break;
case 33:
-#line 349 "parse.yacc"
+#line 350 "parse.yacc"
{
if (printmatches == TRUE && host_matches == TRUE &&
user_matches == TRUE)
}
break;
case 34:
-#line 356 "parse.yacc"
+#line 357 "parse.yacc"
{
if (printmatches == TRUE && host_matches == TRUE &&
user_matches == TRUE) {
}
break;
case 35:
-#line 366 "parse.yacc"
+#line 367 "parse.yacc"
{
pop;
if (runas_matched == TRUE)
}
break;
case 36:
-#line 374 "parse.yacc"
+#line 375 "parse.yacc"
{
runas_matches = (strcmp(yyvsp[0].string, runas_user) == 0);
if (printmatches == TRUE && in_alias == TRUE)
}
break;
case 37:
-#line 387 "parse.yacc"
+#line 388 "parse.yacc"
{
runas_matches = usergr_matches(yyvsp[0].string, runas_user);
if (printmatches == TRUE && in_alias == TRUE)
}
break;
case 38:
-#line 401 "parse.yacc"
+#line 402 "parse.yacc"
{
runas_matches = netgr_matches(yyvsp[0].string, NULL, runas_user);
if (printmatches == TRUE && in_alias == TRUE)
}
break;
case 39:
-#line 415 "parse.yacc"
+#line 416 "parse.yacc"
{
/* could be an all-caps username */
if (find_alias(yyvsp[0].string, RUNAS_ALIAS) == TRUE ||
}
break;
case 40:
-#line 433 "parse.yacc"
+#line 434 "parse.yacc"
{
runas_matches = TRUE;
if (printmatches == TRUE && in_alias == TRUE)
}
break;
case 41:
-#line 447 "parse.yacc"
+#line 448 "parse.yacc"
{
;
}
break;
case 42:
-#line 450 "parse.yacc"
+#line 451 "parse.yacc"
{
no_passwd = TRUE;
if (printmatches == TRUE && host_matches == TRUE &&
}
break;
case 43:
-#line 456 "parse.yacc"
+#line 457 "parse.yacc"
{
no_passwd = FALSE;
if (printmatches == TRUE && host_matches == TRUE &&
}
break;
case 44:
-#line 464 "parse.yacc"
+#line 465 "parse.yacc"
{
if (printmatches == TRUE && in_alias == TRUE) {
append("ALL", &ga_list[ga_list_len-1].entries,
}
break;
case 45:
-#line 483 "parse.yacc"
+#line 484 "parse.yacc"
{
if (printmatches == TRUE && in_alias == TRUE) {
append(yyvsp[0].string, &ga_list[ga_list_len-1].entries,
}
break;
case 46:
-#line 502 "parse.yacc"
+#line 503 "parse.yacc"
{
if (printmatches == TRUE && in_alias == TRUE) {
append(yyvsp[0].command.cmnd, &ga_list[ga_list_len-1].entries,
}
break;
case 49:
-#line 541 "parse.yacc"
+#line 542 "parse.yacc"
{ push; }
break;
case 50:
-#line 541 "parse.yacc"
+#line 542 "parse.yacc"
{
if (host_matches == TRUE &&
add_alias(yyvsp[-3].string, HOST_ALIAS) == FALSE)
}
break;
case 55:
-#line 557 "parse.yacc"
+#line 558 "parse.yacc"
{
push;
if (printmatches == TRUE) {
}
break;
case 56:
-#line 565 "parse.yacc"
+#line 566 "parse.yacc"
{
if (cmnd_matches == TRUE &&
add_alias(yyvsp[-3].string, CMND_ALIAS) == FALSE)
}
break;
case 57:
-#line 577 "parse.yacc"
+#line 578 "parse.yacc"
{ ; }
break;
case 61:
-#line 585 "parse.yacc"
+#line 586 "parse.yacc"
{
push;
if (printmatches == TRUE) {
}
break;
case 62:
-#line 593 "parse.yacc"
+#line 594 "parse.yacc"
{
if (runas_matches > 0 &&
add_alias(yyvsp[-3].string, RUNAS_ALIAS) == FALSE)
}
break;
case 65:
-#line 609 "parse.yacc"
+#line 610 "parse.yacc"
{ push; }
break;
case 66:
-#line 609 "parse.yacc"
+#line 610 "parse.yacc"
{
if (user_matches == TRUE &&
add_alias(yyvsp[-3].string, USER_ALIAS) == FALSE)
}
break;
case 67:
-#line 618 "parse.yacc"
+#line 619 "parse.yacc"
{ ; }
break;
case 70:
-#line 623 "parse.yacc"
+#line 624 "parse.yacc"
{
push;
}
break;
case 71:
-#line 625 "parse.yacc"
+#line 626 "parse.yacc"
{
pop;
if (user_matched == TRUE)
}
break;
case 72:
-#line 633 "parse.yacc"
+#line 634 "parse.yacc"
{
if (strcmp(yyvsp[0].string, user_name) == 0)
user_matches = TRUE;
}
break;
case 73:
-#line 638 "parse.yacc"
+#line 639 "parse.yacc"
{
if (usergr_matches(yyvsp[0].string, user_name))
user_matches = TRUE;
}
break;
case 74:
-#line 643 "parse.yacc"
+#line 644 "parse.yacc"
{
if (netgr_matches(yyvsp[0].string, NULL, user_name))
user_matches = TRUE;
}
break;
case 75:
-#line 648 "parse.yacc"
+#line 649 "parse.yacc"
{
/* could be an all-caps username */
if (find_alias(yyvsp[0].string, USER_ALIAS) == TRUE ||
}
break;
case 76:
-#line 655 "parse.yacc"
+#line 656 "parse.yacc"
{
user_matches = TRUE;
}
break;
-#line 1602 "sudo.tab.c"
+#line 1615 "sudo.tab.c"
}
yyssp -= yym;
yystate = *yyssp;
* else it returns 0.
*/
-int sudo_setenv(var, val)
+int
+sudo_setenv(var, val)
char *var;
char *val;
{
* Returns TRUE if "s" has shell meta characters in it,
* else returns FALSE.
*/
-int has_meta(s)
+int
+has_meta(s)
char *s;
{
register char *t;
* return TRUE if cmnd matches, in the sudo sense,
* the pathname in path; otherwise, return FALSE
*/
-int command_matches(cmnd, user_args, path, sudoers_args)
+int
+command_matches(cmnd, user_args, path, sudoers_args)
char *cmnd;
char *user_args;
char *path;
}
-int addr_matches(n)
+int
+addr_matches(n)
char *n;
{
int i;
}
-int usergr_matches(group, user)
+int
+usergr_matches(group, user)
char *group;
char *user;
{
}
-int netgr_matches(netgr, host, user)
+int
+netgr_matches(netgr, host, user)
char *netgr;
char *host;
char *user;
}
-void set_perms(i, j)
+void
+set_perms(i, j)
int i, j;
{
return;
}
-int main(argc, argv)
+int
+main(argc, argv)
int argc;
char **argv;
{
* and input will time out based on the value of timeout.
*/
-char * tgetpass(prompt, timeout)
+char *
+tgetpass(prompt, timeout)
const char *prompt;
int timeout;
{
* utime(3) sets the access and mod times of the named file.
*/
-int utime(file, tvp)
+int
+utime(file, tvp)
const char *file; /* file to udpate */
const struct utimbuf *utp; /* what to update to */
{
* where it all begins...
*/
-int main(argc, argv)
+int
+main(argc, argv)
int argc;
char **argv;
{
* These exist to allow us to use the same parser as sudo(8).
*/
-int command_matches(cmnd, user_args, path, sudoers_args)
+int
+command_matches(cmnd, user_args, path, sudoers_args)
char *cmnd;
char *user_args;
char *path;
}
-int addr_matches(n)
+int
+addr_matches(n)
char *n;
{
return(TRUE);
}
-int usergr_matches(g, u)
+int
+usergr_matches(g, u)
char *g, *u;
{
return(TRUE);
}
-int netgr_matches(n, h, u)
+int
+netgr_matches(n, h, u)
char *n, *h, *u;
{
return(TRUE);
* Prints a help message and exits w/ exit value of 1.
*/
-static void usage()
+static void
+usage()
{
(void) fprintf(stderr, "usage: %s [-V]\n", Argv[0]);
Exit(-1);
* A positive parameter is considered to be a signal and is reported.
*/
-static RETSIGTYPE Exit(sig)
+static RETSIGTYPE
+Exit(sig)
int sig;
{
(void) unlink(stmp);
* to do now. Returns first letter of their choice (always lowercase).
*/
-static char whatnow()
+static char
+whatnow()
{
char choice;
int ok;
* Print out a help message for whatnow().
*/
-static void whatnow_help()
+static void
+whatnow_help()
{
(void) printf("Options are:\n");
(void) printf(" (e)dit sudoers file again\n");
* Install signal handlers for visudo.
*/
-static void setup_signals()
+static void
+setup_signals()
{
#ifdef POSIX_SIGNALS
struct sigaction action; /* posix signal structure */