diff --git a/backend/ldap.go b/backend/ldap.go index 817cfdb8776bfeb5d8bee63603c881b14f2b8b1b..f4f5e4d6a529f320669aec3fc3a2160fd7cb2740 100644 --- a/backend/ldap.go +++ b/backend/ldap.go @@ -43,11 +43,16 @@ func (c *LDAPQueryConfig) Valid() error { } c.scope = s } + + // Since two different daemons use this code, with separate + // configs, and one of them does not need one of these + // attributes, it's more practical to set defaults rather than + // complain if values are unset. if c.PublicKeyAttr == "" { - return errors.New("empty public_key_attr") + c.PublicKeyAttr = "userPublicKey" } if c.PrivateKeyAttr == "" { - return errors.New("empty public_key_attr") + c.PrivateKeyAttr = "userEncryptedKey" } return nil }