Remove now-unused log_fatal()

This commit is contained in:
Todd C. Miller
2014-04-30 17:00:20 -06:00
parent 5086194c67
commit cbee9cc8cb
5 changed files with 11 additions and 29 deletions

View File

@@ -583,7 +583,7 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation,
memset(&details, 0, sizeof(details));
if (fatal_setjmp() != 0) {
/* called via fatal(), fatalx() or log_fatal() */
/* called via fatal() or fatalx() */
rval = -1;
goto done;
}
@@ -680,7 +680,7 @@ sudoers_io_close(int exit_status, int error)
debug_decl(sudoers_io_close, SUDO_DEBUG_PLUGIN)
if (fatal_setjmp() != 0) {
/* called via fatal(), fatalx() or log_fatal() */
/* called via fatal() or fatalx() */
fatal_disable_setjmp();
debug_return;
}
@@ -704,7 +704,7 @@ sudoers_io_version(int verbose)
debug_decl(sudoers_io_version, SUDO_DEBUG_PLUGIN)
if (fatal_setjmp() != 0) {
/* called via fatal(), fatalx() or log_fatal() */
/* called via fatal() or fatalx() */
fatal_disable_setjmp();
debug_return_bool(-1);
}
@@ -727,7 +727,7 @@ sudoers_io_log(const char *buf, unsigned int len, int idx)
gettimeofday(&now, NULL);
if (fatal_setjmp() != 0) {
/* called via fatal(), fatalx() or log_fatal() */
/* called via fatal() or fatalx() */
fatal_disable_setjmp();
debug_return_bool(-1);
}

View File

@@ -424,7 +424,7 @@ log_allowed(int status)
}
/*
* Perform logging for log_warning()/log_fatal()
* Perform logging for log_warning().
*/
static void
vlog_warning(int flags, const char *fmt, va_list ap)
@@ -529,23 +529,6 @@ log_warning(int flags, const char *fmt, ...)
debug_return;
}
void
log_fatal(int flags, const char *fmt, ...)
{
va_list ap;
debug_decl(log_error, SUDO_DEBUG_LOGGING)
/* Log the error. */
va_start(ap, fmt);
vlog_warning(flags, fmt, ap);
va_end(ap);
/* Exit the plugin. */
sudoers_cleanup();
sudo_debug_exit(__func__, __FILE__, __LINE__, sudo_debug_subsys);
fatal_longjmp(1);
}
#define MAX_MAILFLAGS 63
/*

View File

@@ -36,7 +36,7 @@
#define SUDOERS_LOCALE_USER 0
#define SUDOERS_LOCALE_SUDOERS 1
/* Flags for log_warning()/log_fatal() */
/* Flags for log_warning() */
#define MSG_ONLY 0x01
#define USE_ERRNO 0x02
#define NO_MAIL 0x04
@@ -67,7 +67,6 @@ void log_auth_failure(int status, unsigned int tries);
void log_denial(int status, bool inform_user);
void log_failure(int status, int flags);
void log_warning(int flags, const char *fmt, ...) __printflike(2, 3);
void log_fatal(int flags, const char *fmt, ...) __printflike(2, 3) __attribute__((__noreturn__));
void sudoers_initlocale(const char *ulocale, const char *slocale);
void writeln_wrap(FILE *fp, char *line, size_t len, size_t maxlen);

View File

@@ -542,7 +542,7 @@ sudoers_policy_open(unsigned int version, sudo_conv_t conversation,
args = NULL;
if (fatal_setjmp() != 0) {
/* called via fatal(), fatalx() or log_fatal() */
/* called via fatal() or fatalx() */
(void) rewind_perms();
fatal_disable_setjmp();
debug_return_bool(-1);
@@ -561,7 +561,7 @@ sudoers_policy_close(int exit_status, int error_code)
debug_decl(sudoers_policy_close, SUDO_DEBUG_PLUGIN)
if (fatal_setjmp() != 0) {
/* called via fatal(), fatalx() or log_fatal() */
/* called via fatal() or fatalx() */
fatal_disable_setjmp();
debug_return;
}
@@ -611,7 +611,7 @@ sudoers_policy_init_session(struct passwd *pwd, char **user_env[])
user_env = NULL;
if (fatal_setjmp() != 0) {
/* called via fatal(), fatalx() or log_fatal() */
/* called via fatal() or fatalx() */
fatal_disable_setjmp();
debug_return_bool(-1);
}
@@ -706,7 +706,7 @@ sudoers_policy_version(int verbose)
debug_decl(sudoers_policy_version, SUDO_DEBUG_PLUGIN)
if (fatal_setjmp() != 0) {
/* error recovery via fatal(), fatalx() or log_fatal() */
/* error recovery via fatal() or fatalx() */
fatal_disable_setjmp();
debug_return_bool(-1);
}

View File

@@ -225,7 +225,7 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
/* XXX - would like to move this to policy.c but need the cleanup. */
if (fatal_setjmp() != 0) {
/* error recovery via fatal(), fatalx() or log_fatal() */
/* error recovery via fatal() or fatalx() */
rval = -1;
goto done;
}