rpms/logrotate/FC-6 logrotate-errorConfiguration.patch, 1.1, 1.2 logrotate.spec, 1.55, 1.56

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Feb 8 14:40:39 UTC 2007


Author: pvrabec

Update of /cvs/dist/rpms/logrotate/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv1512

Modified Files:
	logrotate-errorConfiguration.patch logrotate.spec 
Log Message:
fix problem with compress_options_list (#227706)


logrotate-errorConfiguration.patch:
 config.c |  356 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 312 insertions(+), 44 deletions(-)

Index: logrotate-errorConfiguration.patch
===================================================================
RCS file: /cvs/dist/rpms/logrotate/FC-6/logrotate-errorConfiguration.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- logrotate-errorConfiguration.patch	23 Jan 2007 12:05:41 -0000	1.1
+++ logrotate-errorConfiguration.patch	8 Feb 2007 14:40:37 -0000	1.2
@@ -1,6 +1,6 @@
---- logrotate-3.7.4/config.c.old	2006-07-24 14:08:04.000000000 +0200
-+++ logrotate-3.7.4/config.c	2006-09-23 11:02:44.000000000 +0200
-@@ -177,12 +177,114 @@
+--- logrotate-3.7.4/config.c.errorConfiguration	2007-02-08 15:19:14.000000000 +0100
++++ logrotate-3.7.4/config.c	2007-02-08 15:19:37.000000000 +0100
+@@ -192,12 +192,109 @@
      free(array);
  }
  
@@ -40,12 +40,8 @@
 +    to->createUid = from->createUid;
 +    to->createGid = from->createGid;
 +    if (from->compress_options_count) {
-+	to->compress_options_list = (const char **)
-+	    malloc(from->compress_options_count * sizeof(const char *));
-+	for (i = 0; i < from->compress_options_count; i++)
-+	    to->compress_options_list[i] =
-+		strdup(from->compress_options_list[i]);
-+	to->compress_options_count = from->compress_options_count;
++        poptDupArgv(from->compress_options_count, from->compress_options_list, 
++                    &to->compress_options_count,  &to->compress_options_list);
 +    }
 +}
 +
@@ -76,8 +72,7 @@
 +    if (log->compress_ext)
 +	free(log->compress_ext);
 +    if (log->compress_options_list)
-+	free_2d_array((char **)log->compress_options_list,
-+		      log->compress_options_count);
++	free(log->compress_options_list);
 +}
 +
 +static void freeTailLogs(logInfo ** logsPtr, int *numLogsPtr,
@@ -116,7 +111,7 @@
  
      if (stat(path, &sb)) {
  	message(MESS_ERROR, "cannot stat %s: %s\n", path, strerror(errno));
-@@ -264,30 +366,45 @@
+@@ -279,30 +376,45 @@
  
  	for (i = 0; i < files_count; ++i) {
  	    assert(namelist[i] != NULL);
@@ -171,7 +166,7 @@
      const char **file;
      logInfo defConfig = { /* pattern */ NULL,
  	/* files, numFiles */ NULL, 0,
-@@ -323,12 +440,13 @@
+@@ -338,12 +450,13 @@
  
      for (file = paths; *file; file++) {
  	if (readConfigPath(*file, &defConfig, logsPtr, numLogsPtr)) {
@@ -188,7 +183,7 @@
  }
  
  static int globerr(const char *pathname, int theerr)
-@@ -340,6 +458,12 @@
+@@ -355,6 +468,12 @@
      return 1;
  }
  
@@ -201,7 +196,7 @@
  static int readConfigFile(const char *configFile, logInfo * defConfig,
  			  logInfo ** logsPtr, int *numLogsPtr)
  {
-@@ -364,6 +488,7 @@
+@@ -379,6 +498,7 @@
      glob_t globResult;
      const char **argv;
      int argc, argNum;
@@ -209,7 +204,7 @@
  
      /* FIXME: createOwner and createGroup probably shouldn't be fixed
         length arrays -- of course, if we aren't run setuid it doesn't
-@@ -417,6 +542,28 @@
+@@ -432,6 +552,28 @@
  
      start = buf;
      while (*start) {
@@ -238,7 +233,7 @@
  	while (isblank(*start) && (*start))
  	    start++;
  	if (*start == '#') {
-@@ -549,7 +696,13 @@
+@@ -564,7 +706,13 @@
  		if (rc == 4) {
  		    message(MESS_ERROR, "%s:%d extra arguments for "
  			    "create\n", configFile, lineNum);
@@ -253,7 +248,7 @@
  		}
  
  		if (rc > 0)
-@@ -560,7 +713,13 @@
+@@ -575,7 +723,13 @@
  		    if (!pw) {
  			message(MESS_ERROR, "%s:%d unknown user '%s'\n",
  				configFile, lineNum, createOwner);
@@ -268,7 +263,7 @@
  		    }
  		    newlog->createUid = pw->pw_uid;
  		    endpwent();
-@@ -570,7 +729,13 @@
+@@ -585,7 +739,13 @@
  		    if (!group) {
  			message(MESS_ERROR, "%s:%d unknown group '%s'\n",
  				configFile, lineNum, createGroup);
@@ -283,7 +278,7 @@
  		    }
  		    newlog->createGid = group->gr_gid;
  		    endgrent();
-@@ -605,7 +770,13 @@
+@@ -620,7 +780,13 @@
  		    } else if (!isdigit(start[length])) {
  			message(MESS_ERROR, "%s:%d unknown unit '%c'\n",
  				configFile, lineNum, start[length]);
@@ -298,7 +293,7 @@
  		    } else {
  			multiplier = 1;
  		    }
-@@ -614,7 +785,13 @@
+@@ -629,7 +795,13 @@
  		    if (*chptr) {
  			message(MESS_ERROR, "%s:%d bad size '%s'\n",
  				configFile, lineNum, start);
@@ -312,8 +307,8 @@
 +			}
  		    }
  
- 		    if (!strcmp(opt, "size")) {
-@@ -676,7 +853,13 @@
+ 		    if (!strncmp(opt, "size", 4)) {
+@@ -691,7 +863,13 @@
  			message(MESS_ERROR,
  				"%s:%d bad rotation count '%s'\n",
  				configFile, lineNum, start);
@@ -328,7 +323,7 @@
  		    }
  		    *endtag = oldchar, start = endtag;
  		}
-@@ -692,7 +875,13 @@
+@@ -707,7 +885,13 @@
  		    if (*chptr || newlog->logStart < 0) {
  			message(MESS_ERROR, "%s:%d bad start count '%s'\n",
  				configFile, lineNum, start);
@@ -343,7 +338,7 @@
  		    }
  		    *endtag = oldchar, start = endtag;
  		}
-@@ -708,7 +897,13 @@
+@@ -723,7 +907,13 @@
  		    if (*chptr || newlog->rotateAge < 0) {
  			message(MESS_ERROR, "%s:%d bad maximum age '%s'\n",
  				configFile, lineNum, start);
@@ -358,7 +353,7 @@
  		    }
  		    *endtag = oldchar, start = endtag;
  		}
-@@ -718,13 +913,18 @@
+@@ -733,13 +923,18 @@
  			configFile, lineNum);
  	    } else if (!strcmp(start, "mail")) {
  		*endtag = oldchar, start = endtag;
@@ -380,7 +375,7 @@
  
  		*endtag = oldchar, start = endtag;
  	    } else if (!strcmp(start, "missingok")) {
-@@ -738,6 +938,8 @@
+@@ -753,6 +948,8 @@
  	    } else if (!strcmp(start, "prerotate")) {
  		*endtag = oldchar, start = endtag;
  
@@ -389,7 +384,7 @@
  		scriptStart = start;
  		scriptDest = &newlog->pre;
  
-@@ -746,6 +948,8 @@
+@@ -761,6 +958,8 @@
  	    } else if (!strcmp(start, "firstaction")) {
  		*endtag = oldchar, start = endtag;
  
@@ -398,7 +393,7 @@
  		scriptStart = start;
  		scriptDest = &newlog->first;
  
-@@ -754,6 +958,8 @@
+@@ -769,6 +968,8 @@
  	    } else if (!strcmp(start, "postrotate")) {
  		*endtag = oldchar, start = endtag;
  
@@ -407,7 +402,7 @@
  		scriptStart = start;
  		scriptDest = &newlog->post;
  
-@@ -762,6 +968,8 @@
+@@ -777,6 +978,8 @@
  	    } else if (!strcmp(start, "lastaction")) {
  		*endtag = oldchar, start = endtag;
  
@@ -416,7 +411,7 @@
  		scriptStart = start;
  		scriptDest = &newlog->last;
  
-@@ -773,7 +981,9 @@
+@@ -788,7 +991,9 @@
  			    "%s:%d tabooext may not appear inside "
  			    "of log file definition\n", configFile,
  			    lineNum);
@@ -427,7 +422,7 @@
  		}
  
  		*endtag = oldchar, start = endtag;
-@@ -819,7 +1029,9 @@
+@@ -834,7 +1039,9 @@
  			    "%s:%d include may not appear inside "
  			    "of log file definition\n", configFile,
  			    lineNum);
@@ -438,7 +433,7 @@
  		}
  
  		*endtag = oldchar, start = endtag;
-@@ -837,9 +1049,17 @@
+@@ -852,9 +1059,17 @@
  		}
  	    } else if (!strcmp(start, "olddir")) {
  		*endtag = oldchar, start = endtag;
@@ -457,7 +452,7 @@
  		}
  #if 0
  		if (stat(newlog->oldDir, &sb)) {
-@@ -868,6 +1088,7 @@
+@@ -883,6 +1098,7 @@
  		     &endtag)) {
  		    oldchar = *endtag, *endtag = '\0';
  
@@ -465,7 +460,7 @@
  		    newlog->extension = strdup(start);
  
  		    *endtag = oldchar, start = endtag;
-@@ -878,18 +1099,30 @@
+@@ -893,18 +1109,30 @@
  
  	    } else if (!strcmp(start, "compresscmd")) {
  		*endtag = oldchar, start = endtag;
@@ -499,7 +494,7 @@
  		}
  
  		message(MESS_DEBUG, "compress_prog is now %s\n",
-@@ -897,19 +1130,31 @@
+@@ -912,19 +1140,31 @@
  
  	    } else if (!strcmp(start, "uncompresscmd")) {
  		*endtag = oldchar, start = endtag;
@@ -534,13 +529,12 @@
  		}
  
  		message(MESS_DEBUG, "uncompress_prog is now %s\n",
-@@ -918,12 +1163,24 @@
+@@ -933,12 +1173,23 @@
  	    } else if (!strcmp(start, "compressoptions")) {
  		char *options;
  
 +		if (newlog->compress_options_list) {
-+		    free_2d_array((char **)newlog->compress_options_list,
-+				  newlog->compress_options_count);
++		    free(newlog->compress_options_list);
 +		    newlog->compress_options_list = NULL;
 +		    newlog->compress_options_count = 0;
 +		}
@@ -560,7 +554,7 @@
  		}
  
  		if (poptParseArgvString(options,
-@@ -933,7 +1190,12 @@
+@@ -948,7 +1199,12 @@
  			    "%s:%d invalid compression options\n",
  			    configFile, lineNum);
  		    free(options);
@@ -574,7 +568,7 @@
  		}
  
  		message(MESS_DEBUG, "compress_options is now %s\n",
-@@ -941,11 +1203,19 @@
+@@ -956,11 +1212,19 @@
  		free(options);
  	    } else if (!strcmp(start, "compressext")) {
  		*endtag = oldchar, start = endtag;
@@ -595,7 +589,7 @@
  		}
  
  		message(MESS_DEBUG, "compress_ext is now %s\n",
-@@ -973,7 +1243,8 @@
+@@ -988,7 +1252,8 @@
  	    if (newlog != defConfig) {
  		message(MESS_ERROR, "%s:%d unexpected log filename\n",
  			configFile, lineNum);
@@ -605,7 +599,7 @@
  	    }
  
  	    /* If no compression options were found in config file,
-@@ -989,7 +1260,7 @@
+@@ -1004,7 +1269,7 @@
  	    (*numLogsPtr)++;
  	    *logsPtr = realloc(*logsPtr, sizeof(**logsPtr) * *numLogsPtr);
  	    newlog = *logsPtr + *numLogsPtr - 1;
@@ -614,7 +608,7 @@
  
  	    endtag = start;
  	    while (*endtag != '{' && *endtag != '\0')
-@@ -1013,7 +1284,7 @@
+@@ -1028,7 +1293,7 @@
  
  	    newlog->files = NULL;
  	    newlog->numFiles = 0;
@@ -623,7 +617,7 @@
  		rc = glob(argv[argNum], GLOB_NOCHECK, globerr,
  			  &globResult);
  		if (rc == GLOB_ABORTED) {
-@@ -1022,7 +1293,8 @@
+@@ -1037,7 +1302,8 @@
  
  		    message(MESS_ERROR, "%s:%d glob failed for %s\n",
  			    configFile, lineNum, argv[argNum]);
@@ -633,7 +627,7 @@
  		}
  
  		newlog->files =
-@@ -1045,8 +1317,8 @@
+@@ -1060,8 +1326,8 @@
  					"%s:%d duplicate log entry for %s\n",
  					configFile, lineNum,
  					globResult.gl_pathv[i]);
@@ -644,7 +638,7 @@
  			    }
  			}
  		    }
-@@ -1055,19 +1327,21 @@
+@@ -1070,19 +1336,21 @@
  			strdup(globResult.gl_pathv[i]);
  		    newlog->numFiles++;
  		}


Index: logrotate.spec
===================================================================
RCS file: /cvs/dist/rpms/logrotate/FC-6/logrotate.spec,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- logrotate.spec	23 Jan 2007 12:05:41 -0000	1.55
+++ logrotate.spec	8 Feb 2007 14:40:37 -0000	1.56
@@ -1,7 +1,7 @@
-Summary: Rotates, compresses, removes and mails system log files.
+Summary: Rotates, compresses, removes and mails system log files
 Name: logrotate
 Version: 3.7.4
-Release: 10%{?dist}
+Release: 12%{?dist}
 License: GPL
 Group: System Environment/Base
 Source: logrotate-%{PACKAGE_VERSION}.tar.gz
@@ -10,8 +10,8 @@
 Patch3: logrotate-sizeOption.patch
 Patch4: logrotate-widecharPath.patch
 Patch5: logrotate-errorConfiguration.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}.root
 BuildRequires: libselinux-devel
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description
 The logrotate utility is designed to simplify the administration of
@@ -25,7 +25,7 @@
 log files on your system.
 
 %prep
-%setup
+%setup -q
 %patch1 -p1 -b .rhat
 %patch2 -p1 -b .fdLeak
 %patch3 -p1 -b .sizeOption
@@ -33,8 +33,7 @@
 %patch5 -p1 -b .errorConfiguration
 
 %build
-make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -g" \
-	WITH_SELINUX=yes
+make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS -g" WITH_SELINUX=yes
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -61,10 +60,16 @@
 %attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) /var/lib/logrotate.status
 
 %changelog
-* Tue Jan 23 2007 Peter Vrabec <pvrabec at redhat.com> 3.7.4-10
+* Thu Feb 08 2007 Peter Vrabec <pvrabec at redhat.com> 3.7.4-12
+- fix problem with compress_options_list (#227706)
+
+* Tue Jan 23 2007 Peter Vrabec <pvrabec at redhat.com> 3.7.4-11
 - logrotate won't stop if there are some errors in configuration
   or glob failures (#166510, #182062)
 
+* Wed Jan 10 2007 Peter Vrabec <pvrabec at redhat.com> 3.7.4-10
+- fix some rpmlint issues
+
 * Tue Jan 09 2007 Peter Vrabec <pvrabec at redhat.com> 3.7.4-9
 - allow multibyte characters in readPath() (#122145)
 
@@ -248,7 +253,7 @@
 - Apply various bugfix patches from the openwall people
 
 * Tue Jan 29 2002 Elliot Lee <sopwith at redhat.com> 3.6.2-1
-- Fix bug #55809 (include logrotate.status in %files)
+- Fix bug #55809 (include logrotate.status in "files")
 - Fix bug #58328 (incorrect error detection when reading state file)
 - Allow 'G' size specifier from bug #57242
 




More information about the fedora-cvs-commits mailing list