<html><body><div style="color: rgb(0, 0, 0); font-family: arial,helvetica,sans-serif; font-size: 12pt;"><div>Hi there<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>We have a strange problem.......<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>We're trying to override options in sudo rules from IPA, in this case secure_path:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>sudo -ll reports:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>    RunAsUsers: root<br>    Options: requiretty, lecture=always, timestamp_timeout=0, !authenticate, secure_path=/bin:/usr/bin:/usr/local/bin<br>    Commands:<br>        stopinst<br>        /usr/local/bin/stopinst<br>        /usr/local/bin/startinst<br>        /bin/mount /rman<br>        /usr/bin/su - root</div><div><br data-mce-bogus="1"></div><div>/usr/local/bin is also in my local path:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>$ echo $PATH<br>/usr/local/bin:/usr/bin:/usr/local/sbin..........</div><div><br data-mce-bogus="1"></div><div>For easyness, stopinst is currently quite simple:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>$ cat /usr/local/bin/stopinst</div><div>#!/bin/bash<br>echo stopinst<br>echo "Path: $PATH"</div><div><br data-mce-bogus="1"></div><div>I can execute the script a normal user, using full path or just the command:<br data-mce-bogus="1"></div><div>$ stopinst<br>stopinst<br>Path: /usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/net.dr.dk/drextrha/.local/bin:/home/net.dr.dk/drextrha/bin</div><div><br data-mce-bogus="1"></div><div>However, trying to execute the script using sudo fails:<br data-mce-bogus="1"></div><div>$ sudo stopinst<br>[sudo] password for drextrha:<br>sudo: stopinst: command not found</div><div><br data-mce-bogus="1"></div><div>Unless using full path:<br data-mce-bogus="1"></div><div>$ sudo /usr/local/bin/stopinst<br>stopinst<br>Path: /bin:/usr/bin:/usr/local/bin</div><div><br data-mce-bogus="1"></div><div>Secure path in sudoers is:<br data-mce-bogus="1"></div><div>#  grep secure_path /etc/sudoers<br>Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin</div><div><br data-mce-bogus="1"></div><div>If I change the secure_path in local sudoers to include /usr/local/bin:<br data-mce-bogus="1"></div><div>#  grep secure_path /etc/sudoers<br>Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin</div><div><br data-mce-bogus="1"></div><div>I can execute the command using sudo:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>$ sudo stopinst<br>stopinst<br>Path: /bin:/usr/bin:/usr/local/bin</div><div><br data-mce-bogus="1"></div><div>Soooo......    something gets overwritten somewhere that shouldn't???<br data-mce-bogus="1"></div></div></body></html>