old sudo timestamp files at boot time.
^doc/.*\.mdoc\.sed$
^doc/varsub$
+^init.d/*.sh$
+
^pathnames\.h$
^src/sudo$
^src/sesh$
include/sudo_plugin.h
include/sudo_util.h
indent.pro
+init.d/aix.sh.in
+init.d/hpux.sh.in
install-sh
ltmain.sh
m4/ax_check_compile_flag.m4
src/net_ifs.c
src/openbsd.c
src/parse_args.c
-src/preserve_fds.c
src/po/README
src/po/cs.mo
src/po/cs.po
src/po/zh_CN.mo
src/po/zh_CN.po
src/preload.c
+src/preserve_fds.c
src/regress/ttyname/check_ttyname.c
src/selinux.c
src/sesh.c
vardir
rundir
iolog_dir
+RC_LINK
+INIT_DIR
+INIT_SCRIPT
NO_VIZ
SSP_CFLAGS
SSP_LDFLAGS
+
+
+
LT_LDDEP="\$(shlib_exp)"
NO_VIZ="-DNO_VIZ"
OS_INIT=os_init_common
+INIT_SCRIPT=
+INIT_DIR=
+RC_LINK=
CHECKSHADOW=true
shadow_defs=
RTLD_PRELOAD_VAR="LDR_PRELOAD"
fi
+ # Remove timedir on boot, AIX does not have /var/run
+ INIT_SCRIPT=aix.sh
+ INIT_DIR=/etc/rc.d/init.d
+ RC_LINK=/etc/rc.d/rc2.d/S90sudo
+
# AIX-specific functions
for ac_func in getuserattr setauthdb setrlimit64
do :
: ${mansectsu='1m'}
: ${mansectform='4'}
+ # HP-UX does not clear /var/run so we need to do it
+ INIT_SCRIPT=hpux.sh
+ INIT_DIR=/etc/rc.d/init.d
+ RC_LINK=/sbin/rc2.d/S900sudo
+
# HP-UX shared libs must be executable
SHLIB_MODE=0755
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/group_file/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 init.d/aix.sh init.d/hpux.sh 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
"compat/Makefile") CONFIG_FILES="$CONFIG_FILES compat/Makefile" ;;
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/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" ;;
"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" ;;
;;
esac
fi
-clear_rundir=0
-case $host_os in
- hpux*|aix*)
- clear_rundir=1
+case "$rundir" in
+ /var/run*)
+ clear_rundir=0
;;
*)
- case "$rundir" in
- /var/run*)
- ;;
- *)
- clear_rundir=1
- ;;
- esac
+ clear_rundir=1
;;
esac
if test $clear_rundir -eq 1; then
AC_SUBST([SSP_LDFLAGS])
AC_SUBST([SSP_CFLAGS])
AC_SUBST([NO_VIZ])
+AC_SUBST([INIT_SCRIPT])
+AC_SUBST([INIT_DIR])
+AC_SUBST([RC_LINK])
dnl
dnl Variables that get substituted in docs (not overridden by environment)
dnl
LT_LDDEP="\$(shlib_exp)"
NO_VIZ="-DNO_VIZ"
OS_INIT=os_init_common
+INIT_SCRIPT=
+INIT_DIR=
+RC_LINK=
dnl
dnl Other vaiables
RTLD_PRELOAD_VAR="LDR_PRELOAD"
fi
+ # Remove timedir on boot, AIX does not have /var/run
+ INIT_SCRIPT=aix.sh
+ INIT_DIR=/etc/rc.d/init.d
+ RC_LINK=/etc/rc.d/rc2.d/S90sudo
+
# AIX-specific functions
AC_CHECK_FUNCS(getuserattr setauthdb setrlimit64)
COMMON_OBJS="${COMMON_OBJS} aix.lo"
: ${mansectsu='1m'}
: ${mansectform='4'}
+ # HP-UX does not clear /var/run so we need to do it
+ INIT_SCRIPT=hpux.sh
+ INIT_DIR=/etc/rc.d/init.d
+ RC_LINK=/sbin/rc2.d/S900sudo
+
# HP-UX shared libs must be executable
SHLIB_MODE=0755
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/group_file/Makefile plugins/system_group/Makefile plugins/sudoers/Makefile plugins/sudoers/sudoers])
+AC_CONFIG_FILES([Makefile common/Makefile compat/Makefile doc/Makefile include/Makefile init.d/aix.sh init.d/hpux.sh 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
esac
fi
dnl
-dnl AIX and HP-UX do not clear /var/run
-dnl Also point out other non-cleared dirs
+dnl Warn user if they may need to clear rundir manually.
dnl
-clear_rundir=0
-case $host_os in
- hpux*|aix*)
- clear_rundir=1
+case "$rundir" in
+ /var/run*)
+ clear_rundir=0
;;
*)
- case "$rundir" in
- /var/run*)
- ;;
- *)
- clear_rundir=1
- ;;
- esac
+ clear_rundir=1
;;
esac
if test $clear_rundir -eq 1; then
--- /dev/null
+#!/bin/sh
+#
+# Simple AIX rc.d script to remove the sudo timestamp directory on boot.
+# This is needed because AIX does not have /var/run.
+# Install as /etc/rc.d/init.d/sudo with a link /etc/rc.d/rc2.d/S90sudo
+#
+
+PATH=/usr/sbin:/usr/bin:/sbin
+export PATH
+
+TSDIR="@rundir@/ts"
+rval=0
+
+case "$1" in
+start)
+ echo "Removing the $TSDIR directory"
+ rm -rf "$TSDIR"
+ ;;
+*)
+ echo "usage: $0 start"
+ rval=1
+ ;;
+esac
+
+exit $rval
--- /dev/null
+#!/sbin/sh
+#
+# Simple HP-UX init.d script to remove the sudo timestamp directory on boot.
+# This is needed because HP-UX does not clear /var/run on its own.
+# Install as /sbin/init.d/sudo with a link /sbin/rc2.d/S900sudo
+#
+
+PATH=/usr/sbin:/usr/bin:/sbin
+export PATH
+
+TSDIR="@rundir@/ts"
+rval=0
+
+case "$1" in
+start_msg)
+ echo "Removing the $TSDIR directory"
+ ;;
+start)
+ rm -rf "$TSDIR"
+ ;;
+*)
+ echo "usage: $0 {start|start_msg}"
+ rval=1
+ ;;
+esac
+
+exit $rval
shlib_ext = @SHLIB_EXT@
shlib_mode = @SHLIB_MODE@
+# Optional init script and rc.d link
+INIT_DIR=@INIT_DIR@
+INIT_SCRIPT=@INIT_SCRIPT@
+RC_LINK=@RC_LINK@
+
TEST_PROGS = check_ttyname
TEST_LIBS = @LIBS@ @LIBINTL@ $(LT_LIBS)
TEST_LDFLAGS = @LDFLAGS@
pre-install:
-install: install-binaries @INSTALL_NOEXEC@
+install: install-binaries install-rc @INSTALL_NOEXEC@
install-dirs:
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \
$(DESTDIR)$(libexecdir)/sudo $(DESTDIR)$(noexecdir)
+install-rc:
+ @if [ -n "$(INIT_SCRIPT)" ]; then \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(INIT_DIR) \
+ `echo $(DESTDIR)$(RC_LINK)|sed 's,/[^/]*$$,,'`; \
+ $(INSTALL) -O $(install_uid) -G $(install_gid) -m 0755 $(top_srcdir)/init.d/$(INIT_SCRIPT) $(DESTDIR)$(INIT_DIR)/sudo; \
+ rm -f $(DESTDIR)$(RC_LINK); \
+ ln -s $(INIT_DIR)/sudo $(DESTDIR)$(RC_LINK); \
+ fi
+
install-binaries: install-dirs $(PROGS)
$(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -m 04755 sudo $(DESTDIR)$(bindir)/sudo
rm -f $(DESTDIR)$(bindir)/sudoedit
/usr/bin/sudoreplay 0755 root: symlink $bindir/sudoreplay
/usr/sbin/visudo 0755 root: symlink $sbindir/visudo
%endif
+%if [aix]
+ /etc/rc.d/init.d/sudo 0755 root:
+%endif
+%if [sd]
+ /sbin/init.d/sudo 0755 root:
+%endif
%files [!aix]
$sudoedit_man 0644 symlink,ignore-others $sudoedit_man_target
exit 0;
'
+%post [aix]
+ # Create /etc/rc.d/rc2.d/S90sudo link if /etc/rc.d exists
+ if [ -d /etc/rc.d ]; then
+ rm -f /etc/rc.d/rc2.d/S90sudo
+ ln -s /etc/rc.d/init.d/sudo /etc/rc.d/rc2.d/S90sudo
+ fi
+%endif
+%post [sd]
+ # Create /sbin/rc2.d/S900sudo link
+ rm -f /sbin/rc2.d/S900sudo
+ ln -s /sbin/init.d/sudo /sbin/rc2.d/S900sudo
+%endif
%preun
# Remove the time stamp dir and its contents
# We currently leave the lecture status files installed
rm -f /etc/sudo-ldap.conf
fi
%endif
+%if [aix]
+ # Remove /etc/rc.d/rc2.d/S90sudo link
+ rm -f /etc/rc.d/rc2.d/S90sudo
+%endif
+%if [sd]
+ # Remove /sbin/rc2.d/S900sudo link
+ rm -f /sbin/rc2.d/S900sudo
+%endif