Skip to content

Commit

Permalink
Merge pull request #1159 from adg-mh/apr-rename
Browse files Browse the repository at this point in the history
Use `apr_file_rename()` in `oidc_cache_file_set()` for compatiblity on windows
  • Loading branch information
zandbelt authored Jan 17, 2024
2 parents fbef7a9 + 2216186 commit a0972b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ reporting bugs, providing fixes, suggesting useful features or other:
Mads Freek Petersen <https://github.com/madsfreek>
Stefan Richter <https://github.com/sealor>
Mattias Åsander <https://github.com/mattias-asander>
adg-mh <https://github.com/adg-mh>

3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
01/17/2024
- use `apr_file_rename` in file backend to fix issue with renaming files on windows

01/09/2024
- release 2.4.15

Expand Down
2 changes: 1 addition & 1 deletion src/cache/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ static apr_byte_t oidc_cache_file_set(request_rec *r, const char *section, const
apr_file_unlock(fd);
apr_file_close(fd);

if (rename(path, target) != 0) {
if ((rc = apr_file_rename(path, target, r->pool)) != APR_SUCCESS) {
oidc_error(r, "cache file: %s could not be renamed to: %s", path, target);
return FALSE;
}
Expand Down

0 comments on commit a0972b8

Please sign in to comment.