]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
8 years agoAdd SOCK_CLOEXEC define for Android
Stéphane Graber [Fri, 29 Jan 2016 12:35:47 +0000 (13:35 +0100)]
Add SOCK_CLOEXEC define for Android

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #779 from hiraku/fix-centos-template-uppercase
Stéphane Graber [Fri, 29 Jan 2016 09:09:49 +0000 (10:09 +0100)]
Merge pull request #779 from hiraku/fix-centos-template-uppercase

Use ${utsname} instead of ${UTSNAME} because latter variable is not defined

8 years agoUse ${utsname} instead of ${UTSNAME} because latter variable is not defined.
KURODA Hiraku [Fri, 29 Jan 2016 08:29:38 +0000 (17:29 +0900)]
Use ${utsname} instead of ${UTSNAME} because latter variable is not defined.

Signed-off-by: KURODA Hiraku <kuroda@syngram.co.jp>
8 years agoMerge pull request #740 from kvaidas/master
Stéphane Graber [Fri, 29 Jan 2016 08:55:22 +0000 (09:55 +0100)]
Merge pull request #740 from kvaidas/master

Template parameter --variant tells debootstrap which variant to use.

8 years agoMerge pull request #772 from nehaljwani/fix-fedora-template-stmt
Stéphane Graber [Fri, 29 Jan 2016 08:44:13 +0000 (09:44 +0100)]
Merge pull request #772 from nehaljwani/fix-fedora-template-stmt

Fix echo statement inside fedora template

8 years agoMerge pull request #773 from nehaljwani/fix-lxc-create-report
Stéphane Graber [Fri, 29 Jan 2016 08:43:55 +0000 (09:43 +0100)]
Merge pull request #773 from nehaljwani/fix-lxc-create-report

Fix message after {fedora|centos}container creation

8 years agoMerge pull request #774 from Nicop06/patch-1
Stéphane Graber [Fri, 29 Jan 2016 08:37:52 +0000 (09:37 +0100)]
Merge pull request #774 from Nicop06/patch-1

Fix typo in lxc-archlinux.in

8 years agoMerge pull request #778 from hallyn/2016-01-28/usernic
Stéphane Graber [Fri, 29 Jan 2016 08:37:15 +0000 (09:37 +0100)]
Merge pull request #778 from hallyn/2016-01-28/usernic

lxc-test-usernic: update to reflect new lxc-test-usernic arguments

8 years agoFix echo statement inside fedora template
Nehal J Wani [Thu, 21 Jan 2016 19:05:27 +0000 (00:35 +0530)]
Fix echo statement inside fedora template

We no longer use mirrors.kernel.org.
Commit f71e8f4 switched it to archives.fedoraproject.org

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
8 years agoFix message after {fedora|centos}container creation
Nehal J Wani [Thu, 21 Jan 2016 21:06:33 +0000 (02:36 +0530)]
Fix message after {fedora|centos}container creation

If the backingstore is not 'dir', then lxc shouldn't ask the user
to change the password by performing a 'chroot'. Rather, the user
should start, attach, use the passwd command, and then stop the
container.

Fixes #731

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
8 years agolxc-test-usernic: update to reflect new lxc-test-usernic arguments
Serge Hallyn [Thu, 28 Jan 2016 17:08:50 +0000 (18:08 +0100)]
lxc-test-usernic: update to reflect new lxc-test-usernic arguments

the new lxcpath and lxcname are not optional

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoFix Android build of lxc-ls
Stéphane Graber [Thu, 28 Jan 2016 16:08:36 +0000 (17:08 +0100)]
Fix Android build of lxc-ls

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agofork off a task to delete ovs ports when done
Serge Hallyn [Thu, 14 Jan 2016 07:48:57 +0000 (07:48 +0000)]
fork off a task to delete ovs ports when done

The new task waits until the container is STOPPED, then asks
openvswitch to delete the port.

This requires two new arguements to be sent to lxc-user-nic.
Since lxc-user-nic ships with lxc, this shouldn't be a problem.

Finally when calling lxc-user-nic, use execlp insteac of execvp
to preserve lxcpath's const-ness.  Technically we are
guaranteed that execvp won't change the args, but it's worth
it to silence the warnings (and not hide real errors).

With this patch, container nics are cleaned up from openvswitch
bridges on shutdown.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoFix Android build failure
Stéphane Graber [Thu, 28 Jan 2016 13:53:26 +0000 (14:53 +0100)]
Fix Android build failure

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agolxc-ls: tweak algorithm for ls_has_all_grps()
Christian Brauner [Thu, 28 Jan 2016 11:21:30 +0000 (12:21 +0100)]
lxc-ls: tweak algorithm for ls_has_all_grps()

- With the -g/--groups argument the user can give a comma-separated list of
  groups MUST a container must have in order to be displayed. We receive
  this list as a single string. ls_has_all_grps() is called to check if a
  container has all the groups of MUST in its current list of groups HAS. I.e.
  we determine whether MUST ⊆ HAS and only then do we record the container.
  The original implementation was dumb in that it split the string MUST
  everytime it needed to check whether MUST ⊆ HAS for a given container. That's
  pointless work. Instead we split the string MUST only once in main() and pass
  it to ls_get() which passes it along to ls_has_all_grps().
- Before doing any costly checking make sure that #MUST <= #HAS. If not bail
  immediately.
- The linear search algorithm ls_has_all_grps() currently uses stays for now.
  Binary search et al. do not seem to make sense since sorting the array HAS
  for each container is probably too costly. Especially, since it seems
  unlikely that a users specifies 50+ or so groups on the command line a
  container must have to be displayed. If however there are a lot of use-cases
  where users have a lot of containers each with 50-100 groups and regularly use
  lxc-ls with -g/--groups to only show containers that have 50 specified groups
  among their 50-100 groups we can revisit this issue and implement e.g. binary
  search or a ternary search tree.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoRestore old behaviour [filter] behaviour
