diff --git a/CMakeLists.txt b/CMakeLists.txt index 7961cacf..9187ef70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,7 +106,6 @@ if(BUILD_FAIRMQ OR BUILD_SDK) container program_options filesystem - regex date_time regex diff --git a/fairmq/FairMQChannel.cxx b/fairmq/FairMQChannel.cxx index f274368e..4ac4349a 100644 --- a/fairmq/FairMQChannel.cxx +++ b/fairmq/FairMQChannel.cxx @@ -11,6 +11,7 @@ #include // join/split +#include #include #include @@ -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; }