From 0fd54da0b0ae6ccd530a98db084e2ad595cebfd1 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 15 Jul 2020 17:24:39 +0000 Subject: [PATCH] Allow install(1)'s create_tempfile() to work on Linux hosts GLibc expects six 'X' characters in the mkstemp template argument and will return EINVAL otherwise. Reviewed By: emaste, imp, mjg Differential Revision: https://reviews.freebsd.org/D25662 --- usr.bin/xinstall/install.1 | 8 ++++---- usr.bin/xinstall/xinstall.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/xinstall/install.1 b/usr.bin/xinstall/install.1 index 19c5c7dc1bf..4d4db9633d9 100644 --- a/usr.bin/xinstall/install.1 +++ b/usr.bin/xinstall/install.1 @@ -301,8 +301,8 @@ This is mainly for use in debugging the .Fx Ports Collection. .Sh FILES -.Bl -tag -width "INS@XXXX" -compact -.It Pa INS@XXXX +.Bl -tag -width "INS@XXXXXX" -compact +.It Pa INS@XXXXXX If either .Fl S option is specified, or the @@ -312,9 +312,9 @@ or option is used in conjunction with the .Fl s option, temporary files named -.Pa INS@XXXX , +.Pa INS@XXXXXX , where -.Pa XXXX +.Pa XXXXXX is decided by .Xr mkstemp 3 , are created in the target directory. diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index a0d50220830..9531427b999 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1161,7 +1161,7 @@ create_tempfile(const char *path, char *temp, size_t tsize) p++; else p = temp; - (void)strncpy(p, "INS@XXXX", &temp[tsize - 1] - p); + (void)strncpy(p, "INS@XXXXXX", &temp[tsize - 1] - p); temp[tsize - 1] = '\0'; return (mkstemp(temp)); }