void *ptr;
if (size == 0)
- errorx2(1, _("internal error, tried to emalloc(0)"));
+ errorx_nodebug(1, _("internal error, tried to emalloc(0)"));
if ((ptr = malloc(size)) == NULL)
- errorx2(1, NULL);
+ errorx_nodebug(1, NULL);
return ptr;
}
void *ptr;
if (nmemb == 0 || size == 0)
- errorx2(1, _("internal error, tried to emalloc2(0)"));
+ errorx_nodebug(1, _("internal error, tried to emalloc2(0)"));
if (nmemb > SIZE_MAX / size)
- errorx2(1, _("internal error, %s overflow"), "emalloc2()");
+ errorx_nodebug(1, _("internal error, %s overflow"), "emalloc2()");
size *= nmemb;
if ((ptr = malloc(size)) == NULL)
- errorx2(1, NULL);
+ errorx_nodebug(1, NULL);
return ptr;
}
void *ptr;
if (nmemb == 0 || size == 0)
- errorx2(1, _("internal error, tried to ecalloc(0)"));
+ errorx_nodebug(1, _("internal error, tried to ecalloc(0)"));
if (nmemb != 1) {
if (nmemb > SIZE_MAX / size)
- errorx2(1, _("internal error, %s overflow"), "ecalloc()");
+ errorx_nodebug(1, _("internal error, %s overflow"), "ecalloc()");
size *= nmemb;
}
if ((ptr = malloc(size)) == NULL)
- errorx2(1, NULL);
+ errorx_nodebug(1, NULL);
memset(ptr, 0, size);
return ptr;
}
{
if (size == 0)
- errorx2(1, _("internal error, tried to erealloc(0)"));
+ errorx_nodebug(1, _("internal error, tried to erealloc(0)"));
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
- errorx2(1, NULL);
+ errorx_nodebug(1, NULL);
return ptr;
}
{
if (nmemb == 0 || size == 0)
- errorx2(1, _("internal error, tried to erealloc3(0)"));
+ errorx_nodebug(1, _("internal error, tried to erealloc3(0)"));
if (nmemb > SIZE_MAX / size)
- errorx2(1, _("internal error, %s overflow"), "erealloc3()");
+ errorx_nodebug(1, _("internal error, %s overflow"), "erealloc3()");
size *= nmemb;
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
- errorx2(1, NULL);
+ errorx_nodebug(1, NULL);
return ptr;
}
size_t size;
if (nmemb == 0 || msize == 0)
- errorx2(1, _("internal error, tried to erecalloc(0)"));
+ errorx_nodebug(1, _("internal error, tried to erecalloc(0)"));
if (nmemb > SIZE_MAX / msize)
- errorx2(1, _("internal error, %s overflow"), "erecalloc()");
+ errorx_nodebug(1, _("internal error, %s overflow"), "erecalloc()");
size = nmemb * msize;
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
- errorx2(1, NULL);
+ errorx_nodebug(1, NULL);
if (nmemb > onmemb) {
size = (nmemb - onmemb) * msize;
memset((char *)ptr + (onmemb * msize), 0, size);
va_end(ap);
if (len == -1)
- errorx2(1, NULL);
+ errorx_nodebug(1, NULL);
return len;
}
int len;
if ((len = vasprintf(ret, format, args)) == -1)
- errorx2(1, NULL);
+ errorx_nodebug(1, NULL);
return len;
}
if (l != NULL) {
#ifdef DEBUG
if (l->prev == NULL) {
- warningx2("list2tq called with non-semicircular list");
+ warningx_nodebug("list2tq called with non-semicircular list");
abort();
}
#endif
*/
#if defined(SUDO_ERROR_WRAP) && SUDO_ERROR_WRAP == 0
# if defined(__GNUC__) && __GNUC__ == 2
-# define error(rval, fmt...) error2((rval), fmt)
-# define errorx(rval, fmt...) errorx2((rval), fmt)
-# define warning(fmt...) warning2(fmt)
-# define warningx(fmt...) warningx2(fmt)
+# define error(rval, fmt...) error_nodebug((rval), fmt)
+# define errorx(rval, fmt...) errorx_nodebug((rval), fmt)
+# define warning(fmt...) warning_nodebug(fmt)
+# define warningx(fmt...) warningx_nodebug(fmt)
# else
-# define error(rval, ...) error2((rval), __VA_ARGS__)
-# define errorx(rval, ...) errorx2((rval), __VA_ARGS__)
-# define warning(...) warning2(__VA_ARGS__)
-# define warningx(...) warningx2(__VA_ARGS__)
+# define error(rval, ...) error_nodebug((rval), __VA_ARGS__)
+# define errorx(rval, ...) errorx_nodebug((rval), __VA_ARGS__)
+# define warning(...) warning_nodebug(__VA_ARGS__)
+# define warningx(...) warningx_nodebug(__VA_ARGS__)
# endif /* __GNUC__ == 2 */
-# define verror(rval, fmt, ap) error2((rval), (fmt), (ap))
-# define verrorx(rval, fmt, ap) errorx2((rval), (fmt), (ap))
-# define vwarning(fmt, ap) warning2((fmt), (ap))
-# define vwarningx(fmt, ap) warningx2((fmt), (ap))
+# define verror(rval, fmt, ap) error_nodebug((rval), (fmt), (ap))
+# define verrorx(rval, fmt, ap) errorx_nodebug((rval), (fmt), (ap))
+# define vwarning(fmt, ap) warning_nodebug((fmt), (ap))
+# define vwarningx(fmt, ap) warningx_nodebug((fmt), (ap))
#else /* SUDO_ERROR_WRAP */
# if defined(__GNUC__) && __GNUC__ == 2
# define error(rval, fmt...) do { \
sudo_debug_printf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO|sudo_debug_subsys, \
fmt); \
- error2((rval), fmt); \
+ error_nodebug((rval), fmt); \
} while (0)
# define errorx(rval, fmt...) do { \
sudo_debug_printf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|sudo_debug_subsys, fmt); \
- errorx2((rval), fmt); \
+ errorx_nodebug((rval), fmt); \
} while (0)
# define warning(fmt...) do { \
sudo_debug_printf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO|sudo_debug_subsys, \
fmt); \
- warning2(fmt); \
+ warning_nodebug(fmt); \
} while (0)
# define warningx(fmt...) do { \
sudo_debug_printf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|sudo_debug_subsys, fmt); \
- warningx2(fmt); \
+ warningx_nodebug(fmt); \
} while (0)
# else
# define error(rval, ...) do { \
sudo_debug_printf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO|sudo_debug_subsys, \
__VA_ARGS__); \
- error2((rval), __VA_ARGS__); \
+ error_nodebug((rval), __VA_ARGS__); \
} while (0)
# define errorx(rval, ...) do { \
sudo_debug_printf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|sudo_debug_subsys, __VA_ARGS__); \
- errorx2((rval), __VA_ARGS__); \
+ errorx_nodebug((rval), __VA_ARGS__); \
} while (0)
# define warning(...) do { \
sudo_debug_printf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_WARN|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO|sudo_debug_subsys, \
__VA_ARGS__); \
- warning2(__VA_ARGS__); \
+ warning_nodebug(__VA_ARGS__); \
} while (0)
# define warningx(...) do { \
sudo_debug_printf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_WARN|SUDO_DEBUG_LINENO|sudo_debug_subsys, __VA_ARGS__); \
- warningx2(__VA_ARGS__); \
+ warningx_nodebug(__VA_ARGS__); \
} while (0)
# endif /* __GNUC__ == 2 */
# define verror(rval, fmt, ap) do { \
sudo_debug_vprintf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO|sudo_debug_subsys, \
(fmt), (ap)); \
- verror2((rval), (fmt), (ap)); \
+ verror_nodebug((rval), (fmt), (ap)); \
} while (0)
# define verrorx(rval, fmt, ap) do { \
sudo_debug_vprintf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|sudo_debug_subsys, (fmt), (ap)); \
- verrorx2((rval), (fmt), (ap)); \
+ verrorx_nodebug((rval), (fmt), (ap)); \
} while (0)
# define vwarning(fmt, ap) do { \
sudo_debug_vprintf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_WARN|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO|sudo_debug_subsys, \
(fmt), (ap)); \
- vwarning2((fmt), (ap)); \
+ vwarning_nodebug((fmt), (ap)); \
} while (0)
# define vwarningx(fmt, ap) do { \
sudo_debug_vprintf2(__func__, __FILE__, __LINE__, \
SUDO_DEBUG_WARN|SUDO_DEBUG_LINENO|sudo_debug_subsys, (fmt), (ap)); \
- vwarningx2((fmt), (ap)); \
+ vwarningx_nodebug((fmt), (ap)); \
} while (0)
#endif /* SUDO_ERROR_WRAP */
-void error2(int, const char *, ...) __printflike(2, 3) __attribute__((__noreturn__));
-void errorx2(int, const char *, ...) __printflike(2, 3) __attribute__((__noreturn__));
-void verror2(int, const char *, va_list ap) __attribute__((__noreturn__));
-void verrorx2(int, const char *, va_list ap) __attribute__((__noreturn__));
-void warning2(const char *, ...) __printflike(1, 2);
-void warningx2(const char *, ...) __printflike(1, 2);
-void vwarning2(const char *, va_list ap);
-void vwarningx2(const char *, va_list ap);
+void error_nodebug(int, const char *, ...) __printflike(2, 3) __attribute__((__noreturn__));
+void errorx_nodebug(int, const char *, ...) __printflike(2, 3) __attribute__((__noreturn__));
+void verror_nodebug(int, const char *, va_list ap) __attribute__((__noreturn__));
+void verrorx_nodebug(int, const char *, va_list ap) __attribute__((__noreturn__));
+void warning_nodebug(const char *, ...) __printflike(1, 2);
+void warningx_nodebug(const char *, ...) __printflike(1, 2);
+void vwarning_nodebug(const char *, va_list ap);
+void vwarningx_nodebug(const char *, va_list ap);
#endif /* _SUDO_ERROR_H_ */
size_t nsize;
if (env.env_size > SIZE_MAX - 128) {
- errorx2(1, _("internal error, %s overflow"),
+ errorx_nodebug(1, _("internal error, %s overflow"),
"sudo_putenv_nodebug()");
}
nsize = env.env_size + 128;
if (nsize > SIZE_MAX / sizeof(char *)) {
- errorx2(1, _("internal error, %s overflow"),
+ errorx_nodebug(1, _("internal error, %s overflow"),
"sudo_putenv_nodebug()");
}
nenvp = realloc(env.envp, nsize * sizeof(char *));
extern sudo_conv_t sudo_conv;
void
-error2(int eval, const char *fmt, ...)
+error_nodebug(int eval, const char *fmt, ...)
{
va_list ap;
}
void
-errorx2(int eval, const char *fmt, ...)
+errorx_nodebug(int eval, const char *fmt, ...)
{
va_list ap;
}
void
-verror2(int eval, const char *fmt, va_list ap)
+verror_nodebug(int eval, const char *fmt, va_list ap)
{
_warning(1, fmt, ap);
sudoers_cleanup(0);
}
void
-verrorx2(int eval, const char *fmt, va_list ap)
+verrorx_nodebug(int eval, const char *fmt, va_list ap)
{
_warning(0, fmt, ap);
sudoers_cleanup(0);
}
void
-warning2(const char *fmt, ...)
+warning_nodebug(const char *fmt, ...)
{
va_list ap;
}
void
-warningx2(const char *fmt, ...)
+warningx_nodebug(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
}
void
-vwarning2(const char *fmt, va_list ap)
+vwarning_nodebug(const char *fmt, va_list ap)
{
_warning(1, fmt, ap);
}
void
-vwarningx2(const char *fmt, va_list ap)
+vwarningx_nodebug(const char *fmt, va_list ap)
{
_warning(0, fmt, ap);
}
handle = dlopen(plugin_path, RTLD_LAZY|RTLD_GLOBAL);
if (handle == NULL)
- errorx2(1, "unable to dlopen %s: %s", plugin_path, dlerror());
+ errorx_nodebug(1, "unable to dlopen %s: %s", plugin_path, dlerror());
fp = fopen(symbols_file, "r");
if (fp == NULL)
- error2(1, "unable to open %s", symbols_file);
+ error_nodebug(1, "unable to open %s", symbols_file);
while (fgets(line, sizeof(line), fp) != NULL) {
ntests++;
*cp = '\0';
sym = dlsym(handle, line);
if (sym == NULL) {
- warningx2("unable to resolve symbol %s: %s", line, dlerror());
+ warningx_nodebug("unable to resolve symbol %s: %s", line, dlerror());
errors++;
}
}
*/
sym = dlsym(handle, "user_in_group");
if (sym != NULL) {
- warningx2("able to resolve local symbol user_in_group");
+ warningx_nodebug("able to resolve local symbol user_in_group");
errors++;
}
ntests++;
rval = nanosleep(&ts, &rts);
} while (rval == -1 && errno == EINTR);
if (rval == -1) {
- error2(1, _("nanosleep: tv_sec %ld, tv_nsec %ld"),
+ error_nodebug(1, _("nanosleep: tv_sec %ld, tv_nsec %ld"),
(long)ts.tv_sec, (long)ts.tv_nsec);
}
}
struct alias *a = (struct alias *)v1;
char *prefix = (char *)v2;
- warningx2(_("%s: unused %s_Alias %s"), prefix,
+ warningx_nodebug(_("%s: unused %s_Alias %s"), prefix,
a->type == HOSTALIAS ? "Host" : a->type == CMNDALIAS ? "Cmnd" :
a->type == USERALIAS ? "User" : a->type == RUNASALIAS ? "Runas" :
"Unknown", a->name);
void cleanup(int);
void
-error2(int eval, const char *fmt, ...)
+error_nodebug(int eval, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
}
void
-errorx2(int eval, const char *fmt, ...)
+errorx_nodebug(int eval, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
}
void
-verror2(int eval, const char *fmt, va_list ap)
+verror_nodebug(int eval, const char *fmt, va_list ap)
{
_warning(1, fmt, ap);
cleanup(0);
}
void
-verrorx2(int eval, const char *fmt, va_list ap)
+verrorx_nodebug(int eval, const char *fmt, va_list ap)
{
_warning(0, fmt, ap);
cleanup(0);
}
void
-warning2(const char *fmt, ...)
+warning_nodebug(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
}
void
-warningx2(const char *fmt, ...)
+warningx_nodebug(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
}
void
-vwarning2(const char *fmt, va_list ap)
+vwarning_nodebug(const char *fmt, va_list ap)
{
_warning(1, fmt, ap);
}
void
-vwarningx2(const char *fmt, va_list ap)
+vwarningx_nodebug(const char *fmt, va_list ap)
{
_warning(0, fmt, ap);
}
case SUDO_HOOK_RET_STOP:
goto done;
default:
- warningx2("invalid setenv hook return value: %d", rc);
+ warningx_nodebug("invalid setenv hook return value: %d", rc);
break;
}
}
case SUDO_HOOK_RET_STOP:
goto done;
default:
- warningx2("invalid putenv hook return value: %d", rc);
+ warningx_nodebug("invalid putenv hook return value: %d", rc);
break;
}
}
case SUDO_HOOK_RET_STOP:
goto done;
default:
- warningx2("invalid getenv hook return value: %d", rc);
+ warningx_nodebug("invalid getenv hook return value: %d", rc);
break;
}
}
case SUDO_HOOK_RET_STOP:
goto done;
default:
- warningx2("invalid unsetenv hook return value: %d", rc);
+ warningx_nodebug("invalid unsetenv hook return value: %d", rc);
break;
}
}