version 1.25, 2009/04/11 11:48:06 |
version 1.26, 2009/04/19 00:09:00 |
|
|
#include "version.h" |
#include "version.h" |
|
|
#ifndef lint |
#ifndef lint |
__unused static const char rcsid[] = "$Sudo: visudo.c,v 1.229 2009/04/05 16:25:04 millert Exp $"; |
__unused static const char rcsid[] = "$Sudo: visudo.c,v 1.231 2009/04/16 12:22:04 millert Exp $"; |
#endif /* lint */ |
#endif /* lint */ |
|
|
struct sudoersfile { |
struct sudoersfile { |
|
|
error = parse_error; |
error = parse_error; |
if (!quiet) { |
if (!quiet) { |
if (parse_error) |
if (parse_error) |
(void) printf("parse error in %s near line %d\n", sudoers_path, |
(void) printf("parse error in %s near line %d\n", errorfile, |
errorlineno); |
errorlineno); |
else |
else |
(void) printf("%s: parsed OK\n", sudoers_path); |
(void) printf("%s: parsed OK\n", sudoers_path); |
|
|
sudoerslist.last->next = entry; |
sudoerslist.last->next = entry; |
sudoerslist.last = entry; |
sudoerslist.last = entry; |
} |
} |
if (keepopen != NULL) |
|
*keepopen = TRUE; |
|
} else { |
} else { |
/* Already exists, open .tmp version if there is one. */ |
/* Already exists, open .tmp version if there is one. */ |
if (entry->tpath != NULL) { |
if (entry->tpath != NULL) { |
|
|
} else { |
} else { |
if ((fp = fdopen(entry->fd, "r")) == NULL) |
if ((fp = fdopen(entry->fd, "r")) == NULL) |
error(1, "%s", entry->path); |
error(1, "%s", entry->path); |
|
rewind(fp); |
} |
} |
} |
} |
|
if (keepopen != NULL) |
|
*keepopen = TRUE; |
return(fp); |
return(fp); |
} |
} |
|
|