#define INITIAL 0
#line 2 "parse.lex"
/*
- * CU sudo version 1.6
- * Copyright (c) 1996, 1998, 1999 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 1996, 1998, 1999 Todd C. Miller <Todd.Miller@courtesan.com>
+ * All rights reserved.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 1, or (at your option)
- * any later version.
+ * This code is derived from software contributed by Chris Jepeway
+ * <jepeway@cs.utk.edu>
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This code is derived from software contributed by Chris Jepeway
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Please send bugs, changes, problems to sudo-bugs@courtesan.com
- *
- *******************************************************************
- *
- * parse.lex -- lexigraphical analyzer for sudo.
- *
- * Chris Jepeway <jepeway@cs.utk.edu>
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include <sys/types.h>
#include <sys/param.h>
#include "sudo.h"
+#include "parse.h"
#include "sudo.tab.h"
#ifndef lint
#define GOTRUNAS 2
-#line 610 "lex.yy.c"
+#line 614 "lex.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 90 "parse.lex"
+#line 94 "parse.lex"
-#line 763 "lex.yy.c"
+#line 767 "lex.yy.c"
if ( yy_init )
{
case 1:
YY_RULE_SETUP
-#line 91 "parse.lex"
+#line 95 "parse.lex"
{ /* throw away space/tabs */
sawspace = TRUE; /* but remember for fill_args */
}
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 95 "parse.lex"
+#line 99 "parse.lex"
{
sawspace = TRUE; /* remember for fill_args */
++sudolineno;
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 101 "parse.lex"
+#line 105 "parse.lex"
{
LEXTRACE("QUOTEDCHAR ");
fill_args(yytext + 1, 1, sawspace);
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 107 "parse.lex"
+#line 111 "parse.lex"
{
BEGIN INITIAL;
unput(*yytext);
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 113 "parse.lex"
+#line 117 "parse.lex"
{
++sudolineno;
LEXTRACE("\n");
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 119 "parse.lex"
+#line 123 "parse.lex"
{
++sudolineno;
LEXTRACE("\n");
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 125 "parse.lex"
+#line 129 "parse.lex"
{
LEXTRACE("ARG ");
fill_args(yytext, yyleng, sawspace);
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 131 "parse.lex"
+#line 135 "parse.lex"
{
LEXTRACE(", ");
return(',');
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 136 "parse.lex"
+#line 140 "parse.lex"
{
return('!'); /* return '!' */
}
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 140 "parse.lex"
+#line 144 "parse.lex"
{
LEXTRACE("= ");
return('=');
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 145 "parse.lex"
+#line 149 "parse.lex"
{
LEXTRACE(": ");
return(':');
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 150 "parse.lex"
+#line 154 "parse.lex"
{
return('.');
}
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 154 "parse.lex"
+#line 158 "parse.lex"
{
/* cmnd does not require passwd for this user */
LEXTRACE("NOPASSWD ");
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 160 "parse.lex"
+#line 164 "parse.lex"
{
/* cmnd requires passwd for this user */
LEXTRACE("PASSWD ");
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 166 "parse.lex"
+#line 170 "parse.lex"
{
/* netgroup */
fill(yytext, yyleng);
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 172 "parse.lex"
+#line 176 "parse.lex"
{
/* UN*X group */
fill(yytext, yyleng);
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 178 "parse.lex"
+#line 182 "parse.lex"
{
fill(yytext, yyleng);
LEXTRACE("NTWKADDR ");
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 184 "parse.lex"
+#line 188 "parse.lex"
{
fill(yytext, yyleng);
LEXTRACE("FQHOST ");
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 190 "parse.lex"
+#line 194 "parse.lex"
{
BEGIN GOTRUNAS;
LEXTRACE("RUNAS ");
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 196 "parse.lex"
+#line 200 "parse.lex"
{
/* Runas_Alias that user can run command as or ALL */
fill(yytext, yyleng);
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 208 "parse.lex"
+#line 212 "parse.lex"
{
/* username/uid that user can run command as */
fill(yytext, yyleng);
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 215 "parse.lex"
+#line 219 "parse.lex"
BEGIN INITIAL;
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 218 "parse.lex"
+#line 222 "parse.lex"
{
/* directories can't have args... */
if (yytext[yyleng - 1] == '/') {
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 231 "parse.lex"
+#line 235 "parse.lex"
{
fill(yytext, yyleng);
if (strcmp(yytext, "ALL") == 0) {
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 241 "parse.lex"
+#line 245 "parse.lex"
{
fill(yytext, yyleng);
if (strcmp(yytext, "Host_Alias") == 0) {
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 265 "parse.lex"
+#line 269 "parse.lex"
{
return(ERROR);
} /* parse error */
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 269 "parse.lex"
+#line 273 "parse.lex"
ECHO;
YY_BREAK
-#line 1106 "lex.yy.c"
+#line 1110 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(GOTCMND):
case YY_STATE_EOF(GOTRUNAS):
return 0;
}
#endif
-#line 269 "parse.lex"
+#line 273 "parse.lex"
static void
fill(s, len)
yylval.string[len] = '\0';
}
-
static void
fill_cmnd(s, len)
char *s;
yylval.command.args = NULL;
}
-
static void
fill_args(s, len, addspace)
char *s;
arg_len = new_len;
}
-
int
yywrap()
{
YY_NEW_FILE;
#endif /* YY_NEW_FILE */
- /* don't reset the aliases if called by testsudoers */
+ /* Don't reset the aliases if called by testsudoers. */
if (clearaliases)
reset_aliases();
#define YYRECOVERING() (yyerrflag!=0)
#define YYPREFIX "yy"
#line 2 "parse.yacc"
-
/*
- * CU sudo version 1.6
- * Copyright (c) 1996, 1998, 1999 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 1, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * Copyright (c) 1996, 1998, 1999 Todd C. Miller <Todd.Miller@courtesan.com>
+ * All rights reserved.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * This code is derived from software contributed by Chris Jepeway
+ * <jepeway@cs.utk.edu>
*
- * Please send bugs, changes, problems to sudo-bugs@courtesan.com
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- *******************************************************************
- *
- * parse.yacc -- yacc parser and alias manipulation routines for sudo.
- *
- * Chris Jepeway <jepeway@cs.utk.edu>
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#endif /* HAVE_LSEARCH */
#include "sudo.h"
+#include "parse.h"
#ifndef HAVE_LSEARCH
#include "emul/search.h"
yyerror(s)
char *s;
{
- /* save the line the first error occured on */
+ /* Save the line the first error occured on. */
if (errorlineno == -1)
errorlineno = sudolineno ? sudolineno - 1 : 0;
#ifndef TRACELEXER
#endif
parse_error = TRUE;
}
-#line 172 "parse.yacc"
+#line 175 "parse.yacc"
typedef union {
char *string;
int BOOLEAN;
struct sudo_command command;
int tok;
} YYSTYPE;
-#line 196 "sudo.tab.c"
+#line 199 "sudo.tab.c"
#define ALIAS 257
#define NTWKADDR 258
#define FQHOST 259
short *yysslim;
YYSTYPE *yyvs;
int yystacksize;
-#line 666 "parse.yacc"
-
+#line 668 "parse.yacc"
typedef struct {
int type;
size_t nslots = 0;
-/**********************************************************************
- *
- * aliascmp()
- *
- * This function compares two aliasinfo structures.
+/*
+ * Compare two aliasinfo structures, strcmp() style.
*/
-
static int
aliascmp(a1, a2)
const VOID *a1, *a2;
return(r);
}
-
-/**********************************************************************
- *
- * genaliascmp()
- *
- * This function compares two generic_alias structures.
+/*
+ * Compare two generic_alias structures, strcmp() style.
*/
-
static int
genaliascmp(entry, key)
const VOID *entry, *key;
}
-/**********************************************************************
- *
- * add_alias()
- *
- * This function adds the named alias of the specified type to the
- * aliases list.
+/*
+ * Adds the named alias of the specified type to the aliases list.
*/
-
static int
add_alias(alias, type)
char *alias;
return(ok);
}
-
-/**********************************************************************
- *
- * find_alias()
- *
- * This function searches for the named alias of the specified type.
+/*
+ * Searches for the named alias of the specified type.
*/
-
static int
find_alias(alias, type)
char *alias;
sizeof(ai), aliascmp) != NULL);
}
-
-/**********************************************************************
- *
- * more_aliases()
- *
- * This function allocates more space for the aliases list.
+/*
+ * Allocates more space for the aliases list.
*/
-
static int
more_aliases()
{
+
nslots += MOREALIASES;
if (nslots == MOREALIASES)
aliases = (aliasinfo *) malloc(nslots * sizeof(aliasinfo));
return(aliases != NULL);
}
-
-/**********************************************************************
- *
- * dumpaliases()
- *
- * This function lists the contents of the aliases list.
+/*
+ * Lists the contents of the aliases list.
*/
-
void
dumpaliases()
{
}
}
-
-/**********************************************************************
- *
- * list_matches()
- *
- * This function lists the contents of cm_list and ga_list for
- * `sudo -l'.
+/*
+ * Lists the contents of cm_list and ga_list for `sudo -l'.
*/
-
void
list_matches()
{
cm_list_size = 0;
}
-
-/**********************************************************************
- *
- * append()
- *
- * This function appends a source string to the destination prefixing
- * a separator if one is given.
+/*
+ * Appends a source string to the destination, optionally prefixing a separator.
*/
-
static void
append(src, dstp, dst_len, dst_size, separator)
char *src, **dstp;
*dst_len += src_len;
}
-
-/**********************************************************************
- *
- * reset_aliases()
- *
- * This function frees up space used by the aliases list and resets
- * the associated counters.
+/*
+ * Frees up space used by the aliases list and resets the associated counters.
*/
-
void
reset_aliases()
{
+
if (aliases) {
free(aliases);
aliases = NULL;
naliases = nslots = 0;
}
-
-/**********************************************************************
- *
- * expand_ga_list()
- *
- * This function increments ga_list_len, allocating more space as necessary.
+/*
+ * Increments ga_list_len, allocating more space as necessary.
*/
-
static void
expand_ga_list()
{
+
if (++ga_list_len >= ga_list_size) {
while ((ga_list_size += STACKINCREMENT) < ga_list_len)
;
ga_list[ga_list_len - 1].entries = NULL;
}
-
-/**********************************************************************
- *
- * expand_match_list()
- *
- * This function increments cm_list_len, allocating more space as necessary.
+/*
+ * Increments cm_list_len, allocating more space as necessary.
*/
-
static void
expand_match_list()
{
+
if (++cm_list_len >= cm_list_size) {
while ((cm_list_size += STACKINCREMENT) < cm_list_len)
;
cm_list[cm_list_len].nopasswd = FALSE;
}
-
-/**********************************************************************
- *
- * init_parser()
- *
- * This function frees up spaced used by a previous parse and
- * allocates new space for various data structures.
+/*
+ * Frees up spaced used by a previous parser run and allocates new space
+ * for various data structures.
*/
-
void
init_parser()
{
+
/* Free up old data structures if we run the parser more than once. */
if (match) {
free(match);
if (printmatches == TRUE)
expand_match_list();
}
-#line 890 "sudo.tab.c"
+#line 835 "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 212 "parse.yacc"
{ ; }
break;
case 4:
-#line 212 "parse.yacc"
+#line 214 "parse.yacc"
{ yyerrok; }
break;
case 5:
-#line 213 "parse.yacc"
+#line 215 "parse.yacc"
{ push; }
break;
case 6:
-#line 213 "parse.yacc"
+#line 215 "parse.yacc"
{
while (top && user_matches != TRUE) {
pop;
}
break;
case 7:
-#line 219 "parse.yacc"
+#line 221 "parse.yacc"
{ ; }
break;
case 8:
-#line 221 "parse.yacc"
+#line 223 "parse.yacc"
{ ; }
break;
case 9:
-#line 223 "parse.yacc"
+#line 225 "parse.yacc"
{ ; }
break;
case 10:
-#line 225 "parse.yacc"
+#line 227 "parse.yacc"
{ ; }
break;
case 13:
-#line 233 "parse.yacc"
+#line 235 "parse.yacc"
{
/*
* We already did a push if necessary in
}
break;
case 15:
-#line 246 "parse.yacc"
+#line 248 "parse.yacc"
{
push;
}
break;
case 16:
-#line 248 "parse.yacc"
+#line 250 "parse.yacc"
{
pop;
if (host_matched == TRUE)
}
break;
case 17:
-#line 256 "parse.yacc"
+#line 258 "parse.yacc"
{
host_matches = TRUE;
}
break;
case 18:
-#line 259 "parse.yacc"
+#line 261 "parse.yacc"
{
if (addr_matches(yyvsp[0].string))
host_matches = TRUE;
}
break;
case 19:
-#line 264 "parse.yacc"
+#line 266 "parse.yacc"
{
- if (netgr_matches(yyvsp[0].string, host, NULL))
+ if (netgr_matches(yyvsp[0].string, user_host, NULL))
host_matches = TRUE;
free(yyvsp[0].string);
}
break;
case 20:
-#line 269 "parse.yacc"
+#line 271 "parse.yacc"
{
- if (strcasecmp(shost, yyvsp[0].string) == 0)
+ if (strcasecmp(user_shost, yyvsp[0].string) == 0)
host_matches = TRUE;
free(yyvsp[0].string);
}
break;
case 21:
-#line 274 "parse.yacc"
+#line 276 "parse.yacc"
{
- if (strcasecmp(host, yyvsp[0].string) == 0)
+ if (strcasecmp(user_host, yyvsp[0].string) == 0)
host_matches = TRUE;
free(yyvsp[0].string);
}
break;
case 22:
-#line 279 "parse.yacc"
+#line 281 "parse.yacc"
{
/* could be an all-caps hostname */
if (find_alias(yyvsp[0].string, HOST_ALIAS) == TRUE ||
- strcasecmp(shost, yyvsp[0].string) == 0)
+ strcasecmp(user_shost, yyvsp[0].string) == 0)
host_matches = TRUE;
free(yyvsp[0].string);
}
break;
case 25:
-#line 292 "parse.yacc"
+#line 294 "parse.yacc"
{
if (printmatches == TRUE &&
(runas_matches == -1 || cmnd_matches == -1)) {
}
break;
case 26:
-#line 312 "parse.yacc"
+#line 314 "parse.yacc"
{ ; }
break;
case 27:
-#line 313 "parse.yacc"
+#line 315 "parse.yacc"
{
if (printmatches == TRUE && host_matches == TRUE &&
user_matches == TRUE) {
}
break;
case 28:
-#line 325 "parse.yacc"
+#line 327 "parse.yacc"
{
pop;
if (cmnd_matched == TRUE)
}
break;
case 29:
-#line 335 "parse.yacc"
+#line 337 "parse.yacc"
{
/*
* If this is the first entry in a command list
*/
if (runas_matches == -1)
runas_matches =
- (strcmp(RUNAS_DEFAULT, runas_user) == 0);
+ (strcmp(RUNAS_DEFAULT, user_runas) == 0);
}
break;
case 30:
-#line 344 "parse.yacc"
+#line 346 "parse.yacc"
{ ; }
break;
case 33:
-#line 351 "parse.yacc"
+#line 353 "parse.yacc"
{
if (printmatches == TRUE && host_matches == TRUE &&
user_matches == TRUE)
}
break;
case 34:
-#line 358 "parse.yacc"
+#line 360 "parse.yacc"
{
if (printmatches == TRUE && host_matches == TRUE &&
user_matches == TRUE) {
}
break;
case 35:
-#line 368 "parse.yacc"
+#line 370 "parse.yacc"
{
pop;
/*
}
break;
case 36:
-#line 379 "parse.yacc"
+#line 381 "parse.yacc"
{
- runas_matches = (strcmp(yyvsp[0].string, runas_user) == 0);
+ runas_matches = (strcmp(yyvsp[0].string, user_runas) == 0);
if (printmatches == TRUE && in_alias == TRUE)
append(yyvsp[0].string, &ga_list[ga_list_len-1].entries,
&ga_list[ga_list_len-1].entries_len,
}
break;
case 37:
-#line 392 "parse.yacc"
+#line 394 "parse.yacc"
{
- runas_matches = usergr_matches(yyvsp[0].string, runas_user);
+ runas_matches = usergr_matches(yyvsp[0].string, user_runas);
if (printmatches == TRUE && in_alias == TRUE)
append(yyvsp[0].string, &ga_list[ga_list_len-1].entries,
&ga_list[ga_list_len-1].entries_len,
}
break;
case 38:
-#line 406 "parse.yacc"
+#line 408 "parse.yacc"
{
- runas_matches = netgr_matches(yyvsp[0].string, NULL, runas_user);
+ runas_matches = netgr_matches(yyvsp[0].string, NULL, user_runas);
if (printmatches == TRUE && in_alias == TRUE)
append(yyvsp[0].string, &ga_list[ga_list_len-1].entries,
&ga_list[ga_list_len-1].entries_len,
}
break;
case 39:
-#line 420 "parse.yacc"
+#line 422 "parse.yacc"
{
/* could be an all-caps username */
if (find_alias(yyvsp[0].string, RUNAS_ALIAS) == TRUE ||
- strcmp(yyvsp[0].string, runas_user) == 0)
+ strcmp(yyvsp[0].string, user_runas) == 0)
runas_matches = TRUE;
else
runas_matches = FALSE;
}
break;
case 40:
-#line 438 "parse.yacc"
+#line 440 "parse.yacc"
{
runas_matches = TRUE;
if (printmatches == TRUE && in_alias == TRUE)
}
break;
case 41:
-#line 452 "parse.yacc"
+#line 454 "parse.yacc"
{
;
}
break;
case 42:
-#line 455 "parse.yacc"
+#line 457 "parse.yacc"
{
no_passwd = TRUE;
if (printmatches == TRUE && host_matches == TRUE &&
}
break;
case 43:
-#line 461 "parse.yacc"
+#line 463 "parse.yacc"
{
no_passwd = FALSE;
if (printmatches == TRUE && host_matches == TRUE &&
}
break;
case 44:
-#line 469 "parse.yacc"
+#line 471 "parse.yacc"
{
if (printmatches == TRUE && in_alias == TRUE) {
append("ALL", &ga_list[ga_list_len-1].entries,
}
yyval.BOOLEAN = cmnd_matches = TRUE;
- if (cmnd_safe)
- free(cmnd_safe);
- cmnd_safe = estrdup(cmnd);
+ if (safe_cmnd)
+ free(safe_cmnd);
+ safe_cmnd = estrdup(user_cmnd);
}
break;
case 45:
-#line 488 "parse.yacc"
+#line 490 "parse.yacc"
{
if (printmatches == TRUE && in_alias == TRUE) {
append(yyvsp[0].string, &ga_list[ga_list_len-1].entries,
}
break;
case 46:
-#line 507 "parse.yacc"
+#line 509 "parse.yacc"
{
if (printmatches == TRUE && in_alias == TRUE) {
append(yyvsp[0].command.cmnd, &ga_list[ga_list_len-1].entries,
}
/* if NewArgc > 1 pass ptr to 1st arg, else NULL */
- if (command_matches(cmnd, (NewArgc > 1) ?
- cmnd_args : NULL, yyvsp[0].command.cmnd, yyvsp[0].command.args)) {
+ if (command_matches(user_cmnd, (NewArgc > 1) ?
+ user_args : NULL, yyvsp[0].command.cmnd, yyvsp[0].command.args)) {
cmnd_matches = TRUE;
yyval.BOOLEAN = TRUE;
}
}
break;
case 49:
-#line 546 "parse.yacc"
+#line 548 "parse.yacc"
{ push; }
break;
case 50:
-#line 546 "parse.yacc"
+#line 548 "parse.yacc"
{
if (host_matches == TRUE &&
add_alias(yyvsp[-3].string, HOST_ALIAS) == FALSE)
}
break;
case 55:
-#line 562 "parse.yacc"
+#line 564 "parse.yacc"
{
push;
if (printmatches == TRUE) {
}
break;
case 56:
-#line 570 "parse.yacc"
+#line 572 "parse.yacc"
{
if (cmnd_matches == TRUE &&
add_alias(yyvsp[-3].string, CMND_ALIAS) == FALSE)
}
break;
case 57:
-#line 582 "parse.yacc"
+#line 584 "parse.yacc"
{ ; }
break;
case 61:
-#line 590 "parse.yacc"
+#line 592 "parse.yacc"
{
push;
if (printmatches == TRUE) {
}
break;
case 62:
-#line 598 "parse.yacc"
+#line 600 "parse.yacc"
{
if (runas_matches > 0 &&
add_alias(yyvsp[-3].string, RUNAS_ALIAS) == FALSE)
}
break;
case 65:
-#line 614 "parse.yacc"
+#line 616 "parse.yacc"
{ push; }
break;
case 66:
-#line 614 "parse.yacc"
+#line 616 "parse.yacc"
{
if (user_matches == TRUE &&
add_alias(yyvsp[-3].string, USER_ALIAS) == FALSE)
}
break;
case 67:
-#line 623 "parse.yacc"
+#line 625 "parse.yacc"
{ ; }
break;
case 70:
-#line 628 "parse.yacc"
+#line 630 "parse.yacc"
{
push;
}
break;
case 71:
-#line 630 "parse.yacc"
+#line 632 "parse.yacc"
{
pop;
if (user_matched == TRUE)
}
break;
case 72:
-#line 638 "parse.yacc"
+#line 640 "parse.yacc"
{
if (strcmp(yyvsp[0].string, user_name) == 0)
user_matches = TRUE;
}
break;
case 73:
-#line 643 "parse.yacc"
+#line 645 "parse.yacc"
{
if (usergr_matches(yyvsp[0].string, user_name))
user_matches = TRUE;
}
break;
case 74:
-#line 648 "parse.yacc"
+#line 650 "parse.yacc"
{
if (netgr_matches(yyvsp[0].string, NULL, user_name))
user_matches = TRUE;
}
break;
case 75:
-#line 653 "parse.yacc"
+#line 655 "parse.yacc"
{
/* could be an all-caps username */
if (find_alias(yyvsp[0].string, USER_ALIAS) == TRUE ||
}
break;
case 76:
-#line 660 "parse.yacc"
+#line 662 "parse.yacc"
{
user_matches = TRUE;
}
break;
-#line 1619 "sudo.tab.c"
+#line 1564 "sudo.tab.c"
}
yyssp -= yym;
yystate = *yyssp;