Erez Zadok [Mon, 10 Oct 2005 17:15:32 +0000 (17:15 +0000)]
relase 6.1.3
Erez Zadok [Mon, 10 Oct 2005 16:47:03 +0000 (16:47 +0000)]
nuke trailing spaces
Erez Zadok [Sat, 8 Oct 2005 02:56:55 +0000 (02:56 +0000)]
* m4/macros/check_mnttab_type.m4: move the test for MOUNT_* to the
very end, after the test using getvfsbyname().
* m4/macros/expand_run_string.m4: if the string value returned is
empty, consider it invalid.
Erez Zadok [Fri, 7 Oct 2005 23:17:03 +0000 (23:17 +0000)]
* m4/macros/check_varargs_macros.m4: rewrite macro so it'll
try and compile the varargs test, not just cpp it. Some systems
pass the old cpp test, but not when you actually try to compile
the code (Tru64's cc).
Erez Zadok [Fri, 7 Oct 2005 22:28:27 +0000 (22:28 +0000)]
* conf/autofs/autofs_solaris_v1.h: redefine
autofs_strdup_space_hack as a macro to str3cat(NULL,(s)," ","").
This works everywhere and we avoid linking problems, inline
functions, etc.
* conf/autofs/autofs_solaris_v1.c (autofs_mount_fs): remove
autofs_strdup_space_hack() function altogether.
Erez Zadok [Fri, 7 Oct 2005 21:24:26 +0000 (21:24 +0000)]
* m4/macros/os_cflags.m4: remove hack that hardcodes pte_t=u_int.
* configure.in: test for <sys/immu.h> header.
Test for pte_t, but only on IRIX6 systems.
* Makefile.am (EXTRA_DIST_M4): distribute new type_pte_t.m4 file.
* m4/macros/type_pte_t.m4: new test for existence of pte_t
typedef, needed on some IRIX-6.5/gcc systems.
Erez Zadok [Fri, 7 Oct 2005 20:34:18 +0000 (20:34 +0000)]
* m4/macros/header_templates.m4: add missing templates for
HAVE_EXTERN_GETDTABLESIZE, HAVE_EXTERN_GETWD, and
HAVE_EXTERN_UALARM.
Erez Zadok [Fri, 7 Oct 2005 20:05:47 +0000 (20:05 +0000)]
* amd/info_exec.c (exec_map_open): break assignment from inside
conditional, to work around an IRIX-6.5 cc bug.
Erez Zadok [Fri, 7 Oct 2005 18:55:12 +0000 (18:55 +0000)]
* fsinfo/fsi_util.c (set_ether_if), amd/map.c (unmount_mp),
libamu/xutil.c (expand_error), libamu/strutil.c (xsnprintf): avoid
comparison between signed and unsigned integers.
Erez Zadok [Fri, 7 Oct 2005 17:24:21 +0000 (17:24 +0000)]
standard usage and formatting
Erez Zadok [Fri, 7 Oct 2005 17:15:34 +0000 (17:15 +0000)]
* conf/autofs/autofs_solaris_v1.h, conf/autofs/autofs_solaris_v1.c
(autofs_strdup_space_hack): move "space_hack" function from static
inline in header, into the only source file that needs it. This
is cleaner and also prevents linking problem with some compilers
that won't apply CPP macros inside static inline functions (for
the strl* functions).
Erez Zadok [Fri, 7 Oct 2005 16:39:04 +0000 (16:39 +0000)]
* amq/pawd.c (find_mt, find_mlp): remove obsolete, inefficient
code.
(transform_dir): call the new, efficient amqproc_pawd_1() routine.
* amq/amq_clnt.c (amqproc_pawd_1): AMQPROC_PAWD wrapper routine.
* amq/amq.h (amqproc_pawd_1): extern for amq's AMQPROC_PAWD
wrapper routine.
* amd/amq_svc.c (amq_program_1): dispatch point for
amqproc_pawd_1_svc.
* amd/amq_subr.c (amqproc_pawd_1_svc): moved pawd's path-matching
functionality into Amd, where it can be done a lot more
efficiently. We don't have to construct and ship a whole export
tree from Amd to pawd. We just get a variable-length
xdr_wrapstring for the user's path, iterate over the entire export
list inside Amd, and return only a matched string if found
(otherwise we return "" to indicate that there was no match, and
let pawd printf the same string it sent over).
* amd/amd.h: extern for amqproc_pawd_1_svc, amd's service routine
the AMQPROC_PAWD RPC.
* amq/pawd.c (transform_dir): was using UDP only. Now will also
try TCP if UDP failed. Destroy client after use to avoid leftover
TCP sockets in the kernel.
Erez Zadok [Fri, 7 Oct 2005 03:52:42 +0000 (03:52 +0000)]
* ltmain.sh, m4/macros/libtool.m4: update to libtool-1.5.20.
Fixes Tru64 bugs when using ksh.
Erez Zadok [Fri, 7 Oct 2005 03:45:03 +0000 (03:45 +0000)]
* amd/amfs_toplvl.c (amfs_toplvl_mount): break complex ifdef macro
into two sections, to workaround a C99 varargs-macro bug in
gcc-3.2.2 (RH9).
Erez Zadok [Fri, 7 Oct 2005 01:40:02 +0000 (01:40 +0000)]
* libamu/wire.c (print_wires): convert argument-less xsnprintf to
xstrlcpy.
* include/am_utils.h: use new HAVE_C99_VARARGS_MACROS or
HAVE_GCC_VARARGS_MACROS to pass file name and line number to
xsnprintf/xvsnprintf.
* libamu/strutil.c (xsnprintf, xvsnprintf): if debugging is on,
then also print the source file name and line number that called
xsnprintf/xvsnprintf with a buffer that wasn't large enough (most
likely an am-utils bug).
* Makefile.am (EXTRA_DIST_M4): distribute new
check_varargs_macros.m4 file.
* configure.in: execute new AMU_VARARGS_MACROS test.
* m4/macros/check_varargs_macros.m4: new test to check what style
of variable-length argument macros, if any, does the
compiler/pre-processor supports.
Erez Zadok [Fri, 7 Oct 2005 00:20:05 +0000 (00:20 +0000)]
* conf/autofs/autofs_solaris_v2_v3.c (autofs_lookup_2_req)
conf/autofs/autofs_solaris_v1.c (autofs_mount_1_req), amd/opts.c,
amd/nfs_subr.c (nfsproc_lookup_2_svc), amd/nfs_start.c
(mount_automounter), amd/get_args.c (get_args), amd/amfs_toplvl.c,
amd/amfs_auto.c (amfs_auto_mount), amd/amd.h, amd/amd.c (main):
use sizeof() instead of fixed SIZEOF_* macros.
Erez Zadok [Thu, 6 Oct 2005 21:11:50 +0000 (21:11 +0000)]
* libamu/strutil.c (xstrlcat, xstrlcpy), include/am_utils.h
(DEBUG): if debugging is on, then also print the source file name
and line number that called xstrl* with a buffer that wasn't large
enough (most likely an am-utils bug)
Erez Zadok [Thu, 6 Oct 2005 20:33:31 +0000 (20:33 +0000)]
typo that hpux-cc caught
Erez Zadok [Thu, 6 Oct 2005 20:18:22 +0000 (20:18 +0000)]
* include/am_compat.h (INADDR_NONE): define in a common location,
if OS doesn't have it, use 0xffffffffU which should work with any
ANSI compiler.
* fixmount/fixmount.c, libamu/wire.c: remove local definition of
INADDR_NONE.
* amd/amfs_toplvl.c (amfs_toplvl_mount), amd/amfs_auto.c
(amfs_auto_mount): use common SIZEOF_OPTS in definition and call
to autofs_get_opts.
* amd/amd.h (SIZEOF_OPTS): moved #define to common header.
* amd/opts.c (expand_op): Need to check BUFSPACE for env for
vlen+1. Likewise for cp and strlen(cp)+1.
* amd/amfs_toplvl.c (amfs_toplvl_mount) [HAVE_FS_AUTOFS]: Pass new
size argument to autofs_get_opts.
Erez Zadok [Thu, 6 Oct 2005 01:06:39 +0000 (01:06 +0000)]
* amq/pawd.c (transform_dir): use TCP first, else UDP. Destroy
client after use to avoid leftover TCP sockets in the kernel.
Erez Zadok [Wed, 5 Oct 2005 23:31:08 +0000 (23:31 +0000)]
* libamu/hasmntopt.c (amu_hasmntopt): increase size of MNTMAXSTR
from 128 to to 256, because some users have really long option
strings. Suggestion from jon+amd-at-spock.org.
Erez Zadok [Wed, 5 Oct 2005 07:52:17 +0000 (07:52 +0000)]
* amd/opts.c (expand_op): should check BUFSPACE for vlen+1, not
just vlen. Bug discovered when started using xstrlcpy().
* ALL: convert from using strcat to the safer xstrlcat, and from
strcpy to safer xstrlcpy.
* hlfsd/hlfsd.h: remove old fatalerror() and ERRM macros.
* hlfsd/hlfsd.c (fatalerror): new function instead of macro.
Easier to use xstrlcat in this new function.
* amd/amd.h, include/am_utils.h, amd/amd.c: moved 'hostd' extern
from am_utils.h to amd.h, and define its size as a macro that
could be passed to xstrl*().
Erez Zadok [Wed, 5 Oct 2005 01:12:03 +0000 (01:12 +0000)]
* ALL: convert from using sprintf to the safer xsnprintf.
* mk-amd-map/Makefile.am (LDADD): link with libamu to get
xsnprintf().
* amd/amd.h, amd/amd.c, include/am_utils.h: moved pid_fsname
extern from am_utils.h to amd.h, and define its size as a macro
that could be passed to xsnprintf().
Erez Zadok [Mon, 3 Oct 2005 01:00:52 +0000 (01:00 +0000)]
* include/am_utils.h: extern for xvsnprintf().
* amd/autil.c: move strsplit() to libamu/strutil.c.
* libamu/Makefile.am: use strutil.c, not util.c.
* libamu/strutil.c: rename from util.c to explain better purpose
of file. Move xvsnprintf and xsnprintf from xutil.c to this
file. Sync up with 6.2 version of file.
* libamu/xutil.c: explain purpose of file. Move mkdirs/rmdirs
code from old util.c.
Erez Zadok [Sat, 1 Oct 2005 06:47:48 +0000 (06:47 +0000)]
* m4/macros/header_templates.m4: templates for FFS.
* m4/macros/check_mnttab_type.m4: on BSD44 systems, check for file
system mount table name via the MOUNT_* mount(2) macros (because
BSD44 keeps the mount table in the kernel).
* configure.in: synchronise order of searching for mnttab entries
and mount names. The new order is "ext3 ext2 ffs ufs 4.2 4.3 4.4
efs xfs jfs ultrix" (which would prefer ffs on BSD44 instead of
ufs, and ext3 instead of ext2 on Linux).
Erez Zadok [Sat, 1 Oct 2005 05:43:33 +0000 (05:43 +0000)]
* fsinfo/fsi_util.c (set_ether_if): use INADDR_NONE instead of
hard-coded value of -1.
* include/amq_defs.h (AMQ_STRLEN): increase default size from 2KB
to 16KB. We can afford it these days.
* libamu/strcasecmp.c (strcasecmp): use unsigned chars in
tolower() to avoid sign/size promotion bugs.
* libamu/xutil.c (switch_to_logfile): don't output to LOG_CONS by
default (it's unfriendly). If user really wants to, they can set
it in /etc/syslog.conf.
Erez Zadok [Sat, 1 Oct 2005 05:26:25 +0000 (05:26 +0000)]
* include/am_defs.h: include <sys/statvfs.h> if it exists.
* conf/nfs_prot/nfs_prot_netbsd1_4.h: NetBSD 3 has both statfs()
and statvfs(), but the latter is preferred, so #define to use
statvfs.
* configure.in: check for statfs(), statvfs(), and
<sys/statvfs.h>.
* config.guess.long: strip trailing '.' on "netbsdelf3.0."
(Beta). Workaround for bug in config.guess.
* config.{guess,sub}: update to latest versions.
Erez Zadok [Fri, 30 Sep 2005 03:40:16 +0000 (03:40 +0000)]
* amq/pawd.c (find_mt): if the auto mount type is used, pawd could
go into an infinite loop since the mt_directory and mt_mountpoint
fields are the same for auto mounts. Solution: ignore type auto
mounts, similar to toplvl. Bug fix from Jonathan Chen
<jon+amd@spock.org>.
Erez Zadok [Fri, 30 Sep 2005 02:50:30 +0000 (02:50 +0000)]
* README.attrcache: document test-attrcache script.
* scripts/Makefile.am (noinst_SCRIPTS): build test-attrcache
script.
* configure.in: build scripts/test-attrcache script and chmod it
so it can be executed in place.
* scripts/test-attrcache.in: script to test the NFS attribute
cache using Amd.
Erez Zadok [Mon, 26 Sep 2005 06:02:50 +0000 (06:02 +0000)]
comment space
Erez Zadok [Mon, 26 Sep 2005 05:29:55 +0000 (05:29 +0000)]
* libamu/xutil.c (unregister_amq): repair broken meaning of D_AMQ,
which was reversed in am-utils-6.2. Bug fix from Steve Plite
<splite-amutils at sigint.cs.purdue.edu>.
Erez Zadok [Mon, 26 Sep 2005 05:17:16 +0000 (05:17 +0000)]
* hlfsd/stubs.c (nfsproc_getattr_2_svc, nfsproc_lookup_2_svc,
nfsproc_readlink_2_svc, nfsproc_readdir_2_svc), hlfsd/hlfsd.c
(hlfsd_init): use new clocktime() function.
Erez Zadok [Mon, 19 Sep 2005 04:46:31 +0000 (04:46 +0000)]
NEWS update
Erez Zadok [Mon, 19 Sep 2005 04:01:05 +0000 (04:01 +0000)]
Document netbsd's patchs to support noac.
Erez Zadok [Mon, 19 Sep 2005 03:36:26 +0000 (03:36 +0000)]
Document netbsd's patch to support noac.
Erez Zadok [Mon, 19 Sep 2005 02:53:33 +0000 (02:53 +0000)]
*** Released am-utils-6.1.2.1 ***
*******************************************************************
* README.attrcache: Update status of freebsd and openbsd.
* libamu/mount_fs.c (compute_nfs_attrcache_flags): cleanup the
code that sets the ac{reg,dir}{min,max} fields so it also sets the
appropriate nfs_args->flags such as MNT2_NFS_OPT_ACREGMIN.
* configure.in: check for nfs_args fields acregmax and acdirmax.
*******************************************************************
Erez Zadok [Sun, 18 Sep 2005 23:23:07 +0000 (23:23 +0000)]
freebsd version typo
Erez Zadok [Sun, 18 Sep 2005 22:51:51 +0000 (22:51 +0000)]
typo
Erez Zadok [Sun, 18 Sep 2005 22:43:34 +0000 (22:43 +0000)]
*******************************************************************
*** Released am-utils-6.1.2 ***
*******************************************************************
Erez Zadok [Sun, 18 Sep 2005 21:58:04 +0000 (21:58 +0000)]
* README.attrcache: new file documenting in detail OS bugs
relating to attribute caching, which can affect Amd's reliability
under heavy load.
* doc/Makefile.am: install README.attrcache file as attrache.txt
file on am-utils Web site.
* Makefile.am (EXTRA_DIST): include README.attrcache in distro.
* BUGS, NEWS, doc/am-utils.texi (auto_attrcache Parameter),
scripts/amd.conf.5, scripts/amd.conf-sample: document attribute
cache bugs on some OSs.
Erez Zadok [Sat, 17 Sep 2005 22:19:44 +0000 (22:19 +0000)]
* libamu/xutil.c (clocktime): newly implemented routine. Uses
gettimeofday() each time to return a high-resolution clock time,
and does not "cache" the last time. Returns time in seconds, just
like the old implementation. If passed a non-null argument, will
fill it in with the current time in seconds+microseconds.
* libamu/xutil.c: remove actual declaration of clock_valid, and
another never-used declaration for xclock_valid.
* include/am_utils.h: remove defunct definition of clocktime()
macro and clock_valid variable. Add extern for new definition.
* libamu/mount_fs.c (mount_fs), hlfsd/homedir.c (homedir,
hlfsd_diskspace, hlfsd_getpwent, plt_reset, table_add),
hlfsd/hlfsd.c (main, hlfsd_init, reload, cleanup),
conf/mtab/mtab_mach3.c (open_locked_mtab), conf/mtab/mtab_file.c
(open_locked_mtab), amd/nfs_start.c (do_select, run_rpc),
amd/autil.c (host_normalize): remove defunct clock_valid.
* amd/nfs_subr.c (nfsproc_getattr_2_svc): Print microseconds for
node's mtime.
(fh_to_mp3): use new clocktime() to update mtime and get a better
time resolution.
* amd/mapc.c (mapc_reload_map): change prototype from returning
void to returning an int. If reloading was needed and succeeded,
return 1; else return 0.
(mapc_sync): update mtime of parent node if needed. This is a
CRITICAL FIX, to ensure that the kernel flushes its DNLC/dcache
when we run "amq -f" manually or when a map is reloaded.
* amd/map.c (new_ttl): update am_ttl and na_atime in one shot.
(init_map): use new clocktime().
(unmount_mp): if the OS doesn't support a "symttl" option, then
update the mtime of the parent node using the clocktime(); but if
the time hasn't gotten changed because of rapid Amd accesses on
systems that don't have a micro-second NFS-client resolution, then
increment mtime by one arbitrarily (this could, on some systems
and under pathological cases, result in mtime's that are in the
future).
* amd/autil.c (forcibly_timeout_mp): MAJOR BUG FIX: force mtime
update of parent dir, to prevent DNLC/dcache from caching the old
entry, which could result in ESTALE errors, bad symlinks, and
more.
(am_mounted): record mount time, and update am_stats at the same
time, using the double-action redone clocktime() routine.
(am_mounted): update parent's mtime from that of the child.
(am_unmounted): when unmounting an entry, update mtime of parent
node.
* amd/amfs_generic.c (amfs_bgmount): now that clocktime() doesn't
remember it's last non-zero value, save it in a temporary variable
to avoid a TOCTOU problem (between an "if" and a "dlog").
* libamu/xutil.c (show_time_host_and_name),
conf/autofs/autofs_linux.c (autofs_mounted, autofs_timeout_mp),
amd/srvr_nfs.c (nfs_keepalive_callback, nfs_keepalive_timeout)
(find_nfs_srvr), amd/rpc_fwd.c (fwd_alloc), amd/nfs_subr.c
(nfsproc_getattr_2_svc), amd/nfs_start.c (do_select, run_rpc),
amd/mapc.c (root_init), amd/map.c(map_flush_srvr, timeout_mp),
amd/info_ndbm.c (ndbm_init), amd/info_ldap.c (amu_ldap_rebind),
amd/info_file.c (file_open), amd/info_exec.c (fgets_timed,
exec_search), amd/clock.c (timeout, softclock), amd/autil.c
(forcibly_timeout_mp), amd/amfs_generic.c (amfs_retry,
amfs_bgmount, amfs_generic_mount_child), amd/amd.c (main): pass
NULL to clocktime().
Erez Zadok [Thu, 8 Sep 2005 02:36:35 +0000 (02:36 +0000)]
* minor new port: powerpc-apple-darwin8.2.0.
* m4/macros/type_auth_create_gidlist.m4: Old macosx used "gid_t"
but all newer ones (10.4+) use int.
* m4/macros/type_recvfrom_fromlen.m4: Old macosx used "int" for
6th arg of recvfrom(), but all newer ones (10.4+) use socklen_t.
Erez Zadok [Wed, 7 Sep 2005 23:38:22 +0000 (23:38 +0000)]
* minor new port: i386-pc-linux-deb3.1.
* conf/mount/mount_linux.c: If autoconf didn't find any disk-based
file system on this system (probably because /proc isn't mounted),
then provide some default definition for this file to compile.
Erez Zadok [Sun, 28 Aug 2005 00:15:05 +0000 (00:15 +0000)]
* Makefile.am (DISTCLEANFILES): also remove amu_autofs_prot.h,
config.cache.old, and dbgcf.h on "make distclean".
(CLEANFILES): remove dbgcf on plain "make clean".
* amd/Makefile.am (DISTCLEANFILES): also remove ops_autofs.c on
"make distclean".
Erez Zadok [Thu, 25 Aug 2005 02:03:32 +0000 (02:03 +0000)]
* configure.in: wrap all LDAP and HESIOD tests in test whether
--with-OPT was used.
Erez Zadok [Wed, 17 Aug 2005 03:39:00 +0000 (03:39 +0000)]
one-liner vers.m4 file
Erez Zadok [Tue, 16 Aug 2005 23:44:16 +0000 (23:44 +0000)]
* configure.in: sinclude([vers.m4]) version number file.
* vers.m4: new file to separate version number out of
configure.in, useful for nightly snapshot script to generate
nightly version string.
* Makefile.am (EXTRA_DIST_M4): include vers.m4 in distro.
Erez Zadok [Thu, 11 Aug 2005 17:39:32 +0000 (17:39 +0000)]
* configure.in: keep AC_INIT on same line, for nightly snapshot
build script.
Erez Zadok [Sat, 6 Aug 2005 18:57:23 +0000 (18:57 +0000)]
* scripts/amd.conf.5: selectors_in_defaults is a common parameter,
not just [global]. Use consistent capitalization of Amd/Amq.
* scripts/amd.conf-sample: properly list all of the parameters
which are common to both the [global] and the per-map sections.
* doc/am-utils.texi (Common Parameters): selectors_in_defaults is
a common parameter, not just [global].
* scripts/amd.conf-sample (sun_map_syntax): example of new flag.
Erez Zadok [Sat, 6 Aug 2005 17:18:58 +0000 (17:18 +0000)]
* cvs-server.txt: update instructions after branching 6.1-stable.
Erez Zadok [Sat, 6 Aug 2005 17:17:13 +0000 (17:17 +0000)]
* cvs-server.txt: update instructions after branching 6.1-stable.
Erez Zadok [Wed, 3 Aug 2005 04:15:11 +0000 (04:15 +0000)]
start 6.1.2-rc1
Erez Zadok [Wed, 3 Aug 2005 02:14:26 +0000 (02:14 +0000)]
* libamu/xutil.c (xsnprintf): "unsafe" alternative to vsnprintf is
vsprintf, not sprintf.
* conf/umount/umount_osf.c (umount_fs): refer to proper formal
parameter name.
(umount2_fs): pass second arg to umount().
Erez Zadok [Wed, 3 Aug 2005 01:11:15 +0000 (01:11 +0000)]
*******************************************************************
*** Released am-utils-6.1.1 ***
*******************************************************************
Erez Zadok [Wed, 3 Aug 2005 00:35:34 +0000 (00:35 +0000)]
* ALL: remove CVS ID and put actual file name in source.
Erez Zadok [Wed, 3 Aug 2005 00:19:20 +0000 (00:19 +0000)]
* conf/autofs/*.[hc]: proper copyright headers.
Erez Zadok [Wed, 3 Aug 2005 00:01:34 +0000 (00:01 +0000)]
* whitespace reformatting. Remove remaining '%W%' SCCS IDs.
Erez Zadok [Tue, 2 Aug 2005 23:56:00 +0000 (23:56 +0000)]
srvr_nfs.c RCS ID
Erez Zadok [Tue, 2 Aug 2005 23:39:32 +0000 (23:39 +0000)]
proper changelog date format
Erez Zadok [Tue, 2 Aug 2005 22:48:28 +0000 (22:48 +0000)]
* amd/mntfs.c (free_mntfs): don't discard the last reference to an
mntfs that had been mounted already. It won't have the
MFF_RESTARTED flag on, as it gets turned off after the entry is
mounted, but it will have the MFF_RSTKEEP flag on.
* amd/autil.c (mf_mounted), amd/restart.c (restart_fake_mntfs):
show the mntfs's flags.
Erez Zadok [Tue, 2 Aug 2005 01:28:57 +0000 (01:28 +0000)]
* conf/mtab/mtab_linux.c: removed unused code. Cleanup.
(handler): removed this bad signal handler.
(lock_mtab): Redhat's original code set a signal handler called
"handler()" for all non-ALRM signals. The handler called
unlock_mntlist(), plog'ed the signal name, and then exit(1)!
Never, ever, exit() from inside a utility function. This messed
up Amd's careful signal-handling code, and caused Amd to abort
uncleanly only any other "innocent" signal
(even simple SIGUSR1), leaving behind a hung Amd mnt point. That
code should have at least restored the signal handlers' states
upon a successful mtab unlocking. Anyway, that handler was
unnecessary, because will call unlock_mntlist() properly anyway on
exit.
* conf/mtab/mtab_{file,isc3,mach3,linux}.c (unlock_mntlist): dlog
message that we're inside the unlock_mntlist function.
* amd/amd.c (main): use new setup_sighandler() for Amd's four main
signals (INT, TERM, HUP, and CHLD).
(main) Add SIGINT and SIGTERM to masked_sigs, used in
nfs_start.c:do_select() for setjmp/longjmp code; the MASK was set
to all four signals if !HAVE_SIGACTION, but only to HUP+CHLD if we
HAVE_SIGACTION. So this change makes Amd behave consistently.
* include/am_utils.h: extern for new setup_sighandler().
* libamu/xutil.c (setup_sighandler): new utility function to setup
a single signal-handler regardless of what method is supported by
this OS.
(going_down): call unlock_mntlist() when exiting, to ensure that
Amd will remove any leftover mtab lock files, if any.
* amd/restart.c (restart_automounter_nodes): cleanup function.
Erez Zadok [Mon, 1 Aug 2005 21:45:17 +0000 (21:45 +0000)]
* minor new port: i386-pc-linuxoldld-deb3.1.
* configure.in: include <sys/types.h> before <linux/socket.h> to
get the definition of size_t on Debian-3.1r0a.
Erez Zadok [Fri, 29 Jul 2005 10:47:19 +0000 (10:47 +0000)]
* amd/srvr_nfs.c (find_nfs_srvr): don't blindly copy the hostent
IP address. First check if it differs from the existing one of
the fserver, and copy only if it changed. If it did change, flush
the fhandle cache to avoid a stale fhandle being reused. This
allows Amd to detect IP address changes even for an fserver that
lost one or more NFS pings, but not enough to be declared totally
down. We handle the "totally down" fserver case in
check_fs_addr_change().
* amd/ops_nfs.c (nfs_umount), amd/sched.c (sched_task),
amd/nfs_subr.c (nfs_quick_reply): code clarity.
* conf/mount/mount_linux.c (linux_nfs_error): dlog mappings of
errnos to NFS errors.
* conf/umount/umount_linux.c (umount2_fs): cleanup code. Trying
stat() seems doomed to hang at times, so don't try stat at all,
because umount2() appears to be clever enough to never hang.
Erez Zadok [Tue, 26 Jul 2005 03:31:08 +0000 (03:31 +0000)]
* amd/amd.h (FSF_FORCE_UNMOUNT): new flag used to indicate that a
particular fserver may need forced/lazy unmounts when it's mntfs's
are unmounted.
* amd/ops_nfs.c (nfs_umount): a simple unmount returned EBUSY, and
the user specified forced_unmounts=yes in amd.conf, and this
fserver was flagged with FSF_FORCE_UNMOUNT, and the OS supports
forced/lazy unmounts, then try forced/lazy unmounts. This should
allow a hung mount point to be removed.
* amd/srvr_nfs.c (find_nfs_srvr): move away IP-address change
detection code to its own function.
(check_fs_addr_change): new function to detect if the IP address
of a downed host has changed, and do various cleanups and fixups
to try and recover as best from that situation (e.g., flushing
various caches). Also set the FSF_FORCE_UNMOUNT flag for the
fserver in question.
(flush_srvr_nfs_cache): pass fserver as argument, so we can
selectively flush the NFS cache for a single fserver (or all of
them, if you pass NULL).
Erez Zadok [Tue, 26 Jul 2005 01:48:12 +0000 (01:48 +0000)]
* libamu/xutil.c (switch_to_logfile): truncate a regular-file log
file if user passed non-zero "truncate_log" flag.
* include/am_utils.h: switch_to_logfile() now takes a 3rd arg.
* amd/get_args.c (get_args): pass "truncate_log" flag as per
amd.conf global settings.
* amd/conf.c (gopt_truncate_log): store global value of
truncate_log flag.
* amd/amq_subr.c (amqproc_setopt_1_svc), hlfsd/hlfsd.c (main,
reload): don't truncate log file when calling switch_to_logfile().
* amd/amd.h (CFM_TRUNCATE_LOG): new flag. Fix comment typo.
* NEWS, doc/am-utils.texi (truncate_log Parameter),
scripts/amd.conf.5, scripts/amd.conf-sample (log_file): document
new truncate_log amd.conf parameter.
Erez Zadok [Mon, 25 Jul 2005 23:49:41 +0000 (23:49 +0000)]
* amd/conf.c (gopt_forced_unmounts): check Linux kernel version
and alert if your version may be too old for MNT_FORCE to work
(before 2.4.0) or for MNT_DETACH to work (before 2.6.0).
Otherwise it may be impossible to pin down the exact kernel
version in which we should enable this feature.
* conf/umount/umount_linux.c (umount2_fs): if MNT_FORCE returned
EBUSY, then don't try to stat(2) before MNT_DETACH because it
could hang.
Erez Zadok [Thu, 21 Jul 2005 05:22:47 +0000 (05:22 +0000)]
* conf/umount/umount_linux.c (umount_fs): cleanup this function,
breaking long "if" statements using "goto out".
* conf/umount/umount_{aix,bsd44,osf,default,linux}.c (umount_fs):
call new utility function umount2_fs() as needed (EBUSY, EIO, or
ESTALE).
* conf/umount/umount_{aix,bsd44,osf,default,linux}.c (umount2_fs):
define a new utility function to invoke forcible/lazy unmounts
without touching any mtab files. This separate utility function
is useful because it can be called from elsewhere.
* amd/amfs_toplvl.c (amfs_toplvl_init): new function, called
before Amd mounts toplvl mounts, which gives us a hook for cleanup
of a previously dead Amd. In our case, if the user asked for
forced_unmounts, and the OS supports it, then we try forced/lazy
unmounts on any previous toplvl mounts. This is useful if a
previous Amd died and left behind toplvl mount points (this Amd
will clean them up!). WARNING: Don't use forced/lazy unmounts if
you have another valid Amd running, because this code WILL force
those valid toplvl mount points to be detached as well!
* amd/amfs_toplvl.c (amfs_toplvl_umount): don't unconditionally
try forced/lazy unmounts because it will prevent a normal Amd from
terminating and cleaning up properly (self-deadlocking: detached
mounts hang the parent Amd on a stat). Since we already do
unmounts in the background, then try a safer policy: after trying
the normal unmounts a few times (5 sec), escalate and try forced
unmounts a few times (5 more seconds), and if even that failed,
then try the ultimate -- detached unmounts (which always succeed).
This allows Amd to first try and shutdown cleanly, and gradually
try more forcible ways to shutdown. On Linux, this procedure will
cleanly shutdown Amd even if there are processes with their CWD on
Amd's mount points (which normally result in EBUSY).
* Makefile.am (EXTRA_DIST_CONF): add new umount_aix.c to distro.
* conf/umount/umount_aix.c: easier if AIX has its own unmount
helper file.
* m4/macros/check_umount_style.m4: AIX needs its own unmount style
file.
Erez Zadok [Thu, 21 Jul 2005 00:50:02 +0000 (00:50 +0000)]
* doc/am-utils.texi (forced_unmounts Parameter): @xref -> @pxref.
Erez Zadok [Wed, 20 Jul 2005 21:43:28 +0000 (21:43 +0000)]
minor NEWS typo
Erez Zadok [Wed, 20 Jul 2005 03:32:30 +0000 (03:32 +0000)]
* conf/nfs_prot/nfs_prot_aix5_2.h: define compatible
forced-unmount flag.
* conf/umount/umount_default.c (umount_fs): if regular umount got
EBUSY, EIO, or ESTALE, then try forced unmount, if supported. Try
umount2 (Solaris) or uvmount (AIX).
* conf/umount/umount_{bsd44,osf}.c (umount_fs): if default
umount() failed with EIO or ESTALE, also try forced unmount.
* amd/autil.c (amfs_mount), amd/amfs_toplvl.c
(amfs_toplvl_umount): enable forced/lazy unmounts only if user
asked for it (and dlog it).
* scripts/amd.conf.5: document new force_unmount global parameter.
* doc/am-utils.texi (forced_unmounts Parameter): document new
global parameter.
* amd/conf.c (gopt_forced_unmounts): process forced_unmounts
option (default "no"). Exit with an error if user specified the
option as "yes" but configure couldn't find support for either the
MNT_FORCE or MNT_DETACH flags.
* scripts/amd.conf-sample (forced_unmounts): example usage of new
option.
* amd/amd.h (CFM_FORCED_UNMOUNTS): new flag for forced_unmounts
option.
* m4/macros/header_templates.m4: templates for _DETACH and _FORCE.
* configure.in: check for generic u/mount options "detach" and
"force".
* include/am_utils.h (UMOUNT_FS, umount_fs): new prototypes.
Define AMU_UMOUNT flags for force, detach, and autofs.
* amd/amfs_toplvl.c (amfs_toplvl_umount): pass _FORCE and _DETACH
unmount flags unconditionally. Pass them to UMOUNT_FS().
* conf/nfs_prot/nfs_prot_linux.h: define MNT_FORCE and MNT_DETACH
if needed, because some Linux systems don't define them
(presumably because it would be too dangerous to expose these
flags to users).
* amd/autil.c (amfs_mount): if mount(2) failed with ESTALE or EIO,
then assume that we're in trouble, possibly because a previous
mount is hung. So, first try to force a lazy unmount of the old
mount. If the forced unmount worked, then try again to mount the
desired file system. If the forced unmount failed, then don't
retry: just return an error.
* amd/amfs_generic.c (amfs_generic_umount), amd/amfs_host.c
(amfs_host_umount), amd/ops_cachefs.c (cachefs_umount),
amd/ops_cdfs.c (cdfs_umount), amd/ops_efs.c (efs_umount),
amd/ops_lofs.c (lofs_umount), amd/ops_nfs.c (nfs_umount),
amd/ops_pcfs.c (pcfs_umount), amd/ops_ufs.c (ufs_umount),
amd/ops_xfs.c (xfs_umount), conf/umount/umount_bsd44.c
(umount_fs), conf/umount/umount_default.c (umount_fs),
conf/umount/umount_linux.c (umount_fs), conf/umount/umount_osf.c
(umount_fs): compute and use unmount specific flags.
Erez Zadok [Tue, 19 Jul 2005 00:31:43 +0000 (00:31 +0000)]
also fix speling errors and a typo
Erez Zadok [Tue, 19 Jul 2005 00:06:13 +0000 (00:06 +0000)]
silly whitespace
Erez Zadok [Sat, 16 Jul 2005 17:19:47 +0000 (17:19 +0000)]
* configure.in: better help for users, if nfs_args can't be found.
Erez Zadok [Fri, 15 Jul 2005 18:32:02 +0000 (18:32 +0000)]
* BUGS: more details on AIX's need to install bos.net.nfs.adt
before configuring am-utils (else configure cannot find struct
nfs_args on AIX).
Erez Zadok [Mon, 11 Jul 2005 01:55:28 +0000 (01:55 +0000)]
* amd/srvr_nfs.c (find_nfs_srvr): flush NFS handle cache if the IP
address of a down server had changed.
* amd/info_union.c (union_reload): use safer xsnprintf() routine.
Erez Zadok [Sun, 10 Jul 2005 21:41:48 +0000 (21:41 +0000)]
* amd/srvr_nfs.c (find_nfs_srvr): check to see if the IP address
of a named but down fserver changed (i.e., the previous IP address
is no longer responding). If so, then reset the fserver to the
new IP address, and set the fserver's flags such that the function
will fall through to doing the usual NFS version/proto checks and
pinging. (This should fix one case of bug #308.)
* conf/umount/umount_linux.c (umount_fs): warn if plain umount()
failed, before we try to ignore any errors or try optional
umount2(), possibly with forced/lazy unmount.
(umount_fs): dlog when unmount succeeded.
Erez Zadok [Sat, 9 Jul 2005 19:41:06 +0000 (19:41 +0000)]
* conf/mount/mount_linux.c: add a couple more NFSv2 error codes
that are compatible with NFSv3.
Erez Zadok [Thu, 7 Jul 2005 23:34:23 +0000 (23:34 +0000)]
* m4/macros/header_templates.m4: extern template for strlcat().
* amd/get_args.c (get_version_string): use safer strlcat (or
replacement strlcat). Use new wrapper xsnprintf() function, which
will use the safer vsnprintf() if available, else default to plain
sprintf.
* configure.in: check for existence of strlcat() and its extern,
replacing with libamu/strlcat.c as needed.
* libamu/Makefile.am (EXTRA_DIST): add strlcat.c to distro.
* include/am_defs.h: optional strlcat() extern.
* include/am_utils.h: extern for new xvsnprintf().
Check for snprintf function and extern.
Erez Zadok [Thu, 7 Jul 2005 22:29:26 +0000 (22:29 +0000)]
* configure.in: overdue new major libtool shlib version.
Erez Zadok [Wed, 6 Jul 2005 22:51:45 +0000 (22:51 +0000)]
NEWS item
Erez Zadok [Wed, 6 Jul 2005 22:34:26 +0000 (22:34 +0000)]
* conf/nfs_prot/nfs_prot_aix4_3.h: cleanup struct
aix4_nfs_args_bis.
* Makefile.am (EXTRA_DIST_CONF): include mount_aix3.c in
distribution.
* conf/mount/mount_aix.c: mount style for aix 5.x and newer.
* conf/mount/mount_aix3.c: mount styles for aix 3.x/4.x.
* m4/macros/check_mount_style.m4: split mount styles for
aix3.x/4.x and the newer (and better) aix 5.x code.
Erez Zadok [Tue, 5 Jul 2005 17:45:37 +0000 (17:45 +0000)]
* amq/pawd.c (getawd): avoid buffer overflow. Bug fix from Graeme
Wilford <G.Wilford@surrey.ac.uk>.
Erez Zadok [Thu, 30 Jun 2005 14:59:08 +0000 (14:59 +0000)]
NEWS note
Erez Zadok [Thu, 30 Jun 2005 14:58:22 +0000 (14:58 +0000)]
* amd/map.c (get_next_exported_ap): Avoid running off the end of
the exported_ap[] array. Patch from jon+amd-at-spock.org. Fixed
bug #301.
Erez Zadok [Sat, 25 Jun 2005 19:18:35 +0000 (19:18 +0000)]
* Makefile.am (EXTRA_DIST_CONF): distribute new mtab_linux.c.
Erez Zadok [Sat, 25 Jun 2005 19:03:05 +0000 (19:03 +0000)]
* conf/mtab/mtab_linux.c (rewrite_mtab): variable declarations
must come before C code.
Erez Zadok [Sat, 25 Jun 2005 18:15:32 +0000 (18:15 +0000)]
* conf/mtab/mtab_linux.c: Linux-specific mount table hanlding
that's safe (uses locks, handles symlinks to /proc/mounts, etc.).
Patch from Red Hat, which they adapted from mtab_file.c. Minor
fixes to this file.
* m4/macros/check_mnttab_style.m4: Use Linux-specific mount table
handling.
Erez Zadok [Sat, 25 Jun 2005 02:25:36 +0000 (02:25 +0000)]
* conf/mount/mount_aix.c (mount_aix3): minor cleanup of filehandle
copying code.
Erez Zadok [Fri, 24 Jun 2005 00:48:59 +0000 (00:48 +0000)]
* conf/nfs_prot/nfs_prot_hpux.h: add extern for h_errno, which may
be missing from older hpux10 systems.
Erez Zadok [Fri, 24 Jun 2005 00:30:16 +0000 (00:30 +0000)]
* configure.in: update bug-reporting address to list
https://bugzilla.am-utils.org/ as well as the mailing list.
* Makefile.am (EXTRA_DIST_M4): distribute new type_rpcvers_t.m4
Erez Zadok [Thu, 23 Jun 2005 23:46:03 +0000 (23:46 +0000)]
undo bad macro testing
Erez Zadok [Thu, 23 Jun 2005 21:40:44 +0000 (21:40 +0000)]
improved rpcvers_t macro
Erez Zadok [Thu, 23 Jun 2005 21:05:18 +0000 (21:05 +0000)]
* Makefile.am (EXTRA_DIST_M4): distribue new type_rpcvers_t.m4
macro.
* conf/transp/transp_tli.c (get_nfs_version): always use
rpcvers_t, now that it'll be automatically discovered.
* configure.in: check for rpcvers_t type.
* m4/macros/type_rpcvers_t.m4: new macro to check for type of
rpcvers_t (Some Solaris versions need it).
Erez Zadok [Thu, 23 Jun 2005 20:48:41 +0000 (20:48 +0000)]
* conf/nfs_prot/nfs_prot_sunos5_8.h: don't define INADDR_NONE
here, but in the actual source files that may need it.
* libamu/wire.c (INADDR_NONE): define INADDR_NONE if not defined
already.
Erez Zadok [Thu, 23 Jun 2005 20:46:11 +0000 (20:46 +0000)]
fix typo
Erez Zadok [Thu, 23 Jun 2005 20:02:40 +0000 (20:02 +0000)]
* include/am_defs.h: define extern for sleep(3) if needed.
* m4/macros/header_templates.m4: template for sleep(3) extern.
* configure.in: check for extern for sleep(3), which is missing
from some old (and buggy) versions of gcc's fixinc'ed headers.
* conf/nfs_prot/nfs_prot_aix4_3.h: update definition of struct
nfs_args from actual system headers.
* conf/mount/mount_aix.c (mount_aix3): fix name of aix4 "bis"
structure.
Erez Zadok [Wed, 22 Jun 2005 18:38:06 +0000 (18:38 +0000)]
* BUGS: update Solaris information about use of f/lex and
yacc/bison.
Erez Zadok [Tue, 21 Jun 2005 14:36:10 +0000 (14:36 +0000)]
.ignore update
Erez Zadok [Mon, 20 Jun 2005 19:23:35 +0000 (19:23 +0000)]
* minor new port: i386-pc-linux-suse9.3.
* configure.in (linux/nfs_mount.h): Move __KERNEL__ definition up
so u32 is available for <linux/sunrpc/msg_prot.h>.
Erez Zadok [Fri, 17 Jun 2005 00:23:41 +0000 (00:23 +0000)]
* amd/mapc.c (maptypes): move MAP_EXEC after MAP_FILE, because
exec maps will always match when users use amd with command line
args (not amd.conf). Using that legacy way, unfortunately, means
that Amd will use it's hard-coded info-service search path, which
doesn't work for everyone. It's much better to use amd.conf and
specify what you want exactly.