View | Details | Raw Unified | Return to bug 173496 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-1 / +1 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=		logrotate
8
PORTNAME=		logrotate
9
PORTVERSION=		3.7.9
9
PORTVERSION=		3.8.3
10
CATEGORIES=		sysutils
10
CATEGORIES=		sysutils
11
MASTER_SITES=		https://fedorahosted.org/releases/l/o/logrotate/
11
MASTER_SITES=		https://fedorahosted.org/releases/l/o/logrotate/
12
12
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (logrotate-3.7.9.tar.gz) = 080caf904e70e04da16b8dfa95a5a787ec7d722ee1af18ccea437d3ffdd6fec0
1
SHA256 (logrotate-3.8.3.tar.gz) = 0776bf491171edbcc3ba577751fc912e721e99b834c14251df8109fd3bfa1977
2
SIZE (logrotate-3.7.9.tar.gz) = 45301
2
SIZE (logrotate-3.8.3.tar.gz) = 52210
(-)files/patch-Makefile (-23 / +4 lines)
Lines 1-9 Link Here
1
diff --git a/Makefile b/Makefile
1
--- Makefile.orig	2012-10-04 03:59:14.000000000 -0400
2
index adb97f2..a2d51f7 100644
2
+++ Makefile	2012-12-02 21:44:52.000000000 -0500
3
--- a/Makefile
3
@@ -71,6 +71,13 @@
4
+++ b/Makefile
4
     LOADLIBES += -L$(BASEDIR)/lib -Wl,-R,$(BASEDIR)/lib
5
@@ -53,6 +53,13 @@ ifeq ($(OS_NAME),Linux)
6
     BASEDIR = /usr
7
 endif
5
 endif
8
 
6
 
9
+# FreeBSD
7
+# FreeBSD
Lines 16-35 Link Here
16
 ifneq ($(POPT_DIR),)
14
 ifneq ($(POPT_DIR),)
17
     CFLAGS += -I$(POPT_DIR)
15
     CFLAGS += -I$(POPT_DIR)
18
     LOADLIBES += -L$(POPT_DIR)
16
     LOADLIBES += -L$(POPT_DIR)
19
@@ -107,11 +114,15 @@ install:
20
 	$(INSTALL) $(PROG) $(PREFIX)/$(BINDIR) 0755 bin bin; \
21
 	$(INSTALL) $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"` 0644 bin bin; \
22
 	$(INSTALL) $(MAN5) $(PREFIX)/$(MANDIR)/man`echo $(MAN5) | sed "s/.*\.//"` 0644 bin bin; \
