]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mountd/cache.c
mountd: Report the absolute path used to load the junction plug-in
[nfs-utils.git] / utils / mountd / cache.c
index e950ec6a2adda66e49f0dbfaeb8e5105ce51f608..3853bb68cb661b4d4b779935f9ddaecd75639a37 100644 (file)
@@ -29,7 +29,6 @@
 #include "nfslib.h"
 #include "exportfs.h"
 #include "mountd.h"
-#include "xmalloc.h"
 #include "fsloc.h"
 #include "pseudoflavors.h"
 
@@ -109,12 +108,10 @@ static void auth_unix_ip(FILE *f)
                struct addrinfo *ai = NULL;
 
                ai = client_resolve(tmp->ai_addr);
-               if (ai == NULL)
-                       goto out;
-               client = client_compose(ai);
-               freeaddrinfo(ai);
-               if (!client)
-                       goto out;
+               if (ai) {
+                       client = client_compose(ai);
+                       freeaddrinfo(ai);
+               }
        }
        qword_print(f, "nfsd");
        qword_print(f, ipaddr);
@@ -127,7 +124,6 @@ static void auth_unix_ip(FILE *f)
        xlog(D_CALL, "auth_unix_ip: client %p '%s'", client, client?client: "DEFAULT");
 
        free(client);
-out:
        freeaddrinfo(tmp);
 
 }
@@ -830,6 +826,7 @@ lookup_export(char *dom, char *path, struct addrinfo *ai)
 
 #ifdef HAVE_NFS_PLUGIN_H
 #include <dlfcn.h>
+#include <link.h>
 #include <nfs-plugin.h>
 
 /*
@@ -1094,6 +1091,7 @@ static struct exportent *lookup_junction(char *dom, const char *pathname,
                struct addrinfo *ai)
 {
        struct exportent *exp;
+       struct link_map *map;
        void *handle;
 
        handle = dlopen("libnfsjunct.so", RTLD_NOW);
@@ -1101,6 +1099,11 @@ static struct exportent *lookup_junction(char *dom, const char *pathname,
                xlog(D_GENERAL, "%s: dlopen: %s", __func__, dlerror());
                return NULL;
        }
+
+       if (dlinfo(handle, RTLD_DI_LINKMAP, &map) == 0)
+               xlog(D_GENERAL, "%s: loaded plug-in %s",
+                       __func__, map->l_name);
+
        (void)dlerror();        /* Clear any error */
 
        exp = invoke_junction_ops(handle, dom, pathname, ai);