version 1.1.1.1, 2012/05/29 12:26:49
|
version 1.1.1.3, 2013/07/22 10:46:11
|
Line 18
|
Line 18
|
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/param.h> |
|
#include <stdio.h> |
#include <stdio.h> |
#ifdef HAVE_STRING_H |
#ifdef HAVE_STRING_H |
# include <string.h> |
# include <string.h> |
Line 45 sudo_secure_path(const char *path, int type, uid_t uid
|
Line 44 sudo_secure_path(const char *path, int type, uid_t uid
|
int rval = SUDO_PATH_MISSING; |
int rval = SUDO_PATH_MISSING; |
debug_decl(sudo_secure_path, SUDO_DEBUG_UTIL) |
debug_decl(sudo_secure_path, SUDO_DEBUG_UTIL) |
|
|
if (path != NULL && stat_sudoers(path, &sb) == 0) { | if (path != NULL && stat(path, &sb) == 0) { |
if ((sb.st_mode & _S_IFMT) != type) { |
if ((sb.st_mode & _S_IFMT) != type) { |
rval = SUDO_PATH_BAD_TYPE; |
rval = SUDO_PATH_BAD_TYPE; |
} else if (uid != (uid_t)-1 && sb.st_uid != uid) { |
} else if (uid != (uid_t)-1 && sb.st_uid != uid) { |