23
+	else if [ "$(OS_NAME)" = FreeBSD ]; then \
24
+	$(BSD_INSTALL_PROGRAM) $(PROG) $(BINDIR); \
25
+	$(BSD_INSTALL_MAN) $(MAN) $(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"`/$(MAN); \
26
+	$(BSD_INSTALL_MAN) $(MAN5) $(MANDIR)/man`echo $(MAN5) | sed "s/.*\.//"`/$(MAN5); \
27
 	else \
28
 	$(INSTALL) -m 755 $(PROG) $(PREFIX)/$(BINDIR); \
29
 	$(INSTALL) -m 644 $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"`/$(MAN); \
30
 	$(INSTALL) -m 644 $(MAN5) $(PREFIX)/$(MANDIR)/man`echo $(MAN5) | sed "s/.*\.//"`/$(MAN5); \
31
-	fi
32
+	fi; fi
33
 
34
 co:
35
 	co RCS/*,v
(-)files/patch-config.c (-63 / +7 lines)
Lines 1-67 Link Here
1
diff --git a/config.c b/config.c
1
--- config.c.orig	2012-11-09 18:58:51.756188812 +0800
2
index e6d5d1d..d14d742 100644
2
+++ config.c	2012-11-09 19:00:23.064190229 +0800
3
--- a/config.c
3
@@ -1,8 +1,4 @@
4
+++ b/config.c
5
@@ -1,5 +1,4 @@
6
 #include <sys/queue.h>
4
 #include <sys/queue.h>
5
-/* Alloca is defined in stdlib.h in NetBSD */
6
-#ifndef __NetBSD__
7
-#include <alloca.h>
7
-#include <alloca.h>
8
-#endif
9
 #include <limits.h>
8
 #include <ctype.h>
10
 #include <ctype.h>
9
 #include <dirent.h>
11
 #include <dirent.h>
10
 #include <errno.h>
11
@@ -19,6 +18,7 @@
12
 #include <wctype.h>
13
 #include <fnmatch.h>
14
 #include <sys/mman.h>
15
+#include <limits.h>
16
 
17
 #include "basenames.h"
18
 #include "log.h"
19
@@ -28,6 +28,14 @@
20
 #define GLOB_ABORTED GLOB_ABEND
21
 #endif
22
 
23
+#if !defined(MAP_POPULATE)
24
+#define MAP_POPULATE 0
25
+#endif
26
+
27
+#if !defined(MADV_DONTFORK)
28
+#define MADV_DONTFORK 0
29
+#endif
30
+
31
 #define REALLOC_STEP    10
32
 
33
 #if defined(SunOS) 
34
@@ -100,7 +108,7 @@ static char *readPath(const char *configFile, int lineNum, char *key,
35
 
36
 	chptr = start;
37
 
38
-	while( (len = mbrtowc(&pwc, chptr, strlen(chptr), NULL)) != 0 ) {
39
+	while( (len = strlen(chptr)) != 0 && (len = mbrtowc(&pwc, chptr, len, NULL)) != 0 ) {
40
 		if( len == (size_t)(-1) || len == (size_t)(-2) || !iswprint(pwc) || iswblank(pwc) ) {
41
 		    message(MESS_ERROR, "%s:%d bad %s path %s\n",
42
 			    configFile, lineNum, key, start);
43
@@ -519,12 +527,24 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
44
        length arrays -- of course, if we aren't run setuid it doesn't
45
        matter much */
46
 
47
+#ifdef __FreeBSD__
48
+    fd = open(configFile, O_RDONLY);
49
+#else
50
     fd = open(configFile, O_RDONLY | O_CLOEXEC);
51
+#endif
52
     if (fd < 0) {
53
 	message(MESS_ERROR, "failed to open config file %s: %s\n",
54
 		configFile, strerror(errno));
55
 	return 1;
56
     }
57
+#ifdef __FreeBSD__
58
+    if (fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) & FD_CLOEXEC) == -1) {
59
+	message(MESS_ERROR, "Could not set close-on-exec for file %s\n",
60
+		configFile);
61
+	close(fd);
62
+	return 1;
63
+    }
64
+#endif
65
 	/* We don't want anybody to change the file while we parse it,
66
 	 * let's try to lock it for reading. */
67
 	if (fcntl(fd, F_SETLK, &fd_lock) == -1) {
(-)files/patch-logrotate.8 (-14 / +4 lines)
Lines 1-16 Link Here
1
diff --git a/logrotate.8 b/logrotate.8
1
--- logrotate.8.orig	2012-11-09 19:10:08.054188039 +0800
2
index f18c522..33f9a32 100644
2
+++ logrotate.8	2012-11-09 19:10:57.749187879 +0800
3
--- a/logrotate.8
3
@@ -59,7 +59,7 @@
4
+++ b/logrotate.8
5
@@ -48,14 +48,14 @@ correctly.
6
 Tells \fBlogrotate\fR which command to use when mailing logs. This
7
 command should accept two arguments: 1) the subject of the message, and
8
 2) the recipient. The command must then read a message on standard input
9
-and mail it to the recipient. The default mail command is \fB/bin/mail
10
+and mail it to the recipient. The default mail command is \fB/bin/mailx
11
 -s\fR.
12
 
13
 .TP
14
 \fB-s, -\-state <statefile>\fR
4
 \fB-s, -\-state <statefile>\fR
15
 Tells \fBlogrotate\fR to use an alternate state file.  This is useful
5
 Tells \fBlogrotate\fR to use an alternate state file.  This is useful
16
 if logrotate is being run as a different user for various sets of
6
 if logrotate is being run as a different user for various sets of
Lines 19-25 Link Here
19
 
9
 
20
 .TP
10
 .TP
21
 \fB-\-usage\fR
11
 \fB-\-usage\fR
22
@@ -473,10 +473,10 @@ Log files are rotated if the current year is not the same as the last rotation.
12
@@ -507,10 +507,10 @@
23
 .SH FILES
13
 .SH FILES
24
 .PD 0
14
 .PD 0
25
 .TP 27
15
 .TP 27
(-)files/patch-logrotate.c (-14 / +7 lines)
Lines 1-18 Link Here
1
diff --git a/logrotate.c b/logrotate.c
1
--- logrotate.c.orig	2012-11-09 19:00:58.744187984 +0800
2
index 3748918..a528367 100644
2
+++ logrotate.c	2012-11-09 19:01:05.528189740 +0800
3
--- a/logrotate.c
3
@@ -1,8 +1,4 @@
4
+++ b/logrotate.c
5
@@ -1,5 +1,4 @@
6
 #include <sys/queue.h>
4
 #include <sys/queue.h>
5
-/* alloca() is defined in stdlib.h in NetBSD */
6
-#ifndef __NetBSD__
7
-#include <alloca.h>
7
-#include <alloca.h>
8
-#endif
9
 #include <limits.h>
8
 #include <ctype.h>
10
 #include <ctype.h>
9
 #include <dirent.h>
11
 #include <dirent.h>
10
 #include <errno.h>
11
@@ -16,6 +15,7 @@
12
 #include <locale.h>
13
 #include <sys/types.h>
14
 #include <utime.h>
15
+#include <limits.h>
16
 
17
 #if defined(SunOS) 
18
 #include <syslimits.h>

Return to bug 173496