]> git.ipfire.org Git - ipfire-3.x.git/blame - multipath-tools/patches/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch
krb5: Update to 1.14.4
[ipfire-3.x.git] / multipath-tools / patches / 0047-RHBZ-980777-kpartx-read-only-loop-devs.patch
CommitLineData
289c5516
MT
1---
2 kpartx/kpartx.c | 3 +--
3 kpartx/lopart.c | 2 +-
4 2 files changed, 2 insertions(+), 3 deletions(-)
5
6Index: multipath-tools-130222/kpartx/kpartx.c
7===================================================================
8--- multipath-tools-130222.orig/kpartx/kpartx.c
9+++ multipath-tools-130222/kpartx/kpartx.c
10@@ -204,7 +204,6 @@ main(int argc, char **argv){
11 char * delim = NULL;
12 char *uuid = NULL;
13 char *mapname = NULL;
14- int loopro = 0;
15 int hotplug = 0;
16 int loopcreated = 0;
17 struct stat buf;
18@@ -315,7 +314,7 @@ main(int argc, char **argv){
19 if (!loopdev) {
20 loopdev = find_unused_loop_device();
21
22- if (set_loop(loopdev, device, 0, &loopro)) {
23+ if (set_loop(loopdev, device, 0, &ro)) {
24 fprintf(stderr, "can't set up loop\n");
25 exit (1);
26 }
27Index: multipath-tools-130222/kpartx/lopart.c
28===================================================================
29--- multipath-tools-130222.orig/kpartx/lopart.c
30+++ multipath-tools-130222/kpartx/lopart.c
31@@ -230,7 +230,7 @@ set_loop (const char *device, const char
32
33 if ((ffd = open (file, mode)) < 0) {
34
35- if (!*loopro && errno == EROFS)
36+ if (!*loopro && (errno == EROFS || errno == EACCES))
37 ffd = open (file, mode = O_RDONLY);
38
39 if (ffd < 0) {