You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Brad Nicholes <BN...@novell.com> on 2006/02/10 01:14:58 UTC

Re: svn commit: r376473 - /apr/apr/trunk/test/testnames.c

>>> On 2/9/2006 at 3:58:15 pm, in message
<20...@minotaur.apache.org>, wrowe@apache.org
wrote:
> Author: wrowe
> Date: Thu Feb  9 14:58:14 2006
> New Revision: 376473
> 
> URL: http://svn.apache.org/viewcvs?rev=376473&view=rev 
> Log:
> 
>   Rules out netware from this scenario per Brad.
> 
> Modified:
>     apr/apr/trunk/test/testnames.c
> 
> Modified: apr/apr/trunk/test/testnames.c
> URL: 
>
http://svn.apache.org/viewcvs/apr/apr/trunk/test/testnames.c?rev=376473&r1=37

> 6472&r2=376473&view=diff
>
============================================================================
> ==
> --- apr/apr/trunk/test/testnames.c (original)
> +++ apr/apr/trunk/test/testnames.c Thu Feb  9 14:58:14 2006
> @@ -193,7 +193,7 @@
>  
>      rv = apr_filepath_root(&root, &path, APR_FILEPATH_TRUENAME, p);
>  
> -#if defined(WIN32) || defined(NETWARE) || defined(OS2)
> +#if defined(WIN32) || defined(OS2)
>      ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv);
>      ABTS_STR_EQUAL(tc, "//", root);
>  #els

This doesn't quite fix it either.  For NetWare the returns are

      ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv);
      ABTS_STR_EQUAL(tc, "/", root);

Brad 



Re: svn commit: r376473 - /apr/apr/trunk/test/testnames.c

Posted by Brad Nicholes <BN...@novell.com>.
>>> On 2/10/2006 at 1:47:40 pm, in message
<43...@rowe-clan.net>,
"William A. Rowe, Jr." <wr...@rowe-clan.net> wrote:
>> Bottom line is that neither of the results in the test seem valid
on
>> NetWare.  Returning APR_SUCCESS with a path of "/" seems wrong
because
>> an assumption is being made about what "/" means.  And returning
>> APR_EINCOMPLETE with a path of "//" seems wrong because the path
isn't
>> incomplete, it is invalid.
> 
> Successive slashes are legal (and should be compressed).

Right, and they are being compressed inside of apr_filepath_root(). 
That's why the NetWare result is a single '/' rather than a double. 
This is exactly what the Unix implementation is doing.


> 
> But I can see where you are right, if the Netware port doesn't accept
the
> '/foo' path, then it's wrong (but I thought '/foo' implies
local:sys/foo).
> So we should special-case this result on Netware.
> 
> I'm almost of a mind that since 'machine:vol\path' is the normal
syntax, and
> we have several platforms which support similar, that we might want
to 
> permit
> '//machine/vol/path' on Netware as a portable syntax, accepting
either 
> <shrug>.
> 
> Bill

The problem is that //machine/vol/path on NetWare can't be done without
really hacking up the code throughout. So to avoid that, several years
ago I created a module called mod_edir.  One of its functions is
supporting remote file system access.  But it only understands the
syntax 'machine\vol:\path' which is the common way of expressing a
remote file system path on NetWare.  Bascially what mod_edir does is
switch the file IO connection under the covers so that when the path
'vol:\path' is handed to the libc file IO routines, the file path is
assumed to be on a remote file system rather than local.   Bottom line
is that NetWare server to server file access is no where near seamless
due to all of the security policies enforced by the OS.  Which is the
reason for the existence of mod_edir.

Brad