Christian Brauner [Thu, 28 Jan 2016 11:21:29 +0000 (12:21 +0100)]
Restore old behaviour [filter] behaviour

In the Python implementation users could pass a regex without a parameter flag
as additional argument on the command line. The C implementation gained the
flag -r/--regex for this. To not irritate users we restore the old behaviour
and additionally rename -r/--regex to --filter to allow eplicitly passing the
regex.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agolxc-ls: check for ENOMEM and tweaking
Christian Brauner [Thu, 28 Jan 2016 11:21:28 +0000 (12:21 +0100)]
lxc-ls: check for ENOMEM and tweaking

- If lxc_container_new() fails we check for ENOMEM and if so goto out. If
  ENOMEM is not set we will simply continue. The same goes for the call to
  regcomp() but instead of checking for ENOMEM we need to check for REG_ESPACE.

- Tweaking: Since lxc-ls might have to gather a lot of containers and I don't
  know if compilers will always optimize this let's move *some* variable
  declarations outside of the loop when it does not hinder readability

- Set ls_nesting to 0 initially. Otherwise users will always see nested
  containers printed.

- ls_get() gains an argument char **lockpath which is a string pointing us to
  the lock we put under /run/lxc/lock/.../... so that we can remove the lock
  when we no longer need it. To avoid pointless memory allocation in each new
  recursion level we share lockpath amongst all non-fork()ing recursive call to
  ls_get().  As it is not guaranteed that realloc() does not do any memory
  moving when newlen == len_lockpath, we give ls_get() an additional argument
  size_t len_lockpath). Every time we have a non-fork()ing recursive call to
  ls_get() we check if newlen > len_lockpath and only then do we
  realloc(*lockpath, newlen * 2) a reasonable chunk of memory (as the path will
  keep growing) and set len_lockpath = newlen * 2 to pass to the next
  non-fork()ing recursive call to ls_get().
  To avoid keeping a variable char *lockpath in main() which serves no purpose
  whatsoever and might be abused later we use a compound literal
  &(char *){NULL} which gives us an anonymous pointer which we can use for
  memory allocation in ls_get() for lockpath. We can conveniently free() it in
  ls_get() when the nesting level parameter lvl == 0 after exiting the loop.
  The advantage is that the variable is only accessible within ls_get() and not
  in main() while at the same time giving us an easy way to share lockpath
  amongst all non-fork()ing recursive calls to ls_get().

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoRevert "lxc-ls: check for ENOMEM and tweaking"
Stéphane Graber [Thu, 28 Jan 2016 11:33:00 +0000 (12:33 +0100)]
Revert "lxc-ls: check for ENOMEM and tweaking"

This reverts commit 7f3c1cf27f1fcd29b5e7f0b11e4aadfadd5f18ec.

8 years agoRevert "lxc-ls: Restore old [filter] behaviour"
Stéphane Graber [Thu, 28 Jan 2016 11:32:56 +0000 (12:32 +0100)]
Revert "lxc-ls: Restore old [filter] behaviour"

This reverts commit e4434e0fc99631036b1fdabe7216e0a1218f4f3f.

8 years agolxc-ls: Restore old [filter] behaviour
Christian Brauner [Wed, 20 Jan 2016 00:54:45 +0000 (01:54 +0100)]
lxc-ls: Restore old [filter] behaviour

In the Python implementation users could pass a regex without a parameter flag
as additional argument on the command line. The C implementation gained the
flag -r/--regex for this. To not irritate users we restore the old behaviour
and additionally rename -r/--regex to --filter to allow eplicitly passing the
regex.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agolxc-ls: check for ENOMEM and tweaking
Christian Brauner [Sat, 16 Jan 2016 23:18:26 +0000 (00:18 +0100)]
lxc-ls: check for ENOMEM and tweaking

- If lxc_container_new() fails we check for ENOMEM and if so goto out. If
  ENOMEM is not set we will simply continue. The same goes for the call to
  regcomp() but instead of checking for ENOMEM we need to check for REG_ESPACE.

- Tweaking: Since lxc-ls might have to gather a lot of containers and I don't
  know if compilers will always optimize this, let's move *some* variable
  declarations outside of the loop when it does not hinder readability.

- Set ls_nesting to 0 initially. Otherwise users will always see nested
  containers printed.

- ls_get() gains an argument char **lockpath which is a string pointing us to
  the lock we put under /run/lxc/lock/.../... so that we can remove the lock
  when we no longer need it. To avoid pointless memory allocation in each new
  recursion level, we share lockpath amongst all non-fork()ing recursive calls
  to ls_get().  As it is not guaranteed that realloc() does not do any memory
  moving when newlen == len_lockpath, we give ls_get() an additional argument
  size_t len_lockpath). Every time we have a non-fork()ing recursive call to
  ls_get() we check if newlen > len_lockpath and only then do we
  realloc(*lockpath, newlen * 2) a reasonable chunk of memory (as the path will
  keep growing) and set len_lockpath = newlen * 2 to pass to the next
  non-fork()ing recursive call to ls_get().
  To avoid keeping a variable char *lockpath in main() which serves no purpose
  whatsoever and might be abused later we use a compound literal
  &(char *){NULL} which gives us an anonymous pointer. This pointer we can use
  for memory allocation in ls_get() for lockpath. We can conveniently free() it
  in ls_get() when the nesting level parameter lvl == 0 after exiting the loop.
  The advantage is that the variable is only accessible within ls_get() and not
  in main() while at the same time giving us an easy way to share lockpath
  amongst all non-fork()ing recursive calls to ls_get().

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoupdate overlayfs and aufs in lxc.container.conf
Christian Brauner [Sat, 23 Jan 2016 23:21:54 +0000 (00:21 +0100)]
update overlayfs and aufs in lxc.container.conf

