]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
9 months agoMerge pull request #4488 from sgalgano/fix-4476
Stéphane Graber [Tue, 15 Oct 2024 00:09:59 +0000 (20:09 -0400)] 
Merge pull request #4488 from sgalgano/fix-4476

Avoid null pointer dereference when using shared rootfs

9 months agoAvoid null pointer dereference when using shared rootfs. 4488/head
Steven Galgano [Mon, 14 Oct 2024 19:16:36 +0000 (15:16 -0400)] 
Avoid null pointer dereference when using shared rootfs.
rootfs->storage not set by lxc_storage_prepare when using a shared
rootfs.

Fixes: https://github.com/lxc/lxc/issues/4476
Signed-off-by: Steven Galgano <sgalgano@adjacentlink.com>
9 months agoMerge pull request #4487 from hallyn/kurt-cb/lxc
Stéphane Graber [Sun, 13 Oct 2024 22:54:43 +0000 (18:54 -0400)] 
Merge pull request #4487 from hallyn/kurt-cb/lxc

create_run_template: don't use txtuid and txtguid out of scope

9 months agocreate_run_template: don't use txtuid and txtguid out of scope 4487/head
Serge Hallyn [Thu, 10 Oct 2024 04:18:42 +0000 (23:18 -0500)] 
create_run_template: don't use txtuid and txtguid out of scope

It's ok that we don't free the malloc()d space since we're
immediately exec()ing.

Originally-by: Kurt Godwin <kgodwin@itron.com>
Reported-by: Kurt Godwin <kgodwin@itron.com>
Signed-off-by: Serge Hallyn <serge@hallyn.com>
9 months agoMerge pull request #4482 from hallyn/2024-09-16/static
Serge Hallyn [Wed, 9 Oct 2024 20:35:52 +0000 (15:35 -0500)] 
Merge pull request #4482 from hallyn/2024-09-16/static

meson.build: add -ffat-lto-objects

9 months agoMerge pull request #4483 from ariel-miculas/support_puzzlefs
Serge Hallyn [Sun, 6 Oct 2024 00:12:27 +0000 (19:12 -0500)] 
Merge pull request #4483 from ariel-miculas/support_puzzlefs

Add suppport for PuzzleFS images in the oci template

9 months agoAdd suppport for PuzzleFS images in the oci template 4483/head
Ariel Miculas-Trif [Wed, 18 Sep 2024 10:07:46 +0000 (13:07 +0300)] 
Add suppport for PuzzleFS images in the oci template

PuzzleFS images (media type 'application/vnd.puzzlefs.image.rootfs.v1')
can be mounted in a similar way to squashfs images, we just have to
detect the type and reuse the existing code for providing a mount
helper. PuzzleFS is a next-generation container filesystem [1] with
several benefits, such as  reduced duplication, reproducible image
builds, direct mounting support and memory safety guarantees.

Since PuzzleFS currently doesn't provide an image config, also add
support for empty image configs, they are supported by the OCI spec [2].

The MOUNT_HELPER is now passed a `--persist <upperdir>` flag, so it
knows that it needs to create an overlay. This is needed because LXC
expects a writable rootfs and both atomfs and puzzlefs are read-only
filesystems.

Example:
```
$ sudo env PATH=$PATH build/src/lxc/tools/lxc-create --name mycontainer -t \
oci -- --url oci:/$HOME/.local/share/puzzlefs/pfs_ubuntu:eg --no-cache

$ sudo build/src/lxc/tools/lxc-start --name mycontainer --foreground /bin/bash
```

--no-cache is needed for puzzlefs until [3] is solved

[1] https://github.com/project-machine/puzzlefs
[2] https://github.com/opencontainers/image-spec/blob/main/manifest.md#image-manifest
[3] https://github.com/project-machine/puzzlefs/issues/131

