}
}
+std::string escape_cql_term(std::string inp)
+{
+ std::string res;
+ size_t l = inp.length();
+ size_t i;
+ for (i = 0; i < l; i++)
+ {
+ if (strchr("*?^\"", inp[i]))
+ res += "\\";
+ res += inp[i];
+ }
+ return res;
+}
+
void yf::Zoom::Frontend::auth(mp::Package &package, Z_InitRequest *req,
int *error, char **addinfo, ODR odr)
{
if (user.length() && password.length())
{
- torus_query = "userName==" + user + " and password==" + password;
+ torus_query = "userName==\"" + escape_cql_term(user) +
+ "\" and password==\"" + escape_cql_term(password) + "\"";
}
else
{
ip_cstr = cp + 1;
torus_query = "ip encloses/net.ipaddress \"";
- torus_query += ip_cstr;
+ torus_query += escape_cql_term(std::string(ip_cstr));
torus_query += "\"";
}