Use non-exiting allocatings in the sudoers plugin.

This commit is contained in:
Todd C. Miller
2015-06-17 06:49:59 -06:00
parent 6da04821d7
commit d004b02fc6
36 changed files with 1073 additions and 810 deletions

View File

@@ -465,46 +465,44 @@ cleandir: realclean
# Autogenerated dependencies, do not modify # Autogenerated dependencies, do not modify
afs.lo: $(authdir)/afs.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \ afs.lo: $(authdir)/afs.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/afs.c $(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 \ aix_auth.lo: $(authdir)/aix_auth.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/aix_auth.c $(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 \ alias.lo: $(srcdir)/alias.c $(devdir)/def_data.h $(devdir)/gram.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/parse.h $(srcdir)/redblack.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/alias.c
audit.lo: $(srcdir)/audit.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \ $(srcdir)/bsm_audit.h $(srcdir)/defaults.h $(srcdir)/linux_audit.h \
$(srcdir)/redblack.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/logging.h $(srcdir)/solaris_audit.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(top_builddir)/pathnames.h $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/alias.c
audit.lo: $(srcdir)/audit.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/bsm_audit.h \
$(srcdir)/defaults.h $(srcdir)/linux_audit.h $(srcdir)/logging.h \
$(srcdir)/solaris_audit.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/audit.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/audit.c
base64.lo: $(srcdir)/base64.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \ base64.lo: $(srcdir)/base64.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
@@ -513,53 +511,50 @@ base64.lo: $(srcdir)/base64.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/base64.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/base64.c
base64.o: base64.lo base64.o: base64.lo
boottime.lo: $(srcdir)/boottime.c $(devdir)/def_data.h \ boottime.lo: $(srcdir)/boottime.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/boottime.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/boottime.c
bsdauth.lo: $(authdir)/bsdauth.c $(devdir)/def_data.h \ bsdauth.lo: $(authdir)/bsdauth.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/bsdauth.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/bsdauth.c
bsm_audit.lo: $(srcdir)/bsm_audit.c $(devdir)/def_data.h \ bsm_audit.lo: $(srcdir)/bsm_audit.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/bsm_audit.h $(srcdir)/defaults.h \
$(srcdir)/bsm_audit.h $(srcdir)/defaults.h $(srcdir)/logging.h \ $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/bsm_audit.c $(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)/compat/stdbool.h \ check.lo: $(srcdir)/check.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/check.h \ $(srcdir)/check.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/check.c $(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 \ check_addr.o: $(srcdir)/regress/parser/check_addr.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/defaults.h $(srcdir)/interfaces.h $(srcdir)/logging.h \ $(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/parse.h \
$(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/parser/check_addr.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/parser/check_addr.c
@@ -581,15 +576,14 @@ check_hexchar.o: $(srcdir)/regress/parser/check_hexchar.c \
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/parser/check_hexchar.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/parser/check_hexchar.c
check_iolog_path.o: $(srcdir)/regress/iolog_path/check_iolog_path.c \ check_iolog_path.o: $(srcdir)/regress/iolog_path/check_iolog_path.c \
$(devdir)/def_data.c $(devdir)/def_data.h \ $(devdir)/def_data.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/defaults.h $(srcdir)/logging.h \ $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/iolog_path/check_iolog_path.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/iolog_path/check_iolog_path.c
check_symbols.o: $(srcdir)/regress/check_symbols/check_symbols.c \ check_symbols.o: $(srcdir)/regress/check_symbols/check_symbols.c \
$(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
@@ -602,8 +596,8 @@ check_wrap.o: $(srcdir)/regress/logging/check_wrap.c \
$(incdir)/sudo_util.h $(top_builddir)/config.h $(incdir)/sudo_util.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/regress/logging/check_wrap.c $(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)/compat/stdbool.h \ dce.lo: $(authdir)/dce.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
@@ -611,207 +605,194 @@ dce.lo: $(authdir)/dce.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/dce.c $(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 \ defaults.lo: $(srcdir)/defaults.c $(devdir)/def_data.c $(devdir)/def_data.h \
$(devdir)/gram.h $(incdir)/compat/stdbool.h \ $(devdir)/gram.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \ $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \ $(srcdir)/logging.h $(srcdir)/parse.h $(srcdir)/sudo_nss.h \
$(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/defaults.c $(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)/compat/stdbool.h \ env.lo: $(srcdir)/env.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/env.c $(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 \ find_path.lo: $(srcdir)/find_path.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/find_path.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/find_path.c
find_path.o: find_path.lo find_path.o: find_path.lo
fwtk.lo: $(authdir)/fwtk.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \ fwtk.lo: $(authdir)/fwtk.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/fwtk.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/fwtk.c
getdate.o: $(devdir)/getdate.c $(incdir)/sudo_compat.h $(top_builddir)/config.h getdate.o: $(devdir)/getdate.c $(incdir)/sudo_compat.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(devdir)/getdate.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(devdir)/getdate.c
getspwuid.lo: $(srcdir)/getspwuid.c $(devdir)/def_data.h \ getspwuid.lo: $(srcdir)/getspwuid.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/getspwuid.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/getspwuid.c
goodpath.lo: $(srcdir)/goodpath.c $(devdir)/def_data.h \ goodpath.lo: $(srcdir)/goodpath.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/goodpath.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/goodpath.c
goodpath.o: goodpath.lo goodpath.o: goodpath.lo
gram.lo: $(devdir)/gram.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \ gram.lo: $(devdir)/gram.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
$(srcdir)/logging.h $(srcdir)/parse.h $(srcdir)/sudo_nss.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(srcdir)/toke.h \ $(srcdir)/toke.h $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(devdir)/gram.c $(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 \ group_plugin.lo: $(srcdir)/group_plugin.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_dso.h \ $(incdir)/sudo_dso.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.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 $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.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)/compat/stdbool.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/interfaces.h $(srcdir)/logging.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.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)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/iolog.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.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)/compat/stdbool.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.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 $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.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)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.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)/compat/stdbool.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/iolog.h $(srcdir)/logging.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.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)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.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 $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/iolog_path.c
iolog_path.o: iolog_path.lo iolog_path.o: iolog_path.lo
kerb5.lo: $(authdir)/kerb5.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \ kerb5.lo: $(authdir)/kerb5.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/kerb5.c $(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)/compat/stdbool.h \ ldap.lo: $(srcdir)/ldap.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_dso.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_dso.h $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_lbuf.h \ $(incdir)/sudo_lbuf.h $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \ $(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/ldap.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/ldap.c
linux_audit.lo: $(srcdir)/linux_audit.c $(devdir)/def_data.h \ linux_audit.lo: $(srcdir)/linux_audit.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/defaults.h $(srcdir)/linux_audit.h \ $(srcdir)/linux_audit.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/linux_audit.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/linux_audit.c
locale.lo: $(srcdir)/locale.c $(incdir)/compat/stdbool.h \ locale.lo: $(srcdir)/locale.c $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h $(srcdir)/logging.h \ $(incdir)/sudo_gettext.h $(srcdir)/logging.h $(top_builddir)/config.h
$(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/locale.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/locale.c
locale.o: locale.lo locale.o: locale.lo
logging.lo: $(srcdir)/logging.c $(devdir)/def_data.h \ logging.lo: $(srcdir)/logging.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/logging.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/logging.c
logwrap.lo: $(srcdir)/logwrap.c $(devdir)/def_data.h \ logwrap.lo: $(srcdir)/logwrap.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/logwrap.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/logwrap.c
logwrap.o: logwrap.lo logwrap.o: logwrap.lo
match.lo: $(srcdir)/match.c $(devdir)/def_data.h $(devdir)/gram.h \ match.lo: $(srcdir)/match.c $(devdir)/def_data.h $(devdir)/gram.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)/compat/sha2.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
$(srcdir)/logging.h $(srcdir)/parse.h $(srcdir)/sudo_nss.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/match.c $(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 \ match_addr.lo: $(srcdir)/match_addr.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/defaults.h $(srcdir)/interfaces.h $(srcdir)/logging.h \ $(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/match_addr.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/match_addr.c
match_addr.o: match_addr.lo match_addr.o: match_addr.lo
net_ifs.o: $(top_srcdir)/src/net_ifs.c $(incdir)/compat/stdbool.h \ net_ifs.o: $(top_srcdir)/src/net_ifs.c $(incdir)/compat/stdbool.h \
@@ -821,26 +802,25 @@ net_ifs.o: $(top_srcdir)/src/net_ifs.c $(incdir)/compat/stdbool.h \
$(top_builddir)/config.h $(top_builddir)/config.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(top_srcdir)/src/net_ifs.c $(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)/compat/stdbool.h \ pam.lo: $(authdir)/pam.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/pam.c $(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 \ parse.lo: $(srcdir)/parse.c $(devdir)/def_data.h $(devdir)/gram.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_lbuf.h \
$(incdir)/sudo_lbuf.h $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
$(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/parse.c $(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)/compat/stdbool.h \ passwd.lo: $(authdir)/passwd.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
@@ -848,8 +828,8 @@ passwd.lo: $(authdir)/passwd.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/passwd.c $(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)/compat/stdbool.h \ policy.lo: $(srcdir)/policy.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
@@ -858,8 +838,8 @@ policy.lo: $(srcdir)/policy.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/policy.c $(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)/compat/stdbool.h \ prompt.lo: $(srcdir)/prompt.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
@@ -867,8 +847,8 @@ prompt.lo: $(srcdir)/prompt.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/prompt.c $(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)/compat/stdbool.h \ pwutil.lo: $(srcdir)/pwutil.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/pwutil.h $(srcdir)/redblack.h \ $(srcdir)/logging.h $(srcdir)/pwutil.h $(srcdir)/redblack.h \
@@ -877,103 +857,100 @@ pwutil.lo: $(srcdir)/pwutil.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/pwutil.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/pwutil.c
pwutil.o: pwutil.lo pwutil.o: pwutil.lo
pwutil_impl.lo: $(srcdir)/pwutil_impl.c $(devdir)/def_data.h \ pwutil_impl.lo: $(srcdir)/pwutil_impl.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/pwutil.h \ $(srcdir)/pwutil.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/pwutil_impl.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/pwutil_impl.c
pwutil_impl.o: pwutil_impl.lo pwutil_impl.o: pwutil_impl.lo
redblack.lo: $(srcdir)/redblack.c $(devdir)/def_data.h \ redblack.lo: $(srcdir)/redblack.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/redblack.h $(srcdir)/sudo_nss.h \ $(srcdir)/redblack.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/redblack.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/redblack.c
redblack.o: redblack.lo redblack.o: redblack.lo
rfc1938.lo: $(authdir)/rfc1938.c $(devdir)/def_data.h \ rfc1938.lo: $(authdir)/rfc1938.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/rfc1938.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/rfc1938.c
secureware.lo: $(authdir)/secureware.c $(devdir)/def_data.h \ secureware.lo: $(authdir)/secureware.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/secureware.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/secureware.c
securid5.lo: $(authdir)/securid5.c $(devdir)/def_data.h \ securid5.lo: $(authdir)/securid5.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/securid5.c $(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 \ set_perms.lo: $(srcdir)/set_perms.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/set_perms.c $(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)/compat/stdbool.h \ sia.lo: $(authdir)/sia.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/sia.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/sia.c
solaris_audit.lo: $(srcdir)/solaris_audit.c $(devdir)/def_data.h \ solaris_audit.lo: $(srcdir)/solaris_audit.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/defaults.h $(srcdir)/logging.h \ $(srcdir)/logging.h $(srcdir)/solaris_audit.h \
$(srcdir)/solaris_audit.h $(srcdir)/sudo_nss.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/solaris_audit.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/solaris_audit.c
sssd.lo: $(srcdir)/sssd.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \ sssd.lo: $(srcdir)/sssd.c $(devdir)/def_data.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_dso.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_dso.h $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_lbuf.h \ $(incdir)/sudo_lbuf.h $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \ $(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sssd.c $(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 \ sudo_auth.lo: $(authdir)/sudo_auth.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/ins_2001.h \
$(srcdir)/defaults.h $(srcdir)/ins_2001.h \
$(srcdir)/ins_classic.h $(srcdir)/ins_csops.h \ $(srcdir)/ins_classic.h $(srcdir)/ins_csops.h \
$(srcdir)/ins_goons.h $(srcdir)/insults.h $(srcdir)/logging.h \ $(srcdir)/ins_goons.h $(srcdir)/insults.h $(srcdir)/logging.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
@@ -981,13 +958,12 @@ sudo_auth.lo: $(authdir)/sudo_auth.c $(devdir)/def_data.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(authdir)/sudo_auth.c $(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 \ sudo_nss.lo: $(srcdir)/sudo_nss.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_lbuf.h \ $(incdir)/sudo_lbuf.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \ $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_nss.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_nss.c
@@ -998,113 +974,106 @@ sudo_printf.o: $(srcdir)/sudo_printf.c $(incdir)/compat/stdbool.h \
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_printf.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudo_printf.c
sudoers.lo: $(srcdir)/sudoers.c $(devdir)/def_data.h \ sudoers.lo: $(srcdir)/sudoers.c $(devdir)/def_data.h \
$(incdir)/compat/getaddrinfo.h $(incdir)/compat/stdbool.h \ $(incdir)/compat/getaddrinfo.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_util.h $(srcdir)/auth/sudo_auth.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudoers.c
sudoers_debug.lo: $(srcdir)/sudoers_debug.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h \ $(srcdir)/auth/sudo_auth.h $(srcdir)/defaults.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudoers.c
sudoers_debug.lo: $(srcdir)/sudoers_debug.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudoers_debug.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudoers_debug.c
sudoers_debug.o: sudoers_debug.lo sudoers_debug.o: sudoers_debug.lo
sudoreplay.o: $(srcdir)/sudoreplay.c $(incdir)/compat/getopt.h \ sudoreplay.o: $(srcdir)/sudoreplay.c $(incdir)/compat/getopt.h \
$(incdir)/compat/stdbool.h $(incdir)/compat/timespec.h \ $(incdir)/compat/stdbool.h $(incdir)/compat/timespec.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \ $(incdir)/sudo_debug.h $(incdir)/sudo_event.h \
$(incdir)/sudo_event.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/iolog.h \ $(incdir)/sudo_util.h $(srcdir)/iolog.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudoreplay.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sudoreplay.c
testsudoers.o: $(srcdir)/testsudoers.c $(devdir)/def_data.h $(devdir)/gram.h \ testsudoers.o: $(srcdir)/testsudoers.c $(devdir)/def_data.h $(devdir)/gram.h \
$(incdir)/compat/fnmatch.h $(incdir)/compat/stdbool.h \ $(incdir)/compat/fnmatch.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \ $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(srcdir)/defaults.h $(srcdir)/interfaces.h $(srcdir)/logging.h \
$(srcdir)/interfaces.h $(srcdir)/logging.h $(srcdir)/parse.h \ $(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(srcdir)/tsgetgrpw.h \ $(srcdir)/sudoers_debug.h $(srcdir)/tsgetgrpw.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/testsudoers.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/testsudoers.c
timestamp.lo: $(srcdir)/timestamp.c $(devdir)/def_data.h \ timestamp.lo: $(srcdir)/timestamp.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/compat/timespec.h \ $(incdir)/compat/stdbool.h $(incdir)/compat/timespec.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \
$(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \ $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/check.h \
$(incdir)/sudo_util.h $(srcdir)/check.h $(srcdir)/defaults.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/sudo_nss.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/timestamp.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/timestamp.c
timestr.lo: $(srcdir)/timestr.c $(incdir)/sudo_compat.h $(top_builddir)/config.h timestr.lo: $(srcdir)/timestr.c $(incdir)/sudo_compat.h $(top_builddir)/config.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/timestr.c $(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 \ toke.lo: $(devdir)/toke.c $(devdir)/def_data.h $(devdir)/gram.h \
$(incdir)/compat/sha2.h $(incdir)/compat/stdbool.h \ $(incdir)/compat/sha2.h $(incdir)/compat/stdbool.h \
$(incdir)/sudo_alloc.h $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h $(incdir)/sudo_lbuf.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_lbuf.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \ $(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/toke.h $(top_builddir)/config.h $(top_builddir)/pathnames.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 $(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 \ toke_util.lo: $(srcdir)/toke_util.c $(devdir)/def_data.h $(devdir)/gram.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \ $(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(srcdir)/toke.h \ $(srcdir)/sudoers_debug.h $(srcdir)/toke.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/toke_util.c $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/toke_util.c
toke_util.o: toke_util.lo toke_util.o: toke_util.lo
tsgetgrpw.o: $(srcdir)/tsgetgrpw.c $(devdir)/def_data.h \ tsgetgrpw.o: $(srcdir)/tsgetgrpw.c $(devdir)/def_data.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/logging.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(srcdir)/tsgetgrpw.h \ $(srcdir)/sudoers_debug.h $(srcdir)/tsgetgrpw.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/config.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/tsgetgrpw.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/tsgetgrpw.c
visudo.o: $(srcdir)/visudo.c $(devdir)/def_data.h $(devdir)/gram.h \ visudo.o: $(srcdir)/visudo.c $(devdir)/def_data.h $(devdir)/gram.h \
$(incdir)/compat/getopt.h $(incdir)/compat/stdbool.h \ $(incdir)/compat/getopt.h $(incdir)/compat/stdbool.h \
$(incdir)/compat/timespec.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/timespec.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \
$(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \ $(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \
$(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(srcdir)/defaults.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \ $(srcdir)/logging.h $(srcdir)/parse.h $(srcdir)/redblack.h \
$(srcdir)/redblack.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \ $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h $(srcdir)/sudoers_debug.h \
$(srcdir)/sudoers_debug.h $(srcdir)/sudoers_version.h \ $(srcdir)/sudoers_version.h $(top_builddir)/config.h \
$(top_builddir)/config.h $(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/visudo.c $(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 \ visudo_json.o: $(srcdir)/visudo_json.c $(devdir)/def_data.h $(devdir)/gram.h \
$(incdir)/compat/stdbool.h $(incdir)/sudo_alloc.h \ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
$(incdir)/sudo_compat.h $(incdir)/sudo_conf.h \ $(incdir)/sudo_conf.h $(incdir)/sudo_debug.h \
$(incdir)/sudo_debug.h $(incdir)/sudo_fatal.h \ $(incdir)/sudo_fatal.h $(incdir)/sudo_gettext.h \
$(incdir)/sudo_gettext.h $(incdir)/sudo_plugin.h \ $(incdir)/sudo_plugin.h $(incdir)/sudo_queue.h \
$(incdir)/sudo_queue.h $(incdir)/sudo_util.h \ $(incdir)/sudo_util.h $(srcdir)/defaults.h $(srcdir)/logging.h \
$(srcdir)/defaults.h $(srcdir)/logging.h $(srcdir)/parse.h \ $(srcdir)/parse.h $(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudo_nss.h $(srcdir)/sudoers.h \
$(srcdir)/sudoers_debug.h $(top_builddir)/config.h \ $(srcdir)/sudoers_debug.h $(top_builddir)/config.h \
$(top_builddir)/pathnames.h $(top_builddir)/pathnames.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/visudo_json.c $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/visudo_json.c

View File

@@ -184,17 +184,17 @@ alias_free(void *v)
void *next; void *next;
debug_decl(alias_free, SUDOERS_DEBUG_ALIAS) debug_decl(alias_free, SUDOERS_DEBUG_ALIAS)
sudo_efree(a->name); free(a->name);
TAILQ_FOREACH_SAFE(m, &a->members, entries, next) { TAILQ_FOREACH_SAFE(m, &a->members, entries, next) {
if (m->type == COMMAND) { if (m->type == COMMAND) {
c = (struct sudo_command *) m->name; c = (struct sudo_command *) m->name;
sudo_efree(c->cmnd); free(c->cmnd);
sudo_efree(c->args); free(c->args);
} }
sudo_efree(m->name); free(m->name);
sudo_efree(m); free(m);
} }
sudo_efree(a); free(a);
debug_return; debug_return;
} }

View File

@@ -149,7 +149,7 @@ sudo_aix_verify(struct passwd *pw, char *prompt, sudo_auth *auth)
SUDO_CONV_PROMPT_ECHO_OFF); SUDO_CONV_PROMPT_ECHO_OFF);
if (pass == NULL) if (pass == NULL)
break; break;
sudo_efree(message); free(message);
message = NULL; message = NULL;
result = authenticate(pw->pw_name, pass, &reenter, &message); result = authenticate(pw->pw_name, pass, &reenter, &message);
memset_s(pass, SUDO_CONV_REPL_MAX, 0, strlen(pass)); memset_s(pass, SUDO_CONV_REPL_MAX, 0, strlen(pass));
@@ -170,7 +170,7 @@ sudo_aix_verify(struct passwd *pw, char *prompt, sudo_auth *auth)
} }
rval = pass ? AUTH_FAILURE : AUTH_INTR; rval = pass ? AUTH_FAILURE : AUTH_INTR;
} }
sudo_efree(message); free(message);
debug_return_int(rval); debug_return_int(rval);
} }

View File

@@ -146,7 +146,10 @@ bsdauth_verify(struct passwd *pw, char *prompt, sudo_auth *auth)
len = strlen(prompt) - 1; len = strlen(prompt) - 1;
while (isspace(prompt[len]) || prompt[len] == ':') while (isspace(prompt[len]) || prompt[len] == ':')
prompt[len--] = '\0'; prompt[len--] = '\0';
sudo_easprintf(&s, "%s [echo on]: ", prompt); if (asprintf(&s, "%s [echo on]: ", prompt) == -1) {
log_warningx(0, N_("unable to allocate memory"));
debug_return_int(AUTH_FATAL);
}
pass = auth_getpass(prompt, def_passwd_timeout * 60, pass = auth_getpass(prompt, def_passwd_timeout * 60,
SUDO_CONV_PROMPT_ECHO_ON); SUDO_CONV_PROMPT_ECHO_ON);
free(s); free(s);

View File

@@ -124,7 +124,11 @@ sudo_krb5_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
/* Only rewrite prompt if user didn't specify their own. */ /* Only rewrite prompt if user didn't specify their own. */
/*if (!strcmp(prompt, PASSPROMPT)) { */ /*if (!strcmp(prompt, PASSPROMPT)) { */
sudo_easprintf(&krb5_prompt, "Password for %s: ", pname); if (asprintf(&krb5_prompt, "Password for %s: ", pname) == -1) {
log_warningx(0, N_("unable to allocate memory"));
free(pname);
debug_return_int(AUTH_FATAL);
}
/*}*/ /*}*/
free(pname); free(pname);
} }
@@ -144,8 +148,12 @@ sudo_krb5_init(struct passwd *pw, sudo_auth *auth)
auth->data = (void *) &sudo_krb5_data; /* Stash all our data here */ auth->data = (void *) &sudo_krb5_data; /* Stash all our data here */
if (sudo_krb5_instance != NULL) { if (sudo_krb5_instance != NULL) {
sudo_easprintf(&pname, "%s%s%s", pw->pw_name, int len = asprintf(&pname, "%s%s%s", pw->pw_name,
sudo_krb5_instance[0] != '/' ? "/" : "", sudo_krb5_instance); sudo_krb5_instance[0] != '/' ? "/" : "", sudo_krb5_instance);
if (len == -1) {
log_warningx(0, N_("unable to allocate memory"));
debug_return_int(AUTH_FATAL);
}
} }
#ifdef HAVE_KRB5_INIT_SECURE_CONTEXT #ifdef HAVE_KRB5_INIT_SECURE_CONTEXT
@@ -175,7 +183,7 @@ sudo_krb5_init(struct passwd *pw, sudo_auth *auth)
done: done:
if (sudo_krb5_instance != NULL) if (sudo_krb5_instance != NULL)
sudo_efree(pname); free(pname);
debug_return_int(error ? AUTH_FAILURE : AUTH_SUCCESS); debug_return_int(error ? AUTH_FAILURE : AUTH_SUCCESS);
} }

View File

@@ -261,12 +261,11 @@ sudo_pam_begin_session(struct passwd *pw, char **user_envp[], sudo_auth *auth)
char **pam_envp = pam_getenvlist(pamh); char **pam_envp = pam_getenvlist(pamh);
if (pam_envp != NULL) { if (pam_envp != NULL) {
/* Merge pam env with user env. */ /* Merge pam env with user env. */
env_init(*user_envp); if (!env_init(*user_envp) || !env_merge(pam_envp))
if (!env_merge(pam_envp))
status = AUTH_FAILURE; status = AUTH_FAILURE;
*user_envp = env_get(); *user_envp = env_get();
env_init(NULL); (void)env_init(NULL);
sudo_efree(pam_envp); free(pam_envp);
/* XXX - we leak any duplicates that were in pam_envp */ /* XXX - we leak any duplicates that were in pam_envp */
} }
} }
@@ -376,7 +375,11 @@ converse(int num_msg, PAM_CONST struct pam_message **msg,
ret = PAM_CONV_ERR; ret = PAM_CONV_ERR;
goto done; goto done;
} }
pr->resp = sudo_estrdup(pass); if ((pr->resp = strdup(pass)) == NULL) {
sudo_warnx(U_("unable to allocate memory"));
ret = PAM_BUF_ERR;
goto done;
}
memset_s(pass, SUDO_CONV_REPL_MAX, 0, strlen(pass)); memset_s(pass, SUDO_CONV_REPL_MAX, 0, strlen(pass));
break; break;
case PAM_TEXT_INFO: case PAM_TEXT_INFO:

View File

@@ -59,7 +59,7 @@ sudo_passwd_init(struct passwd *pw, sudo_auth *auth)
sudo_setspent(); sudo_setspent();
auth->data = sudo_getepw(pw); auth->data = sudo_getepw(pw);
sudo_endspent(); sudo_endspent();
debug_return_int(AUTH_SUCCESS); debug_return_int(auth->data ? AUTH_SUCCESS : AUTH_FATAL);
} }
int int
@@ -118,7 +118,7 @@ sudo_passwd_cleanup(pw, auth)
if (pw_epasswd != NULL) { if (pw_epasswd != NULL) {
memset_s(pw_epasswd, SUDO_CONV_REPL_MAX, 0, strlen(pw_epasswd)); memset_s(pw_epasswd, SUDO_CONV_REPL_MAX, 0, strlen(pw_epasswd));
sudo_efree(pw_epasswd); free(pw_epasswd);
} }
debug_return_int(AUTH_SUCCESS); debug_return_int(AUTH_SUCCESS);
} }

View File

@@ -67,6 +67,7 @@ int
sudo_rfc1938_setup(struct passwd *pw, char **promptp, sudo_auth *auth) sudo_rfc1938_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
{ {
char challenge[256]; char challenge[256];
size_t challenge_len;
static char *orig_prompt = NULL, *new_prompt = NULL; static char *orig_prompt = NULL, *new_prompt = NULL;
static int op_len, np_size; static int op_len, np_size;
static struct RFC1938 rfc1938; static struct RFC1938 rfc1938;
@@ -110,9 +111,15 @@ sudo_rfc1938_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
} }
/* Get space for new prompt with embedded challenge */ /* Get space for new prompt with embedded challenge */
if (np_size < op_len + strlen(challenge) + 7) { challenge_len = strlen(challenge);
np_size = op_len + strlen(challenge) + 7; if (np_size < op_len + challenge_len + 7) {
new_prompt = sudo_erealloc(new_prompt, np_size); char *p = realloc(new_prompt, op_len + challenge_len + 7);
if (p == NULL) {
sudo_warnx(U_("unable to allocate memory"));
debug_return_int(AUTH_FATAL);
}
np_size = op_len + challenge_len + 7;
new_prompt = p;
} }
if (def_long_otp_prompt) if (def_long_otp_prompt)

View File

@@ -53,22 +53,24 @@
#include "sudoers.h" #include "sudoers.h"
#include "sudo_auth.h" #include "sudo_auth.h"
#ifdef __alpha
extern int crypt_type;
#endif
int int
sudo_secureware_init(struct passwd *pw, sudo_auth *auth) sudo_secureware_init(struct passwd *pw, sudo_auth *auth)
{ {
#ifdef __alpha
extern int crypt_type;
debug_decl(sudo_secureware_init, SUDOERS_DEBUG_AUTH) debug_decl(sudo_secureware_init, SUDOERS_DEBUG_AUTH)
#ifdef __alpha
if (crypt_type == INT_MAX) if (crypt_type == INT_MAX)
debug_return_int(AUTH_FAILURE); /* no shadow */ debug_return_int(AUTH_FAILURE); /* no shadow */
#else
debug_decl(secureware_init, SUDOERS_DEBUG_AUTH)
#endif #endif
sudo_setspent(); sudo_setspent();
auth->data = sudo_getepw(pw); auth->data = sudo_getepw(pw);
sudo_endspent(); sudo_endspent();
debug_return_int(AUTH_SUCCESS); debug_return_int(auth->data ? AUTH_SUCCESS : AUTH_FATAL);
} }
int int
@@ -82,10 +84,7 @@ sudo_secureware_verify(struct passwd *pw, char *pass, sudo_auth *auth)
if (pass[0] == '\0') if (pass[0] == '\0')
debug_return_int(pw_epasswd[0] ? AUTH_FAILURE : AUTH_SUCCESS); debug_return_int(pw_epasswd[0] ? AUTH_FAILURE : AUTH_SUCCESS);
#ifdef __alpha #if defined(__alpha)
{
extern int crypt_type;
# ifdef HAVE_DISPCRYPT # ifdef HAVE_DISPCRYPT
epass = dispcrypt(pass, pw_epasswd, crypt_type); epass = dispcrypt(pass, pw_epasswd, crypt_type);
# else # else
@@ -94,7 +93,6 @@ sudo_secureware_verify(struct passwd *pw, char *pass, sudo_auth *auth)
else if (crypt_type == AUTH_CRYPT_CRYPT16) else if (crypt_type == AUTH_CRYPT_CRYPT16)
epass = crypt(pass, pw_epasswd); epass = crypt(pass, pw_epasswd);
# endif /* HAVE_DISPCRYPT */ # endif /* HAVE_DISPCRYPT */
}
#elif defined(HAVE_BIGCRYPT) #elif defined(HAVE_BIGCRYPT)
epass = bigcrypt(pass, pw_epasswd); epass = bigcrypt(pass, pw_epasswd);
#endif /* __alpha */ #endif /* __alpha */
@@ -114,7 +112,7 @@ sudo_secureware_cleanup(pw, auth)
if (pw_epasswd != NULL) { if (pw_epasswd != NULL) {
memset_s(pw_epasswd, SUDO_CONV_REPL_MAX, 0, strlen(pw_epasswd)); memset_s(pw_epasswd, SUDO_CONV_REPL_MAX, 0, strlen(pw_epasswd));
sudo_efree(pw_epasswd); free(pw_epasswd);
} }
debug_return_int(AUTH_SUCCESS); debug_return_int(AUTH_SUCCESS);
} }

View File

@@ -116,7 +116,7 @@ sudo_sia_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
sudo_argc = NewArgc + 1; sudo_argc = NewArgc + 1;
sudo_argv = reallocarray(NULL, sudo_argc + 1, sizeof(char *)); sudo_argv = reallocarray(NULL, sudo_argc + 1, sizeof(char *));
if (sudo_argv == NULL) { if (sudo_argv == NULL) {
log_warning(0, N_("unable to allocate memory")); log_warningx(0, N_("unable to allocate memory"));
debug_return_int(AUTH_FATAL); debug_return_int(AUTH_FATAL);
} }
sudo_argv[0] = "sudo"; sudo_argv[0] = "sudo";

View File

@@ -102,7 +102,7 @@ check_user_interactive(int validated, int mode, struct passwd *auth_pw)
rval = verify_user(auth_pw, prompt, validated); rval = verify_user(auth_pw, prompt, validated);
if (rval == true && lectured) if (rval == true && lectured)
set_lectured(); set_lectured();
sudo_efree(prompt); free(prompt);
} }
/* Only update timestamp if user was validated. */ /* Only update timestamp if user was validated. */
if (rval == true && ISSET(validated, VALIDATE_SUCCESS) && if (rval == true && ISSET(validated, VALIDATE_SUCCESS) &&

View File

@@ -93,13 +93,13 @@ static struct strmap priorities[] = {
static bool store_int(char *, struct sudo_defs_types *, int); static bool store_int(char *, struct sudo_defs_types *, int);
static bool store_list(char *, struct sudo_defs_types *, int); static bool store_list(char *, struct sudo_defs_types *, int);
static bool store_mode(char *, struct sudo_defs_types *, int); static bool store_mode(char *, struct sudo_defs_types *, int);
static bool store_str(char *, struct sudo_defs_types *, int); static int store_str(char *, struct sudo_defs_types *, int);
static bool store_syslogfac(char *, struct sudo_defs_types *, int); static bool store_syslogfac(char *, struct sudo_defs_types *, int);
static bool store_syslogpri(char *, struct sudo_defs_types *, int); static bool store_syslogpri(char *, struct sudo_defs_types *, int);
static bool store_tuple(char *, struct sudo_defs_types *, int); static bool store_tuple(char *, struct sudo_defs_types *, int);
static bool store_uint(char *, struct sudo_defs_types *, int); static bool store_uint(char *, struct sudo_defs_types *, int);
static bool store_float(char *, struct sudo_defs_types *, int); static bool store_float(char *, struct sudo_defs_types *, int);
static void list_op(char *, size_t, struct sudo_defs_types *, enum list_ops); static bool list_op(char *, size_t, struct sudo_defs_types *, enum list_ops);
static const char *logfac2str(int); static const char *logfac2str(int);
static const char *logpri2str(int); static const char *logpri2str(int);
@@ -244,8 +244,14 @@ set_default(char *var, char *val, int op)
sudo_warnx(U_("values for `%s' must start with a '/'"), var); sudo_warnx(U_("values for `%s' must start with a '/'"), var);
debug_return_bool(false); debug_return_bool(false);
} }
if (!store_str(val, cur, op)) { switch (store_str(val, cur, op)) {
case true:
/* OK */
break;
case false:
sudo_warnx(U_("value `%s' is invalid for option `%s'"), val, var); sudo_warnx(U_("value `%s' is invalid for option `%s'"), val, var);
/* FALLTHROUGH */
default:
debug_return_bool(false); debug_return_bool(false);
} }
break; break;
@@ -340,7 +346,7 @@ set_default(char *var, char *val, int op)
* Set default options to compiled-in values. * Set default options to compiled-in values.
* Any of these may be overridden at runtime by a "Defaults" file. * Any of these may be overridden at runtime by a "Defaults" file.
*/ */
void bool
init_defaults(void) init_defaults(void)
{ {
static int firsttime = 1; static int firsttime = 1;
@@ -352,11 +358,11 @@ init_defaults(void)
for (def = sudo_defs_table; def->name; def++) { for (def = sudo_defs_table; def->name; def++) {
switch (def->type & T_MASK) { switch (def->type & T_MASK) {
case T_STR: case T_STR:
sudo_efree(def->sd_un.str); free(def->sd_un.str);
def->sd_un.str = NULL; def->sd_un.str = NULL;
break; break;
case T_LIST: case T_LIST:
list_op(NULL, 0, def, freeall); (void)list_op(NULL, 0, def, freeall);
break; break;
} }
memset(&def->sd_un, 0, sizeof(def->sd_un)); memset(&def->sd_un, 0, sizeof(def->sd_un));
@@ -418,17 +424,23 @@ init_defaults(void)
#ifdef UMASK_OVERRIDE #ifdef UMASK_OVERRIDE
def_umask_override = true; def_umask_override = true;
#endif #endif
def_iolog_file = sudo_estrdup("%{seq}"); if ((def_iolog_file = strdup("%{seq}")) == NULL)
def_iolog_dir = sudo_estrdup(_PATH_SUDO_IO_LOGDIR); goto oom;
def_sudoers_locale = sudo_estrdup("C"); if ((def_iolog_dir = strdup(_PATH_SUDO_IO_LOGDIR)) == NULL)
goto oom;
if ((def_sudoers_locale = strdup("C")) == NULL)
goto oom;
def_env_reset = ENV_RESET; def_env_reset = ENV_RESET;
def_set_logname = true; def_set_logname = true;
def_closefrom = STDERR_FILENO + 1; def_closefrom = STDERR_FILENO + 1;
def_pam_service = sudo_estrdup("sudo"); if ((def_pam_service = strdup("sudo")) == NULL)
goto oom;
#ifdef HAVE_PAM_LOGIN #ifdef HAVE_PAM_LOGIN
def_pam_login_service = sudo_estrdup("sudo-i"); if ((def_pam_login_service = strdup("sudo-i")) == NULL)
goto oom;
#else #else
def_pam_login_service = sudo_estrdup("sudo"); if ((def_pam_login_service = strdup("sudo")) == NULL)
goto oom;
#endif #endif
#ifdef NO_PAM_SESSION #ifdef NO_PAM_SESSION
def_pam_session = false; def_pam_session = false;
@@ -467,36 +479,53 @@ init_defaults(void)
#endif #endif
/* Now do the strings */ /* Now do the strings */
def_mailto = sudo_estrdup(MAILTO); if ((def_mailto = strdup(MAILTO)) == NULL)
def_mailsub = sudo_estrdup(N_(MAILSUBJECT)); goto oom;
def_badpass_message = sudo_estrdup(_(INCORRECT_PASSWORD)); if ((def_mailsub = strdup(N_(MAILSUBJECT))) == NULL)
def_lecture_status_dir = sudo_estrdup(_PATH_SUDO_LECTURE_DIR); goto oom;
def_timestampdir = sudo_estrdup(_PATH_SUDO_TIMEDIR); if ((def_badpass_message = strdup(_(INCORRECT_PASSWORD))) == NULL)
def_passprompt = sudo_estrdup(_(PASSPROMPT)); goto oom;
def_runas_default = sudo_estrdup(RUNAS_DEFAULT); if ((def_lecture_status_dir = strdup(_PATH_SUDO_LECTURE_DIR)) == NULL)
goto oom;
if ((def_timestampdir = strdup(_PATH_SUDO_TIMEDIR)) == NULL)
goto oom;
if ((def_passprompt = strdup(_(PASSPROMPT))) == NULL)
goto oom;
if ((def_runas_default = strdup(RUNAS_DEFAULT)) == NULL)
goto oom;
#ifdef _PATH_SUDO_SENDMAIL #ifdef _PATH_SUDO_SENDMAIL
def_mailerpath = sudo_estrdup(_PATH_SUDO_SENDMAIL); if ((def_mailerpath = strdup(_PATH_SUDO_SENDMAIL)) == NULL)
def_mailerflags = sudo_estrdup("-t"); goto oom;
if ((def_mailerflags = strdup("-t")) == NULL)
goto oom;
#endif #endif
#if (LOGGING & SLOG_FILE) #if (LOGGING & SLOG_FILE)
def_logfile = sudo_estrdup(_PATH_SUDO_LOGFILE); if ((def_logfile = strdup(_PATH_SUDO_LOGFILE)) == NULL)
goto oom;
#endif #endif
#ifdef EXEMPTGROUP #ifdef EXEMPTGROUP
def_exempt_group = sudo_estrdup(EXEMPTGROUP); if ((def_exempt_group = strdup(EXEMPTGROUP)) == NULL)
goto oom;
#endif #endif
#ifdef SECURE_PATH #ifdef SECURE_PATH
def_secure_path = sudo_estrdup(SECURE_PATH); if ((def_secure_path = strdup(SECURE_PATH)) == NULL)
goto oom;
#endif #endif
def_editor = sudo_estrdup(EDITOR); if ((def_editor = strdup(EDITOR)) == NULL)
goto oom;
def_set_utmp = true; def_set_utmp = true;
def_pam_setcred = true; def_pam_setcred = true;
/* Finally do the lists (currently just environment tables). */ /* Finally do the lists (currently just environment tables). */
init_envtables(); if (!init_envtables())
goto oom;
firsttime = 0; firsttime = 0;
debug_return; debug_return_bool(true);
oom:
sudo_warnx(U_("unable to allocate memory"));
debug_return_bool(false);
} }
/* /*
@@ -518,21 +547,10 @@ update_defaults(int what)
rc = false; rc = false;
break; break;
case DEFAULTS_USER: case DEFAULTS_USER:
#if 1
if (ISSET(what, SETDEF_USER)) {
int m;
m = userlist_matches(sudo_user.pw, def->binding);
if (m == ALLOW) {
if (!set_default(def->var, def->val, def->op))
rc = false;
}
}
#else
if (ISSET(what, SETDEF_USER) && if (ISSET(what, SETDEF_USER) &&
userlist_matches(sudo_user.pw, def->binding) == ALLOW && userlist_matches(sudo_user.pw, def->binding) == ALLOW &&
!set_default(def->var, def->val, def->op)) !set_default(def->var, def->val, def->op))
rc = false; rc = false;
#endif
break; break;
case DEFAULTS_RUNAS: case DEFAULTS_RUNAS:
if (ISSET(what, SETDEF_RUNAS) && if (ISSET(what, SETDEF_RUNAS) &&
@@ -700,19 +718,23 @@ store_tuple(char *val, struct sudo_defs_types *def, int op)
debug_return_bool(true); debug_return_bool(true);
} }
static bool static int
store_str(char *val, struct sudo_defs_types *def, int op) store_str(char *val, struct sudo_defs_types *def, int op)
{ {
debug_decl(store_str, SUDOERS_DEBUG_DEFAULTS) debug_decl(store_str, SUDOERS_DEBUG_DEFAULTS)
sudo_efree(def->sd_un.str); free(def->sd_un.str);
if (op == false) if (op == false) {
def->sd_un.str = NULL; def->sd_un.str = NULL;
else } else {
def->sd_un.str = sudo_estrdup(val); if ((def->sd_un.str = strdup(val)) == NULL) {
sudo_warnx(U_("unable to allocate memory"));
debug_return_int(-1);
}
}
if (def->callback) if (def->callback)
debug_return_bool(def->callback(val)); debug_return_int(def->callback(val));
debug_return_bool(true); debug_return_int(true);
} }
static bool static bool
@@ -723,7 +745,7 @@ store_list(char *str, struct sudo_defs_types *def, int op)
/* Remove all old members. */ /* Remove all old members. */
if (op == false || op == true) if (op == false || op == true)
list_op(NULL, 0, def, freeall); (void)list_op(NULL, 0, def, freeall);
/* Split str into multiple space-separated words and act on each one. */ /* Split str into multiple space-separated words and act on each one. */
if (op != false) { if (op != false) {
@@ -738,7 +760,8 @@ store_list(char *str, struct sudo_defs_types *def, int op)
/* Find end position and perform operation. */ /* Find end position and perform operation. */
for (end = start; *end && !isblank((unsigned char)*end); end++) for (end = start; *end && !isblank((unsigned char)*end); end++)
; ;
list_op(start, end - start, def, op == '-' ? delete : add); if (!list_op(start, end - start, def, op == '-' ? delete : add))
debug_return_bool(false);
} while (*end++ != '\0'); } while (*end++ != '\0');
} }
debug_return_bool(true); debug_return_bool(true);
@@ -836,7 +859,7 @@ store_mode(char *val, struct sudo_defs_types *def, int op)
debug_return_bool(true); debug_return_bool(true);
} }
static void static bool
list_op(char *val, size_t len, struct sudo_defs_types *def, enum list_ops op) list_op(char *val, size_t len, struct sudo_defs_types *def, enum list_ops op)
{ {
struct list_member *cur, *prev = NULL; struct list_member *cur, *prev = NULL;
@@ -845,25 +868,25 @@ list_op(char *val, size_t len, struct sudo_defs_types *def, enum list_ops op)
if (op == freeall) { if (op == freeall) {
while ((cur = SLIST_FIRST(&def->sd_un.list)) != NULL) { while ((cur = SLIST_FIRST(&def->sd_un.list)) != NULL) {
SLIST_REMOVE_HEAD(&def->sd_un.list, entries); SLIST_REMOVE_HEAD(&def->sd_un.list, entries);
sudo_efree(cur->value); free(cur->value);
sudo_efree(cur); free(cur);
} }
debug_return; debug_return_bool(true);
} }
SLIST_FOREACH(cur, &def->sd_un.list, entries) { SLIST_FOREACH(cur, &def->sd_un.list, entries) {
if ((strncmp(cur->value, val, len) == 0 && cur->value[len] == '\0')) { if ((strncmp(cur->value, val, len) == 0 && cur->value[len] == '\0')) {
if (op == add) if (op == add)
debug_return; /* already exists */ debug_return_bool(true); /* already exists */
/* Delete node */ /* Delete node */
if (prev == NULL) if (prev == NULL)
SLIST_REMOVE_HEAD(&def->sd_un.list, entries); SLIST_REMOVE_HEAD(&def->sd_un.list, entries);
else else
SLIST_REMOVE_AFTER(prev, entries); SLIST_REMOVE_AFTER(prev, entries);
sudo_efree(cur->value); free(cur->value);
sudo_efree(cur); free(cur);
break; break;
} }
prev = cur; prev = cur;
@@ -871,9 +894,13 @@ list_op(char *val, size_t len, struct sudo_defs_types *def, enum list_ops op)
/* Add new node to the head of the list. */ /* Add new node to the head of the list. */
if (op == add) { if (op == add) {
cur = sudo_ecalloc(1, sizeof(struct list_member)); cur = calloc(1, sizeof(struct list_member));
cur->value = sudo_estrndup(val, len); if (cur == NULL || (cur->value = strndup(val, len)) == NULL) {
sudo_warnx(U_("unable to allocate memory"));
free(cur);
debug_return_bool(false);
}
SLIST_INSERT_HEAD(&def->sd_un.list, cur, entries); SLIST_INSERT_HEAD(&def->sd_un.list, cur, entries);
} }
debug_return; debug_return_bool(true);
} }

View File

@@ -110,7 +110,7 @@ struct sudo_defs_types {
* Prototypes * Prototypes
*/ */
void dump_default(void); void dump_default(void);
void init_defaults(void); bool init_defaults(void);
bool set_default(char *var, char *val, int op); bool set_default(char *var, char *val, int op);
bool update_defaults(int what); bool update_defaults(int what);
bool check_defaults(int what, bool quiet); bool check_defaults(int what, bool quiet);

View File

@@ -211,7 +211,7 @@ static const char *initial_keepenv_table[] = {
/* /*
* Initialize env based on envp. * Initialize env based on envp.
*/ */
void bool
env_init(char * const envp[]) env_init(char * const envp[])
{ {
char * const *ep; char * const *ep;
@@ -220,7 +220,7 @@ env_init(char * const envp[])
if (envp == NULL) { if (envp == NULL) {
/* Free the old envp we allocated, if any. */ /* Free the old envp we allocated, if any. */
sudo_efree(env.old_envp); free(env.old_envp);
/* Reset to initial state but keep a pointer to what we allocated. */ /* Reset to initial state but keep a pointer to what we allocated. */
env.old_envp = env.envp; env.old_envp = env.envp;
@@ -235,7 +235,13 @@ env_init(char * const envp[])
env.env_len = len; env.env_len = len;
env.env_size = len + 1 + 128; env.env_size = len + 1 + 128;
env.envp = sudo_emallocarray(env.env_size, sizeof(char *)); env.envp = reallocarray(NULL, env.env_size, sizeof(char *));
if (env.envp == NULL) {
env.env_size = 0;
env.env_len = 0;
sudo_warnx(U_("unable to allocate memory"));
debug_return_bool(false);
}
#ifdef ENV_DEBUG #ifdef ENV_DEBUG
memset(env.envp, 0, env.env_size * sizeof(char *)); memset(env.envp, 0, env.env_size * sizeof(char *));
#endif #endif
@@ -243,11 +249,11 @@ env_init(char * const envp[])
env.envp[len] = NULL; env.envp[len] = NULL;
/* Free the old envp we allocated, if any. */ /* Free the old envp we allocated, if any. */
sudo_efree(env.old_envp); free(env.old_envp);
env.old_envp = NULL; env.old_envp = NULL;
} }
debug_return; debug_return_bool(true);
} }
/* /*
@@ -398,7 +404,8 @@ sudo_setenv2(const char *var, const char *val, bool dupcheck, bool overwrite)
debug_decl(sudo_setenv2, SUDOERS_DEBUG_ENV) debug_decl(sudo_setenv2, SUDOERS_DEBUG_ENV)
esize = strlen(var) + 1 + strlen(val) + 1; esize = strlen(var) + 1 + strlen(val) + 1;
estring = sudo_emalloc(esize); if ((estring = malloc(esize)) == NULL)
debug_return_int(-1);
/* Build environment string and insert it. */ /* Build environment string and insert it. */
if (strlcpy(estring, var, esize) >= esize || if (strlcpy(estring, var, esize) >= esize ||
@@ -411,7 +418,7 @@ sudo_setenv2(const char *var, const char *val, bool dupcheck, bool overwrite)
rval = sudo_putenv(estring, dupcheck, overwrite); rval = sudo_putenv(estring, dupcheck, overwrite);
} }
if (rval == -1) if (rval == -1)
sudo_efree(estring); free(estring);
debug_return_int(rval); debug_return_int(rval);
} }
@@ -821,6 +828,16 @@ env_update_didvar(const char *ep, unsigned int *didvar)
} }
} }
#define CHECK_PUTENV(a, b, c) do { \
if (sudo_putenv((a), (b), (c)) == -1) \
goto bad; \
} while (0)
#define CHECK_SETENV2(a, b, c, d) do { \
if (sudo_setenv2((a), (b), (c), (d)) == -1) \
goto bad; \
} while (0)
/* /*
* Build a new environment and ether clear potentially dangerous * Build a new environment and ether clear potentially dangerous
* variables from the old one or start with a clean slate. * variables from the old one or start with a clean slate.
@@ -843,9 +860,13 @@ rebuild_env(void)
didvar = 0; didvar = 0;
env.env_len = 0; env.env_len = 0;
env.env_size = 128; env.env_size = 128;
sudo_efree(env.old_envp); free(env.old_envp);
env.old_envp = env.envp; env.old_envp = env.envp;
env.envp = sudo_emallocarray(env.env_size, sizeof(char *)); env.envp = reallocarray(NULL, env.env_size, sizeof(char *));
if (env.envp == NULL) {
env.env_size = 0;
goto bad;
}
#ifdef ENV_DEBUG #ifdef ENV_DEBUG
memset(env.envp, 0, env.env_size * sizeof(char *)); memset(env.envp, 0, env.env_size * sizeof(char *));
#else #else
@@ -905,8 +926,7 @@ rebuild_env(void)
if (keepit) { if (keepit) {
/* Preserve variable. */ /* Preserve variable. */
if (sudo_putenv(*ep, false, false) == -1) CHECK_PUTENV(*ep, false, false);
goto bad;
env_update_didvar(*ep, &didvar); env_update_didvar(*ep, &didvar);
} }
} }
@@ -918,25 +938,25 @@ rebuild_env(void)
* on sudoers options). * on sudoers options).
*/ */
if (ISSET(sudo_mode, MODE_LOGIN_SHELL)) { if (ISSET(sudo_mode, MODE_LOGIN_SHELL)) {
sudo_setenv2("SHELL", runas_pw->pw_shell, CHECK_SETENV2("SHELL", runas_pw->pw_shell,
ISSET(didvar, DID_SHELL), true); ISSET(didvar, DID_SHELL), true);
sudo_setenv2("LOGNAME", runas_pw->pw_name, CHECK_SETENV2("LOGNAME", runas_pw->pw_name,
ISSET(didvar, DID_LOGNAME), true); ISSET(didvar, DID_LOGNAME), true);
sudo_setenv2("USER", runas_pw->pw_name, CHECK_SETENV2("USER", runas_pw->pw_name,
ISSET(didvar, DID_USER), true); ISSET(didvar, DID_USER), true);
sudo_setenv2("USERNAME", runas_pw->pw_name, CHECK_SETENV2("USERNAME", runas_pw->pw_name,
ISSET(didvar, DID_USERNAME), true); ISSET(didvar, DID_USERNAME), true);
} else { } else {
if (!ISSET(didvar, DID_SHELL)) if (!ISSET(didvar, DID_SHELL))
sudo_setenv2("SHELL", sudo_user.pw->pw_shell, false, true); CHECK_SETENV2("SHELL", sudo_user.pw->pw_shell, false, true);
/* We will set LOGNAME later in the !def_set_logname case. */ /* We will set LOGNAME later in the !def_set_logname case. */
if (!def_set_logname) { if (!def_set_logname) {
if (!ISSET(didvar, DID_LOGNAME)) if (!ISSET(didvar, DID_LOGNAME))
sudo_setenv2("LOGNAME", user_name, false, true); CHECK_SETENV2("LOGNAME", user_name, false, true);
if (!ISSET(didvar, DID_USER)) if (!ISSET(didvar, DID_USER))
sudo_setenv2("USER", user_name, false, true); CHECK_SETENV2("USER", user_name, false, true);
if (!ISSET(didvar, DID_USERNAME)) if (!ISSET(didvar, DID_USERNAME))
sudo_setenv2("USERNAME", user_name, false, true); CHECK_SETENV2("USERNAME", user_name, false, true);
} }
} }
@@ -950,10 +970,13 @@ rebuild_env(void)
*/ */
if (ISSET(sudo_mode, MODE_LOGIN_SHELL) || !ISSET(didvar, KEPT_MAIL)) { if (ISSET(sudo_mode, MODE_LOGIN_SHELL) || !ISSET(didvar, KEPT_MAIL)) {
cp = _PATH_MAILDIR; cp = _PATH_MAILDIR;
if (cp[sizeof(_PATH_MAILDIR) - 2] == '/') if (cp[sizeof(_PATH_MAILDIR) - 2] == '/') {
sudo_easprintf(&cp, "MAIL=%s%s", _PATH_MAILDIR, runas_pw->pw_name); if (asprintf(&cp, "MAIL=%s%s", _PATH_MAILDIR, runas_pw->pw_name) == -1)
else goto bad;
sudo_easprintf(&cp, "MAIL=%s/%s", _PATH_MAILDIR, runas_pw->pw_name); } else {
if (asprintf(&cp, "MAIL=%s/%s", _PATH_MAILDIR, runas_pw->pw_name) == -1)
goto bad;
}
if (sudo_putenv(cp, ISSET(didvar, DID_MAIL), true) == -1) { if (sudo_putenv(cp, ISSET(didvar, DID_MAIL), true) == -1) {
free(cp); free(cp);
goto bad; goto bad;
@@ -973,15 +996,13 @@ rebuild_env(void)
SET(didvar, DID_PATH); SET(didvar, DID_PATH);
else if (strncmp(*ep, "TERM=", 5) == 0) else if (strncmp(*ep, "TERM=", 5) == 0)
SET(didvar, DID_TERM); SET(didvar, DID_TERM);
if (sudo_putenv(*ep, false, false) == -1) CHECK_PUTENV(*ep, false, false);
goto bad;
} }
} }
} }
/* Replace the PATH envariable with a secure one? */ /* Replace the PATH envariable with a secure one? */
if (def_secure_path && !user_is_exempt()) { if (def_secure_path && !user_is_exempt()) {
if (sudo_setenv2("PATH", def_secure_path, true, true) == -1) CHECK_SETENV2("PATH", def_secure_path, true, true);
goto bad;
SET(didvar, DID_PATH); SET(didvar, DID_PATH);
} }
@@ -993,58 +1014,50 @@ rebuild_env(void)
*/ */
if (def_set_logname && !ISSET(sudo_mode, MODE_LOGIN_SHELL)) { if (def_set_logname && !ISSET(sudo_mode, MODE_LOGIN_SHELL)) {
if (!ISSET(didvar, KEPT_LOGNAME)) if (!ISSET(didvar, KEPT_LOGNAME))
sudo_setenv2("LOGNAME", runas_pw->pw_name, true, true); CHECK_SETENV2("LOGNAME", runas_pw->pw_name, true, true);
if (!ISSET(didvar, KEPT_USER)) if (!ISSET(didvar, KEPT_USER))
sudo_setenv2("USER", runas_pw->pw_name, true, true); CHECK_SETENV2("USER", runas_pw->pw_name, true, true);
if (!ISSET(didvar, KEPT_USERNAME)) if (!ISSET(didvar, KEPT_USERNAME))
sudo_setenv2("USERNAME", runas_pw->pw_name, true, true); CHECK_SETENV2("USERNAME", runas_pw->pw_name, true, true);
} }
/* Set $HOME to target user if not preserving user's value. */ /* Set $HOME to target user if not preserving user's value. */
if (reset_home) if (reset_home)
sudo_setenv2("HOME", runas_pw->pw_dir, true, true); CHECK_SETENV2("HOME", runas_pw->pw_dir, true, true);
/* Provide default values for $TERM and $PATH if they are not set. */ /* Provide default values for $TERM and $PATH if they are not set. */
if (!ISSET(didvar, DID_TERM)) { if (!ISSET(didvar, DID_TERM))
if (sudo_putenv("TERM=unknown", false, false) == -1) CHECK_PUTENV("TERM=unknown", false, false);
goto bad; if (!ISSET(didvar, DID_PATH))
} CHECK_SETENV2("PATH", _PATH_STDPATH, false, true);
if (!ISSET(didvar, DID_PATH)) {
if (sudo_setenv2("PATH", _PATH_STDPATH, false, true) == -1)
goto bad;
}
/* Set PS1 if SUDO_PS1 is set. */ /* Set PS1 if SUDO_PS1 is set. */
if (ps1 != NULL) { if (ps1 != NULL)
if (sudo_putenv(ps1, true, true) == -1) CHECK_PUTENV(ps1, true, true);
goto bad;
}
/* Add the SUDO_COMMAND envariable (cmnd + args). */ /* Add the SUDO_COMMAND envariable (cmnd + args). */
if (user_args) { if (user_args) {
sudo_easprintf(&cp, "SUDO_COMMAND=%s %s", user_cmnd, user_args); if (asprintf(&cp, "SUDO_COMMAND=%s %s", user_cmnd, user_args) == -1)
goto bad;
if (sudo_putenv(cp, true, true) == -1) { if (sudo_putenv(cp, true, true) == -1) {
sudo_efree(cp); free(cp);
goto bad; goto bad;
} }
} else { } else {
if (sudo_setenv2("SUDO_COMMAND", user_cmnd, true, true) == -1) CHECK_SETENV2("SUDO_COMMAND", user_cmnd, true, true);
goto bad;
} }
/* Add the SUDO_USER, SUDO_UID, SUDO_GID environment variables. */ /* Add the SUDO_USER, SUDO_UID, SUDO_GID environment variables. */
if (sudo_setenv2("SUDO_USER", user_name, true, true) == -1) CHECK_SETENV2("SUDO_USER", user_name, true, true);
goto bad;
snprintf(idbuf, sizeof(idbuf), "%u", (unsigned int) user_uid); snprintf(idbuf, sizeof(idbuf), "%u", (unsigned int) user_uid);
if (sudo_setenv2("SUDO_UID", idbuf, true, true) == -1) CHECK_SETENV2("SUDO_UID", idbuf, true, true);
goto bad;
snprintf(idbuf, sizeof(idbuf), "%u", (unsigned int) user_gid); snprintf(idbuf, sizeof(idbuf), "%u", (unsigned int) user_gid);
if (sudo_setenv2("SUDO_GID", idbuf, true, true) == -1) CHECK_SETENV2("SUDO_GID", idbuf, true, true);
goto bad;
debug_return_bool(true); debug_return_bool(true);
bad: bad:
sudo_warn(U_("unable to rebuild the environment"));
debug_return_bool(false); debug_return_bool(false);
} }
@@ -1177,7 +1190,11 @@ read_env_file(const char *path, int overwrite)
val_len -= 2; val_len -= 2;
} }
cp = sudo_emalloc(var_len + 1 + val_len + 1); if ((cp = malloc(var_len + 1 + val_len + 1)) == NULL) {
/* XXX - no undo on failure */
rval = false;
break;
}
memcpy(cp, var, var_len + 1); /* includes '=' */ memcpy(cp, var, var_len + 1); /* includes '=' */
memcpy(cp + var_len + 1, val, val_len + 1); /* includes NUL */ memcpy(cp + var_len + 1, val, val_len + 1); /* includes NUL */
@@ -1193,32 +1210,43 @@ read_env_file(const char *path, int overwrite)
debug_return_bool(rval); debug_return_bool(rval);
} }
void bool
init_envtables(void) init_envtables(void)
{ {
struct list_member *cur; struct list_member *cur;
const char **p; const char **p;
debug_decl(init_envtables, SUDOERS_DEBUG_ENV)
/* Fill in the "env_delete" list. */ /* Fill in the "env_delete" list. */
for (p = initial_badenv_table; *p; p++) { for (p = initial_badenv_table; *p; p++) {
cur = sudo_ecalloc(1, sizeof(struct list_member)); cur = calloc(1, sizeof(struct list_member));
cur->value = sudo_estrdup(*p); if (cur == NULL || (cur->value = strdup(*p)) == NULL) {
free(cur);
debug_return_bool(false);
}
SLIST_INSERT_HEAD(&def_env_delete, cur, entries); SLIST_INSERT_HEAD(&def_env_delete, cur, entries);
} }
/* Fill in the "env_check" list. */ /* Fill in the "env_check" list. */
for (p = initial_checkenv_table; *p; p++) { for (p = initial_checkenv_table; *p; p++) {
cur = sudo_ecalloc(1, sizeof(struct list_member)); cur = calloc(1, sizeof(struct list_member));
cur->value = sudo_estrdup(*p); if (cur == NULL || (cur->value = strdup(*p)) == NULL) {
free(cur);
debug_return_bool(false);
}
SLIST_INSERT_HEAD(&def_env_check, cur, entries); SLIST_INSERT_HEAD(&def_env_check, cur, entries);
} }
/* Fill in the "env_keep" list. */ /* Fill in the "env_keep" list. */
for (p = initial_keepenv_table; *p; p++) { for (p = initial_keepenv_table; *p; p++) {
cur = sudo_ecalloc(1, sizeof(struct list_member)); cur = calloc(1, sizeof(struct list_member));
cur->value = sudo_estrdup(*p); if (cur == NULL || (cur->value = strdup(*p)) == NULL) {
free(cur);
debug_return_bool(false);
}
SLIST_INSERT_HEAD(&def_env_keep, cur, entries); SLIST_INSERT_HEAD(&def_env_keep, cur, entries);
} }
debug_return_bool(true);
} }
int int