Explain that multiple /lower layers can be used.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoaufs: support multiple lower layers
Christian Brauner [Sat, 23 Jan 2016 23:17:36 +0000 (00:17 +0100)]
aufs: support multiple lower layers

Do it in a safe way by using strstr() to check for the substring ":/" should
':' be part of a pathname.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agolxc.rootfs: support multiple lower layers
Christian Brauner [Wed, 20 Jan 2016 00:02:59 +0000 (01:02 +0100)]
lxc.rootfs: support multiple lower layers

Do it in a safe way by using strstr() to check for the substring ":/" should
':' be part of a pathname. This should be a safer implementation than the one
originally suggested in #547.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agomount_proc_if_needed: only safe mount when rootfs is defined
Bogdan Purcareata [Wed, 20 Jan 2016 10:53:57 +0000 (10:53 +0000)]
mount_proc_if_needed: only safe mount when rootfs is defined

The safe_mount function was introduced in order to address CVE-2015-1335,
one of the vulnerabilities being a mount with a symlink for the
destination path. In scenarios such as lxc-execute with no rootfs, the
destination path is the host /proc, which is previously mounted by the
host, and is unmounted and mounted again in a new set of namespaces,
therefore eliminating the need to check for it being a symlink.

Mount the rootfs normally if the rootfs is NULL, keep the safe mount
only for scenarios where a different rootfs is defined.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoAdapt manpage for lxc-ls to new C implementation
Christian Brauner [Wed, 20 Jan 2016 01:11:00 +0000 (02:11 +0100)]
Adapt manpage for lxc-ls to new C implementation

- explain new numeric argument to --nesting
- include common options as lxc-ls now uses the standard lxc parser
- add history section and update authors

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agocleanup: lxc_container::want_* comment descriptions
Wolfgang Bumiller [Thu, 14 Jan 2016 13:30:20 +0000 (14:30 +0100)]
cleanup: lxc_container::want_* comment descriptions

They change a value and return true on success rather than
fetching the value as the comments previously suggested.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agolxc-ls: set ls_nesting to 0 initially
Christian Brauner [Fri, 15 Jan 2016 18:57:39 +0000 (19:57 +0100)]
lxc-ls: set ls_nesting to 0 initially

Otherwise users will always get nested containers listed.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoFix btrfs bus error on sparc on snapshot delete
Thomas Tanaka [Thu, 14 Jan 2016 22:42:31 +0000 (14:42 -0800)]
Fix btrfs bus error on sparc on snapshot delete

The following patch fixes memory alignment and endianness
issue while doing a snapshot deletion with btrfs as a
backing store on platform such as sparc.

The implementation is taken from btrfs-progs.

Changes since v1:
- include <byteswap.h> for bswap definition
- include defined function name as a comment above BTRFS_SETGET_STACK_FUNCS

Signed-off-by: Thomas Tanaka <thomas.tanaka@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agocheck for btrfs fs in should_default_to_snapshot
Christian Brauner [Thu, 14 Jan 2016 20:39:05 +0000 (21:39 +0100)]
check for btrfs fs in should_default_to_snapshot

Check if we're really on a btrfs filesystem before we call btrfs_same_fs().
Otherwise we will report misleading errors although everything went fine.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoadd lxc-copy to see_also.sgml.in
Christian Brauner [Thu, 14 Jan 2016 19:36:33 +0000 (20:36 +0100)]
add lxc-copy to see_also.sgml.in

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agolxc-ls: try to protect stack in recursive function
Christian Brauner [Wed, 13 Jan 2016 20:23:00 +0000 (21:23 +0100)]
lxc-ls: try to protect stack in recursive function

As ls_get() is non-tail recursive we face the inherent danger of blowing up the
stack at some level of nesting. To have at least some security we define
MAX_NESTLVL to be 5. That should be sufficient for most users. The argument lvl
to ls_get() can be used to keep track of the level of nesting we are at. If lvl
is greater than the allowed default level return (without error) and unwind the
stack.

--nesting gains an optional numeric argument. This allows the user to specify
the maximum level of nesting she/he wants to see. Fair warning: If your nesting
level is really deep and/or you have a lot of containers your might run into
trouble.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agocgmanager: don't make tasks + cgroup.procs +x
Tycho Andersen [Wed, 13 Jan 2016 07:59:59 +0000 (00:59 -0700)]
cgmanager: don't make tasks + cgroup.procs +x

No reason for these to be +x, and it looks weird.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agolxc_setup_fs: Create /dev/shm folder if it doesn't exist
Bogdan Purcareata [Fri, 8 Jan 2016 15:38:44 +0000 (15:38 +0000)]
lxc_setup_fs: Create /dev/shm folder if it doesn't exist

When running application containers with lxc-execute, /dev is
populated only with device entries. Since /dev is a tmpfs mount in
the container environment, the /dev/shm folder not being present is not
a sufficient reason for the /dev/shm mount to fail.

Create the /dev/shm directory if not present.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoopen_without_symlink: Account when prefix is empty string
Bogdan Purcareata [Fri, 8 Jan 2016 15:38:35 +0000 (15:38 +0000)]
open_without_symlink: Account when prefix is empty string

In the current implementation, the open_without_symlink function
will default to opening the root mount only if the passed rootfs
prefix is null. It doesn't account for the case where this prefix
is passed as an empty string.

Properly handle this second case as well.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoDocument network clear option
Marko Hauptvogel [Mon, 4 Jan 2016 21:58:41 +0000 (22:58 +0100)]
Document network clear option

Should be mentioned separately because it will reset a big group of options.

Signed-off-by: Marko Hauptvogel <marko.hauptvogel@googlemail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agofix lockpath removal in Python lxc-ls
Christian Brauner [Mon, 11 Jan 2016 13:43:42 +0000 (14:43 +0100)]
fix lockpath removal in Python lxc-ls

The lock path for lxc is not

RUNTIME_PATH/lock/lxc

but rather

RUNTIME_PATH/lxc/lock

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoDocument clear behaviour of list options
Marko Hauptvogel [Mon, 4 Jan 2016 21:57:38 +0000 (22:57 +0100)]
Document clear behaviour of list options

More general for all list options.

Seems to currently affect:
lxc.network (clear all NICs)
lxc.network.* (clear current NIC)
lxc.cap.drop
lxc.cap.keep
lxc.cgroup
lxc.mount.entry
lxc.mount.auto
lxc.hook
lxc.id_map
lxc.group
lxc.environment

Signed-off-by: Marko Hauptvogel <marko.hauptvogel@googlemail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agodoc: Add valueless lxc.cap.drop behaviour to Japanese man page
KATOH Yasufumi [Tue, 5 Jan 2016 07:31:46 +0000 (16:31 +0900)]
doc: Add valueless lxc.cap.drop behaviour to Japanese man page

Update for commit 7eff30f

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agodoc: Add LXC_SRC_NAME to Korean lxc.container.conf(5)
Sungbae Yoo [Tue, 5 Jan 2016 03:07:09 +0000 (03:07 +0000)]
doc: Add LXC_SRC_NAME to Korean lxc.container.conf(5)

Update for commit 0794541

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoFix typo in lxc-archlinux.in
Nicolas Porcel [Sat, 23 Jan 2016 15:13:46 +0000 (16:13 +0100)]
Fix typo in lxc-archlinux.in

Thank you vim!

Signed-off-by: Nicolas Porcel <nicolasporcel06@gmail.com>
8 years agoFix android build
Stéphane Graber [Wed, 20 Jan 2016 19:12:16 +0000 (14:12 -0500)]
Fix android build

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoUpdate lxc-ubuntu.in
Vaidas Kascėnas [Wed, 20 Jan 2016 15:20:39 +0000 (17:20 +0200)]
Update lxc-ubuntu.in

Updated as per request in #740

Signed-off-by: Vaidas Kascėnas vaidas@kascenas.lt
8 years agoMerge pull request #771 from bostjan/refactor/gitignore-templates-wildcard
Stéphane Graber [Wed, 20 Jan 2016 15:03:36 +0000 (10:03 -0500)]
Merge pull request #771 from bostjan/refactor/gitignore-templates-wildcard

Refactor templates section of .gitignore - no need to specify individual templates anymore

8 years agoMerge pull request #770 from bostjan/bugfix/gitignore-templates-sparclinux
Stéphane Graber [Wed, 20 Jan 2016 15:03:13 +0000 (10:03 -0500)]
Merge pull request #770 from bostjan/bugfix/gitignore-templates-sparclinux

.gitignore: add missing templates/sparclinux to ignore list

8 years agoMerge pull request #769 from nehaljwani/patch-1
Stéphane Graber [Wed, 20 Jan 2016 15:02:48 +0000 (10:02 -0500)]
Merge pull request #769 from nehaljwani/patch-1

Fix Comment inside Fedora Template

8 years agoRefactor .gitignore section for templates/* - no need to specifiy individual template...
Bostjan Skufca [Wed, 20 Jan 2016 14:20:56 +0000 (14:20 +0000)]
Refactor .gitignore section for templates/* - no need to specifiy individual templates anymore

Signed-off-by: Bostjan Skufca <bostjan@a2o.si>
8 years ago.gitignore: add templates/sparclinux to ignore list
Bostjan Skufca [Wed, 20 Jan 2016 14:15:20 +0000 (14:15 +0000)]
.gitignore: add templates/sparclinux to ignore list

Signed-off-by: Bostjan Skufca <bostjan@a2o.si>
8 years agoFix Comment inside Fedora Template
Nehal J Wani [Tue, 19 Jan 2016 18:51:13 +0000 (00:21 +0530)]
Fix Comment inside Fedora Template

We no longer use mirrors.kernel.org.
Commit f71e8f4 switched it to archives.fedoraproject.org

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
8 years agoavoid printing null string in error message
Serge Hallyn [Thu, 14 Jan 2016 23:07:31 +0000 (15:07 -0800)]
avoid printing null string in error message

Show the ifindex in case it's useful

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #757 from tsdmgz/opensuse-template
Serge Hallyn [Thu, 14 Jan 2016 07:42:07 +0000 (23:42 -0800)]
Merge pull request #757 from tsdmgz/opensuse-template

Add openSUSE Leap release in opensuse template

8 years agocgmanager: drop possibly expected failures to a WARN
Serge Hallyn [Wed, 13 Jan 2016 23:17:50 +0000 (15:17 -0800)]
cgmanager: drop possibly expected failures to a WARN

Otherwise every lxc-info by a user who doesn't own all his cgroups
will result in a set of error messages which are really innocuous.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgmanager: drop the cgm_supports_multiple_controllers bool
Serge Hallyn [Wed, 13 Jan 2016 18:05:18 +0000 (10:05 -0800)]
cgmanager: drop the cgm_supports_multiple_controllers bool

What we want is to make sure we dont' use controller 'all' if cgmanager
doesn't support, if all our cgroups aren't the same, or if we cannot
controll all our cgroups.  We were mixing some of these conditions.  Use
cgm_all_controllers_same for all.  (Might want to rename it, but we want
to stick with just one).

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #748 from brauner/2015-01-01/lxc_ls
Serge Hallyn [Wed, 13 Jan 2016 17:33:10 +0000 (09:33 -0800)]
Merge pull request #748 from brauner/2015-01-01/lxc_ls

Reimplement lxc-ls in C

8 years agocgmanager - fix (again) previous commit
Serge Hallyn [Wed, 13 Jan 2016 17:26:43 +0000 (09:26 -0800)]
cgmanager - fix (again) previous commit

Bad late-night commit.  We were doing a while loop for a reason.  Just
initialize i to 0 before the while loop.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoreimplement lxc-ls in C
Christian Brauner [Mon, 14 Dec 2015 20:25:10 +0000 (21:25 +0100)]
reimplement lxc-ls in C

This is a reimplementation of lxc-ls in C. It supports all features previously
supported by lxc-ls.

- All flags and parameters have the same name as before except when the user
  specifies a regex to filter container names by. In the previous Python
  implementation the regex was passed without paramter flag. The new
  C-implementation has the parameter flag -r/--regex for this.

- Since we fork in lxc_attach() we need some form of IPC. Opening shared memory
  in the parent (mmap()) seems to be impractical since we don't know the size
  of the mapping beforehand. The other option is to open shared memory in the
  child and then to attach the parent to it but then we would need to resort to
  shm_open() or shmget(). Instead we go for a socketpair() here and wait for
  the child.
- Note that we call lxc_attach() and pass ls_get() as exec function to it (To
  be even more specific: We do not pass ls_get() directly but rather a wrapper
  function for ls_get() which receives a few arguments to enable the
  communication between child and parent.). This implementation has the
  advantage that we do not depend on any lxc executables being present in the
  container. The gist in code:

ls_get()
{
/* Gather all relevant information */

