mirror of
git://git.proxmox.com/git/proxmox-backup.git
synced 2025-01-08 21:18:07 +03:00
config: acme: use latest proxmox_sys::fs::ensure_dir_exists
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
parent
e5c0d80ca4
commit
e1a506a0d0
@ -27,19 +27,15 @@ fn root_only() -> CreateOptions {
|
|||||||
.perm(nix::sys::stat::Mode::from_bits_truncate(0o700))
|
.perm(nix::sys::stat::Mode::from_bits_truncate(0o700))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_acme_subdir(dir: &str) -> nix::Result<()> {
|
fn create_acme_subdir(dir: &str) -> Result<(), Error> {
|
||||||
match proxmox_sys::fs::create_dir(dir, root_only()) {
|
proxmox_sys::fs::ensure_dir_exists(dir, &root_only(), false)
|
||||||
Ok(()) => Ok(()),
|
|
||||||
Err(err) if err.already_exists() => Ok(()),
|
|
||||||
Err(err) => Err(err),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn make_acme_dir() -> nix::Result<()> {
|
pub(crate) fn make_acme_dir() -> Result<(), Error> {
|
||||||
create_acme_subdir(ACME_DIR)
|
create_acme_subdir(ACME_DIR)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn make_acme_account_dir() -> nix::Result<()> {
|
pub(crate) fn make_acme_account_dir() -> Result<(), Error> {
|
||||||
make_acme_dir()?;
|
make_acme_dir()?;
|
||||||
create_acme_subdir(ACME_ACCOUNT_DIR)
|
create_acme_subdir(ACME_ACCOUNT_DIR)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user