Commit 58f2ea04 authored by Christian Göttsche's avatar Christian Göttsche

New upstream version 3.13.0

parent 578dd769
...@@ -4,7 +4,25 @@ All notable changes to this project will be documented in this file. ...@@ -4,7 +4,25 @@ All notable changes to this project will be documented in this file.
## [UNRELEASED] ## [UNRELEASED]
[UNRELEASED]: https://github.com/logrotate/logrotate/compare/3.12.3...master [UNRELEASED]: https://github.com/logrotate/logrotate/compare/3.13.0...master
## [3.13.0] - 2017-10-13
- make distribution tarballs report logrotate version properly
[RHBZ#1500264](https://bugzilla.redhat.com/1500264)
- make ```(un)compress work``` even if stdin and/or stdout are closed (#154)
- remove ```-s``` from ```DEFAULT_MAIL_COMMAND``` and improve its documenation (#152)
- uncompress logs before mailing them even if ```delaycompress``` is enabled (#151)
- handle unlink of a non-existing log file as a warning only (#144)
- include compile-time options in the output of ```logrotate --version``` (#145)
- make ```logrotate --version``` print to stdout instead of stderr (#145)
- flush write buffers before syncing state file (#148)
- specify (un)compress utility explicitly in tests (#137)
- enable running tests in parallel (#132)
- explicitly map root UID/GID to 0 on Cygwin (#133)
- add ```.dpkg-bak``` and ```.dpkg-del``` to default tabooext list (#134)
[3.13.0]: https://github.com/logrotate/logrotate/compare/3.12.3...3.13.0
## [3.12.3] - 2017-06-30 ## [3.12.3] - 2017-06-30
......
...@@ -6,21 +6,17 @@ The logrotate utility is designed to simplify the administration of log files on ...@@ -6,21 +6,17 @@ The logrotate utility is designed to simplify the administration of log files on
The latest release is: The latest release is:
* [logrotate-3.12.3](https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.3)) * [logrotate-3.13.0](https://github.com/logrotate/logrotate/releases/download/3.13.0/logrotate-3.13.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.13.0/logrotate-3.13.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.13.0))
Previous releases: Previous releases:
* [logrotate-3.12.3](https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.3))
* [logrotate-3.12.2](https://github.com/logrotate/logrotate/releases/download/3.12.2/logrotate-3.12.2.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.2/logrotate-3.12.2.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.2)) * [logrotate-3.12.2](https://github.com/logrotate/logrotate/releases/download/3.12.2/logrotate-3.12.2.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.2/logrotate-3.12.2.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.2))
* [logrotate-3.12.1](https://github.com/logrotate/logrotate/releases/download/3.12.1/logrotate-3.12.1.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.1/logrotate-3.12.1.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.1)) * [logrotate-3.12.1](https://github.com/logrotate/logrotate/releases/download/3.12.1/logrotate-3.12.1.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.1/logrotate-3.12.1.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.1))
* [logrotate-3.12.0](https://github.com/logrotate/logrotate/releases/download/3.12.0/logrotate-3.12.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.0/logrotate-3.12.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.0)) * [logrotate-3.12.0](https://github.com/logrotate/logrotate/releases/download/3.12.0/logrotate-3.12.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.12.0/logrotate-3.12.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.12.0))
* [logrotate-3.11.0](https://github.com/logrotate/logrotate/releases/download/3.11.0/logrotate-3.11.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.11.0/logrotate-3.11.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.11.0)) * [logrotate-3.11.0](https://github.com/logrotate/logrotate/releases/download/3.11.0/logrotate-3.11.0.tar.xz) ([sig](https://github.com/logrotate/logrotate/releases/download/3.11.0/logrotate-3.11.0.tar.xz.asc)) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.11.0))
* [logrotate-3.10.0](https://github.com/logrotate/logrotate/releases/download/3.10.0/logrotate-3.10.0.tar.gz) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.10.0)) * [logrotate-3.10.0](https://github.com/logrotate/logrotate/releases/download/3.10.0/logrotate-3.10.0.tar.gz) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.10.0))
* [logrotate-3.9.2](https://github.com/logrotate/logrotate/releases/download/3.9.2/logrotate-3.9.2.tar.gz) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.9.2)) * [logrotate-3.9.2](https://github.com/logrotate/logrotate/releases/download/3.9.2/logrotate-3.9.2.tar.gz) ([Changelog](https://github.com/logrotate/logrotate/releases/tag/3.9.2))
* [logrotate-3.9.1](https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.9.1.tar.gz)
* [logrotate-3.9.0](https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.9.0.tar.gz)
* [logrotate-3.8.9](https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.9.tar.gz)
* [logrotate-3.8.8](https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.8.tar.gz)
* [logrotate-3.8.7](https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.7.tar.gz)
## Git checkout ## Git checkout
...@@ -46,7 +42,7 @@ and verify the PGP signature on the distribution tarball: ...@@ -46,7 +42,7 @@ and verify the PGP signature on the distribution tarball:
$ gpg --verify logrotate-3.11.0.tar.xz.asc logrotate-3.11.0.tar.xz $ gpg --verify logrotate-3.11.0.tar.xz.asc logrotate-3.11.0.tar.xz
If succesful your GPG output should look like this: If successful your GPG output should look like this:
gpg: Signature made Fri 02 Dec 2016 08:30:39 AM EST gpg: Signature made Fri 02 Dec 2016 08:30:39 AM EST
gpg: using RSA key 873DB37572A37B36 gpg: using RSA key 873DB37572A37B36
......
...@@ -189,7 +189,8 @@ then ...@@ -189,7 +189,8 @@ then
v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`; v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
v_from_git=1 v_from_git=1
elif test "x$fallback" = x || git --version >/dev/null 2>&1; then elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
v=UNKNOWN # fallback for tarballs produced by 'make dist' (use directory suffix)
v="`basename "$PWD" | sed 's/^[^-]*-//'`"
else else
v=$fallback v=$fallback
fi fi
......
...@@ -130,6 +130,8 @@ static const char *defTabooExts[] = { ...@@ -130,6 +130,8 @@ static const char *defTabooExts[] = {
",v", ",v",
".cfsaved", ".cfsaved",
".disabled", ".disabled",
".dpkg-bak",
".dpkg-del",
".dpkg-dist", ".dpkg-dist",
".dpkg-new", ".dpkg-new",
".dpkg-old", ".dpkg-old",
...@@ -254,15 +256,50 @@ static char *readPath(const char *configFile, int lineNum, const char *key, ...@@ -254,15 +256,50 @@ static char *readPath(const char *configFile, int lineNum, const char *key,
return NULL; return NULL;
} }
/* set *pUid to UID of the given user, return non-zero on failure */
static int resolveUid(const char *userName, uid_t *pUid)
{
struct passwd *pw;
#ifdef __CYGWIN__
if (strcmp(userName, "root") == 0) {
*pUid = 0;
return 0;
}
#endif
pw = getpwnam(userName);
if (!pw)
return -1;
*pUid = pw->pw_uid;
endpwent();
return 0;
}
/* set *pGid to GID of the given group, return non-zero on failure */
static int resolveGid(const char *groupName, gid_t *pGid)
{
struct group *gr;
#ifdef __CYGWIN__
if (strcmp(groupName, "root") == 0) {
*pGid = 0;
return 0;
}
#endif
gr = getgrnam(groupName);
if (!gr)
return -1;
*pGid = gr->gr_gid;
endgrent();
return 0;
}
static int readModeUidGid(const char *configFile, int lineNum, char *key, static int readModeUidGid(const char *configFile, int lineNum, char *key,
const char *directive, mode_t *mode, uid_t *uid, const char *directive, mode_t *mode, uid_t *pUid,
gid_t *gid) { gid_t *pGid)
{
char u[200], g[200]; char u[200], g[200];
unsigned int m; unsigned int m;
char tmp; char tmp;
int rc; int rc;
struct group *group;
struct passwd *pw = NULL;
if (!strcmp("su", directive)) if (!strcmp("su", directive))
/* do not read <mode> for the 'su' directive */ /* do not read <mode> for the 'su' directive */
...@@ -291,24 +328,18 @@ static int readModeUidGid(const char *configFile, int lineNum, char *key, ...@@ -291,24 +328,18 @@ static int readModeUidGid(const char *configFile, int lineNum, char *key,
} }
if (rc > 1) { if (rc > 1) {
pw = getpwnam(u); if (resolveUid(u, pUid) != 0) {
if (!pw) {
message(MESS_ERROR, "%s:%d unknown user '%s'\n", message(MESS_ERROR, "%s:%d unknown user '%s'\n",
configFile, lineNum, u); configFile, lineNum, u);
return -1; return -1;
} }
*uid = pw->pw_uid;
endpwent();
} }
if (rc > 2) { if (rc > 2) {
group = getgrnam(g); if (resolveGid(g, pGid) != 0) {
if (!group) {
message(MESS_ERROR, "%s:%d unknown group '%s'\n", message(MESS_ERROR, "%s:%d unknown group '%s'\n",
configFile, lineNum, g); configFile, lineNum, g);
return -1; return -1;
} }
*gid = group->gr_gid;
endgrent();
} }
return 0; return 0;
...@@ -440,7 +471,7 @@ static void copyLogInfo(struct logInfo *to, struct logInfo *from) ...@@ -440,7 +471,7 @@ static void copyLogInfo(struct logInfo *to, struct logInfo *from)
to->oldDir = strdup(from->oldDir); to->oldDir = strdup(from->oldDir);
to->criterium = from->criterium; to->criterium = from->criterium;
to->weekday = from->weekday; to->weekday = from->weekday;
to->threshhold = from->threshhold; to->threshold = from->threshold;
to->minsize = from->minsize; to->minsize = from->minsize;
to->maxsize = from->maxsize; to->maxsize = from->maxsize;
to->rotateCount = from->rotateCount; to->rotateCount = from->rotateCount;
...@@ -658,7 +689,7 @@ int readAllConfigPaths(const char **paths) ...@@ -658,7 +689,7 @@ int readAllConfigPaths(const char **paths)
.numFiles = 0, .numFiles = 0,
.oldDir = NULL, .oldDir = NULL,
.criterium = ROT_SIZE, .criterium = ROT_SIZE,
.threshhold = 1024 * 1024, .threshold = 1024 * 1024,
.minsize = 0, .minsize = 0,
.maxsize = 0, .maxsize = 0,
.rotateCount = 0, .rotateCount = 0,
...@@ -1130,7 +1161,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig) ...@@ -1130,7 +1161,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
} }
if (!strncmp(opt, "size", 4)) { if (!strncmp(opt, "size", 4)) {
newlog->criterium = ROT_SIZE; newlog->criterium = ROT_SIZE;
newlog->threshhold = size; newlog->threshold = size;
} else if (!strncmp(opt, "maxsize", 7)) { } else if (!strncmp(opt, "maxsize", 7)) {
newlog->maxsize = size; newlog->maxsize = size;
} else { } else {
...@@ -1158,7 +1189,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig) ...@@ -1158,7 +1189,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
newlog->criterium = ROT_HOURLY; newlog->criterium = ROT_HOURLY;
} else if (!strcmp(key, "daily")) { } else if (!strcmp(key, "daily")) {
newlog->criterium = ROT_DAYS; newlog->criterium = ROT_DAYS;
newlog->threshhold = 1; newlog->threshold = 1;
} else if (!strcmp(key, "monthly")) { } else if (!strcmp(key, "monthly")) {
newlog->criterium = ROT_MONTHLY; newlog->criterium = ROT_MONTHLY;
} else if (!strcmp(key, "weekly")) { } else if (!strcmp(key, "weekly")) {
...@@ -1449,7 +1480,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig) ...@@ -1449,7 +1480,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
newlog->compress_prog); newlog->compress_prog);
compresscmd_base = strdup(basename(newlog->compress_prog)); compresscmd_base = strdup(basename(newlog->compress_prog));
/* we check whether we changed the compress_cmd. In case we use the apropriate extension /* we check whether we changed the compress_cmd. In case we use the appropriate extension
as listed in compress_cmd_list */ as listed in compress_cmd_list */
for(i = 0; i < compress_cmd_list_size; i++) { for(i = 0; i < compress_cmd_list_size; i++) {
if (!strcmp(compress_cmd_list[i].cmd, compresscmd_base)) { if (!strcmp(compress_cmd_list[i].cmd, compresscmd_base)) {
......
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for logrotate 3.12.3. # Generated by GNU Autoconf 2.69 for logrotate 3.13.0.
# #
# #
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
...@@ -577,8 +577,8 @@ MAKEFLAGS= ...@@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='logrotate' PACKAGE_NAME='logrotate'
PACKAGE_TARNAME='logrotate' PACKAGE_TARNAME='logrotate'
PACKAGE_VERSION='3.12.3' PACKAGE_VERSION='3.13.0'
PACKAGE_STRING='logrotate 3.12.3' PACKAGE_STRING='logrotate 3.13.0'
PACKAGE_BUGREPORT='' PACKAGE_BUGREPORT=''
PACKAGE_URL='https://github.com/logrotate/logrotate' PACKAGE_URL='https://github.com/logrotate/logrotate'
...@@ -1286,7 +1286,7 @@ if test "$ac_init_help" = "long"; then ...@@ -1286,7 +1286,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures logrotate 3.12.3 to adapt to many kinds of systems. \`configure' configures logrotate 3.13.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
...@@ -1356,7 +1356,7 @@ fi ...@@ -1356,7 +1356,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of logrotate 3.12.3:";; short | recursive ) echo "Configuration of logrotate 3.13.0:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
...@@ -1384,7 +1384,7 @@ Optional Packages: ...@@ -1384,7 +1384,7 @@ Optional Packages:
path to state file (/var/lib/logrotate.status by path to state file (/var/lib/logrotate.status by
default) default)
--with-default-mail-command=COMMAND --with-default-mail-command=COMMAND
default mail command (e.g. /bin/mail -s) default mail command (e.g. /bin/mail)
--with-compress-command=COMMAND --with-compress-command=COMMAND
compress command (default: /bin/gzip) compress command (default: /bin/gzip)
--with-uncompress-command=COMMAND --with-uncompress-command=COMMAND
...@@ -1469,7 +1469,7 @@ fi ...@@ -1469,7 +1469,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
logrotate configure 3.12.3 logrotate configure 3.13.0
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
...@@ -1891,7 +1891,7 @@ cat >config.log <<_ACEOF ...@@ -1891,7 +1891,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by logrotate $as_me 3.12.3, which was It was created by logrotate $as_me 3.13.0, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
...@@ -2240,8 +2240,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ...@@ -2240,8 +2240,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
am__api_version='1.15' am__api_version='1.15'
ac_aux_dir= ac_aux_dir=
...@@ -2757,7 +2755,7 @@ fi ...@@ -2757,7 +2755,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='logrotate' PACKAGE='logrotate'
VERSION='3.12.3' VERSION='3.13.0'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
...@@ -5900,7 +5898,7 @@ case "$host" in ...@@ -5900,7 +5898,7 @@ case "$host" in
DEFAULT_MAIL_COMMAND="/usr/bin/mailx" DEFAULT_MAIL_COMMAND="/usr/bin/mailx"
;; ;;
*-netbsd*) *-netbsd*)
DEFAULT_MAIL_COMMAND="/usr/bin/mail -s" DEFAULT_MAIL_COMMAND="/usr/bin/mail"
COMPRESS_COMMAND="/usr/bin/gzip" COMPRESS_COMMAND="/usr/bin/gzip"
UNCOMPRESS_COMMAND="/usr/bin/gunzip" UNCOMPRESS_COMMAND="/usr/bin/gunzip"
;; ;;
...@@ -6042,7 +6040,7 @@ done ...@@ -6042,7 +6040,7 @@ done
ac_config_headers="$ac_config_headers config.h" ac_config_headers="$ac_config_headers config.h"
AM_CFLAGS="-Wall" AM_CFLAGS="-Wall -Wextra -Wmissing-format-attribute -Wmissing-noreturn -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wunused -Wwrite-strings"
# Check whether --enable-werror was given. # Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then : if test "${enable_werror+set}" = set; then :
enableval=$enable_werror; enable_werror="$enableval" enableval=$enable_werror; enable_werror="$enableval"
...@@ -6591,7 +6589,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ...@@ -6591,7 +6589,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by logrotate $as_me 3.12.3, which was This file was extended by logrotate $as_me 3.13.0, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
...@@ -6658,7 +6656,7 @@ _ACEOF ...@@ -6658,7 +6656,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
logrotate config.status 3.12.3 logrotate config.status 3.13.0
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"
......
AC_INIT([logrotate],m4_esyscmd([build-aux/git-version-gen --prefix '' .tarball-version]), AC_INIT([logrotate],m4_esyscmd([build-aux/git-version-gen --prefix '' .tarball-version]),
[],[],[https://github.com/logrotate/logrotate]) [],[],[https://github.com/logrotate/logrotate])
dnl serial-test not supported prior version 1.12
m4_define([serial_tests], [
m4_esyscmd([automake --version |
perl -nae '{@v = split("[.]", $F[-1]);
if ($v[0] >= 1 && $v[1] >= 12)
{print "serial-tests\n";}
exit;}'
])
])
dnl foreign: Do not require AUTHORS, ChangeLog, NEWS, and README to exist dnl foreign: Do not require AUTHORS, ChangeLog, NEWS, and README to exist
dnl serial_tests: Do not hide standard output of our sequential test-suite
dnl dist-xz: Produce tar.xz version of the release archive dnl dist-xz: Produce tar.xz version of the release archive
AM_INIT_AUTOMAKE(foreign dist-xz serial_tests) AM_INIT_AUTOMAKE(foreign dist-xz)
# --enable-silent-rules # --enable-silent-rules
m4_ifdef([AM_SILENT_RULES], m4_ifdef([AM_SILENT_RULES],
...@@ -82,7 +71,7 @@ case "$host" in ...@@ -82,7 +71,7 @@ case "$host" in
DEFAULT_MAIL_COMMAND="/usr/bin/mailx" DEFAULT_MAIL_COMMAND="/usr/bin/mailx"
;; ;;
*-netbsd*) *-netbsd*)
DEFAULT_MAIL_COMMAND="/usr/bin/mail -s" DEFAULT_MAIL_COMMAND="/usr/bin/mail"
COMPRESS_COMMAND="/usr/bin/gzip" COMPRESS_COMMAND="/usr/bin/gzip"
UNCOMPRESS_COMMAND="/usr/bin/gunzip" UNCOMPRESS_COMMAND="/usr/bin/gunzip"
;; ;;
...@@ -110,7 +99,7 @@ AC_SUBST(STATE_FILE_PATH) ...@@ -110,7 +99,7 @@ AC_SUBST(STATE_FILE_PATH)
AC_ARG_WITH([default-mail-command], AC_ARG_WITH([default-mail-command],
AC_HELP_STRING([--with-default-mail-command=COMMAND], AC_HELP_STRING([--with-default-mail-command=COMMAND],
[default mail command (e.g. /bin/mail -s)]), [default mail command (e.g. /bin/mail)]),
[ [
case "$withval" in case "$withval" in
yes|no) yes|no)
...@@ -178,7 +167,7 @@ AC_SUBST(ROOT_UID) ...@@ -178,7 +167,7 @@ AC_SUBST(ROOT_UID)
AC_CHECK_FUNCS([asprintf fork madvise qsort strndup strptime vfork vsyslog]) AC_CHECK_FUNCS([asprintf fork madvise qsort strndup strptime vfork vsyslog])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AM_CFLAGS="-Wall" AM_CFLAGS="-Wall -Wextra -Wmissing-format-attribute -Wmissing-noreturn -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -Wunused -Wwrite-strings"
AC_ARG_ENABLE([werror], AC_ARG_ENABLE([werror],
[AS_HELP_STRING([--enable-werror], [AS_HELP_STRING([--enable-werror],
[Treat warnings as errors (default: warnings are not errors)])], [Treat warnings as errors (default: warnings are not errors)])],
......
...@@ -37,6 +37,7 @@ void logToSyslog(int enable) { ...@@ -37,6 +37,7 @@ void logToSyslog(int enable) {
#endif #endif
} }
__attribute__((format (printf, 3, 0)))
static void log_once(FILE *where, int level, const char *format, va_list args) static void log_once(FILE *where, int level, const char *format, va_list args)
{ {
switch (level) { switch (level) {
...@@ -53,6 +54,7 @@ static void log_once(FILE *where, int level, const char *format, va_list args) ...@@ -53,6 +54,7 @@ static void log_once(FILE *where, int level, const char *format, va_list args)
fflush(where); fflush(where);
} }
__attribute__((format (printf, 2, 3)))
void message(int level, const char *format, ...) void message(int level, const char *format, ...)
{ {
va_list args; va_list args;
......
.TH LOGROTATE 8 "3.12.3" "Linux" "System Administrator's Manual" .TH LOGROTATE 8 "3.13.0" "Linux" "System Administrator's Manual"
.SH NAME .SH NAME
logrotate \(hy rotates, compresses, and mails system logs logrotate \(hy rotates, compresses, and mails system logs
.SH SYNOPSIS .SH SYNOPSIS
...@@ -63,9 +63,9 @@ output logged to that file is the same as when running \fBlogrotate\fR with ...@@ -63,9 +63,9 @@ output logged to that file is the same as when running \fBlogrotate\fR with
.TP .TP
\fB\-m\fR, \fB\-\-mail\fR \fIcommand\fR \fB\-m\fR, \fB\-\-mail\fR \fIcommand\fR
Tells \fBlogrotate\fR which command to use when mailing logs. This Tells \fBlogrotate\fR which command to use when mailing logs. This
command should accept two arguments: command should accept the following arguments:
.IP .IP
1) the subject of the message 1) the subject of the message given with '-s subject'
.br .br
2) the recipient. 2) the recipient.
.IP .IP
...@@ -576,6 +576,8 @@ is replaced. At startup, the taboo extension list ...@@ -576,6 +576,8 @@ is replaced. At startup, the taboo extension list
.IR ,v , .IR ,v ,
.IR .cfsaved , .IR .cfsaved ,
.IR .disabled , .IR .disabled ,
.IR .dpkg\-bak ,
.IR .dpkg\-del ,
.IR .dpkg\-dist , .IR .dpkg\-dist ,
.IR .dpkg\-new , .IR .dpkg\-new ,
.IR .dpkg\-old , .IR .dpkg\-old ,
...@@ -600,7 +602,7 @@ is replaced. At startup, the taboo pattern list is empty. ...@@ -600,7 +602,7 @@ is replaced. At startup, the taboo pattern list is empty.
\fBweekly\fR [\fIweekday\fR] \fBweekly\fR [\fIweekday\fR]
Log files are rotated once each \fIweekday\fR, or if the date is advanced by at Log files are rotated once each \fIweekday\fR, or if the date is advanced by at
least 7 days since the last rotation (while ignoring the exact time). The least 7 days since the last rotation (while ignoring the exact time). The
\fIweekday\fR intepretation is following: 0 means Sunday, 1 means Monday, ..., \fIweekday\fR interpretation is following: 0 means Sunday, 1 means Monday, ...,
6 means Saturday; the special value 7 means each 7 days, irrespectively of 6 means Saturday; the special value 7 means each 7 days, irrespectively of
weekday. Defaults to 0 if the \fIweekday\fR argument is omitted. weekday. Defaults to 0 if the \fIweekday\fR argument is omitted.
......
...@@ -63,9 +63,9 @@ output logged to that file is the same as when running \fBlogrotate\fR with ...@@ -63,9 +63,9 @@ output logged to that file is the same as when running \fBlogrotate\fR with
.TP .TP
\fB\-m\fR, \fB\-\-mail\fR \fIcommand\fR \fB\-m\fR, \fB\-\-mail\fR \fIcommand\fR
Tells \fBlogrotate\fR which command to use when mailing logs. This Tells \fBlogrotate\fR which command to use when mailing logs. This
command should accept two arguments: command should accept the following arguments:
.IP .IP
1) the subject of the message 1) the subject of the message given with '-s subject'
.br .br
2) the recipient. 2) the recipient.
.IP .IP
...@@ -576,6 +576,8 @@ is replaced. At startup, the taboo extension list ...@@ -576,6 +576,8 @@ is replaced. At startup, the taboo extension list
.IR ,v , .IR ,v ,
.IR .cfsaved , .IR .cfsaved ,
.IR .disabled , .IR .disabled ,
.IR .dpkg\-bak ,
.IR .dpkg\-del ,
.IR .dpkg\-dist , .IR .dpkg\-dist ,
.IR .dpkg\-new , .IR .dpkg\-new ,
.IR .dpkg\-old , .IR .dpkg\-old ,
...@@ -600,7 +602,7 @@ is replaced. At startup, the taboo pattern list is empty. ...@@ -600,7 +602,7 @@ is replaced. At startup, the taboo pattern list is empty.
\fBweekly\fR [\fIweekday\fR] \fBweekly\fR [\fIweekday\fR]
Log files are rotated once each \fIweekday\fR, or if the date is advanced by at Log files are rotated once each \fIweekday\fR, or if the date is advanced by at
least 7 days since the last rotation (while ignoring the exact time). The least 7 days since the last rotation (while ignoring the exact time). The
\fIweekday\fR intepretation is following: 0 means Sunday, 1 means Monday, ..., \fIweekday\fR interpretation is following: 0 means Sunday, 1 means Monday, ...,
6 means Saturday; the special value 7 means each 7 days, irrespectively of 6 means Saturday; the special value 7 means each 7 days, irrespectively of
weekday. Defaults to 0 if the \fIweekday\fR argument is omitted. weekday. Defaults to 0 if the \fIweekday\fR argument is omitted.
......
This diff is collapsed.
...@@ -49,7 +49,7 @@ struct logInfo { ...@@ -49,7 +49,7 @@ struct logInfo {
enum { ROT_HOURLY, ROT_DAYS, ROT_WEEKLY, ROT_MONTHLY, ROT_YEARLY, ROT_SIZE enum { ROT_HOURLY, ROT_DAYS, ROT_WEEKLY, ROT_MONTHLY, ROT_YEARLY, ROT_SIZE
} criterium; } criterium;
int weekday; /* used by ROT_WEEKLY only */ int weekday; /* used by ROT_WEEKLY only */
off_t threshhold; off_t threshold;
off_t maxsize; off_t maxsize;
off_t minsize; off_t minsize;
int rotateCount; int rotateCount;
......
Summary: Rotates, compresses, removes and mails system log files Summary: Rotates, compresses, removes and mails system log files
Name: logrotate Name: logrotate
Version: 3.12.3 Version: 3.13.0
Release: 1%{?dist} Release: 1%{?dist}
License: GPLv2+ License: GPLv2+
Group: System Environment/Base Group: System Environment/Base
......
#! /bin/sh
# test-driver - basic testsuite driver script.
scriptversion=2013-07-13.22; # UTC
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
usage_error ()
{
echo "$0: $*" >&2
print_usage >&2
exit 2
}
print_usage ()
{
cat <<END
Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
END
}
test_name= # Used for reporting.
log_file= # Where to save the output of the test script.