--- libcap-1.10.orig/doc/old/cap_set_fd.3
+++ libcap-1.10/doc/old/cap_set_fd.3
@@ -0,0 +1 @@
+.so man3/cap_get_file.3
--- libcap-1.10.orig/doc/old/cap_set_file.3
+++ libcap-1.10/doc/old/cap_set_file.3
@@ -0,0 +1 @@
+.so man3/cap_get_file.3
--- libcap-1.10.orig/doc/capset.2
+++ libcap-1.10/doc/capset.2
@@ -1 +1 @@
-.so man2/capget.2
+#.so man2/capget.2
--- libcap-1.10.orig/doc/Makefile
+++ libcap-1.10/doc/Makefile
@@ -7,7 +7,7 @@
 topdir=$(shell pwd)/..
 include $(topdir)/Make.Rules
 
-MAN2S = capget.2 capset.2
+#MAN2S = capget.2 
 MAN3S = cap_init.3 cap_free.3 cap_dup.3 \
 	cap_clear.3 cap_get_flag.3 cap_set_flag.3 \
 	cap_get_proc.3 cap_set_proc.3 \
--- libcap-1.10.orig/Make.Rules
+++ libcap-1.10/Make.Rules
@@ -8,7 +8,7 @@
 
 # common 'packaging' directoty
 
-FAKEROOT=
+FAKEROOT=$(DESTDIR)
 
 # Autoconf-style prefixes are activated when $(prefix) is defined.
 # Otherwise binaries and libraraies are installed in /{lib,sbin}/,
@@ -18,13 +18,13 @@
 exec_prefix=$(prefix)
 lib_prefix=$(exec_prefix)
 inc_prefix=$(lib_prefix)
-man_prefix=$(prefix)
+man_prefix=$(prefix)/share
 else
 prefix=/usr
 exec_prefix=
 lib_prefix=$(exec_prefix)
 inc_prefix=$(prefix)
-man_prefix=$(prefix)
+man_prefix=$(prefix)/share
 endif
 
 # Target directories
@@ -42,7 +42,7 @@
 # Compilation specifics
 
 CC=gcc
-COPTFLAGS=-O2
+COPTFLAGS=-O2 
 DEBUG=-g #-DDEBUG
 WARNINGS=-ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
         -Wpointer-arith -Wcast-qual -Wcast-align \
--- libcap-1.10.orig/Makefile
+++ libcap-1.10/Makefile
@@ -3,17 +3,20 @@
 #
 # Makefile for libcap
 
+ifndef topdir
 topdir=$(shell pwd)
-include Make.Rules
+endif
+include $(topdir)/Make.Rules
+DESTDIR=
 
 #
 # flags
 #
 
 all install clean: %: %-here
-	make -C libcap $(MAKE_DEFS) $@
-	make -C progs $(MAKE_DEFS) $@
-	make -C doc $(MAKE_DEFS) $@
+	make -C $(topdir)/libcap $(MAKE_DEFS) $@
+	make -C $(topdir)/progs $(MAKE_DEFS) $@
+	make -C $(topdir)/doc $(MAKE_DEFS) $@
 
 all-here:
 
--- libcap-1.10.orig/libcap/include/sys/capability.h
+++ libcap-1.10/libcap/include/sys/capability.h
@@ -21,7 +21,288 @@
  */
 
 #include <sys/types.h>
