Skip to content
Snippets Groups Projects
Verified Commit 74d035fa authored by David Beniamine's avatar David Beniamine
Browse files

Fix permissions all the way up while uploading directories

parent 2273fc00
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
chown -R 1000:1000 $FILE UID=1000
base_dir="/srv"
chown $UID:$UID "$FILE"
dir=$(dirname "$FILE")
# Fix parent directory's ownership until we hit the base_dir or a directory that
# Already belongs to the user
while [ "$dir" != "$base_dir" ] && [ $(stat -c %u "$dir") != $UID ]; do
chown $UID:$UID "$dir"
dir=$(dirname "$dir")
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment