~ubuntu-branches/ubuntu/saucy/sendmail/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/patches/8.14/8.14.4/hard-code-lockf.patch

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-05-22 15:21:02 UTC
  • mfrom: (9.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20120522152102-7lu2d2zvagerhz6f
Tags: 8.14.4-2.1ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Fix FTBFS with ld --as-needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -urNap sendmail-8.14.4.orig/mail.local/mail.local.c sendmail-8.14.4/mail.local/mail.local.c
 
2
--- sendmail-8.14.4.orig/mail.local/mail.local.c        2008-02-19 08:13:30.000000000 +0100
 
3
+++ sendmail-8.14.4/mail.local/mail.local.c     2012-05-09 10:27:45.201528350 +0200
 
4
@@ -100,22 +100,6 @@ SM_IDSTR(id, "@(#)$Id: mail.local.c,v 8.
 
5
 #define REALLOC(ptr, size)     (((ptr) == NULL) ? malloc(size) : realloc(ptr, size))
 
6
 
 
7
 /*
 
8
-**  If you don't have flock, you could try using lockf instead.
 
9
-*/
 
10
-
 
11
-#ifdef LDA_USE_LOCKF
 
12
-# define flock(a, b)   lockf(a, b, 0)
 
13
-# ifdef LOCK_EX
 
14
-#  undef LOCK_EX
 
15
-# endif /* LOCK_EX */
 
16
-# define LOCK_EX       F_LOCK
 
17
-#endif /* LDA_USE_LOCKF */
 
18
-
 
19
-#ifndef LOCK_EX
 
20
-# include <sys/file.h>
 
21
-#endif /* ! LOCK_EX */
 
22
-
 
23
-/*
 
24
 **  If you don't have setreuid, and you have saved uids, and you have
 
25
 **  a seteuid() call that doesn't try to emulate using setuid(), then
 
26
 **  you can try defining LDA_USE_SETEUID.
 
27
@@ -1095,9 +1079,6 @@ deliver(fd, name)
 
28
        **  can't unlink it.  Historically, binmail set the owner/group at
 
29
        **  each mail delivery.  We no longer do this, assuming that if the
 
30
        **  ownership or permissions were changed there was a reason.
 
31
-       **
 
32
-       **  XXX
 
33
-       **  open(2) should support flock'ing the file.
 
34
        */
 
35
 
 
36
 tryagain:
 
37
@@ -1265,7 +1246,7 @@ tryagain:
 
38
 #endif /* 0 */
 
39
 
 
40
        /* Wait until we can get a lock on the file. */
 
41
-       if (flock(mbfd, LOCK_EX) < 0)
 
42
+       if (lockf(mbfd, F_LOCK, 0) < 0)
 
43
        {
 
44
                mailerr("450 4.2.0", "%s: %s", path, sm_errstring(errno));
 
45
                goto err1;
 
46
@@ -1378,7 +1359,7 @@ err0:             (void) setreuid(0, 0);
 
47
                mbfd = open(path, O_WRONLY, 0);
 
48
                if (mbfd < 0 ||
 
49
                    cursize == 0
 
50
-                   || flock(mbfd, LOCK_EX) < 0 ||
 
51
+                   || lockf(mbfd, F_LOCK, 0) < 0 ||
 
52
                    fstat(mbfd, &sb) < 0 ||
 
53
                    sb.st_size != cursize ||
 
54
                    sb.st_nlink != 1 ||