Bug 17194

Summary: bug in config.c, isolateValue function
Product: [Retired] Red Hat Linux Reporter: Steven Roberts <strobert>
Component: logrotateAssignee: Erik Troan <ewt>
Status: CLOSED RAWHIDE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-09-06 07:22:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Steven Roberts 2000-09-02 23:48:23 UTC
in config.c, isolateValue there is code which appears to be trying to handle trimming off trailing spaces/tabs (checked via glibc's isblank 
function).  Basically before the trailing space check chptr gets left point to the '\n' so trailing spaces never get clipped.

which since chptr is now always left of the '\n', the final if is no longer needed as well.

found when I accidently left a trailing space in an olddir directive ' olddir /var/log/archive '

Here is a patch:
--- orig.config.c       Sat Sep  2 16:46:02 2000
+++ config.c    Sat Sep  2 16:45:51 2000
@@ -53,12 +53,11 @@
 
     while (*chptr != '\n') chptr++;
 
+    chptr--; /* move to the left of the '\n' */
+
     while (isblank(*chptr)) chptr--;
 
-    if (*chptr == '\n')
-       *endPtr = chptr;
-    else
-       *endPtr = chptr + 1;
+    *endPtr = chptr + 1;
 
     return 0;
 }

Comment 1 Erik Troan 2000-09-06 07:22:14 UTC
Fixed for the logrotate already in rawhide and pinstripe

Comment 2 Steven Roberts 2000-09-06 08:40:13 UTC
checked the 3.5.1 version  in rawride.  slightly different patch, but it'll work