]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
install: with -d, use more accurate diagnostics
authorPádraig Brady <P@draigBrady.com>
Tue, 22 Jul 2025 19:34:50 +0000 (20:34 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 22 Jul 2025 20:15:17 +0000 (21:15 +0100)
* gnulib: Update to latest to get the fix to
propagate the appropriate error message.
* tests/install/basic-1.sh: Add a test case.
* NEWS: Mention the bug fix.
Addresses https://bugs.gnu.org/79072

NEWS
gnulib
tests/install/basic-1.sh

diff --git a/NEWS b/NEWS
index f4a4739a8ba7c07cc58c51d1ef1943c99716e1eb..17a43b064967cf0f7d4905c6baf0ef52fe929fef 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,11 @@ GNU coreutils NEWS                                    -*- outline -*-
   copying to non-NFS files from NFSv4 files with trivial ACLs.
   [bug introduced in coreutils-9.6]
 
+  install -d now produces the correct diagnostic upon failure
+  to create a directory.  Previously it would have produced
+  a confusing error about changing permissions.
+  [This bug was present in "the beginning".]
+
   od --strings with -N now works correctly.  Previously od might
   write a NUL byte after a heap buffer, or output invalid addresses.
   [These bugs were present in "the beginning".]
diff --git a/gnulib b/gnulib
index 91aacb5536d4e768064c4f4d8d28bef6aa37e534..84ddfc7bd29853ed91cdd65c7ce818072959f974 160000 (submodule)
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 91aacb5536d4e768064c4f4d8d28bef6aa37e534
+Subproject commit 84ddfc7bd29853ed91cdd65c7ce818072959f974
index e311dbb9e74ca928de0972f563099847aa365dcc..fd13eb68bc84e2d76021502929adf61a7f7f0dd4 100755 (executable)
@@ -148,4 +148,11 @@ returns_ 1 ginstall . . 2>err || fail=1
 printf '%s\n' "ginstall: omitting directory '.'" >exp || framework_failure_
 compare exp err || fail=1
 
+# Ensure correct diagnostic for failing to create dir
+mkdir -m 111 sub-ro || framework_failure_
+if ! mkdir sub-ro/d; then
+  returns_ 1 ginstall -d sub-ro/d 2>err || fail=1
+  grep 'cannot create directory' err || { cat err; fail=1; }
+fi
+
 Exit $fail