if (ret)
return ret;
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
ret = lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]);
if (ret)
if (lxc_arguments_parse(&my_args, argc, argv))
return -1;
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]))
return -1;
c = lxc_container_new(my_args.name, my_args.lxcpath[0]);
if (!c)
return -1;
+
+ if (!c->may_control(c)) {
+ ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name);
+ return -1;
+ }
+
if (!c->is_running(c)) {
ERROR("'%s:%s' is not running", my_args.lxcpath[0], my_args.name);
lxc_container_put(c);
if (ret)
return ret;
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
ret = lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]);
if (ret)
c1 = lxc_container_new(orig, lxcpath);
if (!c1)
exit(1);
+
+ if (!c1->may_control(c1)) {
+ fprintf(stderr, "Insufficent privileges to control %s\n", orig);
+ return -1;
+ }
+
if (!c1->is_defined(c1)) {
fprintf(stderr, "Error: container %s is not defined\n", orig);
lxc_container_put(c1);
if (ret)
return EXIT_FAILURE;
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
ret = lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]);
if (ret)
exit(EXIT_FAILURE);
}
+ if (!c->may_control(c)) {
+ fprintf(stderr, "Insufficent privileges to control %s\n", my_args.name);
+ return -1;
+ }
+
if (!c->is_running(c)) {
fprintf(stderr, "%s is not running\n", my_args.name);
exit(EXIT_FAILURE);
if (lxc_arguments_parse(&my_args, argc, argv))
exit(1);
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]))
exit(1);
if (lxc_arguments_parse(&my_args, argc, argv))
exit(1);
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]))
exit(1);
exit(1);
}
+ if (!c->may_control(c)) {
+ fprintf(stderr, "Insufficent privileges to control %s\n", my_args.name);
+ return -1;
+ }
+
if (!c->is_defined(c)) {
fprintf(stderr, "Container is not defined\n");
lxc_container_put(c);
if (lxc_arguments_parse(&my_args, argc, argv))
exit(1);
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]))
exit(1);
exit(1);
}
+ if (!c->may_control(c)) {
+ ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name);
+ return -1;
+ }
+
if (!c->freeze(c)) {
ERROR("Failed to freeze %s:%s", my_args.lxcpath[0], my_args.name);
lxc_container_put(c);
if (lxc_arguments_parse(&my_args, argc, argv))
return -1;
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]))
return -1;
if (!c)
return -1;
+ if (!c->may_control(c)) {
+ fprintf(stderr, "Insufficent privileges to control %s\n", c->name);
+ return -1;
+ }
+
if (!state && !pid && !ips && keys <= 0)
state = pid = ips = true;
if (ret)
return ret;
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
ret = lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]);
if (ret)
if (lxc_arguments_parse(&my_args, argc, argv))
return -1;
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]))
return -1;
if (lxc_arguments_parse(&my_args, argc, argv))
exit(1);
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
if (my_args.argc > 1) {
ERROR("Too many arguments");
return -1;
exit(1);
}
+ if (!c->may_control(c)) {
+ fprintf(stderr, "Insufficent privileges to control %s\n", my_args.name);
+ return -1;
+ }
+
switch(action) {
case DO_SNAP:
ret = do_snapshot(c);
goto out;
}
+ if (!c->may_control(c)) {
+ fprintf(stderr, "Insufficent privileges to control %s\n", c->name);
+ goto out;
+ }
+
if (!c->is_running(c)) {
fprintf(stderr, "%s is not running\n", c->name);
ret = 2;
if (lxc_arguments_parse(&my_args, argc, argv))
exit(1);
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]))
exit(1);
exit(1);
}
+ if (!c->may_control(c)) {
+ ERROR("Insufficent privileges to control %s:%s", my_args.lxcpath[0], my_args.name);
+ return -1;
+ }
+
if (!c->unfreeze(c)) {
ERROR("Failed to unfreeze %s:%s", my_args.lxcpath[0], my_args.name);
lxc_container_put(c);
if (lxc_arguments_parse(&my_args, argc, argv))
return -1;
+ if (!my_args.log_file)
+ my_args.log_file = "none";
+
if (lxc_log_init(my_args.name, my_args.log_file, my_args.log_priority,
my_args.progname, my_args.quiet, my_args.lxcpath[0]))
return -1;
if (!c)
return -1;
+ if (!c->may_control(c)) {
+ fprintf(stderr, "Insufficent privileges to control %s\n", c->name);
+ return -1;
+ }
+
if (!c->wait(c, my_args.states, my_args.timeout)) {
lxc_container_put(c);
return -1;