aboutsummaryrefslogtreecommitdiff
path: root/libcap
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2011-07-24 19:17:25 -0700
committerJorge Lucangeli Obes <jorgelo@google.com>2015-09-03 14:13:03 -0700
commit083c4ead193d5e1cf799cd524fc72a4d31e71a77 (patch)
tree8c11ec9f583b41f39648a0b0bf92d04797fdf8e9 /libcap
parent50b0098705cc64f607ad426f3623d81ead17128d (diff)
downloadlibcap-083c4ead193d5e1cf799cd524fc72a4d31e71a77.tar.gz
Change directory to "/" after --chroot operation.
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>
Diffstat (limited to 'libcap')
-rw-r--r--libcap/cap_proc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libcap/cap_proc.c b/libcap/cap_proc.c
index 6040c02..8ecb57a 100644
--- a/libcap/cap_proc.c
+++ b/libcap/cap_proc.c
@@ -4,6 +4,8 @@
* This file deals with getting and setting capabilities on processes.
*/
+#include <sys/prctl.h>
+
#include "libcap.h"
cap_t cap_get_proc(void)