aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2021-03-12 14:21:34 +0800
committerIan Kent <raven@themaw.net>2021-03-14 12:03:16 +0800
commit533d0492ed248e935cac30d3733a5f586f3249c4 (patch)
tree4fdc9a06ddc9db4350ce6179ac368248678b04d2 /modules
parentf98cbb601ebb65a5d7dc30036a1d71ec9957d454 (diff)
downloadautofs-533d0492ed248e935cac30d3733a5f586f3249c4.tar.gz
autofs-5.1.7 - add xdr_exports()
Add an xdr_exports() function to get NFS exports from a server. Signed-off-by: Ian Kent <raven@themaw.net>
Diffstat (limited to 'modules')
-rw-r--r--modules/lookup_hosts.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c
index 744062e2..81a4eb18 100644
--- a/modules/lookup_hosts.c
+++ b/modules/lookup_hosts.c
@@ -20,14 +20,6 @@
#include <sys/stat.h>
#include <netdb.h>
-/*
- * Avoid annoying compiler noise by using an alternate name for
- * typedef name in mount.h
- */
-#define name __dummy_type_name
-#include "mount.h"
-#undef name
-
#define MODULE_LOOKUP
#include "automount.h"
#include "nsswitch.h"
@@ -43,9 +35,6 @@ struct lookup_context {
int lookup_version = AUTOFS_LOOKUP_VERSION; /* Required by protocol */
-exports rpc_get_exports(const char *host, long seconds, long micros, unsigned int option);
-void rpc_exports_free(exports list);
-
int lookup_init(const char *mapfmt,
int argc, const char *const *argv, void **context)
{
@@ -99,7 +88,7 @@ static char *get_exports(struct autofs_point *ap, const char *host)
{
char buf[MAX_ERR_BUF];
char *mapent;
- exports exp, this;
+ struct exportinfo *exp, *this;
debug(ap->logopt, MODPREFIX "fetchng export list for %s", host);
@@ -111,7 +100,7 @@ static char *get_exports(struct autofs_point *ap, const char *host)
if (mapent) {
int len = strlen(mapent) + 1;
- len += strlen(host) + 2*(strlen(this->ex_dir) + 2) + 3;
+ len += strlen(host) + 2*(strlen(this->dir) + 2) + 3;
mapent = realloc(mapent, len);
if (!mapent) {
char *estr;
@@ -121,10 +110,10 @@ static char *get_exports(struct autofs_point *ap, const char *host)
return NULL;
}
strcat(mapent, " \"");
- strcat(mapent, this->ex_dir);
+ strcat(mapent, this->dir);
strcat(mapent, "\"");
} else {
- int len = 2*(strlen(this->ex_dir) + 2) + strlen(host) + 3;
+ int len = 2*(strlen(this->dir) + 2) + strlen(host) + 3;
mapent = malloc(len);
if (!mapent) {
@@ -135,16 +124,16 @@ static char *get_exports(struct autofs_point *ap, const char *host)
return NULL;
}
strcpy(mapent, "\"");
- strcat(mapent, this->ex_dir);
+ strcat(mapent, this->dir);
strcat(mapent, "\"");
}
strcat(mapent, " \"");
strcat(mapent, host);
strcat(mapent, ":");
- strcat(mapent, this->ex_dir);
+ strcat(mapent, this->dir);
strcat(mapent, "\"");
- this = this->ex_next;
+ this = this->next;
}
rpc_exports_free(exp);