[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

maillock inadequate - diff to turn it off



Matti,

with the current state of things, mailbox file locking does not work if
Solaris maillock() is used.  First of all, and most important, wrong
name is passed to maillock() - it's user name *with domain*.  As a result,
lock files are named in other way than those used by other programs
(imapd etc.).  Second, if you use mailbox directory other than /var/mail,
lock files are still created in /var/mail.

Diff below adds a configure option "--without-maillock" that reverts
mailbox.c to "handmade" lock files.  Please consider applying it, or
something that would have the same effect.  Thanks.

Eugene

Index: mailbox.c
===================================================================
RCS file: /cvsroot/zmailer/transports/mailbox/mailbox.c,v
retrieving revision 1.76
diff -u -r1.76 mailbox.c
--- mailbox.c	2000/03/03 14:31:01	1.76
+++ mailbox.c	2000/03/14 08:33:32
@@ -848,7 +848,7 @@
 const char *file;
 int iuid;
 {
-#ifdef	HAVE_MAILLOCK_H
+#ifdef	HAVE_MAILLOCK
 	const char *maillockuser;
 	struct passwd *pw;
 	int i;
@@ -912,7 +912,7 @@
 	  return 1;
 	}
 	havemaillock = 1;
-#endif	/* HAVE_MAILLOCK_H */
+#endif	/* HAVE_MAILLOCK */
 #ifdef  HAVE_DOTLOCK
 	havedotlock = (dotlock(file) == 0);
 	if (!havedotlock) {
@@ -1642,11 +1642,11 @@
 		case '"':
 		  break;
 		case '.':
-#ifdef	HAVE_MAILLOCK_H
+#ifdef	HAVE_MAILLOCK
 		  if (havemaillock && ismbox)
 		    mailunlock();
 		  havemaillock = 0;
-#endif	/* HAVE_MAILLOCK_H */
+#endif	/* HAVE_MAILLOCK */
 #ifdef	HAVE_DOTLOCK
 		  if (ismbox)
 		    dotunlock(file);
@@ -1710,11 +1710,11 @@
 	    case '"':
 	      break;
 	    case '.':
-#ifdef	HAVE_MAILLOCK_H
+#ifdef	HAVE_MAILLOCK
 	      if (ismbox && havemaillock)
 		mailunlock();
 	      havemaillock = 0;
-#endif	/* HAVE_MAILLOCK_H */
+#endif	/* HAVE_MAILLOCK */
 #ifdef	HAVE_DOTLOCK
 	      if (ismbox)
 		dotunlock(file);
Index: configure.in
===================================================================
RCS file: /cvsroot/zmailer/configure.in,v
retrieving revision 1.75
diff -u -r1.75 configure.in
--- configure.in	2000/02/18 20:56:01	1.75
+++ configure.in	2000/03/14 09:23:42
@@ -1107,7 +1107,13 @@
 	AC_CHECK_FUNCS(fsync)
 fi
 
-AC_FUNC_SVR4_MAILLOCK
+AC_ARG_WITH(maillock,[  --without-maillock       Do not use maillock() even if
you have it],
+	without_maillock=1)
+if test without_maillock = 0; then
+	AC_FUNC_SVR4_MAILLOCK
+else
+	AC_DEFINE(HAVE_DOTLOCK)
+fi
 
 AC_CHECK_FUNCS(mkdir mktime mkstemp rename rmdir strcpy strdup strstr \
 		strchr strrchr setvbuf strerror strsignal setreuid \