* 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.
* Kevin Layer <layer@franz.com>
January 28, 2005: basic instructions how to setup Amd on Mac OS-X.
+
+* Dan Ottavio <dottavio@ic.sunysb.edu>
+March 2, 2005: new global amd.conf option debug_mtab_file, to set the debug
+mtab file when using debug_options=mtab. Default has changed from "./mtab"
+to "/tmp/mtab" to avoid security problem. Bug fixed to ensure that Amd
+terminates properly even mtab file doesn't exist.
+2005-03-02 Daniel P. Ottavio <dottavio@ic.sunysb.edu>
+
+ * 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 <ezk@cs.sunysb.edu>
* conf/transp/transp_{sockets,tli}.c (amu_get_myaddress): when
the UDP+TCP port that Amd's amq service will use with the RPC portmapper.
Useful with firewalls and NAT'ed environments.
+- new amd.conf option "debug_mtab_file". Allows user to define the mtab
+ file during debug-mtab mode. The default path is "/tmp/mnttab".
+
- new function selector xhost(ARG) which will match ARG against the current
host name. This works even if ARG is a CNAME (unlike the host==ARG
selector).
* don't warn when couldn't rmdir a dir with a readonly ancestor.
* avoid hangs of amd in ctl-amd (must chdir to /)
* workaround occasional daemonizing problems (parent won't die)
+ * don't hang on exit if debug_options=mtab was used
*** Notes specific to am-utils version 6.1b4
* SUCH DAMAGE.
*
*
- * $Id: amd.h,v 1.59 2005/03/02 03:00:09 ezk Exp $
+ * $Id: amd.h,v 1.60 2005/03/04 18:42:43 ezk Exp $
*
*/
* MACROS:
*/
+/*
+ * Define a default debug mtab path for systems
+ * that support mtab on file.
+ */
+#ifdef MOUNT_TABLE_ON_FILE
+# define DEBUG_MNTTAB_FILE "/tmp/mnttab"
+#endif
+
/* options for amd.conf */
#define CFM_BROWSABLE_DIRS 0x0001
#define CFM_MOUNT_TYPE_AUTOFS 0x0002 /* use kernel autofs support */
char *map_type; /* global map type */
char *search_path; /* search path for maps */
char *mount_type; /* mount type for map */
+ char *debug_mtab_file; /* path for the mtab file during debug mode */
u_int flags; /* various CFM_* flags */
#define AMU_TYPE_UDP 0 /* for amfs_auto_{retrans,timeo} */
* SUCH DAMAGE.
*
*
- * $Id: conf.c,v 1.29 2005/02/23 03:59:08 ezk Exp $
+ * $Id: conf.c,v 1.30 2005/03/04 18:42:43 ezk Exp $
*
*/
static int gopt_browsable_dirs(const char *val);
static int gopt_cache_duration(const char *val);
static int gopt_cluster(const char *val);
+static int gopt_debug_mtab_file(const char *val);
static int gopt_debug_options(const char *val);
static int gopt_dismount_interval(const char *val);
static int gopt_domain_strip(const char *val);
{"browsable_dirs", gopt_browsable_dirs},
{"cache_duration", gopt_cache_duration},
{"cluster", gopt_cluster},
+ {"debug_mtab_file", gopt_debug_mtab_file},
{"debug_options", gopt_debug_options},
{"dismount_interval", gopt_dismount_interval},
{"domain_strip", gopt_domain_strip},
}
+static int
+gopt_debug_mtab_file(const char *val)
+{
+ gopt.debug_mtab_file = strdup((char*)val);
+ return 0;
+}
+
+
static int
gopt_debug_options(const char *val)
{
* SUCH DAMAGE.
*
*
- * $Id: get_args.c,v 1.27 2005/02/17 21:32:05 ezk Exp $
+ * $Id: get_args.c,v 1.28 2005/03/04 18:42:43 ezk Exp $
*
*/
#ifdef MOUNT_TABLE_ON_FILE
if (amuDebug(D_MTAB))
- mnttab_file_name = DEBUG_MNTTAB;
+ if(gopt.debug_mtab_file)
+ mnttab_file_name = gopt.debug_mtab_file; /* user supplied debug mtab path */
+ else
+ mnttab_file_name = DEBUG_MNTTAB_FILE; /* default debug mtab path */
else
mnttab_file_name = MNTTAB_FILE_NAME;
#else /* not MOUNT_TABLE_ON_FILE */
* SUCH DAMAGE.
*
*
- * $Id: mtab_file.c,v 1.14 2005/01/03 20:56:45 ezk Exp $
+ * $Id: mtab_file.c,v 1.15 2005/03/04 18:42:43 ezk Exp $
*
*/
sleep(1);
goto again;
}
- return 0;
+ /*
+ * If 'mnttabname' file does not exist give setmntent() a
+ * chance to create it (depending on the mode).
+ * Otherwise, bail out.
+ */
+ else if (errno != ENOENT) {
+ return 0;
+ }
}
eacces:
* SUCH DAMAGE.
*
*
- * $Id: mtab_mach3.c,v 1.12 2005/01/03 20:56:45 ezk Exp $
+ * $Id: mtab_mach3.c,v 1.13 2005/03/04 18:42:43 ezk Exp $
*
*/
sleep(1);
goto again;
}
- return 0;
+ /*
+ * If 'mnttabname' file does not exist give setmntent() a
+ * chance to create it (depending on the mode).
+ * Otherwise, bail out.
+ */
+ else if (errno != ENOENT) {
+ return 0;
+ }
}
eacces:
mfp = setmntent(mnttabname, mode);
@c
@c %W% (Berkeley) %G%
@c
-@c $Id: am-utils.texi,v 1.96 2005/03/02 03:00:09 ezk Exp $
+@c $Id: am-utils.texi,v 1.97 2005/03/04 18:42:43 ezk Exp $
@c
@setfilename am-utils.info
* auto_dir Parameter::
* cache_duration Parameter::
* cluster Parameter::
+* debug_mtab_file Parameter::
* debug_options Parameter::
* dismount_interval Parameter::
* domain_strip Parameter::
in the cache.
@c ----------------------------------------------------------------
-@node cluster Parameter, debug_options Parameter, cache_duration Parameter, Global Parameters
+@node cluster Parameter, debug_mtab_file Parameter, cache_duration Parameter, Global Parameters
@comment node-name, next, previous, up
@subsection @t{cluster} Parameter
@cindex cluster Parameter
(type=string, default no cluster). Same as the @code{-C} option to
@i{Amd}. Specifies the alternate HP-UX cluster to use.
+@c ----------------------------------------------------------------
+@node debug_mtab_file Parameter, debug_options Parameter, cluster Parameter, Global Parameters
+@comment node-name, next, previous, up
+@subsection @t{debug_mtab_file} Parameter
+@cindex debug_mtab_file Parameter
+
+(type=string, default="/tmp/mnttab"). Path to mtab file that is used
+by @i{Amd} to store a list of mounted file systems during debug-mtab mode.
+This option only applies to systems that store mtab information on disk.
+
@c ----------------------------------------------------------------
-@node debug_options Parameter, dismount_interval Parameter, cluster Parameter, Global Parameters
+@node debug_options Parameter, dismount_interval Parameter, debug_mtab_file Parameter, Global Parameters
@comment node-name, next, previous, up
@subsection @t{debug_options} Parameter
@cindex debug_options Parameter
@i{Amd}. Specify in seconds, the time between attempts to dismount file
systems that have exceeded their cached times.
-
@c ----------------------------------------------------------------
@node domain_strip Parameter, full_os Parameter, dismount_interval Parameter, Global Parameters
@comment node-name, next, previous, up
* SUCH DAMAGE.
*
*
- * $Id: am_utils.h,v 1.61 2005/03/02 03:00:09 ezk Exp $
+ * $Id: am_utils.h,v 1.62 2005/03/04 18:42:43 ezk Exp $
*
*/
* DEBUGGING:
*/
-/* debugging mount-table file to use */
-#ifndef DEBUG_MNTTAB
-# define DEBUG_MNTTAB "./mnttab"
-#endif /* not DEBUG_MNTTAB */
-
#ifdef DEBUG
# define D_ALL (~(D_MTAB|D_HRTIME|D_XDRTRACE|D_DAEMON|D_FORK|D_AMQ))
# (amd -D)
debug_options = all,amq,daemon,fork,full,hrtime,info,mem,mtab,\
str,readdir,test,trace,xdrtrace
+# path for mtab file during mtab debug mode
+debug_mtab_file = /tmp/mnttab
# (amd -S)
plock = yes | no
# selectors are not recognized by default in the /defaults entry
.\"
.\" %W% (Berkeley) %G%
.\"
-.\" $Id: amd.conf.5,v 1.33 2005/02/23 03:59:09 ezk Exp $
+.\" $Id: amd.conf.5,v 1.34 2005/03/04 18:42:43 ezk Exp $
.\"
.TH AMD.CONF 5 "7 August 1997"
.SH NAME
.B \-C
option to amd. Specifies the alternate HP-UX cluster to use.
+.TP
+.BR debug_mtab_file " (string, default=/tmp/mnttab)"
+Path to mtab file that is used by Amd to store a list of mounted
+file systems during debug-mtab mode. This option only applies
+to systems that store mtab information on disk.
+.TP
+
.TP
.BR debug_options " (string, default no debug options)"
Same as the