Bug 17194 - bug in config.c, isolateValue function
Summary: bug in config.c, isolateValue function
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: logrotate   
(Show other bugs)
Version: 6.1
Hardware: i386 Linux
medium
low
Target Milestone: ---
Assignee: Erik Troan
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-09-02 23:48 UTC by Steven Roberts
Modified: 2008-05-01 15:37 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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


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