- add map-type-in-map-name fix patch to sync with upstream and RHEL.

- don't readmap on HUP for new mount.
- add NIS_PARTIAL to map entry not found check and fix use after free bug.
This commit is contained in:
Ian Kent 2008-10-10 08:55:18 +00:00
parent 883768c8fc
commit c79aa41303
4 changed files with 132 additions and 1 deletions

View File

@ -0,0 +1,39 @@
autofs-5.0.3 - don't readmap on HUP for new mount
From: Ian Kent <raven@themaw.net>
If we're performing a new mount during a HUP signal then
we will read the map during the mount.
---
lib/master.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- autofs-5.0.3.orig/lib/master.c
+++ autofs-5.0.3/lib/master.c
@@ -1108,8 +1108,6 @@ int master_mount_mounts(struct master *m
}
cache_unlock(nc);
- check_update_map_sources(this, readall);
-
st_mutex_lock();
state_pipe = this->ap->state_pipe[1];
@@ -1120,11 +1118,14 @@ int master_mount_mounts(struct master *m
st_mutex_unlock();
- if (ret == -1 && save_errno == EBADF)
+ if (!ret)
+ check_update_map_sources(this, readall);
+ else if (ret == -1 && save_errno == EBADF) {
if (!master_do_mount(this)) {
list_del_init(&this->list);
master_free_mapent_sources(ap->entry, 1);
master_free_mapent(ap->entry);
+ }
}
}

View File

@ -0,0 +1,27 @@
autofs-5.0.3 - map type in map name fix
From: Ian Kent <raven@themaw.net>
Fix incorrect match of map type as a host name.
Actually the original patch didn't match upstream or RHEL
so this syncs the source with those. It appears the problem
was fixed here some time ago but slightly differently.
---
lib/master_tok.l | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- autofs-5.0.3.orig/lib/master_tok.l
+++ autofs-5.0.3/lib/master_tok.l
@@ -202,7 +202,9 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--
}
}
- {MTYPE}/({DNSERVERSTR}|{DNATTRSTR}=)? {
+ {MTYPE} |
+ {MTYPE}/{DNSERVERSTR}{DNATTRSTR} |
+ {MTYPE}/{DNATTRSTR}= {
tlen = master_leng - 1;
if (bptr != buff && isblank(master_text[tlen])) {
strncat(buff, master_text, tlen);

View File

@ -0,0 +1,54 @@
autofs-5.0.3 - nisplus partial and free
From: Jeff Bastian <jbastian@redhat.com>
During a nisplus key lookup nis_list() can return NIS_PARTIAL
as well as possibly NIS_NOTFOUND or NIS_S_NOTFOUND when the key
doesn't exist. This patch adds this to the checks and fixes a use
after free of the result struct.
---
modules/lookup_nisplus.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
--- autofs-5.0.3.orig/modules/lookup_nisplus.c
+++ autofs-5.0.3/modules/lookup_nisplus.c
@@ -285,13 +285,15 @@ static int lookup_one(struct autofs_poin
result = nis_list(tablename, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
if (result->status != NIS_SUCCESS && result->status != NIS_S_SUCCESS) {
+ nis_error rs = result->status;
nis_freeresult(result);
pthread_setcancelstate(cur_state, NULL);
- if (result->status == NIS_NOTFOUND ||
- result->status == NIS_S_NOTFOUND)
+ if (rs == NIS_NOTFOUND ||
+ rs == NIS_S_NOTFOUND ||
+ rs == NIS_PARTIAL)
return CHE_MISSING;
- return -result->status;
+ return -rs;
}
@@ -338,13 +340,15 @@ static int lookup_wild(struct autofs_poi
result = nis_list(tablename, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
if (result->status != NIS_SUCCESS && result->status != NIS_S_SUCCESS) {
+ nis_error rs = result->status;
nis_freeresult(result);
pthread_setcancelstate(cur_state, NULL);
- if (result->status == NIS_NOTFOUND ||
- result->status == NIS_S_NOTFOUND)
+ if (rs == NIS_NOTFOUND ||
+ rs == NIS_S_NOTFOUND ||
+ rs == NIS_PARTIAL)
return CHE_MISSING;
- return -result->status;
+ return -rs;
}
this = NIS_RES_OBJECT(result);

View File

@ -4,7 +4,7 @@
Summary: A tool for automatically mounting and unmounting filesystems
Name: autofs
Version: 5.0.3
Release: 25
Release: 26
Epoch: 1
License: GPLv2+
Group: System Environment/Daemons
@ -59,6 +59,9 @@ Patch46: autofs-5.0.3-fix-ifc-buff-size-fix-2.patch
Patch47: autofs-5.0.3-check-for-kernel-automount-fix.patch
Patch48: autofs-5.0.3-fix-fd-leak-at-multi-mount-fail.patch
Patch49: autofs-5.0.3-fix-incorrect-multi-mount-mountpoint.patch
Patch50: autofs-5.0.3-map-type-in-map-name-fix.patch
Patch51: autofs-5.0.3-dont-readmap-on-hup-for-new-mount.patch
Patch52: autofs-5.0.3-nisplus-partial-and-free.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, libxml2-devel, cyrus-sasl-devel, openssl-devel module-init-tools util-linux nfs-utils e2fsprogs
Requires: kernel >= 2.6.17
@ -149,6 +152,9 @@ echo %{version}-%{release} > .version
%patch47 -p1
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%build
#CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@ -201,6 +207,11 @@ fi
%{_libdir}/autofs/
%changelog
* Fri Oct 10 2008 Ian Kent <ikent@redhat.com> - 5.0.3-26
- add map-type-in-map-name fix patch to sync with upstream and RHEL.
- don't readmap on HUP for new mount.
- add NIS_PARTIAL to map entry not found check and fix use after free bug.
* Fri Sep 26 2008 Ian Kent <ikent@redhat.com> - 5.0.3-25
- fix fd leak at multi-mount non-fatal mount fail.
- fix incorrect multi-mount mountpoint calcualtion.