@@ -112,8 +112,8 @@ PVS_IGNORE = 'V707,V011,V002,V536,V795'
112112PVS_LOG_OPTS = -a 'GA:1,2' -e -t errorfile -d $(PVS_IGNORE )
113113
114114# Regression tests
115- TEST_PROGS = base64_test conf_test digest_test getgids getgrouplist_test \
116- hexchar_test hltq_test json_test multiarch_test \
115+ TEST_PROGS = base64_test conf_test digest_test dotdot_test getgids \
116+ getgrouplist_test hexchar_test hltq_test json_test multiarch_test \
117117 open_parent_dir_test parse_gids_test parseln_test progname_test \
118118 regex_test strsplit_test strtobool_test strtoid_test \
119119 strtomode_test strtonum_test uuid_test @COMPAT_TEST_PROGS@
@@ -145,14 +145,15 @@ DEVEL = @DEVEL@
145145
146146SHELL = @SHELL@
147147
148- LTOBJS = b64_decode.lo b64_encode.lo basename.lo @DIGEST@ event.lo fatal.lo \
149- key_val.lo gethostname.lo gettime.lo getgrouplist.lo gidlist.lo \
150- hexchar.lo json.lo lbuf.lo locking.lo logfac.lo login_max.lo \
151- logpri.lo mkdir_parents.lo mmap_alloc.lo multiarch.lo parseln.lo \
152- progname.lo rcstr.lo regex.lo roundup.lo secure_path.lo setgroups.lo \
153- strsplit.lo strtobool.lo strtoid.lo strtomode.lo strtonum.lo \
154- sudo_conf.lo sudo_debug.lo sudo_dso.lo term.lo ttyname_dev.lo \
155- ttysize.lo uuid.lo @COMMON_OBJS@ @LTLIBOBJS@
148+ LTOBJS = b64_decode.lo b64_encode.lo basename.lo @DIGEST@ dotdot.lo \
149+ event.lo fatal.lo key_val.lo gethostname.lo gettime.lo \
150+ getgrouplist.lo gidlist.lo hexchar.lo json.lo lbuf.lo \
151+ locking.lo logfac.lo login_max.lo logpri.lo mkdir_parents.lo \
152+ mmap_alloc.lo multiarch.lo parseln.lo progname.lo rcstr.lo \
153+ regex.lo roundup.lo secure_path.lo setgroups.lo strsplit.lo \
154+ strtobool.lo strtoid.lo strtomode.lo strtonum.lo sudo_conf.lo \
155+ sudo_debug.lo sudo_dso.lo term.lo ttyname_dev.lo ttysize.lo \
156+ uuid.lo @COMMON_OBJS@ @LTLIBOBJS@
156157
157158IOBJS = $(LTOBJS:.lo=.i )
158159
@@ -172,6 +173,8 @@ CONF_TEST_OBJS = conf_test.lo sudo_conf.lo
172173
173174DIGEST_TEST_OBJS = digest_test.lo @DIGEST@
174175
176+ DOTDOT_TEST_OBJS = dotdot_test.lo dotdot.lo
177+
175178FNM_TEST_OBJS = fnm_test.lo fnmatch.lo
176179
177180GLOBTEST_OBJS = globtest.lo glob.lo
@@ -298,6 +301,9 @@ conf_test: $(CONF_TEST_OBJS) libsudo_util.la
298301digest_test : $(DIGEST_TEST_OBJS ) libsudo_util.la
299302 $(LIBTOOL ) $(LTFLAGS ) --mode=link $(CC ) -o $@ $(DIGEST_TEST_OBJS ) libsudo_util.la $(ASAN_LDFLAGS ) $(PIE_LDFLAGS ) $(HARDENING_LDFLAGS ) $(TEST_LDFLAGS ) $(TEST_LIBS ) @LIBCRYPTO@
300303
304+ dotdot_test : $(DOTDOT_TEST_OBJS ) libsudo_util.la
305+ $(LIBTOOL ) $(LTFLAGS ) --mode=link $(CC ) -o $@ $(DOTDOT_TEST_OBJS ) libsudo_util.la $(ASAN_LDFLAGS ) $(PIE_LDFLAGS ) $(HARDENING_LDFLAGS ) $(TEST_LDFLAGS ) $(TEST_LIBS ) @LIBCRYPTO@
306+
301307fnm_test : $(FNM_TEST_OBJS ) libsudo_util.la
302308 $(LIBTOOL ) $(LTFLAGS ) --mode=link $(CC ) -o $@ $(FNM_TEST_OBJS ) libsudo_util.la $(ASAN_LDFLAGS ) $(PIE_LDFLAGS ) $(HARDENING_LDFLAGS ) $(TEST_LDFLAGS ) $(TEST_LIBS )
303309
@@ -468,6 +474,7 @@ check: $(TEST_PROGS) check-fuzzer
468474 ./closefrom_test $(TEST_VERBOSE ) || rval=` expr $$ rval + $$ ? ` ; \
469475 fi ; \
470476 ./digest_test $(TEST_VERBOSE ) || rval=` expr $$ rval + $$ ? ` ; \
477+ ./dotdot_test $(TEST_VERBOSE ) || rval=` expr $$ rval + $$ ? ` ; \
471478 if test -f fnm_test; then \
472479 ./fnm_test $(TEST_VERBOSE ) $(srcdir ) /regress/fnmatch/fnm_test.in || rval=` expr $$ rval + $$ ? ` ; \
473480 fi ; \
@@ -718,6 +725,30 @@ digest_test.i: $(srcdir)/regress/digest/digest_test.c \
718725 $(CPP) $(CPPFLAGS) $(srcdir)/regress/digest/digest_test.c > $@
719726digest_test.plog : digest_test.i
720727 rm -f $@ ; pvs-studio --cfg $(PVS_CFG ) --source-file $(srcdir ) /regress/digest/digest_test.c --i-file digest_test.i --output-file $@
728+ dotdot.lo : $(srcdir ) /dotdot.c $(incdir ) /compat/stdbool.h \
729+ $(incdir)/sudo_compat.h $(incdir)/sudo_debug.h \
730+ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(top_builddir)/config.h
731+ $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(HARDENING_CFLAGS) $(srcdir)/dotdot.c
732+ dotdot.i : $(srcdir ) /dotdot.c $(incdir ) /compat/stdbool.h \
733+ $(incdir)/sudo_compat.h $(incdir)/sudo_debug.h \
734+ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h $(top_builddir)/config.h
735+ $(CPP) $(CPPFLAGS) $(srcdir)/dotdot.c > $@
736+ dotdot.plog : dotdot.i
737+ rm -f $@ ; pvs-studio --cfg $(PVS_CFG ) --source-file $(srcdir ) /dotdot.c --i-file dotdot.i --output-file $@
738+ dotdot_test.lo : $(srcdir ) /regress/dotdot/dotdot_test.c \
739+ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
740+ $(incdir)/sudo_fatal.h $(incdir)/sudo_plugin.h \
741+ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
742+ $(top_builddir)/config.h
743+ $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(ASAN_CFLAGS) $(PIE_CFLAGS) $(HARDENING_CFLAGS) $(srcdir)/regress/dotdot/dotdot_test.c
744+ dotdot_test.i : $(srcdir ) /regress/dotdot/dotdot_test.c \
745+ $(incdir)/compat/stdbool.h $(incdir)/sudo_compat.h \
746+ $(incdir)/sudo_fatal.h $(incdir)/sudo_plugin.h \
747+ $(incdir)/sudo_queue.h $(incdir)/sudo_util.h \
748+ $(top_builddir)/config.h
749+ $(CPP) $(CPPFLAGS) $(srcdir)/regress/dotdot/dotdot_test.c > $@
750+ dotdot_test.plog : dotdot_test.i
751+ rm -f $@ ; pvs-studio --cfg $(PVS_CFG ) --source-file $(srcdir ) /regress/dotdot/dotdot_test.c --i-file dotdot_test.i --output-file $@
721752dup3.lo : $(srcdir ) /dup3.c $(incdir ) /sudo_compat.h $(top_builddir ) /config.h
722753 $(LIBTOOL ) $(LTFLAGS ) --mode=compile $(CC ) -c -o $@ $(CPPFLAGS ) $(CFLAGS ) $(ASAN_CFLAGS ) $(PIE_CFLAGS ) $(HARDENING_CFLAGS ) $(srcdir ) /dup3.c
723754dup3.i : $(srcdir ) /dup3.c $(incdir ) /sudo_compat.h $(top_builddir ) /config.h
0 commit comments