aboutsummaryrefslogtreecommitdiff
path: root/libcap
AgeCommit message (Collapse)Author
2016-11-02Update our copy of libcap.Jorge Lucangeli Obes
Merge commit 'dce069b': dce069b Add something to run libcap's quicktest tests against development kernel. 1f52c8a Fix tyop in a comment. a0b240a Up the minor release number. 9c3d89f Update to Linus' kernel tree uapi headers. b245719 Delete unused #define (magit numbers from <linux/xattr.h>) 1bebacb setcap: fix errno display ebcbf9f ignore the place I stage user contributed patches for import. 22579a7 Sigh. Compiling capsh statically and we get no getpw*() functions. 85f38a5 Drop use of libattr for our trivial use case of kernel API. Bug: 32613279 Test: Build HiKey, everything boots. Change-Id: Id002306c0d28fbc12bd6a409870fb97a8068ff24
2016-01-31Fix tyop in a comment.Andrew G Morgan
Thanks to P.J.Opalinski for noticing it. Signed-off-by: Andrew G Morgan <morgan@kernel.org>
2016-01-30Update to Linus' kernel tree uapi headers.Andrew G. Morgan
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2016-01-30Delete unused #define (magit numbers from <linux/xattr.h>)Andrew G. Morgan
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2016-01-30Drop use of libattr for our trivial use case of kernel API.Andrew G. Morgan
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Build libcap for Android.Jorge Lucangeli Obes
Add Android.mk file for 'libcap' target. Also add license-related files. Including auto-generated file for now, will turn into a host binary target later. Bug: 23787966 Change-Id: Iaf2a457872bbc29e758c92cae22e65fa7436d1ed
2015-09-03don't include FAKEROOT in Makefile variablesBenedikt Morbach
instead, prepend it when actually using them. This makes the variables more useful for specifying on the make invocation, as you don't have to repeat your FAKEROOT/DESTDIR for every variable you want to set. Just like you can set 'lib' without specifying lib_prefix. compare: make DESTDIR="${somevar}" prefix=/usr/local LIBDIR="${somevar}"/usr/local/lib96 MANDIR="${somevar}"/usr/share/man to: make DESTDIR="${somevar}" prefix=/usr/local LIBDIR=/usr/local/lib96 MANDIR=/usr/share/man Signed-off-by: Andrew G Morgan <morgan@kernel.org>
2015-09-03Make.Rules: add gperf detection and fix INDENT testMatthieu Crapet
Move gperf detection from libcap/Makefile to Make.Rules to be more cross-environment friendly. Fix INDENT test (dollar sign must be doubled): http://www.gnu.org/software/make/manual/make.html#Variables-in-Recipes Signed-off-by: Matthieu Crapet <mcrapet@gmail.com> Signed-off-by: Andrew G Morgan <morgan@kernel.org>
2015-09-03Change the location we include linux/xattr.hAndrew G Morgan
This header stuff seems a bit fragile, but Serge reports including it in sys/capability.h was causing a lot of trouble building dependent app packages. From the perspective of libcap, this API is only needed internally in cap_file.c so we put an include there. Signed-off-by: Andrew G Morgan <morgan@kernel.org>
2015-09-03libcap: fix dead/empty urls.Xose Vazquez Perez
Cc: Andrew G. Morgan <morgan@kernel.org> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: Andrew G Morgan <morgan@kernel.org>
2015-09-03Fix libcap build issue - remove spurious /uapiAndrew G Morgan
Thanks to Allan McRae for resolving it. Signed-off-by: Andrew G Morgan <morgan@kernel.org>
2015-09-03Fix up the uapi/linux include scheme.Andrew G Morgan
In adopting this uapi header file (without kernel internals), I previously messed up on the apparent location of the files. Thanks to Tom Gundersen for the clarification. Also, delete the non-uapi copies of things since they are no longer needed to build the library and tools. Signed-off-by: Andrew G Morgan <morgan@kernel.org>
2015-09-03Clean up some signed vs. unsigned comparisons in libcap.Andrew G Morgan
Suggestion from Mark Wielaard @ Redhat and, more recently from Akhil Arora @ Intel. Signed-off-by: Andrew G Morgan <morgan@kernel.org>
2015-09-03Add a .pc file to the library.Andrew G Morgan
This patch was generated by Bryan Kadzban, and most recently supported by Thomas H.P. Anderson. For more info on what this file is used for, read: http://en.wikipedia.org/wiki/Pkg-config Signed-off-by: Andrew G Morgan <morgan@kernel.org>
2015-09-03Get the library to compile again.Andrew G Morgan
Signed-off-by: Andrew G Morgan <morgan@kernel.org>
2015-09-03Change directory to "/" after --chroot operation.Andrew G. Morgan
Thanks to Steve Grubb for suggesting this. He wrote: ========= I was reviewing something recently and discovered a problem in capsh. The capsh program has a --chroot command line option. Inspecting the code shows that it does not do a chdir("/") after calling chroot. This means that '.' is outside the chroot. Additional info: http://cwe.mitre.org/data/definitions/243.html ========= Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Add some bounding set capability support to libcap.Andrew G. Morgan
Include some documentation and a link to capsh's man page. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03libcap: introduce CAP_SYSLOGSergey Senozhatsky
Since commit 38ef4c2e437d11b5922723504b62824e96761459 syslog operations require CAP_SYSLOG capability (intoriduced by commit ce6ada35bdf710d16582cc4869c26722547e6f11), not CAP_SYS_ADMIN. Patch introduces CAP_SYSLOG capability. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
2015-09-03fix MakefilesTorsten Werner
This patch allows modifications of $(CFLAGS) when invoking make and fixes some library linking issues. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Clean up of prctl code.Andrew G. Morgan
Also add linux securebits.h file in case the system headers did not include them. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03define sys/securebits.hSerge E. Hallyn
Hey Andrew, Do you think this belongs in libcap? I figure it looks nice sitting next to include/sys/capability.h... But can't convince myself whether it's useful or not. Signed-off-by: Serge Hallyn <serge@us.ibm.com> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Update to latest kernel header 2.6.33.Andrew G. Morgan
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Update kernel header to more recent version.Andrew G. Morgan
Also clean up header to avoid hackery - no longer needed apparently. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Stop using sed for parsing capability.h.Andrew G. Morgan
I've had a number of reports that some systems are using really old versions of sed that don't honor the '\t' for tabs in rules. Since perl does, we'll use that from here on. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Makefile tweaks mostlyAndrew G. Morgan
add rule to build HTML add LIBATTR=no makefile support for not including filesystem support comment cleanup for cap_file.c. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Another corner case not gracefully handled by cap_to_text.Andrew G. Morgan
This shows up when you try to run getpcaps on a system still running with 32-bit capabilities. The output is very verbose for a process with no capabilities. Now it yields '='. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Make rules were not complete for compiling on unprepared systems.Andrew G. Morgan
Reported-by: Ulf GrĂ¼ne <ulf.gruene@t-online.de> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Remove support for kernel feature never implemented.Andrew G. Morgan
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Restore correct source location for <sys/capability.h>Andrew G. Morgan
Reported-by: Robby Workman <rworkman@slackware.com> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Up to date with Linus' tree.Andrew G. Morgan
This change should not impact any code. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Fix cap_copy_int(), add two functions cap_get_pid() and cap_compare()Andrew G. Morgan
Test new and old function with modified test. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Fix for Debian bugs 400591 & 487223: cap_copy_ext()Andrew G. Morgan
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=400591 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=487223 Correct fix implemented as suggested by Matt. Reported-by: Matt Kern <matt.kern@undue.org> Reported-by: Torsten Werner <twerner@debian.org> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Make text representation more readable.Andrew G. Morgan
When the most compact representation of a set of capabilities involves displaying unnamed capabilities (with numbers), folk find the output unreadable. With this change, we make an attempt to avoid ever printing numeric capabilities in the common cases for capability sets. Reported-by: Serge E. Hallyn <serue@us.ibm.com> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Leverage a different, more standard, location for xattr.h .Andrew G. Morgan
Reported-by: Lee Essen <lee.essen@owlsbarn.co.uk> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Some makefile cleanups.Andrew G. Morgan
All the good parts of this change are Mike Frysinger's <vapier@gentoo.org> work. Everything that is broken, is due to my mangling of it. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Make fixes.Hao Xu
Don't need to do -O2 twice. Install the static library with the static libraries name(!) Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03We're moving on to v3 capabilities, to overcome a header file snafu.Andrew G. Morgan
v3 capabilities are functionally equivalent to v2 capabilities, but having a different magic value allow the kernel to warn about possibly unsafe use of v2 capabilities. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Drop dependency on current value of _LINUX_CAPABILITY_VERSIONAndrew G. Morgan
Be more explicit with a local definition of _LIBCAP_CAPABILITY_* to indicate the libraries preferred capability revision. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Clean up in preparation for next release.Andrew G. Morgan
Don't install non-existent man pages. Update kernel header from latest 2.6.26 git tree. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Revised numbers for the SECUREBITS prctl()sAndrew G. Morgan
Andrew Morton said: The hitherto-invisible-to-me PR_GET_TSC and PR_SET_TSC have turned up in mainline, so I have renumbered your prctl options to /* Get/set securebits (as per security/commoncap.c) */ #define PR_GET_SECUREBITS 27 #define PR_SET_SECUREBITS 28 Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Add cap_clear_flag() function to clear one of the EIP capability flag vectorsAndrew G. Morgan
This function makes modifying only one of E I and P sets easier. cap_clear() = cap_clear_flag(,E) + cap_clear_flag(,I) + cap_clear_flag(,P) Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Address a bug manipulating 32-bit text representations of capabilities.Andrew G. Morgan
Reported separately by Serge and Chris Friedoff.
2015-09-03Revert "Add CAP_NS_OVERRIDE (34)."Andrew G. Morgan
This reverts commit 6f8418fa5e8a253970e317600cb963ff45fbe24e. Serge says this was premature (and Andrew says my bad).
2015-09-03Add support for Kohei KaiGai's /sys/kernel/capability/ files.Andrew G. Morgan
This change adds support for checking for new capabilities in the /sys/kernel/capability/{codes,names}/* files when the library wasn't compiled with the latest capabilities. Also update documentation for cap_from_text.3 to be more explicit about how to free a libcap allocated string. (Bug reported by Serge.) Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Fix libcap to build while using more than one make jobChristian Wiese
Fixes build issues while using more than one make job, assuring that cap_names.h is generated before compiling cap_text.c. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Do not hard code toolchain binariesMike Frysinger
If you are cross-compiling, you cannot execute `ar` and `ranlib` on the target library, otherwise things may break. Here we create standard AR and RANLIB variables which can easily be overridden by the environment. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Do not run ldconfig for FAKEROOT installsMike Frysinger
If you're installing into a temporary directory, then running ldconfig will simply waste CPU and I/O time. The install location will not be any path that ldconfig searches, and generally people build as non-root so the ldconfig binary will run for a while before erroring out due to lack of permissions. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Add .gitignore filesMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
2015-09-03Add CAP_NS_OVERRIDE (34).Serge E. Hallyn
Signed-off-by: Andrew G. Morgan <morgan@kernel.org> Signed-off-by: Serge H. Hallyn <sergeh@us.ibm.com>
2015-09-03This is release 2.06.Andrew G. Morgan
Include copy of latest (2.6.24-mm1) capabiity.h file. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>