Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
89bd269
fix(zds): Bounded copy for dsname, volser
traeok Apr 14, 2026
a212b84
fix(zutm): bounded copy for parms
traeok Apr 14, 2026
3ad2748
fix(zut): fail in zut_bpxwdyn_common if parm larger than max len
traeok Apr 14, 2026
c504b4c
fix(zdsm): rename macro to avoid collisions in C++
traeok Apr 14, 2026
f613749
fix(zut): off-by-one buffer overflow possibility
traeok Apr 14, 2026
a4ffefa
fix(zam24): Remove redundant BR R14 instruction
traeok Apr 14, 2026
bb4a6b9
refactor(zds): Make etag copy more robust
traeok Apr 14, 2026
2bff6ea
fix(uss): unchecked indexing for CSV parse
traeok Apr 14, 2026
d3c3110
fix(zds): avoid possible csifiltk overflow
traeok Apr 14, 2026
0dc3898
fix(zds): Truncate error message for 31-bit alloc
traeok Apr 14, 2026
a8d6ee0
fix(zds): avoid indexing UB in zds_is_valid_member_name
traeok Apr 14, 2026
3334360
fix(zcn): 1-byte buffer overflow
traeok Apr 14, 2026
0f908e1
fix(zcnm31): command text overflow for MGCRE
traeok Apr 14, 2026
e283577
refactor: ZDIAG_SET_MSG helper to avoid overflow
traeok Apr 15, 2026
19f0213
fix(zusf): avoid argv option injection
traeok Apr 15, 2026
e0f34fe
fix(zjson): Depth cap of 64 for recursive branches
traeok Apr 15, 2026
0aa1ee0
fix(zlogger): buffer overflow possibilities
traeok Apr 15, 2026
dc9637b
fix(zcnm31): clamp length variables
traeok Apr 15, 2026
3e36c4f
refactor(ztype): remove do/while trick from ZDIAG_SET_MSG
traeok Apr 15, 2026
61b50c8
fix(zjbm): Missing return in ZJBMEMSG
traeok Apr 15, 2026
265f667
fix(zjbm): avoid buffer overflow for str copy
traeok Apr 15, 2026
6af6109
fix: use safe format strings
traeok Apr 17, 2026
ff186a2
Merge branch 'main' into fix/vulns
traeok Apr 17, 2026
cc3fbc5
fix(zutm): remove unused var
traeok Apr 17, 2026
e9032b2
chore: changelog
traeok Apr 17, 2026
64e1d27
fix(zjbm): remove one param from ZDIAG_SET_MSG
traeok Apr 17, 2026
f9d9f23
fix: update link, use dynamic formatting
traeok Apr 20, 2026
c4800b6
Merge branch 'main' into fix/vulns
traeok Apr 20, 2026
3b09544
fix(zjbm): Change int param to pointer
traeok Apr 20, 2026
1874c30
chore: add comments on truncation cases
traeok Apr 20, 2026
384fed6
Merge branch 'main' into fix/vulns
traeok Apr 21, 2026
370143b
refactor(zutm): dynamic precision for parms
traeok Apr 23, 2026
3d0c8d5
Merge branch 'main' into fix/vulns
traeok Apr 23, 2026
4fe2182
Merge branch 'main' into fix/vulns
traeok Apr 23, 2026
812d0be
Merge branch 'main' into fix/vulns
traeok Apr 23, 2026
d213558
Merge remote-tracking branch 'origin/main' into fix/vulns
traeok Apr 23, 2026
816e896
fix(zds): add precision to diag msg
traeok Apr 23, 2026
24a71aa
fix(zds): add 7-byte padding to kept struct dword aligned
traeok Apr 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions native/c/commands/uss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@
fields.push_back(field);
}

// We should have 8 fields: mode, links, user, group, size, filetag, mtime, name
if (fields.size() < 8)

Check failure on line 214 in native/c/commands/uss.cpp

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this code to not nest more than 3 if|for|do|while|switch statements.

See more on https://sonarcloud.io/project/issues?id=zowe_zowe-native-proto&issues=AZ2Rrbka0NYL2QaKAcYf&open=AZ2Rrbka0NYL2QaKAcYf&pullRequest=940
{
continue;
}

