Daniel-Constantin Mierla
2021-06-01 17:48:09 UTC
Content preview: Module: kamailio Branch: master Commit: 6e8e5ed121028bd851d7de214271881a0bb1e4d3
URL: https://github.com/kamailio/kamailio/commit/6e8e5ed121028bd851d7de214271881a0bb1e4d3
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-06-01T19:45:16+02:00
Content analysis details: (-2.4 points, 5.5 required)
pts rule name description
---- ---------------------- --------------------------------------------------
-1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is
CUSTOM_MED
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
provider (miconda[at]gmail.com)
0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
mail domains are different
1.0 FORGED_GMAIL_RCVD 'From' gmail.com does not match 'Received'
headers
0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
EnvelopeFrom freemail headers are
different
-1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list
manager
Module: kamailio
Branch: master
Commit: 6e8e5ed121028bd851d7de214271881a0bb1e4d3
URL: https://github.com/kamailio/kamailio/commit/6e8e5ed121028bd851d7de214271881a0bb1e4d3
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-06-01T19:45:16+02:00
pv: fix {param.count} transformation broken by previous commit
---
Modified: src/modules/pv/pv_trans.c
---
Diff: https://github.com/kamailio/kamailio/commit/6e8e5ed121028bd851d7de214271881a0bb1e4d3.diff
Patch: https://github.com/kamailio/kamailio/commit/6e8e5ed121028bd851d7de214271881a0bb1e4d3.patch
---
diff --git a/src/modules/pv/pv_trans.c b/src/modules/pv/pv_trans.c
index 6ad760f19a..98cce7caa8 100644
--- a/src/modules/pv/pv_trans.c
+++ b/src/modules/pv/pv_trans.c
@@ -3203,6 +3203,28 @@ char* tr_parse_paramlist(str* in, trans_t *t)
goto unknown;
}
+ if(t->subtype == TR_PL_COUNT) {
+ if(*p==TR_PARAM_MARKER) {
+ start_pos = ++p;
+ _tr_parse_sparamx(p, p0, tp, spec, ps, in, s, 1);
+ t->params = tp;
+ tp = 0;
+ if (t->params->type != TR_PARAM_SPEC && p - start_pos != 1) {
+ LM_ERR("invalid separator in transformation: "
+ "%.*s\n", in->len, in->s);
+ goto error;
+ }
+ while(*p && (*p==' ' || *p=='\t' || *p=='\n')) p++;
+ if(*p!=TR_RBRACKET) {
+ LM_ERR("invalid name transformation: %.*s!\n",
+ in->len, in->s);
+ goto error;
+ }
+ }
+ goto done;
+ }
+
+ /* now transformations with mandatory parameters */
if(*p!=TR_PARAM_MARKER)
{
LM_ERR("invalid %.*s transformation: %.*s\n",
@@ -3223,29 +3245,15 @@ char* tr_parse_paramlist(str* in, trans_t *t)
while(is_in_str(p, in) && (*p==' ' || *p=='\t' || *p=='\n')) p++;
}
- if(t->subtype == TR_PL_COUNT) {
- if(*p==TR_PARAM_MARKER) {
- start_pos = ++p;
- _tr_parse_sparamx(p, p0, tp, spec, ps, in, s, 1);
- t->params = tp;
- tp = 0;
- if (tp->type != TR_PARAM_SPEC && p - start_pos != 1) {
- LM_ERR("invalid separator in transformation: "
- "%.*s\n", in->len, in->s);
- goto error;
- }
- }
- } else {
- if(*p==TR_PARAM_MARKER) {
- start_pos = ++p;
- _tr_parse_sparam(p, p0, tp, spec, ps, in, s);
- t->params->next = tp;
- tp = 0;
- if (p - start_pos != 1) {
- LM_ERR("invalid separator in transformation: "
- "%.*s\n", in->len, in->s);
- goto error;
- }
+ if(*p==TR_PARAM_MARKER) {
+ start_pos = ++p;
+ _tr_parse_sparam(p, p0, tp, spec, ps, in, s);
+ t->params->next = tp;
+ tp = 0;
+ if (p - start_pos != 1) {
+ LM_ERR("invalid separator in transformation: "
+ "%.*s\n", in->len, in->s);
+ goto error;
}
}
@@ -3256,6 +3264,7 @@ char* tr_parse_paramlist(str* in, trans_t *t)
goto error;
}
+done:
t->name = name;
return p;
URL: https://github.com/kamailio/kamailio/commit/6e8e5ed121028bd851d7de214271881a0bb1e4d3
Author: Daniel-Constantin Mierla <***@gmail.com> Committer: Daniel-Constantin
Mierla <***@gmail.com> Date: 2021-06-01T19:45:16+02:00
Content analysis details: (-2.4 points, 5.5 required)
pts rule name description
---- ---------------------- --------------------------------------------------
-1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is
CUSTOM_MED
0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
provider (miconda[at]gmail.com)
0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
mail domains are different
1.0 FORGED_GMAIL_RCVD 'From' gmail.com does not match 'Received'
headers
0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
EnvelopeFrom freemail headers are
different
-1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list
manager
Module: kamailio
Branch: master
Commit: 6e8e5ed121028bd851d7de214271881a0bb1e4d3
URL: https://github.com/kamailio/kamailio/commit/6e8e5ed121028bd851d7de214271881a0bb1e4d3
Author: Daniel-Constantin Mierla <***@gmail.com>
Committer: Daniel-Constantin Mierla <***@gmail.com>
Date: 2021-06-01T19:45:16+02:00
pv: fix {param.count} transformation broken by previous commit
---
Modified: src/modules/pv/pv_trans.c
---
Diff: https://github.com/kamailio/kamailio/commit/6e8e5ed121028bd851d7de214271881a0bb1e4d3.diff
Patch: https://github.com/kamailio/kamailio/commit/6e8e5ed121028bd851d7de214271881a0bb1e4d3.patch
---
diff --git a/src/modules/pv/pv_trans.c b/src/modules/pv/pv_trans.c
index 6ad760f19a..98cce7caa8 100644
--- a/src/modules/pv/pv_trans.c
+++ b/src/modules/pv/pv_trans.c
@@ -3203,6 +3203,28 @@ char* tr_parse_paramlist(str* in, trans_t *t)
goto unknown;
}
+ if(t->subtype == TR_PL_COUNT) {
+ if(*p==TR_PARAM_MARKER) {
+ start_pos = ++p;
+ _tr_parse_sparamx(p, p0, tp, spec, ps, in, s, 1);
+ t->params = tp;
+ tp = 0;
+ if (t->params->type != TR_PARAM_SPEC && p - start_pos != 1) {
+ LM_ERR("invalid separator in transformation: "
+ "%.*s\n", in->len, in->s);
+ goto error;
+ }
+ while(*p && (*p==' ' || *p=='\t' || *p=='\n')) p++;
+ if(*p!=TR_RBRACKET) {
+ LM_ERR("invalid name transformation: %.*s!\n",
+ in->len, in->s);
+ goto error;
+ }
+ }
+ goto done;
+ }
+
+ /* now transformations with mandatory parameters */
if(*p!=TR_PARAM_MARKER)
{
LM_ERR("invalid %.*s transformation: %.*s\n",
@@ -3223,29 +3245,15 @@ char* tr_parse_paramlist(str* in, trans_t *t)
while(is_in_str(p, in) && (*p==' ' || *p=='\t' || *p=='\n')) p++;
}
- if(t->subtype == TR_PL_COUNT) {
- if(*p==TR_PARAM_MARKER) {
- start_pos = ++p;
- _tr_parse_sparamx(p, p0, tp, spec, ps, in, s, 1);
- t->params = tp;
- tp = 0;
- if (tp->type != TR_PARAM_SPEC && p - start_pos != 1) {
- LM_ERR("invalid separator in transformation: "
- "%.*s\n", in->len, in->s);
- goto error;
- }
- }
- } else {
- if(*p==TR_PARAM_MARKER) {
- start_pos = ++p;
- _tr_parse_sparam(p, p0, tp, spec, ps, in, s);
- t->params->next = tp;
- tp = 0;
- if (p - start_pos != 1) {
- LM_ERR("invalid separator in transformation: "
- "%.*s\n", in->len, in->s);
- goto error;
- }
+ if(*p==TR_PARAM_MARKER) {
+ start_pos = ++p;
+ _tr_parse_sparam(p, p0, tp, spec, ps, in, s);
+ t->params->next = tp;
+ tp = 0;
+ if (p - start_pos != 1) {
+ LM_ERR("invalid separator in transformation: "
+ "%.*s\n", in->len, in->s);
+ goto error;
}
}
@@ -3256,6 +3264,7 @@ char* tr_parse_paramlist(str* in, trans_t *t)
goto error;
}
+done:
t->name = name;
return p;