summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2016-01-19 02:19:28 +0100
committerAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2016-01-19 02:22:57 +0100
commitae28abf7af8316a8193a70711ac0b84a5961fc66 (patch)
treee806443e326aa79211d280dc39faa7dcd603dec1
parent25620735bafa41e5ab3e93bfc15586b25c5dbf90 (diff)
downloadldap-plugin-ae28abf7af8316a8193a70711ac0b84a5961fc66.tar.gz
ldap-plugin-ae28abf7af8316a8193a70711ac0b84a5961fc66.tar.bz2
ldap-plugin-ae28abf7af8316a8193a70711ac0b84a5961fc66.zip
Check objectClass in is_service
All service accounts now have to have the serviceAccount object class.
-rw-r--r--service_passwords.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/service_passwords.c b/service_passwords.c
index 8c5d465..9b8f52a 100644
--- a/service_passwords.c
+++ b/service_passwords.c
@@ -135,14 +135,11 @@ static char* is_service(const char *dn)
char *service = NULL;
Slapi_Entry *entry = NULL;
- char *attrs[] = { "cn", NULL };
+ char *attrs[] = { "objectClass", "cn", NULL };
Slapi_Attr *attr = NULL;
struct berval **cn = NULL;
-
int rc = 0;
- /* TODO: check parent dn */
-
rc |= get_entry(dn, attrs, &entry);
if (rc != 0 || entry == NULL) {
/* dn not found */
@@ -150,6 +147,13 @@ static char* is_service(const char *dn)
goto fail1;
}
+ if (slapi_entry_attr_hasvalue(
+ entry, "objectClass", "serviceAccount") == 0) {
+ /* no serviceAccount */
+ service = NULL;
+ goto fail1;
+ }
+
rc |= slapi_entry_attr_find(entry, "cn", &attr);
if (rc != 0 || attr == NULL) {
/* no cn attribute */