~ubuntu-branches/ubuntu/precise/rsyslog/precise

« back to all changes in this revision

Viewing changes to parse.c

  • Committer: Package Import Robot
  • Author(s): Scott Moser
  • Date: 2011-11-07 13:54:56 UTC
  • mfrom: (16.1.25 sid)
  • Revision ID: package-import@ubuntu.com-20111107135456-cwt6mu19ski1h2qf
Tags: 5.8.6-1ubuntu1
* Resynchronise with Debian. Remaining changes:
  - Run as rsyslog:rsyslog, set $FileOwner to syslog
  - Replace init script with debian/rsyslog.upstart.
  - debian/rsyslog.logrotate: Use reload command to restart rsyslog
  - debian/rsyslog.conf: enable $RepeatedMsgReduction 
    to avoid bloating the syslog file (LP #453444)
  - Add debian/rsyslog.dmesg.upstart to save initial dmesg into a file.
    Install it in debian/rules.
  - debian/50-default.conf: set of default rules for syslog (forwarded to
    Debian #603160). remove file in postrm on purge. manage with ucf.
  - debian/rules: build with LDFLAGS=""
* Dropped:
  - debian/patches/02-CVE-2011-3200.patch (fixed in upstream release)

Show diffs side-by-side

added added

removed removed

Lines of Context:
210
210
/* Skip whitespace. Often used to trim parsable entries.
211
211
 * Returns with ParsePointer set to first non-whitespace
212
212
 * character (or at end of string).
 
213
 * If bRequireOne is set to true, at least one whitespace
 
214
 * must exist, else an error is returned.
213
215
 */
214
 
rsRetVal parsSkipWhitespace(rsParsObj *pThis)
 
216
rsRetVal parsSkipWhitespace(rsParsObj *pThis, sbool bRequireOne)
215
217
{
216
218
        register unsigned char *pC;
 
219
        int numSkipped;
 
220
        DEFiRet;
 
221
 
217
222
 
218
223
        rsCHECKVALIDOBJECT(pThis, OIDrsPars);
219
224
 
220
225
        pC = rsCStrGetBufBeg(pThis->pCStr);
221
226
 
 
227
        numSkipped = 0;
222
228
        while(pThis->iCurrPos < rsCStrLen(pThis->pCStr)) {
223
229
                if(!isspace((int)*(pC+pThis->iCurrPos)))
224
230
                        break;
225
231
                ++pThis->iCurrPos;
 
232
                ++numSkipped;
226
233
        }
227
234
 
228
 
        return RS_RET_OK;
 
235
        if(bRequireOne && numSkipped == 0)
 
236
                iRet = RS_RET_MISSING_WHITESPACE;
 
237
 
 
238
        RETiRet;
229
239
}
230
240
 
231
241
/* Parse string up to a delimiter.
252
262
        CHKiRet(rsCStrConstruct(&pCStr));
253
263
 
254
264
        if(bTrimLeading)
255
 
                parsSkipWhitespace(pThis);
 
265
                parsSkipWhitespace(pThis, 0);
256
266
 
257
267
        pC = rsCStrGetBufBeg(pThis->pCStr) + pThis->iCurrPos;
258
268
 
383
393
 
384
394
        CHKiRet(cstrConstruct(&pCStr));
385
395
 
386
 
        parsSkipWhitespace(pThis);
 
396
        parsSkipWhitespace(pThis, 0);
387
397
        pC = rsCStrGetBufBeg(pThis->pCStr) + pThis->iCurrPos;
388
398
 
389
399
        /* we parse everything until either '/', ',' or