The code here:
|
// create firetools directory if it doesn't exist |
|
void create_config_directory() { |
|
struct stat s; |
|
char *path; |
|
char *homedir = get_home_directory(); |
|
if (asprintf(&path, "%s/.config/firetools", homedir) == -1) |
|
errExit("asprintf"); |
|
free(homedir); |
|
if (stat(path, &s) == -1) { |
|
/* coverity[toctou] */ |
|
int rv = mkdir(path, 0755); |
|
if (rv == -1) { |
|
fprintf(stderr, "Error: cannot create %s directory\n", path); |
|
exit(1); |
|
} |
|
} |
|
free(path); |
|
} |
can't create the ~/.config/firetools directory if ~/.configdoesn't exist. Apparently mkdir(...) doesn't directly support creating all the directories along the path (the way mkdir -p does).
This makes firetools fail to launch if ~/.configdoesn't exist.
Specifically, while this may be a rare occurrence in regular users' home directories, it can happen when launching firetools as root (having the home directory /root) where the home directory may not contain a .config subdirectory by default in some distributions.
The code here:
firetools/src/common/utils.cpp
Lines 139 to 156 in 81ca775
can't create the
~/.config/firetoolsdirectory if~/.configdoesn't exist. Apparentlymkdir(...)doesn't directly support creating all the directories along the path (the waymkdir -pdoes).This makes firetools fail to launch if
~/.configdoesn't exist.Specifically, while this may be a rare occurrence in regular users' home directories, it can happen when launching firetools as root (having the home directory
/root) where the home directory may not contain a.configsubdirectory by default in some distributions.