]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/start.c
lxc-start: exit early and cleanly if we have insufficient privs
[mirror_lxc.git] / src / lxc / start.c
index eb7d01f9b3306de22408ad64fb2524c2697a9970..91ce5fa821771e0a33ceee3337e34ed5306d3c3f 100644 (file)
@@ -319,10 +319,17 @@ out_sigfd:
        return -1;
 }
 
+extern int lxc_caps_check(void);
+
 struct lxc_handler *lxc_init(const char *name, struct lxc_conf *conf)
 {
        struct lxc_handler *handler;
 
+       if (!lxc_caps_check()) {
+               ERROR("Not running with sufficient privilege");
+               return NULL;
+       }
+
        handler = malloc(sizeof(*handler));
        if (!handler)
                return NULL;