Skip to content

Commit 5071b24

Browse files
authored
Merge pull request #5783 from DrDaveD/without-seccomp-flag
Add mconfig --without-seccomp option
2 parents 94c3fa4 + aef9b06 commit 5071b24

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

mconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ fi
5757

5858
with_network=1
5959
with_suid=1
60+
with_seccomp_check=1
6061

6162
prefix=
6263
exec_prefix=
@@ -111,6 +112,7 @@ usage_args () {
111112
echo " Singularity options:"
112113
echo " --without-suid do not install SUID binary (linux only)"
113114
echo " --without-network do not compile/install network plugins (linux only)"
115+
echo " --without-seccomp do not compile/install seccomp support even if available"
114116
echo
115117
echo " Path modification options:"
116118
echo " --prefix install project in \`prefix'"
@@ -361,6 +363,8 @@ while [ $# -ne 0 ]; do
361363
with_suid=0; shift;;
362364
--without-network)
363365
with_network=0; shift;;
366+
--without-seccomp)
367+
with_seccomp_check=0; shift;;
364368
-V)
365369
if ! echo "$2" | awk '/^-.*/ || /^$/ { exit 2 }'; then
366370
echo "error: option requires an argument: $1"

mlocal/checks/project-post.chk

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,17 @@ fi
303303
########################
304304
# libseccomp dev
305305
########################
306-
printf " checking: libseccomp+headers... "
307-
seccomp_iflags=`pkg-config --cflags-only-I libseccomp 2>/dev/null || true`
308-
if ! printf "#include <seccomp.h>\nint main() { seccomp_syscall_resolve_name(\"read\"); }" | \
309-
$tgtcc $user_cflags $ldflags $seccomp_iflags -x c -o /dev/null - -lseccomp >/dev/null 2>&1; then
310-
tgtstatic=0
311-
echo "no"
312-
else
313-
echo "yes"
314-
appsec=1
306+
if [ "$with_seccomp_check" = "1" ];then
307+
printf " checking: libseccomp+headers... "
308+
seccomp_iflags=`pkg-config --cflags-only-I libseccomp 2>/dev/null || true`
309+
if ! printf "#include <seccomp.h>\nint main() { seccomp_syscall_resolve_name(\"read\"); }" | \
310+
$tgtcc $user_cflags $ldflags $seccomp_iflags -x c -o /dev/null - -lseccomp >/dev/null 2>&1; then
311+
tgtstatic=0
312+
echo "no"
313+
else
314+
echo "yes"
315+
appsec=1
316+
fi
315317
fi
316318

317319
########################

0 commit comments

Comments
 (0)