Krisztian Litkey [Tue, 15 Oct 2013 11:14:47 +0000 (14:14 +0300)]
Merge branch 'master' of github.com:otcshare/policy-internal
Krisztian Litkey [Tue, 15 Oct 2013 05:39:55 +0000 (08:39 +0300)]
common: never remove forcibly a reused fd from epoll.
If during a single iteration of epoll event dispatching
a file descriptor is closed and reused, make sure the
new reused file desciptor is not accidentially removed
from epoll.
During dispatching we try to patch things up to prevent
a busy looping flood of EPOLLRDHUP/EPOLLHUP events for
users that don't properly handle them. This bug was
triggered when the closed file descriptor got reused and
a new watch for it readded from within the I/O watch
callback for the HUP event on the original closed descriptor.
This patch also makes sure that an effectively similar bug
can not be triggered by calling mrp_del_io_watch twice for
the same I/O watch.
Krisztian Litkey [Mon, 14 Oct 2013 17:23:45 +0000 (20:23 +0300)]
common: more mainloop debug messages for I/O watches.
Krisztian Litkey [Mon, 14 Oct 2013 15:01:15 +0000 (18:01 +0300)]
common: more debug messages for stream transport events.
Ismo Puustinen [Mon, 14 Oct 2013 13:51:17 +0000 (16:51 +0300)]
mdb: Don't use C++ keywords in variable names and structure members.
Ismo Puustinen [Mon, 14 Oct 2013 13:48:09 +0000 (16:48 +0300)]
core: fix compiler warnings.
In theory, forward declarations of enums are not allowed, because C
standard doesn't define the size of enum type.
Ismo Puustinen [Fri, 4 Oct 2013 12:11:01 +0000 (15:11 +0300)]
resource-dbus: fix a memory leak.
Krisztian Litkey [Fri, 4 Oct 2013 11:36:13 +0000 (14:36 +0300)]
build-sys: added githooks to do Change-Id insertion/filtering.
Added a bunch of git hooks that collectively try to automatically
insert or filter gerrit Change-Id tags depending on the branch name.
Branches matching *tizen* will have tags inserted other will have
tags filtered out. If you have a bunch of existing commits where
you want do a bulk insert/filter operation, just run git rebase -i
over the range of commits, mark all for rewording, and the hooks
will (try to) do the right thing for you.
To get the name-based insertion/filtering logic working correctly
over rebases, we have to save the branch name in a pre-rebase hook,
use the saved name if it exists or dig it out if not in the
commit-msg hook, and remove the saved name in a post-rewrite hook.
Krisztian Litkey [Mon, 30 Sep 2013 15:53:43 +0000 (18:53 +0300)]
common: don't free a busy nl_pid_watch_t.
Mark an nl_pid_watch_t busy while it is being scanned. If a
client callback destroys the last watch, check if the pid
watch is busy. If it is, just unhash it and mark it dead,
otherwise unhash and destroy it right away. Each time a watch
scan finishes, check and destroy the watch if it has been
marked dead.
Krisztian Litkey [Mon, 30 Sep 2013 14:49:50 +0000 (17:49 +0300)]
resolver: filter out duplicate target dependencies.
Currently failing to do so could trigger dereferencing
fact_stamps beyond its end in older_than_facts (as
fact_stamps is allocated in the graph sorter and its
size reflects the number of unique dependencies).
Krisztian Litkey [Sat, 28 Sep 2013 19:34:33 +0000 (22:34 +0300)]
console: flush and proxy output after each command.
Also we have now an I/O watch in place for the console
output pipe. This enables us in the future to plug any output fd
to any console if we wish to do so.
Krisztian Litkey [Sat, 28 Sep 2013 19:25:03 +0000 (22:25 +0300)]
daemon: make sure stdout is line-buffered (and stderr non-buffered).
This should fix the annoying "no output from console commands" bug
experienced when running/logging via systemd. When running under
systemd fileno stdout is a socket. Hence, stdout is fully buffered
by default with a quite large buffer size. This effectively breaks
the interactive murphy console (unless we fflush both stdout and
stderr after running a command handler) as output resulting from
a console command gets buffered and is only written to the console
at random intervals when the buffer gets full.
Krisztian Litkey [Tue, 24 Sep 2013 19:13:55 +0000 (22:13 +0300)]
config: don't try to load D-Bus plugin.
Krisztian Litkey [Tue, 24 Sep 2013 18:51:57 +0000 (21:51 +0300)]
murphy-db: don't propagate uninitialized value to status.
Krisztian Litkey [Tue, 17 Sep 2013 22:39:10 +0000 (01:39 +0300)]
daemon: valgrind re-exec support, source tree detection
The daemon can now re-exec itself through valgrind, preserving its
command line and the environment if so requested.
Also the daemon tries to detect if it is run directly from the
source tree. If it is, the runtime defaults are modified to
load the configuration file and plugins from the same source
tree and to run with increased verbosity. If necessary these
can be overridden on the command line.
Krisztian Litkey [Tue, 17 Sep 2013 19:20:56 +0000 (22:20 +0300)]
lua-decision: removed now unused 'dependency' Lua object.
Krisztian Litkey [Tue, 17 Sep 2013 14:50:41 +0000 (17:50 +0300)]
lua-decision: use direct dependency on the table for select.
Instead of generating an intermediate target that depends
on the table and have the select rule depend on this one,
omit the intermediate target altogether and let the select
depend on the table itself.
Krisztian Litkey [Tue, 17 Sep 2013 14:28:14 +0000 (17:28 +0300)]
lua-decision: throw Lua exception for fatal ruleset errors.
Throw Lua exception to bail out for ruleset generation errors.
Also use mrp_log_error to log errors instead of printf.
Krisztian Litkey [Sat, 14 Sep 2013 06:25:36 +0000 (09:25 +0300)]
resolver: update targets based on direct dependencies.
Don't run unconditionally the actions of a target if any
of the facts in the transitive closure of the dependencies
have changed. Instead always check the immediate dependencies
and run the actions only if some of those have changed.
Krisztian Litkey [Mon, 16 Sep 2013 12:41:31 +0000 (15:41 +0300)]
resolver: added console dump command.
Krisztian Litkey [Fri, 13 Sep 2013 18:38:50 +0000 (21:38 +0300)]
murphy-db: maintain stamp across transactions without changes.
Transaction track the state of tables by storing as a fingerprint
the number of inserts, deletes and updates in a transaction start
log entry. If at the end of the transaction the fingerprint is
identical the table stamp is restored.
Additionally, row and column update has been modified to omit the
creation of log entries for updates that would produce an identical
row. Since the insert/delete/update fingerprint is updated when
a log entry is created (and replayed during a rollback), this will
keep the stamp intact if a transaction contains only identical
updates.
Krisztian Litkey [Thu, 29 Aug 2013 23:11:30 +0000 (02:11 +0300)]
Merge branch 'master' of github.com:otcshare/policy-internal
Krisztian Litkey [Tue, 27 Aug 2013 16:12:14 +0000 (19:12 +0300)]
common: make mrp_mm_realloc[z] more C++-kosher.
Krisztian Litkey [Wed, 21 Aug 2013 13:19:32 +0000 (16:19 +0300)]
common/glib-glue: include common/mainloop.h.
Ismo Puustinen [Tue, 20 Aug 2013 07:25:49 +0000 (10:25 +0300)]
resource-c: removed forgotten debug print.
Ismo Puustinen [Wed, 14 Aug 2013 06:15:39 +0000 (09:15 +0300)]
common: ecore-glue.h can now be called from C++.
Ismo Puustinen [Tue, 13 Aug 2013 13:18:23 +0000 (16:18 +0300)]
resource-c: can be called from C++ code.
Ismo Puustinen [Tue, 6 Aug 2013 07:22:42 +0000 (10:22 +0300)]
breedline: started working on backwards search.
Ismo Puustinen [Fri, 26 Jul 2013 12:05:33 +0000 (15:05 +0300)]
lua-decision: do not crash if no error message set.
Function bridge expects every caller object to set a string
error message if the call fails, even if the return type is
set to boolean. Still, there shouldn't be a crash if the error
message is not set.
Ismo Puustinen [Wed, 24 Jul 2013 07:25:39 +0000 (10:25 +0300)]
resource-client: fix possible NULL pointer bug.
Ismo Puustinen [Wed, 24 Jul 2013 07:22:02 +0000 (10:22 +0300)]
resource-dbus: do not use memory before testing for NULL.
Ismo Puustinen [Wed, 24 Jul 2013 07:20:37 +0000 (10:20 +0300)]
resource-native: do not use memory before assert.
Ismo Puustinen [Wed, 24 Jul 2013 07:19:10 +0000 (10:19 +0300)]
common: fix a possible NULL pointer error.
Ismo Puustinen [Mon, 22 Jul 2013 20:29:24 +0000 (23:29 +0300)]
murphy-db: sizeof(int*) -> sizeof(int) as reported by static analysis.
Ismo Puustinen [Mon, 22 Jul 2013 17:13:55 +0000 (20:13 +0300)]
resource-c: fixed a compiler warning.
Krisztian Litkey [Thu, 11 Jul 2013 08:09:31 +0000 (11:09 +0300)]
build-sys: fix systemd enabling configure option typo.
Krisztian Litkey [Tue, 9 Jul 2013 13:21:30 +0000 (16:21 +0300)]
resource-native: don't crash on 'premature' resource-set creation attempts.
Fail gracefully instead of crashing in the client library if a
client tries to create a resource set before it has received an
MRP_RES_CONNECTED event (ie. before the backend has been successfully
contacted and queried for resources).
Janos Kovacs [Tue, 25 Jun 2013 15:13:33 +0000 (18:13 +0300)]
resource: deterministic event order: revokes/denies first followed by grants
Janos Kovacs [Sun, 16 Jun 2013 11:14:13 +0000 (14:14 +0300)]
resource: add mrp_application_class_get_priority() to manager API
Janos Kovacs [Sat, 15 Jun 2013 20:17:15 +0000 (23:17 +0300)]
resource: add mrp_resource_owner_recalc(zone) to resource manager interface
Janos Kovacs [Sat, 15 Jun 2013 20:16:43 +0000 (23:16 +0300)]
resource: add mrp_zone_mask_t
Janos Kovacs [Thu, 13 Jun 2013 21:36:48 +0000 (00:36 +0300)]
resource: add resource.method.recalc(zone_name) function
Janos Kovacs [Thu, 13 Jun 2013 18:29:31 +0000 (21:29 +0300)]
resource: add 'dontwait' flag
Janos Kovacs [Thu, 13 Jun 2013 07:53:08 +0000 (10:53 +0300)]
resource: extend backend functionality for lua support and notification
Krisztian Litkey [Fri, 5 Jul 2013 18:56:00 +0000 (21:56 +0300)]
console: don't crash on unterminated quotes, reset errors between commands.
Krisztian Litkey [Fri, 5 Jul 2013 18:52:57 +0000 (21:52 +0300)]
core: fix log target failure message.
Krisztian Litkey [Fri, 5 Jul 2013 10:52:54 +0000 (13:52 +0300)]
daemon: sample-config try to load systemd plugin.
Krisztian Litkey [Fri, 5 Jul 2013 10:50:30 +0000 (13:50 +0300)]
common: fix some warnings.
Krisztian Litkey [Fri, 5 Jul 2013 10:49:43 +0000 (13:49 +0300)]
systemd: added systemd (logging) plugin.
Krisztian Litkey [Wed, 3 Jul 2013 18:32:12 +0000 (21:32 +0300)]
murphy-db: satisfy security-concious gcc (-Werror=format-security).
Krisztian Litkey [Wed, 26 Jun 2013 17:38:36 +0000 (20:38 +0300)]
build-sys: make sure LD_AS_NEEDED=1 does not break AC_LINK_IFELSE.
For some combinations of autoconf/gcc (e.g. 2.69/4.7.2) setting
LD_AS_NEEDED to 1 breaks AC_LINK_IFELSE. That macro generates
a compilation command line where the libraries precede the generated
C source code. With LD_AS_NEEDED=1 all referenced/tested symbols
from any of the libraries end up being undefined. This fools
AC_LINK_IFELSE to consider the test a failure and always choose the
else branch. rpmbuild always sets LD_AS_NEEDED to 1. To work around
this save, unset and restore LD_AS_NEEDED for the duration of the
AC_LINK_IFELSE tests.
Ismo Puustinen [Fri, 14 Jun 2013 08:34:20 +0000 (11:34 +0300)]
resource-c: fix a bug with the autorelease flag handling.
Ismo Puustinen [Thu, 13 Jun 2013 07:53:59 +0000 (10:53 +0300)]
resource-c: handle attribute values changed by the resource backend.
Ismo Puustinen [Tue, 11 Jun 2013 10:30:59 +0000 (13:30 +0300)]
resource-c: added support for automatical releasing of resource sets.
Krisztian Litkey [Thu, 6 Jun 2013 15:29:52 +0000 (18:29 +0300)]
Merge branch 'master' of github.com:otcshare/policy-internal
Krisztian Litkey [Thu, 6 Jun 2013 14:46:37 +0000 (17:46 +0300)]
build-sys: native resource library does/can not need murphy-core.
Krisztian Litkey [Fri, 12 Apr 2013 14:50:03 +0000 (17:50 +0300)]
resource-native: let clients override default logging.
Krisztian Litkey [Wed, 5 Jun 2013 15:21:26 +0000 (18:21 +0300)]
common: add missing json to pkg-config, removed incorrect dbus and glib.
Ismo Puustinen [Wed, 5 Jun 2013 11:15:12 +0000 (14:15 +0300)]
resource-c: don't link resource clients to murphy-core.
Ismo Puustinen [Wed, 5 Jun 2013 11:07:27 +0000 (14:07 +0300)]
build: install murphy-resource.pc file correctly.
Arun Raghavan [Wed, 5 Jun 2013 14:46:02 +0000 (17:46 +0300)]
build-sys: Build with json-c >= 0.11
The pkg-config file name changed with json-c 0.11, so configure checks
need to accordingly change. Also means we shouldn't try to use pkg-config
directly for the json_tokener_get_error() check.
As a result of this, it becomes apparent that murphy/common/json.h
implicitly depends on json.h (and thus so do all files that include it).
Fixing this would require moving out typedefs/macros linking mrp_json_*
to json_* from that header.
Krisztian Litkey [Tue, 4 Jun 2013 19:28:40 +0000 (22:28 +0300)]
core: make sure authenticator backend user_data defaults to NULL.
Krisztian Litkey [Tue, 4 Jun 2013 19:15:23 +0000 (22:15 +0300)]
daemon: only try-load WRT domain-control in sample config.
Krisztian Litkey [Fri, 31 May 2013 14:16:55 +0000 (17:16 +0300)]
core: fix embarrassing typo spotted by Ismo.
Krisztian Litkey [Fri, 31 May 2013 13:46:11 +0000 (16:46 +0300)]
Merge branch 'master' of github.com:otcshare/policy-internal
Krisztian Litkey [Fri, 31 May 2013 13:29:06 +0000 (16:29 +0300)]
plugin-test: added authentication test console command.
Krisztian Litkey [Thu, 30 May 2013 16:46:00 +0000 (19:46 +0300)]
core: first attempt at adding a common authentication infra, smack support.
Added a very simple authentication infra that lets you register
authentication backends and request authentication/access control
from a particular or any backend. The authentication API tries to
be a union of a SMACKish MAC (target / access-mode / id) and a
traditional authentication (target / id / authentication-token).
Hopefully it's enough to fill our needs without being too ugly or
unintuitive to use.
Currently there are two built-in authentication backends. One is
a straightforward SMACK backend, the other is an always-deny backend
which is installed to be the last backend in the chain.
Ismo Puustinen [Thu, 30 May 2013 10:58:59 +0000 (13:58 +0300)]
resource-wrt: do not use uninitialized variables.
Ismo Puustinen [Thu, 30 May 2013 10:32:56 +0000 (13:32 +0300)]
common: do not do arithmetic with void pointers (it's a gcc extension).
Ismo Puustinen [Thu, 30 May 2013 14:11:49 +0000 (17:11 +0300)]
mql: properly handle floating columns in table definitions.
Krisztian Litkey [Mon, 13 May 2013 13:07:52 +0000 (16:07 +0300)]
Merge branch 'master' of github.com:otcshare/policy-internal
Krisztian Litkey [Mon, 13 May 2013 11:32:03 +0000 (14:32 +0300)]
mainloop: wakeup limits based on the bounded wakeup patch from Ismo.
Ismo did all the heavy lifting for this feature and provided the initial
implementation. To avoid having two slightly different wakeup mechanisms
I ended up adding the necessary bits to the original mrp_wakeup_t code.
This patch adds support for setting a lower and an upper limit on how
often wakeup callbacks can be triggered. The lower limit acts as a low-
pass filter, guaranteeing that wakeup callbacks will not be invoked more
often than once per lower limit interval. The upper limit defines a
forced trigger interval, forcibly triggering the callback once per upper
interval in the lack of other events of interest.
Here's the commit message from the original patch:
Bounded wakeup triggers a callback whenever the process wakes up, but not
before a minimum amount of time has passed since the previous wakeup. Even
if no wakeups happen, the callback will get called when a maximum amount of
time has passed. This property makes bounded wakeups useful when doing
energy-aware polling or cleanups.
Ismo Puustinen [Wed, 8 May 2013 07:14:13 +0000 (10:14 +0300)]
resource-dbus: made snprintf handling more robust.
Ismo Puustinen [Tue, 7 May 2013 18:42:15 +0000 (21:42 +0300)]
resource-dbus: allow setting incomplete attribute configrations.
Krisztian Litkey [Tue, 7 May 2013 09:31:12 +0000 (12:31 +0300)]
build-sys: force git hooks on.
Krisztian Litkey [Tue, 7 May 2013 09:29:32 +0000 (12:29 +0300)]
pre-commit-hook: check for mixed autogenerated/ordinary changes
Check if a commit tries to mix changes to autogenerated and ordinary
files and ask the user to reconsider committing the changes as two
separate commits.
Krisztian Litkey [Tue, 7 May 2013 09:36:00 +0000 (12:36 +0300)]
Merge branch 'master' of github.com:otcshare/policy-internal
Ismo Puustinen [Fri, 3 May 2013 11:35:09 +0000 (14:35 +0300)]
build: fix linking D-Bus and Lua libraries.
Krisztian Litkey [Tue, 30 Apr 2013 12:49:38 +0000 (15:49 +0300)]
common: pick the correct mainloop timer to expire next.
In some circumstances our mainloop implementation failed to update
the next timer to expire (ml->next_timer). This commit changes
insert_timer to always update ml->next_timer to point to the non-
deleted timer with the lowest expire-stamp.
An alternative fix would have been to get rid of ml->next_timer
altogether and simply pick the next timer in mrp_mainloop_prepare
by calling find_next_timer.
Krisztian Litkey [Tue, 30 Apr 2013 08:08:50 +0000 (11:08 +0300)]
common: be more careful with allocation error checks in mainloop-test.
Krisztian Litkey [Sun, 28 Apr 2013 10:13:51 +0000 (13:13 +0300)]
license: updated LICENSE-BSD for 2013.
Krisztian Litkey [Sat, 27 Apr 2013 15:34:52 +0000 (18:34 +0300)]
common: updated dbus debug info.
Krisztian Litkey [Fri, 26 Apr 2013 12:58:20 +0000 (15:58 +0300)]
daemon: fix typo in help message.
Krisztian Litkey [Fri, 12 Apr 2013 14:48:45 +0000 (17:48 +0300)]
resource-native: let the client know when a connection is lost.
Krisztian Litkey [Tue, 9 Apr 2013 15:21:49 +0000 (18:21 +0300)]
common/dbus: added mrp_dbus_reply_error.
Krisztian Litkey [Mon, 8 Apr 2013 09:25:45 +0000 (12:25 +0300)]
common/dbus: added missing include.
Ismo Puustinen [Thu, 25 Apr 2013 12:26:37 +0000 (15:26 +0300)]
resource-c: add a print in test app to show the resource set state.
Ismo Puustinen [Thu, 25 Apr 2013 12:16:04 +0000 (15:16 +0300)]
resource-c: better errors, correct casting.
Ismo Puustinen [Thu, 25 Apr 2013 10:41:33 +0000 (13:41 +0300)]
resource-c: remove extra resource callback calls and shortcuts.
The Murphy resource backend should now control the flow with the event
notifications.
Ismo Puustinen [Thu, 18 Apr 2013 06:22:15 +0000 (09:22 +0300)]
tests: process-test updated to latest API.
Ismo Puustinen [Tue, 16 Apr 2013 11:25:50 +0000 (14:25 +0300)]
common: added support for external process watching.
Ismo Puustinen [Fri, 12 Apr 2013 14:30:58 +0000 (17:30 +0300)]
build: cleaned linking for resource-c library and the test programs.
Ismo Puustinen [Thu, 11 Apr 2013 10:28:12 +0000 (13:28 +0300)]
resource-c: fix a memory corruption.
Ismo Puustinen [Thu, 11 Apr 2013 10:27:38 +0000 (13:27 +0300)]
resource-c: fix resource fuzzer error handling.
Ismo Puustinen [Thu, 11 Apr 2013 10:27:00 +0000 (13:27 +0300)]
resource-c: fix a crash in API test app.
Ismo Puustinen [Wed, 10 Apr 2013 12:32:07 +0000 (15:32 +0300)]
resource-c: fix a race condition.
Ismo Puustinen [Tue, 9 Apr 2013 07:20:33 +0000 (10:20 +0300)]
resource-c: started writing api stress testing.
Ismo Puustinen [Tue, 9 Apr 2013 07:19:25 +0000 (10:19 +0300)]
resource-c: fixed a warning in api test.
Ismo Puustinen [Mon, 8 Apr 2013 12:27:23 +0000 (15:27 +0300)]
resource: don't access a freed rset from lua gc.
Ismo Puustinen [Mon, 8 Apr 2013 12:05:37 +0000 (15:05 +0300)]
murphy-db: fix a memory boundary issue.