[node-patches] Change in ovirt-node[master]: ovirt-init-functions: Remove validation for /etc/profile

dougsland at redhat.com dougsland at redhat.com
Mon Oct 12 21:44:04 UTC 2015


Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: ovirt-init-functions: Remove validation for /etc/profile
......................................................................

ovirt-init-functions: Remove validation for /etc/profile

This validation can drop the unpersist operations to /etc/shadow
and /etc/passwd making the passwd command fail when changing
password.

Change-Id: I60547725556333a81c239634a27df13e8331e763
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1251151
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M scripts/ovirt-init-functions.sh.in
1 file changed, 6 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/37/47237/1

diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index b87094b..ece5ed1 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -962,13 +962,12 @@
     fi
     # check if root or admin password is expired, this might be upon reboot
     # in case of automated installed with rootpw or adminpw parameter!
-    if ! grep -q "sudo persist /etc/passwd /etc/shadow" /etc/profile; then
-        if LC_ALL=C chage -l root | grep  -q "password must be changed" \
-            || LC_ALL=C chage -l admin | grep -q "password must be changed"; then
-            unmount_config /etc/passwd /etc/shadow
-            # PAM will force password change at first login
-            # so make sure we persist it after a successful login
-            cat >> /etc/profile << EOF
+    if LC_ALL=C chage -l root | grep  -q "password must be changed" \
+        || LC_ALL=C chage -l admin | grep -q "password must be changed"; then
+        unmount_config /etc/passwd /etc/shadow
+        # PAM will force password change at first login
+        # so make sure we persist it after a successful login
+        cat >> /etc/profile << EOF
 # added by ovirt-early
 if [ "\$USER" = "root" -o "\$USER" = "admin" ]; then
     sudo persist /etc/passwd /etc/shadow
@@ -978,7 +977,6 @@
     fi
 fi
 EOF
-        fi
     fi
 
     if [ "$rescue" = 1 ]; then


-- 
To view, visit https://gerrit.ovirt.org/47237
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60547725556333a81c239634a27df13e8331e763
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>



More information about the node-patches mailing list