mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
only allow a-z A-Z 0-9 - _ [ ] # as channel name characters
This commit is contained in:
parent
7bea2bc0e6
commit
3db32b03d4
|
@ -106,7 +106,6 @@ if(BUILD_FAIRMQ OR BUILD_SDK)
|
||||||
container
|
container
|
||||||
program_options
|
program_options
|
||||||
filesystem
|
filesystem
|
||||||
regex
|
|
||||||
date_time
|
date_time
|
||||||
regex
|
regex
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp> // join/split
|
#include <boost/algorithm/string.hpp> // join/split
|
||||||
|
|
||||||
|
#include <regex>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
|
@ -480,9 +481,11 @@ try {
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate channel name
|
// validate channel name
|
||||||
if (fName.find(".") != string::npos) {
|
smatch m;
|
||||||
|
if (regex_search(fName, m, regex("[^a-zA-Z0-9\\-_\\[\\]#]"))) {
|
||||||
ss << "INVALID";
|
ss << "INVALID";
|
||||||
LOG(error) << "channel name must not contain '.'";
|
LOG(debug) << ss.str();
|
||||||
|
LOG(error) << "channel name contains illegal character: '" << m.str(0) << "', allowed characters are: a-z, A-Z, 0-9, -, _, [, ], #";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user