debian/0000775000000000000000000000000012301722735007172 5ustar debian/libcap2.install0000664000000000000000000000003312301510010012047 0ustar debian/tmp/lib/*/lib*.so.* debian/libcap2-bin.lintian-overrides0000664000000000000000000000003112301510010014603 0ustar statically-linked-binary debian/copyright0000664000000000000000000000467712301510010011120 0ustar This package was debianized by Torsten Werner on Fri Mar 21 16:35:46 CET 2008 based on the package 'libcap' that is maintained by Michael Vogt. It was downloaded from http://www.eu.kernel.org/pub/linux/libs/security/linux-privs/libcap2/ Upstream Author: Andrew G. Morgan Copyright: (c) 1999-2008 Andrew G. Morgan Unless otherwise *explicitly* stated, the following text describes the licensed conditions under which the contents of this libcap release may be used and distributed: ------------------------------------------------------------------------- Redistribution and use in source and binary forms of libcap, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain any existing copyright notice, and this entire permission notice in its entirety, including the disclaimer of warranties. 2. Redistributions in binary form must reproduce all prior and current copyright notices, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of any author may not be used to endorse or promote products derived from this software without their specific prior written permission. ALTERNATIVELY, this product may be distributed under the terms of the GNU General Public License, in which case the provisions of the GNU GPL are required INSTEAD OF the above restrictions. (This clause is necessary due to a potential conflict between the GNU GPL and the restrictions contained in a BSD-style copyright.) THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------- You can find the GPL in /usr/share/common-licenses/GPL debian/orig-tar.sh0000775000000000000000000000032112301510010011226 0ustar #!/bin/sh -e # called by uscan with '--upstream-version' # move to directory 'tarballs' if [ -r .svn/deb-layout ]; then . .svn/deb-layout mv $3 $origDir echo "moved $3 to $origDir" fi debian/libpam-cap.postinst0000664000000000000000000000172512301510010012766 0ustar #!/bin/sh # postinst script for libpam-cap # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure|abort-upgrade|abort-remove|abort-deconfigure) pam-auth-update --package ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/source/0000775000000000000000000000000012301512262010462 5ustar debian/source/format0000664000000000000000000000001412301510010011655 0ustar 3.0 (quilt) debian/libcap2-bin.examples0000664000000000000000000000000012301510010012757 0ustar debian/changelog0000664000000000000000000002304712301722735011052 0ustar libcap2 (1:2.24-0ubuntu2) trusty; urgency=medium * 0004-include-sys-xattr.patch: Include sys/xattr.h in sys/capability.h -- Adam Conrad Fri, 21 Feb 2014 04:26:00 -0700 libcap2 (1:2.24-0ubuntu1) trusty; urgency=medium * New upstream release. - Drop 0001-Add-CAP_WAKE_ALARM-and-CAP_BLOCK_SUSPEND-to-capabili.patch, included upstream. -- Steve Langasek Thu, 20 Feb 2014 15:49:48 -0800 libcap2 (1:2.22-1.2ubuntu2) raring; urgency=low * Add patch (which has been forwarded to the upstream maintainer) to define new capabilities in most recent kernels. (LP: #1084000) (Closes: #689035) -- Serge Hallyn Fri, 18 Jan 2013 15:34:40 -0600 libcap2 (1:2.22-1.2ubuntu1) raring; urgency=low * Resynchronise with Debian. Remaining changes: - Support cross-building. -- Colin Watson Mon, 26 Nov 2012 17:31:03 +0000 libcap2 (1:2.22-1.2) unstable; urgency=low * Non-maintainer upload. * Add preinst script for libcap2-bin to properly remove PAM module on upgrade from libcap2-bin <= 1:2.22-1. (Closes: #673770) -- Tobias Hansen Fri, 06 Jul 2012 20:02:14 +0200 libcap2 (1:2.22-1.1) unstable; urgency=low * Non-maintainer upload with permission from Torsten Werner. * Apply Multiarch patch from Kees Cook. Closes: #653186. * debian/{control,rules,compat}: Build for Multi-arch. * debian/{control,libpam-cap.*}: Split PAM module into separate binary package so it can be built for Multi-arch separate from the -bins pkg. -- Mark Hymers Sun, 13 May 2012 10:28:44 +0100 libcap2 (1:2.22-1ubuntu4) quantal; urgency=low * Rebuild for new armel compiler default of ARMv5t. -- Colin Watson Thu, 04 Oct 2012 14:03:29 +0100 libcap2 (1:2.22-1ubuntu3) precise; urgency=low [ Kees Cook ] * debian/{control,rules,compat}: Build for Multi-arch. * debian/{control,libpam-cap.*}: Split PAM module into separate binary package so it can be built for Multi-arch separate from the -bins pkg. -- Steve Langasek Wed, 28 Dec 2011 22:08:29 -0800 libcap2 (1:2.22-1ubuntu2) precise; urgency=low * Mangle maintainer and Vcs fields. -- Loïc Minier Fri, 21 Oct 2011 08:53:02 +0200 libcap2 (1:2.22-1ubuntu1) precise; urgency=low * Fix cross-building by passing CC and BUILD_CC to dh_auto_make; based on a patch by Colin Watson for the previous CDBS packaging, but adapted for the new dh-based packaging; LP: #872435. -- Loïc Minier Wed, 19 Oct 2011 16:30:24 +0200 libcap2 (1:2.22-1) unstable; urgency=low * New upstream released -- Zhi Li Thu, 28 Jul 2011 12:50:30 +0800 libcap2 (1:2.21-3) unstable; urgency=low * Non-maintainer upload. * 0003-refine-setcap-error-message.patch:refine setcap output on errors (Closes: #633075) -- Zhi Li Wed, 20 Jul 2011 09:35:48 +0800 libcap2 (1:2.21-2) unstable; urgency=low [ Serge Hallyn ] * 0002-support-getting-setting-capabilities-on-large-files.patch: patch from upstream to enable setting capabilities on large files. (Closes: #631134) [ Torsten Werner ] * Move package to alioth's collab-maint project. * Use git instead of svn. * Update Vcs-* headers in debian/control. [ Zhi Li ] * Modify long description in libcap2-bin/debian/control, remove those files that were not generated. (Closes: #620345) -- Torsten Werner Mon, 11 Jul 2011 22:11:41 +0200 libcap2 (1:2.21-1) unstable; urgency=low * New upstream release. * debian/patches/0001-fix-Makefiles.patch: link pam_cap against -lpam. (Closes: #591410) (LP: #582769) -- Serge Hallyn Fri, 20 May 2011 08:28:55 -0500 libcap2 (1:2.20-1) unstable; urgency=low * New upstream release. * Remove all patches because they have been included upstream. -- Torsten Werner Fri, 11 Feb 2011 20:31:45 +0100 libcap2 (1:2.19-3) unstable; urgency=high * Add a versioned dependency on libpam-runtime to libcap2-bin because pam-auth-update is needed in postinst. (Closes: #593250) * Set urgency to high because we are fixing a RC bug. -- Torsten Werner Mon, 16 Aug 2010 23:13:50 +0200 libcap2 (1:2.19-2) unstable; urgency=medium * Add -lpam to LDLIBS. Thanks to Sebastian Ramacher for suggesting the patch! (Closes: 591410) * Set urgency to medium. * Improve patch description. -- Torsten Werner Wed, 04 Aug 2010 05:22:23 +0200 libcap2 (1:2.19-1) unstable; urgency=low [ Kees Cook ] * Add pam_cap.so to the default PAM auth stack. (Closes: #573089) [ Torsten Werner ] * New upstream release. * Convert package to source format 3.0. * Remove quilt from Build-Depends. * Add static library to -dev package. Thanks to Stephan Sürken. (Closes: #589840) * Fix typo in Description. Thanks to Pascal De Vuyst. (Closes: #557496) * Add a patch to fix the man page cap_from_text(3). Thanks to Roland Koebler. (Closes: #567350) * Update Standards-Version: 3.9.0 (no changes). -- Torsten Werner Thu, 22 Jul 2010 23:50:25 +0200 libcap2 (1:2.17-2) unstable; urgency=low * Explain in the long description of the -bin package that the manpage cap_from_text(3) is part of -dev package. (Closes: #548080) -- Torsten Werner Sun, 18 Oct 2009 19:55:39 +0200 libcap2 (1:2.17-1) unstable; urgency=low * new upstream release * Switch from cdbs to dh. * Update Standards-Version: 3.8.3 (no changes). * Use gbp-pq to edit quilt patch. * Change Build-Depends: debhelper (>= 7.0.50~). * Add README.source. * Add man page capsh.8. -- Torsten Werner Wed, 30 Sep 2009 22:26:51 +0200 libcap2 (1:2.16-5) unstable; urgency=low * Remove reference to kernel version 2.2 in debian/control. (Closes: #260005) * Add Suggests: libcap-dev to binary package libcap2-bin. (Closes: #433782) -- Torsten Werner Wed, 01 Apr 2009 23:32:37 +0200 libcap2 (1:2.16-4) unstable; urgency=low * Add Conflicts: and Replaces: libcap2-dev to binary package libcap-dev. * Add epoch to version number because the old package had an epoch. * Add missing files to package libcap-dev which got lost in the previous version. -- Torsten Werner Sun, 22 Mar 2009 21:23:50 +0100 libcap2 (2.16-3) unstable; urgency=low * Rename binary package libcap2-dev to libcap-dev as requested by the release team to continue the transition from libcap1. (Closes: #520553) * Add Provides: libcap2-dev to binary package libcap-dev to ease transition from older versions of libcap2. * Remove Conflicts: libcap-dev. -- Torsten Werner Sat, 21 Mar 2009 21:22:24 +0100 libcap2 (2.16-2) unstable; urgency=low * upload to unstable -- Torsten Werner Sun, 15 Feb 2009 22:09:04 +0100 libcap2 (2.16-1) experimental; urgency=low * new upstream release * Always install libraries into /lib (never /lib64). (Closes: #508315) -- Torsten Werner Sun, 14 Dec 2008 12:24:50 +0100 libcap2 (2.15-3) experimental; urgency=low * Set Priority: standard for binary package libcap2. (Closes: #507781) -- Torsten Werner Thu, 04 Dec 2008 14:15:48 +0100 libcap2 (2.15-2) experimental; urgency=low * Update shlibs file libcap2 (>= 2.10). (Closes: #464712) -- Torsten Werner Wed, 03 Dec 2008 23:42:19 +0100 libcap2 (2.15-1) experimental; urgency=low * new upstream release * Add Homepage header. * Bump Up Standards-Version: 3.8.0. * Update patch build.diff. -- Torsten Werner Mon, 01 Dec 2008 00:26:09 +0100 libcap2 (2.11-2) unstable; urgency=low * Call dh_makeshlibs with -V. (Closes: #492467) * Reformat debian/copyright. * Add Build-Depends: libpam0g-dev to build the pam module. * Ship the pam module in the package libcap2-bin. -- Torsten Werner Sat, 26 Jul 2008 15:40:42 +0200 libcap2 (2.11-1) unstable; urgency=low * new upstream release * Remove patch bug487223.diff because it is not needed anymore. * Refresh patch build.diff. -- Torsten Werner Thu, 24 Jul 2008 20:42:41 +0200 libcap2 (2.10-3) unstable; urgency=low * Add patch from upstream author to fix 'cap_copy_int() always returns NULL (EINVAL)'. (Closes: #487223) -- Torsten Werner Mon, 07 Jul 2008 23:03:52 +0200 libcap2 (2.10-2) unstable; urgency=medium * Add Build-Depends: indent because it is needed on alpha. (Closes: #489477) * Set urgency to medium because we are fixing a FTBFS bug. -- Torsten Werner Sun, 06 Jul 2008 11:34:15 +0200 libcap2 (2.10-1) unstable; urgency=low * new upstream release -- Torsten Werner Wed, 11 Jun 2008 23:37:06 +0200 libcap2 (2.09-1) unstable; urgency=low * new upstream release * Change Priority: optional of package libcap2. -- Torsten Werner Sat, 10 May 2008 11:48:53 +0200 libcap2 (2.08-2) unstable; urgency=low * Do not install the old manpages capget(2) and capset(2) because the package manpages-dev ships more recent ones. * Replace Conflicts: manpages-dev by Suggests: manpages-dev. (Closes: #473072) -- Torsten Werner Sat, 29 Mar 2008 10:19:58 +0100 libcap2 (2.08-1) unstable; urgency=low * Initial Release. (Closes: #464727) -- Torsten Werner Fri, 21 Mar 2008 16:26:04 +0100 debian/compat0000664000000000000000000000000212301510010010345 0ustar 9 debian/pam-configs/0000775000000000000000000000000012301512262011365 5ustar debian/pam-configs/capability0000664000000000000000000000017412301510010013420 0ustar Name: Inheritable Capabilities Management Default: yes Priority: 0 Auth-Type: Additional Auth-Final: optional pam_cap.so debian/rules0000775000000000000000000000114412301510010010227 0ustar #!/usr/bin/make -f DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) CC := gcc else CC := $(DEB_HOST_GNU_TYPE)-gcc endif %: dh $@ override_dh_auto_build: dh_auto_build -- CC=$(CC) BUILD_CC=gcc override_dh_auto_install: dh_auto_install -- lib=lib/$(DEB_HOST_MULTIARCH) RAISE_SETFCAP=no override_dh_makeshlibs: dh_makeshlibs -V 'libcap2 (>= 2.10)' get-orig-source: -uscan --upstream-version 0 debian/control0000664000000000000000000000417612301510010010562 0ustar Source: libcap2 Section: libs Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Torsten Werner Standards-Version: 3.9.0 Build-Depends: debhelper (>= 8.1.3~), indent, libattr1-dev, libpam0g-dev Homepage: http://sites.google.com/site/fullycapable/ XS-Debian-Vcs-Git: git://git.debian.org/collab-maint/libcap2.git XS-Debian-Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/libcap2.git Package: libcap2-bin Section: utils Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: libpam-cap Suggests: libcap-dev Conflicts: libcap-bin Description: basic utility programs for using capabilities This package contains the programs getpcaps, capsh, getcap, and setcap for manipulation of capabilities. The manpages of this package reference the manpage cap_from_text(3) from the libcap-dev package. Please install the libcap-dev package if you need its documentation. Package: libcap2 Priority: standard Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends} Description: support for getting/setting POSIX.1e capabilities This library implements the user-space interfaces to the POSIX 1003.1e capabilities available in Linux kernels. These capabilities are a partitioning of the all powerful root privilege into a set of distinct privileges. Package: libcap-dev Section: libdevel Architecture: any Multi-Arch: same Depends: libcap2 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Provides: libcap2-dev Conflicts: libcap2-dev Replaces: libcap2-dev Suggests: manpages-dev Description: development libraries and header files for libcap2 Contains the necessary support for building applications that use capabilities. Package: libpam-cap Architecture: any Multi-Arch: same Depends: ${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 1.1.3-2~) Breaks: libcap2-bin (<< 1:2.22-1.1) Replaces: libcap2-bin (<< 1:2.22-1.1) Description: PAM module for implementing capabilities This package contains the PAM module for enforcing capabilities on users and groups at PAM session start time. debian/libcap2-bin.install0000664000000000000000000000002212301510010012613 0ustar debian/tmp/sbin/* debian/libpam-cap.install0000664000000000000000000000015612301510010012546 0ustar debian/tmp/lib/*/security/* debian/pam-configs/* usr/share/pam-configs/ pam_cap/capability.conf etc/security/ debian/README.source0000664000000000000000000000031012301510010011320 0ustar This package uses quilt to modify upstream source code. Please check /usr/share/doc/quilt/README.source for more information. -- Torsten Werner Wed, 30 Sep 2009 21:58:13 +0200 debian/libcap-dev.manpages0000664000000000000000000000004012301510010012664 0ustar debian/tmp/usr/share/man/man3/* debian/libcap-dev.install0000664000000000000000000000011212301510010012537 0ustar debian/tmp/usr/include/* debian/tmp/lib/*/lib*.so debian/tmp/lib/*/lib*.a debian/libcap2-bin.manpages0000664000000000000000000000005712301510010012750 0ustar debian/tmp/usr/share/man/man8/* debian/capsh.8 debian/capsh.80000664000000000000000000000215012301510010010334 0ustar .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. .TH CAPSH "8" "September 2009" "capsh 2.17" "System Administration Utilities" .SH NAME capsh \- 'bash' wrapper to raise and lower the bset and pI capabilities .SH DESCRIPTION \fB/sbin/capsh\fR [args ...] .TP \fB\-\-help\fR this message .TP \fB\-\-print\fR display capability relevant state .TP \fB\-\-decode\fR=\fIxxx\fR decode a hex string to a list of caps .TP \fB\-\-drop\fR=\fIxxx\fR remove xxx,.. capabilities from bset .TP \fB\-\-caps\fR=\fIxxx\fR set caps as per cap_from_text() .TP \fB\-\-inh\fR=\fIxxx\fR set xxx,.. inheritiable set .TP \fB\-\-secbits=\fR write a new value for securebits .TP \fB\-\-keep=\fR set keep\-capabability bit to .TP \fB\-\-uid=\fR set uid to (hint: id ) .TP \fB\-\-chroot\fR=\fIpath\fR chroot(2) to this path to invoke bash .TP \fB\-\-killit=\fR send signal(n) to child .TP \fB\-\-forkfor=\fR fork and make child sleep for sec .TP \fB==\fR re\-exec(capsh) with args as for \fB\-\-\fR .TP \fB\-\-\fR remaing arguments are for /bin/bash (without \fB\-\-\fR [/sbin/capsh] will simply exit(0)) debian/watch0000664000000000000000000000020212301510010010172 0ustar version=3 http://www.eu.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-(.*)\.tar\.gz \ debian debian/orig-tar.sh debian/README.Debian0000664000000000000000000000217612301510010011216 0ustar Please check http://www.friedhoff.org/posixfilecaps.html to get more information on POSIX File Capabilities. Example: how to remove the SUID root bit from /bin/ping? -------------------------------------------------------- Make sure you have kernel 2.6.24 or newer you have CONFIG_SECURITY_CAPABILITIES and CONFIG_SECURITY_FILE_CAPABILITIES enabled. The Debian kernels are fine. $ ls -l /bin/ping -rwsr-xr-x 1 root root 30736 2007-01-31 00:10 /bin/ping ^ That is not good. $ sudo chmod 755 /bin/ping Or use dpkg-statoverride. $ ls -l /bin/ping -rwxr-xr-x 1 root root 30736 2007-01-31 00:10 /bin/ping That is better but ping fails. $ ping -c1 localhost ping: icmp open socket: Operation not permitted Now set the missing capability: $ sudo setcap cap_net_raw+ep /bin/ping ... and ping will work again. $ ping -c1 localhost PING localhost (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.026 ms --- localhost ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.026/0.026/0.026/0.000 ms Torsten Werner debian/patches/0000775000000000000000000000000012301722674010623 5ustar debian/patches/0004-include-sys-xattr.patch0000664000000000000000000000105712301722674015627 0ustar Description: Include sys/xattr.h in sys/capability.h We include sys/xattr.h before linux/xattr.h to guard against redefinition of some defines when userspace applications include sys/capability.h and sys/xattr.h and get linux/xattr.h implicitly included out of order. Author: Adam Conrad --- libcap2-2.24.orig/libcap/include/sys/capability.h +++ libcap2-2.24/libcap/include/sys/capability.h @@ -27,6 +27,7 @@ extern "C" { #define __user #endif #include +#include #include /* debian/patches/0001-fix-Makefiles.patch0000664000000000000000000000170712301510010014666 0ustar Description: compile pam_cap with -lpam A similar fix was in Debian but appears to have been accidentally dropped. Drop this one if or when debian gets it back so we can directly sync. Author: Andrew Straw Forwarded: no Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libcap2/+bug/582769 Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591410 Index: libcap2-2.20/pam_cap/Makefile =================================================================== --- libcap2-2.20.orig/pam_cap/Makefile 2011-05-10 10:15:02.540359338 -0500 +++ libcap2-2.20/pam_cap/Makefile 2011-05-10 10:15:07.600359338 -0500 @@ -7,7 +7,7 @@ # that this next line does *not* require -lpam on it.) If you think it # does, *verify that it does*, and if you observe that it fails as # written (and you know why it fails), email me and explain why. Thanks! -LDLIBS += -L../libcap -lcap +LDLIBS += -L../libcap -lcap -lpam all: pam_cap.so $(MAKE) testcompile debian/patches/series0000664000000000000000000000013512301722544012033 0ustar 0001-fix-Makefiles.patch 0003-refine-setcap-error-message.patch 0004-include-sys-xattr.patch debian/patches/0003-refine-setcap-error-message.patch0000664000000000000000000000302412301723025017510 0ustar Description: refine setcap output on errors The error message of setcap is a little confused. From the error message it is hard to detect what is wrong. I removed the last 'usage' function call, because at that code point the 'usage' can not provide any useful information. Instead, I added a function 'mystrerror' which shall provide more information. Author: Zhi Li Forwarded: no Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=633075 Index: libcap-2.24/progs/setcap.c =================================================================== --- libcap-2.24.orig/progs/setcap.c 2014-01-06 03:24:48.791188475 +0000 +++ libcap-2.24/progs/setcap.c 2014-01-06 03:25:21.531121441 +0000 @@ -22,6 +22,25 @@ exit(1); } +static const char * mystrerror(int n) +{ + struct my_error { + int num; + const char *desp; + }db[] = { + { EINVAL, "The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file" }, + { ENODATA, "Are you removing capabilities from a file? That file does not have any capability."}, + {0, ""} + }; + + struct my_error *p = &db[0]; + while (p->num) { + if ( n == p->num ) return p->desp; + p++; + } + return ""; +} + #define MAXCAP 2048 static int read_caps(int quiet, const char *filename, char *buffer) @@ -195,7 +214,8 @@ "Failed to set capabilities on file `%s' (%s)\n", argv[0], strerror(errno)); if (!explained) { - usage(); + fprintf(stderr, "%s\n", mystrerror(errno)); + exit(1); } } } debian/libcap2-bin.preinst0000664000000000000000000000145212301510010012641 0ustar #!/bin/sh # preinst script for libcap2-bin # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `install' # * `install' # * `upgrade' # * `abort-upgrade' # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in upgrade) if dpkg --compare-versions "$2" le "1:2.22-1"; then pam-auth-update --package --remove capability fi ;; install|abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/libpam-cap.prerm0000664000000000000000000000164612301510010012232 0ustar #!/bin/sh # prerm script for libpam-cap # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in remove) pam-auth-update --package --remove capability ;; upgrade|deconfigure|failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0