GNU bug report logs - #21497
install from multiple sources to -t target uses incorrect folder on some sources

Previous Next

Package: coreutils;

Reported by: Chris Severance <aur.severach <at> spamgourmet.com>

Date: Wed, 16 Sep 2015 15:24:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21497 in the body.
You can then email your comments to 21497 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#21497; Package coreutils. (Wed, 16 Sep 2015 15:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chris Severance <aur.severach <at> spamgourmet.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 16 Sep 2015 15:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Chris Severance <aur.severach <at> spamgourmet.com>
To: bug-coreutils <at> gnu.org
Subject: install from multiple sources to -t target uses incorrect folder on
 some sources
Date: Wed, 16 Sep 2015 10:29:16 -0400
The following script of 4 equivalent installs does not complete.

#!/usr/bin/bash

set -e
set -u

# Bug report for install (GNU coreutils) 8.24
# Arch Linux gq 4.1.6-1-ARCH #1 SMP PREEMPT Mon Aug 17 08:52:28 CEST
2015 x86_64 GNU/Linux
# The following 4 install do the same thing. One will fail.

rm -rf 'testin' 'testout'
mkdir -p 'testin/d2'
touch 'testin/f1' 'testin/d2/f2' 'f3'
echo 'Try 1'
install -Dpm644 'testin/f1' 'testin/d2/f2' 'f3' -t "${PWD}/testout/"
rm -rf 'testout'
echo 'Try 2'
install -Dpm644 "${PWD}/testin/f1" "${PWD}/testin/d2/f2" 'f3' -t
"testout/"
rm -rf 'testout'
echo 'Try 3'
install -Dpm644 'f3' "${PWD}/testin/f1" "${PWD}/testin/d2/f2" -t
"${PWD}/testout/"
rm -rf 'testout'
echo 'Try 4 will fail'
install -Dpm644 "${PWD}/testin/f1" "${PWD}/testin/d2/f2" 'f3' -t
"${PWD}/testout/"
# install: cannot stat 'f3': No such file or directory







Information forwarded to bug-coreutils <at> gnu.org:
bug#21497; Package coreutils. (Sat, 02 Jan 2016 22:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 21497 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Chris Severance <aur.severach <at> spamgourmet.com>, 21497 <at> debbugs.gnu.org
Cc: Coreutils <coreutils <at> gnu.org>
Subject: Re: bug#21497: install from multiple sources to -t target uses
 incorrect folder on some sources
Date: Sat, 2 Jan 2016 22:28:56 +0000
[Message part 1 (text/plain, inline)]
On 16/09/15 15:29, Chris Severance wrote:
> The following script of 4 equivalent installs does not complete.
> 
> #!/usr/bin/bash
> 
> set -e
> set -u
> 
> # Bug report for install (GNU coreutils) 8.24
> # Arch Linux gq 4.1.6-1-ARCH #1 SMP PREEMPT Mon Aug 17 08:52:28 CEST
> 2015 x86_64 GNU/Linux
> # The following 4 install do the same thing. One will fail.
> 
> rm -rf 'testin' 'testout'
> mkdir -p 'testin/d2'
> touch 'testin/f1' 'testin/d2/f2' 'f3'
> echo 'Try 1'
> install -Dpm644 'testin/f1' 'testin/d2/f2' 'f3' -t "${PWD}/testout/"
> rm -rf 'testout'
> echo 'Try 2'
> install -Dpm644 "${PWD}/testin/f1" "${PWD}/testin/d2/f2" 'f3' -t
> "testout/"
> rm -rf 'testout'
> echo 'Try 3'
> install -Dpm644 'f3' "${PWD}/testin/f1" "${PWD}/testin/d2/f2" -t
> "${PWD}/testout/"
> rm -rf 'testout'
> echo 'Try 4 will fail'
> install -Dpm644 "${PWD}/testin/f1" "${PWD}/testin/d2/f2" 'f3' -t
> "${PWD}/testout/"
> # install: cannot stat 'f3': No such file or directory

Thanks for the excellent summary.

The first attached patch should fix this.
Also included are another 2 improvements
I noticed while implementing the fix.

thanks,
Pádraig.

[install-D-relative.patch (text/x-patch, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#21497; Package coreutils. (Sat, 02 Jan 2016 23:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 21497 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Pádraig Brady <P <at> draigBrady.com>,
 Chris Severance <aur.severach <at> spamgourmet.com>, 21497 <at> debbugs.gnu.org
Cc: Coreutils <coreutils <at> gnu.org>
Subject: Re: bug#21497: install from multiple sources to -t target uses
 incorrect folder on some sources
Date: Sun, 3 Jan 2016 00:38:03 +0100
On 01/02/2016 11:28 PM, Pádraig Brady wrote:
> Subject: [PATCH 1/3] install: fix relative copies to absolute directory with
>  -D
> 
> * src/install.c (mkancesdirs_safe_wd): Unconditionally
> restore the current working directory when possible called
> multiple times (from install_file_in_dir()).

Minor nit:
  s/possible/possibly/ ?

The actual change, the test case and the other 2 patches look good to me.

Thanks & have a nice day,
Berny




bug closed, send any further explanations to 21497 <at> debbugs.gnu.org and Chris Severance <aur.severach <at> spamgourmet.com> Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Sun, 03 Jan 2016 13:02:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 01 Feb 2016 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.