Bug 17194 - bug in config.c, isolateValue function
bug in config.c, isolateValue function
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: logrotate (Show other bugs)
6.1
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Erik Troan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-09-02 19:48 EDT by Steven Roberts
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-09-06 03:22:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Steven Roberts 2000-09-02 19:48:23 EDT
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 03:22:14 EDT
Fixed for the logrotate already in rawhide and pinstripe
Comment 2 Steven Roberts 2000-09-06 04:40:13 EDT
checked the 3.5.1 version  in rawride.  slightly different patch, but it'll work

Note You need to log in before you can comment on or make changes to this bug.