From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44361 invoked by alias); 1 Dec 2019 18:53:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 44266 invoked by uid 89); 1 Dec 2019 18:53:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=H*RU:800, HX-Spam-Relays-External:800, H*r:800, HContent-Transfer-Encoding:8bit X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited 3/3] hurd: Fix renameat2 error Date: Sun, 01 Dec 2019 18:53:00 -0000 Message-Id: <20191201185306.1159853-4-samuel.thibault@ens-lyon.org> In-Reply-To: <20191201185306.1159853-1-samuel.thibault@ens-lyon.org> References: <20191201185306.1159853-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2019-12/txt/msg00008.txt.bz2 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