1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
--- ../qmail-1.03.orig/qmail-local.c Mon Jun 15 12:53:16 1998
+++ qmail-local.c Sun Jul 16 16:19:04 2000
@@ -1,5 +1,6 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <fcntl.h>
#include "readwrite.h"
#include "sig.h"
#include "env.h"
@@ -128,6 +129,9 @@
if (close(fd) == -1) goto fail; /* NFS dorks */
if (link(fntmptph,fnnewtph) == -1) goto fail;
+ if ((fd = open(fnnewtph, O_RDONLY)) < 0 ||
+ fsync(fd) < 0 || close(fd) < 0) goto fail;
+
/* if it was error_exist, almost certainly successful; i hate NFS */
tryunlinktmp(); _exit(0);
--- ../qmail-1.03.orig/qmail-queue.c Mon Jun 15 12:53:16 1998
+++ qmail-queue.c Sun Jul 16 16:19:33 2000
@@ -1,5 +1,6 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <fcntl.h>
#include "readwrite.h"
#include "sig.h"
#include "exit.h"
@@ -155,6 +156,7 @@
{
unsigned int len;
char ch;
+ int fd;
sig_blocknone();
umask(033);
@@ -183,7 +185,7 @@
todofn = fnnum("todo/",0);
intdfn = fnnum("intd/",0);
- if (link(pidfn,messfn) == -1) die(64);
+ if (link(pidfn,messfn) == -1) die(64);
if (unlink(pidfn) == -1) die(63);
flagmademess = 1;
@@ -248,6 +250,8 @@
if (fsync(intdfd) == -1) die_write();
if (link(intdfn,todofn) == -1) die(66);
+ if ((fd = open(todofn, O_RDONLY)) < 0 ||
+ fsync(fd) < 0 || close(fd) < 0) die(66);
triggerpull();
die(0);
|