Hi, All! I've compiled Samba recently and I've found that my Win95 box and smbclient show UNIX shares as if they are empty. I set DEBUGLEVEL=10 and put a lot of additional DEBUG macro in Samba code. It lookes like readdirname() cut off first two characters from file names because of the strange behavior of readdir(). I've modified readdirname() to make it work by replacing readdir() with readdir_r(): /***********************************************/ char *readdirname(void *p) { static union{ struct dirent dir; char dummy[1024]; } buf; if (!p) return(NULL); if (readdir_r(p, &(buf.dir))==NULL ) return(NULL); unix_to_dos(buf.dir.d_name, True); #ifdef NEXT2 if (telldir(p) < 0) return(NULL); #endif return(buf.dir.d_name); } /***********************************************/ And it began to work properly. But I'm not sure I've corrected all the other things of this sort. I think there must be some way to correct it without surgery. If anybody knows proper compiler options or some other ways to correct strange behavoir of readdir(), please mail to me. My UNIX is SunOS 5.5.1, and I've compiled Samba with SPARC C compiler ver 4.0. I haven't changed CFLAGS setting in Makefile. I've never had any other C compilers in my SUN box, so I couldn't mix *.h files. Thanks for any ideas. Alex Likwintsev aliq@glasnet.ru
On Sat, 30 Aug 1997 Alex Likwintsev <aliq@glasnet.ru> wrote> It lookes like readdirname() cut off first two characters > from file names because of the strange behavior of readdir().This is a known behaviour on Solaris, when linking against the /usr/lib/libucb.a Make sure /usr/ucb is not in your search path when you compile (actuallyu, you should remove it forever, it does only harm, and NEVER specify -lucb when linking> I've never had any other C compilers in my SUN box, > so I couldn't mix *.h files.Having /usr/ucb before /usr/ccs/bin in your path makes cc do strange things /Niels Niels Baggesen, UNI-C, Olof Palmes Alle 38, DK-8200 Aarhus N, Denmark Email: Niels.Baggesen@uni-c.dk Tel: +45 89 37 66 69 Fax: +45 89 37 66 77