endif
$(MAKE) -C kafel
+# Sequence of proto deps, which doesn't fit automatic make rules
+config.o: $(SRCS_PB_O) $(SRCS_PB_H)
$(SRCS_PB_O): $(SRCS_PB_CXX) $(SRCS_PB_H)
-
$(SRCS_PB_CXX) $(SRCS_PB_H): $(SRCS_PROTO)
protoc --cpp_out=. $(SRCS_PROTO)
endif
depend:
- makedepend -Y -Ykafel/include -- -- $(SRCS_C) $(SRCS_CXX) $(SRCS_PB)
+ makedepend -Y -Ykafel/include -- -- $(SRCS_C) $(SRCS_CXX) $(SRCS_PB_CXX)
indent:
clang-format --style=WebKit -i -sort-includes *.c *.h $(SRCS_CXX)
util.o: util.h common.h log.h
uts.o: uts.h common.h log.h
cpu.o: cpu.h common.h log.h util.h
-config.o: common.h caps.h config.h log.h mount.h user.h util.h config.pb.h
+config.o: common.h caps.h config.h log.h mount.h user.h util.h
{
char dbgmsg[4096];
+ /* Copy all permitted caps to the inheritable set */
dbgmsg[0] = '\0';
for (size_t i = 0; i < ARRAYSIZE(capNames); i++) {
if (capsGetPermitted(cap_data, capNames[i].val) == true) {
return false;
}
+ /* Make sure the inheritable set is preserved across execve via the ambient set */
dbgmsg[0] = '\0';
for (size_t i = 0; i < ARRAYSIZE(capNames); i++) {
if (capsGetPermitted(cap_data, capNames[i].val) == false) {
if (cap_data == NULL) {
return false;
}
+ /* Let's start with the empty inheritable set to avoid any mistakes */
capsClearInheritable(cap_data);
if (nsjconf->keep_caps) {
char dbgmsg[4096];
dbgmsg[0] = '\0';
+
+ /* Set all requested caps in the inheritable set if these are present in the permitted set */
struct ints_t *p;
TAILQ_FOREACH(p, &nsjconf->caps, pointers) {
if (capsGetPermitted(cap_data, p->val) == false) {
return false;
}
+ /* Make sure inheritable set is preserved across execve via the modified ambient set */
dbgmsg[0] = '\0';
TAILQ_FOREACH(p, &nsjconf->caps, pointers) {
if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_RAISE, (unsigned long)p->val, 0UL, 0UL) ==
}
LOG_D("Added the following capabilities to the ambient set:%s", dbgmsg);
+ /*
+ * Make sure all other caps (those which were not explicitly requested) are removed from the
+ * bounding set
+ */
dbgmsg[0] = '\0';
for (size_t i = 0; i < ARRAYSIZE(capNames); i++) {
if (capsGetInheritable(cap_data, capNames[i].val) == true) {