Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

zip file permissions

Discussion in 'General Discussion' started by darwin7, May 27, 2018.

  1. darwin7

    darwin7 Active Member

    Joined:
    Jun 9, 2011
    Messages:
    33
    Likes Received:
    4
    Trophy Points:
    58
    Location:
    Milan
    cPanel Access Level:
    Root Administrator
    Good morning

    I have some files zipped/compressed under Windows, and therefore they have no unix permissons set.

    I just discovered that:
    - if the file is unzipped using root, unzipped file's permissions are dirs=755,files=644
    - if the file is unzipped using any user account, unzipped file's permissions are dirs=775,files=664

    Therefore, if I unzip under user's account I got a 500 error until I manually fix the permissions to dirs=755,files=644.

    Is this a normal behavior?
    And why?

    Thank you
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,872
    Likes Received:
    89
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    Yes, the archive folders takes the permission of the user that has executed it, so that is a normal behavior..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. darwin7

    darwin7 Active Member

    Joined:
    Jun 9, 2011
    Messages:
    33
    Likes Received:
    4
    Trophy Points:
    58
    Location:
    Milan
    cPanel Access Level:
    Root Administrator
    Hi. No because it was compressed in Windows, so no unix permissions.
    I inspected the zip using zipinfo and seen that zip file has no permisions or username saved.

    However, what you say don't explain why different user got different permissions in uncompression. This is incoherent.
     
  4. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,872
    Likes Received:
    89
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    If you want to understand the statement properly, you can create 2 users, and upload the files to the user through individual user FTP account and then unzip it and see it yourself.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. darwin7

    darwin7 Active Member

    Joined:
    Jun 9, 2011
    Messages:
    33
    Likes Received:
    4
    Trophy Points:
    58
    Location:
    Milan
    cPanel Access Level:
    Root Administrator
    Hi

    But the problem is the permissions of files inside the zip file, not the zip file itself.
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @darwin7,

    The behavior you notice stems from the default umask value configured for new files in CentOS. You'd need to modify the default umask value from 002 to 022 in the following files if you want to globally change this behavior:

    /etc/profile
    /etc/bashrc


    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice