Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] milter-greylist-2.0.2 crash

2006-01-25 by Matthias Scheler

On Wed, Jan 25, 2006 at 02:34:23PM +0000, Emmanuel Dreyfus wrote:
> Here is the revelant code section:
>         if ((dumpfd = mkstemp(newdumpfile)) == -1) {
>                 syslog(LOG_ERR, "mkstemp(\"%s\") failed: %s",
>                     newdumpfile, strerror(errno));
>                 exit(EX_OSERR);
>         }  

Crude untested hack:

#ifdef SOLARIS_FD_WORKARROUND
	if (dumpfd > 255) {
		int	retries = 10;

		while (dumpfd > 255) {
			int	lowfd;

			lowfd = dup(dumpfd);
			if (lowfd <= 255) {
				(void)close(dupfd);
				dupfd = lowfd;
				break;
			}

			if (retries-- == 0) {
				/* Handle error gracefully */
				...
			}

			(void) usleep(10);
		}
	}
#endif /* SOLARIS_FD_WORKARROUND */

	Kind regards

-- 
Matthias Scheler                                  http://scheler.de/~matthias/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.