Hello community,
here is the log from the commit of package autofs for openSUSE:Factory checked in at 2012-02-06 15:54:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/autofs (Old)
and /work/SRC/openSUSE:Factory/.autofs.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "autofs", Maintainer is "MSzeredi@suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/autofs/autofs.changes 2011-12-30 08:45:23.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.autofs.new/autofs.changes 2012-02-06 15:54:24.000000000 +0100
@@ -1,0 +2,57 @@
+Thu Feb 2 13:09:26 UTC 2012 - lchiquitto@suse.com
+
+- comment out /etc/auto.master.d from the shipped auto.master file
+
+-------------------------------------------------------------------
+Thu Feb 2 12:55:51 UTC 2012 - lchiquitto@suse.com
+
+- configure with --disable-mount-move only when systemd is enabled
+
+-------------------------------------------------------------------
+Fri Jan 27 18:05:45 UTC 2012 - lchiquitto@suse.com
+
+- rpm spec: simplify some commands in the install section and
+ use more rpm macros (from Cristian Rodriguez)
+
+-------------------------------------------------------------------
+Mon Jan 23 16:24:31 UTC 2012 - lchiquitto@suse.com
+
+- enable systemd support by default on openSUSE 12.2 (bnc#741879):
+ * enable disable-mount-move and with-systemd configure options
+ * install systemd service file
+
+-------------------------------------------------------------------
+Mon Jan 23 12:56:56 UTC 2012 - lchiquitto@suse.com
+
+- disable "--as-needed" to make sure automount will be linked
+ against libtirpc (bnc#742846)
+
+-------------------------------------------------------------------
+Thu Jan 19 20:40:34 UTC 2012 - lchiquitto@suse.com
+
+- fix typo in libtirpc file name
+- rpm spec: use the %configure macro
+
+-------------------------------------------------------------------
+Tue Jan 17 12:44:26 UTC 2012 - lchiquitto@suse.com
+
+- update 5.0.6 upstream patches to 20111210, fixing some bugs and
+ implementing new features (bnc#741878):
+ * add systemd unit support (not enabled yet)
+ * add disable move mount configure option
+ * implement 'dir' map type
+ * improve mount location error reporting
+ * fix rpc build error
+ * fix ipv6 configure check
+ * fix ipv6 rpc calls
+ * fix ipv6 name lookup check
+ * fix map source check in file lookup
+ * fix submount shutdown race
+ * fix wait for master source mutex
+ * fix not bind mounting local filesystem
+ * fix LDAP result leaks on error paths
+ * fix result null check in read_one_map()
+ * fix dumpmaps not reading maps
+ * fix paged query more results check
+
+-------------------------------------------------------------------
Old:
----
autofs-5.0.5-fix-ldap-result-leaks.patch
autofs-5.0.5-fix-paged-query-more-results-check.patch
autofs-5.0.5-fix-result-null-check-in-read_one_map.patch
New:
----
autofs-5.0.5-add-piddir-to-configure.patch
autofs-5.0.5-add-systemd-unit-support.patch
autofs-5.0.5-dir-map-type-patch-v2.patch
autofs-5.0.6-add-disable-move-mount-configure-option.patch
autofs-5.0.6-code-analysis-fixes-1.patch
autofs-5.0.6-fix-LDAP-result-leaks-on-error-paths.patch
autofs-5.0.6-fix-MNT_DETACH-define.patch
autofs-5.0.6-fix-dumpmaps-not-reading-maps.patch
autofs-5.0.6-fix-fix-LDAP-result-leaks-on-error-paths.patch
autofs-5.0.6-fix-fix-map-source-check-in-file-lookup.patch
autofs-5.0.6-fix-ipv6-configure-check.patch
autofs-5.0.6-fix-ipv6-name-lookup-check.patch
autofs-5.0.6-fix-ipv6-rpc-calls.patch
autofs-5.0.6-fix-libtirpc-name-typo.patch
autofs-5.0.6-fix-lsb-service-name-in-init-script-2.patch
autofs-5.0.6-fix-not-bind-mounting-local-filesystem.patch
autofs-5.0.6-fix-paged-query-more-results-check.patch
autofs-5.0.6-fix-result-null-check-in-read_one_map.patch
autofs-5.0.6-fix-rpc-build-error.patch
autofs-5.0.6-fix-submount-shutdown-race.patch
autofs-5.0.6-fix-wait-for-master-source-mutex.patch
autofs-5.0.6-improve-mount-location-error-reporting.patch
autofs-5.0.6-remove-empty-command-line-arguments.patch
autofs.service
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ autofs.spec ++++++
--- /var/tmp/diff_new_pack.A6A9eo/_old 2012-02-06 15:54:28.000000000 +0100
+++ /var/tmp/diff_new_pack.A6A9eo/_new 2012-02-06 15:54:28.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package autofs
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,6 +15,12 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+%if 0%{?suse_version} >= 1220
+%define with_systemd 1
+%else
+%define with_systemd 0
+%endif
+
Name: autofs
Url: http://www.kernel.org/pub/linux/daemons/autofs/v5/
BuildRequires: autoconf
@@ -27,6 +33,9 @@
BuildRequires: module-init-tools
BuildRequires: nfs-client
BuildRequires: openldap2-devel
+%if %{with_systemd}
+BuildRequires: systemd
+%endif
Version: 5.0.6
Release: 0
Summary: A Kernel-Based Automounter
@@ -39,17 +48,43 @@
Source3: autofs.schema
Source4: README.SUSE.ldap
Source5: README.SUSE
+Source6: autofs.service
Source7: NetworkManager-autofs
Source8: get-upstream-patches
%define patchdate 20110703
Patch0: autofs-%{version}-upstream-patches-%{patchdate}.bz2
-Patch1: autofs-5.0.6-invalid-ghost-dirs.patch
-Patch2: autofs-5.0.5-fix-paged-query-more-results-check.patch
-Patch3: autofs-5.0.5-fix-result-null-check-in-read_one_map.patch
-Patch4: autofs-5.0.5-fix-ldap-result-leaks.patch
-Patch10: autofs-suse-auto_master_default.patch
-Patch11: autofs-suse-build.patch
-PreReq: %fillup_prereq %insserv_prereq aaa_base
+Patch1: autofs-5.0.6-improve-mount-location-error-reporting.patch
+Patch2: autofs-5.0.6-fix-paged-query-more-results-check.patch
+Patch3: autofs-5.0.6-fix-dumpmaps-not-reading-maps.patch
+Patch4: autofs-5.0.6-fix-result-null-check-in-read_one_map.patch
+Patch5: autofs-5.0.6-fix-LDAP-result-leaks-on-error-paths.patch
+Patch6: autofs-5.0.6-fix-fix-LDAP-result-leaks-on-error-paths.patch
+Patch7: autofs-5.0.6-code-analysis-fixes-1.patch
+Patch8: autofs-5.0.6-fix-not-bind-mounting-local-filesystem.patch
+Patch9: autofs-5.0.5-dir-map-type-patch-v2.patch
+Patch10: autofs-5.0.6-fix-wait-for-master-source-mutex.patch
+Patch11: autofs-5.0.6-fix-submount-shutdown-race.patch
+Patch12: autofs-5.0.6-fix-fix-map-source-check-in-file-lookup.patch
+Patch13: autofs-5.0.6-add-disable-move-mount-configure-option.patch
+Patch14: autofs-5.0.6-fix-lsb-service-name-in-init-script-2.patch
+Patch15: autofs-5.0.6-fix-ipv6-name-lookup-check.patch
+Patch16: autofs-5.0.6-fix-ipv6-rpc-calls.patch
+Patch17: autofs-5.0.6-fix-ipv6-configure-check.patch
+Patch18: autofs-5.0.5-add-piddir-to-configure.patch
+Patch19: autofs-5.0.5-add-systemd-unit-support.patch
+Patch20: autofs-5.0.6-fix-MNT_DETACH-define.patch
+Patch21: autofs-5.0.6-remove-empty-command-line-arguments.patch
+Patch22: autofs-5.0.6-fix-rpc-build-error.patch
+Patch23: autofs-5.0.6-invalid-ghost-dirs.patch
+Patch24: autofs-5.0.6-fix-libtirpc-name-typo.patch
+Patch100: autofs-suse-auto_master_default.patch
+Patch101: autofs-suse-build.patch
+Requires(pre): %fillup_prereq
+Requires(pre): %insserv_prereq
+Requires(pre): aaa_base
+%if %{with_systemd}
+%{?systemd_requires}
+%endif
Recommends: nfs-client
%description
@@ -59,7 +94,7 @@
floppies, and so forth.
%prep
-%setup
+%setup -q
cp %{SOURCE3} .
cp %{SOURCE4} .
cp %{SOURCE5} .
@@ -69,61 +104,101 @@
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
%patch10 -p1
%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+%patch20 -p1
+%patch21 -p1
+%patch22 -p1
+%patch23 -p1
+%patch24 -p1
+%patch100 -p1
+%patch101 -p1
%build
-rm -f configure
-autoconf -f
-./configure %{_target_cpu}-suse-linux \
+SUSE_ASNEEDED=0
+%configure %{_target_cpu}-suse-linux \
--libdir=%{_libdir} --mandir=%{_mandir} \
--with-confdir=/etc/sysconfig \
--disable-mount-locking \
--enable-forced-shutdown \
--enable-ignore-busy \
+%if %{with_systemd}
+ --disable-mount-move \
+ --with-systemd \
+%endif
--with-libtirpc \
--with-hesiod=no \
--with-sasl
-make all DONTSTRIP=1 LOCAL_CFLAGS="$RPM_OPT_FLAGS %(getconf LFS_CFLAGS)" \
+make all DONTSTRIP=1 LOCAL_CFLAGS="%{optflags} %(getconf LFS_CFLAGS)" \
%{?_smp_mflags}
%install
-make install INSTALLROOT=$RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
-install -m 644 %{S:1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.autofs
-install -m 755 %{S:2} $RPM_BUILD_ROOT/etc/init.d/autofs
-ln -s ../../etc/init.d/autofs $RPM_BUILD_ROOT/usr/sbin/rcautofs
-ln -s %{_mandir}/man8/autofs.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/rcautofs.8.gz
-mkdir -p $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d
-install -m 755 %{S:7} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/autofs
+make install INSTALLROOT=%{buildroot}
+install -d -m 755 %{buildroot}%{_sysconfdir}/auto.master.d
+install -D -m 644 %{SOURCE1} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.autofs
+install -D -m 755 %{SOURCE7} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/autofs
+install -D -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/autofs
+ln -s ../../etc/init.d/autofs %{buildroot}%{_sbindir}/rcautofs
+ln -s %{_mandir}/man8/autofs.8.gz %{buildroot}/%{_mandir}/man8/rcautofs.8.gz
+%if %{with_systemd}
+install -D -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/autofs.service
+%endif
# will be installed by fillup scripts
-rm -f $RPM_BUILD_ROOT/etc/sysconfig/autofs
+rm -f %{buildroot}%{_sysconfdir}/sysconfig/autofs
+
+%pre
+%if %{with_systemd}
+%service_add_pre %{name}.service
+%endif
%post
if /sbin/chkconfig -c autofs 3; then
%{insserv_force_if_yast autofs}
fi
%{fillup_only -n autofs}
+%if %{with_systemd}
+%service_add_post %{name}.service
+%endif
%preun
%{stop_on_removal autofs}
+%if %{with_systemd}
+%service_del_preun %{name}.service
+%endif
%postun
%{restart_on_update autofs}
%{insserv_cleanup}
+%if %{with_systemd}
+%service_del_postun %{name}.service
+%endif
%files
%defattr (-, root, root)
-/var/adm/fillup-templates/sysconfig.autofs
-%config(noreplace) /etc/auto.master
-%config(noreplace) /etc/auto.misc
-%config(noreplace) /etc/auto.net
-%config(noreplace) /etc/auto.smb
-%config(noreplace) /etc/autofs_ldap_auth.conf
-%config /etc/init.d/autofs
-%dir /etc/NetworkManager
-%dir /etc/NetworkManager/dispatcher.d
-/etc/NetworkManager/dispatcher.d/autofs
+%{_localstatedir}/adm/fillup-templates/sysconfig.autofs
+%config(noreplace) %{_sysconfdir}/auto.master
+%config(noreplace) %{_sysconfdir}/auto.misc
+%config(noreplace) %{_sysconfdir}/auto.net
+%config(noreplace) %{_sysconfdir}/auto.smb
+%config(noreplace) %{_sysconfdir}/autofs_ldap_auth.conf
+%config %{_sysconfdir}/init.d/autofs
+%dir %{_sysconfdir}/auto.master.d
+%dir %{_sysconfdir}/NetworkManager
+%dir %{_sysconfdir}/NetworkManager/dispatcher.d
+%{_sysconfdir}/NetworkManager/dispatcher.d/autofs
%doc COPYRIGHT README README.changer README.ncpfs README.replicated-server
%doc README.smbfs README.v5.release autofs.schema README.active-restart
%doc README.SUSE README.SUSE.ldap
@@ -131,7 +206,10 @@
%{_libdir}/autofs/
%{_mandir}/man5/*
%{_mandir}/man8/*
-%{_sbindir}/rcautofs
%{_sbindir}/automount
+%{_sbindir}/rcautofs
+%if %{with_systemd}
+%{_unitdir}/autofs.service
+%endif
%changelog
++++++ autofs-5.0.5-add-piddir-to-configure.patch ++++++
commit db9b2b40be3c9adaeda3b41fcff0918f8c111fe6
Author: Ian Kent
Date: Thu Dec 1 18:35:51 2011 +0800
autofs-5.0.5 - add piddir to configure
In order to accomodate possible changes or different pid file
locations add directory selection for pid file directory to
configure. Also update the fifo directory and flag file directory
configure checks.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -17,6 +17,7 @@
- fix ipv6 name lookup check.
- fix ipv6 rpc calls.
- fix ipv6 configure check.
+- add piddir to configure.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/Makefile.conf.in
===================================================================
--- autofs-5.0.6.orig/Makefile.conf.in
+++ autofs-5.0.6/Makefile.conf.in
@@ -79,6 +79,9 @@ autofsconfdir = @confdir@
# Location for autofs maps
autofsmapdir = @mapdir@
+# Localtion of pid files
+autofspiddir = @piddir@
+
# Location for autofs fifos
autofsfifodir = @fifodir@
Index: autofs-5.0.6/aclocal.m4
===================================================================
--- autofs-5.0.6.orig/aclocal.m4
+++ autofs-5.0.6/aclocal.m4
@@ -121,13 +121,29 @@ AC_DEFUN(AF_MAP_D,
fi])
dnl --------------------------------------------------------------------------
+dnl AF_PID_D
+dnl
+dnl Check the location of the pid file directory.
+dnl --------------------------------------------------------------------------
+AC_DEFUN(AF_PID_D,
+[if test -z "$piddir"; then
+ for pid_d in /run /var/run /tmp; do
+ if test -z "$piddir"; then
+ if test -d "$pid_d"; then
+ piddir="$pid_d"
+ fi
+ fi
+ done
+fi])
+
+dnl --------------------------------------------------------------------------
dnl AF_FIFO_D
dnl
dnl Check the location of the autofs fifos directory
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_FIFO_D,
[if test -z "$fifodir"; then
- for fifo_d in /var/run /tmp; do
+ for fifo_d in /run /var/run /tmp; do
if test -z "$fifodir"; then
if test -d "$fifo_d"; then
fifodir="$fifo_d"
@@ -143,7 +159,7 @@ dnl Check the location of the autofs fla
dnl --------------------------------------------------------------------------
AC_DEFUN(AF_FLAG_D,
[if test -z "$flagdir"; then
- for flag_d in /var/run /tmp; do
+ for flag_d in /run /var/run /tmp; do
if test -z "$flagdir"; then
if test -d "$flag_d"; then
flagdir="$flag_d"
Index: autofs-5.0.6/configure
===================================================================
--- autofs-5.0.6.orig/configure
+++ autofs-5.0.6/configure
@@ -2184,7 +2184,7 @@ $as_echo "$mapdir" >&6; }
# The user can specify --with-fifodir=PATH to specify where autofs fifos go
#
if test -z "$fifodir"; then
- for fifo_d in /var/run /tmp; do
+ for fifo_d in /run /var/run /tmp; do
if test -z "$fifodir"; then
if test -d "$fifo_d"; then
fifodir="$fifo_d"
@@ -2214,7 +2214,7 @@ $as_echo "$fifodir" >&6; }
# The user can specify --with-flagdir=PATH to specify where autofs flag file goes
#
if test -z "$flagdir"; then
- for flag_d in /var/run /tmp; do
+ for flag_d in /run /var/run /tmp; do
if test -z "$flagdir"; then
if test -d "$flag_d"; then
flagdir="$flag_d"
Index: autofs-5.0.6/redhat/Makefile
===================================================================
--- autofs-5.0.6.orig/redhat/Makefile
+++ autofs-5.0.6/redhat/Makefile
@@ -8,6 +8,7 @@ autofs.init: autofs.init.in
sed -e "s|@@sbindir@@|$(sbindir)|g" \
-e "s|@@autofslibdir@@|$(autofslibdir)|g" \
-e "s|@@autofsconfdir@@|$(autofsconfdir)|g" \
+ -e "s|@@autofspiddir@@|$(autofspiddir)|g" \
-e "s|@@initdir@@|$(initdir)|g" < autofs.init.in > autofs.init
autofs.sysconfig: autofs.sysconfig.in
Index: autofs-5.0.6/redhat/autofs.init.in
===================================================================
--- autofs-5.0.6.orig/redhat/autofs.init.in
+++ autofs-5.0.6/redhat/autofs.init.in
@@ -86,7 +86,7 @@ function start() {
fi
echo -n $"Starting $prog: "
- $prog $OPTIONS --pid-file /var/run/autofs.pid
+ $prog $OPTIONS --pid-file @@autofspiddir@@/autofs.pid
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
success "$prog startup"
@@ -171,7 +171,7 @@ case "$1" in
stop
;;
status)
- status -p /var/run/autofs.pid -l autofs $prog
+ status -p @@autofspiddir@@/autofs.pid -l autofs $prog
;;
restart|force-reload)
restart
Index: autofs-5.0.6/samples/Makefile
===================================================================
--- autofs-5.0.6.orig/samples/Makefile
+++ autofs-5.0.6/samples/Makefile
@@ -21,7 +21,7 @@ dirs:
install -d -m 755 $(INSTALLROOT)$(autofsmapdir)
install -d -m 755 $(INSTALLROOT)$(autofsconfdir)
install -d -m 755 $(INSTALLROOT)$(autofslibdir)
- install -d -m 755 $(INSTALLROOT)/var/run/autofs
+ install -d -m 755 $(INSTALLROOT)$(autofspiddir)
.PHONY: autofs.init
autofs.init:
++++++ autofs-5.0.5-add-systemd-unit-support.patch ++++++
commit 61b6f92330d9dc701dafa5a07a39aaebe2ad142b
Author: Ian Kent
Date: Thu Dec 1 18:36:00 2011 +0800
autofs-5.0.5 - add systemd unit support
Add a systemd unit file and attempt to integrating it into our
install.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -18,6 +18,7 @@
- fix ipv6 rpc calls.
- fix ipv6 configure check.
- add piddir to configure.
+- add systemd unit support.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/Makefile.conf.in
===================================================================
--- autofs-5.0.6.orig/Makefile.conf.in
+++ autofs-5.0.6/Makefile.conf.in
@@ -98,3 +98,5 @@ mandir = @mandir@
# Location for init.d files
initdir = @initdir@
+# Location of systemd unit files
+systemddir = @systemddir@
Index: autofs-5.0.6/aclocal.m4
===================================================================
--- autofs-5.0.6.orig/aclocal.m4
+++ autofs-5.0.6/aclocal.m4
@@ -199,6 +199,34 @@ fi], [AC_MSG_RESULT(no)])
])
dnl --------------------------------------------------------------------------
+dnl AF_WITH_SYSTEMD
+dnl
+dnl Check the location of the systemd unit files directory
+dnl --------------------------------------------------------------------------
+AC_DEFUN([AF_WITH_SYSTEMD],
+[AC_ARG_WITH(systemd,
+[ --with-systemd install systemd unit file if systemd unit directory
+ is found on system],
+[if test "$withval" = yes; then
+ if test -z "$systemddir"; then
+ AC_MSG_CHECKING([location of the systemd unit files directory])
+ for systemd_d in /lib/systemd/system; do
+ if test -z "$systemddir"; then
+ if test -d "$systemd_d"; then
+ systemddir="$systemd_d"
+ fi
+ fi
+ done
+ fi
+ if test -n "$systemddir"; then
+ AC_MSG_RESULT($systemddir)
+ else
+ AC_MSG_RESULT(not found)
+ fi
+fi])
+])
+
+dnl --------------------------------------------------------------------------
dnl AF_CHECK_LIBXML
dnl
dnl Check for lib xml
Index: autofs-5.0.6/autofs.spec
===================================================================
--- autofs-5.0.6.orig/autofs.spec
+++ autofs-5.0.6/autofs.spec
@@ -8,6 +8,10 @@
%define _lib lib64
%endif
+# Use --without systemd in your rpmbuild command or force values to 0 to
+# disable them.
+%define with_systemd %{?_without_systemd: 0} %{?!_without_systemd: 1}
+
Summary: A tool from automatically mounting and umounting filesystems.
Name: autofs
%define version 5.0.6
@@ -18,9 +22,18 @@ License: GPL
Group: System Environment/Daemons
Source: ftp://ftp.kernel.org/pub/linux/daemons/autofs/v4/autofs-%{version}.tar.gz
Buildroot: %{_tmppath}/%{name}-tmp
+%if %{with_systemd}
+BuildRequires: systemd-units
+%endif
BuildPrereq: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel
Prereq: chkconfig
Requires: /bin/bash mktemp sed textutils sh-utils grep /bin/ps
+%if %{with_systemd}
+Requires(post): systemd-sysv
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%endif
Obsoletes: autofs-ldap
Summary(de): autofs daemon
Summary(fr): d�mon autofs
@@ -55,14 +68,22 @@ inkludera n�tfilsystem, CD-ROM, floppydi
%prep
%setup -q
echo %{version}-%{release} > .version
+%if %{with_systemd}
+ %define _unitdir %{?_unitdir:/lib/systemd/system}
+ %define systemd_configure_arg --with-systemd
+%endif
%build
-CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc --disable-mount-move
+CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc --disable-mount-move %{?systemd_configure_arg:}
CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1
%install
rm -rf $RPM_BUILD_ROOT
+%if %{with_systemd}
+install -d -m 755 $RPM_BUILD_ROOT%{_unitdir}
+%else
mkdir -p -m755 $RPM_BUILD_ROOT/etc/rc.d/init.d
+%endif
mkdir -p -m755 $RPM_BUILD_ROOT%{_sbindir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}/autofs
mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/{man5,man8}
@@ -70,31 +91,56 @@ mkdir -p -m755 $RPM_BUILD_ROOT/etc/sysco
mkdir -p -m755 $RPM_BUILD_ROOT/etc/auto.master.d
make install mandir=%{_mandir} initdir=/etc/rc.d/init.d INSTALLROOT=$RPM_BUILD_ROOT
+echo make -C redhat
make -C redhat
+%if %{with_systemd}
+install -m 644 redhat/autofs.service $RPM_BUILD_ROOT%{_unitdir}/autofs.service
+%else
install -m 755 redhat/autofs.init $RPM_BUILD_ROOT/etc/rc.d/init.d/autofs
+%endif
install -m 644 redhat/autofs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/autofs
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%post
+%if %{with_systemd}
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+%else
chkconfig --add autofs
-
-%postun
-if [ $1 -ge 1 ] ; then
- /sbin/service autofs condrestart > /dev/null 2>&1 || :
-fi
+%endif
%preun
if [ "$1" = 0 ] ; then
+%if %{with_systemd}
+ /bin/systemctl --no-reload disable autofs.service > /dev/null 2>&1 || :
+ /bin/systemctl stop autofs.service > /dev/null 2>&1 || :
+%else
/sbin/service autofs stop > /dev/null 2>&1 || :
/sbin/chkconfig --del autofs
+%endif
fi
+%postun
+%if %{with_systemd}
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+ /bin/systemctl try-restart autofs.service >/dev/null 2>&1 || :
+fi
+%else
+if [ $1 -ge 1 ] ; then
+ /sbin/service autofs condrestart > /dev/null 2>&1 || :
+fi
+%endif
+
%files
%defattr(-,root,root)
%doc CREDITS CHANGELOG INSTALL COPY* README* samples/ldap* samples/autofs.schema samples/autofs_ldap_auth.conf
+%if %{with_systemd}
+%{_unitdir}/autofs.service
+%else
%config /etc/rc.d/init.d/autofs
+%endif
%config(noreplace) /etc/auto.master
%config(noreplace,missingok) /etc/auto.misc
%config(noreplace,missingok) /etc/auto.net
Index: autofs-5.0.6/configure
===================================================================
--- autofs-5.0.6.orig/configure
+++ autofs-5.0.6/configure
@@ -650,6 +650,8 @@ flagdir
fifodir
mapdir
confdir
+systemddir
+piddir
initdir
target_alias
host_alias
@@ -693,6 +695,7 @@ ac_subst_files=''
ac_user_opts='
enable_option_checking
with_path
+with_systemd
with_confdir
with_mapdir
with_fifodir
@@ -1337,6 +1340,8 @@ Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-path=PATH look in PATH for binaries needed by the automounter
+ --with-systemd install systemd unit file if systemd unit directory
+ is found on system
--with-confdir=DIR use DIR for autofs configuration files
--with-mapdir=PATH look in PATH for mount maps used by the automounter
--with-fifodir=PATH use PATH as the directory for fifos used by the automounter
@@ -2119,6 +2124,48 @@ $as_echo "$initdir" >&6; }
done
fi
+if test -z "$piddir"; then
+ for pid_d in /run /var/run /tmp; do
+ if test -z "$piddir"; then
+ if test -d "$pid_d"; then
+ piddir="$pid_d"
+ fi
+ fi
+ done
+fi
+
+
+#
+# Check for systemd unit files direectory exists if unit file installation
+# is requested
+#
+
+# Check whether --with-systemd was given.
+if test "${with_systemd+set}" = set; then :
+ withval=$with_systemd; if test "$withval" = yes; then
+ if test -z "$systemddir"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of the systemd unit files directory" >&5
+$as_echo_n "checking location of the systemd unit files directory... " >&6; }
+ for systemd_d in /lib/systemd/system; do
+ if test -z "$systemddir"; then
+ if test -d "$systemd_d"; then
+ systemddir="$systemd_d"
+ fi
+ fi
+ done
+ fi
+ if test -n "$systemddir"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $systemddir" >&5
+$as_echo "$systemddir" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+ fi
+fi
+fi
+
+
+
#
# Location of system config script directory?
Index: autofs-5.0.6/configure.in
===================================================================
--- autofs-5.0.6.orig/configure.in
+++ autofs-5.0.6/configure.in
@@ -43,6 +43,15 @@ AF_LINUX_PROCFS()
#
AF_INIT_D()
AC_SUBST(initdir)
+AF_PID_D()
+AC_SUBST(piddir)
+
+#
+# Check for systemd unit files direectory exists if unit file installation
+# is requested
+#
+AF_WITH_SYSTEMD()
+AC_SUBST(systemddir)
#
# Location of system config script directory?
Index: autofs-5.0.6/redhat/Makefile
===================================================================
--- autofs-5.0.6.orig/redhat/Makefile
+++ autofs-5.0.6/redhat/Makefile
@@ -2,7 +2,7 @@
-include ../Makefile.conf
include ../Makefile.rules
-all: autofs.init autofs.sysconfig
+all: autofs.init autofs.sysconfig autofs.service
autofs.init: autofs.init.in
sed -e "s|@@sbindir@@|$(sbindir)|g" \
@@ -15,6 +15,12 @@ autofs.sysconfig: autofs.sysconfig.in
sed -e "s|@@autofsmapdir@@|$(autofsmapdir)|g" \
< autofs.sysconfig.in > autofs.sysconfig
+autofs.service: ../samples/autofs.service.in
+ sed -e "s|@@sbindir@@|$(sbindir)|g" \
+ -e "s|@@autofsconfdir@@|$(autofsconfdir)|g" \
+ -e "s|@@autofspiddir@@|$(autofspiddir)|g" \
+ < ../samples/autofs.service.in > autofs.service
+
clean:
- rm -f autofs.init autofs.sysconfig
+ rm -f autofs.init autofs.sysconfig autofs.service
Index: autofs-5.0.6/samples/Makefile
===================================================================
--- autofs-5.0.6.orig/samples/Makefile
+++ autofs-5.0.6/samples/Makefile
@@ -4,7 +4,7 @@ include ../Makefile.rules
SAMPLES = auto.master auto.misc auto.net auto.smb
-all: rc.autofs autofs.conf.default
+all: rc.autofs autofs.conf.default autofs.service
rc.autofs: rc.autofs.in
sed -e "s|@@sbindir@@|$(sbindir)|g" \
@@ -16,6 +16,12 @@ autofs.conf.default: autofs.conf.default
sed -e "s|@@autofsmapdir@@|$(autofsmapdir)|g" \
< autofs.conf.default.in > autofs.conf.default
+autofs.service: autofs.service.in
+ sed -e "s|@@sbindir@@|$(sbindir)|g" \
+ -e "s|@@autofsconfdir@@|$(autofsconfdir)|g" \
+ -e "s|@@autofspiddir@@|$(autofspiddir)|g" \
+ < autofs.service.in > autofs.service
+
.PHONY: dirs
dirs:
install -d -m 755 $(INSTALLROOT)$(autofsmapdir)
@@ -26,13 +32,18 @@ dirs:
.PHONY: autofs.init
autofs.init:
@echo
-ifneq ($(initdir),)
+ifneq ($(systemddir),)
+ install -d -m 755 $(INSTALLROOT)$(systemddir)
+ install autofs.service -m 644 $(INSTALLROOT)$(systemddir)/autofs.service
+else
+ ifneq ($(initdir),)
install -d -m 755 $(INSTALLROOT)$(initdir)
install rc.autofs -m 755 $(INSTALLROOT)$(initdir)/autofs
-else
+ else
if test -d $(INSTALLROOT)/etc/rc.d ; then \
install -c rc.autofs -m 755 $(INSTALLROOT)/etc/rc.d ; \
fi
+ endif
endif
CONFIG = $(shell test -e $(INSTALLROOT)$(autofsconfdir)/autofs.orig || echo "-b --suffix=.orig")
@@ -173,10 +184,10 @@ auto.smb:
fi ; \
fi
-install: rc.autofs autofs.conf.default dirs autofs.init autofs.conf \
- autofs_ldap_auth.conf $(SAMPLES)
+install: rc.autofs autofs.conf.default dirs autofs.init autofs.service \
+ autofs.conf autofs_ldap_auth.conf $(SAMPLES)
@echo
clean:
- rm -f *.o *.s rc.autofs autofs.conf.default
+ rm -f *.o *.s rc.autofs autofs.conf.default autofs.service
Index: autofs-5.0.6/samples/autofs.service.in
===================================================================
--- /dev/null
+++ autofs-5.0.6/samples/autofs.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description=Automounts filesystems on demand
+After=network.target ypbind.service
+
+[Service]
+Type=forking
+PIDFile=@@autofspiddir@@/autofs.pid
+EnvironmentFile=-@@autofsconfdir@@/autofs
+ExecStart=@@sbindir@@/automount ${OPTIONS} --pid-file @@autofspiddir@@/autofs.pid
+
+[Install]
+WantedBy=multi-user.target
++++++ autofs-5.0.5-dir-map-type-patch-v2.patch ++++++
commit 8d7c93e13591a23a1d4c383dbba2fa1069f04869
Author: Masatake YAMATO
Date: Thu Dec 1 15:26:25 2011 +0800
autofs-5.0.5 - dir map-type patch v2
This is the second post of "dir map-type" patch.
Changes since last post:
- Don't use auto. as prefix for included map.
Use .autofs suffix instead. Suggested by Steve Linn.
- Use scandir instead of using opendir/readdir/closedir.
What is dir map-type?
`dir' map-type is for including files under a directory into master
map.
`file' map-type can be used for including a file with + notation like:
+/etc/auto.mine
in auto.master. However, for specifying a new file to be included you
have to edit auto.master file. Editing is also needed when you want to
remove the included file. When you have to do this with your shell
script you may have to use sed or awk.
`dir' map-type permits you adding new master map entries with cp
command and removing the entries with rm command. `dir' map-type is
inspired from /etc/httpd/conf.d and /etc/modprobe.d.
`dir' map-type can be used for included files under a directory
(e.g. /etc/auto.master.d) with + notation like:
+dir:/etc/auto.master.d
in auto.master. With this notation /etc/auto.master.d/*.autofs files
are included except a file which name is started with ".". With the
name of the file you can control whether a file under the directory is
included or not: the file which name ends with ".autofs" is included.
Signed-off-by: Masatake YAMATO
diff --git a/CHANGELOG b/CHANGELOG
index 13b4bf4..1e6edd1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,7 @@
- fix fix LDAP result leaks on error paths.
- code analysis fixes part 1.
- fix not bind mounting local filesystem.
+- add "dir" map-type.
28/06/2011 autofs-5.0.6
-----------------------
diff --git a/autofs.spec b/autofs.spec
index 91d4f8b..82edd1e 100644
--- a/autofs.spec
+++ b/autofs.spec
@@ -67,6 +67,7 @@ mkdir -p -m755 $RPM_BUILD_ROOT%{_sbindir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}/autofs
mkdir -p -m755 $RPM_BUILD_ROOT%{_mandir}/{man5,man8}
mkdir -p -m755 $RPM_BUILD_ROOT/etc/sysconfig
+mkdir -p -m755 $RPM_BUILD_ROOT/etc/auto.master.d
make install mandir=%{_mandir} initdir=/etc/rc.d/init.d INSTALLROOT=$RPM_BUILD_ROOT
make -C redhat
@@ -104,6 +105,7 @@ fi
%dir %{_libdir}/autofs
%{_libdir}/autofs/*
%{_mandir}/*/*
+%dir /etc/auto.master.d
%changelog
* Tue Jun 3 2011 Ian Kent
diff --git a/daemon/lookup.c b/daemon/lookup.c
index 958d8cc..098588c 100644
--- a/daemon/lookup.c
+++ b/daemon/lookup.c
@@ -176,7 +176,8 @@ int lookup_nss_read_master(struct master *master, time_t age)
!strncmp(name, "nis:", 4) ||
!strncmp(name, "nisplus:", 8) ||
!strncmp(name, "ldap:", 5) ||
- !strncmp(name, "ldaps:", 6)) {
+ !strncmp(name, "ldaps:", 6) ||
+ !strncmp(name, "dir:", 4)) {
strncpy(source, name, tmp - name);
/*
diff --git a/man/auto.master.5.in b/man/auto.master.5.in
index de692d2..fff9943 100644
--- a/man/auto.master.5.in
+++ b/man/auto.master.5.in
@@ -107,6 +107,14 @@ appropriate certificate must be configured in the LDAP client.
.B multi
This map type allows the specification of multiple maps separated
by "--". These maps are searched in order to resolve key lookups.
+.TP
+.B dir
+This map type can be used at
+.BR +
+master map including notation. The contents of files under given directory are included
+to the master map. The name of file to be included must be ended with ".autofs". A file
+will be ignored if its name is not ended with the suffix. In addition a dot file, a file
+which name is started with "." is also ignored.
.RE
.TP
\fBformat\fP
@@ -118,7 +126,7 @@ left unspecified, it defaults to \fBsun\fP for all map types except
.TP
\fBmap\fP
Name of the map to use. This is an absolute UNIX pathname
-for maps of types \fBfile\fP or \fBprogram\fP, and the name of a database
+for maps of types \fBfile\fP, \fBdir\fP, or \fBprogram\fP, and the name of a database
in the case for maps of type \fByp\fP, \fBnisplus\fP, or \fBhesiod\fP or
the \fBdn\fP of an LDAP entry for maps of type \fBldap\fP.
.TP
diff --git a/modules/Makefile b/modules/Makefile
index a35c0a5..6090127 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -5,14 +5,14 @@
-include ../Makefile.conf
include ../Makefile.rules
-SRCS := lookup_yp.c lookup_file.c lookup_program.c lookup_userhome.c \
- lookup_multi.c lookup_hosts.c \
+SRCS := lookup_yp.c lookup_file.c lookup_program.c lookup_userhome.c \
+ lookup_multi.c lookup_hosts.c lookup_dir.c \
parse_sun.c \
mount_generic.c mount_nfs.c mount_afs.c mount_autofs.c \
mount_changer.c mount_bind.c
MODS := lookup_yp.so lookup_file.so lookup_program.so lookup_userhome.so \
- lookup_multi.so lookup_hosts.so \
+ lookup_multi.so lookup_hosts.so lookup_dir.so \
parse_sun.so \
mount_generic.so mount_nfs.so mount_afs.so mount_autofs.so \
mount_changer.so mount_bind.so
diff --git a/modules/lookup_dir.c b/modules/lookup_dir.c
new file mode 100644
index 0000000..658cc29
--- /dev/null
+++ b/modules/lookup_dir.c
@@ -0,0 +1,219 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * lookup_dir.c - module for including master files in a directory.
+ *
+ * Copyright 2011 Red Hat, Inc. All rights reserved.
+ * Copyright 2011 Masatake YAMATO
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ * USA; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+#define MODULE_LOOKUP
+#include "automount.h"
+#include "nsswitch.h"
+
+#define MODPREFIX "lookup(dir): "
+
+#define MAX_INCLUDE_DEPTH 16
+
+#define AUTOFS_DIR_EXT ".autofs"
+#define AUTOFS_DIR_EXTSIZ (sizeof(AUTOFS_DIR_EXT) - 1)
+
+struct lookup_context {
+ const char *mapname;
+};
+
+int lookup_version = AUTOFS_LOOKUP_VERSION; /* Required by protocol */
+
+
+int lookup_init(const char *mapfmt, int argc, const char *const *argv, void **context)
+{
+ struct lookup_context *ctxt;
+ char buf[MAX_ERR_BUF];
+ struct stat st;
+
+ *context = NULL;
+ ctxt = malloc(sizeof(struct lookup_context));
+ if (!ctxt) {
+ char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
+ logerr(MODPREFIX "malloc: %s", estr);
+ return 1;
+ }
+
+ if (argc < 1) {
+ free(ctxt);
+ logerr(MODPREFIX "No map name");
+ return 1;
+ }
+
+ ctxt->mapname = argv[0];
+
+ if (ctxt->mapname[0] != '/') {
+ free(ctxt);
+ logmsg(MODPREFIX
+ "dir map %s is not an absolute pathname", argv[0]);
+ return 1;
+ }
+
+ if (access(ctxt->mapname, R_OK)) {
+ free(ctxt);
+ warn(LOGOPT_NONE, MODPREFIX
+ "dir map %s missing or not readable", argv[0]);
+ return 1;
+ }
+
+ if (stat(ctxt->mapname, &st)) {
+ free(ctxt);
+ warn(LOGOPT_NONE, MODPREFIX
+ "dir map %s, could not stat", argv[0]);
+ return 1;
+ }
+
+ if ( (!S_ISDIR(st.st_mode)) && (!S_ISLNK(st.st_mode)) ) {
+ free(ctxt);
+ warn(LOGOPT_NONE, MODPREFIX
+ "dir map %s, is not a directory", argv[0]);
+ }
+
+ *context = ctxt;
+ return 0;
+}
+
+static int acceptable_dirent_p(const struct dirent *e)
+{
+ size_t namesz;
+
+
+ if (!(e->d_type == DT_REG || e->d_type == DT_LNK))
+ return 0;
+
+ namesz = strlen(e->d_name);
+ if (!namesz)
+ return 0;
+
+ if (e->d_name[0] == '.')
+ return 0;
+
+ if (namesz < AUTOFS_DIR_EXTSIZ + 1 ||
+ strcmp(e->d_name + (namesz - AUTOFS_DIR_EXTSIZ),
+ AUTOFS_DIR_EXT))
+ return 0;
+
+ return 1;
+}
+
+
+static int include_file(struct master *master, time_t age, struct lookup_context* ctxt, struct dirent *e)
+{
+ unsigned int logopt = master->logopt;
+ char included_path[PATH_MAX + 1];
+ int included_path_len;
+ char *save_name;
+ int status;
+
+ included_path_len = snprintf(included_path,
+ PATH_MAX + 1,
+ "%s/%s",
+ ctxt->mapname,
+ e->d_name);
+ if (included_path_len > PATH_MAX)
+ return NSS_STATUS_NOTFOUND;
+
+ save_name = master->name;
+ master->name = included_path;
+
+ master->depth++;
+ debug(logopt, MODPREFIX "include: %s", master->name);
+ status = lookup_nss_read_master(master, age);
+ if (!status) {
+ warn(logopt,
+ MODPREFIX
+ "failed to read included master map %s",
+ master->name);
+ }
+ master->depth--;
+
+ master->name = save_name;
+ return NSS_STATUS_SUCCESS;
+}
+
+
+int lookup_read_master(struct master *master, time_t age, void *context)
+{
+ int n, i;
+ struct dirent **namelist = NULL;
+ struct lookup_context *ctxt = (struct lookup_context *) context;
+ unsigned int logopt = master->logopt;
+ char buf[MAX_ERR_BUF];
+
+
+ if (master->depth > MAX_INCLUDE_DEPTH) {
+ error(logopt, MODPREFIX
+ "maximum include depth exceeded %s", master->name);
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ debug(logopt, MODPREFIX "scandir: %s", ctxt->mapname);
+ n = scandir(ctxt->mapname, &namelist, acceptable_dirent_p, versionsort);
+ if (n < 0) {
+ char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
+
+ error(logopt,
+ MODPREFIX "could not scan master map dir %s: %s",
+ ctxt->mapname,
+ estr);
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ for (i = 0; i < n; i++) {
+ struct dirent *e = namelist[i];
+
+ include_file(master, age, ctxt, e);
+ free(e);
+ }
+ free(namelist);
+
+ return NSS_STATUS_SUCCESS;
+}
+
+int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
+{
+ ap->entry->current = NULL;
+ master_source_current_signal(ap->entry);
+ return NSS_STATUS_UNKNOWN;
+}
+
+int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *context)
+{
+ ap->entry->current = NULL;
+ master_source_current_signal(ap->entry);
+ return NSS_STATUS_UNKNOWN;
+}
+
+int lookup_done(void *context)
+{
+ struct lookup_context *ctxt = (struct lookup_context *) context;
+
+ free(ctxt);
+ return 0;
+}
diff --git a/samples/auto.master b/samples/auto.master
index 9fe5609..72f086c 100644
--- a/samples/auto.master
+++ b/samples/auto.master
@@ -12,6 +12,10 @@
#
/net -hosts
#
+# Include /etc/auto.master.d/*.autofs
+#
++dir:/etc/auto.master.d
+#
# Include central master map if it can be found using
# nsswitch sources.
#
++++++ autofs-5.0.6-add-disable-move-mount-configure-option.patch ++++++
commit 393c50907e98de4814c911cb472a121194c5fa2a
Author: Ian Kent
Date: Thu Dec 1 15:28:32 2011 +0800
autofs-5.0.6 - add disable move mount configure option
With the introduction of systemd the root filesystem is now usually
marked as shared instead of private as part of the systemd sandbox
functionality. As a consequence moving a mount from one mount point
to another is not allowed.
To resolve this a configure option (--disable-move-mount) to disable
autofs preparing mount tree and then moving it into place has been
added. The move mount use in autofs was needed for a small set of
automount types with older kernels (prior to 2.6.39). So to disable
the use of move mount it's necessary to use a recent kernel.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -13,6 +13,7 @@
- fix wait for master source mutex.
- fix submount shutdown race.
- fix fix map source check in file lookup.
+- add disable move mount configure option.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/autofs.spec
===================================================================
--- autofs-5.0.6.orig/autofs.spec
+++ autofs-5.0.6/autofs.spec
@@ -57,7 +57,7 @@ inkludera n�tfilsystem, CD-ROM, floppydi
echo %{version}-%{release} > .version
%build
-CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc
+CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc --disable-mount-move
CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1
%install
Index: autofs-5.0.6/configure
===================================================================
--- autofs-5.0.6.orig/configure
+++ autofs-5.0.6/configure
@@ -704,6 +704,7 @@ with_openldap
with_sasl
enable_ext_env
enable_mount_locking
+enable_mount_move
enable_forced_shutdown
enable_ignore_busy
'
@@ -1326,6 +1327,7 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-ext-env disable search in environment for substitution variable
--disable-mount-locking disable use of locking when spawning mount command
+ --disable-mount-move disable use of mount move when when preparing tree of mounts
--enable-force-shutdown enable USR1 signal to force unlink umount of any
busy mounts during shutdown
--enable-ignore-busy enable exit without umounting busy mounts during
@@ -5348,6 +5350,22 @@ $as_echo "#define ENABLE_MOUNT_LOCKING 1
fi
+#
+# Disable use of mount move
+#
+# Check whether --enable-mount-move was given.
+if test "${enable_mount_move+set}" = set; then :
+ enableval=$enable_mount_move;
+else
+ enableval=yes
+fi
+
+if test x$enable_mount_move = xyes -o x$enableval = xyes; then
+
+$as_echo "#define ENABLE_MOUNT_MOVE 1" >>confdefs.h
+
+fi
+
#
# Enable forced shutdown on USR1 signal (unlink umounts all mounts).
#
Index: autofs-5.0.6/configure.in
===================================================================
--- autofs-5.0.6.orig/configure.in
+++ autofs-5.0.6/configure.in
@@ -324,6 +324,16 @@ if test x$enable_mount_locking = xyes -o
fi
#
+# Disable use of mount move
+#
+AC_ARG_ENABLE(mount-move,
+[ --disable-mount-move disable use of mount move when when preparing tree of mounts],,
+ enableval=yes)
+if test x$enable_mount_move = xyes -o x$enableval = xyes; then
+ AC_DEFINE(ENABLE_MOUNT_MOVE, 1, [Disable use of mount move when preparing tree of mounts])
+fi
+
+#
# Enable forced shutdown on USR1 signal (unlink umounts all mounts).
#
AC_ARG_ENABLE(forced-shutdown,
Index: autofs-5.0.6/daemon/automount.c
===================================================================
--- autofs-5.0.6.orig/daemon/automount.c
+++ autofs-5.0.6/daemon/automount.c
@@ -1743,9 +1743,20 @@ static void show_build_info(void)
count = 22;
#endif
+#ifndef ENABLE_MOUNT_MOVE
+ printf("DISABLE_MOUNT_MOVE ");
+ count = count + 19;
+#endif
+
#ifdef ENABLE_FORCED_SHUTDOWN
printf("ENABLE_FORCED_SHUTDOWN ");
count = count + 23;
+
+ if (count > 60) {
+ printf("\n ");
+ count = 0;
+ }
+
#endif
#ifdef ENABLE_IGNORE_BUSY_MOUNTS
Index: autofs-5.0.6/include/config.h.in
===================================================================
--- autofs-5.0.6.orig/include/config.h.in
+++ autofs-5.0.6/include/config.h.in
@@ -12,6 +12,9 @@
/* Disable use of locking when spawning mount command */
#undef ENABLE_MOUNT_LOCKING
+/* Disable use of mount move when preparing tree of mounts */
+#undef ENABLE_MOUNT_MOVE
+
/* define if you have E2FSCK */
#undef HAVE_E2FSCK
Index: autofs-5.0.6/modules/mount_nfs.c
===================================================================
--- autofs-5.0.6.orig/modules/mount_nfs.c
+++ autofs-5.0.6/modules/mount_nfs.c
@@ -163,11 +163,6 @@ int mount_mount(struct autofs_point *ap,
if (root[len - 1] == '/') {
len = snprintf(fullpath, len, "%s", root);
} else if (*name == '/') {
- /*
- * Direct or offset mount, name is absolute path so
- * don't use root (but with move mount changes root
- * is now the same as name).
- */
len = sprintf(fullpath, "%s", root);
} else {
len = sprintf(fullpath, "%s/%s", root, name);
Index: autofs-5.0.6/modules/parse_sun.c
===================================================================
--- autofs-5.0.6.orig/modules/parse_sun.c
+++ autofs-5.0.6/modules/parse_sun.c
@@ -1028,6 +1028,7 @@ static int parse_mapent(const char *ent,
return (p - ent);
}
+#ifdef ENABLE_MOUNT_MOVE
static int move_mount(struct autofs_point *ap,
const char *mm_tmp_root, const char *mm_root,
unsigned int move)
@@ -1063,6 +1064,7 @@ static int move_mount(struct autofs_poin
return 1;
}
+#endif
static void cleanup_multi_root(struct autofs_point *ap, const char *root,
const char *path, unsigned int move)
@@ -1145,6 +1147,7 @@ static void cleanup_multi_triggers(struc
return;
}
+#ifdef ENABLE_MOUNT_MOVE
static int check_fstype_autofs_option(const char *options)
{
char *tok, *tokbuf;
@@ -1171,24 +1174,27 @@ static int check_fstype_autofs_option(co
return found;
}
+#endif
static int mount_subtree(struct autofs_point *ap, struct mapent *me,
const char *name, char *loc, char *options, void *ctxt)
{
struct mapent *mm;
struct mapent *ro;
- char t_dir[] = "/tmp/autoXXXXXX";
- char *mnt_tmp_root, *mm_root, *mm_base, *mm_key;
+ char *mm_root, *mm_base, *mm_key;
const char *mnt_root, *target;
unsigned int mm_root_len, mnt_root_len;
int start, ret = 0, rv;
- unsigned int move;
+ unsigned int move = MOUNT_MOVE_NONE;
+#ifdef ENABLE_MOUNT_MOVE
+ char t_dir[] = "/tmp/autoXXXXXX";
+ char *mnt_tmp_root = NULL;
+#endif
rv = 0;
mm = me->multi;
mm_key = mm->key;
- move = MOUNT_MOVE_NONE;
if (*mm_key == '/') {
mm_root = mm_key;
@@ -1202,7 +1208,10 @@ static int mount_subtree(struct autofs_p
}
mm_root_len = strlen(mm_root);
- mnt_tmp_root = NULL;
+#ifndef ENABLE_MOUNT_MOVE
+ mnt_root = mm_root;
+ mnt_root_len = mm_root_len;
+#else
if (ap->flags & MOUNT_FLAG_REMOUNT) {
mnt_root = mm_root;
mnt_root_len = mm_root_len;
@@ -1213,6 +1222,7 @@ static int mount_subtree(struct autofs_p
mnt_root_len = strlen(mnt_root);
mnt_tmp_root = (char *) mnt_root;
}
+#endif
if (me == me->multi) {
/* name = NULL */
@@ -1238,11 +1248,13 @@ static int mount_subtree(struct autofs_p
}
ro_len = strlen(ro_loc);
+#ifdef ENABLE_MOUNT_MOVE
if (!(ap->flags & MOUNT_FLAG_REMOUNT)) {
move = MOUNT_MOVE_OTHER;
if (check_fstype_autofs_option(myoptions))
move = MOUNT_MOVE_AUTOFS;
}
+#endif
tmp = alloca(mnt_root_len + 1);
strcpy(tmp, mnt_root);
@@ -1266,7 +1278,9 @@ static int mount_subtree(struct autofs_p
goto error_out;
}
} else if (rv <= 0) {
+#ifdef ENABLE_MOUNT_MOVE
move = MOUNT_MOVE_NONE;
+#endif
ret = mount_multi_triggers(ap, me, mm_root, start, mm_base);
if (ret == -1) {
error(ap->logopt, MODPREFIX
@@ -1279,11 +1293,21 @@ static int mount_subtree(struct autofs_p
int loclen = strlen(loc);
int namelen = strlen(name);
+#ifndef ENABLE_MOUNT_MOVE
+ /*
+ * When using move mount to mount offsets or direct mounts
+ * the base of the tree can be the base of the temporary
+ * mount point it needs to be the full path when not moving
+ * the mount after construction.
+ */
+ mnt_root = name;
+#else
if (!(ap->flags & MOUNT_FLAG_REMOUNT)) {
move = MOUNT_MOVE_OTHER;
if (check_fstype_autofs_option(options))
move = MOUNT_MOVE_AUTOFS;
}
+#endif
/* name = mm_root + mm_base */
/* destination = mm_root + mm_base = name */
@@ -1303,7 +1327,9 @@ static int mount_subtree(struct autofs_p
} else if (rv < 0) {
char *mm_root_base = alloca(strlen(mm_root) + strlen(mm_base) + 1);
+#ifdef ENABLE_MOUNT_MOVE
move = MOUNT_MOVE_NONE;
+#endif
strcpy(mm_root_base, mm_root);
strcat(mm_root_base, mm_base);
@@ -1318,6 +1344,7 @@ static int mount_subtree(struct autofs_p
}
}
+#ifdef ENABLE_MOUNT_MOVE
if (!move_mount(ap, mnt_root, target, move)) {
cleanup_multi_triggers(ap, me, mnt_root, start, mm_base);
cleanup_multi_root(ap, mnt_root, mm_root, move);
@@ -1326,6 +1353,7 @@ static int mount_subtree(struct autofs_p
if (mnt_tmp_root)
rmdir(mnt_tmp_root);
+#endif
/* Mount for base of tree failed */
if (rv > 0)
@@ -1341,8 +1369,10 @@ static int mount_subtree(struct autofs_p
return rv;
error_out:
+#ifdef ENABLE_MOUNT_MOVE
if (mnt_tmp_root)
rmdir(mnt_tmp_root);
+#endif
return 1;
}
++++++ autofs-5.0.6-code-analysis-fixes-1.patch ++++++
commit 715030c02051817b41139b87d8a13a71e55e5018
Author: Ian Kent
Date: Thu Dec 1 15:25:17 2011 +0800
autofs-5.0.6 - code analysis fixes 1
Code analysis defect fixes, installment 1.
- fix signed usage of unsigned variable in do_srv_query().
- make NULL check handling of variable dcs explicit in get_dc_list().
- adding an explicit NULL check for variable dcs gaurds against
future changes in get_srv_rrs() returning success while not
clearing the dcs variable.
- makes it explict for readers why we don't need to check for NULL
before free later in the loop.
- fix typo in do_reconnect()
- uri is never set now and, at this point, we need to try to connect
to the last server uri (ctxt->uri->uri) which is set in find_server()
when ctxt->uri is NULL.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -7,6 +7,7 @@
- fix result null check in read_one_map().
- fix LDAP result leaks on error paths.
- fix fix LDAP result leaks on error paths.
+- code analysis fixes part 1.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/modules/dclist.c
===================================================================
--- autofs-5.0.6.orig/modules/dclist.c
+++ autofs-5.0.6/modules/dclist.c
@@ -69,7 +69,7 @@ static void dclist_mutex_unlock(void)
static int do_srv_query(unsigned int logopt, char *name, u_char **packet)
{
- unsigned int len = PACKETSZ;
+ int len = PACKETSZ;
unsigned int last_len = len;
char ebuf[MAX_ERR_BUF];
u_char *buf;
@@ -500,7 +500,8 @@ struct dclist *get_dc_list(unsigned int
}
dclist_mutex_lock();
- if (!get_srv_rrs(logopt, request, &dcs, &numdcs)) {
+ ret = get_srv_rrs(logopt, request, &dcs, &numdcs);
+ if (!ret | !dcs) {
error(logopt,
"DNS SRV query failed for domain %s", domain);
dclist_mutex_unlock();
@@ -526,8 +527,7 @@ struct dclist *get_dc_list(unsigned int
if (!tmp) {
char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
error(logopt, "realloc: %s", estr);
- if (dcs)
- free_srv_rrs(dcs, numdcs);
+ free_srv_rrs(dcs, numdcs);
goto out_error;
}
@@ -548,8 +548,7 @@ struct dclist *get_dc_list(unsigned int
if (ret > 6) {
error(logopt,
"invalid port: %u", dcs[i].port);
- if (dcs)
- free_srv_rrs(dcs, numdcs);
+ free_srv_rrs(dcs, numdcs);
goto out_error;
}
strcat(tmp, port);
Index: autofs-5.0.6/modules/lookup_ldap.c
===================================================================
--- autofs-5.0.6.orig/modules/lookup_ldap.c
+++ autofs-5.0.6/modules/lookup_ldap.c
@@ -736,7 +736,6 @@ static LDAP *find_server(unsigned logopt
static LDAP *do_reconnect(unsigned logopt, struct lookup_context *ctxt)
{
LDAP *ldap = NULL;
- char *uri;
if (ctxt->server || !ctxt->uris) {
ldap = do_connect(logopt, ctxt->server, ctxt);
@@ -780,7 +779,7 @@ static LDAP *do_reconnect(unsigned logop
*/
if (!ldap) {
autofs_sasl_dispose(ctxt);
- ldap = connect_to_server(logopt, uri, ctxt);
+ ldap = connect_to_server(logopt, ctxt->uri->uri, ctxt);
}
#endif
if (ldap)
++++++ autofs-5.0.6-fix-LDAP-result-leaks-on-error-paths.patch ++++++
commit 841023c590621a5794945b3ab16a3d1e24653432
Author: Leonardo Chiquitto
Date: Thu Dec 1 15:22:51 2011 +0800
autofs-5.0.6 - Fix LDAP result leaks on error paths
According to ldap_search_s(3), the result structure must be freed
with ldap_msgfree() even when the search function returned failure.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -5,6 +5,7 @@
- fix paged query more results check.
- fix dumpmaps not reading maps.
- fix result null check in read_one_map().
+- fix LDAP result leaks on error paths.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/modules/lookup_ldap.c
===================================================================
--- autofs-5.0.6.orig/modules/lookup_ldap.c
+++ autofs-5.0.6/modules/lookup_ldap.c
@@ -347,6 +347,8 @@ static int get_query_dn(unsigned logopt,
error(logopt,
MODPREFIX "query failed for %s: %s",
query, ldap_err2string(rv));
+ if (result)
+ ldap_msgfree(result);
free(query);
return 0;
}
@@ -1573,6 +1575,8 @@ int lookup_read_master(struct master *ma
error(logopt, MODPREFIX "query failed for %s: %s",
query, ldap_err2string(rv));
unbind_ldap_connection(logging, ldap, ctxt);
+ if (result)
+ ldap_msgfree(result);
free(query);
return NSS_STATUS_NOTFOUND;
}
@@ -2586,6 +2590,8 @@ static int lookup_one(struct autofs_poin
if ((rv != LDAP_SUCCESS) || !result) {
crit(ap->logopt, MODPREFIX "query failed for %s", query);
unbind_ldap_connection(ap->logopt, ldap, ctxt);
+ if (result)
+ ldap_msgfree(result);
free(query);
return CHE_FAIL;
}
++++++ autofs-5.0.6-fix-MNT_DETACH-define.patch ++++++
commit 4fe89d1f0dfafd759d7022f4ab5a4bf4f5407c87
Author: Ian Kent
Date: Thu Dec 1 22:10:34 2011 +0800
autofs-5.0.6 - fix MNT_DETACH define
MNT_DETACH has been included in herder file
Index: autofs-5.0.6/include/automount.h
===================================================================
--- autofs-5.0.6.orig/include/automount.h
+++ autofs-5.0.6/include/automount.h
@@ -333,7 +333,9 @@ int ncat_path(char *buf, size_t len,
/* Core automount definitions */
+#ifndef MNT_DETACH
#define MNT_DETACH 0x00000002 /* Just detach from the tree */
+#endif
struct startup_cond {
pthread_mutex_t mutex;
++++++ autofs-5.0.6-fix-dumpmaps-not-reading-maps.patch ++++++
commit 597702e403533dc546b8d4bca126fe7f1b6f3c08
Author: Ian Kent
Date: Thu Dec 1 14:54:13 2011 +0800
autofs-5.0.6 - fix dumpmaps not reading maps
The lookup modules won't read any indirect map entries (other than those
in a file map) unless unless the browse option is set. In order to list
the entries when tyhe dumpmap option is given the browse option needs to
be set.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -3,6 +3,7 @@
- fix ipv6 name for lookup fix.
- improve mount location error reporting.
- fix paged query more results check.
+- fix dumpmaps not reading maps.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/lib/master.c
===================================================================
--- autofs-5.0.6.orig/lib/master.c
+++ autofs-5.0.6/lib/master.c
@@ -1283,6 +1283,15 @@ int master_show_mounts(struct master *ma
printf("\nMount point: %s\n", ap->path);
printf("\nsource(s):\n");
+ /*
+ * Ensure we actually read indirect map entries so we can
+ * list them. The map reads won't read any indirect map
+ * entries (other than those in a file map) unless the
+ * browse option is set.
+ */
+ if (ap->type == LKP_INDIRECT)
+ ap->flags |= MOUNT_FLAG_GHOST;
+
/* Read the map content into the cache */
if (lookup_nss_read_map(ap, NULL, now))
lookup_prune_cache(ap, now);
++++++ autofs-5.0.6-fix-fix-LDAP-result-leaks-on-error-paths.patch ++++++
commit e2178565b79d5f84e99d60e668f66979a54a0ac7
Author: Ian Kent
Date: Thu Dec 1 15:24:45 2011 +0800
autofs-5.0.6 - fix fix LDAP result leaks on error paths
The previous patch with which ensured that the result struture returned
from ldap_search_s(3) was freed could sometimes lead to a segmentation
fault because the local variable used was not initialized before use.
diff --git a/CHANGELOG b/CHANGELOG
index dc91c25..d7c20ca 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,7 @@
- fix dumpmaps not reading maps.
- fix result null check in read_one_map().
- fix LDAP result leaks on error paths.
+- fix fix LDAP result leaks on error paths.
28/06/2011 autofs-5.0.6
-----------------------
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
index 29323b2..d8e93e7 100644
--- a/modules/lookup_ldap.c
+++ b/modules/lookup_ldap.c
@@ -280,7 +280,7 @@ static int get_query_dn(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt
{
char buf[MAX_ERR_BUF];
char *query, *dn, *qdn;
- LDAPMessage *result, *e;
+ LDAPMessage *result = NULL, *e;
struct ldap_searchdn *sdns = NULL;
char *attrs[2];
struct berval **value;
@@ -1529,7 +1529,7 @@ int lookup_read_master(struct master *master, time_t age, void *context)
char buf[MAX_ERR_BUF];
char parse_buf[PARSE_MAX_BUF];
char *query;
- LDAPMessage *result, *e;
+ LDAPMessage *result = NULL, *e;
char *class, *info, *entry;
char **keyValue = NULL;
char **values = NULL;
@@ -2475,7 +2475,7 @@ static int lookup_one(struct autofs_point *ap,
char buf[MAX_ERR_BUF];
time_t age = time(NULL);
char *query;
- LDAPMessage *result, *e;
+ LDAPMessage *result = NULL, *e;
char *class, *info, *entry;
char *enc_key1, *enc_key2;
int enc_len1 = 0, enc_len2 = 0;
++++++ autofs-5.0.6-fix-fix-map-source-check-in-file-lookup.patch ++++++
commit 939b1e8973becb8497645fd5af75511004fd96d8
Author: Ian Kent
Date: Thu Dec 1 15:28:08 2011 +0800
autofs-5.0.6 - fix fix map source check in file lookup
A recent change to correct a problem with included map entry removal
has broken a different case of included map key lookup. The check in
previous patch was too broad and caused map key lookup for keys in an
included multi-mount map entrys to not be found.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -12,6 +12,7 @@
- add "dir" map-type.
- fix wait for master source mutex.
- fix submount shutdown race.
+- fix fix map source check in file lookup.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/modules/lookup_file.c
===================================================================
--- autofs-5.0.6.orig/modules/lookup_file.c
+++ autofs-5.0.6/modules/lookup_file.c
@@ -1046,7 +1046,7 @@ do_cache_lookup:
* instance (same map entry cache), not in a distinct source.
*/
if (me && (!me->mapent ||
- (ap->type == LKP_INDIRECT && me->source != source))) {
+ (me->source != source && *me->key != '/'))) {
while ((me = cache_lookup_key_next(me)))
if (me->source == source)
break;
++++++ autofs-5.0.6-fix-ipv6-configure-check.patch ++++++
commit 4ab414f80b9e82ff5043bff5ad79c0c720f64430
Author: Ian Kent
Date: Thu Dec 1 18:35:43 2011 +0800
autofs-5.0.6 - fix ipv6 configure check
Since the functions clntudp6_bufcreate() and clnttcp6_create() of
libtirpc were never actually included in the library our reference
to clntudp6_bufcreate() in configure needs to be removed.
Having redone the libtirpc interface (after realizing these functions
were defined but not actually included in the library) checking for
IPv6 support can't be done now and we need to rely on the transport
independent nature of libtirpc to take care of this. So the INET6
checks have been replaced with WITH_LIBTIRPC checks instead.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -16,6 +16,7 @@
- add disable move mount configure option.
- fix ipv6 name lookup check.
- fix ipv6 rpc calls.
+- fix ipv6 configure check.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/aclocal.m4
===================================================================
--- autofs-5.0.6.orig/aclocal.m4
+++ autofs-5.0.6/aclocal.m4
@@ -324,41 +324,6 @@ LIBS="$af_check_ldap_parse_page_control_
])
dnl --------------------------------------------------------------------------
-dnl AF_CHECK_LIBTIRPC_IPV6
-dnl
-dnl Use libtirpc for rpc transport
-dnl --------------------------------------------------------------------------
-AC_DEFUN([AF_CHECK_LIBTIRPC_IPV6],
-[AC_MSG_CHECKING(if libtirpc has IPv6 support)
-
-# save current flags
-af_check_libtirpc_ipv6_save_cflags="$CFLAGS"
-af_check_libtirpc_ipv6_save_ldflags="$LDFLAGS"
-CFLAGS="$CFLAGS -I/usr/include/tirpc"
-LDFLAGS="$LDFLAGS -ltirpc"
-
-AC_TRY_LINK(
- [ #define INET6
- #include ],
- [ CLIENT *cl;
- struct sockaddr_in6 addr;
- int fd;
- unsigned long ul; struct timeval t; unsigned int ui;
- cl = clntudp6_bufcreate(&addr,ul,ul,t,&fd,ui,ui); ],
- [ af_have_libtirpc_ipv6=yes
- AC_MSG_RESULT(yes) ],
- [ AC_MSG_RESULT(no) ])
-
-if test "$af_have_libtirpc_ipv6" = "yes"; then
- AC_DEFINE(INET6,1, [Use IPv6 with libtirpc])
-fi
-
-# restore flags
-CFLAGS="$af_check_libtirpc_ipv6_save_cflags"
-LDFLAGS="$af_check_libtirpc_ipv6_save_ldflags"
-])
-
-dnl --------------------------------------------------------------------------
dnl AF_CHECK_LIBTIRPC
dnl
dnl Use libtirpc for rpc transport
@@ -399,7 +364,6 @@ AC_ARG_WITH(libtirpc,
[ --with-libtirpc use libtirpc if available],
[if test "$withval" = yes; then
AF_CHECK_LIBTIRPC()
- AF_CHECK_LIBTIRPC_IPV6()
else
AC_MSG_RESULT(no)
fi], [AC_MSG_RESULT(no)])
Index: autofs-5.0.6/configure
===================================================================
--- autofs-5.0.6.orig/configure
+++ autofs-5.0.6/configure
@@ -3087,52 +3087,6 @@ fi
CFLAGS="$af_check_libtirpc_save_cflags"
LDFLAGS="$af_check_libtirpc_save_ldflags"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtirpc has IPv6 support" >&5
-$as_echo_n "checking if libtirpc has IPv6 support... " >&6; }
-
-# save current flags
-af_check_libtirpc_ipv6_save_cflags="$CFLAGS"
-af_check_libtirpc_ipv6_save_ldflags="$LDFLAGS"
-CFLAGS="$CFLAGS -I/usr/include/tirpc"
-LDFLAGS="$LDFLAGS -ltirpc"
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- #define INET6
- #include
-int
-main ()
-{
- CLIENT *cl;
- struct sockaddr_in6 addr;
- int fd;
- unsigned long ul; struct timeval t; unsigned int ui;
- cl = clntudp6_bufcreate(&addr,ul,ul,t,&fd,ui,ui);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- af_have_libtirpc_ipv6=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-if test "$af_have_libtirpc_ipv6" = "yes"; then
-
-$as_echo "#define INET6 1" >>confdefs.h
-
-fi
-
-# restore flags
-CFLAGS="$af_check_libtirpc_ipv6_save_cflags"
-LDFLAGS="$af_check_libtirpc_ipv6_save_ldflags"
-
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
Index: autofs-5.0.6/include/config.h.in
===================================================================
--- autofs-5.0.6.orig/include/config.h.in
+++ autofs-5.0.6/include/config.h.in
@@ -72,9 +72,6 @@
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
-/* Use IPv6 with libtirpc */
-#undef INET6
-
/* Use libxml2 tsd usage workaround */
#undef LIBXML2_WORKAROUND
Index: autofs-5.0.6/modules/replicated.c
===================================================================
--- autofs-5.0.6.orig/modules/replicated.c
+++ autofs-5.0.6/modules/replicated.c
@@ -180,7 +180,7 @@ static unsigned int get_proximity(struct
break;
case AF_INET6:
-#ifndef INET6
+#ifndef WITH_LIBTIRPC
return PROXIMITY_UNSUPPORTED;
#else
addr6 = (struct sockaddr_in6 *) host_addr;
@@ -229,7 +229,9 @@ static unsigned int get_proximity(struct
break;
case AF_INET6:
-#ifdef INET6
+#ifndef WITH_LIBTIRPC
+ return PROXIMITY_UNSUPPORTED;
+#else
if (host_addr->sa_family == AF_INET)
break;
@@ -309,7 +311,9 @@ static unsigned int get_proximity(struct
break;
case AF_INET6:
-#ifdef INET6
+#ifndef WITH_LIBTIRPC
+ return PROXIMITY_UNSUPPORTED;
+#else
if (host_addr->sa_family == AF_INET)
break;
++++++ autofs-5.0.6-fix-ipv6-name-lookup-check.patch ++++++
commit fd0d9f0355b181ff0e5fec8e93512642a2e9152e
Author: Ian Kent
Date: Thu Dec 1 18:34:49 2011 +0800
autofs-5.0.6 - fix ipv6 name lookup check
The host address must be used when the host name has multiple
addresses since we need to mount the specific host and so that
it is known what host log entries refer to.
But the check for multiple addresses can be wrong because there
is no distinction between ipv4 and ipv6 addresses. Change the
check to use the host name when mounting if neither the ipv4
or the ipv6 addresses have more than one record.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -14,6 +14,7 @@
- fix submount shutdown race.
- fix fix map source check in file lookup.
- add disable move mount configure option.
+- fix ipv6 name lookup check.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/modules/replicated.c
===================================================================
--- autofs-5.0.6.orig/modules/replicated.c
+++ autofs-5.0.6/modules/replicated.c
@@ -1117,7 +1117,7 @@ static int add_host_addrs(struct host **
char *name = n_ptr = strdup(host);
int len;
char buf[MAX_ERR_BUF];
- int rr = 0;
+ int rr = 0, rr4 = 0, rr6 = 0;
int ret;
if (!name) {
@@ -1167,8 +1167,21 @@ try_name:
}
this = ni;
- if (this->ai_next)
+ while (this->ai_next) {
+ if (this->ai_family == AF_INET) {
+ struct sockaddr_in *addr = (struct sockaddr_in *) this->ai_addr;
+ if (addr->sin_addr.s_addr != INADDR_LOOPBACK)
+ rr4++;
+ } else if (this->ai_family == AF_INET6) {
+ struct sockaddr_in6 *addr = (struct sockaddr_in6 *) this->ai_addr;
+ if (!IN6_IS_ADDR_LOOPBACK(addr->sin6_addr.__in6_u.__u6_addr32))
+ rr6++;
+ }
+ this = this->ai_next;
+ }
+ if (rr4 > 1 || rr6 > 1)
rr++;
+ this = ni;
while (this) {
ret = add_new_host(list, host, weight, this, rr, options);
if (!ret)
++++++ autofs-5.0.6-fix-ipv6-rpc-calls.patch ++++++
commit f8ea2a5762f65b1e45c21aa3676bf18bb5e37680
Author: Ian Kent
Date: Thu Dec 1 18:35:12 2011 +0800
autofs-5.0.6 - fix ipv6 rpc calls
There is a mistake in the way autofs uses libtirpc. Two IPv6 compatibiliy
functions were thought to be included when in fact they were not and would
not actually work with IPv6 anyway.
To fix that the libtirpc interface code needed to be re-written. Portmap
(using libtirpc calls) is still used to get service port numbers, rather
than rpcbind.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -15,6 +15,7 @@
- fix fix map source check in file lookup.
- add disable move mount configure option.
- fix ipv6 name lookup check.
+- fix ipv6 rpc calls.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/lib/rpc_subs.c
===================================================================
--- autofs-5.0.6.orig/lib/rpc_subs.c
+++ autofs-5.0.6/lib/rpc_subs.c
@@ -62,89 +62,6 @@ static const rpcvers_t mount_vers[] = {
static int connect_nb(int, struct sockaddr *, socklen_t, struct timeval *);
inline void dump_core(void);
-static CLIENT *rpc_clntudp_create(struct sockaddr *addr, struct conn_info *info, int *fd)
-{
- struct sockaddr_in *in4_raddr;
- struct sockaddr_in6 *in6_raddr;
- CLIENT *client = NULL;
-
- switch (addr->sa_family) {
- case AF_INET:
- in4_raddr = (struct sockaddr_in *) addr;
- in4_raddr->sin_port = htons(info->port);
- client = clntudp_bufcreate(in4_raddr,
- info->program, info->version,
- info->timeout, fd,
- info->send_sz, info->recv_sz);
- break;
-
- case AF_INET6:
-#ifndef INET6
- /* Quiet compile warning */
- in6_raddr = NULL;
-#else
- in6_raddr = (struct sockaddr_in6 *) addr;
- in6_raddr->sin6_port = htons(info->port);
- client = clntudp6_bufcreate(in6_raddr,
- info->program, info->version,
- info->timeout, fd,
- info->send_sz, info->recv_sz);
-#endif
- break;
-
- default:
- break;
- }
-
- return client;
-}
-
-static CLIENT *rpc_clnttcp_create(struct sockaddr *addr, struct conn_info *info, int *fd)
-{
- struct sockaddr_in *in4_raddr;
- struct sockaddr_in6 *in6_raddr;
- CLIENT *client = NULL;
- socklen_t slen;
-
- switch (addr->sa_family) {
- case AF_INET:
- in4_raddr = (struct sockaddr_in *) addr;
- in4_raddr->sin_port = htons(info->port);
- slen = sizeof(struct sockaddr_in);
-
- if (connect_nb(*fd, addr, slen, &info->timeout) < 0)
- break;
-
- client = clnttcp_create(in4_raddr,
- info->program, info->version, fd,
- info->send_sz, info->recv_sz);
- break;
-
- case AF_INET6:
-#ifndef INET6
- /* Quiet compile warning */
- in6_raddr = NULL;
-#else
- in6_raddr = (struct sockaddr_in6 *) addr;
- in6_raddr->sin6_port = htons(info->port);
- slen = sizeof(struct sockaddr_in6);
-
- if (connect_nb(*fd, addr, slen, &info->timeout) < 0)
- break;
-
- client = clnttcp6_create(in6_raddr,
- info->program, info->version, fd,
- info->send_sz, info->recv_sz);
-#endif
- break;
-
- default:
- break;
- }
-
- return client;
-}
-
/*
* Perform a non-blocking connect on the socket fd.
*
@@ -232,12 +149,12 @@ done:
return ret;
}
+#ifndef WITH_LIBTIRPC
static CLIENT *rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, int *fd)
{
CLIENT *client = NULL;
- struct sockaddr *laddr;
struct sockaddr_in in4_laddr;
- struct sockaddr_in6 in6_laddr;
+ struct sockaddr_in in4_raddr;
int type, proto;
socklen_t slen;
@@ -252,48 +169,41 @@ static CLIENT *rpc_do_create_client(stru
* layer, it would bind to a reserved port, which has been shown
* to exhaust the reserved port range in some situations.
*/
- switch (addr->sa_family) {
- case AF_INET:
- in4_laddr.sin_family = AF_INET;
- in4_laddr.sin_port = htons(0);
- in4_laddr.sin_addr.s_addr = htonl(INADDR_ANY);
- slen = sizeof(struct sockaddr_in);
- laddr = (struct sockaddr *) &in4_laddr;
- break;
-
- case AF_INET6:
-#ifndef INET6
- /* Quiet compiler */
- in6_laddr.sin6_family = AF_INET6;
- return NULL;
-#else
- in6_laddr.sin6_family = AF_INET6;
- in6_laddr.sin6_port = htons(0);
- in6_laddr.sin6_addr = in6addr_any;
- slen = sizeof(struct sockaddr_in6);
- laddr = (struct sockaddr *) &in6_laddr;
- break;
-#endif
- default:
- return NULL;
- }
+ in4_laddr.sin_family = AF_INET;
+ in4_laddr.sin_port = htons(0);
+ in4_laddr.sin_addr.s_addr = htonl(INADDR_ANY);
+ slen = sizeof(struct sockaddr_in);
if (!info->client) {
+ struct sockaddr *laddr;
+
*fd = open_sock(addr->sa_family, type, proto);
if (*fd < 0)
return NULL;
+ laddr = (struct sockaddr *) &in4_laddr;
if (bind(*fd, laddr, slen) < 0)
return NULL;
}
+ in4_raddr = (struct sockaddr_in *) addr;
+ in4_raddr->sin_port = htons(info->port);
+
switch (info->proto->p_proto) {
case IPPROTO_UDP:
- client = rpc_clntudp_create(addr, info, fd);
+ client = clntudp_bufcreate(in4_raddr,
+ info->program, info->version,
+ info->timeout, fd,
+ info->send_sz, info->recv_sz);
break;
case IPPROTO_TCP:
- client = rpc_clnttcp_create(addr, info, fd);
+ if (connect_nb(*fd, addr, slen, &info->timeout) < 0)
+ break;
+
+ client = clnttcp_create(in4_raddr,
+ info->program, info->version, fd,
+ info->send_sz, info->recv_sz);
break;
default:
@@ -302,20 +212,126 @@ static CLIENT *rpc_do_create_client(stru
return client;
}
+#else
+struct netconfig *find_netconf(void *handle, char *family, char *proto)
+{
+ struct netconfig *nconf;
+
+ while ((nconf = getnetconfig(handle))) {
+ if ((strcmp(nconf->nc_protofmly, family) == 0) &&
+ (strcmp(nconf->nc_proto, proto) == 0))
+ break;
+ }
+
+ return nconf;
+}
+
+static CLIENT *rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, int *fd)
+{
+ CLIENT *client = NULL;
+ struct sockaddr_in in4_laddr;
+ struct sockaddr_in6 in6_laddr;
+ struct sockaddr *laddr = NULL;
+ struct netconfig *nconf;
+ struct netbuf nb_addr;
+ int type, proto;
+ char *nc_family, *nc_proto;
+ void *handle;
+ size_t slen;
+
+ proto = info->proto->p_proto;
+ if (proto == IPPROTO_UDP) {
+ type = SOCK_DGRAM;
+ nc_proto = NC_UDP;
+ } else {
+ type = SOCK_STREAM;
+ nc_proto = NC_TCP;
+ }
+
+ /*
+ * bind to any unused port. If we left this up to the rpc
+ * layer, it would bind to a reserved port, which has been shown
+ * to exhaust the reserved port range in some situations.
+ */
+ if (addr->sa_family == AF_INET) {
+ struct sockaddr_in *in4_raddr = (struct sockaddr_in *) addr;
+ in4_laddr.sin_family = AF_INET;
+ in4_laddr.sin_port = htons(0);
+ in4_laddr.sin_addr.s_addr = htonl(INADDR_ANY);
+ laddr = (struct sockaddr *) &in4_laddr;
+ in4_raddr->sin_port = htons(info->port);
+ slen = sizeof(struct sockaddr_in);
+ nc_family = NC_INET;
+ } else if (addr->sa_family == AF_INET6) {
+ struct sockaddr_in6 *in6_raddr = (struct sockaddr_in6 *) addr;
+ in6_laddr.sin6_family = AF_INET6;
+ in6_laddr.sin6_port = htons(0);
+ in6_laddr.sin6_addr = in6addr_any;
+ laddr = (struct sockaddr *) &in6_laddr;
+ in6_raddr->sin6_port = htons(info->port);
+ slen = sizeof(struct sockaddr_in6);
+ nc_family = NC_INET6;
+ } else
+ return NULL;
+
+ handle = setnetconfig();
+ if (!handle)
+ return NULL;
+
+ nconf = find_netconf(handle, nc_family, nc_proto);
+ if (!nconf) {
+ endnetconfig(handle);
+ return NULL;
+ }
+
+ /*
+ * bind to any unused port. If we left this up to the rpc layer,
+ * it would bind to a reserved port, which has been shown to
+ * exhaust the reserved port range in some situations.
+ */
+ if (!info->client) {
+ *fd = open_sock(addr->sa_family, type, proto);
+ if (*fd < 0) {
+ endnetconfig(handle);
+ return NULL;
+ }
+
+ if (bind(*fd, laddr, slen) < 0) {
+ endnetconfig(handle);
+ return NULL;
+ }
+ }
+
+ nb_addr.maxlen = nb_addr.len = slen;
+ nb_addr.buf = addr;
+
+ if (info->proto->p_proto == IPPROTO_TCP) {
+ if (connect_nb(*fd, addr, slen, &info->timeout) < 0) {
+ endnetconfig(handle);
+ return NULL;
+ }
+ }
+
+ client = clnt_tli_create(*fd, nconf, &nb_addr,
+ info->program, info->version,
+ info->send_sz, info->recv_sz);
+
+ endnetconfig(handle);
+
+ return client;
+}
+#endif
/*
- * Create a UDP RPC client
+ * Create an RPC client
*/
-static CLIENT *create_udp_client(struct conn_info *info)
+static CLIENT *create_client(struct conn_info *info)
{
CLIENT *client = NULL;
struct addrinfo *ai, *haddr;
struct addrinfo hints;
int fd, ret;
- if (info->proto->p_proto != IPPROTO_UDP)
- return NULL;
-
fd = RPC_ANYSOCK;
if (info->client) {
@@ -355,6 +371,11 @@ static CLIENT *create_udp_client(struct
haddr = ai;
while (haddr) {
+ if (haddr->ai_protocol != info->proto->p_proto) {
+ haddr = haddr->ai_next;
+ continue;
+ }
+
client = rpc_do_create_client(haddr->ai_addr, info, &fd);
if (client)
break;
@@ -408,7 +429,7 @@ int rpc_udp_getclient(struct conn_info *
info->program = program;
info->version = version;
- client = create_udp_client(info);
+ client = create_client(info);
if (!client)
return 0;
@@ -428,92 +449,6 @@ void rpc_destroy_udp_client(struct conn_
return;
}
-/*
- * Create a TCP RPC client using non-blocking connect
- */
-static CLIENT *create_tcp_client(struct conn_info *info)
-{
- CLIENT *client = NULL;
- struct addrinfo *ai, *haddr;
- struct addrinfo hints;
- int fd, ret;
-
- if (info->proto->p_proto != IPPROTO_TCP)
- return NULL;
-
- fd = RPC_ANYSOCK;
-
- if (info->client) {
- if (!clnt_control(info->client, CLGET_FD, (char *) &fd)) {
- fd = RPC_ANYSOCK;
- clnt_destroy(info->client);
- info->client = NULL;
- } else {
- clnt_control(info->client, CLSET_FD_NCLOSE, NULL);
- clnt_destroy(info->client);
- }
- }
-
- if (info->addr) {
- client = rpc_do_create_client(info->addr, info, &fd);
- if (client)
- goto done;
-
- if (!info->client) {
- close(fd);
- fd = RPC_ANYSOCK;
- }
- }
-
- memset(&hints, 0, sizeof(hints));
- hints.ai_flags = AI_ADDRCONFIG;
- hints.ai_family = AF_UNSPEC;
- hints.ai_socktype = SOCK_STREAM;
-
- ret = getaddrinfo(info->host, NULL, &hints, &ai);
- if (ret) {
- error(LOGOPT_ANY,
- "hostname lookup failed: %s", gai_strerror(ret));
- info->client = NULL;
- goto out_close;
- }
-
- haddr = ai;
- while (haddr) {
- client = rpc_do_create_client(haddr->ai_addr, info, &fd);
- if (client)
- break;
-
- if (!info->client && fd != RPC_ANYSOCK) {
- close(fd);
- fd = RPC_ANYSOCK;
- }
-
- haddr = haddr->ai_next;
- }
-
- freeaddrinfo(ai);
-
- if (!client) {
- info->client = NULL;
- goto out_close;
- }
-done:
- /* Close socket fd on destroy, as is default for rpcowned fds */
- if (!clnt_control(client, CLSET_FD_CLOSE, NULL)) {
- clnt_destroy(client);
- info->client = NULL;
- goto out_close;
- }
-
- return client;
-
-out_close:
- if (fd != -1)
- close(fd);
- return NULL;
-}
-
int rpc_tcp_getclient(struct conn_info *info,
unsigned int program, unsigned int version)
{
@@ -533,7 +468,7 @@ int rpc_tcp_getclient(struct conn_info *
info->program = program;
info->version = version;
- client = create_tcp_client(info);
+ client = create_client(info);
if (!client)
return 0;
@@ -593,12 +528,9 @@ int rpc_portmap_getclient(struct conn_in
info->close_option = option;
info->client = NULL;
- if (pe_proto->p_proto == IPPROTO_TCP) {
+ if (pe_proto->p_proto == IPPROTO_TCP)
info->timeout.tv_sec = PMAP_TOUT_TCP;
- client = create_tcp_client(info);
- } else
- client = create_udp_client(info);
-
+ client = create_client(info);
if (!client)
return 0;
@@ -635,11 +567,7 @@ unsigned short rpc_portmap_getport(struc
pmap_info.send_sz = RPCSMALLMSGSIZE;
pmap_info.recv_sz = RPCSMALLMSGSIZE;
- if (proto == IPPROTO_TCP)
- client = create_tcp_client(&pmap_info);
- else
- client = create_udp_client(&pmap_info);
-
+ client = create_client(&pmap_info);
if (!client)
return 0;
}
@@ -700,10 +628,8 @@ int rpc_ping_proto(struct conn_info *inf
if (info->proto->p_proto == IPPROTO_UDP) {
info->send_sz = UDPMSGSIZE;
info->recv_sz = UDPMSGSIZE;
- client = create_udp_client(info);
- } else
- client = create_tcp_client(info);
-
+ }
+ client = create_client(info);
if (!client)
return 0;
}
@@ -857,10 +783,8 @@ static int rpc_get_exports_proto(struct
if (info->proto->p_proto == IPPROTO_UDP) {
info->send_sz = UDPMSGSIZE;
info->recv_sz = UDPMSGSIZE;
- client = create_udp_client(info);
- } else
- client = create_tcp_client(info);
-
+ }
+ client = create_client(info);
if (!client)
return 0;
Index: autofs-5.0.6/modules/replicated.c
===================================================================
--- autofs-5.0.6.orig/modules/replicated.c
+++ autofs-5.0.6/modules/replicated.c
@@ -1095,7 +1095,13 @@ static int add_new_host(struct host **li
if (prx == PROXIMITY_ERROR)
return 0;
- addr_len = sizeof(struct sockaddr);
+ if (host_addr->ai_addr->sa_family == AF_INET)
+ addr_len = INET_ADDRSTRLEN;
+ else if (host_addr->ai_addr->sa_family == AF_INET6)
+ addr_len = INET6_ADDRSTRLEN;
+ else
+ return 0;
+
new = new_host(host, host_addr->ai_addr, addr_len, prx, weight, options);
if (!new)
return 0;
++++++ autofs-5.0.6-fix-libtirpc-name-typo.patch ++++++
Fix typo in libtirpc file name
The library file name was misspelled as libitirpc.so.
Index: autofs-5.0.6/daemon/automount.c
===================================================================
--- autofs-5.0.6.orig/daemon/automount.c
+++ autofs-5.0.6/daemon/automount.c
@@ -2225,9 +2225,9 @@ int main(int argc, char *argv[])
xmlInitParser();
#endif
#ifdef TIRPC_WORKAROUND
- void *dh_tirpc = dlopen("libitirpc.so", RTLD_NOW);
+ void *dh_tirpc = dlopen("libtirpc.so", RTLD_NOW);
if (!dh_tirpc)
- dh_tirpc = dlopen("libitirpc.so.1", RTLD_NOW);
+ dh_tirpc = dlopen("libtirpc.so.1", RTLD_NOW);
#endif
if (!master_read_master(master_list, age, 0)) {
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -21,6 +21,7 @@
- add systemd unit support.
- remove empty command line arguments (passed by systemd).
- fix rpc build error.
+- fix typo in libtirpc file name.
28/06/2011 autofs-5.0.6
-----------------------
++++++ autofs-5.0.6-fix-lsb-service-name-in-init-script-2.patch ++++++
commit c22fece4bc4c1245cdb7e6960c25e5ee0bf403a0
Author: Ian Kent
Date: Thu Dec 1 15:29:00 2011 +0800
autofs-5.0.6 - fix lsb service name in init script 2
The "Required-Start:" and "Required-Stop:" in the init script header
incorrectly uses $ypbind instead of ypbind. This isn't correct as
using names starting with a $ is reserved for standards-defined
facilities.
Index: autofs-5.0.6/redhat/autofs.init.in
===================================================================
--- autofs-5.0.6.orig/redhat/autofs.init.in
+++ autofs-5.0.6/redhat/autofs.init.in
@@ -9,8 +9,8 @@
#
### BEGIN INIT INFO
# Provides: autofs
-# Required-Start: $network $ypbind
-# Required-Stop: $network $ypbind
+# Required-Start: $network ypbind
+# Required-Stop: $network ypbind
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Automounts filesystems on demand
Index: autofs-5.0.6/samples/rc.autofs.in
===================================================================
--- autofs-5.0.6.orig/samples/rc.autofs.in
+++ autofs-5.0.6/samples/rc.autofs.in
@@ -8,8 +8,8 @@
#
### BEGIN INIT INFO
# Provides: autofs
-# Required-Start: $network $ypbind
-# Required-Stop: $network $ypbind
+# Required-Start: $network ypbind
+# Required-Stop: $network ypbind
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Automounts filesystems on demand
++++++ autofs-5.0.6-fix-not-bind-mounting-local-filesystem.patch ++++++
commit 0cc6447146815ee5454e2305700f7554e9e718f0
Author: Ian Kent
Date: Thu Dec 1 15:25:40 2011 +0800
autofs-5.0.6 - fix not bind mounting local filesystem
When the --random-multimount-selection (-r) option is used automount(8)
won't bind mount a local filesystem. If the filesystem that has been
requested is local it should always be used.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -8,6 +8,7 @@
- fix LDAP result leaks on error paths.
- fix fix LDAP result leaks on error paths.
- code analysis fixes part 1.
+- fix not bind mounting local filesystem.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/modules/replicated.c
===================================================================
--- autofs-5.0.6.orig/modules/replicated.c
+++ autofs-5.0.6/modules/replicated.c
@@ -1068,18 +1068,20 @@ static int add_new_host(struct host **li
* We can't use PROXIMITY_LOCAL or we won't perform an RPC ping
* to remove hosts that may be down.
*/
- if (options & MOUNT_FLAG_RANDOM_SELECT)
+ if (!host_addr)
prx = PROXIMITY_SUBNET;
else {
prx = get_proximity(host_addr->ai_addr);
/*
* If we want the weight to be the determining factor
- * when selecting a host then all hosts must have the
- * same proximity. However, if this is the local machine
- * it should always be used since it is certainly available.
+ * when selecting a host, or we are using random selection,
+ * then all hosts must have the same proximity. However,
+ * if this is the local machine it should always be used
+ * since it is certainly available.
*/
if (prx != PROXIMITY_LOCAL &&
- (options & MOUNT_FLAG_USE_WEIGHT_ONLY))
+ (options & (MOUNT_FLAG_USE_WEIGHT_ONLY |
+ MOUNT_FLAG_RANDOM_SELECT)))
prx = PROXIMITY_SUBNET;
}
++++++ autofs-5.0.5-fix-paged-query-more-results-check.patch -> autofs-5.0.6-fix-paged-query-more-results-check.patch ++++++
--- /work/SRC/openSUSE:Factory/autofs/autofs-5.0.5-fix-paged-query-more-results-check.patch 2011-10-07 17:06:46.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.autofs.new/autofs-5.0.6-fix-paged-query-more-results-check.patch 2012-02-06 15:54:24.000000000 +0100
@@ -1,30 +1,38 @@
-autofs-5.0.6 - fix paged query more results check
+commit 95ac4259a12f549913c965d2d914ce7d1ec9e325
+Author: Ian Kent
+Date: Thu Dec 1 14:52:48 2011 +0800
+
+ autofs-5.0.6 - fix paged query more results check
+
+ When getting paged results from an LDAP server the server returns an
+ opaque cookie (of type berval) that is used to retrieve the next page.
+ The criteria for deciding if there are more pages is that the berval
+ value is non-null and has a non-zero length.
+
+ To determine if the berval value has non-zero length autofs checks the
+ strlen() of the value but on ppc64 and s390x this can return 0 even if
+ the value has non-zero length causing a premature termination of the
+ query.
+
+ Fix this by also checking the berval length field.
+ Also make sure we free the opaque cookie when the query is finished.
-From: Ian Kent
-
-When getting paged results from an LDAP server the server returns an
-opaque cookie (of type berval) that is used to retrieve the next page.
-The criteria for deciding if there are more pages is that the berval
-value is non-null and has a non-zero length.
-
-To determine if the berval value has non-zero length autofs checks the
-strlen() of the value but on ppc64 and s390x this can return 0 even if
-the value has non-zero length causing a premature termination of the
-query.
-
-Fix this by also checking the berval length field.
-Also make sure we free the opaque cookie when the query is finished.
----
-
- CHANGELOG | 1 +
- modules/lookup_ldap.c | 13 ++++++++++++-
- 2 files changed, 13 insertions(+), 1 deletions(-)
-
-
-Index: autofs/modules/lookup_ldap.c
+Index: autofs-5.0.6/CHANGELOG
+===================================================================
+--- autofs-5.0.6.orig/CHANGELOG
++++ autofs-5.0.6/CHANGELOG
+@@ -2,6 +2,7 @@
+ =======================
+ - fix ipv6 name for lookup fix.
+ - improve mount location error reporting.
++- fix paged query more results check.
+
+ 28/06/2011 autofs-5.0.6
+ -----------------------
+Index: autofs-5.0.6/modules/lookup_ldap.c
===================================================================
---- autofs.orig/modules/lookup_ldap.c
-+++ autofs/modules/lookup_ldap.c
+--- autofs-5.0.6.orig/modules/lookup_ldap.c
++++ autofs-5.0.6/modules/lookup_ldap.c
@@ -2041,7 +2041,8 @@ do_paged:
rv = ldap_parse_page_control(sp->ldap,
returnedControls, &sp->totalCount,
@@ -73,15 +81,3 @@
free(sp.query);
return NSS_STATUS_SUCCESS;
-Index: autofs/CHANGELOG
-===================================================================
---- autofs.orig/CHANGELOG
-+++ autofs/CHANGELOG
-@@ -1,6 +1,7 @@
- ??/??/20?? autofs-5.0.7
- =======================
- - fix ipv6 name for lookup fix.
-+- fix paged query more results check.
-
- 28/06/2011 autofs-5.0.6
- -----------------------
++++++ autofs-5.0.5-fix-result-null-check-in-read_one_map.patch -> autofs-5.0.6-fix-result-null-check-in-read_one_map.patch ++++++
--- /work/SRC/openSUSE:Factory/autofs/autofs-5.0.5-fix-result-null-check-in-read_one_map.patch 2011-10-07 17:06:46.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.autofs.new/autofs-5.0.6-fix-result-null-check-in-read_one_map.patch 2012-02-06 15:54:24.000000000 +0100
@@ -1,16 +1,28 @@
-autofs-5.0.6 - fix result null check in read_one_map()
+commit 9f19db35bd9ee9a96728c61da2bb20f6354035ec
+Author: Ian Kent
+Date: Thu Dec 1 14:54:24 2011 +0800
-From: Ian Kent
+ autofs-5.0.6 - fix result null check in read_one_map()
+
+ Fix the check and reset to NULL of the LDAP library allocated result
+ within the loop to fetch paged query values.
----
-
- modules/lookup_ldap.c | 7 ++++++-
- 1 files changed, 6 insertions(+), 1 deletions(-)
-
-Index: autofs/modules/lookup_ldap.c
+Index: autofs-5.0.6/CHANGELOG
+===================================================================
+--- autofs-5.0.6.orig/CHANGELOG
++++ autofs-5.0.6/CHANGELOG
+@@ -4,6 +4,7 @@
+ - improve mount location error reporting.
+ - fix paged query more results check.
+ - fix dumpmaps not reading maps.
++- fix result null check in read_one_map().
+
+ 28/06/2011 autofs-5.0.6
+ -----------------------
+Index: autofs-5.0.6/modules/lookup_ldap.c
===================================================================
---- autofs.orig/modules/lookup_ldap.c
-+++ autofs/modules/lookup_ldap.c
+--- autofs-5.0.6.orig/modules/lookup_ldap.c
++++ autofs-5.0.6/modules/lookup_ldap.c
@@ -2381,8 +2381,10 @@ static int read_one_map(struct autofs_po
if (rv == LDAP_ADMINLIMIT_EXCEEDED ||
++++++ autofs-5.0.6-fix-rpc-build-error.patch ++++++
commit 67404f4928fec6dd18f3e6d0b8e4e3f8286bdb20
Author: Leonardo Chiquitto
Date: Sat Dec 10 09:55:26 2011 +0800
autofs-5.0.6 - fix rpc build error
The compile error looks like a problem in the libtirpc interface code rewrite
(commit f8ea2a5762 - autofs-5.0.6 - fix ipv6 rpc calls). The following patch
should fix it.
diff --git a/CHANGELOG b/CHANGELOG
index 8dec17f..11d2cbf 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -20,6 +20,7 @@
- add piddir to configure.
- add systemd unit support.
- remove empty command line arguments (passed by systemd).
+- fix rpc build error.
28/06/2011 autofs-5.0.6
-----------------------
diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
index ba679a5..4082fee 100644
--- a/lib/rpc_subs.c
+++ b/lib/rpc_subs.c
@@ -154,7 +154,7 @@ static CLIENT *rpc_do_create_client(struct sockaddr *addr, struct conn_info *inf
{
CLIENT *client = NULL;
struct sockaddr_in in4_laddr;
- struct sockaddr_in in4_raddr;
+ struct sockaddr_in *in4_raddr;
int type, proto;
socklen_t slen;
++++++ autofs-5.0.6-fix-submount-shutdown-race.patch ++++++
commit 96bdf5342ffbdb5c62daa6095f0d9ae7f4b37a58
Author: Ian Kent
Date: Thu Dec 1 15:27:17 2011 +0800
autofs-5.0.6 - fix submount shutdown race
Shutdown of submounts is problematic because the kernel doesn't
know when they are going away and so cannot block path walks
while they shut down. After aquiring the locks that cause mount
requests to wait, the daemon checks if the submount is active before
finally umounting it. If the mount is found to be busy the shutdown
is abandoned and the submount returned to a ready state.
But, if a mount request arrives at the same time as the daemon is
attempting to aquire these locks pthreads appears to become confused
and blocks. So change to using the try version of the lock call and
handling the return appropriately.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -11,6 +11,7 @@
- fix not bind mounting local filesystem.
- add "dir" map-type.
- fix wait for master source mutex.
+- fix submount shutdown race.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/daemon/automount.c
===================================================================
--- autofs-5.0.6.orig/daemon/automount.c
+++ autofs-5.0.6/daemon/automount.c
@@ -1495,6 +1495,41 @@ static void handle_mounts_cleanup(void *
return;
}
+static int submount_source_writelock_nested(struct autofs_point *ap)
+{
+ struct autofs_point *parent = ap->parent;
+ int status;
+
+ status = pthread_rwlock_trywrlock(&parent->entry->source_lock);
+ if (status)
+ goto done;
+
+ mounts_mutex_lock(parent);
+
+ status = pthread_rwlock_trywrlock(&ap->entry->source_lock);
+ if (status) {
+ mounts_mutex_unlock(parent);
+ master_source_unlock(parent->entry);
+ }
+
+done:
+ if (status && status != EBUSY) {
+ logmsg("submount nested master_mapent source write lock failed");
+ fatal(status);
+ }
+
+ return status;
+}
+
+static void submount_source_unlock_nested(struct autofs_point *ap)
+{
+ struct autofs_point *parent = ap->parent;
+
+ master_source_unlock(ap->entry);
+ mounts_mutex_unlock(parent);
+ master_source_unlock(parent->entry);
+}
+
void *handle_mounts(void *arg)
{
struct startup_cond *suc;
@@ -1565,23 +1600,32 @@ void *handle_mounts(void *arg)
master_mutex_lock();
if (ap->submount) {
- master_source_writelock(ap->parent->entry);
- mounts_mutex_lock(ap->parent);
- }
-
- master_source_writelock(ap->entry);
+ /*
+ * If a mount request arrives before the locks are
+ * aquired just return to ready state.
+ */
+ ret = submount_source_writelock_nested(ap);
+ if (ret) {
+ warn(ap->logopt,
+ "can't shutdown submount: mount in progress");
+ /* Return to ST_READY is done immediately */
+ st_add_task(ap, ST_READY);
+ master_mutex_unlock();
+ pthread_setcancelstate(cur_state, NULL);
+ continue;
+ }
+ } else
+ master_source_writelock(ap->entry);
if (ap->state != ST_SHUTDOWN) {
if (!ap->submount)
alarm_add(ap, ap->exp_runfreq);
/* Return to ST_READY is done immediately */
st_add_task(ap, ST_READY);
- master_source_unlock(ap->entry);
- if (ap->submount) {
- mounts_mutex_unlock(ap->parent);
- master_source_unlock(ap->parent->entry);
- }
-
+ if (ap->submount)
+ submount_source_unlock_nested(ap);
+ else
+ master_source_unlock(ap->entry);
master_mutex_unlock();
pthread_setcancelstate(cur_state, NULL);
@@ -1621,12 +1665,10 @@ void *handle_mounts(void *arg)
alarm_add(ap, ap->exp_runfreq);
/* Return to ST_READY is done immediately */
st_add_task(ap, ST_READY);
- master_source_unlock(ap->entry);
- if (ap->submount) {
- mounts_mutex_unlock(ap->parent);
- master_source_unlock(ap->parent->entry);
- }
-
+ if (ap->submount)
+ submount_source_unlock_nested(ap);
+ else
+ master_source_unlock(ap->entry);
master_mutex_unlock();
pthread_setcancelstate(cur_state, NULL);
++++++ autofs-5.0.6-fix-wait-for-master-source-mutex.patch ++++++
commit 752a866e55a047b2967de84d028a7fc111b60006
Author: Ian Kent
Date: Thu Dec 1 15:26:47 2011 +0800
autofs-5.0.6 - fix wait for master source mutex
A previous change that was meant to handle the case where the master map
source mutex read lock count was exceeded was incorrectly done for the
write lock case instead of the read lock case.
diff --git a/CHANGELOG b/CHANGELOG
index 1e6edd1..2352df1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -10,6 +10,7 @@
- code analysis fixes part 1.
- fix not bind mounting local filesystem.
- add "dir" map-type.
+- fix wait for master source mutex.
28/06/2011 autofs-5.0.6
-----------------------
diff --git a/lib/master.c b/lib/master.c
index 6c89e1d..87d1269 100644
--- a/lib/master.c
+++ b/lib/master.c
@@ -540,38 +540,38 @@ void send_map_update_request(struct autofs_point *ap)
void master_source_writelock(struct master_mapent *entry)
{
- int retries = 5; /* 1 second maximum */
int status;
- while (retries--) {
- status = pthread_rwlock_wrlock(&entry->source_lock);
- if (status != EAGAIN)
- break;
- else {
- struct timespec t = { 0, 200000000 };
- struct timespec r;
- while (nanosleep(&t, &r) == -1 && errno == EINTR)
- memcpy(&t, &r, sizeof(struct timespec));
- }
- }
-
+ status = pthread_rwlock_wrlock(&entry->source_lock);
if (status) {
logmsg("master_mapent source write lock failed");
fatal(status);
}
-
return;
}
void master_source_readlock(struct master_mapent *entry)
{
+ int retries = 5; /* 1 second maximum */
int status;
- status = pthread_rwlock_rdlock(&entry->source_lock);
+ while (retries--) {
+ status = pthread_rwlock_tryrdlock(&entry->source_lock);
+ if (status != EAGAIN && status != EBUSY)
+ break;
+ else {
+ struct timespec t = { 0, 200000000 };
+ struct timespec r;
+ while (nanosleep(&t, &r) == -1 && errno == EINTR)
+ memcpy(&t, &r, sizeof(struct timespec));
+ }
+ }
+
if (status) {
logmsg("master_mapent source read lock failed");
fatal(status);
}
+
return;
}
++++++ autofs-5.0.6-improve-mount-location-error-reporting.patch ++++++
commit 1623f6102e8b05cb497e27bd412f8fc8bcc6c089
Author: Ian Kent
Date: Thu Dec 1 14:52:10 2011 +0800
autofs-5.0.6 - improve mount location error reporting
Try and report a more sensible error when an invalid location is
encountered.
Index: autofs-5.0.6/CHANGELOG
===================================================================
--- autofs-5.0.6.orig/CHANGELOG
+++ autofs-5.0.6/CHANGELOG
@@ -1,6 +1,7 @@
??/??/20?? autofs-5.0.7
=======================
- fix ipv6 name for lookup fix.
+- improve mount location error reporting.
28/06/2011 autofs-5.0.6
-----------------------
Index: autofs-5.0.6/modules/parse_sun.c
===================================================================
--- autofs-5.0.6.orig/modules/parse_sun.c
+++ autofs-5.0.6/modules/parse_sun.c
@@ -853,7 +853,7 @@ add_offset_entry(struct autofs_point *ap
return ret;
}
-static int validate_location(char *loc)
+static int validate_location(unsigned int logopt, char *loc)
{
char *ptr = loc;
@@ -867,14 +867,22 @@ static int validate_location(char *loc)
* and "@" in the host name part and ipv6 addresses that
* have ":", "[" and "]".
*/
- if (check_colon(ptr)) {
+ if (!check_colon(ptr)) {
+ error(logopt,
+ "expected colon delimeter not found in location %s",
+ loc);
+ return 0;
+ } else {
while (*ptr && strncmp(ptr, ":/", 2)) {
if (!(isalnum(*ptr) ||
*ptr == '-' || *ptr == '.' || *ptr == '_' ||
*ptr == ',' || *ptr == '(' || *ptr == ')' ||
*ptr == '#' || *ptr == '@' || *ptr == ':' ||
- *ptr == '[' || *ptr == ']'))
+ *ptr == '[' || *ptr == ']')) {
+ error(logopt, "invalid character \"%c\" "
+ "found in location %s", *ptr, loc);
return 0;
+ }
ptr++;
}
@@ -883,8 +891,10 @@ static int validate_location(char *loc)
}
/* Must always be something following */
- if (!*ptr)
+ if (!*ptr) {
+ error(logopt, "invalid location %s", loc);
return 0;
+ }
return 1;
}
@@ -951,8 +961,7 @@ static int parse_mapent(const char *ent,
return 0;
}
- if (!validate_location(loc)) {
- warn(logopt, MODPREFIX "invalid location %s", loc);
+ if (!validate_location(logopt, loc)) {
free(myoptions);
free(loc);
return 0;
@@ -985,9 +994,7 @@ static int parse_mapent(const char *ent,
return 0;
}
- if (!validate_location(ent_chunk)) {
- warn(logopt,
- MODPREFIX "invalid location %s", ent_chunk);
+ if (!validate_location(logopt, ent_chunk)) {
free(ent_chunk);
free(myoptions);
free(loc);
@@ -1688,8 +1695,7 @@ int parse_mount(struct autofs_point *ap,
return 1;
}
- if (!validate_location(loc)) {
- warn(ap->logopt, MODPREFIX "invalid location %s", loc);
+ if (!validate_location(ap->logopt, loc)) {
free(loc);
free(options);
return 1;
@@ -1714,9 +1720,7 @@ int parse_mount(struct autofs_point *ap,
return 1;
}
- if (!validate_location(ent)) {
- warn(ap->logopt,
- MODPREFIX "invalid location %s", loc);
+ if (!validate_location(ap->logopt, ent)) {
free(ent);
free(loc);
free(options);
++++++ autofs-5.0.6-invalid-ghost-dirs.patch ++++++
--- /var/tmp/diff_new_pack.A6A9eo/_old 2012-02-06 15:54:29.000000000 +0100
+++ /var/tmp/diff_new_pack.A6A9eo/_new 2012-02-06 15:54:29.000000000 +0100
@@ -15,7 +15,7 @@
===================================================================
--- autofs-5.0.6.orig/daemon/lookup.c
+++ autofs-5.0.6/daemon/lookup.c
-@@ -604,6 +604,9 @@ int lookup_ghost(struct autofs_point *ap
+@@ -605,6 +605,9 @@ int lookup_ghost(struct autofs_point *ap
if (!strcmp(me->key, "*"))
goto next;
++++++ autofs-5.0.6-remove-empty-command-line-arguments.patch ++++++
commit 6f6f144098ff0f940cdf8968f9152ee1317ab141
Author: Ian Kent
Date: Fri Dec 9 15:06:48 2011 +0800
autofs-5.0.6 - remove empty command line arguments
When invoking the automount daemon from a systemd unit file a macro
that evaluates to the empty string is passed as an empty argument
unlike the shell environment within which unquoted arguments are
seen as white space and are not passed at all.
These empty arguments confuse getopt(3) and cause the program
parameters to be misread so we need to remove them before calling
getopt(3).
diff --git a/CHANGELOG b/CHANGELOG
index d951b5a..8dec17f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -19,6 +19,7 @@
- fix ipv6 configure check.
- add piddir to configure.
- add systemd unit support.
+- remove empty command line arguments (passed by systemd).
28/06/2011 autofs-5.0.6
-----------------------
diff --git a/daemon/automount.c b/daemon/automount.c
index 6bb5aa8..c0b4b85 100644
--- a/daemon/automount.c
+++ b/daemon/automount.c
@@ -1865,6 +1865,34 @@ static int convert_log_priority(char *priority_name)
return -1;
}
+static void remove_empty_args(char **argv, int *argc)
+{
+ int next_to_last = *argc - 1;
+ int i, j;
+
+ for (i = j = 1; i < *argc; i++) {
+ if (*argv[i]) {
+ j++;
+ continue;
+ }
+
+ while (i < *argc && argv[i] && !*argv[i]) i++;
+
+ if (i == *argc)
+ break;
+
+ if (i == next_to_last) {
+ if (*argv[i])
+ argv[j++] = argv[i];
+ break;
+ } else {
+ argv[j++] = argv[i];
+ argv[i--] = "";
+ }
+ }
+ *argc = j;
+}
+
int main(int argc, char *argv[])
{
int res, opt, status;
@@ -1874,6 +1902,7 @@ int main(int argc, char *argv[])
time_t timeout;
time_t age = time(NULL);
struct rlimit rlim;
+ const char *options = "+hp:t:vmdD:fVrO:l:n:CF";
static const struct option long_options[] = {
{"help", 0, 0, 'h'},
{"pid-file", 1, 0, 'p'},
@@ -1918,8 +1947,10 @@ int main(int argc, char *argv[])
dumpmaps = 0;
daemon_check = 1;
+ remove_empty_args(argv, &argc);
+
opterr = 0;
- while ((opt = getopt_long(argc, argv, "+hp:t:vmdD:fVrO:l:n:CF", long_options, NULL)) != EOF) {
+ while ((opt = getopt_long(argc, argv, options, long_options, NULL)) != EOF) {
switch (opt) {
case 'h':
usage();
@@ -2066,7 +2097,7 @@ int main(int argc, char *argv[])
res = setrlimit(RLIMIT_NOFILE, &rlim);
if (res)
printf("%s: can't increase open file limit - continuing",
- argv[0]);
+ program);
#if ENABLE_CORES
rlim.rlim_cur = RLIM_INFINITY;
@@ -2074,7 +2105,7 @@ int main(int argc, char *argv[])
res = setrlimit(RLIMIT_CORE, &rlim);
if (res)
printf("%s: can't increase core file limit - continuing",
- argv[0]);
+ program);
#endif
if (argc == 0)
@@ -2097,7 +2128,7 @@ int main(int argc, char *argv[])
nc = cache_init_null_cache(master_list);
if (!nc) {
printf("%s: failed to init null map cache for %s",
- master_list->name, argv[0]);
+ program, master_list->name);
exit(1);
}
master_list->nc = nc;
++++++ autofs-suse-auto_master_default.patch ++++++
--- /var/tmp/diff_new_pack.A6A9eo/_old 2012-02-06 15:54:29.000000000 +0100
+++ /var/tmp/diff_new_pack.A6A9eo/_new 2012-02-06 15:54:29.000000000 +0100
@@ -2,7 +2,7 @@
===================================================================
--- autofs-5.0.6.orig/samples/auto.master
+++ autofs-5.0.6/samples/auto.master
-@@ -4,13 +4,13 @@
+@@ -4,17 +4,17 @@
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
@@ -16,5 +16,10 @@
-/net -hosts
+#/net -hosts
#
+ # Include /etc/auto.master.d/*.autofs
+ #
+-+dir:/etc/auto.master.d
++#+dir:/etc/auto.master.d
+ #
# Include central master map if it can be found using
# nsswitch sources.
++++++ autofs.service ++++++
[Unit]
Description=Automounts filesystems on demand
After=network.target remote-fs.target ypbind.service
[Service]
Type=forking
PIDFile=/var/run/automount.pid
EnvironmentFile=-/etc/sysconfig/autofs
ExecStart=/usr/sbin/automount ${AUTOFS_OPTIONS} -p /var/run/automount.pid
[Install]
WantedBy=multi-user.target
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org