capabilities: CAP_CHOWN might be required by many plugins opening UNIX sockets
[strongswan.git] / src / libcharon / plugins / error_notify / error_notify_plugin.c
index a1e4351..48b3d94 100644 (file)
@@ -92,6 +92,12 @@ plugin_t *error_notify_plugin_create()
 {
        private_error_notify_plugin_t *this;
 
+       if (!lib->caps->keep(lib->caps, CAP_CHOWN))
+       {       /* required to chown(2) notify socket */
+               DBG1(DBG_CFG, "error-notify plugin requires CAP_CHOWN capability");
+               return NULL;
+       }
+
        INIT(this,
                .public = {
                        .plugin = {