| 498 | } |
| 499 | |
| 500 | apr_status_t md_text_fcreatex(const char *fpath, apr_fileperms_t perms, |
| 501 | apr_pool_t *p, const char *text) |
| 502 | { |
| 503 | apr_status_t rv; |
| 504 | apr_file_t *f; |
| 505 | |
| 506 | rv = md_util_fcreatex(&f, fpath, perms, p); |
| 507 | if (APR_SUCCESS == rv) { |
| 508 | rv = write_text((void*)text, f, p); |
| 509 | apr_file_close(f); |
| 510 | /* See <https://github.com/icing/mod_md/issues/117>: when a umask |
| 511 | * is set, files need to be assigned permissions explicitly. |
| 512 | * Otherwise, as in the issues reported, it will break our access model. */ |
| 513 | rv = apr_file_perms_set(fpath, perms); |
| 514 | if (APR_STATUS_IS_ENOTIMPL(rv)) { |
| 515 | rv = APR_SUCCESS; |
| 516 | } |
| 517 | } |
| 518 | return rv; |
| 519 | } |
| 520 | |
| 521 | apr_status_t md_text_freplace(const char *fpath, apr_fileperms_t perms, |
| 522 | apr_pool_t *p, const char *text) |
no test coverage detected