bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30918: Don't use syscall() to call renameat2()


From: Paul Eggert
Subject: bug#30918: Don't use syscall() to call renameat2()
Date: Sun, 25 Mar 2018 18:20:56 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Seebs wrote:
I have significant concerns about the feasibility of a generic wrapper
for syscall(). In particular, a "wrapper" which does *nothing* but
forward arguments may well be practical. Or one which just fails
immediately and claims ENOTSUPP -- but this creates the risk that we'll
break things which were using perfectly valid syscalls which work fine
and which we don't need to intercept or do anything with.

For this particular issue, failing with ENOTSUPP should do. Perhaps such a behavior could be available as a link-time or runtime option.

More precise would be to have syscall to do nothing but forward arguments, *except* for the renameat2 syscall which would work much like the renameat wrapper that I assume you already have. This would work for coreutils, shouldn't break anything else, shouldn't require a link-time or runtime option, and shouldn't be that much harder than always forwarding syscall arguments.

I'm assuming the race condition refers to the behavior of
RENAME_EXCHANGE.

No, it's RENAME_NOREPLACE. Coreutils doesn't use RENAME_EXCHANGE now (though it might in the future, I suppose).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]