Re: svn commit: r376473 - /apr/apr/trunk/test/testnames.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Brad Nicholes wrote:
>>>>On 2/10/2006 at 12:59:37 pm, in message
> 
> <43...@rowe-clan.net>,
> "William A. Rowe, Jr." <wr...@rowe-clan.net> wrote:
> 
>>Brad Nicholes wrote:
>>
>>>>>>On 2/9/2006 at 5:50:29 pm, in message
>>>
>>><43...@rowe-clan.net>,
>>>"William A. Rowe, Jr." <wr...@rowe-clan.net> wrote:
>>>
>>>
>>>>Brad Nicholes wrote:
>>>>
>>>>
>>>>>This doesn't quite fix it either.  For NetWare the returns are
>>>>>
>>>>>     ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv);
>>>>>     ABTS_STR_EQUAL(tc, "/", root);
>>>>
>>>>Ok I'm confused :)
>>>>
>>>>APR_EINCOMPLETE is a fatal condition.  Is the path "//foo/bar"
>>>
>>>valid?
>>>
>>>
>>>>If so, it's the result that's wrong.
>>>>
>>>>Bill
>>>
>>>
>>>So according to the logic that I am seeing for both Win32 and Unix,
>>>NetWare is a cross between them.  NetWare does not understand UNC
> 
> paths
> 
>>>so returning APR_EINCOMPLETE with "//" would be incorrect.  Also,
>>>returning APR_SUCCESS with "/" would be incorrect as well since a
>>>complete path would require a volume specifier such as "SYS:".  So
> 
> I
> 
>>>believe that what it is returning now, APR_EINCOMPLETE with "/" is
>>>correct on NetWare.
>>>
>>>Am I missing something?
>>
>>Yup.  On Win32/OS2, the path '/foo' root is 'c:/' path 'foo'.  The
> 
> result
> 
>>is complete because it was rooted (to currect drive).
>>
>>With UNC paths, the path '//' is incomplete because we don't know
> 
> the
> 
>>machine and drive.
>>
>>On Netware, is the path '/foo' sufficiently absolute?  I would think
> 
> it is.
> 
> No, not really because NetWare doesn't have a good concept of "current
> working directory".  IOW, if Apache starts from vol2:/apache2, calling
> getcwd() doesn't necessarily get you "vol2:/apache2" back.  Given a path
> of "/foo", NetWare will assume "sys:/foo" which isn't necessarily
> correct.
> 
> 
> 
>>Of course you can use 'bar:bash/foo', and 'bar/bash' is not absolute,
> 
> while
> 
>>the 'bar:/foo' or ':bash/foo' syntaxes are probably incomplete.
>>
>>The incomplete root result implies that the system can't figure out
> 
> how to
> 
>>break apart the path because some information is missing.  You can't,
> 
> on any
> 
>>UNC path, do a directory listing of '//foo/*'.  You can for
> 
> '//foo/bar/*' 
> 
>>and
>>you can for '/bash/*'.
>>
>>Bil
> 
> 
> Bottom line is that neither of the results in the test seem valid on
> NetWare.  Returning APR_SUCCESS with a path of "/" seems wrong because
> an assumption is being made about what "/" means.  And returning
> APR_EINCOMPLETE with a path of "//" seems wrong because the path isn't
> incomplete, it is invalid.

Successive slashes are legal (and should be compressed).

But I can see where you are right, if the Netware port doesn't accept the
'/foo' path, then it's wrong (but I thought '/foo' implies local:sys/foo).
So we should special-case this result on Netware.

I'm almost of a mind that since 'machine:vol\path' is the normal syntax, and
we have several platforms which support similar, that we might want to permit
'//machine/vol/path' on Netware as a portable syntax, accepting either <shrug>.

Bill


Re: svn commit: r376473 - /apr/apr/trunk/test/testnames.c

Posted by Brad Nicholes <BN...@novell.com>.
>>> On 2/10/2006 at 12:59:37 pm, in message
<43...@rowe-clan.net>,
"William A. Rowe, Jr." <wr...@rowe-clan.net> wrote:
> Brad Nicholes wrote:
>>>>>On 2/9/2006 at 5:50:29 pm, in message
>> 
>> <43...@rowe-clan.net>,
>> "William A. Rowe, Jr." <wr...@rowe-clan.net> wrote:
>> 
>>>Brad Nicholes wrote:
>>>
>>>>This doesn't quite fix it either.  For NetWare the returns are
>>>>
>>>>      ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv);
>>>>      ABTS_STR_EQUAL(tc, "/", root);
>>>
>>>Ok I'm confused :)
>>>
>>>APR_EINCOMPLETE is a fatal condition.  Is the path "//foo/bar"
>> 
>> valid?
>> 
>>>If so, it's the result that's wrong.
>>>
>>>Bill
>> 
>> 
>> So according to the logic that I am seeing for both Win32 and Unix,
>> NetWare is a cross between them.  NetWare does not understand UNC
paths
>> so returning APR_EINCOMPLETE with "//" would be incorrect.  Also,
>> returning APR_SUCCESS with "/" would be incorrect as well since a
>> complete path would require a volume specifier such as "SYS:".  So
I
>> believe that what it is returning now, APR_EINCOMPLETE with "/" is
>> correct on NetWare.
>> 
>> Am I missing something?
> 
> Yup.  On Win32/OS2, the path '/foo' root is 'c:/' path 'foo'.  The
result
> is complete because it was rooted (to currect drive).
> 
> With UNC paths, the path '//' is incomplete because we don't know
the
> machine and drive.
> 
> On Netware, is the path '/foo' sufficiently absolute?  I would think
it is.

No, not really because NetWare doesn't have a good concept of "current
working directory".  IOW, if Apache starts from vol2:/apache2, calling
getcwd() doesn't necessarily get you "vol2:/apache2" back.  Given a path
of "/foo", NetWare will assume "sys:/foo" which isn't necessarily
correct.


> Of course you can use 'bar:bash/foo', and 'bar/bash' is not absolute,
while
> the 'bar:/foo' or ':bash/foo' syntaxes are probably incomplete.
> 
> The incomplete root result implies that the system can't figure out
how to
> break apart the path because some information is missing.  You can't,
on any
> UNC path, do a directory listing of '//foo/*'.  You can for
'//foo/bar/*' 
> and
> you can for '/bash/*'.
> 
> Bil

