Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: only chmod when there are files #3203

Merged

Conversation

casperklein
Copy link
Member

@casperklein casperklein commented Mar 25, 2023

Description

Fix for:

[   INF   ]  Welcome to docker-mailserver 11.3.1
[   INF   ]  Checking configuration
[   INF   ]  Configuring mail server
chmod: cannot access '/usr/lib/dovecot/sieve-filter/*': No such file or directory
chmod: cannot access '/usr/lib/dovecot/sieve-pipe/*': No such file or directory  

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change that does improve existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@casperklein casperklein self-assigned this Mar 25, 2023
@casperklein casperklein added this to the v12.0.0 milestone Mar 25, 2023
@casperklein casperklein marked this pull request as ready for review March 25, 2023 23:58
@@ -87,8 +87,8 @@ function _setup_dovecot_sieve
fi

chown dovecot:root -R /usr/lib/dovecot/sieve-*
find /usr/lib/dovecot/sieve-* -type d -exec chmod 755 {} \;
chmod +x /usr/lib/dovecot/sieve-{filter,pipe}/*
find /usr/lib/dovecot/sieve-* -type d -exec chmod 755 {} +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why we set chmod 755 and not chmod -R 755 since this is only matching directories? If we're fixing permissions there, I assume that might be relevant to the contents too 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix appears to be correct to me, since we do not want to adjust the contents of the dirs, only the dirs, so the -R is not needed and not desired as well (as contents and dirs need different dirs).

If you were using -R, you'd be adjusting the contents as well, even though the find only matches dirs.

@georglauterbach georglauterbach merged commit 6fa06f4 into docker-mailserver:master Mar 26, 2023
@casperklein casperklein deleted the fix-chmod-dovecot branch March 27, 2023 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants