bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

movemail on Debian


From: Dave Love
Subject: movemail on Debian
Date: 29 Apr 2003 15:17:50 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

21.3 never got fixed for mail locking on Debian and apparently could
lose mail from a spool delivered to by a Debian system.  (I've made
previous attempts to get this fixed.  It should really be fixed by
making the locking runtime-configurable, but this seems to fix an
important case.)

If there's a bug-fix follow-on, please consider the following.  I
can't really test it, but perhaps someone could at least check the
logic and consider it also for the head source.  It does at least get
liblockfile dynamically linked, which it isn't in the movemail from
the Debian package.  For the head, it should probably be cleaned up to
distinguish HAVE_LIBMAIL and HAVE_LIBLOCKFILE.

Note that with this you get a warning which should probably be dealt
with:

movemail.c:327: the use of `mktemp' is dangerous, better use `mkstemp'

2003-04-29  Dave Love  <address@hidden>

        * configure.in: When we have -llockfile, define HAVE_LIBMAIL, not
        LIBMAIL.

Index: configure.in
===================================================================
RCS file: /cvsroot/emacs/emacs/configure.in,v
retrieving revision 1.267.4.17
diff -u -p -c -r1.267.4.17 configure.in
cvs server: conflicting specifications of output style
*** configure.in        7 Apr 2003 09:34:40 -0000       1.267.4.17
--- configure.in        29 Apr 2003 13:58:35 -0000
*************** if test "$ac_cv_lib_lockfile_maillock" =
*** 1967,1975 ****
      AC_MSG_ERROR([Shared liblockfile found but can't link against it.
  This probably means that movemail could lose mail.
  There may be a \`development' package to install containing liblockfile.])
-   else AC_DEFINE(LIBMAIL, -llockfile)
-   fi
    else :
  fi
  AC_CHECK_FUNCS(touchlock)
  AC_CHECK_HEADERS(maillock.h)
--- 1967,1975 ----
      AC_MSG_ERROR([Shared liblockfile found but can't link against it.
  This probably means that movemail could lose mail.
  There may be a \`development' package to install containing liblockfile.])
    else :
+   fi
+ else AC_DEFINE(HAVE_LIBMAIL)
  fi
  AC_CHECK_FUNCS(touchlock)
  AC_CHECK_HEADERS(maillock.h)

2003-04-29  Dave Love  <address@hidden>

        * config.in: Add HAVE_LIBLOCKFILE.

        * s/gnu-linux.h (MAIL_USE_FLOCK): Don't define if we should use
        maillock.

*** gnu-linux.h.~1.83.~ Fri Sep 28 16:50:04 2001
--- gnu-linux.h Tue Apr 29 15:13:55 2003
***************
*** 129,136 ****
--- 129,146 ----
  /* On GNU/Linux systems, both methods are used by various mail
     programs.  I assume that most people are using newer mailers that
     have heard of flock.  Change this if you need to. */
+ /* Debian contains a patch which says: ``On Debian/GNU/Linux systems,
+    configure gets the right answers, and that means *NOT* using flock.
+    Using flock is guaranteed to be the wrong thing. See Debian Policy
+    for details.'' and then uses `#ifdef DEBIAN'.  Unfortunately the
+    Debian maintainer hasn't provided a clean fix for Emacs.
+    movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
+    HAVE_MAILLOCK_H are defined, so the following appears to be the
+    correct logic.  (MAILDIR is defined in maillock.h.)  -- fx */
  
+ #if !(defined (HAVE_LIBMAIL) && defined (HAVE_MAILLOCK_H))
  #define MAIL_USE_FLOCK
+ #endif
  
  /* Define CLASH_DETECTION if you want lock files to be written
     so that Emacs can tell instantly when you try to modify




reply via email to

[Prev in Thread] Current Thread [Next in Thread]