diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-02-20 13:16:01 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-02-20 13:16:01 +0000 |
commit | f6b8d6730452522f77852af0917cb48424d4c8a9 (patch) | |
tree | 780efc6bfa1bbd8f307e04719e4aacaeffe0eb30 /source/libsmb/clirap.c | |
parent | c40a1e4ebdb379482bf6e7d4efcc9b5321a4e7c6 (diff) | |
download | samba-f6b8d6730452522f77852af0917cb48424d4c8a9.tar.gz samba-f6b8d6730452522f77852af0917cb48424d4c8a9.tar.xz samba-f6b8d6730452522f77852af0917cb48424d4c8a9.zip |
converted a bunch more fns
Diffstat (limited to 'source/libsmb/clirap.c')
-rw-r--r-- | source/libsmb/clirap.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/source/libsmb/clirap.c b/source/libsmb/clirap.c index cd0e5ab73fd..d1ce4d712ee 100644 --- a/source/libsmb/clirap.c +++ b/source/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); } } } |