Clear env before starting a container. Do it right before setting
the container=lxc variable.
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
my_args.progname, my_args.quiet))
return err;
+ if (clearenv()) {
+ SYSERROR("failed to clear environment");
+ /* don't error out though */
+ }
if (putenv("container=lxc")) {
SYSERROR("failed to set environment variable");
return err;
setsid();
}
+ if (clearenv()) {
+ SYSERROR("failed to clear environment");
+ /* don't error out though */
+ }
+
if (putenv("container=lxc")) {
fprintf(stderr, "failed to set environment variable");
if (daemonize) {