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