  	LXC_COMMON_OPTIONS
  };
  
-@@ -56,6 +60,7 @@
+@@ -60,6 +65,7 @@
  static signed long new_personality = -1;
  static int namespace_flags = -1;
  static int remount_sys_proc = 0;

 
 static int my_parser(struct lxc_arguments* args, int c, char* arg)
 {
@@ -76,6 +81,7 @@
 		if (ret)
 			return -1;
 		break;
+	case 't': tty = arg; break;
 	}
 
 	return 0;
@@ -122,6 +128,8 @@
 	struct lxc_handler *handler;
 	uid_t uid;
 	char *curdir;
+	gid_t groups[1] = { 0 };

+		}
+
+		if (setuid(0) != 0) {
+			ERROR("could not set user id: %s", strerror(errno));
+			return -1;
+		}
+
+		if (setgid(0) != 0) {
+			ERROR("could not set group id: %s", strerror(errno));
+			return -1;
+		}
+
+		if (setgroups(1, groups) != 0) {
+			ERROR("could not set groups: %s", strerror(errno));
+			return -1;
+		}
+
+		if (curdir && chdir(curdir))
+			WARN("could not change directory to '%s'", curdir);
+
+		free(curdir);
+
 		if (my_args.argc) {
 			execvp(my_args.argv[0], my_args.argv);
 			SYSERROR("failed to exec '%s'", my_args.argv[0]);