entry->set("mode", str(fields[0]));
entry->set("links", i64(atoi(fields[1].c_str())));
entry->set("user", str(fields[2]));
Expand Down
63 changes: 32 additions & 31 deletions native/c/zam.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/**
* 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
Expand Down Expand Up @@ -63,7 +63,7 @@
if (0 == diag->e_msg_len)
{
strcpy(diag->service_name, operation);
diag->e_msg_len = sprintf(diag->e_msg, "DCB abend during %s for %8.8s data set: %44.44s",
ZDIAG_SET_MSG(diag, "DCB abend during %.16s for %8.8s data set: %44.44s",
operation, ioc->ddname, ioc->jfcb.jfcbdsnm);
diag->detail_rc = ZDS_RTNCD_DCB_ABEND_ERROR;
}
Expand All @@ -78,15 +78,15 @@

if (ioc->jfcb.jfcbind1 != jfcpds)
{
diag->e_msg_len = sprintf(diag->e_msg, "DDname: %8.8s data set: %44.44s is not a PDS: %X", ioc->dcb.dcbddnam, ioc->jfcb.jfcbdsnm, ioc->jfcb.jfcbind1);
ZDIAG_SET_MSG(diag, "DDname: %8.8s data set: %44.44s is not a PDS: %X", ioc->dcb.dcbddnam, ioc->jfcb.jfcbdsnm, ioc->jfcb.jfcbind1);
diag->detail_rc = ZDS_RTNCD_UNSUPPORTED_DATA_SET;
return RTNCD_FAILURE;
}

// ensure member name (e.g. is a partitioned data set)
if (ioc->jfcb.jfcbelnm[0] == ' ')
{
diag->e_msg_len = sprintf(diag->e_msg, "DDname: %8.8s data set: %44.44s is not a partitioned data set: %s", ioc->dcb.dcbddnam, ioc->jfcb.jfcbdsnm, ioc->jfcb.jfcbelnm);
ZDIAG_SET_MSG(diag, "DDname: %8.8s data set: %44.44s is not a partitioned data set: %.8s", ioc->dcb.dcbddnam, ioc->jfcb.jfcbdsnm, ioc->jfcb.jfcbelnm);
diag->detail_rc = ZDS_RTNCD_UNSUPPORTED_DSORG;
return RTNCD_FAILURE;
}
Expand All @@ -107,7 +107,7 @@
{
diag->service_rc = rc;
strcpy(diag->service_name, "ENQ");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to ENQ ddname: %8.8s data set: %44.44s rc was: %d", ioc->dcb.dcbddnam, ioc->jfcb.jfcbdsnm, rc);
ZDIAG_SET_MSG(diag, "Failed to ENQ ddname: %8.8s data set: %44.44s rc was: %d", ioc->dcb.dcbddnam, ioc->jfcb.jfcbdsnm, rc);
diag->detail_rc = ZDS_RTNCD_ENQ_ERROR;
return RTNCD_FAILURE;
}
Expand Down Expand Up @@ -147,7 +147,7 @@
if (0 == ioc->ucb)
{
diag->detail_rc = ZDS_RTNCD_UCB_ERROR;
diag->e_msg_len = sprintf(diag->e_msg, "Failed to get UCB for data set: %44.44s", ioc->jfcb.jfcbdsnm);
ZDIAG_SET_MSG(diag, "Failed to get UCB for data set: %44.44s", ioc->jfcb.jfcbdsnm);
return RTNCD_FAILURE;
}

Expand All @@ -167,7 +167,7 @@
{
diag->service_rc = rc;
strcpy(diag->service_name, "RESERVE");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to RESERVE ddname: %8.8s data set: %44.44s rc was: %d", ioc->dcb.dcbddnam, ioc->jfcb.jfcbdsnm, rc);
ZDIAG_SET_MSG(diag, "Failed to RESERVE ddname: %8.8s data set: %44.44s rc was: %d", ioc->dcb.dcbddnam, ioc->jfcb.jfcbdsnm, rc);
diag->detail_rc = ZDS_RTNCD_RESERVE_ERROR;
return RTNCD_FAILURE;
}
Expand All @@ -184,7 +184,7 @@
{
diag->service_rc = rc;
strcpy(diag->service_name, "OPEN");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to open ddname: %8.8s for data set: %44.44s rc was: %d", ioc->dcb.dcbddnam, ioc->jfcb.jfcbdsnm, rc);
ZDIAG_SET_MSG(diag, "Failed to open ddname: %8.8s for data set: %44.44s rc was: %d", ioc->dcb.dcbddnam, ioc->jfcb.jfcbdsnm, rc);
diag->detail_rc = ZDS_RTNCD_OPEN_ERROR;
return RTNCD_FAILURE;
}
Expand All @@ -196,7 +196,7 @@

if (!(ioc->dcb.dcboflgs & dcbofopn))
{
diag->e_msg_len = sprintf(diag->e_msg, "Data set is not open: %44.44s", ioc->jfcb.jfcbdsnm);
ZDIAG_SET_MSG(diag, "Data set is not open: %44.44s", ioc->jfcb.jfcbdsnm);
diag->detail_rc = ZDS_RTNCD_NOT_OPEN_ERROR;
return RTNCD_FAILURE;
}
Expand All @@ -210,7 +210,7 @@

if (!(ioc->dcb.dcbrecfm & (dcbrecf | dcbrecv)))
{
diag->e_msg_len = sprintf(diag->e_msg, "Data set is not a fixed or variable record format: %X", ioc->dcb.dcbrecfm);
ZDIAG_SET_MSG(diag, "Data set is not a fixed or variable record format: %X", ioc->dcb.dcbrecfm);
diag->detail_rc = ZDS_RTNCD_UNSUPPORTED_RECFM;
return RTNCD_FAILURE;
}
Expand All @@ -219,7 +219,7 @@

if (block_size < 1)
{
diag->e_msg_len = sprintf(diag->e_msg, "Data set has less than 1 block size: %X", block_size);
ZDIAG_SET_MSG(diag, "Data set has less than 1 block size: %X", block_size);
diag->detail_rc = ZDS_RTNCD_UNSUPPORTED_BLOCK_SIZE;
return RTNCD_FAILURE;
}
Expand All @@ -231,7 +231,7 @@
// Fixed-length record validation
if (block_size % ioc->dcb.dcblrecl != 0)
{
diag->e_msg_len = sprintf(diag->e_msg, "Data set block size is not a multiple of the record length: %d not evenly divisible by %d", ioc->dcb.dcbblksi, ioc->dcb.dcblrecl);
ZDIAG_SET_MSG(diag, "Data set block size is not a multiple of the record length: %d not evenly divisible by %d", ioc->dcb.dcbblksi, ioc->dcb.dcblrecl);
diag->detail_rc = ZDS_RTNCD_INVALID_BLOCK_SIZE;
return RTNCD_FAILURE;
}
Expand All @@ -241,7 +241,7 @@
// Variable-length record validation: block size must be >= LRECL + 4 (for BDW)
if (block_size < ioc->dcb.dcblrecl + sizeof(BDW))
{
diag->e_msg_len = sprintf(diag->e_msg, "Data set block size is too small for variable records: %d < %d (LRECL + 4)", block_size, ioc->dcb.dcblrecl + sizeof(BDW));
ZDIAG_SET_MSG(diag, "Data set block size is too small for variable records: %d < %d (LRECL + 4)", block_size, ioc->dcb.dcblrecl + sizeof(BDW));
diag->detail_rc = ZDS_RTNCD_INVALID_BLOCK_SIZE;
return RTNCD_FAILURE;
}
Expand All @@ -263,7 +263,7 @@
{
diag->service_rc = rc;
strcpy(diag->service_name, "NOTE");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to NOTE ddname: %8.8s data set: %44.44s rc was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rc);
ZDIAG_SET_MSG(diag, "Failed to NOTE ddname: %8.8s data set: %44.44s rc was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rc);
diag->detail_rc = ZDS_RTNCD_NOTE_ERROR;
}
}
Expand Down Expand Up @@ -303,7 +303,7 @@
{
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
strcpy(diag->service_name, "MODCB");
diag->e_msg_len = sprintf(diag->e_msg, "MODCB failed rc was: %d rsn was: %d", rc, rsn);
ZDIAG_SET_MSG(diag, "MODCB failed rc was: %d rsn was: %d", rc, rsn);
diag->service_rc = rc;
diag->service_rsn = rsn;
return RTNCD_FAILURE;
Expand All @@ -314,7 +314,7 @@
{
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
strcpy(diag->service_name, "OPEN");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to open acb rc was: %d", rc);
ZDIAG_SET_MSG(diag, "Failed to open acb rc was: %d", rc);
diag->service_rc = rc;
return RTNCD_FAILURE;
}
Expand All @@ -341,7 +341,7 @@
{
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
strcpy(diag->service_name, "CONVTOD");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to CONVTOD rc was: %d", rc);
ZDIAG_SET_MSG(diag, "Failed to CONVTOD rc was: %d", rc);
diag->service_rc = rc;
return rc;
}
Expand All @@ -358,7 +358,7 @@
{
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
strcpy(diag->service_name, "POINT");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to POINT rc was: %d", rc);
ZDIAG_SET_MSG(diag, "Failed to POINT rc was: %d", rc);
diag->service_rc = rc;
return rc;
}
Expand Down Expand Up @@ -392,7 +392,7 @@
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
strcpy(diag->service_name, "GET");
memcpy(rplrdbk, &rplp->rplfdbwd.rplfdbk, sizeof(rplrdbk));
diag->e_msg_len = sprintf(diag->e_msg, "Failed to GET rc was: %d, RPLRDBK was: %02X%02X%02X", rc, rplrdbk[0], rplrdbk[1], rplrdbk[2]);
ZDIAG_SET_MSG(diag, "Failed to GET rc was: %d, RPLRDBK was: %02X%02X%02X", rc, rplrdbk[0], rplrdbk[1], rplrdbk[2]);
diag->service_rc = rc;
return rc;
}
Expand All @@ -410,7 +410,7 @@
{
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
strcpy(diag->service_name, "CLOSE");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to close acb rc was: %d", rc);
ZDIAG_SET_MSG(diag, "Failed to close acb rc was: %d", rc);
diag->service_rc = rc;
return RTNCD_FAILURE;
}
Expand Down Expand Up @@ -454,7 +454,7 @@
{
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
strcpy(diag->service_name, "RDJFCB");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to read output JFCB rc was: %d", rc);
ZDIAG_SET_MSG(diag, "Failed to read output JFCB rc was: %d", rc);
diag->service_rc = rc;
return RTNCD_FAILURE;
}
Expand Down Expand Up @@ -559,7 +559,7 @@

if (0 != rc)
{
diag->e_msg_len = sprintf(diag->e_msg, "Failed to write record rc was: %d", rc);
ZDIAG_SET_MSG(diag, "Failed to write record rc was: %d", rc);
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
diag->service_rc = rc;
return RTNCD_FAILURE;
Expand Down Expand Up @@ -607,7 +607,7 @@

if (0 != rc)
{
diag->e_msg_len = sprintf(diag->e_msg, "Failed to write record rc was: %d", rc);
ZDIAG_SET_MSG(diag, "Failed to write record rc was: %d", rc);
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
diag->service_rc = rc;
return RTNCD_FAILURE;
Expand All @@ -626,7 +626,8 @@
ioc->lines_written++;
RDW *PTR32 rdw_ptr = (RDW * PTR32) ioc->free_location;
rdw_ptr->unused = 0;
rdw_ptr->len = sprintf(ioc->free_location + sizeof(RDW), "%.*s", length, data) + sizeof(RDW);
memcpy(ioc->free_location + sizeof(RDW), data, length);
rdw_ptr->len = length + sizeof(RDW);
ioc->bytes_in_buffer += rdw_ptr->len;
ioc->free_location += rdw_ptr->len;
}
Expand Down Expand Up @@ -736,7 +737,7 @@

if (0 != rc)
{
diag->e_msg_len = sprintf(diag->e_msg, "Failed to write record rc was: %d", rc);
ZDIAG_SET_MSG(diag, "Failed to write record rc was: %d", rc);
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
diag->service_rc = rc;
return RTNCD_FAILURE;
Expand All @@ -763,7 +764,7 @@
{
diag->service_rc = rc;
strcpy(diag->service_name, "BLDL");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to BLDL ddname: %8.8s data set: %44.44s rc was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rc);
ZDIAG_SET_MSG(diag, "Failed to BLDL ddname: %8.8s data set: %44.44s rc was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rc);
diag->detail_rc = ZDS_RTNCD_BLDL_ERROR;
}
return rc;
Expand Down Expand Up @@ -818,7 +819,7 @@
rc = zutm1gur(user);
if (0 != rc)
{
diag->e_msg_len = sprintf(diag->e_msg, "Failed to get userid rc was: %d", rc);
ZDIAG_SET_MSG(diag, "Failed to get userid rc was: %d", rc);
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
diag->service_rc = rc;
return RTNCD_FAILURE;
Expand Down Expand Up @@ -868,7 +869,7 @@
rc = zutm1gur(user);
if (0 != rc)
{
diag->e_msg_len = sprintf(diag->e_msg, "Failed to get userid rc was: %d", rc);
ZDIAG_SET_MSG(diag, "Failed to get userid rc was: %d", rc);
diag->detail_rc = ZDS_RTNCD_SERVICE_FAILURE;
diag->service_rc = rc;
return RTNCD_FAILURE;
Expand Down Expand Up @@ -922,7 +923,7 @@
{
diag->service_rc = rc;
strcpy(diag->service_name, "STOW");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to STOW ISPF statistics: %8.8s data set: %44.44s rsn was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rsn);
ZDIAG_SET_MSG(diag, "Failed to STOW ISPF statistics: %8.8s data set: %44.44s rsn was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rsn);
diag->detail_rc = ZDS_RTNCD_STOW_ERROR;
}
}
Expand All @@ -946,7 +947,7 @@
{
diag->service_rc = rc;
strcpy(diag->service_name, "CLOSE");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to close ddname: %8.8s data set: %44.44s rc was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rc);
ZDIAG_SET_MSG(diag, "Failed to close ddname: %8.8s data set: %44.44s rc was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rc);
diag->detail_rc = ZDS_RTNCD_CLOSE_ERROR;
}
}
Expand All @@ -969,7 +970,7 @@
{
diag->service_rc = rc;
strcpy(diag->service_name, "DEQ RESERVE");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to DEQ RESERVE ddname: %8.8s data set: %44.44s rc was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rc);
ZDIAG_SET_MSG(diag, "Failed to DEQ RESERVE ddname: %8.8s data set: %44.44s rc was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rc);
diag->detail_rc = ZDS_RTNCD_DEQ_RESERVE_ERROR;
}
return rc;
Expand All @@ -995,7 +996,7 @@
{
diag->service_rc = rc;
strcpy(diag->service_name, "DEQ");
diag->e_msg_len = sprintf(diag->e_msg, "Failed to DEQ ddname: %8.8s data set: %44.44s rc was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rc);
ZDIAG_SET_MSG(diag, "Failed to DEQ ddname: %8.8s data set: %44.44s rc was: %d", ioc->ddname, ioc->jfcb.jfcbdsnm, rc);
diag->detail_rc = ZDS_RTNCD_DEQ_ERROR;
}
}
Expand Down
1 change: 0 additions & 1 deletion native/c/zam24.s
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ENTRY24 DS 0H
OILH R15,X'8000' Set AMODE 31 bit for BASSM
LA R1,WORK -> IO_CTRL "work" field
BASSM 0,R15 Call ZAMDEXIT in AMODE 31
BR R14 Return to system
Comment thread
traeok marked this conversation as resolved.
*
CONSTANT DS 0D
LTORG ,
Expand Down
6 changes: 3 additions & 3 deletions native/c/zcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int zcn_activate(ZCN *zcn, const std::string &console_name)
int rc = 0;
zcn->diag.detail_rc = 0;

strcpy(zcn->eye, ZCN_EYE);
memcpy(zcn->eye, ZCN_EYE, sizeof(zcn->eye));

zut_uppercase_pad_truncate(zcn->console_name, console_name, sizeof(zcn->console_name));

Expand Down Expand Up @@ -56,7 +56,7 @@ int zcn_put(ZCN *zcn, const std::string &command)
char *command31 = (char *)__malloc31(command.length() + 1);
if (command31 == nullptr)
{
zcn->diag.e_msg_len = sprintf(zcn->diag.e_msg, "Failed to allocate 31-bit memory for command: %s", command.c_str());
ZDIAG_SET_MSG(&zcn->diag, "Failed to allocate 31-bit memory for command: %s", command.c_str());
return RTNCD_FAILURE;
}
memset(command31, 0x00, command.length() + 1);
Expand Down Expand Up @@ -86,7 +86,7 @@ int zcn_get(ZCN *zcn, std::string &response)
char *resp31 = (char *)__malloc31(zcn->buffer_size);
if (resp31 == nullptr)
{
zcn->diag.e_msg_len = sprintf(zcn->diag.e_msg, "Failed to allocate 31-bit memory for response");
ZDIAG_SET_MSG(&zcn->diag, "Failed to allocate 31-bit memory for response");
return RTNCD_FAILURE;
}
memset(resp31, 0x00, zcn->buffer_size);
Expand Down
16 changes: 8 additions & 8 deletions native/c/zcnm.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int ZCNACT(ZCN *zcn)
if (0 != rc)
{
strcpy(zcn->diag.service_name, "TESTAUTH");
zcn->diag.e_msg_len = sprintf(zcn->diag.e_msg, "Not authorized - %d", rc);
ZDIAG_SET_MSG(&zcn->diag, "Not authorized - %d", rc);
zcn->diag.detail_rc = ZCN_RTNCD_NOT_AUTH;
return RTNCD_FAILURE;
}
Expand All @@ -42,7 +42,7 @@ int ZCNACT(ZCN *zcn)
memcpy(zcn, &zcn31, sizeof(ZCN));
if (0 != rc)
{
zcn->diag.e_msg_len = sprintf(zcn->diag.e_msg, "Error activating console, service: %s, rc: %d, service_rc: %d, service_rsn: %d", zcn->diag.service_name, rc, zcn->diag.service_rc, zcn->diag.service_rsn);
ZDIAG_SET_MSG(&zcn->diag, "Error activating console, service: %.16s, rc: %d, service_rc: %d, service_rsn: %d", zcn->diag.service_name, rc, zcn->diag.service_rc, zcn->diag.service_rsn);
rc = RTNCD_FAILURE;
}
}
Expand All @@ -67,7 +67,7 @@ int ZCNPUT(ZCN *zcn, const char *command)
if (0 != rc)
{
strcpy(zcn->diag.service_name, "TESTAUTH");
zcn->diag.e_msg_len = sprintf(zcn->diag.e_msg, "Not authorized - %d", rc);
ZDIAG_SET_MSG(&zcn->diag, "Not authorized - %d", rc);
zcn->diag.detail_rc = ZCN_RTNCD_NOT_AUTH;
return RTNCD_FAILURE;
}
Expand All @@ -79,7 +79,7 @@ int ZCNPUT(ZCN *zcn, const char *command)

if (0 != rc)
{
zcn->diag.e_msg_len = sprintf(zcn->diag.e_msg, "Error writting data to console, service: %s, rc: %d, service_rc: %d, service_rsn: %d", zcn->diag.service_name, rc, zcn->diag.service_rc, zcn->diag.service_rsn);
ZDIAG_SET_MSG(&zcn->diag, "Error writting data to console, service: %.16s, rc: %d, service_rc: %d, service_rsn: %d", zcn->diag.service_name, rc, zcn->diag.service_rc, zcn->diag.service_rsn);
return RTNCD_FAILURE;
}

Expand Down Expand Up @@ -120,7 +120,7 @@ int ZCNGET(ZCN *zcn, char *response)
if (0 != rc)
{
strcpy(zcn->diag.service_name, "TESTAUTH");
zcn->diag.e_msg_len = sprintf(zcn->diag.e_msg, "Not authorized - %d", rc);
ZDIAG_SET_MSG(&zcn->diag, "Not authorized - %d", rc);
zcn->diag.detail_rc = ZCN_RTNCD_NOT_AUTH;
return RTNCD_FAILURE;
}
Expand All @@ -140,7 +140,7 @@ int ZCNGET(ZCN *zcn, char *response)

if (0 != rc)
{
zcn->diag.e_msg_len = sprintf(zcn->diag.e_msg, "Error getting data from console, service: %s, rc: %d, service_rc: %d, service_rsn: %d", zcn->diag.service_name, rc, zcn->diag.service_rc, zcn->diag.service_rsn);
ZDIAG_SET_MSG(&zcn->diag, "Error getting data from console, service: %.16s, rc: %d, service_rc: %d, service_rsn: %d", zcn->diag.service_name, rc, zcn->diag.service_rc, zcn->diag.service_rsn);
return RTNCD_FAILURE;
}

Expand All @@ -157,7 +157,7 @@ int ZCNDACT(ZCN *zcn)
if (0 != rc)
{
strcpy(zcn->diag.service_name, "TESTAUTH");
zcn->diag.e_msg_len = sprintf(zcn->diag.e_msg, "Not authorized - %d", rc);
ZDIAG_SET_MSG(&zcn->diag, "Not authorized - %d", rc);
zcn->diag.detail_rc = ZCN_RTNCD_NOT_AUTH;
return RTNCD_FAILURE;
}
Expand All @@ -169,7 +169,7 @@ int ZCNDACT(ZCN *zcn)

if (0 != rc)
{
zcn->diag.e_msg_len = sprintf(zcn->diag.e_msg, "Error deactivating console, service: %s, rc: %d, service_rc: %d, service_rsn: %d", zcn->diag.service_name, rc, zcn->diag.service_rc, zcn->diag.service_rsn);
ZDIAG_SET_MSG(&zcn->diag, "Error deactivating console, service: %.16s, rc: %d, service_rc: %d, service_rsn: %d", zcn->diag.service_name, rc, zcn->diag.service_rc, zcn->diag.service_rsn);
return RTNCD_FAILURE;
}

Expand Down
Loading
Loading