summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-08-27 13:24:56 -0400
committerGitHub <noreply@github.com>2021-08-27 13:24:56 -0400
commit8cd2f2fb80b26dc54bbb1f43ec44df16dee8f01b (patch)
treee4630311dc229fb1871f83e9769089f71b9537aa
parent266a3892f25d8cee508f421e718ba6f135ff7123 (diff)
parentdb60a1e654d2212fcc36145cf5e4ba0dd74ce622 (diff)
downloadpodman-8cd2f2fb80b26dc54bbb1f43ec44df16dee8f01b.tar.gz
podman-8cd2f2fb80b26dc54bbb1f43ec44df16dee8f01b.tar.bz2
podman-8cd2f2fb80b26dc54bbb1f43ec44df16dee8f01b.zip
Merge pull request #11339 from rhatdan/subid
Add support for libsubid
-rw-r--r--Makefile1
-rwxr-xr-xhack/libsubid_tag.sh19
2 files changed, 20 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 93c7fdf95..f9efafdba 100644
--- a/Makefile
+++ b/Makefile
@@ -50,6 +50,7 @@ BUILDTAGS ?= \
$(shell hack/btrfs_tag.sh) \
$(shell hack/selinux_tag.sh) \
$(shell hack/systemd_tag.sh) \
+ $(shell hack/libsubid_tag.sh) \
exclude_graphdriver_devicemapper \
seccomp
PYTHON ?= $(shell command -v python3 python|head -n1)
diff --git a/hack/libsubid_tag.sh b/hack/libsubid_tag.sh
new file mode 100755
index 000000000..ab6af9e30
--- /dev/null
+++ b/hack/libsubid_tag.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+if test $(${GO:-go} env GOOS) != "linux" ; then
+ exit 0
+fi
+tmpdir="$PWD/tmp.$RANDOM"
+mkdir -p "$tmpdir"
+trap 'rm -fr "$tmpdir"' EXIT
+cc -o "$tmpdir"/libsubid_tag -l subid -x c - > /dev/null 2> /dev/null << EOF
+#include <shadow/subid.h>
+int main() {
+ struct subid_range *ranges = NULL;
+ get_subuid_ranges("root", &ranges);
+ free(ranges);
+ return 0;
+}
+EOF
+if test $? -eq 0 ; then
+ echo libsubid
+fi