Module: sip-router
Branch: master
Commit: 48e2695dfb8a0a45e09ff555121a53293bddda3c
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=48e2695…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Thu Mar 29 21:56:00 2012 +0100
modules_k/cfgutils: Added note about the core_hash function not being secure to the README
---
modules_k/cfgutils/README | 4 ++++
modules_k/cfgutils/doc/cfgutils_admin.xml | 5 +++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/modules_k/cfgutils/README b/modules_k/cfgutils/README
index 694cf74..7df91b1 100644
--- a/modules_k/cfgutils/README
+++ b/modules_k/cfgutils/README
@@ -513,6 +513,10 @@ unlock("$rU");
Exported function that enables the core_hash() function to be used from
the configuration file.
+ This is a quick and simple hash function and it is not
+ cryptographically secure. This function should not be used for any
+ security related purposes.
+
Parameters:
* “string1” first string to hash
* “string2” (optional) second string to hash (set to "" if not
diff --git a/modules_k/cfgutils/doc/cfgutils_admin.xml b/modules_k/cfgutils/doc/cfgutils_admin.xml
index f391e1d..1ae6192 100644
--- a/modules_k/cfgutils/doc/cfgutils_admin.xml
+++ b/modules_k/cfgutils/doc/cfgutils_admin.xml
@@ -530,6 +530,11 @@ unlock("$rU");
Exported function that enables the core_hash() function to be used
from the configuration file.
</para>
+ <para>
+ This is a quick and simple hash function and it is not
+ cryptographically secure. This function should not be used for
+ any security related purposes.
+ </para>
<para>Parameters:</para>
<itemizedlist>
<listitem>
Module: sip-router
Branch: master
Commit: 5a89af6ea8b83ecc781d3f169023fde8388a2da6
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5a89af6…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Thu Mar 29 16:02:13 2012 +0100
modules_k/presence: Fixed DB insert race hazard on the watchers table
- The time between the query on the watchers table (which determines
there is no matching entry) and the insert is substantial. During
a soak I observed inserts failing because rows had been inserted in
this time window.
- The fix is to use replace (where available) instead of insert.
- Also fixed a small whitespace issue I noticed, and added an extra
use_table call (as I think there was one missing).
---
modules_k/presence/presence.c | 2 +-
modules_k/presence/subscribe.c | 32 ++++++++++++++++++++++++++++----
2 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c
index dd415f7..f6f9152 100644
--- a/modules_k/presence/presence.c
+++ b/modules_k/presence/presence.c
@@ -833,7 +833,7 @@ int update_watchers_status(str pres_uri, pres_ev_t* ev, str* rules_doc)
}ws_t;
ws_t* ws_list= NULL;
- LM_DBG("start\n");
+ LM_DBG("start\n");
if(ev->content_type.s== NULL)
{
diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c
index 0c914c7..0a9db83 100644
--- a/modules_k/presence/subscribe.c
+++ b/modules_k/presence/subscribe.c
@@ -315,6 +315,12 @@ int insert_subs_db(subs_t* s, int type)
query_vals[reason_col].val.str_val= s->reason;
query_vals[socket_info_col].val.str_val= s->sockinfo_str;
+ if (pa_dbf.use_table(pa_db, &active_watchers_table) < 0)
+ {
+ LM_ERR("in use table sql operation\n");
+ return -1;
+ }
+
LM_DBG("inserting subscription in active_watchers table\n");
if(pa_dbf.insert(pa_db, query_cols, query_vals, n_query_cols) < 0)
{
@@ -2310,10 +2316,28 @@ int insert_db_subs_auth(subs_t* subs)
return -1;
}
- if(pa_dbf.insert(pa_db, db_keys, db_vals, n_query_cols )< 0)
- {
- LM_ERR("in sql insert\n");
- return -1;
+ if (pa_dbf.replace != NULL)
+ {
+ if(pa_dbf.replace(pa_db, db_keys, db_vals, n_query_cols,
+ 2, 0) < 0)
+ {
+ LM_ERR("in sql replace\n");
+ return -1;
+ }
+ }
+ else
+ {
+ /* If you use insert() instead of replace() be prepared for some
+ DB error messages. There is a lot of time between the
+ query() that indicated there was no matching entry in the DB
+ and this insert(), so on a multi-user system it is entirely
+ possible (even likely) that a record will be added after the
+ query() but before this insert(). */
+ if(pa_dbf.insert(pa_db, db_keys, db_vals, n_query_cols )< 0)
+ {
+ LM_ERR("in sql insert\n");
+ return -1;
+ }
}
return 0;
Module: sip-router
Branch: master
Commit: 8324f5cd795b846575a027f5269af0d7ecbad20f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8324f5c…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Thu Mar 29 16:11:22 2012 +0100
modules_k/pua: PUA DB only mode improvements and fixes
- Fixed an issue where CSeq wasn't updated in DB only mode
- Fixed a bug with pua.c:update_pua() in DB only mode
- Tidied up the code in pua_db.c
- Separated out the pua dialog (SUBSCRIBE/NOTIFY related) and record
(PUBLISH related) handling functions in pua_db.c
---
modules_k/pua/hash.c | 5 +-
modules_k/pua/pua.c | 4 +-
modules_k/pua/pua_db.c | 669 ++++++++++++++++++++--------------------
modules_k/pua/pua_db.h | 12 +-
modules_k/pua/send_publish.c | 9 +-
modules_k/pua/send_subscribe.c | 25 +-
6 files changed, 365 insertions(+), 359 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=832…
Hello,
just to let you know that over the weekend the ACL (user authentication)
for write access to wiki portals of the project has been turned on.
Anyone that wants to write to the wiki has to create herself/himself an
account. The reason for requiring user authentication is weakness of the
captha system used for anonymous posting -- during the past weeks lot of
wiki pages were updated by spam bots.
If anyone is aware of a stronger captcha-like system to be used for
anonymous posting, write back here. It has to work with dokuwiki.
Cheers,
Daniel
--
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
http://www.asipto.com/index.php/kamailio-advanced-training/