Created attachment 1550551 [details] Handle when $HOME is undefined Description of problem: Programs based on libxdg-basedir don't find system-wide configurations when running from init/systemd context, since it does not handle the case when $HOME is unset. Version-Release number of selected component (if applicable): libxdg-basedir-1.2.0-17.fc2 How reproducible: always Steps to Reproduce: 1. Compile the program in 'Additional info' 2. Run it with 'env -i foo' Actual results: Segmentation fault (core dumped) Expected results: /etc/xdg Additional info: /* compile with 'gcc -g -o foo foo.c -lxdg-basedir' */ #include <basedir.h> #include <stdlib.h> #include <stdio.h> int main() { const char * const *config_paths = xdgSearchableConfigDirectories(NULL); const char * const *path; for (path = config_paths ; *path ; path++) { printf("%s\n", *path); } free((const char **)config_paths); return 0; }
libxdg-basedir-1.2.0-18.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-65c9852d51
libxdg-basedir-1.2.0-18.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-30c590c4a0
Created attachment 1550635 [details] Handle when $HOME is undefined Somehow managed to destroy first chunk in diff...
libxdg-basedir-1.2.0-19.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-cee683419f
libxdg-basedir-1.2.0-19.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-55a2c60e71
Perhaps a more aggressive check strategy should be used? %check make check USE_VALGRIND=1 env -i make check USE_VALGRIND=1 # Check that we get NULL for all things rooted in ENV{HOME} when running # with HOME unset env -i ./tests/testdump | grep null > grep.NULL env -i ./tests/testdump | grep HOME | grep -v DIRS > grep.HOME diff -u grep.NULL grep.HOME
I'll add that to rawhide.
libxdg-basedir-1.2.0-19.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-55a2c60e71
libxdg-basedir-1.2.0-19.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-cee683419f
libxdg-basedir-1.2.0-19.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.
libxdg-basedir-1.2.0-19.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.