]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth: Simplify check_account()
authorVolker Lendecke <vl@samba.org>
Thu, 16 Oct 2025 11:07:23 +0000 (13:07 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 10 Nov 2025 13:29:30 +0000 (13:29 +0000)
We have strlower_talloc() for this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/auth/auth_util.c

index b7a81f09c9e9a05759ba1a0f49206049fb8edaf4..4ee158e025580b12931b9a8767a9308d9c6fb005 100644 (file)
@@ -1883,13 +1883,10 @@ static NTSTATUS check_account(TALLOC_CTX *mem_ctx, const char *domain,
        char *real_username = NULL;
        struct passwd *passwd;
 
-       lower_username = talloc_strdup(mem_ctx, username);
+       lower_username = strlower_talloc(mem_ctx, username);
        if (!lower_username) {
                return NT_STATUS_NO_MEMORY;
        }
-       if (!strlower_m( lower_username )) {
-               return NT_STATUS_INVALID_PARAMETER;
-       }
 
        orig_dom_user = talloc_asprintf(mem_ctx,
                                "%s%c%s",