The Libcap package implements the userspace interface to the POSIX
1003.1e capabilities available in Linux kernels. These capabilities
partition the all-powerful root privilege into a set of distinct
privileges.
Approximate build time:
less than 0.1 SBU
Required disk space:
2.9 MB
8.27.1. Installation of Libcap
Prevent static libraries from being installed:
sed -i '/install -m.*STA/d' libcap/Makefile
Compile the package:
make prefix=/usr lib=lib
The meaning of the make option:
-
lib=lib
-
This parameter sets the library directory to /usr/lib
rather than /usr/lib64
on x86_64. It has no effect on
x86.
To test the results, issue:
make test
Install the package:
make prefix=/usr lib=lib install
8.27.2. Installation of Libcap - 32bit
Clean previous build:
make distclean
Compile the package:
make CC="gcc -m32 -march=i686"
Install the package:
make CC="gcc -m32 -march=i686" lib=lib32 prefix=$PWD/DESTDIR/usr -C libcap install
cp -Rv DESTDIR/usr/lib32/* /usr/lib32
sed -e "s|^libdir=.*|libdir=/usr/lib32|" -i /usr/lib32/pkgconfig/lib{cap,psx}.pc
chmod -v 755 /usr/lib32/libcap.so.2.72
rm -rf DESTDIR
8.27.3. Installation of Libcap - x32bit
Clean previous build:
make distclean
Compile the package:
make CC="gcc -mx32 -march=x86-64"
Install the package:
make CC="gcc -mx32 -march=x86-64" lib=libx32 prefix=$PWD/DESTDIR/usr -C libcap install
cp -Rv DESTDIR/usr/libx32/* /usr/libx32
sed -e "s|^libdir=.*|libdir=/usr/libx32|" -i /usr/libx32/pkgconfig/lib{cap,psx}.pc
chmod -v 755 /usr/libx32/libcap.so.2.72
rm -rf DESTDIR
8.27.4. Contents
of Libcap
Installed programs:
capsh, getcap, getpcaps, and
setcap
Installed library:
libcap.so and libpsx.so
Short Descriptions
capsh
|
A shell wrapper to explore and constrain capability
support
|
getcap
|
Examines file capabilities
|
getpcaps
|
Displays the capabilities of the queried process(es)
|
setcap
|
Sets file capabilities
|
libcap
|
Contains the library functions for manipulating POSIX
1003.1e capabilities
|
libpsx
|
Contains functions to support POSIX semantics for
syscalls associated with the pthread library
|