GNU bug report logs - #48106
bug: touch utility does not handle file create error properly

Previous Next

Package: coreutils;

Reported by: Roland <devzero <at> web.de>

Date: Thu, 29 Apr 2021 18:40:02 UTC

Severity: normal

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

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 48106 in the body.
You can then email your comments to 48106 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#48106; Package coreutils. (Thu, 29 Apr 2021 18:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Roland <devzero <at> web.de>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 29 Apr 2021 18:40:02 GMT) Full text and rfc822 format available.

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

From: Roland <devzero <at> web.de>
To: bug-coreutils <at> gnu.org
Subject: bug: touch utility does not handle file create error properly
Date: Thu, 29 Apr 2021 20:23:47 +0200
hello,

touch utility telling weird error on file creation on a immutable/ro dir.

apparently, it does not catch/report the first error (EPERM) but only
the second one (ENOENT), when trying to set the time on the non-existing
file.

regards
roland kletzing
sysadmin

root <at> s900:/tmp# mkdir /tmp/test
root <at> s900:/tmp# chown 0400 /tmp/test/
root <at> s900:/tmp# chattr +i /tmp/test
root <at> s900:/tmp# touch /tmp/test/testfile
touch: setting times of '/tmp/test/testfile': No such file or directory

root <at> s900:/tmp# strace touch /tmp/test/testfile 2>&1 |grep -i test
execve("/usr/bin/touch", ["touch", "/tmp/test/testfile"], 0x7ffe690abb88
/* 19 vars */) = 0
openat(AT_FDCWD, "/tmp/test/testfile",
O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = -1 EPERM (Operation not
permitted)
utimensat(AT_FDCWD, "/tmp/test/testfile", NULL, 0) = -1 ENOENT (No such
file or directory)
write(2, "setting times of '/tmp/test/test"..., 37setting times of
'/tmp/test/testfile') = 37

# touch  --version
touch (GNU coreutils) 8.30

(on debian 10.9)





Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sat, 01 May 2021 22:49:02 GMT) Full text and rfc822 format available.

Notification sent to Roland <devzero <at> web.de>:
bug acknowledged by developer. (Sat, 01 May 2021 22:49:02 GMT) Full text and rfc822 format available.

Message #10 received at 48106-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Roland <devzero <at> web.de>
Cc: 48106-done <at> debbugs.gnu.org
Subject: Re: bug#48106: bug: touch utility does not handle file create error
 properly
Date: Sat, 1 May 2021 15:48:43 -0700
[Message part 1 (text/plain, inline)]
Thanks for reporting the problem. I installed the attached to fix it.
[0001-touch-fix-wrong-diagnostic-Bug-48106.patch (text/x-patch, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 30 May 2021 11:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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