capabilities: Some plugins don't actually require capabilities at runtime
[strongswan.git] / src / libcharon / plugins / stroke / stroke_plugin.c
index 4e47a12..767bdc6 100644 (file)
@@ -91,6 +91,12 @@ plugin_t *stroke_plugin_create()
 {
        private_stroke_plugin_t *this;
 
+       if (!lib->caps->check(lib->caps, CAP_CHOWN))
+       {       /* required to chown(2) stroke socket */
+               DBG1(DBG_CFG, "stroke plugin requires CAP_CHOWN capability");
+               return NULL;
+       }
+
        INIT(this,
                .public = {
                        .plugin = {