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

Lauri Tirkkonen via GNU coreutils Bug Reports <[email protected]>
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.