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.

Script does change permission - how to solve this?

Discussion in 'General Discussion' started by chris66, May 1, 2008.

  1. chris66

    chris66 Registered

    Joined:
    May 1, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    one of my scripts is changing permission of files in an folder. Author tells i should solve this using htaccess. But i have no idea how....

    Folder permission = 755
    If the script stores a file in it, the file itself has permission 600. If i change the file manually back to 755 it all works fine.

    Thanks in advance for any help or idea.

    Best regards,
    Christian
     
  2. anton_latvia

    anton_latvia Well-Known Member
    PartnerNOC

    Joined:
    May 11, 2004
    Messages:
    348
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    Latvia
    cPanel Access Level:
    Root Administrator
    May be ask "author" ? Anyway, how do you make those files - uploading by webserver, ftp, how? Are you server owner or a customer?

    Anton.
     
  3. chris66

    chris66 Registered

    Joined:
    May 1, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello Anton,

    thank you for your help.

    Author does not tell more to that - shaking head to that support, script is a commercial licensed one.

    I do not upload the files to server itself, the script does it (upload button,...) and stores it at the given directory. While saving it there, the script most change permission to unusable (600).

    I am the owner of a VPS host - but i have no skills about scripting or similar.
    All i need is a solution to prevent scripts to change permission of files in given folders.

    Any ideas welcome, Christian
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This may be a safeguard by the script to ensure only the user that created the file (whatever user the script runs as) has access to the file. This should only be an issue if you are not running SuPHP or similar setup.
     
  5. chris66

    chris66 Registered

    Joined:
    May 1, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello David,

    thanks for your input. In most cases you are right, that could be the reason for.
    But for my scripts this cant be - its a newsscroller which allows to show pics inside the news.
    All is working fine except the pic, its broken because of wrong permission.

    In addtition i cant check the scripts, they are enrypcted so i cant find out where it does change permission. As stated the autor sucks and does not help...

    Well, i think i will have to find a new one...I know there are many scrollers to find, but i need one with a userinterface for my customers...

    I was asking her for help because of the reply of my autor to ask the hostadmin...so i thought maybe is there a chance to set up anything to prevent those permission modify.

    Thanks again, Chris
     
  6. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    Sure, you can prevent permission changes from the file as long as your updates wont break because of it.

    chatter +i filename

    This makes the file immutable (or directory if you prefer) so permissions can not be changed, not even by root. To verify the file is set simply run:

    lsattr filename

    this will give the status with an "i" attribute if its set.

    And of course to remove the lock:

    chattr -i filename

    Good luck
     
Loading...

Share This Page