commit-hurd
[Top][All Lists]
Advanced

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

[hurd,commited 3/3] hurd: Fix renameat2 error


From: Samuel Thibault
Subject: [hurd,commited 3/3] hurd: Fix renameat2 error
Date: Sun, 1 Dec 2019 19:53:06 +0100

renameat2 has to exclude RENAME_EXCHANGE | RENAME_NOREPLACE with EINVAL,
as tested by stdio-common/tst-renameat2.
---
 sysdeps/mach/hurd/renameat2.c | 2 ++
 1 file changed, 2 insertions(+)

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)
-- 
2.24.0




reply via email to

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