Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/md_acme_acct.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,16 @@ static apr_status_t acct_find_and_verify(md_store_t *store, md_store_group_t gro
apr_status_t md_acme_find_acct_for_md(md_acme_t *acme, md_store_t *store, const md_t *md)
{
apr_status_t rv;
int max_retries = acme->max_retries;

while (APR_EAGAIN == (rv = acct_find_and_verify(store, MD_SG_ACCOUNTS,
mk_acct_pattern(acme->p, acme),
acme, md, acme->p))) {
/* nop */
if (max_retries == 0) {
break;
}

--max_retries;
}

if (APR_STATUS_IS_ENOENT(rv)) {
Expand Down
14 changes: 11 additions & 3 deletions src/md_store_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ static apr_status_t mk_group_dir(const char **pdir, md_store_fs_t *s_fs,
{
const perms_t *perms;
apr_status_t rv;
apr_finfo_t finfo;

perms = gperms(s_fs, group);

Expand All @@ -531,11 +532,18 @@ static apr_status_t mk_group_dir(const char **pdir, md_store_fs_t *s_fs,
dispatch(s_fs, MD_S_FS_EV_CREATED, group, *pdir, APR_DIR, p);
}

rv = apr_file_perms_set(*pdir, perms->dir);
md_log_perror(MD_LOG_MARK, MD_LOG_TRACE3, rv, p, "mk_group_dir %s perm set", *pdir);
if (APR_STATUS_IS_ENOTIMPL(rv)) {
if (APR_SUCCESS == apr_stat(&finfo, *pdir, APR_FINFO_PROT, p)
&& finfo.protection == perms->dir) {
/* the permissions are correct */
rv = APR_SUCCESS;
}
else {
rv = apr_file_perms_set(*pdir, perms->dir);
md_log_perror(MD_LOG_MARK, MD_LOG_TRACE3, rv, p, "mk_group_dir %s perm set", *pdir);
if (APR_STATUS_IS_ENOTIMPL(rv)) {
rv = APR_SUCCESS;
}
}
cleanup:
if (APR_SUCCESS != rv) {
md_log_perror(MD_LOG_MARK, MD_LOG_ERR, rv, p, "mk_group_dir %d %s",
Expand Down
Loading