Compare commits

..

58 commits

Author SHA1 Message Date
Fedora Release Engineering
3f562447ac Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-24 22:45:17 +00:00
Fedora Release Engineering
b52e1281d7 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-17 19:57:48 +00:00
Fedora Release Engineering
94cf7c4cca Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 19:22:47 +00:00
Fedora Release Engineering
245b9f42e8 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 08:50:39 +00:00
Fedora Release Engineering
95fc1d6f98 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 09:34:29 +00:00
Fedora Release Engineering
cd145fae82 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 16:31:56 +00:00
Petr Lautrbach
ee204d0fb2 Use %autosetup instead of deprecated %patchN
Fixes:

warning: %patchN is deprecated (1 usages found), use %patch N (or %patch -P N)
2023-05-30 12:21:43 +02:00
Petr Lautrbach
73ea4c2caf Migrate License tag to SPDX
https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_1
2023-05-30 12:20:15 +02:00
Fedora Release Engineering
11537431de Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 21:27:23 +00:00
Fedora Release Engineering
e0c2ac5e57 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 00:26:40 +00:00
Fedora Release Engineering
31a208a708 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 21:04:58 +00:00
Fedora Release Engineering
9044598ffe - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 16:01:10 +00:00
Fedora Release Engineering
7243c03bc0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 21:24:54 +00:00
Tom Stellard
b5c7adca38 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-07 05:41:19 +00:00
Fedora Release Engineering
4d8b8e4f7f - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 09:02:50 +00:00
Fedora Release Engineering
e42ea25b71 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-29 14:50:32 +00:00
Paul Moore
3ae0590d59 - Applied upstream patch to improve netlabel-config error reporting (rhbz #1683434)
- Removed the kernel dependency (rhbz #1733605)
2019-08-02 15:18:17 +00:00
Fedora Release Engineering
16806cdd84 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 18:32:15 +00:00
Fedora Release Engineering
f345f003b9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-01 12:13:52 +00:00
Igor Gnatenko
2143061f8f Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:18 +01:00
Fedora Release Engineering
5d905c637f - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 11:31:41 +00:00
Igor Gnatenko
bb2cfb43db add BuildRequires: gcc
Reference: https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot
2018-07-09 19:06:49 +02:00
Fedora Release Engineering
6fbb7ce34e - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-08 04:04:42 +00:00
Fedora Release Engineering
b9458de6d2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-03 03:54:39 +00:00
Fedora Release Engineering
332037105f - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 22:50:55 +00:00
Fedora Release Engineering
0c3d51fce1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-10 22:13:27 +00:00
Paul Moore
8ff572aaa4 - New upstream version 2016-12-09 01:02:02 +00:00
Fedora Release Engineering
2453b4c9cd - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-04 09:16:01 +00:00
Paul Moore
d605289d23 Remove old patches 2015-10-14 15:57:30 -04:00
Paul Moore
1b69650ed4 - New upstream version 2015-07-10 16:11:23 -04:00
Dennis Gilmore
f9715e9ffc - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-17 21:42:22 +00:00
Peter Robinson
1b76746a61 actually bump release 2015-03-21 14:04:47 +00:00
Peter Robinson
0a49d8afa2 Add patch to support libnl3, Use %%license, Cleanup spec 2015-03-21 13:53:08 +00:00
Peter Robinson
e5f6debc74 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-17 11:37:12 +00:00
Dennis Gilmore
aa593225d2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-07 07:33:39 -05:00
Paul Moore
8779b02a26 - Build with CFLAGS="${optflags}" 2014-02-27 15:41:49 -05:00
Dennis Gilmore
7245588ecc - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild 2013-08-03 08:09:16 -05:00
Paul Moore
713ebfe1bb Sources for the 0.20 release 2013-06-03 15:38:18 -04:00
Paul Moore
efd0da54bd - Version bump to match latest upstream
- Cleanups in the specfile due to changes in the upstream package
2013-05-31 17:13:25 -04:00
Dennis Gilmore
07865541b9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild 2013-02-14 02:12:06 -06:00
Dennis Gilmore
728abe9baf - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 2012-07-19 23:34:33 -05:00
Dennis Gilmore
cb4fd590b5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 2012-01-13 05:03:46 -06:00
Dennis Gilmore
9828cd0db5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 2011-02-08 18:11:27 -06:00
Fedora Release Engineering
6178ef22bd dist-git conversion 2010-07-29 04:18:43 +00:00
Peter Vrabec
dffb250953 fixing return codes (#602291) 2010-06-17 09:44:04 +00:00
Peter Vrabec
86cb1e8cfb make initscript LSB compliant (#522818) show version of netlabelctl and
libnetlabel in help (#602577)
2010-06-16 11:48:23 +00:00
Bill Nottingham
3d2f787ee2 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-25 23:20:08 +00:00
Peter Vrabec
fd6a7850e2 make initscript LSB compliant (#522818) 2009-09-23 12:15:46 +00:00
Peter Vrabec
5d94398178 increase rel. number 2009-09-23 09:26:19 +00:00
Peter Vrabec
e5ddb1d09b fix license tag in spec (#524310) 2009-09-23 09:15:16 +00:00
Jesse Keating
bcd397b6a7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild 2009-07-25 19:12:29 +00:00
Jesse Keating
f19b286a1b - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild 2009-02-26 05:17:43 +00:00
Peter Vrabec
7b6a224c6a upgrade (#478903) 2009-01-08 12:55:50 +00:00
Peter Vrabec
e8c40514e3 upgrade (#439833) 2008-10-27 15:37:04 +00:00
Tom Callaway
a246b8b8c9 fix license tag 2008-08-11 19:00:35 +00:00
Steve Conklin
a22e8fa6e8 new patch to resolve conflicts due to changes in libnl 2008-02-11 15:56:59 +00:00
Steve Conklin
212a1567a2 New patch that fixes BZ 431766 2008-02-11 15:33:43 +00:00
Steve Conklin
5279e1cd6f Changes to match upstream 2008-02-07 19:05:38 +00:00
9 changed files with 246 additions and 389 deletions

5
.gitignore vendored
View file

@ -1 +1,4 @@
netlabel_tools-0.17.tar.gz
netlabel_tools-0.19.tar.gz
/netlabel_tools-0.20.tar.gz
/netlabel_tools-0.21.tar.gz
/netlabel_tools-0.30.0.tar.gz

View file

@ -69,17 +69,17 @@ status() {
# Do not print status if lockfile is missing
if [ ! -f "$VAR_SUBSYS_NETLABEL" ]; then
echo $"Netlabel is stopped."
return 7
return 3
fi
# List rules
/sbin/netlabelctl -p cipsov4 list 2>/dev/null
ret1="$?"
/sbin/netlabelctl -p mgmt list 2>/dev/null
/sbin/netlabelctl -p mgmt protocols 2>/dev/null
ret2="$?"
if [ "$ret1" != "0" -o "$ret2" != "0" ] ; then
return 1
return 2
fi
return 0
}

View file

@ -1,65 +0,0 @@
diff -rup netlabel_tools-0.16-orig/include/linux/netlabel.h netlabel_tools-0.16/include/linux/netlabel.h
--- netlabel_tools-0.16-orig/include/linux/netlabel.h 2006-07-31 17:20:41.000000000 -0400
+++ netlabel_tools-0.16/include/linux/netlabel.h 2006-08-29 14:07:44.000000000 -0400
@@ -39,7 +39,9 @@
/* FIXME: perhaps some or all this lives in a system header file? */
-#define NLMSG_HDRLEN NLMSG_ALIGN(sizeof(struct nlmsghdr))
+#ifndef NLMSG_HDRLEN /* newer netlink.h has these... */
+
+# define NLMSG_HDRLEN NLMSG_ALIGN(sizeof(struct nlmsghdr))
struct nlattr
{
@@ -47,6 +49,13 @@ struct nlattr
unsigned short nla_type;
};
+# define NLA_HDRLEN NLMSG_ALIGN(sizeof(struct nlattr))
+
+# define NETLINK_GENERIC 16
+
+
+#endif
+
enum {
NLA_UNSPEC,
NLA_U8,
@@ -61,10 +70,6 @@ enum {
};
#define NLA_TYPE_MAX (__NLA_TYPE_MAX - 1)
-#define NLA_HDRLEN NLMSG_ALIGN(sizeof(struct nlattr))
-
-#define NETLINK_GENERIC 16
-
struct genlmsghdr {
unsigned char cmd;
unsigned char version;
--- netlabel_tools-0.16-orig/Makefile 2006-06-27 13:06:28.000000000 -0400
+++ netlabel_tools-0.16/Makefile 2006-08-29 16:42:09.000000000 -0400
@@ -43,8 +43,9 @@ INSTALL_SBIN_DIR = $(INSTALL_PREFIX)/sbi
INSTALL_BIN_DIR = $(INSTALL_PREFIX)/bin
INSTALL_MAN_DIR = $(INSTALL_PREFIX)/share/man
-OWNER = root
-GROUP = root
+# Mock doesn't allow this.
+#OWNER = root
+#GROUP = root
#
# targets
@@ -77,9 +78,9 @@ install: $(SUBDIRS)
@echo "INFO: installing files in $(INSTALL_PREFIX)"
@mkdir -p $(INSTALL_SBIN_DIR)
@mkdir -p $(INSTALL_MAN_DIR)/man8
- @install -o $(OWNER) -g $(GROUP) -m 755 netlabelctl/netlabelctl \
+ @install -m 755 netlabelctl/netlabelctl \
$(INSTALL_SBIN_DIR)/netlabelctl
- @install -o $(OWNER) -g $(GROUP) -m 644 docs/man/netlabelctl.8 \
+ @install -m 644 docs/man/netlabelctl.8 \
$(INSTALL_MAN_DIR)/man8
clean:

View file

@ -1,26 +0,0 @@
--- netlabel_tools-0.16-orig/Makefile 2006-06-27 13:06:28.000000000 -0400
+++ netlabel_tools-0.16/Makefile 2006-08-29 16:42:09.000000000 -0400
@@ -43,8 +43,9 @@ INSTALL_SBIN_DIR = $(INSTALL_PREFIX)/sbi
INSTALL_BIN_DIR = $(INSTALL_PREFIX)/bin
INSTALL_MAN_DIR = $(INSTALL_PREFIX)/share/man
-OWNER = root
-GROUP = root
+# Mock doesn't allow this.
+#OWNER = root
+#GROUP = root
#
# targets
@@ -77,9 +78,9 @@ install: $(SUBDIRS)
@echo "INFO: installing files in $(INSTALL_PREFIX)"
@mkdir -p $(INSTALL_SBIN_DIR)
@mkdir -p $(INSTALL_MAN_DIR)/man8
- @install -o $(OWNER) -g $(GROUP) -m 755 netlabelctl/netlabelctl \
+ @install -m 755 netlabelctl/netlabelctl \
$(INSTALL_SBIN_DIR)/netlabelctl
- @install -o $(OWNER) -g $(GROUP) -m 644 docs/man/netlabelctl.8 \
+ @install -m 644 docs/man/netlabelctl.8 \
$(INSTALL_MAN_DIR)/man8
clean:

View file

@ -1,218 +0,0 @@
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
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
@@ -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
/* 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
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
@@ -52,7 +50,11 @@ 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 -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
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#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
#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
+ 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
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);
@@ -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
}

View file

@ -1,29 +0,0 @@
Index: netlabelctl/cipsov4.c
===================================================================
--- netlabelctl/cipsov4.c (revision 27)
+++ netlabelctl/cipsov4.c (revision 28)
@@ -236,7 +236,7 @@
printf("STANDARD");
break;
case CIPSO_V4_MAP_PASS:
- printf("PASS_THROUGH\n");
+ printf("PASS_THROUGH");
break;
default:
printf("UNKNOWN(%u)", mtype_list[iter]);
Index: netlabelctl/map.c
===================================================================
--- netlabelctl/map.c (revision 27)
+++ netlabelctl/map.c (revision 28)
@@ -224,8 +224,10 @@
printf("UNKNOWN(%u)", domain_p[iter].proto_type);
break;
}
- printf(" ");
+ if (iter + 1 < count)
+ printf(" ");
}
+ printf("\n");
}
list_return:

View file

@ -1,65 +1,219 @@
Summary: Tools to manage the Linux NetLabel subsystem
Name: netlabel_tools
Version: 0.17
Release: 7%{?dist}
License: GPL
Group: System Environment/Daemons
URL: http://netlabel.sf.net/
Source0: http://downloads.sourceforge.net/netlabel/%{name}-%{version}.tar.gz
Source1: netlabel
Source2: netlabel.rules
Patch1: netlabel_tools-0.17-new-hdrs.patch
Patch2: netlabel_tools-27_28.patch
Patch3: netlabel_tools-0.17-newlibnl.patch
BuildRoot: %{_tmppath}/%{name}-%{version}
BuildRequires: kernel-headers >= 2.6.18
BuildRequires: libnl-devel
Version: 0.30.0
Release: 21%{?dist}
License: GPL-2.0-only
URL: https://github.com/netlabel/netlabel_tools
Source: https://github.com/netlabel/netlabel_tools/releases/download/v%{version}/%{name}-%{version}.tar.gz
Patch0: rhbz1683434.patch
Requires: libnl3
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: make
BuildRequires: gcc
BuildRequires: kernel-headers
BuildRequires: libnl3-devel
BuildRequires: doxygen
BuildRequires: systemd
%description
NetLabel is a kernel subsystem which implements explicit packet labeling
protocols such as CIPSO and RIPSO for Linux. Packet labeling is used in
secure networks to mark packets with the security attributes of the data they
contain. This package provides the necessary user space tools to query and
configure the kernel subsystem.
protocols such as CIPSO for Linux. Packet labeling is used in secure networks
to mark packets with the security attributes of the data they contain. This
package provides the necessary user space tools to query and configure the
kernel subsystem.
%prep
%setup -q -n %{name}-%{version}
# Build fixes.
%patch1 -p1
# Upstream patch.
%patch2 -p0
%patch3 -p1 -b .libnl
%prep
%autosetup -p 1
%build
# Don't use _smp_mflags, it's small and a hand crafted Makefile
make
%configure
make V=1 %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make INSTALL_PREFIX=${RPM_BUILD_ROOT} \
INSTALL_MAN_DIR=${RPM_BUILD_ROOT}/usr/share/man \
install
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/
install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/
install -m 0640 %{SOURCE2} $RPM_BUILD_ROOT/etc/
rm -rf "%{buildroot}"
mkdir -p "%{buildroot}/etc"
mkdir -p "%{buildroot}/%{_sbindir}"
mkdir -p "%{buildroot}/%{_unitdir}"
mkdir -p "%{buildroot}/%{_mandir}"
make V=1 DESTDIR="%{buildroot}" install
%clean
rm -rf $RPM_BUILD_ROOT
# NOTE: disable since the tests require messing with the running kernel
#%check
#make V=1 check
%preun
%systemd_preun netlabel.service
%postun
%systemd_postun netlabel.service
%post
%systemd_post netlabel.service
%files
%defattr(-,root,root)
%doc docs/*.txt
%attr(0755,root,root) /sbin/*
%attr(0755,root,root) /etc/rc.d/init.d/netlabel
%config(noreplace) %attr(640,root,root) /etc/netlabel.rules
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
%doc CHANGELOG
%doc SUBMITTING_PATCHES
%attr(0644,root,root) %{_mandir}/man8/*
%attr(0755,root,root) %{_sbindir}/netlabelctl
%attr(0755,root,root) %{_sbindir}/netlabel-config
%attr(0644,root,root) %{_unitdir}/netlabel.service
%attr(0644,root,root) %config(noreplace) /etc/netlabel.rules
%changelog
* Mon Feb 11 2008 Steve Conklin <sconklin@redhat.com> - 0.17-7
- bz#431765 Updated the .rules file
- bz#431766 added patch to build with new libnl
- bz#431767 fixed URL in spec file
* Thu Jul 24 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Fri Jan 17 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Thu Jul 18 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Aug 02 2019 Paul Moore <paul@paul-moore.com> - 0.30.0-8
- Applied upstream patch to improve netlabel-config error reporting (rhbz #1683434)
- Removed the kernel dependency (rhbz #1733605)
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Dec 08 2016 Paul Moore <pmoore@redhat.com> - 0.30.0-0
-New upstream version
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.21-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Jul 10 2015 Paul Moore <pmoore@redhat.com> - 0.21-0
- New upstream version
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.20-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Mar 21 2015 Peter Robinson <pbrobinson@fedoraproject.org> 0.20-5
- Add patch to support libnl3
- Use %%license
- Cleanup spec
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.20-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.20-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu Feb 27 2014 Paul Moore <pmoore@redhat.com> - 0.20-2
- Build with CFLAGS="${optflags}"
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.20-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Mon Jun 3 2013 Paul Moore <pmoore@redhat.com> - 0.20-0
- Version bump to match latest upstream
- Cleanups in the specfile due to changes in the upstream package
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.19-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.19-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.19-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.19-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Thu Jun 17 2010 Peter Vrabec <pvrabec@redhat.com> - 0.19-8
- fixing return codes (#602291)
* Wed Jun 16 2010 Peter Vrabec <pvrabec@redhat.com> - 0.19-7
- make initscript LSB compliant (#522818)
- show version of netlabelctl and libnetlabel in help (#602577)
* Wed Sep 23 2009 Peter Vrabec <pvrabec@redhat.com> 0.19-6
- make initscript LSB compliant (#522818)
* Wed Sep 23 2009 Peter Vrabec <pvrabec@redhat.com> 0.19-5
- increase rel. number
* Wed Sep 23 2009 Peter Vrabec <pvrabec@redhat.com> 0.19-4
- fix license tag in spec (#524310)
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.19-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.19-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Thu Jan 08 2009 Peter Vrabec <pvrabec@redhat.com> - 0.19-1
- upgrade (#478903)
* Mon Oct 27 2008 Peter Vrabec <pvrabec@redhat.com> - 0.18-1
- upgrade (#439833)
* Mon Aug 11 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.17-8
- fix license tag
* Mon Feb 11 2008 Steve Conklin <sconklin@redhat.com> - 0.17-7
- New patch for bz#431766 to resolve conflicts
* Thu Feb 7 2008 Steve Conklin <sconklin@redhat.com> - 0.17-6
- Various fixes to follow upstream
- Resolves bz#431765 The example configuration file is invalid
- Resolves bz#431766 The netlabelctl command fails to run due to newer libnl package
- Resolves bz#431767 The url listed in the netlabel_tools package is wrong
* Mon Oct 16 2006 James Antill <james@and.org> - 0.17-3
- Add upstream patch.

38
rhbz1683434.patch Normal file
View file

@ -0,0 +1,38 @@
From 578a65904ff6426c01d81826873d27d0af35f355 Mon Sep 17 00:00:00 2001
From: Paul Moore <paul@paul-moore.com>
Date: Sun, 17 Mar 2019 17:13:55 -0400
Subject: [PATCH] netlabel_config: better error reporting on load
Signed-off-by: Paul Moore <paul@paul-moore.com>
---
netlabelctl/netlabel-config | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/netlabelctl/netlabel-config b/netlabelctl/netlabel-config
index 717d795..15c74f7 100755
--- a/netlabelctl/netlabel-config
+++ b/netlabelctl/netlabel-config
@@ -114,15 +114,21 @@ function nlbl_reset() {
# load the NetLabel configuration from the configuration file
function nlbl_load() {
local ret_rc=0
+ local line_num=0
local line
while read line; do
+ line_num=$(($line_num + 1))
# skip comments and blank lines
echo "$line" | egrep '^#|^$' >& /dev/null && continue
# perform the configuration
- netlabelctl $line >& /dev/null
+ output=$(netlabelctl $line 2>&1)
rc=$?
- [[ $rc -ne 0 ]] && ret_rc=1
+ if [[ $rc -ne 0 ]]; then
+ ret_rc=1
+ echo "error: line $line_num \"$line\""
+ echo "$output"
+ fi
done < "$CFG_FILE"
return $ret_rc

View file

@ -1 +1 @@
905ffd48714f48aaa34ecdc3c51d3dcb netlabel_tools-0.17.tar.gz
fc6b07bf01bc3f68f5f05071072e521e netlabel_tools-0.30.0.tar.gz