Bottom line is that neither of the results in the test seem valid on
NetWare.  Returning APR_SUCCESS with a path of "/" seems wrong because
an assumption is being made about what "/" means.  And returning
APR_EINCOMPLETE with a path of "//" seems wrong because the path isn't
incomplete, it is invalid.

Brad





Re: svn commit: r376473 - /apr/apr/trunk/test/testnames.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Brad Nicholes wrote:
>>>>On 2/9/2006 at 5:50:29 pm, in message
> 
> <43...@rowe-clan.net>,
> "William A. Rowe, Jr." <wr...@rowe-clan.net> wrote:
> 
>>Brad Nicholes wrote:
>>
>>>This doesn't quite fix it either.  For NetWare the returns are
>>>
>>>      ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv);
>>>      ABTS_STR_EQUAL(tc, "/", root);
>>
>>Ok I'm confused :)
>>
>>APR_EINCOMPLETE is a fatal condition.  Is the path "//foo/bar"
> 
> valid?
> 
>>If so, it's the result that's wrong.
>>
>>Bill
> 
> 
> So according to the logic that I am seeing for both Win32 and Unix,
> NetWare is a cross between them.  NetWare does not understand UNC paths
> so returning APR_EINCOMPLETE with "//" would be incorrect.  Also,
> returning APR_SUCCESS with "/" would be incorrect as well since a
> complete path would require a volume specifier such as "SYS:".  So I
> believe that what it is returning now, APR_EINCOMPLETE with "/" is
> correct on NetWare.
> 
> Am I missing something?

Yup.  On Win32/OS2, the path '/foo' root is 'c:/' path 'foo'.  The result
is complete because it was rooted (to currect drive).

With UNC paths, the path '//' is incomplete because we don't know the
machine and drive.

On Netware, is the path '/foo' sufficiently absolute?  I would think it is.
Of course you can use 'bar:bash/foo', and 'bar/bash' is not absolute, while
the 'bar:/foo' or ':bash/foo' syntaxes are probably incomplete.

The incomplete root result implies that the system can't figure out how to
break apart the path because some information is missing.  You can't, on any
UNC path, do a directory listing of '//foo/*'.  You can for '//foo/bar/*' and
you can for '/bash/*'.

Bill

Re: svn commit: r376473 - /apr/apr/trunk/test/testnames.c

Posted by Brad Nicholes <BN...@novell.com>.
>>> On 2/9/2006 at 5:50:29 pm, in message
<43...@rowe-clan.net>,
"William A. Rowe, Jr." <wr...@rowe-clan.net> wrote:
> Brad Nicholes wrote:
>> 
>> This doesn't quite fix it either.  For NetWare the returns are
>> 
>>       ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv);
>>       ABTS_STR_EQUAL(tc, "/", root);
> 
> Ok I'm confused :)
> 
> APR_EINCOMPLETE is a fatal condition.  Is the path "//foo/bar"
valid?
> 
> If so, it's the result that's wrong.
> 
> Bill

So according to the logic that I am seeing for both Win32 and Unix,
NetWare is a cross between them.  NetWare does not understand UNC paths
so returning APR_EINCOMPLETE with "//" would be incorrect.  Also,
returning APR_SUCCESS with "/" would be incorrect as well since a
complete path would require a volume specifier such as "SYS:".  So I
believe that what it is returning now, APR_EINCOMPLETE with "/" is
correct on NetWare.

Am I missing something?

Brad

Re: svn commit: r376473 - /apr/apr/trunk/test/testnames.c

Posted by Brad Nicholes <bn...@novell.com>.
>>> On 2/9/2006 at 5:50 pm, in message <43...@rowe-clan.net>,
"William
A. Rowe, Jr." <wr...@rowe-clan.net> wrote:
> Brad Nicholes wrote:
>> 
>> This doesn't quite fix it either.  For NetWare the returns are
>> 
>>       ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv);
>>       ABTS_STR_EQUAL(tc, "/", root);
> 
> Ok I'm confused :)
> 
> APR_EINCOMPLETE is a fatal condition.  Is the path "//foo/bar"
valid?
> 
> If so, it's the result that's wrong.
> 
> Bil

That's what I was wondering.  I'll have to do a little debugging to see
why NetWare is getting that result.

Brad

Re: svn commit: r376473 - /apr/apr/trunk/test/testnames.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Brad Nicholes wrote:
> 
> This doesn't quite fix it either.  For NetWare the returns are
> 
>       ABTS_INT_EQUAL(tc, APR_EINCOMPLETE, rv);
>       ABTS_STR_EQUAL(tc, "/", root);

Ok I'm confused :)

APR_EINCOMPLETE is a fatal condition.  Is the path "//foo/bar" valid?

If so, it's the result that's wrong.

Bill