GNU bug report logs - #55270
unpack phase randomly changes the cwd

Previous Next

Package: guix;

Reported by: Attila Lendvai <attila <at> lendvai.name>

Date: Thu, 5 May 2022 11:17:01 UTC

Severity: normal

Full log


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

From: Attila Lendvai <attila <at> lendvai.name>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 55270 <at> debbugs.gnu.org
Subject: Re: bug#55270: unpack phase randomly changes the cwd
Date: Thu, 05 May 2022 13:15:28 +0000
> It takes the first result 'scandir' -- i.e., the 'smallest' file name
> according to string-locale<?, so technically it's not random (so no
> reproducibility problems)


fair enough. what i meant to communicate is that it's arbitrary, not random.

another potential issue:

if the root of the archive contains a file called 'environment-variables', then this way it would overwrite the one generated by Guix. this may not necessarily be an issue, though, if that file is never used after the unpack phase.

maybe the cleanest would be to:

1) mkdir a directory ('extracted/'?) and chdir into it prior to
   unpacking, and

2) only do the DWIM chdir if the toplevel of the archive was a single
   dir.

but i lack the necessary perspective to see all the implications.

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“There is always a philosophy for lack of courage.”
	— Albert Camus (1913–1960)





This bug report was last modified 2 years and 338 days ago.

Previous Next


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