summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>1999-12-17 19:02:44 (GMT)
committerH. Peter Anvin <hpa@zytor.com>1999-12-17 19:02:44 (GMT)
commit98b09747969444f2dff268ad1d59c7280b1bcacb (patch)
treef0852496d9b2dff3e56b728ad09f3c5f087b6c7f
parent9e96af19ca39b6e796b431f87c66e037443bc580 (diff)
downloadautofs3-98b09747969444f2dff268ad1d59c7280b1bcacb.zip
autofs3-98b09747969444f2dff268ad1d59c7280b1bcacb.tar.gz
autofs3-98b09747969444f2dff268ad1d59c7280b1bcacb.tar.bz2
autofs3-98b09747969444f2dff268ad1d59c7280b1bcacb.tar.xz
Added mount_multi module; remove smbfs special support
-rw-r--r--NEWS4
-rw-r--r--configure.in2
-rw-r--r--daemon/module.c2
-rw-r--r--daemon/mount.c5
-rw-r--r--modules/Makefile11
-rw-r--r--modules/lookup_program.c4
-rw-r--r--modules/mount_generic.c2
-rw-r--r--modules/mount_smbfs.c189
8 files changed, 14 insertions, 205 deletions
diff --git a/NEWS b/NEWS
index a9a5885..2388f03 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,10 @@ Since autofs-3.1.3:
* Make samples/rc.autofs appropriate for both RedHat and Debian.
* Include spec file to make RedHat RPM.
* Added fixes to mount_autofs with options, from Rainer Clasen.
+* Removed the now-obsolete mount_smbfs. MAKE SURE YOU READ
+ "README.smbfs" before trying to mount an smbfs filesystem using autofs!!
+* Created a new lookup_multi module. Sample usage:
+ automount /path multi file /etc/auto.path -- yp auto.path
Since autofs-3.1.2:
-------------------
diff --git a/configure.in b/configure.in
index 70fddd6..fcd2ff7 100644
--- a/configure.in
+++ b/configure.in
@@ -37,8 +37,6 @@ AC_MSG_RESULT([$searchpath])
AF_PATH_INCLUDE(MOUNT, mount, /bin/mount, $searchpath)
AF_PATH_INCLUDE(UMOUNT, umount, /bin/umount, $searchpath)
AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath)
-AF_PATH_INCLUDE(SMBMOUNT, smbmount, , $searchpath)
-AC_SUBST(HAVE_SMBMOUNT)
#
# Newer mounts have the -s (sloppy) option to ignore unknown options,
diff --git a/daemon/module.c b/daemon/module.c
index 3a0bc26..0a35540 100644
--- a/daemon/module.c
+++ b/daemon/module.c
@@ -69,7 +69,7 @@ struct lookup_mod *open_lookup(const char *name, const char *err_prefix,
return NULL;
}
- if ( mod->lookup_init(mapfmt,argc,argv,&mod->context) ) {
+ if ( mod->lookup_init(mapfmt, argc, argv, &mod->context) ) {
dlclose(dh);
free(mod);
return NULL;
diff --git a/daemon/mount.c b/daemon/mount.c
index 3c52d47..14c718a 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -4,7 +4,7 @@
* mount.c - Abstract mount code used by modules for an unexpected
* filesystem type
*
- * Copyright 1997 Transmeta Corporation - All Rights Reserved
+ * Copyright 1997-1999 Transmeta Corporation - All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -24,7 +24,8 @@
#include "automount.h"
/* These filesystems are known not to work with the "generic" module */
-static char *not_generic[] = { "nfs", "smbfs", "ncpfs", "userfs", "afs",
+/* Note: starting with Samba 2.0.6, smbfs is handled generically. */
+static char *not_generic[] = { "nfs", "ncpfs", "userfs", "afs",
"autofs", NULL };
int do_mount(const char *root, const char *name, int name_len,
diff --git a/modules/Makefile b/modules/Makefile
index 8871934..b1db26a 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -7,10 +7,12 @@
include ../Makefile.rules
SRCS := lookup_yp.c lookup_file.c lookup_program.c lookup_userhome.c \
- parse_sun.c \
+ lookup_multi.c \
+ parse_sun.c \
mount_generic.c mount_nfs.c mount_afs.c mount_autofs.c
MODS := lookup_yp.so lookup_file.so lookup_program.so lookup_userhome.so \
+ lookup_multi.so \
parse_sun.so \
mount_generic.so mount_nfs.so mount_afs.so mount_autofs.so
@@ -19,11 +21,6 @@ ifeq ($(EXT2FS), 1)
MODS += mount_ext2.so
endif
-ifeq ($(SMBFS), 1)
- SRCS += mount_smbfs.c
- MODS += mount_smbfs.so
-endif
-
ifeq ($(HESIOD), 1)
SRCS += lookup_hesiod.c parse_hesiod.c
MODS += lookup_hesiod.so parse_hesiod.so
@@ -41,9 +38,11 @@ all: $(MODS)
clean:
rm -f *.o *.s *.so
+# mount_smbfs.so is an obsolete module which must be removed
install: all
install -d -m 755 $(INSTALLROOT)$(autofslibdir)
install -c $(MODS) -m 644 $(INSTALLROOT)$(autofslibdir)
+ -rm -f $(INSTALLROOT)$(autofslibdir)/mount_smbfs.so
#
# Ad hoc compilation rules for modules which need auxilliary libraries
diff --git a/modules/lookup_program.c b/modules/lookup_program.c
index 9b84a97..f330bba 100644
--- a/modules/lookup_program.c
+++ b/modules/lookup_program.c
@@ -14,10 +14,6 @@
*
* ----------------------------------------------------------------------- */
-/*
-
- */
-
#include <ctype.h>
#include <errno.h>
#include <limits.h>
diff --git a/modules/mount_generic.c b/modules/mount_generic.c
index e0110d3..135a10b 100644
--- a/modules/mount_generic.c
+++ b/modules/mount_generic.c
@@ -4,7 +4,7 @@
* mount_generic.c - module for Linux automountd to mount filesystems
* for which no special magic is required
*
- * Copyright 1997 Transmeta Corporation - All Rights Reserved
+ * Copyright 1997-1999 Transmeta Corporation - All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/modules/mount_smbfs.c b/modules/mount_smbfs.c
deleted file mode 100644
index 472b961..0000000
--- a/modules/mount_smbfs.c
+++ /dev/null
@@ -1,189 +0,0 @@
-#ident "$Id$"
-/* ----------------------------------------------------------------------- *
- *
- * mount_smbfs.c
- *
- * Module for Linux automountd to mount an SMB/CIFS filesystem
- *
- * Mount point input format expected is: //server/service[/root_path...]
- *
- * Copyright 1997-1998 Transmeta Corporation - All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
- * USA; either version 2 of the License, or (at your option) any later
- * version; incorporated herein by reference.
- *
- * ----------------------------------------------------------------------- */
-
-#include <stdio.h>
-#include <malloc.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <string.h>
-#include <syslog.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#define MODULE_MOUNT
-#include "automount.h"
-
-#define MODPREFIX "mount(smbfs): "
-int mount_version = AUTOFS_MOUNT_VERSION; /* Required by protocol */
-
-struct smb_mount_opt {
- char *optname; /* mount-style option name */
- char *optflag; /* command-line flag for smbmount */
- int hasarg; /* takes argument? */
- int satisfies_pwd; /* true if this means we don't need a -n */
-};
-
-static struct smb_mount_opt mount_opt_list[] = {
- { "nocaps", "-C", 0, 0 },
- { "guest", "-n", 0, 1 },
- { "passwd", "-P", 1, 1 },
- { "srvname", "-s", 1, 0 },
- { "mysmbname", "-c", 1, 0 },
- { "login", "-U", 1, 0 },
- { "uid", "-u", 1, 0 },
- { "gid", "-g", 1, 0 },
- { "filemod", "-f", 1, 0 },
- { "dirmod", "-d", 1, 0 },
- { "port", "-p", 1, 0 },
- { "maxxmit", "-m", 1, 0 },
- { NULL, NULL, 0, 0 }
-};
-
-int mount_init(void **context)
-{
- return 0;
-}
-
-static int smb_parse_options(char *optstr, const char **argv,
- char *qbuf, int *qbuflen)
-{
- char *opt;
- int ln;
- int argc;
- int has_pwd;
- int qbufchr, qln;
- struct smb_mount_opt *mount_opt;
-
- has_pwd = 0;
- qbufchr = 0;
- argc = 0;
-
- if ( optstr ) {
- for ( opt = strtok(optstr, ",") ; opt ; opt = strtok(NULL, ",") ) {
- for ( mount_opt = mount_opt_list ; mount_opt->optname ; mount_opt++ ) {
- if ( mount_opt->hasarg ) {
- ln = strlen(mount_opt->optname);
- if ( !strncmp(opt, mount_opt->optname, ln) && opt[ln] == '=' ) {
- qln = strlen(opt)-ln;
- if ( argv ) {
- *(argv++) = mount_opt->optflag;
- memcpy(qbuf, opt+ln+1, qln);
- *(argv++) = qbuf;
- qbuf += qln;
- }
- qbufchr += qln;
- has_pwd = has_pwd || mount_opt->satisfies_pwd;
- argc += 2;
- break;
- }
- } else {
- if ( !strcmp(opt, mount_opt->optname) ) {
- if ( argv )
- *(argv++) = mount_opt->optflag;
- has_pwd = has_pwd || mount_opt->satisfies_pwd;
- argc++;
- break;
- }
- }
- }
- /* Ignore unknown options */
- }
- }
-
- if ( !has_pwd ) {
- syslog(LOG_DEBUG, MODPREFIX "no password option, adding -n");
- if ( argv )
- *(argv++) = "-n";
- argc++;
- }
-
- if ( argv )
- *argv = NULL;
-
- if ( qbuflen )
- *qbuflen = qbufchr;
-
- return argc;
-}
-
-int mount_mount(const char *root, const char *name, int name_len,
- const char *what, const char *fstype, const char *options,
- void *context)
-{
- char *fullpath, *optcopy;
- int err;
- char *qbuf;
- int argc, optsize, qbuflen;
- const char **argv;
-
- fullpath = alloca(strlen(root)+name_len+2);
- if (options)
- optcopy = alloca(optsize = strlen(options)+1);
- else {
- optsize = 0;
- optcopy = NULL;
- }
- if ( !fullpath || (!optcopy && optsize)) {
- syslog(LOG_ERR, MODPREFIX "alloca: %m");
- return 1;
- }
- sprintf(fullpath, "%s/%s", root, name);
-
- if (optsize)
- memcpy(optcopy, options, optsize);
-
- argc = smb_parse_options(optcopy, NULL, NULL, &qbuflen) + 4;
- argv = alloca(sizeof(char *) * argc);
- qbuf = alloca(qbuflen);
- if ( !argv || (qbuflen && !qbuf) ) {
- syslog(LOG_ERR, MODPREFIX "alloca: %m");
- return 1;
- }
- argv[0] = PATH_SMBMOUNT;
- argv[1] = what;
- argv[2] = fullpath;
- if (optsize)
- memcpy(optcopy, options, optsize);
- smb_parse_options(optcopy, argv+3, qbuf, NULL);
-
- syslog(LOG_DEBUG, MODPREFIX "calling mkdir %s", fullpath);
- if ( mkdir(fullpath, 0555) && errno != EEXIST ) {
- syslog(LOG_NOTICE, MODPREFIX "mkdir %s failed: %m", name);
- return 1;
- }
-
- err = spawnv(LOG_NOTICE, PATH_SMBMOUNT, argv);
-
- if ( err ) {
- rmdir(fullpath);
- syslog(LOG_NOTICE, MODPREFIX "failed to mount %s on %s", what, fullpath);
- return 1;
- } else {
- syslog(LOG_DEBUG, MODPREFIX "mounted %s on %s", what, fullpath);
- return 0;
- }
-}
-
-int mount_done(void *context)
-{
- return 0;
-}