]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: do not fallback to "$$" if user is "$"
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 12 Nov 2025 22:35:50 +0000 (11:35 +1300)
committerJennifer Sutton <jsutton@samba.org>
Thu, 20 Nov 2025 21:25:39 +0000 (21:25 +0000)
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 <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
source4/kdc/db-glue.c

index 522d9ff5b082223eb19325e0015cfa7e61031710..b3cb9c0dbc18538c80db253a662b6959fecc7f3f 100644 (file)
@@ -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);