-#include <linux/capability.h>
+/*
+ * This is <linux/capability.h>
+ *
+ * Andrew G. Morgan <morgan@transmeta.com>
+ * Alexander Kjeldaas <astor@guardian.no>
+ * with help from Aleph1, Roland Buresund and Andrew Main.
+ *
+ * See here for the libcap library ("POSIX draft" compliance):
+ *
+ * ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.2/
+ */ 
+
+#ifndef _LINUX_CAPABILITY_H
+#define _LINUX_CAPABILITY_H
+
+#include <linux/types.h>
+/*#include <linux/fs.h>*/
+	
+/* User-level do most of the mapping between kernel and user
+   capabilities based on the version tag given by the kernel. The
+   kernel might be somewhat backwards compatible, but don't bet on
+   it. */
+
+/* XXX - Note, cap_t, is defined by POSIX to be an "opaque" pointer to
+   a set of three capability sets.  The transposition of 3*the
+   following structure to such a composite is better handled in a user
+   library since the draft standard requires the use of malloc/free
+   etc.. */
+ 
+#define _LINUX_CAPABILITY_VERSION  0x19980330
+
+typedef struct __user_cap_header_struct {
+	__u32 version;
+	int pid;
+} *cap_user_header_t;
+ 
+typedef struct __user_cap_data_struct {
+        __u32 effective;
+        __u32 permitted;
+        __u32 inheritable;
+} *cap_user_data_t;
+  
+#ifdef __KERNEL__
+
+/* #define STRICT_CAP_T_TYPECHECKS */
+
+#ifdef STRICT_CAP_T_TYPECHECKS
+
+typedef struct kernel_cap_struct {
+	__u32 cap;
+} kernel_cap_t;
+
+#else
+
+typedef __u32 kernel_cap_t;
+
+#endif
+  
+#define _USER_CAP_HEADER_SIZE  (2*sizeof(__u32))
+#define _KERNEL_CAP_T_SIZE     (sizeof(kernel_cap_t))
+
+#endif
+
+
+/**
+ ** POSIX-draft defined capabilities. 
+ **/
+
+/* In a system with the [_POSIX_CHOWN_RESTRICTED] option defined, this
+   overrides the restriction of changing file ownership and group
+   ownership. */
+
+#define CAP_CHOWN            0
+
+/* Override all DAC access, including ACL execute access if
+   [_POSIX_ACL] is defined. Excluding DAC access covered by
+   CAP_LINUX_IMMUTABLE. */
+
+#define CAP_DAC_OVERRIDE     1
+
+/* Overrides all DAC restrictions regarding read and search on files
+   and directories, including ACL restrictions if [_POSIX_ACL] is
+   defined. Excluding DAC access covered by CAP_LINUX_IMMUTABLE. */
+
+#define CAP_DAC_READ_SEARCH  2
+    
+/* Overrides all restrictions about allowed operations on files, where
+   file owner ID must be equal to the user ID, except where CAP_FSETID
+   is applicable. It doesn't override MAC and DAC restrictions. */
+
+#define CAP_FOWNER           3
+
+/* Overrides the following restrictions that the effective user ID
+   shall match the file owner ID when setting the S_ISUID and S_ISGID
+   bits on that file; that the effective group ID (or one of the
+   supplementary group IDs) shall match the file owner ID when setting
+   the S_ISGID bit on that file; that the S_ISUID and S_ISGID bits are
+   cleared on successful return from chown(2) (not implemented). */
+
+#define CAP_FSETID           4
+
+/* Used to decide between falling back on the old suser() or fsuser(). */
+
+#define CAP_FS_MASK          0x1f
+
+/* Overrides the restriction that the real or effective user ID of a
+   process sending a signal must match the real or effective user ID
+   of the process receiving the signal. */
+
+#define CAP_KILL             5
+
+/* Allows setgid(2) manipulation */
+/* Allows setgroups(2) */
+/* Allows forged gids on socket credentials passing. */
+
+#define CAP_SETGID           6
+
+/* Allows set*uid(2) manipulation (including fsuid). */
+/* Allows forged pids on socket credentials passing. */
+
+#define CAP_SETUID           7
+
+
+/**
+ ** Linux-specific capabilities
+ **/
+
+/* Transfer any capability in your permitted set to any pid,
+   remove any capability in your permitted set from any pid */
+
+#define CAP_SETPCAP          8
+
+/* Allow modification of S_IMMUTABLE and S_APPEND file attributes */
+
+#define CAP_LINUX_IMMUTABLE  9
+
+/* Allows binding to TCP/UDP sockets below 1024 */
+/* Allows binding to ATM VCIs below 32 */
+
+#define CAP_NET_BIND_SERVICE 10
+
+/* Allow broadcasting, listen to multicast */
+
+#define CAP_NET_BROADCAST    11
+
+/* Allow interface configuration */
+/* Allow administration of IP firewall, masquerading and accounting */
+/* Allow setting debug option on sockets */
+/* Allow modification of routing tables */
+/* Allow setting arbitrary process / process group ownership on
+   sockets */
+/* Allow binding to any address for transparent proxying */
+/* Allow setting TOS (type of service) */
+/* Allow setting promiscuous mode */
+/* Allow clearing driver statistics */
+/* Allow multicasting */
+/* Allow read/write of device-specific registers */
+/* Allow activation of ATM control sockets */
+
+#define CAP_NET_ADMIN        12
+
+/* Allow use of RAW sockets */
+/* Allow use of PACKET sockets */
+
+#define CAP_NET_RAW          13
+
+/* Allow locking of shared memory segments */
+/* Allow mlock and mlockall (which doesn't really have anything to do
+   with IPC) */
+
+#define CAP_IPC_LOCK         14
+
+/* Override IPC ownership checks */
+
+#define CAP_IPC_OWNER        15
+
+/* Insert and remove kernel modules - modify kernel without limit */
+/* Modify cap_bset */
+#define CAP_SYS_MODULE       16
+
+/* Allow ioperm/iopl access */
+/* Allow sending USB messages to any device via /proc/bus/usb */
+
+#define CAP_SYS_RAWIO        17
+
+/* Allow use of chroot() */
+
+#define CAP_SYS_CHROOT       18
+
+/* Allow ptrace() of any process */
+
+#define CAP_SYS_PTRACE       19
+
+/* Allow configuration of process accounting */
+
+#define CAP_SYS_PACCT        20
+
+/* Allow configuration of the secure attention key */
+/* Allow administration of the random device */
+/* Allow examination and configuration of disk quotas */
+/* Allow configuring the kernel's syslog (printk behaviour) */
+/* Allow setting the domainname */
+/* Allow setting the hostname */
+/* Allow calling bdflush() */
+/* Allow mount() and umount(), setting up new smb connection */
+/* Allow some autofs root ioctls */
+/* Allow nfsservctl */
+/* Allow VM86_REQUEST_IRQ */
+/* Allow to read/write pci config on alpha */
+/* Allow irix_prctl on mips (setstacksize) */
+/* Allow flushing all cache on m68k (sys_cacheflush) */
+/* Allow removing semaphores */
+/* Used instead of CAP_CHOWN to "chown" IPC message queues, semaphores
+   and shared memory */
+/* Allow locking/unlocking of shared memory segment */
+/* Allow turning swap on/off */
+/* Allow forged pids on socket credentials passing */
+/* Allow setting readahead and flushing buffers on block devices */
+/* Allow setting geometry in floppy driver */
+/* Allow turning DMA on/off in xd driver */
+/* Allow administration of md devices (mostly the above, but some
+   extra ioctls) */
+/* Allow tuning the ide driver */
+/* Allow access to the nvram device */
+/* Allow administration of apm_bios, serial and bttv (TV) device */
+/* Allow manufacturer commands in isdn CAPI support driver */
+/* Allow reading non-standardized portions of pci configuration space */
+/* Allow DDI debug ioctl on sbpcd driver */
+/* Allow setting up serial ports */
+/* Allow sending raw qic-117 commands */
+/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
+   arbitrary SCSI commands */
+/* Allow setting encryption key on loopback filesystem */
+
+#define CAP_SYS_ADMIN        21
+
+/* Allow use of reboot() */
+
+#define CAP_SYS_BOOT         22
+
+/* Allow raising priority and setting priority on other (different
+   UID) processes */
+/* Allow use of FIFO and round-robin (realtime) scheduling on own
+   processes and setting the scheduling algorithm used by another
+   process. */
+
+#define CAP_SYS_NICE         23
+
+/* Override resource limits. Set resource limits. */
+/* Override quota limits. */
+/* Override reserved space on ext2 filesystem */
+/* NOTE: ext2 honors fsuid when checking for resource overrides, so 
+   you can override using fsuid too */
+/* Override size restrictions on IPC message queues */
+/* Allow more than 64hz interrupts from the real-time clock */
+/* Override max number of consoles on console allocation */
+/* Override max number of keymaps */
+
+#define CAP_SYS_RESOURCE     24
+
+/* Allow manipulation of system clock */
+/* Allow irix_stime on mips */
+/* Allow setting the real-time clock */
+
+#define CAP_SYS_TIME         25
+
+/* Allow configuration of tty devices */
+/* Allow vhangup() of tty */
+
+#define CAP_SYS_TTY_CONFIG   26
+
+/* Allow the privileged aspects of mknod() */
+
+#define CAP_MKNOD            27
+
+/* Allow taking of leases on files */
+
+#define CAP_LEASE            28
+
+#endif /* !_LINUX_CAPABILITY_H */
+
+
 
 /*
  * POSIX capability types
--- libcap-1.10.orig/libcap/Makefile
+++ libcap-1.10/libcap/Makefile
@@ -24,12 +24,15 @@
 #
 # defines
 #
+ifndef $(topdir)
 topdir=$(shell pwd)/..
-include ../Make.Rules
+endif
+include $(topdir)/Make.Rules
+
 #
 # Library version
 #
-LIBNAME=libcap.so
+LIBNAME=libcap
 #
 
 FILES=cap_alloc cap_proc cap_extint cap_flag cap_text cap_sys
@@ -39,10 +42,11 @@
 
 INCLS=libcap.h cap_names.h $(INCS)
 OBJS=$(addsuffix .o, $(FILES))
-MAJLIBNAME=$(LIBNAME).$(VERSION)
+LOBJS=$(addsuffix .lo, $(FILES))
+MAJLIBNAME=$(LIBNAME).so.$(VERSION)
 MINLIBNAME=$(MAJLIBNAME).$(MINOR)
 
-all: $(MINLIBNAME)
+all: $(MINLIBNAME) $(LIBNAME).a
 
 _makenames: _makenames.c cap_names.sed
 	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
@@ -50,31 +54,38 @@
 cap_names.h: _makenames
 	./_makenames > cap_names.h
 
-cap_names.sed: Makefile /usr/include/linux/capability.h
-	@echo "=> making cap_names.c from <linux/capability.h>"
-	@sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define \([^ \t]*\)[ \t]*\([^ \t]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed
-#	@sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define CAP_\([^ \t]*\)[ \t]*\([^ \t]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed
+cap_names.sed: Makefile include/sys/capability.h
+	@echo "=> making cap_names.c from <sys/capability.h>"
+	@sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define \([^ \t]*\)[ \t]*\([^ \t]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < include/sys/capability.h | fgrep -v 0x > cap_names.sed #   @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define CAP_\([^ \t]*\)[ \t]*\([^ \t]*\)/  \{ \2, \"\1\" \},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < /usr/include/linux/capability.h | fgrep -v 0x > cap_names.sed
+
+$(LIBNAME).a: $(OBJS)
+	ar cruv $(LIBNAME).a $(OBJS)
 
-$(MINLIBNAME): $(OBJS)
-	$(LD) -soname $(MAJLIBNAME) -x -shared -o $@ $(OBJS)
+$(MINLIBNAME): $(LOBJS)
+	$(CC) -shared -fPIC -Wl,-soname,$(MAJLIBNAME) -o $@ $(LOBJS)
 	ln -sf $(MINLIBNAME) $(MAJLIBNAME)
-	ln -sf $(MAJLIBNAME) $(LIBNAME)
+	ln -sf $(MAJLIBNAME) $(LIBNAME).so
 
 %.o: %.c $(INCLS)
 	$(CC) $(CFLAGS) -c $< -o $@
 
+%.lo: %.c $(INCLS)
+	$(CC) $(CFLAGS) -fPIC -c $< -o $@
+
+
 install: all
 	mkdir -p -m 0755 $(INCDIR)/sys
 	install -m 0644 include/sys/capability.h $(INCDIR)/sys
 	mkdir -p -m 0755 $(LIBDIR)
+	install -m 0644 $(LIBNAME).a $(LIBDIR)
 	install -m 0644 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
 	ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
-	ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME)
+	ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME).so
 	-/sbin/ldconfig
 
 clean:
 	$(LOCALCLEAN)
-	rm -f $(OBJS) $(LIBNAME)*
+	rm -f $(OBJS) $(LOBJS) $(LIBNAME).a $(LIBNAME).so*
 	rm -f cap_names.h cap_names.sed _makenames
 	cd include/sys && $(LOCALCLEAN)
 
--- libcap-1.10.orig/libcap/_makenames.c
+++ libcap-1.10/libcap/_makenames.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <linux/capability.h>
+#include <sys/capability.h>
 
 /*
  * #include 'sed' generated array
--- libcap-1.10.orig/libcap/cap_sys.c
+++ libcap-1.10/libcap/cap_sys.c
@@ -10,7 +10,8 @@
 #include "libcap.h"
 #define __LIBRARY__
 #include <linux/unistd.h>
-
+/* glic >= 2.1 knows capset/capget. no need to define it here */ 
+/* 
 _syscall2(int, capget,
 	  cap_user_header_t, header,
 	  cap_user_data_t, data)
@@ -18,7 +19,7 @@
 _syscall2(int, capset,
 	  cap_user_header_t, header,
 	  const cap_user_data_t, data)
-
+*/
 /*
  * $Log: cap_sys.c,v $
  * Revision 1.1.1.1  1999/04/17 22:16:31  morgan
--- libcap-1.10.orig/debian/changelog
+++ libcap-1.10/debian/changelog
@@ -0,0 +1,98 @@
+libcap (1:1.10-14) unstable; urgency=low
+
+  * fixed a "dangling symlinks" (closes: #191591)
+
+ -- Michael Vogt <mvo@debian.org>  Wed, 14 Apr 2004 00:10:30 +0200
+
+libcap (1:1.10-13) unstable; urgency=low
+
+  * moved README and capfaq-0.2.txt to libcap-bin (closes: #226343)
+
+ -- Michael Vogt <mvo@debian.org>  Wed, 14 Jan 2004 13:29:34 +0100
+
+libcap (1:1.10-12) unstable; urgency=low
+
+  * corrected spelling mistakes (closes: #124906, #124907)
+
+ -- Michael Vogt <mvo@debian.org>  Tue, 18 Dec 2001 05:33:03 +0100
+
+libcap (1:1.10-11) unstable; urgency=low
+
+  * changed priority only for libcap1 (not for libcap-bin, libcap-dev)
+
+ -- Michael Vogt <mvo@debian.org>  Fri, 20 Jul 2001 00:01:47 +0200
+
+libcap (1:1.10-10) unstable; urgency=low
+
+  * changed priority to "required", because libpam-modules depend on it   
+    (closes: #103567)   
+  
+ -- Michael Vogt <mvo@debian.org>  Thu,  5 Jul 2001 11:05:28 +0200
+
+libcap (1:1.10-9) unstable; urgency=low
+
+  * added Build-Depends: debhelper, this closes: #86828
+  * libcap links against libc6, closes: #87234
+  * as no kernel headers get included, it closes: #81962
+  
+ -- Michael Vogt <mvo@debian.org>  Wed,  7 Mar 2001 10:30:31 +0100
+
+libcap (1:1.10-8) unstable; urgency=low
+
+  * fixed a typo in the description and improved the description
+    this closes: #88425 (thanks to Joey Hess <joeyh@debian.org)
+  * added capfaq-0.2.txt to the documentation
+  
+ -- Michael Vogt <mvo@debian.org>  Mon,  5 Mar 2001 10:36:11 +0100
+
+libcap (1:1.10-7) unstable; urgency=low
+
+  * debuged and removed all lintian errors
+  * removed inclusion of kernel-headers in libcap
+  * synced sections with override file
+
+ -- Michael Vogt <mvo@debian.org>  Thu,  1 Mar 2001 02:14:27 +0100
+
+libcap (1:1.10-6) unstable; urgency=low
+
+  * closes: #87343 (thanks to Ryan Murray <rmurray@cyberhqz.com>)
+  * added epoch to override a old version 1.92 floating around
+  * merged all changes from Mikolaj J. Habryn <dichro-debian@rcpt.to> 
+
+ -- Michael Vogt <mvo@debian.org>  Wed, 28 Feb 2001 11:22:23 +0100
+
+libcap (1.10-5) unstable; urgency=low
+
+  * removed capget.2 (is also in manpages-dev)
+  * closes: #86021
+  
+ -- Michael Vogt <mvo@debian.org>  Sun, 18 Feb 2001 01:32:33 +0100
+
+libcap (1.10-4) unstable; urgency=low
+
+  * second try to remove capset.2. man-page.
+
+ -- Michael Vogt <mvo@debian.org>  Thu, 15 Feb 2001 10:34:23 +0100
+
+libcap (1.10-3) unstable; urgency=low
+
+  * closes bug: #86021 (thanks to Ryan Murray <rmurray@cyberhqz.com>
+  * remove the capset.2.gz man-page (it is already in manpages-dev)
+
+ -- Michael Vogt <mvo@debian.org>  Thu, 15 Feb 2001 10:08:34 +0100
+
+libcap (1.10-2) unstable; urgency=low
+
+  * closes bug: #73062, #73606 
+    (thanks to Laurent Bonnaud <bonnaud@iut2.upmf-grenoble.fr>
+	       Robert Bihlmeyer <robbe@orcus.priv.at>)
+
+ -- Michael Vogt <mvo@debian.org>  Thu,  5 Oct 2000 09:21:52 +0200
+
+libcap (1.10-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Michael Vogt <mvo@debian.org>  Tue, 25 Jul 2000 19:28:22 +0200
+
+
--- libcap-1.10.orig/debian/copyright
+++ libcap-1.10/debian/copyright
@@ -0,0 +1,51 @@
+This package was debianized by Michael Vogt <mvo@debian.org> on
+Tue, 25 Jul 2000 19:28:22 +0200.
+
+It was downloaded from ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/
+
+Upstream Author: Andrew G. Morgan <morgan@linux.kernel.org>
+
+Copyright:
+
+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
\ No newline at end of file
--- libcap-1.10.orig/debian/rules
+++ libcap-1.10/debian/rules
@@ -0,0 +1,102 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatability version to use.
+export DH_COMPAT=1
+
+# shared library versions, option 1
+version=1.10
+major=1
+# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
+#version=`ls src/.libs/lib*.so.* | \
+# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
+#major=`ls src/.libs/lib*.so.* | \
+# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	# Add here commands to configure the package.
+	touch configure-stamp
+
+build: configure-stamp build-stamp
+build-stamp:
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	# Add here commands to clean up after the build process.
+	-$(MAKE) clean
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/tmp.
+	$(MAKE) install DESTDIR=`pwd`/debian/tmp
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+#	dh_testversion
+	dh_testdir
+	dh_testroot
+	#
+	# build liblibcap${major} package by moving files from libcap-dev
+	#
+	dh_movefiles -plibcap-bin \
+        sbin/execcap sbin/getpcaps \
+        sbin/setpcaps sbin/sucap 
+
+	dh_movefiles -plibcap$(major)             \
+	lib/libcap.so.$(major)        \
+	lib/libcap.so.$(version) 
+
+#	dh_installdebconf	
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installinit
+	dh_installcron
+# don't install manpages in old/* and ignore packages libcap-bin, libcap1
+	dh_installmanpages -Nlibcap-bin -Ndoc/capset.2 -Nlibcap1 doc/capget.2 doc/old/*
+	dh_installinfo
+	dh_undocumented -Nlibcap1 -Nlibcap-dev execcap.1 getpcaps.1 setpcaps.1 sucap.1
+	dh_installchangelogs CHANGELOG
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	# You may want to make some executables suid here.
+	dh_makeshlibs
+	dh_installdeb
+#	dh_perl
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
--- libcap-1.10.orig/debian/dirs
+++ libcap-1.10/debian/dirs
@@ -0,0 +1,4 @@
+lib
+usr/include
+usr/share/man/man3
+usr/share/man/man2
--- libcap-1.10.orig/debian/libcap1.postinst
+++ libcap-1.10/debian/libcap1.postinst
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    configure*)
+	ldconfig
+	;;
+    *)
+	;;
+esac
+
+#DEBHELPER#
+
--- libcap-1.10.orig/debian/control
+++ libcap-1.10/debian/control
@@ -0,0 +1,35 @@
+Source: libcap
+Section: libs
+Priority: optional
+Maintainer: Michael Vogt <mvo@debian.org>
+Standards-Version: 3.6.1
+Build-Depends: debhelper
+
+Package: libcap-dev
+Section: devel
+Architecture: any
+Depends: libcap1 (= ${Source-Version}), libc6-dev
+Description: development libraries and header files for libcap
+ Contains the necessary support for building applications that use
+ capabilities.
+
+Package: libcap-bin
+Section: devel
+Architecture: any
+Depends: libcap1
+Replaces: libcap-progs
+Description: basic utility programs for using capabilities
+ This packages contains the programs sucap, execap, getpcaps, setpcaps
+ for manipulation of capabilities.
+
+Package: libcap1
+Architecture: any
+Priority: required
+Depends: ${shlibs: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.  Note that it will not provide any functionality with kernels 
+ below 2.2
+
--- libcap-1.10.orig/debian/libcap-bin.docs
+++ libcap-1.10/debian/libcap-bin.docs
@@ -0,0 +1,2 @@
+README
+capfaq-0.2.txt
--- libcap-1.10.orig/debian/libcap1.files
+++ libcap-1.10/debian/libcap1.files
@@ -0,0 +1 @@
+lib/*.so.*
--- libcap-1.10.orig/capfaq-0.2.txt
+++ libcap-1.10/capfaq-0.2.txt
@@ -0,0 +1,264 @@
+This is the Linux kernel capabilities FAQ
+
+Its history, to the extent that I am able to reconstruct it is that
+v2.0 was posted to the Linux kernel list on 1999/04/02 by Boris
+Tobotras. Thanks to Denis Ducamp for forwarding me a copy.
+
+Cheers
+
+Andrew
+
+Linux Capabilities FAQ 0.2
+==========================
+
+1) What is a capability?
+
+The name "capabilities" as used in the Linux kernel can be confusing.
+First there are Capabilities as defined in computer science. A
+capability is a token used by a process to prove that it is allowed to
+do an operation on an object.  The capability identifies the object
+and the operations allowed on that object.  A file descriptor is a
+capability.  You create the file descriptor with the "open" call and
+request read or write permissions.  Later, when doing a read or write
+operation, the kernel uses the file descriptor as an index into a
+data structure that indicates what operations are allowed.  This is an
+efficient way to check permissions.  The necessary data structures are
+created once during the "open" call.  Later read and write calls only
+have to do a table lookup.  Operations on capabilities include copying
+capabilities, transferring capabilities between processes, modifying a
+capability, and revoking a capability.  Modifying a capability can be
+something like taking a read-write filedescriptor and making it
+read-only.  A capability often has a notion of an "owner" which is
+able to invalidate all copies and derived versions of a capability.
+Entire OSes are based on this "capability" model, with varying degrees
+of purity.  There are other ways of implementing capabilities than the
+file descriptor model - traditionally special hardware has been used,
+but modern systems also use the memory management unit of the CPU.
+
+Then there is something quite different called "POSIX capabilities"
+which is what Linux uses.  These capabilities are a partitioning of
+the all powerful root privilege into a set of distinct privileges (but
+look at securelevel emulation to find out that this isn't necessary
+the whole truth).  Users familiar with VMS or "Trusted" versions of
+other UNIX variants will know this under the name "privileges".  The
+name "capabilities" comes from the now defunct POSIX draft 1003.1e
+which used this name.
+
+2) So what is a "POSIX capability"?
+
+A process has three sets of bitmaps called the inheritable(I),
+permitted(P), and effective(E) capabilities.  Each capability is
+implemented as a bit in each of these bitmaps which is either set or
+unset.  When a process tries to do a privileged operation, the
+operating system will check the appropriate bit in the effective set
+of the process (instead of checking whether the effective uid of the
+process i 0 as is normally done).  For example, when a process tries
+to set the clock, the Linux kernel will check that the process has the
+CAP_SYS_TIME bit (which is currently bit 25) set in its effective set.
+
+The permitted set of the process indicates the capabilities the
+process can use.  The process can have capabilities set in the
+permitted set that are not in the effective set.  This indicates that
+the process has temporarily disabled this capability.  A process is
+allowed to set a bit in its effective set only if it is available in
+the permitted set.  The distinction between effective and permitted
+exists so that processes can "bracket" operations that need privilege.
+
+The inheritable capabilities are the capabilities of the current
+process that should be inherited by a program executed by the current
+process.  The permitted set of a process is masked against the
+inheritable set during exec().  Nothing special happens during fork()
+or clone().  Child processes and threads are given an exact copy of
+the capabilities of the parent process.
+
+3) What about other entities in the system? Users, Groups, Files?
+
+Files have capabilities.  Conceptually they have the same three
+bitmaps that processes have, but to avoid confusion we call them by
+other names.  Only executable files have capabilities, libraries don't
+have capabilities (yet).  The three sets are called the allowed set,
+the forced set, and the effective set.
+
+The allowed set indicates what capabilities the executable is allowed
+to receive from an execing process.  This means that during exec(),
+the capabilities of the old process are first masked against a set
+which indicates what the process gives away (the inheritable set of
+the process), and then they are masked against a set which indicates
+what capabilities the new process image is allowed to receive (the
+allowed set of the executable).
+
+The forced set is a set of capabilities created out of thin air and
+given to the process after execing the executable.  The forced set is
+similar in nature to the setuid feature.  In fact, the setuid bit from
+the filesystem is "read" as a full forced set by the kernel.
+
+The effective set indicates which bits in the permitted set of the new
+process should be transferred to the effective set of the new process.
+The effective set is best thought of as a "capability aware" set.  It
+should consist of only 1s if the executable is capability-dumb, or
+only 0s if the executable is capability-smart.  Since the effective
+set consists of only 0s or only 1s, the filesystem can implement this
+set using a single bit.
+
+NOTE: Filesystem support for capabilities is not part of Linux 2.2.
+
+Users and Groups don't have associated capabilities from the kernel's
+point of view, but it is entirely reasonable to associate users or
+groups with capabilities.  By letting the "login" program set some
+capabilities it is possible to make role users such as a backup user
+that will have the CAP_DAC_READ_SEARCH capability and be able to do
+backups.  This could also be implemented as a PAM module, but nobody
+has implemented one yet.
+
+4) What capabilities exist?
+
+The capabilities available in Linux are listed and documented in the
+file /usr/src/linux/include/linux/capability.h.
+
+5) Are Linux capabilities hierarchical?
+
+No, you cannot make a "subcapability" out of a Linux capability as in
+capability-based OSes.
+
+6) How can I use capabilities to make sure Mr. Evil Luser (eluser)
+can't exploit my "suid" programs?
+
+This is the general outline of how this works given filesystem
+capability support exists.  First, you have a PAM module that sets the
+inheritable capabilities of the login-shell of eluser.  Then for all
+"suid" programs on the system, you decide what capabilities they need
+and set the _allowed_ set of the executable to that set of
+capabilities.  The capability rules
+
+   new permitted = forced | (allowed & inheritable)
+
+means that you should be careful about setting forced capabilities on
+executables.  In a few cases, this can be useful though.  For example
+the login program needs to set the inheritable set of the new user and
+therefore needs an almost full permitted set.  So if you want eluser
+to be able to run login and log in as a different user, you will have
+to set some forced bits on that executable.
+
+7) What about passing capabilities between processes?
+
+Currently this is done by the system call "setcap" which can set the
+capabilities of another process.  This requires the CAP_SETPCAP
+capability which you really only want to grant a _few_ processes.
+CAP_SETPCAP was originally intended as a workaround to be able to
+implement filesystem support for capabilities using a daemon outside
+the kernel.
+
+There has been discussions about implementing socket-level capability
+passing.  This means that you can pass a capability over a socket.  No
+support for this exists in the official kernel yet.
+
+8) I see securelevel has been removed from 2.2 and are superceeded by
+capabilities.  How do I emulate securelevel using capabilities?
+
+The setcap system call can remove a capability from _all_ processes on
+the system in one atomic operation.  The setcap utility from the
+libcap distribution will do this for you.  The utility requires the
+CAP_SETPCAP privilege to do this.  The CAP_SETPCAP capability is not
+enabled by default.
+
+libcap is available from
+ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.2/
+
+9) I noticed that the capability.h file lacks some capabilities that
+are needed to fully emulate 2.0 securelevel.  Is there a patch for
+this?
+
+Actually yes - funny you should ask :-).  The problem with 2.0
+securelevel is that they for example stop root from accessing block
+devices.  At the same time they restrict the use of iopl.  These two
+changes are fundamentally different.  Blocking access to block devices
+means restricting something that usually isn't restricted.
+Restricting access to the use of iopl on the other hand means
+restricting (blocking) access to something that is already blocked.
+Emulating the parts of 2.0 securelevel that restricts things that are
+normally not restricted means that the capabilites in the kernel has
+to have a set of capabilities that are usually _on_ for a normal
+process (note that this breaks the explanation that capabilities are a
+partitioning of the root privileges).  There is an experimental patch at
+
+ftp://ftp.guardian.no/pub/free/linux/capabilities/patch-cap-exp-1
+
+which implements a set of capabilities with the "CAP_USER" prefix:
+
+cap_user_sock  - allowed to use socket()
+cap_user_dev   - allowed to open char/block devices
+cap_user_fifo  - allowed to use pipes
+
+These should be enough to emulate 2.0 securelevel (tell me if we need
+something more).
+
+10) Seems I need a CAP_SETPCAP capability that I don't have to make use
+of capabilities.  How do I enable this capability?
+
+Change the definition of CAP_INIT_EFF_SET and CAP_INIT_INH_SET to the
+following in include/linux/capability.h:
+
+#define CAP_INIT_EFF_SET    { ~0 }
+#define CAP_INIT_INH_SET    { ~0 }
+
+This will start init with a full capability set and not with
+CAP_SETPCAP removed.
+
+11) How do I start a process with a limited set of capabilities?
+
+Get the libcap library and use the execcap utility.  The following
+example starts the update daemon with only the CAP_SYS_ADMIN
+capability.
+
+execcap 'cap_sys_admin=eip' update
+
+12) How do I start a process with a limited set of capabilities under
+another uid?
+
+Use the sucap utility which changes uid from root without loosing any
+capabilities.  Normally all capabilities are cleared when changing uid
+from root.  The sucap utility requires the CAP_SETPCAP capability.
+The following example starts updated under uid updated and gid updated
+with CAP_SYS_ADMIN raised in the Effective set.
+
+sucap updated updated execcap 'cap_sys_admin=eip' update
+
+[ Sucap is currently available from
+ftp://ftp.guardian.no/pub/free/linux/capabilities/sucap.c. Put it in
+the progs directory of libcap to compile.]
+
+13) What are the "capability rules"
+
+The capability rules are the rules used to set the capabilities of the
+new process image after an exec.  They work like this:
+
+        pI' = pI
+  (***) pP' = fP | (fI & pI)
+        pE' = pP' & fE          [NB. fE is 0 or ~0]
+
+  I=Inheritable, P=Permitted, E=Effective // p=process, f=file
+  ' indicates post-exec().
+
+Now to make sense of the equations think of fP as the Forced set of
+the executable, and fI as the Allowed set of the executable.  Notice
+how the Inheritable set isn't touched at all during exec().
+
+14) What are the laws for setting capability bits in the Inheritable,
+Permitted, and Effective sets?
+
+Bits can be transferred from Permitted to either Effective or
+Inheritable set.
+
+Bits can be removed from all sets.
+
+15) Where is the standard on which the Linux capabilities are based?
+
+There used to be a POSIX draft called POSIX.6 and later POSIX 1003.1e.
+However after the committee had spent over 10 years, POSIX decided
+that enough is enough and dropped the draft.  There will therefore not
+be a POSIX standard covering security anytime soon.  This may lead to
+that the POSIX draft is available for free, however.
+
+--
+        Best regards, -- Boris.
+
