From 28029c73b75538cd2903965664c6bcc3f22d7230 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 4 Jun 1998 18:49:13 +0000 Subject: client.c: Allowed client to proceed even if it gets error 234 (more data available) when scanning server/workgroup/share lists. ipc.c: Removed redundent definition of ERROR_MORE_DATA (234) we already have ERRmoredata in smb.h Jeremy. (This used to be commit ae3510e9fb309be343e245d8460c1ceb8164077b) --- source3/client/client.c | 209 +++++++++++++++++++++++++----------------------- 1 file changed, 108 insertions(+), 101 deletions(-) (limited to 'source3/client') diff --git a/source3/client/client.c b/source3/client/client.c index 0628314f1e..86de850abf 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -2948,64 +2948,67 @@ static BOOL browse_host(BOOL sort) if (cli_call_api(PIPE_LANMAN, 0,PTR_DIFF(p,param),0, 0, 1024, BUFFER_SIZE, - &rprcnt,&rdrcnt, - param,NULL, NULL, - &rparam,&rdata)) - { - int res = SVAL(rparam,0); - int converter=SVAL(rparam,2); - int i; - BOOL long_share_name=False; + &rprcnt,&rdrcnt, + param,NULL, NULL, + &rparam,&rdata)) + { + int res = SVAL(rparam,0); + int converter=SVAL(rparam,2); + int i; + BOOL long_share_name=False; - if (res == 0) - { - count=SVAL(rparam,4); - p = rdata; + if (res == 0 || res == ERRmoredata) + { + count=SVAL(rparam,4); + p = rdata; - if (count > 0) - { - printf("\n\tSharename Type Comment\n"); - printf("\t--------- ---- -------\n"); - } + if (count > 0) + { + printf("\n\tSharename Type Comment\n"); + printf("\t--------- ---- -------\n"); + } - if (sort) - qsort(p,count,20,QSORT_CAST StrCaseCmp); + if (sort) + qsort(p,count,20,QSORT_CAST StrCaseCmp); - for (i=0;i8) long_share_name=True; + if (strlen(sname)>8) long_share_name=True; - p += 20; - } + p += 20; + } - if (long_share_name) { - printf("\nNOTE: There were share names longer than 8 chars.\nOn older clients these may not be accessible or may give browsing errors\n"); - } - } + if (long_share_name) { + printf("\nNOTE: There were share names longer than 8 chars.\n\ +On older clients these may not be accessible or may give browsing errors\n"); + } + + if(res == ERRmoredata) + printf("\nNOTE: More data was available, the list was truncated.\n"); } + } if (rparam) free(rparam); if (rdata) free(rdata); @@ -3115,36 +3118,38 @@ static BOOL list_servers(char *wk_grp) if (cli_call_api(PIPE_LANMAN, 0,PTR_DIFF(p+4,param),0, 0, 8, BUFFER_SIZE - SAFETY_MARGIN, - &rprcnt,&rdrcnt, - param,NULL, NULL, - &rparam,&rdata)) - { - int res = SVAL(rparam,0); - int converter=SVAL(rparam,2); - int i; - - if (res == 0) { - char *p2 = rdata; - count=SVAL(rparam,4); - - if (count > 0) { - printf("\n\nThis machine has a browse list:\n"); - printf("\n\tServer Comment\n"); - printf("\t--------- -------\n"); - } + &rprcnt,&rdrcnt, + param,NULL, NULL, + &rparam,&rdata)) + { + int res = SVAL(rparam,0); + int converter=SVAL(rparam,2); + int i; + + if (res == 0 || res == ERRmoredata) { + char *p2 = rdata; + count=SVAL(rparam,4); + + if (count > 0) { + printf("\n\nThis machine has a browse list:\n"); + printf("\n\tServer Comment\n"); + printf("\t--------- -------\n"); + } - for (i=0;i 0) { - printf("\n\nThis machine has a workgroup list:\n"); - printf("\n\tWorkgroup Master\n"); - printf("\t--------- -------\n"); - } + &rprcnt,&rdrcnt, + param,NULL, NULL, + &rparam,&rdata)) + { + int res = SVAL(rparam,0); + int converter=SVAL(rparam,2); + int i; + + if (res == 0 || res == ERRmoredata) { + char *p2 = rdata; + count=SVAL(rparam,4); + + if (count > 0) { + printf("\n\nThis machine has a workgroup list:\n"); + printf("\n\tWorkgroup Master\n"); + printf("\t--------- -------\n"); + } - for (i=0;i