summaryrefslogtreecommitdiff
path: root/source3/libsmb/clirap.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-02-20 13:16:01 +0000
committerAndrew Tridgell <tridge@samba.org>2001-02-20 13:16:01 +0000
commit064898cf8ad604c3d0a7399964b122d4c53fe7df (patch)
tree8be01b511bd06b775ba1188c2c9c8e1eeb977429 /source3/libsmb/clirap.c
parentc28d3f635887c22713221d2df3c7aee5b53dc613 (diff)
downloadsamba-064898cf8ad604c3d0a7399964b122d4c53fe7df.tar.gz
samba-064898cf8ad604c3d0a7399964b122d4c53fe7df.tar.bz2
samba-064898cf8ad604c3d0a7399964b122d4c53fe7df.zip
converted a bunch more fns
(This used to be commit f6b8d6730452522f77852af0917cb48424d4c8a9)
Diffstat (limited to 'source3/libsmb/clirap.c')
-rw-r--r--source3/libsmb/clirap.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index cd0e5ab73f..d1ce4d712e 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -255,10 +255,9 @@ BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
p += 4;
SIVAL(p,0,stype);
p += 4;
-
- pstrcpy(p, workgroup);
- unix_to_dos(p, True);
- p = skip_string(p,1);
+
+ p += clistr_push(cli, p, workgroup, -1,
+ CLISTR_TERMINATE | CLISTR_CONVERT);
if (cli_api(cli,
param, PTR_DIFF(p,param), 8, /* params, length, max */
@@ -275,29 +274,38 @@ BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype,
count=SVAL(rparam,4);
p = rdata;
-
if (!(stype&0x80000000)) {
for (i = 0;i < count;i++, p += 26) {
- char *sname = p;
- int comment_offset = (IVAL(p,22) & 0xFFFF)-converter;
- char *cmnt = comment_offset?(rdata+comment_offset):"";
- if (comment_offset < 0 || comment_offset > rdrcnt) continue;
-
- stype = IVAL(p,18) & ~SV_TYPE_LOCAL_LIST_ONLY;
-
- dos_to_unix(sname, True);
- dos_to_unix(cmnt, True);
- fn(sname, stype, cmnt, state);
+ fstring sname, cmnt;
+ int comment_offset = (IVAL(p,22) & 0xFFFF)-converter;
+ char *cptr = comment_offset?(rdata+comment_offset):NULL;
+ if (comment_offset < 0 || comment_offset > rdrcnt) continue;
+
+ stype = IVAL(p,18) & ~SV_TYPE_LOCAL_LIST_ONLY;
+ clistr_pull(cli, sname, p,
+ sizeof(fstring), -1,
+ CLISTR_TERMINATE |
+ CLISTR_CONVERT);
+ fstrcpy(cmnt, "");
+ if (cptr) {
+ clistr_pull(cli, cmnt, cptr,
+ sizeof(fstring), -1,
+ CLISTR_TERMINATE |
+ CLISTR_CONVERT);
+ }
+ fn(sname, stype, cmnt, state);
}
}
else {
for (i = 0; i < count; i++, p+= 16) {
- char *sname = p;
-
- dos_to_unix(sname, True);
+ fstring sname;
- fn(sname, stype, NULL, state);
+ clistr_pull(cli, sname, p,
+ sizeof(fstring), -1,
+ CLISTR_TERMINATE |
+ CLISTR_CONVERT);
+ fn(sname, stype, NULL, state);
}
}
}