diff options
author | Marcel Ritter <marcel@linux-ng.de> | 2022-06-21 09:19:17 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2022-06-21 09:24:35 -0400 |
commit | 2eabb25d5a43e48e769a0db29956e9f5dc5b5913 (patch) | |
tree | 9ad28cee6088d4278a234f975f68a0ab5c101af6 | |
parent | 09128b9e09b21ea3b4a7e5e19b211fc5f4c8c564 (diff) | |
download | nfs-utils-2eabb25d5a43e48e769a0db29956e9f5dc5b5913.tar.gz |
svcgssd: Fix use-after-free bug (config variables)
This patch fixes a bug when trying to set "principal" in /etc/nfs.conf.
Memory gets freed by conf_cleanup() before being used - moving cleanup
code resolves that.
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/gssd/svcgssd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c index 881207b..a242b78 100644 --- a/utils/gssd/svcgssd.c +++ b/utils/gssd/svcgssd.c @@ -211,9 +211,6 @@ main(int argc, char *argv[]) rpc_verbosity = conf_get_num("svcgssd", "RPC-Verbosity", rpc_verbosity); idmap_verbosity = conf_get_num("svcgssd", "IDMAP-Verbosity", idmap_verbosity); - /* We don't need the config anymore */ - conf_cleanup(); - while ((opt = getopt(argc, argv, "fivrnp:")) != -1) { switch (opt) { case 'f': @@ -328,6 +325,9 @@ main(int argc, char *argv[]) daemon_ready(); + /* We don't need the config anymore */ + conf_cleanup(); + nfs4_init_name_mapping(NULL); /* XXX: should only do this once */ rc = event_base_dispatch(evbase); |