2006-11-27 Erez Zadok * doc/Makefile.am: properly publish html files using newer text2html. 2006-11-27 Erez Zadok * doc/Makefile.am: obfuscate emails in ChangeLog before it is published on web site. * obfuscate many more emails in the distro, esp. of files which get posted on the am-utils web site. 2006-11-26 Erez Zadok * minor new port: i386-apple-darwin8.8.1. * doc/am-utils.texi: remove obvious URLs used by spammers, and replace them with links to the am-utils web site, which uses PNG images to obfuscate the actual email/mailman URLs. 2006-10-30 Erez Zadok * doc/am-utils.texi (Password maps): minor typo reported by Christoph P. Kukulies. 2006-10-26 Erez Zadok * minor new port: i386-pc-linux-fc6. * m4/macros/linux_headers.m4: handle newer Linux kernels which removed UTS_RELEASE from . 2006-10-25 Erez Zadok * minor new ports: i386-pc-linux-centos4.4 and powerpc-apple-darwin8.7.0. * config.guess.long: recognize CentOS Linux. 2006-06-20 Erez Zadok * minor new port: i386-pc-solaris2.11-nexentaos (GNU/OpenSolaris). * config.guess.long: recognize NexentaOS (GNU/OpenSolaris) * config.guess, config.sub: updates from latest official GNU distributions. 2006-05-11 Erez Zadok * Minor new ports: i386-unknown-freebsd6.1 (RELEASE), powerpc-apple-darwin8.6.0, and i386-unknown-openbsd3.9. 2006-05-10 Erez Zadok * libamu/mount_fs.c (compute_nfs_attrcache_flags): fix signedness problems on IRIX-6.5. * conf/autofs/autofs_solaris_v1.c (xdr_umntrequest): fix signedness problems on IRIX-6.5. 2006-05-01 Erez Zadok * configure.in: check if libc already includes dbm functionality (as in FreeBSD 6), then don't bother to check specific libraries such as libdbm, gdbm, etc. 2006-04-21 Erez Zadok * configure.in: detect G/DBM support via gdbm_compat library (Debian 3.1). * minor new port: powerpc-apple-darwin8.5.0 2006-04-20 Erez Zadok * scripts/amd.conf-sample, scripts/amd.conf.5, doc/am-utils.texi, NEWS: document new nfs_allow_any_interface parameter. * include/am_compat.h (INADDR_LOOPBACK): define INADDR_LOOPBACK if not defined, since some systems don't have it. 2006-04-20 Nick Williams * libamu/wire.c (is_interface_local): new boolena function to determine if address represents any of the local interfaces. (getwire): more properly check if address equals INADDR_LOOPBACK, not if IFF_LOOPBACK is not (the latter isn't as correct). * include/am_utils.h: extern for new is_interface_local() function. * conf/transp/transp_{sockets,tli}.c: don't define INADDR_LOOPBACK here but in am_compat.h * amd/nfs_prot_svc.c (nfs_program_2): if nfs_allow_any_interface=yes, then allow NFS packets from any local interface (not just 127.0.0.1). * amd/conf.c (gopt_nfs_allow_any_interface): implement the new amd.conf parameter nfs_allow_any_interface. * amd/amd.h (CFM_NFS_ANY_INTERFACE): define new global flag when al interfaces are acceptable for local NFS packets. 2006-04-18 Christos Zoulas * amd/opts.c: Add support for optionally specifying the hostname to match against the netgroup in the netgrp and netgrpd selectors. 2006-04-16 Erez Zadok * libamu/mtab.c (hasmntval): fix inverted meaning of error from hasmntvalerr(). 2006-04-14 Erez Zadok * libamu/mount_fs.c (compute_nfs_attrcache_flags): use new hasmntvalerr() function to set attribute cache values only if they were set (regardless whether they were set to zero or a non-zero value). Before, we were unable to distinguish between an error to parse an option, and a user who actually wanted to set an attribute-cache value to 0. This now fixes an important performance bug that Amd was turning off the attribute caches even for regular (non-automounter) NFS mounts. * libamu/mtab.c (hasmntvalerr): new function to set the value of an option into an integer, but ONLY if that options was set and parsed correctly. This function returns 1 on error, 0 on success (instead of always setting the option value to 0). (hasmntval): wrapper function around hasmntvalerr, which maintains backwards compatibility (always sets option value to 0, even on error to parse the option). * amd/nfs_subr.c (fh_to_mp3): use long int printf format for fhh_pid. 2006-04-05 Christos Zoulas * amd/amfs_generic.c (amfs_lookup_mntfs): fix use-after-free bug (Coverity). 2006-03-27 Erez Zadok * doc/am-utils.texi, scripts/{amd.conf.5,amd.conf-sample}: document new nfs_retransmit_counter_toplvl and nfs_retry_interval_toplvl global amd.conf parameters. * amd/conf.c (gopt_nfs_retransmit_counter_toplvl, (gopt_nfs_retry_interval_toplvl): parse amd.conf nfs_retransmit_counter_toplvl and nfs_retry_interval_toplvl global parameters. * amd/amfs_toplvl.c (amfs_toplvl_mount): support setting toplvl timeo/retrans parameters for Amd's toplvl mounts, separately from all other UDP or NFS mounts. * amd/amd.h: define a new timeo/retrans parameter for toplvl mounts. 2006-03-22 Erez Zadok * minor new port: i386-pc-linux-suse10.1 (beta 8). 2006-03-21 Christos Zoulas * amd/am_ops.c (merge_opts): Remove useless check found by Coverity; xmalloc never returns NULL. 2006-03-21 Erez Zadok * minor new ports: i386-pc-linux-fc5. * amd/info_ldap.c: as of Linux Fedora Core 5 (which comes with openldap-2.3.9), the ldap.h headers deprecate several functions used in this file, such as ldap_unbind. You get compile errors about missing extern definitions. Those externs are still in , but surrounded by an ifdef LDAP_DEPRECATED. I am turning on that ifdef at the top of info_ldap.c, under the assumption that the functions may be deprecated, but they still work for this (older?) version of the LDAP API. It gets am-utils to compile, but it is not clear if it will work perfectly. * libamu/xdr_func.c (xdr_am_mountres3_ok), amq/amq_xdr.c (xdr_amq_mount_tree, xdr_amq_mount_tree_p, xdr_amq_mount_info_list, xdr_amq_mount_tree_list), amq/amq.c (show_mti), amd/amq_subr.c (xdr_amq_setopt, xdr_amq_mount_subtree, xdr_amq_mount_tree, xdr_amq_mount_tree_list, xdr_amq_mount_tree), libamu/xdr_func.c (xdr_am_mountres3_ok): use casing magic to stop GCC-4.1 from complaining about "dereferencing type-punned pointer will break strict-aliasing rules" here (but not elsewhere). 2006-03-20 Christos Zoulas * libamu/wire.c: avoid potential dereferencing of a NULL pointer (Coverity). * hlfsd/homedir.c (delay): remove unnecessary check for NULL pointer (Coverity). * fsinfo/fsi_analyze.c (analyze_dkmounts, analyze_mounts, analyze_mounts): avoid potential dereferencing of a NULL pointer (Coverity). * conf/transp/transp_sockets.c (create_amq_service): avoid potential dereferencing of a NULL pointer (Coverity). * amd/sched.c (sigchld): properly check for the end of the waiting process list (Coverity). * amd/mapc.c (mapc_create): initialize 'modify' to zero (Coverity). * amd/autil.c (amfs_mkcacheref, am_unmounted): avoid potential dereferencing of a NULL pointer (Coverity). * amd/amfs_generic.c (amfs_lookup_mntfs): free def_opts before reusing it (memory leak bug detected by Coverity). (amfs_bgmount): avoid potential dereferencing of a NULL pointer (Coverity). * amd/am_ops.c (merge_opts): no need to check if newstr is NULL (bug detected by Coverity). 2006-03-08 Ion Badulescu * amd/nfs_subr.c (mp_to_fh): fixed old-style filehandles--the pid comparison was failing. 2006-03-08 Erez Zadok * configure.in: properly test for either or (unfortunately, Autoconf will map both names to the same $ac_cv_* variable name). Some systems support one header or another. Patch inspired by work Debian did. 2006-02-16 Daniel P. Ottavio * amd/sum_map_tok.l: Fixed a bug in a regular expression that prevented dashes in hostnames. This was posted in BZ by Thomas A. Fine. * README.sun2amd: Fixed a typo. Sentence mentions use of autofs type when it should be host type. 2006-01-04 Erez Zadok * doc/am-utils.texi (auto_attrcache Parameter): revise discussion to mention pros and cons of turning on/off this parameter, including impact on Amd's performance, and ways to improve performance while minimizing the window of vulnerability in which kernel may return the wrong (cached) attributes. 2006-01-02 Erez Zadok * updated copyright year to 2006 on all files. 2005-12-20 Erez Zadok * include/am_utils.h, conf/transp/transp_tli.c (amu_svc_register, register_autofs_service): use a consistent prototype for the dispatch function of the autofs service de/registration functions. 2005-12-03 Erez Zadok * minor new ports: i386-unknown-netbsdelf2.1, i386-unknown-netbsdelf3.0 (RELEASE), and i386-unknown-openbsd3.8. 2005-12-02 Erez Zadok * m4/macros/check_field.m4: remove double inclusion of msdosfs headers, which are included in mount_header1.h (netbsd 2.1 doesn't protect which causes compile errors). 2005-11-08 Erez Zadok * minor new port: i386-unknown-freebsd6.0 (RELEASE) 2005-10-26 Erez Zadok * amd/amq_subr.c (amqproc_pawd_1_svc): repeatedly resolve path in Amd, not in pawd (to avoid repeated network RPCs). * amq/pawd.c (transform_dir): move repeated path resolution into Amd. 2005-10-25 Erez Zadok * amq/pawd.c (transform_dir): resolve path repeatedly until finished. Bug fix from Jonathan Chen . Added safety check to prevent infinite loops. 2005-10-19 Erez Zadok * doc/am-utils.texi (opts Option): document new pcfs options longname, nowin95, shortname, user=N, group=N, mask=N, and dirmask=N. * amd/ops_pcfs.c (mount_pcfs): process new pcfs options longname, nowin95, shortname, user=N, group=N, mask=N, and dirmask=N. * include/am_compat.h: provide compatibility mnttab string names, if needed, for pcfs mount options longname, nowin95, shortname, user=N, group=N, mask=N, and dirmask=N. * include/am_utils.h: extern for hasmntstr(). * libamu/mtab.c (hasmntstr): new function to return the string value following a mount option, up to the next comma-delimited options. * configure.in: check for mnttab and pcfs options longname, nowin95, and shortname. * Makefile.am (EXTRA_DIST_M4): distribute new macro check_mnt2_pcfs_opt.m4. * m4/macros/check_mnt2_pcfs_opt.m4: new macro to check for pcfs mnttab and mount options. 2005-10-18 Erez Zadok * libamu/mount_fs.c (print_nfs_args): print nfs_args->addr correctly, depending if it's a pointer or not. * conf/sa_dref/sa_dref_*.h: for each NFS_SA_DREF macro, also #define NFS_ARGS_T_ADDR_IS_POINTER if nfs_args->addr is a pointer or an embedded structure, so we can tell how to print it. * libamu/mount_fs.c (print_nfs_args): print nfs_args->addrlen field, if it exists. * configure.in: check for nfs_args->addrlen field. * wire-test/wire-test.c (main), libamu/mount_fs.c (print_nfs_args), fixmount/fixmount.c (inetresport, clnt_create_timeout), amq/pawd.c (transform_dir), amq/amq.c (main), amd/srvr_nfs.c (find_nfs_srvr), amd/autil.c (amfs_mount): document that as per POSIX, we don't need to set the sa_len/sin_len fields in struct sockaddr/sockaddr_in. The field is used only internally in the kernel. See www.awprofessional.com/articles/article.asp?p=169505&seqNum=2&rl=1 * fixmount/fixmount.c (inetresport): initialize sockaddr_in structure before filling in some fields. 2005-10-11 Erez Zadok * doc/am-utils.texi (nfs_vers, nfs_proto parameters): clarify and correct mistaken description of nfs_proto. 2005-10-10 Erez Zadok ******************************************************************* *** Released am-utils-6.1a1 *** ******************************************************************* * README.sun2amd: revised. 2005-10-09 Daniel P. Ottavio * amd/info_nis.c (nis_search): Bug fix for bugzilla #428; make sure that sun_entry2amd() is not called when yp_match() returns an error, this is done by checking that 'res' is 0. Bug fix (same BZ#); free the output allocated by yp_match() instead of freeing the return value of sun_entry2amd(). * amd/sun_map.c (sun_entry2amd): Fix a comment. * README.sun2amd: Made a first pass at describing the status of the sun2amd feature. Moved the date. 2005-10-09 Erez Zadok * README.sun2amd: place holder. * Makefile.am (EXTRA_DIST): distribute new README.sun2amd file. 2005-10-07 Erez Zadok * 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. * 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). * 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. * m4/macros/os_cflags.m4: remove hack that hardcodes pte_t=u_int. * configure.in: test for 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. * m4/macros/header_templates.m4: add missing templates for HAVE_EXTERN_GETDTABLESIZE, HAVE_EXTERN_GETWD, and HAVE_EXTERN_UALARM. * amd/info_exec.c (exec_map_open): break assignment from inside conditional, to work around an IRIX-6.5 cc bug. * amd/Makefile.am (amd_LDADD, sun2amd_LDADD): put libaminfo.a before libamu.la. Some linkers (e.g., IRIX-6.5) incorrectly complain about undefined symbols. * 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. * 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). * 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. 2005-10-06 Erez Zadok * ltmain.sh, m4/macros/libtool.m4: update to libtool-1.5.20. Fixes Tru64 bugs when using ksh. * 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). * 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. * 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. * 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) * 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. 2005-10-06 Rainer Orth * 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. 2005-10-05 Erez Zadok * 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. * 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. * 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. 2005-10-04 Erez Zadok * 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*(). * 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(). 2005-10-02 Erez Zadok * 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. * libamu/xutil.c: explain purpose of file. Move mkdirs/rmdirs code from old util.c. 2005-10-01 Erez Zadok * 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). * include/am_defs.h: include 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 . * config.guess.long: strip trailing '.' on "netbsdelf3.0." (Beta). Workaround for bug in config.guess. * config.{guess,sub}: update to latest versions. 2005-09-30 Christos Zoulas * 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. 2005-09-29 Erez Zadok * 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 . * 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. 2005-09-26 Erez Zadok * 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. 2005-09-18 Erez Zadok * README.attrcache: document netbsd's patchs to support noac. * 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. * README.attrcache: new file documenting in detail OS bugs relating to attribute caching, which can affect Amd's reliability under heavy load. Update status of freebsd and openbsd. * 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. 2005-09-17 Erez Zadok * 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(). 2005-09-15 Erez Zadok * amd/nfs_subr.c (nfsproc_getattr_2_svc): initialize 'retry', just in case. (fh_to_mp3): increment amd_stats.d_stale counter only if we are actually returning ESTALE. * amd/info_exec.c (exec_parse_qanswer), amd/info_file.c (file_search_or_reload), amd/info_hesiod.c (hesiod_search), amd/info_ldap.c (amu_ldap_search), amd/info_ndbm.c (search_ndbm), amd/info_nis.c (nis_search), amd/info_nisplus.c (nisplus_search, nisplus_search): don't dereference mnt_map->cfm which may be null if we're not using an amd.conf file. 2005-09-14 Erez Zadok * libamu/xutil.c (unregister_amq): if failed to de-register Amd from portmapper, report it under dlog (debugging), not as an annoying plog that always shows up. 2005-09-13 Erez Zadok * mk-amd-map/mk-amd-map.c (read_file_file), libamu/util.c (strsplit), libamu/hasmntopt.c (nextmntopt), amd/sun_map.c (sun_entry2amd), amd/sun2amd.c (sun2amd_convert_convert), amd/mapc.c (mapc_add_kv), amd/info_file.c (file_search_or_reload), amd/info_exec.c (exec_parse_qanswer): cast isspace() and isascii() arg to unsigned char, which is safer as per Christos. * amd/sun_map.c (sun_entry2amd): isspace takes an int, not a char. * configure.in: keep a dummy unused AM_PROG_LEX, because old Automake (1.6.3) looks for it if you refer to LEX in your Makefile.am files. Silly thing, fixed in newer versions of Automake (1.9.2). 2005-09-11 Erez Zadok * Makefile.am (EXTRA_DIST_M4): add prog_{lex,yacc}.m4 to distro. * configure.in: use new macros AMU_PROG_YACC and AMU_PROG_LEX. * m4/macros/prog_yacc.m4: new macro to check if bison/yacc/byacc exist, but exist with an error if none found. * m4/macros/prog_lex.m4: new macro to check if f/lex exist, but exit with an error if not found (am-utils requires f/lex). 2005-09-07 Erez Zadok * 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. * minor new port: i386-pc-linux-deb3.1. 2005-09-02 Erez Zadok * 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. 2005-08-28 Daniel P. Ottavio * amd/sun_map.c (sun_entry2amd) : Wipe out any trailing white spaces or '\n' before passing strings to the parser. * amd/amd.h : oops, reverting bad changes * amd/info_file.c : oops, reverting bad changes * amd/mapc.c : oops, reverting bad changes * amd/sun_map_parse.y : oops, reverting bad changes 2005-08-27 Erez Zadok * libamu/xutil.c: amd_program_number is a u_long now. (unregister_amq): if pmap_unset failed to de-register Amd from the portmapper, print an error message. (get_amd_program_number): returns a u_long now. (set_amd_program_number): take a u_long now. * include/am_utils.h: get_amd_program_number() returns u_long now. set_amd_program_number() takes a u_long now. * amq/amq.c: amd_program_number is a u_long, not int. * amd/nfs_start.c (mount_automounter): when registering Amd with the portmapper (for Amq service), don't fail if just one of TCP or UDP failed to register, but only if both transports failed. That way Amq can still contact Amd using the transport that did register correctly. However, now, if both transports failed to register, then set amd_state to "Done" so it would shutdown cleanly. * conf/transp/transp_{sockets,tli{}.c (amu_svc_register): better comments. * libamu/xutil.c: debug_flags should always be initialized to D_CONTROL (amq,daemon,fork). (debug_option): allow setting initial immutable debug_flags via amd.conf; afterward, prevent it (i.e., one tries it via "amq -D"). * 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". 2005-08-27 Daniel P. Ottavio * amd/info_file.c (file_search_or_reload): Changed the key variable that is passed to the sun_entry2amd. * amd/mapc.c (mapc_add_kv): Add support for multiple entries packed into one line. This is a workaround for handling Sun style mounts that contains multiple entries on one line: "multi-mount entries". The sun2amd conversion tools will convert such entries into type:=auto and pack each of the auto-entries into one line separated by '\n'. The mapc_add_kv function will now recognize such entries and add then. * amd/sun2amd.c (sun2amd_convert): Add print statement that includes the line number during a parser failure. * sun_map.c: Fix the AMD_MAP_PREF_KW definition. Fix spelling. (sun_mountpts2amd): removed this function (sun_hsfs2amd): added some more comments (sun_nfs2amd): moved support for multi-mount entries from this function to sun_multi2amd(). (sun_multi2amd): New function to handle multi-mount entries. This function will convert the Sun version to an Amd type:=auto. Each extra auto entry will be appended to the same line separated by a '\n'. (sun_entry2amd): Fixed a bug if-statement. This function now checks for multi-mount entries. * amd/sun_map.h: Add a fstype member to the sun_mountpt struct. * amd/sun_map_parse.y: Parser now supports fstype for multi-mount entries. * amd/sun_map_tok.l: No longer print the line and column number when parsing. This is because the parser is handed strings not files. Therefore, the line number will always be 1. It is now up to the higher level tools to echo line information during error when they feed the parser. 2005-08-24 Erez Zadok * configure.in: wrap all LDAP and HESIOD tests in test whether --with-OPT was used. 2005-08-20 Daniel P. Ottavio * amd/sun_map.c: Clean up #defines (sun_entry2amd) : Verify that the key and entry values passed are not NULL. Free the Sun entry struct when done. * amd/sun_map.h: Add some "not implemented yet" comments to the map and mmap structures. * amd/sun_map_parse.y: Removed automap include functionality, it will need to be re-implemented using a pre-processor. Clean up function calls. 2005-08-16 Daniel P. Ottavio * amd/sun2amd.c (sun2amd_convert): If the input line is too long don't return an error just null terminate and continue. Fix bug: the map key was not written. * amd/sun_map.c: Add a new Amd device, and cdfs constant. (sun_locations2amd): Write the NFS type keyword for each host of the mount entry. Add a space between each mount location. (sun_hsfs2amd): New function to support hsfs to cdfs. (sun_nfs2amd): Don't write the nfs type here. Fix comments. (sun_entry2amd): Change function parameter var for clarity. Add support for hsfs. * amd/sun_map_parse.y (sun_map_parse_read): Reset the entry list after it has been returned. 2005-08-16 Erez Zadok * amd/get_args.c (get_args): initialize debug_flags if they've never been set. 2005-08-15 Erez Zadok * amd/mapc.c (mapc_create): mapc find takes 4th arg, the mount point. Now, we can properly initialize the cfm structure of the mnt_map, so we can have access to the flags (e.g., SUN_MAP_SYNTAX) inside each info_*.c file. (mapc_find): takes 4rd arg (mntpt) and passes it to calls to mapc_create. (root_newmap): pass NULL as 4th arg (mntpt). * amd/amfs_generic.c (amfs_parse_defaults): remove ugly hack to initialize map cfm structure (including flags) so late. * amd/autil.c (amfs_mkcacheref): pass mount point as 4th arg to mapc_find. * amd/amfs_root.c (amfs_root_mount): pass NULL as new 4th arg to mapc_find. * amd/amd.h: extern for mapc_find changed to pass the mount point. * libamu/xutil.c: debug_flags should be unsigned. (dbg_opt): fix comments for updated debug_flags, add "defaults". (debug_option): Don't allow "immutable" (D_IMMUTABLE) flags to be changed, because they could mess Amd's state and only make sense to be set once when Amd starts. Currently these immutable flags are "daemon," "fork," "amq," and "mtab." If Amd not compiled with debugging, set default "control" options (daemon,fork,amq). (unregister_amq): proper use of D_AMQ. * include/am_utils.h: define new D_BASIC, D_CONTROL, D_DEFAULT, D_IMMUTABLE, and D_MASK. Updated definitions of D_ALL and D_TEST. debug_flags extern should be unsigned. * scripts/amd.conf-sample (debug_options): mention new "defaults" option. * scripts/amd.conf.5,doc/am-utils.texi: document new debug option "defaults" and properly explain the corrected meanings of "daemon," "fork," "amq," and their "no" inversions. Better explain "all" and "test" too. Correct default debug_mtab file to /tmp/mtab. * hlfsd/stubs.c (nfsproc_readlink_2_svc): proper use of D_FORK. * hlfsd/homedir.c (homedir): proper use of D_FORK. * hlfsd/hlfsd.c (main, hlfsd_init, cleanup): proper use of D_DAEMON. * amd/nfs_start.c (mount_automounter): proper use of D_AMQ. * amd/amd.h (DEBUG_MNTTAB_FILE): change default to /tmp/mtab, which is more common on more systems (instead of /tmp/mnttab). * amd/amd.c (main): properly use D_DAEMON. 2005-08-14 Erez Zadok * libamu/xutil.c (xlog_opt): define new pseudo log_option named "defaults", which is an alias for "fatal,error,user,warning,info". * scripts/amd.conf.5, doc/am-utils.texi, amd/amd.8: document new log_option "defaults". * amq/amq.8: typo. Arg name for -D is "debug_options" not "log_options". * libamu/xutil.c: make xlog_level static, and initialize it to XLOG_DEFAULT. (cmdoption): take unsigned int as flags argument, and print any errors as XLOG_ERROR (which cannot be turned off). (switch_option): remove old code which disallowed you from turning off flags that were set when Amd started up. Now, you can turn any log option on/off at start time or later on (via amq -x), other than the two mandatory options (fatal+error). * include/am_utils.h (XLOG_*): remove unused XLOG_DEFSTR. Define XLOG_MASK to mask out unused flag bits. Define XLOG_DEFAULT to be what it was before (fatal + error + user + warning + info), but use the new mask. Remove extern's for xlog_level and xlog_level_init. Change extern for cmdoption() to take an unsigned flags argument. * doc/am-utils.texi, amq/amq.8, scripts/amd.conf.5, amd/amd.8: document mandatory log options (fatal+error) which cannot be turned off and are always on by default. They must be on so that Amd can report crucial errors, including those related to setting flags on/off. * hlfsd/hlfsd.c (main): remove hack to initialize log_options. * wire-test/wire-test.c: remove reference to unused xlog_level. * amd/mapc.c (mapc_create): 'alloc' flags variable should be unsigned. * amd/get_args.c (get_args): no need for hack using xlog_level_init. * amd/Makefile.am: separate sources common to amd and sun2amd into a special, locally-built only, static library called libaminfo.a. * libamu/xutil.c (real_plog, xsnprintf): call new xvsnprintf() wrapper function. (xvsnprintf): new function which already gets a va_list. This was needed to avoid nesting va_list's (which apparently isn't allowed). * include/am_utils.h: prototype for new xvsnprintf wrapper. * 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. 2005-08-14 Daniel P. Ottavio * amd/info_file.c: add key to sun_entry2amd()'s parameters * amd/info_hesiod.c: add key to sun_entry2amd()'s parameters * amd/info_ldap.c: add key to sun_entry2amd()'s parameters * amd/info_ndbm.c: add key to sun_entry2amd()'s parameters * amd/info_nis.c: add key to sun_entry2amd()'s parameters * amd/info_nisplus.c: add key to sun_entry2amd()'s parameters * amd/sun_map.c: New functions to support sun translation to amd. The function sun_entry2amd's parameters were expanded to include the key value. sun_entry_2amd() now returns NULL on error. * amd/sun_map.h: Expand sun_entry2amd's parameters to include key value. * amd/sun_map_parse.y: Change how file system types are parsed out of the list of options for each entry. The previous way was not working properly so now we just look for the 'fstype' keyword in each option. If it exists we copy its key value. Added some comments to sun_map_parse_read(). * amd/amd.h: Added an extern from info_file.c called file_read_line(). Previously this function was static but is now used in sun2amd.c. * amd/info_file.c: Changed the static function read_line() to a public function called file_read_line(). This function is now used in sun2amd.c * amd/sun2amd.8: Filled in the contents of this man page. This is a conversion utility that converts Sun maps to Amd maps. * amd/sun2amd.c: Implemented a working version of this utility. 2005-08-11 Erez Zadok * amd/sun_map_parse.y: instead of using a custom FOO_alloc() function, use Amd's CALLOC(struct FOO) macro. * amd/sun_map.h: remove extern definitions to functions no longer needed. * amd/sun_map.c: removed superfluous *_alloc() functions, some of which caused conflicts with same-named symbols in the parser (since we rename 'yyalloc' to 'sun_map_alloc'). * configure.in: keep AC_INIT on same line, for nightly snapshot build script. * amd/Makefile.am: f/lex libraries are incompatible with multiple scanners, so don't link Amd with libl.a/libfl.a. 2005-08-10 Daniel P. Ottavio * amd/sun_map_tok.l: Clean up regular expression so HPUX stops whining. 2005-08-09 Daniel P. Ottavio * amd/sun_map_parse.y: Moved license below special yacc bracket to be portable with HPUX's yacc. Clean up externs. * amd/sun_map_tok.l: Moved license below special lex bracket to be portable with HPUX's lex. Fixed definitions to allow for a non-flex lex to parse strings instead of files. Added some casts to strlcpy usage to silence warnings. Moved the % options because HPUX was complaining, 2005-08-08 Daniel P. Ottavio * amd/sun_map_tok.l: Applied some definition goop to handle the ECHO symbol that lex defines. This symbol causes problems on RedHat-EL-powerPC platforms. Replaced strncpy with strlcpy. Renamed the function sun_map_yyinput to sun_map_input. This function is a utility function that is not generated by lex. Therefore, the 'yy' may cause confusion. 2005-08-08 Erez Zadok * amd/sun_map_tok.l: allocate more output slots so lex scanners don't run out of memory. * amd/sun_map_parse.y: declare extern for sun_map_parse(). * libamu/xutil.c (xsnprintf): ensure proper comparisons between signed and unsigned quantities. 2005-08-06 Erez Zadok * libamu/util.c, amd/autil.c (strsplit): moved strsplit() function from Amd code to to libamu, so sun2amd could use it. * amd/Makefile.am (sbin_PROGRAMS): build sun2amd binary and man page. (EXTRA_sun2amd_OBJECTS): sun2amd needs to link with all info_*.c files * amd/sun2amd.8: placeholder for man page. * amd/sun2amd.c: placeholder for C version of translator from Sun syntax maps to Amd maps. * */*.[0-9]: include file name in nroff source comment. * ALL: use '0' properly when assigning or passing it to functions. If in the context pointer, use NULL. If in the context of a single char (say within a string), the use '\0'. This is just to make the code clearer. * m4/macros/header_templates.m4: template for HAVE_MAP_SUN. * amd/mapc.c (maptypes): add placeholder for Sun-syntax map methods. * amd/Makefile.am (EXTRA_amd_SOURCES): compile info_sun.c * amd/info_sun.c: placeholder for meta info parser to get info from Sun automount-style /etc/auto_master, possibly following into multiple info services (via /etc/nsswitch.conf). * libamu/xutil.c (xsnprintf): if vsnprintf truncated the output string to avoid an overflow, print an error. Include some code to break out any possible infinite loop between plog() and xsnprintf(). (real_plog): now we can use (carefully) xsnprintf() directly. * amd/sun_map.[hc]: cleanup and formatting. * amd/sun_map_parse.y: to match the literal string "fstype=" use double quotes, not single quotes. * amd/get_args.c (get_args): call conf_parse() using conf_in. * amd/amd.h: use renamed parser symbols (yyparse -> conf_parse; yyin -> conf_in). * ylwrap: Enhance wrapper to avoid the #define hacks done by Gdb, and suggested by the Automake manual. This enhanced parser will prefix each conflicting yacc/lex symbol with a unique name produced from INPUT. For example, if INPUT is foo_parse.y, then yyparse() becomes foo_parse(). This requires that both your .l and corresponding .y files have the same prefix (e.g., foo_parse.y and foo_tok.l). * amd/Makefile.am (BUILT_SOURCES): define which yacc/lex .h/.c source files are built automatically, and therefore should not be in the distro (IMHO), and should be cleaned upon "make clean". (amd_SOURCES): include new sun_map_parse.y and sun_map_tok.l files. * ylwrap: new file needed because we have two parsers now. * amd/sun_map_{parse.y,tok.l}: cleanup and formatting. 2005-08-06 Daniel P. Ottavio * amd/Makefile.am: Added new files sun_map.h, sun_map.c, sun_map_parse.y, and sun_map_tok.l. These files add support for parsing Sun style maps. The yacc/lex files needed custom rules so they don't cause symbol conflicts with each other. * amd/amd.h: Added "#define INFO_MAX_LINE_LEN" that specifies the line limit for info services. * amd/info_exec.c: Replaced MAX_LINE_LEN with INFO_MAX_LINE_LEN * amd/info_file.c: Replaced MAX_LINE_LEN with INFO_MAX_LINE_LEN, added support for parsing Sun style maps. The support for Sun maps is done using the sun_entry2amd() function. This function is called for each entry line that is read only when Sun parsing is enabled. For each entry line that is passed to the function a copy of the Amd equivalent is returned. * amd/sun_map.h: new header file for Sun style map support * amd/sun_map.c: new source file for Sun style map support, clean up comments, additional sun2amd conversion routines * amd/sun_map_parse.y: new yacc file for parsing Sun style maps, fix copyright notice, put filename below license. * amd/sun_map_tok.l: new lex file for parsing Sun style maps, fix copyright notice, put filename below license. * amd/get_args.c: replace usage of strlcat with xstrlcat * include/am_utils.h: added 'extern void xstrlcat()' * libamu/util.c: Added a xstrlcat() function that wraps the syscall strlcat() so that string truncations can be logged. 2005-08-06 Erez Zadok * amd/info_file.c (file_search, file_reload): pass mnt_map to file_search_or_reload. (file_search_or_reload): ensure that mnt_map is never NULL. * amd/info_nis.c (nis_search): call sun_entry2amd() if sun_map_syntax=yes. * amd/info_ldap.c (amu_ldap_search): call sun_entry2amd() if sun_map_syntax=yes. * amd/info_hesiod.c (hesiod_search): call sun_entry2amd() if sun_map_syntax=yes. * amd/info_ndbm.c (ndbm_search): pass mnt_map to search_ndbm. (search_ndbm): call sun_entry2amd() if sun_map_syntax=yes. * amd/info_nisplus.c (nisplus_search): call sun_entry2amd() if sun_map_syntax=yes. * amd/info_exec.c (exec_search): pass mnt_map to exec_parse_qanswer. (exec_parse_qanswer): call sun_entry2amd() if sun_map_syntax=yes. * doc/am-utils.texi (sun_map_syntax Parameter): document new common parameter. * scripts/amd.conf.5: selectors_in_defaults is a common parameter, not just [global]. Use consistent capitalization of Amd/Amq. Document new sun_map_syntax parameter. * scripts/amd.conf-sample: properly list all of the parameters which are common to both the [global] and the per-map sections. (sun_map_syntax): example of new parameter. * 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. * amd/conf.c ({ropt,gopt}_sun_map_syntax): new function to parse sun_map_syntax flag (global or per map). * amd/amd.h (CFM_SUN_MAP_SYNTAX): new flag for users to say if the map uses Sun automounter syntax. * cvs-server.txt: update instructions after branching 6.1-stable. 2005-08-02 Erez Zadok ******************************************************************* *** Released am-utils-6.1.1 *** ******************************************************************* * 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(). * ALL: remove CVS ID and put actual file name in source. * conf/autofs/*.[hc]: proper copyright headers. * whitespace reformatting. Remove remaining '%W%' SCCS IDs. * 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. 2005-08-01 Erez Zadok * 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. * minor new port: i386-pc-linuxoldld-deb3.1. * configure.in: include before to get the definition of size_t on Debian-3.1r0a. 2005-07-29 Erez Zadok * 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. 2005-07-25 Erez Zadok * 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). * 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. * 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. 2005-07-21 Erez Zadok * 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). 2005-07-20 Erez Zadok * 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. * doc/am-utils.texi (forced_unmounts Parameter): @xref -> @pxref. 2005-07-19 Erez Zadok * 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. 2005-07-18 Erez Zadok * 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. 2005-07-16 Erez Zadok * configure.in: better help for users, if nfs_args can't be found. 2005-07-15 Erez Zadok * 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). 2005-07-10 Erez Zadok * 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. * 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. 2005-07-08 Erez Zadok * conf/mount/mount_linux.c: add a couple more NFSv2 error codes that are compatible with NFSv3. 2005-07-07 Erez Zadok * 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(). * configure.in: overdue new major libtool shlib version. Check for snprintf function and extern. 2005-07-06 Erez Zadok * 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. 2005-07-05 Erez Zadok * amq/pawd.c (getawd): avoid buffer overflow. Bug fix from Graeme Wilford . 2005-06-30 Erez Zadok * 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. 2005-06-25 Erez Zadok * Makefile.am (EXTRA_DIST_CONF): distribute new mtab_linux.c. * conf/mtab/mtab_linux.c (rewrite_mtab): variable declarations must come before C code. * 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. 2005-06-24 Erez Zadok * conf/mount/mount_aix.c (mount_aix3): minor cleanup of filehandle copying code. 2005-06-23 Erez Zadok * conf/nfs_prot/nfs_prot_hpux.h: add extern for h_errno, which may be missing from older hpux10 systems. * 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 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). * 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. * 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. 2005-06-22 Erez Zadok * BUGS: update Solaris information about use of f/lex and yacc/bison. 2005-06-20 Erez Zadok * minor new port: i386-pc-linux-suse9.3. 2005-06-20 Rainer Orth * configure.in (linux/nfs_mount.h): Move __KERNEL__ definition up so u32 is available for . 2005-06-16 Erez Zadok * 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. 2005-06-15 Erez Zadok * minor new port: i386-pc-linux-fc4 (gcc4 catches more bugs). * m4/macros/type_recvfrom_fromlen.m4: linux systems use unsigned int as the type of recvfrom()'s 6th argument. * m4/macros/type_yp_order_outorder.m4: linux systems use unsigned int as the type of yp_order()'s 3rd argument. 2005-06-15 Erez Zadok * scripts/amd.conf-sample (map_type): typo, said mount_type instead of map_type for the 'exec' example. 2005-06-11 Erez Zadok ******************************************************************* *** Released am-utils-6.1 *** ******************************************************************* 2005-06-04 Erez Zadok * amd/ops_nfs.c (mount_nfs_fh): set timeo/retrans mount options only if the user specified them in amd.conf or elsewhere. If they were not specified, don't do anything, which would let the OS use its own defaults. * amd/get_args.c (get_args): negative timeo/retrans are "good" in that they represent uninitialized values (meaning to let the OS use it's default values). So only check if user specified a value equal to zero (invalid). * amd/amd.h: define AMU_TYPE_NONE so we know when users didn't specify timeo/retrans at all. 2005-06-03 Erez Zadok ******************************************************************* *** Released am-utils-6.1-rc7 *** ******************************************************************* * m4/macros/os_cflags.m4 (CFLAGS): use custom-OS C flags for configuring, not just for building. That way the two phases (configure and compile) are in sync. This fixes getwire() on OSF/1 systems. * conf/nfs_prot/nfs_prot_sunos5_8.h: define INADDR_NONE if not defined in system headers. 2005-06-01 Erez Zadok * libamu/Makefile.am (EXTRA_DIST): remove alloca.c as it's no longer needed. 2005-05-28 Erez Zadok * completed set of fixes for irix6.5. * Minor new ports alpha-unknown-linux-gentoo1.4.16 alphaev56-dec-osf4.0f, mips-unknown-linux-gentoo1.4.16, and sparc64-unknown-linux-gentoo1.4.16, and mips-sgi-irix6.5. Test those systems with both cc and gcc, where possible. * include/am_xdr_func.h: remove trailing comma at end of enum list. * m4/macros/os_cflags.m4: with gcc 3.4.3 on irix-6.5, we get pte_t undefined. So give it a dummy value. * libamu/alloca.c: remove file from distro. * configure.in: don't call AC_FUNC_ALLOCA any more. * include/am_defs.h: remove header fixups for , now that we don't need it. * amd/amq_svc.c (amqsvc_is_client_allowed): rewrite function to avoid only use of alloca() in am-utils, and to use strdup explicitly. This way we can avoid using alloca, a feature that's not portable on various systems. * amq/amq.c: remove unused lint/rcsid cruft. 2005-05-27 Erez Zadok * conf/checkmount/checkmount_osf.c (fixmount_check_mount): add extra parentheses around assignments in "if" expressions (gcc complains). * conf/nfs_prot/nfs_prot_osf4.h: add missing extern definitions for plock, hstrerror, getmntinfo, alloca, xdr_exportnode, and xdr_groups. * configure.in: check for , which, if found, appears to be preferable to . Use it to find . On some Linux systems (Gentoo), both exist but only one must be included, or else you get redefined structure errors. * libamu/wire.c (is_network_member): check if masknum is INADDR_NONE, not "< 0" because it's an unsigned quantity. * libamu/util.c (xstrlcpy): remove useless test for size_t < 0, because it's an unsigned quantity. 2005-05-26 Erez Zadok ******************************************************************* *** Released am-utils-6.1-rc6 *** ******************************************************************* 2005-05-25 Erez Zadok * conf/nfs_prot/nfs_prot_aix5_2.h: AIX 5.3 complains about missing definition of struct thread_credentials in but trying to bring that definition in drags a whole lot of other messy stuff. So just provide a dummy definition for this structure. 2005-05-24 Erez Zadok * Makefile.am (EXTRA_DIST_M4): distribute m4/macros/libtool.m4. * m4/macros/header_templates.m4: template for HAVE_EXTERN_MNTCTL. * m4/macros/check_extern.m4: include on AIX systems, so we can find extern definition for mntctl(). * conf/mtab/mtab_aix.c, conf/checkmount/checkmount_aix.c: only define an extern for mntctl() if needed. * amd/ops_nfs.c (prime_nfs_fhandle_cache): never, ever, use C++ style comments in C code. Some C compilers don't accept it. * amd/info_ldap.c (amu_ldap_init, get_ldap_timestamp): force cast of "time_t *ts" to u_long, to avoid complaints on AIX 5.2 with xlC. * amd/get_args.c: rename symbol conf_file to amu_conf_file to avoid conflict with libldap.a from openldap-2.0.21 on AIX 5.2. Oh, when will people who develop libraries learn to always prefix their exported symbols with a library-specific name? * configure.in: check for mntctl() extern on AIX systems. * ltmain.sh: update from latest libtool-1.5.18, so we can properly build on AIX 5.2/5.3 with cc and with gcc. * m4/macros/libtool.m4: update from latest libtool-1.5.18. This time, and from now on, we must include libtool.m4 from the libtool distribution itself. That way we ensure that we use an ltmain.sh that matches the appropriate libtool M4 macros. This makes am-utils no longer dependent on having libtool installed on a given system on which you run bootstrap. 2005-05-23 Erez Zadok * minor new port: i386-pc-linux-deb3.0. 2005-05-22 Erez Zadok * minor new ports: i386-unknown-netbsdelf2.0.2 and i386-unknown-openbsd3.7. 2005-05-20 Erez Zadok * minor new ports: i386-pc-linux-gentoo1.4.16 and powerpc-unknown-linux-yellowdog2.3. * include/{mount_headers2.h, am_defs.h}: safer setup before inclusion of , which is broken on several systems. * configure.in: test for . Separate special test for because we need to define __KERNEL__ for that test, as well as optionally define struct nfs2_fh for some systems (gentoo with 2.4 kernel, yellowdog 2.3, and others). * config.guess.long: support Gentoo and Yellow Dog Linux distros. 2005-05-18 Erez Zadok * minor new ports: i386-pc-linux-suse9.2 and i386-unknown-freebsd5.4. * amd/nfs_subr.c: use NFS_FHSIZE, not FHSIZE. 2005-05-17 Erez Zadok ******************************************************************* *** Released am-utils-6.1-rc5 *** ******************************************************************* * amd/info_ldap.c (amu_ldap_init): change plog to dlog, to avoid sending annoying warning for a minor issue. 2005-05-17 Ion Badulescu * amd/nfs_subr.c: check for NULL pointer before dereferencing it. 2005-05-16 Erez Zadok * minor new ports: powerpc-apple-darwin7.9.0. * m4/macros/host_macros.m4: if a NetBSD system, remove 'elf' part from OS name because it's no longer relevant. Also, don't include the major OS version number in the OS name because that's also unnecessary (and users can always use $osver in maps). * amd/nfs_subr.c: use [1] for out-of-band pointer at the end of struct am_fh, because it's the most portable method. Bug fix suggestion from Dan Riley . Better fix from Ion Badulescu: use [FHSIZE-sizeof(u_int)] which is the actual size we use. * amd/amfs_generic.c (amfs_lookup_mntfs): reset currently used def_opts to options given in -opts, appended with the /default options. Bug fix suggestion from Dan Riley . 2005-05-13 Erez Zadok ******************************************************************* *** Released am-utils-6.1-rc4 *** ******************************************************************* 2005-05-11 Daniel P. Ottavio * amd/amd.c (main) : fixed memory leak detected by valgrind * amd/info_ldap.c (amu_ldap_init) : fixed memory leak detected by valgrind 2005-05-11 Erez Zadok * m4/macros/{check_checkmount_style.m4, check_mnttab_style.m4, check_nfs_fh_dref.m4, check_nfs_prot_headers.m4, check_nfs_sa_dref.m4, check_umount_style.m4, os_cflags.m4}: check for "macosx" as valid OS string, so we compile properly on Darwin systems. ******************************************************************* *** Released am-utils-6.1-rc3 *** ******************************************************************* * rerun bootstrap to get a working configure script that actually checks for limits.h and dependent linux autofs/nfs headers. * configure.in: remove redundant check for limits.h. 2005-05-09 Erez Zadok ******************************************************************* *** Released am-utils-6.1-rc2 *** ******************************************************************* 2005-05-08 Erez Zadok * amd/amfs_generic.c (amfs_lookup_mntfs): removed redundant use of old_def_opts variable. 2005-05-08 Daniel P. Ottavio * amd/amfs_generic.c (amfs_lookup_mntfs) : Make sure when a map entry has a single dash '-', that the default options are reset. This functionality was somehow lost from earlier releases and reported by Dan Riley . 2005-05-05 Erez Zadok * config.guess.long: detect SuSE Enterprise Server and call it "sles" not "suse". 2005-05-02 Erez Zadok * doc/am-utils.texi (amd): document proper use of /etc/hosts.allow. Don't spawn a new Amd process because Amd will get confused if someone else waitpid's on its children (which often do important un/mount work). Issue reported by Francis Montagnac . * minor new ports: powerpc64-unknown-linux-rhel4, and powerpc64-unknown-linux-sles9. 2005-05-01 Daniel P. Ottavio * amd/amfs_host.c (amfs_host_umount): We do not want to pass ENOENT as an error because if the directory does not exists our work is done anyway. * conf/umount/umount_linux.c (umount_fs): If we are successful or there was an ENOENT, remove the mount entry from the mtab file. 2005-05-01 Ion Badulescu * amd/nfs_subr.c: am_fh definition moved here from amd.h; restructured to better reflect its duality (old/new filehandles) (fh_to_mp3): fhh_gen is always used, even for new style f/h (mp_to_fh): ditto * amd/amd.h: moved am_fh definition to nfs_subr.c (which is the only place where it's used) 2005-04-30 Erez Zadok * m4/macros/host_macros.m4: use sw_vers on Apple machines to find out more appropriate OS name (macosx) and OS version (10.3.x) than uname(3) reports. 2005-04-29 Erez Zadok * config.guess, config.sub, doc/texinfo.tex: updates from latest official GNU distributions. * m4/macros/host_macros.m4: for macosx, change architecture value from "Power Macintosh" to "powerpc". * libamu/util.c (xstrlcpy): format 'len' parameter as u_long, not int (it's a size_t). 2005-04-16 Erez Zadok * scripts/amd.conf.5, doc/am-utils.texi (normalize_slashes Parameter), scripts/amd.conf-sample: document new normalize_slashes global configuration parameter. * amd/opts.c (deslashify, normalize_slash): don't touch trailing slashes, even if multiples of them, if user said normalize_slashes=no in amd.conf. * amd/conf.c (gopt_normalize_slashes): new function to record if to normalize slashes or not. * amd/amd.h (CFM_NORMALIZE_SLASHES): new flag to decide if to normalize double-slashes or not ("yes" by default). * amd/autil.c (am_mounted): pass TRUE when calling mf_mounted. This is the parent mntfs which does the mf->mf_fo (am_opts type), and we're passing TRUE here to tell mf_mounted to actually free the am_opts. * amd/autil.c (mf_mounted): Be careful when calling free_ops and XFREE here. Some pseudo file systems like nfsx call this function, even though it would be called by the lower-level amd file system functions. nfsx needs to call this function because of the other actions it takes. So we pass a boolean from the caller (yes, not so clean workaround) to determine if we should free or not. If we're not freeing (often because we're called from a callback function), then just to be sure, we'll zero out the am_opts structure and set the pointer to NULL. The parent mntfs node owns this memory and is going to free it with a call to mf_mounted(mntfs,TRUE). * amd/amd.h: pass flag to mf_mounted, to free or not to free the am_opts. * amd/amfs_nfsx.c (amfs_nfsx_cont): call mf_mounted with FALSE to tell it not to free the am_opts, to avoid double free. * include/am_defs.h: include limits.h if found. * configure.in: check for limits.h. Check for certain Linux headers such as auto_fs.h after checking for limits.h, and include the latter if it exists, because some Linux headers depend on limits.h. This prevents warnings during configure time. 2005-04-12 Erez Zadok * amd/amfs_toplvl.c (amfs_toplvl_mount): do NOT set retrans/timeo values from default global UDP settings, because it can cause unexpected timeouts in Amd on slow systems. The default that each OS provides for these toplvl NFS mounts should be OK, or else you can use the map_options entry. 2005-04-09 Daniel P. Ottavio * amd/nfs_subr.c (mp_to_fh): Replace xstrlcpy with memcpy because the source buffer is treated more as a filehandle than a string. * amd/nfs_subr.c (fh_to_mp3): Replace xstrlcpy with memcpy because the source buffer is treated more as a filehandle than a string. * amd/opts.c (free_op): No longer need to assign pointer to NULL after XFREE. * amd/opts.c (expand_op): Revert back to using strncpy() instead of xstrlcpy. The code is correct and relies on the semantics of strncpy. * libamu/mount_fs.c (compute_nfs_args): Leave XXX warning that use of xstrlcpy in NFS_HN_DREF may corrupt a struct nfs_args, or truncate our concocted "hostname:/path" string prematurely if the nap->hostname field is ever less than 64 bytes long (MAXHOSTNAMELEN). * libamu/util.c (xstrlcpy): Return immediately if len is 0 to avoid unnecessary work. Log an error and return if len is less than 0. 2005-04-07 Erez Zadok * include/am_utils.h (XFREE): XFREE() should nullify the pointer even when compiling without debugging. It's safer this way. * libamu/xutil.c (am_set_hostname), hlfsd/stubs.c (nfsproc_lookup_2_svc), fsinfo/fsinfo.c (fsi_get_args), fixmount/fixmount.c (is_same_host, remove_mount, main), conf/mtab/mtab_isc3.c (mnt_dup, mtab_of), conf/mount/mount_svr4.c (mount_svr4), conf/mount/mount_linux.c (setup_loop_device), conf/hn_dref/hn_dref_linux.h (NFS_HN_DREF), conf/hn_dref/hn_dref_isc3.h (NFS_HN_DREF), amd/opts.c (expand_op), amd/ops_nfs.c (mount_nfs_fh), amd/nfs_subr.c (fh_to_mp3, mp_to_fh), amd/amfs_host.c (amfs_host_mount), amd/am_ops.c (merge_opts): use the new xstrlcpy instead of strncpy. * conf/checkmount/checkmount_{default,svr4}.c (fixmount_check_mount): document why NOT to use xstrlcpy. * libamu/xutil.c: am_hostname need not be MAXHOSTNAMELEN+1 any more, just MAXHOSTNAMELEN. * libamu/xutil.c (real_plog): use strlcpy (not xstrlcpy to avoid recursion, since xstrlcpy may use plog). * libamu/util.c (xstrlcpy): truncating a string is serious. Use XLOG_ERROR not XLOG_WARNING. 2005-04-06 Erez Zadok * include/am_utils.h: external definition for new xstrlcpy function. * libamu/util.c (xstrlcpy): new function. Similar to strncpy, but uses strlcpy to guarantee that the resulting string is null terminated, and also warn if the resulting string was truncated. * libamu/xutil.c (get_server_pid): move this function from util.c which is for general-purpose utilities. * m4/macros/header_templates.m4: template for HAVE_EXTERN_STRLCPY. * include/am_defs.h: provide extern definition for strlcpy, if needed. * libamu/Makefile.am (EXTRA_DIST): include strlcpy.c in distro. * configure.in: search for strlcpy and its extern. * amq/pawd.c (find_mt): It only handles *some* filesystem types, so it breaks on direct xfs mounts for example. The fix (from Christos Zoulas) is simple: We need to exclude toplvl to avoid infinite recursion, but all other fs's are game. 2005-03-31 Erez Zadok * amd/nfs_subr.c (fh_to_mp3): strncpy may not null terminate if copying exactly len bytes, so add null just to be safe. 2005-03-30 Daniel P. Ottavio * amd/nfs_subr.c (fh_to_mp3): Increased the n of strncpy() to make sure it null terminates. 2005-03-29 Daniel P. Ottavio * amd/nfs_subr.c (fh_to_mp3): Fix memset bug. In this case the memset can be removed because strncpy() should padd the buffer with NULLs anyway. 2005-03-21 Rainer Orth * include/am_defs.h: Clarify comment. 2005-03-21 Erez Zadok * include/am_defs.h: undefine "GROUP" so Solaris 10 with gcc-2.96 won't complain about a conflict for this definition between and . 2005-03-20 Erez Zadok * amd/readdir.c (amfs_readdir_browsable): use %p, not %lx. * libamu/mount_fs.c (print_nfs_args): print pointer with %p, not %lx. 2005-03-18 Erez Zadok ******************************************************************* *** Released am-utils-6.1-rc1 *** ******************************************************************* 2005-03-18 Erez Zadok * conf/transp/transp_tli.c (get_nfs_version): use proper type for versout on Solaris (rpcvcers_t). * amd/mapc.c (mapc_showtypes): if last map type to print, don't append newline or comma to it. * libamu/mount_fs.c (print_nfs_args): cast struct netbuf pointer to %lx because on Solaris 10 sparc gcc-3.4.3 complains about casting it to an int (size is different). * configure.in, NEWS: prepare for 6.1-rc1 release. 2005-03-17 Erez Zadok * scripts/amd2ldif.in, ldap.schema: fixes by Adam Morley to synchronize what amd2ldif does vs. what the ldap.schema expects. * amd/map.c (exported_ap_free): We're using a free-list data structure and re-using malloc'ed objects. So, to be safe, memset entire structure when it's freed, not just the pointer. (umount_exported): bug fix to on-exit code. Don't run am_unmounted() unless unmount_mp() didn't run, since the latter already calls am_unmounted(). This way we avoid a double-free bug. 2005-03-15 Erez Zadok * tasks: updates. Executable maps is supported. NFSv4 and FreeBSD autofs isn't. * Makefile.am (EXTRA_DIST): include FAQ in distro. * doc/Makefile.am (alldocs): install README.lda and README.osx. * FAQ: new file, better late than never. 2005-03-14 Erez Zadok * scripts/amd2ldif.in: patch to add the amdMapName attribute to the amdMapTimestamp object when amd2ldif converts it. This is necessary if you are using type:=auto mounts and want those mountmaps looked up through LDAP. Patch from Jim Zajkowski . 2005-03-12 Erez Zadok * minor new ports: i386-pc-linux-rhel4. * minor new ports: powerpc-apple-darwin7.8.0. 2005-03-10 Erez Zadok * amd/ops_nfs.c (prime_nfs_fhandle_cache): rearrange code so it's cleaner. * ltmain.sh: upgrade from libtool-1.5.6. * m4/macros/check_{fs_mntent,mnttab_type,mount_type}.m4: check for Linux 2.6 kernel modules, which have a .ko extension, not .o. Now we can properly detect which file systems exist on Linux 2.6 based systems (SLES9, RHEL4, Fedora, etc.). 2005-03-09 Erez Zadok * m4/macros/host_macros.m4: find out what's the OS software distribution name, if any. * m4/macros/header_templates.m4: template for DISTRO_NAME. * amd/get_args.c (get_version_string): print again full_os, os, osver, and vendor (bug fix). (get_version_string): print distribution name, if known (e.g., rh9, suse8, etc.). * amd/mapc.c (mapc_showtypes): wrap around list of supported map. 2005-03-08 Erez Zadok * amd/map.c (umount_exported): when unmounting file systems on exit (when amd.conf global unmount_on_exit=yes), use unmount_mp() instead of unmount_node() because the latter always unmounts in the foreground, whereas the former unmounts in the bg/fg as needed. Unmounting always in the foreground has two problems: (1) if the unmount hangs, amd hangs, and (2) for type:=program, the unmount script is execve'd(!) thus replacing the main amd process, which never gets to finish up, leaving the amd mount points hung. * NEWS: mention new feature of executable maps. * AUTHORS: Acknowledge Erik Kline. * scripts/amd.conf.5: document executable maps and exec_map_timeout parameter. * scripts/amd.conf-sample: examples of an executable map and exec_map_timeout. * m4/macros/header_templates.m4: template for HAVE_MAP_EXEC. * doc/am-utils.texi: document Executable maps and exec_map_timeout parameter. * amd/conf.c (gopt_exec_map_timeout): function to parse exec_map_timeout [global] parameter. * amd/amd.h (AMFS_EXEC_MAP_TIMEOUT): define default executable map timeout to 10 seconds, and a global placeholder for the configurable value. * amd/amd.c (init_global_options): initialize default executable map timeout. * amd/Makefile.am (EXTRA_amd_SOURCES): include info_exec.c in tarball. * configure.in: enable executable maps. * amd/mapc.c: define executable map functions and behavior. * amd/info_exec.c: executable map implementation from Erik Kline , modified, cleaned-up, and fixed. 2005-03-07 Erez Zadok * amd/info_file.c (file_init_or_mtime): consolidate identical file_init and file_mtime into one function. 2005-03-05 Erez Zadok * doc/am-utils.texi (Program Filesystem): if umount/unmount are not specified, Amd uses "umount ${fs}" by default. * amd/amfs_program.c (amfs_program_match): if neither unmount nor umount parameters are specified, use the default userland umount program with "umount ${fs}". This way type:=program doesn't have to specify the umount program for basic unmounting actions. (amfs_program_init): save unmount program string in mf_private only if it's NULL, not based on mf_refc. * configure.in: auto-detect name of userland unmount program. * aux_conf.h.in (UNMOUNT_PROGRAM): macro for default userland unmount program. * amd/ops_cachefs.c (cachefs_init): save unmount program string in mf_private only if it's NULL, not based on mf_refc. * configure.in: don't "discover" inheritance file system any more, since we don't have the .c file for it. * amd/get_args.c (get_version_string): hack to still show that we support the inherit file system in output of amd -v. 2005-03-05 Ion Badulescu * amd/amfs_inherit.c: removed, dead code * amd/Makefile.am, amd/am_ops.c, amd/amd.h, conf/autofs/autofs_linux.h, conf/autofs/autofs_solaris_v1.h, conf/autofs/autofs_solaris_v2_v3.h, m4/macros/header_templates.m4: removed references to amfs_inherit.c 2005-03-05 Erez Zadok * amd/autil.c (am_mounted): completely rewrite the unmount no/timeout code to (1) make more sense for odd conditions, and (2) allow utimeout=N mount options to override FS_NOTIMEOUT default flags for disk-based file systems such as ufs, pcfs, cdfs, etc. * libamu/mount_fs.c (mount_fs): use safer XFREE() not free(). * conf/umount/umount_linux.c (umount_fs): strtok is destructive, so use strdup'ed string. * conf/mount/mount_linux.c (parse_opts): strtok is destructive, so use strdup'ed string. 2005-03-04 Erez Zadok * scripts/amd.conf.5, doc/am-utils.texi (cache_duration Parameter): clarify actual behavior: this Parameter affects initial mount timeout as well as the linear backoff what happens the initial failed EBUSY unmount. * doc/am-utils.texi (opts Option): better explanation of utimeout=N mount pseudo-option. * amd/amd.h (AM_TTL, AM_TTL_W): better comments, minor cleanup. 2005-03-02 Daniel P. Ottavio * AUTHORS: add Dan Ottavio. * scripts/amd.conf.5: document new debug_mtab_file option. * scripts/amd.conf-sample (debug_mtab_file): show example. * doc/am-utils.texi (debug_mtab_file Parameter): document new option. * conf/mtab/mtab_{file,mach3}.c (open_locked_mtab): if mtab file doesn't exist by the time Amd tries to exist, return a 0 rather than hang indefinitely. * amd/conf.c (gopt_debug_mtab_file): new function to parse debug_mtab_file option. * amd/amd.h: placeholder for debug_mtab_file string. Define default debug_mtab_file to "/tmp/mtab". * NEWS: document new debug_mtab_file option. 2005-03-02 Erez Zadok * conf/transp/transp_{sockets,tli}.c (amu_get_myaddress): when users want Amd's NFS service to bind to some arbitrary "localhost" address, show which address was actually resolved and bound to. 2005-03-01 Erez Zadok * amd/srvr_nfs.c (start_nfs_pings): move code from elsewhere (update_nfs_pingval) that initializes the pinger, as well as turns it on/off as needed, and handles changing its value. This is to avoid races and other infinite-loop conditions that could result in ping storms. * amd/srvr_amfs_auto.c (amfs_generic_find_srvr): when creating a new file server structure, default the ping value to AM_PINGER (30sec) and set the FSF_PING_UNINIT flag. * amd/amd.h (FSF_PING_UNINIT): new flag to tell whether the NFS pinger had been initialized for a given file server. * scripts/ctl-amd.in (stop): no need to check if /var/lock/subsys/amd file exists if you do an rm -f afterward. Ensure that proper return value is returned from script. * NEWS, doc/am-utils.texi (opts Option): update meaning of ping=N so that if N=-1, pings are off; if N=0, pings are set to the default value (currently 30 seconds). 2005-02-28 Erez Zadok * amd/nfs_prot_svc.c (nfs_program_2): on TLI system, try to call __rpc_get_local_uid to verify if the RPC call through the local host interface came from UID 0. * configure.in: look for internal libnsl function __rpc_get_local_uid (seems to be available on all known TLI systems, Solaris and HP-UX 11). * conf/transp/transp_tli.c (amu_svc_getcaller): unnecessary function for TLI systems (and it violated a array's bounds, discovered with libumem.so). (bind_resv_port, bind_resv_port_only_udp, get_autofs_address): just to be on the safe side, set struct t_bind's qlen field to non zero (64 by default). This value cannot be zero for TCP connections, and it's unclear if it's good to have it zero for UDP connections, so setting it to 64 is safer. 2005-02-27 Erez Zadok * doc/am-utils.texi (opts Option, Keep-alives): update text on ping option. * amd/srvr_nfs.c (update_nfs_pingval): new function to update NFS server ping values, turn them off, or re-enable them. (find_nfs_srvr): call update_nfs_pingval() as needed. * hlfsd/hlfsd.c (reaper, cleanup): don't use exit(3) in a signal handler, but use _exit(2) instead. * amd/amd.c (parent_exit): This signal handler is called during Amd initialization. The parent forks a child to do all the hard automounting work, and waits for a SIGQUIT signal from the child. When the parent gets the signal it's supposed to call this handler and exit(3), thus completing the daemonizing process. Alas, on some systems, especially Linux 2.4/2.6 with Glibc, exit(3) doesn't always terminate the parent process. Worse, the parent process now refuses to accept any more SIGQUIT signals -- they are blocked. What's really annoying is that this doesn't happen all the time, suggesting a race condition somewhere. (This happens even if I change the logic to use another signal.) I traced this to something which exit(3) does in addition to exiting the process, probably some atexit() stuff or other side-effects related to signal handling. Either way, since at this stage the parent process just needs to terminate, I'm simply calling _exit(2). Note also that the OpenGroup doesn't list exit(3) as a recommended "Base Interface" but they do list _exit(2) as one. This fix seems to work reliably all the time. * scripts/wait4amd2die.in: change default to recognize that amd is down more quickly (check every 3 seconds instead of 5). 2005-02-26 Erez Zadok * libamu/xutil.c (amu_release_controlling_tty): warn if closing stdin/stdout/stderr failed. No need for tempfd. * scripts/ctl-{amd,hlfsd}.in: before running any real program in these shell scripts, chdir to "/" to avoid possible hangs with existing NFS mounts. This was causing ctl-amd's forked grand-child amd process to hang if restartable_mounts=no. Go figure. 2005-02-25 Erez Zadok * minor new port ia64-unknown-linux-rhel4 * fsinfo/fsi_util.c (set_ether_if): avoid u_long casting to -1 (RHEL4 gcc 3.4.3 ia64 compiler complains). 2005-02-24 Erez Zadok * minor new port i386-unknown-freebsd6.0 (6.0-CURRENT-SNAP001). 2005-02-23 Erez Zadok * minor new port: i386-pc-linux-rhel3. * INSTALL: major update of the compatibility list. * m4/macros/os_cflags.m4: set AMU_CFLAGS not AM_CFLAGS. 2005-02-22 Erez Zadok * scripts/amd.conf.5, doc/am-utils.texi (preferred_amq_port): document new preferred_amq_port [global] option. * scripts/amd.conf-sample (preferred_amq_port): example. * include/am_utils.h: add preferred_amq_port to prototype. * conf/transp/transp_tli.c (bind_preferred_amq_port): new function to bind the Amq RPC service for UDP and TCP to a preferred port (or to any port if preferred_amq_port==0). (create_amq_service): decide if to bind to RPC_ANYFD, or to a requested port. * conf/transp/transp_sockets.c (create_amq_service): if preferred_amq_port is greater than 0, then bind to that port for both UDP and TCP. If preferred_amq_port==0, then bind to any port. * amd/nfs_start.c (mount_automounter): pass global preferred_amq_port value to create_amq_service(). * amd/conf.c (gopt_preferred_amq_port): new function to parse amd.conf value for preferred_amq_port. * amd/amd.h: placeholder for preferred_amq_port. 2005-02-21 Erez Zadok * conf/transp/transp_tli.c (bind_resv_port_only_udp): rename old bindnfs_port to a more proper name. This function binds the NFS service to a specified port, and only for UDP. * conf/transp/transp_tli.c: cleanup some code, rename some functions, in preparation for RPC amq port specification code. 2005-02-19 Erez Zadok * */Makefile.am: don't redefine CFLAGS or LDFLAGS; they are reserved for users to pass them on the command line. Instead, use autoconf's internal AM_CFLAGS and AM_LDFLAGS. * depcomp, install-sh, missing, mkinstalldirs: update from latest versions of Automake 1.9.2. * m4/macros/*.m4: properly quote AC_DEFUN'ed macro name, and fix regexp/patsubst M4 commands. Newer versions of autoconf (e.g., v2.59) complain about those. 2005-02-17 Erez Zadok * amd/opts.c (f_xhost): if we don't have hstrerror, just print the value of h_errno. * configure.in: include -lresolv if it defines the hstrerror() function and not already available in existing libraries. * minor new port: powerpc-apple-darwin7.7.0. * amd/nfs_subr.c (mp_to_fh): pathlen should be u_int because it is later compared against an unsigned quantity (complaint from gcc 3.3 on SuSE 8.2) * include/am_utils.h: remove unnecessary (and conflicting) extern for bind_resv_port2(), which is declared as static in transp_tli.c. * doc/am-utils.texi, scripts/amd.conf.5, scripts/amd.conf-sample, NEWS: document four new amd.conf options: nfs_retry_interval_udp, nfs_retransmit_counter_udp nfs_retry_interval_tcp, and nfs_retransmit_counter_tcp. * amd/ops_nfs.c (mount_nfs_fh): set timeo/retrans values based on wether nfs_proto was "udp" or "tcp". * amd/amfs_toplvl.c (amfs_toplvl_mount): set retrans/timeo values from default UDP settings (because toplvl mounts are UDP for now). * amd/get_args.c (get_args): use parameters to -t option to set both UDP and TCP timeo/retrans values. * amd/conf.c: (gopt_nfs_retransmit_counter_udp, (gopt_nfs_retransmit_counter_tcp, gopt_nfs_retry_interval_udp (gopt_nfs_retry_interval_tcp): new functions to parse UDP and TCP retrans/timeo parameters separately. (gopt_nfs_retry_interval, gopt_nfs_retransmit_counter): if specified, use it to set defaults for both UDP and TCP. * amd/amd.c (init_global_options): initialize default values of both UDP and TCP retrans/timeo values to -1. * amd/amd.h (AMU_TYPE_{TCP,UDP,MAX}): define separate retrans and timeo values, one for udp mounts and another for tcp mounts. 2005-02-16 Erez Zadok * README.osx: new file with some instructions for Mac OS-X users, courtesy Kevin Layer. * amd/get_args.c (get_args): move call to switch_to_logfile() after processing -v, so we don't print "no logfile defined; using stderr" when we're about to print version info and exit anyway. * minor new port: powerpc-ibm-aix5.3.0.0. * hlfsd/hlfsd.c (main): rewrite code to avoid negative array references. * conf/checkmount/checkmount_aix.c: remove extern definition for mntctl(), since AIX 5.3 has it in . * amd/info_union.c (union_reload): rewrite code to avoid negative array references. * amd/opts.c (split_opts, expand_op): rewrite code to avoid negative array references. * conf/mtab/mtab_aix.c: remove extern definition for mntctl(), since AIX 5.3 has it in . * libamu/xutil.c (real_plog): rewrite code to avoid negative array references. * libamu/wire.c (is_network_member): rearrange code slightly to avoid negative array references (AIX 5.3 xlC 7.0 compiler complains about it). 2005-01-26 Erez Zadok * doc/am-utils.texi (xhost Selector Function): document new selector function. * amd/opts.c (f_xhost): new function for use when matching the "host" selector for the current host's name. This function will now match the primary host name as well as all known aliases (CNAMES) that gethostbyname() returns. This function now supports a new function selector called xhost(ARG); the old host==ARG selector is unharmed. 2005-01-17 Ion Badulescu * NEWS: document the ability to restart old mount points * amd/map.c (mount_auto_node): force the fileid of the root to be 1, so that it won't change between restarts; use the root filesystem's own methods instead of hard-coding the use of the default methods * conf/transp/transp_tli.c (create_nfs_service): better cleanup on error conditions. (bind_resv_port2): allow the caller to request a certain port. * conf/transp/transp_sockets.c (bind_resv_port): allow the caller to request a certain port. (create_nfs_service): better cleanup on error conditions. * amd/restart.c (restart_automounter_nodes): new function, takes care of restarting automounter NFS mount points (autofs will come later). (restart): skip all automounter mount points. * amd/nfs_subr.c (fh_to_mp3, mp_to_fh): new filehandle implementation: if the path to the node is shorter than sizeof(fh) chars (currently 32 chars for a NFSv2 fh), simply store it inside the fh. For longer paths, keep the old implementation. * amd/nfs_start.c (mount_automounter): reorder things so that restarting the toplvl filesystems occurs before anything else (so that we can grab all the ports we need before we accidentally use them for something else). * amd/mntfs.c (locate_mntfs): remove dead code; add special handling of restarted toplvl filesystems. * amd/mapc.c (root_keyiter): fix up a comment. * amd/map.c (path_to_exported_ap): new function, searches for and returns a node by the path to it. (get_root_nfs_fh): remove unnecessary fiddling with the root fh. * config.guess.long: support Red Hat Enterprise Linux 2005-01-17 Erez Zadok * libamu/util.c (rmdirs): prevent amd from logging 'Read-only filesystem' errors when the mount point has an ancestor (i.e. '/') that is mounted read-only. Patch from David Rage . 2005-01-17 Ion Badulescu * conf/umount/umount_linux.c (umount_fs): Linux doesn't need the autofs space hack * conf/umount/umount_default.c (umount_fs): there is no need for HAVE_LOOP_DEV, now that Linux has its own dedicated umount_linux.c 2005-01-17 Erez Zadok * doc/am-utils.texi (Automatic Unmounting): document new umount2() behavior on Linux. * conf/umount/umount_linux.c (umount_fs): new file. On Linux, if umount(2) failed with EIO or ESTALE, try umount2(2) with MNT_FORCE+MNT_DETACH. Based on patch from Christos Zoulas . * m4/macros/check_umount_style.m4: pick new linux umount style. * Makefile.am (EXTRA_DIST_CONF): distribute new umount_linux.c file. 2005-01-16 Erez Zadok * conf/nfs_prot/nfs_prot_aix{4_2,4_3,5_1,5_2}.h, m4/macros/struct_nfs_args.m4: minor cleanups for quicker execution of "nfs_args" test. 2005-01-13 Erez Zadok * amd/get_args.c (show_usage): separate function to print usage string. (get_args) Call show_usage() from get_args when needed, then exit. * amd/get_args.c (get_version_string): print also domain, host, and hostd. (get_args): print version string at the very end, after all other values had been initialized. Patch from Christos Zoulas . * conf/transp/transp_sockets.c (check_pmap_up, get_nfs_version), conf/transp/transp_tli.c (check_pmap_up): correct an inconsistency in timeouts in the RPC code between socket and TLI implementations. The clntudp_create timeout has a different meaning than the clnt_call timeout. Set the timeout of the create to 2 seconds which means retry if no answer in two seconds, and the timeout call to 6 seconds, which will give us consistently 2 to 3 pings. This is useful on occasional network UDP loss where a single packet loss would wrongfully mark a server down. (The TLI code is the one that had the problem occurs.) Patch from Christos Zoulas . * libamu/mount_fs.c (compute_nfs_attrcache_flags): make sure code compiles even for systems that don't have the nfs_args ac{reg,dir}{min,max} fields. * amd/amfs_toplvl.c (set_auto_attrcache_timeout): just to be safe, add "noac" if amd.conf option auto_attrcache was set to 0. This should hopefully make the compute_nfs_attrcache_flags patch even safer. * libamu/mount_fs.c (compute_nfs_attrcache_flags): separate function to compute attribute-cache values. This function now computes attribute-cache flags for BOTH Amd's automount points (NFS) as well as any normal NFS mount that Amd performs. (compute_nfs_args, compute_automounter_nfs_args): call compute_nfs_attrcache_flags to figure out attribute-cache related flags. Patch from Christos Zoulas . * scripts/amd.conf-sample: show examples of new global options domain_strip and auto_attrcache. * scripts/amd.conf.5: document new global options domain_strip and auto_attrcache. Add warning to auto_attrcache use in case of ESTALE. * doc/am-utils.texi: minor cleanups and document new global options domain_strip and auto_attrcache. Add warning to auto_attrcache use in case of ESTALE. * amd/conf.c (gopt_auto_attrcache): parse new global amd.conf option auto_attrcache. (gopt_domain_strip): parse new global amd.conf option domain_strip. Part of a patch from Christos Zoulas . * amd/autil.c (host_normalize): don't call domain_strip() unconditionally, but depend on the new global amd.conf flag domain_strip. * amd/amfs_toplvl.c (set_auto_attrcache_timeout): new function to set attribute cache timeout value given other configured global defaults. (amfs_toplvl_mount): set automount point attribute cache option value to "noac" if attrcache=0, else set it to whatever set_auto_attrcache_timeout() returns. * amd/amd.h (CFM_DOMAIN_STRIP, CFM_DEFAULT_FLAGS): flag to decide if to strip the domain from the host name or not, default options set to strip the domain. Store global value of automount attribute cache timeout value. * amd/amd.c (init_global_options): add flag to record automount point attribute cache value. * amd/amd.c (do_memory_locking): new function to encapsulate all of the memory-locking functionality, which was in main() before. Also added a call to madvise(), just in case. (main): call do_memory_locking() to pin process memory if amd.conf asked for it, but do so after the main Amd process daemonizes, because mlock/mlockall is not inherited by fork() by default. Slightly restructured patch from Jonathan Chen . * configure.in: check for madvise(2). * config.guess, config.sub: updates for latest official GNU versions. * m4/GNUmakefile: update paths to "make update" 2005-01-12 Erez Zadok * conf/nfs_prot/nfs_prot_hpux11.h: define an nfs_fh3 structure that's compatible for HPUX11 as well as NFSv3. * include/am_defs.h: On AIX 5.2, both and define MAXDNAME, if compiling with gcc -D_USE_IRS (so that we get extern definitions for hstrerror() and others). So undef MAXDNAME before it gets redefined. * include/am_defs.h: Solaris 10 (build 72) defines GROUP_OBJ in , which is included in many other header files. uses GROUP_OBJ inside enum zotypes. So if you're unlucky enough to include both headers, you get a compile error because the two symbols conflict. Temp hack: undefine acl.h's GROUP_OBJ before including nis.h, because we don't need acl.h for am-utils. * m4/macros/os_cflags.m4: turn -D_USE_IRS for AIX5+ so that certain extern definitions of resolver functions become available. * amd/opts.c (expand_op): use #define for expand_error string because some compilers complain about the use of static const char[] inside a varargs function. * minor new port i386-unknown-netbsdelf1.6.2. * new port i386-unknown-netbsdelf2.0. * minor port i386-unknown-freebsd5.3. * libamu/mount_fs.c (compute_nfs_args): don't compare nap->maxgrouplist against NULL but against 0 directly, because on FreeBSD 4.3, NULL is defined is (void *)0 and gcc 3.4 complains about a type mismatch. * minor port i386-pc-linux-fc3 (Fedora Core 3). 2005-01-11 Erez Zadok * hlfsd/hlfsd.c (main): use sigsuspend() over sigpause(), because FC3 doesn't have proper extern definition for the defunct sigpause(). * configure.in: look for sigsuspend(). 2005-01-01 Erez Zadok * updated copyright year to 2005 on all files. 2004-11-29 Erez Zadok * scripts/amd.conf.5: Small fixes to typos in man page, from Thomas Klausner . 2004-10-22 Erez Zadok * ldap.schema: add this file to distribution. 2004-09-15 Erez Zadok * doc/am-utils.texi: fix old URLs. 2004-09-01 Erez Zadok * conf/mtab/mtab_aix.c (read_mtab): avoid a race condition between multiple calls to mntctl(). Patch suggested by Michael van Elst . 2004-08-07 Erez Zadok * doc/am-utils.texi (Program Filesystem): document how to get double slashes in Amd maps. * amd/opts.c (normalize_slash): support escaped slashes, needed for SMB mounts. Use '\\\/\\\/' in a string to get a double slash. 2004-08-06 Erez Zadok * amd/amfs_program.c (amfs_program_match): bug fix. Complain if both opt_unmount and opt_umount are missing, not when just one of them is missing. 2004-08-03 Erez Zadok * amq/pawd.c (find_mt): recognize "linkx" type mounts. Patch from Hauke Fath . Support "nfsx" while we're at it. * doc/am-utils.texi: mention bugzilla. Fix broken URL HREF's. 2004-08-02 Erez Zadok * amq/pawd.c (find_mt): recognize "host" type mounts. Patch from Dan Nelson . 2004-07-30 Erez Zadok * doc/am-utils.texi, NEWS: minor typos fixed. 2004-07-30 Erez Zadok * include/am_xdr_func.h: cannot have field-less structure; put a dummy field in. * conf/autofs/autofs_solaris_v2_v3.c (xdr_autofs_rddirargs): cast 2nd arg of xdr_u_int to a u_int*, not int*. (autofs_mount_2_req): don't use C++ // comments. 2004-07-30 Erez Zadok * m4/macros/{try_compile_anyfs,check_field}.m4: include if it exists. Part of a set of FreeBSD 5 patches from Martin Blapp . * include/am_defs.h: include if it exists. * amd/ops_pcfs.c (mount_pcfs): set pcfs_args_t.dirmask field to 0777 by default. * configure.in: check for pcfs_args_t.dirmask field. Check for existence of , new on FreeBSD 5. 2004-07-29 Erez Zadok * minor new port: i386-pc-linux-fc2 (Fedora Core 2). * amd/info_ldap.c (amu_ldap_rebind): don't use ldap_enable_cache() unless the function exists in libldap and the extern is in . Recently, openldap removed the extern from ldap.h, but left the function in libldap, for binary compatibility; however ldap_enable_cache and related functions have been deprecated (and no longer listed in the header files), and therefore should be avoided. * m4/macros/check_extern_ldap.m4: new macro to check for LDAP-specific externs. This is separate from check_extern.m4 so as to avoid breaking the general-purpose macro with LDAP-specific headers. * m4/macros/header_templates.m4: extern template for new HAVE_EXTERN_LDAP_ENABLE_CACHE. * configure.in: call new check_extern_ldap.m4 macro. * Makefile.am (EXTRA_DIST_M4): distribute new check_extern_ldap.m4 macro. * config.guess.long: distinguish between redhat and fedora-core releases. 2004-07-23 Erez Zadok * Minor new port i386-pc-linux-suse8.2: minor new port to SuSE 8.2. This systems' latest GCC (gcc version 3.3 20030226 prerelease) correctly caught a lot of possibly bad comparisons between signed and unsigned quantities. * hlfsd/homedir.c (table_add, plt_search): changed first arg of both functions to u_int. * hlfsd/hlfsd.h, hlfsd/hlfsd.c: change 'cache_interval' to u_int. Changed proto for plt_search arg to u_int. * amq/amq.c (show_mi, main): change 'i' to u_int. * amq/pawd.c (find_mlp): change 'i' to u_int. * amd/srvr_nfs.c (find_nfs_srvr): change proto_nfs_version to u_int. * amd/amd.h: change prototype of vreaddir and amfs_error_readdir to use u_int count parameter. * amd/ops_TEMPLATE.c (foofs_readdir), amd/amfs_error.c (amfs_error_readdir): change 'count' parameter in proto to u_int. * amd/amd.h: change proto of amfs_generic_readdir() to use u_int count parameter. * amd/readdir.c (make_entry_chain): preflen should be u_int. (amfs_readdir_browsable): change 'count' to u_int. (amfs_generic_readdir): change 'count' to u_int. * amd/amd.h: amu_global_options's portmap_program field should be u_long, not int (to match RPC conventions). Change am_fh's fhh_gen field to u_int, to match am_gen field in struct am_node. * amd/conf.c (gopt_portmap_program): use atol() instead of atoi() to avoid size differences. * conf/mount/mount_linux.c (find_unused_loop_device): cast to int to avoid comparison between chars and integers. * libamu/mount_fs.c (get_hex_string): change 'i' to u_int to avoid comparisons between signed and unsigned integers. 2004-07-13 Erez Zadok * minor new port: i386-pc-linux-suse9.1. * include/am_defs.h: don't use __kernel_dev_t for dev_t on Linux, because SuSE wants __kernel_old_dev_t. Instead, just define it directly to what they both use: an unsigned short. 2004-05-27 Erez Zadok * minor new port: i386-unknown-freebsd4.10 2004-04-29 Ion Badulescu * amd/amfs_generic.c (amfs_lookup_one_mntfs): fix the creation of mountpoints for autofs-based sublinks the right way 2004-04-28 Ion Badulescu Fixes for various memory management problems discovered by Rainer's purify run: * conf/transp/transp_tli.c (check_pmap_up): zero out struct timeval before using; (get_nfs_version): ditto * amd/map.c (umount_exported): make sure we don't try to free the same am_node multiple times, by setting its corresponding exported_ap slot to null * amd/get_args.c (get_version_string): a static pointer is pretty pointless, make it automatic * amd/conf.c (gopt_debug_options): remove unnecessary strdup(); (gopt_log_options): ditto (gopt_print_version): free version string after using it * amd/autil.c (mf_mounted): free mntfs->mf_fo instead of leaking it * amd/amfs_generic.c (amfs_lookup_one_mntfs): use the CALLOC macro (amfs_lookup_mntfs): free def_opts on return * amd/amd.c (daemon_mode): zero out struct sigaction before using it; (main): ditto 2004-04-27 Ion Badulescu * amd/amfs_generic.c (amfs_lookup_one_mntfs): force FS_MKMNT on the real mount of an autofs-based sublink 2004-04-25 Ion Badulescu * amd/map.c (free_map_if_success): avoid dereferencing a pointer to potentially freed memory 2004-02-26 Erez Zadok * minor new port: i386-unknown-freebsd5.2.1. 2004-01-30 Ion Badulescu * scripts/ctl-hlfsd.in: don't run hlfsd with -D fork 2004-01-25 Erez Zadok * minor new port: sparc64-unknown-linux-deb3.0 * config.guess.long: recoognize Debian Linux. 2004-01-22 Erez Zadok * conf/transp/transp_tli.c (amu_get_myaddress): use htonl(INADDR_LOOPBACK) and define INADDR_LOOPBACK if not already available. 2004-01-21 Erez Zadok * wire-test/wire-test.c, hlfsd/hlfsd.c (main): pass NULL as second parameter to amu_get_myaddress(). * conf/transp/transp_tli.c (amu_get_myaddress): resolve value of localhost_address amd.conf parameter, if defined (else default to HOST_SELF_CONNECT). Removed htonl() around socket address copying (I think it was wrong) since plog("My IP address is...") in amd.c was printing addresses wrong on Solaris x86.. * conf/transp/transp_sockets.c (amu_get_myaddress): comment out old DEBUG code that warns if 127.0.0.1 isn't the same as what get_myaddress() reports. Add code to resolve value of localhost_address amd.conf parameter, if defined (else default to 127.0.0.1). * amd/conf.c (gopt_localhost_address): new function to parse amd.conf parameter localhost_address. * amd/amd.h: global field to store amd.conf localhost_address parameter. * amd/amd.c (main): call amu_get_myaddress with global option, which could have been set in amd.conf. * NEWS, doc/am-utils.texi, scripts/amd.conf-sample, scripts/amd.conf.5: document new option localhost_address. 2004-01-20 Ion Badulescu * amd/conf.c (gopt_nfs_allow_insecure_port): support function for the new "nfs_allow_insecure_port" amd.conf directive * amd/nfs_prot_svc.c (nfs_program_2): complain about the insecure port and drop the request only if the "nfs_allow_insecure_port" option is not set in amd.conf * doc/am-utils.texi (Global Parameters): documented the new amd.conf directive "nfs_allow_insecure_port" * scripts/amd.conf.5 (nfs_allow_insecure_port): ditto * scripts/amd.conf-sample (nfs_allow_insecure_port): added the "nfs_allow_insecure_port" directive 2004-01-20 Erez Zadok * doc/am-utils.texi: amd-workers is defunct. 2004-01-19 Erez Zadok * cvs-server.txt: updated instructions 2004-01-18 Erez Zadok * minor new port: i386-unknown-freebsd5.2. 2004-01-05 Erez Zadok * MIRRORS.{txt,html}: verify each mirror site, update to new locations (if found), and remove stale mirrors URLs. * updated copyright year to 2004 on all files. 2004-01-03 Erez Zadok * MIRRORS.txt: track status. * Makefile.am (install-snapshot): new directory to install snapshots (now that am-utils home page is moved). 2004-01-02 Erez Zadok * INSTALL, README.autofs: remove forced text-mode. * doc/am-utils.texi: fix Amd book URL. * Makefile.am (EXTRA_DIST): include new mirror files in tarball. * AUTHORS, BUGS, README, README.y2k, configure.in, doc/am-utils.texi: revisions to use newer URLs for Web site, FTP, and mailing lists. * MIRRORS.{html,txt}: updates. * doc/Makefile.am: install mirror lists officially. 2004-01-01 Erez Zadok * tasks: things to do after migrating ftp/Web sites. 2003-12-09 Erez Zadok * fsinfo/fsinfo.8: fixed typo (unbalanced []) in man page. Bug report from Eric S. Raymond . 2003-11-18 Erez Zadok * Makefile.am (EXTRA_DIST_M4): exclude removed file m4/macros/struct_nfs_fh3.m4 from distro. 2003-10-24 Rainer Orth * libamu/xdr_func.c (xdr_am_nfs_fh3): Use AM_FHSIZE3 instead of FHSIZE3 (may be undefined). 2003-10-24 Ion Badulescu Compile fix for Solaris7 with LDAP: * include/am_defs.h: moved the ldap headers before am_nfs_prot.h to facilitate using ldap types in it * conf/nfs_prot/nfs_prot_sunos5_7.h: add a couple of ldap definitions that Sun left out of their headers 2003-10-24 Ion Badulescu * conf/nfs_prot/nfs_prot_*.h: remove all NFSv3-related definitions, they are now defined globally * libamu/xdr_func.c: unconditionally define all xdr functions needed for NFSv3, but with an am_ prefix to prevent namespace collisions * amd/amfs_host.c, amd/ops_nfs.c, amd/srvr_nfs.c, libamu/mount_fs.c: added the am_ prefix to all structures and functions having to do with NFSv3 to prevent namespace collisions * include/am_utils.h: moved definition of am_nfs_handle to ... * include/am_xdr_func.h: ... here. Also define AM_FHSIZE3, am_nfs_fh3, AM_NFSPROC3_LOOKUP, am_nfsstat3, am_fhandle3, am_mountstat3, am_mountres3_ok, am_mountres3, am_filename3, am_diropargs3, am_LOOKUP3args, am_LOOKUP3resok, am_LOOKUP3resfail, am_LOOKUP3res here; remove cross-platform compile helper macros AMU_LOOKUP3RES_*. * include/am_defs.h: include am_xdr_func.h before am_utils.h to provide definitions for NFS filehandles * amd/amd.h: removed declaration for xdr_mountres3 * doc/am-utils.text: minor warning fix * BUGS: document the autoconf warnings when trying to compile system header files in isolation 2003-10-23 Ion Badulescu * m4/macros/struct_nfs_fh3.m4: removed, not needed * configure.in: check if struct mounta has the optptr field; removed all NFSv3-related checks, we implement everything internally now * conf/autofs/autofs_solaris_v2_v3.c (autofs_mount_2_free): don't touch mnt->optptr unless HAVE_MOUNTA_OPTPTR is defined 2003-10-22 Ion Badulescu * m4/macros/struct_nfs_fh3.m4: removed, not used anymore * libamu/xdr_func.c (xdr_am_nfs_fh3): update xdr_am_nfs_fh3 comments * configure.in: don't check for xdr_nfs_fh3 and struct nfs_fh3, we always use our own 2003-10-22 Ion Badulescu * BUGS: document the limitations of bind mounts on Linux 2003-10-21 Ion Badulescu * buildall: added support for -i (make install) 2003-10-16 Rainer Orth * NEWS: New minor port i386-pc-solaris2.10 (Solaris 10). * INSTALL: Mention its test status. 2003-10-16 Erez Zadok * amd/ops_nfs.c (nfs_init): declare as static to match forward definition at top of file. * conf/nfs_prot/nfs_prot_{hpux11, netbsd1_4,openbsd,aix5_2}.h: added missing definitions for LOOKUP3res, diropargs3, etc. 2003-10-15 Erez Zadok * libamu/xdr_func.c (xdr_LOOKUP3res, xdr_am_nfs_fh3), libamu/mount_fs.c (compute_nfs_args), amd/ops_nfs.c (got_nfs_fh_mount, got_nfs_fh_webnfs, prime_nfs_fhandle_cache, webnfs_lookup), amd/amfs_host.c (fetch_fhandle): Attempt to cleanup some inconsistencies with how we treat NFSv3 file handles. Whenever we need to get data out of a filehandle given to us, we assume that it uses the OS's native fhandle structure (often struct nfs_fh3). When we store the fhandle data for our own use, however, we store it in one of two ways. The first, is that we use the system's default nfs_fh3 structure; the second is that we define out own struct am_nfs_fh3 in nfs_prot.h (and go through an elaborate autoconf song-and-dance to "discover" it as a native fh3 handle structure). It appears that we do the latter, instead of using the system's default fhandle structure, simply to avoid extra malloc's and free's, because whereas nfsv2's fhandle structure is a simple 32-byte buffer, nfsv3's fhandle structures often just define a "char *" for the fhandle data, and the caller must malloc/free the space inside as needed. Our code was never written with constructor/destructor callbacks for these nfsv3 filehandles. Moreover, we carefully wrote our own am_nfs_fh3 structure so IT JUST SO HAPPENS to align with most (hopefully all) of the fhandle structures for v3: first four bytes are the length fields and the next four bytes are the fhandle data. Sigh. Having this inconsistent use of v3 filehandles can be a real bear, because we simply cannot avoid using the system's default fhandle structure indirectly, through things like diropargs3 in xdr_diropargs3(), which has inside of it a reference to the system's default nfs_fh3 structure. ANYWAY, the current fix I've come up with is to generalize the way we dereference field names within the nfs_fh3 structure (whether ours or the system's) and the same for the system's LOOKUP3res structure. I'm not pleased with this fix; I'd rather we don't use our own am_nfs_fh3 structure at all. * libamu/xdr_func.c (xdr_am_nfs_fh3): always define this function if we have NFS3, because we often use our own, incompatible am_nfs_fh3 structure. * include/am_xdr_func.h: We cannot use the native system's xdr_nfs_fh3 because we are defining our own incompatible am_hfs_fh3 structure for some systems. * include/am_xdr_func.h: Define default values for field names of struct nfs_fh3 and LOOKUP3res. * doc/am-utils.texi (debug_options Parameter): minor typo fixed. * conf/nfs_prot/nfs_prot_freebsd3.h: FreeBSD uses different fields names for struct nfs_fh3 and LOOKUP3res, so override the default names here. * configure.in: AMU_CHECK_FS_MNTENT(nfs3) test before AMU_STRUCT_NFS_FH3, because the latter depends on the former. * amd/ops_nfs.c (prime_nfs_fhandle_cache): add {} to disambiguate and clarify if-the-else clauses. 2003-10-13 Ion Badulescu * amd/get_args.c (get_version_string): change "Built by" to "Configured by", and add a new "Built by" line using the variables below * m4/update_build_version (vers): add BUILD_USER, BUILD_HOST, and BUILD_DATE to build_version.h * amd/mntfs.c (locate_mntfs): fix restarted filesystems: mf_fo must be initialized even for them, otherwise we lose opt_sublink (and perhaps other options as well). Report from Rainer Orth. * amd/amfs_generic.c (amfs_bgmount): The fix for the mf_fo NULL pointer dereferencing was a bit too aggressive and could end up not processing the sublink option if the filesystem was already mounted. 2003-10-11 Ion Badulescu Fix restarted filesystem by disabling the amfs_inherit filesystem and moving the restarting logic into the generic code. The old code is still there, will be removed sometime in the near future. * amd/mntfs.c (locate_mntfs): disable amfs_inherit and simply return the pointer to the restarted filesystem (free_mntfs): check for the MFF_RESTART flag instead of the amfs_inherit ops * amd/autil.c (mf_mounted): remove the MFF_RESTART flag once the filesystem is in use * amd/amfs_nfsx.c (amfs_nfsx_init): only call fs_init() if the filesystem is not being restarted (amfs_nfsx_remount): if the filesystem is already mounted, short-circuit the code and just continue * amd/amfs_generic.c (amfs_bgmount): only call fs_init() if the filesystem is not being restarted; remove hack that was used to work around an amfs_inherit problem 2003-10-09 Rainer Orth Use WebNFS to obtain file handles for mount(2). * NEWS: Document WebNFS support. * configure.in: Check for public mount option. * include/am_compat.h (MNTTAB_OPT_PUBLIC): Define if missing. * doc/am-utils.texi (opts Option): Renamed webnfs to public, update description. * amd/amd.h (FSF_WEBNFS): New mntfs flag. * include/am_utils.h (RPC_XID_WEBNFS): New XID type. * amd/amfs_host.c (amfs_host_mount, amfs_host_umounted): Reject WebNFS mount/umount attempts. * amd/ops_nfs.c (got_nfs_fh_mount): Renamed from got_nfs_fh. (got_nfs_fh_webnfs): New function. (flush_nfs_fhandle_cache): Don't invalidate port for WebNFS servers. (prime_nfs_fhandle_cache): Likewise. Remove unconditional return of public file handle for WebNFS, but get NFS file handles via mountd or WebNFS instead. (webnfs_lookup): New function. (nfs_umounted): Don't inform mountd if MFF_WEBNFS. * amd/rpc_fwd.c (fwd_packet, fwd_reply): Send/receive WebNFS packets. * amd/srvr_nfs.c (recompute_portmap): Don't contact portmap for WebNFS servers. Mention host in info message. (find_nfs_srvr): Handle public mount option. Prefer NFSv3/tcp if the client supports it. Allow port mount option to override default or result from portmap lookup. * libamu/xdr_func.c (xdr_diropargs3, xdr_filename3, xdr_LOOKUP3args, xdr_LOOKUP3res, xdr_LOOKUP3resfail, xdr_LOOKUP3resok, xdr_nfs_fh3, xdr_nfsstat3): New functions. * include/am_xdr_func.h: Declare them. * configure.in: Check for them. * conf/nfs_prot/nfs_prot_linux.h: Provide missing NFSv3 definitions and types. 2003-10-09 Rainer Orth Support IRIX 6 private mount option. * configure.in (AC_CHECK_MNTTAB_OPTS): Check for private option name string. (AC_CHECK_MNT2_NFS_OPTS): Check for private NFS mount option (IRIX 6). * aux/macros/header_templates.m4 (MNTTAB_OPT_PRIVATE, MNT2_NFS_OPT_PRIVATE): Provide templates. * include/am_compat.h (MNTTAB_OPT_PRIVATE): Define if missing. * doc/am-utils.texi (opts Option): Document it. 2003-10-09 Rainer Orth * doc/am-utils.texi (opts Option): Fix Tru64 UNIX name in proplist mount option. 2003-10-09 Rainer Orth * libamu/mount_fs.c (compute_nfs_args) [HAVE_NFS_ARGS_T_FH_LEN]: Don't reference removed fh3. 2003-10-09 Rainer Orth * NEWS: New minor port sparc-sun-solaris2.10 (Solaris 10). * INSTALL: Mention test status of various ports. Describe IRIX 6 autofs status. 2003-10-09 Ion Badulescu * NEWS: updated * amd/amfs_generic.c (amfs_bgmount): don't use mf_fo until after we've done all the tests and we know we have a valid and mountable mntfs. Otherwise we could end up dereferencing null pointers. * amd/amd.h: fixed a copy&paste comment bug * amd/am_ops.c (ops_match): minor code cleanup * doc/am-utils.texi: fixed various typos; added warning about the racy nature of nfsx; removed duplicated listing of debug options; added paragraph about signals supported by hlfsd; removed the long list of (maybe) supported platforms since it duplicates the list in INSTALL. 2003-10-02 Rainer Orth Simplify FD_SET etc. use. * include/am_defs.h (FD_SET, FD_ISSET, FD_CLR, FD_ZERO): Provide if missing. (rpc_pending_now, run_rpc): Use them. * configure.in: Check for fds_bits field in fd_set. * amd/nfs_start.c (run_rpc): Use it. 2003-10-02 Rainer Orth Improve RPC XID handling. * amd/rpc_fwd.c (fwd_packet, fwd_reply): Always log xid. Convert xid to/from host/network byte order. 2003-10-02 Rainer Orth Use NFS V2/V3 file handles instead of mount results. * include/am_utils.h (am_nfs_fhandle): Use NFS V2/V3 file handles only, not MOUNTPROC_MNT results. * amd/amfs_host.c (fetch_fhandle): Use local variables to store MOUNTPROC_MNT results. * amd/autil.c (amfs_mount): Use new am_nfs_fhandle_t. * amd/ops_nfs.c (struct fh_cache): New member fh_status. (got_nfs_fh): Use local variables to store MOUNTPROC_MNT results. Store MOUNTPROC_MNT errors in fh_status. (prime_nfs_fhandle_cache): Get fh_error from fh_status. * hlfsd/hlfsd.c (main): Use new am_nfs_fhandle_t. * libamu/mount_fs.c (compute_nfs_args): Copy NFS V2/V3 file handles straight from new am_nfs_fhandle_t. 2003-10-02 Rainer Orth * amd/clock.c (CID_ALLOC): Remove unused argument. (timeout): Likewise. * amd/ops_nfs.c (FHID_ALLOC): Remove unused argument. (prime_nfs_fhandle_cache): Likewise. (call_mountd): Use UDPMSGSIZE instead of magic constant. * amd/rpc_fwd.c (XID_ALLOC): Remove unused argument. (fwd_packet): Likewise. Handle TLOOK error from t_rcvudata(). 2003-09-30 Ion Badulescu * NEWS: updated * libamu/mount_fs.c (mount_fs): don't try to recreate the mount point if the mount fails with ENOENT: in the best case we would be papering over a bug, and in the worst case we could cause a deadlock (with autofs). If there are races, they need to be exposed and fixed properly. * conf/autofs/autofs_solaris_v1.h, conf/autofs/autofs_solaris_v2_v3.h, conf/autofs/autofs_linux.h: (AUTOFS_NFSX_FS_FLAGS): autofs semantics don't allow us to mount nfsx directly onto an autofs mountpoint, so disallow it * amd/amfs_nfsx.c (amfs_nfsx_match): more restrictive sanity check to avoid trying to memmove(foo, bar, (unsigned)-1) due to invalid map entries... (amfs_nfsx_cont): amfs_retry does most of the cleanup work for us in the upper layer, so don't do anything else beside wakeup() on success (amfs_nfsx_remount): only create the mountpoints as we need them, avoids creating them on the wrong filesystem in the case of hierarchical mounts; fix crash-generating typo (m should really be mf and I swear I hate single-character variable names) * amd/amfs_generic.c (amfs_cont): one more dlog (amfs_bgmount): amazingly enough, even foreground mounts can be backgrounded (in the case of nfsx), so account for this possibility and permit retries * m4/macros/check_autofs_style.m4 (AMU_AUTOFS_PROT_HEADER): define and AC_SUBST it as ${top_builddir}/amu_autofs_prot.h * amd/Makefile.am ($(amd_OBJECTS) $(EXTRA_amd_OBJECTS)): depend on @AMU_AUTOFS_PROT_HEADER@ 2003-09-29 Erez Zadok * minor new port mipsel-unknown-linux-rhPS2 (Linux on Sony PlayStation 2) * amd/srvr_nfs.c (find_nfs_srvr): don't run code that expects "char protocols[]" unless MNTTAB_OPT_PROTO is defined. 2003-09-26 Rainer Orth Consolidate alloca support. * amd/amq_svc.c: Move alloca support ... * include/am_defs.h: ... here. * amd/conf_parse.y: Remove alloca support. * fsinfo/fsi_gram.y: Likewise. 2003-09-25 Rainer Orth Handle Solaris 10. * m4/macros/check_nfs_prot_headers.m4 (AMU_CHECK_NFS_PROT_HEADERS): Don't use wildcards for sunos5.[0-3], solaris 2.[0-3], there were no micro releases. Explicitly match sunos5*, solaris2* for Solaris 8 and beyond. * m4/macros/os_cflags.m4 (AMU_OS_CFLAGS): Dont use wildcards for solaris2.[0-5], sunos5.[0-5], but explicitly handle Solaris 2.5 micro releases to cope with Solaris 2.5.1. Explicitly match solaris2*, sunos5*. 2003-09-25 Rainer Orth * amd/amq_svc.c: Provide alloca prerequisites. * conf/transp/transp_tli.c (register_autofs_service): Fix typo. 2003-09-23 Ion Badulescu * minor new port: x86_64-unknown-linux-rh2.9.5AS. (Red Hat Enterprise Linux 3.0 beta running on a 64-bit AMD64 platform) 2003-09-22 Ion Badulescu * conf/autofs/autofs_solaris_v1.c (autofs_mount_fs): compile fix 2003-09-19 Ion Badulescu * amd/amfs_nfsl.c (amfs_nfsl_match): checking opt_fs is not always eno