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))
8
-** If you don't have flock, you could try using lockf instead.
12
-# define flock(a, b) lockf(a, b, 0)
15
-# endif /* LOCK_EX */
16
-# define LOCK_EX F_LOCK
17
-#endif /* LDA_USE_LOCKF */
20
-# include <sys/file.h>
21
-#endif /* ! LOCK_EX */
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.
33
- ** open(2) should support flock'ing the file.
37
@@ -1265,7 +1246,7 @@ tryagain:
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)
44
mailerr("450 4.2.0", "%s: %s", path, sm_errstring(errno));
46
@@ -1378,7 +1359,7 @@ err0: (void) setreuid(0, 0);
47
mbfd = open(path, O_WRONLY, 0);
50
- || flock(mbfd, LOCK_EX) < 0 ||
51
+ || lockf(mbfd, F_LOCK, 0) < 0 ||
52
fstat(mbfd, &sb) < 0 ||
53
sb.st_size != cursize ||