version 1.2, 1999/12/10 06:45:11 |
version 1.3, 2000/01/24 04:22:53 |
|
|
%{ |
%{ |
/* |
/* |
* Copyright (c) 1996, 1998, 1999 Todd C. Miller <Todd.Miller@courtesan.com> |
* Copyright (c) 1996, 1998-2000 Todd C. Miller <Todd.Miller@courtesan.com> |
* All rights reserved. |
* All rights reserved. |
* |
* |
* This code is derived from software contributed by Chris Jepeway |
* This code is derived from software contributed by Chris Jepeway |
|
|
#endif /* HAVE_LSEARCH */ |
#endif /* HAVE_LSEARCH */ |
|
|
#ifndef lint |
#ifndef lint |
static const char rcsid[] = "$Sudo: parse.yacc,v 1.167 1999/12/05 19:06:09 millert Exp $"; |
static const char rcsid[] = "$Sudo: parse.yacc,v 1.170 2000/01/17 23:46:25 millert Exp $"; |
#endif /* lint */ |
#endif /* lint */ |
|
|
/* |
/* |
|
|
int clearaliases = TRUE; |
int clearaliases = TRUE; |
int printmatches = FALSE; |
int printmatches = FALSE; |
int pedantic = FALSE; |
int pedantic = FALSE; |
|
int keepall = FALSE; |
|
|
/* |
/* |
* Alias types |
* Alias types |
|
|
free($1); |
free($1); |
} |
} |
| NETGROUP { |
| NETGROUP { |
if (netgr_matches($1, user_host, NULL)) |
if (netgr_matches($1, user_host, user_shost, NULL)) |
$$ = TRUE; |
$$ = TRUE; |
else |
else |
$$ = -1; |
$$ = -1; |
|
|
* the user was listed in sudoers. Also, we |
* the user was listed in sudoers. Also, we |
* need to be able to tell whether or not a |
* need to be able to tell whether or not a |
* user was listed for this specific host. |
* user was listed for this specific host. |
|
* |
|
* If keepall is set and the user matches then |
|
* we need to keep entries around too... |
*/ |
*/ |
if (user_matches != -1 && host_matches != -1 && |
if (user_matches != -1 && host_matches != -1 && |
cmnd_matches != -1 && runas_matches != -1) |
cmnd_matches != -1 && runas_matches != -1) |
|
|
(top == 2 && host_matches != -1 && |
(top == 2 && host_matches != -1 && |
match[0].host == -1))) |
match[0].host == -1))) |
pushcp; |
pushcp; |
|
else if (user_matches == TRUE && keepall) |
|
pushcp; |
cmnd_matches = -1; |
cmnd_matches = -1; |
} |
} |
; |
; |
|
|
user_matches == TRUE) |
user_matches == TRUE) |
append_runas($1, ", "); |
append_runas($1, ", "); |
} |
} |
if (netgr_matches($1, NULL, *user_runas)) |
if (netgr_matches($1, NULL, NULL, *user_runas)) |
$$ = TRUE; |
$$ = TRUE; |
else |
else |
$$ = -1; |
$$ = -1; |
|
|
free($1); |
free($1); |
} |
} |
| NETGROUP { |
| NETGROUP { |
if (netgr_matches($1, NULL, user_name)) |
if (netgr_matches($1, NULL, NULL, user_name)) |
$$ = TRUE; |
$$ = TRUE; |
else |
else |
$$ = -1; |
$$ = -1; |