forked from pool/glibc
Accepting request 178384 from home:Andreas_Schwab:Factory
- glibc-bindresvport-blacklist.diff: Renamed from glibc-2.3.90-bindresvport.blacklist.diff; fix resource leaks (bnc#824046) - Remove glibc-armhf-compat.patch OBS-URL: https://build.opensuse.org/request/show/178384 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=289
This commit is contained in:
parent
9532d05464
commit
5e387c0743
@ -1,22 +0,0 @@
|
||||
Patch for elf/dl-load.c taken from Debian:
|
||||
For backward compatibility with armhf binaries built with the
|
||||
old linker SONAME, we need to fake out the linker to believe
|
||||
the new is the old, until such a point as everything is rebuilt.
|
||||
|
||||
--- glibc-2.15/elf/dl-load.c.~1~ 2011-12-30 23:13:56.000000000 +0100
|
||||
+++ glibc-2.15/elf/dl-load.c 2012-04-18 15:05:33.203485389 +0200
|
||||
@@ -2082,10 +2082,13 @@
|
||||
soname = ((const char *) D_PTR (l, l_info[DT_STRTAB])
|
||||
+ l->l_info[DT_SONAME]->d_un.d_val);
|
||||
if (strcmp (name, soname) != 0)
|
||||
+#ifdef __arm__
|
||||
+ if (strcmp(name, "ld-linux.so.3") || strcmp(soname, "ld-linux-armhf.so.3"))
|
||||
+#endif
|
||||
continue;
|
||||
|
||||
/* We have a match on a new name -- cache it. */
|
||||
- add_name_to_object (l, soname);
|
||||
+ add_name_to_object (l, name);
|
||||
l->l_soname_added = 1;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
Index: glibc-2.17/sunrpc/bindrsvprt.c
|
||||
===================================================================
|
||||
--- glibc-2.16.90.orig/sunrpc/bindrsvprt.c
|
||||
+++ glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
--- glibc-2.17.orig/sunrpc/bindrsvprt.c
|
||||
+++ glibc-2.17/sunrpc/bindrsvprt.c
|
||||
@@ -29,6 +29,9 @@
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
@ -12,7 +12,7 @@ Index: glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
@@ -42,21 +45,102 @@
|
||||
@@ -42,6 +45,93 @@
|
||||
*/
|
||||
__libc_lock_define_initialized (static, lock);
|
||||
|
||||
@ -21,10 +21,8 @@ Index: glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
+#define ENDPORT (IPPORT_RESERVED - 1)
|
||||
+#define NPORTS (ENDPORT - STARTPORT + 1)
|
||||
+
|
||||
+/*
|
||||
+ * Read the file /etc/rpc.blacklisted, so that we don't bind
|
||||
+ * to this ports.
|
||||
+ */
|
||||
+/* Read the file /etc/rpc.blacklisted, so that we don't bind to these
|
||||
+ ports. */
|
||||
+
|
||||
+static int blacklist_read;
|
||||
+static int *list;
|
||||
@ -39,11 +37,13 @@ Index: glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
+ int size = 0, ptr = 0;
|
||||
+
|
||||
+ __libc_lock_lock (lock);
|
||||
+ if (blacklist_read)
|
||||
+ goto unlock;
|
||||
+ blacklist_read = 1;
|
||||
+
|
||||
+ fp = fopen ("/etc/bindresvport.blacklist", "r");
|
||||
+ if (NULL == fp)
|
||||
+ return;
|
||||
+ if (fp == NULL)
|
||||
+ goto unlock;
|
||||
+
|
||||
+ while (!feof_unlocked (fp))
|
||||
+ {
|
||||
@ -54,47 +54,51 @@ Index: glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
+ break;
|
||||
+
|
||||
+ cp = buf;
|
||||
+ tmp = strchr (cp, '#'); /* remove comments */
|
||||
+ /* Remove comments. */
|
||||
+ tmp = strchr (cp, '#');
|
||||
+ if (tmp)
|
||||
+ *tmp = '\0';
|
||||
+ while (isspace ((int)*cp)) /* remove spaces and tabs */
|
||||
+ /* Remove spaces and tabs. */
|
||||
+ while (isspace ((unsigned char) *cp))
|
||||
+ ++cp;
|
||||
+ if (*cp == '\0') /* ignore empty lines */
|
||||
+ /* Ignore empty lines. */
|
||||
+ if (*cp == '\0')
|
||||
+ continue;
|
||||
+ if (cp[strlen (cp) - 1] == '\n')
|
||||
+ cp[strlen (cp) - 1] = '\0';
|
||||
+
|
||||
+ port = strtoul (cp, &tmp, 0);
|
||||
+ while (isspace(*tmp))
|
||||
+ while (isspace ((unsigned char) *tmp))
|
||||
+ ++tmp;
|
||||
+ if (*tmp != '\0' || (port == ULONG_MAX && errno == ERANGE))
|
||||
+ continue;
|
||||
+
|
||||
+ /* Don't bother with out-of-range ports */
|
||||
+ /* Don't bother with out-of-range ports. */
|
||||
+ if (port < LOWPORT || port > ENDPORT)
|
||||
+ continue;
|
||||
+
|
||||
+ if (ptr >= size)
|
||||
+ {
|
||||
+ size += 10;
|
||||
+ list = realloc (list, size * sizeof (int));
|
||||
+ if (list == NULL)
|
||||
+ int *new_list = realloc (list, size * sizeof (int));
|
||||
+ if (new_list == NULL)
|
||||
+ {
|
||||
+ free (list);
|
||||
+ list = NULL;
|
||||
+ free (buf);
|
||||
+ return;
|
||||
+ goto unlock;
|
||||
+ }
|
||||
+ list = new_list;
|
||||
+ }
|
||||
+
|
||||
+ list[ptr++] = port;
|
||||
+ }
|
||||
+
|
||||
+ fclose (fp);
|
||||
+
|
||||
+ if (buf)
|
||||
+ free (buf);
|
||||
+
|
||||
+ free (buf);
|
||||
+ list_size = ptr;
|
||||
+
|
||||
+ unlock:
|
||||
+ __libc_lock_unlock (lock);
|
||||
+}
|
||||
+
|
||||
@ -102,11 +106,7 @@ Index: glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
/*
|
||||
* Bind a socket to a privileged IP port
|
||||
*/
|
||||
int
|
||||
bindresvport (int sd, struct sockaddr_in *sin)
|
||||
{
|
||||
+ static short startport = STARTPORT;
|
||||
static short port;
|
||||
@@ -52,12 +142,11 @@ bindresvport (int sd, struct sockaddr_in
|
||||
struct sockaddr_in myaddr;
|
||||
int i;
|
||||
|
||||
@ -114,13 +114,15 @@ Index: glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
-#define LOWPORT 512
|
||||
-#define ENDPORT (IPPORT_RESERVED - 1)
|
||||
-#define NPORTS (ENDPORT - STARTPORT + 1)
|
||||
- static short startport = STARTPORT;
|
||||
static short startport = STARTPORT;
|
||||
|
||||
+ if (!blacklist_read)
|
||||
+ load_blacklist ();
|
||||
|
||||
+
|
||||
if (sin == (struct sockaddr_in *) 0)
|
||||
{
|
||||
@@ -75,6 +159,7 @@ bindresvport (int sd, struct sockaddr_in
|
||||
sin = &myaddr;
|
||||
@@ -75,6 +164,7 @@ bindresvport (int sd, struct sockaddr_in
|
||||
port = (__getpid () % NPORTS) + STARTPORT;
|
||||
}
|
||||
|
||||
@ -128,7 +130,7 @@ Index: glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
/* Initialize to make gcc happy. */
|
||||
int res = -1;
|
||||
|
||||
@@ -86,12 +171,22 @@ bindresvport (int sd, struct sockaddr_in
|
||||
@@ -86,12 +176,22 @@ bindresvport (int sd, struct sockaddr_in
|
||||
again:
|
||||
for (i = 0; i < nports; ++i)
|
||||
{
|
||||
@ -139,7 +141,7 @@ Index: glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
+
|
||||
+ sin->sin_port = htons (port);
|
||||
+
|
||||
+ /* Check, if this port is not blacklisted. */
|
||||
+ /* Check that this port is not blacklisted. */
|
||||
+ for (j = 0; j < list_size; j++)
|
||||
+ if (port == list[j])
|
||||
+ goto try_next_port;
|
||||
@ -148,7 +150,7 @@ Index: glibc-2.16.90/sunrpc/bindrsvprt.c
|
||||
if (res >= 0 || errno != EADDRINUSE)
|
||||
break;
|
||||
+
|
||||
+try_next_port:
|
||||
+ try_next_port:
|
||||
+ if (++port > endport)
|
||||
+ port = startport;
|
||||
}
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 10 08:33:46 UTC 2013 - schwab@suse.de
|
||||
|
||||
- glibc-bindresvport-blacklist.diff: Renamed from
|
||||
glibc-2.3.90-bindresvport.blacklist.diff; fix resource leaks
|
||||
(bnc#824046)
|
||||
- Remove glibc-armhf-compat.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 20 08:26:35 UTC 2013 - schwab@suse.de
|
||||
|
||||
|
@ -203,13 +203,11 @@ Patch12: glibc-2.3.90-noversion.diff
|
||||
# PATCH-FIX-OPENSUSE -- Make --no-archive default for localedef - kukuk@suse.de
|
||||
Patch13: glibc-2.3.2.no_archive.diff
|
||||
# PATCH-FIX-OPENSUSE -- add blacklist for bindresvport
|
||||
Patch14: glibc-2.3.90-bindresvport.blacklist.diff
|
||||
Patch14: glibc-bindresvport-blacklist.diff
|
||||
# PATCH-FIX-OPENSUSE prefer -lang rpm packages
|
||||
Patch15: glibc-2.3.90-langpackdir.diff
|
||||
# PATCH-FEATURE-SLE increase cpusetsize to 4096, needs to be kept for compatibility kukuk@suse.de (XXX: Review)
|
||||
Patch18: glibc-cpusetsize.diff
|
||||
# PATCH-FIX-OPENSUSE Allow ARM binaries with old linker path to run - aj@suse.de
|
||||
Patch20: glibc-armhf-compat.patch
|
||||
# PATCH-FIX-OPENSUSE Fix check abi for crypt additions
|
||||
Patch21: glibc-fix-check-abi.patch
|
||||
# PATCH-FIX-OPENSUSE Disable badsalttest which expects that crypt can fail
|
||||
@ -479,10 +477,6 @@ rm nscd/s-stamp
|
||||
%patch305 -p1
|
||||
%patch306 -p1
|
||||
|
||||
%ifarch armv7l armv7hl
|
||||
%patch20 -p1
|
||||
%endif
|
||||
|
||||
%patch1000 -p1
|
||||
%patch1001 -p1
|
||||
%patch1002 -p1
|
||||
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 10 08:33:46 UTC 2013 - schwab@suse.de
|
||||
|
||||
- glibc-bindresvport-blacklist.diff: Renamed from
|
||||
glibc-2.3.90-bindresvport.blacklist.diff; fix resource leaks
|
||||
(bnc#824046)
|
||||
- Remove glibc-armhf-compat.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 20 08:26:35 UTC 2013 - schwab@suse.de
|
||||
|
||||
|
@ -202,13 +202,11 @@ Patch12: glibc-2.3.90-noversion.diff
|
||||
# PATCH-FIX-OPENSUSE -- Make --no-archive default for localedef - kukuk@suse.de
|
||||
Patch13: glibc-2.3.2.no_archive.diff
|
||||
# PATCH-FIX-OPENSUSE -- add blacklist for bindresvport
|
||||
Patch14: glibc-2.3.90-bindresvport.blacklist.diff
|
||||
Patch14: glibc-bindresvport-blacklist.diff
|
||||
# PATCH-FIX-OPENSUSE prefer -lang rpm packages
|
||||
Patch15: glibc-2.3.90-langpackdir.diff
|
||||
# PATCH-FEATURE-SLE increase cpusetsize to 4096, needs to be kept for compatibility kukuk@suse.de (XXX: Review)
|
||||
Patch18: glibc-cpusetsize.diff
|
||||
# PATCH-FIX-OPENSUSE Allow ARM binaries with old linker path to run - aj@suse.de
|
||||
Patch20: glibc-armhf-compat.patch
|
||||
# PATCH-FIX-OPENSUSE Fix check abi for crypt additions
|
||||
Patch21: glibc-fix-check-abi.patch
|
||||
# PATCH-FIX-OPENSUSE Disable badsalttest which expects that crypt can fail
|
||||
@ -479,10 +477,6 @@ rm nscd/s-stamp
|
||||
%patch305 -p1
|
||||
%patch306 -p1
|
||||
|
||||
%ifarch armv7l armv7hl
|
||||
%patch20 -p1
|
||||
%endif
|
||||
|
||||
%patch1000 -p1
|
||||
%patch1001 -p1
|
||||
%patch1002 -p1
|
||||
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 10 08:33:46 UTC 2013 - schwab@suse.de
|
||||
|
||||
- glibc-bindresvport-blacklist.diff: Renamed from
|
||||
glibc-2.3.90-bindresvport.blacklist.diff; fix resource leaks
|
||||
(bnc#824046)
|
||||
- Remove glibc-armhf-compat.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 20 08:26:35 UTC 2013 - schwab@suse.de
|
||||
|
||||
|
@ -203,13 +203,11 @@ Patch12: glibc-2.3.90-noversion.diff
|
||||
# PATCH-FIX-OPENSUSE -- Make --no-archive default for localedef - kukuk@suse.de
|
||||
Patch13: glibc-2.3.2.no_archive.diff
|
||||
# PATCH-FIX-OPENSUSE -- add blacklist for bindresvport
|
||||
Patch14: glibc-2.3.90-bindresvport.blacklist.diff
|
||||
Patch14: glibc-bindresvport-blacklist.diff
|
||||
# PATCH-FIX-OPENSUSE prefer -lang rpm packages
|
||||
Patch15: glibc-2.3.90-langpackdir.diff
|
||||
# PATCH-FEATURE-SLE increase cpusetsize to 4096, needs to be kept for compatibility kukuk@suse.de (XXX: Review)
|
||||
Patch18: glibc-cpusetsize.diff
|
||||
# PATCH-FIX-OPENSUSE Allow ARM binaries with old linker path to run - aj@suse.de
|
||||
Patch20: glibc-armhf-compat.patch
|
||||
# PATCH-FIX-OPENSUSE Fix check abi for crypt additions
|
||||
Patch21: glibc-fix-check-abi.patch
|
||||
# PATCH-FIX-OPENSUSE Disable badsalttest which expects that crypt can fail
|
||||
@ -479,10 +477,6 @@ rm nscd/s-stamp
|
||||
%patch305 -p1
|
||||
%patch306 -p1
|
||||
|
||||
%ifarch armv7l armv7hl
|
||||
%patch20 -p1
|
||||
%endif
|
||||
|
||||
%patch1000 -p1
|
||||
%patch1001 -p1
|
||||
%patch1002 -p1
|
||||
|
Loading…
Reference in New Issue
Block a user