Update m68k fchownat

View: New views
8 Messages — Rating Filter:   Alert me  

Update m68k fchownat

by Joseph S. Myers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...>
+
+ [BZ #10609]
+ * sysdeps/unix/sysv/linux/m68k/fchownat.c (fchownat): Fix handling
+ of empty parameters for file names.
+
 2009-09-06  Andreas Schwab  <schwab@...>
 
  * 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@...

Re: Update m68k fchownat

by Andreas Schwab-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

"Joseph S. Myers" <joseph@...> writes:

> +2009-10-30  Joseph Myers  <joseph@...>
> +
> + [BZ #10609]
> + * sysdeps/unix/sysv/linux/m68k/fchownat.c (fchownat): Fix handling
> + of empty parameters for file names.

Ok.

Andreas.

--
Andreas Schwab, schwab@...
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Re: Update m68k fchownat

by Matt Turner-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 30, 2009 at 9:25 AM, Joseph S. Myers
<joseph@...> wrote:
> 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.

If you could whip up a quick patch, I'll test it for you. (I'd do it,
but I haven't done the GNU copyright sign-off stuff yet.)

Thanks for the heads-up too.

Matt

Re: Update m68k fchownat

by Matt Turner-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 30, 2009 at 9:25 AM, Joseph S. Myers
<joseph@...> wrote:
> 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.

Hi Joseph,
Please find and commit if appropriate the attached patch to fix alpha
__fxstatat for empty file names.

If it's preferred that I send the patch inline, please let me know. I
haven't completely the copyright assignment paperwork, but I think
this patch is sufficiently trivial that copyright assignment isn't
needed.

Thanks,
Matt Turner


0001-Fix-alpha-__fxstatat-for-empty-file-names.patch (2K) Download Attachment

Re: Update m68k fchownat

by Joseph S. Myers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 10 Nov 2009, Matt Turner wrote:

> On Fri, Oct 30, 2009 at 9:25 AM, Joseph S. Myers
> <joseph@...> wrote:
> > 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.
>
> Hi Joseph,
> Please find and commit if appropriate the attached patch to fix alpha
> __fxstatat for empty file names.

I have committed this as a purely mechanical update, but must remind you
that as I said in
<http://sourceware.org/ml/libc-ports/2009-11/msg00017.html> there are
rather more updates needed for this target, including an ____longjmp_chk
implementation which will need review by an alpha expert.

--
Joseph S. Myers
joseph@...

Re: Update m68k fchownat

by Matt Turner-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Nov 10, 2009 at 4:15 PM, Joseph S. Myers
<joseph@...> wrote:

> On Tue, 10 Nov 2009, Matt Turner wrote:
>
>> On Fri, Oct 30, 2009 at 9:25 AM, Joseph S. Myers
>> <joseph@...> wrote:
>> > 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.
>>
>> Hi Joseph,
>> Please find and commit if appropriate the attached patch to fix alpha
>> __fxstatat for empty file names.
>
> I have committed this as a purely mechanical update, but must remind you
> that as I said in
> <http://sourceware.org/ml/libc-ports/2009-11/msg00017.html> there are
> rather more updates needed for this target, including an ____longjmp_chk
> implementation which will need review by an alpha expert.

Thanks! I'll see what I can do about the more pressing issues as well.

On a separate note, Gentoo is using around 10 patches for glibc on
alpha, mostly from Aurelien Jarno. I guess I should try to get these
into glibc-ports.git too.

Matt

Re: Update m68k fchownat

by Joseph S. Myers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 10 Nov 2009, Matt Turner wrote:

> On a separate note, Gentoo is using around 10 patches for glibc on
> alpha, mostly from Aurelien Jarno. I guess I should try to get these
> into glibc-ports.git too.

I can only review very straightforward mechanical updates to unmaintained
ports.  Anything needing target-specific knowledge will need to be
reviewed by RTH or another maintainer familiar with alpha (and anyone
familiar with alpha but not presently a maintainer, who cares about glibc
on alpha, should consider getting a copyright assignment and volunteering
to be maintainer once they've produced a few good patches).

--
Joseph S. Myers
joseph@...

Re: Update m68k fchownat

by Joseph S. Myers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 10 Nov 2009, Matt Turner wrote:

> On a separate note, Gentoo is using around 10 patches for glibc on
> alpha, mostly from Aurelien Jarno. I guess I should try to get these
> into glibc-ports.git too.

Note a previous thread regarding some of his patches
<http://sourceware.org/ml/libc-ports/2009-07/msg00008.html>.  Any fixes in
that set that didn't get approved by RTH then (there was at least one) are
going to need revision and approval by RTH or another alpha expert.

(If you want patches that went in after 2.10 branch cherry-picked to 2.10
branch, then post a list of the relevant commits.)

--
Joseph S. Myers
joseph@...