diff -Nru coreutils-8.32/debian/changelog coreutils-8.32/debian/changelog --- coreutils-8.32/debian/changelog 2024-01-08 14:56:36.000000000 +0000 +++ coreutils-8.32/debian/changelog 2024-02-08 03:46:39.000000000 +0000 @@ -1,3 +1,15 @@ +coreutils (8.32-4.1ubuntu1.2) jammy; urgency=medium + + * Fix an issue where running 'ls -l' on an autofs mount with + '--ghost' or 'browse_mode=yes' enabled causes the mount to be + attempted, even when the underlying storage is not available. + This changes behaviour of ls back to what it was previously, + before statx was introduced in 8.32. (LP: #2033892) + - d/p/lp2033892-01-ls-avoid-triggering-automounts.patch + - d/p/lp2033892-02-stat-only-automount-with-cached-never.patch + + -- Matthew Ruffell Thu, 08 Feb 2024 16:46:39 +1300 + coreutils (8.32-4.1ubuntu1.1) jammy; urgency=medium * d/p/assure-new-macro-affirm.patch, diff -Nru coreutils-8.32/debian/patches/lp2033892-01-ls-avoid-triggering-automounts.patch coreutils-8.32/debian/patches/lp2033892-01-ls-avoid-triggering-automounts.patch --- coreutils-8.32/debian/patches/lp2033892-01-ls-avoid-triggering-automounts.patch 1970-01-01 00:00:00.000000000 +0000 +++ coreutils-8.32/debian/patches/lp2033892-01-ls-avoid-triggering-automounts.patch 2024-02-08 03:46:39.000000000 +0000 @@ -0,0 +1,32 @@ +commit 85c975df2c25bd799370b04bb294e568e001102f +From: Rohan Sable +Date: Mon, 7 Mar 2022 14:14:13 +0000 +Subject: ls: avoid triggering automounts + statx() has different defaults wrt automounting + compared to stat() or lstat(), so explicitly + set the AT_NO_AUTOMOUNT flag to suppress that behavior, + and avoid unintended operations or potential errors. + + * src/ls.c (do_statx): Pass AT_NO_AUTOMOUNT to avoid this behavior. + Fixes https://bugs.gnu.org/54286 + + Signed-off-by: Rohan Sable + [mruffell: remove NEWS hunk] +Bug-Ubuntu: https://bugs.launchpad.net/bugs/2033892 +Bug: https://bugs.gnu.org/54286 +Origin: backport, https://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=85c975df2c2 +Last-Update: 2024-02-08 + +Index: coreutils-8.32/src/ls.c +=================================================================== +--- coreutils-8.32.orig/src/ls.c 2024-02-08 16:37:56.558416206 +1300 ++++ coreutils-8.32/src/ls.c 2024-02-08 16:37:56.554416133 +1300 +@@ -1154,7 +1154,7 @@ + { + struct statx stx; + bool want_btime = mask & STATX_BTIME; +- int ret = statx (fd, name, flags, mask, &stx); ++ int ret = statx (fd, name, flags | AT_NO_AUTOMOUNT, mask, &stx); + if (ret >= 0) + { + statx_to_stat (&stx, st); diff -Nru coreutils-8.32/debian/patches/lp2033892-02-stat-only-automount-with-cached-never.patch coreutils-8.32/debian/patches/lp2033892-02-stat-only-automount-with-cached-never.patch --- coreutils-8.32/debian/patches/lp2033892-02-stat-only-automount-with-cached-never.patch 1970-01-01 00:00:00.000000000 +0000 +++ coreutils-8.32/debian/patches/lp2033892-02-stat-only-automount-with-cached-never.patch 2024-02-08 03:46:39.000000000 +0000 @@ -0,0 +1,43 @@ +commit 92cb8427c537f37edd43c5cef1909585201372ab +From: Pádraig Brady +Date: Mon, 7 Mar 2022 23:29:20 +0000 +Subject: stat: only automount with --cached=never + Revert to the default behavior before the introduction of statx(). + + * src/stat.c (do_stat): Set AT_NO_AUTOMOUNT without --cached=never. + * doc/coreutils.texi (stat invocation): Mention the automount + behavior with --cached=never. + + Fixes https://bugs.gnu.org/54287 + [mruffell: remove NEWS hunk] +Bug-Ubuntu: https://bugs.launchpad.net/bugs/2033892 +Bug: https://bugs.gnu.org/54287 +Origin: backport, https://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=92cb8427c53 +Last-Update: 2024-02-08 + +Index: coreutils-8.32/doc/coreutils.texi +=================================================================== +--- coreutils-8.32.orig/doc/coreutils.texi 2024-02-08 16:38:09.990659623 +1300 ++++ coreutils-8.32/doc/coreutils.texi 2024-02-08 16:38:09.986659550 +1300 +@@ -12375,6 +12375,7 @@ + + @item never + Always sychronize with the latest file system attributes. ++This also mounts automounted files. + + @item default + Leave the caching behavior to the underlying file system. +Index: coreutils-8.32/src/stat.c +=================================================================== +--- coreutils-8.32.orig/src/stat.c 2024-02-08 16:38:09.990659623 +1300 ++++ coreutils-8.32/src/stat.c 2024-02-08 16:38:09.986659550 +1300 +@@ -1355,6 +1355,9 @@ + else if (force_sync) + flags |= AT_STATX_FORCE_SYNC; + ++ if (! force_sync) ++ flags |= AT_NO_AUTOMOUNT; ++ + fd = statx (fd, pathname, flags, format_to_mask (format), &stx); + if (fd < 0) + { diff -Nru coreutils-8.32/debian/patches/series coreutils-8.32/debian/patches/series --- coreutils-8.32/debian/patches/series 2024-01-08 14:55:29.000000000 +0000 +++ coreutils-8.32/debian/patches/series 2024-02-08 03:46:39.000000000 +0000 @@ -10,3 +10,5 @@ improve-removed-directory-test.patch tail-fix-tailing-sysfs-files-where-PAGE_SIZE-BUFSIZ.patch assure-new-macro-affirm.patch +lp2033892-01-ls-avoid-triggering-automounts.patch +lp2033892-02-stat-only-automount-with-cached-never.patch