From 2e686d0a16a8449f4d816e6e31a56fc8a805151e Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 30 Mar 2023 04:07:07 -0400 Subject: [PATCH 01/54] Update defaults.yaml Signed-off-by: 1000TurquoisePogs --- defaults.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults.yaml b/defaults.yaml index c3d872d34..4b55a8f59 100644 --- a/defaults.yaml +++ b/defaults.yaml @@ -14,8 +14,8 @@ components: fallback: true retryIntervalSeconds: 10 https: - keyring: ${{ ()=> { if (components.zss.tls) { if (zowe.certificate.keystore.type == "JCERACFKS") { return zowe.certificate.keystore.file.replace(/safkeyring:\/+/,"") } else { return zowe.certificate.keystore.file } } else { return null } }() }} - password: ${{ ()=> { if (components.zss.tls) { if (zowe.certificate.keystore.type == "JCERACFKS") { return null } else { return zowe.certificate.keystore.password } } else { return null } }() }} + keyring: ${{ ()=> { if (components.zss.tls) { if (zowe.certificate.keystore.type.startsWith("JCERACF")) { return zowe.certificate.keystore.file.replace(/safkeyring.*:\/+/,"") } else { return zowe.certificate.keystore.file } } else { return null } }() }} + password: ${{ ()=> { if (components.zss.tls) { if (zowe.certificate.keystore.type.startsWith("JCERACF")) { return null } else { return zowe.certificate.keystore.password } } else { return null } }() }} label: ${{ ()=> { if (components.zss.tls) { return zowe.certificate.keystore.alias } else { return null } }() }} port: ${{ ()=> { if (components.zss.tls) { return components.zss.port } else { return null } }() }} ipAddresses: ${{ ()=> { if (components.zss.tls){ if (zowe.environments?.ZWED_agent_https_ipAddresses){ return zowe.environments.ZWED_agent_https_ipAddresses.split(',') } else { return [ '0.0.0.0' ] } } else { return null } }() }} From 0b157220427d0657228659c15b8e4be0c4204bf5 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 30 Mar 2023 04:22:19 -0400 Subject: [PATCH 02/54] Update defaults.yaml Signed-off-by: 1000TurquoisePogs --- defaults.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults.yaml b/defaults.yaml index 4b55a8f59..b29a4e9aa 100644 --- a/defaults.yaml +++ b/defaults.yaml @@ -14,8 +14,8 @@ components: fallback: true retryIntervalSeconds: 10 https: - keyring: ${{ ()=> { if (components.zss.tls) { if (zowe.certificate.keystore.type.startsWith("JCERACF")) { return zowe.certificate.keystore.file.replace(/safkeyring.*:\/+/,"") } else { return zowe.certificate.keystore.file } } else { return null } }() }} - password: ${{ ()=> { if (components.zss.tls) { if (zowe.certificate.keystore.type.startsWith("JCERACF")) { return null } else { return zowe.certificate.keystore.password } } else { return null } }() }} + keyring: ${{ ()=> { if (components.zss.tls) { if (zowe.certificate.keystore.type.match(/JCE.*KS/)) { return zowe.certificate.keystore.file.replace(/safkeyring.*:\/+/,"") } else { return zowe.certificate.keystore.file } } else { return null } }() }} + password: ${{ ()=> { if (components.zss.tls) { if (zowe.certificate.keystore.type.match(/JCE.*KS/)) { return null } else { return zowe.certificate.keystore.password } } else { return null } }() }} label: ${{ ()=> { if (components.zss.tls) { return zowe.certificate.keystore.alias } else { return null } }() }} port: ${{ ()=> { if (components.zss.tls) { return components.zss.port } else { return null } }() }} ipAddresses: ${{ ()=> { if (components.zss.tls){ if (zowe.environments?.ZWED_agent_https_ipAddresses){ return zowe.environments.ZWED_agent_https_ipAddresses.split(',') } else { return [ '0.0.0.0' ] } } else { return null } }() }} From a1de800ede5af77b249f22d09db4dfa488049635 Mon Sep 17 00:00:00 2001 From: Irek Fakhrutdinov Date: Wed, 18 Oct 2023 11:21:10 +0200 Subject: [PATCH 03/54] Remove unnecessary AC=1 options from build scripts and comments Additionally, remove the old ZIS build script. Signed-off-by: Irek Fakhrutdinov --- build/build_dynamic.sh | 2 +- build/build_env.sh | 1 - build/build_zss.sh | 1 - build/build_zss64.sh | 2 +- c/storageApiml.c | 2 +- c/zis/build.sh | 134 -------------------------- plugins/zis/echo/build.sh | 2 +- plugins/zis/magic-number/build.sh | 2 +- tests/build_zisdl.sh | 2 +- zis-aux/test/aux-guest/build/build.sh | 2 +- zis-aux/test/utils/build/build.sh | 2 +- 11 files changed, 8 insertions(+), 144 deletions(-) delete mode 100644 c/zis/build.sh diff --git a/build/build_dynamic.sh b/build/build_dynamic.sh index bf0f7e047..4167e7491 100755 --- a/build/build_dynamic.sh +++ b/build/build_dynamic.sh @@ -146,7 +146,7 @@ do done -ld -V -b ac=1 -b rent -b case=mixed -b map -b xref -b reus -e getPluginDescriptor \ +ld -V -b rent -b case=mixed -b map -b xref -b reus -e getPluginDescriptor \ -o "//'${USER}.DEV.LOADLIB(ZWESISDL)'" \ zisdynamic.o \ server-api.o \ diff --git a/build/build_env.sh b/build/build_env.sh index f33c68456..bb2030900 100644 --- a/build/build_env.sh +++ b/build/build_env.sh @@ -40,7 +40,6 @@ c89 \ -DHTTPSERVER_BPX_IMPERSONATION=1 \ -DAPF_AUTHORIZED=0 \ -Wc,dll,expo,langlvl\(extc99\),gonum,goff,hgpr,roconst,ASM,asmlib\('CEE.SCEEMAC','SYS1.MACLIB','SYS1.MODGEN'\) \ - -Wl,ac=1 \ -I ${COMMON}/h \ -I ${ZSS}/h \ -o ${ZSS}/bin/envService \ diff --git a/build/build_zss.sh b/build/build_zss.sh index bd1b35950..394123121 100755 --- a/build/build_zss.sh +++ b/build/build_zss.sh @@ -151,7 +151,6 @@ xlc \ -DNEW_CAA_LOCATIONS=1 \ -Wc,dll,expo,langlvl\(extc99\),gonum,goff,hgpr,roconst,ASM,asmlib\('CEE.SCEEMAC','SYS1.MACLIB','SYS1.MODGEN'\) \ -Wc,xplink,agg,exp,list,so\(\),off,xref \ - -Wl,ac=1 \ -I ${COMMON}/h \ -I ${COMMON}/platform/posix \ -I ${COMMON}/jwt/jwt \ diff --git a/build/build_zss64.sh b/build/build_zss64.sh index e6fd32324..f07d63221 100755 --- a/build/build_zss64.sh +++ b/build/build_zss64.sh @@ -148,7 +148,7 @@ if ! c89 \ -DNEW_CAA_LOCATIONS=1 \ -Wc,lp64,dll,expo,langlvl\(extc99\),gonum,goff,hgpr,roconst,ASM,asmlib\('CEE.SCEEMAC','SYS1.MACLIB','SYS1.MODGEN'\) \ -Wc,agg,exp,list,so\(\),off,xref \ - -Wl,lp64,ac=1 \ + -Wl,lp64 \ -I ${COMMON}/h \ -I ${COMMON}/platform/posix \ -I ${COMMON}/jwt/jwt \ diff --git a/c/storageApiml.c b/c/storageApiml.c index 40fec1c77..c9760221f 100644 --- a/c/storageApiml.c +++ b/c/storageApiml.c @@ -557,7 +557,7 @@ c89 \ -DAPF_AUTHORIZED=0 \ -Wc,dll,langlvl\(extc99\),gonum,goff,hgpr,roconst,ASM,asmlib\('CEE.SCEEMAC','SYS1.MACLIB','SYS1.MODGEN'\) \ -Wc,agg,exp,list\(\),so\(\),off,xref \ - -Wl,ac=1,dll \ + -Wl,dll \ -I../h \ -I../deps/zowe-common-c/h \ -I/usr/lpp/gskssl/include \ diff --git a/c/zis/build.sh b/c/zis/build.sh deleted file mode 100644 index e253d40f9..000000000 --- a/c/zis/build.sh +++ /dev/null @@ -1,134 +0,0 @@ -# This program and the accompanying materials are -# made available under the terms of the Eclipse Public License v2.0 which accompanies -# this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html -# -# SPDX-License-Identifier: EPL-2.0 -# -# Copyright Contributors to the Zowe Project. - -COMMON=../../../zowe-common-c - -CFLAGS=(-S -M -qmetal -q64 -DSUBPOOL=132 -DMETTLE=1 -DMSGPREFIX='"IDX"' --DRADMIN_XMEM_MODE --DCMS_LPA_DEV_MODE --qreserved_reg=r12 --Wc,"arch(8),agg,exp,list(),so(),off,xref,roconst,longname,lp64" -I ../../h --I $COMMON/h) - -ASFLAGS=(-mgoff -mobject -mflag=nocont --TERM --RENT) - -LDFLAGS=(-V -b ac=1 -b rent -b case=mixed -b map -b xref -b reus) - -xlc "${CFLAGS[@]}" \ -$COMMON/c/alloc.c \ -$COMMON/c/cmutils.c \ -$COMMON/c/collections.c \ -$COMMON/c/crossmemory.c \ -$COMMON/c/isgenq.c \ -$COMMON/c/le.c \ -$COMMON/c/logging.c \ -$COMMON/c/lpa.c -DLPA_LOG_DEBUG_MSG_ID='"ZIS00100I"' \ -$COMMON/c/metalio.c \ -$COMMON/c/mtlskt.c \ -$COMMON/c/nametoken.c \ -$COMMON/c/zos.c \ -$COMMON/c/qsam.c \ -$COMMON/c/radmin.c \ -$COMMON/c/recovery.c \ -$COMMON/c/resmgr.c \ -$COMMON/c/scheduling.c \ -$COMMON/c/stcbase.c \ -$COMMON/c/timeutls.c \ -$COMMON/c/utils.c \ -$COMMON/c/xlate.c \ -$COMMON/c/zvt.c \ -parm.c \ -plugin.c \ -server.c \ -service.c \ -services/auth.c \ -services/nwm.c \ -services/secmgmt.c \ -services/snarfer.c - -as "${ASFLAGS[@]}" -aegimrsx=alloc.asm alloc.s -as "${ASFLAGS[@]}" -aegimrsx=cmutils.asm cmutils.s -as "${ASFLAGS[@]}" -aegimrsx=collections.asm collections.s -as "${ASFLAGS[@]}" -aegimrsx=crossmemory.asm crossmemory.s -as "${ASFLAGS[@]}" -aegimrsx=isgenq.asm isgenq.s -as "${ASFLAGS[@]}" -aegimrsx=le.asm le.s -as "${ASFLAGS[@]}" -aegimrsx=logging.asm logging.s -as "${ASFLAGS[@]}" -aegimrsx=lpa.asm lpa.s -as "${ASFLAGS[@]}" -aegimrsx=metalio.asm metalio.s -as "${ASFLAGS[@]}" -aegimrsx=mtlskt.asm mtlskt.s -as "${ASFLAGS[@]}" -aegimrsx=nametoken.asm nametoken.s -as "${ASFLAGS[@]}" -aegimrsx=zos.asm zos.s -as "${ASFLAGS[@]}" -aegimrsx=qsam.asm qsam.s -as "${ASFLAGS[@]}" -aegimrsx=radmin.asm radmin.s -as "${ASFLAGS[@]}" -aegimrsx=recovery.asm recovery.s -as "${ASFLAGS[@]}" -aegimrsx=resmgr.asm resmgr.s -as "${ASFLAGS[@]}" -aegimrsx=scheduling.asm scheduling.s -as "${ASFLAGS[@]}" -aegimrsx=stcbase.asm stcbase.s -as "${ASFLAGS[@]}" -aegimrsx=timeutls.asm timeutls.s -as "${ASFLAGS[@]}" -aegimrsx=utils.asm utils.s -as "${ASFLAGS[@]}" -aegimrsx=xlate.asm xlate.s -as "${ASFLAGS[@]}" -aegimrsx=zvt.asm zvt.s - -as "${ASFLAGS[@]}" -aegimrsx=parm.asm parm.s -as "${ASFLAGS[@]}" -aegimrsx=plugin.asm plugin.s -as "${ASFLAGS[@]}" -aegimrsx=server.asm server.s -as "${ASFLAGS[@]}" -aegimrsx=service.asm service.s - -as "${ASFLAGS[@]}" -aegimrsx=auth.asm auth.s -as "${ASFLAGS[@]}" -aegimrsx=nwm.asm nwm.s -as "${ASFLAGS[@]}" -aegimrsx=snarfer.asm snarfer.s - -as "${ASFLAGS[@]}" -aegimrsx=auth.asm auth.s -as "${ASFLAGS[@]}" -aegimrsx=nwm.asm nwm.s -as "${ASFLAGS[@]}" -aegimrsx=secmgmt.asm secmgmt.s -as "${ASFLAGS[@]}" -aegimrsx=snarfer.asm snarfer.s - -export _LD_SYSLIB="//'SYS1.CSSLIB'://'CEE.SCEELKEX'://'CEE.SCEELKED'://'CEE.SCEERUN'://'CEE.SCEERUN2'://'CSF.SCSFMOD0'" - -ld "${LDFLAGS[@]}" -e main \ --o "//'$USER.DEV.LOADLIB(ZWESIS01)'" \ -alloc.o \ -cmutils.o \ -collections.o \ -crossmemory.o \ -isgenq.o \ -le.o \ -logging.o \ -lpa.o \ -metalio.o \ -mtlskt.o \ -nametoken.o \ -zos.o \ -qsam.o \ -radmin.o \ -recovery.o \ -resmgr.o \ -scheduling.o \ -stcbase.o \ -timeutls.o \ -utils.o \ -xlate.o \ -zvt.o \ -parm.o \ -plugin.o \ -server.o \ -service.o \ -auth.o \ -nwm.o \ -secmgmt.o \ -snarfer.o \ -> ZISSRV01.link - - -# This program and the accompanying materials are -# made available under the terms of the Eclipse Public License v2.0 which accompanies -# this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html -# -# SPDX-License-Identifier: EPL-2.0 -# -# Copyright Contributors to the Zowe Project. diff --git a/plugins/zis/echo/build.sh b/plugins/zis/echo/build.sh index 56e2a2a36..2a069a6f9 100755 --- a/plugins/zis/echo/build.sh +++ b/plugins/zis/echo/build.sh @@ -16,7 +16,7 @@ CFLAGS=(-S -M -qmetal -q64 -DSUBPOOL=132 -DMETTLE=1 -DMSGPREFIX='"IDX"' ASFLAGS=(-mgoff -mobject -mflag=nocont --TERM --RENT) -LDFLAGS=(-V -b ac=1 -b rent -b case=mixed -b map -b xref -b reus) +LDFLAGS=(-V -b rent -b case=mixed -b map -b xref -b reus) xlc "${CFLAGS[@]}" -DCMS_CLIENT \ $COMMON/c/alloc.c \ diff --git a/plugins/zis/magic-number/build.sh b/plugins/zis/magic-number/build.sh index 049749db2..9f733723c 100644 --- a/plugins/zis/magic-number/build.sh +++ b/plugins/zis/magic-number/build.sh @@ -16,7 +16,7 @@ CFLAGS=(-S -M -qmetal -q64 -DSUBPOOL=132 -DMETTLE=1 -DMSGPREFIX='"IDX"' ASFLAGS=(-mgoff -mobject -mflag=nocont --TERM --RENT) -LDFLAGS=(-V -b ac=1 -b rent -b case=mixed -b map -b xref -b reus) +LDFLAGS=(-V -b rent -b case=mixed -b map -b xref -b reus) xlc "${CFLAGS[@]}" -DCMS_CLIENT \ $COMMON/c/alloc.c \ diff --git a/tests/build_zisdl.sh b/tests/build_zisdl.sh index 4264eabf1..9c5969ccb 100755 --- a/tests/build_zisdl.sh +++ b/tests/build_zisdl.sh @@ -37,7 +37,7 @@ do done -ld -V -b ac=1 -b rent -b case=mixed -b map -b xref -b reus -e main \ +ld -V -b rent -b case=mixed -b map -b xref -b reus -e main \ -o "//'$USER.DEV.LOADLIB(ZISDLTST)'" \ zisdl.o \ stubs.o \ diff --git a/zis-aux/test/aux-guest/build/build.sh b/zis-aux/test/aux-guest/build/build.sh index 60dc0a3f9..f92dc212d 100644 --- a/zis-aux/test/aux-guest/build/build.sh +++ b/zis-aux/test/aux-guest/build/build.sh @@ -17,7 +17,7 @@ CFLAGS=(-S -M -qmetal -q64 -DSUBPOOL=132 -DMETTLE=1 -DMSGPREFIX='"IDX"' ASFLAGS=(-mgoff -mobject -mflag=nocont --TERM --RENT) -LDFLAGS=(-V -b ac=1 -b rent -b case=mixed -b map -b xref -b reus) +LDFLAGS=(-V -b rent -b case=mixed -b map -b xref -b reus) xlc "${CFLAGS[@]}" \ $COMMON/c/alloc.c \ diff --git a/zis-aux/test/utils/build/build.sh b/zis-aux/test/utils/build/build.sh index 0e790b171..d5d9bd493 100644 --- a/zis-aux/test/utils/build/build.sh +++ b/zis-aux/test/utils/build/build.sh @@ -40,7 +40,7 @@ $COMMON/c/zos.c ; extattr +a ../bin/shrmem64-target-test xlc "-Wa,goff" -DAS_TEST \ "-Wc,LANGLVL(EXTC99),FLOAT(HEX),agg,exp,list(),so(),goff,xref,gonum,roconst,gonum,ASM,ASMLIB('SYS1.MACLIB'),LP64,XPLINK" \ -"-Wl,ac=1" -I $COMMON/h -I $ZSSAUX/src -I $ZSSAUX/include \ +-I $COMMON/h -I $ZSSAUX/src -I $ZSSAUX/include \ -o ../bin/pe-test \ $ZSSAUX/test/utils/src/pe-test.c \ $COMMON/c/alloc.c \ From d46c6b2261e360bee8aa1af1f898a25c4ebb0e39 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 2 Nov 2023 06:55:33 -0400 Subject: [PATCH 04/54] Update zwes1606w message for troubleshooting Signed-off-by: 1000TurquoisePogs --- CHANGELOG.md | 3 +- c/jwk.c | 113 ++++++++++++++++++++++++++++++--------------- deps/zowe-common-c | 2 +- h/jwk.h | 4 +- h/zssLogging.h | 2 +- 5 files changed, 83 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4312ecf1a..cb4c56ef5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,9 @@ All notable changes to the ZSS package will be documented in this file. -## Recent Changes +## `2.13.0` - Bugfix: Corrected build environment file's use of IP address to github.com (#660) +- Enhancement: Consolidate JWK warnings into improved ZWES1606W message (#663) ## `2.10.0` - This action making a CHANGELOG note via special syntax from the GitHub PR commit message, like it could automatically update CHANGELOG.md with the message. First job checks if PR body has changelog note or not if it's not there then it asked them to add it and second job is to check if changelog note has been added in changelog.md file or not. (#636) diff --git a/c/jwk.c b/c/jwk.c index a90824856..9a61e6a54 100644 --- a/c/jwk.c +++ b/c/jwk.c @@ -86,26 +86,32 @@ static int jwkTaskMain(RLETask *task) { JwkSettings *settings = context->settings; const int maxAttempts = 1000; const int retryIntervalSeconds = settings->retryIntervalSeconds; + const int warnInterval = 10; bool success = false; + int rc = 0; + int rsn = 0; + for (int i = 0; i < maxAttempts; i++) { - int status = getJwk(context); - if (status == JWK_STATUS_OK) { + getJwk(context, &rc, &rsn); + if (rc == JWK_STATUS_OK) { success = true; context->isPublicKeyInitialized = true; break; - } else if (status == JWK_STATUS_UNRECOGNIZED_FMT_ERROR) { + } else if (rc == JWK_STATUS_UNRECOGNIZED_FMT_ERROR) { zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, ZSS_LOG_JWK_UNRECOGNIZED_MSG); break; - } else if (status == JWK_STATUS_PUBLIC_KEY_ERROR) { + } else if (rc == JWK_STATUS_PUBLIC_KEY_ERROR) { zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, ZSS_LOG_JWK_PUBLIC_KEY_ERROR_MSG); break; - } else if (status == JWK_STATUS_HTTP_CONTEXT_ERROR) { + } else if (rc == JWK_STATUS_HTTP_CONTEXT_ERROR) { zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, ZSS_LOG_JWK_HTTP_CTX_ERROR_MSG); break; } else { - zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, ZSS_LOG_JWK_RETRY_MSG, - jwkGetStrStatus(status), retryIntervalSeconds); + if (i % warnInterval == 0) { + zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, ZSS_LOG_JWK_RETRY_MSG, + jwkGetStrStatus(rc), rc, jwkHttpClientGetStrStatus(rsn), rsn, retryIntervalSeconds); + } sleep(retryIntervalSeconds); } } @@ -119,7 +125,8 @@ static int jwkTaskMain(RLETask *task) { static int getJwk(JwkContext *context) { JwkSettings *settings = context->settings; - int status = 0; + int rc = 0; + int rsn = 0; ShortLivedHeap *slh = makeShortLivedHeap(0x40000, 0x40); HttpClientSettings clientSettings = {0}; @@ -127,10 +134,8 @@ static int getJwk(JwkContext *context) { clientSettings.port = settings->port; clientSettings.recvTimeoutSeconds = (settings->timeoutSeconds > 0) ? settings->timeoutSeconds : 10; - Json *jwkJson = doRequest(slh, &clientSettings, settings->tlsEnv, settings->path, &status); - if (status) { - zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "failed to obtain JWK, status = %d\n", status); - } else { + Json *jwkJson = doRequest(slh, &clientSettings, settings->tlsEnv, settings->path, &rc, &rsn); + if (!rc) { x509_public_key_info publicKey; getPublicKey(jwkJson, &publicKey, &status); if (status == 0) { @@ -141,8 +146,8 @@ static int getJwk(JwkContext *context) { return status; } -static Json *doRequest(ShortLivedHeap *slh, HttpClientSettings *clientSettings, TlsEnvironment *tlsEnv, char *path, int *statusOut) { - int status = 0; +static Json *doRequest(ShortLivedHeap *slh, HttpClientSettings *clientSettings, TlsEnvironment *tlsEnv, char *path, int *rc, int *rsn) { + *rsn = 0; HttpClientContext *httpClientContext = NULL; HttpClientSession *session = NULL; LoggingContext *loggingContext = makeLoggingContext(); @@ -151,40 +156,39 @@ static Json *doRequest(ShortLivedHeap *slh, HttpClientSettings *clientSettings, do { zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_DEBUG, "JWK request to https://%s:%d%s\n", clientSettings->host, clientSettings->port, path); - status = httpClientContextInitSecure(clientSettings, loggingContext, tlsEnv, &httpClientContext); - if (status) { - zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "error in httpcb ctx init: %d\n", status); - *statusOut = JWK_STATUS_HTTP_CONTEXT_ERROR; + *rsn = httpClientContextInitSecure(clientSettings, loggingContext, tlsEnv, &httpClientContext); + if (*rsn) { + *rc = JWK_STATUS_HTTP_CONTEXT_ERROR; break; } - status = httpClientSessionInit(httpClientContext, &session); - if (status) { - zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "error initing session: %d\n", status); - *statusOut = JWK_STATUS_HTTP_REQUEST_ERROR; + *rsn = httpClientSessionInit(httpClientContext, &session); + if (*rsn) { + zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "error initing session: %d\n", *rsn); + *rc = JWK_STATUS_HTTP_REQ_INIT_ERROR; break; } - status = httpClientSessionStageRequest(httpClientContext, session, "GET", path, NULL, NULL, NULL, 0); - if (status) { - zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "error staging request: %d\n", status); - *statusOut = JWK_STATUS_HTTP_REQUEST_ERROR; + *rsn = httpClientSessionStageRequest(httpClientContext, session, "GET", path, NULL, NULL, NULL, 0); + if (*rsn) { + zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "error staging request: %d\n", *rsn); + *rc = JWK_STATUS_HTTP_REQ_STAGING_ERROR; break; } requestStringHeader(session->request, TRUE, "accept", "application/json"); - status = httpClientSessionSend(httpClientContext, session); - if (status) { - zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "error sending request: %d\n", status); - *statusOut = JWK_STATUS_HTTP_REQUEST_ERROR; + *rsn = httpClientSessionSend(httpClientContext, session); + if (*rsn) { + zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "error sending request: %d\n", *rsn); + *rc = JWK_STATUS_HTTP_REQ_SEND_ERROR; break; } - jsonBody = receiveResponse(slh, httpClientContext, session, &status); - if (status) { - *statusOut = status; + jsonBody = receiveResponse(slh, httpClientContext, session, rc); + if (*rc) { + *rsn = *rc; break; } int statusCode = session->response->statusCode; if (statusCode != 200) { zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "HTTP status %d\n", statusCode); - *statusOut = JWK_STATUS_RESPONSE_ERROR; + *rc = JWK_STATUS_RESPONSE_ERROR; break; } } while (0); @@ -372,18 +376,53 @@ static const char *MESSAGES[] = { [JWK_STATUS_UNRECOGNIZED_FMT_ERROR] = "JWK is in unrecognized format", [JWK_STATUS_PUBLIC_KEY_ERROR] = "failed to create public key", [JWK_STATUS_HTTP_CONTEXT_ERROR] = "failed to init HTTP context", - [JWK_STATUS_HTTP_REQUEST_ERROR] = "failed to send HTTP request" + [JWK_STATUS_HTTP_REQ_INIT_ERROR] = "failed to init HTTP request", + [JWK_STATUS_HTTP_REQ_STAGING_ERROR] = "failed on staging HTTP request", + [JWK_STATUS_HTTP_REQ_SEND_ERROR] = "failed to send HTTP request" +}; + +static const char *HTTP_CLIENT_MESSAGES[] = { + [HTTP_CLIENT_INVALID_ARGUMENT] = "Invalid argument to client", + [HTTP_CLIENT_OUTPUT_WOULD_OVERFLOW] = "Output would overflow", + [HTTP_CLIENT_INVALID_PORT] = "Invalid port", + [HTTP_CLIENT_REQDSETTING_MISSING] = "Required setting missing", + [HTTP_CLIENT_LOOKUP_FAILED] = "Lookup failed", + [HTTP_CLIENT_CONNECT_FAILED] = "Connect failed", + [HTTP_CLIENT_SESSION_ERR] = "Client session error", + [HTTP_CLIENT_ADDRBYNAME_ERR] = "Hostname to IP error", + [HTTP_CLIENT_SEND_ERROR] = "Failed to send", + [HTTP_CLIENT_SOCKET_UNREGISTERED] = "Socket unregistered", + [HTTP_CLIENT_SXREAD_ERROR] = "SelectX Read Error", + [HTTP_CLIENT_NO_REQUEST] = "No request", + [HTTP_CLIENT_NO_SOCKET] = "No Socket", + [HTTP_CLIENT_RESP_PARSE_FAILED] = "Response parsing failed", + [HTTP_CLIENT_READ_ERROR] = "Read error", + [HTTP_CLIENT_RESPONSE_ZEROLEN] = "Response is zero length", + [HTTP_CLIENT_TLS_ERROR] = "TLS error", + [HTTP_CLIENT_TLS_NOT_CONFIGURED] = "TLS not configured", }; + #define MESSAGE_COUNT sizeof(MESSAGES)/sizeof(MESSAGES[0]) const char *jwkGetStrStatus(int status) { if (status >= MESSAGE_COUNT || status < 0) { - return "Unknown status code"; + return "Unknown rc"; } const char *message = MESSAGES[status]; if (!message) { - return "Unknown status code"; + return "Unknown rc"; + } + return message; +} + +const char *jwkHttpClientGetStrStatus(int status) { + if (status >= HTTP_CLIENT_TLS_NOT_CONFIGURED || status < 0) { + return "Unknown reason"; + } + const char *message = HTTP_CLIENT_MESSAGES[status]; + if (!message) { + return "Unknown reason"; } return message; } diff --git a/deps/zowe-common-c b/deps/zowe-common-c index 0d55d4724..9c634b56a 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit 0d55d47244d37b77bd156fc0376cc0c90e9592a2 +Subproject commit 9c634b56a68e7771d3b663b50adddd344b427a2a diff --git a/h/jwk.h b/h/jwk.h index 8d1e9b236..04d8240b0 100644 --- a/h/jwk.h +++ b/h/jwk.h @@ -41,7 +41,9 @@ struct JwkContext_tag { #define JWK_STATUS_UNRECOGNIZED_FMT_ERROR 4 #define JWK_STATUS_PUBLIC_KEY_ERROR 7 #define JWK_STATUS_HTTP_CONTEXT_ERROR 8 -#define JWK_STATUS_HTTP_REQUEST_ERROR 9 +#define JWK_STATUS_HTTP_REQ_INIT_ERROR 9 +#define JWK_STATUS_HTTP_REQ_STAGING_ERROR 10 +#define JWK_STATUS_HTTP_REQ_SEND_ERROR 11 void configureJwt(HttpServer *server, JwkSettings *jwkSettings); const char *jwkGetStrStatus(int status); diff --git a/h/zssLogging.h b/h/zssLogging.h index de5381f5e..7366b2442 100644 --- a/h/zssLogging.h +++ b/h/zssLogging.h @@ -515,7 +515,7 @@ bool isLogLevelValid(int level); #ifndef ZSS_LOG_JWK_RETRY_MSG_ID #define ZSS_LOG_JWK_RETRY_MSG_ID ZSS_LOG_MSG_PRFX"1606W" #endif -#define ZSS_LOG_JWK_RETRY_MSG_TEXT "Failed to get JWK - %s, retry in %d seconds\n" +#define ZSS_LOG_JWK_RETRY_MSG_TEXT "Failed to get JWK. rc=%s (%d), rsn=%s (%d). Retry in %d seconds\n" #define ZSS_LOG_JWK_RETRY_MSG ZSS_LOG_JWK_RETRY_MSG_ID" "ZSS_LOG_JWK_RETRY_MSG_TEXT #endif /* MVD_H_ZSSLOGGING_H_ */ From 540da27953e9c356f7ae0d8cff28ceb4fa9b9cf6 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 2 Nov 2023 11:23:22 -0400 Subject: [PATCH 05/54] Compile fixes Signed-off-by: 1000TurquoisePogs --- c/jwk.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/c/jwk.c b/c/jwk.c index 9a61e6a54..0eb7a9f7b 100644 --- a/c/jwk.c +++ b/c/jwk.c @@ -1,4 +1,3 @@ - /* This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies @@ -41,9 +40,9 @@ #include "jwk.h" static Json *receiveResponse(ShortLivedHeap *slh, HttpClientContext *httpClientContext, HttpClientSession *session, int *statusOut); -static Json *doRequest(ShortLivedHeap *slh, HttpClientSettings *clientSettings, TlsEnvironment *tlsEnv, char *path, int *statusOut); +static Json *doRequest(ShortLivedHeap *slh, HttpClientSettings *clientSettings, TlsEnvironment *tlsEnv, char *path, int *rc, int *rsn); static void getPublicKey(Json *jwk, x509_public_key_info *publicKeyOut, int *statusOut); -static int getJwk(JwkContext *context); +static void getJwk(JwkContext *context, int *rc, int *rsn); static int checkJwtSignature(JwsAlgorithm algorithm, int sigLen, const uint8_t *signature, int msgLen, const uint8_t *message, void *userData); static bool decodeBase64Url(const char *data, char *resultBuf, int *lenOut); static int jwkTaskMain(RLETask *task); @@ -123,10 +122,8 @@ static int jwkTaskMain(RLETask *task) { fflush(stdout); } -static int getJwk(JwkContext *context) { +static void getJwk(JwkContext *context, int *rc, int *rsn) { JwkSettings *settings = context->settings; - int rc = 0; - int rsn = 0; ShortLivedHeap *slh = makeShortLivedHeap(0x40000, 0x40); HttpClientSettings clientSettings = {0}; @@ -134,16 +131,15 @@ static int getJwk(JwkContext *context) { clientSettings.port = settings->port; clientSettings.recvTimeoutSeconds = (settings->timeoutSeconds > 0) ? settings->timeoutSeconds : 10; - Json *jwkJson = doRequest(slh, &clientSettings, settings->tlsEnv, settings->path, &rc, &rsn); - if (!rc) { + Json *jwkJson = doRequest(slh, &clientSettings, settings->tlsEnv, settings->path, rc, rsn); + if (*rc == 0) { x509_public_key_info publicKey; - getPublicKey(jwkJson, &publicKey, &status); - if (status == 0) { + getPublicKey(jwkJson, &publicKey, rc); + if (*rc == 0) { context->publicKey = publicKey; } } SLHFree(slh); - return status; } static Json *doRequest(ShortLivedHeap *slh, HttpClientSettings *clientSettings, TlsEnvironment *tlsEnv, char *path, int *rc, int *rsn) { @@ -391,7 +387,7 @@ static const char *HTTP_CLIENT_MESSAGES[] = { [HTTP_CLIENT_SESSION_ERR] = "Client session error", [HTTP_CLIENT_ADDRBYNAME_ERR] = "Hostname to IP error", [HTTP_CLIENT_SEND_ERROR] = "Failed to send", - [HTTP_CLIENT_SOCKET_UNREGISTERED] = "Socket unregistered", + [HTTP_CLIENT_SOCK_UNREGISTERED] = "Socket unregistered", [HTTP_CLIENT_SXREAD_ERROR] = "SelectX Read Error", [HTTP_CLIENT_NO_REQUEST] = "No request", [HTTP_CLIENT_NO_SOCKET] = "No Socket", From e131cab9daa4b118df91ff0bc7810b6cdef8f190 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 2 Nov 2023 11:38:35 -0400 Subject: [PATCH 06/54] Compile fixes Signed-off-by: 1000TurquoisePogs --- c/jwk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c/jwk.c b/c/jwk.c index 0eb7a9f7b..72f8768a0 100644 --- a/c/jwk.c +++ b/c/jwk.c @@ -46,6 +46,7 @@ static void getJwk(JwkContext *context, int *rc, int *rsn); static int checkJwtSignature(JwsAlgorithm algorithm, int sigLen, const uint8_t *signature, int msgLen, const uint8_t *message, void *userData); static bool decodeBase64Url(const char *data, char *resultBuf, int *lenOut); static int jwkTaskMain(RLETask *task); +static const char *jwkHttpClientGetStrStatus(int status); void configureJwt(HttpServer *server, JwkSettings *settings) { int rc = 0; @@ -412,7 +413,7 @@ const char *jwkGetStrStatus(int status) { return message; } -const char *jwkHttpClientGetStrStatus(int status) { +static const char *jwkHttpClientGetStrStatus(int status) { if (status >= HTTP_CLIENT_TLS_NOT_CONFIGURED || status < 0) { return "Unknown reason"; } From 031f072a66fe18ca8344db1b4be0f9b736edfd9f Mon Sep 17 00:00:00 2001 From: struga0258 Date: Fri, 10 Nov 2023 14:31:23 +0000 Subject: [PATCH 07/54] v2.13.0 Signed-off-by: struga0258 --- build/zis.proj.env | 4 ++-- build/zss.proj.env | 2 +- manifest.template.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/zis.proj.env b/build/zis.proj.env index 66a847fbe..734ee1f4b 100644 --- a/build/zis.proj.env +++ b/build/zis.proj.env @@ -1,4 +1,4 @@ PROJECT="zis" -VERSION=2.12.0 -DYNLINK_PLUGIN_VERSION=5 +VERSION=2.13.0 +DYNLINK_PLUGIN_VERSION=6 DEPS="" diff --git a/build/zss.proj.env b/build/zss.proj.env index cded01474..10713f4f5 100644 --- a/build/zss.proj.env +++ b/build/zss.proj.env @@ -1,5 +1,5 @@ PROJECT="zss" -VERSION=2.12.0 +VERSION=2.13.0 DEPS="QUICKJS LIBYAML" QUICKJS="quickjs" diff --git a/manifest.template.yaml b/manifest.template.yaml index 3ad2a24e0..7c556c3c0 100644 --- a/manifest.template.yaml +++ b/manifest.template.yaml @@ -3,7 +3,7 @@ name: zss # Component identifier. This identifier matches artifact path in Zowe Artifactory https://zowe.jfrog.io/. id: org.zowe.zss # Without the v -version: 2.12.0 +version: 2.13.0 # Component version is defined in gradle.properties for Gradle project # Human readable component name title: Zowe System Services (ZSS) From 83ffa195ea8fac888cd525b413bfbaa837094cf8 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 16 Nov 2023 10:18:04 -0500 Subject: [PATCH 08/54] Update CHANGELOG.md Signed-off-by: 1000TurquoisePogs --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4312ecf1a..9077fad2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to the ZSS package will be documented in this file. ## Recent Changes - Bugfix: Corrected build environment file's use of IP address to github.com (#660) +## `2.13.0` +- Enhancement: Change pattern matching for keyrings to allow more types of keyrings in the future (#581) + ## `2.10.0` - This action making a CHANGELOG note via special syntax from the GitHub PR commit message, like it could automatically update CHANGELOG.md with the message. First job checks if PR body has changelog note or not if it's not there then it asked them to add it and second job is to check if changelog note has been added in changelog.md file or not. (#636) - Bugfix: Datasets with VOLSER set to an MVS Symbol would cause dataset read, write, and metadata API calls to fail for those datasets. (#603) From 888710366e97396389656b7745771b40d2522c4e Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 16 Nov 2023 10:18:28 -0500 Subject: [PATCH 09/54] Update CHANGELOG.md Signed-off-by: 1000TurquoisePogs --- CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9077fad2b..52261b023 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,9 @@ All notable changes to the ZSS package will be documented in this file. -## Recent Changes -- Bugfix: Corrected build environment file's use of IP address to github.com (#660) - ## `2.13.0` - Enhancement: Change pattern matching for keyrings to allow more types of keyrings in the future (#581) +- Bugfix: Corrected build environment file's use of IP address to github.com (#660) ## `2.10.0` - This action making a CHANGELOG note via special syntax from the GitHub PR commit message, like it could automatically update CHANGELOG.md with the message. First job checks if PR body has changelog note or not if it's not there then it asked them to add it and second job is to check if changelog note has been added in changelog.md file or not. (#636) From f6aa969f8e30bc9a77760f6b52602978870ca54f Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Fri, 17 Nov 2023 07:21:25 -0500 Subject: [PATCH 10/54] Remove duplicate logs, skip first round of 1606 Signed-off-by: 1000TurquoisePogs --- c/jwk.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/c/jwk.c b/c/jwk.c index 72f8768a0..520cae2a2 100644 --- a/c/jwk.c +++ b/c/jwk.c @@ -108,7 +108,8 @@ static int jwkTaskMain(RLETask *task) { zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, ZSS_LOG_JWK_HTTP_CTX_ERROR_MSG); break; } else { - if (i % warnInterval == 0) { + //+1 to skip first round, with good timing message may be skipped entirely. + if ((i+1) % warnInterval == 0) { zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, ZSS_LOG_JWK_RETRY_MSG, jwkGetStrStatus(rc), rc, jwkHttpClientGetStrStatus(rsn), rsn, retryIntervalSeconds); } @@ -160,20 +161,17 @@ static Json *doRequest(ShortLivedHeap *slh, HttpClientSettings *clientSettings, } *rsn = httpClientSessionInit(httpClientContext, &session); if (*rsn) { - zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "error initing session: %d\n", *rsn); *rc = JWK_STATUS_HTTP_REQ_INIT_ERROR; break; } *rsn = httpClientSessionStageRequest(httpClientContext, session, "GET", path, NULL, NULL, NULL, 0); if (*rsn) { - zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "error staging request: %d\n", *rsn); *rc = JWK_STATUS_HTTP_REQ_STAGING_ERROR; break; } requestStringHeader(session->request, TRUE, "accept", "application/json"); *rsn = httpClientSessionSend(httpClientContext, session); if (*rsn) { - zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "error sending request: %d\n", *rsn); *rc = JWK_STATUS_HTTP_REQ_SEND_ERROR; break; } @@ -184,7 +182,6 @@ static Json *doRequest(ShortLivedHeap *slh, HttpClientSettings *clientSettings, } int statusCode = session->response->statusCode; if (statusCode != 200) { - zowelog(NULL, LOG_COMP_ID_JWK, ZOWE_LOG_WARNING, "HTTP status %d\n", statusCode); *rc = JWK_STATUS_RESPONSE_ERROR; break; } From 7fe6ac7976fa5a3b259250d893d20ccec3b6a5c6 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Tue, 24 Oct 2023 08:59:36 -0400 Subject: [PATCH 11/54] Update defaults.yaml for ip and tls setting Signed-off-by: 1000TurquoisePogs --- defaults.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/defaults.yaml b/defaults.yaml index b29a4e9aa..40f287ada 100644 --- a/defaults.yaml +++ b/defaults.yaml @@ -18,10 +18,12 @@ components: password: ${{ ()=> { if (components.zss.tls) { if (zowe.certificate.keystore.type.match(/JCE.*KS/)) { return null } else { return zowe.certificate.keystore.password } } else { return null } }() }} label: ${{ ()=> { if (components.zss.tls) { return zowe.certificate.keystore.alias } else { return null } }() }} port: ${{ ()=> { if (components.zss.tls) { return components.zss.port } else { return null } }() }} - ipAddresses: ${{ ()=> { if (components.zss.tls){ if (zowe.environments?.ZWED_agent_https_ipAddresses){ return zowe.environments.ZWED_agent_https_ipAddresses.split(',') } else { return [ '0.0.0.0' ] } } else { return null } }() }} + ipAddresses: ${{ ()=> { if (components.zss.tls){ if (zowe.environments?.ZWED_agent_https_ipAddresses){ return zowe.environments.ZWED_agent_https_ipAddresses.split(',') } else if (components.zss.zowe.network.server.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network.server.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '0.0.0.0' ] } } else { return null } }() }} + maxTls: ${{ ()=> { if (components.zss.zowe.network.server.maxTls) { return components.zss.zowe.network.server.maxTls } else if (zowe.network.server.maxTls) { return zowe.network.server.maxTls } else { return "TLSv1.3" } }() }} + minTls: ${{ ()=> { if (components.zss.zowe.network.server.minTls) { return components.zss.zowe.network.server.minTls } else if (zowe.network.server.minTls) { return zowe.network.server.minTls } else { return "TLSv1.2" } }() }} http: port: ${{ ()=> { if (components.zss.tls) { return null } else { return components.zss.port } }() }} - ipAddresses: ${{ () => { if (components.zss.tls) { return null } else { if (zowe.environments?.ZWED_agent_http_ipAddresses) { return zowe.environments.ZWED_agent_http_ipAddresses.split(',') } else { return [ '127.0.0.1' ] } } }() }} + ipAddresses: ${{ () => { if (components.zss.tls) { return null } else { if (zowe.environments?.ZWED_agent_http_ipAddresses) { return zowe.environments.ZWED_agent_http_ipAddresses.split(',') } else if (components.zss.zowe.network.server.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network.server.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '127.0.0.1' ] } } }() }} mediationLayer: server: isHttps: true From 18f36523e28621195ccc66c4b040c9bac1600414 Mon Sep 17 00:00:00 2001 From: Zowe Robot Date: Tue, 24 Oct 2023 13:00:29 +0000 Subject: [PATCH 12/54] Update changelog with PR #659 description Signed-off-by: Zowe Robot --- CHANGELOG.md | 1 + deps/zowe-common-c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3acbe5729..98ba8529e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to the ZSS package will be documented in this file. - Enhancement: Change pattern matching for keyrings to allow more types of keyrings in the future (#581) - Bugfix: Corrected build environment file's use of IP address to github.com (#660) - Enhancement: Consolidate JWK warnings into improved ZWES1606W message (#663) +- Added support for using "zowe.network" and "components.app-server.zowe.network" to set listener IP and TLS version properties. (#659) ## `2.10.0` - This action making a CHANGELOG note via special syntax from the GitHub PR commit message, like it could automatically update CHANGELOG.md with the message. First job checks if PR body has changelog note or not if it's not there then it asked them to add it and second job is to check if changelog note has been added in changelog.md file or not. (#636) diff --git a/deps/zowe-common-c b/deps/zowe-common-c index 9c634b56a..0c7a6b8b6 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit 9c634b56a68e7771d3b663b50adddd344b427a2a +Subproject commit 0c7a6b8b62b36571bd23dafd31a58a77c6056b29 From 27fe5a3a972092135088456badc470d3a8421b02 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Fri, 27 Oct 2023 08:05:42 -0400 Subject: [PATCH 13/54] Update default to account for possibly missing objects Signed-off-by: 1000TurquoisePogs --- defaults.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/defaults.yaml b/defaults.yaml index 40f287ada..78fd025fc 100644 --- a/defaults.yaml +++ b/defaults.yaml @@ -18,12 +18,12 @@ components: password: ${{ ()=> { if (components.zss.tls) { if (zowe.certificate.keystore.type.match(/JCE.*KS/)) { return null } else { return zowe.certificate.keystore.password } } else { return null } }() }} label: ${{ ()=> { if (components.zss.tls) { return zowe.certificate.keystore.alias } else { return null } }() }} port: ${{ ()=> { if (components.zss.tls) { return components.zss.port } else { return null } }() }} - ipAddresses: ${{ ()=> { if (components.zss.tls){ if (zowe.environments?.ZWED_agent_https_ipAddresses){ return zowe.environments.ZWED_agent_https_ipAddresses.split(',') } else if (components.zss.zowe.network.server.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network.server.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '0.0.0.0' ] } } else { return null } }() }} - maxTls: ${{ ()=> { if (components.zss.zowe.network.server.maxTls) { return components.zss.zowe.network.server.maxTls } else if (zowe.network.server.maxTls) { return zowe.network.server.maxTls } else { return "TLSv1.3" } }() }} - minTls: ${{ ()=> { if (components.zss.zowe.network.server.minTls) { return components.zss.zowe.network.server.minTls } else if (zowe.network.server.minTls) { return zowe.network.server.minTls } else { return "TLSv1.2" } }() }} + ipAddresses: "${{ ()=> { if (components.zss.tls){ if (zowe.environments?.ZWED_agent_https_ipAddresses){ return zowe.environments.ZWED_agent_https_ipAddresses.split(',') } else if (components.zss.zowe?.network?.server?.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network?.server?.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '0.0.0.0' ] } } else { return null } }() }}" + maxTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.maxTls) { return components.zss.zowe.network.server.maxTls } else if (zowe.network?.server?.maxTls) { return zowe.network.server.maxTls } else { return 'TLSv1.3' } }() }}" + minTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.minTls) { return components.zss.zowe.network.server.minTls } else if (zowe.network?.server?.minTls) { return zowe.network.server.minTls } else { return 'TLSv1.2' } }() }}" http: port: ${{ ()=> { if (components.zss.tls) { return null } else { return components.zss.port } }() }} - ipAddresses: ${{ () => { if (components.zss.tls) { return null } else { if (zowe.environments?.ZWED_agent_http_ipAddresses) { return zowe.environments.ZWED_agent_http_ipAddresses.split(',') } else if (components.zss.zowe.network.server.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network.server.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '127.0.0.1' ] } } }() }} + ipAddresses: "${{ () => { if (components.zss.tls) { return null } else { if (zowe.environments?.ZWED_agent_http_ipAddresses) { return zowe.environments.ZWED_agent_http_ipAddresses.split(',') } else if (components.zss.zowe?.network?.server?.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network?.server?.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '127.0.0.1' ] } } }() }}" mediationLayer: server: isHttps: true From e08b52a78957d971c5ae5ea79e67cf07634d4dfb Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Fri, 10 Nov 2023 07:06:17 -0500 Subject: [PATCH 14/54] Add missing minTls Signed-off-by: 1000TurquoisePogs --- defaults.yaml | 4 ++-- schemas/zss-config.json | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/defaults.yaml b/defaults.yaml index 78fd025fc..d9b017425 100644 --- a/defaults.yaml +++ b/defaults.yaml @@ -19,8 +19,8 @@ components: label: ${{ ()=> { if (components.zss.tls) { return zowe.certificate.keystore.alias } else { return null } }() }} port: ${{ ()=> { if (components.zss.tls) { return components.zss.port } else { return null } }() }} ipAddresses: "${{ ()=> { if (components.zss.tls){ if (zowe.environments?.ZWED_agent_https_ipAddresses){ return zowe.environments.ZWED_agent_https_ipAddresses.split(',') } else if (components.zss.zowe?.network?.server?.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network?.server?.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '0.0.0.0' ] } } else { return null } }() }}" - maxTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.maxTls) { return components.zss.zowe.network.server.maxTls } else if (zowe.network?.server?.maxTls) { return zowe.network.server.maxTls } else { return 'TLSv1.3' } }() }}" - minTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.minTls) { return components.zss.zowe.network.server.minTls } else if (zowe.network?.server?.minTls) { return zowe.network.server.minTls } else { return 'TLSv1.2' } }() }}" + maxTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.tls.maxTls) { return components.zss.zowe.network.server.tls.maxTls } else if (zowe.network?.server?.tls.maxTls) { return zowe.network.server.tls.maxTls } else { return 'TLSv1.3' } }() }}" + minTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.tls.minTls) { return components.zss.zowe.network.server.tls.minTls } else if (zowe.network?.server?.tls.minTls) { return zowe.network.server.tls.minTls } else { return 'TLSv1.2' } }() }}" http: port: ${{ ()=> { if (components.zss.tls) { return null } else { return components.zss.port } }() }} ipAddresses: "${{ () => { if (components.zss.tls) { return null } else { if (zowe.environments?.ZWED_agent_http_ipAddresses) { return zowe.environments.ZWED_agent_http_ipAddresses.split(',') } else if (components.zss.zowe?.network?.server?.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network?.server?.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '127.0.0.1' ] } } }() }}" diff --git a/schemas/zss-config.json b/schemas/zss-config.json index aa2091e00..028bf127a 100644 --- a/schemas/zss-config.json +++ b/schemas/zss-config.json @@ -136,7 +136,14 @@ "enum": ["TLSv1.0", "TLSv1.1", "TLSv1.2", "TLSv1.3"], "default": "TLSv1.3", "description": "Maximum tls version allowed." + }, + "minTls": { + "type": [ "string", "null" ], + "enum": ["TLSv1.0", "TLSv1.1", "TLSv1.2", "TLSv1.3"], + "default": "TLSv1.2", + "description": "Minimum tls version allowed." } + } }, "http": { From f27533c35d76062b1438a2556922aa93481bf04d Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Fri, 10 Nov 2023 07:08:38 -0500 Subject: [PATCH 15/54] Add missing ? Signed-off-by: 1000TurquoisePogs --- defaults.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults.yaml b/defaults.yaml index d9b017425..d22169b36 100644 --- a/defaults.yaml +++ b/defaults.yaml @@ -19,8 +19,8 @@ components: label: ${{ ()=> { if (components.zss.tls) { return zowe.certificate.keystore.alias } else { return null } }() }} port: ${{ ()=> { if (components.zss.tls) { return components.zss.port } else { return null } }() }} ipAddresses: "${{ ()=> { if (components.zss.tls){ if (zowe.environments?.ZWED_agent_https_ipAddresses){ return zowe.environments.ZWED_agent_https_ipAddresses.split(',') } else if (components.zss.zowe?.network?.server?.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network?.server?.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '0.0.0.0' ] } } else { return null } }() }}" - maxTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.tls.maxTls) { return components.zss.zowe.network.server.tls.maxTls } else if (zowe.network?.server?.tls.maxTls) { return zowe.network.server.tls.maxTls } else { return 'TLSv1.3' } }() }}" - minTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.tls.minTls) { return components.zss.zowe.network.server.tls.minTls } else if (zowe.network?.server?.tls.minTls) { return zowe.network.server.tls.minTls } else { return 'TLSv1.2' } }() }}" + maxTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.tls?.maxTls) { return components.zss.zowe.network.server.tls.maxTls } else if (zowe.network?.server?.tls?.maxTls) { return zowe.network.server.tls.maxTls } else { return 'TLSv1.3' } }() }}" + minTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.tls?.minTls) { return components.zss.zowe.network.server.tls.minTls } else if (zowe.network?.server?.tls?.minTls) { return zowe.network.server.tls.minTls } else { return 'TLSv1.2' } }() }}" http: port: ${{ ()=> { if (components.zss.tls) { return null } else { return components.zss.port } }() }} ipAddresses: "${{ () => { if (components.zss.tls) { return null } else { if (zowe.environments?.ZWED_agent_http_ipAddresses) { return zowe.environments.ZWED_agent_http_ipAddresses.split(',') } else if (components.zss.zowe?.network?.server?.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network?.server?.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '127.0.0.1' ] } } }() }}" From 3278b045496ddecef3cc452d42295f5c53e7dd23 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 15 Nov 2023 10:27:12 -0500 Subject: [PATCH 16/54] read minTls value Signed-off-by: 1000TurquoisePogs --- c/zss.c | 1 + 1 file changed, 1 insertion(+) diff --git a/c/zss.c b/c/zss.c index bce8aa91b..de81b30ca 100644 --- a/c/zss.c +++ b/c/zss.c @@ -1161,6 +1161,7 @@ static bool readAgentHttpsSettingsV2(ShortLivedHeap *slh, JsonObject *httpsConfigObject = jsonAsObject(httpsConfig); TlsSettings *settings = (TlsSettings*)SLHAlloc(slh, sizeof(*settings)); settings->maxTls = jsonObjectGetString(httpsConfigObject, "maxTls"); + settings->minTls = jsonObjectGetString(httpsConfigObject, "minTls"); char *ciphers = jsonObjectGetString(httpsConfigObject, "ciphers"); /* * Takes a string of ciphers. This isn't ideal, but any other methods are From d39633b505ca87994f2f6b5f0df63c5be69b8759 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 20 Nov 2023 07:52:41 -0500 Subject: [PATCH 17/54] Add cipher customization support Signed-off-by: 1000TurquoisePogs --- CHANGELOG.md | 3 ++- c/zss.c | 33 +++++++++++++++++++++++++++++---- defaults.yaml | 5 +++-- schemas/zss-config.json | 12 ++++++++++-- 4 files changed, 44 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98ba8529e..5200c9aed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,11 @@ All notable changes to the ZSS package will be documented in this file. ## `2.13.0` +- Enhancement: Added support for using "zowe.network" and "components.zss.zowe.network" to set listener IP and TLS version properties. (#659) +- Enhancement: Added support for using "zowe.network" and "components.zss.zowe.network" to set cipher suites. - Enhancement: Change pattern matching for keyrings to allow more types of keyrings in the future (#581) - Bugfix: Corrected build environment file's use of IP address to github.com (#660) - Enhancement: Consolidate JWK warnings into improved ZWES1606W message (#663) -- Added support for using "zowe.network" and "components.app-server.zowe.network" to set listener IP and TLS version properties. (#659) ## `2.10.0` - This action making a CHANGELOG note via special syntax from the GitHub PR commit message, like it could automatically update CHANGELOG.md with the message. First job checks if PR body has changelog note or not if it's not there then it asked them to add it and second job is to check if changelog note has been added in changelog.md file or not. (#636) diff --git a/c/zss.c b/c/zss.c index de81b30ca..e5a3dce11 100644 --- a/c/zss.c +++ b/c/zss.c @@ -1147,6 +1147,8 @@ static char* generateCookieName(JsonObject *envConfig, int port) { #define AGENT_HTTPS_PREFIX "ZWED_agent_https_" #define ENV_AGENT_HTTPS_KEY(key) AGENT_HTTPS_PREFIX key +TLS_IANA_CIPHER_MAP(ianaCipherMap) + static bool readAgentHttpsSettingsV2(ShortLivedHeap *slh, ConfigManager *configmgr, char **outAddress, @@ -1162,13 +1164,36 @@ static bool readAgentHttpsSettingsV2(ShortLivedHeap *slh, TlsSettings *settings = (TlsSettings*)SLHAlloc(slh, sizeof(*settings)); settings->maxTls = jsonObjectGetString(httpsConfigObject, "maxTls"); settings->minTls = jsonObjectGetString(httpsConfigObject, "minTls"); - char *ciphers = jsonObjectGetString(httpsConfigObject, "ciphers"); + + Json *cipherJson = jsonObjectGetPropertyValue(httpsConfigObject, "ciphers"); + char *ciphers = NULL; + if (jsonIsString(cipherJson)) { /* - * Takes a string of ciphers. This isn't ideal, but any other methods are - * going to be fairly complicated. - * + * Takes a string of ciphers. * ciphers: 13021303003500380039002F00320033 */ + ciphers = jsonObjectGetString(httpsConfigObject, "ciphers"); + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Cipher string override to %s\n", ciphers); + } else { + JsonArray cipherArray = jsonObjectGetArray(httpsConfigObject, "ciphers"); + int count = jsonArrayGetCount(cipherArray); + ciphers = (char *)safeMalloc((4*count)+1, "cipher list"); + for (int i = 0; i < count; i++) { + char *ianaName = jsonArrayGetString(cipherArray, i); + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Cipher request=%s\n", ianaName); + CipherMap *cipher = (CipherMap *)ianaCipherMap; + while (cipher->suiteId != NULL) { + if (!strcmp(ianaName, cipher->name)) { + strcat(ciphers, cipher->suiteId); + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Cipher match=%s\n", cipher->suiteId); + } + ++cipher; + } + } + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Cipher array override to %s\n", ciphers); + + } + ECVT *ecvt = getECVT(); /* 2.3 (1020300) no tls 1.3 diff --git a/defaults.yaml b/defaults.yaml index d22169b36..522467485 100644 --- a/defaults.yaml +++ b/defaults.yaml @@ -19,8 +19,9 @@ components: label: ${{ ()=> { if (components.zss.tls) { return zowe.certificate.keystore.alias } else { return null } }() }} port: ${{ ()=> { if (components.zss.tls) { return components.zss.port } else { return null } }() }} ipAddresses: "${{ ()=> { if (components.zss.tls){ if (zowe.environments?.ZWED_agent_https_ipAddresses){ return zowe.environments.ZWED_agent_https_ipAddresses.split(',') } else if (components.zss.zowe?.network?.server?.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network?.server?.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '0.0.0.0' ] } } else { return null } }() }}" - maxTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.tls?.maxTls) { return components.zss.zowe.network.server.tls.maxTls } else if (zowe.network?.server?.tls?.maxTls) { return zowe.network.server.tls.maxTls } else { return 'TLSv1.3' } }() }}" - minTls: "${{ ()=> { if (components.zss.zowe?.network?.server?.tls?.minTls) { return components.zss.zowe.network.server.tls.minTls } else if (zowe.network?.server?.tls?.minTls) { return zowe.network.server.tls.minTls } else { return 'TLSv1.2' } }() }}" + maxTls: "${{ ()=> { let maxTls = components.zss.zowe?.network?.server?.tls?.maxTls || zowe.network?.server?.tls?.maxTls; return maxTls ? maxTls : 'TLSv1.3'; }() }}" + minTls: "${{ ()=> { let minTls = components.zss.zowe?.network?.server?.tls?.minTls || zowe.network?.server?.tls?.minTls; return minTls ? minTls : 'TLSv1.2'; }() }}" + ciphers: "${{ ()=> { let ciphers = components.zss.zowe?.network?.server?.tls?.ciphers || zowe.network?.server?.tls?.ciphers; if (typeof ciphers == 'string') { return ciphers; } else if (Array.isArray(ciphers)) { return ciphers.map(cipher => cipher.toUpperCase()); } else { return [ 'TLS_AES_256_GCM_SHA384', 'TLS_AES_128_GCM_SHA256', 'TLS_CHACHA20_POLY1305_SHA256', 'TLS_DHE_RSA_WITH_AES_128_GCM_SHA256', 'TLS_DHE_RSA_WITH_AES_256_GCM_SHA384', 'TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256', 'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384', 'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256', 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384' ]; } }() }}" http: port: ${{ ()=> { if (components.zss.tls) { return null } else { return components.zss.port } }() }} ipAddresses: "${{ () => { if (components.zss.tls) { return null } else { if (zowe.environments?.ZWED_agent_http_ipAddresses) { return zowe.environments.ZWED_agent_http_ipAddresses.split(',') } else if (components.zss.zowe?.network?.server?.listenAddresses) { return components.zss.zowe.network.server.listenAddresses } else if (zowe.network?.server?.listenAddresses) { return zowe.network.server.listenAddresses } else { return [ '127.0.0.1' ] } } }() }}" diff --git a/schemas/zss-config.json b/schemas/zss-config.json index 028bf127a..a697a5320 100644 --- a/schemas/zss-config.json +++ b/schemas/zss-config.json @@ -124,8 +124,16 @@ "description": "The password to the keyring" }, "ciphers": { - "type": [ "string", "null" ], - "description": "The list of ciphers in order of priority" + "oneOf": { + { "type": "string", + "description": "A set of cipher suite IDs as a number string without separators. The numbers are in order of priority."}, + { "type": "array", + "description": "A set of IANA names for cipher suites, in order of priority", + "items": { + "type": "string" + } + } + } }, "keyshares": { "type": [ "string", "null" ], From 95e9c2f030721f1105bafde0ee361808ee02590f Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 20 Nov 2023 08:11:12 -0500 Subject: [PATCH 18/54] compile fixes Signed-off-by: 1000TurquoisePogs --- c/zss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/zss.c b/c/zss.c index e5a3dce11..3f707529b 100644 --- a/c/zss.c +++ b/c/zss.c @@ -1175,7 +1175,7 @@ static bool readAgentHttpsSettingsV2(ShortLivedHeap *slh, ciphers = jsonObjectGetString(httpsConfigObject, "ciphers"); zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Cipher string override to %s\n", ciphers); } else { - JsonArray cipherArray = jsonObjectGetArray(httpsConfigObject, "ciphers"); + JsonArray *cipherArray = jsonObjectGetArray(httpsConfigObject, "ciphers"); int count = jsonArrayGetCount(cipherArray); ciphers = (char *)safeMalloc((4*count)+1, "cipher list"); for (int i = 0; i < count; i++) { From 62e7627be796bda0eab1776aedee6cb9218ff9d1 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 20 Nov 2023 09:17:14 -0500 Subject: [PATCH 19/54] Fix json typo Signed-off-by: 1000TurquoisePogs --- schemas/zss-config.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/schemas/zss-config.json b/schemas/zss-config.json index a697a5320..16d33bf9e 100644 --- a/schemas/zss-config.json +++ b/schemas/zss-config.json @@ -124,16 +124,17 @@ "description": "The password to the keyring" }, "ciphers": { - "oneOf": { + "oneOf": [ { "type": "string", - "description": "A set of cipher suite IDs as a number string without separators. The numbers are in order of priority."}, + "description": "A set of cipher suite IDs as a number string without separators. The numbers are in order of priority." + }, { "type": "array", "description": "A set of IANA names for cipher suites, in order of priority", "items": { "type": "string" } } - } + ] }, "keyshares": { "type": [ "string", "null" ], From bc69948c511b48cd7fb9f502a351af6b6af8e481 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 20 Nov 2023 09:26:43 -0500 Subject: [PATCH 20/54] Update CHANGELOG.md Signed-off-by: 1000TurquoisePogs --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5200c9aed..5660b7cdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,9 @@ All notable changes to the ZSS package will be documented in this file. - Enhancement: Added support for using "zowe.network" and "components.zss.zowe.network" to set listener IP and TLS version properties. (#659) - Enhancement: Added support for using "zowe.network" and "components.zss.zowe.network" to set cipher suites. - Enhancement: Change pattern matching for keyrings to allow more types of keyrings in the future (#581) -- Bugfix: Corrected build environment file's use of IP address to github.com (#660) - Enhancement: Consolidate JWK warnings into improved ZWES1606W message (#663) +- Bugfix: Corrected build environment file's use of IP address to github.com (#660) + ## `2.10.0` - This action making a CHANGELOG note via special syntax from the GitHub PR commit message, like it could automatically update CHANGELOG.md with the message. First job checks if PR body has changelog note or not if it's not there then it asked them to add it and second job is to check if changelog note has been added in changelog.md file or not. (#636) From e516db3b84e7ff416a064002fba16c8cdbba194e Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Tue, 21 Nov 2023 07:16:08 -0500 Subject: [PATCH 21/54] Improvements after review Signed-off-by: 1000TurquoisePogs --- c/zss.c | 11 ++++++++++- h/zssLogging.h | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/c/zss.c b/c/zss.c index 3f707529b..20c64839c 100644 --- a/c/zss.c +++ b/c/zss.c @@ -1177,18 +1177,27 @@ static bool readAgentHttpsSettingsV2(ShortLivedHeap *slh, } else { JsonArray *cipherArray = jsonObjectGetArray(httpsConfigObject, "ciphers"); int count = jsonArrayGetCount(cipherArray); - ciphers = (char *)safeMalloc((4*count)+1, "cipher list"); + + int cipherCharLength = 4; + ciphers = (char *)safeMalloc((sizeof(char) * cipherCharLength * count)+1, "cipher list"); + for (int i = 0; i < count; i++) { char *ianaName = jsonArrayGetString(cipherArray, i); zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Cipher request=%s\n", ianaName); CipherMap *cipher = (CipherMap *)ianaCipherMap; + bool found = false; while (cipher->suiteId != NULL) { if (!strcmp(ianaName, cipher->name)) { strcat(ciphers, cipher->suiteId); zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Cipher match=%s\n", cipher->suiteId); + found = true; + break; } ++cipher; } + if (!found) { + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_WARNING, ZSS_LOG_CIPHER_INVALID_MSG, ianaName); + } } zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Cipher array override to %s\n", ciphers); diff --git a/h/zssLogging.h b/h/zssLogging.h index 7366b2442..0f954b56f 100644 --- a/h/zssLogging.h +++ b/h/zssLogging.h @@ -297,6 +297,13 @@ bool isLogLevelValid(int level); #define ZSS_LOG_HTTPS_INVALID_MSG_TEXT "Failed to configure https server, check agent https settings\n" #define ZSS_LOG_HTTPS_INVALID_MSG ZSS_LOG_HTTPS_INVALID_MSG_ID" "ZSS_LOG_HTTPS_INVALID_MSG_TEXT +#ifndef ZSS_LOG_CIPHER_INVALID_MSG_ID +#define ZSS_LOG_CIPHER_INVALID_MSG_ID ZSS_LOG_MSG_PRFX"1066W" +#endif +#define ZSS_LOG_CIPHER_INVALID_MSG_TEXT "Requested cipher '%s' not available.\n" +#define ZSS_LOG_CIPHER_INVALID_MSG ZSS_LOG_CIPHER_INVALID_MSG_ID" "ZSS_LOG_CIPHER_INVALID_MSG_TEXT + + /* registerProduct */ #ifndef ZSS_LOG_PROD_REG_ENABLED_MSG_ID From c14e376243f1e46d9c61a09a9be2835fd1a49b3f Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 22 Nov 2023 11:57:43 -0600 Subject: [PATCH 22/54] Update zss-config.json Signed-off-by: 1000TurquoisePogs --- schemas/zss-config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/zss-config.json b/schemas/zss-config.json index 16d33bf9e..75f32f60a 100644 --- a/schemas/zss-config.json +++ b/schemas/zss-config.json @@ -142,13 +142,13 @@ }, "maxTls": { "type": [ "string", "null" ], - "enum": ["TLSv1.0", "TLSv1.1", "TLSv1.2", "TLSv1.3"], + "enum": ["TLSv1.2", "TLSv1.3"], "default": "TLSv1.3", "description": "Maximum tls version allowed." }, "minTls": { "type": [ "string", "null" ], - "enum": ["TLSv1.0", "TLSv1.1", "TLSv1.2", "TLSv1.3"], + "enum": ["TLSv1.2", "TLSv1.3"], "default": "TLSv1.2", "description": "Minimum tls version allowed." } From 46ace0863290b9f18f56df3712e41f9e02d7745d Mon Sep 17 00:00:00 2001 From: Irek Fakhrutdinov Date: Fri, 24 Nov 2023 08:41:46 +0100 Subject: [PATCH 23/54] Fix typos in "plugin". According to the Zowe doc guidelines, "plugin" must be "plug-in". Signed-off-by: Irek Fakhrutdinov --- h/zis/message.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/h/zis/message.h b/h/zis/message.h index 5d4e5e9e5..277a90f43 100644 --- a/h/zis/message.h +++ b/h/zis/message.h @@ -250,34 +250,34 @@ #define ZISAUX_LOG_LEGACY_API_MSG_TEXT "Legacy API has been detected, some functionality may be limited" #define ZISAUX_LOG_LEGACY_API_MSG ZISAUX_LOG_LEGACY_API_MSG_ID" "ZISAUX_LOG_LEGACY_API_MSG_TEXT -/* ZIS dynamic linkage plugin messages */ +/* ZIS dynamic linkage plug-in messages */ #define ZISDYN_LOG_STARTUP_MSG_ID ZIS_MSG_PRFX"0700I" -#define ZISDYN_LOG_STARTUP_MSG_TEXT "ZIS Dynamic Base plugin starting, version %d.%d.%d+%d, stub version %d" +#define ZISDYN_LOG_STARTUP_MSG_TEXT "ZIS Dynamic Base plug-in starting, version %d.%d.%d+%d, stub version %d" #define ZISDYN_LOG_STARTUP_MSG ZISDYN_LOG_STARTUP_MSG_ID" "ZISDYN_LOG_STARTUP_MSG_TEXT #define ZISDYN_LOG_STARTED_MSG_ID ZIS_MSG_PRFX"0701I" -#define ZISDYN_LOG_STARTED_MSG_TEXT "ZIS Dynamic Base plugin successfully started" +#define ZISDYN_LOG_STARTED_MSG_TEXT "ZIS Dynamic Base plug-in successfully started" #define ZISDYN_LOG_STARTED_MSG ZISDYN_LOG_STARTED_MSG_ID" "ZISDYN_LOG_STARTED_MSG_TEXT #define ZISDYN_LOG_STARTUP_FAILED_MSG_ID ZIS_MSG_PRFX"0702E" -#define ZISDYN_LOG_STARTUP_FAILED_MSG_TEXT "ZIS Dynamic Base plugin startup failed, status = %d" +#define ZISDYN_LOG_STARTUP_FAILED_MSG_TEXT "ZIS Dynamic Base plug-in startup failed, status = %d" #define ZISDYN_LOG_STARTUP_FAILED_MSG ZISDYN_LOG_STARTUP_FAILED_MSG_ID" "ZISDYN_LOG_STARTUP_FAILED_MSG_TEXT #define ZISDYN_LOG_INIT_ERROR_MSG_ID ZIS_MSG_PRFX"0703E" -#define ZISDYN_LOG_INIT_ERROR_MSG_TEXT "ZIS Dynamic Base plugin init error -" +#define ZISDYN_LOG_INIT_ERROR_MSG_TEXT "ZIS Dynamic Base plug-in init error -" #define ZISDYN_LOG_INIT_ERROR_MSG ZISDYN_LOG_INIT_ERROR_MSG_ID" "ZISDYN_LOG_INIT_ERROR_MSG_TEXT #define ZISDYN_LOG_TERM_MSG_ID ZIS_MSG_PRFX"0704I" -#define ZISDYN_LOG_TERM_MSG_TEXT "ZIS Dynamic Base plugin terminating" +#define ZISDYN_LOG_TERM_MSG_TEXT "ZIS Dynamic Base plug-in terminating" #define ZISDYN_LOG_TERM_MSG ZISDYN_LOG_TERM_MSG_ID" "ZISDYN_LOG_TERM_MSG_TEXT #define ZISDYN_LOG_TERMED_MSG_ID ZIS_MSG_PRFX"0705I" -#define ZISDYN_LOG_TERMED_MSG_TEXT "ZIS Dynamic Base plugin successfully terminated" +#define ZISDYN_LOG_TERMED_MSG_TEXT "ZIS Dynamic Base plug-in successfully terminated" #define ZISDYN_LOG_TERMED_MSG ZISDYN_LOG_TERMED_MSG_ID" "ZISDYN_LOG_TERMED_MSG_TEXT #define ZISDYN_LOG_TERM_FAILED_MSG_ID ZIS_MSG_PRFX"0706E" -#define ZISDYN_LOG_TERM_FAILED_MSG_TEXT "ZIS Dynamic Base plugin terminated with error" +#define ZISDYN_LOG_TERM_FAILED_MSG_TEXT "ZIS Dynamic Base plug-in terminated with error" #define ZISDYN_LOG_TERM_FAILED_MSG ZISDYN_LOG_TERM_FAILED_MSG_ID" "ZISDYN_LOG_TERM_FAILED_MSG_TEXT #define ZISDYN_LOG_CMD_RESP_MSG_ID ZIS_MSG_PRFX"0707I" @@ -301,7 +301,7 @@ #define ZISDYN_LOG_STUB_DISCARDED_MSG ZISDYN_LOG_STUB_DISCARDED_MSG_ID" "ZISDYN_LOG_STUB_DISCARDED_MSG_TEXT #define ZISDYN_LOG_DEV_MODE_MSG_ID ZIS_MSG_PRFX"0713W" -#define ZISDYN_LOG_DEV_MODE_MSG_TEXT "ZIS Dynamic base plugin development mode is enabled" +#define ZISDYN_LOG_DEV_MODE_MSG_TEXT "ZIS Dynamic base plug-in development mode is enabled" #define ZISDYN_LOG_DEV_MODE_MSG ZISDYN_LOG_DEV_MODE_MSG_ID" "ZISDYN_LOG_DEV_MODE_MSG_TEXT #define ZISDYN_LOG_BAD_ZIS_VERSION_MSG_ID ZIS_MSG_PRFX"0714E" From 8edc2a8783898b9ad2e0b018615da9377da779d1 Mon Sep 17 00:00:00 2001 From: Aleksandr Agoltsov Date: Sun, 26 Nov 2023 10:44:24 +0000 Subject: [PATCH 24/54] extend slh max size Signed-off-by: Alex Agoltsov --- c/datasetjson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/datasetjson.c b/c/datasetjson.c index 7601500c8..7f50ca41f 100644 --- a/c/datasetjson.c +++ b/c/datasetjson.c @@ -1575,7 +1575,7 @@ void updateDataset(HttpResponse* response, char* absolutePath, int jsonMode) { if(returnCode == 0) { int blockSize = 0x10000; - int maxBlockCount = (translationLength*2)/blockSize; + int maxBlockCount = (translationLength*4)/blockSize; if (!maxBlockCount){ maxBlockCount = 0x10; } From a2de3666c8720e09bb9429c64698c0aa69dd0b0f Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 29 Nov 2023 05:43:42 -0500 Subject: [PATCH 25/54] update pointer Signed-off-by: 1000TurquoisePogs --- deps/zowe-common-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zowe-common-c b/deps/zowe-common-c index 0c7a6b8b6..c9cd51be4 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit 0c7a6b8b62b36571bd23dafd31a58a77c6056b29 +Subproject commit c9cd51be49787784466dcec3ff2eec4c15e72702 From a66bb7961e278c3072041696af73b843f9124d7a Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 11 Dec 2023 07:11:19 -0500 Subject: [PATCH 26/54] Fix for detecting whether or not in HA mode, and what HA cookie value should be Signed-off-by: 1000TurquoisePogs --- CHANGELOG.md | 3 +++ c/zss.c | 35 ++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1e9906f4..662aa9558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to the ZSS package will be documented in this file. ## Recent Changes +## `2.13.0` +- Bugfix: ZSS would not use zowe.cookieIdentifier when an HA config was used. + ## `2.10.0` - Bugfix: Datasets with VOLSER set to an MVS Symbol would cause dataset read, write, and metadata API calls to fail for those datasets. (#603) - Bugfix: Preventing error code 0C9-09 caused by a block size of zero (#606) diff --git a/c/zss.c b/c/zss.c index ee4ea205e..f206dddee 100644 --- a/c/zss.c +++ b/c/zss.c @@ -1097,26 +1097,27 @@ static void readAgentAddressAndPortV2(ConfigManager *configmgr, char **addressHa static char* generateCookieNameV2(ConfigManager *configmgr, int port) { int cookieLength=256; char *cookieName = safeMalloc(cookieLength+1, "CookieName"); - char *zoweInstanceId = getenv("ZOWE_INSTANCE"); - char *haInstanceCountStr = getenv("ZWE_HA_INSTANCES_COUNT"); + int haInstanceCount=0; - if (haInstanceCountStr != NULL) { - haInstanceCount = atoi(haInstanceCountStr); - } - if (haInstanceCount > 1 && zoweInstanceId != NULL) { - snprintf(cookieName, cookieLength, "%s.%s", SESSION_TOKEN_COOKIE_NAME, zoweInstanceId); - } else { - snprintf(cookieName, cookieLength, "%s.%d", SESSION_TOKEN_COOKIE_NAME, port); + Json *result = NULL; + int rc = cfgGetAnyC(configmgr, ZSS_CFGNAME, &result, 1, "haInstances"); + if (jsonIsObject(result)){ + JsonObject *resultObj = jsonAsObject(result); + JsonProperty *prop = resultObj->firstProperty; + while (prop!=NULL){ + haInstanceCount++; + prop = prop->next; + } } - zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Cookie name set as %s\n",cookieName); - return cookieName; -} -static char* generateCookieName(JsonObject *envConfig, int port) { - int cookieLength=256; - char *cookieName = safeMalloc(cookieLength+1, "CookieName"); - char *zoweInstanceId = getenv("ZWE_zowe_cookieIdentifier"); - if (zoweInstanceId != NULL) { + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "instance count = %d\n", haInstanceCount); + + char *zoweInstanceId = NULL; + cfgGetStringC(configmgr, ZSS_CFGNAME, &zoweInstanceId, 2, "zowe", "cookieIdentifier"); + + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "cookieId = %s\n", zoweInstanceId); + + if (haInstanceCount > 1 && zoweInstanceId != NULL) { snprintf(cookieName, cookieLength, "%s.%s", SESSION_TOKEN_COOKIE_NAME, zoweInstanceId); } else { snprintf(cookieName, cookieLength, "%s.%d", SESSION_TOKEN_COOKIE_NAME, port); From 3f210ccfec14f156c845f71380448887c505acbc Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 11 Dec 2023 07:12:05 -0500 Subject: [PATCH 27/54] Update changelog Signed-off-by: 1000TurquoisePogs --- CHANGELOG.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 515acde06..e258dd394 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to the ZSS package will be documented in this file. +## `2.14.0` +- Bugfix: ZSS would not use zowe.cookieIdentifier when an HA config was used. + ## `2.13.0` - Enhancement: Added support for using "zowe.network" and "components.zss.zowe.network" to set listener IP and TLS version properties. (#659) - Enhancement: Added support for using "zowe.network" and "components.zss.zowe.network" to set cipher suites. @@ -9,10 +12,6 @@ All notable changes to the ZSS package will be documented in this file. - Enhancement: Consolidate JWK warnings into improved ZWES1606W message (#663) - Bugfix: Corrected build environment file's use of IP address to github.com (#660) - -## `2.13.0` -- Bugfix: ZSS would not use zowe.cookieIdentifier when an HA config was used. - ## `2.10.0` - This action making a CHANGELOG note via special syntax from the GitHub PR commit message, like it could automatically update CHANGELOG.md with the message. First job checks if PR body has changelog note or not if it's not there then it asked them to add it and second job is to check if changelog note has been added in changelog.md file or not. (#636) - Bugfix: Datasets with VOLSER set to an MVS Symbol would cause dataset read, write, and metadata API calls to fail for those datasets. (#603) From 6159d61a5c2cdefa250771146e9621b9db17f15b Mon Sep 17 00:00:00 2001 From: struga0258 Date: Mon, 18 Dec 2023 15:48:53 +0000 Subject: [PATCH 28/54] v2.14.0 Signed-off-by: struga0258 --- build/zis.proj.env | 4 ++-- build/zss.proj.env | 2 +- manifest.template.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/zis.proj.env b/build/zis.proj.env index 734ee1f4b..9df8a7f29 100644 --- a/build/zis.proj.env +++ b/build/zis.proj.env @@ -1,4 +1,4 @@ PROJECT="zis" -VERSION=2.13.0 -DYNLINK_PLUGIN_VERSION=6 +VERSION=2.14.0 +DYNLINK_PLUGIN_VERSION=7 DEPS="" diff --git a/build/zss.proj.env b/build/zss.proj.env index 10713f4f5..7a6153e3d 100644 --- a/build/zss.proj.env +++ b/build/zss.proj.env @@ -1,5 +1,5 @@ PROJECT="zss" -VERSION=2.13.0 +VERSION=2.14.0 DEPS="QUICKJS LIBYAML" QUICKJS="quickjs" diff --git a/manifest.template.yaml b/manifest.template.yaml index 7c556c3c0..994b682ea 100644 --- a/manifest.template.yaml +++ b/manifest.template.yaml @@ -3,7 +3,7 @@ name: zss # Component identifier. This identifier matches artifact path in Zowe Artifactory https://zowe.jfrog.io/. id: org.zowe.zss # Without the v -version: 2.13.0 +version: 2.14.0 # Component version is defined in gradle.properties for Gradle project # Human readable component name title: Zowe System Services (ZSS) From 01381c050ec8bd6d1599981abde2e9c0e59073a5 Mon Sep 17 00:00:00 2001 From: Irek Fakhrutdinov Date: Tue, 9 Jan 2024 15:57:53 +0100 Subject: [PATCH 29/54] Update the zowe-common-c deps Signed-off-by: Irek Fakhrutdinov --- deps/zowe-common-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zowe-common-c b/deps/zowe-common-c index c9cd51be4..05a8e0fc2 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit c9cd51be49787784466dcec3ff2eec4c15e72702 +Subproject commit 05a8e0fc2a10210b9fb9e88d48a9d24b60b15dde From 209b97ed731c567bcf1ad9764d224b87dda2ad10 Mon Sep 17 00:00:00 2001 From: James Struga Date: Tue, 9 Jan 2024 18:43:18 -0500 Subject: [PATCH 30/54] set right version for zss v3 Signed-off-by: James Struga --- CHANGELOG.md | 2 ++ README.md | 6 +++--- build/zis.proj.env | 2 +- build/zss.proj.env | 2 +- deps/zowe-common-c | 2 +- manifest.template.yaml | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4312ecf1a..09c9d06ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to the ZSS package will be documented in this file. ## Recent Changes - Bugfix: Corrected build environment file's use of IP address to github.com (#660) +## `3.0.0` + ## `2.10.0` - This action making a CHANGELOG note via special syntax from the GitHub PR commit message, like it could automatically update CHANGELOG.md with the message. First job checks if PR body has changelog note or not if it's not there then it asked them to add it and second job is to check if changelog note has been added in changelog.md file or not. (#636) - Bugfix: Datasets with VOLSER set to an MVS Symbol would cause dataset read, write, and metadata API calls to fail for those datasets. (#603) diff --git a/README.md b/README.md index 7a1facfdc..cfaefbb0b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ export ZWE_zowe_runtimeDirectory=/path/to/zowe-install-packaging ZWE_CLI_PARAMETER_CONFIG="FILE(/my/zowe.yaml)" ./zssServer.sh ``` -Note: ZSS defaults are in [defaults.yaml](https://github.com/zowe/zss/blob/v2.x/staging/defaults.yaml) so you only need to provide customizations in your own zowe.yaml. +Note: ZSS defaults are in [defaults.yaml](https://github.com/zowe/zss/blob/v3.x/staging/defaults.yaml) so you only need to provide customizations in your own zowe.yaml. ## How to submit a pull request @@ -57,7 +57,7 @@ git add deps/zowe-common-c/ When using ZSS as the agent to host files and folders, for example: for the Zowe Editor Desktop app by the App server, may lead to '401 Impersonator Error' Fix: Make sure the program-controlled bit is set for your ZSS binary `extattr +p zssServer` -ZSS in V2 takes advantage of V2 by using schemas and the Zowe configuration YAML. If you're running `zssServer` accidentally, instead of `zssServer.sh` or your `zssServer.sh` is out of date, you may see an error on start like `ZSS 2.x requires schemas and config` +ZSS in V3 takes advantage of V3 by using schemas and the Zowe configuration YAML. If you're running `zssServer` accidentally, instead of `zssServer.sh` or your `zssServer.sh` is out of date, you may see an error on start like `ZSS 2.x requires schemas and config` When starting ZSS, you may encounter a schema validation issue i.e. `Configuration has validity exceptions: Schema at '' invalid [...]`. Fix: To read these errors, consult: https://docs.zowe.org/stable/user-guide/configmgr-using/#validation-error-reporting @@ -65,7 +65,7 @@ Note: ZSS has a default schema in `$ZWES_COMPONENT_HOME/schemas` and default con ## Mock server -If you don't have access to z/OS, or want to help expand the Mock server, find it at: https://github.com/zowe/zss/tree/v2.x/staging/mock +If you don't have access to z/OS, or want to help expand the Mock server, find it at: https://github.com/zowe/zss/tree/v3.x/staging/mock This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies diff --git a/build/zis.proj.env b/build/zis.proj.env index 66a847fbe..0a113ef38 100644 --- a/build/zis.proj.env +++ b/build/zis.proj.env @@ -1,4 +1,4 @@ PROJECT="zis" -VERSION=2.12.0 +VERSION=3.0.0 DYNLINK_PLUGIN_VERSION=5 DEPS="" diff --git a/build/zss.proj.env b/build/zss.proj.env index cded01474..b30671c6b 100644 --- a/build/zss.proj.env +++ b/build/zss.proj.env @@ -1,5 +1,5 @@ PROJECT="zss" -VERSION=2.12.0 +VERSION=3.0.0 DEPS="QUICKJS LIBYAML" QUICKJS="quickjs" diff --git a/deps/zowe-common-c b/deps/zowe-common-c index 0d55d4724..e23522d5e 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit 0d55d47244d37b77bd156fc0376cc0c90e9592a2 +Subproject commit e23522d5e1d643f2013dd0cb21ce91c516607ae2 diff --git a/manifest.template.yaml b/manifest.template.yaml index 3ad2a24e0..7a5305cd9 100644 --- a/manifest.template.yaml +++ b/manifest.template.yaml @@ -3,7 +3,7 @@ name: zss # Component identifier. This identifier matches artifact path in Zowe Artifactory https://zowe.jfrog.io/. id: org.zowe.zss # Without the v -version: 2.12.0 +version: 3.0.0 # Component version is defined in gradle.properties for Gradle project # Human readable component name title: Zowe System Services (ZSS) From 3f58b998b834006e2a00a11782f6fe82954d01dd Mon Sep 17 00:00:00 2001 From: James Struga Date: Wed, 17 Jan 2024 13:45:56 -0500 Subject: [PATCH 31/54] add new deps Signed-off-by: James Struga --- deps/zowe-common-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zowe-common-c b/deps/zowe-common-c index 05a8e0fc2..e23522d5e 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit 05a8e0fc2a10210b9fb9e88d48a9d24b60b15dde +Subproject commit e23522d5e1d643f2013dd0cb21ce91c516607ae2 From 62bf9de9e5da1c9c569dcdea3c0545d5e9300c26 Mon Sep 17 00:00:00 2001 From: James Struga Date: Wed, 17 Jan 2024 13:47:50 -0500 Subject: [PATCH 32/54] remove Jenkinsfile Signed-off-by: James Struga --- Jenkinsfile | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index fd4bc6b6a..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,46 +0,0 @@ -#!groovy - -/** - * This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v2.0 which accompanies - * this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html - * - * SPDX-License-Identifier: EPL-2.0 - * - * Copyright Contributors to the Zowe Project. - */ - -node("zowe-jenkins-agent") { - - def lib = library("jenkins-library").org.zowe.jenkins_shared_library - def pipeline = lib.pipelines.generic.GenericPipeline.new(this) - - pipeline.admins.add("dnikolaev", "sgrady") - - pipeline.setup( - packageName: 'org.zowe.zss', - extraInit: { - pipeline.setVersion(sh(script: "cat version.txt", returnStdout: true).trim()) - } - ) - - pipeline.build( - operation: { - echo "Build will happen in pre-packaging" - } - ) - - // define we need packaging stage, which processed in .pax folder - pipeline.packaging(name: 'zss', paxOptions: '-x os390') - - // define we need publish stage - pipeline.publish( - allowPublishWithoutTest: true, - artifacts: [ - '.pax/zss.pax', - ] - ) - - pipeline.end() - -} From 7500dd453c1748005f8fc4aa152b6335c6fb8a26 Mon Sep 17 00:00:00 2001 From: struga0258 Date: Tue, 6 Feb 2024 15:01:29 +0000 Subject: [PATCH 33/54] v2.15.0 Signed-off-by: struga0258 --- build/zis.proj.env | 4 ++-- build/zss.proj.env | 2 +- manifest.template.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/zis.proj.env b/build/zis.proj.env index 9df8a7f29..91f913557 100644 --- a/build/zis.proj.env +++ b/build/zis.proj.env @@ -1,4 +1,4 @@ PROJECT="zis" -VERSION=2.14.0 -DYNLINK_PLUGIN_VERSION=7 +VERSION=2.15.0 +DYNLINK_PLUGIN_VERSION=8 DEPS="" diff --git a/build/zss.proj.env b/build/zss.proj.env index 7a6153e3d..c784694fb 100644 --- a/build/zss.proj.env +++ b/build/zss.proj.env @@ -1,5 +1,5 @@ PROJECT="zss" -VERSION=2.14.0 +VERSION=2.15.0 DEPS="QUICKJS LIBYAML" QUICKJS="quickjs" diff --git a/manifest.template.yaml b/manifest.template.yaml index 994b682ea..0572611b0 100644 --- a/manifest.template.yaml +++ b/manifest.template.yaml @@ -3,7 +3,7 @@ name: zss # Component identifier. This identifier matches artifact path in Zowe Artifactory https://zowe.jfrog.io/. id: org.zowe.zss # Without the v -version: 2.14.0 +version: 2.15.0 # Component version is defined in gradle.properties for Gradle project # Human readable component name title: Zowe System Services (ZSS) From 5e8de857707259a5be318480b0445844a273682d Mon Sep 17 00:00:00 2001 From: Irek Fakhrutdinov Date: Thu, 8 Feb 2024 11:19:15 +0100 Subject: [PATCH 34/54] Update zowe-common-c deps Signed-off-by: Irek Fakhrutdinov --- deps/zowe-common-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zowe-common-c b/deps/zowe-common-c index 05a8e0fc2..c723503bb 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit 05a8e0fc2a10210b9fb9e88d48a9d24b60b15dde +Subproject commit c723503bbd4b740bd3ceefd9c6eaee98a221cd3a From 996709dc5c4d869eee0578ad9c59fdebcc7d0be7 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Wed, 14 Feb 2024 10:40:48 -0600 Subject: [PATCH 35/54] Update start.sh Signed-off-by: 1000TurquoisePogs --- bin/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/start.sh b/bin/start.sh index 0a1df3986..0f7e12381 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -168,7 +168,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then ZSS_SERVER_31="./zssServer" ZSS_SERVER_64="./zssServer64" - if [ "$ZWE_components_zss_agent_64bit" = "true" ] && [ -x "${ZSS_SERVER_64}" ]; then + if [ "$ZWE_components_zss_agent_64bit" != "false" ] && [ -x "${ZSS_SERVER_64}" ]; then ZSS_SERVER="${ZSS_SERVER_64}" else ZSS_SERVER="${ZSS_SERVER_31}" From 8a8fd50f3e92fa7f133a1bb87f9b1f3e4908645c Mon Sep 17 00:00:00 2001 From: Irek Fakhrutdinov Date: Mon, 4 Mar 2024 16:54:45 +0100 Subject: [PATCH 36/54] Take into account leap seconds in AUX messages' timestamps; update deps Fixes: #690 Signed-off-by: Irek Fakhrutdinov --- CHANGELOG.md | 3 +++ deps/zowe-common-c | 2 +- zis-aux/src/aux-utils.c | 10 +++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e258dd394..7e7d798c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to the ZSS package will be documented in this file. +## `2.16.0` +- Bugfix: AUX should take leap seconds into account in their log messages' timestamp (#690, #691) + ## `2.14.0` - Bugfix: ZSS would not use zowe.cookieIdentifier when an HA config was used. diff --git a/deps/zowe-common-c b/deps/zowe-common-c index c723503bb..54bbc53cb 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit c723503bbd4b740bd3ceefd9c6eaee98a221cd3a +Subproject commit 54bbc53cb0cb39845778f7d88819a9ba28b3ae17 diff --git a/zis-aux/src/aux-utils.c b/zis-aux/src/aux-utils.c index db2210163..b2386d606 100644 --- a/zis-aux/src/aux-utils.c +++ b/zis-aux/src/aux-utils.c @@ -199,19 +199,27 @@ static void getSTCK(uint64 *stckValue) { __asm(" STCK 0(%0)" : : "r"(stckValue)); } -static int64 getLocalTimeOffset() { +static int64 getLocalTimeOffset(void) { CVT * __ptr32 cvt = *(void * __ptr32 * __ptr32)0x10; void * __ptr32 cvtext2 = cvt->cvtext2; int64 *cvtldto = (int64 * __ptr32)(cvtext2 + 0x38); return *cvtldto; } +static int64 getLeapSecondsOffset(void) { + CVT * __ptr32 cvt = *(void * __ptr32 * __ptr32)0x10; + void * __ptr32 cvtext2 = cvt->cvtext2; + int64 *cvtlso = (int64 * __ptr32)(cvtext2 + 0x50); + return *cvtlso; +} + static void getCurrentLogTimestamp(LogTimestamp *timestamp) { uint64 stck = 0; getSTCK(&stck); stck += getLocalTimeOffset(); + stck -= getLeapSecondsOffset(); stckToLogTimestamp(stck, timestamp); From 4a11baf2c322c5f026aa934e260122081481ca7f Mon Sep 17 00:00:00 2001 From: Jordan Filteau Date: Tue, 12 Mar 2024 11:20:30 -0500 Subject: [PATCH 37/54] updating pointer for zowe-common-c. Signed-off-by: Jordan Filteau --- deps/zowe-common-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zowe-common-c b/deps/zowe-common-c index 54bbc53cb..f3203cf1d 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit 54bbc53cb0cb39845778f7d88819a9ba28b3ae17 +Subproject commit f3203cf1da579b7f89fa41fe6848857391a9bfbd From 180114f52ccbc56b42720cdab1290769b3626c94 Mon Sep 17 00:00:00 2001 From: struga0258 Date: Wed, 17 Apr 2024 13:34:25 +0000 Subject: [PATCH 38/54] v2.16.0 Signed-off-by: struga0258 --- build/zis.proj.env | 4 ++-- build/zss.proj.env | 2 +- manifest.template.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/zis.proj.env b/build/zis.proj.env index 91f913557..c7b28edb4 100644 --- a/build/zis.proj.env +++ b/build/zis.proj.env @@ -1,4 +1,4 @@ PROJECT="zis" -VERSION=2.15.0 -DYNLINK_PLUGIN_VERSION=8 +VERSION=2.16.0 +DYNLINK_PLUGIN_VERSION=9 DEPS="" diff --git a/build/zss.proj.env b/build/zss.proj.env index c784694fb..a1b363b4d 100644 --- a/build/zss.proj.env +++ b/build/zss.proj.env @@ -1,5 +1,5 @@ PROJECT="zss" -VERSION=2.15.0 +VERSION=2.16.0 DEPS="QUICKJS LIBYAML" QUICKJS="quickjs" diff --git a/manifest.template.yaml b/manifest.template.yaml index 0572611b0..7fc8638d2 100644 --- a/manifest.template.yaml +++ b/manifest.template.yaml @@ -3,7 +3,7 @@ name: zss # Component identifier. This identifier matches artifact path in Zowe Artifactory https://zowe.jfrog.io/. id: org.zowe.zss # Without the v -version: 2.15.0 +version: 2.16.0 # Component version is defined in gradle.properties for Gradle project # Human readable component name title: Zowe System Services (ZSS) From 6e89d7f8efed200aa85eb93efc812a70bb95f907 Mon Sep 17 00:00:00 2001 From: Cameron Kirk Date: Mon, 20 May 2024 11:41:20 -0700 Subject: [PATCH 39/54] Fix Typo in README.md Signed-off-by: Cameron Kirk --- plugins/zis/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/zis/README.md b/plugins/zis/README.md index f00153be4..6a9698d07 100644 --- a/plugins/zis/README.md +++ b/plugins/zis/README.md @@ -114,7 +114,7 @@ Refer to that source for the full plugin sample. A ZIS plugin is a load module with the following characteristics: * AMODE 64 * Reentrant -* The result of call a ZIS plugin lod module is a plugin descriptor data +* The result of a call to a ZIS plugin load module is a plugin descriptor data structure mapped by the C struct [`ZISPlugin`](https://github.com/zowe/zss/blob/82c6f2d30951d64fb1bb6487c2dde92700b91552/h/zis/plugin.h#L81-L112) ### Services From 1570b6856d05616b62b2aaa9baffaf7b3c03da85 Mon Sep 17 00:00:00 2001 From: Irek Fakhrutdinov Date: Wed, 22 May 2024 21:13:08 +0200 Subject: [PATCH 40/54] Update the zowe-common-c dependency Signed-off-by: Irek Fakhrutdinov --- deps/zowe-common-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zowe-common-c b/deps/zowe-common-c index f3203cf1d..1ecbdb4b3 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit f3203cf1da579b7f89fa41fe6848857391a9bfbd +Subproject commit 1ecbdb4b3fd0bd28f5a8cf0b78d0f29536a41bfb From b1840bf2783b5767dcee8dd68c7cd7b23e424d03 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Tue, 28 May 2024 14:27:58 +0200 Subject: [PATCH 41/54] Set native tls off if attls is on Signed-off-by: 1000TurquoisePogs --- defaults.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults.yaml b/defaults.yaml index 522467485..71c340569 100644 --- a/defaults.yaml +++ b/defaults.yaml @@ -2,7 +2,7 @@ components: zss: port: 7557 crossMemoryServerName: ${{ ()=> { if (zowe.environments?.ZWED_privilegedServerName) { return zowe.environments.ZWED_privilegedServerName } else { if (zowe.environments?.ZWES_XMEM_SERVER_NAME) { return zowe.environments.ZWES_XMEM_SERVER_NAME } else { return "ZWESIS_STD" } } }() }} - tls: true + tls: "${{ ()=> { if (components.zss.zowe?.network?.server?.tls?.attls) { return false } else if (zowe.network?.server?.tls?.attls) { return false } else { return true } }() }}" productDir: ${{ zowe.runtimeDirectory }}/components/zss/defaults pluginsDir: ${{ zowe.workspaceDirectory }}/app-server/plugins instanceDir: ${{ zowe.workspaceDirectory }}/zss From 28903b16cf4cd57930cce761414f11e3097b63f6 Mon Sep 17 00:00:00 2001 From: Gautham Kuppuswamy Date: Thu, 30 May 2024 04:53:12 -0400 Subject: [PATCH 42/54] Correcting the zowe-common-c Signed-off-by: Gautham Kuppuswamy --- deps/zowe-common-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/zowe-common-c b/deps/zowe-common-c index 1ecbdb4b3..7c0d765ae 160000 --- a/deps/zowe-common-c +++ b/deps/zowe-common-c @@ -1 +1 @@ -Subproject commit 1ecbdb4b3fd0bd28f5a8cf0b78d0f29536a41bfb +Subproject commit 7c0d765ae25e12421839b15cb89736f2c04afbf9 From 22af74e648df42bfb52f31147bab935cd8346847 Mon Sep 17 00:00:00 2001 From: Gautham Kuppuswamy Date: Thu, 30 May 2024 06:18:19 -0400 Subject: [PATCH 43/54] Changelog and missing code in zss.c module Signed-off-by: Gautham Kuppuswamy --- CHANGELOG.md | 3 +++ c/zss.c | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e7d798c2..8766c9a5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to the ZSS package will be documented in this file. +## `2.17.0` +- Code to configure the SLH block size of the http server through 'httpRequestHeapMaxBlocks' in the yaml.(#701) + ## `2.16.0` - Bugfix: AUX should take leap seconds into account in their log messages' timestamp (#690, #691) diff --git a/c/zss.c b/c/zss.c index 5fb34c1ba..50dba92bb 100644 --- a/c/zss.c +++ b/c/zss.c @@ -355,6 +355,27 @@ static void setPrivilegedServerName(HttpServer *server, JsonObject *mvdSettings, } #endif /* __ZOWE_OS_ZOS */ +static void setHttpRequestHeapMaxBlocks(HttpServer *server, ConfigManager *configmgr){ + + int maxBlocks = 0; + int getStatus = cfgGetIntC(configmgr,ZSS_CFGNAME,&maxBlocks,3,"components","zss","httpHeapMaxBlocks"); + + if (getStatus == ZCFG_SUCCESS){ + if (maxBlocks > HTTP_REQUEST_HEAP_MAX_BLOCKS){ + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "httpHeapMaxBlocks out of range, max value is %d\n",HTTP_REQUEST_HEAP_MAX_BLOCKS); + maxBlocks = HTTP_REQUEST_HEAP_MAX_BLOCKS; + } else if (maxBlocks < HTTP_REQUEST_HEAP_MIN_BLOCKS){ + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "httpHeapMaxBlocks out of range, min value is %d\n",HTTP_REQUEST_HEAP_MIN_BLOCKS); + maxBlocks = HTTP_REQUEST_HEAP_MIN_BLOCKS; + } + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "httpHeapMaxBlocks should be between %d and %d\n",HTTP_REQUEST_HEAP_MIN_BLOCKS,HTTP_REQUEST_HEAP_MAX_BLOCKS); + } else{ + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "fallback to default server settings\n"); + maxBlocks = HTTP_REQUEST_HEAP_DEFAULT_BLOCKS; + } + server->config->httpRequestHeapMaxBlocks = (unsigned int)maxBlocks; +} + static void loadWebServerConfigV2(HttpServer *server, ConfigManager *configmgr, hashtable *htUsers, @@ -370,6 +391,7 @@ static void loadWebServerConfigV2(HttpServer *server, server->config->userTimeouts = htUsers; server->config->groupTimeouts = htGroups; server->config->defaultTimeout = defaultSessionTimeout; + setHttpRequestHeapMaxBlocks(server, configmgr); registerHttpServiceOfLastResort(server,NULL); #ifdef __ZOWE_OS_ZOS setPrivilegedServerNameV2(server, configmgr); From 4ef981fda2fcc773d1bb4cb9842ff4ca601c7506 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Fri, 14 Jun 2024 12:14:52 +0200 Subject: [PATCH 44/54] Apply HEAPPOOLS64(OFF) to plugins-init Signed-off-by: 1000TurquoisePogs --- bin/configure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/configure.sh b/bin/configure.sh index 38367d234..61af36b10 100755 --- a/bin/configure.sh +++ b/bin/configure.sh @@ -25,6 +25,6 @@ if [ -n "${ZWE_components_zss_pluginsDir}" ]; then fi if [ "${ZWE_components_app_server_enabled}" != "true" ]; then - _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/components/zss/bin/plugins-init.js" + _CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/components/zss/bin/plugins-init.js" fi From 1859f0bf7123049475a054a18497597e8042cb33 Mon Sep 17 00:00:00 2001 From: struga0258 Date: Mon, 1 Jul 2024 14:11:25 +0000 Subject: [PATCH 45/54] v2.17.0 Signed-off-by: struga0258 --- build/zis.proj.env | 4 ++-- build/zss.proj.env | 2 +- manifest.template.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/zis.proj.env b/build/zis.proj.env index c7b28edb4..71ec6ee7d 100644 --- a/build/zis.proj.env +++ b/build/zis.proj.env @@ -1,4 +1,4 @@ PROJECT="zis" -VERSION=2.16.0 -DYNLINK_PLUGIN_VERSION=9 +VERSION=2.17.0 +DYNLINK_PLUGIN_VERSION=10 DEPS="" diff --git a/build/zss.proj.env b/build/zss.proj.env index a1b363b4d..756da4047 100644 --- a/build/zss.proj.env +++ b/build/zss.proj.env @@ -1,5 +1,5 @@ PROJECT="zss" -VERSION=2.16.0 +VERSION=2.17.0 DEPS="QUICKJS LIBYAML" QUICKJS="quickjs" diff --git a/manifest.template.yaml b/manifest.template.yaml index 7fc8638d2..c844992bc 100644 --- a/manifest.template.yaml +++ b/manifest.template.yaml @@ -3,7 +3,7 @@ name: zss # Component identifier. This identifier matches artifact path in Zowe Artifactory https://zowe.jfrog.io/. id: org.zowe.zss # Without the v -version: 2.16.0 +version: 2.17.0 # Component version is defined in gradle.properties for Gradle project # Human readable component name title: Zowe System Services (ZSS) From 486e64cfa808c71fcef7e44c879c487de399bfc1 Mon Sep 17 00:00:00 2001 From: Gautham Kuppuswamy Date: Mon, 8 Jul 2024 03:36:31 -0400 Subject: [PATCH 46/54] Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEFAULT instead of INFO Signed-off-by: Gautham Kuppuswamy --- CHANGELOG.md | 3 +++ c/zss.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8766c9a5b..0acda89db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to the ZSS package will be documented in this file. +## `2.18.0` +- Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEFAULT instead of INFO.(#715) + ## `2.17.0` - Code to configure the SLH block size of the http server through 'httpRequestHeapMaxBlocks' in the yaml.(#701) diff --git a/c/zss.c b/c/zss.c index 50dba92bb..cb81a3812 100644 --- a/c/zss.c +++ b/c/zss.c @@ -370,7 +370,7 @@ static void setHttpRequestHeapMaxBlocks(HttpServer *server, ConfigManager *confi } zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "httpHeapMaxBlocks should be between %d and %d\n",HTTP_REQUEST_HEAP_MIN_BLOCKS,HTTP_REQUEST_HEAP_MAX_BLOCKS); } else{ - zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "fallback to default server settings\n"); + zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "fallback to default server settings\n"); maxBlocks = HTTP_REQUEST_HEAP_DEFAULT_BLOCKS; } server->config->httpRequestHeapMaxBlocks = (unsigned int)maxBlocks; From 7823e03325935cd4b668164904817c1817516ed2 Mon Sep 17 00:00:00 2001 From: Gautham Kuppuswamy Date: Mon, 8 Jul 2024 03:46:57 -0400 Subject: [PATCH 47/54] Update the CHANGELOG with correct PR number Signed-off-by: Gautham Kuppuswamy --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0acda89db..834d4e6ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the ZSS package will be documented in this file. ## `2.18.0` -- Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEFAULT instead of INFO.(#715) +- Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEFAULT instead of INFO.(#719) ## `2.17.0` - Code to configure the SLH block size of the http server through 'httpRequestHeapMaxBlocks' in the yaml.(#701) From 8db4abab865b47f0dea292ee37a235c4af546e05 Mon Sep 17 00:00:00 2001 From: Gautham Kuppuswamy Date: Mon, 8 Jul 2024 03:54:00 -0400 Subject: [PATCH 48/54] Correcting typo for CHANGELOG wrt PR #719 Signed-off-by: Gautham Kuppuswamy --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 834d4e6ef..93e0add06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the ZSS package will be documented in this file. ## `2.18.0` -- Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEFAULT instead of INFO.(#719) +- Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEBUG instead of INFO.(#719) ## `2.17.0` - Code to configure the SLH block size of the http server through 'httpRequestHeapMaxBlocks' in the yaml.(#701) From 05fc40fefda28bd9817a20c384c84df0b1901fd9 Mon Sep 17 00:00:00 2001 From: struga0258 Date: Wed, 24 Jul 2024 15:09:34 +0000 Subject: [PATCH 49/54] v2.18.0 Signed-off-by: struga0258 --- build/zis.proj.env | 4 ++-- build/zss.proj.env | 2 +- manifest.template.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/zis.proj.env b/build/zis.proj.env index 71ec6ee7d..b1bf03a7b 100644 --- a/build/zis.proj.env +++ b/build/zis.proj.env @@ -1,4 +1,4 @@ PROJECT="zis" -VERSION=2.17.0 -DYNLINK_PLUGIN_VERSION=10 +VERSION=2.18.0 +DYNLINK_PLUGIN_VERSION=11 DEPS="" diff --git a/build/zss.proj.env b/build/zss.proj.env index 756da4047..5140ad0de 100644 --- a/build/zss.proj.env +++ b/build/zss.proj.env @@ -1,5 +1,5 @@ PROJECT="zss" -VERSION=2.17.0 +VERSION=2.18.0 DEPS="QUICKJS LIBYAML" QUICKJS="quickjs" diff --git a/manifest.template.yaml b/manifest.template.yaml index c844992bc..55b0ee45f 100644 --- a/manifest.template.yaml +++ b/manifest.template.yaml @@ -3,7 +3,7 @@ name: zss # Component identifier. This identifier matches artifact path in Zowe Artifactory https://zowe.jfrog.io/. id: org.zowe.zss # Without the v -version: 2.17.0 +version: 2.18.0 # Component version is defined in gradle.properties for Gradle project # Human readable component name title: Zowe System Services (ZSS) From 7527fa7e76d0a4d5a4e231e21de673a8c55e8d73 Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Tue, 20 Aug 2024 16:56:06 +0200 Subject: [PATCH 50/54] Do not log into zowe.runtimeDirectory Signed-off-by: Martin Zeithaml --- CHANGELOG.md | 2 +- bin/start.sh | 121 +++++++++++++++++++++++---------------------------- 2 files changed, 55 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc13c2f54..676d721e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the ZSS package will be documented in this file. ## `3.0.0` - +- Bugfix: ommiting `zowe.logDirectory` forces the zss to log into the `zowe.runtimeDirectory`. (#726) ## `2.18.0` - Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEBUG instead of INFO.(#719) diff --git a/bin/start.sh b/bin/start.sh index 0f7e12381..a4322abef 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -2,9 +2,9 @@ # This program and the accompanying materials are # made available under the terms of the Eclipse Public License v2.0 which accompanies # this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html -# +# # SPDX-License-Identifier: EPL-2.0 -# +# # Copyright Contributors to the Zowe Project. @@ -17,7 +17,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then cd ${ZWE_zowe_runtimeDirectory}/components/zss/bin export _BPXK_AUTOCVT=ON - + # Get component home dir if defined, otherwise set it based on runtimeDirectory if [ -z "${ZWES_COMPONENT_HOME}" ]; then if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then @@ -26,148 +26,135 @@ if [[ "${OSNAME}" == "OS/390" ]]; then ZWES_COMPONENT_HOME="${ZWE_zowe_runtimeDirectory}/components/zss" fi fi - + # Get schema paths if defined, otherwise set it based on runtimeDirectory if [ -z "${ZWES_SCHEMA_PATHS}" ]; then if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then echo "ZWE_zowe_runtimeDirectory is not defined. Run with ZWES_SCHEA_PATHS defined to the colon-separated file paths of zowe json schemas used to validate the ZSS configuration yaml file, or have ZWE_zowe_runtimeDirectory defined to the path of a zowe install that includes zowe core schemas and zss within /components/zss" fi fi - + # Get config path or fail if [ -z "${ZWE_CLI_PARAMETER_CONFIG}" ]; then echo "ZWE_CLI_PARAMETER_CONFIG is not defined. Rerun script with it defined to a list of paths to zowe.yaml files such as /path/to/zowe.yaml or FILE(/yaml1.yaml):LIB(other.yaml):FILE(/path/to/yaml3.yaml)" fi - + # Take in our defaults ZWES_CONFIG="FILE(${ZWE_CLI_PARAMETER_CONFIG}):FILE(${ZWES_COMPONENT_HOME}/defaults.yaml)" - + # Essential parameters now set up. - + ZSS_SCRIPT_DIR="${ZWES_COMPONENT_HOME}/bin" - + ZWES_SCHEMA_PATHS="${ZWES_COMPONENT_HOME}/schemas/zowe-schema.json:${ZWE_zowe_runtimeDirectory}/schemas/zowe-yaml-schema.json:${ZWE_zowe_runtimeDirectory}/schemas/server-common.json:${ZWES_COMPONENT_HOME}/schemas/zss-config.json" - - + + # this is to resolve ZSS bin path in LIBPATH variable. LIBPATH="${LIBPATH}:${ZSS_SCRIPT_DIR}" - + #### Log file initialization #### - if [ -n "$ZWES_LOG_FILE" ] - then - if [[ $ZWES_LOG_FILE == /* ]] - then + if [ -n "$ZWES_LOG_FILE" ]; then + if [[ $ZWES_LOG_FILE == /* ]]; then echo "Absolute log location given." else ZWES_LOG_FILE="${ZSS_SCRIPT_DIR}/${ZWES_LOG_FILE}" echo "Relative log location given, set to absolute path=$ZWES_LOG_FILE" fi - if [ -n "$ZWES_LOG_DIR" ] - then - echo "ZWES_LOG_FILE set (value $ZWES_LOG_FILE). Ignoring ZWES_LOG_DIR." + if [ -n "$ZWES_LOG_DIR" ]; then + echo "ZWES_LOG_FILE set (value $ZWES_LOG_FILE). Ignoring ZWES_LOG_DIR." fi else # _FILE was not specified; default filename, and check and maybe default _DIR - if [ -z "$ZWES_LOG_DIR" ] - then - if [ -n "$ZWE_zowe_logDirectory" -a -d "$ZWE_zowe_logDirectory" ] - then + if [ -z "$ZWES_LOG_DIR" ]; then + if [ -n "$ZWE_zowe_logDirectory" -a -d "$ZWE_zowe_logDirectory" ]; then ZWES_LOG_DIR=${ZWE_zowe_logDirectory} else - ZWES_LOG_DIR="../log" + echo "Cannot determine the log directory. Logging disabled." + ZWES_LOG_DIR= + ZWES_LOG_FILE=/dev/null fi fi - if [ -f "$ZWES_LOG_DIR" ] - then + if [ -f "$ZWES_LOG_DIR" ]; then ZWES_LOG_FILE=$ZWES_LOG_DIR - elif [ ! -d "$ZWES_LOG_DIR" ] - then + elif [ ! -d "$ZWES_LOG_DIR" ] && [ ! -z "$ZWES_LOG_DIR" ]; then echo "Will make log directory $ZWES_LOG_DIR" mkdir -p $ZWES_LOG_DIR - if [ $? -ne 0 ] - then - echo "Cannot make log directory. Logging disabled." + if [ $? -ne 0 ]; then + echo "Cannot make log directory. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi ZWES_ROTATE_LOGS=0 - if [ -d "$ZWES_LOG_DIR" ] && [ -z "$ZWES_LOG_FILE" ] - then + if [ -d "$ZWES_LOG_DIR" ] && [ -z "$ZWES_LOG_FILE" ]; then ZWES_LOG_FILE="$ZWES_LOG_DIR/zssServer-`date +%Y-%m-%d-%H-%M`.log" - if [ -z "$ZWES_LOGS_TO_KEEP" ] - then + if [ -z "$ZWES_LOGS_TO_KEEP" ]; then ZWES_LOGS_TO_KEEP=5 fi echo $ZWES_LOGS_TO_KEEP|egrep '^\-?[0-9]+$' >/dev/null - if [ $? -ne 0 ] - then - echo "ZWES_LOGS_TO_KEEP not a number. Defaulting to 5." + if [ $? -ne 0 ]; then + echo "ZWES_LOGS_TO_KEEP not a number. Defaulting to 5." ZWES_LOGS_TO_KEEP=5 fi - if [ $ZWES_LOGS_TO_KEEP -ge 0 ] - then + if [ $ZWES_LOGS_TO_KEEP -ge 0 ]; then ZWES_ROTATE_LOGS=1 fi fi #Clean up excess logs, if appropriate. - if [ $ZWES_ROTATE_LOGS -ne 0 ] - then - for f in `ls -r -1 $ZWES_LOG_DIR/zssServer-*.log 2>/dev/null | tail +$ZWES_LOGS_TO_KEEP` - do + if [ $ZWES_ROTATE_LOGS -ne 0 ]; then + for f in `ls -r -1 $ZWES_LOG_DIR/zssServer-*.log 2>/dev/null | tail +$ZWES_LOGS_TO_KEEP`; do echo zssServer.sh removing $f rm -f $f done fi fi ZSS_CHECK_DIR="$(dirname "$ZWES_LOG_FILE")" - if [ ! -d "$ZSS_CHECK_DIR" ] - then - echo "ZWES_LOG_FILE contains nonexistent directories. Creating $ZSS_CHECK_DIR" + if [ ! -d "$ZSS_CHECK_DIR" ]; then + echo "ZWES_LOG_FILE contains nonexistent directories. Creating $ZSS_CHECK_DIR" mkdir -p $ZSS_CHECK_DIR - if [ $? -ne 0 ] - then - echo "Cannot make log directory. Logging disabled." + if [ $? -ne 0 ]; then + echo "Cannot make log directory. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi #Now sanitize final log filename: if it is relative, make it absolute before cd to js - if [ "$ZWES_LOG_FILE" != "/dev/null" ] - then + if [ "$ZWES_LOG_FILE" != "/dev/null" ]; then ZSS_CHECK_DIR=$(cd "$(dirname "$ZWES_LOG_FILE")"; pwd) ZWES_LOG_FILE=$ZSS_CHECK_DIR/$(basename "$ZWES_LOG_FILE") fi + + if [ ! -z $(echo "${ZWED_LOG_FILE}" | grep "^${ZWE_zowe_runtimeDirectory}") ]; then + echo "Logging into zowe.runtimeDirectory not allowed. Logging disabled." + ZWED_LOG_FILE=/dev/null + fi + echo ZWES_LOG_FILE=${ZWES_LOG_FILE} export ZWES_LOG_FILE=$ZWES_LOG_FILE - if [ ! -e $ZWES_LOG_FILE ] - then + if [ ! -e $ZWES_LOG_FILE ]; then touch $ZWES_LOG_FILE - if [ $? -ne 0 ] - then - echo "Cannot make log file. Logging disabled." + if [ $? -ne 0 ]; then + echo "Cannot make log file. Logging disabled." ZWES_LOG_FILE=/dev/null fi else - if [ -d $ZWES_LOG_FILE ] - then - echo "ZWES_LOG_FILE is a directory. Must be a file. Logging disabled." + if [ -d $ZWES_LOG_FILE ]; then + echo "ZWES_LOG_FILE is a directory. Must be a file. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi - if [ ! -w "$ZWES_LOG_FILE" ] - then + if [ ! -w "$ZWES_LOG_FILE" ]; then echo file "$ZWES_LOG_FILE" is not writable. Logging disabled. ZWES_LOG_FILE=/dev/null fi #### Log file determined #### - + # Startup zss export dir=`dirname "$0"` cd $ZSS_SCRIPT_DIR - - # determine amode for zssServer + + # determine amode for zssServer ZSS_SERVER_31="./zssServer" ZSS_SERVER_64="./zssServer64" - + if [ "$ZWE_components_zss_agent_64bit" != "false" ] && [ -x "${ZSS_SERVER_64}" ]; then ZSS_SERVER="${ZSS_SERVER_64}" else @@ -183,7 +170,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then _BPX_SHAREAS=NO _BPX_JOBNAME=${ZWE_zowe_job_prefix}SZ ${ZSS_SERVER} --schemas "${ZWES_SCHEMA_PATHS}" --configs "${ZWES_CONFIG}" 2>&1 else _BPX_SHAREAS=NO _BPX_JOBNAME=${ZWE_zowe_job_prefix}SZ ${ZSS_SERVER} --schemas "${ZWES_SCHEMA_PATHS}" --configs "${ZWES_CONFIG}" 2>&1 | tee $ZWES_LOG_FILE - fi + fi else echo "Zowe ZSS server is unsupported on ${OSNAME}. Supported systems: OS/390" fi From 24312825b01d5fe1bb778d8917fb169bb9c8308f Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Fri, 23 Aug 2024 10:59:24 +0200 Subject: [PATCH 51/54] If no log dir, disable logging in prod Signed-off-by: Martin Zeithaml --- CHANGELOG.md | 2 +- bin/start.sh | 127 +++++++++++++++++++++++++++++---------------------- 2 files changed, 74 insertions(+), 55 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 676d721e6..269705d7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the ZSS package will be documented in this file. ## `3.0.0` -- Bugfix: ommiting `zowe.logDirectory` forces the zss to log into the `zowe.runtimeDirectory`. (#726) +- Enhancement: if no `zowe.logDirectory` is provided, logging is disabled. (#726) ## `2.18.0` - Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEBUG instead of INFO.(#719) diff --git a/bin/start.sh b/bin/start.sh index a4322abef..3d5410e02 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -2,9 +2,9 @@ # This program and the accompanying materials are # made available under the terms of the Eclipse Public License v2.0 which accompanies # this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html -# +# # SPDX-License-Identifier: EPL-2.0 -# +# # Copyright Contributors to the Zowe Project. @@ -17,7 +17,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then cd ${ZWE_zowe_runtimeDirectory}/components/zss/bin export _BPXK_AUTOCVT=ON - + # Get component home dir if defined, otherwise set it based on runtimeDirectory if [ -z "${ZWES_COMPONENT_HOME}" ]; then if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then @@ -26,135 +26,154 @@ if [[ "${OSNAME}" == "OS/390" ]]; then ZWES_COMPONENT_HOME="${ZWE_zowe_runtimeDirectory}/components/zss" fi fi - + # Get schema paths if defined, otherwise set it based on runtimeDirectory if [ -z "${ZWES_SCHEMA_PATHS}" ]; then if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then echo "ZWE_zowe_runtimeDirectory is not defined. Run with ZWES_SCHEA_PATHS defined to the colon-separated file paths of zowe json schemas used to validate the ZSS configuration yaml file, or have ZWE_zowe_runtimeDirectory defined to the path of a zowe install that includes zowe core schemas and zss within /components/zss" fi fi - + # Get config path or fail if [ -z "${ZWE_CLI_PARAMETER_CONFIG}" ]; then echo "ZWE_CLI_PARAMETER_CONFIG is not defined. Rerun script with it defined to a list of paths to zowe.yaml files such as /path/to/zowe.yaml or FILE(/yaml1.yaml):LIB(other.yaml):FILE(/path/to/yaml3.yaml)" fi - + # Take in our defaults ZWES_CONFIG="FILE(${ZWE_CLI_PARAMETER_CONFIG}):FILE(${ZWES_COMPONENT_HOME}/defaults.yaml)" - + # Essential parameters now set up. - + ZSS_SCRIPT_DIR="${ZWES_COMPONENT_HOME}/bin" - + ZWES_SCHEMA_PATHS="${ZWES_COMPONENT_HOME}/schemas/zowe-schema.json:${ZWE_zowe_runtimeDirectory}/schemas/zowe-yaml-schema.json:${ZWE_zowe_runtimeDirectory}/schemas/server-common.json:${ZWES_COMPONENT_HOME}/schemas/zss-config.json" - - + + # this is to resolve ZSS bin path in LIBPATH variable. LIBPATH="${LIBPATH}:${ZSS_SCRIPT_DIR}" - + #### Log file initialization #### - if [ -n "$ZWES_LOG_FILE" ]; then - if [[ $ZWES_LOG_FILE == /* ]]; then + if [ -n "$ZWES_LOG_FILE" ] + then + if [[ $ZWES_LOG_FILE == /* ]] + then echo "Absolute log location given." else ZWES_LOG_FILE="${ZSS_SCRIPT_DIR}/${ZWES_LOG_FILE}" echo "Relative log location given, set to absolute path=$ZWES_LOG_FILE" fi - if [ -n "$ZWES_LOG_DIR" ]; then - echo "ZWES_LOG_FILE set (value $ZWES_LOG_FILE). Ignoring ZWES_LOG_DIR." + if [ -n "$ZWES_LOG_DIR" ] + then + echo "ZWES_LOG_FILE set (value $ZWES_LOG_FILE). Ignoring ZWES_LOG_DIR." fi else # _FILE was not specified; default filename, and check and maybe default _DIR - if [ -z "$ZWES_LOG_DIR" ]; then - if [ -n "$ZWE_zowe_logDirectory" -a -d "$ZWE_zowe_logDirectory" ]; then + if [ -z "$ZWES_LOG_DIR" ] + then + if [ -n "$ZWE_zowe_logDirectory" -a -d "$ZWE_zowe_logDirectory" ] + then ZWES_LOG_DIR=${ZWE_zowe_logDirectory} else - echo "Cannot determine the log directory. Logging disabled." - ZWES_LOG_DIR= - ZWES_LOG_FILE=/dev/null + if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then + ZWES_LOG_DIR="../log" + else + echo "Cannot determine the log directory. Logging disabled." + ZWES_LOG_DIR= + ZWES_LOG_FILE=/dev/null + fi fi fi - if [ -f "$ZWES_LOG_DIR" ]; then + if [ -f "$ZWES_LOG_DIR" ] + then ZWES_LOG_FILE=$ZWES_LOG_DIR - elif [ ! -d "$ZWES_LOG_DIR" ] && [ ! -z "$ZWES_LOG_DIR" ]; then + elif [ ! -d "$ZWES_LOG_DIR" ] + then echo "Will make log directory $ZWES_LOG_DIR" mkdir -p $ZWES_LOG_DIR - if [ $? -ne 0 ]; then - echo "Cannot make log directory. Logging disabled." + if [ $? -ne 0 ] + then + echo "Cannot make log directory. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi ZWES_ROTATE_LOGS=0 - if [ -d "$ZWES_LOG_DIR" ] && [ -z "$ZWES_LOG_FILE" ]; then + if [ -d "$ZWES_LOG_DIR" ] && [ -z "$ZWES_LOG_FILE" ] + then ZWES_LOG_FILE="$ZWES_LOG_DIR/zssServer-`date +%Y-%m-%d-%H-%M`.log" - if [ -z "$ZWES_LOGS_TO_KEEP" ]; then + if [ -z "$ZWES_LOGS_TO_KEEP" ] + then ZWES_LOGS_TO_KEEP=5 fi echo $ZWES_LOGS_TO_KEEP|egrep '^\-?[0-9]+$' >/dev/null - if [ $? -ne 0 ]; then - echo "ZWES_LOGS_TO_KEEP not a number. Defaulting to 5." + if [ $? -ne 0 ] + then + echo "ZWES_LOGS_TO_KEEP not a number. Defaulting to 5." ZWES_LOGS_TO_KEEP=5 fi - if [ $ZWES_LOGS_TO_KEEP -ge 0 ]; then + if [ $ZWES_LOGS_TO_KEEP -ge 0 ] + then ZWES_ROTATE_LOGS=1 fi fi #Clean up excess logs, if appropriate. - if [ $ZWES_ROTATE_LOGS -ne 0 ]; then - for f in `ls -r -1 $ZWES_LOG_DIR/zssServer-*.log 2>/dev/null | tail +$ZWES_LOGS_TO_KEEP`; do + if [ $ZWES_ROTATE_LOGS -ne 0 ] + then + for f in `ls -r -1 $ZWES_LOG_DIR/zssServer-*.log 2>/dev/null | tail +$ZWES_LOGS_TO_KEEP` + do echo zssServer.sh removing $f rm -f $f done fi fi ZSS_CHECK_DIR="$(dirname "$ZWES_LOG_FILE")" - if [ ! -d "$ZSS_CHECK_DIR" ]; then - echo "ZWES_LOG_FILE contains nonexistent directories. Creating $ZSS_CHECK_DIR" + if [ ! -d "$ZSS_CHECK_DIR" ] + then + echo "ZWES_LOG_FILE contains nonexistent directories. Creating $ZSS_CHECK_DIR" mkdir -p $ZSS_CHECK_DIR - if [ $? -ne 0 ]; then - echo "Cannot make log directory. Logging disabled." + if [ $? -ne 0 ] + then + echo "Cannot make log directory. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi #Now sanitize final log filename: if it is relative, make it absolute before cd to js - if [ "$ZWES_LOG_FILE" != "/dev/null" ]; then + if [ "$ZWES_LOG_FILE" != "/dev/null" ] + then ZSS_CHECK_DIR=$(cd "$(dirname "$ZWES_LOG_FILE")"; pwd) ZWES_LOG_FILE=$ZSS_CHECK_DIR/$(basename "$ZWES_LOG_FILE") fi - - if [ ! -z $(echo "${ZWED_LOG_FILE}" | grep "^${ZWE_zowe_runtimeDirectory}") ]; then - echo "Logging into zowe.runtimeDirectory not allowed. Logging disabled." - ZWED_LOG_FILE=/dev/null - fi - echo ZWES_LOG_FILE=${ZWES_LOG_FILE} export ZWES_LOG_FILE=$ZWES_LOG_FILE - if [ ! -e $ZWES_LOG_FILE ]; then + if [ ! -e $ZWES_LOG_FILE ] + then touch $ZWES_LOG_FILE - if [ $? -ne 0 ]; then - echo "Cannot make log file. Logging disabled." + if [ $? -ne 0 ] + then + echo "Cannot make log file. Logging disabled." ZWES_LOG_FILE=/dev/null fi else - if [ -d $ZWES_LOG_FILE ]; then - echo "ZWES_LOG_FILE is a directory. Must be a file. Logging disabled." + if [ -d $ZWES_LOG_FILE ] + then + echo "ZWES_LOG_FILE is a directory. Must be a file. Logging disabled." ZWES_LOG_FILE=/dev/null fi fi - if [ ! -w "$ZWES_LOG_FILE" ]; then + if [ ! -w "$ZWES_LOG_FILE" ] + then echo file "$ZWES_LOG_FILE" is not writable. Logging disabled. ZWES_LOG_FILE=/dev/null fi #### Log file determined #### - + # Startup zss export dir=`dirname "$0"` cd $ZSS_SCRIPT_DIR - - # determine amode for zssServer + + # determine amode for zssServer ZSS_SERVER_31="./zssServer" ZSS_SERVER_64="./zssServer64" - + if [ "$ZWE_components_zss_agent_64bit" != "false" ] && [ -x "${ZSS_SERVER_64}" ]; then ZSS_SERVER="${ZSS_SERVER_64}" else @@ -170,7 +189,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then _BPX_SHAREAS=NO _BPX_JOBNAME=${ZWE_zowe_job_prefix}SZ ${ZSS_SERVER} --schemas "${ZWES_SCHEMA_PATHS}" --configs "${ZWES_CONFIG}" 2>&1 else _BPX_SHAREAS=NO _BPX_JOBNAME=${ZWE_zowe_job_prefix}SZ ${ZSS_SERVER} --schemas "${ZWES_SCHEMA_PATHS}" --configs "${ZWES_CONFIG}" 2>&1 | tee $ZWES_LOG_FILE - fi + fi else echo "Zowe ZSS server is unsupported on ${OSNAME}. Supported systems: OS/390" fi From 3ef0e0511fcf7da777da5c62bf94a7e849209974 Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Fri, 23 Aug 2024 11:00:59 +0200 Subject: [PATCH 52/54] Minor update Signed-off-by: Martin Zeithaml --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 269705d7a..92650925c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to the ZSS package will be documented in this file. ## `3.0.0` -- Enhancement: if no `zowe.logDirectory` is provided, logging is disabled. (#726) +- Enhancement: if no `zowe.logDirectory` is defined in config, logging is disabled. (#726) ## `2.18.0` - Change log level for setting default value of 'httpRequestHeapMaxBlocks' to DEBUG instead of INFO.(#719) From 2cd75d062df19af43fbb283b3af802196778bb4f Mon Sep 17 00:00:00 2001 From: Martin Zeithaml Date: Fri, 23 Aug 2024 11:13:10 +0200 Subject: [PATCH 53/54] Do not create empty dir Signed-off-by: Martin Zeithaml --- bin/start.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/start.sh b/bin/start.sh index 3d5410e02..347a07b2d 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -88,12 +88,13 @@ if [[ "${OSNAME}" == "OS/390" ]]; then ZWES_LOG_FILE=$ZWES_LOG_DIR elif [ ! -d "$ZWES_LOG_DIR" ] then - echo "Will make log directory $ZWES_LOG_DIR" - mkdir -p $ZWES_LOG_DIR - if [ $? -ne 0 ] - then - echo "Cannot make log directory. Logging disabled." - ZWES_LOG_FILE=/dev/null + if [ -n "${ZWES_LOG_DIR}" ]; then + echo "Will make log directory $ZWES_LOG_DIR" + mkdir -p $ZWES_LOG_DIR + if [ $? -ne 0 ]; then + echo "Cannot make log directory. Logging disabled." + ZWES_LOG_FILE=/dev/null + fi fi fi ZWES_ROTATE_LOGS=0 From b55b510ab16360c32838fbffcac082e54559ca2f Mon Sep 17 00:00:00 2001 From: Martin Zeithaml <66114686+Martin-Zeithaml@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:35:20 +0200 Subject: [PATCH 54/54] Update start.sh Signed-off-by: Martin Zeithaml <66114686+Martin-Zeithaml@users.noreply.github.com> --- bin/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/start.sh b/bin/start.sh index 347a07b2d..6f4a6e5c8 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -77,7 +77,7 @@ if [[ "${OSNAME}" == "OS/390" ]]; then if [ -z "${ZWE_zowe_runtimeDirectory}" ]; then ZWES_LOG_DIR="../log" else - echo "Cannot determine the log directory. Logging disabled." + echo "No log directory. Logging disabled." ZWES_LOG_DIR= ZWES_LOG_FILE=/dev/null fi