diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-08-20 15:45:16 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-08-20 15:45:16 +0000 |
commit | 748d65a4ac898708dc7d2fd6f2bdee41489fee86 (patch) | |
tree | b54a4d77d71beba6e6422c366ecb17f57c172614 /source3/smbd/ipc.c | |
parent | 7f38abfbdb57b4ed33fa0aaacdfe7414d4c19a28 (diff) | |
download | samba-748d65a4ac898708dc7d2fd6f2bdee41489fee86.tar.gz samba-748d65a4ac898708dc7d2fd6f2bdee41489fee86.tar.bz2 samba-748d65a4ac898708dc7d2fd6f2bdee41489fee86.zip |
- fix a bug in NetServerEnum where counted and total were not counted
correctly if there were multiple instances of a name. This led to the
infamous "not enough memory" error when browsing (but this isn't the
only cause of that message)
- fix a triple-chaining bug which affected OpenX following a TconX
- fix a serious nmbd bug that meant nmdb would answer packets that it
wasn't supposed to, causing havoc with browse lists.
- never time out SELF packets. This is an interim fix until I find out
why nmbd thought they should be timed out.
(This used to be commit 2960c3908c2c3b01a1f2b77def60350018d298e1)
Diffstat (limited to 'source3/smbd/ipc.c')
-rw-r--r-- | source3/smbd/ipc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index 78a9807769..9da7c993dd 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -963,7 +963,7 @@ static BOOL api_RNetServerEnum(int cnum, int uid, char *param, char *data, int f_len, s_len; struct srv_info_struct *servers=NULL; int counted=0,total=0; - int i; + int i,missed; fstring domain; BOOL domain_request; BOOL local_request = servertype & SV_TYPE_LOCAL_LIST_ONLY; @@ -991,6 +991,7 @@ static BOOL api_RNetServerEnum(int cnum, int uid, char *param, char *data, total = get_server_info(servertype,&servers,domain); data_len = fixed_len = string_len = 0; + missed = 0; qsort(servers,total,sizeof(servers[0]),QSORT_CAST srv_comp); @@ -1006,12 +1007,13 @@ static BOOL api_RNetServerEnum(int cnum, int uid, char *param, char *data, DEBUG(4,("fill_srv_info %20s %8x %25s %15s\n", s->name, s->type, s->comment, s->domain)); - if (data_len <= buf_len) - { + if (data_len <= buf_len) { counted++; fixed_len += f_len; string_len += s_len; - } + } else { + missed++; + } } } @@ -1044,12 +1046,12 @@ static BOOL api_RNetServerEnum(int cnum, int uid, char *param, char *data, SSVAL(*rparam,0,NERR_Success); SSVAL(*rparam,2,0); SSVAL(*rparam,4,counted); - SSVAL(*rparam,6,total); + SSVAL(*rparam,6,counted+missed); if (servers) free(servers); DEBUG(3,("NetServerEnum domain = %s uLevel=%d counted=%d total=%d\n", - domain,uLevel,counted,total)); + domain,uLevel,counted,counted+missed)); return(True); } |