netapi: add samr_acb_flags_to_netapi_flags for NetUserEnum and NetUserGetInfo.
authorGünther Deschner <gd@samba.org>
Wed, 27 Aug 2008 17:25:07 +0000 (19:25 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 29 Aug 2008 11:58:00 +0000 (13:58 +0200)
Guenther
(This used to be commit 2f2c60bf91e1e2b3b24c4bb39ac598cb3c704158)

source3/lib/netapi/user.c

index 6e13a54528419c3e118abc208ffc5181663c21ed..3c42f8b9315c2e4b5b5faa9ccdaa7208c60e3b19 100644 (file)
@@ -675,6 +675,18 @@ static NTSTATUS libnetapi_samr_lookup_user(TALLOC_CTX *mem_ctx,
 /****************************************************************
 ****************************************************************/
 
+static uint32_t samr_acb_flags_to_netapi_flags(uint32_t acb)
+{
+       uint32_t fl = UF_SCRIPT; /* god knows why */
+
+       fl |= ads_acb2uf(acb);
+
+       return fl;
+}
+
+/****************************************************************
+****************************************************************/
+
 static NTSTATUS libnetapi_samr_lookup_user_map_USER_INFO(TALLOC_CTX *mem_ctx,
                                                         struct rpc_pipe_client *pipe_cli,
                                                         struct dom_sid *domain_sid,
@@ -763,7 +775,8 @@ static NTSTATUS libnetapi_samr_lookup_user_map_USER_INFO(TALLOC_CTX *mem_ctx,
                        info20.usri20_full_name = talloc_strdup(mem_ctx,
                                info21->full_name.string);
 
-                       info20.usri20_flags = info21->acct_flags;
+                       info20.usri20_flags =
+                               samr_acb_flags_to_netapi_flags(info21->acct_flags);
                        info20.usri20_user_id = rid;
 
                        ADD_TO_ARRAY(mem_ctx, struct USER_INFO_20, info20,
@@ -780,7 +793,8 @@ static NTSTATUS libnetapi_samr_lookup_user_map_USER_INFO(TALLOC_CTX *mem_ctx,
                        info23.usri23_full_name = talloc_strdup(mem_ctx,
                                info21->full_name.string);
 
-                       info23.usri23_flags = info21->acct_flags;
+                       info23.usri23_flags =
+                               samr_acb_flags_to_netapi_flags(info21->acct_flags);
 
                        if (!sid_compose(&sid, domain_sid, rid)) {
                                return NT_STATUS_NO_MEMORY;