diff --git a/INSTALL b/INSTALL index d2b030b8c..b0a658d48 100644 --- a/INSTALL +++ b/INSTALL @@ -55,11 +55,11 @@ For most systems and configurations it is possible simply to: install-doc, and install-sudoers make targets. 6) Edit the sudoers file with `visudo' as necessary for your - site. You will probably want to refer the sample.sudoers + site. You will probably want to refer the example sudoers file and sudoers man page included with the sudo package. 7) If you want to use syslogd(8) to do the logging, you'll need - to update your /etc/syslog.conf file. See the sample.syslog.conf + to update your /etc/syslog.conf file. See the example syslog.conf file included in the distribution for an example. Available configure options @@ -425,8 +425,8 @@ Authentication options: Linux, Solaris and HP-UX (version 11 and higher). NOTE: on RedHat Linux and Fedora you *must* have an /etc/pam.d/sudo - file install. You may either use the sample.pam file included with - sudo or use /etc/pam.d/su as a reference. The sample.pam file + file install. You may either use the example pam.conf file included + with sudo or use /etc/pam.d/su as a reference. The pam.conf file included with sudo may or may not work with other Linux distributions. On Solaris and HP-UX 11 systems you should check (and understand) the contents of /etc/pam.conf. Do a "man pam.conf" for more @@ -676,7 +676,7 @@ Options that set runtime-changeable default values: How you want to do your logging. You may choose "syslog", "file", or "both". Setting this to "syslog" is nice because you can keep all of your sudo logs in one place (see the - sample.syslog.conf file). The default is "syslog". + example syslog.conf file). The default is "syslog". Sudoers options: syslog and logfile --with-loglen=NUMBER diff --git a/MANIFEST b/MANIFEST index 5a86b20b7..9e804dbbe 100644 --- a/MANIFEST +++ b/MANIFEST @@ -21,10 +21,6 @@ doc/TROUBLESHOOTING doc/UPGRADE doc/fixman.sh doc/fixmdoc.sh -doc/sample.pam -doc/sample.sudo.conf -doc/sample.sudoers -doc/sample.syslog.conf doc/schema.ActiveDirectory doc/schema.OpenLDAP doc/schema.iPlanet @@ -49,6 +45,11 @@ doc/sudoreplay.mdoc.in doc/visudo.cat doc/visudo.man.in doc/visudo.mdoc.in +examples/Makefile.in +examples/pam.conf +examples/sudo.conf +examples/sudoers +examples/syslog.conf include/Makefile.in include/compat/charclass.h include/compat/endian.h diff --git a/Makefile.in b/Makefile.in index a5aa1633f..d48d543d1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -32,6 +32,7 @@ datarootdir = @datarootdir@ localedir = @localedir@ localstatedir = @localstatedir@ docdir = @docdir@ +exampledir = $(datarootdir)/examples/$(PACKAGE_TARNAME) mandir = @mandir@ rundir = @rundir@ vardir = @vardir@ @@ -48,7 +49,7 @@ sudoers_mode = @SUDOERS_MODE@ shlib_mode = @SHLIB_MODE@ SUBDIRS = lib/util @ZLIB_SRC@ plugins/group_file plugins/sudoers \ - plugins/system_group src include doc + plugins/system_group src include doc examples SAMPLES = plugins/sample @@ -306,6 +307,7 @@ package: sudo.pp mandir=$(mandir) \ localedir=$(localedir) \ docdir=$(docdir) \ + exampledir=$(exampledir) \ sysconfdir=$(sysconfdir) \ sudoersdir=$(sudoersdir) \ sudoers_uid=$(sudoers_uid) \ diff --git a/configure b/configure index bcdc35d74..851532b4c 100755 --- a/configure +++ b/configure @@ -23204,7 +23204,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 doc/Makefile include/Makefile init.d/aix.sh init.d/hpux.sh lib/util/Makefile lib/util/util.exp src/sudo_usage.h src/Makefile plugins/sample/Makefile plugins/group_file/Makefile plugins/system_group/Makefile plugins/sudoers/Makefile plugins/sudoers/sudoers" +ac_config_files="$ac_config_files Makefile doc/Makefile examples/Makefile include/Makefile init.d/aix.sh init.d/hpux.sh lib/util/Makefile lib/util/util.exp 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 @@ -24193,6 +24193,7 @@ do "lib/zlib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/zlib/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "init.d/aix.sh") CONFIG_FILES="$CONFIG_FILES init.d/aix.sh" ;; "init.d/hpux.sh") CONFIG_FILES="$CONFIG_FILES init.d/hpux.sh" ;; @@ -25288,8 +25289,8 @@ $as_echo "$as_me: sudo session required libpam_hpsec.so.1 bypass_umask bypass_la fi ;; linux*) - { $as_echo "$as_me:${as_lineno-$LINENO}: You will need to customize sample.pam and install it as /etc/pam.d/sudo" >&5 -$as_echo "$as_me: You will need to customize sample.pam and install it as /etc/pam.d/sudo" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: You will need to customize examples/pam.conf and install it as /etc/pam.d/sudo" >&5 +$as_echo "$as_me: You will need to customize examples/pam.conf and install it as /etc/pam.d/sudo" >&6;} ;; esac fi diff --git a/configure.ac b/configure.ac index b660d89e4..67ff19439 100644 --- a/configure.ac +++ b/configure.ac @@ -4020,7 +4020,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 doc/Makefile include/Makefile init.d/aix.sh init.d/hpux.sh lib/util/Makefile lib/util/util.exp src/sudo_usage.h src/Makefile plugins/sample/Makefile plugins/group_file/Makefile plugins/system_group/Makefile plugins/sudoers/Makefile plugins/sudoers/sudoers]) +AC_CONFIG_FILES([Makefile doc/Makefile examples/Makefile include/Makefile init.d/aix.sh init.d/hpux.sh lib/util/Makefile lib/util/util.exp 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 @@ -4035,7 +4035,7 @@ if test "$with_pam" = "yes"; then fi ;; linux*) - AC_MSG_NOTICE([You will need to customize sample.pam and install it as /etc/pam.d/sudo]) + AC_MSG_NOTICE([You will need to customize examples/pam.conf and install it as /etc/pam.d/sudo]) ;; esac fi diff --git a/doc/Makefile.in b/doc/Makefile.in index 93d83b686..9599015f0 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -23,7 +23,6 @@ srcdir = @srcdir@ docdir = @docdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -cross_compiling = @CROSS_COMPILING@ # Tools to use SED = @SED@ @@ -84,9 +83,8 @@ DEVDOCS = $(srcdir)/sudo.man.in $(srcdir)/sudo.cat \ OTHER_DOCS = $(top_srcdir)/ChangeLog $(top_srcdir)/README \ $(top_srcdir)/NEWS $(srcdir)/HISTORY $(srcdir)/CONTRIBUTORS \ - $(srcdir)/LICENSE $(srcdir)/TROUBLESHOOTING $(srcdir)/UPGRADE \ - $(srcdir)/sample.* - + $(srcdir)/LICENSE $(srcdir)/TROUBLESHOOTING $(srcdir)/UPGRADE + OTHER_DOCS_LDAP = $(top_srcdir)/README.LDAP $(srcdir)/schema.* VERSION = @PACKAGE_VERSION@ diff --git a/doc/TROUBLESHOOTING b/doc/TROUBLESHOOTING index cb7ac7b25..1f2e7fbff 100644 --- a/doc/TROUBLESHOOTING +++ b/doc/TROUBLESHOOTING @@ -42,9 +42,9 @@ A) The owner and permissions on the sudo binary appear to be OK but when Q) Sudo never gives me a chance to enter a password using PAM, it just says 'Sorry, try again.' three times and exits. A) You didn't setup PAM to work with sudo. On RedHat Linux or Fedora - Core this generally means installing sample.pam as /etc/pam.d/sudo. - See the sample.pam file for hints on what to use for other Linux - systems. + Core this generally means installing the sample pam.conf file as + /etc/pam.d/sudo. See the example pam.conf file for hints on what + to use for other Linux systems. Q) Sudo says 'Account expired or PAM config lacks an "account" section for sudo, contact your system administrator' and exits @@ -57,7 +57,7 @@ A) Your PAM config lacks an "account" specification. On Linux this Q) Sudo is setup to log via syslog(3) but I'm not getting any log messages. A) Make sure you have an entry in your syslog.conf file to save - the sudo messages (see the sample.syslog.conf file). The default + the sudo messages (see the example syslog.conf file). The default log facility is authpriv (changeable via configure or in sudoers). Don't forget to send a SIGHUP to your syslogd so that it re-reads its conf file. Also, remember that syslogd does *not* create @@ -143,7 +143,7 @@ A) Sudo removes the following "dangerous" environment variables Q) How can I keep sudo from asking for a password? A) To specify this on a per-user (and per-command) basis, use the 'NOPASSWD' tag right before the command list in sudoers. See - the sudoers man page and sample.sudoers for details. To disable + the sudoers man page and examples/sudoers for details. To disable passwords completely, add !authenticate" to the Defaults line in /etc/sudoers. You can also turn off authentication on a per-user or per-host basis using a user or host-specific Defaults diff --git a/doc/UPGRADE b/doc/UPGRADE index 026faaeac..7d3dc1c0b 100644 --- a/doc/UPGRADE +++ b/doc/UPGRADE @@ -128,9 +128,9 @@ o Upgrading from a version prior to 1.8.0: The sudo.conf file, usually stored in /etc, is used to configure plugins. This file is optional--if no plugins are specified - in sudo.conf, the "sudoers" plugin is used. See the sample.sudo.conf - file in the doc directory or refer to the updated sudo manual - to see how to configure sudo.conf. + in sudo.conf, the "sudoers" plugin is used. See the example + sudo.conf file in the doc directory or refer to the updated + sudo manual to see how to configure sudo.conf. The "askpass" setting has moved from the sudoers file to the sudo.conf file. If you have a sudoers file that uses the diff --git a/examples/Makefile.in b/examples/Makefile.in new file mode 100644 index 000000000..7ef45c621 --- /dev/null +++ b/examples/Makefile.in @@ -0,0 +1,94 @@ +# +# Copyright (c) 2014 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 +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# @configure_input@ +# + +#### Start of system configuration section. #### + +srcdir = @srcdir@ +exampledir = $(datarootdir)/examples/$(PACKAGE_TARNAME) +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Our install program supports extra flags... +INSTALL = $(SHELL) $(top_srcdir)/install-sh -c +INSTALL_OWNER = -o $(install_uid) -g $(install_gid) + +# Where to install things... +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +sbindir = @sbindir@ +sysconfdir = @sysconfdir@ +libexecdir = @libexecdir@ +datarootdir = @datarootdir@ +localstatedir = @localstatedir@ + +# User and group ids the installed files should be "owned" by +install_uid = 0 +install_gid = 0 + +#### End of system configuration section. #### + +SHELL = @SHELL@ + +EXAMPLES = $(srcdir)/pam.conf $(srcdir)/sudo.conf $(srcdir)/sudoers \ + $(srcdir)/syslog.conf + +VERSION = @PACKAGE_VERSION@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ + +all: $(EXAMPLES) + +Makefile: $(srcdir)/Makefile.in + (cd $(top_builddir) && ./config.status --file examples/Makefile) + +pre-install: + +install: install-doc + +install-dirs: + $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(exampledir) + +install-binaries: + +install-includes: + +install-doc: install-dirs + for f in $(EXAMPLES); do $(INSTALL) $(INSTALL_OWNER) -m 0644 $$f $(DESTDIR)$(exampledir); done + +install-plugin: + +uninstall: + -rm -rf $(DESTDIR)$(exampledir) + +cppcheck: + +check: + +clean: + +mostlyclean: clean + +distclean: clean + -rm -rf Makefile + +clobber: distclean + +realclean: distclean + +cleandir: distclean diff --git a/doc/sample.pam b/examples/pam.conf similarity index 100% rename from doc/sample.pam rename to examples/pam.conf diff --git a/doc/sample.sudo.conf b/examples/sudo.conf similarity index 100% rename from doc/sample.sudo.conf rename to examples/sudo.conf diff --git a/doc/sample.sudoers b/examples/sudoers similarity index 100% rename from doc/sample.sudoers rename to examples/sudoers diff --git a/doc/sample.syslog.conf b/examples/syslog.conf similarity index 100% rename from doc/sample.syslog.conf rename to examples/syslog.conf diff --git a/sudo.pp b/sudo.pp index fd9600cdd..5a29314f6 100644 --- a/sudo.pp +++ b/sudo.pp @@ -279,6 +279,8 @@ still allow people to get their work done." $docdir/ChangeLog ignore,ignore-others %endif $docdir/* 0644 + $exampledir/ 0755 + $exampledir/* 0644 $localedir/*/ - optional $localedir/*/LC_MESSAGES/ - optional $localedir/*/LC_MESSAGES/* 0644 optional