summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-06-04 18:49:13 +0000
committerJeremy Allison <jra@samba.org>1998-06-04 18:49:13 +0000
commit28029c73b75538cd2903965664c6bcc3f22d7230 (patch)
tree46aa6e531bdcb9c59ef8e4bfbb8b1a2f4b98edb1 /source3/client
parent1b85da9a1cd91c4d658ea50f1ed6545e85a0199a (diff)
downloadsamba-28029c73b75538cd2903965664c6bcc3f22d7230.tar.gz
samba-28029c73b75538cd2903965664c6bcc3f22d7230.tar.bz2
samba-28029c73b75538cd2903965664c6bcc3f22d7230.zip
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)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c209
1 files changed, 108 insertions, 101 deletions
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;i<count;i++)
- {
- char *sname = p;
- int type = SVAL(p,14);
- int comment_offset = IVAL(p,16) & 0xFFFF;
- fstring typestr;
- *typestr=0;
+ for (i=0;i<count;i++)
+ {
+ char *sname = p;
+ int type = SVAL(p,14);
+ int comment_offset = IVAL(p,16) & 0xFFFF;
+ fstring typestr;
+ *typestr=0;
- switch (type)
- {
- case STYPE_DISKTREE:
- fstrcpy(typestr,"Disk"); break;
- case STYPE_PRINTQ:
- fstrcpy(typestr,"Printer"); break;
- case STYPE_DEVICE:
- fstrcpy(typestr,"Device"); break;
- case STYPE_IPC:
- fstrcpy(typestr,"IPC"); break;
- }
+ switch (type)
+ {
+ case STYPE_DISKTREE:
+ fstrcpy(typestr,"Disk"); break;
+ case STYPE_PRINTQ:
+ fstrcpy(typestr,"Printer"); break;
+ case STYPE_DEVICE:
+ fstrcpy(typestr,"Device"); break;
+ case STYPE_IPC:
+ fstrcpy(typestr,"IPC"); break;
+ }
- printf("\t%-15.15s%-10.10s%s\n",
- sname,
- typestr,
- comment_offset?rdata+comment_offset-converter:"");
+ printf("\t%-15.15s%-10.10s%s\n",
+ sname, typestr,
+ comment_offset?rdata+comment_offset-converter:"");
- if (strlen(sname)>8) 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<count;i++) {
- char *sname = p2;
- int comment_offset = IVAL(p2,22) & 0xFFFF;
- printf("\t%-16.16s %s\n",
- sname,
- comment_offset?rdata+comment_offset-converter:"");
-
- ok=True;
- p2 += 26;
- }
+ for (i=0;i<count;i++) {
+ char *sname = p2;
+ int comment_offset = IVAL(p2,22) & 0xFFFF;
+ printf("\t%-16.16s %s\n", sname,
+ comment_offset?rdata+comment_offset-converter:"");
+
+ ok=True;
+ p2 += 26;
}
+
+ if(res == ERRmoredata)
+ printf("\nNOTE: More data was available, the list was truncated.\n");
}
+ }
if (rparam) {free(rparam); rparam = NULL;}
if (rdata) {free(rdata); rdata = NULL;}
@@ -3154,36 +3159,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 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<count;i++) {
- char *sname = p2;
- int comment_offset = IVAL(p2,22) & 0xFFFF;
- printf("\t%-16.16s %s\n",
- sname,
- comment_offset?rdata+comment_offset-converter:"");
+ for (i=0;i<count;i++) {
+ char *sname = p2;
+ int comment_offset = IVAL(p2,22) & 0xFFFF;
+ printf("\t%-16.16s %s\n", sname,
+ comment_offset?rdata+comment_offset-converter:"");
- ok=True;
- p2 += 26;
- }
+ ok=True;
+ p2 += 26;
}
+
+ if(res == ERRmoredata)
+ printf("\nNOTE: More data was available, the list was truncated.\n");
}
+ }
if (rparam) free(rparam);
if (rdata) free(rdata);