Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117755022
fix-permissions
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
862 B
Referenced Files
None
Subscribers
None
fix-permissions
View Options
#!/bin/sh
# Allow this script to fail without failing a build
set
+e
SYMLINK_OPT
=
${
2
:-
-L
}
# Fix permissions on the given directory or file to allow group read/write of
# regular files and execute of directories.
[
$(
id -u
)
-ne
0
]
&&
CHECK_OWNER
=
" -uid
$(
id -u
)
"
# If argument does not exist, script will still exit with 0,
# but at least we'll see something went wrong in the log
if
!
[
-e
"
$1
"
]
;
then
echo
"ERROR: File or directory
$1
does not exist."
>
&
2
# We still want to end successfully
exit
0
fi
find
$SYMLINK_OPT
"
$1
"
${
CHECK_OWNER
}
\!
-gid
0
-exec chgrp
0
{}
+
find
$SYMLINK_OPT
"
$1
"
${
CHECK_OWNER
}
\!
-perm -g+rw -exec chmod g+rw
{}
+
find
$SYMLINK_OPT
"
$1
"
${
CHECK_OWNER
}
-perm /u+x -a
\!
-perm /g+x -exec chmod g+x
{}
+
find
$SYMLINK_OPT
"
$1
"
${
CHECK_OWNER
}
-type d
\!
-perm /g+x -exec chmod g+x
{}
+
# Always end successfully
exit
0
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Sat, Apr 4, 7:36 AM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18823041
Default Alt Text
fix-permissions (862 B)
Attached To
Mode
rKOLABSTWOICORE kolab-s2i-core
Attached
Detach File
Event Timeline