From 4cb4c4f4c0686f611d787948b93e32f288a7ca08 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Fri, 28 Jun 2013 13:34:30 +0800 Subject: [PATCH] - fix add null check in parse_server_string() (bz979155). --- ...dd-null-check-in-parse_server_string.patch | 45 +++++++++++++++++++ autofs.spec | 7 ++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch diff --git a/autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch b/autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch new file mode 100644 index 0000000..1e3fc20 --- /dev/null +++ b/autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch @@ -0,0 +1,45 @@ +autofs-5.0.7 - fix add null check in parse_server_string() + +From: Ian Kent + +In a recent patch that added an error check for the case there's no ':' server +name delimiter parse_server_string() braces were not added which lead to an +incorrect parse error. +--- + CHANGELOG | 1 + + modules/lookup_ldap.c | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 503a21e..5d90139 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -52,6 +52,7 @@ + - add changlog entry for coverity fixes. + - fix probe each nfs version in turn for singleton mounts. + - misc man page fixes. ++- fix add null check in parse_server_string(). + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c +index 35ea6ea..a2bfafd 100644 +--- a/modules/lookup_ldap.c ++++ b/modules/lookup_ldap.c +@@ -1210,14 +1210,14 @@ static int parse_server_string(unsigned logopt, const char *url, struct lookup_c + const char *q = NULL; + + /* Isolate the server. Include the port spec */ +- if (*ptr != '[') ++ if (*ptr != '[') { + q = strchr(ptr, ':'); + if (!q) { + crit(logopt, MODPREFIX + "LDAP server name not found in %s", ptr); + return 0; + } +- else { ++ } else { + q = ++ptr; + while (*q == ':' || isxdigit(*q)) + q++; diff --git a/autofs.spec b/autofs.spec index 6c8aaf8..53b2507 100644 --- a/autofs.spec +++ b/autofs.spec @@ -8,7 +8,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.0.7 -Release: 22%{?dist} +Release: 23%{?dist} Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -93,6 +93,7 @@ Patch77: autofs-5.0.7-fix-possible-use-after-free-in-lookup_dir-lookup_init.patc Patch78: autofs-5.0.7-add-changlog-entry-for-coverity-fixes.patch Patch79: autofs-5.0.7-fix-probe-each-nfs-version-in-turn-for-singleton-mounts.patch Patch80: autofs-5.0.7-misc-man-page-fixes.patch +Patch81: autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if %{with_systemd} BuildRequires: systemd-units @@ -230,6 +231,7 @@ echo %{version}-%{release} > .version %patch78 -p1 %patch79 -p1 %patch80 -p1 +%patch81 -p1 %build #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir} @@ -321,6 +323,9 @@ fi %dir /etc/auto.master.d %changelog +* Fri Jun 28 2013 Ian Kent - 1:5.0.7-23 +- fix add null check in parse_server_string() (bz979155). + * Wed Jun 19 2013 Ian Kent - 1:5.0.7-22 - misc man page fixes (bz948517).