]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_init: set the control terminal in the child session
authorJonathan Calmels <jcalmels@nvidia.com>
Tue, 21 Nov 2017 01:30:45 +0000 (17:30 -0800)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 15 Dec 2017 11:14:55 +0000 (12:14 +0100)
Signed-off-by: Jonathan Calmels <jcalmels@nvidia.com>
src/lxc/tools/lxc_init.c

index 3aab2397e4bca072e13b4f1c658b046f85cebec6..c8a5e35b09d66c85adf069ce717452d0de34f43d 100644 (file)
@@ -193,7 +193,10 @@ int main(int argc, char *argv[])
                if (sid < 0)
                        DEBUG("Failed to make child session leader");
 
-               NOTICE("About to exec '%s'", aargv[0]);
+                if (ioctl(STDIN_FILENO, TIOCSCTTY, 0) < 0)
+                        DEBUG("Failed to set controlling terminal");
+
+               NOTICE("Exec'ing \"%s\"", aargv[0]);
 
                ret = execvp(aargv[0], aargv);
                ERROR("Failed to exec: '%s' : %s", aargv[0], strerror(errno));