diff options
author | Gerald Carter <jerry@samba.org> | 2002-06-17 18:36:36 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2002-06-17 18:36:36 +0000 |
commit | 1e6e5b299c235b513095a76a4cd9fffc41e8fc9c (patch) | |
tree | 9f741529073ad411cc7328334e26d3e35b1d33f1 /source/nsswitch/winbindd_rpc.c | |
parent | a11c5d7ad07d259d764aede4745d13f8163a8212 (diff) | |
download | samba-1e6e5b299c235b513095a76a4cd9fffc41e8fc9c.tar.gz samba-1e6e5b299c235b513095a76a4cd9fffc41e8fc9c.tar.xz samba-1e6e5b299c235b513095a76a4cd9fffc41e8fc9c.zip |
beginning to sync up for 2.2.5 release....
Diffstat (limited to 'source/nsswitch/winbindd_rpc.c')
-rw-r--r-- | source/nsswitch/winbindd_rpc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/nsswitch/winbindd_rpc.c b/source/nsswitch/winbindd_rpc.c index 684ce5ac288..edf445a0ec9 100644 --- a/source/nsswitch/winbindd_rpc.c +++ b/source/nsswitch/winbindd_rpc.c @@ -23,6 +23,24 @@ #include "winbindd.h" +/******************************************************************* + Duplicate a UNISTR2 string into a UNIX codepage null terminated char* + using a talloc context +********************************************************************/ + +static char *unistr2_tdup(TALLOC_CTX *ctx, const UNISTR2 *str) +{ + char *s; + int maxlen = (str->uni_str_len+1)*4; + if (!str->buffer) + return NULL; + s = (char *)talloc(ctx, maxlen); /* convervative */ + if (!s) + return NULL; + unistr2_to_unix(s, str, maxlen); + return s; +} + /* Query display info for a domain. This returns enough information plus a bit extra to give an overview of domain users for the User Manager application. */ @@ -92,6 +110,7 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, } for (j=0;j<count;i++, j++) { + /* unistr2_tdup converts to UNIX charset. */ (*info)[i].acct_name = unistr2_tdup(mem_ctx, &info1.str[j].uni_acct_name); (*info)[i].full_name = unistr2_tdup(mem_ctx, &info1.str[j].uni_full_name); (*info)[i].user_rid = info1.sam[j].rid_user; |