Hi,
attached is a series of patches that implements autofs support. In order
to test it, you can either use a provided command-line client or patch
autofs and test directly using automounter.
I have patched the rawhide version of automounter and put it into my
fedorapeople account until it lands in Fedora:
http://jhrozek.fedorapeople.org/autofs-sssd/
Alternatively, you can apply the patches directly onto autofs-5.0.6:
http://jhrozek.fedorapeople.org/autofs-sssd/autofs-5.0.6-sss-lookup-modul...
http://jhrozek.fedorapeople.org/autofs-sssd/autofs-5.0.6-teach-automount-...
The patches are functionally complete with the single exception of the
IPA provider. I will finish it during today. To test with an IPA server,
you need to set "autofs_provider = ldap" manually.
There is a bug in the responder where we don't properly clean up after
setent, but I don't think I should hold off sending the patches for review.
The responder also uses the deprecated cache checking logic (see patch
0008). I will either finish that before 1.7.9 or during 1.8 development.
The responder also does not perform an implicit setautomntent() yet. A
fix for none of these issues would need a string freeze break.
The patches are based on the sudo patches on-list and Stephen's pending
cache timeout patch and must be applied on top of them.
[PATCH 01/10] BUILD: Introduce a --with-autofs config option
This would allow to select the autofs feature during build without
having to select the other features.
[PATCH 02/10] SYSDB: Remove code duplication between member_add and member_del
Refactoring patch that will be used in the next one.
[PATCH 03/10] AUTOFS: sysdb interface
The cache interface.
[PATCH 04/10] AUTOFS: a client library
This is the library the autofs client is using. automounter dlopen()s
the library so there is no header file, no pkgconfig file and the
library is in the libsss_autofs package, not in -devel.
The library provides the following interface that translates into
responder interface in the next patch:
* _sss_setautomntent() - select the map for processing
* _sss_getautomntent_r() - iterates through key/value pairs in the
selected map. The key is usually the mount
point, the value is mount information
(server:/export)
* _sss_getautomntbyname_r() - returns value for a specific key.
* _sss_endautomntent() deselect a map, clean up
As you can see, the interface closely resembles netgroup interface glibc
uses, so I was able to reuse many concepts from the netgroup code.
[PATCH 05/10] AUTOFS: a command-line test client
A very simply binary that can be used to test getting data from the
library via SSSD in pretty much the same way SSSD would. A required
positional parameter specifies the map name and the tool would print out
all the key/value pairs using _sss_getautomntent_r(). You can also
specify -n to query a specific key using _sss_getautomntbyname_r().
There is one gotcha in the code - the library location is hardcoded to
".libs". Is there a way to get this from libtool?
[PATCH 06/10] AUTOFS: Data Provider request
Implements the request that the responder might use to communicate with
the back end.
[PATCH 07/10] Refactor setent_req_list
Makes the setent_add_ref() and setent_notify_*() functions more generic
to be reusable by the autofs responder.
[PATCH 08/10] Split the logic to check cache expiration into separate function
The autofs responder can't reuse the check_cache function, so I split
the cache expiration check logic into a separate function instead.
As mentioned earlier, this patch might not be needed if I can finish the
rewrite to the new cache check logic.
[PATCH 09/10] AUTOFS: responder
The responder process. The patch seems big, but many parts are just
generic responder plumbing.
[PATCH 10/10] AUTOFS: LDAP provder
The whole LDAP provider in a single patch. One place that might need
improving is removing a map from an entry. The entry might become
orphaned when no maps link to it and the cache might grow. I will
improve the patch by searching for entries with no memberof: links and
deleting them after the save.
There is neither enumerate task nor any periodic download. I'm not quite
sure it is needed. I'll ask Ian about that.
Happy reviewing.