-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new zss /jes end point for submitting jcl to jes #402
Open
joepun76
wants to merge
16
commits into
zowe:v2.x/staging
Choose a base branch
from
joepun76:jesSubmit
base: v2.x/staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5e3aa0e
initial
joepun76 1afc9d2
Update pointer
1000TurquoisePogs e76fe2b
configure log component
aditya-ranshinge 386d49c
Merge pull request #432 from zowe/bugfix/json-debug-v1
1000TurquoisePogs 3a28c7e
Merge branch 'v1.x/staging' into users/aditya/feature/replace-printf-…
1000TurquoisePogs c67a66d
Merge pull request #436 from zowe/users/aditya/feature/replace-printf…
1000TurquoisePogs f28dffd
Merge branch 'zowe:v1.x/staging' into jesSubmit
joepun76 9119986
Merge V2
ojcelis bbd29cc
Updated and addressed review points related to PR402
ojcelis be6a01e
Merge branch 'zowe:v2.x/staging' into jesSubmit
ojcelis 930c92f
update submodule to the latest
ojcelis cb38205
Addressed additional review points
ojcelis 436d3ef
Merge v2.x/staging to jesSubmit branch
ojcelis 4306e49
fixed issue with 64 bit
ojcelis 4b02de5
update zowe-common-c to the latest
ojcelis c966b6e
Merge branch 'zowe:v2.x/staging' into jesSubmit
ojcelis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,41 @@ | ||
|
||
/* | ||
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. | ||
*/ | ||
|
||
#ifdef METTLE | ||
/* HAS NOT BEEN COMPILED WITH METTLE BEFORE */ | ||
#error Metal C is not supported | ||
#else | ||
#include <stdbool.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need all these includes? For example, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed unnecessary includes |
||
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <stdlib.h> | ||
#include <stdarg.h> | ||
#include <sys/stat.h> | ||
#include "zowetypes.h" | ||
#include "alloc.h" | ||
#include "utils.h" | ||
#include "json.h" | ||
#include "bpxnet.h" | ||
#include "logging.h" | ||
#include "unixfile.h" | ||
#ifdef __ZOWE_OS_ZOS | ||
#include "zos.h" | ||
#endif | ||
|
||
#include "charsets.h" | ||
|
||
#include "socketmgmt.h" | ||
#include "httpserver.h" | ||
#include "datasetjson.h" | ||
#include "pdsutil.h" | ||
#include "jcsi.h" | ||
#include "impersonation.h" | ||
#include "dynalloc.h" | ||
#include "utils.h" | ||
#include "vsam.h" | ||
#include "qsam.h" | ||
#include "icsf.h" | ||
|
||
|
||
|
||
#include "dsutils.h" | ||
|
||
|
||
#ifdef __ZOWE_OS_ZOS | ||
/* | ||
Dataset only, no wildcards or pds members accepted - beware that this should be wrapped with authentication | ||
*/ | ||
int getVolserForDataset(const DatasetName *dataset, Volser *volser) { | ||
int dsutilsGetVolserForDataset(const DatasetName *dataset, Volser *volser) { | ||
if (dataset == NULL){ | ||
return -1; | ||
} | ||
|
@@ -91,7 +84,7 @@ int getVolserForDataset(const DatasetName *dataset, Volser *volser) { | |
return rc; | ||
} | ||
|
||
char getRecordLengthType(char *dscb){ | ||
char dsutilsGetRecordLengthType(char *dscb){ | ||
int posOffset = 44; | ||
int recfm = dscb[84 - posOffset]; | ||
if ((recfm & 0xc0) == 0xc0){ | ||
|
@@ -105,13 +98,13 @@ char getRecordLengthType(char *dscb){ | |
} | ||
} | ||
|
||
int getMaxRecordLength(char *dscb){ | ||
int dsutilsGetMaxRecordLength(char *dscb){ | ||
int posOffset = 44; | ||
int lrecl = (dscb[88-posOffset] << 8) | dscb[89-posOffset]; | ||
return lrecl; | ||
} | ||
|
||
int obtainDSCB1(const char *dsname, unsigned int dsnameLength, | ||
int dsutilsObtainDSCB1(const char *dsname, unsigned int dsnameLength, | ||
const char *volser, unsigned int volserLength, | ||
char *dscb1) { | ||
|
||
|
@@ -179,7 +172,7 @@ int obtainDSCB1(const char *dsname, unsigned int dsnameLength, | |
} | ||
|
||
|
||
int getLreclOrRespondError(HttpResponse *response, | ||
int dsutilsGetLreclOrRespondError(HttpResponse *response, | ||
const DatasetName *dsn, | ||
const char *ddPath){ | ||
|
||
|
@@ -190,20 +183,20 @@ int getLreclOrRespondError(HttpResponse *response, | |
int reasonCode; | ||
FILE *in = fopen(ddPath, "r"); | ||
if (in == NULL) { | ||
respondWithError(response,HTTP_STATUS_NOT_FOUND,"File could not be opened or does not exist"); | ||
respondWithError(response, HTTP_STATUS_NOT_FOUND, "File could not be opened or does not exist"); | ||
return 0; | ||
} | ||
|
||
Volser volser; | ||
memset(&volser.value, ' ', sizeof(volser.value)); | ||
|
||
int volserSuccess = getVolserForDataset(dsn, &volser); | ||
int volserSuccess = dsutilsGetVolserForDataset(dsn, &volser); | ||
int handledThroughDSCB = FALSE; | ||
|
||
if (!volserSuccess){ | ||
|
||
char dscb[INDEXED_DSCB] = {0}; | ||
int rc = obtainDSCB1(dsn->value, sizeof(dsn->value), | ||
int rc = dsutilsObtainDSCB1(dsn->value, sizeof(dsn->value), | ||
volser.value, sizeof(volser.value), | ||
dscb); | ||
if (rc == 0){ | ||
|
@@ -212,8 +205,8 @@ int getLreclOrRespondError(HttpResponse *response, | |
dumpbuffer(dscb,INDEXED_DSCB); | ||
} | ||
|
||
lrecl = getMaxRecordLength(dscb); | ||
char recordType = getRecordLengthType(dscb); | ||
lrecl = dsutilsGetMaxRecordLength(dscb); | ||
char recordType = dsutilsGetRecordLengthType(dscb); | ||
if (recordType == 'U'){ | ||
fclose(in); | ||
respondWithError(response, HTTP_STATUS_BAD_REQUEST,"Undefined-length dataset"); | ||
|
@@ -251,7 +244,7 @@ int getLreclOrRespondError(HttpResponse *response, | |
#define DSPATH_PREFIX "//\'" | ||
#define DSPATH_SUFFIX "\'" | ||
|
||
bool isDatasetPathValid(const char *path) { | ||
bool dsutilsIsDatasetPathValid(const char *path) { | ||
|
||
/* Basic check. The fopen() dataset path format is //'dsn(member)' */ | ||
|
||
|
@@ -340,7 +333,7 @@ bool isDatasetPathValid(const char *path) { | |
#define DSPATH_PREFIX "//\'" | ||
#define DSPATH_SUFFIX "\'" | ||
|
||
void extractDatasetAndMemberName(const char *datasetPath, | ||
void dsutilsExtractDatasetAndMemberName(const char *datasetPath, | ||
DatasetName *dsn, | ||
DatasetMemberName *memberName) { | ||
|
||
|
@@ -374,7 +367,7 @@ void extractDatasetAndMemberName(const char *datasetPath, | |
#undef DSPATH_PREFIX | ||
#undef DSPATH_SUFFIX | ||
|
||
void respondWithDYNALLOCError(HttpResponse *response, | ||
void dsutilsRespondWithDYNALLOCError(HttpResponse *response, | ||
int rc, int sysRC, int sysRSN, | ||
const DynallocDatasetName *dsn, | ||
const DynallocMemberName *member, | ||
|
@@ -415,3 +408,13 @@ void respondWithDYNALLOCError(HttpResponse *response, | |
#endif /* __ZOWE_OS_ZOS */ | ||
|
||
#endif /* not METTLE - the whole module */ | ||
|
||
/* | ||
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. | ||
*/ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file needs the copyright at the top and at the bottom (and any others without one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included copyright at the top and at the bottom