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 <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#ifndef STD_HEADERS
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
#endif /* !STD_HEADERS */
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@@ -51,8 +51,10 @@ static char rcsid[] = "$Id$";
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef STD_HEADERS
|
#ifdef STD_HEADERS
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#endif /* STD_HEADERS */
|
#else
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
#endif /* STD_HEADERS */
|
||||||
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
29
parse.c
29
parse.c
@@ -39,7 +39,7 @@ static char rcsid[] = "$Id$";
|
|||||||
#endif /* lint */
|
#endif /* lint */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <strings.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -297,6 +297,20 @@ int cmnd_type_ok()
|
|||||||
* of commands in something like:
|
* of commands in something like:
|
||||||
* user machine=ALL,!/bin/rm,!/etc/named ...
|
* 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 (strcmp(list_ptr[USER_LIST] -> data, cmnd) == 0) {
|
||||||
if (list_ptr[USER_LIST] -> op == '!') {
|
if (list_ptr[USER_LIST] -> op == '!') {
|
||||||
return (QUIT_NOW);
|
return (QUIT_NOW);
|
||||||
@@ -320,6 +334,19 @@ int cmnd_type_ok()
|
|||||||
tmp_ptr = list_ptr[CMND_LIST];
|
tmp_ptr = list_ptr[CMND_LIST];
|
||||||
list_ptr[CMND_LIST] = tmp_ptr -> next;
|
list_ptr[CMND_LIST] = tmp_ptr -> next;
|
||||||
while (next_type == TYPE3) {
|
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 (strcmp(list_ptr[CMND_LIST] -> data, cmnd) == 0) {
|
||||||
if (list_ptr[USER_LIST] -> op == '!') {
|
if (list_ptr[USER_LIST] -> op == '!') {
|
||||||
list_ptr[CMND_LIST] = save_ptr;
|
list_ptr[CMND_LIST] = save_ptr;
|
||||||
|
4
sudo.c
4
sudo.c
@@ -64,7 +64,6 @@ static char rcsid[] = "$Id$";
|
|||||||
#endif /* !NeXT */
|
#endif /* !NeXT */
|
||||||
#endif /* STD_HEADERS */
|
#endif /* STD_HEADERS */
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <strings.h>
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@@ -89,6 +88,8 @@ uid_t uid;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
static void usage();
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
*
|
*
|
||||||
@@ -102,7 +103,6 @@ main(argc, argv, envp)
|
|||||||
char **argv;
|
char **argv;
|
||||||
char **envp;
|
char **envp;
|
||||||
{
|
{
|
||||||
static void usage();
|
|
||||||
int rtn;
|
int rtn;
|
||||||
|
|
||||||
Argv = argv;
|
Argv = argv;
|
||||||
|
Reference in New Issue
Block a user