Package: onak Version: 0.4.0-1 Severity: minor I discovered a race condition in onak-mail.pl. Let me summarize what the script does:
1) Read configuration. 2) Open a unique spool file for the arriving mail. 3) Write that mail to the file and close it. 4) Try to acquire a lock on the spool directory and exit if that fails. 5) Process the spool directory. Now think of two concurrent onak-mail.pl invocations. Let's assume that the first invocation has just finished step 4 successfully (holding the lock). Now the second process comes along and creates the new spool file. Now the first process starts to process the directory. It may see the spool file of the second process before the second process has fully written the mail. So it is possible that only a truncated version of the mail is processed. Even though this is unlikely, it is still possible. Now the spool processing logic already skips files not ending in ".onak". An easy solution therefore is to create the spool file as ".onak.tmp" (being ignored by the loop) and rename it after the close. Helmut -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

