Code

sysdb.git
9 years agostore: Added field type VALUE for attribute values.
Sebastian Harl [Sun, 15 Mar 2015 02:05:50 +0000 (22:05 -0400)]
store: Added field type VALUE for attribute values.

9 years agostore: Test get_field() more extensively and fix a small bug.
Sebastian Harl [Sun, 15 Mar 2015 01:46:41 +0000 (21:46 -0400)]
store: Test get_field() more extensively and fix a small bug.

Use a table-driven test now.

9 years agoAdd tests for expression iterators.
Sebastian Harl [Wed, 11 Mar 2015 19:03:46 +0000 (20:03 +0100)]
Add tests for expression iterators.

9 years agostore_expr: iterator: Support constant arrays without a stored object.
Sebastian Harl [Wed, 11 Mar 2015 19:02:07 +0000 (20:02 +0100)]
store_expr: iterator: Support constant arrays without a stored object.

9 years agostore_expr: Fix iter_has_next if the first elements are filtered.
Sebastian Harl [Wed, 11 Mar 2015 19:01:19 +0000 (20:01 +0100)]
store_expr: Fix iter_has_next if the first elements are filtered.

9 years agodata: Let sdb_data_array_get support DATETIME, BINARY, REGEX values.
Sebastian Harl [Wed, 11 Mar 2015 19:00:27 +0000 (20:00 +0100)]
data: Let sdb_data_array_get support DATETIME, BINARY, REGEX values.

9 years agodata: sdb_data_strcmp supports arrays because sdb_data_format supports it.
Sebastian Harl [Wed, 11 Mar 2015 18:59:13 +0000 (19:59 +0100)]
data: sdb_data_strcmp supports arrays because sdb_data_format supports it.

9 years agostore: Use iterable expressions for iterators.
Sebastian Harl [Sun, 8 Mar 2015 21:57:06 +0000 (22:57 +0100)]
store: Use iterable expressions for iterators.

Rather than having a separate iterator implementation in store_lookup.

9 years agostore: When advancing an iterator don't loop endlessly on filtered objects.
Sebastian Harl [Sun, 8 Mar 2015 21:56:09 +0000 (22:56 +0100)]
store: When advancing an iterator don't loop endlessly on filtered objects.

9 years agostore: Apply iterator expressions to the iterated objects.
Sebastian Harl [Sun, 8 Mar 2015 21:52:49 +0000 (22:52 +0100)]
store: Apply iterator expressions to the iterated objects.

9 years agostore: Advance expression iterators even if array access fails.
Sebastian Harl [Sun, 8 Mar 2015 21:47:51 +0000 (22:47 +0100)]
store: Advance expression iterators even if array access fails.

Else, we'd have an endless loop as the caller doesn't know about that.

9 years agostore: Fixed a memory leak in sdb_store_expr_iter_destroy().
Sebastian Harl [Sun, 8 Mar 2015 21:46:45 +0000 (22:46 +0100)]
store: Fixed a memory leak in sdb_store_expr_iter_destroy().

9 years agoLet iterator operators fill in the left operand of child operators.
Sebastian Harl [Sun, 8 Mar 2015 16:15:33 +0000 (17:15 +0100)]
Let iterator operators fill in the left operand of child operators.

This avoids the need for repeating the same operand in two places and better
reflects what's actually going on.

9 years agoLet the first operand of ANY/ALL iterators be an expression.
Sebastian Harl [Sun, 8 Mar 2015 10:56:33 +0000 (11:56 +0100)]
Let the first operand of ANY/ALL iterators be an expression.

For now, the same restrictions apply as before (iterate child objects or the
backends field). This is in preparation for more generic iterators.

9 years agoquery language: Change iterator syntax to ANY/ALL <iter>.<field> <op> <v>.
Sebastian Harl [Sat, 7 Mar 2015 13:14:56 +0000 (14:14 +0100)]
query language: Change iterator syntax to ANY/ALL <iter>.<field> <op> <v>.

That is, make it explicit that iterators access the object name and make it
easier to support other fields as well.

9 years agodata: Return the number of bytes that would have been returned.
Sebastian Harl [Sat, 7 Mar 2015 13:01:17 +0000 (14:01 +0100)]
data: Return the number of bytes that would have been returned.

