Skip to content

Commit a0972b8

Browse files
authored
Merge pull request #1159 from adg-mh/apr-rename
Use `apr_file_rename()` in `oidc_cache_file_set()` for compatiblity on windows
2 parents fbef7a9 + 2216186 commit a0972b8

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,5 @@ reporting bugs, providing fixes, suggesting useful features or other:
9090
Mads Freek Petersen <https://github.com/madsfreek>
9191
Stefan Richter <https://github.com/sealor>
9292
Mattias Åsander <https://github.com/mattias-asander>
93+
adg-mh <https://github.com/adg-mh>
9394

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
01/17/2024
2+
- use `apr_file_rename` in file backend to fix issue with renaming files on windows
3+
14
01/09/2024
25
- release 2.4.15
36

src/cache/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static apr_byte_t oidc_cache_file_set(request_rec *r, const char *section, const
408408
apr_file_unlock(fd);
409409
apr_file_close(fd);
410410

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

0 commit comments

Comments
 (0)