You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "Brian W. Fitzpatrick" <fi...@collab.net> on 2005/06/17 22:47:04 UTC

Bug in apr_dir_make_recursive (was Re: Bug report)

[cc'ing apr dev list]

On Jun 16, 2005, at 3:01 PM, Brian W. Fitzpatrick wrote:

> On Thu, 2005-06-16 at 15:49 -0400, John Peacock wrote:
>
>> Leon Koenig wrote:
>>
>>> bash-3.00$ mkdir blah; cd blah; rmdir ../blah
>>> bash-3.00$ svn checkout http://127.0.0.1/svn/test
>>> Segmentation fault
>>>
>>>
>>
>> Are you upset that it segfaults or that it doesn't smack you up  
>> side the
>> head for deleting the directory out from under yourself?  ;-)
>>
>> Following the same steps:
>>
>> $ cp ../something .
>> cp: cannot create regular file `./something': No such file or  
>> directory
>>
>> Is that more like what you expected?
>>
>
> It's what I would expect.  This is a bug in apr...
> apr_dir_make_recursive is going into an infinite loop.
>
> I'm working on this right now.

Patch attached.

APR devs, what say ye?

-Fitz

Log message
[[[
Fix bug where an attempt to create a directory at a relative path in a
non-existent CWD would send apr_dir_make_recursive into an infinite
loop (resulting in a segmentation fault).

* file_io/unix/dir.c, file_io/win32/dir.c (apr_dir_make_recursive):
   Return an error in the case of a zero length path.
]]]


Re: Bug in apr_dir_make_recursive (was Re: Bug report)

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 03:47 PM 6/17/2005, Brian W. Fitzpatrick wrote:

>Patch attached.
>
>APR devs, what say ye?

    if (!path[0]) {

would be much faster.

Otherwise +1 :)

Bill