Skip to content

Commit 453d0d3

Browse files
committed
Auto-detect compatible permissions method, with possibility to deny acl if needed.
1 parent 2cd009c commit 453d0d3

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
@@ -328,3 +328,17 @@ function do_list_functions() {
328328
function do_shell() {
329329
bash "$@"
330330
}
331+
332+
function has_acl() {
333+
return 0
334+
}
335+
336+
function permission_mode() {
337+
if [ "$IS_CHOWN_FORBIDDEN" == "true" ]; then
338+
echo "chmod"
339+
elif has_acl; then
340+
echo "facl"
341+
else
342+
echo "stickybit"
343+
fi
344+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export APP_USER_LOCAL
2929
APP_USER_LOCAL_RANDOM="$(convert_to_boolean_string "${APP_USER_LOCAL_RANDOM:-false}")"
3030
export APP_USER_LOCAL_RANDOM
3131

32+
export PERMISSION_MODE=${PERMISSION_MODE:="$(permission_mode)"}
33+
3234
export BUILD_USER_SSH_PRIVATE_KEY=${BUILD_USER_SSH_PRIVATE_KEY:-}
3335
export BUILD_USER_SSH_PUBLIC_KEY=${BUILD_USER_SSH_PUBLIC_KEY:-}
3436
export BUILD_USER_SSH_KNOWN_HOSTS=${BUILD_USER_SSH_KNOWN_HOSTS:-}

0 commit comments

Comments
 (0)