Permalink
Commits on Feb 9, 2016
  1. fix length check in proc_swaps_read

    hallyn committed Feb 9, 2016
    thanks Nehal for reminding me.
    
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  2. Make reporting of swap and memory dynamic and hopefully more realistic

    hallyn committed Feb 9, 2016
    This is a WIP, do not merge yet.
    
    Closes #68
    
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  3. Don't expand LIBDIR for liblxcfs.so, always use /usr/lib/lxcfs/

    hallyn committed Feb 9, 2016
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  4. Add support for /proc/swaps

    hallyn committed Feb 9, 2016
    Example Output:
    
    [root at lxc-dev <http://lists.linuxcontainers.org/listinfo/lxc-devel>  ~]# lxc-attach -n ubuntuwily --  /bin/cat /proc/swaps
    Filename                                Type            Size    Used    Priority
    none                                    virtual         1048572 1048572 0
    
    Signed-off-by: Teemu Grönqvist <teemu.gronqvist@net9.fi>
    Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  5. Merge pull request #81 from hallyn/2016-02-08/pam

    hallyn committed Feb 9, 2016
    pam_cgfs: change handling of name=systemd
  6. pam_cgfs: change handling of name=systemd

    hallyn committed Feb 9, 2016
    Don't always ignore it.
    
    Do ignore it (like all others) if not listed in the -c argument.
    
    If the logged in task's name=systemd cgroup != that of the init
    task's, assume we are in systemd and rename the user's.
    
    If they are the same, assume we are in upstart or sysvinit and
    create=chown a name=systemd cgroup just as for the others.
    
    This should fix
    
    https://bugs.launchpad.net/ubuntu/+source/lxcfs/+bug/1543353
    
    and allow the ubuntu systemd package to drop its cgroup related
    delta.
    
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  7. Merge pull request #80 from hallyn/2016-02-08/dist

    hallyn committed Feb 9, 2016
    add test_reload.sh to extra_dist
  8. add test_reload.sh to extra_dist

    hallyn committed Feb 9, 2016
    to get it into the make dist tarball
    
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Commits on Feb 8, 2016
  1. Merge pull request #79 from hallyn/2016-02-08/privlib

    hallyn committed Feb 8, 2016
    2016 02 08/privlib
  2. testsuite: handle liblxcfs changes

    hallyn committed Feb 8, 2016
    Since it is no longer automatically built, build liblxcfstest by hand
    and move it into place.
    
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  3. test_reload: actually time out

    hallyn committed Feb 8, 2016
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  4. Look for liblxcfs under LIBDIR/lxcfs

    hallyn committed Feb 8, 2016
    if it was not found using ld.so.
    
    Also use the same function always to load the library.
    
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  5. Makefile: make testlib build optional, and drop the soname

    hallyn committed Feb 8, 2016
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  6. bindings: avoid allocating an unused buffer

    Blub committed with hallyn Feb 5, 2016
    cgfs_list_children() and cgfs_list_keys() follow the same
    pattern with the differences being that one lists
    directories, the other files, and that cgfs_list_children()
    always allocates an empty list while cgfs_list_keys()
    NULL-initializes the list.
    Both have a case which returns an error after a list has
    been allocated, and in both cases the cleanup code is
    guarded with an if(list).
    In both cases on success the caller assumes the list is
    non-empty which is why cgfs_list_children() returned a list
    with a terminating NULL-entry.
    
    This deduplicates the iteration code into a function with a
    flag for whether regular files or directories are of
    interest and a callback to create the list element.
    
    Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
    Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  7. bindings: even more concise must_strcat_pid

    Blub committed with hallyn Feb 5, 2016
    We already assume tmp[] is big enough when using an unsized
    sprintf(), considering it contains a single pid number and
    is 30 bytes we can assume it was also big enough to hold the
    terminating null byte.
    
    Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
    Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  8. bindings: return value type fixup

    Blub committed with hallyn Feb 5, 2016
    Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
    Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Commits on Feb 4, 2016
  1. configure.ac: add -Wno-portability

    hallyn committed Feb 4, 2016
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  2. Merge pull request #76 from hallyn/2016-02-03/pidfile

    hallyn committed Feb 4, 2016
    2016 02 03/pidfile
Commits on Feb 3, 2016
  1. drop glibc travis exceptions - we don't use glibc any more

    hallyn committed Feb 3, 2016
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  2. Add a pidfile

    hallyn committed Feb 3, 2016
    and update testsuite to use pidfile
    
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  3. drop a debugging printf

    hallyn committed Feb 3, 2016
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  4. Merge pull request #75 from hallyn/n

    hallyn committed Feb 3, 2016
    Don't tie entries in 'hierarchies' to their subsystem id
  5. Don't tie entries in 'hierarchies' to their subsystem id

    hallyn committed Feb 3, 2016
    There's no place where we rely on it, and it gets out of whack
    if cgroups have been unmounted+remounted.
    
    This is an alternative to lxc#70.
    Thanks to smemsh for the report and proposed fix.
    
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  6. Merge pull request #74 from hallyn/2016-02-02/split.2

    hallyn committed Feb 3, 2016
    2016 02 02/split.2
  7. Make the bulk of the lxcfs code reloadable

    hallyn committed Feb 1, 2016
    Move the majority of the code (the bits most likely to have security
    bugs coming up) reloadable.  Sending USR1 signal to lxcfs will cause
    it to reload the shared library so as to immediately start using the
    fixed code.  This allows us to upgrade lxcfs in the majority of
    cases without having to restart containers.
    
    To achieve this, some code was moved around so that lxcfs.c itself
    does not risk pinning any symbols from the shared library (which
    would prevent it being unloaded).  We track the number of threads
    currently using the bindings, and do the reload after it hits
    zero (specifically, the next time that we turn the count from 0 to 1)
    
    Also add a test case to make sure an updated library does in fact
    get loaded.
    
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Commits on Feb 2, 2016
  1. Avoid redefinition of ret in local scope

    hallyn committed Feb 1, 2016
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  2. Merge pull request #72 from stgraber/master

    hallyn committed Feb 2, 2016
    Don't hardcode strings in testsuites
  3. Don't hardcode strings in testsuites

    stgraber committed Feb 2, 2016
    With this, we should be able to run more than one testsuite at once.
    
    Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Commits on Jan 29, 2016
  1. Merge pull request #69 from sforshee/fixes

    hallyn committed Jan 29, 2016
    Random fixes
Commits on Jan 28, 2016
  1. Remove unused chunks in caching code

    Seth Forshee committed Jan 28, 2016
    Several pieces of code which deal with caching contents for proc
    files contain code like this:
    
      if (l >= cache_size) {
          ...
          goto err;
      }
      if (l < cache_size) {
          ...
      } else {
          ...
      }
    
    When the first condition is false the second condition will
    always be true, so the code in the else block is never used.
    The second if/else statement can then just be replaced with the
    code from the if block.
    
    Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
  2. Avoid theoretical underflow in prune_init_{slice,scope}

    Seth Forshee committed Jan 28, 2016
    In practice these should never underflow, but in theory it's possible.
    
    Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
  3. tests: update to handle lxcfs virtualizing based on init

    hallyn committed Jan 28, 2016
    lxcfs used to use $current's cgroups to virtualize proc, but
    switched in 0.17 to using $current's init's cgroups.  The
    tests need to be updated to reflect that.
    
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Commits on Jan 27, 2016
  1. mkdir_p: check for null not \0, and fail if enomem

    hallyn committed Jan 27, 2016
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  2. pam: free path when pruning

    hallyn committed Jan 27, 2016
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  3. pam: detect write failure in write_int()

    hallyn committed Jan 27, 2016
    Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>