From: Erez Zadok Date: Sun, 7 Aug 2005 01:37:26 +0000 (+0000) Subject: * m4/macros/header_templates.m4: template for HAVE_MAP_SUN. X-Git-Tag: before-clocktime-fixes~46 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=882118a2c3bc488bd59f5f7d44d926d104431921;p=am-utils-6.0.git * 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). --- diff --git a/ChangeLog b/ChangeLog index 2d0c92c..dd9d167 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2005-08-06 Erez Zadok + * 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 diff --git a/amd/Makefile.am b/amd/Makefile.am index 49a0d09..4780f95 100644 --- a/amd/Makefile.am +++ b/amd/Makefile.am @@ -79,6 +79,7 @@ EXTRA_amd_SOURCES = \ info_nis.c \ info_nisplus.c \ info_passwd.c \ + info_sun.c \ info_union.c \ \ ops_cachefs.c \ diff --git a/amd/info_sun.c b/amd/info_sun.c new file mode 100644 index 0000000..5d4b644 --- /dev/null +++ b/amd/info_sun.c @@ -0,0 +1,57 @@ +/* + * 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 +#endif /* HAVE_CONFIG_H */ +#include +#include +#include + + +/* XXX: just a placeholder. fill in */ diff --git a/amd/mapc.c b/amd/mapc.c index 00d9bf5..f95412c 100644 --- a/amd/mapc.c +++ b/amd/mapc.c @@ -198,12 +198,6 @@ extern int ndbm_search(mnt_map *, char *, char *, char **, time_t *); 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 *); @@ -211,6 +205,16 @@ extern int file_reload(mnt_map *, char *, add_fn *); 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[] = @@ -323,6 +327,18 @@ 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, diff --git a/configure.in b/configure.in index d365368..9f9f132 100644 --- a/configure.in +++ b/configure.in @@ -55,7 +55,7 @@ AH_BOTTOM([ 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 ***) @@ -870,6 +870,7 @@ AC_MSG_NOTICE(*** MAP 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" diff --git a/m4/macros/header_templates.m4 b/m4/macros/header_templates.m4 index f2f3df5..458905d 100644 --- a/m4/macros/header_templates.m4 +++ b/m4/macros/header_templates.m4 @@ -58,6 +58,9 @@ AH_TEMPLATE([HAVE_MAP_LDAP], 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])