r5178 - in glibc-package/trunk/debian: . patches patches/hurd-i386
Author: sthibault
Date: 2012-03-25 17:35:01 +0000 (Sun, 25 Mar 2012)
New Revision: 5178
Added:
glibc-package/trunk/debian/patches/hurd-i386/tg-symlink_dealloc.diff
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/patches/series
Log:
New hurd-i386 patch to fix port deallocation on symlink creation failure.
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2012-03-06 18:42:38 UTC (rev 5177)
+++ glibc-package/trunk/debian/changelog 2012-03-25 17:35:01 UTC (rev 5178)
@@ -1,6 +1,8 @@
eglibc (2.13-28) UNRELEASED; urgency=low
- *
+ [ Samuel Thibault ]
+ * patches/hurd-i386/tg-symlink_dealloc.diff: New patch from Ludovic Courtès
+ to fix port deallocation on symlink creation failure.
-- Aurelien Jarno <aurel32@debian.org> Mon, 27 Feb 2012 07:03:32 +0100
Added: glibc-package/trunk/debian/patches/hurd-i386/tg-symlink_dealloc.diff
===================================================================
--- glibc-package/trunk/debian/patches/hurd-i386/tg-symlink_dealloc.diff (rev 0)
+++ glibc-package/trunk/debian/patches/hurd-i386/tg-symlink_dealloc.diff 2012-03-25 17:35:01 UTC (rev 5178)
@@ -0,0 +1,75 @@
+From: Ludovic Courtès <ludo@gnu.org>
+Subject: [PATCH] Fix invalid port deallocation in `symlink'
+
+2012-03-18 Ludovic Courtès <address@hidden>
+
+ * sysdeps/mach/hurd/symlink.c (__symlink): Deallocate NODE only
+ when it is non-null.
+ * sysdeps/mach/hurd/symlinkat.c (symlinkat): Likewise.
+
+---
+ sysdeps/mach/hurd/symlink.c | 7 +++++--
+ sysdeps/mach/hurd/symlinkat.c | 7 +++++--
+ 2 files changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/sysdeps/mach/hurd/symlink.c b/sysdeps/mach/hurd/symlink.c
+index 857e236..4a4e61f 100644
+--- a/sysdeps/mach/hurd/symlink.c
++++ b/sysdeps/mach/hurd/symlink.c
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
++/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 12 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
+@@ -44,6 +44,7 @@ __symlink (from, to)
+ return -1;
+
+ /* Create a new, unlinked node in the target directory. */
++ node = MACH_PORT_NULL;
+ err = __dir_mkfile (dir, O_WRITE, 0777 & ~_hurd_umask, &node);
+
+ if (! err)
+@@ -59,7 +60,9 @@ __symlink (from, to)
+ err = __dir_link (dir, node, name, 1);
+
+ __mach_port_deallocate (__mach_task_self (), dir);
+- __mach_port_deallocate (__mach_task_self (), node);
++
++ if (node != MACH_PORT_NULL)
++ __mach_port_deallocate (__mach_task_self (), node);
+
+ if (err)
+ return __hurd_fail (err);
+diff --git a/sysdeps/mach/hurd/symlinkat.c b/sysdeps/mach/hurd/symlinkat.c
+index 9a51c66..71806d7 100644
+--- a/sysdeps/mach/hurd/symlinkat.c
++++ b/sysdeps/mach/hurd/symlinkat.c
+@@ -1,5 +1,5 @@
+ /* Create a symbolic link named relative to an open directory. Hurd version.
+- Copyright (C) 1991,1992,1993,1994,1995,1996,1997,2006
++ Copyright (C) 1991,1992,1993,1994,1995,1996,1997,2006,2012
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+@@ -51,6 +51,7 @@ symlinkat (from, fd, to)
+ return -1;
+
+ /* Create a new, unlinked node in the target directory. */
++ node = MACH_PORT_NULL;
+ err = __dir_mkfile (dir, O_WRITE, 0777 & ~_hurd_umask, &node);
+
+ if (! err)
+@@ -66,7 +67,9 @@ symlinkat (from, fd, to)
+ err = __dir_link (dir, node, name, 1);
+
+ __mach_port_deallocate (__mach_task_self (), dir);
+- __mach_port_deallocate (__mach_task_self (), node);
++
++ if (node != MACH_PORT_NULL)
++ __mach_port_deallocate (__mach_task_self (), node);
+
+ if (err)
+ return __hurd_fail (err);
+--
+tg: (0234227..) t/symlink_dealloc (depends on: baseline)
Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series 2012-03-06 18:42:38 UTC (rev 5177)
+++ glibc-package/trunk/debian/patches/series 2012-03-25 17:35:01 UTC (rev 5178)
@@ -178,6 +178,7 @@
hurd-i386/tg-mach-nanosleep.diff
hurd-i386/cvs-mmap.diff
hurd-i386/cvs-hurd-socket-EAFNOSUPPORT.diff
+hurd-i386/tg-symlink_dealloc.diff
kfreebsd/submitted-libc_once.diff
Reply to: