rpms/netlabel_tools/devel netlabel_tools-0.17-newlibnl.patch, 1.1, 1.2 netlabel_tools.spec, 1.7, 1.8

Steve Conklin (sconklin) fedora-extras-commits at redhat.com
Mon Feb 11 15:33:52 UTC 2008


Author: sconklin

Update of /cvs/pkgs/rpms/netlabel_tools/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27013

Modified Files:
	netlabel_tools-0.17-newlibnl.patch netlabel_tools.spec 
Log Message:
New patch that fixes BZ 431766


netlabel_tools-0.17-newlibnl.patch:

Index: netlabel_tools-0.17-newlibnl.patch
===================================================================
RCS file: /cvs/pkgs/rpms/netlabel_tools/devel/netlabel_tools-0.17-newlibnl.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- netlabel_tools-0.17-newlibnl.patch	7 Feb 2008 19:05:38 -0000	1.1
+++ netlabel_tools-0.17-newlibnl.patch	11 Feb 2008 15:33:43 -0000	1.2
@@ -1,5 +1,6 @@
---- netlabel_tools-0.17/libnetlabel/netlabel_comm.c.spc	2008-02-07 08:57:38.000000000 -0600
-+++ netlabel_tools-0.17/libnetlabel/netlabel_comm.c	2008-02-07 09:02:01.000000000 -0600
+diff -up netlabel_tools-0.17/libnetlabel/netlabel_internal.h.libnl netlabel_tools-0.17/libnetlabel/netlabel_internal.h
+--- netlabel_tools-0.17/libnetlabel/netlabel_internal.h.libnl	2006-09-28 17:18:05.000000000 -0500
++++ netlabel_tools-0.17/libnetlabel/netlabel_internal.h	2008-02-11 09:24:06.000000000 -0600
 @@ -8,19 +8,17 @@
  /*
   * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
@@ -27,52 +28,25 @@
   *
   */
  
