~ubuntu-branches/ubuntu/hardy/logrotate/hardy-updates

« back to all changes in this revision

Viewing changes to debian/patches/dst.patch

  • Committer: Bazaar Package Importer
  • Author(s): Paul Martin
  • Date: 2006-04-08 23:02:19 UTC
  • mfrom: (3.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20060408230219-7moi9qw2g42w1nye
Tags: 3.7.1-3
* Patch debian/control to fix FTBFS on kfreebsd-amd64. Perhaps we need
  a build-depends macro for !kfreebsd. (Closes: #361465)
* Use and depend on debhelper version 5.
* Switch from dpatch to quilt.
* cpp-crossbuild.patch: change from using $(CPP) to $(CC) -E.
  Thanks to NIIBE Yutaka. (Closes: #284040)
* dst.patch: fix mktime initialisation so that daylight savings is
  taken into account. Thanks to Holger Weiss. (Closes: #278591)
* man-333996.patch: fix typos in logrotate.8 where "then" should be
  "than". Thanks to Adrian Knoth. (Closes: #333996)
* manpage.patch: Apply missed fixes from #101272. Thanks to J S Bygott.
  (Closes: #335060)
* script-argument.patch: Allow the use of $1 in scripts again.
  (Closes: #330783)
* README.Debian: Document that sysklogd does its own log rotation.
  (Closes: #308963)
* README.Debian: Document how scripts are called. (Closes: #308920)
* Update the copyright file.
* debian/control: remove versioned dependency on cron. The version of
  cron forbidden pre-dates woody (currently "oldstable") by several
  years. This versioned dependency is preventing logrotate being
  installed with bcron. (Closes: #304038, #349150)
* debian/rules: Fix backports, allowing them to use selinux.
  (Closes: #340363)
* uncompressChild-warning.patch: Fix a "might be used uninitialised" 
  warning from gcc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Closes: #278591
 
2
Patch from: Holger Weiss <holger@ZEDAT.FU-Berlin.DE>
 
3
 
 
4
If you call logrotate once a week between 00:00 and 01:00 AM and
 
5
daylight saving time is in effect, "weekly" rotations will be done only
 
6
once in two weeks.  E.g., the following crontab won't work as expected:
 
7
 
 
8
12 0 * * 1 /usr/sbin/logrotate
 
9
 
 
10
logrotate uses the tm struct "lastRotated" in order to find out whether
 
11
a logfile needs rotating.  "lastRotated" is filled by first setting
 
12
everything to zero, then setting the mday, month and year of the last
 
13
rotation and then calling mktime(3) in order to normalize the rest of
 
14
the struct.  The problem is that if daylight saving time is in effect,
 
15
mktime() will increment "lastRotated.tm_isdst" from 0 to 1 and push
 
16
"lastRotated" by one hour.  Hence, the current time will be compared
 
17
with the day of the last rotation, 01:00 AM.  This can be solved by
 
18
setting lastRotated.tm_isdst correctly prior to the mktime() call.
 
19
 
 
20
 
 
21
Index: logrotate-3.7.1/logrotate.c
 
22
===================================================================
 
23
--- logrotate-3.7.1.orig/logrotate.c    2006-04-08 21:36:03.268110593 +0100
 
24
+++ logrotate-3.7.1/logrotate.c 2006-04-08 21:36:11.342764986 +0100
 
25
@@ -78,6 +78,7 @@
 
26
        states[i].lastRotated.tm_mon = now.tm_mon;
 
27
        states[i].lastRotated.tm_mday = now.tm_mday;
 
28
        states[i].lastRotated.tm_year = now.tm_year;
 
29
+       states[i].lastRotated.tm_isdst = now.tm_isdst;
 
30
 
 
31
        /* fill in the rest of the st->lastRotated fields */
 
32
        lr_time = mktime(&states[i].lastRotated);