<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 14, 2014 at 7:21 PM, Jakub Hrozek <span dir="ltr">&lt;<a href="mailto:jhrozek@redhat.com" target="_blank">jhrozek@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">On Fri, Jun 27, 2014 at 09:44:34AM +0300, Noam Meltzer wrote:<br>

&gt; Follow patches are the code implementing design document:<br>
&gt; <a href="https://fedorahosted.org/sssd/wiki/DesignDocs/rpc.idmapd%20plugin" target="_blank">https://fedorahosted.org/sssd/wiki/DesignDocs/rpc.idmapd%20plugin</a><br>
&gt;<br>
&gt; Changes compared to v2 of this patch:<br>
&gt;  * rebase over rev. 8ca18752 (current master)<br>
&gt;  * remove man pages from the patch (will be sent separately)<br>
&gt;  * add new contact details for plugin author<br>
&gt;  * code style<br>
&gt;  * remove sss_nfs_make_request() wrapper<br>
&gt;  * fix typo in reply_to_name(): REPLY_ID_OFFSET -&gt; REPLY_NAME_OFFSET<br>
<br>
</div>Thanks for these changes! The patches look good with one nitpick, which<br>
I can fix locally before pushing and one packaging question. I&#39;ll ask<br>
those inline when replying to the patches themselves.<br>
<br>
But more importantly, I have a question on testing the patches. I admit<br>
my NFS internals knowledge is quite lacking, so maybe these are basic<br>
questions..how exactly do I make sure the plugin mapping functions are<br>
called? I tried attaching gdb to rpc.idmapd and doing various operations<br>
to the file (ls, echo &quot;foo&quot; &gt;&gt; file) etc but still no luck. Disabling<br>
the sss nsswitch plugin just yields UIDs and GIDs on the client (which<br>
is<br>
<br>
For my test, I configured a server and a client. I can mount the shares<br>
just fine, I see I&#39;m using NFSv4 in the mount(8) output. I can see the<br>
sss plugin was loaded, because journalctl -u nfs-idmap.service says:<br>
Jul 14 12:01:21 <a href="http://master.ipa.example.com" target="_blank">master.ipa.example.com</a> rpc.idmapd[24320]: rpc.idmapd:<br>
sss_nfs_init: use memcache: 1<br>
Jul 14 12:01:21 <a href="http://master.ipa.example.com" target="_blank">master.ipa.example.com</a> rpc.idmapd[24320]: rpc.idmapd:<br>
libnfsidmap: loaded plugin /lib64/libnfsidmap/sss_nfs.so for method<br>
sss_nfs<br>
<br>
My idmapd.conf file looks quite simple:<br>
--------------------<br>
[General]<br>
Verbosity = 2<br>
Domain = <a href="http://ipa.example.com" target="_blank">ipa.example.com</a><br>
<br>
[Mapping]<br>
Nobody-User = nfsnobody<br>
Nobody-Group = nfsnobody<br>
<br>
[Translation]<br>
Method = sss_nfs<br>
<br>
[Static]<br>
<br>
[UMICH_SCHEMA]<br>
--------------------<br>
<br>
I guess I could also ask -- where does the rpc.idmapd daemon hook into<br>
the system? When exactly are the translation functions called?<br></blockquote><div><br></div><div>The idmapd.conf looks good (assuming that your LDAP domain really is <a href="http://ipa.example.com">ipa.example.com</a>).</div>
<div><br></div><div>Regarding how rpc.idmapd operation:</div><div>1. There&#39;s the feature wiki: <a href="https://fedorahosted.org/sssd/wiki/DesignDocs/rpc.idmapd%20plugin">https://fedorahosted.org/sssd/wiki/DesignDocs/rpc.idmapd%20plugin</a></div>
<div>I&#39;m not sure that it answers your question though. (so I&#39;ll make sure to update it following this email thread)</div><div><br></div><div>2. rpc.idmapd listens for events (queries) from the kernel over a named pipe. once such an event arrives, rpc.idmapd will start the mapping process using libnfsidmap.</div>
<div>libnfsidmap on its turn will dlopen(3) the relevant plugin (sss_nfs in our case) and call the relevant functions from &#39;struct trans_func&#39;.</div><div><br></div><div><br></div><div>How to test:</div><div>libnfsidmap.git comes with a small C code named &quot;libtest.c&quot; which allows you to directly test the various function from &#39;struct trans_func&#39;.</div>
<div>I modified this code a bit to match our needs (and attached to this email).</div><div>compile/link with:</div><div><font face="courier new, monospace">gcc -o libtest libtest.c  -lnfsidmap</font><br></div><div><br></div>
<div>run like this:</div><div><div><font face="courier new, monospace">$ ./libtest noam@localdomain 0 users@localdomain 101</font></div><div><br></div><div>expected output:</div><div><font face="courier new, monospace">input: user=noam@localdomain uid=0 group=users@localdomain gid=101</font></div>
<div><font face="courier new, monospace">nfs4_name_to_uid: username noam@localdomain has uid 1000</font></div><div><font face="courier new, monospace">nfs4_name_to_gid: username users@localdomain has gid 100</font></div><div>
<font face="courier new, monospace">nfs4_uid_to_name: uid 0 has name root@localdomain</font></div><div><font face="courier new, monospace">nfs4_gid_to_name: gid 101 has name libuuid@localdomain</font></div><div><br></div>
</div><div><br></div><div>Unfortunately, I don&#39;t have an LDAP environment at the moment to test it myself. So what you see here is the result of the default idmapd.conf running with the &quot;nss&quot; plugin (going to /etc/passwd ...)</div>
<div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Thank you for your help.<br>
_______________________________________________<br>
sssd-devel mailing list<br>
<a href="mailto:sssd-devel@lists.fedorahosted.org">sssd-devel@lists.fedorahosted.org</a><br>
<a href="https://lists.fedorahosted.org/mailman/listinfo/sssd-devel" target="_blank">https://lists.fedorahosted.org/mailman/listinfo/sssd-devel</a><br>
</blockquote></div><br></div></div>