Skip to content

docker-entrypoint.sh unconditionally creates ROUNDCUBEMAIL_TEMP_DIR #447

Description

@rekup

In the docker-entrypoint.sh script there are the following lines:

if [ ! -z "${ROUNDCUBEMAIL_TEMP_DIR}" ]; then
mkdir -p ${ROUNDCUBEMAIL_TEMP_DIR} && chown www-data ${ROUNDCUBEMAIL_TEMP_DIR}
fi

By checking -z in the conditional, I assume the intention was to execute mkdir/chown only when ROUNDCUBEMAIL_TEMP_DIR is not empty. However, this variable can never be empty because of the following line:

: "${ROUNDCUBEMAIL_TEMP_DIR:=/tmp/roundcube-temp}"

The := operator assigns the default value when the variable is either unset or empty. As a result, it is impossible to disable creation of the temporary directory by setting:

ROUNDCUBEMAIL_TEMP_DIR=""

because the variable is immediately replaced with /tmp/roundcube-temp.

One possible fix would be to use = instead of :=, which would preserve an explicitly empty value while still providing a default when the variable is unset.

Before opening a PR, I wanted to check whether there is a specific reason for the current implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. to triageNew issues that need attention and classification

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions