coren has submitted this change and it was merged.

Change subject: Add 'useldap' command line utility
......................................................................


Add 'useldap' command line utility

Allows easily running commands with LDAP nss turned on.

Change-Id: I8f4b52d4127a26f1e7be99e5df292055f035711c
---
M debian/changelog
M src/Makefile
A src/useldap
3 files changed, 19 insertions(+), 2 deletions(-)

Approvals:
  coren: Verified; Looks good to me, approved



diff --git a/debian/changelog b/debian/changelog
index 084a288..ba1b565 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,12 @@
+nfsd-ldap (1.2) unstable; urgency=low
+
+  * Add 'useldap' utility to manually run commands with LDAP nss
+
+ -- Marc A. Pelletier <m...@wikimedia.org>  Tue, 24 Nov 2015 11:02:40 -0500
+
 nfsd-ldap (1.1) unstable; urgency=low
 
-  * COrrect the shim script so that it passes its argument forward
+  * Correct the shim script so that it passes its argument forward
 
  -- Marc A. Pelletier <m...@wikimedia.org>  Mon, 23 Nov 2015 15:57:37 -0500
 
diff --git a/src/Makefile b/src/Makefile
index e96f56d..2563a67 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -11,8 +11,10 @@
 useldap.so: useldap.c
        gcc -rdynamic -fPIC -shared -Wl,-soname,useldap.so -o useldap.so 
useldap.c
 
-install: useldap.so rpc.mountd
+install: useldap.so rpc.mountd useldap
        install -d $(DESTDIR)/usr/lib/nfsd-ldap
        install -m 0755 useldap.so $(DESTDIR)/usr/lib/nfsd-ldap/useldap.so
        install -d $(DESTDIR)/usr/sbin
        install -m 0755 rpc.mountd $(DESTDIR)/usr/sbin/rpc.mountd
+       install -d $(DESTDIR)/usr/bin
+       install -m 0755 useldap $(DESTDIR)/usr/bin/useldap
diff --git a/src/useldap b/src/useldap
new file mode 100644
index 0000000..8431483
--- /dev/null
+++ b/src/useldap
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ $# -lt 2 ]; then
+  echo "usage: $0 command..." >&2
+  echo 'Runs "command" with LDAP nss turned on' >&2
+  exit 1
+fi
+
+LD_PRELOAD=/usr/lib/nfsd-ldap/useldap.so exec "$@"

-- 
To view, visit https://gerrit.wikimedia.org/r/255125
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f4b52d4127a26f1e7be99e5df292055f035711c
Gerrit-PatchSet: 2
Gerrit-Project: operations/debs/nfsd-ldap
Gerrit-Branch: master
Gerrit-Owner: coren <mpellet...@wikimedia.org>
Gerrit-Reviewer: coren <mpellet...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to