Open iklick opened 7 months ago
This appears to be the result of passing -r
when starting saslauthd: https://github.com/cyrusimap/cyrus-sasl/blob/ef0bafd15f5a541033c673e0e68993b07c16147a/saslauthd/saslauthd-main.c#L222-L223
This results in the realm being concatenated with the username, in addition to being passed as the realm: https://github.com/cyrusimap/cyrus-sasl/blob/ef0bafd15f5a541033c673e0e68993b07c16147a/saslauthd/saslauthd-main.c#L393-L404
It's a little unclear to me how auth_krb5
should be expected to behave in this situation; it's treating what it was told is the username as a username. Kerberos usernames are allowed to contain @
, so it probably shouldn't just assume that a username containing an @
contains a realm.
My personal inclination is that this should be considered a misconfiguration rather than a bug, but there are a few ways to potentially improve the user experience here:
-r
flag entirely, and reimplement realm concatenation as an option inside the mechanisms that require it.-r
when it is combined with an inappropriate mechanism.saslauthd-main.c
that exits with an error when -r
is used with an inappropriate mechanism.
Version: 2.1.28 Mechanism: kerberos5
I start up saslauthd and then test the kerberos5 configuration with testsaslauthd without specifying the realm which runs successfully
When I run testsaslauthd while specifying the realm though, I get a failure
Looking at the saslauthd debug output, I see the values set for user has the realm tacked on now:
saslauthd[296346] :auth failure: [user=testuser@ISAACCORP] [service=ldap] [realm=ISAACCORP] [mech=kerberos5] [reason=saslauthd internal error]
I added my own debugging lines right before the krb5_parse_name call in saslauthd's auth_krb5.c and I see that form_principal_name has doubled up the realm.
The output of this custom debugging is:
I think form_principal_name in auth_krb5.c should not add a realm if a realm has already been added to the username.