Merge lp:~gandelman-a/ubuntu/lucid/cluster-agents/lp893352 into lp:ubuntu/lucid/cluster-agents

Proposed by Adam Gandelman
Status: Merged
Approved by: James Page
Approved revision: 7
Merge reported by: James Page
Merged at revision: not available
Proposed branch: lp:~gandelman-a/ubuntu/lucid/cluster-agents/lp893352
Merge into: lp:ubuntu/lucid/cluster-agents
Diff against target: 111 lines (+65/-4)
5 files modified
.pc/applied-patches (+1/-0)
debian/changelog (+8/-0)
debian/patches/mysql_move_writable_test.patch (+45/-0)
debian/patches/series (+1/-0)
heartbeat/mysql (+10/-4)
To merge this branch: bzr merge lp:~gandelman-a/ubuntu/lucid/cluster-agents/lp893352
Reviewer Review Type Date Requested Status
James Page Pending
Review via email: mp+83073@code.launchpad.net

Description of the change

Proposed SRU for bug 893352

To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

LGTM

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.pc/applied-patches'
2--- .pc/applied-patches 2010-03-30 06:57:42 +0000
3+++ .pc/applied-patches 2011-11-22 20:57:27 +0000
4@@ -1,1 +1,2 @@
5 spelling-fixes.patch
6+mysql_move_writable_test.patch
7
8=== modified file 'debian/changelog'
9--- debian/changelog 2010-04-26 12:30:52 +0000
10+++ debian/changelog 2011-11-22 20:57:27 +0000
11@@ -1,3 +1,11 @@
12+cluster-agents (1:1.0.3-2ubuntu1.1) lucid-proposed; urgency=low
13+
14+ * debian/patches/mysql_move_writable_test.patch: Cherry-pick upstream
15+ commit (95a6eb8a). In mysql OCF, properly create $pid_dir before testing
16+ permissions on it. (LP: #893352)
17+
18+ -- Adam Gandelman <adamg@canonical.com> Tue, 22 Nov 2011 11:20:06 -0800
19+
20 cluster-agents (1:1.0.3-2ubuntu1) lucid; urgency=low
21
22 * Merge from debian unstable
23
24=== added file 'debian/patches/mysql_move_writable_test.patch'
25--- debian/patches/mysql_move_writable_test.patch 1970-01-01 00:00:00 +0000
26+++ debian/patches/mysql_move_writable_test.patch 2011-11-22 20:57:27 +0000
27@@ -0,0 +1,45 @@
28+Author: Florian Haas <florian.haas@linbit.com>
29+Date: Fri Jun 4 14:15:23 2010 +0200
30+Origin: https://github.com/ClusterLabs/resource-agents/
31+Bug-Ubuntu: https://bugs.launchpad.net/bugs/893352
32+Description: mysql: check for write permissions after creating pid and socket directory
33+
34+Stupidly, we'd previously check permissions on the pid directory before
35+creating it. Move the permission check after directory creation, and
36+also check the socket directory in the same manner.
37+
38+commit a1801207e0602d9b975f336569b562c195a6eb8a
39+
40+
41+Index: cluster-agents/heartbeat/mysql
42+===================================================================
43+--- cluster-agents.orig/heartbeat/mysql 2011-11-22 10:40:46.480688355 -0800
44++++ cluster-agents/heartbeat/mysql 2011-11-22 10:40:57.116687965 -0800
45+@@ -342,10 +342,6 @@
46+ fi
47+
48+ pid_dir=`dirname $OCF_RESKEY_pid`
49+- if ! su -s /bin/sh - $OCF_RESKEY_user -c "test -w $pid_dir"; then
50+- ocf_log err "Directory $pid_dir for pidfile $OCF_RESKEY_pid is not writable by $OCF_RESKEY_user"
51+- return $OCF_ERR_PERM;
52+- fi
53+ if [ ! -d $pid_dir ] ; then
54+ ocf_log info "Creating PID dir: $pid_dir"
55+ mkdir -p $pid_dir
56+@@ -359,6 +355,16 @@
57+ chown $OCF_RESKEY_user:$OCF_RESKEY_group $socket_dir
58+ fi
59+
60++ # Regardless of whether we just created the directory or it
61++ # already existed, check whether it is writable by the configured
62++ # user
63++ for dir in $pid_dir $socket_dir; do
64++ if ! su -s /bin/sh - $OCF_RESKEY_user -c "test -w $dir"; then
65++ ocf_log err "Directory $dir is not writable by $OCF_RESKEY_user"
66++ exit $OCF_ERR_PERM;
67++ fi
68++ done
69++
70+ # Uncomment to perform permission clensing
71+ # - not convinced this should be enabled by default
72+ #
73
74=== modified file 'debian/patches/series'
75--- debian/patches/series 2010-03-30 06:57:42 +0000
76+++ debian/patches/series 2011-11-22 20:57:27 +0000
77@@ -1,1 +1,2 @@
78 spelling-fixes.patch
79+mysql_move_writable_test.patch
80
81=== modified file 'heartbeat/mysql'
82--- heartbeat/mysql 2010-04-14 16:09:45 +0000
83+++ heartbeat/mysql 2011-11-22 20:57:27 +0000
84@@ -342,10 +342,6 @@
85 fi
86
87 pid_dir=`dirname $OCF_RESKEY_pid`
88- if ! su -s /bin/sh - $OCF_RESKEY_user -c "test -w $pid_dir"; then
89- ocf_log err "Directory $pid_dir for pidfile $OCF_RESKEY_pid is not writable by $OCF_RESKEY_user"
90- return $OCF_ERR_PERM;
91- fi
92 if [ ! -d $pid_dir ] ; then
93 ocf_log info "Creating PID dir: $pid_dir"
94 mkdir -p $pid_dir
95@@ -359,6 +355,16 @@
96 chown $OCF_RESKEY_user:$OCF_RESKEY_group $socket_dir
97 fi
98
99+ # Regardless of whether we just created the directory or it
100+ # already existed, check whether it is writable by the configured
101+ # user
102+ for dir in $pid_dir $socket_dir; do
103+ if ! su -s /bin/sh - $OCF_RESKEY_user -c "test -w $dir"; then
104+ ocf_log err "Directory $dir is not writable by $OCF_RESKEY_user"
105+ exit $OCF_ERR_PERM;
106+ fi
107+ done
108+
109 # Uncomment to perform permission clensing
110 # - not convinced this should be enabled by default
111 #

Subscribers

People subscribed via source and target branches

to all changes: