From: Todd C. Miller Date: Thu, 15 Aug 2013 19:06:49 +0000 (-0600) Subject: Change some fatalx(NULL) that should be fatal(NULL). X-Git-Tag: SUDO_1_8_8^2~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=85fc5792d42994a650c5c165d792eb3a1a86547d;p=sudo Change some fatalx(NULL) that should be fatal(NULL). --- diff --git a/common/alloc.c b/common/alloc.c index 05ddffd55..3f9dd27a4 100644 --- a/common/alloc.c +++ b/common/alloc.c @@ -82,7 +82,7 @@ emalloc(size_t size) fatalx_nodebug(_("internal error, tried to emalloc(0)")); if ((ptr = malloc(size)) == NULL) - fatalx_nodebug(NULL); + fatal_nodebug(NULL); return ptr; } @@ -102,7 +102,7 @@ emalloc2(size_t nmemb, size_t size) size *= nmemb; if ((ptr = malloc(size)) == NULL) - fatalx_nodebug(NULL); + fatal_nodebug(NULL); return ptr; } @@ -124,7 +124,7 @@ ecalloc(size_t nmemb, size_t size) size *= nmemb; } if ((ptr = malloc(size)) == NULL) - fatalx_nodebug(NULL); + fatal_nodebug(NULL); memset(ptr, 0, size); return ptr; } @@ -143,7 +143,7 @@ erealloc(void *ptr, size_t size) ptr = ptr ? realloc(ptr, size) : malloc(size); if (ptr == NULL) - fatalx_nodebug(NULL); + fatal_nodebug(NULL); return ptr; } @@ -165,7 +165,7 @@ erealloc3(void *ptr, size_t nmemb, size_t size) size *= nmemb; ptr = ptr ? realloc(ptr, size) : malloc(size); if (ptr == NULL) - fatalx_nodebug(NULL); + fatal_nodebug(NULL); return ptr; } @@ -189,7 +189,7 @@ erecalloc(void *ptr, size_t onmemb, size_t nmemb, size_t msize) size = nmemb * msize; ptr = ptr ? realloc(ptr, size) : malloc(size); if (ptr == NULL) - fatalx_nodebug(NULL); + fatal_nodebug(NULL); if (nmemb > onmemb) { size = (nmemb - onmemb) * msize; memset((char *)ptr + (onmemb * msize), 0, size); @@ -254,7 +254,7 @@ easprintf(char **ret, const char *fmt, ...) va_end(ap); if (len == -1) - fatalx_nodebug(NULL); + fatal_nodebug(NULL); return len; } @@ -268,6 +268,6 @@ evasprintf(char **ret, const char *format, va_list args) int len; if ((len = vasprintf(ret, format, args)) == -1) - fatalx_nodebug(NULL); + fatal_nodebug(NULL); return len; } diff --git a/plugins/sudoers/env.c b/plugins/sudoers/env.c index 5e8822191..78cd2e609 100644 --- a/plugins/sudoers/env.c +++ b/plugins/sudoers/env.c @@ -366,7 +366,7 @@ sudo_putenv(char *str, bool dupcheck, bool overwrite) if (env.envp[env.env_len] != NULL) fatalx(_("sudo_putenv: corrupted envp, length mismatch")); #endif - fatalx(NULL); + fatal(NULL); } debug_return_int(rval); } diff --git a/src/exec_common.c b/src/exec_common.c index 07113a1d0..982063e79 100644 --- a/src/exec_common.c +++ b/src/exec_common.c @@ -109,7 +109,7 @@ disable_execute(char *const envp[]) preload = fmt_string(RTLD_PRELOAD_VAR, sudo_conf_noexec_path()); # endif if (preload == NULL) - fatalx(NULL); + fatal(NULL); nenvp[env_len++] = preload; nenvp[env_len] = NULL; } else { diff --git a/src/parse_args.c b/src/parse_args.c index ee8bbd796..87466556f 100644 --- a/src/parse_args.c +++ b/src/parse_args.c @@ -503,7 +503,7 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp, settings[j] = fmt_string(sudo_settings[i].name, sudo_settings[i].value); if (settings[j] == NULL) - fatalx(NULL); + fatal(NULL); j++; } } diff --git a/src/sudo.c b/src/sudo.c index 0b6393eed..14fe05fbe 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -467,7 +467,7 @@ get_user_info(struct user_details *ud) user_info[i] = fmt_string("user", pw->pw_name); if (user_info[i] == NULL) - fatalx(NULL); + fatal(NULL); ud->username = user_info[i] + sizeof("user=") - 1; /* Stash user's shell for use with the -s flag; don't pass to plugin. */ @@ -493,14 +493,14 @@ get_user_info(struct user_details *ud) if (getcwd(cwd, sizeof(cwd)) != NULL) { user_info[++i] = fmt_string("cwd", cwd); if (user_info[i] == NULL) - fatalx(NULL); + fatal(NULL); ud->cwd = user_info[i] + sizeof("cwd=") - 1; } if ((cp = get_process_ttyname()) != NULL) { user_info[++i] = fmt_string("tty", cp); if (user_info[i] == NULL) - fatalx(NULL); + fatal(NULL); ud->tty = user_info[i] + sizeof("tty=") - 1; efree(cp); } @@ -511,7 +511,7 @@ get_user_info(struct user_details *ud) strlcpy(host, "localhost", sizeof(host)); user_info[++i] = fmt_string("host", host); if (user_info[i] == NULL) - fatalx(NULL); + fatal(NULL); ud->host = user_info[i] + sizeof("host=") - 1; get_ttysize(&ud->ts_lines, &ud->ts_cols); @@ -739,7 +739,7 @@ command_info_to_details(char * const info[], struct command_details *details) #endif details->pw = getpwuid(details->euid); if (details->pw != NULL && (details->pw = pw_dup(details->pw)) == NULL) - fatalx(NULL); + fatal(NULL); #ifdef HAVE_SETAUTHDB aix_restoreauthdb(); #endif