From e07280eeeb76a8a2e716f0376c225869defa2d7c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 18 Feb 2013 15:32:36 -0500 Subject: [PATCH] Rename sample_group plugin to group_file. Install group_file and system_group plugins by default. --- MANIFEST | 10 +++---- Makefile.in | 23 ++++++---------- configure | 4 +-- configure.in | 2 +- doc/sudoers.cat | 2 +- doc/sudoers.man.in | 2 +- doc/sudoers.mdoc.in | 2 +- .../{sample_group => group_file}/Makefile.in | 26 +++++++++---------- .../{sample_group => group_file}/getgrent.c | 2 +- .../group_file.c} | 8 +++--- .../group_file.exp} | 0 .../plugin_test.c | 4 +-- 12 files changed, 39 insertions(+), 46 deletions(-) rename plugins/{sample_group => group_file}/Makefile.in (84%) rename plugins/{sample_group => group_file}/getgrent.c (98%) rename plugins/{sample_group/sample_group.c => group_file/group_file.c} (92%) rename plugins/{sample_group/sample_group.exp => group_file/group_file.exp} (100%) rename plugins/{sample_group => group_file}/plugin_test.c (97%) diff --git a/MANIFEST b/MANIFEST index 8aca34e0c..9818aa960 100644 --- a/MANIFEST +++ b/MANIFEST @@ -148,14 +148,14 @@ mkdep.pl mkinstalldirs mkpkg pathnames.h.in +plugins/group_file/Makefile.in +plugins/group_file/getgrent.c +plugins/group_file/group_file.c +plugins/group_file/group_file.exp +plugins/group_file/plugin_test.c plugins/sample/Makefile.in plugins/sample/sample_plugin.c plugins/sample/sample_plugin.exp -plugins/sample_group/Makefile.in -plugins/sample_group/getgrent.c -plugins/sample_group/plugin_test.c -plugins/sample_group/sample_group.c -plugins/sample_group/sample_group.exp plugins/sudoers/Makefile.in plugins/sudoers/aixcrypt.exp plugins/sudoers/alias.c diff --git a/Makefile.in b/Makefile.in index 25afe7531..bf243fb6b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2010-2011 Todd C. Miller +# Copyright (c) 2010-2013 Todd C. Miller # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -46,9 +46,8 @@ sudoers_gid = @SUDOERS_GID@ sudoers_mode = @SUDOERS_MODE@ shlib_mode = @SHLIB_MODE@ -SUBDIRS = compat common @ZLIB_SRC@ plugins/sudoers src include doc - -SAMPLES = plugins/sample plugins/sample_group plugins/system_group +SUBDIRS = compat common @ZLIB_SRC@ plugins/group_file plugins/sudoers \ + plugins/system_group src include doc VERSION = @PACKAGE_VERSION@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ @@ -77,13 +76,7 @@ XGETTEXT_OPTS = -F -k_ -kN_ --copyright-holder="Todd C. Miller" \ --flag easprintf:3:c-format --flag lbuf_append:2:c-format \ --flag lbuf_append_quoted:3:c-format --foreign-user -all: config.status - for d in $(SUBDIRS) $(SAMPLES); \ - do (cd $$d && exec $(MAKE) $@) && continue; \ - exit $$?; \ - done - -check pre-install: config.status +all check pre-install: config.status for d in $(SUBDIRS); \ do (cd $$d && exec $(MAKE) $@) && continue; \ exit $$?; \ @@ -132,14 +125,14 @@ depend: siglist.c signame.c fi; \ $(srcdir)/mkdep.pl $(srcdir)/common/Makefile.in \ $(srcdir)/compat/Makefile.in $(srcdir)/plugins/sample/Makefile.in \ - $(srcdir)/plugins/sample_group/Makefile.in \ + $(srcdir)/plugins/group_file/Makefile.in \ $(srcdir)/plugins/sudoers/Makefile.in \ $(srcdir)/plugins/system_group/Makefile.in \ $(srcdir)/src/Makefile.in $(srcdir)/zlib/Makefile.in; \ ./config.status --file $(srcdir)/common/Makefile \ --file $(srcdir)/compat/Makefile \ --file $(srcdir)/plugins/sample/Makefile \ - --file $(srcdir)/plugins/sample_group/Makefile \ + --file $(srcdir)/plugins/group_file/Makefile \ --file $(srcdir)/plugins/sudoers/Makefile \ --file $(srcdir)/plugins/system_group/Makefile \ --file $(srcdir)/src/Makefile --file $(srcdir)/zlib/Makefile @@ -297,14 +290,14 @@ package: sudo.pp version=$(VERSION) $(PPVARS) clean: config.status - for d in $(SUBDIRS) $(SAMPLES); do \ + for d in $(SUBDIRS); do \ (cd $$d && exec $(MAKE) $@); \ done mostlyclean: clean distclean: config.status - for d in $(SUBDIRS) $(SAMPLES); do \ + for d in $(SUBDIRS); do \ (cd $$d && exec $(MAKE) $@); \ done -rm -rf Makefile pathnames.h config.h config.status config.cache \ diff --git a/configure b/configure index caf0c8723..ae1472996 100755 --- a/configure +++ b/configure @@ -21206,7 +21206,7 @@ test "$localedir" = '${datarootdir}/locale' && localedir='$(datarootdir)/locale' test "$localstatedir" = '${prefix}/var' && localstatedir='$(prefix)/var' test "$sysconfdir" = '${prefix}/etc' -a X"$with_stow" != X"yes" && sysconfdir='/etc' -ac_config_files="$ac_config_files Makefile common/Makefile compat/Makefile doc/Makefile include/Makefile src/sudo_usage.h src/Makefile plugins/sample/Makefile plugins/sample_group/Makefile plugins/system_group/Makefile plugins/sudoers/Makefile plugins/sudoers/sudoers" +ac_config_files="$ac_config_files Makefile common/Makefile compat/Makefile doc/Makefile include/Makefile src/sudo_usage.h src/Makefile plugins/sample/Makefile plugins/group_file/Makefile plugins/system_group/Makefile plugins/sudoers/Makefile plugins/sudoers/sudoers" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -22208,7 +22208,7 @@ do "src/sudo_usage.h") CONFIG_FILES="$CONFIG_FILES src/sudo_usage.h" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "plugins/sample/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/sample/Makefile" ;; - "plugins/sample_group/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/sample_group/Makefile" ;; + "plugins/group_file/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/group_file/Makefile" ;; "plugins/system_group/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/system_group/Makefile" ;; "plugins/sudoers/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/sudoers/Makefile" ;; "plugins/sudoers/sudoers") CONFIG_FILES="$CONFIG_FILES plugins/sudoers/sudoers" ;; diff --git a/configure.in b/configure.in index 83bb5d643..510f5fa3e 100644 --- a/configure.in +++ b/configure.in @@ -3618,7 +3618,7 @@ test "$sysconfdir" = '${prefix}/etc' -a X"$with_stow" != X"yes" && sysconfdir='/ dnl dnl Substitute into the Makefile and man pages dnl -AC_CONFIG_FILES([Makefile common/Makefile compat/Makefile doc/Makefile include/Makefile src/sudo_usage.h src/Makefile plugins/sample/Makefile plugins/sample_group/Makefile plugins/system_group/Makefile plugins/sudoers/Makefile plugins/sudoers/sudoers]) +AC_CONFIG_FILES([Makefile common/Makefile compat/Makefile doc/Makefile include/Makefile src/sudo_usage.h src/Makefile plugins/sample/Makefile plugins/group_file/Makefile plugins/system_group/Makefile plugins/sudoers/Makefile plugins/sudoers/sudoers]) AC_OUTPUT dnl diff --git a/doc/sudoers.cat b/doc/sudoers.cat index e65fb3d05..d78221f4d 100644 --- a/doc/sudoers.cat +++ b/doc/sudoers.cat @@ -1415,7 +1415,7 @@ SSUUDDOOEERRSS OOPPTTIIOONNSS For example, given _/_e_t_c_/_s_u_d_o_-_g_r_o_u_p, a group file in Unix group format, the sample group plugin can be used: - Defaults group_plugin="sample_group.so /etc/sudo-group" + Defaults group_plugin="group_file.so /etc/sudo-group" For more information see sudo_plugin(4). diff --git a/doc/sudoers.man.in b/doc/sudoers.man.in index 4329420b4..b056b0cb7 100644 --- a/doc/sudoers.man.in +++ b/doc/sudoers.man.in @@ -2941,7 +2941,7 @@ a group file in Unix group format, the sample group plugin can be used: .nf .sp .RS 0n -Defaults group_plugin="sample_group.so /etc/sudo-group" +Defaults group_plugin="group_file.so /etc/sudo-group" .RE .fi .sp diff --git a/doc/sudoers.mdoc.in b/doc/sudoers.mdoc.in index c48597ad3..f6558464a 100644 --- a/doc/sudoers.mdoc.in +++ b/doc/sudoers.mdoc.in @@ -2738,7 +2738,7 @@ For example, given .Pa /etc/sudo-group , a group file in Unix group format, the sample group plugin can be used: .Bd -literal -Defaults group_plugin="sample_group.so /etc/sudo-group" +Defaults group_plugin="group_file.so /etc/sudo-group" .Ed .Pp For more information see diff --git a/plugins/sample_group/Makefile.in b/plugins/group_file/Makefile.in similarity index 84% rename from plugins/sample_group/Makefile.in rename to plugins/group_file/Makefile.in index a65c5bb6b..e6581c5d2 100644 --- a/plugins/sample_group/Makefile.in +++ b/plugins/group_file/Makefile.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2011 Todd C. Miller +# Copyright (c) 2011, 2013 Todd C. Miller # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -69,9 +69,9 @@ plugindir = @PLUGINDIR@ # File extension, mode and map file to use for shared libraries/objects soext = @SOEXT@ shlib_mode = @SHLIB_MODE@ -shlib_exp = $(srcdir)/sample_group.exp -shlib_map = sample_group.map -shlib_opt = sample_group.opt +shlib_exp = $(srcdir)/group_file.exp +shlib_map = group_file.map +shlib_opt = group_file.opt # OS dependent defines DEFS = @OSDEFS@ @@ -80,16 +80,16 @@ DEFS = @OSDEFS@ SHELL = @SHELL@ -OBJS = sample_group.lo getgrent.lo +OBJS = group_file.lo getgrent.lo LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/ VERSION = @PACKAGE_VERSION@ -all: sample_group.la +all: group_file.la Makefile: $(srcdir)/Makefile.in - (cd $(top_builddir) && ./config.status --file plugins/sample_group/Makefile) + (cd $(top_builddir) && ./config.status --file plugins/group_file/Makefile) .SUFFIXES: .o .c .h .lo @@ -102,7 +102,7 @@ $(shlib_map): $(shlib_exp) $(shlib_opt): $(shlib_exp) @sed 's/^/+e /' $(shlib_exp) > $@ -sample_group.la: $(OBJS) $(LT_LIBS) @LT_LDDEP@ +group_file.la: $(OBJS) $(LT_LIBS) @LT_LDDEP@ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) -o $@ $(OBJS) $(LIBS) -module -avoid-version -rpath $(plugindir) pre-install: @@ -118,11 +118,11 @@ install-includes: install-doc: -install-plugin: install-dirs sample_group.la - $(INSTALL) -b~ -m $(shlib_mode) .libs/sample_group$(soext) $(DESTDIR)$(plugindir) +install-plugin: install-dirs group_file.la + $(INSTALL) -b~ -m $(shlib_mode) .libs/group_file$(soext) $(DESTDIR)$(plugindir) uninstall: - -rm -f $(DESTDIR)$(plugindir)/sample_group$(soext) + -rm -f $(DESTDIR)$(plugindir)/group_file$(soext) check: @@ -144,7 +144,7 @@ cleandir: realclean # Autogenerated dependencies, do not modify getgrent.lo: $(srcdir)/getgrent.c $(top_builddir)/config.h $(incdir)/missing.h $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/getgrent.c -sample_group.lo: $(srcdir)/sample_group.c $(top_builddir)/config.h \ +group_file.lo: $(srcdir)/group_file.c $(top_builddir)/config.h \ $(top_srcdir)/compat/stdbool.h $(incdir)/sudo_plugin.h \ $(incdir)/missing.h - $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/sample_group.c + $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(PIE_CFLAGS) $(SSP_CFLAGS) $(DEFS) $(srcdir)/group_file.c diff --git a/plugins/sample_group/getgrent.c b/plugins/group_file/getgrent.c similarity index 98% rename from plugins/sample_group/getgrent.c rename to plugins/group_file/getgrent.c index 5c7a319b6..68e004e49 100644 --- a/plugins/sample_group/getgrent.c +++ b/plugins/group_file/getgrent.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005,2008,2010-2011 Todd C. Miller + * Copyright (c) 2005,2008,2010-2013 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/plugins/sample_group/sample_group.c b/plugins/group_file/group_file.c similarity index 92% rename from plugins/sample_group/sample_group.c rename to plugins/group_file/group_file.c index 2d46693d6..77d65b68d 100644 --- a/plugins/sample_group/sample_group.c +++ b/plugins/group_file/group_file.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Todd C. Miller + * Copyright (c) 2010-2013 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -76,7 +76,7 @@ sample_init(int version, sudo_printf_t sudo_printf, char *const argv[]) if (GROUP_API_VERSION_GET_MAJOR(version) != GROUP_API_VERSION_MAJOR) { sudo_log(SUDO_CONV_ERROR_MSG, - "sample_group: incompatible major version %d, expected %d\n", + "group_file: incompatible major version %d, expected %d\n", GROUP_API_VERSION_GET_MAJOR(version), GROUP_API_VERSION_MAJOR); return -1; @@ -85,12 +85,12 @@ sample_init(int version, sudo_printf_t sudo_printf, char *const argv[]) /* Sanity check the specified group file. */ if (argv == NULL || argv[0] == NULL) { sudo_log(SUDO_CONV_ERROR_MSG, - "sample_group: path to group file not specified\n"); + "group_file: path to group file not specified\n"); return -1; } if (stat(argv[0], &sb) != 0) { sudo_log(SUDO_CONV_ERROR_MSG, - "sample_group: %s: %s\n", argv[0], strerror(errno)); + "group_file: %s: %s\n", argv[0], strerror(errno)); return -1; } if ((sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) { diff --git a/plugins/sample_group/sample_group.exp b/plugins/group_file/group_file.exp similarity index 100% rename from plugins/sample_group/sample_group.exp rename to plugins/group_file/group_file.exp diff --git a/plugins/sample_group/plugin_test.c b/plugins/group_file/plugin_test.c similarity index 97% rename from plugins/sample_group/plugin_test.c rename to plugins/group_file/plugin_test.c index a74deb1c4..cd63bffdf 100644 --- a/plugins/sample_group/plugin_test.c +++ b/plugins/group_file/plugin_test.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Todd C. Miller + * Copyright (c) 2010-2013 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) { int ch, i, found; - char *plugin = "sample_group.so"; + char *plugin = "group_file.so"; char *user, *group; struct passwd *pwd; -- 2.40.0