1. 05 Apr, 2014 1 commit
    • lxc_spawn: initialize netpipe · 2f2623ec
      Serge Hallyn authored
      When rebooting an unprivileged container, netpipe starts out
      as not -1.  If count_veths somehow changed this could lead
      to trying to send data over nonexistent pipe.  (Ok can't
      *really* happen, as it currently stands, but it's an open
      end)
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
  2. 04 Apr, 2014 9 commits
  3. 03 Apr, 2014 1 commit
    • fix lxc-info printing duplicate lines · e2426f0b
      Dwight Engen authored
      When lxc-info's stdout is not line buffered (ie. "lxc-info -n foo |more")
      the first three lines will be duplicated. This is because c->get_ips()
      comes next and it forks and the child will exit() causing its fds to be
      closed which flushes out its (fork duplicated) stdio buffers. The lines are
      then duplicated when the parent actually gets around to flushing out its
      stdio. This causes problems for programs (such as the lxc-webpanel) which
      are popen()ing lxc-info.
      
      The fix here isn't necessarily the right one, but does show what the
      problem is. Seems like maybe we should fix this inside of get_ips(), for
      other API callers as well.
      Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com>
      Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
  4. 02 Apr, 2014 6 commits
  5. 01 Apr, 2014 5 commits
  6. 31 Mar, 2014 2 commits
  7. 29 Mar, 2014 2 commits
  8. 27 Mar, 2014 2 commits
  9. 26 Mar, 2014 1 commit
  10. 25 Mar, 2014 1 commit
  11. 24 Mar, 2014 4 commits
  12. 23 Mar, 2014 4 commits
  13. 21 Mar, 2014 2 commits
    • fix console stdin,stdout,stderr fds · 0d9acb99
      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>