diff --git a/getpcaps.8 b/getpcaps.8 new file mode 100644 index 0000000..6bbf46a --- /dev/null +++ b/getpcaps.8 @@ -0,0 +1,23 @@ +.\" Hey, EMACS: -*- nroff -*- +.TH GETPCAPS 8 "2001-05-29" +.\" Please adjust this date whenever revising the manpage. +.SH NAME +getpcaps \- display process capabilities +.SH SYNOPSIS +.B getpcaps +.IR pid ... +.SH DESCRIPTION +.B getpcaps +displays the capabilities on the processes indicated by the +.I pid +value(s) given on the commandline. The capabilities +are displayed in the +.BR cap_from_text (3) +format. +.SH SEE ALSO +.BR execcap (8). +.br +.SH AUTHOR +This manual page was written by Robert Bihlmeyer , +for the Debian GNU/Linux system (but may be used by others). + diff --git a/libcap-2.22-signed-sizeof-compare.patch b/libcap-2.22-signed-sizeof-compare.patch new file mode 100644 index 0000000..4ada3fa --- /dev/null +++ b/libcap-2.22-signed-sizeof-compare.patch @@ -0,0 +1,21 @@ +diff -up libcap-2.22/libcap/cap_file.c.911878 libcap-2.22/libcap/cap_file.c +--- libcap-2.22/libcap/cap_file.c.911878 2013-05-14 11:45:25.569448468 +0200 ++++ libcap-2.22/libcap/cap_file.c 2013-05-14 11:47:04.712036407 +0200 +@@ -187,7 +187,7 @@ cap_t cap_get_fd(int fildes) + /* fill the capability sets via a system call */ + sizeofcaps = fgetxattr(fildes, XATTR_NAME_CAPS, + &rawvfscap, sizeof(rawvfscap)); +- if (sizeofcaps < sizeof(rawvfscap.magic_etc)) { ++ if (sizeofcaps < (int) sizeof(rawvfscap.magic_etc)) { + cap_free(result); + result = NULL; + } else { +@@ -217,7 +217,7 @@ cap_t cap_get_file(const char *filename) + /* fill the capability sets via a system call */ + sizeofcaps = getxattr(filename, XATTR_NAME_CAPS, + &rawvfscap, sizeof(rawvfscap)); +- if (sizeofcaps < sizeof(rawvfscap.magic_etc)) { ++ if (sizeofcaps < (int) sizeof(rawvfscap.magic_etc)) { + cap_free(result); + result = NULL; + } else { diff --git a/libcap.spec b/libcap.spec index 57b34b5..9d8bd7a 100644 --- a/libcap.spec +++ b/libcap.spec @@ -1,14 +1,18 @@ Name: libcap Version: 2.22 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Library for getting and setting POSIX.1e capabilities -Source: http://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/%{name}-%{version}.tar.bz2 +# Original tarball should be here, but got deleted: +#Source: http://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/libcap-2.22.tar.bz2 +Source: http://mirror.linux.org.au/linux/libs/security/linux-privs/libcap2/%{name}-%{version}.tar.bz2 +# http://manned.org/getpcaps/299a4949/src: +Source1: getpcaps.8 Patch0: %{name}-2.22-buildflags.patch +Patch1: libcap-2.22-signed-sizeof-compare.patch URL: http://ftp.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/ License: LGPLv2+ Group: System Environment/Libraries -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libattr-devel pam-devel %description @@ -32,51 +36,61 @@ libcap. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build # libcap can not be build with _smp_mflags: -make PREFIX=%{_prefix} LIBDIR=%{_lib} SBINDIR=%{_sbindir} \ +make PREFIX=%{_prefix} LIBDIR=%{_libdir} SBINDIR=%{_sbindir} \ INCDIR=%{_includedir} MANDIR=%{_mandir} %install -rm -rf ${RPM_BUILD_ROOT} make install RAISE_SETFCAP=no \ - DESTDIR=${RPM_BUILD_ROOT} \ - LIBDIR=${RPM_BUILD_ROOT}/%{_lib} \ - SBINDIR=${RPM_BUILD_ROOT}/%{_sbindir} \ - INCDIR=${RPM_BUILD_ROOT}/%{_includedir} \ - MANDIR=${RPM_BUILD_ROOT}/%{_mandir} -mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man{2,3,8} -#mv -f doc/*.2 ${RPM_BUILD_ROOT}/%{_mandir}/man2/ -mv -f doc/*.3 ${RPM_BUILD_ROOT}/%{_mandir}/man3/ + DESTDIR=%{buildroot} \ + LIBDIR=%{buildroot}/%{_libdir} \ + SBINDIR=%{buildroot}/%{_sbindir} \ + INCDIR=%{buildroot}/%{_includedir} \ + MANDIR=%{buildroot}/%{_mandir}/ +mkdir -p %{buildroot}/%{_mandir}/man{2,3,8} +mv -f doc/*.3 %{buildroot}/%{_mandir}/man3/ +cp -f %{SOURCE1} %{buildroot}/%{_mandir}/man8/ # remove static lib -rm -f ${RPM_BUILD_ROOT}/%{_lib}/libcap.a +rm -f %{buildroot}/%{_libdir}/libcap.a -chmod +x ${RPM_BUILD_ROOT}/%{_lib}/*.so.* +chmod +x %{buildroot}/%{_libdir}/*.so.* %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root,-) -/%{_lib}/*.so.* +/%{_libdir}/*.so.* %{_sbindir}/* %{_mandir}/man1/* %{_mandir}/man8/* -/%{_lib}/security/pam_cap.so +/%{_libdir}/security/pam_cap.so %doc doc/capability.notes License %files devel %defattr(-,root,root,-) %{_includedir}/* -/%{_lib}/*.so +/%{_libdir}/*.so %{_mandir}/man3/* %clean -rm -rf ${RPM_BUILD_ROOT} +rm -rf %{buildroot} %changelog +* Tue May 14 2013 Karsten Hopp 2.22-6 +- mv libraries to /usr/lib* +- add getpcaps man page +- spec file cleanup +- fix URL of tarball + +* Tue May 14 2013 Karsten Hopp 2.22-5 +- add patch from Mark Wielaard to fix use of uninitialized memory in _fcaps_load + rhbz #911878 + * Sun Feb 24 2013 Ville Skyttä - 2.22-5 - Build with $RPM_OPT_FLAGS and $RPM_LD_FLAGS.