View File

@@ -53,15 +53,14 @@
* but it is in '.' and IGNORE_DOT is set. * but it is in '.' and IGNORE_DOT is set.
*/ */
int int
find_path(char *infile, char **outfile, struct stat *sbp, char *path, find_path(const char *infile, char **outfile, struct stat *sbp,
int ignore_dot) const char *path, int ignore_dot)
{ {
static char command[PATH_MAX]; /* qualified filename */ static char command[PATH_MAX];
char *n; /* for traversing path */ const char *cp, *ep, *pathend;
char *origpath; /* so we can free path later */ bool found = false;
bool found = false; /* did we find the command? */ bool checkdot = false;
bool checkdot = false; /* check current dir? */ int len;
int len; /* length parameter */
debug_decl(find_path, SUDOERS_DEBUG_UTIL) debug_decl(find_path, SUDOERS_DEBUG_UTIL)
if (strlen(infile) >= PATH_MAX) { if (strlen(infile) >= PATH_MAX) {
@@ -73,7 +72,7 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
* If we were given a fully qualified or relative path * If we were given a fully qualified or relative path
* there is no need to look at $PATH. * there is no need to look at $PATH.
*/ */
if (strchr(infile, '/')) { if (strchr(infile, '/') != NULL) {
strlcpy(command, infile, sizeof(command)); /* paranoia */ strlcpy(command, infile, sizeof(command)); /* paranoia */
if (sudo_goodpath(command, sbp)) { if (sudo_goodpath(command, sbp)) {
*outfile = command; *outfile = command;
@@ -84,39 +83,32 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
if (path == NULL) if (path == NULL)
debug_return_int(NOT_FOUND); debug_return_int(NOT_FOUND);
path = sudo_estrdup(path);
origpath = path;
do { pathend = path + strlen(path);
if ((n = strchr(path, ':'))) for (cp = sudo_strsplit(path, pathend, ":", &ep); cp != NULL;
*n = '\0'; cp = sudo_strsplit(NULL, pathend, ":", &ep)) {
/* /*
* Search current dir last if it is in PATH This will miss sneaky * Search current dir last if it is in PATH.
* things like using './' or './/' * This will miss sneaky things like using './' or './/' (XXX)
*/ */
if (*path == '\0' || (*path == '.' && *(path + 1) == '\0')) { if (cp == ep || (*cp == '.' && cp + 1 == ep)) {
checkdot = 1; checkdot = 1;
path = n + 1;
continue; continue;
} }
/* /*
* Resolve the path and exit the loop if found. * Resolve the path and exit the loop if found.
*/ */
len = snprintf(command, sizeof(command), "%s/%s", path, infile); len = snprintf(command, sizeof(command), "%.*s/%s",
(int)(ep - cp), cp, infile);
if (len <= 0 || (size_t)len >= sizeof(command)) { if (len <= 0 || (size_t)len >= sizeof(command)) {
sudo_efree(origpath);
errno = ENAMETOOLONG; errno = ENAMETOOLONG;
debug_return_int(NOT_FOUND_ERROR); debug_return_int(NOT_FOUND_ERROR);
} }
if ((found = sudo_goodpath(command, sbp))) if ((found = sudo_goodpath(command, sbp)))
break; break;
}
path = n + 1;
} while (n);
sudo_efree(origpath);
/* /*
* Check current dir if dot was in the PATH * Check current dir if dot was in the PATH

View File

@@ -142,7 +142,7 @@ sudo_getepw(const struct passwd *pw)
done: done:
#endif #endif
/* If no shadow password, fall back on regular password. */ /* If no shadow password, fall back on regular password. */
debug_return_str(sudo_estrdup(epw ? epw : pw->pw_passwd)); debug_return_str(strdup(epw ? epw : pw->pw_passwd));
} }
void void

View File

@@ -135,7 +135,11 @@ group_plugin_load(char *plugin_info)
} }
} }
if (ac != 0) { if (ac != 0) {
argv = sudo_emallocarray(ac, sizeof(char *)); argv = reallocarray(NULL, ac, sizeof(char *));
if (argv == NULL) {
sudo_warnx(U_("unable to allocate memory"));
goto done;
}
ac = 0; ac = 0;
for ((cp = strtok(args, " \t")); cp; (cp = strtok(NULL, " \t"))) for ((cp = strtok(args, " \t")); cp; (cp = strtok(NULL, " \t")))
argv[ac++] = cp; argv[ac++] = cp;
@@ -145,7 +149,7 @@ group_plugin_load(char *plugin_info)
rc = (group_plugin->init)(GROUP_API_VERSION, sudo_printf, argv); rc = (group_plugin->init)(GROUP_API_VERSION, sudo_printf, argv);
done: done:
sudo_efree(argv); free(argv);
if (rc != true) { if (rc != true) {
if (group_handle != NULL) { if (group_handle != NULL) {

View File

@@ -57,14 +57,16 @@ static struct interface_list interfaces;
* Parse a space-delimited list of IP address/netmask pairs and * Parse a space-delimited list of IP address/netmask pairs and
* store in a list of interface structures. * store in a list of interface structures.
*/ */
void bool
set_interfaces(const char *ai) set_interfaces(const char *ai)
{ {
char *addrinfo, *addr, *mask; char *addrinfo, *addr, *mask;
struct interface *ifp; struct interface *ifp;
bool rval = false;
debug_decl(set_interfaces, SUDOERS_DEBUG_NETIF) debug_decl(set_interfaces, SUDOERS_DEBUG_NETIF)
addrinfo = sudo_estrdup(ai); if ((addrinfo = strdup(ai)) == NULL)
debug_return_bool(false);
for (addr = strtok(addrinfo, " \t"); addr != NULL; addr = strtok(NULL, " \t")) { for (addr = strtok(addrinfo, " \t"); addr != NULL; addr = strtok(NULL, " \t")) {
/* Separate addr and mask. */ /* Separate addr and mask. */
if ((mask = strchr(addr, '/')) == NULL) if ((mask = strchr(addr, '/')) == NULL)
@@ -72,7 +74,8 @@ set_interfaces(const char *ai)
*mask++ = '\0'; *mask++ = '\0';
/* Parse addr and store in list. */ /* Parse addr and store in list. */
ifp = sudo_ecalloc(1, sizeof(*ifp)); if ((ifp = calloc(1, sizeof(*ifp))) == NULL)
goto done;
if (strchr(addr, ':')) { if (strchr(addr, ':')) {
/* IPv6 */ /* IPv6 */
#ifdef HAVE_STRUCT_IN6_ADDR #ifdef HAVE_STRUCT_IN6_ADDR
@@ -81,7 +84,7 @@ set_interfaces(const char *ai)
inet_pton(AF_INET6, mask, &ifp->netmask.ip6) != 1) inet_pton(AF_INET6, mask, &ifp->netmask.ip6) != 1)
#endif #endif
{ {
sudo_efree(ifp); free(ifp);
continue; continue;
} }
} else { } else {
@@ -89,14 +92,17 @@ set_interfaces(const char *ai)
ifp->family = AF_INET; ifp->family = AF_INET;
if (inet_pton(AF_INET, addr, &ifp->addr.ip4) != 1 || if (inet_pton(AF_INET, addr, &ifp->addr.ip4) != 1 ||
inet_pton(AF_INET, mask, &ifp->netmask.ip4) != 1) { inet_pton(AF_INET, mask, &ifp->netmask.ip4) != 1) {
sudo_efree(ifp); free(ifp);
continue; continue;
} }
} }
SLIST_INSERT_HEAD(&interfaces, ifp, entries); SLIST_INSERT_HEAD(&interfaces, ifp, entries);
} }
sudo_efree(addrinfo); rval = true;
debug_return;
done:
free(addrinfo);
debug_return_bool(rval);
} }
struct interface_list * struct interface_list *
@@ -111,12 +117,15 @@ dump_interfaces(const char *ai)
char *cp, *addrinfo; char *cp, *addrinfo;
debug_decl(set_interfaces, SUDOERS_DEBUG_NETIF) debug_decl(set_interfaces, SUDOERS_DEBUG_NETIF)
addrinfo = sudo_estrdup(ai); if ((addrinfo = strdup(ai)) == NULL) {
sudo_warnx(U_("unable to allocate memory"));
sudo_printf(SUDO_CONV_INFO_MSG, _("Local IP address and netmask pairs:\n")); } else {
sudo_printf(SUDO_CONV_INFO_MSG,
_("Local IP address and netmask pairs:\n"));
for (cp = strtok(addrinfo, " \t"); cp != NULL; cp = strtok(NULL, " \t")) for (cp = strtok(addrinfo, " \t"); cp != NULL; cp = strtok(NULL, " \t"))
sudo_printf(SUDO_CONV_INFO_MSG, "\t%s\n", cp); sudo_printf(SUDO_CONV_INFO_MSG, "\t%s\n", cp);
sudo_efree(addrinfo); free(addrinfo);
}
debug_return; debug_return;
} }

View File

@@ -49,7 +49,7 @@ SLIST_HEAD(interface_list, interface);
*/ */
int get_net_ifs(char **addrinfo); int get_net_ifs(char **addrinfo);
void dump_interfaces(const char *); void dump_interfaces(const char *);
void set_interfaces(const char *); bool set_interfaces(const char *);
struct interface_list *get_interfaces(void); struct interface_list *get_interfaces(void);
#endif /* SUDOERS_INTERFACES_H */ #endif /* SUDOERS_INTERFACES_H */

View File

@@ -571,7 +571,7 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation,
char pathbuf[PATH_MAX], sessid[7]; char pathbuf[PATH_MAX], sessid[7];
char *tofree = NULL; char *tofree = NULL;
char * const *cur; char * const *cur;
const char *plugin_path = NULL; const char *cp, *plugin_path = NULL;
size_t len; size_t len;
int i, rval = -1; int i, rval = -1;
debug_decl(sudoers_io_open, SUDOERS_DEBUG_PLUGIN) debug_decl(sudoers_io_open, SUDOERS_DEBUG_PLUGIN)
@@ -593,10 +593,11 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation,
} }
/* Initialize the debug subsystem. */ /* Initialize the debug subsystem. */
for (cur = settings; *cur != NULL; cur++) { for (cur = settings; (cp = *cur) != NULL; cur++) {
if (strncmp(*cur, "debug_flags=", sizeof("debug_flags=") - 1) == 0) { if (strncmp(cp, "debug_flags=", sizeof("debug_flags=") - 1) == 0) {
sudoers_debug_parse_flags(&debug_files, cp += sizeof("debug_flags=") - 1;
*cur + sizeof("debug_flags=") - 1); if (!sudoers_debug_parse_flags(&debug_files, cp))
debug_return_int(-1);
continue; continue;
} }
if (strncmp(*cur, "plugin_path=", sizeof("plugin_path=") - 1) == 0) { if (strncmp(*cur, "plugin_path=", sizeof("plugin_path=") - 1) == 0) {
@@ -617,7 +618,11 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation,
/* If no I/O log path defined we need to figure it out ourselves. */ /* If no I/O log path defined we need to figure it out ourselves. */
if (details.iolog_path == NULL) { if (details.iolog_path == NULL) {
/* Get next session ID and convert it into a path. */ /* Get next session ID and convert it into a path. */
tofree = sudo_emalloc(sizeof(_PATH_SUDO_IO_LOGDIR) + sizeof(sessid) + 2); tofree = malloc(sizeof(_PATH_SUDO_IO_LOGDIR) + sizeof(sessid) + 2);
if (tofree == NULL) {
sudo_warnx(U_("unable to allocate memory"));
goto done;
}
memcpy(tofree, _PATH_SUDO_IO_LOGDIR, sizeof(_PATH_SUDO_IO_LOGDIR)); memcpy(tofree, _PATH_SUDO_IO_LOGDIR, sizeof(_PATH_SUDO_IO_LOGDIR));
if (!io_nextid(tofree, NULL, sessid)) { if (!io_nextid(tofree, NULL, sessid)) {
rval = false; rval = false;
@@ -665,7 +670,7 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation,
rval = true; rval = true;
done: done:
sudo_efree(tofree); free(tofree);
if (details.runas_pw) if (details.runas_pw)
sudo_pw_delref(details.runas_pw); sudo_pw_delref(details.runas_pw);
sudo_endpwent(); sudo_endpwent();

View File

@@ -172,7 +172,11 @@ expand_iolog_path(const char *prefix, const char *dir, const char *file,
/* Expanded path must be <= PATH_MAX */ /* Expanded path must be <= PATH_MAX */
if (prefix != NULL) if (prefix != NULL)
prelen = strlen(prefix); prelen = strlen(prefix);
dst = path = sudo_emalloc(prelen + PATH_MAX); dst = path = malloc(prelen + PATH_MAX);
if (path == NULL) {
sudo_warnx(U_("unable to allocate memory"));
goto bad;
}
*path = '\0'; *path = '\0';
pathend = path + prelen + PATH_MAX; pathend = path + prelen + PATH_MAX;
@@ -282,6 +286,6 @@ expand_iolog_path(const char *prefix, const char *dir, const char *file,
debug_return_str(path); debug_return_str(path);
bad: bad:
sudo_efree(path); free(path);
debug_return_str(NULL); debug_return_str(NULL);
} }

View File

@@ -78,7 +78,11 @@ linux_audit_command(char *argv[], int result)
/* Convert argv to a flat string. */ /* Convert argv to a flat string. */
for (size = 0, av = argv; *av != NULL; av++) for (size = 0, av = argv; *av != NULL; av++)
size += strlen(*av) + 1; size += strlen(*av) + 1;
command = cp = sudo_emalloc(size); command = cp = malloc(size);
if (command == NULL) {
sudo_warn(U_("unable to allocate memory"));
goto done;
}
for (av = argv; *av != NULL; av++) { for (av = argv; *av != NULL; av++) {
n = strlcpy(cp, *av, size - (cp - command)); n = strlcpy(cp, *av, size - (cp - command));
if (n >= size - (cp - command)) { if (n >= size - (cp - command)) {
@@ -101,7 +105,7 @@ linux_audit_command(char *argv[], int result)
rc = 0; rc = 0;
done: done:
sudo_efree(command); free(command);
debug_return_int(rc); debug_return_int(rc);
} }

View File

@@ -43,7 +43,6 @@
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_fatal.h" #include "sudo_fatal.h"
#include "sudo_alloc.h"
#include "logging.h" #include "logging.h"
static int current_locale = SUDOERS_LOCALE_USER; static int current_locale = SUDOERS_LOCALE_USER;
@@ -56,17 +55,20 @@ sudoers_getlocale(void)
return current_locale; return current_locale;
} }
void bool
sudoers_initlocale(const char *ulocale, const char *slocale) sudoers_initlocale(const char *ulocale, const char *slocale)
{ {
if (ulocale != NULL) { if (ulocale != NULL) {
sudo_efree(user_locale); free(user_locale);
user_locale = sudo_estrdup(ulocale); if ((user_locale = strdup(ulocale)) == NULL)
return false;
} }
if (slocale != NULL) { if (slocale != NULL) {
sudo_efree(sudoers_locale); free(sudoers_locale);
sudoers_locale = sudo_estrdup(slocale); if ((sudoers_locale = strdup(slocale)) == NULL)
return false;
} }
return true;
} }
/* /*
@@ -87,8 +89,11 @@ sudoers_setlocale(int newlocale, int *prevlocale)
if (current_locale != SUDOERS_LOCALE_USER) { if (current_locale != SUDOERS_LOCALE_USER) {
current_locale = SUDOERS_LOCALE_USER; current_locale = SUDOERS_LOCALE_USER;
res = setlocale(LC_ALL, user_locale ? user_locale : ""); res = setlocale(LC_ALL, user_locale ? user_locale : "");
if (res != NULL && user_locale == NULL) if (res != NULL && user_locale == NULL) {
user_locale = sudo_estrdup(setlocale(LC_ALL, NULL)); user_locale = strdup(setlocale(LC_ALL, NULL));
if (user_locale == NULL)
res = NULL;
}
} }
break; break;
case SUDOERS_LOCALE_SUDOERS: case SUDOERS_LOCALE_SUDOERS:
@@ -99,8 +104,9 @@ sudoers_setlocale(int newlocale, int *prevlocale)
res = setlocale(LC_ALL, sudoers_locale ? sudoers_locale : "C"); res = setlocale(LC_ALL, sudoers_locale ? sudoers_locale : "C");
if (res == NULL && sudoers_locale != NULL) { if (res == NULL && sudoers_locale != NULL) {
if (strcmp(sudoers_locale, "C") != 0) { if (strcmp(sudoers_locale, "C") != 0) {
sudo_efree(sudoers_locale); free(sudoers_locale);
sudoers_locale = sudo_estrdup("C"); sudoers_locale = strdup("C");
if (sudoers_locale != NULL)
res = setlocale(LC_ALL, "C"); res = setlocale(LC_ALL, "C");
} }
} }

View File

@@ -73,7 +73,7 @@ bool log_denial(int status, bool inform_user);
bool log_failure(int status, int flags); bool log_failure(int status, int flags);
bool log_warning(int flags, const char *fmt, ...) __printflike(2, 3); bool log_warning(int flags, const char *fmt, ...) __printflike(2, 3);
bool log_warningx(int flags, const char *fmt, ...) __printflike(2, 3); bool log_warningx(int flags, const char *fmt, ...) __printflike(2, 3);
void sudoers_initlocale(const char *ulocale, const char *slocale); bool sudoers_initlocale(const char *ulocale, const char *slocale);
void writeln_wrap(FILE *fp, char *line, size_t len, size_t maxlen); void writeln_wrap(FILE *fp, char *line, size_t len, size_t maxlen);
#endif /* SUDOERS_LOGGING_H */ #endif /* SUDOERS_LOGGING_H */

View File

@@ -413,8 +413,7 @@ command_matches(const char *sudoers_cmnd, const char *sudoers_args, const struct
if (strcmp(sudoers_cmnd, "sudoedit") == 0 && if (strcmp(sudoers_cmnd, "sudoedit") == 0 &&
strcmp(user_cmnd, "sudoedit") == 0 && strcmp(user_cmnd, "sudoedit") == 0 &&
command_args_match(sudoers_cmnd, sudoers_args)) { command_args_match(sudoers_cmnd, sudoers_args)) {
sudo_efree(safe_cmnd); /* No need to set safe_cmnd since user_cmnd matches sudoers_cmnd */
safe_cmnd = sudo_estrdup(sudoers_cmnd);
rc = true; rc = true;
} }
goto done; goto done;
@@ -460,9 +459,7 @@ command_matches_fnmatch(const char *sudoers_cmnd, const char *sudoers_args)
if (fnmatch(sudoers_cmnd, user_cmnd, FNM_PATHNAME) != 0) if (fnmatch(sudoers_cmnd, user_cmnd, FNM_PATHNAME) != 0)
debug_return_bool(false); debug_return_bool(false);
if (command_args_match(sudoers_cmnd, sudoers_args)) { if (command_args_match(sudoers_cmnd, sudoers_args)) {
if (safe_cmnd) /* No need to set safe_cmnd since user_cmnd matches sudoers_cmnd */
free(safe_cmnd);
safe_cmnd = sudo_estrdup(user_cmnd);
debug_return_bool(true); debug_return_bool(true);
} }
debug_return_bool(false); debug_return_bool(false);
@@ -523,8 +520,11 @@ command_matches_glob(const char *sudoers_cmnd, const char *sudoers_args)
if (user_stat == NULL || if (user_stat == NULL ||
(user_stat->st_dev == sudoers_stat.st_dev && (user_stat->st_dev == sudoers_stat.st_dev &&
user_stat->st_ino == sudoers_stat.st_ino)) { user_stat->st_ino == sudoers_stat.st_ino)) {
sudo_efree(safe_cmnd); free(safe_cmnd);
safe_cmnd = sudo_estrdup(cp); if ((safe_cmnd = strdup(cp)) == NULL) {
sudo_warnx(U_("unable to allocate memory"));
cp = NULL; /* fail closed */
}
break; break;
} }
} }
@@ -533,8 +533,7 @@ command_matches_glob(const char *sudoers_cmnd, const char *sudoers_args)
debug_return_bool(false); debug_return_bool(false);
if (command_args_match(sudoers_cmnd, sudoers_args)) { if (command_args_match(sudoers_cmnd, sudoers_args)) {
sudo_efree(safe_cmnd); /* safe_cmnd was set above. */
safe_cmnd = sudo_estrdup(user_cmnd);
debug_return_bool(true); debug_return_bool(true);
} }
debug_return_bool(false); debug_return_bool(false);
@@ -556,9 +555,10 @@ command_matches_normal(const char *sudoers_cmnd, const char *sudoers_args, const
if (strcmp(user_cmnd, sudoers_cmnd) == 0) { if (strcmp(user_cmnd, sudoers_cmnd) == 0) {
if (command_args_match(sudoers_cmnd, sudoers_args)) { if (command_args_match(sudoers_cmnd, sudoers_args)) {
sudo_efree(safe_cmnd); free(safe_cmnd);
safe_cmnd = sudo_estrdup(sudoers_cmnd); if ((safe_cmnd = strdup(sudoers_cmnd)) != NULL)
debug_return_bool(true); debug_return_bool(true);
sudo_warnx(U_("unable to allocate memory"));
} }
} }
debug_return_bool(false); debug_return_bool(false);
@@ -714,8 +714,11 @@ command_matches_normal(const char *sudoers_cmnd, const char *sudoers_args, const
/* XXX - log functions not available but we should log very loudly */ /* XXX - log functions not available but we should log very loudly */
debug_return_bool(false); debug_return_bool(false);
} }
sudo_efree(safe_cmnd); free(safe_cmnd);
safe_cmnd = sudo_estrdup(sudoers_cmnd); if ((safe_cmnd = strdup(sudoers_cmnd)) == NULL) {
sudo_warnx(U_("unable to allocate memory"));
debug_return_bool(false);
}
debug_return_bool(true); debug_return_bool(true);
} }
#endif /* SUDOERS_NAME_MATCH */ #endif /* SUDOERS_NAME_MATCH */
@@ -768,8 +771,11 @@ command_matches_dir(const char *sudoers_dir, size_t dlen)
if (user_stat == NULL || if (user_stat == NULL ||
(user_stat->st_dev == sudoers_stat.st_dev && (user_stat->st_dev == sudoers_stat.st_dev &&
user_stat->st_ino == sudoers_stat.st_ino)) { user_stat->st_ino == sudoers_stat.st_ino)) {
sudo_efree(safe_cmnd); free(safe_cmnd);
safe_cmnd = sudo_estrdup(buf); if ((safe_cmnd = strdup(buf)) == NULL) {
sudo_warnx(U_("unable to allocate memory"));
dent = NULL;
}
break; break;
} }
} }
@@ -944,7 +950,7 @@ sudo_getdomainname(void)
for (cp = domain; *cp != '\0'; cp++) { for (cp = domain; *cp != '\0'; cp++) {
/* Check for illegal characters, Linux may use "(none)". */ /* Check for illegal characters, Linux may use "(none)". */
if (*cp == '(' || *cp == ')' || *cp == ',' || *cp == ' ') { if (*cp == '(' || *cp == ')' || *cp == ',' || *cp == ' ') {
sudo_efree(domain); free(domain);
domain = NULL; domain = NULL;
break; break;
} }

View File

@@ -237,17 +237,57 @@ sudo_file_lookup(struct sudo_nss *nss, int validated, int pwflag)
tags = &cs->tags; tags = &cs->tags;
#ifdef HAVE_SELINUX #ifdef HAVE_SELINUX
/* Set role and type if not specified on command line. */ /* Set role and type if not specified on command line. */
if (user_role == NULL) if (user_role == NULL) {
user_role = cs->role ? sudo_estrdup(cs->role) : def_role; if (cs->role != NULL) {
if (user_type == NULL) user_role = strdup(cs->role);
user_type = cs->type ? sudo_estrdup(cs->type) : def_type; if (user_role == NULL) {
sudo_warnx(U_("unable to allocate memory"));
SET(validated, VALIDATE_ERROR);
goto done;
}
} else {
user_role = def_role;
}
}
if (user_type == NULL) {
if (cs->type != NULL) {
user_type = strdup(cs->type);
if (user_type == NULL) {
sudo_warnx(U_("unable to allocate memory"));
SET(validated, VALIDATE_ERROR);
goto done;
}
} else {
user_type = def_type;
}
}
#endif /* HAVE_SELINUX */ #endif /* HAVE_SELINUX */
#ifdef HAVE_PRIV_SET #ifdef HAVE_PRIV_SET
/* Set Solaris privilege sets */ /* Set Solaris privilege sets */
if (runas_privs == NULL) if (runas_privs == NULL) {
runas_privs = cs->privs ? sudo_estrdup(cs->privs) : def_privs; if (cs->privs != NULL) {
if (runas_limitprivs == NULL) runas_privs = strdup(cs->privs);
runas_limitprivs = cs->limitprivs ? sudo_estrdup(cs->limitprivs) : def_limitprivs; if (runas_privs == NULL) {
sudo_warnx(U_("unable to allocate memory"));
SET(validated, VALIDATE_ERROR);
goto done;
}
} else {
runas_privs = def_privs;
}
}
if (runas_limitprivs == NULL) {
if (cs->limitprivs != NULL) {
runas_limitprivs = strdup(cs->limitprivs);
if (runas_limitprivs == NULL) {
sudo_warnx(U_("unable to allocate memory"));
SET(validated, VALIDATE_ERROR);
goto done;
}
} else {
runas_limitprivs = def_limitprivs;
}
}
#endif /* HAVE_PRIV_SET */ #endif /* HAVE_PRIV_SET */
/* /*
* If user is running command as himself, * If user is running command as himself,
@@ -307,6 +347,9 @@ sudo_file_lookup(struct sudo_nss *nss, int validated, int pwflag)
} }
} }
} }
#if defined(HAVE_SELINUX) || defined(HAVE_PRIV_SET)
done:
#endif
(void) restore_perms(); (void) restore_perms();
debug_return_int(validated); debug_return_int(validated);
} }

View File

@@ -248,7 +248,10 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
#endif /* HAVE_BSD_AUTH_H */ #endif /* HAVE_BSD_AUTH_H */
if (MATCHES(*cur, "network_addrs=")) { if (MATCHES(*cur, "network_addrs=")) {
interfaces_string = *cur + sizeof("network_addrs=") - 1; interfaces_string = *cur + sizeof("network_addrs=") - 1;
set_interfaces(interfaces_string); if (!set_interfaces(interfaces_string)) {
sudo_warn(U_("unable to parse network address list"));
goto bad;
}
continue; continue;
} }
if (MATCHES(*cur, "max_groups=")) { if (MATCHES(*cur, "max_groups=")) {
@@ -269,7 +272,8 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
for (cur = info->user_info; *cur != NULL; cur++) { for (cur = info->user_info; *cur != NULL; cur++) {
if (MATCHES(*cur, "user=")) { if (MATCHES(*cur, "user=")) {
user_name = sudo_estrdup(*cur + sizeof("user=") - 1); if ((user_name = strdup(*cur + sizeof("user=") - 1)) == NULL)
goto oom;
continue; continue;
} }
if (MATCHES(*cur, "uid=")) { if (MATCHES(*cur, "uid=")) {
@@ -295,19 +299,28 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
continue; continue;
} }
if (MATCHES(*cur, "cwd=")) { if (MATCHES(*cur, "cwd=")) {
user_cwd = sudo_estrdup(*cur + sizeof("cwd=") - 1); if ((user_cwd = strdup(*cur + sizeof("cwd=") - 1)) == NULL)
goto oom;
continue; continue;
} }
if (MATCHES(*cur, "tty=")) { if (MATCHES(*cur, "tty=")) {
user_tty = user_ttypath = sudo_estrdup(*cur + sizeof("tty=") - 1); if ((user_ttypath = strdup(*cur + sizeof("tty=") - 1)) == NULL)
goto oom;
user_tty = user_ttypath;
if (strncmp(user_tty, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) if (strncmp(user_tty, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0)
user_tty += sizeof(_PATH_DEV) - 1; user_tty += sizeof(_PATH_DEV) - 1;
continue; continue;
} }
if (MATCHES(*cur, "host=")) { if (MATCHES(*cur, "host=")) {
user_host = user_shost = sudo_estrdup(*cur + sizeof("host=") - 1); if ((user_host = strdup(*cur + sizeof("host=") - 1)) == NULL)
if ((p = strchr(user_host, '.'))) goto oom;
user_shost = sudo_estrndup(user_host, (size_t)(p - user_host)); if ((p = strchr(user_host, '.')) != NULL) {
user_shost = strndup(user_host, (size_t)(p - user_host));
if (user_shost == NULL)
goto oom;
} else {
user_shost = user_host;
}
continue; continue;
} }
if (MATCHES(*cur, "lines=")) { if (MATCHES(*cur, "lines=")) {
@@ -340,13 +353,24 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
continue; continue;
} }
} }
user_runhost = user_srunhost = sudo_estrdup(remhost ? remhost : user_host); if ((user_runhost = strdup(remhost ? remhost : user_host)) == NULL)
if ((p = strchr(user_runhost, '.'))) goto oom;
user_srunhost = sudo_estrndup(user_runhost, (size_t)(p - user_runhost)); if ((p = strchr(user_runhost, '.')) != NULL) {
if (user_cwd == NULL) user_srunhost = strndup(user_runhost, (size_t)(p - user_runhost));
user_cwd = sudo_estrdup("unknown"); if (user_srunhost == NULL)
if (user_tty == NULL) goto oom;
user_tty = sudo_estrdup("unknown"); /* user_ttypath remains NULL */ } else {
user_srunhost = user_runhost;
}
if (user_cwd == NULL) {
if ((user_cwd = strdup("unknown")) == NULL)
goto oom;
}
if (user_tty == NULL) {
if ((user_tty = strdup("unknown")) == NULL)
goto oom;
/* user_ttypath remains NULL */
}
if (groups != NULL && groups[0] != '\0') { if (groups != NULL && groups[0] != '\0') {
/* sudo_parse_gids() will print a warning on error. */ /* sudo_parse_gids() will print a warning on error. */
@@ -368,6 +392,8 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
#undef MATCHES #undef MATCHES
debug_return_int(flags); debug_return_int(flags);
oom:
sudo_warnx(U_("unable to allocate memory"));
bad: bad:
debug_return_int(MODE_ERROR); debug_return_int(MODE_ERROR);
} }
@@ -573,7 +599,7 @@ sudoers_policy_open(unsigned int version, sudo_conv_t conversation,
{ {
struct sudo_conf_debug_file_list debug_files = TAILQ_HEAD_INITIALIZER(debug_files); struct sudo_conf_debug_file_list debug_files = TAILQ_HEAD_INITIALIZER(debug_files);
struct sudoers_policy_open_info info; struct sudoers_policy_open_info info;
const char *plugin_path = NULL; const char *cp, *plugin_path = NULL;
char * const *cur; char * const *cur;
debug_decl(sudoers_policy_open, SUDOERS_DEBUG_PLUGIN) debug_decl(sudoers_policy_open, SUDOERS_DEBUG_PLUGIN)
@@ -586,14 +612,15 @@ sudoers_policy_open(unsigned int version, sudo_conv_t conversation,
args = NULL; args = NULL;
/* Initialize the debug subsystem. */ /* Initialize the debug subsystem. */
for (cur = settings; *cur != NULL; cur++) { for (cur = settings; (cp = *cur) != NULL; cur++) {
if (strncmp(*cur, "debug_flags=", sizeof("debug_flags=") - 1) == 0) { if (strncmp(cp, "debug_flags=", sizeof("debug_flags=") - 1) == 0) {
sudoers_debug_parse_flags(&debug_files, cp += sizeof("debug_flags=") - 1;
*cur + sizeof("debug_flags=") - 1); if (!sudoers_debug_parse_flags(&debug_files, cp))
debug_return_int(-1);
continue; continue;
} }
if (strncmp(*cur, "plugin_path=", sizeof("plugin_path=") - 1) == 0) { if (strncmp(cp, "plugin_path=", sizeof("plugin_path=") - 1) == 0) {
plugin_path = *cur + sizeof("plugin_path=") - 1; plugin_path = cp + sizeof("plugin_path=") - 1;
continue; continue;
} }
} }
@@ -771,6 +798,14 @@ sudoers_policy_version(int verbose)
debug_return_int(true); debug_return_int(true);
} }
static struct sudo_hook sudoers_hooks[] = {
{ SUDO_HOOK_VERSION, SUDO_HOOK_SETENV, sudoers_hook_setenv, NULL },
{ SUDO_HOOK_VERSION, SUDO_HOOK_UNSETENV, sudoers_hook_unsetenv, NULL },
{ SUDO_HOOK_VERSION, SUDO_HOOK_GETENV, sudoers_hook_getenv, NULL },
{ SUDO_HOOK_VERSION, SUDO_HOOK_PUTENV, sudoers_hook_putenv, NULL },
{ -1, -1, NULL, NULL }
};
/* /*
* Register environment function hooks. * Register environment function hooks.
* Note that we have not registered sudoers with the debug subsystem yet. * Note that we have not registered sudoers with the debug subsystem yet.
@@ -778,26 +813,16 @@ sudoers_policy_version(int verbose)
static void static void
sudoers_policy_register_hooks(int version, int (*register_hook)(struct sudo_hook *hook)) sudoers_policy_register_hooks(int version, int (*register_hook)(struct sudo_hook *hook))
{ {
struct sudo_hook hook; struct sudo_hook *hook;
memset(&hook, 0, sizeof(hook)); for (hook = sudoers_hooks; hook->hook_fn != NULL; hook++) {
hook.hook_version = SUDO_HOOK_VERSION; if (register_hook(hook) != 0) {
sudo_warn_nodebug(
hook.hook_type = SUDO_HOOK_SETENV; U_("unable to register hook of type %d (version %d.%d)"),
hook.hook_fn = sudoers_hook_setenv; hook->hook_type,SUDO_HOOK_VERSION_GET_MAJOR(hook->hook_version),
register_hook(&hook); SUDO_HOOK_VERSION_GET_MINOR(hook->hook_version));
}
hook.hook_type = SUDO_HOOK_UNSETENV; }
hook.hook_fn = sudoers_hook_unsetenv;
register_hook(&hook);
hook.hook_type = SUDO_HOOK_GETENV;
hook.hook_fn = sudoers_hook_getenv;
register_hook(&hook);
hook.hook_type = SUDO_HOOK_PUTENV;
hook.hook_fn = sudoers_hook_putenv;
register_hook(&hook);
} }
__dso_public struct policy_plugin sudoers_policy = { __dso_public struct policy_plugin sudoers_policy = {

View File

@@ -96,8 +96,12 @@ expand_prompt(const char *old_prompt, const char *auth_user)
} }
} }
if ((new_prompt = malloc(++len)) == NULL) {
sudo_warnx(U_("unable to allocate memory"));
debug_return_str(NULL);
}
if (subst) { if (subst) {
new_prompt = sudo_emalloc(++len);
endp = new_prompt + len; endp = new_prompt + len;
for (p = old_prompt, np = new_prompt; *p; p++) { for (p = old_prompt, np = new_prompt; *p; p++) {
if (p[0] =='%') { if (p[0] =='%') {
@@ -151,13 +155,16 @@ expand_prompt(const char *old_prompt, const char *auth_user)
goto oflow; goto oflow;
} }
*np = '\0'; *np = '\0';
} else } else {
new_prompt = sudo_estrdup(old_prompt); /* Nothing to expand. */
memcpy(new_prompt, old_prompt, len); /* len includes NUL */
}
debug_return_str(new_prompt); debug_return_str(new_prompt);
oflow: oflow:
/* We pre-allocate enough space, so this should never happen. */ /* We pre-allocate enough space, so this should never happen. */
free(new_prompt);
sudo_warnx(U_("internal error, %s overflow"), __func__); sudo_warnx(U_("internal error, %s overflow"), __func__);
debug_return_str(NULL); debug_return_str(NULL);
} }

View File

@@ -80,6 +80,8 @@ do_check(char *dir_in, char *file_in, char *tdir_out, char *tfile_out)
strftime(file_out, sizeof(file_out), tfile_out, timeptr); strftime(file_out, sizeof(file_out), tfile_out, timeptr);
path = expand_iolog_path(NULL, dir_in, file_in, &slash); path = expand_iolog_path(NULL, dir_in, file_in, &slash);
if (path == NULL)
sudo_fatalx("unable to expand I/O log path");
*slash = '\0'; *slash = '\0';
if (strcmp(path, dir_out) != 0) { if (strcmp(path, dir_out) != 0) {
sudo_warnx("%s: expected %s, got %s", dir_in, dir_out, path); sudo_warnx("%s: expected %s, got %s", dir_in, dir_out, path);

View File

@@ -131,7 +131,10 @@ main(int argc, char *argv[])
continue; continue;
if (strncmp(line, "interfaces:", sizeof("interfaces:") - 1) == 0) { if (strncmp(line, "interfaces:", sizeof("interfaces:") - 1) == 0) {
set_interfaces(line + sizeof("interfaces:") - 1); if (!set_interfaces(line + sizeof("interfaces:") - 1)) {
sudo_warn("unable to parse interfaces list");
errors++;
}
} else if (strncmp(line, "address:", sizeof("address:") - 1) == 0) { } else if (strncmp(line, "address:", sizeof("address:") - 1) == 0) {
errors += check_addr(line + sizeof("address:") - 1); errors += check_addr(line + sizeof("address:") - 1);
ntests++; ntests++;

View File

@@ -88,7 +88,7 @@ static bool cb_sudoers_locale(const char *);
static int set_cmnd(void); static int set_cmnd(void);
static void create_admin_success_flag(void); static void create_admin_success_flag(void);
static bool init_vars(char * const *); static bool init_vars(char * const *);
static void set_fqdn(void); static bool set_fqdn(void);
static bool set_loginclass(struct passwd *); static bool set_loginclass(struct passwd *);
static bool set_runasgr(const char *, bool); static bool set_runasgr(const char *, bool);
static bool set_runaspw(const char *, bool); static bool set_runaspw(const char *, bool);
@@ -178,10 +178,14 @@ sudoers_policy_init(void *info, char * const envp[])
sudo_fatal_callback_register(sudoers_cleanup); sudo_fatal_callback_register(sudoers_cleanup);
/* Initialize environment functions (including replacements). */ /* Initialize environment functions (including replacements). */
env_init(envp); if (!env_init(envp))
debug_return_int(-1);
/* Setup defaults data structures. */ /* Setup defaults data structures. */
init_defaults(); if (!init_defaults()) {
sudo_warnx(U_("unable to initialize sudoers default values"));
debug_return_int(-1);
}
/* Parse info from front-end. */ /* Parse info from front-end. */
sudo_mode = sudoers_policy_deserialize_info(info, &runas_user, &runas_group); sudo_mode = sudoers_policy_deserialize_info(info, &runas_user, &runas_group);
@@ -299,17 +303,34 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
*/ */
if (argc == 0) { if (argc == 0) {
NewArgc = 1; NewArgc = 1;
NewArgv = sudo_emallocarray(NewArgc + 1, sizeof(char *)); NewArgv = reallocarray(NULL, NewArgc + 1, sizeof(char *));
if (NewArgv == NULL) {
sudo_warnx(U_("unable to allocate memory"));
rval = -1;
goto done;
}
NewArgv[0] = user_cmnd; NewArgv[0] = user_cmnd;
NewArgv[1] = NULL; NewArgv[1] = NULL;
} else { } else {
/* Must leave an extra slot before NewArgv for bash's --login */ /* Must leave an extra slot before NewArgv for bash's --login */
NewArgc = argc; NewArgc = argc;
NewArgv = sudo_emallocarray(NewArgc + 2, sizeof(char *)); NewArgv = reallocarray(NULL, NewArgc + 2, sizeof(char *));
if (NewArgv == NULL) {
sudo_warnx(U_("unable to allocate memory"));
rval = -1;
goto done;
}
memcpy(++NewArgv, argv, argc * sizeof(char *)); memcpy(++NewArgv, argv, argc * sizeof(char *));
NewArgv[NewArgc] = NULL; NewArgv[NewArgc] = NULL;
if (ISSET(sudo_mode, MODE_LOGIN_SHELL) && runas_pw != NULL) if (ISSET(sudo_mode, MODE_LOGIN_SHELL) && runas_pw != NULL) {
NewArgv[0] = sudo_estrdup(runas_pw->pw_shell); NewArgv[0] = strdup(runas_pw->pw_shell);
if (NewArgv[0] == NULL) {
sudo_warnx(U_("unable to allocate memory"));
free(NewArgv);
rval = -1;
goto done;
}
}
} }
/* If given the -P option, set the "preserve_groups" flag. */ /* If given the -P option, set the "preserve_groups" flag. */
@@ -359,8 +380,13 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
/* Restore user's locale. */ /* Restore user's locale. */
sudoers_setlocale(oldlocale, NULL); sudoers_setlocale(oldlocale, NULL);
if (safe_cmnd == NULL) if (safe_cmnd == NULL) {
safe_cmnd = sudo_estrdup(user_cmnd); if ((safe_cmnd = strdup(user_cmnd)) == NULL) {
sudo_warnx(U_("unable to allocate memory"));
rval = -1;
goto done;
}
}
/* If only a group was specified, set runas_pw based on invoking user. */ /* If only a group was specified, set runas_pw based on invoking user. */
if (runas_pw == NULL) { if (runas_pw == NULL) {
@@ -488,6 +514,8 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
const char prefix[] = "iolog_path="; const char prefix[] = "iolog_path=";
iolog_path = expand_iolog_path(prefix, def_iolog_dir, iolog_path = expand_iolog_path(prefix, def_iolog_dir,
def_iolog_file, &sudo_user.iolog_file); def_iolog_file, &sudo_user.iolog_file);
if (iolog_path == NULL)
goto bad;
sudo_user.iolog_file++; sudo_user.iolog_file++;
} }
} }
@@ -577,7 +605,7 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
if (ISSET(sudo_mode, MODE_EDIT)) { if (ISSET(sudo_mode, MODE_EDIT)) {
int edit_argc; int edit_argc;
sudo_efree(safe_cmnd); free(safe_cmnd);
safe_cmnd = find_editor(NewArgc - 1, NewArgv + 1, &edit_argc, &edit_argv); safe_cmnd = find_editor(NewArgc - 1, NewArgv + 1, &edit_argc, &edit_argv);
if (safe_cmnd == NULL || audit_success(edit_argc, edit_argv) != 0) if (safe_cmnd == NULL || audit_success(edit_argc, edit_argv) != 0)
goto bad; goto bad;
@@ -594,7 +622,7 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
env_get(), cmnd_umask, iolog_path, closure); env_get(), cmnd_umask, iolog_path, closure);
/* Zero out stashed copy of environment, it is owned by the front-end. */ /* Zero out stashed copy of environment, it is owned by the front-end. */
env_init(NULL); (void)env_init(NULL);
goto done; goto done;
@@ -626,7 +654,10 @@ init_vars(char * const envp[])
bool unknown_user = false; bool unknown_user = false;
debug_decl(init_vars, SUDOERS_DEBUG_PLUGIN) debug_decl(init_vars, SUDOERS_DEBUG_PLUGIN)
sudoers_initlocale(setlocale(LC_ALL, NULL), def_sudoers_locale); if (!sudoers_initlocale(setlocale(LC_ALL, NULL), def_sudoers_locale)) {
sudo_warnx(U_("unable to allocate memory"));
debug_return_bool(false);
}
for (ep = envp; *ep; ep++) { for (ep = envp; *ep; ep++) {
/* XXX - don't fill in if empty string */ /* XXX - don't fill in if empty string */
@@ -708,7 +739,11 @@ set_cmnd(void)
debug_decl(set_cmnd, SUDOERS_DEBUG_PLUGIN) debug_decl(set_cmnd, SUDOERS_DEBUG_PLUGIN)
/* Allocate user_stat for find_path() and match functions. */ /* Allocate user_stat for find_path() and match functions. */
user_stat = sudo_ecalloc(1, sizeof(struct stat)); user_stat = calloc(1, sizeof(struct stat));
if (user_stat == NULL) {
sudo_warnx(U_("unable to allocate memory"));
debug_return_int(NOT_FOUND_ERROR);
}
/* Default value for cmnd, overridden below. */ /* Default value for cmnd, overridden below. */
if (user_cmnd == NULL) if (user_cmnd == NULL)
@@ -749,7 +784,10 @@ set_cmnd(void)
/* Alloc and build up user_args. */ /* Alloc and build up user_args. */
for (size = 0, av = NewArgv + 1; *av; av++) for (size = 0, av = NewArgv + 1; *av; av++)
size += strlen(*av) + 1; size += strlen(*av) + 1;
user_args = sudo_emalloc(size); if (size == 0 || (user_args = malloc(size)) == NULL) {
sudo_warnx(U_("unable to allocate memory"));
debug_return_int(-1);
}
if (ISSET(sudo_mode, MODE_SHELL|MODE_LOGIN_SHELL)) { if (ISSET(sudo_mode, MODE_SHELL|MODE_LOGIN_SHELL)) {
/* /*
* When running a command via a shell, the sudo front-end * When running a command via a shell, the sudo front-end
@@ -928,71 +966,104 @@ set_loginclass(struct passwd *pw)
#endif #endif
/* /*
* Look up the fully qualified domain name of user_host and user_runhost. * Look up the fully qualified domain name of host.
* Sets user_host, user_shost, user_runhost and user_srunhost. * Returns true on success, setting longp and shortp.
* Use AI_FQDN if available since "canonical" is not always the same as fqdn. * Returns false on failure, longp and shortp are unchanged.
*/ */
static void static bool
set_fqdn(void) resolve_host(const char *host, char **longp, char **shortp)
{ {
struct addrinfo *res0, hint; struct addrinfo *res0, hint;
bool remote; char *cp, *lname, *sname;
char *p; debug_decl(resolve_host, SUDOERS_DEBUG_PLUGIN)
debug_decl(set_fqdn, SUDOERS_DEBUG_PLUGIN)
/* If the -h flag was given we need to resolve both host and runhost. */
remote = strcmp(user_runhost, user_host) != 0;
memset(&hint, 0, sizeof(hint)); memset(&hint, 0, sizeof(hint));
hint.ai_family = PF_UNSPEC; hint.ai_family = PF_UNSPEC;
hint.ai_flags = AI_FQDN; hint.ai_flags = AI_FQDN;
/* First resolve user_host, sets user_host and user_shost. */ if (getaddrinfo(host, NULL, &hint, &res0) != 0)
if (getaddrinfo(user_host, NULL, &hint, &res0) != 0) { debug_return_bool(false);
log_warningx(SLOG_SEND_MAIL|SLOG_RAW_MSG, if ((lname = strdup(res0->ai_canonname)) == NULL) {
N_("unable to resolve host %s"), user_host);
} else {
if (user_shost != user_host)
sudo_efree(user_shost);
sudo_efree(user_host);
user_host = user_shost = sudo_estrdup(res0->ai_canonname);
freeaddrinfo(res0); freeaddrinfo(res0);
if ((p = strchr(user_host, '.')) != NULL) debug_return_bool(false);
user_shost = sudo_estrndup(user_host, (size_t)(p - user_host));
} }
if ((cp = strchr(lname, '.')) != NULL) {
sname = strndup(lname, (size_t)(cp - lname));
if (sname == NULL) {
free(lname);
freeaddrinfo(res0);
debug_return_bool(false);
}
} else {
sname = lname;
}
freeaddrinfo(res0);
*longp = lname;
*shortp = sname;
/* Next resolve user_runhost, sets user_runhost and user_srunhost. */ debug_return_bool(true);
}
/*
* Look up the fully qualified domain name of user_host and user_runhost.
* Sets user_host, user_shost, user_runhost and user_srunhost.
* Use AI_FQDN if available since "canonical" is not always the same as fqdn.
*/
static bool
set_fqdn(void)
{
bool remote;
char *lhost, *shost;
debug_decl(set_fqdn, SUDOERS_DEBUG_PLUGIN)
/* If the -h flag was given we need to resolve both host and runhost. */
remote = strcmp(user_runhost, user_host) != 0;
/* First resolve user_host, setting user_host and user_shost. */
if (!resolve_host(user_host, &lhost, &shost)) {
if (!resolve_host(user_runhost, &lhost, &shost)) {
log_warning(SLOG_SEND_MAIL|SLOG_RAW_MSG,
N_("unable to resolve host %s"), user_host);
debug_return_bool(false);
}
}
if (user_shost != user_host)
free(user_shost);
free(user_host);
user_host = lhost;
user_shost = shost;
/* Next resolve user_runhost, setting user_runhost and user_srunhost. */
lhost = shost = NULL;
if (remote) { if (remote) {
if (getaddrinfo(user_runhost, NULL, &hint, &res0) != 0) { /* Failure checked below. */
log_warningx(SLOG_SEND_MAIL|SLOG_RAW_MSG, (void)resolve_host(user_runhost, &lhost, &shost);
N_("unable to resolve host %s"), user_runhost);
} else {
if (user_srunhost != user_runhost)
sudo_efree(user_srunhost);
sudo_efree(user_runhost);
user_runhost = user_srunhost = sudo_estrdup(res0->ai_canonname);
freeaddrinfo(res0);
if ((p = strchr(user_runhost, '.'))) {
user_srunhost =
sudo_estrndup(user_runhost, (size_t)(p - user_runhost));
}
}
} else { } else {
/* Not remote, just use user_host. */ /* Not remote, just use user_host. */
if ((lhost = strdup(user_host)) != NULL) {
if (user_shost != user_host)
shost = strdup(lhost);
else
shost = lhost;
}
}
if (lhost == NULL || shost == NULL) {
free(lhost);
free(shost);
log_warning(SLOG_SEND_MAIL|SLOG_RAW_MSG,
N_("unable to resolve host %s"), user_runhost);
debug_return_bool(false);
}
if (user_srunhost != user_runhost) if (user_srunhost != user_runhost)
sudo_efree(user_srunhost); free(user_srunhost);
sudo_efree(user_runhost); free(user_runhost);
user_runhost = user_srunhost = sudo_estrdup(user_host); user_runhost = lhost;
if ((p = strchr(user_runhost, '.'))) { user_srunhost = shost;
user_srunhost =
sudo_estrndup(user_runhost, (size_t)(p - user_runhost));
}
}
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO, sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
"host %s, shost %s, runhost %s, srunhost %s", "host %s, shost %s, runhost %s, srunhost %s",
user_host, user_shost, user_runhost, user_srunhost); user_host, user_shost, user_runhost, user_srunhost);
debug_return; debug_return_bool(true);
} }
/* /*
@@ -1075,8 +1146,7 @@ cb_runas_default(const char *user)
static bool static bool
cb_sudoers_locale(const char *locale) cb_sudoers_locale(const char *locale)
{ {
sudoers_initlocale(NULL, locale); return sudoers_initlocale(NULL, locale);
return true;
} }
/* /*

View File

@@ -35,7 +35,6 @@
#include <pathnames.h> #include <pathnames.h>
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_fatal.h" #include "sudo_fatal.h"
#include "sudo_alloc.h"
#include "sudo_queue.h" #include "sudo_queue.h"
#include "defaults.h" #include "defaults.h"
#include "logging.h" #include "logging.h"
@@ -227,7 +226,7 @@ struct timeval;
bool sudo_goodpath(const char *, struct stat *); bool sudo_goodpath(const char *, struct stat *);
/* findpath.c */ /* findpath.c */
int find_path(char *, char **, struct stat *, char *, int); int find_path(const char *, char **, struct stat *, const char *, int);
/* check.c */ /* check.c */
int check_user(int validate, int mode); int check_user(int validate, int mode);
@@ -326,8 +325,8 @@ char *expand_iolog_path(const char *prefix, const char *dir, const char *file,
char **env_get(void); char **env_get(void);
bool env_merge(char * const envp[]); bool env_merge(char * const envp[]);
bool env_swap_old(void); bool env_swap_old(void);
void env_init(char * const envp[]); bool env_init(char * const envp[]);
void init_envtables(void); bool init_envtables(void);
bool insert_env_vars(char * const envp[]); bool insert_env_vars(char * const envp[]);
bool read_env_file(const char *, int); bool read_env_file(const char *, int);
bool rebuild_env(void); bool rebuild_env(void);
@@ -354,7 +353,7 @@ extern sudo_conv_t sudo_conv;
extern sudo_printf_t sudo_printf; extern sudo_printf_t sudo_printf;
/* sudoers_debug.c */ /* sudoers_debug.c */
void sudoers_debug_parse_flags(struct sudo_conf_debug_file_list *debug_files, const char *entry); bool sudoers_debug_parse_flags(struct sudo_conf_debug_file_list *debug_files, const char *entry);
void sudoers_debug_register(const char *plugin_path, struct sudo_conf_debug_file_list *debug_files); void sudoers_debug_register(const char *plugin_path, struct sudo_conf_debug_file_list *debug_files);
void sudoers_debug_deregister(void); void sudoers_debug_deregister(void);

View File

@@ -77,7 +77,7 @@ unsigned int sudoers_subsystem_ids[NUM_SUBSYSTEMS];
* Parse the "filename flags,..." debug_flags entry and insert a new * Parse the "filename flags,..." debug_flags entry and insert a new
* sudo_debug_file struct into debug_files. * sudo_debug_file struct into debug_files.
*/ */
void bool
sudoers_debug_parse_flags(struct sudo_conf_debug_file_list *debug_files, sudoers_debug_parse_flags(struct sudo_conf_debug_file_list *debug_files,
const char *entry) const char *entry)
{ {
@@ -87,22 +87,33 @@ sudoers_debug_parse_flags(struct sudo_conf_debug_file_list *debug_files,
/* Already initialized? */ /* Already initialized? */
if (sudoers_debug_instance != SUDO_DEBUG_INSTANCE_INITIALIZER) if (sudoers_debug_instance != SUDO_DEBUG_INSTANCE_INITIALIZER)
return; return true;
/* Process new-style debug flags: filename flags,... */ /* Only process new-style debug flags: filename flags,... */
filename = entry; filename = entry;
if (*filename != '/' || (flags = strpbrk(filename, " \t")) == NULL) if (*filename != '/' || (flags = strpbrk(filename, " \t")) == NULL)
return; return true;
namelen = (size_t)(flags - filename); namelen = (size_t)(flags - filename);
while (isblank((unsigned char)*flags)) while (isblank((unsigned char)*flags))
flags++; flags++;
if (*flags == '\0') if (*flags != '\0') {
return; if ((debug_file = calloc(1, sizeof(*debug_file))) == NULL)
goto oom;
debug_file = sudo_emalloc(sizeof(*debug_file)); if ((debug_file->debug_file = strndup(filename, namelen)) == NULL)
debug_file->debug_file = sudo_estrndup(filename, namelen); goto oom;
debug_file->debug_flags = sudo_estrdup(flags); if ((debug_file->debug_flags = strdup(flags)) == NULL)
goto oom;
TAILQ_INSERT_TAIL(debug_files, debug_file, entries); TAILQ_INSERT_TAIL(debug_files, debug_file, entries);
}
return true;
oom:
if (debug_file != NULL) {
free(debug_file->debug_file);
free(debug_file->debug_flags);
free(debug_file);
}
sudo_warnx_nodebug(U_("unable to allocate memory"));
return false;
} }
/* /*
@@ -123,9 +134,9 @@ sudoers_debug_register(const char *program,
} }
TAILQ_FOREACH_SAFE(debug_file, debug_files, entries, debug_next) { TAILQ_FOREACH_SAFE(debug_file, debug_files, entries, debug_next) {
TAILQ_REMOVE(debug_files, debug_file, entries); TAILQ_REMOVE(debug_files, debug_file, entries);
sudo_efree(debug_file->debug_file); free(debug_file->debug_file);
sudo_efree(debug_file->debug_flags); free(debug_file->debug_flags);
sudo_efree(debug_file); free(debug_file);
} }
} }
} }

View File

@@ -85,7 +85,6 @@
#include "sudo_gettext.h" /* must be included before sudo_compat.h */ #include "sudo_gettext.h" /* must be included before sudo_compat.h */
#include "sudo_compat.h" #include "sudo_compat.h"
#include "sudo_alloc.h"
#include "sudo_fatal.h" #include "sudo_fatal.h"
#include "logging.h" #include "logging.h"
#include "iolog.h" #include "iolog.h"
@@ -493,8 +492,10 @@ replay_session(const double max_wait, const char *decimal)
/* Store the line in iov followed by \r\n pair. */ /* Store the line in iov followed by \r\n pair. */
if (iovcnt + 3 > iovmax) { if (iovcnt + 3 > iovmax) {
iov = iovmax ? iov = iovmax ?
sudo_ereallocarray(iov, iovmax <<= 1, sizeof(*iov)) : reallocarray(iov, iovmax <<= 1, sizeof(*iov)) :
sudo_emallocarray(iovmax = 32, sizeof(*iov)); reallocarray(NULL, iovmax = 32, sizeof(*iov));
if (iov == NULL)
sudo_fatalx(U_("unable to allocate memory"));
} }
linelen = (size_t)(nl - line) + 1; linelen = (size_t)(nl - line) + 1;
iov[iovcnt].iov_base = line; iov[iovcnt].iov_base = line;
@@ -537,7 +538,7 @@ replay_session(const double max_wait, const char *decimal)
sudo_ev_loop(evbase, 0); sudo_ev_loop(evbase, 0);
} }
if (iov != &iovb) if (iov != &iovb)
sudo_efree(iov); free(iov);
} }
debug_return; debug_return;
} }
@@ -689,7 +690,8 @@ parse_expr(struct search_node_list *head, char *argv[], bool sub_expr)
} }
/* Allocate new search node */ /* Allocate new search node */
sn = sudo_ecalloc(1, sizeof(*sn)); if ((sn = calloc(1, sizeof(*sn))) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
sn->type = type; sn->type = type;
sn->or = or; sn->or = or;
sn->negated = not; sn->negated = not;
@@ -800,7 +802,8 @@ parse_logfile(char *logfile)
* 2) cwd * 2) cwd
* 3) command with args * 3) command with args
*/ */
li = sudo_ecalloc(1, sizeof(*li)); if ((li = calloc(1, sizeof(*li))) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
if (getline(&buf, &bufsize, fp) == -1 || if (getline(&buf, &bufsize, fp) == -1 ||
getline(&li->cwd, &cwdsize, fp) == -1 || getline(&li->cwd, &cwdsize, fp) == -1 ||
getline(&li->cmd, &cmdsize, fp) == -1) { getline(&li->cmd, &cmdsize, fp) == -1) {
@@ -839,7 +842,8 @@ parse_logfile(char *logfile)
sudo_warn(U_("%s: user field is missing"), logfile); sudo_warn(U_("%s: user field is missing"), logfile);
goto bad; goto bad;
} }
li->user = sudo_estrndup(cp, (size_t)(ep - cp)); if ((li->user = strndup(cp, (size_t)(ep - cp))) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
/* runas user */ /* runas user */
cp = ep + 1; cp = ep + 1;
@@ -847,7 +851,8 @@ parse_logfile(char *logfile)
sudo_warn(U_("%s: runas user field is missing"), logfile); sudo_warn(U_("%s: runas user field is missing"), logfile);
goto bad; goto bad;
} }
li->runas_user = sudo_estrndup(cp, (size_t)(ep - cp)); if ((li->runas_user = strndup(cp, (size_t)(ep - cp))) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
/* runas group */ /* runas group */
cp = ep + 1; cp = ep + 1;
@@ -855,17 +860,21 @@ parse_logfile(char *logfile)
sudo_warn(U_("%s: runas group field is missing"), logfile); sudo_warn(U_("%s: runas group field is missing"), logfile);
goto bad; goto bad;
} }
if (cp != ep) if (cp != ep) {
li->runas_group = sudo_estrndup(cp, (size_t)(ep - cp)); if ((li->runas_group = strndup(cp, (size_t)(ep - cp))) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
}
/* tty, followed by optional rows + columns */ /* tty, followed by optional rows + columns */
cp = ep + 1; cp = ep + 1;
if ((ep = strchr(cp, ':')) == NULL) { if ((ep = strchr(cp, ':')) == NULL) {
/* just the tty */ /* just the tty */
li->tty = sudo_estrdup(cp); if ((li->tty = strdup(cp)) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
} else { } else {
/* tty followed by rows + columns */ /* tty followed by rows + columns */
li->tty = sudo_estrndup(cp, (size_t)(ep - cp)); if ((li->tty = strndup(cp, (size_t)(ep - cp))) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
cp = ep + 1; cp = ep + 1;
/* need to NULL out separator to use strtonum() */ /* need to NULL out separator to use strtonum() */
if ((ep = strchr(cp, ':')) != NULL) { if ((ep = strchr(cp, ':')) != NULL) {
@@ -886,13 +895,13 @@ parse_logfile(char *logfile)
} }
} }
fclose(fp); fclose(fp);
sudo_efree(buf); free(buf);
debug_return_ptr(li); debug_return_ptr(li);
bad: bad:
if (fp != NULL) if (fp != NULL)
fclose(fp); fclose(fp);
sudo_efree(buf); free(buf);
free_log_info(li); free_log_info(li);
debug_return_ptr(NULL); debug_return_ptr(NULL);
} }
@@ -901,13 +910,13 @@ static void
free_log_info(struct log_info *li) free_log_info(struct log_info *li)
{ {
if (li != NULL) { if (li != NULL) {
sudo_efree(li->cwd); free(li->cwd);
sudo_efree(li->user); free(li->user);
sudo_efree(li->runas_user); free(li->runas_user);
sudo_efree(li->runas_group); free(li->runas_group);
sudo_efree(li->tty); free(li->tty);
sudo_efree(li->cmd); free(li->cmd);
sudo_efree(li); free(li);
} }
} }
@@ -974,7 +983,7 @@ find_sessions(const char *dir, regex_t *re, const char *user, const char *tty)
DIR *d; DIR *d;
struct dirent *dp; struct dirent *dp;
struct stat sb; struct stat sb;
size_t sdlen, sessions_len = 0, sessions_size = 36*36; size_t sdlen, sessions_len = 0, sessions_size = 0;
unsigned int i; unsigned int i;
int len; int len;
char pathbuf[PATH_MAX], **sessions = NULL; char pathbuf[PATH_MAX], **sessions = NULL;
@@ -999,7 +1008,6 @@ find_sessions(const char *dir, regex_t *re, const char *user, const char *tty)
pathbuf[sdlen] = '\0'; pathbuf[sdlen] = '\0';
/* Store potential session dirs for sorting. */ /* Store potential session dirs for sorting. */
sessions = sudo_emallocarray(sessions_size, sizeof(char *));
while ((dp = readdir(d)) != NULL) { while ((dp = readdir(d)) != NULL) {
/* Skip "." and ".." */ /* Skip "." and ".." */
if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' ||
@@ -1018,10 +1026,16 @@ find_sessions(const char *dir, regex_t *re, const char *user, const char *tty)
/* Add name to session list. */ /* Add name to session list. */
if (sessions_len + 1 > sessions_size) { if (sessions_len + 1 > sessions_size) {
sessions_size <<= 1; if (sessions_size == 0)
sessions = sudo_ereallocarray(sessions, sessions_size, sizeof(char *)); sessions_size = 36 * 36 / 2;
sessions = reallocarray(sessions, sessions_size, 2 * sizeof(char *));
if (sessions == NULL)
sudo_fatalx(U_("unable to allocate memory"));
sessions_size *= 2;
} }
sessions[sessions_len++] = sudo_estrdup(dp->d_name); if ((sessions[sessions_len] = strdup(dp->d_name)) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
sessions_len++;
} }
closedir(d); closedir(d);
@@ -1034,7 +1048,7 @@ find_sessions(const char *dir, regex_t *re, const char *user, const char *tty)
errno = ENAMETOOLONG; errno = ENAMETOOLONG;
sudo_fatal("%s/%s/log", dir, sessions[i]); sudo_fatal("%s/%s/log", dir, sessions[i]);
} }
sudo_efree(sessions[i]); free(sessions[i]);
/* Check for dir with a log file. */ /* Check for dir with a log file. */
if (lstat(pathbuf, &sb) == 0 && S_ISREG(sb.st_mode)) { if (lstat(pathbuf, &sb) == 0 && S_ISREG(sb.st_mode)) {
@@ -1046,7 +1060,7 @@ find_sessions(const char *dir, regex_t *re, const char *user, const char *tty)
find_sessions(pathbuf, re, user, tty); find_sessions(pathbuf, re, user, tty);
} }
} }
sudo_efree(sessions); free(sessions);
debug_return_int(0); debug_return_int(0);
} }

