check for module attached only when enabling veto streaming, not disabling

This commit is contained in:
2020-05-28 09:21:19 +02:00
parent 6189fd157a
commit d175ba0936

View File

@ -7455,23 +7455,23 @@ int set_veto(int file_des) {
// only set // only set
if (Server_VerifyLock() == OK) { if (Server_VerifyLock() == OK) {
// veto allowed only if module attached or in -nomodule mode // veto allowed only if module attached or in -nomodule mode
if (arg > 0) {
if (checkModuleFlag) { if (checkModuleFlag) {
int type_ret = checkDetectorType(); int type_ret = checkDetectorType();
if (type_ret == -1) { if (type_ret == -1) {
ret = FAIL; ret = FAIL;
sprintf( sprintf(mess, "Could not enable veto streaming. "
mess, "Could not open "
"Could not enable/disable veto streaming. Could not open "
"file to know if module attached.\n"); "file to know if module attached.\n");
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} else if (type_ret == -2) { } else if (type_ret == -2) {
ret = FAIL; ret = FAIL;
sprintf(mess, "Could not enable/disable veto streaming. No " sprintf(mess, "Could not enable veto streaming. No "
"module attached!\n"); "module attached!\n");
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} else if (type_ret == FAIL) { } else if (type_ret == FAIL) {
ret = FAIL; ret = FAIL;
sprintf(mess, "Could not enable/disable veto streaming. Wrong " sprintf(mess, "Could not enable veto streaming. Wrong "
"module type " "module type "
"attached!\n"); "attached!\n");
LOG(logERROR, (mess)); LOG(logERROR, (mess));
@ -7479,7 +7479,8 @@ int set_veto(int file_des) {
} else { } else {
LOG(logINFOBLUE, LOG(logINFOBLUE,
("In No-Module mode: Ignoring module-attached check. " ("In No-Module mode: Ignoring module-attached check. "
"Continuing to enable/disable veto streaming.\n")); "Continuing to enable veto streaming.\n"));
}
} }
if (ret == OK) { if (ret == OK) {
setVeto(arg); setVeto(arg);