- Applied upstream patch to improve netlabel-config error reporting (rhbz #1683434)

- Removed the kernel dependency (rhbz #1733605)
This commit is contained in:
Paul Moore 2019-08-02 15:18:17 +00:00
parent 16806cdd84
commit 3ae0590d59
2 changed files with 47 additions and 3 deletions

View File

@ -1,12 +1,13 @@
Summary: Tools to manage the Linux NetLabel subsystem
Name: netlabel_tools
Version: 0.30.0
Release: 7%{?dist}
Release: 8%{?dist}
License: GPLv2
Source: https://github.com/netlabel/netlabel_tools/releases/download/v%{version}/%{name}-%{version}.tar.gz
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: kernel libnl3
Requires: libnl3
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
@ -25,6 +26,7 @@ kernel subsystem.
%prep
%setup -q
%patch0 -p1
%build
%configure
@ -64,6 +66,10 @@ make V=1 DESTDIR="%{buildroot}" install
%attr(0644,root,root) %config(noreplace) /etc/netlabel.rules
%changelog
* 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

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