From: Collin Funk Date: Fri, 19 Sep 2025 06:29:02 +0000 (-0700) Subject: dd: don't mistakenly use O_EXCL on GNU/Hurd X-Git-Tag: v9.8~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2662ddf335c9c5bafefa9c8c0b25c26e73d192ab;p=thirdparty%2Fcoreutils.git dd: don't mistakenly use O_EXCL on GNU/Hurd * src/dd.c (v): Add the O_EXCL flag to the set of bits that we do not want to use for our definitions. * cfg.mk (sc_dd_O_FLAGS): Adjust to pass syntax-check. * NEWS: Mention the fix. Reported by Bruno Haible. --- diff --git a/NEWS b/NEWS index 4c979607b2..d618a0bdda 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,10 @@ GNU coreutils NEWS -*- outline -*- precedence. Previously multiple specifications would induce an error. [bug introduced in coreutils-5.90] + 'dd oflag=seek_bytes' no longer mistakenly reports errors when the + output file exists on GNU/Hurd. + [bug introduced in coreutils-8.16] + 'fold' no longer exhausts memory when processing large inputs with a very large --width argument. [This bug was present in "the beginning".] diff --git a/cfg.mk b/cfg.mk index 0abb5c2262..8e8cae2e66 100644 --- a/cfg.mk +++ b/cfg.mk @@ -68,7 +68,8 @@ sc_dd_O_FLAGS: @rm -f $@.1 $@.2 @{ echo O_FULLBLOCK; echo O_NOCACHE; \ perl -nle '/^ +\| (O_\w*)$$/ and print $$1' $(dd); } | sort > $@.1 - @{ echo O_NOFOLLOW; perl -nle '/{"[a-z]+",\s*(O_\w+)},/ and print $$1' \ + @{ echo O_NOFOLLOW; echo O_EXCL; \ + perl -nle '/{"[a-z]+",\s*(O_\w+)},/ and print $$1' \ $(dd); } | sort > $@.2 @diff -u $@.1 $@.2; diff=$$?; \ rm -f $@.1 $@.2; \ diff --git a/src/dd.c b/src/dd.c index 33959b4952..98f3600890 100644 --- a/src/dd.c +++ b/src/dd.c @@ -295,6 +295,7 @@ enum | O_DIRECT | O_DIRECTORY | O_DSYNC + | O_EXCL | O_NOATIME | O_NOCTTY | O_NOFOLLOW