Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
XDG config envs do not accept quoted paths #2062
Steps to Reproduce the Problem
The command /home/jenkins/workspace/libelektra_PR-2060-UC533EJXFEGIMCPXROAS5K3DQGSNDLWE3TI7WV4NENQDLGK2UB4A@3/build/bin/kdb get failed while accessing the key database with the info: Sorry, 8 warnings were issued ;( Warning (#100): Description: environment variable is not absolute and cannot be used Ingroup: plugin Module: resolver At: /home/jenkins/workspace/libelektra_PR-2060-UC533EJXFEGIMCPXROAS5K3DQGSNDLWE3TI7WV4NENQDLGK2UB4A@3/src/plugins/resolver/filename.c:194 Reason: XDG_CONFIG_HOME contains a path that is not absolute (violates XDG specification) and thus it was skipped: '/home/jenkins/workspace/libelektra_PR-2060-UC533EJXFEGIMCPXROAS5K3DQGSNDLWE3TI7WV4NENQDLGK2UB4A@3/xdg/user'
Modifying the path from
quotes should be stripped before testing for an absolute path
quotes are treated as part of the path and hence resolver.c treats it as relative path (which in turn violates XDG specs).
Further Log Files and Output
Thank you for reporting the problem! Could you please point me to the place where the quoting is explained? Is it in https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html?
Nowhere. But assume you want a path for xdg with spaces, then you would need quotes around it.
The current resolver.c implementation only checks the first char of the path to determine if it is an absolute path which might not be an
Personal experience suggests always quoting paths. Since that is obviously not enough I did a quick search and found https://stackoverflow.com/questions/33318499/should-i-use-quotes-in-environment-path-names.
Regardless of style guides and other opinions I would expect Elektra to work when i give it a valid path. even when it is quoted.
Of course you always need to quote paths to make the shell happy (to allow newlines and avoid the problems mentioned in the link). But the shell removes these quotes, so they never end up in the environment and are never seen by Elektra.
If you put quotes literally in the string, they are interpreted as file path. The only non-file path character in the *PATH variables is colon (