| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to the usual way async in dconf works, we can start getting replies
immediately (without returning to the mainloop). For this reason, we
must be sure that we do not modify the OutstandingWatch structure at any
point after we've issued even one call because the results may already
be coming in.
For this reason, we must add up the 'pending' count in a separate loop
run before we start making the calls.
https://bugzilla.gnome.org/show_bug.cgi?id=724929
|
|
|
|
|
|
|
| |
file-db databases don't have an associated D-Bus bus type, so don't try
to install match rules for them.
https://bugzilla.gnome.org/show_bug.cgi?id=723553
|
| |
|
|
|
|
|
|
|
|
| |
This is a new database type that is simply an absolute path to a gvdb
anywhere on the filesystem. Change notification is not supported.
This is intended to be used by things like gdm that wish to install
databases (somewhere in /usr) as part of the software.
|
|
|
|
|
| |
If we can't find a given profile in /etc then look for it in the
XDG_DATA_DIRS.
|
|
|
|
|
|
|
| |
Check incoming signals for non-sense before bubbling them up to higher
layers. This will avoid dconf APIs feeding invalid key names to
applications during change notifications in the case that we're fed
invalid data over D-Bus.
|
|
|
|
|
|
|
|
|
| |
Testing uncovered a case of a shadowed variable in the signal handling
code of the engine: the object path on which a signal arrived was being
shadowed by the 'path' variable used when deserialising the content of
the signal, causing the signal to fail to be delivered.
Rename the D-Bus path variable to 'object_path' to avoid the issue.
|
|
|
|
|
|
|
|
|
|
|
| |
Testing revealed that we were transmitting any change signal that came
in from the bus up to user code, even if the engine in question was not
interested in receiving the signal.
This is a problem in the case that two DConfClient objects exist for
different profiles. In that case, we'd get crosstalk between the
subscriptions that each client had made and change notifications would
appear in both clients even if the change only affected one.
|
|
|
|
|
| |
Wire through WritabilityNotify signals from the engine. This has been
unimplemented for a very long time...
|
|
|
|
|
|
|
| |
Allow specifying a profile when calling dconf_engine_new(). This will
allow us to avoid setting/unsetting the DCONF_PROFILE environment in
testcases from contexts where other threads may be reading from the
environment.
|
|
|
|
|
|
| |
We use a NULL handle in case we don't care about the return value. In that
case, we certainly don't care about the return type either, so use NULL for
expected_type in this case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On failure to open a gvdb file in /etc/dconf/db we would issue a warning
once per process -- even if multiple files were missing.
This was enforced using a static variable.
An unfortunate side effect of this global state is that the testcases
couldn't reliably know if to expect the error or not. This issue was
side-stepped by running any cases that may emit the warning under a
fork, but that made it difficult to debug some of the cases.
Rework the backends not to use global state for the flag and instead
store it per-source.
Remove a use of g_test_trap_fork().
|
|
|
|
|
|
|
| |
Make sure we actually acquire the sources lock on entry to
dconf_engine_read_user_value().
Uncovered during testing.
|
|
|
|
|
|
|
|
|
| |
Add a DCONF_ERROR error domain with associated DConfError enum type.
Use this instead of the adhoc approach that we've been taking up to this
point.
https://bugzilla.gnome.org/show_bug.cgi?id=704638
|
|
|
|
|
|
|
|
|
| |
Don't use the access() system call from the service source because this
bypasses the mocking layer in the testsuite. Use gvdb_table_new()
instead. This also avoids an extra syscall.
Also: change a couple of criticals to warnings because they are not
programmer errors.
|
|
|
|
| |
We ought to be including this from each .c file.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement g_settings_backend_read_user_value() in DConfSettingsBackend.
This will help us support g_settings_get_user_value() properly.
We add a new engine API to support this as well. It takes a
read_through queue, even though we don't bother using that from
DConfSettingsBackend.
https://bugzilla.gnome.org/show_bug.cgi?id=668233
|
|
|
|
|
|
|
|
|
|
|
| |
When we do change operations, make sure we seal our DConfChangeset
before sharing it between threads.
This will ensure it gets sealed in only one thread instead of being
implicitly sealed in two different threads at the same time when each of
them calls dconf_changeset_describe().
https://bugzilla.gnome.org/show_bug.cgi?id=703073
|
| |
|
|
|
|
|
|
|
|
| |
We should not send empty changesets to the service so just ignore them
when we get them.
This now means that an empty 'dconf load' will not send any D-Bus
messages (and will not cause D-Bus activation).
|
|
|
|
|
| |
Many fixes for typos but also some adjustments for the recent
refactoring (particularly updating HACKING).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to a quirk of the implementation of the D-Bus daemon (see upstream
bug https://bugs.freedesktop.org/show_bug.cgi?id=59780 for details)
error messages can arrive out of sequence with repsect to the order of
the method calls that they are in reply to.
This may or may not be a violation of the strict-ordering principle of
D-Bus (which does not actually appear to be written into the spec) but
either way, we should dial down our assumptions about ordering since the
D-Bus implementation that everyone is using does not currently work this
way.
https://bugzilla.gnome.org/show_bug.cgi?id=687120
|
|
|
|
|
| |
Instead of calling Init() blindly on startup for any service-db, only do
it if the file is missing when we go to open it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
service-db databases are based on a gvdb in the user runtime dir
maintained by the dconf-service.
On startup, the client will send an Init message to the service to
ensure that the database is properly initialised. After that, things
are pretty much the same except that the values are read from the file
in the runtime dir instead of from the home directory.
We also drop the "shm" signalling mechanism for this case and instead
use the same invalidation trick that system databases use (ie:
overwriting the old gvdb header after writing the new file).
|
| |
|
|
|
|
|
|
| |
It's really just a GQueue...
https://bugzilla.gnome.org/show_bug.cgi?id=685316
|
|
|
|
|
|
|
|
|
| |
Checking for 'u' or 's' is really insanely silly from a robustness
standpoint. Ensure that we properly have "user-db:" or "system-db:" and
that a non-empty database name is given, warning if not.
This was specifically causing annoying problems with the profile file
that gdm was installing, so add a copy of that file to our testcases.
|
|
|
|
|
|
|
|
| |
If we opened an empty database file (like on first login) and did a
'dconf list' on it then we would crash (due to accessing the GVDB
without checking for NULL).
Add a check.
|
|
|
|
|
|
|
|
|
| |
The GSettings backend still wants to use this and it does us no harm to
have it on the engine API (which is only visible internally).
Adjust the various consumers of the engine to the new API.
Thanks to Rui Matos for reminding me about this...
|
|
|
|
|
|
| |
In the case we do a fast watch and hit the race condition of a change
occuring before our watch is established we need to emit a change signal
on "/". The arguments for that were incorrect, so fix them.
|
|
|
|
|
| |
Resetting keys should absolutely always succeed, so don't check for key
writability in that case.
|
|
|
|
|
|
|
|
|
|
| |
In the case that we call dconf_engine_source_refresh() on a source that
had a NULL database and the result is that we still have a NULL
database, return FALSE.
This will prevent the unnecessary bumping of the state counter when
there was really no change. This happens in the case of a missing
system database file.
|
|
|
|
|
| |
Always do init as part of the process of dconf_engine_source_new() to
avoid the consumer from having to call it for themselves.
|
|
|
|
|
| |
Don't open the database file on _init(). This makes us match the system
source better.
|
|
|
|
|
| |
Stop returning a boolean here (since all of the sources always returned
TRUE all the time anyway).
|
|
|
|
|
|
|
|
|
|
|
| |
The new supposedly-threadsafe implementation of refcounting in the
engine still had a bug in it: in the event that we were going to remove
the last reference and we discovered that the refcount was not 1 after
taking the lock, we would return (under the assumption that someone else
had increased the count).
This is the wrong thing to do. No matter what, we need to drop our
reference -- instead of return, we should goto again.
|
|
|
|
| |
The workaround is in GLib now, so we don't have to do it.
|
|
|
|
|
|
|
| |
We were hardcoding g_type_init() in the D-Bus testcase because the GDBus
backend depended on that happening. That is not true for the libdbus-1
backend, so split it out into a separate function implemeneted by the
backend.
|
|
|
|
|
|
| |
We were storing the expected type of the reply in the call handle
already but not really doing anything with it. Provide an API to access
it.
|
|
|
|
|
|
|
|
|
| |
Add dconf_engine_sync() that does the same thing as the code in the
GSettings backend used to do, in a cleaner way.
Update the GSettings backend to use the new call.
Add a new call to DConfClient wrapping the engine call as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was a very slim race condition in the implementation of
dconf_engine_unref().
In order to check if the engine should be freed (to avoid double-freeing
in two separate threads) the code was checking if the engine was still
in the global list of engines.
It is possible, however, that this thread could have unrefed the engine
at exactly the same time as another thread, that thread won the race and
freed the engine (removing it from the list) and then a third thread
created another engine at the same time and it happened to have the same
pointer address as the engine that was just freed. In this case, the
first engine would still see "itself" in the global list and free again.
It's unlikely that this would ever happen in the real world but the
regression tests picked it up.
The new implementation should avoid that issue by not depending on the
engine finding itself in the list as part of the decision about if it
should be freed or not.
|
|
|
|
|
|
|
| |
Disable C compiler warnings entirely while building Vala code.
Fix-up a couple of legitimate issues plus one false-positive
(in service.c).
|
|
|
|
|
|
|
|
|
|
| |
Clean up the Makefiles and make them as similar as possible.
Move CFLAGS to a common point of definition and stop using -I so much.
Replace the 'dbus stub' with libdconf-mock.a in tests/. Fill in some
stubs for future mock code for shm and gvdb (just to get things
compiling for now).
|
|
|
|
|
|
|
|
|
|
| |
Use dconf_shm_is_flagged() instead of direct access.
Change the semantics of what happens when we fail to open the shm file.
We used to refuse to initialise at all in that case -- now we initialise
but will try again every time to reopen ourselves.
The error case will now be slower but closer to the correct behaviour.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the shm code from the engine and the service and put it in a
separate convenience library in shm/.
Remove the vestigial shmdir weirdness from the service (since shmdir is
now always relative to XDG_RUNTIME_DIR and has been for some time).
The purpose of this is so that dconf-engine can be properly unit-tested.
dconf-engine now has five points of contact with the world (excluding
the users of the engine themselves):
- the DCONF_PROFILE environment variable
- fopen() of profile files
- shm
- gvdb
- dbus
The environment variable is quite easily controlled. fopen() is
intercepted in the engine testcase with a interpose of the libc symbol.
With this commit now each of dbus, gvdb and shm are implemented in
separate utility modules that can be mocked from the testcases.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This should have been done in the first place but it went unnoticed
because the linker has an odd habit of permitting two structs with the
same name to be defined.
It only became a problem when optimisation was turned on and GCC noticed
that nobody was writing to one particular copy of that struct and
assumed that its contents would always be all-zeros (which is an
assumption that later became untrue once the linker had done its strange
magic).
|
|
|
|
|
|
|
|
|
| |
Clean up the profile parser, firming up the semantics of exactly what
happens in all cases. Document it.
There are now no more cases of aborting due to failures caused while
opening, parsing or initialising the profile. Lines of arbitrary length
are also supported.
|
|
|
|
| |
On finalize, we weren't freeing these properly.
|
|
|
|
|
|
|
|
| |
Otherwise it's possible for multiple threads to initialise it at the
same time.
Each thread will come up with the same value anyway, but it's a string,
so we will leak all but one of them.
|
| |
|