version 1.36, 2008/11/22 16:33:42 |
version 1.37, 2009/01/09 00:14:52 |
|
|
#include "version.h" |
#include "version.h" |
|
|
#ifndef lint |
#ifndef lint |
__unused static const char rcsid[] = "$Sudo: sudo.c,v 1.500 2008/11/18 15:57:09 millert Exp $"; |
__unused static const char rcsid[] = "$Sudo: sudo.c,v 1.501 2009/01/09 00:13:37 millert Exp $"; |
#endif /* lint */ |
#endif /* lint */ |
|
|
/* |
/* |
|
|
(unsigned long) statbuf.st_gid, (unsigned long) SUDOERS_GID); |
(unsigned long) statbuf.st_gid, (unsigned long) SUDOERS_GID); |
else if ((fp = fopen(sudoers, "r")) == NULL) |
else if ((fp = fopen(sudoers, "r")) == NULL) |
log_error(USE_ERRNO, "can't open %s", sudoers); |
log_error(USE_ERRNO, "can't open %s", sudoers); |
else if (statbuf.st_size != 0) { |
else { |
/* |
/* |
* Make sure we can actually read sudoers so we can present the |
* Make sure we can actually read sudoers so we can present the |
* user with a reasonable error message. |
* user with a reasonable error message (unlike the lexer). |
*/ |
*/ |
if (fgetc(fp) == EOF) |
if (statbuf.st_size != 0) { |
log_error(USE_ERRNO, "can't read %s", sudoers); |
if (fgetc(fp) == EOF) |
rewind(fp); |
log_error(USE_ERRNO, "can't read %s", sudoers); |
|
rewind(fp); |
|
} |
|
(void) fcntl(fileno(fp), F_SETFD, 1); |
} |
} |
(void) fcntl(fileno(fp), F_SETFD, 1); |
|
|
|
set_perms(PERM_ROOT); /* change back to root */ |
set_perms(PERM_ROOT); /* change back to root */ |
return(fp); |
return(fp); |