When you have the following line in smb.conf: [test[foo].dir] the share name is set to "test[foo". On SVN you can see that both samba 3.0.x (iniparser.c) and samba 4.0 (params.c) truncate the name at the first ']'. Shouldn't '[' and ']' be both invalid or valid ? Windows systems can perfectly see and access shares containing '[' and ']' characters, but can't share themselves such share.
this is a limitation of the iniparser. Just use a registry share if you need something like this. The following works properly: # net conf addshare "M[y]share" /tmp/