netapi: always return correct account name in NetUserGetInfo/NetUserEnum.
authorGünther Deschner <gd@samba.org>
Wed, 27 Aug 2008 17:26:37 +0000 (19:26 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 29 Aug 2008 11:58:00 +0000 (13:58 +0200)
Guenther
(This used to be commit 47768bfb01815f7b6bf687fe04ca7d19385aea59)

source3/lib/netapi/user.c

index 3c42f8b9315c2e4b5b5faa9ccdaa7208c60e3b19..887ab940025abad5e498a3d44dcc188d06e345e5 100644 (file)
@@ -748,7 +748,8 @@ static NTSTATUS libnetapi_samr_lookup_user_map_USER_INFO(TALLOC_CTX *mem_ctx,
 
        switch (level) {
                case 10:
-                       info10.usri10_name = talloc_strdup(mem_ctx, user_name);
+                       info10.usri10_name = talloc_strdup(mem_ctx,
+                               info21->account_name.string);
                        NT_STATUS_HAVE_NO_MEMORY(info10.usri10_name);
 
                        info10.usri10_comment = talloc_strdup(mem_ctx,
@@ -766,7 +767,8 @@ static NTSTATUS libnetapi_samr_lookup_user_map_USER_INFO(TALLOC_CTX *mem_ctx,
                        break;
 
                case 20:
-                       info20.usri20_name = talloc_strdup(mem_ctx, user_name);
+                       info20.usri20_name = talloc_strdup(mem_ctx,
+                               info21->account_name.string);
                        NT_STATUS_HAVE_NO_MEMORY(info20.usri20_name);
 
                        info20.usri20_comment = talloc_strdup(mem_ctx,
@@ -784,7 +786,8 @@ static NTSTATUS libnetapi_samr_lookup_user_map_USER_INFO(TALLOC_CTX *mem_ctx,
 
                        break;
                case 23:
-                       info23.usri23_name = talloc_strdup(mem_ctx, user_name);
+                       info23.usri23_name = talloc_strdup(mem_ctx,
+                               info21->account_name.string);
                        NT_STATUS_HAVE_NO_MEMORY(info23.usri23_name);
 
                        info23.usri23_comment = talloc_strdup(mem_ctx,