libelektra: xfconf-binding: cannot read from KDB

During the development of the xfconf binding, I encountered a problem where I receive a different key store state. While the kdb tool can read all keys set by the user, the glib binding is only able to read all the default keys in my case.

Steps to Reproduce the Problem

While

kdb set user:/tests/hello world
#> Create a new key user:/tests/hello with string "world"

kdb get user:/tests/hello
#> world

works as expected,

GElektraKeySet * key_set = gelektra_keyset_new (0, GELEKTRA_KEYSET_END);
GElektraKey * parent_key = gelektra_key_new ("/", GELEKTRA_KEY_END);
gelektra_kdb_get (gElektraKdb, key_set, parent_key);

only reads all the default keys and stores them into key_set. This is also the case with system:/ keys.

Expected Result

key_set contains user:/tests/hello.

Actual Result

key_set does not contain user:/tests/hello.

System Information

  • Elektra: master
  • Operating System: Arch Linux

Infos about xfconf binding

As of now I am developing this binding. My strategy is to implement the c headers of xfconf and use the binding as drop-in replacement for xfconf. Then I start an application which uses xfconf (e.g. thunar) which then calls the functions of the xfconf binding instead of the real xfconf library:

ldd $(which thunar) | grep -E "(xfconf|elektra)"
	libxfconf-0.so.3 => /usr/lib/libxfconf-0.so.3 (0x00007f97ec8ca000)
	libgelektra-5.0.so => /home/richi/Dokumente/tu/2022-ss/cm/libelektra/cmake-build-debug/lib/libgelektra-5.0.so (0x00007f97eb868000)
	libelektra-kdb.so.5 => /home/richi/Dokumente/tu/2022-ss/cm/libelektra/cmake-build-debug/lib/libelektra-kdb.so.5 (0x00007f97eb84c000)
	libelektra-core.so.5 => /home/richi/Dokumente/tu/2022-ss/cm/libelektra/cmake-build-debug/lib/libelektra-core.so.5 (0x00007f97eb830000)

My Cmake flags are:

-DKDB_DB_HOME="~/.config/kdb/cm/home"
-DKDB_DB_SYSTEM="~/.config/kdb/cm/system"
-DKDB_DB_SPEC="~/.config/kdb/cm/spec"
-DKDB_DB_USER=".config/kdb/cm/user"
-DCMAKE_INSTALL_PREFIX="install"
-DENABLE_DEBUG="ON"
-DENABLE_LOGGER="ON"
-DPLUGINS="ALL"
-DTOOLS="ALL"
-DBINDINGS="ALL"
-DTOOLS="ALL"

Further Log Files and Output

Using inotifywait I found out that both kdb and thunar accessed my ~/.config/kdb/cm/user/default.ecf which tells me that this is not a problem which consists of reading wrong files from the file system.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (18 by maintainers)

Most upvoted comments

I found out what the issue was. I already silently called kdbGet somewhere else in the code before xfconf_channel_get_property.