Skip to content

Commit ed5ad46

Browse files
committed
Auto-detect compatible permissions method, with possibility to deny acl if needed.
1 parent 9c14e67 commit ed5ad46

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

ubuntu/16.04/usr/local/share/bootstrap/common_functions.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,17 @@ function do_list_functions() {
346346
function do_shell() {
347347
bash "$@"
348348
}
349+
350+
function has_acl() {
351+
return 0
352+
}
353+
354+
function permission_mode() {
355+
if [ "$IS_CHOWN_FORBIDDEN" == "true" ]; then
356+
echo "chmod"
357+
elif has_acl; then
358+
echo "facl"
359+
else
360+
echo "stickybit"
361+
fi
362+
}

ubuntu/16.04/usr/local/share/env/50-bootstrap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export APP_USER_LOCAL
3434
APP_USER_LOCAL_RANDOM="$(convert_to_boolean_string "${APP_USER_LOCAL_RANDOM:-false}")"
3535
export APP_USER_LOCAL_RANDOM
3636

37+
export PERMISSION_MODE=${PERMISSION_MODE:="$(permission_mode)"}
38+
3739
export BUILD_USER_SSH_PRIVATE_KEY=${BUILD_USER_SSH_PRIVATE_KEY:-}
3840
export BUILD_USER_SSH_PUBLIC_KEY=${BUILD_USER_SSH_PUBLIC_KEY:-}
3941
export BUILD_USER_SSH_KNOWN_HOSTS=${BUILD_USER_SSH_KNOWN_HOSTS:-}

0 commit comments

Comments
 (0)