/* get nested containers */
if (args->ls_nested && running) {
/* set up some more stuff */

/*
 * execute ls_get() in namespace of the container to
   * get nested containers
 */
   c->attach(c, ls_get_wrapper, &wrapargs, &aopt, &out)

/* do some cleaning up */
}
}

- When the user requests listing of nested containers without fancy-format
  enabled we want him to easily recognize which container is nested in which.
  So in this case we do not simply record the name but rather the name
  prepended with all the parents of the container:

grand-grand-parent/grand-parent/parent/child

- Pretty-printing nested containers: Any call to list_*_containers() will
  return a sorted array of container names.  Furthermore, the recursive
  implementation of lxc_ls() will automatically put the containers in the
  correct order regarding their nesting. That is if we have the following
  nesting:

A
A --> S
A --> T --> O
A --> T --> O --> L
A --> T --> O --> M
A --> U
A --> U --> P
A --> U --> Q
B

  The array ls_get() will set up looks like this:
A S T O L M U P Q B

  Hence, we only need to keep an additional variable nestlvl to indicate the
  nesting level a container is at and use that to compute (a) the maximum field
  width we need to print out the container names and (b) to correctly indent
  each container according to its nesting level when printing it.

- add comments to make the ls_get() function more accessible

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agocgmanager: fix abuse of 'i'
Serge Hallyn [Wed, 13 Jan 2016 01:21:59 +0000 (17:21 -0800)]
cgmanager: fix abuse of 'i'

we were initializing i to 0, then doing a while i <, but then a
separate commit (by myself) used i as a generic variable in between
those two.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoMerge pull request #742 from brauner/2015-12-12/split_bdev_into_modules
Serge Hallyn [Tue, 12 Jan 2016 08:07:33 +0000 (00:07 -0800)]
Merge pull request #742 from brauner/2015-12-12/split_bdev_into_modules

Split bdev into modules

8 years agoCleanup bdev.c after splitting into modules
Christian Brauner [Wed, 30 Dec 2015 16:34:08 +0000 (17:34 +0100)]
Cleanup bdev.c after splitting into modules

The function

- bdev_get();

becomes static. It is called from nowhere else so far and never appeared in any
header.

Minor changes

- Avoid comparisons between int and size_t types. Use size_t where
  possible else cast to size_t when it makes sense.
- insert missing spaces between operators
- put declarations for all static functions at the top

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoSplit bdev into modules: lxcnbd
Christian Brauner [Wed, 30 Dec 2015 16:02:54 +0000 (17:02 +0100)]
Split bdev into modules: lxcnbd

The functions

- clone_attach_nbd();
- do_attach_nbd();
- nbd_busy();
- nbd_detach();
- nbd_get_partition();
- wait_for_partition();

move from bdev.c to lxcnbd.c. They remain static

The functions

- attach_nbd();
- detach_nbd_idx();
- nbd_clonepaths();
- nbd_create();
- nbd_destroy();
- nbd_detect();
- nbd_mount();
- nbd_umount();
- requires_nbd();

move from bdev.c to lxcnbd.{c,h}. They all become extern.

The struct

- struct nbd_attach_data

moves from bdev.c to lxcnbd.c.

Adapt Makefile.am to include lxcnbd.{c,h}.

The structs

       - struct bdev; /* defined in bdev.h */
       - struct bdev_specs; /* defined in lxccontainer.h */
       - struct lxc_conf; /* defined conf.h */

are forward declared/put as incomplete types into lxcnbd.h as the functions
associated with nbd need access to it.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoSplit bdev into modules: lxcrbd
Christian Brauner [Wed, 30 Dec 2015 14:27:48 +0000 (15:27 +0100)]
Split bdev into modules: lxcrbd

The functions

- rbd_clonepaths();
- rbd_create();
- rbd_destroy();
- rbd_detect();
- rbd_mount();
- rbd_umount();

move from bdev.c to lxcrbd.{c,h}. All functions previously declared static
become extern.

Adapt Makefile.am to include lxcrbd.{c,h}.

The structs

       - struct bdev; /* defined in bdev.h */
       - struct bdev_specs; /* defined in lxccontainer.h */
       - struct lxc_conf; /* defined conf.h */

are forward declared/put as incomplete types into lxcrbd.h as the functions
associated with rbd need access to it.

