|
|
ce0267 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
ce0267 |
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
ce0267 |
Date: Thu, 8 Sep 2022 11:54:49 -0500
|
|
|
ce0267 |
Subject: [PATCH] multipathd: ignore duplicated multipathd command keys
|
|
|
ce0267 |
|
|
|
ce0267 |
multipath adds rather than or-s the values of command keys. Fix this.
|
|
|
ce0267 |
Also, return an invalid fingerprint if a key is used more than once.
|
|
|
ce0267 |
|
|
|
ce0267 |
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
ce0267 |
---
|
|
|
ce0267 |
multipathd/cli.c | 8 ++--
|
|
|
ce0267 |
multipathd/main.c | 106 +++++++++++++++++++++++-----------------------
|
|
|
ce0267 |
2 files changed, 58 insertions(+), 56 deletions(-)
|
|
|
ce0267 |
|
|
|
ce0267 |
diff --git a/multipathd/cli.c b/multipathd/cli.c
|
|
|
ce0267 |
index 85d73dfb..45e80197 100644
|
|
|
ce0267 |
--- a/multipathd/cli.c
|
|
|
ce0267 |
+++ b/multipathd/cli.c
|
|
|
ce0267 |
@@ -341,9 +341,11 @@ fingerprint(vector vec)
|
|
|
ce0267 |
if (!vec)
|
|
|
ce0267 |
return 0;
|
|
|
ce0267 |
|
|
|
ce0267 |
- vector_foreach_slot(vec, kw, i)
|
|
|
ce0267 |
- fp += kw->code;
|
|
|
ce0267 |
-
|
|
|
ce0267 |
+ vector_foreach_slot(vec, kw, i) {
|
|
|
ce0267 |
+ if (fp & kw->code)
|
|
|
ce0267 |
+ return (uint64_t)-1;
|
|
|
ce0267 |
+ fp |= kw->code;
|
|
|
ce0267 |
+ }
|
|
|
ce0267 |
return fp;
|
|
|
ce0267 |
}
|
|
|
ce0267 |
|
|
|
ce0267 |
diff --git a/multipathd/main.c b/multipathd/main.c
|
|
|
ce0267 |
index 870ae7d8..cd68a9d2 100644
|
|
|
ce0267 |
--- a/multipathd/main.c
|
|
|
ce0267 |
+++ b/multipathd/main.c
|
|
|
ce0267 |
@@ -1628,62 +1628,62 @@ uxlsnrloop (void * ap)
|
|
|
ce0267 |
/* Tell main thread that thread has started */
|
|
|
ce0267 |
post_config_state(DAEMON_CONFIGURE);
|
|
|
ce0267 |
|
|
|
ce0267 |
- set_handler_callback(LIST+PATHS, cli_list_paths);
|
|
|
ce0267 |
- set_handler_callback(LIST+PATHS+FMT, cli_list_paths_fmt);
|
|
|
ce0267 |
- set_handler_callback(LIST+PATHS+RAW+FMT, cli_list_paths_raw);
|
|
|
ce0267 |
- set_handler_callback(LIST+PATH, cli_list_path);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAPS, cli_list_maps);
|
|
|
ce0267 |
- set_handler_callback(LIST+STATUS, cli_list_status);
|
|
|
ce0267 |
- set_unlocked_handler_callback(LIST+DAEMON, cli_list_daemon);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAPS+STATUS, cli_list_maps_status);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAPS+STATS, cli_list_maps_stats);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAPS+FMT, cli_list_maps_fmt);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAPS+RAW+FMT, cli_list_maps_raw);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAPS+TOPOLOGY, cli_list_maps_topology);
|
|
|
ce0267 |
- set_handler_callback(LIST+TOPOLOGY, cli_list_maps_topology);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAPS+JSON, cli_list_maps_json);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAP+TOPOLOGY, cli_list_map_topology);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAP+FMT, cli_list_map_fmt);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAP+RAW+FMT, cli_list_map_fmt);
|
|
|
ce0267 |
- set_handler_callback(LIST+MAP+JSON, cli_list_map_json);
|
|
|
ce0267 |
- set_handler_callback(LIST+CONFIG+LOCAL, cli_list_config_local);
|
|
|
ce0267 |
- set_handler_callback(LIST+CONFIG, cli_list_config);
|
|
|
ce0267 |
- set_handler_callback(LIST+BLACKLIST, cli_list_blacklist);
|
|
|
ce0267 |
- set_handler_callback(LIST+DEVICES, cli_list_devices);
|
|
|
ce0267 |
- set_handler_callback(LIST+WILDCARDS, cli_list_wildcards);
|
|
|
ce0267 |
- set_handler_callback(RESET+MAPS+STATS, cli_reset_maps_stats);
|
|
|
ce0267 |
- set_handler_callback(RESET+MAP+STATS, cli_reset_map_stats);
|
|
|
ce0267 |
- set_handler_callback(ADD+PATH, cli_add_path);
|
|
|
ce0267 |
- set_handler_callback(DEL+PATH, cli_del_path);
|
|
|
ce0267 |
- set_handler_callback(ADD+MAP, cli_add_map);
|
|
|
ce0267 |
- set_handler_callback(DEL+MAP, cli_del_map);
|
|
|
ce0267 |
- set_handler_callback(DEL+MAPS, cli_del_maps);
|
|
|
ce0267 |
- set_handler_callback(SWITCH+MAP+GROUP, cli_switch_group);
|
|
|
ce0267 |
+ set_handler_callback(LIST|PATHS, cli_list_paths);
|
|
|
ce0267 |
+ set_handler_callback(LIST|PATHS|FMT, cli_list_paths_fmt);
|
|
|
ce0267 |
+ set_handler_callback(LIST|PATHS|RAW|FMT, cli_list_paths_raw);
|
|
|
ce0267 |
+ set_handler_callback(LIST|PATH, cli_list_path);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAPS, cli_list_maps);
|
|
|
ce0267 |
+ set_handler_callback(LIST|STATUS, cli_list_status);
|
|
|
ce0267 |
+ set_unlocked_handler_callback(LIST|DAEMON, cli_list_daemon);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAPS|STATUS, cli_list_maps_status);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAPS|STATS, cli_list_maps_stats);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAPS|FMT, cli_list_maps_fmt);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAPS|RAW|FMT, cli_list_maps_raw);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAPS|TOPOLOGY, cli_list_maps_topology);
|
|
|
ce0267 |
+ set_handler_callback(LIST|TOPOLOGY, cli_list_maps_topology);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAPS|JSON, cli_list_maps_json);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAP|TOPOLOGY, cli_list_map_topology);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAP|FMT, cli_list_map_fmt);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAP|RAW|FMT, cli_list_map_fmt);
|
|
|
ce0267 |
+ set_handler_callback(LIST|MAP|JSON, cli_list_map_json);
|
|
|
ce0267 |
+ set_handler_callback(LIST|CONFIG|LOCAL, cli_list_config_local);
|
|
|
ce0267 |
+ set_handler_callback(LIST|CONFIG, cli_list_config);
|
|
|
ce0267 |
+ set_handler_callback(LIST|BLACKLIST, cli_list_blacklist);
|
|
|
ce0267 |
+ set_handler_callback(LIST|DEVICES, cli_list_devices);
|
|
|
ce0267 |
+ set_handler_callback(LIST|WILDCARDS, cli_list_wildcards);
|
|
|
ce0267 |
+ set_handler_callback(RESET|MAPS|STATS, cli_reset_maps_stats);
|
|
|
ce0267 |
+ set_handler_callback(RESET|MAP|STATS, cli_reset_map_stats);
|
|
|
ce0267 |
+ set_handler_callback(ADD|PATH, cli_add_path);
|
|
|
ce0267 |
+ set_handler_callback(DEL|PATH, cli_del_path);
|
|
|
ce0267 |
+ set_handler_callback(ADD|MAP, cli_add_map);
|
|
|
ce0267 |
+ set_handler_callback(DEL|MAP, cli_del_map);
|
|
|
ce0267 |
+ set_handler_callback(DEL|MAPS, cli_del_maps);
|
|
|
ce0267 |
+ set_handler_callback(SWITCH|MAP|GROUP, cli_switch_group);
|
|
|
ce0267 |
set_unlocked_handler_callback(RECONFIGURE, cli_reconfigure);
|
|
|
ce0267 |
- set_handler_callback(SUSPEND+MAP, cli_suspend);
|
|
|
ce0267 |
- set_handler_callback(RESUME+MAP, cli_resume);
|
|
|
ce0267 |
- set_handler_callback(RESIZE+MAP, cli_resize);
|
|
|
ce0267 |
- set_handler_callback(RELOAD+MAP, cli_reload);
|
|
|
ce0267 |
- set_handler_callback(RESET+MAP, cli_reassign);
|
|
|
ce0267 |
- set_handler_callback(REINSTATE+PATH, cli_reinstate);
|
|
|
ce0267 |
- set_handler_callback(FAIL+PATH, cli_fail);
|
|
|
ce0267 |
- set_handler_callback(DISABLEQ+MAP, cli_disable_queueing);
|
|
|
ce0267 |
- set_handler_callback(RESTOREQ+MAP, cli_restore_queueing);
|
|
|
ce0267 |
- set_handler_callback(DISABLEQ+MAPS, cli_disable_all_queueing);
|
|
|
ce0267 |
- set_handler_callback(RESTOREQ+MAPS, cli_restore_all_queueing);
|
|
|
ce0267 |
+ set_handler_callback(SUSPEND|MAP, cli_suspend);
|
|
|
ce0267 |
+ set_handler_callback(RESUME|MAP, cli_resume);
|
|
|
ce0267 |
+ set_handler_callback(RESIZE|MAP, cli_resize);
|
|
|
ce0267 |
+ set_handler_callback(RELOAD|MAP, cli_reload);
|
|
|
ce0267 |
+ set_handler_callback(RESET|MAP, cli_reassign);
|
|
|
ce0267 |
+ set_handler_callback(REINSTATE|PATH, cli_reinstate);
|
|
|
ce0267 |
+ set_handler_callback(FAIL|PATH, cli_fail);
|
|
|
ce0267 |
+ set_handler_callback(DISABLEQ|MAP, cli_disable_queueing);
|
|
|
ce0267 |
+ set_handler_callback(RESTOREQ|MAP, cli_restore_queueing);
|
|
|
ce0267 |
+ set_handler_callback(DISABLEQ|MAPS, cli_disable_all_queueing);
|
|
|
ce0267 |
+ set_handler_callback(RESTOREQ|MAPS, cli_restore_all_queueing);
|
|
|
ce0267 |
set_unlocked_handler_callback(QUIT, cli_quit);
|
|
|
ce0267 |
set_unlocked_handler_callback(SHUTDOWN, cli_shutdown);
|
|
|
ce0267 |
- set_handler_callback(GETPRSTATUS+MAP, cli_getprstatus);
|
|
|
ce0267 |
- set_handler_callback(SETPRSTATUS+MAP, cli_setprstatus);
|
|
|
ce0267 |
- set_handler_callback(UNSETPRSTATUS+MAP, cli_unsetprstatus);
|
|
|
ce0267 |
- set_handler_callback(FORCEQ+DAEMON, cli_force_no_daemon_q);
|
|
|
ce0267 |
- set_handler_callback(RESTOREQ+DAEMON, cli_restore_no_daemon_q);
|
|
|
ce0267 |
- set_handler_callback(GETPRKEY+MAP, cli_getprkey);
|
|
|
ce0267 |
- set_handler_callback(SETPRKEY+MAP+KEY, cli_setprkey);
|
|
|
ce0267 |
- set_handler_callback(UNSETPRKEY+MAP, cli_unsetprkey);
|
|
|
ce0267 |
- set_handler_callback(SETMARGINAL+PATH, cli_set_marginal);
|
|
|
ce0267 |
- set_handler_callback(UNSETMARGINAL+PATH, cli_unset_marginal);
|
|
|
ce0267 |
- set_handler_callback(UNSETMARGINAL+MAP, cli_unset_all_marginal);
|
|
|
ce0267 |
+ set_handler_callback(GETPRSTATUS|MAP, cli_getprstatus);
|
|
|
ce0267 |
+ set_handler_callback(SETPRSTATUS|MAP, cli_setprstatus);
|
|
|
ce0267 |
+ set_handler_callback(UNSETPRSTATUS|MAP, cli_unsetprstatus);
|
|
|
ce0267 |
+ set_handler_callback(FORCEQ|DAEMON, cli_force_no_daemon_q);
|
|
|
ce0267 |
+ set_handler_callback(RESTOREQ|DAEMON, cli_restore_no_daemon_q);
|
|
|
ce0267 |
+ set_handler_callback(GETPRKEY|MAP, cli_getprkey);
|
|
|
ce0267 |
+ set_handler_callback(SETPRKEY|MAP|KEY, cli_setprkey);
|
|
|
ce0267 |
+ set_handler_callback(UNSETPRKEY|MAP, cli_unsetprkey);
|
|
|
ce0267 |
+ set_handler_callback(SETMARGINAL|PATH, cli_set_marginal);
|
|
|
ce0267 |
+ set_handler_callback(UNSETMARGINAL|PATH, cli_unset_marginal);
|
|
|
ce0267 |
+ set_handler_callback(UNSETMARGINAL|MAP, cli_unset_all_marginal);
|
|
|
ce0267 |
|
|
|
ce0267 |
umask(077);
|
|
|
ce0267 |
uxsock_listen(&uxsock_trigger, ux_sock, ap);
|