]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
16 months agounshare: simplify lookup_name 4411/head
Serge Hallyn [Mon, 11 Mar 2024 20:41:05 +0000 (15:41 -0500)] 
unshare: simplify lookup_name

pass the optarg straight to getpwnam_r, instead of first
scanning the name out of it.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
16 months agoMerge pull request #4410 from HappyDrink-okk/main
Stéphane Graber [Mon, 11 Mar 2024 19:42:22 +0000 (15:42 -0400)] 
Merge pull request #4410 from HappyDrink-okk/main

lxc-unshare: fix an buffer overflow issue in lxc_unshare

16 months agolxc-unshare: fix an buffer overflow issue in lxc_unshare 4410/head
HappyDrink-okk [Sun, 10 Mar 2024 07:45:34 +0000 (15:45 +0800)] 
lxc-unshare: fix an buffer overflow issue in lxc_unshare

If the input parameter length is greater than PATH_MAX, a buffer overflow will occur.

Signed-off-by: HappyDrink-okk <liu7529@yeah.net>
17 months agoMerge pull request #4397 from PoneyClairDeLune/patch-1
Stéphane Graber [Fri, 23 Feb 2024 23:11:49 +0000 (18:11 -0500)] 
Merge pull request #4397 from PoneyClairDeLune/patch-1

Assign IPv6 address and enable IPv6 NAT by default

17 months agolxc-net: Enable IPv6 by default 4397/head
Lumière Élevé [Thu, 8 Feb 2024 17:16:32 +0000 (17:16 +0000)] 
lxc-net: Enable IPv6 by default

Signed-off-by: Lumière Élevé <88174309+PoneyClairDeLune@users.noreply.github.com>
17 months agoMerge pull request #4403 from mihalicyn/meson_fixup_1
Christian Brauner [Mon, 19 Feb 2024 12:38:08 +0000 (13:38 +0100)] 
Merge pull request #4403 from mihalicyn/meson_fixup_1

github: master -> main & ossfuzz build fixes

17 months agotests/meson: attempt to fix ossfuzz builds 4403/head
Alexander Mikhalitsyn [Mon, 19 Feb 2024 09:05:43 +0000 (10:05 +0100)] 
tests/meson: attempt to fix ossfuzz builds

As we link statically with liblxc, we don't need to
link with liblxc_ext_sources, as all the symbols will come
from liblxc.a itself.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agogithub: master -> main
Alexander Mikhalitsyn [Mon, 19 Feb 2024 08:56:04 +0000 (09:56 +0100)] 
github: master -> main

Our main branch is "main" for some time, but
in github scripts we still use "master" which is incorrect
and prevent some stuff from working.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agoMerge pull request #4401 from mihalicyn/meson_link_dynamically_fix
Christian Brauner [Sun, 18 Feb 2024 22:07:56 +0000 (23:07 +0100)] 
Merge pull request #4401 from mihalicyn/meson_link_dynamically_fix

[RFC] meson: link dynamically

17 months agomeson: link with liblxc dynamically everywhere if possible 4401/head
Alexander Mikhalitsyn [Sun, 18 Feb 2024 16:12:49 +0000 (17:12 +0100)] 
meson: link with liblxc dynamically everywhere if possible

Link tests/tools/commands dynamically with liblxc if possible.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agonetwork: use IN_LIBLXC
Alexander Mikhalitsyn [Sun, 18 Feb 2024 16:05:10 +0000 (17:05 +0100)] 
network: use IN_LIBLXC

Put a bunch of functions under #if IN_LIBLXC to compile-out
them when network.c is linked with tools/tests code.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agostorage_utils: move get_fssize to utils
Alexander Mikhalitsyn [Sun, 18 Feb 2024 15:04:54 +0000 (16:04 +0100)] 
storage_utils: move get_fssize to utils

This helper is used in the lxc/tools and it's
fully independent of storage_utils code, let's move it
to utils.c

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agostorage_utils: unhide and rename is_valid_storage_type to lxc_is_valid_storage_type
Alexander Mikhalitsyn [Sun, 18 Feb 2024 14:56:47 +0000 (15:56 +0100)] 
storage_utils: unhide and rename is_valid_storage_type to lxc_is_valid_storage_type

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agoconfile: unhide lxc_config_parse_arch() helper
Alexander Mikhalitsyn [Sun, 18 Feb 2024 14:43:20 +0000 (15:43 +0100)] 
confile: unhide lxc_config_parse_arch() helper

