mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
AcmeClient: Prevent mode 0750 on everything inside /var/etc/acme-client
This change avoids that all contents in any subfolder is set to mode 0750 as this is illegal e.g. for private keys for SSH.
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
ACME_DIRS="/var/etc/acme-client /var/etc/acme-client/certs /var/etc/acme-client/keys /var/etc/acme-client/configs /var/etc/acme-client/challenges /var/etc/acme-client/home"
|
||||
ACME_BASE="/var/etc/acme-client"
|
||||
ACME_DIRS="/var/etc/acme-client/certs /var/etc/acme-client/keys /var/etc/acme-client/configs /var/etc/acme-client/challenges /var/etc/acme-client/home"
|
||||
|
||||
# Generating dirs if missing and setting owner and mode (recursively)
|
||||
for directory in ${ACME_DIRS}; do
|
||||
mkdir -p ${directory}
|
||||
chown -R root:wheel ${directory}
|
||||
chmod -R 750 ${directory}
|
||||
done
|
||||
|
||||
# Setting owner and mode for base and immediate children (non recursive)
|
||||
chown root:wheel ${ACME_BASE} ${ACME_BASE}/*
|
||||
chmod 750 ${ACME_BASE} ${ACME_BASE}/*
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user