~ubuntu-branches/ubuntu/raring/autofs5/raring

« back to all changes in this revision

Viewing changes to debian/patches/01UPSTREAM_autofs-5.0.4-clear-rpc-client-on-lookup-fail.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Jan Christoph Nordholz
  • Date: 2009-08-28 21:24:14 UTC
  • mfrom: (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090828212414-z9xvmo5kdpm26vxv
Tags: 5.0.4-3
* Fix LSB initscript header to use keywords that
  insserv knows about. Closes: #541841.
* Bump Standards version to 3.8.3.
  * Add README.source.

* Upload sponsored by Petter Reinholdtsen.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 01UPSTREAM_autofs-5.0.4-clear-rpc-client-on-lookup-fail.patch
 
3
##
 
4
## DP: Upstream patch on top of 5.0.4.
 
5
 
 
6
@DPATCH@
 
7
autofs-5.0.4 - clear rpc client on lookup fail
 
8
 
 
9
From: Ian Kent <raven@themaw.net>
 
10
 
 
11
If a name lookup failure occurs in create_tcp_client() or create_udp_client()
 
12
the client is destoryed and the file descriptor is closed at exit but the rpc
 
13
client isn't set to NULL. This leads to a subsequent SEGV when attempting to
 
14
use the invalid client.
 
15
---
 
16
 
 
17
 CHANGELOG      |    1 +
 
18
 lib/rpc_subs.c |    2 ++
 
19
 2 files changed, 3 insertions(+), 0 deletions(-)
 
20
 
 
21
 
 
22
diff --git a/CHANGELOG b/CHANGELOG
 
23
index 00b455e..91edd14 100644
 
24
--- a/CHANGELOG
 
25
+++ b/CHANGELOG
 
26
@@ -34,6 +34,7 @@
 
27
 - fix file map lookup when reading included or nsswitch sources.
 
28
 - use misc device ioctl interface by default, if available.
 
29
 - fix call restorecon when misc device file doesn't exist.
 
30
+- clear rpc client on lookup fail.
 
31
 
 
32
 4/11/2008 autofs-5.0.4
 
33
 -----------------------
 
34
diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
 
35
index a822f1f..d034b29 100644
 
36
--- a/lib/rpc_subs.c
 
37
+++ b/lib/rpc_subs.c
 
38
@@ -346,6 +346,7 @@ static CLIENT *create_udp_client(struct conn_info *info)
 
39
        if (ret) {
 
40
                error(LOGOPT_ANY,
 
41
                      "hostname lookup failed: %s", gai_strerror(ret));
 
42
+               info->client = NULL;
 
43
                goto out_close;
 
44
        }
 
45
 
 
46
@@ -470,6 +471,7 @@ static CLIENT *create_tcp_client(struct conn_info *info)
 
47
        if (ret) {
 
48
                error(LOGOPT_ANY,
 
49
                      "hostname lookup failed: %s", gai_strerror(ret));
 
50
+               info->client = NULL;
 
51
                goto out_close;
 
52
        }
 
53