From 2dad1cd88b29fcc46c92fed9a0427067cccd86fe Mon Sep 17 00:00:00 2001 From: Simon Pichugin Date: Jun 08 2018 19:04:28 +0000 Subject: Issue 49640 - Errors about PBKDF2 password storage plugin at server startup Bug description: Schema check errors are logged in the error log at start up. It happens because of the missing attributes that are required by nsslapdPlugin objectclass. Also we add the Password Storage Schemes two times: in config.c and in fedse.c. Fix description: Remove PBKDF2_SHA256 from slapd_bootstrap_config because setup_internal_backends will happen shortly after (during main.c). Another part of the fix - add nsslapd-pluginId, nsslapd-pluginVersion, nsslapd-pluginVendor, and nsslapd-pluginDescription attributes to fedse.c. The values don't matter because it will be rewritten shortly after from pwd_storage_scheme_init functions (still during the startup). https://pagure.io/389-ds-base/issue/49640 Reviewed by: mreynolds (Thanks!) --- diff --git a/ldap/servers/slapd/config.c b/ldap/servers/slapd/config.c index 9b3b5a6..1b6db8d 100644 --- a/ldap/servers/slapd/config.c +++ b/ldap/servers/slapd/config.c @@ -36,15 +36,6 @@ extern char *localuser; char *rel2abspath(char *); static char *bootstrap_plugins[] = { - "dn: cn=PBKDF2_SHA256,cn=Password Storage Schemes,cn=plugins,cn=config\n" - "objectclass: top\n" - "objectclass: nsSlapdPlugin\n" - "cn: PBKDF2_SHA256\n" - "nsslapd-pluginpath: libpwdstorage-plugin\n" - "nsslapd-plugininitfunc: pbkdf2_sha256_pwd_storage_scheme_init\n" - "nsslapd-plugintype: pwdstoragescheme\n" - "nsslapd-pluginenabled: on", - NULL }; diff --git a/ldap/servers/slapd/fedse.c b/ldap/servers/slapd/fedse.c index 9d9f6b8..001750a 100644 --- a/ldap/servers/slapd/fedse.c +++ b/ldap/servers/slapd/fedse.c @@ -126,7 +126,11 @@ static const char *internal_entries[] = "nsslapd-pluginpath: libpwdstorage-plugin\n" "nsslapd-plugininitfunc: pbkdf2_sha256_pwd_storage_scheme_init\n" "nsslapd-plugintype: pwdstoragescheme\n" - "nsslapd-pluginenabled: on\n", + "nsslapd-pluginenabled: on\n" + "nsslapd-pluginId: PBKDF2_SHA256\n" + "nsslapd-pluginVersion: none\n" + "nsslapd-pluginVendor: 389 Project\n" + "nsslapd-pluginDescription: PBKDF2_SHA256\n", "dn: cn=CRYPT-MD5,cn=Password Storage Schemes,cn=plugins,cn=config\n" "objectClass: top\n" @@ -135,7 +139,11 @@ static const char *internal_entries[] = "nsslapd-pluginPath: libpwdstorage-plugin\n" "nsslapd-pluginInitfunc: crypt_md5_pwd_storage_scheme_init\n" "nsslapd-pluginType: pwdstoragescheme\n" - "nsslapd-pluginEnabled: on\n", + "nsslapd-pluginEnabled: on\n" + "nsslapd-pluginId: CRYPT-MD5\n" + "nsslapd-pluginVersion: none\n" + "nsslapd-pluginVendor: 389 Project\n" + "nsslapd-pluginDescription: CRYPT-MD5\n", "dn: cn=CRYPT-SHA256,cn=Password Storage Schemes,cn=plugins,cn=config\n" "objectClass: top\n" @@ -144,7 +152,11 @@ static const char *internal_entries[] = "nsslapd-pluginPath: libpwdstorage-plugin\n" "nsslapd-pluginInitfunc: crypt_sha256_pwd_storage_scheme_init\n" "nsslapd-pluginType: pwdstoragescheme\n" - "nsslapd-pluginEnabled: on\n", + "nsslapd-pluginEnabled: on\n" + "nsslapd-pluginId: CRYPT-SHA256\n" + "nsslapd-pluginVersion: none\n" + "nsslapd-pluginVendor: 389 Project\n" + "nsslapd-pluginDescription: CRYPT-SHA256\n", "dn: cn=CRYPT-SHA512,cn=Password Storage Schemes,cn=plugins,cn=config\n" "objectClass: top\n" @@ -153,7 +165,11 @@ static const char *internal_entries[] = "nsslapd-pluginPath: libpwdstorage-plugin\n" "nsslapd-pluginInitfunc: crypt_sha512_pwd_storage_scheme_init\n" "nsslapd-pluginType: pwdstoragescheme\n" - "nsslapd-pluginEnabled: on\n", + "nsslapd-pluginEnabled: on\n" + "nsslapd-pluginId: CRYPT-SHA512\n" + "nsslapd-pluginVersion: none\n" + "nsslapd-pluginVendor: 389 Project\n" + "nsslapd-pluginDescription: CRYPT-SHA512\n", }; static int NUM_INTERNAL_ENTRIES = sizeof(internal_entries) / sizeof(internal_entries[0]);