Skip to content

Commit 523be85

Browse files
authored
Merge pull request lxc#4567 from mihalicyn/various_fixes_jul2025
A bunch of fixes (Jul 2025)
2 parents 49b75bb + b3a5d28 commit 523be85

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

src/lxc/conf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2682,11 +2682,11 @@ static int __lxc_idmapped_mounts_child(struct lxc_handler *handler, FILE *f)
26822682
ret = parse_lxc_mount_attrs(&opts, mntent.mnt_opts);
26832683
if (ret < 0)
26842684
return syserror("Failed to parse LXC specific mount options");
2685-
__data = opts.data;
26862685

26872686
ret = parse_mount_attrs(&opts, mntent.mnt_opts);
26882687
if (ret < 0)
26892688
return syserror("Failed to parse mount options");
2689+
__data = opts.data;
26902690

26912691
/* No idmapped mount entry so skip it. */
26922692
if (is_empty_string(opts.userns_path))

src/lxc/network.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4183,6 +4183,7 @@ int lxc_network_recv_name_and_ifindex_from_child(struct lxc_handler *handler)
41834183
ret = lxc_recv_nointr(data_sock, netdev->name, IFNAMSIZ, 0);
41844184
if (ret < 0)
41854185
return -1;
4186+
netdev->name[IFNAMSIZ-1] = '\0';
41864187

41874188
/* Receive network device ifindex in the child's namespace to
41884189
* parent.

src/tests/lxc-test-rootfs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ set -ex
99
cleanup() {
1010
set +e
1111
lxc-destroy -n lxc-test-rootfs -f
12+
sed -i '/^root:910000:10000/d' /etc/subuid /etc/subgid
1213
if [ $PHASE != "done" ]; then
1314
echo "rootfs test failed at $PHASE"
1415
exit 1
@@ -48,4 +49,20 @@ mkdir /proc/$pid/root/rwtest || ro=1
4849
rmdir /proc/$pid/root/rwtest
4950
ro=0
5051

52+
lxc-stop -n lxc-test-rootfs -k
53+
PHASE=idmapped_rootfs
54+
echo "Starting phase $PHASE"
55+
usermod -v 910000-919999 -w 910000-919999 root
56+
sed -i '/lxc.rootfs.options/d' $config
57+
echo "lxc.idmap = u 0 910000 9999" >> $config
58+
echo "lxc.idmap = g 0 910000 9999" >> $config
59+
echo "lxc.rootfs.options = idmap=container" >> $config
60+
lxc-start -n lxc-test-rootfs
61+
pid=$(lxc-info -n lxc-test-rootfs -p -H)
62+
ro=0
63+
lxc-attach -n lxc-test-rootfs -- mkdir /rwtest || ro=1
64+
[ $ro -ne 1 ]
65+
rmdir /proc/$pid/root/rwtest
66+
ro=0
67+
5168
PHASE=done

src/tests/lxc-test-snapdeps

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
set -e
1616

17+
modprobe -v overlay || true
1718
if ! grep -q overlay /proc/filesystems; then
1819
echo "Not running this test as overlay is not available"
1920
exit 0

0 commit comments

Comments
 (0)