Module: sip-router
Branch: master
Commit: b690ab5236cbe209dd1d80ddcc15bc4c9053c42f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b690ab5…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Tue Sep 7 18:06:53 2010 +0200
tls: doc - notes about filename path
- notes about how filename path are resolved in function of the
first character.
- regenerated README.
---
modules/tls/README | 30 +++++++++++++++++++
modules/tls/doc/params.xml | 69 ++++++++++++++++++++++++++++++++++++++-----
2 files changed, 91 insertions(+), 8 deletions(-)
diff --git a/modules/tls/README b/modules/tls/README
index ed9004d..ac64fdc 100644
--- a/modules/tls/README
+++ b/modules/tls/README
@@ -321,6 +321,12 @@ modparam("tls", "tls_method", "TLSv1")
Sets the certificate file name. The certificate file can also contain
the private key in PEM format.
+ If the file name starts with a '.' the path will be relative to the
+ working directory (at runtime). If it starts with a '/' it will be an
+ absolute path and if it starts with anything else the path will be
+ relative to the main config file directory (e.g.: for ser -f
+ /etc/ser/ser.cfg it will be relative to /etc/ser/).
+
Warning: try not to use certificate with keys longer then 1024 bytes.
Longer keys will severely impact performance, in particular the TLS
connection rate.
@@ -336,6 +342,12 @@ modparam("tls", "certificate", "/usr/local/etc/ser/my_certificate.pem")
Sets the private key file name.
+ If the file name starts with a '.' the path will be relative to the
+ working directory (at runtime). If it starts with a '/' it will be an
+ absolute path and if it starts with anything else the path will be
+ relative to the main config file directory (e.g.: for ser -f
+ /etc/ser/ser.cfg it will be relative to /etc/ser/).
+
Note: the private key can be contained in the same file as the
certificate (just append it to the certificate file, e.g.: cat pkey.pem
>> cert.pem)
@@ -354,6 +366,12 @@ modparam("tls", "private", "/usr/local/etc/ser/my_pkey.pem")
to one of the listed CAs, the authentication will succeed. See also
verify_certificate, verify_depth and require_certificate.
+ If the file name starts with a '.' the path will be relative to the
+ working directory (at runtime). If it starts with a '/' it will be an
+ absolute path and if it starts with anything else the path will be
+ relative to the main config file directory (e.g.: for ser -f
+ /etc/ser/ser.cfg it will be relative to /etc/ser/).
+
By default the CA file is not set.
An easy way to create the CA list is to append each trusted trusted CA
@@ -782,6 +800,12 @@ modparam("tls", "tls_force_run", 11)
client) and domain basis (for now only IPs). The corresponding module
parameters will be ignored.
+ If the file name starts with a '.' the path will be relative to the
+ working directory (at runtime). If it starts with a '/' it will be an
+ absolute path and if it starts with anything else the path will be
+ relative to the main config file directory (e.g.: for ser -f
+ /etc/ser/ser.cfg it will be relative to /etc/ser/).
+
By default no config file is specified.
The following parameters can be set in the config file, for each
@@ -795,6 +819,12 @@ modparam("tls", "tls_force_run", 11)
* ca_list
* cipher_list
+ All the parameters that take filenames as values will be resolved using
+ the same rules as for the tls config filename itself: starting with a
+ '.' means relative to the working directory, a '/' means an absolute
+ path and anything else a path relative to the directory of the current
+ ser main config file.
+
SIP-router acts as a server when it accepts a connection and as a
client when it initiates a new connection by itself (it connects to
something).
diff --git a/modules/tls/doc/params.xml b/modules/tls/doc/params.xml
index 7416d52..90e5020 100644
--- a/modules/tls/doc/params.xml
+++ b/modules/tls/doc/params.xml
@@ -62,10 +62,20 @@ modparam("tls", "tls_method", "TLSv1")
<section id="certificate">
<title><varname>certificate</varname> (string)</title>
<para>
- Sets the certificate file name. The certificate file can also contain the private key in PEM format.
+ Sets the certificate file name. The certificate file can also contain
+ the private key in PEM format.
</para>
<para>
- <emphasis>Warning:</emphasis> try not to use certificate with keys longer then 1024 bytes. Longer keys will severely impact performance, in particular the TLS connection rate.
+ If the file name starts with a '.' the path will be relative to the
+ working directory (<emphasis>at runtime</emphasis>). If it starts
+ with a '/' it will be an absolute path and if it starts with anything
+ else the path will be relative to the main config file directory
+ (e.g.: for ser -f /etc/ser/ser.cfg it will be relative to /etc/ser/).
+ </para>
+ <para>
+ <emphasis>Warning:</emphasis> try not to use certificate with keys
+ longer then 1024 bytes. Longer keys will severely impact performance,
+ in particular the TLS connection rate.
</para>
<para>
The default value is [SER_CFG_DIR]/cert.pem.
@@ -86,7 +96,16 @@ modparam("tls", "certificate", "/usr/local/etc/ser/my_certificate.pem")
Sets the private key file name.
</para>
<para>
- Note: the private key can be contained in the same file as the certificate (just append it to the certificate file, e.g.: cat pkey.pem >> cert.pem)
+ If the file name starts with a '.' the path will be relative to the
+ working directory (<emphasis>at runtime</emphasis>). If it starts
+ with a '/' it will be an absolute path and if it starts with anything
+ else the path will be relative to the main config file directory
+ (e.g.: for ser -f /etc/ser/ser.cfg it will be relative to /etc/ser/).
+ </para>
+ <para>
+ Note: the private key can be contained in the same file as the
+ certificate (just append it to the certificate file, e.g.:
+ cat pkey.pem >> cert.pem)
</para>
<para>
The default value is [SER_CFG_DIR]/cert.pem.
@@ -104,13 +123,27 @@ modparam("tls", "private", "/usr/local/etc/ser/my_pkey.pem")
<section id="ca_list">
<title><varname>ca_list</varname> (string)</title>
<para>
- Sets the CA list file name. This file contains a list of all the trusted CAs certificates. If a signature in a certificate chain belongs to one of the listed CAs, the authentication will succeed. See also <emphasis>verify_certificate</emphasis>, <emphasis>verify_depth</emphasis> and <emphasis>require_certificate</emphasis>.
+ Sets the CA list file name. This file contains a list of all the
+ trusted CAs certificates. If a signature in a certificate chain belongs
+ to one of the listed CAs, the authentication will succeed. See also
+ <emphasis>verify_certificate</emphasis>,
+ <emphasis>verify_depth</emphasis> and
+ <emphasis>require_certificate</emphasis>.
+ </para>
+ <para>
+ If the file name starts with a '.' the path will be relative to the
+ working directory (<emphasis>at runtime</emphasis>). If it starts
+ with a '/' it will be an absolute path and if it starts with anything
+ else the path will be relative to the main config file directory
+ (e.g.: for ser -f /etc/ser/ser.cfg it will be relative to /etc/ser/).
</para>
<para>
By default the CA file is not set.
</para>
<para>
- An easy way to create the CA list is to append each trusted trusted CA certificate in the PEM format to one file, e.g.: for f in trusted_cas/*.pem ; do cat "$f" >> ca_list.pem ; done .
+ An easy way to create the CA list is to append each trusted trusted CA
+ certificate in the PEM format to one file, e.g.: for f in
+ trusted_cas/*.pem ; do cat "$f" >> ca_list.pem ; done .
</para>
<example>
<title>Set <varname>ca_list</varname> parameter</title>
@@ -760,13 +793,24 @@ modparam("tls", "tls_force_run", 11)
Sets the name of the TLS specific config file.
</para>
<para>
- If set the TLS module will load a special config file, in which different TLS parameters can be specified on a per role (server or client) and domain basis (for now only IPs). The corresponding module parameters will be ignored.
+ If set the TLS module will load a special config file, in which
+ different TLS parameters can be specified on a per role (server or
+ client) and domain basis (for now only IPs). The corresponding module
+ parameters will be ignored.
+ </para>
+ <para>
+ If the file name starts with a '.' the path will be relative to the
+ working directory (<emphasis>at runtime</emphasis>). If it starts
+ with a '/' it will be an absolute path and if it starts with anything
+ else the path will be relative to the main config file directory
+ (e.g.: for ser -f /etc/ser/ser.cfg it will be relative to /etc/ser/).
</para>
<para>
By default no config file is specified.
</para>
<para>
- The following parameters can be set in the config file, for each domain:
+ The following parameters can be set in the config file, for each
+ domain:
</para>
<itemizedlist>
<listitem><para>tls_method</para></listitem>
@@ -779,7 +823,16 @@ modparam("tls", "tls_force_run", 11)
<listitem><para>cipher_list</para></listitem>
</itemizedlist>
<para>
- SIP-router acts as a server when it accepts a connection and as a client when it initiates a new connection by itself (it connects to something).
+ All the parameters that take filenames as values will be resolved
+ using the same rules as for the tls config filename itself: starting
+ with a '.' means relative to the working directory, a '/' means an
+ absolute path and anything else a path relative to the directory of
+ the current ser main config file.
+ </para>
+ <para>
+ SIP-router acts as a server when it accepts a connection and as a
+ client when it initiates a new connection by itself (it connects to
+ something).
</para>
<example>
<title>Short config file</title>
Module: sip-router
Branch: master
Commit: 99fab38dd345a28262221d1af220933697c1c53d
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=99fab38…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Tue Sep 7 18:20:40 2010 +0200
sip-router*.cfg: defines, links, test run support
- added links to docs, ser_ctl, serweb and sr-users mailing list
address
- feature defines compatible with kamailio.cfg: WITH_DEBUG,
WITH_TLS, WITH_XMLRPC (can be enabled by uncommenting the
corresponding #!define or by starting ser with -A WITH_XXXX)
- XMLRPC_TLS_ONLY define: when enabled XMLRPC will be allowed only
on TLS and only from clients with valid certificates.
- XMLRPC_ALLOW_NET1, XMLRPC_ALLOW_NET2, XMLRPC_ALLOW_NET3 defines:
when enabled they must contain a valid network address (e.g.
10.0.0.0/8). xmlrpc requests will be accepted only from
localhost (always) and from clients with source addresses
matching one of the XMLRPC_ALLOW_NET[1-3] defines.
E.g.: ser -A WITH_XMLRPC -A XMLRPC_ALLOW_NET1=10.0.0.0/8 ....
- LOCAL_TEST_RUN define: when enabled ser will assume it is
not installed and that it is started from the source/compile
directory (as opposed to an installed version). All the modules
will be searched in modules*/modulename/modulename.so and all the
other files referenced in the config will be relative to the
working directory (and not the ser config file directory).
- multicast replication listen address set to udp only (avoids
warnings on startup)
- load sl after tm (the new merged sl prints a warning if tm is
not loaded first)
- use ser instead of sip-router for the DB names/uris and ctl
sockets
- use a XMLRPC specific route
- XMLRPC bug workaround for xmlrpclib (which waits for an EOF
before interpreting the response).
---
etc/sip-router-basic.cfg | 74 +++++++++++++++++++++----
etc/sip-router-oob.cfg | 135 +++++++++++++++++++++++++++++++++++++++------
etc/sip-router.cfg | 80 +++++++++++++++++++++++++--
3 files changed, 254 insertions(+), 35 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=99f…
Module: sip-router
Branch: master
Commit: 629cba2015ecf837a972070a55c5f02bdefed107
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=629cba2…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Tue Sep 7 17:43:26 2010 +0200
tls: relative file path support & license changes
- support relative path for private_key, ca_list and certificate.
If the filename starts with '.' or '..' the path will be
considered to be relative to the working directory (otherwise if
it does not start with '/' it will be relative to the main ser.cfg
file directory). The relative path is supported both for modparam
and for value loaded from the tls.cfg file.
- BSDed and removed FSF (c) from tls_domain.[ch] (the only code
remaining somewhat similar with the tls experimental module is
1 typedef).
---
modules/tls/tls_cfg.c | 16 ++++++-
modules/tls/tls_config.c | 5 ++-
modules/tls/tls_domain.c | 102 +++++++++++++++++++++++++++++++---------------
modules/tls/tls_domain.h | 39 ++++++-----------
4 files changed, 100 insertions(+), 62 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=629…
Module: sip-router
Branch: master
Commit: 139913192cb9e9616680a3a430a4039da9beb718
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1399131…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Tue Sep 7 17:03:53 2010 +0200
cfg_parser: allow relative paths for the cfg file
Allow relative parhs in the cfg_parser framework (used by the tls
module, ldap(s) and iptrtpproxy), by adding a new "basedir"
parameter to cfg_parser_init().
If basedir == 0 and the filename does not start with '/', the
filename path will be considered to be relative to the main ser
config file (e.g. ser -f /etc/ser/ser.cfg => relative to /etc/ser/ ).
This was the previous behaviour.
If basedir == "" the filename path will be considered to be
relative to the working directory (ser -w /tmp => relative to
/tmp).
For other basedir values, the filename path will be considered to
be relative to basedir.
---
cfg_parser.c | 32 +++++++++++++++++++++++---------
cfg_parser.h | 2 +-
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/cfg_parser.c b/cfg_parser.c
index 0827939..fa8721b 100644
--- a/cfg_parser.c
+++ b/cfg_parser.c
@@ -612,19 +612,33 @@ static char* get_base_name(str* filename)
}
-cfg_parser_t* cfg_parser_init(str* filename)
+
+/** intialize the config parser.
+ * @param basedir - path to the config file name. If 0 the path
+ * (base directory) of the main ser.cfg file will be used, else
+ * basedir will be concatenated to the filename. It will be
+ * used only if filename is not an absolute path.
+ * @param filename - config filename (can include path elements).
+ * @return 0 on error, !=0 on success.
+ */
+cfg_parser_t* cfg_parser_init(str* basedir, str* filename)
{
cfg_parser_t* st;
- char* pathname, *base;
+ char* pathname, *base, *abs_pathname;
- pathname = NULL;
+ abs_pathname = NULL;
+ pathname = filename->s;
st = NULL;
base = NULL;
- if ((pathname = get_abs_pathname(NULL, filename)) == NULL) {
- ERR("cfg_parser: Error while converting %.*s to absolute pathname\n",
- STR_FMT(filename));
- goto error;
+ /* if basedir == 0 or != "" get_abs_pathname */
+ if (basedir == 0 || basedir->len != 0) {
+ if ((abs_pathname = get_abs_pathname(basedir, filename)) == NULL) {
+ ERR("cfg_parser: Error while converting %.*s to absolute"
+ " pathname\n", STR_FMT(filename));
+ goto error;
+ }
+ pathname = abs_pathname;
}
if ((base = get_base_name(filename)) == NULL) goto error;
@@ -640,7 +654,7 @@ cfg_parser_t* cfg_parser_init(str* filename)
goto error;
}
- pkg_free(pathname);
+ if (abs_pathname) pkg_free(abs_pathname);
st->file = base;
st->line = 1;
@@ -653,7 +667,7 @@ cfg_parser_t* cfg_parser_init(str* filename)
pkg_free(st);
}
if (base) pkg_free(base);
- if (pathname) pkg_free(pathname);
+ if (abs_pathname) pkg_free(abs_pathname);
return NULL;
}
diff --git a/cfg_parser.h b/cfg_parser.h
index 4399b6c..11296c5 100644
--- a/cfg_parser.h
+++ b/cfg_parser.h
@@ -151,7 +151,7 @@ typedef struct cfg_parser {
extern struct cfg_option cfg_bool_values[];
-struct cfg_parser* cfg_parser_init(str* filename);
+struct cfg_parser* cfg_parser_init(str* basedir, str* filename);
void cfg_section_parser(struct cfg_parser* st, cfg_func_f parser, void* param);
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#87 - make install fails with a bash syntax error
User who did this - Daniel-Constantin Mierla (miconda)
----------
What is the change? Just moving the 'do' on a new line?
There are many such 'for' statements, did you get error only here? What is the error message?
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=87#comment117
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#87 - make install fails with a bash syntax error
User who did this - Dmitry Goncharov (Dmitry)
----------
The first patch is bit defective. It wont work if C_INSTALL_CFGS is not empty.
Please, consider this patch.
----------
One or more files have been attached.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=87#comment116
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.