sgrubb pushed to libcap-ng (f21). "Don't leak file descriptor"

notifications at fedoraproject.org notifications at fedoraproject.org
Wed May 13 21:20:40 UTC 2015


From c89f17334f623e7ab957aa9924703f73ab31c0d3 Mon Sep 17 00:00:00 2001
From: sgrubb <sgrubb at redhat.com>
Date: Wed, 13 May 2015 17:18:55 -0400
Subject: Don't leak file descriptor


diff --git a/libcap-ng-leak.patch b/libcap-ng-leak.patch
new file mode 100644
index 0000000..bd6f9ad
--- /dev/null
+++ b/libcap-ng-leak.patch
@@ -0,0 +1,12 @@
+Index: src/cap-ng.c
+===================================================================
+--- src/cap-ng.c	(revision 56)
++++ src/cap-ng.c	(working copy)
+@@ -197,6 +197,7 @@
+ 				if (errno == 0)
+ 					last_cap = val;
+ 			}
++			close(fd);
+ 		}
+ 		if (last_cap == -1)
+ 			last_cap = CAP_LAST_CAP;
diff --git a/libcap-ng.spec b/libcap-ng.spec
index 0f1f6ee..e545f2f 100644
--- a/libcap-ng.spec
+++ b/libcap-ng.spec
@@ -3,11 +3,12 @@
 Summary: An alternate posix capabilities library
 Name: libcap-ng
 Version: 0.7.5
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 URL: http://people.redhat.com/sgrubb/libcap-ng
 Source0: http://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz
+Patch1: libcap-ng-leak.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: kernel-headers >= 2.6.11 
 
@@ -50,6 +51,7 @@ lets you set the file system based capabilities.
 
 %prep
 %setup -q
+%patch1 -p0
 
 %build
 %configure --libdir=/%{_lib}
@@ -113,6 +115,9 @@ rm -rf $RPM_BUILD_ROOT
 %attr(0644,root,root) %{_mandir}/man8/*
 
 %changelog
+* Wed May 13 2015 Steve Grubb <sgrubb at redhat.com> 0.7.5-2
+- Don't leak file descriptor
+
 * Thu May 07 2015 Steve Grubb <sgrubb at redhat.com> 0.7.5-1
 - New upstream release
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/libcap-ng.git/commit/?h=f21&id=c89f17334f623e7ab957aa9924703f73ab31c0d3


More information about the scm-commits mailing list