summaryrefslogtreecommitdiff
path: root/hack
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-08-27 08:12:56 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-08-27 08:13:01 -0400
commitdb60a1e654d2212fcc36145cf5e4ba0dd74ce622 (patch)
tree4074f0a4e0aed23846e8fdf986028eb258474300 /hack
parent6f61ef87afe6695ca6cbd6e3b818ef619b6d54da (diff)
downloadpodman-db60a1e654d2212fcc36145cf5e4ba0dd74ce622.tar.gz
podman-db60a1e654d2212fcc36145cf5e4ba0dd74ce622.tar.bz2
podman-db60a1e654d2212fcc36145cf5e4ba0dd74ce622.zip
Add support for libsubid
This will enable remote access to /etc/subuid and /etc/subgid information from ldap services, if shadow-utils ships with a libsubid. [NO TESTS NEEDED] Since we have no way to test this. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'hack')
-rwxr-xr-xhack/libsubid_tag.sh19
1 files changed, 19 insertions, 0 deletions
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