Jenkins: Permission denied to a 777 file
Permissions on a file are important, but so are permissions on the super directories of that file.
If you do not have read and execute permissions on the directories you are traversing through, then you cannot follow the relative path to the file. If you lack read permissions on the directory "build.log" resides in, you cannot list the files in that directory. Read, Write, and Execute permissions do matter for directories, and they roughly map to:
- Read = allows Listing of files
- Write = allows Creating / Deleting / Modifying files
- Execute = allows changing directory to this directory
Adam Matan
Team leader, developer, and public speaker. I build end-to-end apps using modern cloud infrastructure, especially serverless tools. My current position is R&D Manager at Corvid by Wix.com, a serverless platform for rapid web app generation. My CV and contact details are available on my Github README.
Updated on June 04, 2022Comments
-
Adam Matan over 1 year
I have created a Jenkins build to compile and distribute some modules. The output of the build commands (e.g.,
make
orant
) is redirected to a file namedbuild.log
.The funny thing is that redirecting
echo
into the very same file, usingtee
, fails:tee: ../../build.log: Permission denied
The file exists and has 777 permissions (checked with
ls -ltrh ../..
). Any ideas what's wrong with this write?