1. 07 Apr, 2014 3 commits
  2. 04 Apr, 2014 14 commits
  3. 01 Apr, 2014 11 commits
  4. 27 Mar, 2014 1 commit
  5. 26 Mar, 2014 1 commit
  6. 25 Mar, 2014 1 commit
  7. 24 Mar, 2014 4 commits
  8. 23 Mar, 2014 3 commits
  9. 21 Mar, 2014 2 commits
    • fix console stdin,stdout,stderr fds · 6d37caf0
      Dwight Engen authored
      The fds for stdin,stdout,stderr that we were leaving open for /sbin/init
      in the container were those from /dev/tty or lxc.console (if given), which
      wasn't right. Inside the container it should only have access to the pty
      that lxc creates representing the console.
      
      This was noticed because busybox's init was resetting the termio on its
      stdin which was effecting the actual users terminal instead of the pty.
      This meant it was setting icanon so were were not passing keystrokes
      immediately to the pty, and hence command line history/editing wasn't
      working.
      
      Fix by dup'ing the console pty to stdin,stdout,stderr just before
      exec()ing /sbin/init. Fix fd leak in error handling that I noticed while
      going through this code.
      
      Also tested with lxc.console = none, lxc.console = /dev/tty7 and no
      lxc.console specified.
      
      V2: The first version was getting EBADF sometimes on dup2() because
      lxc_console_set_stdfds() was being called after lxc_check_inherited()
      had already closed the fds for the pty. Fix by calling
      lxc_check_inherited() as late as possible which also extends coverage
      of open fd checked code.
      
      V3: Don't move lxc_check_inherited() since it needs to be called while
      the tmp proc mount is still mounted. Move call to lxc_console_set_stdfds()
      just before it.
      Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com>
      Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>