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

admin/operations: fix and improve requeueing #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liske
Copy link

@liske liske commented Mar 7, 2025

Using a filename which cannot be interpreted as integer value in decimal notation without any leading zeros does not work[1]. The only id which can be used save seems to be 0, other values can be overwritten due to [2] and the implementation of message_enqueue_retrieve_max_ID[3] which is not free of race conditions. So better be save than sorry.

[1] grommunio/gromox#135
[2] grommunio/gromox#136
[3] https://github.com/grommunio/gromox/blob/17ca866e731a3c19a6e66491442dd68a72b0ad39/mda/message_enqueue.cpp#L328

The code has been improved:

  • always use mv -n to never replace existing files
  • do not croak if save/ is empty

Using a filename which cannot be interpreted as integer value in decimal notation
without any leading zeros does not work[1]. The **only** id which can be used save seems
to be `0`, other values can be overwritten due to [2] and the implementation
of `message_enqueue_retrieve_max_ID`[3] which is **not** free of race conditions. So
better be save than sorry.

[1] grommunio/gromox#135
[2] grommunio/gromox#136
[3] https://github.com/grommunio/gromox/blob/17ca866e731a3c19a6e66491442dd68a72b0ad39/mda/message_enqueue.cpp#L328

The code has been improved:
- always use `mv -n` to **never** replace existing files
- do not croak if `save/` is empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant