<div dir="ltr">Dear <span style="font-size:12.8px;white-space:nowrap">Christian</span><div><span style="font-size:12.8px;white-space:nowrap">Thanks for your explanation about shell builtin. I changed directory permissions and now it works!</span></div><div><span style="font-size:12.8px;white-space:nowrap"><br></span></div><div><span style="font-size:12.8px;white-space:nowrap">Mitra</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 28, 2016 at 4:17 PM, Christian Heimes <span dir="ltr"><<a href="mailto:cheimes@redhat.com" target="_blank">cheimes@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2016-06-28 09:08, Mitra Dehghan wrote:<br>
><br>
> Hello,<br>
><br>
> I want to know how can I give directory permissions on a client to a<br>
> domain user in FreeIPA.<br>
><br>
><br>
> I'm using "runasuser" feature in sudo policy to give my domain users<br>
> permission to run local services on client.<br>
><br>
> Here is an example:<br>
> I have a service on my client called "/abc/" located at "/home/abc/" and<br>
> locally run by local user called "/abc/"<br>
><br>
> I have used runasuser feature in sudo policy rules to let domain users<br>
> (say: /usr@mydomain.dc/) run the service. /usr/ can run scripts, read<br>
> and edit files and stop/start services, using /abc/'s permissions and<br>
> without any problem.<br>
><br>
> But the problem I have faced is, when I want "/usr/" to traverse<br>
> subdirectories under "//home/abc//" it doesn't work.<br>
> I have defined sudocmd for cd command and added it as allow-command to<br>
> appropriate sudorule. my sudocmd definitions are like this:<br>
><br>
> /ipa sudocmd-add --desc="ttttttt" 'cd /home/abc/n/'<br>
> /<br>
> /ipa sudocmd-add --desc="ttttttt" 'cd /home/abc/m/'<br>
> /<br>
> /ipa sudocmd-add --desc="ttttttt" 'cd /home/abc/n/q/'/<br>
<br>
cd is a builtin command of your shell. It has to be because it changes<br>
the current working directory the shell's process. sudo doesn't work for<br>
shell builtins. You have to find another way to accomplish your task.<br>
<br>
By the way are you familiar how r,w,x work for directories? 'r' is used<br>
for listing the content of a directory, 'w' for creating/removing files<br>
(except for +t directories) and 'x' is used to check if a user is<br>
allowed to enter a directory. You can allow users to enter a directory<br>
w/o actually seeing its content.<br>
<span class="HOEnZb"><font color="#888888"><br>
Christian<br>
<br>
<br>
</font></span><br>--<br>
Manage your subscription for the Freeipa-users mailing list:<br>
<a href="https://www.redhat.com/mailman/listinfo/freeipa-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/freeipa-users</a><br>
Go to <a href="http://freeipa.org" rel="noreferrer" target="_blank">http://freeipa.org</a> for more info on the project<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">m-dehghan</div>
</div>