Skip to content

Commit 8d7adb7

Browse files
committed
Fix umask better
While the umask was previously set for builds (and in fact `docker run` sets it to 0022 by default), the release pipeline `cp`'s files (with `-a`) which respect the user's umask, and is outside of the build path. This sets the umask in a common function called by all build tools, which Stephen agreed was the simplest and most complete fix. The `verify-prereqs` function is already poorly named for what it does, and this only makes it epsilon worse.
1 parent b450001 commit 8d7adb7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

build/common.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ function kube::build::verify_prereqs() {
163163

164164
kube::version::get_version_vars
165165
kube::version::save_version_vars "${KUBE_ROOT}/.dockerized-kube-version-defs"
166+
167+
# Without this, the user's umask can leak through.
168+
umask 0022
166169
}
167170

168171
# ---------------------------------------------------------------------------

hack/lib/golang.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,10 +523,6 @@ kube::golang::setup_env() {
523523

524524
# This seems to matter to some tools
525525
export GO15VENDOREXPERIMENT=1
526-
527-
# This is for sanity. Without it, user umasks leak through into release
528-
# artifacts.
529-
umask 0022
530526
}
531527

532528
# This will take binaries from $GOPATH/bin and copy them to the appropriate
@@ -678,6 +674,9 @@ kube::golang::build_some_binaries() {
678674
}
679675

680676
kube::golang::build_binaries_for_platform() {
677+
# This is for sanity. Without it, user umasks can leak through.
678+
umask 0022
679+
681680
local platform=$1
682681

683682
local -a statics=()

0 commit comments

Comments
 (0)