Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Sambruk/EgilSCIM
Browse files Browse the repository at this point in the history
  • Loading branch information
joesiltberg committed Mar 14, 2024
2 parents 6aa131f + 48269da commit 0b6cd86
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Releases

## Unreleased
#### Bugfixes
- In the Windows version a heap corruption problem was fixed in the LDAP code (#211)

## v2.17.0 (2024-02-27)
#### Features
- Built-in support for converting national test activity names to UUIDs (#206)
Expand Down
4 changes: 2 additions & 2 deletions src/config_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class config_file {
return theconfigfile;
}

const char *file_name() {
return filename.u8string().c_str();
std::string file_name_str() {
return filename.u8string();
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/config_file_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ int config_parser::rule_comment() {

void config_parser::syntax_error(const std::string &str) {
/** Set prefix */
simplescim_error_string_set_prefix("%s:%lu:%lu:syntax error", config_file::instance().file_name(),
auto config = config_file::instance().file_name_str();
simplescim_error_string_set_prefix("%s:%lu:%lu:syntax error", config.c_str(),
line, col);

/** Set message */
Expand All @@ -278,7 +279,8 @@ void config_parser::syntax_error(const std::string &str) {

void config_parser::syntax_error_expected(const std::string &str) {
/** Set prefix */
simplescim_error_string_set_prefix("%s:%lu:%lu:syntax error", config_file::instance().file_name(),
auto config = config_file::instance().file_name_str();
simplescim_error_string_set_prefix("%s:%lu:%lu:syntax error", config.c_str(),
line, col);

/** Set message */
Expand Down
2 changes: 1 addition & 1 deletion src/ldap_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int ldap_search_ext_s_utf8(
int n = MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, attrs[i], (int)strlen(attrs[i]), wattrs[i], buffer_size);
wattrs[i][n] = 0;
}
wattrs[num_attrs] = nullptr;
wattrs.push_back(nullptr);

return ldap_search_ext_sW(ld, base_buffer, scope,
filter_buffer,
Expand Down
4 changes: 2 additions & 2 deletions src/load_limiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ std::shared_ptr<load_limiter> get_limiter(const std::string& type) {
static std::string current_config;
static std::map<std::string, std::shared_ptr<load_limiter>> limiters;

if (conf.file_name() != current_config) {
if (conf.file_name_str() != current_config) {
limiters.clear();
current_config = conf.file_name();
current_config = conf.file_name_str();
}

if (limiters.find(type) == limiters.end()) {
Expand Down
6 changes: 4 additions & 2 deletions src/simplescim_ldap_attrs_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ class Parser {
* according to global 'parser' object and 'str'.
*/
void syntax_error(const std::string &str) {
auto config = config_file::instance().file_name_str();
simplescim_error_string_set_prefix(
"%s:ldap-attrs:%lu:%lu:syntax error", config_file::instance().file_name(),
"%s:ldap-attrs:%lu:%lu:syntax error", config.c_str(),
line, col);
simplescim_error_string_set_message("%s", str.c_str()
);
Expand All @@ -64,8 +65,9 @@ class Parser {
* when the error is of type "expected x, found y".
*/
void syntax_error_expected(const std::string &str) {
auto config = config_file::instance().file_name_str();
simplescim_error_string_set_prefix(
"%s:ldap-attrs:%lu:%lu:syntax error", config_file::instance().file_name(),
"%s:ldap-attrs:%lu:%lu:syntax error", config.c_str(),
line, col);

if (isprint(*cur)) {
Expand Down

0 comments on commit 0b6cd86

Please sign in to comment.