Looks safe enough to be available for liblxc users.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agoconf: reorganize/split code to utils.c
Alexander Mikhalitsyn [Sun, 18 Feb 2024 14:24:29 +0000 (15:24 +0100)] 
conf: reorganize/split code to utils.c

Move run_script/run_script_argv helpers to utils.c

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agoconf: reorganize/split code to idmap_utils.c
Alexander Mikhalitsyn [Sun, 18 Feb 2024 14:17:25 +0000 (15:17 +0100)] 
conf: reorganize/split code to idmap_utils.c

Move some idmaps-related functions from lxc/conf.c
to a new idmap_utils.c file.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agoconfile: unhide lxc_config_define*() helpers
Alexander Mikhalitsyn [Sat, 17 Feb 2024 15:58:02 +0000 (16:58 +0100)] 
confile: unhide lxc_config_define*() helpers

Let's unhide lxc_config_define_add, lxc_config_define_load and
lxc_config_define_free helpers. These functions are safe enough
to be used by external tools. Semantic is also clear.

Reason is that we have lxc-start/lxc-execute tools which
use these symbols. Right now it works, because we just
link a whole liblxc statically to each lxc-* tool...

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agomeson: introduce IN_LIBLXC preprocessor macro
Alexander Mikhalitsyn [Sat, 17 Feb 2024 15:47:41 +0000 (16:47 +0100)] 
meson: introduce IN_LIBLXC preprocessor macro

The purpose of it is to tell us if we are compiling
liblxc or lxc test/tool/command.

This thing is needed to exclude unnecessary functions
from being compiled-in in the resulting executables
like lxc-start, lxc-attach, etc.

The problem is that lxc tools (lxc-start, lxc-stop, etc)
depend not only on the liblxc as a shared library, but also
require some non-exported symbols or helpers from liblxc
internals. So, we have to link these executables with some liblxc
object files directly which results in the dependency hell,
because linking one .c file from liblxc may end up having to
link with another one (what contains some dependency) and so on.
By using IN_LIBLXC in the liblxc internals we can selectively
omit some functions from being compiled in such cases.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agoconfile: move lxc_fill_elevated_privileges() to tools/lxc_attach
Alexander Mikhalitsyn [Sat, 17 Feb 2024 15:43:21 +0000 (16:43 +0100)] 
confile: move lxc_fill_elevated_privileges() to tools/lxc_attach

lxc_fill_elevated_privileges() is used only in lxc-attach tool,
let's move this function in there.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agoMerge pull request #4395 from tsnaik/mount-check
Stéphane Graber [Fri, 16 Feb 2024 04:01:44 +0000 (23:01 -0500)] 
Merge pull request #4395 from tsnaik/mount-check

oci: resolve cross-filesystem blob caching failure

17 months agoMerge pull request #4398 from mihalicyn/usernic_fixes_2
Christian Brauner [Thu, 15 Feb 2024 17:50:37 +0000 (18:50 +0100)] 
Merge pull request #4398 from mihalicyn/usernic_fixes_2

tests: lxc-test-usernic: use iproute tool instead of brctl

17 months agoMerge pull request #4399 from mihalicyn/apparmor_lxc_copy
Christian Brauner [Thu, 15 Feb 2024 17:50:19 +0000 (18:50 +0100)] 
Merge pull request #4399 from mihalicyn/apparmor_lxc_copy

config: apparmor: add AppArmor profile for lxc-copy

17 months agoMerge pull request #4400 from mihalicyn/remove_old_cgroup_handling_in_tests
Christian Brauner [Thu, 15 Feb 2024 17:50:06 +0000 (18:50 +0100)] 
Merge pull request #4400 from mihalicyn/remove_old_cgroup_handling_in_tests

tests: remove old and broken cgroup handling code from tests

17 months agotests: remove old and broken cgroup handling code from tests 4400/head
Alexander Mikhalitsyn [Thu, 15 Feb 2024 17:13:05 +0000 (18:13 +0100)] 
tests: remove old and broken cgroup handling code from tests

