mirror of
https://github.com/certbot/certbot.git
synced 2026-07-30 18:04:31 +02:00
constants.CONFIG_DIRS_MODE, fix #362 config dir bug
This commit is contained in:
@@ -50,6 +50,9 @@ DVSNI_CHALLENGE_PORT = 443
|
|||||||
"""Port to perform DVSNI challenge."""
|
"""Port to perform DVSNI challenge."""
|
||||||
|
|
||||||
|
|
||||||
|
CONFIG_DIRS_MODE = 0o755
|
||||||
|
"""Directory mode for ``.IConfig.config_dir`` et al."""
|
||||||
|
|
||||||
TEMP_CHECKPOINT_DIR = "temp_checkpoint"
|
TEMP_CHECKPOINT_DIR = "temp_checkpoint"
|
||||||
"""Temporary checkpoint directory (relative to IConfig.work_dir)."""
|
"""Temporary checkpoint directory (relative to IConfig.work_dir)."""
|
||||||
|
|
||||||
|
|||||||
@@ -934,9 +934,12 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
uid = os.geteuid()
|
uid = os.geteuid()
|
||||||
le_util.make_or_verify_dir(self.config.config_dir, 0o755, uid)
|
le_util.make_or_verify_dir(
|
||||||
le_util.make_or_verify_dir(self.config.work_dir, 0o755, uid)
|
self.config.config_dir, constants.CONFIG_DIRS_MODE, uid)
|
||||||
le_util.make_or_verify_dir(self.config.backup_dir, 0o755, uid)
|
le_util.make_or_verify_dir(
|
||||||
|
self.config.work_dir, constants.CONFIG_DIRS_MODE, uid)
|
||||||
|
le_util.make_or_verify_dir(
|
||||||
|
self.config.backup_dir, constants.CONFIG_DIRS_MODE, uid)
|
||||||
|
|
||||||
def get_version(self):
|
def get_version(self):
|
||||||
"""Return version of Apache Server.
|
"""Return version of Apache Server.
|
||||||
|
|||||||
@@ -349,9 +349,12 @@ class NginxConfigurator(object):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
uid = os.geteuid()
|
uid = os.geteuid()
|
||||||
le_util.make_or_verify_dir(self.config.work_dir, 0o755, uid)
|
le_util.make_or_verify_dir(
|
||||||
le_util.make_or_verify_dir(self.config.backup_dir, 0o755, uid)
|
self.config.work_dir, constants.CONFIG_DIRS_MODE, uid)
|
||||||
le_util.make_or_verify_dir(self.config.config_dir, 0o755, uid)
|
le_util.make_or_verify_dir(
|
||||||
|
self.config.backup_dir, constants.CONFIG_DIRS_MODE, uid)
|
||||||
|
le_util.make_or_verify_dir(
|
||||||
|
self.config.config_dir, constants.CONFIG_DIRS_MODE, uid)
|
||||||
|
|
||||||
def get_version(self):
|
def get_version(self):
|
||||||
"""Return version of Nginx Server.
|
"""Return version of Nginx Server.
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ import time
|
|||||||
|
|
||||||
import zope.component
|
import zope.component
|
||||||
|
|
||||||
|
from letsencrypt.client import constants
|
||||||
from letsencrypt.client import errors
|
from letsencrypt.client import errors
|
||||||
from letsencrypt.client import interfaces
|
from letsencrypt.client import interfaces
|
||||||
from letsencrypt.client import le_util
|
from letsencrypt.client import le_util
|
||||||
|
|
||||||
from letsencrypt.client.display import util as display_util
|
from letsencrypt.client.display import util as display_util
|
||||||
|
|
||||||
|
|
||||||
@@ -164,7 +166,8 @@ class Reverter(object):
|
|||||||
unable to add checkpoint
|
unable to add checkpoint
|
||||||
|
|
||||||
"""
|
"""
|
||||||
le_util.make_or_verify_dir(cp_dir, 0o755, os.geteuid())
|
le_util.make_or_verify_dir(
|
||||||
|
cp_dir, constants.CONFIG_DIRS_MODE, os.geteuid())
|
||||||
|
|
||||||
op_fd, existing_filepaths = self._read_and_append(
|
op_fd, existing_filepaths = self._read_and_append(
|
||||||
os.path.join(cp_dir, "FILEPATHS"))
|
os.path.join(cp_dir, "FILEPATHS"))
|
||||||
@@ -305,7 +308,8 @@ class Reverter(object):
|
|||||||
else:
|
else:
|
||||||
cp_dir = self.config.in_progress_dir
|
cp_dir = self.config.in_progress_dir
|
||||||
|
|
||||||
le_util.make_or_verify_dir(cp_dir, 0o755, os.geteuid())
|
le_util.make_or_verify_dir(
|
||||||
|
cp_dir, constants.CONFIG_DIRS_MODE, os.geteuid())
|
||||||
|
|
||||||
# Append all new files (that aren't already registered)
|
# Append all new files (that aren't already registered)
|
||||||
new_fd = None
|
new_fd = None
|
||||||
|
|||||||
@@ -18,10 +18,13 @@ import letsencrypt
|
|||||||
|
|
||||||
from letsencrypt.client import account
|
from letsencrypt.client import account
|
||||||
from letsencrypt.client import configuration
|
from letsencrypt.client import configuration
|
||||||
|
from letsencrypt.client import constants
|
||||||
from letsencrypt.client import client
|
from letsencrypt.client import client
|
||||||
from letsencrypt.client import errors
|
from letsencrypt.client import errors
|
||||||
from letsencrypt.client import interfaces
|
from letsencrypt.client import interfaces
|
||||||
|
from letsencrypt.client import le_util
|
||||||
from letsencrypt.client import log
|
from letsencrypt.client import log
|
||||||
|
|
||||||
from letsencrypt.client.display import util as display_util
|
from letsencrypt.client.display import util as display_util
|
||||||
from letsencrypt.client.display import ops as display_ops
|
from letsencrypt.client.display import ops as display_ops
|
||||||
|
|
||||||
@@ -177,6 +180,9 @@ def main(): # pylint: disable=too-many-branches, too-many-statements
|
|||||||
client.rollback(args.rollback, config)
|
client.rollback(args.rollback, config)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
le_util.make_or_verify_dir(
|
||||||
|
config.config_dir, constants.CONFIG_DIRS_MODE, os.geteuid())
|
||||||
|
|
||||||
# Prepare for init of Client
|
# Prepare for init of Client
|
||||||
if args.email is None:
|
if args.email is None:
|
||||||
acc = client.determine_account(config)
|
acc = client.determine_account(config)
|
||||||
|
|||||||
Reference in New Issue
Block a user