summaryrefslogtreecommitdiff
path: root/engine
Commit message (Collapse)AuthorAgeFilesLines
* Replace all hard-coded /etc path with sysconfdirwip/lantw/dont-hard-code-etcTing-Wei Lan2018-08-162-3/+3
| | | | | | | This is useful for JHBuild environments and systems that don't want to use /etc/dconf. https://bugzilla.gnome.org/show_bug.cgi?id=739299
* Engine: Change overflow thresholds in subscription counts from GMAXUINT32 to ↵Daniel Playfair Cal2018-08-151-2/+2
| | | | GMAXUINT
* Engine: Add locks around access to subscription counts to ensure that each ↵Daniel Playfair Cal2018-08-141-3/+44
| | | | | | | | state transition is atomic Update comment about threading, documenting the new lock Add documentation comments for new utility functions
* Engine: add g_debug statements in state changing interface functionsDaniel Playfair Cal2018-08-141-1/+9
|
* Engine: extend subscriptions state to account for multiple client ↵Daniel Playfair Cal2018-08-142-73/+129
| | | | | | | | | | | | | | subscriptions to the same path Remove accidental whitespace change Simplify branching in watch_fast and unwatch_fast Indentation fixes Store the subscription counts directly in the hash table pointer instead of mallocing ints Add documentation comments for new utility functions
* Engine: add some missing objects to dconf_engine_unrefDaniel Playfair Cal2018-08-141-0/+9
|
* Namespace the dependencies variablesEmmanuele Bassi2018-08-111-3/+3
| | | | | | | | | | | | | The build currently, unintentionally, depends on side effects, namely: that a variable defined in a meson.build file will be valid for any other included meson.build file, until it gets re-defined. We use the same `deps` variable in many places, and we end up depending on the inclusion order when we get to the client library, which depends on the gsettings backend defining the `deps` variable. Reviewed-by: nobody Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
* build: Add trailing commas where necessaryIñigo Martínez2018-08-111-4/+4
| | | | | | Having trailing commas in place means that if another source file or parameter is added to the end of the list or function, there won't be noise when adding the comma to the line above.
* build: Do not make heavy use of project_nameIñigo Martínez2018-08-111-4/+2
| | | | | | | | | The current meson build files make heavy use of meson's `project_name` function. However this makes difficult for any developer to find for given program/library/file names. The project name is also never going to change. Due to this reason these calls have been changed for `dconf` itself.
* build: Fix internal dependenciesIñigo Martínez2018-08-111-1/+11
| | | | | | | | | meson is able to generate internal dependencies for handling built libraries. These internal dependencies depend on other dependencies as well, based on the includes exposed by their headers. This have been fixed by using proper internal dependencies for these libraries.
* build: Avoid building libraries twiceIñigo Martínez2018-08-111-11/+1
| | | | | | | | | | | dconf builts a number of internal static libraries which in some cases are duplicated. This duplication comes from autotools that used to built two libraries for each library, one with PIC enabled and the other one without it. This has been changed to build only one library for each library to be built, except `libdconf-common-hidden` which hides some symbols for the GIO module to be built.
* Engine: track in progress watch handles to avoid spurious changed signals ↵Daniel Playfair Cal2018-07-132-12/+87
| | | | for the root path
* Remove .gitignore filesIñigo Martínez2017-10-221-2/+0
| | | | | | | | | | meson does not allow to build source code inside the source code tree, for this reason there is no need for .gitignore files to ignore built files. This patch removes .gitignore files which are no longer needed. https://bugzilla.gnome.org/show_bug.cgi?id=784910
* build: Remove autotoolsIñigo Martínez2017-10-171-22/+0
| | | | | | | To avoid the burden of maintaining multiple build systems, this patch removes autotools support. https://bugzilla.gnome.org/show_bug.cgi?id=784910
* build: Port to meson build systemIñigo Martínez2017-10-172-0/+32
| | | | | | | | meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools. https://bugzilla.gnome.org/show_bug.cgi?id=784910
* engine: some internal const-correctness changesAllison Ryan Lortie2015-12-162-6/+6
| | | | | | | There is no reason that the read_through queue should not be 'const', so expose it as such. https://bugzilla.gnome.org/show_bug.cgi?id=759128
* engine: add DCONF_READ_DEFAULT_VALUE flagAllison Ryan Lortie2015-12-161-1/+15
| | | | | | | | Add a flag that allows checking the default value without constructing a read_through queue. Make use of this new flag to simplify code in a couple of places. https://bugzilla.gnome.org/show_bug.cgi?id=759128
* engine: merge _read and _read_user_value()Allison Ryan Lortie2015-12-162-68/+28
| | | | | | | Delete the separate dconf_engine_read_user_value() and merge its functionality into dconf_engine_read() by adding a flags field. https://bugzilla.gnome.org/show_bug.cgi?id=759128
* common: rename dconf-error.h to dconf-enums.hAllison Ryan Lortie2015-12-161-1/+1
| | | | | | This will soon contain an extra enum. https://bugzilla.gnome.org/show_bug.cgi?id=759128
* engine, client: add list_locks() operationAllison Ryan Lortie2015-11-302-0/+70
| | | | | | | Add an API to dconf-engine (and exposed via DConfClient) for getting a list of locks that are present in a given dconf profile. https://bugzilla.gnome.org/show_bug.cgi?id=758864
* engine: add support for runtime profile selectionAllison Ryan Lortie2015-11-111-12/+77
| | | | | | | | | | | | | | | | | | | | | | | | Add support to dconf-engine for opening "runtime" profiles. These profiles are intended to be symbolic links or plain files that will live either in XDG_RUNTIME_DIR/dconf/profile or /run/dconf/user/$(uid). This is intended to allow for a PAM module that makes complex decisions about application of a specific policy to a user and sets up the profile at login time, thus preventing the need for this complex decision to be a part of every program that uses dconf. This PAM module would not be part of dconf, but would rather be a part of a dconf-aware system administrator framework. In the case that the profile file is found in /run/dconf, then it will not be possible for the user to override the profile selection, including via the DCONF_PROFILE environment variable. This provides a mechanism for lockdown that is slightly more difficult for a user to circumvent. In theory, this is pointless since it can still be defeated with LD_PRELOAD, but in practice this raises the bar quite a bit. https://bugzilla.gnome.org/show_bug.cgi?id=751417
* engine: fix race in match rule addingRyan Lortie2014-02-211-7/+11
| | | | | | | | | | | | | 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: don't install match rules on no busRyan Lortie2014-02-111-8/+15
| | | | | | | 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
* Updated FSF's addressDaniel Mustieles2014-01-3111-33/+11
|
* engine: add support for 'file-db'Ryan Lortie2014-01-135-7/+92
| | | | | | | | 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.
* profiles: allow profiles in XDG_DATA_DIRSRyan Lortie2014-01-131-11/+55
| | | | | If we can't find a given profile in /etc then look for it in the XDG_DATA_DIRS.
* engine: reject junk signalsRyan Lortie2013-11-271-0/+36
| | | | | | | 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.
* engine: fix a case of variable shadowingRyan Lortie2013-11-271-3/+3
| | | | | | | | | 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.
* engine: filter change signals properlyRyan Lortie2013-11-271-2/+23
| | | | | | | | | | | 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.
* engine: add support for WritabilityNotifyRyan Lortie2013-11-262-4/+24
| | | | | Wire through WritabilityNotify signals from the engine. This has been unimplemented for a very long time...
* engine: add 'profile' argument to constructorRyan Lortie2013-11-262-4/+6
| | | | | | | 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.
* engine: allow NULL handleRyan Lortie2013-11-251-1/+4
| | | | | | 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.
* engine: issue warnings once per sourceRyan Lortie2013-11-253-6/+5
| | | | | | | | | | | | | | | | | 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().
* engine: fix locking bugRyan Lortie2013-11-251-0/+2
| | | | | | | Make sure we actually acquire the sources lock on entry to dconf_engine_read_user_value(). Uncovered during testing.
* Add DCONF_ERROR error domainRyan Lortie2013-11-252-8/+1
| | | | | | | | | 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
* engine: restructure a bit to improve testabilityRyan Lortie2013-11-252-12/+17
| | | | | | | | | 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.
* Add missing "config.h" include everywhereRyan Lortie2013-11-246-0/+12
| | | | We ought to be including this from each .c file.
* GSettings: implement _read_user_value()Ryan Lortie2013-10-282-0/+50
| | | | | | | | | | | | 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
* engine: seal changesets on changesRyan Lortie2013-06-251-0/+4
| | | | | | | | | | | 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
* Use G_LOG_DOMAIN in all library componentsRyan Lortie2013-02-211-1/+1
|
* engine, gsettings: prevent empty changesetsRyan Lortie2013-02-111-0/+11
| | | | | | | | 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).
* docs/comments: make some corrections/updatesRyan Lortie2013-02-111-3/+3
| | | | | Many fixes for typos but also some adjustments for the recent refactoring (particularly updating HACKING).
* engine: accept out-of-order error reply messagesRyan Lortie2013-01-241-3/+20
| | | | | | | | | | | | | | | 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
* engine: only Init the service when neededRyan Lortie2013-01-111-3/+7
| | | | | 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.
* engine: add a new database type: "service-db"Ryan Lortie2013-01-094-1/+94
| | | | | | | | | | | | | | 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).
* adjust to new gvdb APIsRyan Lortie2012-11-091-4/+4
|
* engine/: drop DConfChangesetListRyan Lortie2012-10-024-45/+6
| | | | | | It's really just a GQueue... https://bugzilla.gnome.org/show_bug.cgi?id=685316
* engine: improve robustness of profile parsingRyan Lortie2012-07-192-20/+43
| | | | | | | | | 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.
* engine: fix dconf_engine_list() with empty dbRyan Lortie2012-07-151-0/+3
| | | | | | | | 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.
* engine: bring back origin_tag logicRyan Lortie2012-07-152-6/+10
| | | | | | | | | 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...