aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2019-12-01 16:46:38 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-12-01 16:46:59 +0000
commitd51ca7d6ad1ab41ee8c86680cc82a3b75cbb6fd3 (patch)
tree0139f41e46f25d122e6e4ba5c1a7c0a50f9ccca0
parent563202976e5786ecef491d45e6c0fada2b8d0fdb (diff)
downloadglibc-d51ca7d6ad1ab41ee8c86680cc82a3b75cbb6fd3.tar
glibc-d51ca7d6ad1ab41ee8c86680cc82a3b75cbb6fd3.tar.gz
glibc-d51ca7d6ad1ab41ee8c86680cc82a3b75cbb6fd3.tar.bz2
glibc-d51ca7d6ad1ab41ee8c86680cc82a3b75cbb6fd3.zip
hurd: Fix renameat2 error
renameat2 has to exclude RENAME_EXCHANGE | RENAME_NOREPLACE with EINVAL, as tested by stdio-common/tst-renameat2.
-rw-r--r--sysdeps/mach/hurd/renameat2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/renameat2.c b/sysdeps/mach/hurd/renameat2.c
index 7892e9ca9e..9e8f39d540 100644
--- a/sysdeps/mach/hurd/renameat2.c
+++ b/sysdeps/mach/hurd/renameat2.c
@@ -30,6 +30,8 @@ __renameat2 (int oldfd, const char *old, int newfd, const char *new,
const char *oldname, *newname;
int excl = 0;
+ if ((flags & (RENAME_EXCHANGE | RENAME_NOREPLACE)) == (RENAME_EXCHANGE | RENAME_NOREPLACE))
+ return __hurd_fail (EINVAL);
if (flags & (RENAME_EXCHANGE | RENAME_WHITEOUT))
return __hurd_fail (ENOSYS);
if (flags & RENAME_NOREPLACE)