Thanks for remembering me; didn't try the patch yet but overall looks
good to me.
Just one nitpick on the not supported message check:
Pádraig Brady wrote on Sat, Mar 02, 2024 at 11:01:42AM +0000:
> + if (renameatu (AT_FDCWD, file[0], AT_FDCWD, file[1],
> + RENAME_EXCHANGE))
> + {
> + if (errno == EINVAL || is_ENOTSUP (errno))
checking the man page, renameeat with RENAME_EXCHANGE on a dir and
something inside it also fails with EINVAL, so that will print the
operation isn't supported when it can probably be considered a user
error (I did't take the time to try this patch, using another tool to
illustrate but it should be the same):
$ mkdir a
$ touch a/b
$ ./renameat2 --exchange a a/b
renameat2: Invalid argument
I guess there's not much we can do about this though, EINVAL could also
really mean not supported in this case and checking if one path is a
prefix of another seems overkill to me...
--
Dominique Martinet | Asmadeus