summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2016-11-11 21:06:02 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2016-11-11 21:06:34 +0100
commitbac7367d5d3b3140ccc12a908cc763e9b299f424 (patch)
treee036a25ebd37986dc686be610c895abaf8cd29a5
parent81fae820815a5f4c217b950ae4fb989f51e5180b (diff)
downloadldap-plugin-bac7367d5d3b3140ccc12a908cc763e9b299f424.tar.gz
ldap-plugin-bac7367d5d3b3140ccc12a908cc763e9b299f424.tar.bz2
ldap-plugin-bac7367d5d3b3140ccc12a908cc763e9b299f424.zip
get_service_dn: Get the service dn from service name
This is not really working, because the base_dn of the service accounts is missing. This will be added later.
-rw-r--r--service_passwords.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/service_passwords.c b/service_passwords.c
index 522b468..bde1906 100644
--- a/service_passwords.c
+++ b/service_passwords.c
@@ -445,6 +445,31 @@ static char *get_virtual_service(const char *dn)
return service;
}
+/** The DN of the service specified by name.
+ *
+ * This function builds the \c DN of a service from the service name and
+ * the base dn for the services.
+ *
+ * @param[in] service The name of the service.
+ * @return Pointer to the service dn. The caller is responsible for freeing
+ * it with \c slapi_ch_free_string.
+ */
+static char *get_service_dn(const char *service)
+{
+ char *new_dn = NULL;
+ char *base_dn = NULL;
+ Slapi_RDN *rdn = NULL;
+
+ /* TODO: Get base_dn */
+
+ rdn = slapi_rdn_new();
+ slapi_rdn_add(rdn, "cn", service);
+ new_dn = slapi_dn_plus_rdn(base_dn, slapi_rdn_get_rdn(rdn));
+ slapi_rdn_free(&rdn);
+
+ return new_dn;
+}
+
/** \c PRE_BIND plugin to allow password fallback.
*
* This function is called before a bind operation. If the BIND_DN is a user