always skip symlinks in adjust_permissions#2644
always skip symlinks in adjust_permissions#2644akesandgren merged 9 commits intoeasybuilders:developfrom
Conversation
| @@ -1098,20 +1098,20 @@ def adjust_permissions(name, permissionBits, add=True, onlyfiles=False, onlydirs | |||
| perms = os.stat(path)[stat.ST_MODE] | |||
There was a problem hiding this comment.
This needs to be os.lstat to match the os.lchmod below
|
Have you had time to test this besides the test in the framework/filetools ? |
|
Hmmm, hasattr(os, 'lchmod') returns False on my Ubuntu 16.04 Python 2.7.12 system. lchown, lstat however should still be used. symlinks should just be ignored for chmod. |
|
@akesandgren Symbolic links are already skipped by default by So should we be changing anything? |
|
Would have to look at the code properly again.... I'll get back on it. |
|
@akesandgren deprecation of the now useless |
|
should we test this on all easyblocks that uses it? Worst case is that some block uses it with "follow symlinks" to use that sideeffect. And would then need two invocations instead. |
|
@akesandgren There are no easyblocks that use In any case, this will be tested thoroughly during the next regression test for EasyBuild v3.8.0... |
|
Ah yes, monday morning... |
This was pointed out by @akesandgren.
Using
os.lchmod&os.lchownprevents EasyBuild from trying to change permissions on files it has no business in changing, in case a symlink points to a file outside of the build/install directory...It probably also helps in avoiding problems like easybuilders/easybuild-easyblocks#1564