aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>1998-03-28 03:22:35 +0000
committerH. Peter Anvin <hpa@zytor.com>1998-03-28 03:22:35 +0000
commitcb3194a59be9fd8dd4e98d4d9632af40a0315fbc (patch)
tree69ca7bae90187a3fbe784eb4b094e4398377e208
parentc8b133bf7abb149fabc197c41083e825025fd9d0 (diff)
downloadautofs3-cb3194a59be9fd8dd4e98d4d9632af40a0315fbc.tar.gz
autofs3-cb3194a59be9fd8dd4e98d4d9632af40a0315fbc.tar.xz
autofs3-cb3194a59be9fd8dd4e98d4d9632af40a0315fbc.zip
Hesiod fixes.
-rw-r--r--.prerel2
-rw-r--r--Makefile.rules2
-rw-r--r--modules/lookup_hesiod.c7
-rw-r--r--modules/parse_hesiod.c20
-rw-r--r--samples/rc.autofs4
5 files changed, 20 insertions, 15 deletions
diff --git a/.prerel b/.prerel
index b8626c4..7ed6ff8 100644
--- a/.prerel
+++ b/.prerel
@@ -1 +1 @@
-4
+5
diff --git a/Makefile.rules b/Makefile.rules
index 8d73e26..5f64100 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -16,7 +16,7 @@
# Uncomment these to build hesiod support. HESIOD should point to the
# hesiod base directory.
#HESIOD =/usr/athena
-#HESIOD_LIBS = -Llib/$(HESIOD) -lhesiod $(LIBRESOLV)
+#HESIOD_LIBS = -L$(HESIOD)/lib -lhesiod $(LIBRESOLV)
# Uncomment this to build NIS+ support.
#NISPLUS=1
diff --git a/modules/lookup_hesiod.c b/modules/lookup_hesiod.c
index 757cec2..46b33f2 100644
--- a/modules/lookup_hesiod.c
+++ b/modules/lookup_hesiod.c
@@ -34,7 +34,8 @@ int lookup_version = AUTOFS_LOOKUP_VERSION; /* Required by protocol */
/* This initializes a context (persistent non-global data) for queries to
this module. */
-int lookup_init(char *mapfmt, int argc, char **argv, void **context)
+int lookup_init(const char *mapfmt, int argc, const char * const *argv,
+ void **context)
{
struct lookup_context *ctxt = NULL;
@@ -60,9 +61,9 @@ int lookup_init(char *mapfmt, int argc, char **argv, void **context)
record in hesiod. If it's an AFS or NFS filesyste, parse it out. If
it's an ERR filesystem, it's an error message we should log. Otherwise,
assume it's something we know how to deal with already (generic). */
-int lookup_mount(char *root, char *name, int name_len, void *context)
+int lookup_mount(const char *root, const char *name, int name_len, void *context)
{
- char **hes_result, mapent[HESIOD_LEN + 1];
+ char **hes_result;
struct lookup_context *ctxt = (struct lookup_context *) context;
int rv;
diff --git a/modules/parse_hesiod.c b/modules/parse_hesiod.c
index 084f3a0..de1bc6f 100644
--- a/modules/parse_hesiod.c
+++ b/modules/parse_hesiod.c
@@ -25,11 +25,11 @@ int parse_version = AUTOFS_PARSE_VERSION; /* Required by protocol */
/* Break out the fields in an AFS record of the form:
"AFS /afs/athena/mit/tytso w /mit/tytso-afs" */
-static int parse_afs(char *filsysline, char *name, int name_len,
+static int parse_afs(const char *filsysline, const char *name, int name_len,
char *source, int source_len,
char *options, int options_len)
{
- char *p;
+ const char *p;
int i;
p = filsysline;
@@ -65,11 +65,11 @@ static int parse_afs(char *filsysline, char *name, int name_len,
/* Break out the fields in an NFS record of the form:
"NFS /export/src nelson.tx.ncsu.edu w /ncsu/tx-src" */
-static int parse_nfs(char *filsysline, char *name, int name_len,
+static int parse_nfs(const char *filsysline, const char *name, int name_len,
char *source, int source_len,
char *options, int options_len)
{
- char *p;
+ const char *p;
char mount[HESIOD_LEN + 1];
int i;
@@ -119,11 +119,11 @@ static int parse_nfs(char *filsysline, char *name, int name_len,
/* Break out the fields in a generic record of the form:
"UFS /dev/ra0g w /site" */
-static int parse_generic(char *filsysline, char *name, int name_len,
+static int parse_generic(const char *filsysline, const char *name, int name_len,
char *source, int source_len,
char *options, int options_len)
{
- char *p;
+ const char *p;
int i;
p = filsysline;
@@ -157,7 +157,7 @@ static int parse_generic(char *filsysline, char *name, int name_len,
return 0;
}
-int parse_init(int argc, char **argv, void **context)
+int parse_init(int argc, const char * const *argv, void **context)
{
return 0;
}
@@ -167,12 +167,14 @@ int parse_done(void *context)
return 0;
}
-int parse_mount(char *root, char *name, int name_len, char *mapent, void *context)
+int parse_mount(const char *root, const char *name,
+ int name_len, const char *mapent, void *context)
{
char source[HESIOD_LEN+1],
fstype[HESIOD_LEN+1],
options[HESIOD_LEN+1],
- *p, *q;
+ *q;
+ const char *p;
p = mapent;
q = fstype;
diff --git a/samples/rc.autofs b/samples/rc.autofs
index 9647b38..10bd1ad 100644
--- a/samples/rc.autofs
+++ b/samples/rc.autofs
@@ -51,8 +51,10 @@ then
options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'`
if [ -x $map ]; then
echo "automount $dir program $map $options $localoptions"
- else
+ elif [ -f $map ]; then
echo "automount $dir file $map $options $localoptions"
+ else
+ echo "automount $dir `basename $map` $options $localoptions"
fi
fi
done