Skip to content

Commit c7a3382

Browse files
committed
Auto-detect compatible permissions method, with possibility to deny acl if needed.
1 parent 1766d7c commit c7a3382

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
@@ -290,3 +290,17 @@ function test_remote_ports() {
290290
timeout 1 bash -c "cat < /dev/null > /dev/tcp/${SERVICE_PARAMS[0]}/${SERVICE_PARAMS[1]}" 2>/dev/null || return 1
291291
done
292292
}
293+
294+
function has_acl() {
295+
return 0
296+
}
297+
298+
function permission_mode() {
299+
if [ "$IS_CHOWN_FORBIDDEN" == "true" ]; then
300+
echo "chmod"
301+
elif has_acl; then
302+
echo "facl"
303+
else
304+
echo "stickybit"
305+
fi
306+
}

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)