From a5b731c6d3a5258894ea1f7c2bad9fd7cff51003 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Wed, 8 Jan 2025 10:52:56 -0500 Subject: [PATCH] conffile: add 'arg' argument to conf_remove_now() (RHEL-70923) Signed-off-by: Steve Dickson Resolves: RHEL-70923 --- nfs-utils-2.5.4-conffile-argument.patch | 38 +++++++++++++++++++++++++ nfs-utils.spec | 4 +++ 2 files changed, 42 insertions(+) create mode 100644 nfs-utils-2.5.4-conffile-argument.patch diff --git a/nfs-utils-2.5.4-conffile-argument.patch b/nfs-utils-2.5.4-conffile-argument.patch new file mode 100644 index 0000000..5a770d6 --- /dev/null +++ b/nfs-utils-2.5.4-conffile-argument.patch @@ -0,0 +1,38 @@ +diff -up nfs-utils-2.5.4/support/nfs/conffile.c.orig nfs-utils-2.5.4/support/nfs/conffile.c +--- nfs-utils-2.5.4/support/nfs/conffile.c.orig 2021-06-10 14:07:47.000000000 -0400 ++++ nfs-utils-2.5.4/support/nfs/conffile.c 2025-01-08 10:36:51.838168127 -0500 +@@ -169,13 +169,15 @@ static void free_conftrans(struct conf_t + * Insert a tag-value combination from LINE (the equal sign is at POS) + */ + static int +-conf_remove_now(const char *section, const char *tag) ++conf_remove_now(const char *section, const char *arg, const char *tag) + { + struct conf_binding *cb, *next; + + cb = LIST_FIRST(&conf_bindings[conf_hash (section)]); + for (; cb; cb = next) { + next = LIST_NEXT(cb, link); ++ if (arg && (cb->arg == NULL || strcasecmp(arg, cb->arg) != 0)) ++ continue; + if (strcasecmp(cb->section, section) == 0 + && strcasecmp(cb->tag, tag) == 0) { + LIST_REMOVE(cb, link); +@@ -217,7 +219,7 @@ conf_set_now(const char *section, const + struct conf_binding *node = 0; + + if (override) +- conf_remove_now(section, tag); ++ conf_remove_now(section, arg, tag); + else if (conf_get_section(section, arg, tag)) { + if (!is_default) { + xlog(LOG_INFO, "conf_set: duplicate tag [%s]:%s, ignoring...", +@@ -1252,7 +1254,7 @@ conf_end(int transaction, int commit) + node->is_default); + break; + case CONF_REMOVE: +- conf_remove_now(node->section, node->tag); ++ conf_remove_now(node->section, node->arg, node->tag); + break; + case CONF_REMOVE_SECTION: + conf_remove_section_now(node->section); diff --git a/nfs-utils.spec b/nfs-utils.spec index ab63cf7..01ce3df 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -71,6 +71,7 @@ Patch027: nfs-utils-2.5.4-gssd-segfault.patch Patch028: nfs-utils-2.5.4-rpcidmapd-nfsopen-failure.patch Patch029: nfs-utils-2.5.4-mount-writable.patch Patch030: nfs-utils-2.5.4-mount-v3-retry.patch +Patch031: nfs-utils-2.5.4-conffile-argument.patch Patch100: nfs-utils-1.2.1-statdpath-man.patch Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch @@ -512,6 +513,9 @@ fi %{_mandir}/*/nfsiostat.8.gz %changelog +* Wed Jan 8 2025 Steve Dickson 2.5.4-29 +- conffile: add 'arg' argument to conf_remove_now() (RHEL-70923) + * Sun Nov 24 2024 Steve Dickson 2.5.4-28 - Makefile.am: allow mount.nfs to be writeable by owner (RHEL-68701) - mount.nfs: retry NFSv3 mount after NFSv4 failure in auto negotiation (RHEL-68574)