Hi All, We are facing an issue with exec sudo command which is resulting in an infinite loop. We have one script in which we are checking if $USER is not equal to root then execute the same script with exec sudo so that it will run with root. Code snippet: script1: if [[ "$USER" != "root" ]]; then exec sudo $0 $@ fi If we run the script with some another user say root1 using below "sudo -u root1 script1" script1 will run in infinite loop. In CentOS 7.4 when exec sudo command runs , the value of $USER remains same i.e root1 and again it enters and if block and execute the scipt1 and so on .. While in case of Centos 7.3 after running exec sudo command value of $USER gets updated to root and it works fine -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos-devel/attachments/20180411/d62eeecd/attachment-0007.html>