From: Douglas Bagnall Date: Wed, 12 Nov 2025 22:35:50 +0000 (+1300) Subject: s4:kdc: do not fallback to "$$" if user is "$" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6414e111c785661c494a2dc9626fe716f705d24;p=thirdparty%2Fsamba.git s4:kdc: do not fallback to "$$" if user is "$" or from "" to "$", though I am not sure it is easy to get this far with an empty account name. Signed-off-by: Douglas Bagnall Reviewed-by: Jennifer Sutton --- diff --git a/source4/kdc/db-glue.c b/source4/kdc/db-glue.c index 522d9ff5b08..b3cb9c0dbc1 100644 --- a/source4/kdc/db-glue.c +++ b/source4/kdc/db-glue.c @@ -3459,7 +3459,7 @@ static krb5_error_code samba_kdc_lookup_client(krb5_context context, } len = strlen(fallback_account); - if (len >= 2 && fallback_account[len - 1] == '$') { + if (len == 0 || fallback_account[len - 1] == '$') { /* there is already a $, so no fallback */ TALLOC_FREE(fallback_account); TALLOC_FREE(fallback_realm);