This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Update m68k fchownat
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-ports at sourceware dot org
- Date: Fri, 30 Oct 2009 14:25:13 +0000 (UTC)
- Subject: Update m68k fchownat
This patch fixes the m68k fchownat implementation to handle empty file
names correctly in line with the libc changes for this issue for bug
10609. OK to commit?
If anyone wishes to update alpha ports files for libc changes,
sysdeps/unix/sysv/linux/alpha/fxstatat.c looks like it needs a similar
update.
diff --git a/ChangeLog.m68k b/ChangeLog.m68k
index 41ede01..59be68c 100644
--- a/ChangeLog.m68k
+++ b/ChangeLog.m68k
@@ -1,3 +1,9 @@
+2009-10-30 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #10609]
+ * sysdeps/unix/sysv/linux/m68k/fchownat.c (fchownat): Fix handling
+ of empty parameters for file names.
+
2009-09-06 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c: New file.
diff --git a/sysdeps/unix/sysv/linux/m68k/fchownat.c b/sysdeps/unix/sysv/linux/m68k/fchownat.c
index 6cc0932..cbf5380 100644
--- a/sysdeps/unix/sysv/linux/m68k/fchownat.c
+++ b/sysdeps/unix/sysv/linux/m68k/fchownat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -51,6 +51,12 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
if (fd != AT_FDCWD && file[0] != '/')
{
size_t filelen = strlen (file);
+ if (__builtin_expect (filelen == 0, 0))
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+
static const char procfd[] = "/proc/self/fd/%d/%s";
/* Buffer for the path name we are going to use. It consists of
- the string /proc/self/fd/
--
Joseph S. Myers
joseph@codesourcery.com