]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/conf.c
confile:add lxc.init.cwd
[mirror_lxc.git] / src / lxc / conf.c
index a2b3673a79b8115d29fea4d99e2fee26dc0a373f..8234279f995687a35ed83cebb546f788fa353879 100644 (file)
 
 lxc_log_define(lxc_conf, lxc);
 
-#if HAVE_LIBCAP
-#ifndef CAP_SETFCAP
-#define CAP_SETFCAP 31
-#endif
-
-#ifndef CAP_MAC_OVERRIDE
-#define CAP_MAC_OVERRIDE 32
-#endif
-
-#ifndef CAP_MAC_ADMIN
-#define CAP_MAC_ADMIN 33
-#endif
-#endif
-
-#ifndef PR_CAPBSET_DROP
-#define PR_CAPBSET_DROP 24
-#endif
-
-#ifndef LO_FLAGS_AUTOCLEAR
-#define LO_FLAGS_AUTOCLEAR 4
-#endif
-
-#ifndef CAP_SETUID
-#define CAP_SETUID 7
-#endif
-
-#ifndef CAP_SETGID
-#define CAP_SETGID 6
-#endif
-
-/* needed for cgroup automount checks, regardless of whether we
- * have included linux/capability.h or not */
-#ifndef CAP_SYS_ADMIN
-#define CAP_SYS_ADMIN 21
-#endif
-
 /* Define pivot_root() if missing from the C library */
 #ifndef HAVE_PIVOT_ROOT
 static int pivot_root(const char * new_root, const char * put_old)
@@ -158,19 +122,6 @@ static int pivot_root(const char * new_root, const char * put_old)
 extern int pivot_root(const char * new_root, const char * put_old);
 #endif
 
-/* Define sethostname() if missing from the C library */
-#ifndef HAVE_SETHOSTNAME
-static int sethostname(const char * name, size_t len)
-{
-#ifdef __NR_sethostname
-       return syscall(__NR_sethostname, name, len);
-#else
-       errno = ENOSYS;
-       return -1;
-#endif
-}
-#endif
-
 #ifndef MS_PRIVATE
 #define MS_PRIVATE (1<<18)
 #endif
@@ -2430,9 +2381,11 @@ struct lxc_conf *lxc_conf_init(void)
        new->loglevel = LXC_LOG_LEVEL_NOTSET;
        new->personality = -1;
        new->autodev = 1;
+       new->console.buffer_log_file = NULL;
+       new->console.buffer_log_file_fd = -1;
+       new->console.buffer_size = 0;
        new->console.log_path = NULL;
        new->console.log_fd = -1;
-       new->console.buffer_size = 0;
        new->console.path = NULL;
        new->console.peer = -1;
        new->console.peerpty.busy = -1;
@@ -3461,6 +3414,7 @@ void lxc_conf_free(struct lxc_conf *conf)
                return;
        if (current_config == conf)
                current_config = NULL;
+       free(conf->console.buffer_log_file);
        free(conf->console.log_path);
        free(conf->console.path);
        if (conf->console.buffer_size > 0 && conf->console.ringbuf.addr)
@@ -3478,6 +3432,7 @@ void lxc_conf_free(struct lxc_conf *conf)
        free(conf->rcfile);
        free(conf->execute_cmd);
        free(conf->init_cmd);
+       free(conf->init_cwd);
        free(conf->unexpanded_config);
        free(conf->pty_names);
        free(conf->syslog);