GNU bug report logs - #79072
install -d onto readonly fs prints the wrong error

Previous Next

Package: coreutils;

Reported by: Lauri Tirkkonen <lauri <at> hacktheplanet.fi>

Date: Tue, 22 Jul 2025 05:20:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Lauri Tirkkonen <lauri <at> hacktheplanet.fi>
Subject: bug#79072: closed (Re: bug#79072: install -d onto readonly fs
 prints the wrong error)
Date: Tue, 22 Jul 2025 19:19:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#79072: install -d onto readonly fs prints the wrong error

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 79072 <at> debbugs.gnu.org.

-- 
79072: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79072
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Lauri Tirkkonen <lauri <at> hacktheplanet.fi>
Cc: Gnulib bugs <bug-gnulib <at> gnu.org>, 79072-done <at> debbugs.gnu.org,
 Collin Funk <collin.funk1 <at> gmail.com>
Subject: Re: bug#79072: install -d onto readonly fs prints the wrong error
Date: Tue, 22 Jul 2025 12:17:56 -0700
[Message part 3 (text/plain, inline)]
Thanks for reporting that inaccurate diagnostic. Sorry about the tricky 
code; it's a tricky situation. Looks like Collin's patch is not quite right.

I installed the attached patches into Gnulib. The first one fixes the 
two cases you mentioned, the second an unlikely bug I discovered in the 
neighborhood. Please give the patches a try. As they fix the bugs for me 
I am boldly closing the Coreutils bug report; we can reopen it if I'm wrong.
[0001-mkdir-p-better-diagnostics.patch (text/x-patch, attachment)]
[0002-mkdir-p-ENOENT-ENOTDIR-safety-and-consistency.patch (text/x-patch, attachment)]
[Message part 6 (message/rfc822, inline)]
From: Lauri Tirkkonen <lauri <at> hacktheplanet.fi>
To: bug-coreutils <at> gnu.org
Subject: install -d onto readonly fs prints the wrong error
Date: Tue, 22 Jul 2025 13:17:30 +0900
Hi,

saw this on coreutils 9.7 on Alpine Linux, but it also reproduces on
commit 027855dcad52d718927c3405bc7d605143e2a625.

	# mount -t tmpfs -o ro none /mnt
	# ./src/ginstall -d /mnt/foo
	ginstall: cannot change permissions of ‘/mnt/foo’: No such file or directory

I would expect the error to be EROFS for creating the directory, not
changing permissions of the directory that was not able to be created.
strace confirms mkdir() returns EROFS, but install tries to open() and
stat() the not-created directory afterward.

-- 
Lauri Tirkkonen | lotheac @ IRCnet



This bug report was last modified 29 days ago.

Previous Next


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