We have removed the same piece of code in
ec85e5ca495 ("lxc-test-usernic: drop cgroup handling")
let's do the same for two other tests.

This fixes autopkgtests.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agoconfig: apparmor: add AppArmor profile for lxc-copy 4399/head
Alexander Mikhalitsyn [Thu, 15 Feb 2024 16:59:59 +0000 (17:59 +0100)] 
config: apparmor: add AppArmor profile for lxc-copy

lxc-copy can start container as lxc-start does in some cases,
so we need to have the same profile for it.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
17 months agotests: lxc-test-usernic: use iproute tool instead of brctl 4398/head
Alexander Mikhalitsyn [Thu, 15 Feb 2024 16:37:24 +0000 (17:37 +0100)] 
tests: lxc-test-usernic: use iproute tool instead of brctl

This is required to fix autopkgtest failures.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
18 months agooci: resolve cross-filesystem blob caching failure 4395/head
Tanmay Naik [Sat, 3 Feb 2024 00:28:43 +0000 (00:28 +0000)] 
oci: resolve cross-filesystem blob caching failure

This commit addresses an issue in the OCI template where lxc-create
fails if OCI-cache directory for blob caching is not on the same mount
as the destination OCI directory. lxc-create bails when skopeo tries to
create a hard-link across the two and fails.

For example, if /var/lib/lxc is a bind mountpoint of a random directory
and skopeo fails to hard-link across /var/cache/lxc and /var/lib/lxc

This commit introduces a check where if both directories are on not the
same mount points, it disables blob caching in skopeo and continues.

Signed-off-by: Tanmay Naik <tnaik96@gmail.com>
18 months agoMerge pull request #4394 from hallyn/2024-02-02/test-usernic-fixes
Stéphane Graber [Fri, 2 Feb 2024 21:11:14 +0000 (22:11 +0100)] 
Merge pull request #4394 from hallyn/2024-02-02/test-usernic-fixes

test-usernic fixes

18 months agolxc-test-usernic: drop cgroup handling 4394/head
Serge Hallyn [Fri, 2 Feb 2024 16:41:11 +0000 (10:41 -0600)] 
lxc-test-usernic: drop cgroup handling

This stuff is not needed in a modern systemd based system, and in fact
breaks.  It would probably be better to detect such a system so that a
non-systemd box can still run this test.  But I'm not sure what would be
reliable.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
18 months agotest-usernic: don't use ifconfig
Serge Hallyn [Fri, 2 Feb 2024 16:39:16 +0000 (10:39 -0600)] 
test-usernic: don't use ifconfig

ifconfig is not available on many modern systems.  Use ip instead.

Maybe it would be better to detect what's available, but that
could become brittle.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
18 months agoMerge pull request #4391 from gibmat/fix-x32-container-creation
Stéphane Graber [Tue, 30 Jan 2024 01:37:41 +0000 (02:37 +0100)] 
Merge pull request #4391 from gibmat/fix-x32-container-creation

Add x32 to the list of recognized architectures

18 months agoAdd x32 to the list of recognized architectures 4391/head
Mathias Gibbens [Tue, 30 Jan 2024 01:03:06 +0000 (01:03 +0000)] 
Add x32 to the list of recognized architectures

LXC supports x32 containers, but currently creation of those containers is broken:

lxc-create: x32-test: ../src/lxc/confile.c: set_config_personality: 1432 Invalid argument - Unsupported personality "x32"
lxc-create: x32-test: ../src/lxc/parse.c: lxc_file_for_each_line_mmap: 129 Failed to parse config file "/var/lib/lxc/x32-test/config" at line "lxc.arch = x32"
lxc-create: x32-test: ../src/lxc/tools/lxc_create.c: main: 317 Failed to create container x32-test

Signed-off-by: Mathias Gibbens <gibmat@debian.org>
18 months agoMerge pull request #4390 from jacobmcnamee/unpack-tar-xattrs
Stéphane Graber [Sun, 28 Jan 2024 23:17:29 +0000 (00:17 +0100)] 
Merge pull request #4390 from jacobmcnamee/unpack-tar-xattrs

lxc-download, lxc-local: preserve xattrs on unpack