-@@ -100,7 +98,10 @@
-     goto open_failure;
+@@ -37,11 +35,13 @@ struct nlbl_handle_s {
+ /* Specify which version of libnl we are using */
+ /*  1.0-pre5 => 1005 */
+ /*  1.0-pre6 => 1006 */
+-#define LIBNL_VERSION           1005
++/*  1.0-pre8 => 1008 */
++/*  1.1      => 1100 */
++#define LIBNL_VERSION           1100
  
-   /* set the netlink handle properties */
--#if LIBNL_VERSION >= 1006
-+#if LIBNL_VERSION >= 1008
-+  nl_socket_set_peer_port(hndl->nl_hndl, 0);
-+  nl_set_passcred(hndl->nl_hndl, 1);
-+#elif LIBNL_VERSION == 1006
-   nl_handle_set_peer_pid(hndl->nl_hndl, 0);
-   nl_set_passcred(hndl->nl_hndl, 1);
- #endif
-@@ -177,7 +178,11 @@
-    * is waiting to be read from the handle */
-   timeout.tv_sec = nlcomm_read_timeout;
-   timeout.tv_usec = 0;
-+#if LIBNL_VERSION >= 1008
-+  nl_fd = nl_socket_get_fd(hndl->nl_hndl);
-+#else
-   nl_fd = nl_handle_get_fd(hndl->nl_hndl);
-+#endif
-   FD_ZERO(&read_fds);
-   FD_SET(nl_fd, &read_fds);
-   ret_val = select(nl_fd + 1, &read_fds, NULL, NULL, &timeout);
-@@ -250,7 +255,11 @@
-    * is waiting to be read from the handle */
-   timeout.tv_sec = nlcomm_read_timeout;
-   timeout.tv_usec = 0;
-+#if LIBNL_VERSION >= 1008
-+  nl_fd = nl_socket_get_fd(hndl->nl_hndl);
-+#else
-   nl_fd = nl_handle_get_fd(hndl->nl_hndl);
-+#endif
-   FD_ZERO(&read_fds);
-   FD_SET(nl_fd, &read_fds);
-   ret_val = select(nl_fd + 1, &read_fds, NULL, NULL, &timeout);
-@@ -349,6 +358,6 @@
- #if LIBNL_VERSION == 1005
-   return nl_send_auto_complete(hndl->nl_hndl, nlbl_msg_nlhdr(msg));
- #elif LIBNL_VERSION >= 1006
--  return = nl_send_auto_complete(hndl->nl_hndl, msg);
-+  return nl_send_auto_complete(hndl->nl_hndl, msg);
- #endif
- }
---- netlabel_tools-0.17/libnetlabel/netlabel_internal.h.spc	2008-02-07 08:58:27.000000000 -0600
-+++ netlabel_tools-0.17/libnetlabel/netlabel_internal.h	2008-02-07 09:02:01.000000000 -0600
+ /* XXX - this whole block will most likely go away once libnl supports Generic
+  * Netlink */
+-#if 1 /* Generic Netlink types */
++#if LIBNL_VERSION <= 1006 /* Generic Netlink types */
+ 
+ /* Generic Netlink message header */
+ struct genlmsghdr {
+diff -up netlabel_tools-0.17/libnetlabel/netlabel_msg.c.libnl netlabel_tools-0.17/libnetlabel/netlabel_msg.c
+--- netlabel_tools-0.17/libnetlabel/netlabel_msg.c.libnl	2006-09-28 17:18:05.000000000 -0500
++++ netlabel_tools-0.17/libnetlabel/netlabel_msg.c	2008-02-11 09:22:13.000000000 -0600
 @@ -8,19 +8,17 @@
  /*
   * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
@@ -100,24 +74,22 @@
   *
   */
  
-@@ -37,11 +35,12 @@
- /* Specify which version of libnl we are using */
- /*  1.0-pre5 => 1005 */
- /*  1.0-pre6 => 1006 */
--#define LIBNL_VERSION           1005
-+/*  1.0-pre8 => 1008 */
-+#define LIBNL_VERSION           1008
+@@ -52,7 +50,11 @@ nlbl_msg *nlbl_msg_new(void)
+   struct genlmsghdr genl_hdr;
  
- /* XXX - this whole block will most likely go away once libnl supports Generic
-  * Netlink */
--#if 1 /* Generic Netlink types */
-+#if LIBNL_VERSION <= 1006 /* Generic Netlink types */
+   /* create the message with a simple netlink header */
++#if LIBNL_VERSION >= 1008
++  msg = nlmsg_alloc();
++#else
+   msg = nlmsg_build_no_hdr();
++#endif
+   if (msg == NULL)
+     goto msg_new_failure;
  
- /* Generic Netlink message header */
- struct genlmsghdr {
---- netlabel_tools-0.17/libnetlabel/netlabel_msg.c.spc	2008-02-07 08:57:55.000000000 -0600
-+++ netlabel_tools-0.17/libnetlabel/netlabel_msg.c	2008-02-07 09:02:01.000000000 -0600
-@@ -8,19 +8,17 @@
+diff -up netlabel_tools-0.17/libnetlabel/netlabel_comm.c.libnl netlabel_tools-0.17/libnetlabel/netlabel_comm.c
+--- netlabel_tools-0.17/libnetlabel/netlabel_comm.c.libnl	2006-09-28 17:18:05.000000000 -0500
++++ netlabel_tools-0.17/libnetlabel/netlabel_comm.c	2008-02-11 09:24:06.000000000 -0600
+@@ -8,28 +8,33 @@
  /*
   * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
   *
@@ -144,15 +116,103 @@
   *
   */
  
-@@ -52,7 +50,11 @@
-   struct genlmsghdr genl_hdr;
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <unistd.h>
++#include <linux/types.h>
+ #include <sys/types.h>
++
++#ifndef __USE_GNU
++#define __USE_GNU
+ #include <sys/socket.h>
+-#include <linux/types.h>
++#undef __USE_GNU
++#else
++#include <sys/socket.h>
++#endif
  
-   /* create the message with a simple netlink header */
+ #include <libnetlabel.h>
+ 
+@@ -100,7 +105,10 @@ nlbl_handle *nlbl_comm_open(void)
+     goto open_failure;
+ 
+   /* set the netlink handle properties */
+-#if LIBNL_VERSION >= 1006
 +#if LIBNL_VERSION >= 1008
-+  msg = nlmsg_alloc();
++  nl_socket_set_peer_port(hndl->nl_hndl, 0);
++  nl_set_passcred(hndl->nl_hndl, 1);
++#elif LIBNL_VERSION == 1006
+   nl_handle_set_peer_pid(hndl->nl_hndl, 0);
+   nl_set_passcred(hndl->nl_hndl, 1);
+ #endif
+@@ -177,7 +185,11 @@ int nlbl_comm_recv_raw(nlbl_handle *hndl
+    * is waiting to be read from the handle */
+   timeout.tv_sec = nlcomm_read_timeout;
+   timeout.tv_usec = 0;
++#if LIBNL_VERSION >= 1008
++  nl_fd = nl_socket_get_fd(hndl->nl_hndl);
 +#else
-   msg = nlmsg_build_no_hdr();
+   nl_fd = nl_handle_get_fd(hndl->nl_hndl);
 +#endif
-   if (msg == NULL)
-     goto msg_new_failure;
+   FD_ZERO(&read_fds);
+   FD_SET(nl_fd, &read_fds);
+   ret_val = select(nl_fd + 1, &read_fds, NULL, NULL, &timeout);
+@@ -188,14 +200,12 @@ int nlbl_comm_recv_raw(nlbl_handle *hndl
  
+   /* perform the read operation */
+   *data = NULL;
+-#if LIBNL_VERSION == 1005
+-  ret_val = nl_recv(hndl->nl_hndl, &peer_nladdr, data);
++#if LIBNL_VERSION >= 1006
++  ret_val = nl_recv(hndl->nl_hndl, &peer_nladdr, data, &creds);
+   if (ret_val < 0)
+     return ret_val;
+-  /* XXX - avoid a compiler warning about unused variables */
+-  creds = NULL;
+-#elif LIBNL_VERSION >= 1006
+-  ret_val = nl_recv(hndl->nl_hndl, &peer_nladdr, data, &creds);
++#else
++  ret_val = nl_recv(hndl->nl_hndl, &peer_nladdr, data);
+   if (ret_val < 0)
+     return ret_val;
+ #endif
+@@ -250,7 +260,11 @@ int nlbl_comm_recv(nlbl_handle *hndl, nl
+    * is waiting to be read from the handle */
+   timeout.tv_sec = nlcomm_read_timeout;
+   timeout.tv_usec = 0;
++#if LIBNL_VERSION >= 1008
++  nl_fd = nl_socket_get_fd(hndl->nl_hndl);
++#else
+   nl_fd = nl_handle_get_fd(hndl->nl_hndl);
++#endif
+   FD_ZERO(&read_fds);
+   FD_SET(nl_fd, &read_fds);
+   ret_val = select(nl_fd + 1, &read_fds, NULL, NULL, &timeout);
+@@ -260,12 +274,16 @@ int nlbl_comm_recv(nlbl_handle *hndl, nl
+     return -EAGAIN;
+ 
+   /* perform the read operation */
+-#if LIBNL_VERSION == 1005
+-  ret_val = nl_recv(hndl->nl_hndl, &peer_nladdr, &data);
++#if LIBNL_VERSION >= 1100
++  ret_val = nl_recv(hndl->nl_hndl, &peer_nladdr, &data, &creds);
+   if (ret_val < 0)
+     return ret_val;
+ #elif LIBNL_VERSION >= 1006
+-  ret_val = nl_recv(hndl->nl_hndl, &peer_nladdr, &data, &creds);
++  ret_val = nl_recv(hndl->nl_hndl, &peer_nladdr, data, &creds);
++  if (ret_val < 0)
++    return ret_val;
++#else
++  ret_val = nl_recv(hndl->nl_hndl, &peer_nladdr, data);
+   if (ret_val < 0)
+     return ret_val;
+ #endif
+@@ -349,6 +367,6 @@ int nlbl_comm_send(nlbl_handle *hndl, nl
+ #if LIBNL_VERSION == 1005
+   return nl_send_auto_complete(hndl->nl_hndl, nlbl_msg_nlhdr(msg));
+ #elif LIBNL_VERSION >= 1006
+-  return = nl_send_auto_complete(hndl->nl_hndl, msg);
++  return nl_send_auto_complete(hndl->nl_hndl, msg);
+ #endif
+ }


Index: netlabel_tools.spec
===================================================================
RCS file: /cvs/pkgs/rpms/netlabel_tools/devel/netlabel_tools.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- netlabel_tools.spec	7 Feb 2008 19:05:38 -0000	1.7
+++ netlabel_tools.spec	11 Feb 2008 15:33:43 -0000	1.8
@@ -29,7 +29,7 @@
 %patch1 -p1
 # Upstream patch.
 %patch2 -p0
-%patch3 -p1
+%patch3 -p1 -b .libnl
 
 %build
 # Don't use _smp_mflags, it's small and a hand crafted Makefile




More information about the fedora-extras-commits mailing list