mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-19 14:57:04 +00:00
chasquid-util: Fix creating the directory on user-add
`chasquid-util user-add` is meant to create the domain directory if it doesn't exist; however there's a bug that makes this not happen, and instead the command fails with: Error writing database: open <path>: no such file or directory This patch fixes the issue and adds a test to ensure we don't have any regressions on this behaviour. Thanks to raspbeguy (https://github.com/raspbeguy) for reporting this issue (on IRC).
This commit is contained in:
@@ -25,13 +25,15 @@ function check_userdb() {
|
||||
|
||||
|
||||
rm -rf .config/
|
||||
mkdir -p .config/domains/domain/ .data/domaininfo
|
||||
mkdir -p .config/ .data/domaininfo
|
||||
echo 'data_dir: ".data"' >> .config/chasquid.conf
|
||||
|
||||
if ! r print-config > /dev/null; then
|
||||
fail print-config
|
||||
fi
|
||||
|
||||
# We intentionally run this when the domain directory doesn't exist, as we
|
||||
# want to confirm it creates it.
|
||||
if ! r user-add interactive@domain --password=passwd > /dev/null; then
|
||||
fail user-add
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user