From: Todd C. Miller Date: Fri, 5 Aug 1994 00:21:04 +0000 (+0000) Subject: no longer use global validate_only X-Git-Tag: SUDO_1_3_1~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a24fdfd0813ede954737c2a5104e5bfb25f59a81;p=sudo no longer use global validate_only now checks for command called "validate" removed check for non-fully qualified commands since that is done by find_path --- diff --git a/parse.c b/parse.c index c80647983..3eeda3c5c 100644 --- a/parse.c +++ b/parse.c @@ -284,22 +284,16 @@ int host_type_ok() int cmnd_type_ok() { /* - * check for the reserved keyword 'ALL'. + * always return success if the user is running the special + * command "validate" or the user has the reserved keyword 'ALL'. */ - if (strcmp(list_ptr[USER_LIST] -> data, "ALL") == 0) { - /* if the command has an absolute path, let them do it */ - if (cmnd[0] == '/') { - return (MATCH); - } - /* if the command does not have an absolute path, forget it */ - else { - return (NO_MATCH); - } - } + if (!strcmp(cmnd, "validate") || !strcmp(list_ptr[USER_LIST]->data, "ALL")) + return (MATCH); + /* * if the command has an absolute path, check it out */ - else if (list_ptr[USER_LIST] -> data[0] == '/') { + if (list_ptr[USER_LIST] -> data[0] == '/') { /* * op | data | return value * --------------------------------- @@ -488,10 +482,7 @@ int validate() */ switch (return_code) { case FOUND_USER: - if (validate_only) - return_code = VALIDATE_OK; - else - return_code = cmnd_check(); + return_code = cmnd_check(); delete_list(USER_LIST); delete_list(HOST_LIST); delete_list(CMND_LIST);