[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-recutils] [BUG] recutils 1.8, editing error if TMPDIR is on a t
From: |
Jose E. Marchesi |
Subject: |
Re: [bug-recutils] [BUG] recutils 1.8, editing error if TMPDIR is on a tmpfs |
Date: |
Mon, 07 Jan 2019 14:03:40 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hi.
first thanks for the new release, nice to see that recutils is still
maintained.
Thanks to you for your feedback! :)
I have the following issue:
my /tmp directory is on a tmpfs, mounted with
$:> mount | grep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=20971520k)
if I try to edit a recutil file
$:> touch test.rec
$:> recins -r "Name: Test" test.rec
recins: error: renaming file /tmp/receVREcm to test.rec
and the relevant part of a strace with the above command
access("test.rec", W_OK) = 0
stat("test.rec", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
stat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=320, ...}) = 0
getpid() = 566
openat(AT_FDCWD, "/tmp/recDHlD7C", O_RDWR|O_CREAT|O_EXCL, 0600) = 4
fcntl(4, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(4, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
write(4, "Name: Test\n", 11) = 11
close(4) = 0
rename("/tmp/recDHlD7C", "test.rec") = -1 EXDEV (Invalid cross-device
link)
unlink("/tmp/recDHlD7C") = 0
write(2, "recins", 6recins) = 6
write(2, ": error: ", 9: error: ) = 9
write(2, "renaming file /tmp/recDHlD7C to "..., 41renaming file
/tmp/recDHlD7C to test.rec
) = 41
close(1) = 0
close(2) = 0
exit_group(1) = ?
+++ exited with 1 +++
I'm using an up-to-date CRUX distro with gcc 7.4.0 and glibc 2.27.
Hmm, rename (2) doesn't work across different filesystems, hence the
EXDEV. We need to copy-and-delete instead, I am afraid.