summaryrefslogtreecommitdiff
path: root/security/tripwire/patches/patch-ad
blob: 44eba392a483dbb66cfea8c5666e75989bf03446 (plain)
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
$NetBSD: patch-ad,v 1.2 2003/12/05 05:40:32 ben Exp $

--- src/utils.c.orig	1994-07-25 09:23:16.000000000 -0700
+++ src/utils.c
@@ -697,8 +697,13 @@ direntry_print (name, statbuf, mode)
 
 	print_perm((uint32)statbuf.st_mode);
 
+#if (defined(BSD) && BSD >= 199306)
+	(void) printf(" %-9.9s %7lld %s", owner, statbuf.st_size,
+						a_time + 4);
+#else
 	(void) printf(" %-9.9s %7d %s", owner, statbuf.st_size,
 						a_time + 4);
+#endif
 	printf(" %s\n", name);
 
 }
@@ -789,13 +794,10 @@ fd_tempfilename_generate()
     int fd;
 
     (void) strcpy(tmp, TEMPFILE_TEMPLATE);
-    if ((char *) mktemp(tmp) == NULL) {
-	perror("tempfilename_generate: mktemp()");
-	exit(1);
-    }
+    fd = mkstemp(tmp);
 
-    if ((fd = open(tmp, O_RDWR | O_CREAT, 0600)) < 0) {
-	perror("tempfilename_generate: open()");
+    if (fd == -1) {
+	perror("tempfilename_generate: mkstemp()");
 	exit(1);
     }
     /* unlink right away to make sure no one can tamper with our file */