18 months agolxc-download, lxc-local: preserve xattrs on unpack 4390/head
Jacob McNamee [Sun, 28 Jan 2024 20:57:24 +0000 (12:57 -0800)] 
lxc-download, lxc-local: preserve xattrs on unpack

Update tar invocation to preserve all xattrs when unpacking the rootfs,
notably retaining security.capability xattrs (e.g. for ping, newuidmap)

Note: bsdtar already preserves xattrs with -p

Signed-off-by: Jacob McNamee <jacob@jacobmcnamee.com>
18 months agoMerge pull request #4388 from mihalicyn/plumb_userns_checks
Christian Brauner [Fri, 26 Jan 2024 18:35:14 +0000 (19:35 +0100)] 
Merge pull request #4388 from mihalicyn/plumb_userns_checks

tree-wide: use container_uses_namespace() in more places

18 months agotree-wide: use container_uses_namespace() in less trivial cases 4388/head
Alexander Mikhalitsyn [Fri, 26 Jan 2024 16:20:27 +0000 (17:20 +0100)] 
tree-wide: use container_uses_namespace() in less trivial cases

In our current codebase we have a logical pattern:
list_empty(&handler->conf->id_map)
*IF AND ONLY IF*
container does NOT use user namespace

Which is perfectly correct nowadays, but once we (hopefully)
get an "isolated user namespaces" stuff ready it won't be the case.
It will be perfectly fine to have a user namespace with empty
/proc/*/{u,g}id_map files. Nowadays it's also possible,
but this kind of a configuration close to useless and nobody
actually uses it.

No functional changes intended.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
18 months agotree-wide: use container_uses_namespace() helper
Alexander Mikhalitsyn [Fri, 26 Jan 2024 16:01:46 +0000 (17:01 +0100)] 
tree-wide: use container_uses_namespace() helper

No functional changes.

Will be useful in future support for an isolated
user namespaces [1]. I have already played with
that locally and found that in the LXC codebase
we have a bunch of different ways to ensure if
a container uses user namespaces or not.

This commit contains a trivial conversion from
an open-coded version of the container_uses_namespace()
helper to an actual use of the helper.

[1] https://lpc.events/event/17/contributions/1569/

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
18 months agoMerge pull request #4363 from zhaixiaojuan/main
Stéphane Graber [Sun, 14 Jan 2024 21:53:37 +0000 (22:53 +0100)] 
Merge pull request #4363 from zhaixiaojuan/main

Add loongarch64 support

18 months agoMerge pull request #4382 from petermichaux/main
Stéphane Graber [Thu, 11 Jan 2024 20:10:47 +0000 (21:10 +0100)] 
Merge pull request #4382 from petermichaux/main

Add Verbose Output in Download Template

18 months agoFix error message. 4382/head
Peter Michaux [Sat, 6 Jan 2024 18:08:06 +0000 (10:08 -0800)] 
Fix error message.

Signed-off-by: Peter Michaux <petermichaux@gmail.com>
18 months agoAdd verbose output in download template.
Peter Michaux [Sat, 6 Jan 2024 17:51:13 +0000 (09:51 -0800)] 
Add verbose output in download template.

Signed-off-by: Peter Michaux <petermichaux@gmail.com>
18 months agoMerge pull request #4381 from petermichaux/patch-1
Stéphane Graber [Sat, 6 Jan 2024 15:12:24 +0000 (16:12 +0100)] 
Merge pull request #4381 from petermichaux/patch-1

Align columns in lxc-download.in template

18 months agoAlign columns in lxc-download.in template 4381/head
Peter Michaux [Sat, 6 Jan 2024 06:10:34 +0000 (22:10 -0800)] 
Align columns in lxc-download.in template

Signed-off-by: Peter Michaux <petermichaux@gmail.com>
19 months agoAdd loongarch64 support 4363/head
zhaixiaojuan [Thu, 2 Nov 2023 08:14:45 +0000 (16:14 +0800)] 
Add loongarch64 support

Signed-off-by: zhaixiaojuan <zhaixiaojuan@loongson.cn>
19 months agoMerge pull request #4375 from lxc/dependabot/github_actions/actions/upload-artifact-4
Stéphane Graber [Mon, 18 Dec 2023 13:56:58 +0000 (08:56 -0500)] 
Merge pull request #4375 from lxc/dependabot/github_actions/actions/upload-artifact-4

build(deps): bump actions/upload-artifact from 3 to 4

19 months agobuild(deps): bump actions/upload-artifact from 3 to 4 4375/head
dependabot[bot] [Mon, 18 Dec 2023 13:13:10 +0000 (13:13 +0000)] 
build(deps): bump actions/upload-artifact from 3 to 4

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
19 months agoMerge pull request #3236 from xinhua9569/master
Stéphane Graber [Wed, 13 Dec 2023 18:18:29 +0000 (13:18 -0500)] 
Merge pull request #3236 from xinhua9569/master

config: try to create workdir if not exist

19 months agoconfig: try to create workdir if not exist 3236/head
dongxinhua [Mon, 23 Dec 2019 10:59:29 +0000 (18:59 +0800)] 
config: try to create workdir if not exist

Signed-off-by: dongxinhua <dongxinhua@huawei.com>
19 months agoMerge pull request #4368 from desultory/main
Stéphane Graber [Mon, 11 Dec 2023 22:23:55 +0000 (17:23 -0500)] 
Merge pull request #4368 from desultory/main

Updated lxc-local template

19 months agolxc-local: Add --no-dev option to exclude /dev from the fstree 4368/head
Zen [Thu, 16 Nov 2023 17:49:43 +0000 (11:49 -0600)] 
lxc-local: Add --no-dev option to exclude /dev from the fstree

Signed-off-by: Zen <z@pyl.onl>
19 months agolxc-local: Re-organize code to use more functions
Zen [Thu, 16 Nov 2023 16:35:53 +0000 (10:35 -0600)] 
lxc-local: Re-organize code to use more functions

Signed-off-by: Zen <z@pyl.onl>
19 months agolxc-local: Improve usage info
Zen [Thu, 16 Nov 2023 16:45:02 +0000 (10:45 -0600)] 
lxc-local: Improve usage info

Signed-off-by: Zen <z@pyl.onl>
19 months agolxc-local: Change LXC_CONFIG to LXC_METADATA to match args and be more clear
Zen [Thu, 16 Nov 2023 16:33:54 +0000 (10:33 -0600)] 
lxc-local: Change LXC_CONFIG to LXC_METADATA to match args and be more clear

Signed-off-by: Zen <z@pyl.onl>
19 months agoMerge pull request #3430 from Der-Jan/master-zfs-fix
Stéphane Graber [Mon, 11 Dec 2023 03:37:39 +0000 (22:37 -0500)] 
Merge pull request #3430 from Der-Jan/master-zfs-fix

Read list until process exits

19 months agoMerge pull request #4351 from flisk/fix-untagged-vlans-on-bridges-without-default...
Stéphane Graber [Mon, 11 Dec 2023 02:48:06 +0000 (21:48 -0500)] 
Merge pull request #4351 from flisk/fix-untagged-vlans-on-bridges-without-default-pvids

don't try to delete vlan 0 from veth

19 months agoMerge pull request #4169 from cole-miller/link-local
Stéphane Graber [Mon, 11 Dec 2023 02:46:33 +0000 (21:46 -0500)] 
Merge pull request #4169 from cole-miller/link-local

Disable IPv6 link-local addresses for bridged veth

19 months agoDisable IPv6 link-local addresses for bridged veth 4169/head
Cole Miller [Fri, 15 Jul 2022 17:52:52 +0000 (13:52 -0400)] 
Disable IPv6 link-local addresses for bridged veth

When creating a bridged veth tunnel, disable assignment of IPv6
link-local addresses on the host's end by writing 1 to
/proc/sys/net/ipv6/conf/NAME/disable_ipv6, if it exists.

Signed-off-by: Cole Miller <m@cole-miller.net>
19 months agodon't try to delete vlan 0 from veth 4351/head
flisk [Thu, 5 Oct 2023 10:28:03 +0000 (12:28 +0200)] 
don't try to delete vlan 0 from veth

vid 0 is a special value that indicates the absence of a default pvid

Signed-off-by: flisk <self@flisk.xyz>
19 months agoMerge pull request #4321 from lkomurcub/libarchive_tar_exclude
Stéphane Graber [Sun, 10 Dec 2023 20:21:52 +0000 (15:21 -0500)] 
Merge pull request #4321 from lkomurcub/libarchive_tar_exclude

Add libarchive tar support for lxc download

20 months agoMerge pull request #4344 from gibmat/fix-ephemeral-copy
Stéphane Graber [Wed, 29 Nov 2023 15:35:13 +0000 (10:35 -0500)] 
Merge pull request #4344 from gibmat/fix-ephemeral-copy

lxc_storage_prepare(): Fix ephemeral copies

20 months agoconf: fix ephemeral copies 4344/head
Christian Brauner [Wed, 29 Nov 2023 14:57:04 +0000 (15:57 +0100)] 
conf: fix ephemeral copies

Don't rely on rootfs->bdev_type because that may be NULL. Use storage->type
instead which can't be NULL.

Co-Developed-by: Mathias Gibbens <gibmat@debian.org>
Signed-off-by: Mathias Gibbens <gibmat@debian.org>
Reported-by: Mathias Gibbens <gibmat@debian.org>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
20 months agoMerge pull request #4370 from simondeziel/no-upstart
Stéphane Graber [Mon, 27 Nov 2023 06:01:02 +0000 (01:01 -0500)] 
Merge pull request #4370 from simondeziel/no-upstart

Remove support for upstart

20 months agoconfig/init: Drop upstart files 4370/head
Simon Deziel [Fri, 24 Nov 2023 19:19:44 +0000 (14:19 -0500)] 
config/init: Drop upstart files

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
20 months agodoc: remove the warning mentionning upstart
Simon Deziel [Fri, 24 Nov 2023 19:21:21 +0000 (14:21 -0500)] 
doc: remove the warning mentionning upstart

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
20 months agohooks/ubuntu-cloud-prep: remove upstart handling
Simon Deziel [Fri, 24 Nov 2023 19:20:43 +0000 (14:20 -0500)] 
hooks/ubuntu-cloud-prep: remove upstart handling

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
20 months agomeson: Remove support for upstart
Simon Deziel [Fri, 24 Nov 2023 19:20:09 +0000 (14:20 -0500)] 
meson: Remove support for upstart

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agoMerge pull request #4357 from ElJeffe/fix-idmap-clear
Stéphane Graber [Thu, 12 Oct 2023 05:25:13 +0000 (01:25 -0400)] 
Merge pull request #4357 from ElJeffe/fix-idmap-clear

reset root_nsuid_map and root_nsgid_map when idmaps is cleared

21 months agoreset root_nsuid_map and root_nsgid_map when idmaps is cleared 4357/head
Jef Steelant [Wed, 11 Oct 2023 09:56:58 +0000 (09:56 +0000)] 
reset root_nsuid_map and root_nsgid_map when idmaps is cleared

Signed-off-by: Jef Steelant <jef@steelant.be>
21 months agoMerge pull request #4352 from simondeziel/shellcheck-checkconfig
Stéphane Graber [Sat, 7 Oct 2023 08:06:36 +0000 (04:06 -0400)] 
Merge pull request #4352 from simondeziel/shellcheck-checkconfig

Make `lxc-checkconfig` shellcheck clean

21 months agolxc/checkconfig: use multiline `echo` 4352/head
Simon Deziel [Fri, 6 Oct 2023 05:19:33 +0000 (01:19 -0400)] 
lxc/checkconfig: use multiline `echo`

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agolxc/checkconfig: replace `echo -n` by printf
Simon Deziel [Fri, 6 Oct 2023 05:16:38 +0000 (01:16 -0400)] 
lxc/checkconfig: replace `echo -n` by printf

printf is already used for color output.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agolxc/checkconfig: minor cosmetic change
Simon Deziel [Fri, 6 Oct 2023 04:57:44 +0000 (00:57 -0400)] 
lxc/checkconfig: minor cosmetic change

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agolxc/checkconfig: avoid subshell (SC2235)
Simon Deziel [Fri, 6 Oct 2023 04:31:27 +0000 (00:31 -0400)] 
lxc/checkconfig: avoid subshell (SC2235)

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agolxc/checkconfig: remove superfluous (..) around test command (SC2234)
Simon Deziel [Fri, 6 Oct 2023 04:27:47 +0000 (00:27 -0400)] 
lxc/checkconfig: remove superfluous (..) around test command (SC2234)

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agolxc/checkconfig: check exit code directly (SC2181)
Simon Deziel [Fri, 6 Oct 2023 04:25:16 +0000 (00:25 -0400)] 
lxc/checkconfig: check exit code directly (SC2181)

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agolxc/checkconfig: replace `! -z` by `-n` (SC2236)
Simon Deziel [Fri, 6 Oct 2023 04:24:08 +0000 (00:24 -0400)] 
lxc/checkconfig: replace `! -z` by `-n` (SC2236)

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agolxc/checkconfig: add missing quotes to please shellcheck
Simon Deziel [Fri, 6 Oct 2023 04:22:46 +0000 (00:22 -0400)] 
lxc/checkconfig: add missing quotes to please shellcheck

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agolxc/checkconfig: remove some unneeded `echo -n`
Simon Deziel [Fri, 6 Oct 2023 04:18:21 +0000 (00:18 -0400)] 
lxc/checkconfig: remove some unneeded `echo -n`

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agolxc/checkconfig: replace `type` by `command`
Simon Deziel [Fri, 6 Oct 2023 04:03:35 +0000 (00:03 -0400)] 
lxc/checkconfig: replace `type` by `command`

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
21 months agolxc/checkconfig: replace `cat | grep` with `grep`
Simon Deziel [Fri, 6 Oct 2023 05:43:04 +0000 (01:43 -0400)] 
lxc/checkconfig: replace `cat | grep` with `grep`

Also speedup `grep` invokations while at it.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
22 months agoMerge pull request #4349 from mihalicyn/set_timeout_fixup
Stéphane Graber [Tue, 26 Sep 2023 18:33:20 +0000 (14:33 -0400)] 
Merge pull request #4349 from mihalicyn/set_timeout_fixup

lxc/lxccontainer: fix do_lxcapi_set_timeout retval

22 months agolxc/lxccontainer: fix do_lxcapi_set_timeout retval 4349/head
Alexander Mikhalitsyn [Tue, 26 Sep 2023 17:08:45 +0000 (19:08 +0200)] 
lxc/lxccontainer: fix do_lxcapi_set_timeout retval

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
23 months agoMerge pull request #4345 from lxc/dependabot/github_actions/actions/checkout-4
Christian Brauner [Mon, 4 Sep 2023 15:04:34 +0000 (17:04 +0200)] 
Merge pull request #4345 from lxc/dependabot/github_actions/actions/checkout-4

build(deps): bump actions/checkout from 3 to 4

23 months agobuild(deps): bump actions/checkout from 3 to 4 4345/head
dependabot[bot] [Mon, 4 Sep 2023 13:53:54 +0000 (13:53 +0000)] 
build(deps): bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
23 months agoMerge pull request #4343 from stgraber/main
Christian Brauner [Thu, 31 Aug 2023 06:25:23 +0000 (08:25 +0200)] 
Merge pull request #4343 from stgraber/main

lxccontainer.h: Move new fields to the end

23 months agolxccontainer.h: Move new fields to the end 4343/head
Stéphane Graber [Thu, 31 Aug 2023 04:46:14 +0000 (00:46 -0400)] 
lxccontainer.h: Move new fields to the end

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
23 months agoMerge pull request #4341 from stgraber/main
Christian Brauner [Wed, 30 Aug 2023 21:25:40 +0000 (23:25 +0200)] 
Merge pull request #4341 from stgraber/main

Remove references to LXD

23 months agoRemove references to LXD 4341/head
Stéphane Graber [Wed, 30 Aug 2023 21:06:23 +0000 (17:06 -0400)] 
Remove references to LXD

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
23 months agoMerge pull request #4339 from hallyn/2023-08-29/consoleperms
Christian Brauner [Tue, 29 Aug 2023 22:18:57 +0000 (00:18 +0200)] 
Merge pull request #4339 from hallyn/2023-08-29/consoleperms

Update console perms to 0600

23 months agoUpdate console perms to 0600 4339/head
Serge Hallyn [Tue, 29 Aug 2023 21:14:28 +0000 (16:14 -0500)] 
Update console perms to 0600

Closes #4338

We should not give execute permissions to console output.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
23 months agoMerge pull request #4336 from smoser/fix/api-start-split-better
Serge Hallyn [Wed, 23 Aug 2023 15:11:00 +0000 (10:11 -0500)] 
Merge pull request #4336 from smoser/fix/api-start-split-better

Fix start api call to split quoted strings in execute or init command.

23 months agoFix start api call to split quoted strings in execute or init command. 4336/head
Scott Moser [Tue, 22 Aug 2023 18:07:36 +0000 (14:07 -0400)] 
Fix start api call to split quoted strings in execute or init command.

If a user of the container.start api call provided NULL for the argv
argument, then lxc would load either 'lxc.execute.cmd' or
'lxc.init.cmd' configuration items as the command.

Given a config like:

    lxc.execute.cmd = /usr/bin/touch "file one" "file 2"

lxc would just split the string on spaces and end up executing array:

  ['touch', 'file"', 'one"', '"file', '2"']

This differs from the experience with the `lxc-start` command which
would use lxc_string_split_quoted and execute:

  ['touch', 'file one', 'file 2']

Note that as described in lxc_string_split_quoted, commands that include
nested quotes and possibly other characters are still a problem.  In
those cases, the caller of 'start' can provide an argv array.

Signed-off-by: Scott Moser <smoser@brickies.net>
23 months agoMerge pull request #4260 from mihalicyn/lxcapi_set_timeout
Christian Brauner [Tue, 22 Aug 2023 13:22:29 +0000 (15:22 +0200)] 
Merge pull request #4260 from mihalicyn/lxcapi_set_timeout

LXC API extension: set_timeout

23 months agoMerge pull request #4295 from mihalicyn/apparmor_mount_propagation
Stéphane Graber [Thu, 17 Aug 2023 16:31:16 +0000 (12:31 -0400)] 
Merge pull request #4295 from mihalicyn/apparmor_mount_propagation

Apparmor mount propagation

2 years agogithub: Update for main branch
Stéphane Graber [Mon, 24 Jul 2023 15:37:53 +0000 (11:37 -0400)] 
github: Update for main branch

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2 years agoMerge pull request #4327 from hallyn/2023-07-17/ai
Christian Brauner [Mon, 17 Jul 2023 17:04:37 +0000 (19:04 +0200)] 
Merge pull request #4327 from hallyn/2023-07-17/ai

CONTRIBUTING: add a note on AI generated code

2 years agoCONTRIBUTING: add a note on AI generated code 4327/head
Serge Hallyn [Mon, 17 Jul 2023 12:57:17 +0000 (07:57 -0500)] 
CONTRIBUTING: add a note on AI generated code

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
2 years agoMerge pull request #4324 from hallyn/2023-07-06/bequiet
Christian Brauner [Fri, 7 Jul 2023 10:48:59 +0000 (12:48 +0200)] 
Merge pull request #4324 from hallyn/2023-07-06/bequiet

get_hierarchy: dont WARN about no usable controller

2 years agoget_hierarchy: dont WARN about no usable controller 4324/head
Serge Hallyn [Thu, 6 Jul 2023 23:34:59 +0000 (18:34 -0500)] 
get_hierarchy: dont WARN about no usable controller

If I start a container with loglevel WARN, and (on a pretty
stock ubuntu) do lxc-info -n $c, I get

lxc-start media 20230706233337.765 WARN     cgfsng - cgroups/cgfsng.c:get_hierarchy:142 - There is no useable cpuacct controller
lxc-start media 20230706233337.765 WARN     cgfsng - cgroups/cgfsng.c:get_hierarchy:142 - There is no useable blkio controller

I don't think that's worth WARNing about, so change it to
INFO.

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
2 years agoAdd libarchive tar support for lxc download 4321/head
Levent Komurcu [Mon, 26 Jun 2023 07:23:30 +0000 (09:23 +0200)] 
Add libarchive tar support for lxc download

This patch fixes unpacking images when the system provided tar is libarchive (bsd-tar). bsd-tar  doesn't support 'exclude' flags (--anchored) like gnu-tar does. Instead each exclude path is prepended with ^ to simulate behavior of --anchored when bsd tar is detected.

Signed-off-by: Levent Komurcu <levent.komurcu@nl.bosch.com>