Midnight Commander and SMB

Stephen Langasek vorlon at netexpress.net
Fri Jan 8 17:31:53 GMT 1999


On Sat, 9 Jan 1999, Dan M. wrote:

> Ok, a backtrace:

> #0  0x404bfdc4 in strncmp ()
> #1  0x4001a2b8 in smbw_path (path=0x0) at smbwrapper/smbw.c:353
> #2  0x4001caae in mkdir (name=0x0, mode=0) at smbwrapper/wrapped.c:344
> smbw_path->/usr/local/lib/libgnome.so.31
> #3  0x4040c86e in lock () at gnome-metadata.c:144
> #4  0x4040e19d in gnome_metadata_get (
>     file=0x818d5b8 "/home/daniel/desktop/Home directory",
>     name=0x81129bb "icon-position", size=0xbffffc0c, buffer=0xbffffc08)
>     at gnome-metadata.c:1000

> I'm not sure then who's bug this is :) for some reason,
> gnome-metadata.c:144 is calling mkdir() with a NULL pointer
> for the first argument. This doesn't cause a problem under
> normal circumstances (?)

According to my (linux) manpages, mkdir should return -1 and set errno to
EFAULT here.  So it's an smbwrapper bug.  Of course, it may also be a
gnome bug--it seems odd that gnome would deliberately call mkdir with a
null pointer.  Would check if I had the gnome sources handy atm..

-Steve Langasek

> Running under smbwrapper, smbw_path() in smbw.c doesn't check if path is
> a null pointer so the first call to strncmp() in that function causes a
> segfault. Adding:

>      if (path==NULL)
>                 return(0);
> 
> immediately before/after the comment about BSD malloc and recompiling,
> gmc starts up gracefully, desktop icons and all. I don't know what
> other programs this is likely to break, however.



More information about the samba-technical mailing list