Yahoo Groups archive

Milter-greylist

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

Message

Re: [milter-greylist] group permissions for socket

2007-02-04 by Nerijus Baliunas

On Wed, 31 Jan 2007 07:39:13 +0000 Emmanuel Dreyfus <manu@...> wrote:

> It would not be hard to add the mode after the socket specification:
> socket "/foo/bar/sock" 660
> 
> And I beleive it will satisfy everyone.

I am trying the following patch:

diff -u -r1.162 milter-greylist.c
--- milter-greylist.c	2 Feb 2007 07:01:48 -0000	1.162
+++ milter-greylist.c	3 Feb 2007 23:48:24 -0000
@@ -1276,6 +1276,10 @@
 	cleanup_sock(conf.c_socket);
 	(void)smfi_setconn(conf.c_socket);
 
+	if (chmod(conf.c_socket, S_IWGRP) < 0) {
+		mg_log(LOG_ERR, "Error defining access to %s: %s", conf.c_socket, strerror(errno));
+	}
+
 	/*
 	 * Reload a saved greylist
 	 * No lock needed here either.

And I'm getting this message in the logs:
milter-greylist: Error defining access to /var/milter-greylist/milter-greylist.sock: No such file or directory

It seems socket is not created in smfi_setconn()? I tried to move chmod()
after "exitval = smfi_main()" line, but it didn't work neither. It seems the best
option would be to use umask(), but then it's impossible to use syntax like
socket "/foo/bar/sock" 660, isn't it?

Regards,
Nerijus

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.