[libcap-ng] Remove useless code in pscap causing EBADFD

Steve Grubb sgrubb at fedoraproject.org
Wed Dec 19 21:43:46 UTC 2012


commit 42e500b82823966a941076a2d145acd145bb93f8
Author: Steve <sgrubb at redhat.com>
Date:   Wed Dec 19 16:43:41 2012 -0500

    Remove useless code in pscap causing EBADFD

 libcap-ng-0.7.4-badfd.patch |   12 ++++++++++++
 libcap-ng.spec              |    7 ++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/libcap-ng-0.7.4-badfd.patch b/libcap-ng-0.7.4-badfd.patch
new file mode 100644
index 0000000..7161ba5
--- /dev/null
+++ b/libcap-ng-0.7.4-badfd.patch
@@ -0,0 +1,12 @@
+diff -urp libcap-ng-0.7.3/utils/pscap.c libcap-ng-0.7.4/utils/pscap.c
+--- libcap-ng-0.7.3/utils/pscap.c	2012-11-09 14:45:43.000000000 -0500
++++ libcap-ng-0.7.4/utils/pscap.c	2012-11-30 10:06:42.000000000 -0500
+@@ -142,8 +142,6 @@ int main(int argc, char *argv[])
+ 				fclose(f);
+ 			}
+ 			
+-			len = read(fd, buf, sizeof buf - 1);
+-			close(fd);
+ 			if (header == 0) {
+ 				printf("%-5s %-5s %-10s  %-16s  %s\n",
+ 				    "ppid", "pid", "name", "command",
diff --git a/libcap-ng.spec b/libcap-ng.spec
index 4390ba3..cbbd336 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.3
-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-0.7.4-badfd.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 -p1
 
 %build
 %configure --libdir=/%{_lib}
@@ -111,6 +113,9 @@ rm -rf $RPM_BUILD_ROOT
 %attr(0644,root,root) %{_mandir}/man8/*
 
 %changelog
+* Wed Dec 19 2012 Steve Grubb <sgrubb at redhat.com> 0.7.3-2
+- Remove useless code in pscap causing EBADFD
+
 * Fri Nov 09 2012 Steve Grubb <sgrubb at redhat.com> 0.7.3-1
 - New upstream release
 


More information about the scm-commits mailing list