That is, behave as documented, even if the buffer is NULL or otherwise too
small. Return size_t instead of an integer.

9 years agodata: Let strlen/format handle NULL values correctly.
Sebastian Harl [Sat, 7 Mar 2015 12:56:32 +0000 (13:56 +0100)]
data: Let strlen/format handle NULL values correctly.

9 years agostore: Add support for iterable expressions.
Sebastian Harl [Thu, 5 Mar 2015 20:25:40 +0000 (21:25 +0100)]
store: Add support for iterable expressions.

It can be used to iterate through either the list of child nodes or through
arbitrary arrays. An expression is iterable either if it stores / evaluates to
an array or if it's a typed expression evaluated in the context of an object
where the specified type represents child nodes.

9 years agoavltree: Add sdb_avltree_iter_peek_next().
Sebastian Harl [Thu, 5 Mar 2015 07:13:42 +0000 (08:13 +0100)]
avltree: Add sdb_avltree_iter_peek_next().

The function returns the next element without advancing the iterator.

9 years agoAllow the left operand of comparison operations to be NULL (initially).
Sebastian Harl [Wed, 4 Mar 2015 20:13:49 +0000 (21:13 +0100)]
Allow the left operand of comparison operations to be NULL (initially).

However, when evaluating the expression, the operand has to be set. We'll use
this as a placeholder for inserting values dynamically.

9 years agoanalyzer: Check that all iterators use ary operators.
Sebastian Harl [Wed, 4 Mar 2015 09:54:49 +0000 (10:54 +0100)]
analyzer: Check that all iterators use ary operators.

All iterators are based on a comparison <iter> <op> <expr> and the same
restrictions apply to all of them.

9 years agofrontend/grammar: Fixed format argument used in yyerrorf().
Sebastian Harl [Mon, 2 Mar 2015 06:41:55 +0000 (07:41 +0100)]
frontend/grammar: Fixed format argument used in yyerrorf().

9 years agot/integration: Split query.sh into multiple tests.
Sebastian Harl [Sun, 1 Mar 2015 18:34:14 +0000 (19:34 +0100)]
t/integration: Split query.sh into multiple tests.

9 years agointegration/query.sh: Check that empty commands work fine.
Sebastian Harl [Sun, 1 Mar 2015 18:16:23 +0000 (19:16 +0100)]
integration/query.sh: Check that empty commands work fine.

9 years agoparser_test: Test further error cases and error propagation in the analyzer.
Sebastian Harl [Sun, 1 Mar 2015 18:13:04 +0000 (19:13 +0100)]
parser_test: Test further error cases and error propagation in the analyzer.

9 years agofrontend/grammar: Check arithmetic expressions early.
Sebastian Harl [Sun, 1 Mar 2015 17:36:34 +0000 (18:36 +0100)]
frontend/grammar: Check arithmetic expressions early.

Constant expressions are evaluated early. Thus, creating an expression object
may fail if there's a semantics error. Catch this early and report a (generic)
error to avoid propagating a NULL value.

9 years agosysdbql(7): Document typed expressions.
Sebastian Harl [Sun, 1 Mar 2015 16:31:29 +0000 (17:31 +0100)]
sysdbql(7): Document typed expressions.

9 years agoAdd support for the 'NOT IN' operator.
Sebastian Harl [Sun, 1 Mar 2015 15:39:20 +0000 (16:39 +0100)]
Add support for the 'NOT IN' operator.

'a NOT IN b' is the same as 'NOT a IN b'.

9 years agoparser_test: Test various array expressions.
Sebastian Harl [Sun, 1 Mar 2015 15:24:35 +0000 (16:24 +0100)]
parser_test: Test various array expressions.

9 years agoanalyzer: The left operand of IN may be an array as well.
Sebastian Harl [Sun, 1 Mar 2015 15:22:09 +0000 (16:22 +0100)]
analyzer: The left operand of IN may be an array as well.

9 years agoanalyzer: Check the data-type of IN operands.
Sebastian Harl [Sun, 1 Mar 2015 15:19:29 +0000 (16:19 +0100)]
analyzer: Check the data-type of IN operands.

9 years agot/: Make it possibly to easily run unit and integration tests separately.
Sebastian Harl [Sun, 1 Mar 2015 14:41:17 +0000 (15:41 +0100)]
t/: Make it possibly to easily run unit and integration tests separately.

