Use mkdtempat instead of mkdtemp

This fixes an interaction of -C with incremental 'X'.
Problem reported by Pavel Cahyna.
* gnulib.modules: Remove mkdtemp.
Add tempname, since our mkdtempat uses it.
* lib/mkdtempat.c, lib/mkdtempat.h: New files.
* lib/Makefile.am (noinst_HEADERS): Add mkdtempat.h.
(libtar_a_SOURCES): Add mkdtempat.c.
* src/incremen.c: Include mkdtempat.h.
(purge_directory): Use mkdtempat, not mkdtemp.
This commit is contained in:
Paul Eggert
2026-04-13 00:02:17 -07:00
parent 0470c109c0
commit d479b2cc91
5 changed files with 53 additions and 2 deletions
+2
View File
@@ -30,6 +30,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/gnu -I../ -I../gnu
AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
noinst_HEADERS = \
mkdtempat.h\
paxlib.h\
rmt.h\
system.h\
@@ -37,6 +38,7 @@ noinst_HEADERS = \
xattr-at.h
libtar_a_SOURCES = \
mkdtempat.c\
paxerror.c paxexit-status.c paxlib.h paxnames.c \
rtapelib.c \
rmt.h \