From e96a99f3e2b33525cf87eff3d2a13118f21c5186 Mon Sep 17 00:00:00 2001
From: Günther Deschner <gd@samba.org>
Date: Wed, 27 Aug 2008 19:25:07 +0200
Subject: netapi: add samr_acb_flags_to_netapi_flags for NetUserEnum and
 NetUserGetInfo.

Guenther
(This used to be commit 2f2c60bf91e1e2b3b24c4bb39ac598cb3c704158)
---
 source3/lib/netapi/user.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

(limited to 'source3/lib')

diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c
index 6e13a54528..3c42f8b931 100644
--- a/source3/lib/netapi/user.c
+++ b/source3/lib/netapi/user.c
@@ -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;
-- 
cgit