aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@gmail.com>2010-11-02 10:40:57 +0000
committerLeonardo Arena <rnalrd@gmail.com>2010-11-02 15:23:18 +0000
commita01dad92bf1e8a5c9fa0788234bd97963ba7470b (patch)
treef736d8bba97c7e2034653b259a05d5cb232ec1b2
parent1fc5ca7e586febbed1cb2baf5af92dca6d655c07 (diff)
downloadalpine_aports-a01dad92bf1e8a5c9fa0788234bd97963ba7470b.tar.bz2
alpine_aports-a01dad92bf1e8a5c9fa0788234bd97963ba7470b.tar.xz
alpine_aports-a01dad92bf1e8a5c9fa0788234bd97963ba7470b.zip
main/multipath-tools: removed unused patches
(cherry picked from commit 9755b2741ab312972f106699d21a4e836ed1d06b)
-rw-r--r--main/multipath-tools/multipath-tools-0.4.8-r1-kpartx.patch250
-rw-r--r--main/multipath-tools/multipath-tools-0.4.8-socket-cve-2009-0115.patch29
-rw-r--r--main/multipath-tools/multipath-tools-0.4.8-udev-scsi_id-changes.patch90
3 files changed, 0 insertions, 369 deletions
diff --git a/main/multipath-tools/multipath-tools-0.4.8-r1-kpartx.patch b/main/multipath-tools/multipath-tools-0.4.8-r1-kpartx.patch
deleted file mode 100644
index ae2a7fe1c6..0000000000
--- a/main/multipath-tools/multipath-tools-0.4.8-r1-kpartx.patch
+++ /dev/null
@@ -1,250 +0,0 @@
1diff --git a/kpartx/devmapper.c b/kpartx/devmapper.c
2index 3e973aa..893d6dd 100644
3--- a/kpartx/devmapper.c
4+++ b/kpartx/devmapper.c
5@@ -4,10 +4,12 @@
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9+#include <stdint.h>
10 #include <libdevmapper.h>
11 #include <ctype.h>
12 #include <linux/kdev_t.h>
13 #include <errno.h>
14+#include "devmapper.h"
15
16 #define UUID_PREFIX "part%d-"
17 #define MAX_PREFIX_LEN 8
18@@ -72,7 +74,7 @@ dm_simplecmd (int task, const char *name) {
19
20 extern int
21 dm_addmap (int task, const char *name, const char *target,
22- const char *params, unsigned long size, const char *uuid, int part) {
23+ const char *params, uint64_t size, const char *uuid, int part) {
24 int r = 0;
25 struct dm_task *dmt;
26 char *prefixed_uuid = NULL;
27diff --git a/kpartx/devmapper.h b/kpartx/devmapper.h
28index ccdbead..2bd27d2 100644
29--- a/kpartx/devmapper.h
30+++ b/kpartx/devmapper.h
31@@ -1,7 +1,7 @@
32 int dm_prereq (char *, int, int, int);
33 int dm_simplecmd (int, const char *);
34-int dm_addmap (int, const char *, const char *, const char *, unsigned long,
35- char *, int);
36+int dm_addmap (int, const char *, const char *, const char *, uint64_t,
37+ const char *, int);
38 int dm_map_present (char *);
39 char * dm_mapname(int major, int minor);
40 dev_t dm_get_first_dep(char *devname);
41diff --git a/kpartx/gpt.c b/kpartx/gpt.c
42index dc846ca..047a829 100644
43--- a/kpartx/gpt.c
44+++ b/kpartx/gpt.c
45@@ -36,6 +36,7 @@
46 #include <errno.h>
47 #include <endian.h>
48 #include <byteswap.h>
49+#include <linux/fs.h>
50 #include "crc32.h"
51
52 #if BYTE_ORDER == LITTLE_ENDIAN
53@@ -50,10 +51,18 @@
54 # define __cpu_to_le32(x) bswap_32(x)
55 #endif
56
57+#ifndef BLKGETLASTSECT
58 #define BLKGETLASTSECT _IO(0x12,108) /* get last sector of block device */
59+#endif
60+#ifndef BLKGETSIZE
61 #define BLKGETSIZE _IO(0x12,96) /* return device size */
62+#endif
63+#ifndef BLKSSZGET
64 #define BLKSSZGET _IO(0x12,104) /* get block device sector size */
65+#endif
66+#ifndef BLKGETSIZE64
67 #define BLKGETSIZE64 _IOR(0x12,114,sizeof(uint64_t)) /* return device size in bytes (u64 *arg) */
68+#endif
69
70 struct blkdev_ioctl_param {
71 unsigned int block;
72@@ -143,20 +152,14 @@ get_sector_size(int filedes)
73 static uint64_t
74 _get_num_sectors(int filedes)
75 {
76- unsigned long sectors=0;
77 int rc;
78-#if 0
79- uint64_t bytes=0;
80+ uint64_t bytes=0;
81
82- rc = ioctl(filedes, BLKGETSIZE64, &bytes);
83+ rc = ioctl(filedes, BLKGETSIZE64, &bytes);
84 if (!rc)
85 return bytes / get_sector_size(filedes);
86-#endif
87- rc = ioctl(filedes, BLKGETSIZE, &sectors);
88- if (rc)
89- return 0;
90-
91- return sectors;
92+
93+ return 0;
94 }
95
96 /************************************************************
97@@ -193,7 +196,7 @@ last_lba(int filedes)
98 sectors = 1;
99 }
100
101- return sectors - 1;
102+ return sectors ? sectors - 1 : 0;
103 }
104
105
106@@ -220,17 +223,22 @@ read_lba(int fd, uint64_t lba, void *buffer, size_t bytes)
107 {
108 int sector_size = get_sector_size(fd);
109 off_t offset = lba * sector_size;
110+ uint64_t lastlba;
111 ssize_t bytesread;
112
113 lseek(fd, offset, SEEK_SET);
114 bytesread = read(fd, buffer, bytes);
115
116+ lastlba = last_lba(fd);
117+ if (!lastlba)
118+ return bytesread;
119+
120 /* Kludge. This is necessary to read/write the last
121 block of an odd-sized disk, until Linux 2.5.x kernel fixes.
122 This is only used by gpt.c, and only to read
123 one sector, so we don't have to be fancy.
124 */
125- if (!bytesread && !(last_lba(fd) & 1) && lba == last_lba(fd)) {
126+ if (!bytesread && !(lastlba & 1) && lba == lastlba) {
127 bytesread = read_lastoddsector(fd, lba, buffer, bytes);
128 }
129 return bytesread;
130@@ -505,7 +513,8 @@ find_valid_gpt(int fd, gpt_header ** gpt, gpt_entry ** ptes)
131 if (!gpt || !ptes)
132 return 0;
133
134- lastlba = last_lba(fd);
135+ if (!(lastlba = last_lba(fd)))
136+ return 0;
137 good_pgpt = is_gpt_valid(fd, GPT_PRIMARY_PARTITION_TABLE_LBA,
138 &pgpt, &pptes);
139 if (good_pgpt) {
140diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c
141index dbe2ee2..72ca81d 100644
142--- a/kpartx/kpartx.c
143+++ b/kpartx/kpartx.c
144@@ -25,6 +25,7 @@
145 #include <stdlib.h>
146 #include <string.h>
147 #include <unistd.h>
148+#include <stdint.h>
149 #include <sys/stat.h>
150 #include <sys/types.h>
151 #include <ctype.h>
152@@ -366,16 +367,16 @@ main(int argc, char **argv){
153
154 slices[j].minor = m++;
155
156- printf("%s%s%d : 0 %lu %s %lu\n",
157+ printf("%s%s%d : 0 %" PRIu64 " %s %" PRIu64"\n",
158 mapname, delim, j+1,
159- (unsigned long) slices[j].size, device,
160- (unsigned long) slices[j].start);
161+ slices[j].size, device,
162+ slices[j].start);
163 }
164 /* Loop to resolve contained slices */
165 d = c;
166 while (c) {
167 for (j = 0; j < n; j++) {
168- unsigned long start;
169+ uint64_t start;
170 int k = slices[j].container - 1;
171
172 if (slices[j].size == 0)
173@@ -387,9 +388,9 @@ main(int argc, char **argv){
174 slices[j].minor = m++;
175
176 start = slices[j].start - slices[k].start;
177- printf("%s%s%d : 0 %lu /dev/dm-%d %lu\n",
178+ printf("%s%s%d : 0 %" PRIu64 " /dev/dm-%d %" PRIu64 "\n",
179 mapname, delim, j+1,
180- (unsigned long) slices[j].size,
181+ slices[j].size,
182 slices[k].minor, start);
183 c--;
184 }
185@@ -448,8 +449,8 @@ main(int argc, char **argv){
186 }
187 strip_slash(partname);
188
189- if (safe_sprintf(params, "%s %lu", device,
190- (unsigned long)slices[j].start)) {
191+ if (safe_sprintf(params, "%s %" PRIu64 ,
192+ device, slices[j].start)) {
193 fprintf(stderr, "params too small\n");
194 exit(1);
195 }
196@@ -468,7 +469,7 @@ main(int argc, char **argv){
197 &slices[j].minor);
198
199 if (verbose)
200- printf("add map %s (%d:%d): 0 %lu %s %s\n",
201+ printf("add map %s (%d:%d): 0 %" PRIu64 " %s %s\n",
202 partname, slices[j].major,
203 slices[j].minor, slices[j].size,
204 DM_TARGET, params);
205@@ -502,10 +503,10 @@ main(int argc, char **argv){
206 }
207 strip_slash(partname);
208
209- if (safe_sprintf(params, "%d:%d %lu",
210+ if (safe_sprintf(params, "%d:%d %" PRIu64,
211 slices[k].major,
212 slices[k].minor,
213- (unsigned long)slices[j].start)) {
214+ slices[j].start)) {
215 fprintf(stderr, "params too small\n");
216 exit(1);
217 }
218@@ -524,7 +525,7 @@ main(int argc, char **argv){
219 &slices[j].minor);
220
221 if (verbose)
222- printf("add map %s : 0 %lu %s %s\n",
223+ printf("add map %s : 0 %" PRIu64 " %s %s\n",
224 partname, slices[j].size,
225 DM_TARGET, params);
226 c--;
227diff --git a/kpartx/kpartx.h b/kpartx/kpartx.h
228index 9b3aeca..43ae3f8 100644
229--- a/kpartx/kpartx.h
230+++ b/kpartx/kpartx.h
231@@ -1,6 +1,8 @@
232 #ifndef _KPARTX_H
233 #define _KPARTX_H
234
235+#include <stdint.h>
236+
237 /*
238 * For each partition type there is a routine that takes
239 * a block device and a range, and returns the list of
240@@ -20,8 +22,8 @@
241 * units: 512 byte sectors
242 */
243 struct slice {
244- unsigned long start;
245- unsigned long size;
246+ uint64_t start;
247+ uint64_t size;
248 int container;
249 int major;
250 int minor;
diff --git a/main/multipath-tools/multipath-tools-0.4.8-socket-cve-2009-0115.patch b/main/multipath-tools/multipath-tools-0.4.8-socket-cve-2009-0115.patch
deleted file mode 100644
index deab762065..0000000000
--- a/main/multipath-tools/multipath-tools-0.4.8-socket-cve-2009-0115.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From: Hannes Reinecke <hare@suse.de>
2Date: Wed, 1 Apr 2009 20:31:01 +0000 (+0200)
3Subject: [multipathd] /var/run/multipathd.sock is world-writable
4X-Git-Url: http://git.kernel.org/gitweb.cgi?p=linux%2Fstorage%2Fmultipath-tools%2F.git;a=commitdiff_plain;h=0a0319d381249760c71023edbe0ac9c093bb4a74;hp=15d4bdddcb9b71e0ec6fecc3c37a1b8cae8f51ff
5
6[multipathd] /var/run/multipathd.sock is world-writable
7
8Due to an stray 'umask()' the socket file is in fact world-writable,
9allowing for an easy exploit.
10
11References: 458598
12---
13
14diff --git a/multipathd/main.c b/multipathd/main.c
15index 8a1a63d..9957f1f 100644
16--- a/multipathd/main.c
17+++ b/multipathd/main.c
18@@ -1454,8 +1454,9 @@ daemonize(void)
19
20 close(in_fd);
21 close(out_fd);
22- chdir("/");
23- umask(0);
24+ if (chdir("/") < 0)
25+ fprintf(stderr, "cannot chdir to '/', continuing\n");
26+
27 return 0;
28 }
29
diff --git a/main/multipath-tools/multipath-tools-0.4.8-udev-scsi_id-changes.patch b/main/multipath-tools/multipath-tools-0.4.8-udev-scsi_id-changes.patch
deleted file mode 100644
index a770a05899..0000000000
--- a/main/multipath-tools/multipath-tools-0.4.8-udev-scsi_id-changes.patch
+++ /dev/null
@@ -1,90 +0,0 @@
1diff -Nuar multipath-tools-0.4.8.orig/libmultipath/defaults.h multipath-tools-0.4.8/libmultipath/defaults.h
2--- multipath-tools-0.4.8.orig/libmultipath/defaults.h 2007-08-02 21:05:37.000000000 +0000
3+++ multipath-tools-0.4.8/libmultipath/defaults.h 2009-10-30 06:00:21.432553430 +0000
4@@ -1,4 +1,4 @@
5-#define DEFAULT_GETUID "/lib/udev/scsi_id -g -u -s /block/%n"
6+#define DEFAULT_GETUID "/lib/udev/scsi_id -g -u -d /dev/%n"
7 #define DEFAULT_UDEVDIR "/dev"
8 #define DEFAULT_SELECTOR "round-robin 0"
9 #define DEFAULT_FEATURES "0"
10diff -Nuar multipath-tools-0.4.8.orig/libmultipath/hwtable.c multipath-tools-0.4.8/libmultipath/hwtable.c
11--- multipath-tools-0.4.8.orig/libmultipath/hwtable.c 2007-08-02 21:05:37.000000000 +0000
12+++ multipath-tools-0.4.8/libmultipath/hwtable.c 2009-10-30 06:00:08.087158020 +0000
13@@ -157,7 +157,7 @@
14 /* HP Smart Array */
15 .vendor = "HP",
16 .product = "LOGICAL VOLUME.*",
17- .getuid = "/lib/udev/scsi_id -n -g -u -s /block/%n",
18+ .getuid = "/lib/udev/scsi_id -n -g -u -d /dev/%n",
19 .getprio = NULL,
20 .features = DEFAULT_FEATURES,
21 .hwhandler = DEFAULT_HWHANDLER,
22@@ -199,7 +199,7 @@
23 {
24 .vendor = "EMC",
25 .product = "SYMMETRIX",
26- .getuid = "/lib/udev/scsi_id -g -u -ppre-spc3-83 -s /block/%n",
27+ .getuid = "/lib/udev/scsi_id -g -u -ppre-spc3-83 -d /dev/%n",
28 .getprio = NULL,
29 .features = DEFAULT_FEATURES,
30 .hwhandler = DEFAULT_HWHANDLER,
31diff -Nuar multipath-tools-0.4.8.orig/multipath/multipath.conf.5 multipath-tools-0.4.8/multipath/multipath.conf.5
32--- multipath-tools-0.4.8.orig/multipath/multipath.conf.5 2007-08-02 21:05:37.000000000 +0000
33+++ multipath-tools-0.4.8/multipath/multipath.conf.5 2009-10-30 05:59:19.272559733 +0000
34@@ -109,7 +109,7 @@
35 The default program and args to callout to obtain a unique path
36 identifier. Should be specified with an absolute path. Default value
37 is
38-.I /lib/udev/scsi_id -g -u -s
39+.I /lib/udev/scsi_id -g -u -d
40 .TP
41 .B prio_callout
42 The default program and args to callout to obtain a path priority
43diff -Nuar multipath-tools-0.4.8.orig/multipath.conf.annotated multipath-tools-0.4.8/multipath.conf.annotated
44--- multipath-tools-0.4.8.orig/multipath.conf.annotated 2007-08-02 21:05:37.000000000 +0000
45+++ multipath-tools-0.4.8/multipath.conf.annotated 2009-10-30 05:59:53.002576683 +0000
46@@ -47,9 +47,9 @@
47 # # scope : multipath
48 # # desc : the default program and args to callout to obtain a unique
49 # # path identifier. Absolute path required
50-# # default : /lib/udev/scsi_id -g -u -s
51+# # default : /lib/udev/scsi_id -g -u -d
52 # #
53-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
54+# getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n"
55 #
56 # #
57 # # name : prio_callout
58@@ -291,9 +291,9 @@
59 # # scope : multipath
60 # # desc : the program and args to callout to obtain a unique
61 # # path identifier. Absolute path required
62-# # default : /lib/udev/scsi_id -g -u -s
63+# # default : /lib/udev/scsi_id -g -u -d
64 # #
65-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
66+# getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n"
67 #
68 # #
69 # # name : prio_callout
70diff -Nuar multipath-tools-0.4.8.orig/multipath.conf.synthetic multipath-tools-0.4.8/multipath.conf.synthetic
71--- multipath-tools-0.4.8.orig/multipath.conf.synthetic 2007-08-02 21:05:37.000000000 +0000
72+++ multipath-tools-0.4.8/multipath.conf.synthetic 2009-10-30 05:59:38.569224508 +0000
73@@ -7,7 +7,7 @@
74 # polling_interval 10
75 # selector "round-robin 0"
76 # path_grouping_policy multibus
77-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
78+# getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n"
79 # prio_callout /bin/true
80 # path_checker directio
81 # rr_min_io 100
82@@ -52,7 +52,7 @@
83 # vendor "COMPAQ "
84 # product "HSV110 (C)COMPAQ"
85 # path_grouping_policy multibus
86-# getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
87+# getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n"
88 # path_checker directio
89 # path_selector "round-robin 0"
90 # hardware_handler "0"