From: Noel Power Date: Mon, 23 Oct 2023 14:12:39 +0000 (+0100) Subject: s3:/winbindd: remove parse_domain_user_fstr X-Git-Tag: talloc-2.4.2~1160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6830b796ac8937c8171f8f834c17f0cb7acf68b5;p=thirdparty%2Fsamba.git s3:/winbindd: remove parse_domain_user_fstr Last caller of parse_domain_user_fstr has been removed so we can safely remove the function Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Oct 24 13:47:16 UTC 2023 on atb-devel-224 --- diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index 90433ee3a36..16e4e0ff14d 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -531,10 +531,6 @@ bool parse_domain_user(TALLOC_CTX *ctx, char **namespace, char **domain, char **user); -bool parse_domain_user_fstr(const char *domuser, - fstring namespace, - fstring domain, - fstring user); /** * Ensure an incoming username from NSS is fully qualified. Replace the * incoming username with DOMAIN user. Additionally returns diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 443f7c1a108..136d90c384c 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -1631,50 +1631,6 @@ fail: return false; } -/* Parse a DOMAIN\user or UPN string into a domain, namespace and a user */ -bool parse_domain_user_fstr(const char *domuser, - fstring namespace, - fstring domain, - fstring user) -{ - char *p = NULL; - - if (strlen(domuser) == 0) { - return false; - } - - p = strchr(domuser, *lp_winbind_separator()); - if (p != NULL) { - if (PTR_DIFF(p, domuser) >= sizeof(fstring)) { - DBG_ERR("index %td exceeds len of dest string %zu\n", - PTR_DIFF(p, domuser), - (sizeof(fstring) - 1)); - return false; - } - fstrcpy(user, p + 1); - fstrcpy(domain, domuser); - domain[PTR_DIFF(p, domuser)] = '\0'; - fstrcpy(namespace, domain); - } else { - fstrcpy(user, domuser); - - domain[0] = '\0'; - namespace[0] = '\0'; - p = strchr(domuser, '@'); - if (p != NULL) { - /* upn */ - fstrcpy(namespace, p + 1); - } else if (assume_domain(lp_workgroup())) { - fstrcpy(domain, lp_workgroup()); - fstrcpy(namespace, domain); - } else { - fstrcpy(namespace, lp_netbios_name()); - } - } - - return strupper_m(domain); -} - bool canonicalize_username(TALLOC_CTX *mem_ctx, char **pusername_inout, char **pnamespace,