Description: Fix for compile error "format not a string literal and no format arguments" Author: Tobias Frost --- a/plugin/auth_file/auth_file.cc +++ b/plugin/auth_file/auth_file.cc @@ -235,7 +235,7 @@ if (!file.is_open()) { string error_msg= "Could not open users file: " + new_users_file; - errmsg_printf(error::ERROR, _(error_msg.c_str())); + errmsg_printf(error::ERROR, "%s", _(error_msg.c_str())); return false; } @@ -262,7 +262,7 @@ if (not users_dummy.insert(pair(username, password)).second) { string error_msg= "Duplicate entry found in users file: " + username; - errmsg_printf(error::ERROR, _(error_msg.c_str())); + errmsg_printf(error::ERROR, "%s", _(error_msg.c_str())); return false; } } @@ -272,7 +272,7 @@ { /* On any non-EOF break, unparseable line */ string error_msg= "Unable to parse users file " + new_users_file + ":" + e.what(); - errmsg_printf(error::ERROR, _(error_msg.c_str())); + errmsg_printf(error::ERROR, "%s", _(error_msg.c_str())); return false; } } --- a/plugin/regex_policy/module.cc +++ b/plugin/regex_policy/module.cc @@ -85,14 +85,14 @@ } catch (const std::exception &e) { - errmsg_printf(error::ERROR, _(e.what())); + errmsg_printf(error::ERROR, "%s", _(e.what())); return false; } if (! file.is_open()) { string error_msg= "Unable to open regex policy file: " + new_policy_file; - errmsg_printf(error::ERROR, _(error_msg.c_str())); + errmsg_printf(error::ERROR, "%s", _(error_msg.c_str())); return false; } @@ -138,7 +138,7 @@ catch (const std::exception &e) { string error_msg= "Bad policy item: user=" + user_regex + " object=" + object_regex + " action=" + action; - errmsg_printf(error::ERROR, _(error_msg.c_str())); + errmsg_printf(error::ERROR, "%s", _(error_msg.c_str())); throw std::exception(); } } @@ -148,7 +148,7 @@ { /* On any non-EOF break, unparseable line */ string error_msg= "Unable to parse policy file " + new_policy_file + ":" + e.what(); - errmsg_printf(error::ERROR, _(error_msg.c_str())); + errmsg_printf(error::ERROR, "%s", _(error_msg.c_str())); return false; }