umask on two hosts identical ( 0027 )

Still when i unzip the same file ( MD5 match), the permissions of same unzipped file differ in directory and file permission in two hosts.

How can it be possible ?

  • 1
    What versions of unzip? What file system types? What options are you passing? You tell us what's different. – Mikel Sep 21 '15 at 4:38
  • unzip 5.52 , ext3 FS, 2.6.39-400.109.1.el5uek kernel – Novice User Sep 21 '15 at 18:37
  • How do the permissions differ? Copy-paste the output of ls -la in a directory that was unzipped. – Gilles 'SO- stop being evil' Sep 21 '15 at 22:44
  • What does getfacl . print in the directory where you're extracting the ZIP files on both machines? – Mikel Sep 22 '15 at 1:26
  • @Mikel : user::rwx group::r-x other::--- and on other host, for other it is --x – Novice User Sep 22 '15 at 1:33

Firstly, I'm assuming that the command you are running is identical. There are a few reasons that spring to mind:

  • The unzip command may be a different version which has different behaviour.
  • The effective umask in the shell you run the command from may not match the host umask of 0027. Usually this would be because you set it in ~/.profile or similar. You can determine this by just running "umask" in the shell.
  • Other host based differences. What are the file system types in each case? What are the mount options? Are they all linux hosts, or are there BSD and other unices involved?
  • It's been a while -- does/can zip preserve permissions? – Jeff Schaller Sep 21 '15 at 12:23
  • I am using same unzip command viz unzip <filename> and there is no ~/.profile in both hosts. – Novice User Sep 21 '15 at 18:37
  • @JeffSchaller: Not in the standard format, but you can do it through extended attributes which some *nix implementations of unzip will interpret. As I understand it though, the question is about why the unzip command is not behaving identically given similar environments. – Matthew Sharp Sep 22 '15 at 1:19
  • @NoviceUser: The umask may possibly be set by other mechanisms. What is the actual umask reported by the shells that you run unzip from? – Matthew Sharp Sep 22 '15 at 1:23
  • @MatthewSharp : It is 0027 – Novice User Sep 22 '15 at 1:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.