1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-22 20:41:26 +00:00

Update to 3.8.3.

PR:		ports/173496
Submitted by:	wxs@
Approved by:	maintainer timeout
This commit is contained in:
Wesley Shields 2012-12-17 15:22:55 +00:00
parent 873d4bda50
commit 1a6db7c45a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=309102
6 changed files with 25 additions and 117 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= logrotate
PORTVERSION= 3.7.9
PORTVERSION= 3.8.3
CATEGORIES= sysutils
MASTER_SITES= https://fedorahosted.org/releases/l/o/logrotate/

View File

@ -1,2 +1,2 @@
SHA256 (logrotate-3.7.9.tar.gz) = 080caf904e70e04da16b8dfa95a5a787ec7d722ee1af18ccea437d3ffdd6fec0
SIZE (logrotate-3.7.9.tar.gz) = 45301
SHA256 (logrotate-3.8.3.tar.gz) = 0776bf491171edbcc3ba577751fc912e721e99b834c14251df8109fd3bfa1977
SIZE (logrotate-3.8.3.tar.gz) = 52210

View File

@ -1,9 +1,7 @@
diff --git a/Makefile b/Makefile
index adb97f2..a2d51f7 100644
--- a/Makefile
+++ b/Makefile
@@ -53,6 +53,13 @@ ifeq ($(OS_NAME),Linux)
BASEDIR = /usr
--- Makefile.orig 2012-10-04 03:59:14.000000000 -0400
+++ Makefile 2012-12-02 21:44:52.000000000 -0500
@@ -71,6 +71,13 @@
LOADLIBES += -L$(BASEDIR)/lib -Wl,-R,$(BASEDIR)/lib
endif
+# FreeBSD
@ -16,20 +14,3 @@ index adb97f2..a2d51f7 100644
ifneq ($(POPT_DIR),)
CFLAGS += -I$(POPT_DIR)
LOADLIBES += -L$(POPT_DIR)
@@ -107,11 +114,15 @@ install:
$(INSTALL) $(PROG) $(PREFIX)/$(BINDIR) 0755 bin bin; \
$(INSTALL) $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"` 0644 bin bin; \
$(INSTALL) $(MAN5) $(PREFIX)/$(MANDIR)/man`echo $(MAN5) | sed "s/.*\.//"` 0644 bin bin; \
+ else if [ "$(OS_NAME)" = FreeBSD ]; then \
+ $(BSD_INSTALL_PROGRAM) $(PROG) $(BINDIR); \
+ $(BSD_INSTALL_MAN) $(MAN) $(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"`/$(MAN); \
+ $(BSD_INSTALL_MAN) $(MAN5) $(MANDIR)/man`echo $(MAN5) | sed "s/.*\.//"`/$(MAN5); \
else \
$(INSTALL) -m 755 $(PROG) $(PREFIX)/$(BINDIR); \
$(INSTALL) -m 644 $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"`/$(MAN); \
$(INSTALL) -m 644 $(MAN5) $(PREFIX)/$(MANDIR)/man`echo $(MAN5) | sed "s/.*\.//"`/$(MAN5); \
- fi
+ fi; fi
co:
co RCS/*,v

View File

@ -1,67 +1,11 @@
diff --git a/config.c b/config.c
index e6d5d1d..d14d742 100644
--- a/config.c
+++ b/config.c
@@ -1,5 +1,4 @@
--- config.c.orig 2012-11-09 18:58:51.756188812 +0800
+++ config.c 2012-11-09 19:00:23.064190229 +0800
@@ -1,8 +1,4 @@
#include <sys/queue.h>
-/* Alloca is defined in stdlib.h in NetBSD */
-#ifndef __NetBSD__
-#include <alloca.h>
-#endif
#include <limits.h>
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
@@ -19,6 +18,7 @@
#include <wctype.h>
#include <fnmatch.h>
#include <sys/mman.h>
+#include <limits.h>
#include "basenames.h"
#include "log.h"
@@ -28,6 +28,14 @@
#define GLOB_ABORTED GLOB_ABEND
#endif
+#if !defined(MAP_POPULATE)
+#define MAP_POPULATE 0
+#endif
+
+#if !defined(MADV_DONTFORK)
+#define MADV_DONTFORK 0
+#endif
+
#define REALLOC_STEP 10
#if defined(SunOS)
@@ -100,7 +108,7 @@ static char *readPath(const char *configFile, int lineNum, char *key,
chptr = start;
- while( (len = mbrtowc(&pwc, chptr, strlen(chptr), NULL)) != 0 ) {
+ while( (len = strlen(chptr)) != 0 && (len = mbrtowc(&pwc, chptr, len, NULL)) != 0 ) {
if( len == (size_t)(-1) || len == (size_t)(-2) || !iswprint(pwc) || iswblank(pwc) ) {
message(MESS_ERROR, "%s:%d bad %s path %s\n",
configFile, lineNum, key, start);
@@ -519,12 +527,24 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
length arrays -- of course, if we aren't run setuid it doesn't
matter much */
+#ifdef __FreeBSD__
+ fd = open(configFile, O_RDONLY);
+#else
fd = open(configFile, O_RDONLY | O_CLOEXEC);
+#endif
if (fd < 0) {
message(MESS_ERROR, "failed to open config file %s: %s\n",
configFile, strerror(errno));
return 1;
}
+#ifdef __FreeBSD__
+ if (fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) & FD_CLOEXEC) == -1) {
+ message(MESS_ERROR, "Could not set close-on-exec for file %s\n",
+ configFile);
+ close(fd);
+ return 1;
+ }
+#endif
/* We don't want anybody to change the file while we parse it,
* let's try to lock it for reading. */
if (fcntl(fd, F_SETLK, &fd_lock) == -1) {

View File

@ -1,16 +1,6 @@
diff --git a/logrotate.8 b/logrotate.8
index f18c522..33f9a32 100644
--- a/logrotate.8
+++ b/logrotate.8
@@ -48,14 +48,14 @@ correctly.
Tells \fBlogrotate\fR which command to use when mailing logs. This
command should accept two arguments: 1) the subject of the message, and
2) the recipient. The command must then read a message on standard input
-and mail it to the recipient. The default mail command is \fB/bin/mail
+and mail it to the recipient. The default mail command is \fB/bin/mailx
-s\fR.
.TP
--- logrotate.8.orig 2012-11-09 19:10:08.054188039 +0800
+++ logrotate.8 2012-11-09 19:10:57.749187879 +0800
@@ -59,7 +59,7 @@
\fB-s, -\-state <statefile>\fR
Tells \fBlogrotate\fR to use an alternate state file. This is useful
if logrotate is being run as a different user for various sets of
@ -19,7 +9,7 @@ index f18c522..33f9a32 100644
.TP
\fB-\-usage\fR
@@ -473,10 +473,10 @@ Log files are rotated if the current year is not the same as the last rotation.
@@ -507,10 +507,10 @@
.SH FILES
.PD 0
.TP 27

View File

@ -1,18 +1,11 @@
diff --git a/logrotate.c b/logrotate.c
index 3748918..a528367 100644
--- a/logrotate.c
+++ b/logrotate.c
@@ -1,5 +1,4 @@
--- logrotate.c.orig 2012-11-09 19:00:58.744187984 +0800
+++ logrotate.c 2012-11-09 19:01:05.528189740 +0800
@@ -1,8 +1,4 @@
#include <sys/queue.h>
-/* alloca() is defined in stdlib.h in NetBSD */
-#ifndef __NetBSD__
-#include <alloca.h>
-#endif
#include <limits.h>
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
@@ -16,6 +15,7 @@
#include <locale.h>
#include <sys/types.h>
#include <utime.h>
+#include <limits.h>
#if defined(SunOS)
#include <syslimits.h>