diff --git a/SOURCES/nuxwdog-heisen-memory-bug.patch b/SOURCES/nuxwdog-heisen-memory-bug.patch new file mode 100644 index 0000000..381b6e7 --- /dev/null +++ b/SOURCES/nuxwdog-heisen-memory-bug.patch @@ -0,0 +1,47 @@ +From 63d0cb4948d240068be52c5b0f701a9524320d4d Mon Sep 17 00:00:00 2001 +From: Dinesh Prasanth M K +Date: Thu, 16 Aug 2018 12:23:31 -0400 +Subject: [PATCH] Fixing memory issue in NHSM-OCS + +This fixes the heisen memory bug +https://pagure.io/nuxwdog/issue/8 + +Signed-off-by: Dinesh Prasanth M K +--- + src/com/redhat/nuxwdog/wdpwd.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/com/redhat/nuxwdog/wdpwd.cpp b/src/com/redhat/nuxwdog/wdpwd.cpp +index 1ff7829..09191fc 100644 +--- a/src/com/redhat/nuxwdog/wdpwd.cpp ++++ b/src/com/redhat/nuxwdog/wdpwd.cpp +@@ -111,7 +111,7 @@ watchdog_pwd_encrypt(char *pwdvalue, pwdenc_t *pwdcrypt) + + int len = strlen(pwdvalue); + { +- if ((pwdcrypt->ptr = (void *)malloc(len)) == NULL) ++ if ((pwdcrypt->ptr = (void *)malloc(len + 1)) == NULL) + return; + + pwdcrypt->len = len; +@@ -247,7 +247,7 @@ int watchdog_pwd_save(char *pwdname, int serial, char *pwdvalue) + * Already have this password saved, so server must be + * reprompting. Replace the old value with the new value. + */ +- char *keyname = (char *) malloc(strlen(pwdname) + strlen(KEY_PREFIX)); ++ char *keyname = (char *) malloc(strlen(pwdname) + strlen(KEY_PREFIX) + 1); + sprintf(keyname, "%s%s", KEY_PREFIX, pwdname); + pwdp->pwdserial = add_key("user", keyname, (void *) pwdvalue, + strlen(pwdvalue), KEY_SPEC_PROCESS_KEYRING); +@@ -270,7 +270,7 @@ int watchdog_pwd_save(char *pwdname, int serial, char *pwdvalue) + pwdp->pwdname = strdup(pwdname); + pwdp->serial = serial; + +- char *keyname = (char *) malloc(strlen(pwdname) + strlen(KEY_PREFIX)); ++ char *keyname = (char *) malloc(strlen(pwdname) + strlen(KEY_PREFIX) + 1); + sprintf(keyname, "%s%s", KEY_PREFIX, pwdname); + pwdp->pwdserial = add_key("user", keyname, (void *) pwdvalue, + strlen(pwdvalue), KEY_SPEC_PROCESS_KEYRING); +-- +2.14.4 + diff --git a/SPECS/nuxwdog.spec b/SPECS/nuxwdog.spec index 37e1348..4d917ae 100644 --- a/SPECS/nuxwdog.spec +++ b/SPECS/nuxwdog.spec @@ -1,7 +1,6 @@ Name: nuxwdog Version: 1.0.3 -#Release: 5.1%{?dist} -Release: 5.1.el7_4 +Release: 8%{?dist} Summary: Watchdog server to start and stop processes, and prompt for passwords # The entire source code is LGPLv2 except for the perl module, which is GPL+ or Artistic License: LGPLv2 and (GPL+ or Artistic) @@ -26,6 +25,7 @@ Obsoletes: nuxwdog-client Source0: https://fedorahosted.org/released/nuxwdog/%{name}-%{version}.tar.gz Patch0: nuxwdog-Allow-unlimited-conf-line-length.patch Patch1: nuxwdog-set-uid.patch +Patch2: nuxwdog-heisen-memory-bug.patch # Note: there is an rpmlint warning about Nuxwdogclient.so being a private-shared-object-provide # This would ordinarily be fixed by calling the macro perl_default_filter, but @@ -73,6 +73,7 @@ The nuxwdog-client-perl package contains a perl interface to nuxwdog. %setup -q -n %{name}-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build ant \ @@ -143,9 +144,15 @@ rm -rf %{buildroot} %exclude %dir %{perl_vendorarch}/auto/ %changelog -* Tue Feb 13 2018 Ade Lee 1.0.3-5.1 +* Mon Aug 20 2018 Dogtag Team 1.0.3-8 +- Resolves: rhbz #1615617 - nuxwdog systemd - memory error + when starting subCA (dmoluguw) + +* Wed Jan 17 2018 Ade Lee 1.0.3-7 +- Resolves: 1534030 - add option to set process uid + +* Thu Nov 2 2017 Ade Lee 1.0.3-6 - Resolves: rhbz#1503753 - nuxwdog is cutting off long ExeArgs -- Resolves: rhbz#1534030 - add option to set process uid * Fri Jun 24 2016 Ade Lee 1.0.3-5 - Resolves: rhbz#1283272 - Move perl bindings to a subpackage