summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-08-28 12:07:25 +0200
committerGünther Deschner <gd@samba.org>2008-08-29 13:58:04 +0200
commitf14748ee45ad54751e732a9c384951dd755d7a2b (patch)
tree3842d4b5e94be453e4dcc7f37006f8c103d30dd4 /source3/lib
parentab627f40c092fa8b1254b590203f919c05ab13d7 (diff)
downloadsamba-f14748ee45ad54751e732a9c384951dd755d7a2b.tar.gz
samba-f14748ee45ad54751e732a9c384951dd755d7a2b.tar.bz2
samba-f14748ee45ad54751e732a9c384951dd755d7a2b.zip
netapi: add info21_to_USER_INFO_20.
Guenther (This used to be commit 93a5844814714cf07341bc2962dfac5c3e51d788)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/netapi/user.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c
index 8ce97bedcc..406d8fe6b5 100644
--- a/source3/lib/netapi/user.c
+++ b/source3/lib/netapi/user.c
@@ -762,6 +762,25 @@ static NTSTATUS info21_to_USER_INFO_10(TALLOC_CTX *mem_ctx,
/****************************************************************
****************************************************************/
+static NTSTATUS info21_to_USER_INFO_20(TALLOC_CTX *mem_ctx,
+ const struct samr_UserInfo21 *i21,
+ struct USER_INFO_20 *i)
+{
+ ZERO_STRUCTP(i);
+
+ i->usri20_name = talloc_strdup(mem_ctx, i21->account_name.string);
+ NT_STATUS_HAVE_NO_MEMORY(i->usri20_name);
+ i->usri20_comment = talloc_strdup(mem_ctx, i21->description.string);
+ i->usri20_full_name = talloc_strdup(mem_ctx, i21->full_name.string);
+ i->usri20_flags = samr_acb_flags_to_netapi_flags(i21->acct_flags);
+ i->usri20_user_id = i21->rid;
+
+ return NT_STATUS_OK;
+}
+
+/****************************************************************
+****************************************************************/
+
static NTSTATUS libnetapi_samr_lookup_user_map_USER_INFO(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *pipe_cli,
struct dom_sid *domain_sid,
@@ -834,19 +853,8 @@ static NTSTATUS libnetapi_samr_lookup_user_map_USER_INFO(TALLOC_CTX *mem_ctx,
break;
case 20:
- 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,
- info21->description.string);
-
- info20.usri20_full_name = talloc_strdup(mem_ctx,
- info21->full_name.string);
-
- info20.usri20_flags =
- samr_acb_flags_to_netapi_flags(info21->acct_flags);
- info20.usri20_user_id = rid;
+ status = info21_to_USER_INFO_20(mem_ctx, info21, &info20);
+ NT_STATUS_NOT_OK_RETURN(status);
ADD_TO_ARRAY(mem_ctx, struct USER_INFO_20, info20,
(struct USER_INFO_20 **)buffer, num_entries);