Commit e10d3395 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

auto-build: ensure build dir sticky bit is unset

To avoid unexpected permissions on build files the build directories
must not have a sticky bit set. The bit is unset on directory creation.
parent 731bcaf1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -188,14 +188,18 @@ build ()
	done
	trap "[ -L '$lock' ] && rm '$lock'" EXIT

	# create the build dir if it does not exist
	# create the build dir if it does not exist & remove any stickbits set by 
	# the parent; prevents permissions from being forced to values that may 
	# affect the build
	if ! [ -e "$dir" ]; then
		mkdir -p "$dir"
		chmod g-s "$dir"
	elif ! [ -d "$dir" ]; then
		echo "the build directory $dir exists but is not a directory" >&2
		return 1
	fi


	# create the git repository if it does not exist
	is_git_workspace "$dir" || git clone "$GIT_DIR" "$dir" >&2