9 years agot/coverage.sh: Exclude auto-generated c files.
Sebastian Harl [Sun, 1 Mar 2015 14:38:56 +0000 (15:38 +0100)]
t/coverage.sh: Exclude auto-generated c files.

9 years agot/unit/: Create one test binary for each *_test.c file.
Sebastian Harl [Sat, 28 Feb 2015 17:45:39 +0000 (18:45 +0100)]
t/unit/: Create one test binary for each *_test.c file.

That'll allow to run more stuff in parallel or single tests more selectively.

9 years agocore/time_test: Converted to "loop" tests.
Sebastian Harl [Fri, 27 Feb 2015 23:11:30 +0000 (00:11 +0100)]
core/time_test: Converted to "loop" tests.

9 years agocore/store*_test.c: Converted most tests to "loop" tests.
Sebastian Harl [Fri, 27 Feb 2015 23:01:05 +0000 (00:01 +0100)]
core/store*_test.c: Converted most tests to "loop" tests.

9 years agofrontend/parser_test: Convert to "loop" tests.
Sebastian Harl [Fri, 27 Feb 2015 22:17:12 +0000 (23:17 +0100)]
frontend/parser_test: Convert to "loop" tests.

That'll make sure we'll see the errors of all test cases in one test run.

9 years agofrontend/query_test.c: Added unit tests for the FETCH commands.
Sebastian Harl [Fri, 27 Feb 2015 22:02:00 +0000 (23:02 +0100)]
frontend/query_test.c: Added unit tests for the FETCH commands.

9 years agoparser_test: Add testcases covering operand type checks.
Sebastian Harl [Fri, 27 Feb 2015 18:32:55 +0000 (19:32 +0100)]
parser_test: Add testcases covering operand type checks.

9 years agoanalyzer: Verify the type of arithmetic operands.
Sebastian Harl [Fri, 27 Feb 2015 18:22:35 +0000 (19:22 +0100)]
analyzer: Verify the type of arithmetic operands.

9 years agoanalyzer: Check types of comparison operands.
Sebastian Harl [Fri, 27 Feb 2015 18:15:47 +0000 (19:15 +0100)]
analyzer: Check types of comparison operands.

9 years agoMerged branch 'master' of git://github.com/sysdb/sysdb.git.
Sebastian Harl [Fri, 27 Feb 2015 17:34:02 +0000 (18:34 +0100)]
Merged branch 'master' of git://github.com/sysdb/sysdb.git.

9 years agofrontend: Fixed a memory leak in an error condition in FETCH.
Sebastian Harl [Fri, 27 Feb 2015 17:13:22 +0000 (18:13 +0100)]
frontend: Fixed a memory leak in an error condition in FETCH.

9 years agoconfigure: Make sure that PACKAGE_URL is defined.
Sebastian Harl [Fri, 27 Feb 2015 16:49:14 +0000 (17:49 +0100)]
configure: Make sure that PACKAGE_URL is defined.

autoconf < 2.64 don't support PACKAGE_URL.

Thanks to @faxm0dem for reporting the resulting build error on RHEL6 in #1

9 years agoMerged branch 'master' of git://git.tokkee.org/sysdb.
Sebastian Harl [Fri, 27 Feb 2015 16:39:51 +0000 (17:39 +0100)]
Merged branch 'master' of git://git.tokkee.org/sysdb.

9 years agoCheck the return value of write() to satisfy GCC's unused-result checks.
Sebastian Harl [Fri, 27 Feb 2015 16:31:29 +0000 (17:31 +0100)]
Check the return value of write() to satisfy GCC's unused-result checks.

9 years agot/valgrind.suppress: Suppress various issues in OpenSSL 1.0.0.
Sebastian Harl [Fri, 27 Feb 2015 16:20:52 +0000 (17:20 +0100)]
t/valgrind.suppress: Suppress various issues in OpenSSL 1.0.0.

9 years agointegration/query.sh: Test FETCH with FILTER.
Sebastian Harl [Wed, 25 Feb 2015 09:42:36 +0000 (10:42 +0100)]
integration/query.sh: Test FETCH with FILTER.

9 years agofrontend: Fixed hostname in error messages in FETCH.
Sebastian Harl [Wed, 25 Feb 2015 09:40:10 +0000 (10:40 +0100)]
frontend: Fixed hostname in error messages in FETCH.

9 years agofrontend: Fix a memory leak in an error condition in FETCH.
Sebastian Harl [Wed, 25 Feb 2015 09:39:34 +0000 (10:39 +0100)]
frontend: Fix a memory leak in an error condition in FETCH.

9 years agointegration/test_lib.sh: Store the CA serial in $TESTDIR.
Sebastian Harl [Wed, 25 Feb 2015 09:20:35 +0000 (10:20 +0100)]
integration/test_lib.sh: Store the CA serial in $TESTDIR.

9 years agofrontend: Provide more details in the logs when shutting down a connection.
Sebastian Harl [Sun, 22 Feb 2015 18:38:31 +0000 (19:38 +0100)]
frontend: Provide more details in the logs when shutting down a connection.

9 years agosysdb: Print the server version after (re)connecting.
Sebastian Harl [Sun, 22 Feb 2015 15:47:01 +0000 (16:47 +0100)]
sysdb: Print the server version after (re)connecting.

9 years agofrontend: Added the SERVER_VERSION command.
Sebastian Harl [Sun, 22 Feb 2015 15:46:30 +0000 (16:46 +0100)]
frontend: Added the SERVER_VERSION command.

This command sends back the server version.

9 years agoproto: Make sdb_proto_marshal_int32 a public function.
Sebastian Harl [Sun, 22 Feb 2015 15:27:09 +0000 (16:27 +0100)]
proto: Make sdb_proto_marshal_int32 a public function.

9 years agosysdbd-store-network(5): Documented the store::network plugin.
Sebastian Harl [Sat, 21 Feb 2015 16:07:14 +0000 (17:07 +0100)]
sysdbd-store-network(5): Documented the store::network plugin.

9 years agoversion-gen.sh: Added .git suffix to default version again.
Sebastian Harl [Sat, 21 Feb 2015 15:45:47 +0000 (16:45 +0100)]
version-gen.sh: Added .git suffix to default version again.

9 years agoRelease SysDB 0.7.0. sysdb-0.7.0
Sebastian Harl [Sat, 21 Feb 2015 14:03:11 +0000 (15:03 +0100)]
Release SysDB 0.7.0.

9 years agoReleaseNotes: Set 0.7.0 release date to 2015-02-21.
Sebastian Harl [Sat, 21 Feb 2015 14:02:26 +0000 (15:02 +0100)]
ReleaseNotes: Set 0.7.0 release date to 2015-02-21.

9 years agoReleaseNotes: Added draft for the 0.7.0 release.
Sebastian Harl [Thu, 19 Feb 2015 22:06:49 +0000 (23:06 +0100)]
ReleaseNotes: Added draft for the 0.7.0 release.

9 years agostore::network: Reconnect after losing the connection to the remote side.
Sebastian Harl [Wed, 18 Feb 2015 20:32:48 +0000 (21:32 +0100)]
store::network: Reconnect after losing the connection to the remote side.

9 years agostore::network: Added support for SSL configuration options.
Sebastian Harl [Wed, 18 Feb 2015 12:05:24 +0000 (13:05 +0100)]
store::network: Added support for SSL configuration options.

9 years agossl utils: During shutdown, destroy mutexes as the last step.
Sebastian Harl [Mon, 16 Feb 2015 08:04:18 +0000 (09:04 +0100)]
ssl utils: During shutdown, destroy mutexes as the last step.

Even ERR_free_strings() may call CRYPTO_lock.

9 years agostore::network: Use INFO level for an informational message.
Sebastian Harl [Mon, 16 Feb 2015 07:58:38 +0000 (08:58 +0100)]
store::network: Use INFO level for an informational message.

9 years agossl: Register OpenSSL thread-ID and locking callbacks.
Sebastian Harl [Tue, 10 Feb 2015 07:46:41 +0000 (08:46 +0100)]
ssl: Register OpenSSL thread-ID and locking callbacks.

This is required for multi-threaded applications. Else, they "will crash at
random".

