Skip to content

Use install -m 755 for explicit binary mode#247

Open
tejaskochar-db wants to merge 1 commit into
databricks:mainfrom
tejaskochar-db:fix-install-perms
Open

Use install -m 755 for explicit binary mode#247
tejaskochar-db wants to merge 1 commit into
databricks:mainfrom
tejaskochar-db:fix-install-perms

Conversation

@tejaskochar-db
Copy link
Copy Markdown

@tejaskochar-db tejaskochar-db commented May 29, 2026

The script currently sets the binary mode in two steps:

chmod +x ./databricks
cp ./databricks "$TARGET"

Under restrictive umasks such as 0027, this leaves the installed binary at mode 0750 instead of 0755 — non-root users cannot execute it.

Two compounding causes:

  • chmod +x without a u/g/o/a actor letter is umask-aware: under 0027 it adds x only for owner and group, producing 0750.
  • cp without -p further masks the resulting mode through umask, so even a 0755 source would land as 0750.

This patch replaces both lines with:

install -m 755 ./databricks "$TARGET/"

install -m 755 sets the mode atomically and ignores umask — the standard pattern for installer scripts.

Verified that the binary lands as 0755 under umask 0027 and that a non-root user can execute it after sudo sh install.sh.

Under restrictive umasks such as 0027, `chmod +x` + `cp` produces a 0750
binary. When installed via sudo, the binary is owned by root, leaving
non-root users unable to execute it. `install -m 755` sets the mode
atomically and ignores umask.

Co-authored-by: Isaac
@tejaskochar-db tejaskochar-db requested a review from pietern May 29, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant