Hello community, here is the log from the commit of package netlabel for openSUSE:Factory checked in at 2014-06-04 18:39:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/netlabel (Old) and /work/SRC/openSUSE:Factory/.netlabel.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "netlabel" Changes: -------- --- /work/SRC/openSUSE:Factory/netlabel/netlabel.changes 2014-03-27 06:10:30.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.netlabel.new/netlabel.changes 2014-06-04 18:39:11.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Jun 2 02:21:03 UTC 2014 - crrodrig...@opensuse.org + +- Port to libnl3 (0001-Port-to-libnl3.patch) + This is the last package depending on libnl1, after all + relevant requests are accepted, libnl1 can be dropped. + +------------------------------------------------------------------- New: ---- 0001-Port-to-libnl3.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ netlabel.spec ++++++ --- /var/tmp/diff_new_pack.bw4Zj4/_old 2014-06-04 18:39:12.000000000 +0200 +++ /var/tmp/diff_new_pack.bw4Zj4/_new 2014-06-04 18:39:12.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package netlabel # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -34,15 +34,14 @@ Source0: http://downloads.sourceforge.net/project/netlabel/netlabel_tools/%{upstream_version}/netlabel_tools-%{upstream_version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: doxygen -%if 0%{?suse_version} >= 1210 -BuildRequires: libnl-1_1-devel -%else -BuildRequires: libnl-devel -%endif +BuildRequires: pkgconfig +BuildRequires: pkgconfig(libnl-3.0) # PATCH-FIX-UPSTREAM netlabel_tools-0.20.diff m...@suse.de Patch0: netlabel_tools-0.20.diff # PATCH-FIX-OPENSUSE netlabel_tools-0.20-service.diff m...@suse.de Patch1: netlabel_tools-0.20-service.diff +#PATCH-FIX_OPENSUSE posted to upstream late may 2014, port to libnl3 +Patch2: 0001-Port-to-libnl3.patch %description Explicit labeled networking for Linux @@ -81,7 +80,7 @@ %setup -q -n netlabel_tools-%{upstream_version} %patch0 -p0 %patch1 -p0 - +%patch2 -p1 %build CFLAGS="$RPM_OPT_FLAGS -W -Wall" export RPM_OPT_FLAGS CFLAGS ++++++ 0001-Port-to-libnl3.patch ++++++ >From d82ed2081cf58fb2504ba037d7a1e6444ec5019a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodrig...@opensuse.org> Date: Wed, 28 May 2014 00:11:37 -0400 Subject: [PATCH] Port to libnl3 --- libnetlabel/netlabel_comm.c | 35 ----------------------------- libnetlabel/netlabel_internal.h | 49 +++++++---------------------------------- libnetlabel/netlabel_msg.c | 4 ---- macros.mk | 2 +- netlabelctl/Makefile | 2 +- 5 files changed, 10 insertions(+), 82 deletions(-) diff --git a/libnetlabel/netlabel_comm.c b/libnetlabel/netlabel_comm.c index 289629b..02869e8 100644 --- a/libnetlabel/netlabel_comm.c +++ b/libnetlabel/netlabel_comm.c @@ -102,13 +102,8 @@ struct nlbl_handle *nlbl_comm_open(void) goto open_failure; /* set the netlink handle properties */ -#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 nl_disable_sequence_check(hndl->nl_hndl); /* connect to the generic netlink subsystem in the kernel */ @@ -177,11 +172,7 @@ int nlbl_comm_recv_raw(struct nlbl_handle *hndl, unsigned char **data) * no data 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); @@ -192,15 +183,9 @@ int nlbl_comm_recv_raw(struct nlbl_handle *hndl, unsigned char **data) /* perform the read operation */ *data = NULL; -#if LIBNL_VERSION >= 1006 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 /* if we are setup to receive credentials, only accept messages from * the kernel (ignore all others and send an -EAGAIN) */ @@ -251,11 +236,7 @@ int nlbl_comm_recv(struct nlbl_handle *hndl, nlbl_msg **msg) * no data 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); @@ -265,19 +246,9 @@ int nlbl_comm_recv(struct nlbl_handle *hndl, nlbl_msg **msg) return -EAGAIN; /* perform the read operation */ -#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); - 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 /* if we are setup to receive credentials, only accept messages from * the kernel (ignore all others and send an -EAGAIN) */ @@ -344,9 +315,7 @@ int nlbl_comm_send(struct nlbl_handle *hndl, nlbl_msg *msg) creds.gid = getegid(); /* set the message properties */ -#if LIBNL_VERSION >= 1006 nlmsg_set_creds(msg, &creds); -#endif /* request a netlink ack message */ nl_hdr = nlbl_msg_nlhdr(msg); @@ -355,9 +324,5 @@ int nlbl_comm_send(struct nlbl_handle *hndl, nlbl_msg *msg) nl_hdr->nlmsg_flags |= NLM_F_ACK; /* send the message */ -#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); -#endif } diff --git a/libnetlabel/netlabel_internal.h b/libnetlabel/netlabel_internal.h index acc2f03..54200af 100644 --- a/libnetlabel/netlabel_internal.h +++ b/libnetlabel/netlabel_internal.h @@ -27,6 +27,14 @@ #include <netlink/netlink.h> +#define nl_handle_alloc nl_socket_alloc +#define nl_handle_destroy nl_socket_free +#define nl_handle nl_sock +#define nlmsg_build(ptr) nlmsg_inherit(ptr) +#define nl_set_passcred nl_socket_set_passcred +#define nl_disable_sequence_check nl_socket_disable_seq_check +#define nlmsg_len nlmsg_datalen + /* NetLabel communication handle */ struct nlbl_handle { struct nl_handle *nl_hndl; @@ -37,46 +45,5 @@ struct nlbl_handle { (((hdr)->nlmsg_flags & NLM_F_MULTI) && \ ((hdr)->nlmsg_type != NLMSG_DONE))) -/* Specify which version of libnl we are using */ -/* 1.0-pre5 => 1005 */ -/* 1.0-pre6 => 1006 */ -/* 1.0-pre8 => 1008 */ -/* 1.1 => 1100 */ -#define LIBNL_VERSION 1100 - -/* XXX - this whole block will most likely go away once libnl supports Generic - * Netlink */ -#if LIBNL_VERSION <= 1006 /* Generic Netlink types */ - -/* Generic Netlink message header */ -struct genlmsghdr { - uint8_t cmd; - uint8_t version; - uint16_t reserved; -}; - -#define GENL_ID_CTRL 0x10 - -enum { - CTRL_CMD_UNSPEC, - CTRL_CMD_NEWFAMILY, - CTRL_CMD_DELFAMILY, - CTRL_CMD_GETFAMILY, - CTRL_CMD_NEWOPS, - CTRL_CMD_DELOPS, - CTRL_CMD_GETOPS, - __CTRL_CMD_MAX, -}; -#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1) - -enum { - CTRL_ATTR_UNSPEC, - CTRL_ATTR_FAMILY_ID, - CTRL_ATTR_FAMILY_NAME, - __CTRL_ATTR_MAX, -}; -#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1) - -#endif /* Generic Netlink types */ #endif diff --git a/libnetlabel/netlabel_msg.c b/libnetlabel/netlabel_msg.c index fb2fc58..af00fbe 100644 --- a/libnetlabel/netlabel_msg.c +++ b/libnetlabel/netlabel_msg.c @@ -63,11 +63,7 @@ nlbl_msg *nlbl_msg_new(void) struct genlmsghdr genl_hdr; /* 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; diff --git a/macros.mk b/macros.mk index a9466f0..b9f8813 100644 --- a/macros.mk +++ b/macros.mk @@ -53,7 +53,7 @@ CPPFLAGS += -I$(TOPDIR) -I$(TOPDIR)/include LIBFLAGS = CFLAGS ?= -Wl,-z,relro -Wall -O0 -g -CFLAGS += -fPIC +CFLAGS += `pkg-config --cflags libnl-3.0` -fPIC LDFLAGS ?= -z relro -g # diff --git a/netlabelctl/Makefile b/netlabelctl/Makefile index 06af6a5..07cebbb 100644 --- a/netlabelctl/Makefile +++ b/netlabelctl/Makefile @@ -49,7 +49,7 @@ CONF_FILE = netlabel.rules OBJS = main.o mgmt.o map.o unlabeled.o cipsov4.o -LDFLAGS := ../libnetlabel/libnetlabel.a -lnl -lm +LDFLAGS := ../libnetlabel/libnetlabel.a `pkg-config --libs libnl-3.0` -lm DEPS = $(OBJS:%.o=%.d) -- 1.8.4.5 -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org