9 years agoSSL utils: Added init() and shutdown() functions for global setup/shutdown.
Sebastian Harl [Mon, 9 Feb 2015 17:43:39 +0000 (18:43 +0100)]
SSL utils: Added init() and shutdown() functions for global setup/shutdown.

Use those functions in sysdb and sysdbd instead of calling the OpenSSL
functions directly.

9 years agovalgrind.suppress: Ignore a Memcheck:Cond error in libcrypto.
Sebastian Harl [Tue, 3 Feb 2015 13:26:20 +0000 (14:26 +0100)]
valgrind.suppress: Ignore a Memcheck:Cond error in libcrypto.

This happens with the libssl version on Travis.

9 years agot/integration/: Added simple SSL tests.
Sebastian Harl [Sun, 1 Feb 2015 19:31:14 +0000 (20:31 +0100)]
t/integration/: Added simple SSL tests.

9 years agoparser_test: Added various tests for STORE commands.
Sebastian Harl [Sun, 1 Feb 2015 18:18:51 +0000 (19:18 +0100)]
parser_test: Added various tests for STORE commands.

9 years agoREADME: Add libssl to prerequisites.
Sebastian Harl [Sun, 1 Feb 2015 17:48:04 +0000 (18:48 +0100)]
README: Add libssl to prerequisites.

9 years agosysdb(1), sysdbd(1): Document client authentication.
Sebastian Harl [Sun, 1 Feb 2015 17:44:54 +0000 (18:44 +0100)]
sysdb(1), sysdbd(1): Document client authentication.

9 years agosysdb(1), sysdbd(1): Document files used by the tools by default.
Sebastian Harl [Sun, 1 Feb 2015 16:50:37 +0000 (17:50 +0100)]
sysdb(1), sysdbd(1): Document files used by the tools by default.

9 years agosysdb(1): Document SSL related command line options.
Sebastian Harl [Sun, 1 Feb 2015 16:41:31 +0000 (17:41 +0100)]
sysdb(1): Document SSL related command line options.

9 years agosysdbd.conf(5): Document the Listen SSL options.
Sebastian Harl [Sun, 1 Feb 2015 16:17:59 +0000 (17:17 +0100)]
sysdbd.conf(5): Document the Listen SSL options.

9 years agofrontend, client: Properly support IPv6 when handling address strings.
Sebastian Harl [Sun, 1 Feb 2015 16:04:09 +0000 (17:04 +0100)]
frontend, client: Properly support IPv6 when handling address strings.

9 years agoclient: Prefix all log messages with "client:".
Sebastian Harl [Sun, 1 Feb 2015 11:00:12 +0000 (12:00 +0100)]
client: Prefix all log messages with "client:".

9 years agosysdb: Add -A option to specify a CA certificates file.
Sebastian Harl [Sun, 1 Feb 2015 10:55:55 +0000 (11:55 +0100)]
sysdb: Add -A option to specify a CA certificates file.

9 years agoUnload all plugins when shutting down sysdbd.
Sebastian Harl [Sun, 1 Feb 2015 10:31:23 +0000 (11:31 +0100)]
Unload all plugins when shutting down sysdbd.

This will destruct all registered user-data objects, thus properly shutting
down all internal plugin state (e.g. connections to other systems).

9 years agocollectd::unixsock: Fixed a memory leak happening when unloading the module.
Sebastian Harl [Sun, 1 Feb 2015 10:30:09 +0000 (11:30 +0100)]
collectd::unixsock: Fixed a memory leak happening when unloading the module.

9 years agoclient: Check the remote peer name.
Sebastian Harl [Sun, 1 Feb 2015 10:19:54 +0000 (11:19 +0100)]
client: Check the remote peer name.

9 years agosysdbd-syslog(5): Documented LogLevel configuration option.
Sebastian Harl [Sun, 1 Feb 2015 09:45:46 +0000 (10:45 +0100)]
sysdbd-syslog(5): Documented LogLevel configuration option.

9 years agoplugin: Fixed log message for newly registered config callbacks.
Sebastian Harl [Sun, 1 Feb 2015 09:39:55 +0000 (10:39 +0100)]
plugin: Fixed log message for newly registered config callbacks.

9 years agosyslog plugin: Make log-level configurable.
Sebastian Harl [Sun, 1 Feb 2015 09:38:38 +0000 (10:38 +0100)]
syslog plugin: Make log-level configurable.

