<div dir="ltr">Hello,<div>I have a problem using sudo policy in FreeIPA when target commands use environment variables defined on a specific local user's profile. </div><div> </div><div>Here is the problem:</div><div><br></div><div>1- There is a client machine with local user called <i>srvusr .</i>this user has permission to run <i>target_cmd</i>. </div><div><br></div><div>2- <i>target_cmd</i> is dependent on environment variables defined in <i>srvusr'</i>s profile. Even before joining to FreeIPA, users had to use "su <i>srvusr</i>" command to get permission for executing the <i>target_cmd</i>.</div><div><br></div><div>3- I defined a sudo policy for <i>target_cmd</i> to be executed by external user   permissions (<i>srvusr)</i>. </div><div><br></div><div>4- when I run sudo -l on client machine it says IPA user has permission to run  <i>target_cmd</i> with <i>srvusr</i> privileges.<br></div><div><br></div><div>5- The command I run with my IPA user is:</div><div>$ sudo -H  -u  <i>srvusr</i>  <i>/path/to/</i><i>target_cmd</i>    <i>target_cmd</i><i>_argument</i></div><div><i>or</i></div><div>$ sudo -H  -u  <i>srvusr</i>  <i>/path/to/</i><i>target_cmd</i><i><br></i></div><div><br></div><div>I used -H to inherit target user's environment variables</div><div><br></div><div>The command fails to run and the error is:<br></div><div><br></div><div> "Check environment error! environment not defined or NULL"<br></div><div><br></div><div>I would be glad if someone help me to find a solution for that!</div><div><br></div><div>thanks for your advice in advance</div><div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">m-dehghan</div>
</div></div>