Description: Missing ptr check in mount.cifs.c at line 1566, so on my systen withour ipv6 it couse segfault when I try to mount samba shares. My patch, that solve problem publish below. Additional info: * Distr: Arch Linux * package version(s): smbclient (samba) 3.5.0-1, kernel26 2.6.32.9-1, glibc 2.11.1-1 * config and/or log files etc: default configs Steps to reproduce: 1. disable ipv6 1.1. network without ipv6 hosts 2. run command similar to: sudo mount.cifs //GAZ/torrents /home/hatred/smb4k/GAZ/torrents -o uid=1000,gid=101,port=445,rw,file_mode=0644,dir_mode=0755,perm,nosetuids,noserverino,nomapchars,iocharset=utf8,domain=GAZHOME,ip=192.168.1.2,guest Patch, that solve this issue: ~~~~~~~~~~~~~~~~~~~~~~~ begin cut here ~~~~~~~~~~~~~~~~~~~~~~~ --- mount.cifs.c.orig 2010-03-03 13:42:02.143936727 +1000 +++ mount.cifs.c 2010-03-04 01:53:22.752879004 +1000 @@ -1563,7 +1563,7 @@ } } - if (addr->ai_addr->sa_family == AF_INET6 && addr6->sin6_scope_id) { + if (addr && addr->ai_addr->sa_family == AF_INET6 && addr6->sin6_scope_id) { strlcat(options, "%", options_size); current_len = strnlen(options, options_size); optionstail = options + current_len; ~~~~~~~~~~~~~~~~~~~~~~~~ end cut here ~~~~~~~~~~~~~~~~~~~~~~~~
Created attachment 5448 [details] Patch that fixed this issue
Jeff, is there a chance to review the patch until tomorrow? If it's correct, we could include it in 3.5.2 then. Thanks!
Patch is correct and is already in cifs-utils 4.1. Should be fine for samba to take the same one.
*** This bug has been marked as a duplicate of bug 7315 ***