From 7a00c5257c52faee3ddd7100f46b4b2daed5f86b Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 16 Aug 2009 15:13:31 +0000 Subject: [PATCH] Add scaffolding for building sudoreplay --- Makefile.in | 9 ++++++++- config.h.in | 3 +++ configure.in | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index f0eed2a8e..6f8e88a76 100644 --- a/Makefile.in +++ b/Makefile.in @@ -110,7 +110,7 @@ SRCS = aix.c alias.c alloc.c audit.c bsm_audit.c check.c closefrom.c \ snprintf.c strcasecmp.c strerror.c strlcat.c strlcpy.c sudo.c \ sudo_noexec.c sudo_edit.c sudo_nss.c term.c testsudoers.c tgetpass.c \ toke.c toke.l tsgetgrpw.c utimes.c vasgroups.c visudo.c zero_bytes.c \ - redblack.c selinux.c sesh.c $(AUTH_SRCS) + redblack.c selinux.c sesh.c sudoreplay.c $(AUTH_SRCS) AUTH_SRCS = auth/afs.c auth/aix_auth.c auth/bsdauth.c auth/dce.c auth/fwtk.c \ auth/kerb4.c auth/kerb5.c auth/pam.c auth/passwd.c auth/rfc1938.c \ @@ -137,6 +137,8 @@ SUDO_OBJS = $(COMMON_OBJS) $(AUTH_OBJS) @SUDO_OBJS@ audit.o check.o env.o \ VISUDO_OBJS = $(COMMON_OBJS) visudo.o fileops.o gettime.o goodpath.o \ find_path.o pwutil.o +REPLAY_OBJS = sudoreplay.o error.o + TEST_OBJS = $(COMMON_OBJS) interfaces.o testsudoers.o tsgetgrpw.o tspwutil.o LIB_OBJS = @LIBOBJS@ @@ -191,6 +193,9 @@ sudo: $(SUDO_OBJS) $(LIB_OBJS) visudo: $(VISUDO_OBJS) $(LIB_OBJS) $(CC) -o $@ $(VISUDO_OBJS) $(LIB_OBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS) +sudoreplay: $(REPLAY_OBJS) $(LIB_OBJS) + $(CC) -o $@ $(REPLAY_OBJS) $(LIB_OBJS) $(LDFLAGS) $(LIBS) + testsudoers: $(TEST_OBJS) $(LIB_OBJS) $(CC) -o $@ $(TEST_OBJS) $(LIB_OBJS) $(LDFLAGS) $(LIBS) $(NET_LIBS) @@ -305,6 +310,8 @@ selinux.o: $(srcdir)/selinux.c $(SUDODEP) $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/selinux.c sudo.o: $(srcdir)/sudo.c $(SUDODEP) sudo_usage.h $(srcdir)/interfaces.h $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudo.c +sudoreplay.o: $(srcdir)/replay.c $(srcdir)/compat.h $(srcdir)/error.h config.h + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudoreplay.c sudo_edit.o: $(srcdir)/sudo_edit.c $(SUDODEP) $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudo_edit.c sudo_noexec.o: $(srcdir)/sudo_noexec.c $(srcdir)/compat.h config.h diff --git a/config.h.in b/config.h.in index 5ef404379..e01864abe 100644 --- a/config.h.in +++ b/config.h.in @@ -312,6 +312,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MPS_LDAP_SSL_H +/* Define to 1 if you have the `nanosleep' function. */ +#undef HAVE_NANOSLEEP + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H diff --git a/configure.in b/configure.in index 7cfeeee6e..23a5f9f3a 100644 --- a/configure.in +++ b/configure.in @@ -119,7 +119,7 @@ dnl dnl Initial values for Makefile variables listed above dnl May be overridden by environment variables.. dnl -PROGS="sudo visudo" +PROGS="sudo visudo sudoreplay" : ${MANTYPE='man'} : ${mansrcdir='.'} : ${SUDOERS_MODE='0440'} @@ -1836,7 +1836,7 @@ dnl AC_FUNC_GETGROUPS AC_CHECK_FUNCS(strchr strrchr memchr memcpy memset sysconf tzset \ strftime setrlimit initgroups getgroups fstat gettimeofday \ - setlocale getaddrinfo setsid setenv vhangup) + setlocale getaddrinfo setsid setenv vhangup nanosleep) AC_CHECK_FUNCS(openpty, [AC_CHECK_HEADERS(util.h pty.h, [break])], [ AC_CHECK_LIB(util, openpty, [ AC_CHECK_HEADERS(util.h pty.h, [break]) -- 2.40.0