>From 2c9d956aacdfddbb87334c985cd995d75102f789 Mon Sep 17 00:00:00 2001 From: Paul Eggert
Date: Sat, 5 Jan 2019 19:20:11 -0800 Subject: [PATCH 2/3] =?UTF-8?q?diff:=20remove=20unportable=20=E2=80=98diff?= =?UTF-8?q?=20-N=20-=20f=20<&-=E2=80=99=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * NEWS: Mention this. * bootstrap.conf (gnulib_modules): Add stdopen. * doc/diffutils.texi (Comparing Directories): Do not document behavior if stdin is closed. * src/diff.c: Include stdopen.h. (main): Call stdopen early. (compare_files) [__hpux]: Remove recently-introduced special case for HP-UX exec with stdin closed. * tests/new-file: Remove tests of the removed feature. --- NEWS | 9 +++++++++ bootstrap.conf | 1 + doc/diffutils.texi | 3 +-- src/diff.c | 11 ++++------- tests/new-file | 14 -------------- 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/NEWS b/NEWS index d45d0fc..af675da 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,15 @@ GNU diffutils NEWS -*- outline -*- * Noteworthy changes in release ?.? (????-??-??) [?] +** Incompatible changes + + diff no longer treats a closed stdin as representing an absent file + in usage like 'diff --new-file - foo <&-'. This feature was rarely + if ever used and was not portable to POSIX platforms that reopen + stdin on exec, such as SELinux if the process underwent an AT_SECURE + transition, or HP-UX even if not setuid. + [bug#33965 introduced in 2.8] + * Noteworthy changes in release 3.7 (2018-12-31) [stable] diff --git a/bootstrap.conf b/bootstrap.conf index 48cadd4..0c9fbfe 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -67,6 +67,7 @@ stat stat-macros stat-time stdint +stdopen strcase strftime strptime diff --git a/doc/diffutils.texi b/doc/diffutils.texi index 42d3abd..3a780db 100644 --- a/doc/diffutils.texi +++ b/doc/diffutils.texi @@ -1796,8 +1796,7 @@ second position.) To do this, use the @option{--new-file} (@option{-N}) option. This option affects command-line arguments as well as files found via directory traversal; for example, @samp{diff -N a b} treats @file{a} as empty if @file{a} does not exist but address@hidden does, and similarly @samp{diff -N - b} treats standard input -as empty if it is closed but @file{b} exists. address@hidden does. If the older directory contains large files that are not in the newer directory, you can make the patch smaller by using the diff --git a/src/diff.c b/src/diff.c index 2ed3ae5..a5ec7f4 100644 --- a/src/diff.c +++ b/src/diff.c @@ -37,6 +37,7 @@ #include