} else if (cmnd_matches == FALSE) {  return(VALIDATE_NOT_OK);
int validate(check_cmnd)    int check_cmnd;{    int return_code;    /* become sudoers file owner */    set_perms(PERM_SUDOERS, 0);    /* we opened _PATH_SUDO_SUDOERS in check_sudoers() so just rewind it */    rewind(sudoers_fp);    yyin = sudoers_fp;    yyout = stdout;    /*     * Allocate space for data structures in the parser.     */    init_parser();    /*     * Need to be root while stat'ing things in the parser.     */    set_perms(PERM_ROOT, 0);    return_code = yyparse();    /*     * Don't need to keep this open...     */    (void) fclose(sudoers_fp);    sudoers_fp = NULL;    /* relinquish extra privs */    set_perms(PERM_USER, 0);    if (return_code || parse_error)	return(VALIDATE_ERROR);    /*     * Nothing on the top of the stack => user doesn't appear in sudoers.     * Allow anyone to try the psuedo commands "list" and "validate".     */    if (top == 0) {	if (check_cmnd == TRUE)	    return(VALIDATE_NO_USER);	else	    return(VALIDATE_NOT_OK);    }    /*     * Only check the actual command if the check_cmnd     * flag is set.  It is not set for the "validate"     * and "list" pseudo-commands.  Always check the     * host and user.     */    if (check_cmnd == FALSE)	while (top) {	    if (host_matches == TRUE) {		/* user may always do validate or list on allowed hosts */		if (no_passwd == TRUE)		    return(VALIDATE_OK_NOPASS);		else		    return(VALIDATE_OK);	    }	    top--;	}    else	while (top) {	    if (host_matches == TRUE) {		if (cmnd_matches == TRUE) {		   if (runas_matches == TRUE) {		    	/*			 * User was granted access to cmnd on host.		    	 * If no passwd required return as such.			 */		    	if (no_passwd == TRUE)			    return(VALIDATE_OK_NOPASS);		    	else			    return(VALIDATE_OK);		    }		} else if (cmnd_matches == FALSE) {		    /* User was explicitly denied acces to cmnd on host. */		    return(VALIDATE_NOT_OK);		}	    }	    top--;	}    /*     * we popped everything off the stack =>     * user was mentioned, but not explicitly     * granted nor denied access => say no     */    return(VALIDATE_NOT_OK);}