From: Michael Chase-S. <mc...@us...> - 2011-11-23 03:24:03
|
Update of /cvsroot/sblim/sfcb In directory vz-cvs-3.sog:/tmp/cvs-serv9974 Modified Files: ChangeLog NEWS README cimXmlParser.c control.c httpAdapter.c sfcb.cfg.pre.in Log Message: 3435778 Preserve leading/trailing whitespace in values Index: ChangeLog =================================================================== RCS file: /cvsroot/sblim/sfcb/ChangeLog,v retrieving revision 1.699 retrieving revision 1.700 diff -u -d -r1.699 -r1.700 --- ChangeLog 22 Nov 2011 20:58:18 -0000 1.699 +++ ChangeLog 23 Nov 2011 03:24:00 -0000 1.700 @@ -1,3 +1,8 @@ +2011-11-22 Michael Chase-Salerno <br...@li...> + + * cimXmlParser.c, control.c, httpAdapter.c, sfcb.cfg.pre.in: + [ 3435778 ] Preserve leading/trailing whitespace in values + 2011-11-22 Chris Buccella <buc...@li...> * httpAdapter.c, sfcBasicPAMAuthentication.c: Index: sfcb.cfg.pre.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcb.cfg.pre.in,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- sfcb.cfg.pre.in 22 Nov 2011 20:41:20 -0000 1.28 +++ sfcb.cfg.pre.in 23 Nov 2011 03:24:00 -0000 1.29 @@ -94,6 +94,11 @@ ## Default is NULL which means no change to the default permission. #socketPathGroupPerm: daemon +## Trim leading and trailing whitespace from XML property values. +## Whitespace is space, tab, crlf. Any ascii value <= 32. +## Default is true +#trimWhitespace: true + ##---------------------------- Provider-Related ------------------------------- ## Max number of provider processes. Index: httpAdapter.c =================================================================== RCS file: /cvsroot/sblim/sfcb/httpAdapter.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- httpAdapter.c 22 Nov 2011 20:58:18 -0000 1.95 +++ httpAdapter.c 23 Nov 2011 03:24:00 -0000 1.96 @@ -90,6 +90,7 @@ static long numRequest; static long selectTimeout = 5; /* default 5 sec. timeout for select() before read() */ struct timeval httpSelectTimeout = {0, 0}; +int trimws; #if defined USE_SSL static SSL_CTX *ctx; @@ -1620,6 +1621,9 @@ noChunking = 0; noChunking = noChunking == 0; + if (getControlBool("trimWhitespace", &trimws)) + trimws = 0; + /* * grab commandline options */ Index: README =================================================================== RCS file: /cvsroot/sblim/sfcb/README,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- README 9 Sep 2011 22:54:18 -0000 1.57 +++ README 23 Nov 2011 03:24:00 -0000 1.58 @@ -498,6 +498,7 @@ sslCiphers: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH registrationDir: /usr/local/var/lib/sfcb/registration providerDirs: /usr/local/lib/sfcb /usr/local/lib /usr/local/lib/cmpi + trimWhitespace: true Config Option Descriptions -------------------------- @@ -640,6 +641,11 @@ Specify the trace file for sfcb. Can be overriden by setting environment variable SFCB_TRACE_FILE. Default: stderr. +trimWhitespace + Trim leading and trailing whitespace from XML property values. + Whitespace is space, tab, crlf. Any ascii value <= 32. + Default is true + After making any changes to sfcb.cfg you must restart sfcb or get it to reload the config file by typing Index: NEWS =================================================================== RCS file: /cvsroot/sblim/sfcb/NEWS,v retrieving revision 1.623 retrieving revision 1.624 diff -u -d -r1.623 -r1.624 --- NEWS 22 Nov 2011 20:58:18 -0000 1.623 +++ NEWS 23 Nov 2011 03:24:00 -0000 1.624 @@ -5,6 +5,7 @@ - 3367333 New entry point for authentication library - 3367332 RHOST Support for PAM +- 3435778 Preserve leading/trailing whitespace in values Bugs fixed: Index: cimXmlParser.c =================================================================== RCS file: /cvsroot/sblim/sfcb/cimXmlParser.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- cimXmlParser.c 21 May 2010 22:26:50 -0000 1.35 +++ cimXmlParser.c 23 Nov 2011 03:24:00 -0000 1.36 @@ -30,6 +30,8 @@ #include "trace.h" +extern int trimws; + static int attrsOk(XmlBuffer * xb, const XmlElement * e, XmlAttr * r, const char *tag, int etag); static char *getValue(XmlBuffer * xb, const char *v); @@ -438,14 +440,17 @@ xb->nulledChar = *(xb->cur); *(xb->cur) = 0; - /* skip leading blanks */ - while (*start && *start<=' ') start++; - if (start == NULL) return ""; // should check for *start == NULL instead? start==NULL shouldn't happen, ever. end=xb->cur; - /* strip trailing blanks */ - while (*(end-1)<=' ') { - *(end-1) = 0; - end -= 1; + + if (trimws) { + /* skip leading blanks */ + while (*start && *start<=' ') start++; + if (start == NULL) return ""; // should check for *start == NULL instead? start==NULL shouldn't happen, ever. + /* strip trailing blanks */ + while (*(end-1)<=' ') { + *(end-1) = 0; + end -= 1; + } } /* unescape */ help = start; Index: control.c =================================================================== RCS file: /cvsroot/sblim/sfcb/control.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- control.c 22 Nov 2011 20:41:19 -0000 1.41 +++ control.c 23 Nov 2011 03:24:00 -0000 1.42 @@ -92,6 +92,8 @@ {"useChunking", 2, "false"}, {"chunkSize", 1, "50000"}, + + {"trimWhitespace", 2, "true"}, {"keepaliveTimeout", 1, "15"}, {"keepaliveMaxRequest", 1, "10"}, |