- bug fix: strtolower(argv[1]) removed
This commit is contained in:
52
exeman.c
52
exeman.c
@ -506,7 +506,7 @@ static int handleBatchPath(pExeMan self, SConnection * pCon, int argc,
|
|||||||
{
|
{
|
||||||
char pBuffer[1024];
|
char pBuffer[1024];
|
||||||
|
|
||||||
if (strcmp(argv[1], "batchpath") == 0) {
|
if (strcasecmp(argv[1], "batchpath") == 0) {
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
if (!SCMatchRights(pCon, usUser)) {
|
if (!SCMatchRights(pCon, usUser)) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -529,7 +529,7 @@ static int handleBatchPath(pExeMan self, SConnection * pCon, int argc,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strcmp(argv[1], "syspath") == 0) {
|
if (strcasecmp(argv[1], "syspath") == 0) {
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
if (!SCMatchRights(pCon, usMugger)) {
|
if (!SCMatchRights(pCon, usMugger)) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -1108,14 +1108,17 @@ static int infoHandler(pExeMan self, SConnection * pCon,
|
|||||||
SCWrite(pCon, "Nothing to execute", eValue);
|
SCWrite(pCon, "Nothing to execute", eValue);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
|
/*
|
||||||
|
argv must no be modifed, use strcasecmp instead M.Z.
|
||||||
strtolower(argv[2]);
|
strtolower(argv[2]);
|
||||||
if (strcmp(argv[2], "stack") == 0) {
|
*/
|
||||||
|
if (strcasecmp(argv[2], "stack") == 0) {
|
||||||
printExeStack(self, pCon);
|
printExeStack(self, pCon);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strcmp(argv[2], "range") == 0) {
|
} else if (strcasecmp(argv[2], "range") == 0) {
|
||||||
printExeRange(self, pCon, argc, argv);
|
printExeRange(self, pCon, argc, argv);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strcmp(argv[2], "text") == 0) {
|
} else if (strcasecmp(argv[2], "text") == 0) {
|
||||||
printExeText(self, pCon, argc, argv);
|
printExeText(self, pCon, argc, argv);
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
@ -1300,62 +1303,65 @@ int ExeManagerWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
strlcpy(pBufferName, argv[1], 255);
|
strlcpy(pBufferName, argv[1], 255);
|
||||||
|
/*
|
||||||
|
argv must no be modifed, use strcasecmp instead M.Z.
|
||||||
strtolower(argv[1]);
|
strtolower(argv[1]);
|
||||||
|
*/
|
||||||
status = handleBatchPath(self, pCon, argc, argv);
|
status = handleBatchPath(self, pCon, argc, argv);
|
||||||
if (status >= 0) {
|
if (status >= 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
if (strcmp(argv[1], "interest") == 0) {
|
if (strcasecmp(argv[1], "interest") == 0) {
|
||||||
registerCallbacks(pCon, pSics, self);
|
registerCallbacks(pCon, pSics, self);
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strcmp(argv[1], "uninterest") == 0) {
|
} else if (strcasecmp(argv[1], "uninterest") == 0) {
|
||||||
unregisterCallbacks(pCon, self);
|
unregisterCallbacks(pCon, self);
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strcmp(argv[1], "upload") == 0) {
|
} else if (strcasecmp(argv[1], "upload") == 0) {
|
||||||
status = startUpload(self, pCon);
|
status = startUpload(self, pCon);
|
||||||
if (status) {
|
if (status) {
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else if (strcmp(argv[1], "append") == 0) {
|
} else if (strcasecmp(argv[1], "append") == 0) {
|
||||||
status = appendLine(self, pCon, argc, argv);
|
status = appendLine(self, pCon, argc, argv);
|
||||||
if (status) {
|
if (status) {
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else if (strcmp(argv[1], "save") == 0) {
|
} else if (strcasecmp(argv[1], "save") == 0) {
|
||||||
status = uploadSave(self, pCon, argc, argv);
|
status = uploadSave(self, pCon, argc, argv);
|
||||||
if (status) {
|
if (status) {
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else if (strcmp(argv[1], "forcesave") == 0) {
|
} else if (strcasecmp(argv[1], "forcesave") == 0) {
|
||||||
status = uploadForceSave(self, pCon, argc, argv);
|
status = uploadForceSave(self, pCon, argc, argv);
|
||||||
if (status) {
|
if (status) {
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else if (strcmp(argv[1], "clearupload") == 0) {
|
} else if (strcasecmp(argv[1], "clearupload") == 0) {
|
||||||
status = clearUpload(self, pCon);
|
status = clearUpload(self, pCon);
|
||||||
if (status) {
|
if (status) {
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else if (strcmp(argv[1], "info") == 0) {
|
} else if (strcasecmp(argv[1], "info") == 0) {
|
||||||
status = infoHandler(self, pCon, argc, argv);
|
status = infoHandler(self, pCon, argc, argv);
|
||||||
return status;
|
return status;
|
||||||
} else if (strcmp(argv[1], "print") == 0) {
|
} else if (strcasecmp(argv[1], "print") == 0) {
|
||||||
status = printBuffer(self, pCon, argc, argv);
|
status = printBuffer(self, pCon, argc, argv);
|
||||||
return status;
|
return status;
|
||||||
} else if (strcmp(argv[1], "enqueue") == 0) {
|
} else if (strcasecmp(argv[1], "enqueue") == 0) {
|
||||||
status = enqueueBuffer(self, pCon, argc, argv);
|
status = enqueueBuffer(self, pCon, argc, argv);
|
||||||
if (status) {
|
if (status) {
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else if (strcmp(argv[1], "dir") == 0) {
|
} else if (strcasecmp(argv[1], "dir") == 0) {
|
||||||
if (argc <= 2) {
|
if (argc <= 2) {
|
||||||
dirList = findDirEntries(self, "*");
|
dirList = findDirEntries(self, "*");
|
||||||
} else {
|
} else {
|
||||||
@ -1368,7 +1374,7 @@ int ExeManagerWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
SCWrite(pCon, "Nothing found", eValue);
|
SCWrite(pCon, "Nothing found", eValue);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strcmp(argv[1], "fullpath") == 0) {
|
} else if (strcasecmp(argv[1], "fullpath") == 0) {
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
SCWrite(pCon, "ERROR: not enough arguments to exe fullpath",
|
SCWrite(pCon, "ERROR: not enough arguments to exe fullpath",
|
||||||
eError);
|
eError);
|
||||||
@ -1385,23 +1391,23 @@ int ExeManagerWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strcmp(argv[1], "makepath") == 0) {
|
} else if (strcasecmp(argv[1], "makepath") == 0) {
|
||||||
return makeExePath(self, pCon, argc, argv);
|
return makeExePath(self, pCon, argc, argv);
|
||||||
} else if (strcmp(argv[1], "clear") == 0) {
|
} else if (strcasecmp(argv[1], "clear") == 0) {
|
||||||
clearQueue(self);
|
clearQueue(self);
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strcmp(argv[1], "queue") == 0) {
|
} else if (strcasecmp(argv[1], "queue") == 0) {
|
||||||
printQueue(self, pCon);
|
printQueue(self, pCon);
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strcmp(argv[1], "run") == 0) {
|
} else if (strcasecmp(argv[1], "run") == 0) {
|
||||||
status = execQueue(self, pCon, pSics);
|
status = execQueue(self, pCon, pSics);
|
||||||
if (status) {
|
if (status) {
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} else if (strcmp(argv[1], "echo") == 0) {
|
} else if (strcasecmp(argv[1], "echo") == 0) {
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
self->echo = atoi(argv[2]) != 0;
|
self->echo = atoi(argv[2]) != 0;
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
@ -1409,7 +1415,7 @@ int ExeManagerWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
SCPrintf(pCon, eValue, "exe echo = %d", self->echo);
|
SCPrintf(pCon, eValue, "exe echo = %d", self->echo);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} else if (strcmp(argv[1], "runhdb") == 0) {
|
} else if (strcasecmp(argv[1], "runhdb") == 0) {
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
SCWrite(pCon, "ERROR: require path to root of queue node", eError);
|
SCWrite(pCon, "ERROR: require path to root of queue node", eError);
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
|
Reference in New Issue
Block a user