diff -urN autofs-3.1.3/.autofs-3.1.3 autofs-3.1.4-pre1/.autofs-3.1.3 --- autofs-3.1.3/.autofs-3.1.3 Tue Nov 3 13:21:15 1998 +++ autofs-3.1.4-pre1/.autofs-3.1.3 Wed Dec 31 16:00:00 1969 @@ -1 +0,0 @@ -x diff -urN autofs-3.1.3/.autofs-3.1.4 autofs-3.1.4-pre1/.autofs-3.1.4 --- autofs-3.1.3/.autofs-3.1.4 Wed Dec 31 16:00:00 1969 +++ autofs-3.1.4-pre1/.autofs-3.1.4 Sun Mar 7 14:45:56 1999 @@ -0,0 +1 @@ +x diff -urN autofs-3.1.3/.version autofs-3.1.4-pre1/.version --- autofs-3.1.3/.version Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/.version Sun Mar 7 14:45:56 1999 @@ -1 +1 @@ -3.1.3 +3.1.4 diff -urN autofs-3.1.3/Makefile autofs-3.1.4-pre1/Makefile --- autofs-3.1.3/Makefile Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/Makefile Sun Mar 7 14:45:56 1999 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.10 1998/04/06 11:10:46 hpa Exp $ +# $Id: Makefile,v 1.11 1998/11/05 01:13:07 hpa Exp $ # # Main Makefile for the autofs user-space tools # @@ -6,8 +6,8 @@ -include Makefile.conf include Makefile.rules -.PHONY: daemon all kernel clean install install_kernel mrproper -.PHONY: distclean backup +.PHONY: daemon all kernel clean install install_kernel install_samples +.PHONY: mrproper distclean backup daemon: for i in $(SUBDIRS); do $(MAKE) -C $$i all; done @@ -26,6 +26,9 @@ install_kernel: if [ -d kernel ]; then $(MAKE) -C kernel install; fi + +install_samples: + if [ -d samples ]; then $(MAKE) -C samples install; fi mrproper distclean: clean find . -noleaf \( -name '*~' -o -name '#*' -o -name '*.orig' -o -name '*.rej' -o -name '*.old' \) -print0 | xargs -0 rm -f diff -urN autofs-3.1.3/Makefile.conf.in autofs-3.1.4-pre1/Makefile.conf.in --- autofs-3.1.3/Makefile.conf.in Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/Makefile.conf.in Sun Mar 7 14:45:56 1999 @@ -42,3 +42,6 @@ # Where to install man pages mandir = @mandir@ + +# Location for init.d files +initdir = @initdir@ diff -urN autofs-3.1.3/Makefile.rules autofs-3.1.4-pre1/Makefile.rules --- autofs-3.1.3/Makefile.rules Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/Makefile.rules Sun Mar 7 14:45:56 1999 @@ -1,5 +1,5 @@ # -*- makefile -*- -# $Id: Makefile.rules,v 1.10 1998/11/03 21:21:02 hpa Exp $ +# $Id: Makefile.rules,v 1.11 1999/03/07 22:36:55 hpa Exp $ # # Makefile rules for autofs project # @@ -9,7 +9,7 @@ INCDIRS = include samples INCFILES = COPYING COPYRIGHT NEWS README* TODO Makefile Makefile.rules \ Makefile.conf.in .version .autofs-* configure.in aclocal.m4 \ - configure *.patch + configure *.patch autofs.spec # Compilers, linkers and flags # The STRIP defined here *must not* remove any dynamic-loading symbols diff -urN autofs-3.1.3/NEWS autofs-3.1.4-pre1/NEWS --- autofs-3.1.3/NEWS Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/NEWS Sun Mar 7 14:45:56 1999 @@ -1,3 +1,11 @@ +Since autofs-3.1.3: +------------------- +* Merge in documentation changes from RedHat RPM. +* Support installing the samples stuff (make install_samples). +* 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. + Since autofs-3.1.2: ------------------- * Added README.options; missing since 3.1.0... oops! diff -urN autofs-3.1.3/README autofs-3.1.4-pre1/README --- autofs-3.1.3/README Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/README Sun Mar 7 14:45:56 1999 @@ -1,11 +1,17 @@ -*- text -*- -$Id: README,v 1.5 1998/04/09 23:46:00 hpa Exp $ +$Id: README,v 1.6 1998/11/05 01:13:09 hpa Exp $ autofs is a kernel-based automounter for Linux. It performs a job similar to amd(8) but relies on a small stub of kernel code instead of pretending to be an NFS server. The result is simpler code, better reliability, and much faster operation in the common case (everything already mounted.) + +An AMD/AutoFS HOWTO is available at: + +http://www.Linux-Consulting.com/Amd_AutoFS/autofs.html + +... as well as from your favourite HOWTO archive. To build autofs, please run: diff -urN autofs-3.1.3/TODO autofs-3.1.4-pre1/TODO --- autofs-3.1.3/TODO Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/TODO Sun Mar 7 14:45:56 1999 @@ -1,6 +1,10 @@ +$Id: TODO,v 1.5 1998/11/05 04:09:48 hpa Exp $ + autofs v3 TODO list ------------------- -* Additional lookup modules: [ng]dbm, db/hash...? +* The autofs v3 project is closed, except for bugfixes. I may or may + not choose to accept feature enhancements written by other people; + please contact me directly. autofs v4 TODO list ------------------- diff -urN autofs-3.1.3/aclocal.m4 autofs-3.1.4-pre1/aclocal.m4 --- autofs-3.1.3/aclocal.m4 Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/aclocal.m4 Sun Mar 7 14:45:56 1999 @@ -1,4 +1,4 @@ -dnl $Id: aclocal.m4,v 1.4 1998/04/01 11:32:20 hpa Exp $ +dnl $Id: aclocal.m4,v 1.5 1998/11/05 01:13:09 hpa Exp $ dnl -------------------------------------------------------------------------- dnl AF_PATH_INCLUDE: @@ -32,4 +32,22 @@ else AC_MSG_RESULT(no) fi +fi]) + +dnl -------------------------------------------------------------------------- +dnl AF_INIT_D +dnl +dnl Check the location of the init.d directory +dnl -------------------------------------------------------------------------- +AC_DEFUN(AF_INIT_D, +[if test -z "$initdir"; then + AC_MSG_CHECKING([location of the init.d directory]) + for init_d in /etc/init.d /etc/rc.d/init.d; do + if test -z "$initdir"; then + if test -d "$init_d"; then + initdir="$init_d" + AC_MSG_RESULT($initdir) + fi + fi + done fi]) diff -urN autofs-3.1.3/autofs.spec autofs-3.1.4-pre1/autofs.spec --- autofs-3.1.3/autofs.spec Wed Dec 31 16:00:00 1969 +++ autofs-3.1.4-pre1/autofs.spec Sun Mar 7 14:45:56 1999 @@ -0,0 +1,130 @@ +# $Id: autofs.spec,v 1.4 1999/03/07 22:34:02 hpa Exp $ +Summary: autofs daemon +Name: autofs +%define version 3.1.4 +Version: %{version} +Release: 1 +Copyright: GPL +Group: Networking/Daemons +Source: ftp://ftp.kernel.org/pub/linux/daemons/autofs/autofs-%{version}.tar.gz +# Patch: autofs-3.1.1-rh.patch +Buildroot: /var/tmp/autofs-tmp +Prereq: chkconfig +Requires: /bin/bash mktemp sed textutils sh-utils grep /bin/ps +Summary(de): autofs daemon +Summary(fr): démon autofs +Summary(tr): autofs sunucu süreci +Summary(sv): autofs-daemon + +%description +autofs is a daemon which automatically mounts filesystems when you use +them, and unmounts them later when you are not using them. This can +include network filesystems, CD-ROMs, floppies, and so forth. + +%description -l de +autofs ist ein Dämon, der Dateisysteme automatisch montiert, wenn sie +benutzt werden, und sie später bei Nichtbenutzung wieder demontiert. +Dies kann Netz-Dateisysteme, CD-ROMs, Disketten und ähnliches einschließen. + +%description -l fr +autofs est un démon qui monte automatiquement les systèmes de fichiers +lorsqu'on les utilise et les démonte lorsqu'on ne les utilise plus. Cela +inclus les systèmes de fichiers réseau, les CD-ROMs, les disquettes, etc. + +%description -l tr +autofs, kullanýlan dosya sistemlerini gerek olunca kendiliðinden baðlar +ve kullanýmlarý sona erince yine kendiliðinden çözer. Bu iþlem, að dosya +sistemleri, CD-ROM'lar ve disketler üzerinde yapýlabilir. + +%description -l sv +autofs är en daemon som mountar filsystem när de använda, och senare +unmountar dem när de har varit oanvända en bestämd tid. Detta kan +inkludera nätfilsystem, CD-ROM, floppydiskar, och så vidare. + +%prep +%setup -q + +%build +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr +make + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +mkdir -p $RPM_BUILD_ROOT/usr/sbin +mkdir -p $RPM_BUILD_ROOT/usr/lib/autofs +mkdir -p $RPM_BUILD_ROOT/usr/man/man5 +mkdir -p $RPM_BUILD_ROOT/usr/man/man8 + +make install INSTALLROOT=$RPM_BUILD_ROOT +make install_samples INSTALLROOT=$RPM_BUILD_ROOT +install -m 755 -d $RPM_BUILD_ROOT/misc + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +chkconfig --add autofs + +%postun +if [ "$1" = 0 ] ; then + chkconfig --del autofs +fi + +%files +%defattr(-,root,root) +%doc COPYRIGHT NEWS README TODO +%config /etc/rc.d/init.d/autofs +%config(missingok) /etc/auto.master +%config(missingok) /etc/auto.misc +/usr/sbin/automount +%dir /misc +/usr/lib/autofs +/usr/man/*/* + +%changelog +$Log: autofs.spec,v $ +Revision 1.4 1999/03/07 22:34:02 hpa +Added (missingok) to auto.master. + +Revision 1.3 1998/11/05 04:06:00 hpa +Regularized the logs. + +Revision 1.2 1998/11/05 04:00:50 hpa +Add RCS Id/Log tags. + +Revision 1.1 1998/11/05 01:13:10 hpa +Imported spec file from RedHat Rawhide SRPM 3.1.1-8; +adjusted to be closer to 3.1.4 recommended use; not +done yet, however. + +RedHat logs: + +* Tue Oct 6 1998 Bill Nottingham +- fix bash2 breakage in init script + +* Sun Aug 23 1998 Jeff Johnson +- typo in man page. + +* Mon Jul 20 1998 Jeff Johnson +- added sparc to ExclusiveArch. + +* Thu May 07 1998 Prospector System +- translations modified for de, fr, tr + +* Thu Apr 30 1998 Cristian Gafton +- updated to 3.1.1 + +* Wed Apr 22 1998 Michael K. Johnson +- enhanced initscripts + +* Fri Dec 05 1997 Michael K. Johnson +- Link with -lnsl for glibc compliance. + +* Thu Oct 23 1997 Michael K. Johnson +- exclusivearch for i386 for now, since our kernel packages on + other platforms don't include autofs yet. +- improvements to initscripts. + +* Thu Oct 16 1997 Michael K. Johnson +- Built package from 0.3.14 for 5.0 diff -urN autofs-3.1.3/configure autofs-3.1.4-pre1/configure --- autofs-3.1.3/configure Tue Nov 3 13:21:15 1998 +++ autofs-3.1.4-pre1/configure Sun Mar 7 14:45:56 1999 @@ -455,7 +455,7 @@ # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=.autofs-3.1.3 +ac_unique_file=.autofs-3.1.4 # Find the source files, if location was not specified. if test -z "$srcdir"; then @@ -1021,6 +1021,23 @@ # +# Location of init.d directory? +# +if test -z "$initdir"; then + echo $ac_n "checking location of the init.d directory""... $ac_c" 1>&6 +echo "configure:1029: checking location of the init.d directory" >&5 + for init_d in /etc/init.d /etc/rc.d/init.d; do + if test -z "$initdir"; then + if test -d "$init_d"; then + initdir="$init_d" + echo "$ac_t""$initdir" 1>&6 + fi + fi + done +fi + + +# # Write Makefile.conf and include/config.h # @@ -1123,6 +1140,7 @@ s%@HESIOD_FLAGS@%$HESIOD_FLAGS%g s%@CPP@%$CPP%g s%@HAVE_NISPLUS@%$HAVE_NISPLUS%g +s%@initdir@%$initdir%g CEOF EOF diff -urN autofs-3.1.3/configure.in autofs-3.1.4-pre1/configure.in --- autofs-3.1.3/configure.in Tue Nov 3 13:21:15 1998 +++ autofs-3.1.4-pre1/configure.in Sun Mar 7 14:45:56 1999 @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.10 1998/04/06 11:14:45 hpa Exp $ +# $Id: configure.in,v 1.11 1998/11/05 01:13:10 hpa Exp $ # configure.in for the autofs daemon # @@ -7,7 +7,7 @@ # define([AC_CACHE_LOAD], )dnl define([AC_CACHE_SAVE], )dnl -AC_INIT(.autofs-3.1.3) +AC_INIT(.autofs-3.1.4) # # autofs installs by default in /usr @@ -84,6 +84,12 @@ HAVE_NISPLUS=0 AC_CHECK_HEADER(rpcsvc/nis.h, HAVE_NISPLUS=1) AC_SUBST(HAVE_NISPLUS) + +# +# Location of init.d directory? +# +AF_INIT_D() +AC_SUBST(initdir) # # Write Makefile.conf and include/config.h diff -urN autofs-3.1.3/man/Makefile autofs-3.1.4-pre1/man/Makefile --- autofs-3.1.3/man/Makefile Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/man/Makefile Sun Mar 7 14:45:55 1999 @@ -1,13 +1,20 @@ -# $Id: Makefile,v 1.4 1998/03/29 10:35:38 hpa Exp $ +# $Id: Makefile,v 1.6 1998/11/05 01:15:17 hpa Exp $ -include ../Makefile.conf include ../Makefile.rules -install: +GENFILES = $(patsubst %.in, %, $(wildcard *.[58].in)) + +.SUFFIXES: .in + +.in: + sed -e 's|@@INIT.D@@|$(initdir)|g' < $< > $@ + +all: $(GENFILES) + +install: all install -c *.5 -m 644 $(INSTALLROOT)$(mandir)/man5 install -c *.8 -m 644 $(INSTALLROOT)$(mandir)/man8 -all: - clean: - + rm -f $(GENFILES) diff -urN autofs-3.1.3/man/auto.master.5 autofs-3.1.4-pre1/man/auto.master.5 --- autofs-3.1.3/man/auto.master.5 Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/man/auto.master.5 Sun Mar 7 14:45:55 1999 @@ -1,5 +1,5 @@ .\" t -.\" $Id: auto.master.5,v 1.2 1997/10/06 21:52:01 hpa Exp $ +.\" $Id: auto.master.5,v 1.3 1998/11/05 01:13:18 hpa Exp $ .TH AUTO.MASTER 5 "9 Sep 1997" .SH NAME /etc/auto.master \- Master Map for automounter @@ -32,7 +32,7 @@ tabs. Lines beginning with # are comments. The first field is the mount point. Second field is the map file to be consulted for this mount-point. The third field is optional and can contain options to be applied to all -entries in the map. Options are cumulative which is a difference to the +entries in the map. Options are cumulative, which is a difference to the behavior of the SunOS automounter. The format of the map file and the options are described in diff -urN autofs-3.1.3/man/autofs.5 autofs-3.1.4-pre1/man/autofs.5 --- autofs-3.1.3/man/autofs.5 Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/man/autofs.5 Sun Mar 7 14:45:55 1999 @@ -1,5 +1,5 @@ .\" t -.\" $Id: autofs.5,v 1.3 1998/04/06 10:58:15 hpa Exp $ +.\" $Id: autofs.5,v 1.4 1998/11/05 01:13:19 hpa Exp $ .TH AUTOFS 5 "6 Apr 1998" .SH NAME autofs \- Format of the automounter maps @@ -79,7 +79,7 @@ is expanded to the value of the .B key field that matched the line (which probably only makes sense together with -a wildchard key). +a wildcard key). .SS Wildcard Key A * in the .B key diff -urN autofs-3.1.3/man/autofs.8 autofs-3.1.4-pre1/man/autofs.8 --- autofs-3.1.3/man/autofs.8 Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/man/autofs.8 Wed Dec 31 16:00:00 1969 @@ -1,64 +0,0 @@ -.\" $Id: autofs.8,v 1.2 1997/10/06 21:52:01 hpa Exp $ -.TH AUTOFS 8 "9 Sep 1997" -.SH NAME -/etc/init.d/autofs \- Control Script for automounter -.SH SYNOPSIS -.B /etc/init.d/autofs -.I start|stop|reload -.SH "DESCRIPTION" -.B autofs -control the operation of the -.BR automount (8) -daemons running on the Linux system. Usually -.B autofs -is invoked at system boot time with the -.I start -parameter and at shutdown time with the -.I stop -parameter. The -.B autofs -script can also manually be invoked by the system administrator to shut -down, restart or reload the automounters. -.P -.SH "OPERATION" -.B autofs -will consult a configuration file -.I /etc/auto.master -(see -.BR auto.master (5)) -to find mount points on the system. For each of those mount points a -.BR automount (8) -process is started with the appropriate parameters. You can check the -active mount points for the automounter with the -.B /etc/init.d/autofs status -command. After the -.I auto.master -configuration file is processed the -.B autofs -script will check for an NIS map with the same name. If such a map exists -then that map will be processed in the same way as the auto.master map. The -NIS map will be processed last. -.P -.B /etc/init.d/autofs reload -will check the current auto.master map against running daemons. It will kill -those daemons whose entries have changed and then start daemons for new or -changed entries. -.P -If a map is modified then the change will become effective immediately. If -the -.I auto.master -map is modified then the -.B autofs -script must be rerun to activate the changes. -.P -.B /etc/init.d/autofs status -will display the current configuration and a list of currently running -automount daemons. -.SH "SEE ALSO" -.BR automount (8), -.BR autofs (5), -.BR auto.master (5). -.SH AUTHOR -This manual page was written by Christoph Lameter , -for the Debian GNU/Linux system. Edited by H. Peter Anvin -. diff -urN autofs-3.1.3/man/autofs.8.in autofs-3.1.4-pre1/man/autofs.8.in --- autofs-3.1.3/man/autofs.8.in Wed Dec 31 16:00:00 1969 +++ autofs-3.1.4-pre1/man/autofs.8.in Sun Mar 7 14:45:55 1999 @@ -0,0 +1,64 @@ +.\" $Id: autofs.8.in,v 1.1 1998/11/05 01:13:19 hpa Exp $ +.TH AUTOFS 8 "9 Sep 1997" +.SH NAME +@@INIT.D@@/autofs \- Control Script for automounter +.SH SYNOPSIS +.B @@INIT.D@@/autofs +.I start|stop|reload +.SH "DESCRIPTION" +.B autofs +control the operation of the +.BR automount (8) +daemons running on the Linux system. Usually +.B autofs +is invoked at system boot time with the +.I start +parameter and at shutdown time with the +.I stop +parameter. The +.B autofs +script can also manually be invoked by the system administrator to shut +down, restart or reload the automounters. +.P +.SH "OPERATION" +.B autofs +will consult a configuration file +.I /etc/auto.master +(see +.BR auto.master (5)) +to find mount points on the system. For each of those mount points a +.BR automount (8) +process is started with the appropriate parameters. You can check the +active mount points for the automounter with the +.B @@INIT.D@@/autofs status +command. After the +.I auto.master +configuration file is processed the +.B autofs +script will check for an NIS map with the same name. If such a map exists +then that map will be processed in the same way as the auto.master map. The +NIS map will be processed last. +.P +.B @@INIT.D@@/autofs reload +will check the current auto.master map against running daemons. It will kill +those daemons whose entries have changed and then start daemons for new or +changed entries. +.P +If a map is modified then the change will become effective immediately. If +the +.I auto.master +map is modified then the +.B autofs +script must be rerun to activate the changes. +.P +.B @@INIT.D@@/autofs status +will display the current configuration and a list of currently running +automount daemons. +.SH "SEE ALSO" +.BR automount (8), +.BR autofs (5), +.BR auto.master (5). +.SH AUTHOR +This manual page was written by Christoph Lameter , +for the Debian GNU/Linux system. Edited by H. Peter Anvin +. diff -urN autofs-3.1.3/modules/Makefile autofs-3.1.4-pre1/modules/Makefile --- autofs-3.1.3/modules/Makefile Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/modules/Makefile Sun Mar 7 14:45:55 1999 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.9 1998/03/30 02:23:56 hpa Exp $ +# $Id: Makefile,v 1.10 1999/03/07 22:34:52 hpa Exp $ # # Makefile for autofs # @@ -6,11 +6,11 @@ -include ../Makefile.conf include ../Makefile.rules -SRCS := lookup_yp.c lookup_file.c lookup_program.c \ +SRCS := lookup_yp.c lookup_file.c lookup_program.c lookup_userhome.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 \ +MODS := lookup_yp.so lookup_file.so lookup_program.so lookup_userhome.so \ parse_sun.so \ mount_generic.so mount_nfs.so mount_afs.so mount_autofs.so diff -urN autofs-3.1.3/modules/lookup_userhome.c autofs-3.1.4-pre1/modules/lookup_userhome.c --- autofs-3.1.3/modules/lookup_userhome.c Wed Dec 31 16:00:00 1969 +++ autofs-3.1.4-pre1/modules/lookup_userhome.c Sun Mar 7 14:45:55 1999 @@ -0,0 +1,71 @@ +#ident "$Id: lookup_userhome.c,v 1.1 1999/03/07 22:34:52 hpa Exp $" +/* ----------------------------------------------------------------------- * + * + * lookup_userhome.c - module for Linux automount to generate symlinks + * to user home directories + * + * Copyright 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 + * 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 +#include +#include +#include +#include +#include +#include +#include +#include + +#define MODULE_LOOKUP +#include "automount.h" + +#define MODPREFIX "lookup(userhome): " + +int lookup_version = AUTOFS_LOOKUP_VERSION; /* Required by protocol */ + +int lookup_init(const char *mapfmt, int argc, const char * const *argv, + void **context) +{ + return 0; /* Nothing to do */ +} + +int lookup_mount(const char *root, const char *name, + int name_len, void *context) +{ + struct passwd *pw; + + syslog(LOG_DEBUG, MODPREFIX "looking up %s", name); + + /* Get the equivalent username */ + pw = getpwnam(name); + if ( !pw ) { + syslog(LOG_DEBUG, MODPREFIX "not found: %s", name); + return 1; /* Unknown user or error */ + } + + /* Create the appropriate symlink */ + if ( chdir(root) ) { + syslog(LOG_ERR, MODPREFIX "chdir failed: %m"); + return 1; + } + + if ( symlink(pw->pw_dir, name) && errno != EEXIST ) { + syslog(LOG_DEBUG, MODPREFIX "symlink failed: %m"); + return 1; + } + + return 0; +} + +int lookup_done(void *context) +{ + return 0; +} diff -urN autofs-3.1.3/modules/lookup_yp.c autofs-3.1.4-pre1/modules/lookup_yp.c --- autofs-3.1.3/modules/lookup_yp.c Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/modules/lookup_yp.c Sun Mar 7 14:45:55 1999 @@ -1,4 +1,4 @@ -#ident "$Id: lookup_yp.c,v 1.2 1997/10/06 21:52:03 hpa Exp $" +#ident "$Id: lookup_yp.c,v 1.3 1999/03/07 22:34:52 hpa Exp $" /* ----------------------------------------------------------------------- * * * lookup_yp.c - module for Linux automountd to access a YP (NIS) @@ -13,9 +13,6 @@ * version; incorporated herein by reference. * * ----------------------------------------------------------------------- */ - -/* - */ #include #include diff -urN autofs-3.1.3/modules/mount_autofs.c autofs-3.1.4-pre1/modules/mount_autofs.c --- autofs-3.1.3/modules/mount_autofs.c Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/modules/mount_autofs.c Sun Mar 7 14:45:55 1999 @@ -1,4 +1,4 @@ -#ident "$Id: mount_autofs.c,v 1.5 1998/04/06 11:04:14 hpa Exp $" +#ident "$Id: mount_autofs.c,v 1.6 1999/03/07 22:34:53 hpa Exp $" /* * mount_autofs.c * @@ -75,6 +75,7 @@ char *p = options; do { argc++; + if ( *p == ',' ) p++; } while ((p = strchr(p,',')) != NULL); } argv = (char **) alloca((argc+1) * sizeof(char *)); @@ -94,9 +95,16 @@ argv[argc++] = p; if ( options ) { - argv[argc++] = strtok(options, ","); - while ((argv[argc++] = strtok(NULL, ",")) != NULL) - continue; + /* Rainer Clasen reported funniness using strtok() here. */ + + p = options; + do { + if ( *p == ',' ) { + *p = '\0'; + p++; + } + argv[argc++] = p; + } while ( (p = strchr(p,',')) != NULL ); } argv[argc] = NULL; diff -urN autofs-3.1.3/samples/Makefile autofs-3.1.4-pre1/samples/Makefile --- autofs-3.1.3/samples/Makefile Wed Dec 31 16:00:00 1969 +++ autofs-3.1.4-pre1/samples/Makefile Sun Mar 7 14:45:56 1999 @@ -0,0 +1,19 @@ +# $Id: Makefile,v 1.3 1999/03/07 22:39:33 hpa Exp $ + +-include ../Makefile.conf +include ../Makefile.rules + +all: rc.autofs + +clean: + rm -f rc.autofs + +install: all + -mv -f $(INSTALLROOT)/etc/auto.master $(INSTALLROOT)/etc/auto.master.old + install -c auto.master -m 644 $(INSTALLROOT)/etc + -mv -f $(INSTALLROOT)/etc/auto.misc $(INSTALLROOT)/etc/auto.misc.old + install -c auto.misc -m 644 $(INSTALLROOT)/etc + install -c rc.autofs -m 755 $(INSTALLROOT)$(initdir)/autofs + +rc.autofs: rc.autofs.in + sed -e "s/@@sbindir@@/$(sbindir)/g" < rc.autofs.in > rc.autofs diff -urN autofs-3.1.3/samples/rc.autofs autofs-3.1.4-pre1/samples/rc.autofs --- autofs-3.1.3/samples/rc.autofs Tue Nov 3 13:21:14 1998 +++ autofs-3.1.4-pre1/samples/rc.autofs Wed Dec 31 16:00:00 1969 @@ -1,229 +0,0 @@ -#! /bin/bash -# -# $Id: rc.autofs,v 1.4 1998/11/03 21:05:18 hpa Exp $ -# -# rc file for automount using a Sun-style "master map". -# We first look for a local /etc/auto.master, then a YP -# map with that name -# -# On most distributions, this file should be called: -# /etc/rc.d/init.d/autofs or /etc/init.d/autofs -# - -# This is used in the Debian distribution to determine the proper -# location for the S- and K-links to this init file. -# The following value is extracted by debstd to figure out how to -# generate the postinst script. Edit the field to change the way the -# script is registered through update-rc.d (see the manpage for -# update-rc.d!) -# -FLAGS="defaults 21" - -test -f /usr/sbin/automount || exit 0 -PATH=/sbin:/usr/sbin:/bin:/usr/bin -export PATH - -# -# We can add local options here -# e.g. localoptions='rsize=8192,wsize=8192' -# -localoptions='' - -# -# This function will build a list of automount commands to execute in -# order # to activate all the mount points. It is used to figure out -# the difference of automount points in case of a reload -# -function getmounts() -{ -# -# Check for local maps to be loaded -# -if [ -f /etc/auto.master ] -then - cat /etc/auto.master | sed -e '/^#/d' -e '/^$/d'| ( - while read dir map options - do - if [ ! -z "$dir" -a ! -z "$map" \ - -a x`echo "$map" | cut -c1` != 'x-' ] - then - map=`echo "/etc/$map" | sed -e 's:^/etc//:/:'` - options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'` - if [ -x $map ]; then - echo "automount $dir program $map $options $localoptions" - elif [ -f $map ]; then - echo "automount $dir file $map $options $localoptions" - else - echo "automount $dir `basename $map` $options $localoptions" - fi - fi - done - ) -fi - -# -# Check for YellowPage maps to be loaded -# -if [ -e /usr/bin/ypcat ] && [ `ypcat -k auto.master 2>/dev/null | wc -l` -gt 0 ] -then - ypcat -k auto.master | ( - while read dir map options - do - if [ ! -z "$dir" -a ! -z "$map" \ - -a x`echo "$map" | cut -c1` != 'x-' ] - then - map=`echo "$map" | sed -e 's/^auto_/auto./'` - options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'` - echo "automount $dir yp $map $options $localoptions" - fi - done - ) -fi -} - -# -# Status lister. -# -function status() -{ - echo "Configured Mount Points:" - echo "------------------------" - getmounts - echo "" - echo "Active Mount Points:" - echo "--------------------" - ps ax|grep "[0-9]:[0-9][0-9] automount " | ( - while read pid tt stat time command; do echo $command; done - ) -} - - -# -# Redhat start/stop function. -# -function redhat() -{ - -# -# See how we were called. -# -case "$1" in - start) - # Check if the automounter is already running? - if [ ! -f /var/lock/subsys/automount ]; then - echo 'Starting automounter: ' - getmounts | sh - touch /var/lock/subsys/automount - fi - ;; - stop) - killall -TERM automount - rm -f /var/lock/subsys/automount - ;; - reload|restart) - if [ ! -f /var/lock/subsys/automount ]; then - echo "Automounter not running" - exit 1 - fi - echo "Checking for changes to /etc/auto.master ...." - TMP1=`tempfile`; - TMP2=`tempfile`; - getmounts >$TMP1 - ps ax|grep "[0-9]:[0-9][0-9] automount " | ( - while read pid tt stat time command; do - echo "$command" >>$TMP2 - if ! grep -q "^$command" $TMP2; then - kill -USR2 $pid - echo "Stop $command" - fi - done - ) - cat $TMP1 | ( while read x; do - if ! grep -q "^$x" $TMP2; then - $x - echo "Start $x" - fi - done ) - rm $TMP1 $TMP2 - ;; - status) - status - ;; - *) - echo "Usage: /etc/init.d/autofs {start|stop|restart|reload|status}" - exit 1 -esac -} - -# -# Debian start/stop functions. -# -function debian() -{ - -DAEMON=/usr/sbin/automount - -# -# See how we were called. -# -case "$1" in - start) - echo -n 'Starting automounter:' - getmounts | while read cmd mnt rest - do - echo -n " $mnt" - pidfile=/var/run/automount`echo $mnt | sed 's/\//./'`.pid - start-stop-daemon --start --pidfile $pidfile --quiet \ - --exec $DAEMON -- $mnt $rest - # - # Automount needs a '--pidfile' or '-p' option. - # For now we look for the pid ourself. - # - ps ax | grep "[0-9]:[0-9][0-9] $DAEMON $mnt" | ( - read pid rest - echo $pid > $pidfile - echo "$mnt $rest" >> $pidfile - ) - done - echo "." - ;; - stop) - echo 'Stopping automounter.' - start-stop-daemon --stop --quiet --signal USR2 --exec $DAEMON - ;; - reload|restart) - echo "Reloading automounter: checking for changes ... " - TMP=/var/run/automount.tmp - getmounts >$TMP - for i in /var/run/automount.*.pid - do - pid=`head -n 1 $i 2>/dev/null` - [ "$pid" = "" ] && continue - command=`tail +2 $i` - if ! grep -q "^$command" $TMP - then - echo "Stopping automounter: $command" - kill -USR2 $pid - fi - done - rm -f $TMP - /etc/init.d/autofs start - ;; - status) - status - ;; - *) - echo "Usage: /etc/init.d/autofs {start|stop|restart|reload|status}" >&2 - exit 1 - ;; -esac -} - -if [ -f /etc/debian_version ] -then - debian "$@" -else - redhat "$@" -fi - -exit 0 diff -urN autofs-3.1.3/samples/rc.autofs.in autofs-3.1.4-pre1/samples/rc.autofs.in --- autofs-3.1.3/samples/rc.autofs.in Wed Dec 31 16:00:00 1969 +++ autofs-3.1.4-pre1/samples/rc.autofs.in Sun Mar 7 14:45:56 1999 @@ -0,0 +1,261 @@ +#! /bin/bash +# +# $Id: rc.autofs.in,v 1.2 1999/03/07 22:38:33 hpa Exp $ +# +# rc file for automount using a Sun-style "master map". +# We first look for a local /etc/auto.master, then a YP +# map with that name +# +# On most distributions, this file should be called: +# /etc/rc.d/init.d/autofs or /etc/init.d/autofs +# + +# This is used in the Debian distribution to determine the proper +# location for the S- and K-links to this init file. +# The following value is extracted by debstd to figure out how to +# generate the postinst script. Edit the field to change the way the +# script is registered through update-rc.d (see the manpage for +# update-rc.d!) +# +FLAGS="defaults 21" + +# +# Location of the automount daemon +# +DAEMON=@@sbindir@@/automount + +# +# Determine which kind of configuration we're using +# +system=unknown +if [ -f /etc/debian_version ]; then + system=debian + initdir=/etc/init.d +elif [ -f /etc/redhat-release ]; then + system=redhat + initdir=/etc/rc.d/init.d +else + echo "$0: Unknown system, please port and contact autofs@linux.kernel.org" 1>&2 + exit 1 +fi + +if [ $system = redhat ]; then + . $initdir/functions +fi + +test -e $DAEMON || exit 0 +thisscript="$0" +if [ ! test -f $thisscript ]; then + echo "$0: Cannot find myself" 1>&2 + exit 1 +fi + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +export PATH + +# +# We can add local options here +# e.g. localoptions='rsize=8192,wsize=8192' +# +localoptions='' + +# +# This function will build a list of automount commands to execute in +# order to activate all the mount points. It is used to figure out +# the difference of automount points in case of a reload +# +function getmounts() +{ +# +# Check for local maps to be loaded +# +if [ -f /etc/auto.master ] +then + cat /etc/auto.master | sed -e '/^#/d' -e '/^$/d'| ( + while read dir map options + do + if [ ! -z "$dir" -a ! -z "$map" \ + -a x`echo "$map" | cut -c1` != 'x-' ] + then + map=`echo "/etc/$map" | sed -e 's:^/etc//:/:'` + options=`echo "$options" | sed -e 's/\(^\|[ \t]\)-/\1/g'` + if [ -x $map ]; then + echo "$DAEMON $dir program $map $options $localoptions" + elif [ -f $map ]; then + echo "$DAEMON $dir file $map $options $localoptions" + else + echo "$DAEMON $dir `basename $map` $options $localoptions" + fi + fi + done + ) +fi + +# +# Check for YellowPage maps to be loaded +# +if [ -e /usr/bin/ypcat ] && [ `ypcat -k auto.master 2>/dev/null | wc -l` -gt 0 ] +then + ypcat -k auto.master | ( + while read dir map options + do + if [ ! -z "$dir" -a ! -z "$map" \ + -a x`echo "$map" | cut -c1` != 'x-' ] + then + map=`echo "$map" | sed -e 's/^auto_/auto./'` + if echo $options | grep -- '-t' >/dev/null 2>&1 ; then + mountoptions="--timeout $(echo $options | \ + sed 's/^.*-t\(imeout\)*[ \t]*\([0-9][0-9]*\).*$/\2/g')" + fi + options=`echo "$options" | sed -e ' + s/--*t\(imeout\)*[ \t]*[0-9][0-9]*//g + s/\(^\|[ \t]\)-/\1/g'` + echo "$DAEMON $dir yp $map $options $localoptions" + fi + done + ) +fi +} + +# +# Status lister. +# +function status() +{ + echo "Configured Mount Points:" + echo "------------------------" + getmounts + echo "" + echo "Active Mount Points:" + echo "--------------------" + ps ax|grep "[0-9]:[0-9][0-9] automount " | ( + while read pid tt stat time command; do echo $command; done + ) +} + + +# +# Redhat start/stop function. +# +function redhat() +{ + +# +# See how we were called. +# +case "$1" in + start) + # Check if the automounter is already running? + if [ ! -f /var/lock/subsys/automount ]; then + echo 'Starting automounter: ' + getmounts | sh + touch /var/lock/subsys/automount + fi + ;; + stop) + kill -TERM $(/sbin/pidof /usr/sbin/automount) + rm -f /var/lock/subsys/automount + ;; + reload|restart) + if [ ! -f /var/lock/subsys/automount ]; then + echo "Automounter not running" + exit 1 + fi + echo "Checking for changes to /etc/auto.master ...." + TMP1=`mktemp /tmp/autofs.XXXXXX` || { echo "could not make temp file" >& 2; exit 1; } + TMP2=`mktemp /tmp/autofs.XXXXXX` || { echo "could not make temp file" >& 2; exit 1; } + getmounts >$TMP1 + ps ax|grep "[0-9]:[0-9][0-9] automount " | ( + while read pid tt stat time command; do + echo "$command" >>$TMP2 + if ! grep -q "^$command" $TMP2; then + kill -USR2 $pid + echo "Stop $command" + fi + done + ) + cat $TMP1 | ( while read x; do + if ! grep -q "^$x" $TMP2; then + $x + echo "Start $x" + fi + done ) + rm -f $TMP1 $TMP2 + ;; + status) + status + ;; + *) + echo "Usage: $initdir/autofs {start|stop|restart|reload|status}" + exit 1 +esac +} + +# +# Debian start/stop functions. +# +function debian() +{ +# +# See how we were called. +# +case "$1" in + start) + echo -n 'Starting automounter:' + getmounts | while read cmd mnt rest + do + echo -n " $mnt" + pidfile=/var/run/automount`echo $mnt | sed 's/\//./'`.pid + start-stop-daemon --start --pidfile $pidfile --quiet \ + --exec $DAEMON -- $mnt $rest + # + # Automount needs a '--pidfile' or '-p' option. + # For now we look for the pid ourself. + # + ps ax | grep "[0-9]:[0-9][0-9] $DAEMON $mnt" | ( + read pid rest + echo $pid > $pidfile + echo "$mnt $rest" >> $pidfile + ) + done + echo "." + ;; + stop) + echo 'Stopping automounter.' + start-stop-daemon --stop --quiet --signal USR2 --exec $DAEMON + ;; + reload|restart) + echo "Reloading automounter: checking for changes ... " + TMP=/var/run/automount.tmp + getmounts >$TMP + for i in /var/run/automount.*.pid + do + pid=`head -n 1 $i 2>/dev/null` + [ "$pid" = "" ] && continue + command=`tail +2 $i` + if ! grep -q "^$command" $TMP + then + echo "Stopping automounter: $command" + kill -USR2 $pid + fi + done + rm -f $TMP + $thisscript start + ;; + status) + status + ;; + *) + echo "Usage: $initdir/autofs {start|stop|restart|reload|status}" >&2 + exit 1 + ;; +esac +} + +if [ $system = debian ]; then + debian "$@" +elif [ $system = redhat ]; then + redhat "$@" +fi + +exit 0