s4:kdc: Have smb_krb5_principal_get_comp_string() properly indicate an error
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 20 Sep 2023 22:41:05 +0000 (10:41 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 26 Oct 2023 01:24:32 +0000 (01:24 +0000)
commit9a0c5ee4aefac943ee21e93af643b44e336c3563
tree331f429add3271e99e285197a66018e32c928845
parent2944bc1e02a279771a4514a09d1b92ef29d7a07d
s4:kdc: Have smb_krb5_principal_get_comp_string() properly indicate an error

The existing implementation did not differentiate between the case where
the relevant component was not present, and that where talloc_strndup()
failed. To correct this situation, put the result into an out parameter
on success and return an error on failure.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15482

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/krb5_wrap/krb5_samba.c
lib/krb5_wrap/krb5_samba.h
source4/dsdb/samdb/ldb_modules/acl.c
source4/kdc/db-glue.c