sclorg / container-common-scripts

Apache License 2.0
20 stars 45 forks source link

Find Umask issue soon #119

Open hhorak opened 5 years ago

hhorak commented 5 years ago

With umask set to 077, the image build and test might fail. While we might not fix this properly, it would be good to find out that the umask is the cause soon by having explicit check for umask during:

praiskup commented 5 years ago

This is probably broken in docker, for buildah, I reported https://github.com/containers/buildah/issues/1305 some time ago.

praiskup commented 5 years ago

But of course, ADD sth somewhere files which are manually created files by make can cause problems as well.

pkubatrh commented 5 years ago

Just to sum up what issues we hit when investigating rhel8 CI issues (which had umask 077):

@kubco2 I hope did not forget anything

phracek commented 5 years ago

Just to sum up what issues we hit when investigating rhel8 CI issues (which had umask 077):

* when generating source files distgen only explicitly sets permissions for files, not for directories the files are located in

* when changing permissions during `assemble` the `fix-permission` script needs to run before any further cp/mv commands are called (via hooks for example) to avoid missing permissions outside directories on which the `fix-permission` script is called

@pkubatrh I guess, fix-permission script has to be run after mv commands if you want to fix permissions otherwise mv will not have correct permissions. For cp command -a is enough. Am I right?

* when copying files into new locations `-a` should be used to keep permissions in tact after ^ happens

@kubco2 I hope did not forget anything

pkubatrh commented 5 years ago

@pkubatrh I guess, fix-permission script has to be run after mv commands if you want to fix permissions otherwise mv will not have correct permissions

Afaik mv does not alter the inode of the file moved in any way so fix-permission should not need to be re-run after the move.

Edit: I noticed I had a mention of mv in my previous comment for some reason so I removed it to avoid further confusion.

ppisar commented 5 years ago

On Sun, Sep 22, 2019 at 10:56:09PM -0700, Petr Kubat wrote:

Afaik mv does not alter the inode of the file moved in any way so fix-permission should not need to be re-run after the move.

Only true when the source and the target live on the same file system. /tmp is usually a tmpfs on Fedora.