Put:

       - #define __STDC_FORMAT_MACROS

and include:

       - #include <inttypes.h>

in lxcrbd.c so that the format specifier PRIu64 is available.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoSplit bdev into modules: lxcloop
Christian Brauner [Wed, 30 Dec 2015 14:06:36 +0000 (15:06 +0100)]
Split bdev into modules: lxcloop

The functions

- loop_clonepaths();
- loop_create();
- loop_destroy();
- loop_detect();
- loop_mount();
- loop_umount();

move from bdev.c to lxcloop.{c,h}. All functions previously declared static
become extern.

The functions

- do_loop_create();
- find_free_loopdev_no_control();
- find_free_loopdev();

move from bdev.c to lxcloop.c. They remain static.

Adapt Makefile.am to include lxcloop.{c,h}.

The structs

       - struct bdev; /* defined in bdev.h */
       - struct bdev_specs; /* defined in lxccontainer.h */
       - struct lxc_conf; /* defined conf.h */

are forward declared/put as incomplete types into lxcloop.h as the functions
associated with loop need access to it.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoSplit bdev into modules: lxcdir
Christian Brauner [Wed, 30 Dec 2015 13:49:55 +0000 (14:49 +0100)]
Split bdev into modules: lxcdir

The functions

- dir_clonepaths();
- dir_create();
- dir_destroy();
- dir_detect();
- dir_mount();
- dir_umount();

move from bdev.c to lxcdir.{c,h}. All functions which previously were static
become extern.

Adapt Makefile.am to include lxcdir.{c,h}.

The structs

       - struct bdev; /* defined in bdev.h */
       - struct bdev_specs; /* defined in lxccontainer.h */
       - struct lxc_conf; /* defined conf.h */

are forward declared/put as incomplete types into lxcdir.h as the functions
associated with dir need access to it.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoSplit bdev into modules: lxcaufs
Christian Brauner [Wed, 30 Dec 2015 13:38:44 +0000 (14:38 +0100)]
Split bdev into modules: lxcaufs

The functions

- aufs_clonepaths();
- aufs_create();
- aufs_destroy();
- aufs_detect();
- aufs_mount();
- aufs_umount();

move from bdev.c to lxcaufs.{c,h}. All functions which previously were static
become extern.

Adapt Makefile.am to include lxcaufs.{c,h}.

The structs

       - struct bdev; /* defined in bdev.h */
       - struct bdev_specs; /* defined in lxccontainer.h */
       - struct lxc_conf; /* defined conf.h */

are forward declared/put as incomplete types into lxcaufs.h as the functions
associated with aufs need access to it.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoSplit bdev into modules: lxclvm
Christian Brauner [Tue, 29 Dec 2015 15:24:29 +0000 (16:24 +0100)]
Split bdev into modules: lxclvm

The functions

- lvm_detect();
- lvm_mount();
- lvm_umount();
- lvm_compare_lv_attr();
- lvm_is_thin_volume();
- lvm_is_thin_pool();
- lvm_snapshot();
- lvm_clonepaths();
- lvm_destroy();
- lvm_create();

move from bdev.c to lxclvm.{c,h}. All functions previously declared as static
become public.

Adapt Makefile.am to include lxclvm.{c,h}.

The function:

- mount_unknown_fs();

becomes public.

Rationale: It is already called from different places and will be called by lvm,
and rdb. Also, it is defined twice exactly the same way. Once in conf.c
and once in bdev.c. Let's avoid that.
Defining the same function twice in different places just asks for
trouble.

The functions:

- blk_getsize();
- detect_fs();
- do_mkfs();
- is_blktype();

become public as they will be called for loop, lvm, and or rdb.

Move the definition of:

- DEFAULT_FS_SIZE
- DEFAULT_FSTYPE

from bdev.c to bdev.h to grant other modules access to it.

Remove:
- find_fstype_cb();

from conf.c. It is defined static in bdev.c

Put:

- #define __STDC_FORMAT_MACROS

and include:

- #include <inttypes.h>

in lxclvm.c so that the format specifier PRIu64 is available.

The structs:

- struct bdev; /* defined in bdev.h */
- struct bdev_specs; /* defined in lxccontainer.h */
- struct lxc_conf; /* defined conf.h */

are forward declared/put as incomplete types into lxclvm.h as the functions
associated with lvm need access to it.

Take the chance to restructure bdev.c:

- put bdev structs which have already been split out into separate
  modules at the top
- put declarations of all static functions at the top (This includes
  all functions associated with modules that have not yet already been
  put into a separate module.)

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoSplit bdev into modules: lxczfs
Christian Brauner [Tue, 29 Dec 2015 12:35:53 +0000 (13:35 +0100)]
Split bdev into modules: lxczfs

The functions:

- zfs_clone();
- zfs_clonepaths();
- zfs_create();
- zfs_destroy();
- zfs_detect();
- zfs_list_entry();
- zfs_mount();
- zfs_umount();

move from bdev.c to lxczfs.{c,h}. All functions previously declared as static
become public.

Adapt Makefile.am to include lxczfs.{c,h}.

The structs:

- struct bdev; /* defined in bdev.h */
- struct bdev_specs; /* defined in lxccontainer.h */
- struct lxc_conf; /* defined conf.h */

are forward declared/put as incomplete types into lxczfs.h as the functions
associated with zfs need access to it.

Minor changes:

- Use exit(EXIT_FAILURE) instead of exit(1).
- Use brackets around else {} if the if {} did:
I.e. instead of:

if {
// do one;
// do two;
} else
// do three;

use:

if {
// do one;
// do two;
} else {
// do three;
}
- Instead of declaring char pointers and arrays on the same line, i.e.:

char arr[len], *p;

  do:

char arr[len];
char *p;

  which makes intentions a lot clearer.

- Since we require c99 anyway, use finer-grained scoping by declaring
  variables where they are needed instead of simply at the top.

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoMerge pull request #750 from peti/patch-1
Stéphane Graber [Tue, 12 Jan 2016 07:47:59 +0000 (09:47 +0200)]
Merge pull request #750 from peti/patch-1

bash completion: the 'have' command was deprecated in favor of '_have'

8 years agoMerge pull request #760 from hallyn/2016-01-11/btrfs
Stéphane Graber [Tue, 12 Jan 2016 07:45:46 +0000 (09:45 +0200)]
Merge pull request #760 from hallyn/2016-01-11/btrfs

copy_storage: try to use snapshot for btrfs

8 years agoMerge pull request #761 from hallyn/2016-01-11/preservens.1
Stéphane Graber [Tue, 12 Jan 2016 07:43:20 +0000 (09:43 +0200)]
Merge pull request #761 from hallyn/2016-01-11/preservens.1

preserve inherited fds for stop hook

8 years agopreserve inherited fds for stop hook
Serge Hallyn [Tue, 12 Jan 2016 04:55:30 +0000 (20:55 -0800)]
preserve inherited fds for stop hook

When preserving fds for the stop hook, make sure to also save
any fds we've inherited.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoSet the right variable to NULL when unsetting ipv6_gateway
Serge Hallyn [Tue, 12 Jan 2016 02:25:19 +0000 (18:25 -0800)]
Set the right variable to NULL when unsetting ipv6_gateway

We were freeing one and setting a different one to NULL, eventually
leading to a crash when closing the netdev (at container shutdown)
and freeing already-freed memory.

Closes #732

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocopy_storage: try to use snapshot for btrfs
Serge Hallyn [Mon, 11 Jan 2016 21:07:05 +0000 (13:07 -0800)]
copy_storage: try to use snapshot for btrfs

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agobash completion: the 'have' command was deprecated in favor of '_have'
Peter Simons [Sat, 2 Jan 2016 16:53:07 +0000 (17:53 +0100)]
bash completion: the 'have' command was deprecated in favor of '_have'

`bash-completion` version 2.1 and later no longer include the `have` command,
and consequently the `lxc` competion file fails on such systems. The command is
now called `_have`.

Signed-off-by: Peter Simons <simons@cryp.to>
8 years agoFix zypper repo for Leap
Terzeus S. Dominguez [Mon, 11 Jan 2016 14:35:26 +0000 (22:35 +0800)]
Fix zypper repo for Leap

Leap repos are moved one level deeper. Included oss repo only.

Signed-off-by: Terzeus S. Dominguez <zeus@dmgznet.com>
8 years agoAdd iproute2 and net-tools to Leap install
Terzeus S. Dominguez [Sun, 10 Jan 2016 19:31:30 +0000 (03:31 +0800)]
Add iproute2 and net-tools to Leap install

Added missing network utilities to base install for Leap. Included
check to do it for Leap 42.1 only.

Signed-off-by: Terzeus S. Dominguez <zeus@dmgznet.com>
8 years agoFix typo
Terzeus S. Dominguez [Sun, 10 Jan 2016 18:13:10 +0000 (02:13 +0800)]
Fix typo

Signed-off-by: Terzeus S. Dominguez <zeus@dmgznet.com>
8 years agoAdd openSUSE Leap release in opensuse template
Terzeus S. Dominguez [Sun, 10 Jan 2016 15:13:48 +0000 (23:13 +0800)]
Add openSUSE Leap release in opensuse template

Signed-off-by: Terzeus S. Dominguez <zeus@dmgznet.com>
8 years agoMerge pull request #752 from hallyn/2016-01-04/cgroup.use
Serge Hallyn [Fri, 8 Jan 2016 21:05:42 +0000 (13:05 -0800)]
Merge pull request #752 from hallyn/2016-01-04/cgroup.use

2016 01 04/cgroup.use

8 years agoadd LXC_CGNS_AWARE env variable for mount hooks
Serge Hallyn [Fri, 1 Jan 2016 01:43:15 +0000 (17:43 -0800)]
add LXC_CGNS_AWARE env variable for mount hooks

This way the lxcfs mount hook can know whether lxc knows about
cgroup namespaces.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoattach: unshare cgroupns if possible
Serge Hallyn [Tue, 10 Nov 2015 00:17:31 +0000 (18:17 -0600)]
attach: unshare cgroupns if possible

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
---
Changelog 20160104: only try if kernel supports cgns.

8 years agocontainer start: unshare cgns when possible
Serge Hallyn [Mon, 9 Nov 2015 23:55:54 +0000 (17:55 -0600)]
container start: unshare cgns when possible

We'll probably want to make this configurable with a
lxc.cgroupns = [1|0], but for now just always do it.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
---
Changelog 20160104: only try to unshare if /proc/self/ns/cgroup exists.

8 years agodetect which cgroups we cannot use
Serge Hallyn [Fri, 1 Jan 2016 00:37:43 +0000 (16:37 -0800)]
detect which cgroups we cannot use

and continue without them if possible.  This allows an unpriv user
who only has a few cgroups he owns to still use lxc.

This patch only handles cgmanger - we need to handle this in cgfs too.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoapparmor: recognize 'unconfined' as unconfined.
Serge Hallyn [Wed, 6 Jan 2016 19:45:38 +0000 (11:45 -0800)]
apparmor: recognize 'unconfined' as unconfined.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoUpdate lxc-ubuntu.in
Vaidas Kascėnas [Wed, 6 Jan 2016 17:46:33 +0000 (19:46 +0200)]
Update lxc-ubuntu.in

Updated as per request in https://github.com/lxc/lxc/pull/740#discussion-diff-48759756

