Skip to content

Commit 33c5a68

Browse files
lxc/start.c: add initial protection from upstream
Signed-off-by: DreamConnected <1487442471@qq.com>
1 parent 431da5d commit 33c5a68

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

.github/workflows/code-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
-Dopenssl=false \
4646
-Ddbus=false \
4747
-Dandroid-log=true \
48+
-Dlandlock-monitor=true \
4849
--cross-file aarch64-android-api30.txt
4950
5051
meson compile -C build

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
-Dopenssl=true \
7575
-Ddbus=false \
7676
-Dandroid-log=true \
77+
-Dlandlock-monitor=true \
7778
--cross-file aarch64-android-api30.txt
7879
7980
meson compile -C build

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66

77
# Release tarballs.
88
lxc-*.tar.gz*
9-
/.github/workflows

src/lxc/start.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,10 +729,13 @@ int lxc_handler_mainloop(struct lxc_async_descr *descr, struct lxc_handler *hand
729729
pthread_t thread;
730730

731731
/* Skip protection if a seccomp proxy is setup. */
732+
#if HAVE_DECL_SECCOMP_NOTIFY_FD
732733
if (!handler || !handler->conf || handler->conf->seccomp.notifier.proxy_fd > 0) {
733734
/* Landlock not supported when seccomp notify is in use. */
734735
SYSERROR("Skipping Landlock due to seccomp notify");
735-
736+
#else
737+
if (!handler || !handler->conf) {
738+
#endif
736739
/* We don't need to use thread then */
737740
return lxc_mainloop(descr, -1);
738741
}

0 commit comments

Comments
 (0)