2005-08-06 Erez Zadok <ezk@cs.sunysb.edu>
+ * 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
info_nis.c \
info_nisplus.c \
info_passwd.c \
+ info_sun.c \
info_union.c \
\
ops_cachefs.c \
--- /dev/null
+/*
+ * Copyright (c) 1997-2005 Erez Zadok
+ * Copyright (c) 1990 Jan-Simon Pendry
+ * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Jan-Simon Pendry at Imperial College, London.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgment:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *
+ * File: am-utils/amd/info_sun.c
+ *
+ */
+
+/*
+ * Get info from Sun automount-style /etc/auto_master, possibly following
+ * into multiple info services (via /etc/nsswitch.conf).
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif /* HAVE_CONFIG_H */
+#include <am_defs.h>
+#include <amd.h>
+#include <sun_map.h>
+
+
+/* XXX: just a placeholder. fill in */
extern int ndbm_mtime(mnt_map *, char *, time_t *);
#endif /* HAVE_MAP_NDBM */
-/* EXECUTABLE MAPS */
-#ifdef HAVE_MAP_EXEC
-extern int exec_init(mnt_map *, char *, time_t *);
-extern int exec_search(mnt_map *, char *, char *, char **, time_t *);
-#endif /* HAVE_MAP_EXEC */
-
/* FILE MAPS */
#ifdef HAVE_MAP_FILE
extern int file_init_or_mtime(mnt_map *, char *, time_t *);
extern int file_search(mnt_map *, char *, char *, char **, time_t *);
#endif /* HAVE_MAP_FILE */
+/* EXECUTABLE MAPS */
+#ifdef HAVE_MAP_EXEC
+extern int exec_init(mnt_map *, char *, time_t *);
+extern int exec_search(mnt_map *, char *, char *, char **, time_t *);
+#endif /* HAVE_MAP_EXEC */
+
+/* Sun-syntax MAPS */
+#ifdef HAVE_MAP_SUN
+/* XXX: fill in */
+#endif /* HAVE_MAP_SUN */
/* note that the choice of MAPC_{INC,ALL} will affect browsable_dirs */
static map_type maptypes[] =
MAPC_INC
},
#endif /* HAVE_MAP_EXEC */
+#ifdef HAVE_MAP_SUN
+ {
+ /* XXX: fill in */
+ "sun",
+ NULL,
+ NULL,
+ NULL, /* isup function */
+ NULL,
+ NULL,
+ 0
+ },
+#endif /* HAVE_MAP_SUN */
{
"error",
error_init,
dnl
dnl AC_CONFIG_AUX_DIR(m4)
AC_PREREQ(2.52)
-AC_REVISION($Revision: 1.108 $)
+AC_REVISION($Revision: 1.109 $)
AC_COPYRIGHT([Copyright (c) 1997-2005 Erez Zadok])
dnl find out system type
AC_MSG_NOTICE(*** SYSTEM TYPES ***)
dnl DBM is obsolete, use NDBM
dnl AMU_CHECK_MAP_FUNCS(dbminit dbmopen, dbm)
AMU_CHECK_MAP_FUNCS(fgets, file)
+AMU_CHECK_MAP_FUNCS(fgets, sun)
AMU_CHECK_MAP_FUNCS(waitpid, exec)
dnl Define HESIOD map if user wanted it, and both headers and libraries exist
if test "$with_hesiod" = "yes" && test "$ac_cv_header_hesiod_h" = "yes"
AH_TEMPLATE([HAVE_MAP_PASSWD],
[Define if have PASSWD maps])
+AH_TEMPLATE([HAVE_MAP_SUN],
+[Define if have Sun-syntax maps])
+
AH_TEMPLATE([HAVE_MAP_UNION],
[Define if have UNION maps])