utils llist: Added TODO note about iterator improvements.
store: Exported the store base object type as opaque type.
Renamed from store_obj_t to sdb_store_base_t to avoid a name-clash with
sdb_store_obj_t.
Renamed from store_obj_t to sdb_store_base_t to avoid a name-clash with
sdb_store_obj_t.
parser_test: Free memory returned by sdb_fe_parse().
dbi_test: Make tests support CK_FORK=no.
… by resetting state as needed.
… by resetting state as needed.
frontend: Let sdb_fe_parse() return a list of parsed node objects.
Each parse-tree node object represents a single command.
Each parse-tree node object represents a single command.
utils llist: Added sdb_llist_get().
object: Added sdb_object_create_simple().
This function creates a "simple" object without custom initialization and
destructor.
This function creates a "simple" object without custom initialization and
destructor.
utils llist: Added sdb_llist_len().
Declare sdb_fe_yyparse() in parser.h.
Apparently, older versions of bison do not include the function prototype in
the generated header file. Double-declarations don't hurt (as long as they
match).
Apparently, older versions of bison do not include the function prototype in
the generated header file. Double-declarations don't hurt (as long as they
match).
src/Makefile: Let libsysdb depend on parser.h.
src/Makefile: Tell automake that grammar.h is auto-built.
frontend: Added flex/bison based parser skeleton.
For now, this implements a mostly empty parser and helper functions to parse
strings (rather than open files). The parser accepts the "LIST" command and
ignores SQL and C style comments.
For now, this implements a mostly empty parser and helper functions to parse
strings (rather than open files). The parser accepts the "LIST" command and
ignores SQL and C style comments.
frontend/query: Fixed typo.
src/Makefile: Use LTLIBRARIES for libsysdb_scanner.
sysdb/scanner.l: Enabled 8bit, nodefault, and warn options.
store: Don't look up services from hierarchical hosts.
We don't have any concept of service inheritance (yet?).
Also, I'm not sure if this would ever make sense in general. This might be a
query option, though.
We don't have any concept of service inheritance (yet?).
Also, I'm not sure if this would ever make sense in general. This might be a
query option, though.
Fixed some issues identified by static code analysis.
The following issues were identified and fixed:
* Allocator sizeof operand mismatch in dbi utils.
* Dead increment in tools/sysdb/input.
* Memory leak (and leaving behind invalid memory) in tools/sysdbd/configfile.
* Out-of-bound array access in core/plugin (the original report by the clang
analyzer was wrong but pointed to a location affected by a related
problem).
* Stack address stored into global variable in liboconfig.
Thanks to cppcheck and the clang analyzer!
The following issues were identified and fixed:
* Allocator sizeof operand mismatch in dbi utils.
* Dead increment in tools/sysdb/input.
* Memory leak (and leaving behind invalid memory) in tools/sysdbd/configfile.
* Out-of-bound array access in core/plugin (the original report by the clang
analyzer was wrong but pointed to a location affected by a related
problem).
* Stack address stored into global variable in liboconfig.
Thanks to cppcheck and the clang analyzer!
Moved coverage.sh to the t/ subdirectory.
Makefile: Added coverage.sh to a dist tarball.
coverage.sh: Added a helper script to generate HTML coverage reports.
The script uses lcov and creates a clean copy of the source code in a
temporary directory using 'make dist'.
The script uses lcov and creates a clean copy of the source code in a
temporary directory using 'make dist'.
t/Makefile: Pass gcov flags to tests as well.
Else, some tests might not compile correctly.
Else, some tests might not compile correctly.
.gitignore: Ignore test-driver.
This file is created by newer autotools when running ‘make check’.
This file is created by newer autotools when running ‘make check’.
src/Makefile: Include sysdb.h.in file in a distribution.
src/Makefile: Added a rule to create ‘../version’.
Makefile: Fixed generation of the ‘version’ file.
src/Makefile: Fixed path to connection-private.h.
t/Makefile: Use top_srcdir rather than top_builddir.
This allows running tests out-of-tree.
This allows running tests out-of-tree.
Make everything buildable out-of-tree.
Updated README.
Added missing dependencies, links to dependency upstream homepages, and some
notes about testing.
Added missing dependencies, links to dependency upstream homepages, and some
notes about testing.
Let the config parser accept unquoted IPv6 addresses.
The parser supports raw IPv6 addresses, optional address and port (as
[<addr>]:<port>), and embedded IPv4 addresses.
Based on "Common Patterns" found in the flex manual.
The parser supports raw IPv6 addresses, optional address and port (as
[<addr>]:<port>), and embedded IPv4 addresses.
Based on "Common Patterns" found in the flex manual.
src/Makefile: Fixed an automake warning.
Added "lib" suffix to library name.
Added "lib" suffix to library name.
configure: Re-enabled coverage support for GCC.
D'oh!
D'oh!
configure: Do stricter GCC checking.
$GCC might be true for clang as well but clang does not support gcov coverage
testing.
$GCC might be true for clang as well but clang does not support gcov coverage
testing.
configure: Do not enable gcov unless the compiler is GCC.
Others are not known (to me) to work.
Others are not known (to me) to work.
.travis.yml: Use --enable-gcov which will fix clang builds.
build system: Added --enable-gcov configure option.
.travis.yml: Use verbose coveralls output.
This is to see what's going on in the logs.
This is to see what's going on in the logs.
.travis.yml: Collect and upload coverage information to coveralls.io.
Use -Wno-sign-conversion on Travis.
GNU libc, as used on the current test machines, would else provoke an error in
the expansion of FD_SET.
GNU libc, as used on the current test machines, would else provoke an error in
the expansion of FD_SET.
proto utils: Fixed invalid conversion of return value.
Thanks to Travis CI for finding this!
Thanks to Travis CI for finding this!
Added a travis-ci.org project specification.
sysdb: Use the flex scanner generator for reading input.
The idea is to implement a minimalistic parser which understands all valid
input and which is used to determine if an input line is part of an existing
command or a command on its own. This information will then be used to update
the prompt (and possibly to determine other information as well).
The scanner's YY_INPUT "method" is overwritten in order to use readline and
custom buffering for user input.
The idea is to implement a minimalistic parser which understands all valid
input and which is used to determine if an input line is part of an existing
command or a command on its own. This information will then be used to update
the prompt (and possibly to determine other information as well).
The scanner's YY_INPUT "method" is overwritten in order to use readline and
custom buffering for user input.
Merged branch 'master' of git://git.tokkee.org/sysdb.
plugin: Record all loaded plugins and use that for improved error messages.
frontend: Make the number of handler threads configurable.
The number is passed to listen_and_serve() as part of sdb_fe_loop_t.
The number is passed to listen_and_serve() as part of sdb_fe_loop_t.
frontend: Return an error if no handler threads could be created.
frontend: Implemented simplified error handling when creating threads.
There's hardly any reasonable error condition that might happen, so this
rather simplied approach should be sufficient.
There's hardly any reasonable error condition that might happen, so this
rather simplied approach should be sufficient.
client: Let sdb_client_recv() use sdb_proto_select().
proto utils: Added sdb_proto_select().
This is a simple wrapper around select(2) to be used in cases where we only
care about a single file-descriptor being ready for a particular operation.
This is a simple wrapper around select(2) to be used in cases where we only
care about a single file-descriptor being ready for a particular operation.
frontend/sock_test: Try to connect to the server socket.
This verifies that the socket is actually usable.
Also, it fixes a race condition in the test. The UNIX socket file is already
created when adding the listener. Thus, the previous synchronization between
the main thread and the socket handler thread did not work in most cases.
This verifies that the socket is actually usable.
Also, it fixes a race condition in the test. The UNIX socket file is already
created when adding the listener. Thus, the previous synchronization between
the main thread and the socket handler thread did not work in most cases.
frontend: Clean up UNIX sockets when closing a listener.
frontend: Let listen_and_serve() return early if do_loop == 0.
That is, do not (re-)open any sockets.
That is, do not (re-)open any sockets.
frontend/sock_test: Added initial tests for frontend code.
.gitignore: Ignore sysdb / sysdbd only as src/sysdb / src/sysdbd.
Moved connection-private.h from src/include/frontend/ to src/frontend/.
This header is not meant to be used anyway else, so don't lead people into
temptation.
This header is not meant to be used anyway else, so don't lead people into
temptation.
Moved sysdb and sysdbd sources to src/tools/.
Also, moved all purely private headers to that directory as well.
Renamed some files for greater consistency.
Also, moved all purely private headers to that directory as well.
Renamed some files for greater consistency.
.gitignore: Ignore ar-lib.
sysdb: Use a string buffer and simple (stupid) ';' EO-query checks.
Use a different prompt (similar to psql) when inside a query.
Use a different prompt (similar to psql) when inside a query.
configure: Fixed some automake warnings.
doc/Makefile: Use SUFFIXES rather than GNU-specific %-style rules.
strbuf_test: Added tests for sdb_strbuf_clear().
strbuf_test: Added a couple of tests operating on a zero-size buffer.
This is mostly about checking that this does not crash.
This is mostly about checking that this does not crash.
strbuf utils: Added sdb_strbuf_clear().
sysdb: Free memory allocated by readline().
sysdb: Don't warn about missing history file when loading history.
sysdb: Check for and use libedit/libreadline for command input.
dbi utils: Don't keep invalid object address after closing DBI connections.
frontend: Remove stale UNIX sockets before trying to bind().
client: Report client socket errors using error utils.
sysdb: Exit, if the current user could not be determined.
Merged branch 'master' of git://git.tokkee.org/sysdb.
sysdb: Use error utilities.
error utils: Make the logger callback configurable.
Don't depend on the plugin module anymore. Rather, add sdb_error_set_logger()
which may be used to set a callback to be used for all logging. Default to
printing to stderr.
sysdbd now uses that to register sdb_plugin_log as logger callback.
Don't depend on the plugin module anymore. Rather, add sdb_error_set_logger()
which may be used to set a callback to be used for all logging. Default to
printing to stderr.
sysdbd now uses that to register sdb_plugin_log as logger callback.
Moved core/error to utils/error.
Later, we'll use the module from the daemon and client.
Later, we'll use the module from the daemon and client.
sysdb: Connect to the server and issue a STARTUP command.
The current username is sent along with the STARTUP command.
The current username is sent along with the STARTUP command.
sysdbd: Send SIGINT to backend thread when shutting down.
This will interrupt the sleep call and make the thread shut down faster.
This will interrupt the sleep call and make the thread shut down faster.
proto utils: Fixed offset check in get_int().
Let sdb_client_connect() send a username to the server.
… using a STARTUP message.
… using a STARTUP message.
frontend: Split connection status constants into a separate header.
This will allow the client to use it as well.
This will allow the client to use it as well.
store_test: Fixed golden data for tojson() test.
Merged branch 'master' of git://git.tokkee.org/sysdb.
store_test: Added a test for tojson().
store: tojson(): Comma-separate multiple hosts.
Run all tests using TZ=UTC.
This will ensure consistent time formatting.
This will ensure consistent time formatting.
t/core/store_test: Added initial tests for the object store.
For now, testing basic insertion operations.
For now, testing basic insertion operations.
store: Don't try to update non-existent attributes.
object_test: Added test for sdb_object_cmp_by_name().
object_test: Added tests for wrapped object and memory management.
Updated various copyright notices to 2012-2013.
sysdbd: Changed -d option to -D and default to daemonizing the process.
It doesn't really matter much what the default is but -d should be reserved
for debugging.
It doesn't really matter much what the default is but -d should be reserved
for debugging.
sysdbd: Fixed a typo.
sysdb: Added a initial client implementation.
For now, this is basically a placeholder.
For now, this is basically a placeholder.
client: Let client_recv() read a full response.
… and block if necessary. There is no reason that a client should handle
partial responses.
… and block if necessary. There is no reason that a client should handle
partial responses.
client: Let client_recv() not pass unparsed status,len to the caller.
strbuf_test: Added skip() tests using various offsets.
util strbuf: Let skip() support an offset.
That is, add support for removing bytes from the middle of the buffer.
That is, add support for removing bytes from the middle of the buffer.
Added version functions to libsysdbclient.
This is basically the same as the sdb_version() functions but to be used only
in the client lib.
This is basically the same as the sdb_version() functions but to be used only
in the client lib.
Link proto and strbuf utilities into libsysdbclient.
Added initial client library implementation.
For now, this includes a network client only.
For now, this includes a network client only.
utils proto: Added sdb_proto_get_int().
This function “recieves” a 32bit integer from a string buffer and converts it
from network to host byte order.
This function “recieves” a 32bit integer from a string buffer and converts it
from network to host byte order.