Log file size is limited to 4G
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logrotate (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: logrotate
logrotate internally stores threshhold as unsigned int. Thus file rotation cannot be setup to value greater than 4G. Worst thing is that logrotate quietly rounds file size, and it size is specified as 9G, effective size will be 1G.
Patch is:
===
Index: logrotate-
=======
--- logrotate-
+++ logrotate-
@@ -1253,7 +1253,7 @@
message(
switch (log->criterium) {
case ROT_DAYS:
- message(MESS_DEBUG, "after %d days ", log->threshhold);
+ message(MESS_DEBUG, "after %lld days ", (long long) log->threshhold);
break;
case ROT_WEEKLY:
@@ -1265,7 +1265,7 @@
break;
case ROT_SIZE:
- message(MESS_DEBUG, "%d bytes ", log->threshhold);
+ message(MESS_DEBUG, "%lld bytes ", (long long) log->threshhold);
break;
case ROT_FORCE:
@@ -1286,7 +1286,7 @@
if (log->minsize)
- message(MESS_DEBUG, "only log files >= %d bytes are rotated, ", log->minsize);
+ message(MESS_DEBUG, "only log files >= %lld bytes are rotated, ", (long long) log->minsize);
if (log->logAddress) {
Index: logrotate-
=======
--- logrotate-
+++ logrotate-
@@ -33,8 +33,8 @@
char *oldDir;
enum { ROT_DAYS, ROT_WEEKLY, ROT_MONTHLY, ROT_YEARLY, ROT_SIZE,
- unsigned int threshhold;
- unsigned int minsize;
+ off_t threshhold;
+ off_t minsize;
int rotateCount;
int rotateAge;
int logStart;
Index: logrotate-
=======
--- logrotate-
+++ logrotate-
@@ -484,7 +484,7 @@
char oldchar, foo;
off_t length;
int lineNum = 1;
- int multiplier;
+ off_t multiplier;
int i, k;
char *scriptStart = NULL;
char **scriptDest = NULL;
@@ -792,7 +792,7 @@
} else if (!strcmp(start, "size") || !strcmp(start, "minsize")) {
- unsigned int size = 0;
+ off_t size = 0;
===
Is anybody there? Bug is easy to understand and easy to fix, patch provided. What are you waiting for?