From 1d629ccd465f10d40a567dc82b3ec4886e79dfb7 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Thu, 7 Jul 2016 08:21:43 -0400 Subject: [PATCH] Check sudoers file after editing "visudo -c" should be run after the sudoers file has been edited. This will ensure that the file is still syntactically correct, and exit 1 if it isn't. Otherwise, obscure errors can occur later on, and it is difficult to track them back to this script as the source of the error. Change-Id: Id0e5114d72c0779952a0c2c2c06696929c6c8b17 --- elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path | 1 + 1 file changed, 1 insertion(+) diff --git a/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path b/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path index 1b13e70a..8d70bfce 100755 --- a/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path +++ b/elements/rpm-distro/pre-install.d/00-usr-local-bin-secure-path @@ -7,3 +7,4 @@ set -eu set -o pipefail sed -i '/secure_path/ s/$/:\/usr\/local\/bin/' /etc/sudoers +visudo -c