mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 00:31:14 +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
|
||||
program_options
|
||||
filesystem
|
||||
regex
|
||||
date_time
|
||||
regex
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <boost/algorithm/string.hpp> // join/split
|
||||
|
||||
#include <regex>
|
||||
#include <set>
|
||||
#include <random>
|
||||
|
||||
|
@ -480,9 +481,11 @@ try {
|
|||
}
|
||||
|
||||
// validate channel name
|
||||
if (fName.find(".") != string::npos) {
|
||||
smatch m;
|
||||
if (regex_search(fName, m, regex("[^a-zA-Z0-9\\-_\\[\\]#]"))) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user