mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-03 15:55:40 +00:00
added patches from John_Rouillard
directory spec uses EDITOR
This commit is contained in:
2
check.c
2
check.c
@@ -41,7 +41,9 @@ static char rcsid[] = "$Id$";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef STD_HEADERS
|
||||
#include <strings.h>
|
||||
#endif /* !STD_HEADERS */
|
||||
#include <fcntl.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
|
@@ -51,8 +51,10 @@ static char rcsid[] = "$Id$";
|
||||
#include <stdio.h>
|
||||
#ifdef STD_HEADERS
|
||||
#include <stdlib.h>
|
||||
#endif /* STD_HEADERS */
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif /* STD_HEADERS */
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
|
29
parse.c
29
parse.c
@@ -39,7 +39,7 @@ static char rcsid[] = "$Id$";
|
||||
#endif /* lint */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <strings.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
@@ -297,6 +297,20 @@ int cmnd_type_ok()
|
||||
* of commands in something like:
|
||||
* user machine=ALL,!/bin/rm,!/etc/named ...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Check to see if a directory is being permitted
|
||||
*/
|
||||
if (list_ptr[USER_LIST]->data[strlen(list_ptr[USER_LIST]->data)-1]
|
||||
== '/') {
|
||||
/* we have a directory spec */
|
||||
if (strncmp(list_ptr[USER_LIST]->data, cmnd,
|
||||
strlen(list_ptr[USER_LIST]->data)) == 0)
|
||||
return(MATCH);
|
||||
else
|
||||
return(NO_MATCH);
|
||||
}
|
||||
|
||||
if (strcmp(list_ptr[USER_LIST] -> data, cmnd) == 0) {
|
||||
if (list_ptr[USER_LIST] -> op == '!') {
|
||||
return (QUIT_NOW);
|
||||
@@ -320,6 +334,19 @@ int cmnd_type_ok()
|
||||
tmp_ptr = list_ptr[CMND_LIST];
|
||||
list_ptr[CMND_LIST] = tmp_ptr -> next;
|
||||
while (next_type == TYPE3) {
|
||||
/*
|
||||
* Check to see if a directory is being permitted
|
||||
*/
|
||||
if (list_ptr[CMND_LIST]->
|
||||
data[strlen(list_ptr[CMND_LIST]->data)-1] == '/' ) {
|
||||
/* we have a directory spec */
|
||||
if (strncmp(list_ptr[CMND_LIST]->data, cmnd,
|
||||
strlen(list_ptr[CMND_LIST]->data)) == 0)
|
||||
return(MATCH);
|
||||
else
|
||||
return(NO_MATCH);
|
||||
}
|
||||
|
||||
if (strcmp(list_ptr[CMND_LIST] -> data, cmnd) == 0) {
|
||||
if (list_ptr[USER_LIST] -> op == '!') {
|
||||
list_ptr[CMND_LIST] = save_ptr;
|
||||
|
4
sudo.c
4
sudo.c
@@ -64,7 +64,6 @@ static char rcsid[] = "$Id$";
|
||||
#endif /* !NeXT */
|
||||
#endif /* STD_HEADERS */
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <pwd.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/param.h>
|
||||
@@ -89,6 +88,8 @@ uid_t uid;
|
||||
#endif
|
||||
|
||||
|
||||
static void usage();
|
||||
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
@@ -102,7 +103,6 @@ main(argc, argv, envp)
|
||||
char **argv;
|
||||
char **envp;
|
||||
{
|
||||
static void usage();
|
||||
int rtn;
|
||||
|
||||
Argv = argv;
|
||||
|
Reference in New Issue
Block a user