Signed-off-by: Ariel Miculas-Trif <amiculas@cisco.com>
10 months agomeson.build: drop suggest-attribute=noreturn build option 4482/head
Serge Hallyn [Thu, 3 Oct 2024 18:41:39 +0000 (13:41 -0500)] 
meson.build: drop suggest-attribute=noreturn build option

The suggest-attribute=noreturn option marks functions which will
never return, to give the compiler some hints.  It catches all of
our src/lxc/tools/*.c *_main functions as follows:

error: function might be candidate for attribute ‘noreturn’ [-Werror=suggest-attribute=noreturn]

But if we mark those __noreturn, then  the compiler complains that:

../src/lxc/tools/lxc_attach.c:320:53: warning: ‘main’ specifies less restrictive attribute than its target ‘lxc_attach_main’: ‘noreturn’ [-Wmissi
ng-attributes]
  320 | int __attribute__((weak, alias("lxc_attach_main"))) main(int argc, char *argv[]);

This recommendation is really not very important, so let's not ask
the build to warn about it.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
10 months agomeson.build: add -ffat-lto-objects
Serge Hallyn [Mon, 16 Sep 2024 12:47:34 +0000 (07:47 -0500)] 
meson.build: add -ffat-lto-objects

Otherwise, if we generate a static library, lintian warns that
it has no code sections.  See

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=977596

Signed-off-by: Serge Hallyn <serge@hallyn.com>
10 months agoMerge pull request #4481 from yuncang123/main
Stéphane Graber [Mon, 16 Sep 2024 11:42:33 +0000 (07:42 -0400)] 
Merge pull request #4481 from yuncang123/main

fix possible clang compile error on AARCH

10 months agofix possible clang compile error in AARCH 4481/head
yuncang123 [Sat, 14 Sep 2024 18:03:01 +0000 (02:03 +0800)] 
fix possible clang compile error in AARCH

Signed-off-by: yuncang123 <135211779+yuncang123@users.noreply.github.com>
11 months agoMerge pull request #4475 from stgraber/main
Christian Brauner [Sun, 25 Aug 2024 19:21:38 +0000 (21:21 +0200)] 
Merge pull request #4475 from stgraber/main

README: Update security contact

11 months agoREADME: Update security contact 4475/head
Stéphane Graber [Sun, 25 Aug 2024 17:17:59 +0000 (13:17 -0400)] 
README: Update security contact

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
11 months agoMerge pull request #4472 from stgraber/main
Christian Brauner [Thu, 8 Aug 2024 06:21:26 +0000 (08:21 +0200)] 
Merge pull request #4472 from stgraber/main

doc: Fix definitions of get_config_path and set_config_path

11 months agodoc: Fix definitions of get_config_path and set_config_path 4472/head
Stéphane Graber [Wed, 7 Aug 2024 18:10:59 +0000 (14:10 -0400)] 
doc: Fix definitions of get_config_path and set_config_path

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
12 months agoMerge pull request #4462 from Jip-Hop/list-exit-code
Serge Hallyn [Tue, 16 Jul 2024 19:31:04 +0000 (14:31 -0500)] 
Merge pull request #4462 from Jip-Hop/list-exit-code

Exit 0 when there's no error

12 months agoExit 0 when there's no error 4462/head
Jip-Hop [Tue, 9 Jul 2024 10:33:36 +0000 (12:33 +0200)] 
Exit 0 when there's no error

Signed-off-by: Jip de Beer <2871973+Jip-Hop@users.noreply.github.com>
12 months agoMerge pull request #4463 from stgraber/main
Stéphane Graber [Tue, 16 Jul 2024 18:33:39 +0000 (20:33 +0200)] 
Merge pull request #4463 from stgraber/main

Reduce logging for newuidmap/newgidmap

12 months agoidmap: Lower logging level of newXidmap tools to INFO 4463/head
Stéphane Graber [Tue, 16 Jul 2024 14:08:31 +0000 (10:08 -0400)] 
idmap: Lower logging level of newXidmap tools to INFO

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
12 months agoRemove unused function
Stéphane Graber [Wed, 5 Jun 2024 22:40:15 +0000 (18:40 -0400)] 
Remove unused function

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
13 months agoMerge pull request #4459 from mihalicyn/lxc_nixos_build_fix2
Stéphane Graber [Wed, 26 Jun 2024 18:58:02 +0000 (20:58 +0200)] 
Merge pull request #4459 from mihalicyn/lxc_nixos_build_fix2

meson: fix build with -Dtools-multicall=true on NixOS

13 months agomeson: fix build with -Dtools-multicall=true on NixOS 4459/head
Alexander Mikhalitsyn [Wed, 26 Jun 2024 18:42:55 +0000 (20:42 +0200)] 
meson: fix build with -Dtools-multicall=true on NixOS

See also:
https://github.com/lxc/lxc/pull/4428

Fixes: #4427
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
13 months agoMerge pull request #4453 from mihalicyn/update_githubci_ubuntu24
Stéphane Graber [Wed, 26 Jun 2024 18:35:38 +0000 (20:35 +0200)] 
Merge pull request #4453 from mihalicyn/update_githubci_ubuntu24

Update GitHub Actions to use Ubuntu 24.04

13 months agogithub: exclude clang & ubuntu-24.04 combination 4453/head
Alexander Mikhalitsyn [Wed, 26 Jun 2024 17:47:31 +0000 (19:47 +0200)] 
github: exclude clang & ubuntu-24.04 combination

Temporary workaround for:
https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-18/+bug/2064187

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
13 months agolxc/storage/zfs: ignore false-positive use-after-free warning
Alexander Mikhalitsyn [Wed, 26 Jun 2024 17:28:03 +0000 (19:28 +0200)] 
lxc/storage/zfs: ignore false-positive use-after-free warning

free(dataset) is perfecly valid after failed realloc(dataset, len) call.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
13 months agogithub: properly check apparmor profile changes
Alexander Mikhalitsyn [Tue, 4 Jun 2024 11:49:59 +0000 (13:49 +0200)] 
github: properly check apparmor profile changes

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
13 months agogithub: start using ubuntu-24.04
Alexander Mikhalitsyn [Tue, 4 Jun 2024 11:49:19 +0000 (13:49 +0200)] 
github: start using ubuntu-24.04

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
13 months agoMerge pull request #4456 from mihalicyn/apparmor_syntax_fix_fixup
Stéphane Graber [Wed, 5 Jun 2024 14:53:02 +0000 (16:53 +0200)] 
Merge pull request #4456 from mihalicyn/apparmor_syntax_fix_fixup

AppArmor fixup

13 months agoapparmor: regenerate rules 4456/head
Alexander Mikhalitsyn [Wed, 5 Jun 2024 12:38:06 +0000 (14:38 +0200)] 
apparmor: regenerate rules

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
13 months agoapparmor: use /{,**} instead of /**
Alexander Mikhalitsyn [Wed, 5 Jun 2024 12:33:31 +0000 (14:33 +0200)] 
apparmor: use /{,**} instead of /**

It turned out, that old (and incorrect) rule:
mount options=(rw,make-slave) -> **,

is NOT equivalent to:
mount options=(rw,make-slave) -> /**,

Let's use:
mount options=(rw,make-slave) -> /{,**},

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
14 months agoMerge pull request #4452 from mihalicyn/apparmor_prof_syntax_fix
Stéphane Graber [Tue, 4 Jun 2024 14:02:10 +0000 (16:02 +0200)] 
Merge pull request #4452 from mihalicyn/apparmor_prof_syntax_fix

Apparmor profiles syntax fixes

14 months agoapparmor: regenerate rules 4452/head
Alexander Mikhalitsyn [Tue, 4 Jun 2024 11:30:51 +0000 (13:30 +0200)] 
apparmor: regenerate rules

Follow the instruction from config/apparmor/README:

./lxc-generate-aa-rules.py container-rules.base > container-rules
cat abstractions/container-base.in container-rules > abstractions/container-base

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
14 months agoapparmor: fix rule path pattern specification syntax
Alexander Mikhalitsyn [Tue, 4 Jun 2024 11:28:05 +0000 (13:28 +0200)] 
apparmor: fix rule path pattern specification syntax

See also:
https://bugs.launchpad.net/lxc/+bug/2064144
https://github.com/lxc/incus/pull/889/commits/d2c13e3f6312f08750981a80a510530e881c4ec7

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
14 months agoMerge pull request #4450 from jacobmcnamee/fix-local-template
Stéphane Graber [Wed, 22 May 2024 18:04:43 +0000 (20:04 +0200)] 
Merge pull request #4450 from jacobmcnamee/fix-local-template

lxc-local: fix broken templates processing

14 months agolxc-local: remove check for template existence before extraction 4450/head
Jacob McNamee [Wed, 22 May 2024 14:02:14 +0000 (07:02 -0700)] 
lxc-local: remove check for template existence before extraction

This check always fails because template files do not exist until the
rootfs is unpacked. File existence is already confirmed before replacing
variables

Signed-off-by: Jacob McNamee <jacob@jacobmcnamee.com>
14 months agolxc-local: fix incorrect path to `templates` file
Jacob McNamee [Wed, 22 May 2024 13:44:17 +0000 (06:44 -0700)] 
lxc-local: fix incorrect path to `templates` file

Signed-off-by: Jacob McNamee <jacob@jacobmcnamee.com>
14 months agolxc-local: fix use of `LXC_PATH` before init
Jacob McNamee [Wed, 22 May 2024 13:34:08 +0000 (06:34 -0700)] 
lxc-local: fix use of `LXC_PATH` before init

Signed-off-by: Jacob McNamee <jacob@jacobmcnamee.com>
14 months agoMerge pull request #4446 from tenforward/japanese
Stéphane Graber [Tue, 21 May 2024 04:34:47 +0000 (06:34 +0200)] 
Merge pull request #4446 from tenforward/japanese

Update lxc-{attach,execute}.sgml.in

14 months agoUpdate lxc-execute.sgml.in 4446/head
KATOH Yasufumi [Fri, 17 May 2024 07:47:16 +0000 (16:47 +0900)] 
Update lxc-execute.sgml.in

Update for a7aa297

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
14 months agoUpdate lxc-{attach,execute}.sgml.in
KATOH Yasufumi [Fri, 17 May 2024 07:21:04 +0000 (16:21 +0900)] 
Update lxc-{attach,execute}.sgml.in

Update for 52bf34d and a7aa297

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
14 months agoMerge pull request #4441 from MMFuba/patch-2
Stéphane Graber [Mon, 13 May 2024 04:56:32 +0000 (06:56 +0200)] 
Merge pull request #4441 from MMFuba/patch-2

Update lxc-execute.sgml.in

14 months agoMerge pull request #4442 from MMFuba/patch-1
Stéphane Graber [Mon, 13 May 2024 03:57:15 +0000 (05:57 +0200)] 
Merge pull request #4442 from MMFuba/patch-1

Update lxc-attach.sgml.in

14 months agoUpdate lxc-execute.sgml.in 4441/head
MMFuba [Sun, 12 May 2024 19:17:57 +0000 (21:17 +0200)] 
Update lxc-execute.sgml.in

add hint to use numerical values for uid and gid

Signed-off-by: MMFuba <114305581+MMFuba@users.noreply.github.com>
14 months agoUpdate lxc-attach.sgml.in 4442/head
MMFuba [Sun, 12 May 2024 19:13:36 +0000 (21:13 +0200)] 
Update lxc-attach.sgml.in

added hint to use numerical value for uid and gid

Signed-off-by: MMFuba <114305581+MMFuba@users.noreply.github.com>
15 months agoMerge pull request #4432 from mihalicyn/ipv6_ebadf_fixup
Stéphane Graber [Mon, 8 Apr 2024 13:07:42 +0000 (09:07 -0400)] 
Merge pull request #4432 from mihalicyn/ipv6_ebadf_fixup

Don't fail veth creation if ipv6 is disabled

15 months agonetwork: netdev_configure_server_veth: reduce scope of disable_ipv6_fd/path vars 4432/head
Alexander Mikhalitsyn [Mon, 8 Apr 2024 10:29:08 +0000 (12:29 +0200)] 
network: netdev_configure_server_veth: reduce scope of disable_ipv6_fd/path vars

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
15 months agolxc/network: handle non-existing sysctl <ifname>/disable_ipv6
Alexander Mikhalitsyn [Mon, 8 Apr 2024 10:21:21 +0000 (12:21 +0200)] 
lxc/network: handle non-existing sysctl <ifname>/disable_ipv6

Skip writting to /proc/sys/net/ipv6/conf/<ifname>/disable_ipv6
if it does not exist.

Fixes: #4431
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
15 months agoMerge pull request #4428 from mihalicyn/new_meson_build_fixup
Stéphane Graber [Sat, 6 Apr 2024 21:26:00 +0000 (17:26 -0400)] 
Merge pull request #4428 from mihalicyn/new_meson_build_fixup

meson: fix build on NixOS

15 months agogithub: test the lxc multicall binary builds too 4428/head
Alexander Mikhalitsyn [Sat, 6 Apr 2024 20:11:12 +0000 (22:11 +0200)] 
github: test the lxc multicall binary builds too

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
15 months agomeson: fix build on NixOS
Alexander Mikhalitsyn [Fri, 5 Apr 2024 15:50:58 +0000 (17:50 +0200)] 
meson: fix build on NixOS

Fixes: #4427
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agomeson: Set DEVEL flag post release
Stéphane Graber [Wed, 3 Apr 2024 03:34:20 +0000 (23:34 -0400)] 
meson: Set DEVEL flag post release

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agoRelease LXC 6.0.0 v6.0.0
Stéphane Graber [Wed, 3 Apr 2024 03:33:26 +0000 (23:33 -0400)] 
Release LXC 6.0.0

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agoMerge pull request #4424 from stgraber/main
Serge Hallyn [Wed, 3 Apr 2024 02:47:03 +0000 (21:47 -0500)] 
Merge pull request #4424 from stgraber/main

Cleanup MAINTAINERS, COPYING and sort out SPDX headers

16 months agolxc.spec: Align SPDX license id 4424/head
Stéphane Graber [Wed, 3 Apr 2024 00:43:37 +0000 (20:43 -0400)] 
lxc.spec: Align SPDX license id

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agoMakefile: Align SPDX license id
Stéphane Graber [Wed, 3 Apr 2024 00:43:30 +0000 (20:43 -0400)] 
Makefile: Align SPDX license id

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agomeson: Align SPDX license id
Stéphane Graber [Wed, 3 Apr 2024 00:42:09 +0000 (20:42 -0400)] 
meson: Align SPDX license id

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agoCOPYING: Clarify licensing of files without SPDX
Stéphane Graber [Wed, 3 Apr 2024 00:29:39 +0000 (20:29 -0400)] 
COPYING: Clarify licensing of files without SPDX

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agodoc: Add SPDX headers and remove Author field
Stéphane Graber [Wed, 3 Apr 2024 00:23:13 +0000 (20:23 -0400)] 
doc: Add SPDX headers and remove Author field

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agosrc/include: Add SPDX headers
Stéphane Graber [Tue, 2 Apr 2024 22:31:26 +0000 (18:31 -0400)] 
src/include: Add SPDX headers

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agosrc/tests: Add SPDX headers
Stéphane Graber [Tue, 2 Apr 2024 22:24:10 +0000 (18:24 -0400)] 
src/tests: Add SPDX headers

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agohooks: Add SPDX headers
Stéphane Graber [Tue, 2 Apr 2024 21:59:17 +0000 (17:59 -0400)] 
hooks: Add SPDX headers

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agolxc.spec: Clear default changelog
Stéphane Graber [Tue, 2 Apr 2024 21:54:04 +0000 (17:54 -0400)] 
lxc.spec: Clear default changelog

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agolxc.spec: Use SPDX
Stéphane Graber [Tue, 2 Apr 2024 21:52:37 +0000 (17:52 -0400)] 
lxc.spec: Use SPDX

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agotemplate: Use SPDX
Stéphane Graber [Tue, 2 Apr 2024 21:51:55 +0000 (17:51 -0400)] 
template: Use SPDX

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agoconfig/yum: Use SPDX header
Stéphane Graber [Tue, 2 Apr 2024 21:50:03 +0000 (17:50 -0400)] 
config/yum: Use SPDX header

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agoCOPYING: Remove whitespace
Stéphane Graber [Tue, 2 Apr 2024 21:49:54 +0000 (17:49 -0400)] 
COPYING: Remove whitespace

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agoMAINTAINERS: Remove Dwight from the maintainer list
Stéphane Graber [Tue, 2 Apr 2024 21:45:23 +0000 (17:45 -0400)] 
MAINTAINERS: Remove Dwight from the maintainer list

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agoMerge pull request #4377 from adamcstephens/install-options
Stéphane Graber [Tue, 2 Apr 2024 17:46:34 +0000 (13:46 -0400)] 
Merge pull request #4377 from adamcstephens/install-options

build: add more options for customizing install

16 months agoMerge pull request #4423 from stgraber/main
Serge Hallyn [Tue, 2 Apr 2024 15:51:03 +0000 (10:51 -0500)] 
Merge pull request #4423 from stgraber/main

lxc-checkconfig improvements

16 months agolxc-checkconfig: Fix shellcheck 4423/head
Stéphane Graber [Tue, 2 Apr 2024 15:26:48 +0000 (11:26 -0400)] 
lxc-checkconfig: Fix shellcheck

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agolxc-checkconfig: Show namespace limits
Stéphane Graber [Tue, 2 Apr 2024 15:21:43 +0000 (11:21 -0400)] 
lxc-checkconfig: Show namespace limits

Closes #4259

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
16 months agoMerge pull request #4422 from mihalicyn/ct_list_fix
Stéphane Graber [Tue, 2 Apr 2024 14:53:31 +0000 (10:53 -0400)] 
Merge pull request #4422 from mihalicyn/ct_list_fix

lxc-ls: list names with whitespaces in `--active`.

16 months agolxc-ls: list names with whitespaces in `--active`. 4422/head
Edênis Freindorfer Azevedo [Wed, 15 Sep 2021 03:12:52 +0000 (00:12 -0300)] 
lxc-ls: list names with whitespaces in `--active`.

Fixes: #3970
Signed-off-by: Edênis Freindorfer Azevedo <edenisfa@gmail.com>
[ small fixes ]
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agoMerge pull request #4421 from mihalicyn/lxc_copy_fixes
Stéphane Graber [Tue, 2 Apr 2024 13:07:45 +0000 (09:07 -0400)] 
Merge pull request #4421 from mihalicyn/lxc_copy_fixes

lxc/tools: set default log_priority to ERROR

16 months agoMerge pull request #4418 from mihalicyn/cumulative_fixes_2apr2024
Stéphane Graber [Tue, 2 Apr 2024 13:05:54 +0000 (09:05 -0400)] 
Merge pull request #4418 from mihalicyn/cumulative_fixes_2apr2024

confile_utils: fix incorrect multiply_overflow test #2

16 months agoMerge pull request #4420 from mihalicyn/autostart_fix
Christian Brauner [Tue, 2 Apr 2024 12:55:51 +0000 (14:55 +0200)] 
Merge pull request #4420 from mihalicyn/autostart_fix

tools/lxc_autostart: don't fail when there are no containers

16 months agoMerge pull request #4419 from mihalicyn/fixup_mod_rdep
Christian Brauner [Tue, 2 Apr 2024 12:55:16 +0000 (14:55 +0200)] 
Merge pull request #4419 from mihalicyn/fixup_mod_rdep

lxc/lxccontainer: specify file mode in open() call inside mod_rdep

16 months agolxc/tools: set default log_priority to ERROR 4421/head
Alexander Mikhalitsyn [Tue, 2 Apr 2024 11:58:35 +0000 (13:58 +0200)] 
lxc/tools: set default log_priority to ERROR

For some reason, we don't have default log_priority
set for many tools which leads to the situation when
tools can fail silently even if error occurs.

Fixes: #4405
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agotools/lxc_autostart: don't fail when there are no containers 4420/head
Alexander Mikhalitsyn [Tue, 2 Apr 2024 11:43:08 +0000 (13:43 +0200)] 
tools/lxc_autostart: don't fail when there are no containers

Fixes: #3847
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agolxc/lxccontainer: specify file mode in open() call inside mod_rdep 4419/head
Alexander Mikhalitsyn [Tue, 2 Apr 2024 10:55:19 +0000 (12:55 +0200)] 
lxc/lxccontainer: specify file mode in open() call inside mod_rdep

We must explicitly specify file mode in open(.. O_CREAT ..).

Let's set 0644, while previously it was 0666 [1] which seems too much.

[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=libio/fileops.c;h=4db4a76f755b1f3b766dc47c669c09242395ec95;hb=HEAD#l216

Fixes: Coverity 1596044
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agolxc/confile: do not print excess space before scale suffix for time.offset.boot 4418/head
Alexander Mikhalitsyn [Tue, 2 Apr 2024 10:14:38 +0000 (12:14 +0200)] 
lxc/confile: do not print excess space before scale suffix for time.offset.boot

Let's make time.offset.boot and time.offset.monotonic getters consistent

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agolxc/confile: do not print newline symbol in getter for lxc.time.offset.*
Alexander Mikhalitsyn [Tue, 2 Apr 2024 09:46:29 +0000 (11:46 +0200)] 
lxc/confile: do not print newline symbol in getter for lxc.time.offset.*

It's clearly a mistake in the getters implementation.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agotests/parse_config_file: fix some typos
Alexander Mikhalitsyn [Tue, 2 Apr 2024 09:14:18 +0000 (11:14 +0200)] 
tests/parse_config_file: fix some typos

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agotests/parse_config_file: add tests for lxc.time.offset.*
Alexander Mikhalitsyn [Tue, 2 Apr 2024 09:13:21 +0000 (11:13 +0200)] 
tests/parse_config_file: add tests for lxc.time.offset.*

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agotree-wide: replace multiply_overflow with check_mul_overflow
Arnaud Fontaine [Tue, 2 Apr 2024 08:49:34 +0000 (10:49 +0200)] 
tree-wide: replace multiply_overflow with check_mul_overflow

Remove redundant multiply_overflow helper and use check_mul_overflow.

This also fixes a bug with incorrect handling for negative offset values.

Link: #4374

Signed-off-by: Arnaud Fontaine <arnaud.fontaine@airbus.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agoMerge pull request #4417 from mihalicyn/revert-3951-2021-08-25.fixes
Stéphane Graber [Mon, 1 Apr 2024 21:16:55 +0000 (17:16 -0400)] 
Merge pull request #4417 from mihalicyn/revert-3951-2021-08-25.fixes

Rework "lxccontainer: fixes" PR

16 months agolxccontainer: rework copy_file() 4417/head
Christian Brauner [Wed, 25 Aug 2021 14:11:55 +0000 (16:11 +0200)] 
lxccontainer: rework copy_file()

Signed-off-by: Christian Brauner <christian@brauner.io>
resurrect file_exists(new) check
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agolxccontainer: improve mod_rdep()
Christian Brauner [Wed, 25 Aug 2021 14:05:00 +0000 (16:05 +0200)] 
lxccontainer: improve mod_rdep()

Signed-off-by: Christian Brauner <christian@brauner.io>
O_RDWR -> O_WRONLY | O_CREAT
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agoRevert "lxccontainer: fixes"
Alexander Mikhalitsyn [Mon, 1 Apr 2024 15:23:48 +0000 (17:23 +0200)] 
Revert "lxccontainer: fixes"

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
16 months agoMerge pull request #3951 from brauner/2021-08-25.fixes
Stéphane Graber [Mon, 1 Apr 2024 13:21:05 +0000 (09:21 -0400)] 
Merge pull request #3951 from brauner/2021-08-25.fixes

lxccontainer: fixes

16 months agoMerge pull request #4416 from ffontaine/main
Stéphane Graber [Sun, 31 Mar 2024 01:13:21 +0000 (21:13 -0400)] 
Merge pull request #4416 from ffontaine/main

src/lxc/syscall_numbers.h: drop define -1

16 months agosrc/lxc/syscall_numbers.h: drop define -1 4416/head
Fabrice Fontaine [Sat, 30 Mar 2024 15:50:46 +0000 (16:50 +0100)] 
src/lxc/syscall_numbers.h: drop define -1

Drop "#define -1" to avoid the following m68k build failure with gcc 12:

In file included from ../src/lxc/syscall_wrappers.h:19,
                 from ../src/lxc/mount_utils.h:15,
                 from ../src/lxc/conf.h:24,
                 from ../src/lxc/log.h:19,
                 from ../src/lxc/storage/btrfs.c:20:
../src/lxc/syscall_numbers.h:423:25: error: macro names must be identifiers
  423 |                 #define -1
      |                         ^

Fixes:
 - http://autobuild.buildroot.org/results/f40a517eba86838b11b4b1d6a8a05b8233a3394d

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
16 months agoMerge pull request #4346 from zhongTao99/fix
Stéphane Graber [Tue, 26 Mar 2024 14:37:20 +0000 (10:37 -0400)] 
Merge pull request #4346 from zhongTao99/fix

containers in the FREEZING state also need to be unfreeze

16 months agoMerge pull request #4412 from petris/fix_rexec_free
Serge Hallyn [Sat, 23 Mar 2024 01:34:50 +0000 (20:34 -0500)] 
Merge pull request #4412 from petris/fix_rexec_free

rexec: Avoid invalid free in rexec failure path

16 months agorexec: Avoid invalid free in rexec failure path 4412/head
Petr Malat [Tue, 12 Mar 2024 12:28:29 +0000 (13:28 +0100)] 
rexec: Avoid invalid free in rexec failure path

Commit "rexec: free argv array on failure" used __do_free_string_list
as a destructor for argv, which is an array of pointers to a single
buffer and not an array of pointers to independent buffers, which leads
to an attempt to free invalid pointer whenever argv has more than one
element.

Structure argv as one memory block and use __do_free as the destructor.

Signed-off-by: Petr Malat <oss@malat.biz>
16 months agoMerge pull request #4414 from cjavad/main
Stéphane Graber [Mon, 18 Mar 2024 07:28:38 +0000 (03:28 -0400)] 
Merge pull request #4414 from cjavad/main

README: Correct 'armvl7' to 'armv7l'

16 months agoREADME: Correct 'armvl7' to 'armv7l' 4414/head
Javad Shafique [Sun, 17 Mar 2024 21:18:35 +0000 (22:18 +0100)] 
README: Correct 'armvl7' to 'armv7l'

Use the correct designation for the armv7l arch, as also reflected in src/lxc/confile.c.

Signed-off-by: Javad Shafique <javadshafique@hotmail.com>
16 months agoMerge pull request #4411 from hallyn/2024-03-11/simplify-lookup_name
Stéphane Graber [Mon, 11 Mar 2024 23:37:09 +0000 (19:37 -0400)] 
Merge pull request #4411 from hallyn/2024-03-11/simplify-lookup_name

unshare: simplify lookup_name

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