Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#52 opendir doesn't work?

v0.9.1
closed-accepted
nobody
None
5
2002-05-09
2002-03-28
Anonymous
No

I have downloaded & installed the latest lxr version.

I have
always preferred python, php or csh-gawk-grep-sed to do scripting
stuff
over perl, so i will need your help here :)

My problem is
that when i point my browser to http://localhost/lxr/source
i
get a message that my src directory can't be read (although it is
guo+xrw)
So even though i get the header stuff of the page, etc i
don't get the contents
of the src dir in the browser.

Error is
in : lib/LXR/File/Plain.pm line 104

So what can the problem be?
I know that somehow apache must have access to that
directory. I
put a link from /usr/local/lxr to my source dir, so that permissions
in
.htacess apply to src dir too, but i still can't have access to
the src dir !!!
How can i solve this ??

Now, i tried to debug
Plain.pm, by printing some stuff, but the fact is i keep
getting
the error for line 104 again, although it is now 107! I have diabled

caching in the browser, so i guess it is apache who has cached the
Plain.pm
How can i solve this too??

Many thanks !

Manolis
Perakakis

Discussion

  • Robbie Ye
    Robbie Ye
    2002-04-28

    Logged In: YES
    user_id=507870

    Hi,

    I have an error reported at the same file, same line number,
    i.e. Plain.pm line 104. The complete error message is like this:

    ** Fatal: Can't open
    /home/robbieye/indexed-src/GEANT4/4.0/source/digits hits/ at
    /home/robbieye/lxr-0.9.1//lib/LXR/Files/Plain.pm line 104.

    I am using LXR 0.9.1 to cross reference Geant4 4.0 package.
    Every directory in the source tree is cross referenced and
    browsable except for this particular one with a '+' in the
    directory name: "digits+hits". So apparently the perl
    scripts changed the '+' to ' ' and so the opendir() fails

    Now let me explain my story more precisely. So, most of the
    things work fine, except for the following case.

    When I browse the parent directory of "digits+hits", which is:
    http://localhost.localdomain:8080/lxr/GEANT4/source/source/
    On the shown page, there is a link to the sub directory
    "digits+hits", the link is shown correctly
    as:http://localhost.localdomain:8080/lxr/GEANT4/source/source/digits%2Bhits/

    Then when I clicked on this link, the returned URL in the
    browser's (i'm using Opera) address bar is:
    http://localhost.localdomain:8080/lxr/GEANT4/source/source/digits%2Bhits/
    So this is still correct. But the return page itself
    contains the error message:
    ** Fatal: Can't open
    /home/robbieye/indexed-src/GEANT4/4.0/source/digits hits/ at
    /home/robbieye/lxr-0.9.1//lib/LXR/Files/Plain.pm line 104.

    Also, the directory title in the page is showed as "GEANT4/
    source/ digits hits/", so the '+' is substituted by a blank
    space somehow. And when I move my browser to the "digits
    hits" portion of this erroroneous link, it reads:
    http://localhost.localdomain:8080/lxr/GEANT4/source/source/digits%20hits/,
    so the "%2B" is changed to "%20" in the address.

    I knew little about Perl to fix the problem myself, can
    someone out there help me with this? Thank you very much,
    I'd be more than happy to verify your solutions! Actually i
    tried to look into the Perl scripts, and I stop at the
    function http_wash in file /lib/LXR/Common.pm and comment
    out the line: "$t =~ s/\+/ /g;", but the error is still
    there(i didn't restart my browser though).

    Robbie <robbieye@ccs.neu.edu>

     
  • Malcolm Box
    Malcolm Box
    2002-04-30

    Logged In: YES
    user_id=215386

    The problem is in http_wash in Common.pm. This function is
    quite aggressive in cleaning "special" characters out of
    input values, to prevent security attacks.

    I haven't done a full security check to see whether this
    could be relaxed somewhat, but if you're not so concerned
    about security the easiest thing to do is to remove the call
    to http_wash:

    $HTTP->{'path_info'} = http_wash($ENV{'PATH_INFO'});

    in the httpinit function in Common.pm.

     
  • Robbie Ye
    Robbie Ye
    2002-05-01

    Logged In: YES
    user_id=507870

    Yes, both ways worked, so either of these two:

    1) Remove the http_wash() call and do a direct assignment in
    httpinit()
    $HTTP->{'path_info'} = http_wash($ENV{'PATH_INFO'});
    i.e.
    $HTTP->{'path_info'} = $ENV{'PATH_INFO'};

    2) Comment out "$t =~ s/\+/ /g;", the 5th line in
    http_wash() function.
    Last time I forgot to hit refresh button after changing
    the Common.pm so what i saw is the cached page.

    Thanks a lot!
    Robbie

     
  • Malcolm Box
    Malcolm Box
    2002-05-09

    • status: open --> closed-accepted