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: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#79072: closed (install -d onto readonly fs prints the wrong
 error)
Date: Tue, 22 Jul 2025 19:19:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 22 Jul 2025 12:17:56 -0700
with message-id <ea9d57b2-5c80-4374-aa7c-ebfc1dfa5274 <at> cs.ucla.edu>
and subject line Re: bug#79072: install -d onto readonly fs prints the wrong error
has caused the debbugs.gnu.org bug report #79072,
regarding install -d onto readonly fs prints the wrong error
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> 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: 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


[Message part 3 (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 4 (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)]

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.