diff options
-rw-r--r-- | service_passwords.c | 25 |
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 |