2 libmultipath/Makefile | 2
3 libmultipath/callout.c | 217 -----------------------------------------------
4 libmultipath/callout.h | 7 -
5 libmultipath/discovery.c | 1
7 5 files changed, 1 insertion(+), 227 deletions(-)
9 Index: multipath-tools-120518/libmultipath/Makefile
10 ===================================================================
11 --- multipath-tools-120518.orig/libmultipath/Makefile
12 +++ multipath-tools-120518/libmultipath/Makefile
13 @@ -9,7 +9,7 @@ DEVLIB = libmultipath.so
14 LIBS = $(DEVLIB).$(SONAME)
15 LIBDEPS = -lpthread -ldl -ldevmapper -ludev
17 -OBJS = memory.o parser.o vector.o devmapper.o callout.o \
18 +OBJS = memory.o parser.o vector.o devmapper.o \
19 hwtable.o blacklist.o util.o dmparser.o config.o \
20 structs.o discovery.o propsel.o dict.o \
21 pgpolicies.o debug.o regex.o defaults.o uevent.o \
22 Index: multipath-tools-120518/libmultipath/callout.c
23 ===================================================================
24 --- multipath-tools-120518.orig/libmultipath/callout.c
28 - * Source: copy of the udev package source file
30 - * Copyrights of the source file apply
31 - * Copyright (c) 2004 Christophe Varoqui
34 -#include <sys/stat.h>
37 -#include <sys/types.h>
40 -#include <sys/wait.h>
43 -#include "checkers.h"
49 -int execute_program(char *path, char *value, int len)
54 - int fds[2], null_fd;
57 - char arg[CALLOUT_MAX_SIZE];
58 - int argc = sizeof(arg) / 2;
59 - char *argv[argc + 1];
64 - if (strchr(path, ' ')) {
65 - strlcpy(arg, path, sizeof(arg));
67 - while (pos != NULL && i < argc) {
68 - if (pos[0] == '\'') {
69 - /* don't separate if in apostrophes */
71 - argv[i] = strsep(&pos, "\'");
72 - while (pos[0] == ' ')
75 - argv[i] = strsep(&pos, " ");
87 - condlog(0, "error creating pipe for callout: %s", strerror(errno));
96 - close(STDOUT_FILENO);
98 - /* dup write side of pipe to STDOUT */
99 - if (dup(fds[1]) < 0)
102 - /* Ignore writes to stderr */
103 - null_fd = open("/dev/null", O_WRONLY);
105 - close(STDERR_FILENO);
110 - retval = execv(argv[0], argv);
111 - condlog(0, "error execing %s : %s", argv[0], strerror(errno));
114 - condlog(0, "fork failed: %s", strerror(errno));
119 - /* parent reads from fds[0] */
124 - count = read(fds[0], value + i, len - i-1);
130 - condlog(0, "not enough space for response from %s", argv[0]);
137 - condlog(0, "no response from %s", argv[0]);
141 - if (i > 0 && value[i-1] == '\n')
149 - if (WIFEXITED(status)) {
150 - status = WEXITSTATUS(status);
154 - condlog(0, "%s exitted with %d", argv[0], status);
156 - else if (WIFSIGNALED(status))
157 - condlog(0, "%s was terminated by signal %d", argv[0], WTERMSIG(status));
159 - condlog(0, "%s terminated abnormally", argv[0]);
165 -apply_format (char * string, char * cmd, struct path * pp)
182 - pos = strchr(string, '%');
183 - myfree = CALLOUT_MAX_SIZE;
186 - strcpy(dst, string);
190 - len = (int) (pos - string) + 1;
196 - snprintf(p, len, "%s", string);
202 - len = strlen(pp->dev) + 1;
208 - snprintf(p, len, "%s", pp->dev);
209 - for (q = p; q < p + len; q++) {
210 - if (q && *q == '!')
216 - len = strlen(pp->dev_t) + 1;
222 - snprintf(p, len, "%s", pp->dev_t);
233 - len = strlen(pos) + 1;
239 - snprintf(p, len, "%s", pos);
240 - condlog(3, "reformated callout = %s", dst);
244 Index: multipath-tools-120518/libmultipath/callout.h
245 ===================================================================
246 --- multipath-tools-120518.orig/libmultipath/callout.h
252 -int execute_program(char *, char *, int);
253 -int apply_format (char *, char *, struct path *);
255 -#endif /* _CALLOUT_H */
256 Index: multipath-tools-120518/libmultipath/discovery.c
257 ===================================================================
258 --- multipath-tools-120518.orig/libmultipath/discovery.c
259 +++ multipath-tools-120518/libmultipath/discovery.c
263 #include "blacklist.h"
264 -#include "callout.h"
267 #include "sg_include.h"
268 Index: multipath-tools-120518/multipathd/main.c
269 ===================================================================
270 --- multipath-tools-120518.orig/multipathd/main.c
271 +++ multipath-tools-120518/multipathd/main.c
274 #include <defaults.h>
276 -#include <callout.h>
277 #include <blacklist.h>
278 #include <structs_vec.h>
279 #include <dmparser.h>