Bug 2511 - check_path_syntax and QNX interoperability
Summary: check_path_syntax and QNX interoperability
Status: RESOLVED INVALID
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.10
Hardware: x86 Linux
: P3 major
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-22 00:15 UTC by Sergey Kogan
Modified: 2013-09-02 11:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Kogan 2005-03-22 00:15:26 UTC
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.
Comment 1 Jeremy Allison 2005-03-22 08:32:25 UTC
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.
Comment 2 Gerald (Jerry) Carter (dead mail address) 2005-03-22 09:36:29 UTC
I'm assuming that QNX has no problems with win2k3 file shares ?
Comment 3 Sergey Kogan 2005-03-22 22:20:05 UTC
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 ?
Comment 4 Jeremy Allison 2005-03-22 23:23:20 UTC
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.
Comment 5 Sergey Kogan 2005-03-23 01:02:27 UTC
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 ?
Comment 6 Jeremy Allison 2005-03-23 09:36:18 UTC
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.
Comment 7 Björn Jacke 2013-09-02 11:26:02 UTC
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?