QNX 4 shows strange behavior when trying to mount and access linux samba file shares: you can't get contents of share root directory. Any subdirectory is listed OK. E.g. (/qnx/folder mounted to //linux/folder) QNX> ls /qnx/folder <nothing displayed> QNX> ls /qnx/folder/subfolder <contents of linux/folder/subfolder displayed> I have traced this problem back to smbd/reply.c check_path_syntax: QNX requests trans2_findfirst with pathname equal to "\." (backslash-and-point). As it is specified in reply.c, "component of pathname can't be '.' only". So, check_path_syntax returns error, and tran2_findfirst sends error packet back to QNX. It seem's be no way to force QNX use different pathname when requesting contents of mounted smb share root. I propose changing check_path_syntax to strip useless dirsep-and-point components from pathname: /* Component of pathname can't be "." only. */ < ret = NT_STATUS_OBJECT_NAME_INVALID; < num_bad_components++; < *d++ = *s++; > if(d==destname) > { > *d++='/'; /* \.(NUL) -> \(NUL) */ > continue; > } > s++; /* Just skip invalid pathname component */ continue; In my tests this seems be sufficent to make QNX happy.
No, we can't do this I'm afraid. check_path_syntax() matches the W2k3 parsing code perfectly for most of the incoming SMB requests. I've recently begun to suspect that findfirst/findnext have a varient of this that uses different code. If W2k3 accepts this pathname then I'll need to split this code out into a ff_check_path_syntax() function but please leave the original function alone. Jeremy.
I'm assuming that QNX has no problems with win2k3 file shares ?
Hmm... Can't check it with win2k server as I don't have one nearby. :-( Anyway, we have a problem here and we need to fix it. As fixing QNX is not an option, I think we have to fix samba one way or another. What do you think about introducing smb.conf global parameter to switch between strict (current) and relaxed (ignoring dirsep-dot path components) check_path_syntax rules ? Should I try to code it this way ?
If you need to fix your local copy do whatever hack you need :-). But in the longer term I'm going to split check_path_syntax() into a check_path_syntax() and check_path_syntax_ff() in the mainline code. Jeremy.
Is there any chances to integrate a fix into samba-3 source tree before ff_check_path_syntax is implemented ? Should I try to code this fix ? And if yes, then what do you see as appropriate way to trigger old/new behavior of check_path_syntax ? Is my idea of global config parameter good enough ?
No, splitting into c_p_s_ff() will be done for 3.0.14, that's the earliest I could fix this anyway. I really don't want to just hack the current working c_p_s() code. Jeremy.
is this still an issue with QNX? In any case it's not a samba but a qnx4 bug, so I'll close this one as it seems to be a qnx issue, right?