Signed-off-by: Vaidas Kascėnas vaidas@kascenas.lt
8 years agocoverity: preserve_ns returns bool, not int
Serge Hallyn [Mon, 4 Jan 2016 22:39:50 +0000 (14:39 -0800)]
coverity: preserve_ns returns bool, not int

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocoverity: ovl_clonepaths: free osrc and ndelta on error paths
Serge Hallyn [Mon, 4 Jan 2016 22:37:17 +0000 (14:37 -0800)]
coverity: ovl_clonepaths: free osrc and ndelta on error paths

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocoverity: close fout on error in is_wlan()
Serge Hallyn [Mon, 4 Jan 2016 22:34:49 +0000 (14:34 -0800)]
coverity: close fout on error in is_wlan()

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoDon't try to change aa label if we are already apparmor-confined
Serge Hallyn [Mon, 4 Jan 2016 21:20:06 +0000 (21:20 +0000)]
Don't try to change aa label if we are already apparmor-confined

Closes #1459

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoMerge pull request #743 from tw4452852/buffer_overflow
Stéphane Graber [Mon, 4 Jan 2016 18:09:34 +0000 (13:09 -0500)]
Merge pull request #743 from tw4452852/buffer_overflow

fix buffer overflow in ifaddrs.c

8 years agoMerge pull request #739 from shindo/fix/python-lxc/pyos-afterfork
Stéphane Graber [Mon, 4 Jan 2016 18:05:59 +0000 (13:05 -0500)]
Merge pull request #739 from shindo/fix/python-lxc/pyos-afterfork

python-lxc: Call PyOS_AfterFork after attaching to a container

8 years agoMerge pull request #746 from ar45/fix_debian_systemd_getty
Stéphane Graber [Mon, 4 Jan 2016 18:05:04 +0000 (13:05 -0500)]
Merge pull request #746 from ar45/fix_debian_systemd_getty

Fix #520 - multiple instances of agetty on systemd.

8 years agoNULL pointer deference if nlmsg_reserve() returns NULL for ifi
Wim Coekaerts [Tue, 29 Dec 2015 06:25:58 +0000 (22:25 -0800)]
NULL pointer deference if nlmsg_reserve() returns NULL for ifi

nlmsg_reserve() might return NULL

        if (nlmsg_len + tlen > nlmsg->cap)
                return NULL;

Also set err = -ENOMEM where appropriate

Signed-off-by: Wim Coekaerts <wim.coekaerts@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agodoc: Improve man pages
KATOH Yasufumi [Mon, 28 Dec 2015 09:55:24 +0000 (18:55 +0900)]
doc: Improve man pages

* Add long options if not be written
* Remove optional tags in OPTIONS section

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agodoc: Add LXC_SRC_NAME to lxc.container.conf(5)
KATOH Yasufumi [Mon, 28 Dec 2015 09:48:56 +0000 (18:48 +0900)]
doc: Add LXC_SRC_NAME to lxc.container.conf(5)

only add to English and Japanese docs.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agonetwork.c:is_wlan() File Leak f
Wim Coekaerts [Tue, 29 Dec 2015 06:23:47 +0000 (22:23 -0800)]
network.c:is_wlan() File Leak f

network.c:is_wlan() File Leak f f initialized at line 156 with fopen f
leaks when fopen(path, r) != NULL at line 156 and physname == NULL at
line 163.

Signed-off-by: Wim Coekaerts <wim.coekaerts@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agocriu.c: protect from buffer overrun of version in fscanf()
Wim Coekaerts [Sun, 27 Dec 2015 17:29:10 +0000 (09:29 -0800)]
criu.c: protect from buffer overrun of version in fscanf()

while highly unlikely to happen...
char version[1024];

fscanf(.. %[1024] .., version  );

should leave room for null termination

Signed-off-by: Wim Coekaerts <wim.coekaerts@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoImprove the help of lxc-create
KATOH Yasufumi [Thu, 24 Dec 2015 06:03:39 +0000 (15:03 +0900)]
Improve the help of lxc-create

* remove unavailable options (-w, -r)
* remove overlapped option (-P)
* classify options according to bdev type

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoDocumenting valueless lxc.cap.drop behaviour
Marko Hauptvogel [Sun, 3 Jan 2016 22:20:47 +0000 (23:20 +0100)]
Documenting valueless lxc.cap.drop behaviour

From b24b0e16848fbb93402a08efa3950cd59272b8da Mon Sep 17 00:00:00 2001
From: Marko Hauptvogel <marko.hauptvogel@googlemail.com>
Date: Sun, 3 Jan 2016 23:07:19 +0100
Subject: [PATCH] Documenting valueless lxc.cap.drop behaviour

Undocummented behaviour since 7d0eb87.

Signed-off-by: Marko Hauptvogel <marko.hauptvogel@googlemail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoAdd support for Linux for SPARC distribution host and template
Wim Coekaerts [Tue, 22 Dec 2015 22:25:00 +0000 (14:25 -0800)]
Add support for Linux for SPARC distribution host and template

Linux for SPARC is a free community Linux distribution for SPARC hosted by Oracle. See : https://oss.oracle.com/projects/linux-sparc

While the distribution is based on Oracle Linux it does have some differences and since it's not actually Oracle Linux I decided to add a separate template rather than having the Oracle Linux template also support Linux for SPARC.

This patch adds the lxc-template for Linux for SPARC and it also adds Linux for SPARC in the configure.ac as a distribution target to build.

Signed-off-by: Wim Coekaerts <wim.coekaerts@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoFix #520 - multiple instances of agetty on systemd.
Aron Podrigal [Fri, 1 Jan 2016 02:04:42 +0000 (21:04 -0500)]
Fix #520 - multiple instances of agetty on systemd.

Fixes issue with double tty login lxc-console
Ref #520, #484

Signed-off-by: Aron Podrigal <aronp@guaranteedplus.com>