9 years agoerror utils: Add sdb_error_parse_priority().
Sebastian Harl [Sun, 1 Feb 2015 09:36:18 +0000 (10:36 +0100)]
error utils: Add sdb_error_parse_priority().

9 years agosysdbd: Add SSL{Certificate,CertificateKey,CACertificates} config options.
Sebastian Harl [Sat, 31 Jan 2015 14:54:04 +0000 (15:54 +0100)]
sysdbd: Add SSL{Certificate,CertificateKey,CACertificates} config options.

9 years agofrontend: Support custom SSL options for each listener.
Sebastian Harl [Sat, 31 Jan 2015 14:51:47 +0000 (15:51 +0100)]
frontend: Support custom SSL options for each listener.

9 years agosysdb: Added -K and -C options to specify SSL key and cert files.
Sebastian Harl [Fri, 30 Jan 2015 15:04:48 +0000 (16:04 +0100)]
sysdb: Added -K and -C options to specify SSL key and cert files.

9 years agosysdb: Use SSL keys and certs in ~/.config/sysdb/ssl/ by default.
Sebastian Harl [Fri, 30 Jan 2015 12:43:19 +0000 (13:43 +0100)]
sysdb: Use SSL keys and certs in ~/.config/sysdb/ssl/ by default.

9 years agoutils os: Add sdb_realpath().
Sebastian Harl [Fri, 30 Jan 2015 12:42:27 +0000 (13:42 +0100)]
utils os: Add sdb_realpath().

This function is similar to realpath() but also expands ~/ to the current
user's home directory.

9 years agoSSL utils: Pass a constant options object to all constructors.
Sebastian Harl [Fri, 30 Jan 2015 11:35:20 +0000 (12:35 +0100)]
SSL utils: Pass a constant options object to all constructors.

9 years agosysdb: Add and use sdb_input_reset().
Sebastian Harl [Fri, 30 Jan 2015 11:01:48 +0000 (12:01 +0100)]
sysdb: Add and use sdb_input_reset().

This simplifies cleanup.

9 years agoMove sdb_get_homedir() from tools/sysdb to utils/os.
Sebastian Harl [Fri, 30 Jan 2015 10:49:20 +0000 (11:49 +0100)]
Move sdb_get_homedir() from tools/sysdb to utils/os.

9 years agoSSL utils: Include the relevant filename in all error messages.
Sebastian Harl [Fri, 30 Jan 2015 10:27:16 +0000 (11:27 +0100)]
SSL utils: Include the relevant filename in all error messages.

9 years agoSSL utils: Add sdb_ssl_free_options().
Sebastian Harl [Fri, 30 Jan 2015 10:26:49 +0000 (11:26 +0100)]
SSL utils: Add sdb_ssl_free_options().

9 years agoclient: Make SSL options configurable.
Sebastian Harl [Fri, 30 Jan 2015 10:12:12 +0000 (11:12 +0100)]
client: Make SSL options configurable.

9 years agoconfigure: Where available, include version information in the summary.
Sebastian Harl [Wed, 28 Jan 2015 15:35:37 +0000 (16:35 +0100)]
configure: Where available, include version information in the summary.

9 years agofrontend: Log an INFO message about which listener sockets are in use.
Sebastian Harl [Wed, 28 Jan 2015 15:20:19 +0000 (16:20 +0100)]
frontend: Log an INFO message about which listener sockets are in use.

9 years agoclient, sysdb: Let TCP connection use SSL.
Sebastian Harl [Wed, 28 Jan 2015 15:19:24 +0000 (16:19 +0100)]
client, sysdb: Let TCP connection use SSL.

9 years agoclient: Don't use select() before reading from a client connection.
Sebastian Harl [Wed, 28 Jan 2015 15:17:47 +0000 (16:17 +0100)]
client: Don't use select() before reading from a client connection.

This doesn't work well if the connection buffers data (like with the upcoming
SSL support).

9 years agofrontend, sysdbd: Let all TCP connections use SSL.
Sebastian Harl [Wed, 28 Jan 2015 15:14:23 +0000 (16:14 +0100)]
frontend, sysdbd: Let all TCP connections use SSL.

Client certificate checks are enforced and the client cert's common name (CN)
is used as the peer name.