summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-08-25 11:30:18 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-08-25 11:30:18 +0200
commit0c65e62965eefc1f8cebfaa3636ef72fc21c5260 (patch)
tree978590a558f6571af85b424ecff78fb28cf8d552
parenta568626d4a627d226f203eb83f41b731e0f00ac9 (diff)
parent1824ab8d98b983402315b86954a7ad160b43b508 (diff)
downloadrsyslog-0c65e62965eefc1f8cebfaa3636ef72fc21c5260.zip
rsyslog-0c65e62965eefc1f8cebfaa3636ef72fc21c5260.tar.gz
rsyslog-0c65e62965eefc1f8cebfaa3636ef72fc21c5260.tar.xz
Merge branch 'v5-stable' of git+ssh://git.adiscon.com/git/rsyslog into v5-stable
Conflicts: template.c
-rw-r--r--runtime/msg.c2
-rw-r--r--template.c39
-rw-r--r--template.h37
3 files changed, 48 insertions, 30 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 01bafb8..aa97dc2 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -2546,11 +2546,13 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
++pFld; /* skip to field terminator */
if(*pFld == pTpe->data.field.field_delim) {
++pFld; /* eat it */
+#ifdef STRICT_GPLV3
if (pTpe->data.field.field_expand != 0) {
while (*pFld == pTpe->data.field.field_delim) {
++pFld;
}
}
+#endif
++iCurrFld;
}
}
diff --git a/template.c b/template.c
index e58623d..23251c0 100644
--- a/template.c
+++ b/template.c
@@ -1,25 +1,30 @@
/* This is the template processing code of rsyslog.
- * Please see syslogd.c for license information.
* begun 2004-11-17 rgerhards
*
- * Copyright 2004, 2007 Rainer Gerhards and Adiscon
+ * Copyright 2004-2012 Rainer Gerhards and Adiscon
*
* This file is part of rsyslog.
*
- * Rsyslog is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * -or-
+ * see COPYING.ASL20 in the source distribution
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
- * Rsyslog is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Rsyslog. If not, see <http://www.gnu.org/licenses/>.
- *
- * A copy of the GPL can be found in the file "COPYING" in this distribution.
+ * Note: there is a tiny bit of code left where I could not get any response
+ * from the author if this code can be placed under ASL2.0. I have guarded this
+ * with #ifdef STRICT_GPLV3. Only if that macro is defined, the code will be
+ * compiled. Otherwise this feature is not present. The plan is to do a
+ * different implementation in the future to get rid of this problem.
+ * rgerhards, 2012-08-25
*/
#include "config.h"
@@ -700,7 +705,9 @@ static int do_Parameter(unsigned char **pp, struct template *pTpl)
/* now we fall through the "regular" FromPos code */
#endif /* #ifdef FEATURE_REGEXP */
if(*p == 'F') {
+#ifdef STRICT_GPLV3
pTpe->data.field.field_expand = 0;
+#endif
/* we have a field counter, so indicate it in the template */
++p; /* eat 'F' */
if (*p == ':') {
@@ -728,10 +735,12 @@ static int do_Parameter(unsigned char **pp, struct template *pTpl)
pTpe->data.field.field_delim = 9;
} else {
pTpe->data.field.field_delim = iNum;
+# ifdef STRICT_GPLV3
if (*p == '+') {
pTpe->data.field.field_expand = 1;
p ++;
}
+# endif
if(*p == ',') { /* real fromPos? */
++p;
iNum = 0;
diff --git a/template.h b/template.h
index e659659..ad698e8 100644
--- a/template.h
+++ b/template.h
@@ -1,25 +1,30 @@
/* This is the header for template processing code of rsyslog.
- * Please see syslogd.c for license information.
* begun 2004-11-17 rgerhards
*
- * Copyright (C) 2004 by Rainer Gerhards and Adiscon GmbH
+ * Copyright 2004-2012 Rainer Gerhards and Adiscon
*
* This file is part of rsyslog.
*
- * Rsyslog is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * -or-
+ * see COPYING.ASL20 in the source distribution
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
- * Rsyslog is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Rsyslog. If not, see <http://www.gnu.org/licenses/>.
- *
- * A copy of the GPL can be found in the file "COPYING" in this distribution.
+ * Note: there is a tiny bit of code left where I could not get any response
+ * from the author if this code can be placed under ASL2.0. I have guarded this
+ * with #ifdef STRICT_GPLV3. Only if that macro is defined, the code will be
+ * compiled. Otherwise this feature is not present. The plan is to do a
+ * different implementation in the future to get rid of this problem.
+ * rgerhards, 2012-08-25
*/
#ifndef TEMPLATE_H_INCLUDED
@@ -88,7 +93,9 @@ struct templateEntry {
#endif
unsigned has_fields; /* support for field-counting: field to extract */
unsigned char field_delim; /* support for field-counting: field delemiter char */
+#ifdef STRICT_GPLV3
int field_expand; /* use multiple instances of the field delimiter as a single one? */
+#endif
enum tplFormatTypes eDateFormat;
enum tplFormatCaseConvTypes eCaseConv;