The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unknown opendir calls

Discussion in 'General Discussion' started by Website Rob, Jul 30, 2003.

  1. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    I have been seeing lost of these lately, in my error_log:

    opendir(./../../../..): Permission denied at /usr/lib/perl5/5.6.1/FindBin.pm line 143

    PHP 4.3.1 running with safe_mod ON, nothing else security wise.


    As I do not know how to track down who or what is making the above type calls, I hoping someone can shed some light on this situation.

    cPanel.net Support Ticket Number:
     
  2. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    I am having this same problem now with a shopping cart script we use called InTheQ. Everything was working fine yesterday, but today it's not. The only thing we have done differently is that we were copying some accounts from one server to another with the multiple copy accounts feature. Today we are getting this error when trying to run our shopping cart script:

    opendir(./../../../..): Permission denied at /usr/lib/perl5/5.6.1/FindBin.pm line 143

    Can't locate Qenumeration.pm in @INC (@INC contains: //../Qscripts /usr/lib/perl5/5.6.1/i686-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i686-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at Qmenu.cgi line 86.

    BEGIN failed--compilation aborted at Qmenu.cgi line 86.

    Did you ever find a fix for this? When I run the script as root with ./Qmenu.cgi the error doesn't show up. But if I su username and then run the script in SSH as the user I get that error. It's obvious it has to do with permissions, but I haven't been able to figure it out yet.

    cPanel.net Support Ticket Number:
     
  3. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    Is your setup the same: PHP 4.3.1 running with safe_mod ON, nothing else security wise. (i.e., no phpsuexec)?

    At least you know what is causing the error. I had presumed it was a script call and probably PHP, but didn't know the 'intent' of why the call was being made. If it's a script error, that's one thing. If it's a malicious attempt, that's something totally different.

    Your script looks like it uses Perl and why it doesn't find everything it needs in: #!/usr/bin/perl - has me wondering. Have you contacted the script creator on this?

    cPanel.net Support Ticket Number:
     
  4. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    Thanks for your reply. We are and always have been running suexec. I have done a number of tests and have found the following so far...

    Cgi scripts DO run in the cgi-bin only! Until yesterday cgi scripts would run in any directory on the users account. So I put a test file (which does run in the cgi-bin) in the public_html direcoty and it gave a 500 internal server error. Here is what the suexec log shows:

    [2003-08-06 11:34:27]: info: (target/actual) uid: (easyhost/easyhost) gid: (easyhost/easyhost) cmd: test.cgi

    [2003-08-06 11:34:27]: error: target uid/gid (32003/32003) mismatch with directory (32003/99) or program (32003/32003) or trusted user (0/10)
    root@venus [/var/log]#


    I just checked and some how the group on my public_html directory got changed to nobody. So I changed it back to easyhost and now when I run the test.cgi file I get the 403 Forbidden error. After doing that I can't even run the test.cgi file that's in the cgi-bin, I get the same 403 error.

    Actually I just checked and all of the group settings of all my accounts on the public_html directory some how got changed to nobody. This sounds like an suexec problem to me. Still looking... Any suggestions? I have disabled suexec and then re-enabled it, but no luck.

    cPanel.net Support Ticket Number:
     
  5. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    Your tip on viewing the 'suexec_log' helped me to sort out my original question (thank you :)) and another error that was showing up as well. Seems a Client was trying to use some included scripts (cgi-sys) which I had shut down -- namely the FormMail scripts -- which caused the 'opendir' error. The other error was a Client mis-naming an image file. It was a 'png' image which was listed as 'py' so naturally it wouldn't run as script, hence the error.


    I duplicated your situation of taking a generic 'cgi/pl' script, that runs fine in the 'cgi-bin' and moved it to the 'public_html' dir -- it also ran fine, owner & permission were correctly set.

    A handy tip I can pass back is, when copying files in shell and wanting to keep the same "owner & file permissions", always use:

    # cp -p file_name /to/wherever


    I cannot see where any Cpanel release or version, would change GID to nobody? Something else could be going on there. BTW, I am using:

    WHM 7.2.0 cPanel 7.2.1-E104
    RedHat 7.3 - WHM X v2.1

    cPanel.net Support Ticket Number:
     
  6. nitromax

    nitromax Well-Known Member

    Joined:
    Feb 12, 2002
    Messages:
    189
    Likes Received:
    0
    Trophy Points:
    16
    Thanks for the cp -p tip. I knew there had to be a way to do that.

    I found out why the public_html group got changed to nobody. It's when we enabled the experamental feature in /scripts/easyapche. In doing reseach in the forum we found this link:

    http://forums.cpanel.net/showthread.php?s=&threadid=12506&highlight=cgi+scripts+not


    We ran the fixed version listed in that post, but it didn't help our situation any.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page