View File

@@ -137,7 +137,8 @@ main(int argc, char *argv[])
initprogname(argc > 0 ? argv[0] : "testsudoers"); initprogname(argc > 0 ? argv[0] : "testsudoers");
sudoers_initlocale(setlocale(LC_ALL, ""), def_sudoers_locale); if (!sudoers_initlocale(setlocale(LC_ALL, ""), def_sudoers_locale))
sudo_fatalx(U_("unable to allocate memory"));
bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have own domain */ bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have own domain */
textdomain("sudoers"); textdomain("sudoers");
@@ -220,7 +221,8 @@ main(int argc, char *argv[])
} }
if ((p = strchr(user_host, '.'))) { if ((p = strchr(user_host, '.'))) {
*p = '\0'; *p = '\0';
user_shost = sudo_estrdup(user_host); if ((user_shost = strdup(user_host)) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
*p = '.'; *p = '.';
} else { } else {
user_shost = user_host; user_shost = user_host;
@@ -236,7 +238,8 @@ main(int argc, char *argv[])
for (size = 0, from = argv; *from; from++) for (size = 0, from = argv; *from; from++)
size += strlen(*from) + 1; size += strlen(*from) + 1;
user_args = sudo_emalloc(size); if ((user_args = malloc(size)) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
for (to = user_args, from = argv; *from; from++) { for (to = user_args, from = argv; *from; from++) {
n = strlcpy(to, *from, size - (to - user_args)); n = strlcpy(to, *from, size - (to - user_args));
if (n >= size - (to - user_args)) if (n >= size - (to - user_args))
@@ -248,14 +251,17 @@ main(int argc, char *argv[])
} }
/* Initialize default values. */ /* Initialize default values. */
init_defaults(); if (!init_defaults())
sudo_fatalx(U_("unable to initialize sudoers default values"));
/* Set runas callback. */ /* Set runas callback. */
sudo_defs_table[I_RUNAS_DEFAULT].callback = cb_runas_default; sudo_defs_table[I_RUNAS_DEFAULT].callback = cb_runas_default;
/* Load ip addr/mask for each interface. */ /* Load ip addr/mask for each interface. */
if (get_net_ifs(&p) > 0) if (get_net_ifs(&p) > 0) {
set_interfaces(p); if (!set_interfaces(p))
sudo_fatal(U_("unable to parse network address list"));
}
/* Allocate space for data structures in the parser. */ /* Allocate space for data structures in the parser. */
init_parser("sudoers", false); init_parser("sudoers", false);
@@ -459,10 +465,10 @@ open_sudoers(const char *sudoers, bool doedit, bool *keepopen)
debug_return_ptr(fp); debug_return_ptr(fp);
} }
void bool
init_envtables(void) init_envtables(void)
{ {
return; return(true);
} }
bool bool

View File

@@ -163,7 +163,8 @@ main(int argc, char *argv[])
#endif #endif
initprogname(argc > 0 ? argv[0] : "visudo"); initprogname(argc > 0 ? argv[0] : "visudo");
sudoers_initlocale(setlocale(LC_ALL, ""), def_sudoers_locale); if (!sudoers_initlocale(setlocale(LC_ALL, ""), def_sudoers_locale))
sudo_fatalx(U_("unable to allocate memory"));
bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have visudo domain */ bindtextdomain("sudoers", LOCALEDIR); /* XXX - should have visudo domain */
textdomain("sudoers"); textdomain("sudoers");
@@ -232,7 +233,8 @@ main(int argc, char *argv[])
get_hostname(); get_hostname();
/* Setup defaults data structures. */ /* Setup defaults data structures. */
init_defaults(); if (!init_defaults())
sudo_fatalx(U_("unable to initialize sudoers default values"));
if (checkonly) { if (checkonly) {
exitcode = check_syntax(sudoers_file, quiet, strict, oldperms) ? 0 : 1; exitcode = check_syntax(sudoers_file, quiet, strict, oldperms) ? 0 : 1;
@@ -339,7 +341,8 @@ edit_sudoers(struct sudoersfile *sp, char *editor, char *args, int lineno)
/* Create the temp file if needed and set timestamp. */ /* Create the temp file if needed and set timestamp. */
if (sp->tpath == NULL) { if (sp->tpath == NULL) {
sudo_easprintf(&sp->tpath, "%s.tmp", sp->path); if (asprintf(&sp->tpath, "%s.tmp", sp->path) == -1)
sudo_fatalx(U_("unable to allocate memory"));
tfd = open(sp->tpath, O_WRONLY | O_CREAT | O_TRUNC, 0600); tfd = open(sp->tpath, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (tfd < 0) if (tfd < 0)
sudo_fatal("%s", sp->tpath); sudo_fatal("%s", sp->tpath);
@@ -409,7 +412,9 @@ edit_sudoers(struct sudoersfile *sp, char *editor, char *args, int lineno)
} }
/* Build up argument vector for the command */ /* Build up argument vector for the command */
av = sudo_emallocarray(ac, sizeof(char *)); av = reallocarray(NULL, ac, sizeof(char *));
if (av == NULL)
sudo_fatalx(U_("unable to allocate memory"));
if ((av[0] = strrchr(editor, '/')) != NULL) if ((av[0] = strrchr(editor, '/')) != NULL)
av[0]++; av[0]++;
else else
@@ -510,7 +515,8 @@ reparse_sudoers(char *editor, char *args, bool strict, bool quiet)
sp->tpath, sp->path); sp->tpath, sp->path);
/* Clean slate for each parse */ /* Clean slate for each parse */
init_defaults(); if (!init_defaults())
sudo_fatalx(U_("unable to initialize sudoers default values"));
init_parser(sp->path, quiet); init_parser(sp->path, quiet);
/* Parse the sudoers temp file(s) */ /* Parse the sudoers temp file(s) */
@@ -636,7 +642,7 @@ install_sudoers(struct sudoersfile *sp, bool oldperms)
* mv(1) in case sp->tpath and sp->path are on different file systems. * mv(1) in case sp->tpath and sp->path are on different file systems.
*/ */
if (rename(sp->tpath, sp->path) == 0) { if (rename(sp->tpath, sp->path) == 0) {
sudo_efree(sp->tpath); free(sp->tpath);
sp->tpath = NULL; sp->tpath = NULL;
} else { } else {
if (errno == EXDEV) { if (errno == EXDEV) {
@@ -658,11 +664,11 @@ install_sudoers(struct sudoersfile *sp, bool oldperms)
sudo_warnx(U_("command failed: '%s %s %s', %s unchanged"), sudo_warnx(U_("command failed: '%s %s %s', %s unchanged"),
_PATH_MV, sp->tpath, sp->path, sp->path); _PATH_MV, sp->tpath, sp->path, sp->path);
(void) unlink(sp->tpath); (void) unlink(sp->tpath);
sudo_efree(sp->tpath); free(sp->tpath);
sp->tpath = NULL; sp->tpath = NULL;
goto done; goto done;
} }
sudo_efree(sp->tpath); free(sp->tpath);
sp->tpath = NULL; sp->tpath = NULL;
} else { } else {
sudo_warn(U_("error renaming %s, %s unchanged"), sp->tpath, sp->path); sudo_warn(U_("error renaming %s, %s unchanged"), sp->tpath, sp->path);
@@ -676,10 +682,10 @@ done:
} }
/* STUB */ /* STUB */
void bool
init_envtables(void) init_envtables(void)
{ {
return; return true;
} }
/* STUB */ /* STUB */
@@ -915,15 +921,16 @@ open_sudoers(const char *path, bool doedit, bool *keepopen)
break; break;
} }
if (entry == NULL) { if (entry == NULL) {
entry = sudo_ecalloc(1, sizeof(*entry)); entry = calloc(1, sizeof(*entry));
entry->path = sudo_estrdup(path); if (entry == NULL || (entry->path = strdup(path)) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
/* entry->modified = 0; */ /* entry->modified = 0; */
entry->fd = open(entry->path, open_flags, sudoers_mode); entry->fd = open(entry->path, open_flags, sudoers_mode);
/* entry->tpath = NULL; */ /* entry->tpath = NULL; */
entry->doedit = doedit; entry->doedit = doedit;
if (entry->fd == -1) { if (entry->fd == -1) {
sudo_warn("%s", entry->path); sudo_warn("%s", entry->path);
sudo_efree(entry); free(entry);
debug_return_ptr(NULL); debug_return_ptr(NULL);
} }
if (!checkonly && !sudo_lock_file(entry->fd, SUDO_TLOCK)) if (!checkonly && !sudo_lock_file(entry->fd, SUDO_TLOCK))
@@ -996,7 +1003,8 @@ get_editor(char **args)
/* Should never happen since we already checked above. */ /* Should never happen since we already checked above. */
sudo_fatal(U_("unable to stat editor (%s)"), UserEditor); sudo_fatal(U_("unable to stat editor (%s)"), UserEditor);
} }
EditorPath = sudo_estrdup(def_editor); if ((EditorPath = strdup(def_editor)) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
Editor = strtok(EditorPath, ":"); Editor = strtok(EditorPath, ":");
do { do {
EditorArgs = get_args(Editor); EditorArgs = get_args(Editor);
@@ -1031,8 +1039,9 @@ get_editor(char **args)
* find one that exists, is regular, and is executable. * find one that exists, is regular, and is executable.
*/ */
if (Editor == NULL || *Editor == '\0') { if (Editor == NULL || *Editor == '\0') {
sudo_efree(EditorPath); free(EditorPath);
EditorPath = sudo_estrdup(def_editor); if ((EditorPath = strdup(def_editor)) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
Editor = strtok(EditorPath, ":"); Editor = strtok(EditorPath, ":");
do { do {
EditorArgs = get_args(Editor); EditorArgs = get_args(Editor);
@@ -1080,7 +1089,8 @@ get_hostname(void)
if ((user_host = sudo_gethostname()) != NULL) { if ((user_host = sudo_gethostname()) != NULL) {
if ((p = strchr(user_host, '.'))) { if ((p = strchr(user_host, '.'))) {
*p = '\0'; *p = '\0';
user_shost = sudo_estrdup(user_host); if ((user_shost = strdup(user_host)) == NULL)
sudo_fatalx(U_("unable to allocate memory"));
*p = '.'; *p = '.';
} else { } else {
user_shost = user_host; user_shost = user_host;