Proper fallback if capability dropping is not available
authorTobias Brunner <tobias@strongswan.org>
Fri, 27 Jul 2012 12:45:15 +0000 (14:45 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 27 Jul 2012 12:46:42 +0000 (14:46 +0200)
src/charon-nm/nm/nm_backend.c
src/libcharon/daemon.c
src/libcharon/plugins/eap_gtc/eap_gtc_plugin.c
src/libstrongswan/utils/capabilities.h

index a9ad9bd..f36cf1f 100644 (file)
@@ -22,7 +22,9 @@
 #include <daemon.h>
 #include <processing/jobs/callback_job.h>
 
+#ifndef CAP_DAC_OVERRIDE
 #define CAP_DAC_OVERRIDE 1
+#endif
 
 typedef struct nm_backend_t nm_backend_t;
 
index ece5aff..612796a 100644 (file)
 #include <kernel/kernel_handler.h>
 #include <processing/jobs/start_action_job.h>
 
+#ifndef CAP_NET_ADMIN
+#define CAP_NET_ADMIN 12
+#endif
+
 typedef struct private_daemon_t private_daemon_t;
 
 /**
index c7fd3b0..df24cfa 100644 (file)
@@ -19,8 +19,9 @@
 
 #include <daemon.h>
 
-/* missing in cababilities.h */
+#ifndef CAP_AUDIT_WRITE
 #define CAP_AUDIT_WRITE 29
+#endif
 
 METHOD(plugin_t, get_name, char*,
        eap_gtc_plugin_t *this)
index df29cd3..cd23cbf 100644 (file)
@@ -24,7 +24,7 @@
 #include <library.h>
 #ifdef HAVE_SYS_CAPABILITY_H
 # include <sys/capability.h>
-#else
+#elif defined(CAPABILITIES_NATIVE)
 # include <linux/capability.h>
 #endif