lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 0ebfc39 1/2: Don't let a failing 'usermod' co


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0ebfc39 1/2: Don't let a failing 'usermod' command cause early termination
Date: Wed, 9 Oct 2019 15:54:06 -0400 (EDT)

branch: master
commit 0ebfc39cb149e2a1eb822cdd7f5c71987541b4fa
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Don't let a failing 'usermod' command cause early termination
    
    It is possible that no group with the exact name 'sudo' exists, in
    particular on a system that names its sudoers group 'wheel'.
---
 install_centos.sh | 2 +-
 lmi_setup_21.sh   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/install_centos.sh b/install_centos.sh
index 05967c5..74b0aea 100755
--- a/install_centos.sh
+++ b/install_centos.sh
@@ -76,7 +76,7 @@ getent passwd "${NORMAL_USER}" || useradd \
   --password="$(openssl passwd -1 expired)" \
   "${NORMAL_USER}"
 
-usermod -aG sudo "${NORMAL_USER}"
+usermod -aG sudo "${NORMAL_USER}" || echo "Oops."
 
 mountpoint /dev/pts || mount -t devpts -o rw,nosuid,noexec,relatime,mode=600 
devpts /dev/pts
 mountpoint /proc    || mount -t proc -o rw,nosuid,nodev,noexec,relatime proc 
/proc
diff --git a/lmi_setup_21.sh b/lmi_setup_21.sh
index c49e7e1..29c3096 100755
--- a/lmi_setup_21.sh
+++ b/lmi_setup_21.sh
@@ -46,7 +46,7 @@ useradd \
   --password="$(openssl passwd -1 expired)" \
   "${NORMAL_USER}"
 
-usermod -aG sudo "${NORMAL_USER}"
+usermod -aG sudo "${NORMAL_USER}" || echo "Oops."
 
 # Add an 'lmi' group, which may be useful in a multi-user chroot.
 getent group 1001 || groupadd --gid=1001 lmi || echo "Oops."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]