Makefile.am | 12 ++
Makefile.in | 70 +++++++++++++---
ldap/ldif/template-dse.ldif.in | 11 ++
ldap/servers/plugins/whoami/whoami.c | 146 +++++++++++++++++++++++++++++++++++
4 files changed, 224 insertions(+), 15 deletions(-)
New commits:
commit beaad2ce018235fa5bf4ae135d36e7b8bba8b909
Author: Anupam Jain <anjain(a)localhost.localdomain>
Date: Thu Jun 13 13:09:55 2013 -0700
Ticket 123 - Enhancement request:"whoami" extended operation
Description:
Makefile and template-dse.ldif.in containing whoami plugin
configuration
Reviewed by: nhosoi
https://fedorahosted.org/389/ticket/123
diff --git a/Makefile.am b/Makefile.am
index 7f00b07..37647b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -228,7 +228,8 @@ serverplugin_LTLIBRARIES = libacl-plugin.la libattr-unique-plugin.la
\
libreferint-plugin.la libreplication-plugin.la libretrocl-plugin.la \
libroles-plugin.la libstatechange-plugin.la libsyntax-plugin.la \
libviews-plugin.la libschemareload-plugin.la libusn-plugin.la \
- libacctusability-plugin.la librootdn-access-plugin.la $(LIBACCTPOLICY_PLUGIN) \
+ libacctusability-plugin.la librootdn-access-plugin.la \
+ libwhoami-plugin.la $(LIBACCTPOLICY_PLUGIN) \
$(LIBPAM_PASSTHRU_PLUGIN) $(LIBDNA_PLUGIN) \
$(LIBBITWISE_PLUGIN) $(LIBPRESENCE_PLUGIN) $(LIBPOSIX_WINSYNC_PLUGIN)
@@ -1297,7 +1298,16 @@ libviews_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
libviews_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK)
libviews_plugin_la_LDFLAGS = -avoid-version
+#------------------------
+# libwhoami-plugin
+#------------------------
+libwhoami_plugin_la_SOURCES = ldap/servers/plugins/whoami/whoami.c
+libwhoami_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
+libwhoami_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK)
+libwhoami_plugin_la_LDFLAGS = -avoid-version
+
+#------------------------
#////////////////////////////////////////////////////////////////
#
# Programs
diff --git a/Makefile.in b/Makefile.in
index e858d77..e8bea15 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -847,6 +847,14 @@ libviews_plugin_la_OBJECTS = $(am_libviews_plugin_la_OBJECTS)
libviews_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libviews_plugin_la_LDFLAGS) $(LDFLAGS) -o $@
+libwhoami_plugin_la_DEPENDENCIES = libslapd.la $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_libwhoami_plugin_la_OBJECTS = \
+ ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo
+libwhoami_plugin_la_OBJECTS = $(am_libwhoami_plugin_la_OBJECTS)
+libwhoami_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libwhoami_plugin_la_LDFLAGS) $(LDFLAGS) -o $@
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS)
am_dbscan_bin_OBJECTS = \
ldap/servers/slapd/tools/dbscan_bin-dbscan.$(OBJEXT)
@@ -1051,10 +1059,10 @@ SOURCES = $(libavl_a_SOURCES) $(libldaputil_a_SOURCES) \
$(libschemareload_plugin_la_SOURCES) $(libslapd_la_SOURCES) \
$(libstatechange_plugin_la_SOURCES) \
$(libsyntax_plugin_la_SOURCES) $(libusn_plugin_la_SOURCES) \
- $(libviews_plugin_la_SOURCES) $(dbscan_bin_SOURCES) \
- $(dsktune_bin_SOURCES) $(infadd_bin_SOURCES) \
- $(ldap_agent_bin_SOURCES) $(ldclt_bin_SOURCES) \
- $(ldif_bin_SOURCES) $(makstrdb_SOURCES) \
+ $(libviews_plugin_la_SOURCES) $(libwhoami_plugin_la_SOURCES) \
+ $(dbscan_bin_SOURCES) $(dsktune_bin_SOURCES) \
+ $(infadd_bin_SOURCES) $(ldap_agent_bin_SOURCES) \
+ $(ldclt_bin_SOURCES) $(ldif_bin_SOURCES) $(makstrdb_SOURCES) \
$(migratecred_bin_SOURCES) $(mmldif_bin_SOURCES) \
$(ns_slapd_SOURCES) $(pwdhash_bin_SOURCES) \
$(rsearch_bin_SOURCES)
@@ -1086,13 +1094,13 @@ DIST_SOURCES = $(libavl_a_SOURCES) $(libldaputil_a_SOURCES) \
$(am__libslapd_la_SOURCES_DIST) \
$(libstatechange_plugin_la_SOURCES) \
$(libsyntax_plugin_la_SOURCES) $(libusn_plugin_la_SOURCES) \
- $(libviews_plugin_la_SOURCES) $(dbscan_bin_SOURCES) \
- $(dsktune_bin_SOURCES) $(infadd_bin_SOURCES) \
- $(ldap_agent_bin_SOURCES) $(am__ldclt_bin_SOURCES_DIST) \
- $(ldif_bin_SOURCES) $(makstrdb_SOURCES) \
- $(migratecred_bin_SOURCES) $(mmldif_bin_SOURCES) \
- $(am__ns_slapd_SOURCES_DIST) $(pwdhash_bin_SOURCES) \
- $(rsearch_bin_SOURCES)
+ $(libviews_plugin_la_SOURCES) $(libwhoami_plugin_la_SOURCES) \
+ $(dbscan_bin_SOURCES) $(dsktune_bin_SOURCES) \
+ $(infadd_bin_SOURCES) $(ldap_agent_bin_SOURCES) \
+ $(am__ldclt_bin_SOURCES_DIST) $(ldif_bin_SOURCES) \
+ $(makstrdb_SOURCES) $(migratecred_bin_SOURCES) \
+ $(mmldif_bin_SOURCES) $(am__ns_slapd_SOURCES_DIST) \
+ $(pwdhash_bin_SOURCES) $(rsearch_bin_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -1497,7 +1505,8 @@ serverplugin_LTLIBRARIES = libacl-plugin.la libattr-unique-plugin.la
\
libreferint-plugin.la libreplication-plugin.la libretrocl-plugin.la \
libroles-plugin.la libstatechange-plugin.la libsyntax-plugin.la \
libviews-plugin.la libschemareload-plugin.la libusn-plugin.la \
- libacctusability-plugin.la librootdn-access-plugin.la $(LIBACCTPOLICY_PLUGIN) \
+ libacctusability-plugin.la librootdn-access-plugin.la \
+ libwhoami-plugin.la $(LIBACCTPOLICY_PLUGIN) \
$(LIBPAM_PASSTHRU_PLUGIN) $(LIBDNA_PLUGIN) \
$(LIBBITWISE_PLUGIN) $(LIBPRESENCE_PLUGIN) $(LIBPOSIX_WINSYNC_PLUGIN)
@@ -2494,6 +2503,15 @@ libviews_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
libviews_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK)
libviews_plugin_la_LDFLAGS = -avoid-version
+#------------------------
+# libwhoami-plugin
+#------------------------
+libwhoami_plugin_la_SOURCES = ldap/servers/plugins/whoami/whoami.c
+libwhoami_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
+libwhoami_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK)
+libwhoami_plugin_la_LDFLAGS = -avoid-version
+
+#------------------------
#////////////////////////////////////////////////////////////////
#
# Programs
@@ -4397,6 +4415,17 @@ ldap/servers/plugins/views/libviews_plugin_la-views.lo: \
ldap/servers/plugins/views/$(DEPDIR)/$(am__dirstamp)
libviews-plugin.la: $(libviews_plugin_la_OBJECTS) $(libviews_plugin_la_DEPENDENCIES)
$(EXTRA_libviews_plugin_la_DEPENDENCIES)
$(libviews_plugin_la_LINK) -rpath $(serverplugindir) $(libviews_plugin_la_OBJECTS)
$(libviews_plugin_la_LIBADD) $(LIBS)
+ldap/servers/plugins/whoami/$(am__dirstamp):
+ @$(MKDIR_P) ldap/servers/plugins/whoami
+ @: > ldap/servers/plugins/whoami/$(am__dirstamp)
+ldap/servers/plugins/whoami/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ldap/servers/plugins/whoami/$(DEPDIR)
+ @: > ldap/servers/plugins/whoami/$(DEPDIR)/$(am__dirstamp)
+ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo: \
+ ldap/servers/plugins/whoami/$(am__dirstamp) \
+ ldap/servers/plugins/whoami/$(DEPDIR)/$(am__dirstamp)
+libwhoami-plugin.la: $(libwhoami_plugin_la_OBJECTS) $(libwhoami_plugin_la_DEPENDENCIES)
$(EXTRA_libwhoami_plugin_la_DEPENDENCIES)
+ $(libwhoami_plugin_la_LINK) -rpath $(serverplugindir) $(libwhoami_plugin_la_OBJECTS)
$(libwhoami_plugin_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
@@ -4995,6 +5024,8 @@ mostlyclean-compile:
-rm -f ldap/servers/plugins/usn/*.lo
-rm -f ldap/servers/plugins/views/*.$(OBJEXT)
-rm -f ldap/servers/plugins/views/*.lo
+ -rm -f ldap/servers/plugins/whoami/*.$(OBJEXT)
+ -rm -f ldap/servers/plugins/whoami/*.lo
-rm -f ldap/servers/slapd/*.$(OBJEXT)
-rm -f ldap/servers/slapd/*.lo
-rm -f ldap/servers/slapd/back-ldbm/*.$(OBJEXT)
@@ -5201,6 +5232,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@
@am__quote@ldap/servers/plugins/usn/$(DEPDIR)/libusn_plugin_la-usn.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@ldap/servers/plugins/usn/$(DEPDIR)/libusn_plugin_la-usn_cleanup.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@ldap/servers/plugins/views/$(DEPDIR)/libviews_plugin_la-views.Plo(a)am__quote@
+@AMDEP_TRUE@@am__include@
@am__quote@ldap/servers/plugins/whoami/$(DEPDIR)/libwhoami_plugin_la-whoami.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@ldap/servers/slapd/$(DEPDIR)/ldap_agent_bin-agtmmap.Po(a)am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-add.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-agtmmap.Plo(a)am__quote@
@@ -8104,6 +8136,13 @@ ldap/servers/plugins/views/libviews_plugin_la-views.lo:
ldap/servers/plugins/vie
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS)
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
$(libviews_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o
ldap/servers/plugins/views/libviews_plugin_la-views.lo `test -f
'ldap/servers/plugins/views/views.c' || echo
'$(srcdir)/'`ldap/servers/plugins/views/views.c
+ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo:
ldap/servers/plugins/whoami/whoami.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS)
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
$(libwhoami_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT
ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo -MD -MP -MF
ldap/servers/plugins/whoami/$(DEPDIR)/libwhoami_plugin_la-whoami.Tpo -c -o
ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo `test -f
'ldap/servers/plugins/whoami/whoami.c' || echo
'$(srcdir)/'`ldap/servers/plugins/whoami/whoami.c
+@am__fastdepCC_TRUE@ $(am__mv)
ldap/servers/plugins/whoami/$(DEPDIR)/libwhoami_plugin_la-whoami.Tpo
ldap/servers/plugins/whoami/$(DEPDIR)/libwhoami_plugin_la-whoami.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ldap/servers/plugins/whoami/whoami.c'
object='ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo' libtool=yes
@AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp)
@AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS)
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
$(libwhoami_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o
ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo `test -f
'ldap/servers/plugins/whoami/whoami.c' || echo
'$(srcdir)/'`ldap/servers/plugins/whoami/whoami.c
+
ldap/servers/slapd/tools/dbscan_bin-dbscan.o: ldap/servers/slapd/tools/dbscan.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbscan_bin_CPPFLAGS)
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/slapd/tools/dbscan_bin-dbscan.o -MD
-MP -MF ldap/servers/slapd/tools/$(DEPDIR)/dbscan_bin-dbscan.Tpo -c -o
ldap/servers/slapd/tools/dbscan_bin-dbscan.o `test -f
'ldap/servers/slapd/tools/dbscan.c' || echo
'$(srcdir)/'`ldap/servers/slapd/tools/dbscan.c
@am__fastdepCC_TRUE@ $(am__mv) ldap/servers/slapd/tools/$(DEPDIR)/dbscan_bin-dbscan.Tpo
ldap/servers/slapd/tools/$(DEPDIR)/dbscan_bin-dbscan.Po
@@ -9279,6 +9318,7 @@ clean-libtool:
-rm -rf ldap/servers/plugins/uiduniq/.libs ldap/servers/plugins/uiduniq/_libs
-rm -rf ldap/servers/plugins/usn/.libs ldap/servers/plugins/usn/_libs
-rm -rf ldap/servers/plugins/views/.libs ldap/servers/plugins/views/_libs
+ -rm -rf ldap/servers/plugins/whoami/.libs ldap/servers/plugins/whoami/_libs
-rm -rf ldap/servers/slapd/.libs ldap/servers/slapd/_libs
-rm -rf ldap/servers/slapd/back-ldbm/.libs ldap/servers/slapd/back-ldbm/_libs
-rm -rf lib/base/.libs lib/base/_libs
@@ -9996,6 +10036,8 @@ distclean-generic:
-rm -f ldap/servers/plugins/usn/$(am__dirstamp)
-rm -f ldap/servers/plugins/views/$(DEPDIR)/$(am__dirstamp)
-rm -f ldap/servers/plugins/views/$(am__dirstamp)
+ -rm -f ldap/servers/plugins/whoami/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ldap/servers/plugins/whoami/$(am__dirstamp)
-rm -f ldap/servers/slapd/$(DEPDIR)/$(am__dirstamp)
-rm -f ldap/servers/slapd/$(am__dirstamp)
-rm -f ldap/servers/slapd/back-ldbm/$(DEPDIR)/$(am__dirstamp)
@@ -10034,7 +10076,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool
clean-local \
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR)
ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR)
ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR)
ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR)
ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR)
ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR)
ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR)
ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR)
ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR)
ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR)
ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR)
ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR)
ldap/servers/plugins/rever/$
(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR)
ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR)
ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR)
ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR)
ldap/servers/plugins/views/$(DEPDIR) ldap/servers/slapd/$(DEPDIR)
ldap/servers/slapd/back-ldbm/$(DEPDIR) ldap/servers/slapd/tools/$(DEPDIR)
ldap/servers/slapd/tools/ldclt/$(DEPDIR) ldap/servers/slapd/tools/rsearch/$(DEPDIR)
ldap/servers/snmp/$(DEPDIR) ldap/systools/$(DEPDIR) lib/base/$(DEPDIR)
lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR) lib/libadmin/$(DEPDIR)
lib/libsi18n/$(DEPDIR)
+ -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR)
ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR)
ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR)
ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR)
ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR)
ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR)
ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR)
ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR)
ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR)
ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR)
ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR)
ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR)
ldap/servers/plugins/rever/$
(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR)
ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR)
ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR)
ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR)
ldap/servers/plugins/views/$(DEPDIR) ldap/servers/plugins/whoami/$(DEPDIR)
ldap/servers/slapd/$(DEPDIR) ldap/servers/slapd/back-ldbm/$(DEPDIR)
ldap/servers/slapd/tools/$(DEPDIR) ldap/servers/slapd/tools/ldclt/$(DEPDIR)
ldap/servers/slapd/tools/rsearch/$(DEPDIR) ldap/servers/snmp/$(DEPDIR)
ldap/systools/$(DEPDIR) lib/base/$(DEPDIR) lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR)
lib/libadmin/$(DEPDIR) lib/libsi18n/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
@@ -10090,7 +10132,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR)
ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR)
ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR)
ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR)
ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR)
ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR)
ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR)
ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR)
ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR)
ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR)
ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR)
ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR)
ldap/servers/plugins/rever/$
(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR)
ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR)
ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR)
ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR)
ldap/servers/plugins/views/$(DEPDIR) ldap/servers/slapd/$(DEPDIR)
ldap/servers/slapd/back-ldbm/$(DEPDIR) ldap/servers/slapd/tools/$(DEPDIR)
ldap/servers/slapd/tools/ldclt/$(DEPDIR) ldap/servers/slapd/tools/rsearch/$(DEPDIR)
ldap/servers/snmp/$(DEPDIR) ldap/systools/$(DEPDIR) lib/base/$(DEPDIR)
lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR) lib/libadmin/$(DEPDIR)
lib/libsi18n/$(DEPDIR)
+ -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR)
ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR)
ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR)
ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR)
ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR)
ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR)
ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR)
ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR)
ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR)
ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR)
ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR)
ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR)
ldap/servers/plugins/rever/$
(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR)
ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR)
ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR)
ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR)
ldap/servers/plugins/views/$(DEPDIR) ldap/servers/plugins/whoami/$(DEPDIR)
ldap/servers/slapd/$(DEPDIR) ldap/servers/slapd/back-ldbm/$(DEPDIR)
ldap/servers/slapd/tools/$(DEPDIR) ldap/servers/slapd/tools/ldclt/$(DEPDIR)
ldap/servers/slapd/tools/rsearch/$(DEPDIR) ldap/servers/snmp/$(DEPDIR)
ldap/systools/$(DEPDIR) lib/base/$(DEPDIR) lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR)
lib/libadmin/$(DEPDIR) lib/libsi18n/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in
index 95ed60c..11595aa 100644
--- a/ldap/ldif/template-dse.ldif.in
+++ b/ldap/ldif/template-dse.ldif.in
@@ -738,6 +738,17 @@ nsslapd-pluginenabled: off
nsslapd-pluginbetxn: on
nsslapd-plugin-depends-on-type: database
+dn: cn=whoami,cn=plugins,cn=config
+objectclass: top
+objectclass: nsSlapdPlugin
+objectclass: extensibleObject
+cn: whoami
+nsslapd-pluginpath: libwhoami-plugin
+nsslapd-plugininitfunc: whoami_init
+nsslapd-plugintype: extendedop
+nsslapd-pluginenabled: on
+nsslapd-plugin-depends-on-type: database
+
dn: cn=RootDN Access Control,cn=plugins,cn=config
objectclass: top
objectclass: nsSlapdPlugin
commit 35e2b3883dd15cf5f32a07de5ac6f570c4c9bbc6
Author: Anupam Jain <anjain(a)localhost.localdomain>
Date: Tue Jun 11 16:51:00 2013 -0700
Ticket 123 - Enhancement request:"whoami" extended operation
Description:
whoami extended operation plugin that fetches the client authzid
associated with the client.
Reviewed by: nhosoi
https://fedorahosted.org/389/ticket/123
diff --git a/ldap/servers/plugins/whoami/whoami.c b/ldap/servers/plugins/whoami/whoami.c
new file mode 100644
index 0000000..f6f46bf
--- /dev/null
+++ b/ldap/servers/plugins/whoami/whoami.c
@@ -0,0 +1,146 @@
+/** BEGIN COPYRIGHT BLOCK
+ * This Program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; version 2 of the License.
+ *
+ * This Program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * In addition, as a special exception, Red Hat, Inc. gives You the additional
+ * right to link the code of this Program with code not covered under the GNU
+ * General Public License ("Non-GPL Code") and to distribute linked
combinations
+ * including the two, subject to the limitations in this paragraph. Non-GPL Code
+ * permitted under this exception must only link to the code of this Program
+ * through those well defined interfaces identified in the file named EXCEPTION
+ * found in the source code files (the "Approved Interfaces"). The files of
+ * Non-GPL Code may instantiate templates or use macros or inline functions from
+ * the Approved Interfaces without causing the resulting work to be covered by
+ * the GNU General Public License. Only Red Hat, Inc. may make changes or
+ * additions to the list of Approved Interfaces. You must obey the GNU General
+ * Public License in all respects for all of the Program code and other code used
+ * in conjunction with the Program except the Non-GPL Code covered by this
+ * exception. If you modify this file, you may extend this exception to your
+ * version of the file, but you are not obligated to do so. If you do not wish to
+ * provide this exception without modification, you must delete this exception
+ * statement from your version and license this file solely under the GPL without
+ * exception.
+ *
+ *
+ * Copyright (C) 2013 Red Hat, Inc.
+ * All rights reserved.
+ * END COPYRIGHT BLOCK **/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/**
+ * LDAP whoami extended operation plug-in
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "slapi-plugin.h"
+
+#define PLUGIN_NAME "whoami-plugin"
+#define PLUGIN_DESC "whoami extended operation plugin"
+#define WHOAMI_EXOP_REQUEST_OID "1.3.6.1.4.1.4203.1.11.3"
+
+static Slapi_PluginDesc expdesc = { PLUGIN_NAME, VENDOR, DS_PACKAGE_VERSION, PLUGIN_DESC
};
+
+static char *whoami_exop_oid_list[] = { WHOAMI_EXOP_REQUEST_OID, NULL };
+
+int whoami_init( Slapi_PBlock *pb );
+int whoami_exop( Slapi_PBlock *pb );
+
+/* Extended operation function */
+
+int whoami_exop( Slapi_PBlock *pb )
+{
+ struct berval *bval;
+ struct berval retbval;
+
+ Slapi_DN *dn = NULL;
+ char *client_dn = NULL;
+ char *fdn = NULL;
+ char *oid = NULL;
+ /* Get the OID and the value included in the request */
+
+ if ( slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_OID, &oid ) != 0 )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, PLUGIN_NAME, "Could not get OID from
request\n" );
+ slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not get OID from
request\n", 0, NULL );
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+ }
+
+ if ( slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_VALUE, &bval ) != 0 || bval->bv_val
!= NULL )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, PLUGIN_NAME, "Could not get
correct request value from request\n" );
+ slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not
get correct request value from request\n", 0, NULL );
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+ }
+
+ /* Fetch the client dn */
+
+ if( slapi_pblock_get( pb, SLAPI_CONN_DN, &client_dn ) !=0 )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, PLUGIN_NAME, "Could not get client_dn" );
+ slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not get
client_dn\n", 0, NULL );
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+ }
+
+ if( client_dn == NULL )
+ {
+ retbval.bv_val = NULL;
+ retbval.bv_len = 0;
+ }
+ else
+ {
+ fdn = slapi_ch_smprintf( "dn: %s", client_dn );
+ retbval.bv_val = fdn;
+ retbval.bv_len = strlen( retbval.bv_val );
+ }
+
+ /* Set the return value in pblock */
+
+ if ( slapi_pblock_set( pb, SLAPI_EXT_OP_RET_OID, NULL ) != 0 || slapi_pblock_set( pb,
SLAPI_EXT_OP_RET_VALUE, &retbval ) != 0 )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, PLUGIN_NAME, "Could not set return values"
);
+ slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not
set return values", 0, NULL );
+ slapi_ch_free_string( &client_dn );
+ slapi_ch_free_string( &fdn );
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+ }
+
+ /* Send the response back to client */
+
+ slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL );
+
+ /* Free any memory allocated by this plug-in. */
+
+ slapi_ch_free_string( &client_dn );
+ slapi_ch_free_string( &fdn );
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+}
+
+/* Initialization function */
+
+int whoami_init( Slapi_PBlock *pb )
+{
+
+ /* Register the plugin function as an extended operation plugin function */
+
+ if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_03 ) != 0 ||
slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, ( void * )&expdesc ) != 0 ||
slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, ( void * )whoami_exop ) != 0 ||
slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_OIDLIST, ( void * )whoami_exop_oid_list ) !=0 )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, PLUGIN_NAME, "whoami_init: Failed to register
plug-in.\n" );
+ return( -1 );
+ }
+
+ return( 0 );
+}
+