From 28177ca73bdbe3f8fb17a608db3df1a39e0e37a4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 17 Aug 1996 11:37:44 +0000 Subject: - added support for Amiga-unix (based on BSD I think) - changed the order of PROGS and SPROGS in Makefile (SPROGS first) - another 64 bit cleanup (for INADDR_NONE) - added paranoia code in DirCacheAdd() to detect looping - fixed important DirCache flush bug - rewrote the NetServerEnum code after I found it could return servers from multiple workgroups at once, and this could cause browsing havoc. Now a null workgroup query is equivalent to a query for the servers primary workgroup - got rid of my_workgroup() - got rid of "workgroup = *" comment in Makefile. We no longer support a workgroup of *, users must set the workgroup explicitly - the wins.dat file was being stored in a different format to what it was being loaded in - this could cause havoc. fixed. - uppercase our netbios name and the workgroup name at startup - if accept fails in main loop when running as a daemon then continue, don't just exit! - don't use ./ on smbclient in smbtar - better code to detect if a process exists (This used to be commit ec3d53963064b50ff33e8eff47812aac82f164ba) --- source3/smbd/dir.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/smbd/dir.c') diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 55a5983468..42bd54c270 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -631,6 +631,7 @@ add an entry to the directory cache ********************************************************************/ void DirCacheAdd(char *path,char *name,char *dname,int snum) { + int count; struct dir_cache *entry = (struct dir_cache *)malloc(sizeof(*entry)); if (!entry) return; entry->path = strdup(path); @@ -647,7 +648,12 @@ void DirCacheAdd(char *path,char *name,char *dname,int snum) DEBUG(4,("Added dir cache entry %s %s -> %s\n",path,name,dname)); if (dir_cache_size == DIRCACHESIZE) { - for (entry=dir_cache; entry->next; entry=entry->next) ; + for (entry=dir_cache, count=1; + entry->next && count < dir_cache_size; + entry=entry->next, count++) ; + if (entry->next || count != dir_cache_size) { + DEBUG(0,("DirCache bug - please report\n")); + } free(entry->path); free(entry->name); free(entry->dname); @@ -695,6 +701,7 @@ void DirCacheFlush(int snum) if (entry->next) entry->next->prev = entry->prev; if (dir_cache == entry) dir_cache = entry->next; free(entry); + dir_cache_size--; } else { next = entry->next; } -- cgit