Skip to content

Commit 0b2ba2e

Browse files
authored
Add Azure CLI repo root guard
1 parent de7207e commit 0b2ba2e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

scripts/install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,11 @@ import_microsoft_rpm_key() {
309309
configure_azure_cli_rpm_repo() {
310310
log_info "Configuring Azure CLI dnf package source..."
311311

312+
if [[ $EUID -ne 0 ]]; then
313+
log_error "Configuring the Azure CLI dnf package source requires root privileges"
314+
return 1
315+
fi
316+
312317
import_microsoft_rpm_key || return 1
313318

314319
if [[ -f "$AZURE_CLI_RPM_REPO_PATH" ]]; then

0 commit comments

Comments
 (0)