rpms/logrotate/devel logrotate-3.7.6-fdclose.patch, NONE, 1.1 logrotate-3.7.6-segfault.patch, 1.1, 1.2 logrotate.spec, 1.71, 1.72
Tomas Smetana (tsmetana)
fedora-extras-commits at redhat.com
Wed Apr 23 12:46:32 UTC 2008
- Previous message (by thread): rpms/htdig/devel htdig.spec,1.43,1.44
- Next message (by thread): rpms/quota/devel .cvsignore, 1.10, 1.11 quota-3.06-no-stripping.patch, 1.1, 1.2 quota.spec, 1.41, 1.42 sources, 1.11, 1.12 quota-3.15-manpages.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: tsmetana
Update of /cvs/pkgs/rpms/logrotate/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29335
Modified Files:
logrotate-3.7.6-segfault.patch logrotate.spec
Added Files:
logrotate-3.7.6-fdclose.patch
Log Message:
* Wed Apr 23 2008 Tomas Smetana <tsmetana at redhat.com> 3.7.6-4
- improve patch for #432330
logrotate-3.7.6-fdclose.patch:
--- NEW FILE logrotate-3.7.6-fdclose.patch ---
diff -up logrotate-3.7.6/logrotate.c.fdclose logrotate-3.7.6/logrotate.c
--- logrotate-3.7.6/logrotate.c.fdclose 2008-04-21 11:49:57.000000000 +0200
+++ logrotate-3.7.6/logrotate.c 2008-04-21 11:53:08.000000000 +0200
@@ -935,6 +935,9 @@ int rotateSingleLog(logInfo * log, int l
if (oldContext != NULL) {
freecon(oldContext);
}
+ if (close(fdcurr) < 0)
+ message(MESS_ERROR, "error closing file %s",
+ log->files[logNum]);
return 1;
}
}
@@ -946,6 +949,9 @@ int rotateSingleLog(logInfo * log, int l
if (oldContext != NULL) {
freecon(oldContext);
}
+ if (close(fdcurr) < 0)
+ message(MESS_ERROR, "error closing file %s",
+ log->files[logNum]);
return 1;
}
}
@@ -959,10 +965,16 @@ int rotateSingleLog(logInfo * log, int l
message(MESS_ERROR, "getting file context %s: %s\n",
log->files[logNum], strerror(errno));
if (selinux_enforce) {
+ if (close(fdcurr) < 0)
+ message(MESS_ERROR, "error closing file %s",
+ log->files[logNum]);
return 1;
}
}
}
+ if (close(fdcurr) < 0)
+ message(MESS_ERROR, "error closing file %s",
+ log->files[logNum]);
}
#endif
message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
logrotate-3.7.6-segfault.patch:
Index: logrotate-3.7.6-segfault.patch
===================================================================
RCS file: /cvs/pkgs/rpms/logrotate/devel/logrotate-3.7.6-segfault.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- logrotate-3.7.6-segfault.patch 11 Feb 2008 10:41:13 -0000 1.1
+++ logrotate-3.7.6-segfault.patch 23 Apr 2008 12:45:56 -0000 1.2
@@ -1,52 +1,11 @@
diff -up logrotate-3.7.6/logrotate.c.segfault logrotate-3.7.6/logrotate.c
---- logrotate-3.7.6/logrotate.c.segfault 2008-02-11 11:33:52.000000000 +0100
-+++ logrotate-3.7.6/logrotate.c 2008-02-11 11:34:59.000000000 +0100
-@@ -1325,7 +1325,7 @@ static int readState(char *stateFilename
- {
- FILE *f;
- char buf[1024];
-- const char **argv;
-+ const char **argv = NULL;
- int argc;
- int year, month, day;
- int i;
-@@ -1409,7 +1409,8 @@ static int readState(char *stateFilename
- message(MESS_ERROR,
- "bad year %d for file %s in state file %s\n", year,
- argv[0], stateFilename);
-- free(argv);
-+ if(argv)
-+ free(argv);
- fclose(f);
- return 1;
- }
-@@ -1418,7 +1419,8 @@ static int readState(char *stateFilename
- message(MESS_ERROR,
- "bad month %d for file %s in state file %s\n", month,
- argv[0], stateFilename);
-- free(argv);
-+ if(argv)
-+ free(argv);
- fclose(f);
- return 1;
- }
-@@ -1428,7 +1430,8 @@ static int readState(char *stateFilename
- message(MESS_ERROR,
- "bad day %d for file %s in state file %s\n", day,
- argv[0], stateFilename);
-- free(argv);
-+ if(argv)
-+ free(argv);
- fclose(f);
- return 1;
- }
-@@ -1445,7 +1448,8 @@ static int readState(char *stateFilename
- lr_time = mktime(&st->lastRotated);
- st->lastRotated = *localtime(&lr_time);
+--- logrotate-3.7.6/logrotate.c.segfault 2008-04-23 14:40:51.000000000 +0200
++++ logrotate-3.7.6/logrotate.c 2008-04-23 14:41:14.000000000 +0200
+@@ -1380,6 +1380,7 @@ static int readState(char *stateFilename
+ line++;
-- free(argv);
-+ if(argv)
-+ free(argv);
- }
-
- fclose(f);
+ while (fgets(buf, sizeof(buf) - 1, f)) {
++ argv = NULL;
+ line++;
+ i = strlen(buf);
+ if (buf[i - 1] != '\n') {
Index: logrotate.spec
===================================================================
RCS file: /cvs/pkgs/rpms/logrotate/devel/logrotate.spec,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- logrotate.spec 11 Feb 2008 10:41:13 -0000 1.71
+++ logrotate.spec 23 Apr 2008 12:45:56 -0000 1.72
@@ -1,7 +1,7 @@
Summary: Rotates, compresses, removes and mails system log files
Name: logrotate
Version: 3.7.6
-Release: 3%{?dist}
+Release: 4%{?dist}
License: GPL+
Group: System Environment/Base
# The source for this package was pulled from cvs.
@@ -63,6 +63,9 @@
%attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate.status
%changelog
+* Wed Apr 23 2008 Tomas Smetana <tsmetana at redhat.com> 3.7.6-4
+- improve patch for #432330
+
* Mon Feb 11 2008 Tomas Smetana <tsmetana at redhat.com> 3.7.6-3
- fix #432330 segfault on corrupted status file
- Previous message (by thread): rpms/htdig/devel htdig.spec,1.43,1.44
- Next message (by thread): rpms/quota/devel .cvsignore, 1.10, 1.11 quota-3.06-no-stripping.patch, 1.1, 1.2 quota.spec, 1.41, 1.42 sources, 1.11, 1.12 quota-3.15-manpages.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list