#undef efree
#define efree(x) free((void *)(x))
-__dso_public int easprintf(char **, const char *, ...) __printflike(2, 3);
-__dso_public int evasprintf(char **, const char *, va_list) __printflike(2, 0);
-__dso_public void *ecalloc(size_t, size_t) __malloc_like;
-__dso_public void *emalloc(size_t) __malloc_like;
-__dso_public void *emallocarray(size_t, size_t) __malloc_like;
-__dso_public void *erealloc(void *, size_t);
-__dso_public void *ereallocarray(void *, size_t, size_t);
-__dso_public void *erecalloc(void *, size_t, size_t, size_t);
-__dso_public char *estrdup(const char *) __malloc_like;
-__dso_public char *estrndup(const char *, size_t) __malloc_like;
+__dso_public int sudo_easprintf(char **, const char *, ...) __printflike(2, 3);
+__dso_public int sudo_evasprintf(char **, const char *, va_list) __printflike(2, 0);
+__dso_public void *sudo_ecalloc(size_t, size_t) __malloc_like;
+__dso_public void *sudo_emalloc(size_t) __malloc_like;
+__dso_public void *sudo_emallocarray(size_t, size_t) __malloc_like;
+__dso_public void *sudo_erealloc(void *, size_t);
+__dso_public void *sudo_ereallocarray(void *, size_t, size_t);
+__dso_public void *sudo_erecalloc(void *, size_t, size_t, size_t);
+__dso_public char *sudo_estrdup(const char *) __malloc_like;
+__dso_public char *sudo_estrndup(const char *, size_t) __malloc_like;
#endif /* _SUDO_ALLOC_H */
cleandir: realclean
# Autogenerated dependencies, do not modify
-aix.lo: $(srcdir)/aix.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+aix.lo: $(srcdir)/aix.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_util.h $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/aix.c
-alloc.lo: $(srcdir)/alloc.c $(incdir)/alloc.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(top_builddir)/config.h
+alloc.lo: $(srcdir)/alloc.c $(incdir)/fatal.h $(incdir)/gettext.h \
+ $(incdir)/missing.h $(incdir)/sudo_alloc.h $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/alloc.c
atobool.lo: $(srcdir)/atobool.c $(incdir)/compat/stdbool.h $(incdir)/missing.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_util.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_util.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/sudo_conf/conf_test.c
-event.lo: $(srcdir)/event.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/missing.h $(incdir)/queue.h \
+event.lo: $(srcdir)/event.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_event.h $(incdir)/sudo_util.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/event.c
-event_poll.lo: $(srcdir)/event_poll.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+event_poll.lo: $(srcdir)/event_poll.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_event.h $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/event_poll.c
-event_select.lo: $(srcdir)/event_select.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+event_select.lo: $(srcdir)/event_select.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_event.h $(incdir)/sudo_util.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/event_select.c
-fatal.lo: $(srcdir)/fatal.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_plugin.h $(top_builddir)/config.h
+fatal.lo: $(srcdir)/fatal.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_plugin.h \
+ $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/fatal.c
fnm_test.lo: $(srcdir)/regress/fnmatch/fnm_test.c $(incdir)/compat/fnmatch.h \
$(incdir)/missing.h $(top_builddir)/config.h
getopt_long.lo: $(srcdir)/getopt_long.c $(incdir)/compat/getopt.h \
$(incdir)/fatal.h $(incdir)/missing.h $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/getopt_long.c
-gidlist.lo: $(srcdir)/gidlist.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+gidlist.lo: $(srcdir)/gidlist.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_util.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/gidlist.c
$(incdir)/sudo_debug.h $(incdir)/sudo_util.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/key_val.c
-lbuf.lo: $(srcdir)/lbuf.c $(incdir)/alloc.h $(incdir)/fatal.h \
- $(incdir)/missing.h $(incdir)/sudo_debug.h $(incdir)/sudo_lbuf.h \
+lbuf.lo: $(srcdir)/lbuf.c $(incdir)/fatal.h $(incdir)/missing.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h $(incdir)/sudo_lbuf.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/lbuf.c
locale_stub.lo: $(top_srcdir)/src/locale_stub.c $(incdir)/fatal.h \
strtonum.lo: $(srcdir)/strtonum.c $(incdir)/gettext.h $(incdir)/missing.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/strtonum.c
-sudo_conf.lo: $(srcdir)/sudo_conf.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/secure_path.h \
+sudo_conf.lo: $(srcdir)/sudo_conf.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/secure_path.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_conf.c
-sudo_debug.lo: $(srcdir)/sudo_debug.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/sudo_debug.h \
+sudo_debug.lo: $(srcdir)/sudo_debug.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_debug.c
#include "gettext.h" /* must be included before missing.h */
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_debug.h"
#include "sudo_util.h"
debug_decl(aix_setauthdb, SUDO_DEBUG_UTIL)
/* set usrinfo, like login(1) does */
- len = easprintf(&info, "NAME=%s%cLOGIN=%s%cLOGNAME=%s%cTTY=%s%c",
+ len = sudo_easprintf(&info, "NAME=%s%cLOGIN=%s%cLOGNAME=%s%cTTY=%s%c",
user, '\0', user, '\0', user, '\0', tty ? tty : "", '\0');
(void)usrinfo(SETUINFO, info, len);
efree(info);
#include "gettext.h" /* must be included before missing.h */
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
/*
* If there is no SIZE_MAX or SIZE_T_MAX we have to assume that size_t
* could be signed (as it is on SunOS 4.x). This just means that
- * emallocarray() and ereallocarray() cannot allocate huge amounts on such a
+ * sudo_emallocarray() and sudo_ereallocarray() cannot allocate huge amounts on such a
* platform but that is OK since sudo doesn't need to do so anyway.
*/
#ifndef SIZE_MAX
#endif /* SIZE_MAX */
/*
- * emalloc() calls the system malloc(3) and exits with an error if
+ * sudo_emalloc() calls the system malloc(3) and exits with an error if
* malloc(3) fails.
*/
void *
-emalloc(size_t size)
+sudo_emalloc(size_t size)
{
void *ptr;
if (size == 0)
- sudo_fatalx_nodebug(_("internal error, tried to emalloc(0)"));
+ sudo_fatalx_nodebug(_("internal error, tried allocate zero bytes"));
if ((ptr = malloc(size)) == NULL)
sudo_fatal_nodebug(NULL);
}
/*
- * emallocarray() allocates nmemb * size bytes and exits with an error
+ * sudo_emallocarray() allocates nmemb * size bytes and exits with an error
* if overflow would occur or if the system malloc(3) fails.
*/
void *
-emallocarray(size_t nmemb, size_t size)
+sudo_emallocarray(size_t nmemb, size_t size)
{
void *ptr;
if (nmemb == 0 || size == 0)
- sudo_fatalx_nodebug(_("internal error, tried to emallocarray(0)"));
+ sudo_fatalx_nodebug(_("internal error, tried allocate zero bytes"));
if (nmemb > SIZE_MAX / size)
- sudo_fatalx_nodebug(_("internal error, %s overflow"), "emallocarray");
+ sudo_fatalx_nodebug(_("internal error, %s overflow"), "sudo_emallocarray");
size *= nmemb;
if ((ptr = malloc(size)) == NULL)
}
/*
- * ecalloc() allocates nmemb * size bytes and exits with an error
+ * sudo_ecalloc() allocates nmemb * size bytes and exits with an error
* if overflow would occur or if the system malloc(3) fails.
* On success, the allocated space is zero-filled.
*/
void *
-ecalloc(size_t nmemb, size_t size)
+sudo_ecalloc(size_t nmemb, size_t size)
{
void *ptr;
if (nmemb == 0 || size == 0)
- sudo_fatalx_nodebug(_("internal error, tried to ecalloc(0)"));
+ sudo_fatalx_nodebug(_("internal error, tried allocate zero bytes"));
if (nmemb != 1) {
if (nmemb > SIZE_MAX / size)
- sudo_fatalx_nodebug(_("internal error, %s overflow"), "ecalloc");
+ sudo_fatalx_nodebug(_("internal error, %s overflow"), "sudo_ecalloc");
size *= nmemb;
}
if ((ptr = malloc(size)) == NULL)
}
/*
- * erealloc() calls the system realloc(3) and exits with an error if
- * realloc(3) fails. You can call erealloc() with a NULL pointer even
+ * sudo_erealloc() calls the system realloc(3) and exits with an error if
+ * realloc(3) fails. You can call sudo_erealloc() with a NULL pointer even
* if the system realloc(3) does not support this.
*/
void *
-erealloc(void *ptr, size_t size)
+sudo_erealloc(void *ptr, size_t size)
{
if (size == 0)
- sudo_fatalx_nodebug(_("internal error, tried to erealloc(0)"));
+ sudo_fatalx_nodebug(_("internal error, tried allocate zero bytes"));
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
}
/*
- * ereallocarray() realloc(3)s nmemb * size bytes and exits with an error
- * if overflow would occur or if the system malloc(3)/realloc(3) fails.
- * You can call erealloc() with a NULL pointer even if the system realloc(3)
- * does not support this.
+ * sudo_ereallocarray() sudo_realloc(3)s nmemb * size bytes and exits with an
+ * error if overflow would occur or if the system malloc(3)/realloc(3) fails.
+ * You can call sudo_ereallocarray() with a NULL pointer even if the system
+ * realloc(3) does not support this.
*/
void *
-ereallocarray(void *ptr, size_t nmemb, size_t size)
+sudo_ereallocarray(void *ptr, size_t nmemb, size_t size)
{
if (nmemb == 0 || size == 0)
- sudo_fatalx_nodebug(_("internal error, tried to ereallocarray(0)"));
+ sudo_fatalx_nodebug(_("internal error, tried allocate zero bytes"));
if (nmemb > SIZE_MAX / size)
- sudo_fatalx_nodebug(_("internal error, %s overflow"), "ereallocarray");
+ sudo_fatalx_nodebug(_("internal error, %s overflow"), "sudo_ereallocarray");
size *= nmemb;
ptr = ptr ? realloc(ptr, size) : malloc(size);
}
/*
- * erecalloc() realloc(3)s nmemb * msize bytes and exits with an error
+ * sudo_ersudo_ecalloc() realloc(3)s nmemb * msize bytes and exits with an error
* if overflow would occur or if the system malloc(3)/realloc(3) fails.
- * On success, the new space is zero-filled. You can call erealloc()
+ * On success, the new space is zero-filled. You can call sudo_erealloc()
* with a NULL pointer even if the system realloc(3) does not support this.
*/
void *
-erecalloc(void *ptr, size_t onmemb, size_t nmemb, size_t msize)
+ersudo_ecalloc(void *ptr, size_t onmemb, size_t nmemb, size_t msize)
{
size_t size;
if (nmemb == 0 || msize == 0)
- sudo_fatalx_nodebug(_("internal error, tried to erecalloc(0)"));
+ sudo_fatalx_nodebug(_("internal error, tried allocate zero bytes"));
if (nmemb > SIZE_MAX / msize)
- sudo_fatalx_nodebug(_("internal error, %s overflow"), "erecalloc");
+ sudo_fatalx_nodebug(_("internal error, %s overflow"), "ersudo_ecalloc");
size = nmemb * msize;
ptr = ptr ? realloc(ptr, size) : malloc(size);
}
/*
- * estrdup() is like strdup(3) except that it exits with an error if
- * malloc(3) fails. NOTE: unlike strdup(3), estrdup(NULL) is legal.
+ * sudo_estrdup() is like strdup(3) except that it exits with an error if
+ * malloc(3) fails. NOTE: unlike strdup(3), sudo_estrdup(NULL) is legal.
*/
char *
-estrdup(const char *src)
+sudo_estrdup(const char *src)
{
char *dst = NULL;
size_t len;
if (src != NULL) {
len = strlen(src);
- dst = (char *) emalloc(len + 1);
+ dst = (char *) sudo_emalloc(len + 1);
(void) memcpy(dst, src, len);
dst[len] = '\0';
}
}
/*
- * estrdup() is like strndup(3) except that it exits with an error if
- * malloc(3) fails. NOTE: unlike strdup(3), estrdup(NULL) is legal.
+ * sudo_estrndup() is like strndup(3) except that it exits with an error if
+ * malloc(3) fails. NOTE: unlike strdup(3), sudo_estrdup(NULL) is legal.
*/
char *
-estrndup(const char *src, size_t maxlen)
+sudo_estrndup(const char *src, size_t maxlen)
{
char *dst = NULL;
size_t len = 0;
len++;
maxlen--;
}
- dst = (char *) emalloc(len + 1);
+ dst = (char *) sudo_emalloc(len + 1);
(void) memcpy(dst, src, len);
dst[len] = '\0';
}
}
/*
- * easprintf() calls vasprintf() and exits with an error if vasprintf()
+ * sudo_easprintf() calls vasprintf() and exits with an error if vasprintf()
* returns -1 (out of memory).
*/
int
-easprintf(char **ret, const char *fmt, ...)
+sudo_easprintf(char **ret, const char *fmt, ...)
{
int len;
va_list ap;
}
/*
- * evasprintf() calls vasprintf() and exits with an error if vasprintf()
+ * sudo_evasprintf() calls vasprintf() and exits with an error if vasprintf()
* returns -1 (out of memory).
*/
int
-evasprintf(char **ret, const char *format, va_list args)
+sudo_evasprintf(char **ret, const char *format, va_list args)
{
int len;
#include <errno.h>
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_debug.h"
#include "sudo_event.h"
struct sudo_event_base *base;
debug_decl(sudo_ev_base_alloc, SUDO_DEBUG_EVENT)
- base = ecalloc(1, sizeof(*base));
+ base = sudo_ecalloc(1, sizeof(*base));
TAILQ_INIT(&base->events);
TAILQ_INIT(&base->timeouts);
if (sudo_ev_base_alloc_impl(base) != 0) {
/* XXX - sanity check events value */
- ev = ecalloc(1, sizeof(*ev));
+ ev = sudo_ecalloc(1, sizeof(*ev));
ev->fd = fd;
ev->events = events;
ev->pfd_idx = -1;
#include <poll.h>
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_debug.h"
#include "sudo_event.h"
base->pfd_high = -1;
base->pfd_max = 32;
- base->pfds = ereallocarray(NULL, base->pfd_max, sizeof(struct pollfd));
+ base->pfds = sudo_ereallocarray(NULL, base->pfd_max, sizeof(struct pollfd));
for (i = 0; i < base->pfd_max; i++) {
base->pfds[i].fd = -1;
}
int i;
base->pfd_max <<= 1;
base->pfds =
- ereallocarray(base->pfds, base->pfd_max, sizeof(struct pollfd));
+ sudo_ereallocarray(base->pfds, base->pfd_max, sizeof(struct pollfd));
for (i = base->pfd_free; i < base->pfd_max; i++) {
base->pfds[i].fd = -1;
}
#include <errno.h>
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_debug.h"
#include "sudo_event.h"
debug_decl(sudo_ev_base_alloc_impl, SUDO_DEBUG_EVENT)
base->maxfd = NFDBITS - 1;
- base->readfds_in = ecalloc(1, sizeof(fd_mask));
- base->writefds_in = ecalloc(1, sizeof(fd_mask));
- base->readfds_out = ecalloc(1, sizeof(fd_mask));
- base->writefds_out = ecalloc(1, sizeof(fd_mask));
+ base->readfds_in = sudo_ecalloc(1, sizeof(fd_mask));
+ base->writefds_in = sudo_ecalloc(1, sizeof(fd_mask));
+ base->readfds_out = sudo_ecalloc(1, sizeof(fd_mask));
+ base->writefds_out = sudo_ecalloc(1, sizeof(fd_mask));
debug_return_int(0);
}
if (ev->fd > base->maxfd) {
const int o = (base->maxfd + 1) / NFDBITS;
const int n = howmany(ev->fd + 1, NFDBITS);
- base->readfds_in = erecalloc(base->readfds_in, o, n, sizeof(fd_mask));
- base->writefds_in = erecalloc(base->writefds_in, o, n, sizeof(fd_mask));
- base->readfds_out = erecalloc(base->readfds_out, o, n, sizeof(fd_mask));
- base->writefds_out = erecalloc(base->writefds_out, o, n, sizeof(fd_mask));
+ base->readfds_in = ersudo_ecalloc(base->readfds_in, o, n, sizeof(fd_mask));
+ base->writefds_in = ersudo_ecalloc(base->writefds_in, o, n, sizeof(fd_mask));
+ base->readfds_out = ersudo_ecalloc(base->readfds_out, o, n, sizeof(fd_mask));
+ base->writefds_out = ersudo_ecalloc(base->writefds_out, o, n, sizeof(fd_mask));
base->maxfd = (n * NFDBITS) - 1;
}
#include "gettext.h" /* must be included before missing.h */
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "queue.h"
#include "sudo_plugin.h"
int serrno = errno;
char *str;
- evasprintf(&str, fmt, ap);
+ sudo_evasprintf(&str, fmt, ap);
if (use_errno) {
if (fmt != NULL) {
sudo_printf(SUDO_CONV_ERROR_MSG,
#include "gettext.h" /* must be included before missing.h */
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_debug.h"
#include "sudo_util.h"
ngids++;
/* Allocate and fill in array. */
if (ngids != 0) {
- gids = emallocarray(ngids, sizeof(GETGROUPS_T));
+ gids = sudo_emallocarray(ngids, sizeof(GETGROUPS_T));
ngids = 0;
if (basegid != NULL)
gids[ngids++] = *basegid;
#include <ctype.h>
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_lbuf.h"
#include "sudo_debug.h"
do {
lbuf->size += 256;
} while (lbuf->len + extra + 1 >= lbuf->size);
- lbuf->buf = erealloc(lbuf->buf, lbuf->size);
+ lbuf->buf = sudo_erealloc(lbuf->buf, lbuf->size);
}
}
#define SUDO_ERROR_WRAP 0
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "pathnames.h"
#include "sudo_plugin.h"
debug_flags++;
/* Set debug file and parse the flags (init debug as soon as possible). */
- debug_file = estrndup(entry, filelen);
- debug_flags = estrdup(debug_flags);
+ debug_file = sudo_estrndup(entry, filelen);
+ debug_flags = sudo_estrdup(debug_flags);
sudo_debug_init(debug_file, debug_flags);
efree(debug_file);
for (cur = sudo_conf_data.paths; cur->pname != NULL; cur++) {
if (strncasecmp(name, cur->pname, cur->pnamelen) == 0 &&
isblank((unsigned char)name[cur->pnamelen])) {
- cur->pval = estrdup(path);
+ cur->pval = sudo_estrdup(path);
break;
}
}
while (isblank((unsigned char)*ep))
ep++;
}
- options = emallocarray(nopts + 1, sizeof(*options));
+ options = sudo_emallocarray(nopts + 1, sizeof(*options));
/* Fill in options array, there is at least one element. */
for (nopts = 0; (ep = strpbrk(cp, " \t")) != NULL; ) {
- options[nopts++] = estrndup(cp, (size_t)(ep - cp));
+ options[nopts++] = sudo_estrndup(cp, (size_t)(ep - cp));
while (isblank((unsigned char)*ep))
ep++;
cp = ep;
}
- options[nopts++] = estrdup(cp);
+ options[nopts++] = sudo_estrdup(cp);
options[nopts] = NULL;
} else {
/* No extra options. */
pathlen = strlen(path);
}
- info = ecalloc(1, sizeof(*info));
- info->symbol_name = estrndup(name, namelen);
- info->path = estrndup(path, pathlen);
+ info = sudo_ecalloc(1, sizeof(*info));
+ info->symbol_name = sudo_estrndup(name, namelen);
+ info->path = sudo_estrndup(path, pathlen);
info->options = options;
info->lineno = conf_lineno;
TAILQ_INSERT_TAIL(&sudo_conf_data.plugins, info, entries);
struct stat sb;
FILE *fp;
char *cp, *line = NULL;
- char *prev_locale = estrdup(setlocale(LC_ALL, NULL));
+ char *prev_locale = sudo_estrdup(setlocale(LC_ALL, NULL));
size_t linesize = 0;
/* Parse sudo.conf in the "C" locale. */
#include "gettext.h" /* must be included before missing.h */
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_plugin.h"
#include "sudo_debug.h"
atoid
atomode
closefrom_fallback
-easprintf
-ecalloc
-emalloc
-emallocarray
-erealloc
-ereallocarray
-erecalloc
-estrdup
-estrndup
-evasprintf
-sudo_fatal_callback_deregister
-sudo_fatal_callback_register
-sudo_fatal_nodebug
-sudo_fatalx_nodebug
getprogname
initprogname
isblank
sudo_dso_preload_table
sudo_dso_strerror
sudo_dso_unload
+sudo_easprintf
+sudo_ecalloc
+sudo_emalloc
+sudo_emallocarray
+sudo_erealloc
+sudo_ereallocarray
+sudo_erecalloc
+sudo_estrdup
+sudo_estrndup
sudo_ev_add
sudo_ev_alloc
sudo_ev_base_alloc
sudo_ev_loopbreak
sudo_ev_loopcontinue
sudo_ev_loopexit
+sudo_evasprintf
+sudo_fatal_callback_deregister
+sudo_fatal_callback_register
+sudo_fatal_nodebug
+sudo_fatalx_nodebug
sudo_fnmatch
sudo_freeaddrinfo
sudo_futimes
sudo_term_restore
sudo_utimes
sudo_vasprintf
-sudo_vsnprintf
sudo_vfatal_nodebug
sudo_vfatalx_nodebug
+sudo_vsnprintf
sudo_vwarn_nodebug
sudo_vwarnx_nodebug
sudo_warn_gettext
cleandir: realclean
# Autogenerated dependencies, do not modify
-afs.lo: $(authdir)/afs.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+afs.lo: $(authdir)/afs.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/afs.c
-aix_auth.lo: $(authdir)/aix_auth.c $(devdir)/def_data.h $(incdir)/alloc.h \
+aix_auth.lo: $(authdir)/aix_auth.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/aix_auth.c
alias.lo: $(srcdir)/alias.c $(devdir)/def_data.h $(devdir)/gram.h \
- $(incdir)/alloc.h $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
$(srcdir)/redblack.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
boottime.lo: $(srcdir)/boottime.c $(incdir)/compat/stdbool.h \
$(incdir)/missing.h $(incdir)/sudo_debug.h $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/boottime.c
-bsdauth.lo: $(authdir)/bsdauth.c $(devdir)/def_data.h $(incdir)/alloc.h \
+bsdauth.lo: $(authdir)/bsdauth.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
- $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/bsdauth.c
bsm_audit.lo: $(srcdir)/bsm_audit.c $(incdir)/fatal.h $(incdir)/gettext.h \
$(incdir)/missing.h $(incdir)/sudo_debug.h $(srcdir)/bsm_audit.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/bsm_audit.c
-check.lo: $(srcdir)/check.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+check.lo: $(srcdir)/check.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/check.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/check.c
check_addr.o: $(srcdir)/regress/parser/check_addr.c $(devdir)/def_data.h \
- $(incdir)/alloc.h $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/parse.h \
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/parser/check_fill.c
check_iolog_path.o: $(srcdir)/regress/iolog_path/check_iolog_path.c \
$(devdir)/def_data.c $(devdir)/def_data.h \
- $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_debug.h \
+ $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
$(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/logging/check_wrap.c
-dce.lo: $(authdir)/dce.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+dce.lo: $(authdir)/dce.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/dce.c
defaults.lo: $(srcdir)/defaults.c $(devdir)/def_data.c $(devdir)/def_data.h \
- $(devdir)/gram.h $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
- $(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+ $(devdir)/gram.h $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
+ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/defaults.c
-env.lo: $(srcdir)/env.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+env.lo: $(srcdir)/env.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/env.c
-find_path.lo: $(srcdir)/find_path.c $(devdir)/def_data.h $(incdir)/alloc.h \
+find_path.lo: $(srcdir)/find_path.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(top_builddir)/config.h \
- $(top_builddir)/pathnames.h
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/find_path.c
find_path.o: find_path.lo
-fwtk.lo: $(authdir)/fwtk.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+fwtk.lo: $(authdir)/fwtk.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/fwtk.c
getdate.o: $(devdir)/getdate.c $(incdir)/missing.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(devdir)/getdate.c
-getspwuid.lo: $(srcdir)/getspwuid.c $(devdir)/def_data.h $(incdir)/alloc.h \
+getspwuid.lo: $(srcdir)/getspwuid.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(top_builddir)/config.h \
- $(top_builddir)/pathnames.h
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/getspwuid.c
-goodpath.lo: $(srcdir)/goodpath.c $(devdir)/def_data.h $(incdir)/alloc.h \
+goodpath.lo: $(srcdir)/goodpath.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/goodpath.c
goodpath.o: goodpath.lo
-gram.lo: $(devdir)/gram.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+gram.lo: $(devdir)/gram.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/parse.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/toke.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(devdir)/gram.c
group_plugin.lo: $(srcdir)/group_plugin.c $(devdir)/def_data.h \
- $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_debug.h $(incdir)/sudo_dso.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(top_builddir)/config.h \
- $(top_builddir)/pathnames.h
+ $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
+ $(incdir)/sudo_dso.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h \
+ $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/group_plugin.c
group_plugin.o: group_plugin.lo
hexchar.lo: $(srcdir)/hexchar.c $(incdir)/missing.h $(incdir)/sudo_debug.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/hexchar.c
hexchar.o: hexchar.lo
-interfaces.lo: $(srcdir)/interfaces.c $(devdir)/def_data.h $(incdir)/alloc.h \
+interfaces.lo: $(srcdir)/interfaces.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h \
$(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/defaults.h \
- $(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(top_builddir)/config.h \
- $(top_builddir)/pathnames.h
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
+ $(srcdir)/defaults.h $(srcdir)/interfaces.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/interfaces.c
interfaces.o: interfaces.lo
-iolog.lo: $(srcdir)/iolog.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+iolog.lo: $(srcdir)/iolog.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/iolog.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/iolog.c
-iolog_path.lo: $(srcdir)/iolog_path.c $(devdir)/def_data.h $(incdir)/alloc.h \
+iolog_path.lo: $(srcdir)/iolog_path.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h \
$(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
- $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
+ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
+ $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/iolog_path.c
iolog_path.o: iolog_path.lo
-kerb5.lo: $(authdir)/kerb5.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+kerb5.lo: $(authdir)/kerb5.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/kerb5.c
-ldap.lo: $(srcdir)/ldap.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+ldap.lo: $(srcdir)/ldap.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_dso.h $(incdir)/sudo_lbuf.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/ldap.c
-linux_audit.lo: $(srcdir)/linux_audit.c $(incdir)/alloc.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/sudo_debug.h \
- $(srcdir)/linux_audit.h $(top_builddir)/config.h
+linux_audit.lo: $(srcdir)/linux_audit.c $(incdir)/fatal.h $(incdir)/gettext.h \
+ $(incdir)/missing.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(srcdir)/linux_audit.h \
+ $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/linux_audit.c
-locale.lo: $(srcdir)/locale.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+locale.lo: $(srcdir)/locale.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/sudo_alloc.h \
$(srcdir)/logging.h $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/locale.c
locale.o: locale.lo
-logging.lo: $(srcdir)/logging.c $(devdir)/def_data.h $(incdir)/alloc.h \
+logging.lo: $(srcdir)/logging.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
- $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/logging.c
-logwrap.lo: $(srcdir)/logwrap.c $(devdir)/def_data.h $(incdir)/alloc.h \
+logwrap.lo: $(srcdir)/logwrap.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
- $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/logwrap.c
logwrap.o: logwrap.lo
match.lo: $(srcdir)/match.c $(devdir)/def_data.h $(devdir)/gram.h \
- $(incdir)/alloc.h $(incdir)/compat/fnmatch.h $(incdir)/compat/glob.h \
+ $(incdir)/compat/fnmatch.h $(incdir)/compat/glob.h \
$(incdir)/compat/sha2.h $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
$(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
- $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
+ $(srcdir)/logging.h $(srcdir)/parse.h $(srcdir)/sudo_nss.h \
+ $(srcdir)/sudoers.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/match.c
-match_addr.lo: $(srcdir)/match_addr.c $(devdir)/def_data.h $(incdir)/alloc.h \
+match_addr.lo: $(srcdir)/match_addr.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h \
$(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/defaults.h \
- $(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(top_builddir)/config.h \
- $(top_builddir)/pathnames.h
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
+ $(srcdir)/defaults.h $(srcdir)/interfaces.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/match_addr.c
match_addr.o: match_addr.lo
-net_ifs.o: $(top_srcdir)/src/net_ifs.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_conf.h \
+net_ifs.o: $(top_srcdir)/src/net_ifs.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(top_srcdir)/src/net_ifs.c
-pam.lo: $(authdir)/pam.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+pam.lo: $(authdir)/pam.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/pam.c
parse.lo: $(srcdir)/parse.c $(devdir)/def_data.h $(devdir)/gram.h \
- $(incdir)/alloc.h $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_lbuf.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/parse.c
-passwd.lo: $(authdir)/passwd.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+passwd.lo: $(authdir)/passwd.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/passwd.c
-policy.lo: $(srcdir)/policy.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+policy.lo: $(srcdir)/policy.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_version.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/policy.c
-prompt.lo: $(srcdir)/prompt.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+prompt.lo: $(srcdir)/prompt.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/prompt.c
-pwutil.lo: $(srcdir)/pwutil.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+pwutil.lo: $(srcdir)/pwutil.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/pwutil.h $(srcdir)/redblack.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/pwutil.c
pwutil.o: pwutil.lo
-pwutil_impl.lo: $(srcdir)/pwutil_impl.c $(devdir)/def_data.h $(incdir)/alloc.h \
+pwutil_impl.lo: $(srcdir)/pwutil_impl.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h \
$(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
- $(srcdir)/pwutil.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
+ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/pwutil.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/pwutil_impl.c
pwutil_impl.o: pwutil_impl.lo
-redblack.lo: $(srcdir)/redblack.c $(incdir)/alloc.h $(incdir)/missing.h \
+redblack.lo: $(srcdir)/redblack.c $(incdir)/missing.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_debug.h $(srcdir)/redblack.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/redblack.c
redblack.o: redblack.lo
-rfc1938.lo: $(authdir)/rfc1938.c $(devdir)/def_data.h $(incdir)/alloc.h \
+rfc1938.lo: $(authdir)/rfc1938.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
- $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/rfc1938.c
-secureware.lo: $(authdir)/secureware.c $(devdir)/def_data.h $(incdir)/alloc.h \
+secureware.lo: $(authdir)/secureware.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h \
$(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
- $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
+ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
+ $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/secureware.c
-securid5.lo: $(authdir)/securid5.c $(devdir)/def_data.h $(incdir)/alloc.h \
+securid5.lo: $(authdir)/securid5.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/securid5.c
-set_perms.lo: $(srcdir)/set_perms.c $(devdir)/def_data.h $(incdir)/alloc.h \
+set_perms.lo: $(srcdir)/set_perms.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(top_builddir)/config.h \
- $(top_builddir)/pathnames.h
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/set_perms.c
-sia.lo: $(authdir)/sia.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+sia.lo: $(authdir)/sia.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/sia.c
-sssd.lo: $(srcdir)/sssd.c $(devdir)/def_data.h $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
+sssd.lo: $(srcdir)/sssd.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_dso.h $(incdir)/sudo_lbuf.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sssd.c
-sudo_auth.lo: $(authdir)/sudo_auth.c $(devdir)/def_data.h $(incdir)/alloc.h \
+sudo_auth.lo: $(authdir)/sudo_auth.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/defaults.h $(srcdir)/ins_2001.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/ins_2001.h \
$(srcdir)/ins_classic.h $(srcdir)/ins_csops.h \
$(srcdir)/ins_goons.h $(srcdir)/insults.h $(srcdir)/logging.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/sudo_auth.c
-sudo_nss.lo: $(srcdir)/sudo_nss.c $(devdir)/def_data.h $(incdir)/alloc.h \
+sudo_nss.lo: $(srcdir)/sudo_nss.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_lbuf.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
- $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_lbuf.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
+ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
+ $(srcdir)/sudoers.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_nss.c
-sudoers.lo: $(srcdir)/sudoers.c $(devdir)/def_data.h $(incdir)/alloc.h \
+sudoers.lo: $(srcdir)/sudoers.c $(devdir)/def_data.h \
$(incdir)/compat/getaddrinfo.h $(incdir)/compat/stdbool.h \
$(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/secure_path.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/auth/sudo_auth.h $(srcdir)/defaults.h \
- $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+ $(incdir)/queue.h $(incdir)/secure_path.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/auth/sudo_auth.h \
+ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
+ $(srcdir)/sudoers.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudoers.c
-sudoreplay.o: $(srcdir)/sudoreplay.c $(incdir)/alloc.h \
- $(incdir)/compat/getopt.h $(incdir)/compat/stdbool.h \
- $(incdir)/compat/timespec.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_event.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/iolog.h $(srcdir)/logging.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+sudoreplay.o: $(srcdir)/sudoreplay.c $(incdir)/compat/getopt.h \
+ $(incdir)/compat/stdbool.h $(incdir)/compat/timespec.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_event.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/iolog.h \
+ $(srcdir)/logging.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudoreplay.c
testsudoers.o: $(srcdir)/testsudoers.c $(devdir)/def_data.h $(devdir)/gram.h \
- $(incdir)/alloc.h $(incdir)/compat/fnmatch.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/secure_path.h $(incdir)/sudo_conf.h \
+ $(incdir)/compat/fnmatch.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/secure_path.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/parse.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/tsgetgrpw.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/testsudoers.c
-timestamp.lo: $(srcdir)/timestamp.c $(devdir)/def_data.h $(incdir)/alloc.h \
+timestamp.lo: $(srcdir)/timestamp.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/compat/timespec.h \
$(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/secure_path.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/check.h \
- $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(top_builddir)/config.h \
- $(top_builddir)/pathnames.h
+ $(incdir)/queue.h $(incdir)/secure_path.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/check.h $(srcdir)/defaults.h \
+ $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/timestamp.c
timestr.lo: $(srcdir)/timestr.c $(incdir)/missing.h $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/timestr.c
toke.lo: $(devdir)/toke.c $(devdir)/def_data.h $(devdir)/gram.h \
- $(incdir)/alloc.h $(incdir)/compat/sha2.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/secure_path.h $(incdir)/sudo_debug.h \
+ $(incdir)/compat/sha2.h $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/secure_path.h $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_lbuf.h $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/toke.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(devdir)/toke.c
toke_util.lo: $(srcdir)/toke_util.c $(devdir)/def_data.h $(devdir)/gram.h \
- $(incdir)/alloc.h $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/toke_util.c
toke_util.o: toke_util.lo
-tsgetgrpw.o: $(srcdir)/tsgetgrpw.c $(devdir)/def_data.h $(incdir)/alloc.h \
+tsgetgrpw.o: $(srcdir)/tsgetgrpw.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
- $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
- $(srcdir)/sudoers.h $(srcdir)/tsgetgrpw.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/tsgetgrpw.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/tsgetgrpw.c
visudo.o: $(srcdir)/visudo.c $(devdir)/def_data.h $(devdir)/gram.h \
- $(incdir)/alloc.h $(incdir)/compat/getopt.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_conf.h \
+ $(incdir)/compat/getopt.h $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
$(srcdir)/redblack.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/visudo.c
visudo_json.o: $(srcdir)/visudo_json.c $(devdir)/def_data.h $(devdir)/gram.h \
- $(incdir)/alloc.h $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
$(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
- $(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_debug.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
+ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
+ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/visudo_json.c
struct alias *a;
debug_decl(alias_add, SUDO_DEBUG_ALIAS)
- a = ecalloc(1, sizeof(*a));
+ a = sudo_ecalloc(1, sizeof(*a));
a->name = name;
a->type = type;
/* a->used = false; */
len = strlen(prompt) - 1;
while (isspace(prompt[len]) || prompt[len] == ':')
prompt[len--] = '\0';
- easprintf(&s, "%s [echo on]: ", prompt);
+ sudo_easprintf(&s, "%s [echo on]: ", prompt);
pass = auth_getpass(prompt, def_passwd_timeout * 60,
SUDO_CONV_PROMPT_ECHO_ON);
free(s);
krb5_get_init_creds_opt_alloc(krb5_context context,
krb5_get_init_creds_opt **opts)
{
- *opts = emalloc(sizeof(krb5_get_init_creds_opt));
+ *opts = sudo_emalloc(sizeof(krb5_get_init_creds_opt));
krb5_get_init_creds_opt_init(*opts);
return 0;
}
/* Only rewrite prompt if user didn't specify their own. */
/*if (!strcmp(prompt, PASSPROMPT)) { */
- easprintf(&krb5_prompt, "Password for %s: ", pname);
+ sudo_easprintf(&krb5_prompt, "Password for %s: ", pname);
/*}*/
free(pname);
}
auth->data = (void *) &sudo_krb5_data; /* Stash all our data here */
if (sudo_krb5_instance != NULL) {
- easprintf(&pname, "%s%s%s", pw->pw_name,
+ sudo_easprintf(&pname, "%s%s%s", pw->pw_name,
sudo_krb5_instance[0] != '/' ? "/" : "", sudo_krb5_instance);
}
goto done;
#endif
}
- pr->resp = estrdup(pass);
+ pr->resp = sudo_estrdup(pass);
memset_s(pass, SUDO_CONV_REPL_MAX, 0, strlen(pass));
break;
case PAM_TEXT_INFO:
/* Get space for new prompt with embedded challenge */
if (np_size < op_len + strlen(challenge) + 7) {
np_size = op_len + strlen(challenge) + 7;
- new_prompt = (char *) erealloc(new_prompt, np_size);
+ new_prompt = (char *) sudo_erealloc(new_prompt, np_size);
}
if (def_long_otp_prompt)
/* Rebuild argv for sia_ses_init() */
sudo_argc = NewArgc + 1;
- sudo_argv = emallocarray(sudo_argc + 1, sizeof(char *));
+ sudo_argv = sudo_emallocarray(sudo_argc + 1, sizeof(char *));
sudo_argv[0] = "sudo";
for (i = 0; i < NewArgc; i++)
sudo_argv[i + 1] = NewArgv[i];
#ifdef UMASK_OVERRIDE
def_umask_override = true;
#endif
- def_iolog_file = estrdup("%{seq}");
- def_iolog_dir = estrdup(_PATH_SUDO_IO_LOGDIR);
- def_sudoers_locale = estrdup("C");
+ def_iolog_file = sudo_estrdup("%{seq}");
+ def_iolog_dir = sudo_estrdup(_PATH_SUDO_IO_LOGDIR);
+ def_sudoers_locale = sudo_estrdup("C");
def_env_reset = ENV_RESET;
def_set_logname = true;
def_closefrom = STDERR_FILENO + 1;
- def_pam_service = estrdup("sudo");
+ def_pam_service = sudo_estrdup("sudo");
#ifdef HAVE_PAM_LOGIN
- def_pam_login_service = estrdup("sudo-i");
+ def_pam_login_service = sudo_estrdup("sudo-i");
#else
- def_pam_login_service = estrdup("sudo");
+ def_pam_login_service = sudo_estrdup("sudo");
#endif
#ifdef NO_PAM_SESSION
def_pam_session = false;
#endif
/* Now do the strings */
- def_mailto = estrdup(MAILTO);
- def_mailsub = estrdup(N_(MAILSUBJECT));
- def_badpass_message = estrdup(_(INCORRECT_PASSWORD));
- def_lecture_status_dir = estrdup(_PATH_SUDO_LECTURE_DIR);
- def_timestampdir = estrdup(_PATH_SUDO_TIMEDIR);
- def_passprompt = estrdup(_(PASSPROMPT));
- def_runas_default = estrdup(RUNAS_DEFAULT);
+ def_mailto = sudo_estrdup(MAILTO);
+ def_mailsub = sudo_estrdup(N_(MAILSUBJECT));
+ def_badpass_message = sudo_estrdup(_(INCORRECT_PASSWORD));
+ def_lecture_status_dir = sudo_estrdup(_PATH_SUDO_LECTURE_DIR);
+ def_timestampdir = sudo_estrdup(_PATH_SUDO_TIMEDIR);
+ def_passprompt = sudo_estrdup(_(PASSPROMPT));
+ def_runas_default = sudo_estrdup(RUNAS_DEFAULT);
#ifdef _PATH_SUDO_SENDMAIL
- def_mailerpath = estrdup(_PATH_SUDO_SENDMAIL);
- def_mailerflags = estrdup("-t");
+ def_mailerpath = sudo_estrdup(_PATH_SUDO_SENDMAIL);
+ def_mailerflags = sudo_estrdup("-t");
#endif
#if (LOGGING & SLOG_FILE)
- def_logfile = estrdup(_PATH_SUDO_LOGFILE);
+ def_logfile = sudo_estrdup(_PATH_SUDO_LOGFILE);
#endif
#ifdef EXEMPTGROUP
- def_exempt_group = estrdup(EXEMPTGROUP);
+ def_exempt_group = sudo_estrdup(EXEMPTGROUP);
#endif
#ifdef SECURE_PATH
- def_secure_path = estrdup(SECURE_PATH);
+ def_secure_path = sudo_estrdup(SECURE_PATH);
#endif
- def_editor = estrdup(EDITOR);
+ def_editor = sudo_estrdup(EDITOR);
def_set_utmp = true;
def_pam_setcred = true;
if (op == false)
def->sd_un.str = NULL;
else
- def->sd_un.str = estrdup(val);
+ def->sd_un.str = sudo_estrdup(val);
if (def->callback)
debug_return_bool(def->callback(val));
debug_return_bool(true);
/* Add new node to the head of the list. */
if (op == add) {
- cur = ecalloc(1, sizeof(struct list_member));
- cur->value = estrndup(val, len);
+ cur = sudo_ecalloc(1, sizeof(struct list_member));
+ cur->value = sudo_estrndup(val, len);
SLIST_INSERT_HEAD(&def->sd_un.list, cur, entries);
}
debug_return;
env.env_len = len;
env.env_size = len + 1 + 128;
- env.envp = emallocarray(env.env_size, sizeof(char *));
+ env.envp = sudo_emallocarray(env.env_size, sizeof(char *));
#ifdef ENV_DEBUG
memset(env.envp, 0, env.env_size * sizeof(char *));
#endif
debug_decl(sudo_setenv2, SUDO_DEBUG_ENV)
esize = strlen(var) + 1 + strlen(val) + 1;
- estring = emalloc(esize);
+ estring = sudo_emalloc(esize);
/* Build environment string and insert it. */
if (strlcpy(estring, var, esize) >= esize ||
env.env_len = 0;
env.env_size = 128;
old_envp = env.envp;
- env.envp = emallocarray(env.env_size, sizeof(char *));
+ env.envp = sudo_emallocarray(env.env_size, sizeof(char *));
#ifdef ENV_DEBUG
memset(env.envp, 0, env.env_size * sizeof(char *));
#else
if (ISSET(sudo_mode, MODE_LOGIN_SHELL) || !ISSET(didvar, KEPT_MAIL)) {
cp = _PATH_MAILDIR;
if (cp[sizeof(_PATH_MAILDIR) - 2] == '/')
- easprintf(&cp, "MAIL=%s%s", _PATH_MAILDIR, runas_pw->pw_name);
+ sudo_easprintf(&cp, "MAIL=%s%s", _PATH_MAILDIR, runas_pw->pw_name);
else
- easprintf(&cp, "MAIL=%s/%s", _PATH_MAILDIR, runas_pw->pw_name);
+ sudo_easprintf(&cp, "MAIL=%s/%s", _PATH_MAILDIR, runas_pw->pw_name);
if (sudo_putenv(cp, ISSET(didvar, DID_MAIL), true) == -1) {
free(cp);
goto bad;
/* Add the SUDO_COMMAND envariable (cmnd + args). */
if (user_args) {
- easprintf(&cp, "SUDO_COMMAND=%s %s", user_cmnd, user_args);
+ sudo_easprintf(&cp, "SUDO_COMMAND=%s %s", user_cmnd, user_args);
if (sudo_putenv(cp, true, true) == -1) {
efree(cp);
goto bad;
do {
bsize += 1024;
} while (blen + len >= bsize);
- bad = erealloc(bad, bsize);
+ bad = sudo_erealloc(bad, bsize);
bad[blen] = '\0';
}
strlcat(bad, *ep, bsize);
val_len -= 2;
}
- cp = emalloc(var_len + 1 + val_len + 1);
+ cp = sudo_emalloc(var_len + 1 + val_len + 1);
memcpy(cp, var, var_len + 1); /* includes '=' */
memcpy(cp + var_len + 1, val, val_len + 1); /* includes NUL */
/* Fill in the "env_delete" list. */
for (p = initial_badenv_table; *p; p++) {
- cur = ecalloc(1, sizeof(struct list_member));
- cur->value = estrdup(*p);
+ cur = sudo_ecalloc(1, sizeof(struct list_member));
+ cur->value = sudo_estrdup(*p);
SLIST_INSERT_HEAD(&def_env_delete, cur, entries);
}
/* Fill in the "env_check" list. */
for (p = initial_checkenv_table; *p; p++) {
- cur = ecalloc(1, sizeof(struct list_member));
- cur->value = estrdup(*p);
+ cur = sudo_ecalloc(1, sizeof(struct list_member));
+ cur->value = sudo_estrdup(*p);
SLIST_INSERT_HEAD(&def_env_check, cur, entries);
}
/* Fill in the "env_keep" list. */
for (p = initial_keepenv_table; *p; p++) {
- cur = ecalloc(1, sizeof(struct list_member));
- cur->value = estrdup(*p);
+ cur = sudo_ecalloc(1, sizeof(struct list_member));
+ cur->value = sudo_estrdup(*p);
SLIST_INSERT_HEAD(&def_env_keep, cur, entries);
}
}
if (path == NULL)
debug_return_int(NOT_FOUND);
- path = estrdup(path);
+ path = sudo_estrdup(path);
origpath = path;
do {
done:
#endif
/* If no shadow password, fall back on regular password. */
- debug_return_str(estrdup(epw ? epw : pw->pw_passwd));
+ debug_return_str(sudo_estrdup(epw ? epw : pw->pw_passwd));
}
void
/* Save the line the first error occurred on. */
if (errorlineno == -1) {
errorlineno = sudolineno;
- errorfile = estrdup(sudoers);
+ errorfile = sudo_estrdup(sudoers);
}
if (sudoers_warnings && s != NULL) {
LEXTRACE("<*> ");
struct defaults *d;
debug_decl(new_default, SUDO_DEBUG_PARSER)
- d = ecalloc(1, sizeof(struct defaults));
+ d = sudo_ecalloc(1, sizeof(struct defaults));
d->var = var;
d->val = val;
/* d->type = 0; */
struct member *m;
debug_decl(new_member, SUDO_DEBUG_PARSER)
- m = ecalloc(1, sizeof(struct member));
+ m = sudo_ecalloc(1, sizeof(struct member));
m->name = name;
m->type = type;
HLTQ_INIT(m, entries);
struct sudo_digest *dig;
debug_decl(new_digest, SUDO_DEBUG_PARSER)
- dig = emalloc(sizeof(*dig));
+ dig = sudo_emalloc(sizeof(*dig));
dig->digest_type = digest_type;
- dig->digest_str = estrdup(digest_str);
+ dig->digest_str = sudo_estrdup(digest_str);
debug_return_ptr(dig);
}
/*
* We use a single binding for each entry in defs.
*/
- binding = emalloc(sizeof(*binding));
+ binding = sudo_emalloc(sizeof(*binding));
if (bmem != NULL)
HLTQ_TO_TAILQ(binding, bmem, entries);
else
struct userspec *u;
debug_decl(add_userspec, SUDO_DEBUG_PARSER)
- u = ecalloc(1, sizeof(*u));
+ u = sudo_ecalloc(1, sizeof(*u));
HLTQ_TO_TAILQ(&u->users, members, entries);
HLTQ_TO_TAILQ(&u->privileges, privs, entries);
TAILQ_INSERT_TAIL(&userspecs, u, entries);
init_lexer();
efree(sudoers);
- sudoers = path ? estrdup(path) : NULL;
+ sudoers = path ? sudo_estrdup(path) : NULL;
parse_error = false;
errorlineno = -1;
case 26:
#line 246 "gram.y"
{
- struct privilege *p = ecalloc(1, sizeof(*p));
+ struct privilege *p = sudo_ecalloc(1, sizeof(*p));
HLTQ_TO_TAILQ(&p->hostlist, yyvsp[-2].member, entries);
HLTQ_TO_TAILQ(&p->cmndlist, yyvsp[0].cmndspec, entries);
HLTQ_INIT(p, entries);
case 36:
#line 324 "gram.y"
{
- struct cmndspec *cs = ecalloc(1, sizeof(*cs));
+ struct cmndspec *cs = sudo_ecalloc(1, sizeof(*cs));
if (yyvsp[-4].runas != NULL) {
if (yyvsp[-4].runas->runasusers != NULL) {
cs->runasuserlist =
- emalloc(sizeof(*cs->runasuserlist));
+ sudo_emalloc(sizeof(*cs->runasuserlist));
HLTQ_TO_TAILQ(cs->runasuserlist,
yyvsp[-4].runas->runasusers, entries);
}
if (yyvsp[-4].runas->runasgroups != NULL) {
cs->runasgrouplist =
- emalloc(sizeof(*cs->runasgrouplist));
+ sudo_emalloc(sizeof(*cs->runasgrouplist));
HLTQ_TO_TAILQ(cs->runasgrouplist,
yyvsp[-4].runas->runasgroups, entries);
}
case 61:
#line 466 "gram.y"
{
- yyval.runas = ecalloc(1, sizeof(struct runascontainer));
+ yyval.runas = sudo_ecalloc(1, sizeof(struct runascontainer));
yyval.runas->runasusers = new_member(NULL, MYSELF);
/* $$->runasgroups = NULL; */
}
case 62:
#line 471 "gram.y"
{
- yyval.runas = ecalloc(1, sizeof(struct runascontainer));
+ yyval.runas = sudo_ecalloc(1, sizeof(struct runascontainer));
yyval.runas->runasusers = yyvsp[0].member;
/* $$->runasgroups = NULL; */
}
case 63:
#line 476 "gram.y"
{
- yyval.runas = ecalloc(1, sizeof(struct runascontainer));
+ yyval.runas = sudo_ecalloc(1, sizeof(struct runascontainer));
yyval.runas->runasusers = yyvsp[-2].member;
yyval.runas->runasgroups = yyvsp[0].member;
}
case 64:
#line 481 "gram.y"
{
- yyval.runas = ecalloc(1, sizeof(struct runascontainer));
+ yyval.runas = sudo_ecalloc(1, sizeof(struct runascontainer));
/* $$->runasusers = NULL; */
yyval.runas->runasgroups = yyvsp[0].member;
}
case 65:
#line 486 "gram.y"
{
- yyval.runas = ecalloc(1, sizeof(struct runascontainer));
+ yyval.runas = sudo_ecalloc(1, sizeof(struct runascontainer));
yyval.runas->runasusers = new_member(NULL, MYSELF);
/* $$->runasgroups = NULL; */
}
case 79:
#line 535 "gram.y"
{
- struct sudo_command *c = ecalloc(1, sizeof(*c));
+ struct sudo_command *c = sudo_ecalloc(1, sizeof(*c));
c->cmnd = yyvsp[0].command.cmnd;
c->args = yyvsp[0].command.args;
yyval.member = new_member((char *)c, COMMAND);
;
privilege : hostlist '=' cmndspeclist {
- struct privilege *p = ecalloc(1, sizeof(*p));
+ struct privilege *p = sudo_ecalloc(1, sizeof(*p));
HLTQ_TO_TAILQ(&p->hostlist, $1, entries);
HLTQ_TO_TAILQ(&p->cmndlist, $3, entries);
HLTQ_INIT(p, entries);
;
cmndspec : runasspec selinux solarisprivs cmndtag digcmnd {
- struct cmndspec *cs = ecalloc(1, sizeof(*cs));
+ struct cmndspec *cs = sudo_ecalloc(1, sizeof(*cs));
if ($1 != NULL) {
if ($1->runasusers != NULL) {
cs->runasuserlist =
- emalloc(sizeof(*cs->runasuserlist));
+ sudo_emalloc(sizeof(*cs->runasuserlist));
HLTQ_TO_TAILQ(cs->runasuserlist,
$1->runasusers, entries);
}
if ($1->runasgroups != NULL) {
cs->runasgrouplist =
- emalloc(sizeof(*cs->runasgrouplist));
+ sudo_emalloc(sizeof(*cs->runasgrouplist));
HLTQ_TO_TAILQ(cs->runasgrouplist,
$1->runasgroups, entries);
}
;
runaslist : /* empty */ {
- $$ = ecalloc(1, sizeof(struct runascontainer));
+ $$ = sudo_ecalloc(1, sizeof(struct runascontainer));
$$->runasusers = new_member(NULL, MYSELF);
/* $$->runasgroups = NULL; */
}
| userlist {
- $$ = ecalloc(1, sizeof(struct runascontainer));
+ $$ = sudo_ecalloc(1, sizeof(struct runascontainer));
$$->runasusers = $1;
/* $$->runasgroups = NULL; */
}
| userlist ':' grouplist {
- $$ = ecalloc(1, sizeof(struct runascontainer));
+ $$ = sudo_ecalloc(1, sizeof(struct runascontainer));
$$->runasusers = $1;
$$->runasgroups = $3;
}
| ':' grouplist {
- $$ = ecalloc(1, sizeof(struct runascontainer));
+ $$ = sudo_ecalloc(1, sizeof(struct runascontainer));
/* $$->runasusers = NULL; */
$$->runasgroups = $2;
}
| ':' {
- $$ = ecalloc(1, sizeof(struct runascontainer));
+ $$ = sudo_ecalloc(1, sizeof(struct runascontainer));
$$->runasusers = new_member(NULL, MYSELF);
/* $$->runasgroups = NULL; */
}
$$ = new_member($1, ALIAS);
}
| COMMAND {
- struct sudo_command *c = ecalloc(1, sizeof(*c));
+ struct sudo_command *c = sudo_ecalloc(1, sizeof(*c));
c->cmnd = $1.cmnd;
c->args = $1.args;
$$ = new_member((char *)c, COMMAND);
/* Save the line the first error occurred on. */
if (errorlineno == -1) {
errorlineno = sudolineno;
- errorfile = estrdup(sudoers);
+ errorfile = sudo_estrdup(sudoers);
}
if (sudoers_warnings && s != NULL) {
LEXTRACE("<*> ");
struct defaults *d;
debug_decl(new_default, SUDO_DEBUG_PARSER)
- d = ecalloc(1, sizeof(struct defaults));
+ d = sudo_ecalloc(1, sizeof(struct defaults));
d->var = var;
d->val = val;
/* d->type = 0; */
struct member *m;
debug_decl(new_member, SUDO_DEBUG_PARSER)
- m = ecalloc(1, sizeof(struct member));
+ m = sudo_ecalloc(1, sizeof(struct member));
m->name = name;
m->type = type;
HLTQ_INIT(m, entries);
struct sudo_digest *dig;
debug_decl(new_digest, SUDO_DEBUG_PARSER)
- dig = emalloc(sizeof(*dig));
+ dig = sudo_emalloc(sizeof(*dig));
dig->digest_type = digest_type;
- dig->digest_str = estrdup(digest_str);
+ dig->digest_str = sudo_estrdup(digest_str);
debug_return_ptr(dig);
}
/*
* We use a single binding for each entry in defs.
*/
- binding = emalloc(sizeof(*binding));
+ binding = sudo_emalloc(sizeof(*binding));
if (bmem != NULL)
HLTQ_TO_TAILQ(binding, bmem, entries);
else
struct userspec *u;
debug_decl(add_userspec, SUDO_DEBUG_PARSER)
- u = ecalloc(1, sizeof(*u));
+ u = sudo_ecalloc(1, sizeof(*u));
HLTQ_TO_TAILQ(&u->users, members, entries);
HLTQ_TO_TAILQ(&u->privileges, privs, entries);
TAILQ_INSERT_TAIL(&userspecs, u, entries);
init_lexer();
efree(sudoers);
- sudoers = path ? estrdup(path) : NULL;
+ sudoers = path ? sudo_estrdup(path) : NULL;
parse_error = false;
errorlineno = -1;
}
}
if (ac != 0) {
- argv = emallocarray(ac, sizeof(char *));
+ argv = sudo_emallocarray(ac, sizeof(char *));
ac = 0;
for ((cp = strtok(args, " \t")); cp; (cp = strtok(NULL, " \t")))
argv[ac++] = cp;
struct interface *ifp;
debug_decl(set_interfaces, SUDO_DEBUG_NETIF)
- addrinfo = estrdup(ai);
+ addrinfo = sudo_estrdup(ai);
for (addr = strtok(addrinfo, " \t"); addr != NULL; addr = strtok(NULL, " \t")) {
/* Separate addr and mask. */
if ((mask = strchr(addr, '/')) == NULL)
*mask++ = '\0';
/* Parse addr and store in list. */
- ifp = ecalloc(1, sizeof(*ifp));
+ ifp = sudo_ecalloc(1, sizeof(*ifp));
if (strchr(addr, ':')) {
/* IPv6 */
#ifdef HAVE_STRUCT_IN6_ADDR
char *cp, *addrinfo;
debug_decl(set_interfaces, SUDO_DEBUG_NETIF)
- addrinfo = estrdup(ai);
+ addrinfo = sudo_estrdup(ai);
sudo_printf(SUDO_CONV_INFO_MSG, _("Local IP address and netmask pairs:\n"));
for (cp = strtok(addrinfo, " \t"); cp != NULL; cp = strtok(NULL, " \t"))
/* If no I/O log path defined we need to figure it out ourselves. */
if (details.iolog_path == NULL) {
/* Get next session ID and convert it into a path. */
- tofree = emalloc(sizeof(_PATH_SUDO_IO_LOGDIR) + sizeof(sessid) + 2);
+ tofree = sudo_emalloc(sizeof(_PATH_SUDO_IO_LOGDIR) + sizeof(sessid) + 2);
memcpy(tofree, _PATH_SUDO_IO_LOGDIR, sizeof(_PATH_SUDO_IO_LOGDIR));
if (!io_nextid(tofree, NULL, sessid)) {
rval = false;
/* Expanded path must be <= PATH_MAX */
if (prefix != NULL)
prelen = strlen(prefix);
- dst = path = emalloc(prelen + PATH_MAX);
+ dst = path = sudo_emalloc(prelen + PATH_MAX);
*path = '\0';
pathend = path + prelen + PATH_MAX;
}
efree(ldap_conf.host);
- ldap_conf.host = estrdup(hostbuf);
+ ldap_conf.host = sudo_estrdup(hostbuf);
debug_return_bool(true);
toobig:
hostbuf[0] = '\0';
STAILQ_FOREACH(entry, uri_list, entries) {
- buf = estrdup(entry->val);
+ buf = sudo_estrdup(entry->val);
for ((uri = strtok(buf, " \t")); uri != NULL; (uri = strtok(NULL, " \t"))) {
if (strncasecmp(uri, "ldap://", 7) == 0) {
nldap++;
/* Store parsed URI(s) in host for ldap_create() or ldap_init(). */
efree(ldap_conf.host);
- ldap_conf.host = estrdup(hostbuf);
+ ldap_conf.host = sudo_estrdup(hostbuf);
rc = LDAP_SUCCESS;
}
len += strlen(uri->val) + 1;
}
- buf = cp = emalloc(len);
+ buf = cp = sudo_emalloc(len);
buf[0] = '\0';
STAILQ_FOREACH(uri, uri_list, entries) {
cp += strlcpy(cp, uri->val, len - (cp - buf));
ep++;
if (*ep != '\0') {
digest->digest_type = digest_type;
- digest->digest_str = estrndup(cp, (size_t)(ep - cp));
+ digest->digest_str = sudo_estrndup(cp, (size_t)(ep - cp));
cp = ep + 1;
while (isblank((unsigned char)*cp))
cp++;
/* check for !command */
if (*val == '!') {
foundbang = true;
- allowed_cmnd = estrdup(1 + val); /* !command */
+ allowed_cmnd = sudo_estrdup(1 + val); /* !command */
} else {
foundbang = false;
- allowed_cmnd = estrdup(val); /* command */
+ allowed_cmnd = sudo_estrdup(val); /* command */
}
/* split optional args away from command */
/* walk through options */
for (p = bv; *p != NULL; p++) {
- var = estrdup((*p)->bv_val);
+ var = sudo_estrdup((*p)->bv_val);
DPRINTF2("ldap sudoOption: '%s'", var);
/* check for equals sign past first char */
debug_decl(sudo_ldap_build_default_filter, SUDO_DEBUG_LDAP)
if (ldap_conf.search_filter)
- easprintf(&filt, "(&%s(cn=defaults))", ldap_conf.search_filter);
+ sudo_easprintf(&filt, "(&%s(cn=defaults))", ldap_conf.search_filter);
else
- filt = estrdup("cn=defaults");
+ filt = sudo_estrdup("cn=defaults");
debug_return_str(filt);
}
/* If timed, add space for time limits. */
if (ldap_conf.timed)
sz += TIMEFILTER_LENGTH;
- buf = emalloc(sz);
+ buf = sudo_emalloc(sz);
*buf = '\0';
/*
* those get ANDed in to the expression.
*/
if (def_group_plugin) {
- easprintf(&filt, "%s%s(|(sudoUser=%s*)(sudoUser=%%:*))%s%s",
+ sudo_easprintf(&filt, "%s%s(|(sudoUser=%s*)(sudoUser=%%:*))%s%s",
(ldap_conf.timed || ldap_conf.search_filter) ? "(&" : "",
ldap_conf.search_filter ? ldap_conf.search_filter : "",
def_use_netgroups ? "+" : "",
ldap_conf.timed ? timebuffer : "",
(ldap_conf.timed || ldap_conf.search_filter) ? ")" : "");
} else {
- easprintf(&filt, "%s%s(sudoUser=*)(sudoUser=+*)%s%s",
+ sudo_easprintf(&filt, "%s%s(sudoUser=*)(sudoUser=+*)%s%s",
(ldap_conf.timed || ldap_conf.search_filter) ? "(&" : "",
ldap_conf.search_filter ? ldap_conf.search_filter : "",
ldap_conf.timed ? timebuffer : "",
*cp = '\0';
/* copy to bindpw and binddn */
efree(ldap_conf.bindpw);
- ldap_conf.bindpw = estrdup(buf);
+ ldap_conf.bindpw = sudo_estrdup(buf);
efree(ldap_conf.binddn);
ldap_conf.binddn = ldap_conf.rootbinddn;
ldap_conf.rootbinddn = NULL;
break;
case CONF_STR:
efree(*(char **)(cur->valp));
- *(char **)(cur->valp) = *value ? estrdup(value) : NULL;
+ *(char **)(cur->valp) = *value ? sudo_estrdup(value) : NULL;
break;
case CONF_LIST_STR:
{
if (len > 0) {
head = (struct ldap_config_str_list *)cur->valp;
- str = emalloc(sizeof(*str) + len);
+ str = sudo_emalloc(sizeof(*str) + len);
memcpy(str->val, value, len + 1);
STAILQ_INSERT_TAIL(head, str, entries);
}
ldap_conf.use_sasl = -1;
ldap_conf.rootuse_sasl = -1;
ldap_conf.deref = -1;
- ldap_conf.search_filter = estrdup(DEFAULT_SEARCH_FILTER);
+ ldap_conf.search_filter = sudo_estrdup(DEFAULT_SEARCH_FILTER);
STAILQ_INIT(&ldap_conf.uri);
STAILQ_INIT(&ldap_conf.base);
fclose(fp);
if (!ldap_conf.host)
- ldap_conf.host = estrdup("localhost");
+ ldap_conf.host = sudo_estrdup("localhost");
DPRINTF1("LDAP Config Summary");
DPRINTF1("===================");
if (ldap_conf.search_filter && ldap_conf.search_filter[0] != '(') {
size_t len = strlen(ldap_conf.search_filter);
cp = ldap_conf.search_filter;
- ldap_conf.search_filter = emalloc(len + 3);
+ ldap_conf.search_filter = sudo_emalloc(len + 3);
ldap_conf.search_filter[0] = '(';
memcpy(ldap_conf.search_filter + 1, cp, len);
ldap_conf.search_filter[len + 1] = ')';
struct ldap_result *result;
debug_decl(sudo_ldap_result_alloc, SUDO_DEBUG_LDAP)
- result = ecalloc(1, sizeof(*result));
+ result = sudo_ecalloc(1, sizeof(*result));
STAILQ_INIT(&result->searches);
debug_return_ptr(result);
debug_decl(sudo_ldap_result_add_search, SUDO_DEBUG_LDAP)
/* Create new entry and add it to the end of the chain. */
- news = ecalloc(1, sizeof(*news));
+ news = sudo_ecalloc(1, sizeof(*news));
news->ldap = ldap;
news->searchresult = searchresult;
STAILQ_INSERT_TAIL(&lres->searches, news, entries);
goto done;
/* Create a handle container. */
- handle = ecalloc(1, sizeof(struct sudo_ldap_handle));
+ handle = sudo_ecalloc(1, sizeof(struct sudo_ldap_handle));
handle->ld = ld;
/* handle->result = NULL; */
/* handle->username = NULL; */
*/
if (++lres->nentries > lres->allocated_entries) {
lres->allocated_entries += ALLOCATION_INCREMENT;
- lres->entries = ereallocarray(lres->entries, lres->allocated_entries,
+ lres->entries = sudo_ereallocarray(lres->entries, lres->allocated_entries,
sizeof(lres->entries[0]));
}
/* Store everything in the sudo_nss handle. */
handle->result = lres;
- handle->username = estrdup(pw->pw_name);
+ handle->username = sudo_estrdup(pw->pw_name);
handle->grlist = user_group_list;
debug_return_ptr(lres);
#include "missing.h"
#include "fatal.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "sudo_debug.h"
#include "linux_audit.h"
/* Convert argv to a flat string. */
for (size = 0, av = argv; *av != NULL; av++)
size += strlen(*av) + 1;
- command = cp = emalloc(size);
+ command = cp = sudo_emalloc(size);
for (av = argv; *av != NULL; av++) {
n = strlcpy(cp, *av, size - (cp - command));
if (n >= size - (cp - command)) {
#include "missing.h"
#include "fatal.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "logging.h"
static int current_locale = SUDOERS_LOCALE_USER;
{
if (ulocale != NULL) {
efree(user_locale);
- user_locale = estrdup(ulocale);
+ user_locale = sudo_estrdup(ulocale);
}
if (slocale != NULL) {
efree(sudoers_locale);
- sudoers_locale = estrdup(slocale);
+ sudoers_locale = sudo_estrdup(slocale);
}
}
current_locale = SUDOERS_LOCALE_USER;
res = setlocale(LC_ALL, user_locale ? user_locale : "");
if (res != NULL && user_locale == NULL)
- user_locale = estrdup(setlocale(LC_ALL, NULL));
+ user_locale = sudo_estrdup(setlocale(LC_ALL, NULL));
}
break;
case SUDOERS_LOCALE_SUDOERS:
if (res == NULL && sudoers_locale != NULL) {
if (strcmp(sudoers_locale, "C") != 0) {
efree(sudoers_locale);
- sudoers_locale = estrdup("C");
+ sudoers_locale = sudo_estrdup("C");
res = setlocale(LC_ALL, "C");
}
}
}
} else {
if (def_log_host) {
- len = easprintf(&full_line, "%s : %s : HOST=%s : %s",
+ len = sudo_easprintf(&full_line, "%s : %s : HOST=%s : %s",
timestr, user_name, user_srunhost, msg);
} else {
- len = easprintf(&full_line, "%s : %s : %s",
+ len = sudo_easprintf(&full_line, "%s : %s : %s",
timestr, user_name, msg);
}
/* Expand printf-style format + args (with a special case). */
if (fmt == INCORRECT_PASSWORD_ATTEMPT) {
unsigned int tries = va_arg(ap, unsigned int);
- easprintf(&message, ngettext("%u incorrect password attempt",
+ sudo_easprintf(&message, ngettext("%u incorrect password attempt",
"%u incorrect password attempts", tries), tries);
} else {
- evasprintf(&message, _(fmt), ap);
+ sudo_evasprintf(&message, _(fmt), ap);
}
/* Log to debug file. */
(void) close(pfd[1]);
/* Build up an argv based on the mailer path and flags */
- mflags = estrdup(def_mailerflags);
+ mflags = sudo_estrdup(def_mailerflags);
if ((argv[0] = strrchr(mpath, '/')))
argv[0]++;
else
for (ep = sudo_user.env_vars; *ep != NULL; ep++)
evlen += strlen(*ep) + 1;
- evstr = emalloc(evlen);
+ evstr = sudo_emalloc(evlen);
evstr[0] = '\0';
for (ep = sudo_user.env_vars; *ep != NULL; ep++) {
strlcat(evstr, *ep, evlen);
/*
* Allocate and build up the line.
*/
- line = emalloc(++len);
+ line = sudo_emalloc(++len);
line[0] = '\0';
if (message != NULL) {
strcmp(user_cmnd, "sudoedit") == 0 &&
command_args_match(sudoers_cmnd, sudoers_args)) {
efree(safe_cmnd);
- safe_cmnd = estrdup(sudoers_cmnd);
+ safe_cmnd = sudo_estrdup(sudoers_cmnd);
rc = true;
}
goto done;
if (command_args_match(sudoers_cmnd, sudoers_args)) {
if (safe_cmnd)
free(safe_cmnd);
- safe_cmnd = estrdup(user_cmnd);
+ safe_cmnd = sudo_estrdup(user_cmnd);
debug_return_bool(true);
}
debug_return_bool(false);
(user_stat->st_dev == sudoers_stat.st_dev &&
user_stat->st_ino == sudoers_stat.st_ino)) {
efree(safe_cmnd);
- safe_cmnd = estrdup(cp);
+ safe_cmnd = sudo_estrdup(cp);
break;
}
}
if (command_args_match(sudoers_cmnd, sudoers_args)) {
efree(safe_cmnd);
- safe_cmnd = estrdup(user_cmnd);
+ safe_cmnd = sudo_estrdup(user_cmnd);
debug_return_bool(true);
}
debug_return_bool(false);
if (strcmp(user_cmnd, sudoers_cmnd) == 0) {
if (command_args_match(sudoers_cmnd, sudoers_args)) {
efree(safe_cmnd);
- safe_cmnd = estrdup(sudoers_cmnd);
+ safe_cmnd = sudo_estrdup(sudoers_cmnd);
debug_return_bool(true);
}
}
debug_return_bool(false);
}
efree(safe_cmnd);
- safe_cmnd = estrdup(sudoers_cmnd);
+ safe_cmnd = sudo_estrdup(sudoers_cmnd);
debug_return_bool(true);
}
#endif /* SUDOERS_NAME_MATCH */
(user_stat->st_dev == sudoers_stat.st_dev &&
user_stat->st_ino == sudoers_stat.st_ino)) {
efree(safe_cmnd);
- safe_cmnd = estrdup(buf);
+ safe_cmnd = sudo_estrdup(buf);
break;
}
}
#ifdef HAVE_GETDOMAINNAME
char *buf, *cp;
- buf = emalloc(HOST_NAME_MAX + 1);
+ buf = sudo_emalloc(HOST_NAME_MAX + 1);
if (getdomainname(buf, HOST_NAME_MAX + 1) == 0 && *buf != '\0') {
domain = buf;
for (cp = buf; *cp != '\0'; cp++) {
#ifdef HAVE_SELINUX
/* Set role and type if not specified on command line. */
if (user_role == NULL)
- user_role = cs->role ? estrdup(cs->role) : def_role;
+ user_role = cs->role ? sudo_estrdup(cs->role) : def_role;
if (user_type == NULL)
- user_type = cs->type ? estrdup(cs->type) : def_type;
+ user_type = cs->type ? sudo_estrdup(cs->type) : def_type;
#endif /* HAVE_SELINUX */
#ifdef HAVE_PRIV_SET
/* Set Solaris privilege sets */
if (runas_privs == NULL)
- runas_privs = cs->privs ? estrdup(cs->privs) : def_privs;
+ runas_privs = cs->privs ? sudo_estrdup(cs->privs) : def_privs;
if (runas_limitprivs == NULL)
- runas_limitprivs = cs->limitprivs ? estrdup(cs->limitprivs) : def_limitprivs;
+ runas_limitprivs = cs->limitprivs ? sudo_estrdup(cs->limitprivs) : def_limitprivs;
#endif /* HAVE_PRIV_SET */
/*
* If user is running command as himself,
for (cur = info->user_info; *cur != NULL; cur++) {
if (MATCHES(*cur, "user=")) {
- user_name = estrdup(*cur + sizeof("user=") - 1);
+ user_name = sudo_estrdup(*cur + sizeof("user=") - 1);
continue;
}
if (MATCHES(*cur, "uid=")) {
continue;
}
if (MATCHES(*cur, "cwd=")) {
- user_cwd = estrdup(*cur + sizeof("cwd=") - 1);
+ user_cwd = sudo_estrdup(*cur + sizeof("cwd=") - 1);
continue;
}
if (MATCHES(*cur, "tty=")) {
- user_tty = user_ttypath = estrdup(*cur + sizeof("tty=") - 1);
+ user_tty = user_ttypath = sudo_estrdup(*cur + sizeof("tty=") - 1);
if (strncmp(user_tty, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
user_tty += sizeof(_PATH_DEV) - 1;
continue;
}
if (MATCHES(*cur, "host=")) {
- user_host = user_shost = estrdup(*cur + sizeof("host=") - 1);
+ user_host = user_shost = sudo_estrdup(*cur + sizeof("host=") - 1);
if ((p = strchr(user_host, '.')))
- user_shost = estrndup(user_host, (size_t)(p - user_host));
+ user_shost = sudo_estrndup(user_host, (size_t)(p - user_host));
continue;
}
if (MATCHES(*cur, "lines=")) {
continue;
}
}
- user_runhost = user_srunhost = estrdup(remhost ? remhost : user_host);
+ user_runhost = user_srunhost = sudo_estrdup(remhost ? remhost : user_host);
if ((p = strchr(user_runhost, '.')))
- user_srunhost = estrndup(user_runhost, (size_t)(p - user_runhost));
+ user_srunhost = sudo_estrndup(user_runhost, (size_t)(p - user_runhost));
if (user_cwd == NULL)
- user_cwd = estrdup("unknown");
+ user_cwd = sudo_estrdup("unknown");
if (user_tty == NULL)
- user_tty = estrdup("unknown"); /* user_ttypath remains NULL */
+ user_tty = sudo_estrdup("unknown"); /* user_ttypath remains NULL */
if (groups != NULL && groups[0] != '\0') {
/* sudo_parse_gids() will print a warning on error. */
debug_decl(sudoers_policy_exec_setup, SUDO_DEBUG_PLUGIN)
/* Increase the length of command_info as needed, it is *not* checked. */
- command_info = ecalloc(32, sizeof(char **));
+ command_info = sudo_ecalloc(32, sizeof(char **));
command_info[info_len++] = sudo_new_key_val("command", safe_cmnd);
if (def_log_input || def_log_output) {
if (iolog_path)
command_info[info_len++] = iolog_path;
if (def_log_input) {
- command_info[info_len++] = estrdup("iolog_stdin=true");
- command_info[info_len++] = estrdup("iolog_ttyin=true");
+ command_info[info_len++] = sudo_estrdup("iolog_stdin=true");
+ command_info[info_len++] = sudo_estrdup("iolog_ttyin=true");
}
if (def_log_output) {
- command_info[info_len++] = estrdup("iolog_stdout=true");
- command_info[info_len++] = estrdup("iolog_stderr=true");
- command_info[info_len++] = estrdup("iolog_ttyout=true");
+ command_info[info_len++] = sudo_estrdup("iolog_stdout=true");
+ command_info[info_len++] = sudo_estrdup("iolog_stderr=true");
+ command_info[info_len++] = sudo_estrdup("iolog_ttyout=true");
}
if (def_compress_io) {
- command_info[info_len++] = estrdup("iolog_compress=true");
+ command_info[info_len++] = sudo_estrdup("iolog_compress=true");
}
if (def_maxseq) {
- easprintf(&command_info[info_len++], "maxseq=%u", def_maxseq);
+ sudo_easprintf(&command_info[info_len++], "maxseq=%u", def_maxseq);
}
}
if (ISSET(sudo_mode, MODE_EDIT))
- command_info[info_len++] = estrdup("sudoedit=true");
+ command_info[info_len++] = sudo_estrdup("sudoedit=true");
if (ISSET(sudo_mode, MODE_LOGIN_SHELL)) {
/* Set cwd to run user's homedir. */
command_info[info_len++] = sudo_new_key_val("cwd", runas_pw->pw_dir);
}
if (def_stay_setuid) {
- easprintf(&command_info[info_len++], "runas_uid=%u",
+ sudo_easprintf(&command_info[info_len++], "runas_uid=%u",
(unsigned int)user_uid);
- easprintf(&command_info[info_len++], "runas_gid=%u",
+ sudo_easprintf(&command_info[info_len++], "runas_gid=%u",
(unsigned int)user_gid);
- easprintf(&command_info[info_len++], "runas_euid=%u",
+ sudo_easprintf(&command_info[info_len++], "runas_euid=%u",
(unsigned int)runas_pw->pw_uid);
- easprintf(&command_info[info_len++], "runas_egid=%u",
+ sudo_easprintf(&command_info[info_len++], "runas_egid=%u",
runas_gr ? (unsigned int)runas_gr->gr_gid :
(unsigned int)runas_pw->pw_gid);
} else {
- easprintf(&command_info[info_len++], "runas_uid=%u",
+ sudo_easprintf(&command_info[info_len++], "runas_uid=%u",
(unsigned int)runas_pw->pw_uid);
- easprintf(&command_info[info_len++], "runas_gid=%u",
+ sudo_easprintf(&command_info[info_len++], "runas_gid=%u",
runas_gr ? (unsigned int)runas_gr->gr_gid :
(unsigned int)runas_pw->pw_gid);
}
/* We reserve an extra spot in the list for the effective gid. */
glsize = sizeof("runas_groups=") - 1 +
((grlist->ngids + 1) * (MAX_UID_T_LEN + 1));
- gid_list = emalloc(glsize);
+ gid_list = sudo_emalloc(glsize);
memcpy(gid_list, "runas_groups=", sizeof("runas_groups=") - 1);
cp = gid_list + sizeof("runas_groups=") - 1;
sudo_grlist_delref(grlist);
}
if (def_closefrom >= 0)
- easprintf(&command_info[info_len++], "closefrom=%d", def_closefrom);
+ sudo_easprintf(&command_info[info_len++], "closefrom=%d", def_closefrom);
if (def_noexec)
- command_info[info_len++] = estrdup("noexec=true");
+ command_info[info_len++] = sudo_estrdup("noexec=true");
if (def_exec_background)
- command_info[info_len++] = estrdup("exec_background=true");
+ command_info[info_len++] = sudo_estrdup("exec_background=true");
if (def_set_utmp)
- command_info[info_len++] = estrdup("set_utmp=true");
+ command_info[info_len++] = sudo_estrdup("set_utmp=true");
if (def_use_pty)
- command_info[info_len++] = estrdup("use_pty=true");
+ command_info[info_len++] = sudo_estrdup("use_pty=true");
if (def_utmp_runas)
command_info[info_len++] = sudo_new_key_val("utmp_user", runas_pw->pw_name);
if (cmnd_umask != 0777)
- easprintf(&command_info[info_len++], "umask=0%o", (unsigned int)cmnd_umask);
+ sudo_easprintf(&command_info[info_len++], "umask=0%o", (unsigned int)cmnd_umask);
#ifdef HAVE_LOGIN_CAP_H
if (def_use_loginclass)
command_info[info_len++] = sudo_new_key_val("login_class", login_class);
}
if (subst) {
- new_prompt = emalloc(++len);
+ new_prompt = sudo_emalloc(++len);
endp = new_prompt + len;
for (p = old_prompt, np = new_prompt; *p; p++) {
if (p[0] =='%') {
}
*np = '\0';
} else
- new_prompt = estrdup(old_prompt);
+ new_prompt = sudo_estrdup(old_prompt);
debug_return_str(new_prompt);
#endif
item = sudo_make_pwitem(uid, NULL);
if (item == NULL) {
- item = ecalloc(1, sizeof(*item));
+ item = sudo_ecalloc(1, sizeof(*item));
item->refcnt = 1;
item->k.uid = uid;
/* item->d.pw = NULL; */
item = sudo_make_pwitem((uid_t)-1, name);
if (item == NULL) {
len = strlen(name) + 1;
- item = ecalloc(1, sizeof(*item) + len);
+ item = sudo_ecalloc(1, sizeof(*item) + len);
item->refcnt = 1;
item->k.name = (char *) item + sizeof(*item);
memcpy(item->k.name, name, len);
home_len + 1 /* pw_dir */ + shell_len + 1 /* pw_shell */;
for (i = 0; i < 2; i++) {
- pwitem = ecalloc(1, len);
+ pwitem = sudo_ecalloc(1, len);
pw = &pwitem->pw;
pw->pw_uid = uid;
pw->pw_gid = gid;
*/
item = sudo_make_gritem(gid, NULL);
if (item == NULL) {
- item = ecalloc(1, sizeof(*item));
+ item = sudo_ecalloc(1, sizeof(*item));
item->refcnt = 1;
item->k.gid = gid;
/* item->d.gr = NULL; */
item = sudo_make_gritem((gid_t)-1, name);
if (item == NULL) {
len = strlen(name) + 1;
- item = ecalloc(1, sizeof(*item) + len);
+ item = sudo_ecalloc(1, sizeof(*item) + len);
item->refcnt = 1;
item->k.name = (char *) item + sizeof(*item);
memcpy(item->k.name, name, len);
len = sizeof(*gritem) + name_len + 1;
for (i = 0; i < 2; i++) {
- gritem = ecalloc(1, len);
+ gritem = sudo_ecalloc(1, len);
gr = &gritem->gr;
gr->gr_gid = (gid_t) atoid(group + 1, NULL, NULL, &errstr);
gr->gr_name = (char *)(gritem + 1);
if (item == NULL) {
/* Should not happen. */
len = strlen(pw->pw_name) + 1;
- item = ecalloc(1, sizeof(*item) + len);
+ item = sudo_ecalloc(1, sizeof(*item) + len);
item->refcnt = 1;
item->k.name = (char *) item + sizeof(*item);
memcpy(item->k.name, pw->pw_name, len);
total += strlen(name) + 1;
/* Allocate space for struct item, struct passwd and the strings. */
- pwitem = ecalloc(1, total);
+ pwitem = sudo_ecalloc(1, total);
newpw = &pwitem->pw;
/*
if (name != NULL)
total += strlen(name) + 1;
- gritem = ecalloc(1, total);
+ gritem = sudo_ecalloc(1, total);
/*
* Copy in group contents and make strings relative to space
} else {
if (sudo_user.max_groups > 0) {
ngids = sudo_user.max_groups;
- gids = emallocarray(ngids, sizeof(GETGROUPS_T));
+ gids = sudo_emallocarray(ngids, sizeof(GETGROUPS_T));
(void)getgrouplist(pw->pw_name, pw->pw_gid, gids, &ngids);
} else {
#if defined(HAVE_SYSCONF) && defined(_SC_NGROUPS_MAX)
if (ngids < 0)
#endif
ngids = NGROUPS_MAX * 2;
- gids = emallocarray(ngids, sizeof(GETGROUPS_T));
+ gids = sudo_emallocarray(ngids, sizeof(GETGROUPS_T));
if (getgrouplist(pw->pw_name, pw->pw_gid, gids, &ngids) == -1) {
efree(gids);
- gids = emallocarray(ngids, sizeof(GETGROUPS_T));
+ gids = sudo_emallocarray(ngids, sizeof(GETGROUPS_T));
if (getgrouplist(pw->pw_name, pw->pw_gid, gids, &ngids) == -1)
ngids = -1;
}
total += groupname_len * ngids;
again:
- grlitem = ecalloc(1, total);
+ grlitem = sudo_ecalloc(1, total);
/*
* Copy in group list and make pointers relative to space
#endif /* STDC_HEADERS */
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "sudo_debug.h"
#include "redblack.h"
struct rbtree *tree;
debug_decl(rbcreate, SUDO_DEBUG_RBTREE)
- tree = (struct rbtree *) emalloc(sizeof(*tree));
+ tree = (struct rbtree *) sudo_emalloc(sizeof(*tree));
tree->compar = compar;
/*
node = res < 0 ? node->left : node->right;
}
- node = (struct rbnode *) emalloc(sizeof(*node));
+ node = (struct rbnode *) sudo_emalloc(sizeof(*node));
node->data = data;
node->left = node->right = rbnil(tree);
node->parent = parent;
debug_decl(sudo_sss_attrcpy, SUDO_DEBUG_SSSD)
sudo_debug_printf(SUDO_DEBUG_DEBUG, "dst=%p, src=%p", dst, src);
- sudo_debug_printf(SUDO_DEBUG_INFO, "emalloc: cnt=%d", src->num_values);
+ sudo_debug_printf(SUDO_DEBUG_INFO, "sudo_emalloc: cnt=%d", src->num_values);
- dst->name = estrdup(src->name);
+ dst->name = sudo_estrdup(src->name);
dst->num_values = src->num_values;
- dst->values = emallocarray(dst->num_values, sizeof(char *));
+ dst->values = sudo_emallocarray(dst->num_values, sizeof(char *));
for (i = 0; i < dst->num_values; ++i)
- dst->values[i] = estrdup(src->values[i]);
+ dst->values[i] = sudo_estrdup(src->values[i]);
debug_return;
}
debug_decl(sudo_sss_rulecpy, SUDO_DEBUG_SSSD)
sudo_debug_printf(SUDO_DEBUG_DEBUG, "dst=%p, src=%p", dst, src);
- sudo_debug_printf(SUDO_DEBUG_INFO, "emalloc: cnt=%d", src->num_attrs);
+ sudo_debug_printf(SUDO_DEBUG_INFO, "sudo_emalloc: cnt=%d", src->num_attrs);
dst->num_attrs = src->num_attrs;
- dst->attrs = emallocarray(dst->num_attrs, sizeof(struct sss_sudo_attr));
+ dst->attrs = sudo_emallocarray(dst->num_attrs, sizeof(struct sss_sudo_attr));
for (i = 0; i < dst->num_attrs; ++i)
sudo_sss_attrcpy(dst->attrs + i, src->attrs + i);
if (in_res == NULL)
debug_return_ptr(NULL);
- sudo_debug_printf(SUDO_DEBUG_DEBUG, "emalloc: cnt=%d", in_res->num_rules);
+ sudo_debug_printf(SUDO_DEBUG_DEBUG, "sudo_emalloc: cnt=%d", in_res->num_rules);
- out_res = emalloc(sizeof(struct sss_sudo_result));
+ out_res = sudo_emalloc(sizeof(struct sss_sudo_result));
out_res->rules = in_res->num_rules > 0 ?
- emallocarray(in_res->num_rules, sizeof(struct sss_sudo_rule)) : NULL;
+ sudo_emallocarray(in_res->num_rules, sizeof(struct sss_sudo_rule)) : NULL;
out_res->num_rules = 0;
for (i = l = 0; i < in_res->num_rules; ++i) {
in_res->num_rules, l);
if (l > 0) {
out_res->rules =
- ereallocarray(out_res->rules, l, sizeof(struct sss_sudo_rule));
+ sudo_ereallocarray(out_res->rules, l, sizeof(struct sss_sudo_rule));
} else {
efree(out_res->rules);
out_res->rules = NULL;
debug_decl(sudo_sss_open, SUDO_DEBUG_SSSD);
/* Create a handle container. */
- handle = emalloc(sizeof(struct sudo_sss_handle));
+ handle = sudo_emalloc(sizeof(struct sudo_sss_handle));
/* Load symbols */
handle->ssslib = sudo_dso_load(path, SUDO_DSO_LAZY);
ep++;
if (*ep != '\0') {
digest->digest_type = digest_type;
- digest->digest_str = estrndup(cp, (size_t)(ep - cp));
+ digest->digest_str = sudo_estrndup(cp, (size_t)(ep - cp));
cp = ep + 1;
while (isblank((unsigned char)*cp))
cp++;
/* check for !command */
if (*val == '!') {
foundbang = true;
- allowed_cmnd = estrdup(1 + val); /* !command */
+ allowed_cmnd = sudo_estrdup(1 + val); /* !command */
} else {
foundbang = false;
- allowed_cmnd = estrdup(val); /* command */
+ allowed_cmnd = sudo_estrdup(val); /* command */
}
/* split optional args away from command */
for (i = 0; val_array[i] != NULL; i++) {
sudo_debug_printf(SUDO_DEBUG_INFO, "sssd/ldap sudoOption: '%s'",
val_array[i]);
- v = estrdup(val_array[i]);
+ v = sudo_estrdup(val_array[i]);
/* check for equals sign past first char */
val = strchr(v, '=');
*/
if (argc == 0) {
NewArgc = 1;
- NewArgv = emallocarray(NewArgc + 1, sizeof(char *));
+ NewArgv = sudo_emallocarray(NewArgc + 1, sizeof(char *));
NewArgv[0] = user_cmnd;
NewArgv[1] = NULL;
} else {
/* Must leave an extra slot before NewArgv for bash's --login */
NewArgc = argc;
- NewArgv = emallocarray(NewArgc + 2, sizeof(char *));
+ NewArgv = sudo_emallocarray(NewArgc + 2, sizeof(char *));
memcpy(++NewArgv, argv, argc * sizeof(char *));
NewArgv[NewArgc] = NULL;
if (ISSET(sudo_mode, MODE_LOGIN_SHELL) && runas_pw != NULL)
- NewArgv[0] = estrdup(runas_pw->pw_shell);
+ NewArgv[0] = sudo_estrdup(runas_pw->pw_shell);
}
/* If given the -P option, set the "preserve_groups" flag. */
sudoers_setlocale(oldlocale, NULL);
if (safe_cmnd == NULL)
- safe_cmnd = estrdup(user_cmnd);
+ safe_cmnd = sudo_estrdup(user_cmnd);
/* If only a group was specified, set runas_pw based on invoking user. */
if (runas_pw == NULL) {
debug_decl(set_cmnd, SUDO_DEBUG_PLUGIN)
/* Allocate user_stat for find_path() and match functions. */
- user_stat = ecalloc(1, sizeof(struct stat));
+ user_stat = sudo_ecalloc(1, sizeof(struct stat));
/* Default value for cmnd, overridden below. */
if (user_cmnd == NULL)
/* Alloc and build up user_args. */
for (size = 0, av = NewArgv + 1; *av; av++)
size += strlen(*av) + 1;
- user_args = emalloc(size);
+ user_args = sudo_emalloc(size);
if (ISSET(sudo_mode, MODE_SHELL|MODE_LOGIN_SHELL)) {
/*
* When running a command via a shell, the sudo front-end
if (user_shost != user_host)
efree(user_shost);
efree(user_host);
- user_host = estrdup(res0->ai_canonname);
+ user_host = sudo_estrdup(res0->ai_canonname);
freeaddrinfo(res0);
if ((p = strchr(user_host, '.')) != NULL)
- user_shost = estrndup(user_host, (size_t)(p - user_host));
+ user_shost = sudo_estrndup(user_host, (size_t)(p - user_host));
else
user_shost = user_host;
}
debug_decl(resolve_editor, SUDO_DEBUG_PLUGIN)
/* Note: editor becomes part of argv_out and is not freed. */
- editor = emalloc(edlen + 1);
+ editor = sudo_emalloc(edlen + 1);
memcpy(editor, ed, edlen);
editor[edlen] = '\0';
efree(editor);
debug_return_str(NULL);
}
- nargv = (char **) emallocarray(nargc + 1 + nfiles + 1, sizeof(char *));
+ nargv = (char **) sudo_emallocarray(nargc + 1 + nfiles + 1, sizeof(char *));
for (ac = 0; cp != NULL && ac < nargc; ac++) {
nargv[ac] = cp;
cp = strtok(NULL, " \t");
#include <pathnames.h>
#include "missing.h"
#include "fatal.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "queue.h"
#include "defaults.h"
#include "logging.h"
#include "gettext.h" /* must be included before missing.h */
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "logging.h"
#include "iolog.h"
/* Store the line in iov followed by \r\n pair. */
if (iovcnt + 3 > iovmax) {
iov = iovmax ?
- ereallocarray(iov, iovmax <<= 1, sizeof(*iov)) :
- emallocarray(iovmax = 32, sizeof(*iov));
+ sudo_ereallocarray(iov, iovmax <<= 1, sizeof(*iov)) :
+ sudo_emallocarray(iovmax = 32, sizeof(*iov));
}
linelen = (size_t)(ep - cp) + 1;
iov[iovcnt].iov_base = cp;
}
/* Allocate new search node */
- sn = ecalloc(1, sizeof(*sn));
+ sn = sudo_ecalloc(1, sizeof(*sn));
sn->type = type;
sn->or = or;
sn->negated = not;
* 2) cwd
* 3) command with args
*/
- li = ecalloc(1, sizeof(*li));
+ li = sudo_ecalloc(1, sizeof(*li));
if (getline(&buf, &bufsize, fp) == -1 ||
getline(&li->cwd, &cwdsize, fp) == -1 ||
getline(&li->cmd, &cmdsize, fp) == -1) {
sudo_warn(U_("%s: user field is missing"), logfile);
goto bad;
}
- li->user = estrndup(cp, (size_t)(ep - cp));
+ li->user = sudo_estrndup(cp, (size_t)(ep - cp));
/* runas user */
cp = ep + 1;
sudo_warn(U_("%s: runas user field is missing"), logfile);
goto bad;
}
- li->runas_user = estrndup(cp, (size_t)(ep - cp));
+ li->runas_user = sudo_estrndup(cp, (size_t)(ep - cp));
/* runas group */
cp = ep + 1;
goto bad;
}
if (cp != ep)
- li->runas_group = estrndup(cp, (size_t)(ep - cp));
+ li->runas_group = sudo_estrndup(cp, (size_t)(ep - cp));
/* tty, followed by optional rows + columns */
cp = ep + 1;
if ((ep = strchr(cp, ':')) == NULL) {
/* just the tty */
- li->tty = estrdup(cp);
+ li->tty = sudo_estrdup(cp);
} else {
/* tty followed by rows + columns */
- li->tty = estrndup(cp, (size_t)(ep - cp));
+ li->tty = sudo_estrndup(cp, (size_t)(ep - cp));
cp = ep + 1;
/* need to NULL out separator to use strtonum() */
if ((ep = strchr(cp, ':')) != NULL) {
pathbuf[sdlen] = '\0';
/* Store potential session dirs for sorting. */
- sessions = emallocarray(sessions_size, sizeof(char *));
+ sessions = sudo_emallocarray(sessions_size, sizeof(char *));
while ((dp = readdir(d)) != NULL) {
/* Skip "." and ".." */
if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' ||
/* Add name to session list. */
if (sessions_len + 1 > sessions_size) {
sessions_size <<= 1;
- sessions = ereallocarray(sessions, sessions_size, sizeof(char *));
+ sessions = sudo_ereallocarray(sessions, sessions_size, sizeof(char *));
}
- sessions[sessions_len++] = estrdup(dp->d_name);
+ sessions[sessions_len++] = sudo_estrdup(dp->d_name);
}
closedir(d);
}
if ((p = strchr(user_host, '.'))) {
*p = '\0';
- user_shost = estrdup(user_host);
+ user_shost = sudo_estrdup(user_host);
*p = '.';
} else {
user_shost = user_host;
for (size = 0, from = argv; *from; from++)
size += strlen(*from) + 1;
- user_args = (char *) emalloc(size);
+ user_args = (char *) sudo_emalloc(size);
for (to = user_args, from = argv; *from; from++) {
n = strlcpy(to, *from, size - (to - user_args));
if (n >= size - (to - user_args))
/* Create the temp file if needed and set timestamp. */
if (sp->tpath == NULL) {
- easprintf(&sp->tpath, "%s.tmp", sp->path);
+ sudo_easprintf(&sp->tpath, "%s.tmp", sp->path);
tfd = open(sp->tpath, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (tfd < 0)
sudo_fatal("%s", sp->tpath);
}
/* Build up argument vector for the command */
- av = emallocarray(ac, sizeof(char *));
+ av = sudo_emallocarray(ac, sizeof(char *));
if ((av[0] = strrchr(editor, '/')) != NULL)
av[0]++;
else
break;
}
if (entry == NULL) {
- entry = ecalloc(1, sizeof(*entry));
- entry->path = estrdup(path);
+ entry = sudo_ecalloc(1, sizeof(*entry));
+ entry->path = sudo_estrdup(path);
/* entry->modified = 0; */
entry->fd = open(entry->path, open_flags, SUDOERS_MODE);
/* entry->tpath = NULL; */
/* Should never happen since we already checked above. */
sudo_fatal(U_("unable to stat editor (%s)"), UserEditor);
}
- EditorPath = estrdup(def_editor);
+ EditorPath = sudo_estrdup(def_editor);
Editor = strtok(EditorPath, ":");
do {
EditorArgs = get_args(Editor);
*/
if (Editor == NULL || *Editor == '\0') {
efree(EditorPath);
- EditorPath = estrdup(def_editor);
+ EditorPath = sudo_estrdup(def_editor);
Editor = strtok(EditorPath, ":");
do {
EditorArgs = get_args(Editor);
if (gethostname(thost, sizeof(thost)) != -1) {
thost[sizeof(thost) - 1] = '\0';
- user_host = estrdup(thost);
+ user_host = sudo_estrdup(thost);
if ((p = strchr(user_host, '.'))) {
*p = '\0';
- user_shost = estrdup(user_host);
+ user_shost = sudo_estrdup(user_host);
*p = '.';
} else {
user_shost = user_host;
cleandir: realclean
# Autogenerated dependencies, do not modify
-check_ttyname.o: $(srcdir)/regress/ttyname/check_ttyname.c $(incdir)/alloc.h \
+check_ttyname.o: $(srcdir)/regress/ttyname/check_ttyname.c \
$(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/missing.h $(incdir)/sudo_util.h \
- $(top_builddir)/config.h
+ $(incdir)/missing.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_util.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/ttyname/check_ttyname.c
-conversation.o: $(srcdir)/conversation.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
+conversation.o: $(srcdir)/conversation.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/sudo.h \
$(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/conversation.c
-env_hooks.o: $(srcdir)/env_hooks.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_conf.h \
+env_hooks.o: $(srcdir)/env_hooks.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_dso.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/env_hooks.c
-exec.o: $(srcdir)/exec.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+exec.o: $(srcdir)/exec.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_event.h $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h \
$(srcdir)/sudo.h $(srcdir)/sudo_exec.h $(srcdir)/sudo_plugin_int.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/exec.c
-exec_common.o: $(srcdir)/exec_common.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+exec_common.o: $(srcdir)/exec_common.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
+ $(srcdir)/sudo_exec.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/exec_common.c
-exec_pty.o: $(srcdir)/exec_pty.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_event.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
- $(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
- $(top_builddir)/pathnames.h
+exec_pty.o: $(srcdir)/exec_pty.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_event.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
+ $(srcdir)/sudo_exec.h $(srcdir)/sudo_plugin_int.h \
+ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/exec_pty.c
-get_pty.o: $(srcdir)/get_pty.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+get_pty.o: $(srcdir)/get_pty.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/get_pty.c
-hooks.o: $(srcdir)/hooks.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+hooks.o: $(srcdir)/hooks.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
$(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/hooks.c
-load_plugins.o: $(srcdir)/load_plugins.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_dso.h $(incdir)/sudo_plugin.h \
- $(incdir)/sudo_util.h $(srcdir)/sudo.h \
+load_plugins.o: $(srcdir)/load_plugins.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_dso.h \
+ $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
$(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/load_plugins.c
locale_stub.o: $(srcdir)/locale_stub.c $(incdir)/fatal.h $(incdir)/gettext.h \
$(incdir)/missing.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/locale_stub.c
-net_ifs.o: $(srcdir)/net_ifs.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+net_ifs.o: $(srcdir)/net_ifs.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/net_ifs.c
-openbsd.o: $(srcdir)/openbsd.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+openbsd.o: $(srcdir)/openbsd.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/openbsd.c
-parse_args.o: $(srcdir)/parse_args.c $(incdir)/alloc.h \
- $(incdir)/compat/getopt.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+parse_args.o: $(srcdir)/parse_args.c $(incdir)/compat/getopt.h \
+ $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
+ $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_alloc.h \
+ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_lbuf.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h \
./sudo_usage.h
preload.o: $(srcdir)/preload.c $(incdir)/missing.h $(incdir)/sudo_dso.h \
$(incdir)/sudo_plugin.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/preload.c
-preserve_fds.o: $(srcdir)/preserve_fds.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
- $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
- $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_util.h $(srcdir)/sudo.h \
+preserve_fds.o: $(srcdir)/preserve_fds.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/preserve_fds.c
-selinux.o: $(srcdir)/selinux.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+selinux.o: $(srcdir)/selinux.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/selinux.c
-sesh.o: $(srcdir)/sesh.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+sesh.o: $(srcdir)/sesh.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(srcdir)/sudo_exec.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sesh.c
-signal.o: $(srcdir)/signal.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+signal.o: $(srcdir)/signal.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/signal.c
-solaris.o: $(srcdir)/solaris.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+solaris.o: $(srcdir)/solaris.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_dso.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/solaris.c
-sudo.o: $(srcdir)/sudo.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+sudo.o: $(srcdir)/sudo.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
$(srcdir)/sudo_plugin_int.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h ./sudo_usage.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo.c
-sudo_edit.o: $(srcdir)/sudo_edit.c $(incdir)/alloc.h \
- $(incdir)/compat/stdbool.h $(incdir)/fatal.h $(incdir)/gettext.h \
- $(incdir)/missing.h $(incdir)/queue.h $(incdir)/sudo_conf.h \
+sudo_edit.o: $(srcdir)/sudo_edit.c $(incdir)/compat/stdbool.h \
+ $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
+ $(incdir)/queue.h $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_edit.c
sudo_noexec.lo: $(srcdir)/sudo_noexec.c $(incdir)/missing.h \
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_noexec.c
-tgetpass.o: $(srcdir)/tgetpass.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
- $(incdir)/sudo_plugin.h $(incdir)/sudo_util.h $(srcdir)/sudo.h \
- $(top_builddir)/config.h $(top_builddir)/pathnames.h
+tgetpass.o: $(srcdir)/tgetpass.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h \
+ $(incdir)/sudo_debug.h $(incdir)/sudo_plugin.h \
+ $(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
+ $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/tgetpass.c
-ttyname.o: $(srcdir)/ttyname.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+ttyname.o: $(srcdir)/ttyname.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_util.h $(srcdir)/sudo.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/ttyname.c
-utmp.o: $(srcdir)/utmp.c $(incdir)/alloc.h $(incdir)/compat/stdbool.h \
- $(incdir)/fatal.h $(incdir)/gettext.h $(incdir)/missing.h \
- $(incdir)/queue.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
+utmp.o: $(srcdir)/utmp.c $(incdir)/compat/stdbool.h $(incdir)/fatal.h \
+ $(incdir)/gettext.h $(incdir)/missing.h $(incdir)/queue.h \
+ $(incdir)/sudo_alloc.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_util.h $(srcdir)/sudo.h $(srcdir)/sudo_exec.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/utmp.c
pass = tgetpass(msg->msg, msg->timeout, flags);
if (pass == NULL)
goto err;
- repl->reply = estrdup(pass);
+ repl->reply = sudo_estrdup(pass);
memset_s(pass, SUDO_CONV_REPL_MAX, 0, strlen(pass));
break;
case SUDO_CONV_INFO_MSG:
/* Append at the end if not already found. */
if (!found) {
size_t env_len = (size_t)(ep - environ);
- char **envp = ereallocarray(priv_environ, env_len + 2, sizeof(char *));
+ char **envp = sudo_ereallocarray(priv_environ, env_len + 2, sizeof(char *));
if (environ != priv_environ)
memcpy(envp, environ, env_len * sizeof(char *));
envp[env_len++] = (char *)string;
snprintf(signame, sizeof(signame), "%d", signo);
sudo_debug_printf(SUDO_DEBUG_DIAG, "scheduled SIG%s for child", signame);
- sigfwd = ecalloc(1, sizeof(*sigfwd));
+ sigfwd = sudo_ecalloc(1, sizeof(*sigfwd));
sigfwd->signo = signo;
TAILQ_INSERT_TAIL(&sigfwd_list, sigfwd, entries);
if (!enabled)
env_size++;
#endif
- nenvp = emallocarray(env_size, sizeof(*envp));
+ nenvp = sudo_emallocarray(env_size, sizeof(*envp));
memcpy(nenvp, envp, env_len * sizeof(*envp));
nenvp[env_len] = NULL;
/* Prepend our LD_PRELOAD to existing value or add new entry at the end. */
if (preload_idx == -1) {
# ifdef RTLD_PRELOAD_DEFAULT
- easprintf(&preload, "%s=%s%s%s", RTLD_PRELOAD_VAR, sudo_conf_noexec_path(), RTLD_PRELOAD_DELIM, RTLD_PRELOAD_DEFAULT);
+ sudo_easprintf(&preload, "%s=%s%s%s", RTLD_PRELOAD_VAR, sudo_conf_noexec_path(), RTLD_PRELOAD_DELIM, RTLD_PRELOAD_DEFAULT);
# else
preload = sudo_new_key_val(RTLD_PRELOAD_VAR, sudo_conf_noexec_path());
# endif
nenvp[env_len++] = preload;
nenvp[env_len] = NULL;
} else {
- easprintf(&preload, "%s=%s%s%s", RTLD_PRELOAD_VAR, sudo_conf_noexec_path(), RTLD_PRELOAD_DELIM, nenvp[preload_idx]);
+ sudo_easprintf(&preload, "%s=%s%s%s", RTLD_PRELOAD_VAR, sudo_conf_noexec_path(), RTLD_PRELOAD_DELIM, nenvp[preload_idx]);
nenvp[preload_idx] = preload;
}
# ifdef RTLD_PRELOAD_ENABLE_VAR
for (argc = 0; argv[argc] != NULL; argc++)
continue;
- nargv = emallocarray(argc + 2, sizeof(char *));
+ nargv = sudo_emallocarray(argc + 2, sizeof(char *));
nargv[0] = "sh";
nargv[1] = (char *)path;
memcpy(nargv + 2, argv + 1, argc * sizeof(char *));
(void) fcntl(wfd, F_SETFL, n | O_NONBLOCK);
/* Allocate and add to head of list. */
- iob = emalloc(sizeof(*iob));
+ iob = sudo_emalloc(sizeof(*iob));
iob->revent = sudo_ev_alloc(rfd, SUDO_EV_READ, io_callback, iob);
iob->wevent = sudo_ev_alloc(wfd, SUDO_EV_WRITE, io_callback, iob);
iob->len = 0;
struct sudo_hook_entry *hook;
debug_decl(register_hook_internal, SUDO_DEBUG_HOOKS)
- hook = ecalloc(1, sizeof(*hook));
+ hook = sudo_ecalloc(1, sizeof(*hook));
hook->u.generic_fn = hook_fn;
hook->closure = closure;
SLIST_INSERT_HEAD(head, hook, entries);
if (len >= 3 && info->path[len - 3] == '.' &&
info->path[len - 2] == 's' && info->path[len - 1] == 'o') {
const char *sopath = info->path;
- char *slpath = estrdup(info->path);
+ char *slpath = sudo_estrdup(info->path);
int serrno = errno;
slpath[len - 1] = 'l';
}
}
if (handle != NULL) {
- container = ecalloc(1, sizeof(*container));
+ container = sudo_ecalloc(1, sizeof(*container));
container->handle = handle;
container->name = info->symbol_name;
container->options = info->options;
*/
if (policy_plugin->handle == NULL) {
/* Default policy plugin */
- info = ecalloc(1, sizeof(*info));
+ info = sudo_ecalloc(1, sizeof(*info));
info->symbol_name = "sudoers_policy";
info->path = SUDOERS_PLUGIN;
/* info->options = NULL; */
/* Default I/O plugin */
if (TAILQ_EMPTY(io_plugins)) {
- info = ecalloc(1, sizeof(*info));
+ info = sudo_ecalloc(1, sizeof(*info));
info->symbol_name = "sudoers_io";
info->path = SUDOERS_PLUGIN;
/* info->options = NULL; */
#include "gettext.h" /* must be included before missing.h */
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_conf.h"
#include "sudo_debug.h"
if (num_interfaces == 0)
debug_return_int(0);
ailen = num_interfaces * 2 * INET6_ADDRSTRLEN;
- *addrinfo = cp = emalloc(ailen);
+ *addrinfo = cp = sudo_emalloc(ailen);
/* Store the IP addr/netmask pairs. */
for (ifa = ifaddrs; ifa != NULL; ifa = ifa -> ifa_next) {
* Get interface configuration or return.
*/
for (;;) {
- ifconf_buf = emalloc(buflen);
+ ifconf_buf = sudo_emalloc(buflen);
ifconf = (struct ifconf *) ifconf_buf;
ifconf->ifc_len = buflen - sizeof(struct ifconf);
ifconf->ifc_buf = (caddr_t) (ifconf_buf + sizeof(struct ifconf));
if ((n = ifconf->ifc_len / sizeof(struct ifreq)) == 0)
debug_return_int(0);
ailen = n * 2 * INET6_ADDRSTRLEN;
- *addrinfo = cp = emalloc(ailen);
+ *addrinfo = cp = sudo_emalloc(ailen);
/* For each interface, store the ip address and netmask. */
for (i = 0; i < ifconf->ifc_len; ) {
int env_size = 32;
debug_decl(parse_args, SUDO_DEBUG_ARGS)
- env_add = emallocarray(env_size, sizeof(char *));
+ env_add = sudo_emallocarray(env_size, sizeof(char *));
/* Pass progname to plugin so it can call initprogname() */
sudo_settings[ARG_PROGNAME].value = getprogname();
/* Set max_groups from sudo.conf. */
i = sudo_conf_max_groups();
if (i != -1) {
- easprintf(&cp, "%d", i);
+ sudo_easprintf(&cp, "%d", i);
sudo_settings[ARG_MAX_GROUPS].value = cp;
}
} else if (!got_end_of_args && is_envar) {
if (nenv == env_size - 2) {
env_size *= 2;
- env_add = ereallocarray(env_add, env_size, sizeof(char *));
+ env_add = sudo_ereallocarray(env_add, env_size, sizeof(char *));
}
env_add[nenv++] = argv[optind];
size_t cmnd_size = (size_t) (argv[argc - 1] - argv[0]) +
strlen(argv[argc - 1]) + 1;
- cmnd = dst = emallocarray(cmnd_size, 2);
+ cmnd = dst = sudo_emallocarray(cmnd_size, 2);
for (av = argv; *av != NULL; av++) {
for (src = *av; *src != '\0'; src++) {
/* quote potential meta characters */
ac += 2; /* -c cmnd */
}
- av = emallocarray(ac + 1, sizeof(char *));
+ av = sudo_emallocarray(ac + 1, sizeof(char *));
av[0] = (char *)user_details.shell; /* plugin may override shell */
if (cmnd != NULL) {
av[1] = "-c";
#ifdef _PATH_SUDO_PLUGIN_DIR
sudo_settings[ARG_PLUGIN_DIR].value = sudo_conf_plugin_dir_path();
#endif
- settings = emallocarray(NUM_SETTINGS + 1, sizeof(char *));
+ settings = sudo_emallocarray(NUM_SETTINGS + 1, sizeof(char *));
for (i = 0, j = 0; i < NUM_SETTINGS; i++) {
if (sudo_settings[i].value) {
sudo_debug_printf(SUDO_DEBUG_INFO, "settings: %s=%s",
struct preserved_fd *pfd, *pfd_new;
debug_decl(add_preserved_fd, SUDO_DEBUG_UTIL)
- pfd_new = emalloc(sizeof(*pfd));
+ pfd_new = sudo_emalloc(sizeof(*pfd));
pfd_new->lowfd = fd;
pfd_new->highfd = fd;
pfd_new->flags = fcntl(fd, F_GETFD);
}
/* Create bitmap of preserved (relocated) fds. */
- fdsp = ecalloc(howmany(lastfd + 1, NFDBITS), sizeof(fd_mask));
+ fdsp = sudo_ecalloc(howmany(lastfd + 1, NFDBITS), sizeof(fd_mask));
TAILQ_FOREACH(pfd, pfds, entries) {
FD_SET(pfd->lowfd, fdsp);
}
#include <errno.h>
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_util.h"
/* Lookup tty name via sudo (using kernel info if possible). */
if ((tty_sudo = get_process_ttyname()) == NULL)
- tty_sudo = estrdup("none");
+ tty_sudo = sudo_estrdup("none");
/* Lookup tty name via libc and compare to kernel tty. */
for (fd = STDERR_FILENO; fd >= STDIN_FILENO; fd--) {
if (cp != NULL) {
if (tty_libc == NULL || strcmp(cp, tty_libc) != 0) {
efree(tty_libc);
- tty_libc = estrdup(cp);
+ tty_libc = sudo_estrdup(cp);
}
if (tty_sudo != NULL && strcmp(tty_libc, tty_sudo) == 0) {
rval = 0;
sudo_fatal(U_("unable to open audit system"));
} else {
/* audit role change using the same format as newrole(1) */
- easprintf(&message, "newrole: old-context=%s new-context=%s",
+ sudo_easprintf(&message, "newrole: old-context=%s new-context=%s",
old_context, new_context);
rc = audit_log_user_message(au_fd, AUDIT_USER_ROLE_CHANGE,
message, NULL, NULL, ttyn, 1);
/*
* Convert "context" back into a string and verify it.
*/
- new_context = estrdup(context_str(context));
+ new_context = sudo_estrdup(context_str(context));
if (security_check_context(new_context) < 0) {
sudo_warnx(U_("%s is not a valid context"), new_context);
errno = EINVAL;
*/
for (argc = 0; argv[argc] != NULL; argc++)
continue;
- nargv = emallocarray(argc + 2, sizeof(char *));
+ nargv = sudo_emallocarray(argc + 2, sizeof(char *));
if (noexec)
nargv[0] = *argv[0] == '-' ? "-sesh-noexec" : "sesh-noexec";
else
#include "gettext.h" /* must be included before missing.h */
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_conf.h"
#include "sudo_debug.h"
/* Shift argv and make a copy of the command to execute. */
argv++;
argc--;
- cmnd = estrdup(argv[0]);
+ cmnd = sudo_estrdup(argv[0]);
/* If invoked as a login shell, modify argv[0] accordingly. */
if (login_shell) {
*/
ud->ngroups = sudo_conf_max_groups();
if (ud->ngroups > 0) {
- ud->groups = emallocarray(ud->ngroups, sizeof(GETGROUPS_T));
+ ud->groups = sudo_emallocarray(ud->ngroups, sizeof(GETGROUPS_T));
/* No error on insufficient space if user specified max_groups. */
(void)getgrouplist(ud->username, ud->gid, ud->groups, &ud->ngroups);
rval = 0;
for (tries = 0; tries < 10 && rval == -1; tries++) {
ud->ngroups <<= 1;
efree(ud->groups);
- ud->groups = emallocarray(ud->ngroups, sizeof(GETGROUPS_T));
+ ud->groups = sudo_emallocarray(ud->ngroups, sizeof(GETGROUPS_T));
rval = getgrouplist(ud->username, ud->gid, ud->groups, &ud->ngroups);
}
}
if ((ud->ngroups = getgroups(0, NULL)) > 0) {
/* Use groups from kernel if not too many or source is static. */
if (ud->ngroups < maxgroups || group_source == GROUP_SOURCE_STATIC) {
- ud->groups = emallocarray(ud->ngroups, sizeof(GETGROUPS_T));
+ ud->groups = sudo_emallocarray(ud->ngroups, sizeof(GETGROUPS_T));
if (getgroups(ud->ngroups, ud->groups) < 0) {
efree(ud->groups);
ud->groups = NULL;
* Format group list as a comma-separated string of gids.
*/
glsize = sizeof("groups=") - 1 + (ud->ngroups * (MAX_UID_T_LEN + 1));
- gid_list = emalloc(glsize);
+ gid_list = sudo_emalloc(glsize);
memcpy(gid_list, "groups=", sizeof("groups=") - 1);
cp = gid_list + sizeof("groups=") - 1;
for (i = 0; i < ud->ngroups; i++) {
debug_decl(get_user_info, SUDO_DEBUG_UTIL)
/* XXX - bound check number of entries */
- user_info = emallocarray(32, sizeof(char *));
+ user_info = sudo_emallocarray(32, sizeof(char *));
ud->pid = getpid();
ud->ppid = getppid();
if ((ud->shell = getenv("SHELL")) == NULL || ud->shell[0] == '\0') {
ud->shell = pw->pw_shell[0] ? pw->pw_shell : _PATH_BSHELL;
}
- ud->shell = estrdup(ud->shell);
+ ud->shell = sudo_estrdup(ud->shell);
- easprintf(&user_info[++i], "pid=%d", (int)ud->pid);
- easprintf(&user_info[++i], "ppid=%d", (int)ud->ppid);
- easprintf(&user_info[++i], "pgid=%d", (int)ud->pgid);
- easprintf(&user_info[++i], "tcpgid=%d", (int)ud->tcpgid);
- easprintf(&user_info[++i], "sid=%d", (int)ud->sid);
+ sudo_easprintf(&user_info[++i], "pid=%d", (int)ud->pid);
+ sudo_easprintf(&user_info[++i], "ppid=%d", (int)ud->ppid);
+ sudo_easprintf(&user_info[++i], "pgid=%d", (int)ud->pgid);
+ sudo_easprintf(&user_info[++i], "tcpgid=%d", (int)ud->tcpgid);
+ sudo_easprintf(&user_info[++i], "sid=%d", (int)ud->sid);
- easprintf(&user_info[++i], "uid=%u", (unsigned int)ud->uid);
- easprintf(&user_info[++i], "euid=%u", (unsigned int)ud->euid);
- easprintf(&user_info[++i], "gid=%u", (unsigned int)ud->gid);
- easprintf(&user_info[++i], "egid=%u", (unsigned int)ud->egid);
+ sudo_easprintf(&user_info[++i], "uid=%u", (unsigned int)ud->uid);
+ sudo_easprintf(&user_info[++i], "euid=%u", (unsigned int)ud->euid);
+ sudo_easprintf(&user_info[++i], "gid=%u", (unsigned int)ud->gid);
+ sudo_easprintf(&user_info[++i], "egid=%u", (unsigned int)ud->egid);
if ((cp = get_user_groups(ud)) != NULL)
user_info[++i] = cp;
ud->host = user_info[i] + sizeof("host=") - 1;
sudo_get_ttysize(&ud->ts_lines, &ud->ts_cols);
- easprintf(&user_info[++i], "lines=%d", ud->ts_lines);
- easprintf(&user_info[++i], "cols=%d", ud->ts_cols);
+ sudo_easprintf(&user_info[++i], "lines=%d", ud->ts_lines);
+ sudo_easprintf(&user_info[++i], "cols=%d", ud->ts_cols);
user_info[++i] = NULL;
int len;
char *cp, *colon;
- cp = path = estrdup(path);
+ cp = path = sudo_estrdup(path);
do {
if ((colon = strchr(cp, ':')))
*colon = '\0';
#include "gettext.h" /* must be included before missing.h */
#include "missing.h"
-#include "alloc.h"
+#include "sudo_alloc.h"
#include "fatal.h"
#include "sudo_conf.h"
#include "sudo_debug.h"
* For each file specified by the user, make a temporary version
* and copy the contents of the original to it.
*/
- tf = emallocarray(nfiles, sizeof(*tf));
+ tf = sudo_emallocarray(nfiles, sizeof(*tf));
memset(tf, 0, nfiles * sizeof(*tf));
for (i = 0, j = 0; i < nfiles; i++) {
rc = -1;
cp = tf[j].ofile;
suff = strrchr(cp, '.');
if (suff != NULL) {
- easprintf(&tf[j].tfile, "%.*s/%.*sXXXXXXXX%s", tmplen, tmpdir,
+ sudo_easprintf(&tf[j].tfile, "%.*s/%.*sXXXXXXXX%s", tmplen, tmpdir,
(int)(size_t)(suff - cp), cp, suff);
} else {
- easprintf(&tf[j].tfile, "%.*s/%s.XXXXXXXX", tmplen, tmpdir, cp);
+ sudo_easprintf(&tf[j].tfile, "%.*s/%s.XXXXXXXX", tmplen, tmpdir, cp);
}
if (seteuid(user_details.uid) != 0)
sudo_fatal("seteuid(%d)", (int)user_details.uid);
* to create a new argv.
*/
nargc = editor_argc + nfiles;
- nargv = (char **) emallocarray(nargc + 1, sizeof(char *));
+ nargv = (char **) sudo_emallocarray(nargc + 1, sizeof(char *));
for (ac = 0; ac < editor_argc; ac++)
nargv[ac] = command_details->argv[ac];
for (i = 0; i < nfiles && ac < nargc; )
if (*dev != '/') {
/* devname() doesn't use the /dev/ prefix, add one... */
size_t len = sizeof(_PATH_DEV) + strlen(dev);
- tty = emalloc(len);
+ tty = sudo_emalloc(len);
strlcpy(tty, _PATH_DEV, len);
strlcat(tty, dev, len);
} else {
/* Should not happen but just in case... */
- tty = estrdup(dev);
+ tty = sudo_estrdup(dev);
}
}
debug_return_str(tty);
tty = _ttyname_dev(tdev, buf, sizeof(buf));
- debug_return_str(estrdup(tty));
+ debug_return_str(sudo_estrdup(tty));
}
#elif defined(HAVE_STRUCT_PSINFO_PR_TTYDEV) || defined(HAVE_PSTAT_GETPROC) || defined(__linux__)
/*
/* Add to list of subdirs to search. */
if (num_subdirs + 1 > max_subdirs) {
max_subdirs += 64;
- subdirs = ereallocarray(subdirs, max_subdirs, sizeof(char *));
+ subdirs = sudo_ereallocarray(subdirs, max_subdirs, sizeof(char *));
}
- subdirs[num_subdirs++] = estrdup(pathbuf);
+ subdirs[num_subdirs++] = sudo_estrdup(pathbuf);
}
continue;
}
if (S_ISCHR(sb.st_mode) && sb.st_rdev == rdev) {
- devname = estrdup(pathbuf);
+ devname = sudo_estrdup(pathbuf);
sudo_debug_printf(SUDO_DEBUG_INFO, "resolved dev %u as %s",
(unsigned int)rdev, pathbuf);
goto done;
(unsigned int)minor(rdev));
if (stat(buf, &sb) == 0) {
if (S_ISCHR(sb.st_mode) && sb.st_rdev == rdev)
- tty = estrdup(buf);
+ tty = sudo_estrdup(buf);
}
sudo_debug_printf(SUDO_DEBUG_INFO, "comparing dev %u to %s: %s",
(unsigned int)rdev, buf, tty ? "yes" : "no");
} else {
if (stat(devname, &sb) == 0) {
if (S_ISCHR(sb.st_mode) && sb.st_rdev == rdev)
- tty = estrdup(devname);
+ tty = sudo_estrdup(devname);
}
}
}
mib[5] = 1;
do {
size += size / 10;
- ki_proc = erealloc(ki_proc, size);
+ ki_proc = sudo_erealloc(ki_proc, size);
rc = sysctl(mib, sudo_kp_namelen, ki_proc, &size, NULL, 0);
} while (rc == -1 && errno == ENOMEM);
if (rc != -1) {
tty = ttyname(STDERR_FILENO);
}
- debug_return_str(estrdup(tty));
+ debug_return_str(sudo_estrdup(tty));
}
#endif