UNCLASSIFIED
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ironbank Containers
DIAT
AAP Mongo
Commits
90a119f2
You need to sign in or sign up before continuing.
Commit
90a119f2
authored
Jul 21, 2021
by
WingKwan Lau
Browse files
Update scripts/fix-permissions.sh
parent
d67b6e8f
Pipeline
#379533
canceled with stages
in 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
scripts/fix-permissions.sh
scripts/fix-permissions.sh
+29
-0
No files found.
scripts/fix-permissions.sh
0 → 100644
View file @
90a119f2
#!/bin/sh
# allow script to fail without failing build
set
+e
# unless otherwise specified, follow symlinks
SYMLINK_OPT
=
${
2
:-
-L
}
# catch error if file/directory does not exist
if
!
[
-e
"
$1
"
]
;
then
echo
"ERROR: File or directory
$1
does not exist."
>
&2
exit
0
fi
# fix group ownership
find
$SYMLINK_OPT
"
$1
"
\!
-gid
0
-exec
chgrp
0
{}
+
# fix group permissions
find
$SYMLINK_OPT
"
$1
"
\!
-perm
-g
+rw
-exec
chmod
g+rw
{}
+
# ensure the group can execute any file executable by the owning user
find
$SYMLINK_OPT
"
$1
"
-perm
/u+x
-a
\!
-perm
/g+x
-exec
chmod
g+x
{}
+
# ensure directories have executable permissions
find
$SYMLINK_OPT
"
$1
"
-type
d
\!
-perm
/g+x
-exec
chmod
g+x
{}
+
# always end successfully so that build does not fail
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment