diff options
author | 2017-12-09 10:01:57 -0500 | |
---|---|---|
committer | 2017-12-09 10:01:57 -0500 | |
commit | 41e2c50dd50f241ef07597a888b249c836fe4de4 (patch) | |
tree | 90362d319c3fb18469803a0f60f8f704aa04d9dd /src | |
parent | fix typo (diff) | |
download | firejail-41e2c50dd50f241ef07597a888b249c836fe4de4.tar.gz firejail-41e2c50dd50f241ef07597a888b249c836fe4de4.tar.zst firejail-41e2c50dd50f241ef07597a888b249c836fe4de4.zip |
firecfg fix (#1670)
Diffstat (limited to 'src')
-rw-r--r-- | src/firecfg/desktop_files.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/firecfg/desktop_files.c b/src/firecfg/desktop_files.c index 2edc4c83b..7e30857c5 100644 --- a/src/firecfg/desktop_files.c +++ b/src/firecfg/desktop_files.c | |||
@@ -109,7 +109,20 @@ void fix_desktop_files(char *homedir) { | |||
109 | if (asprintf(&user_apps_dir, "%s/.local/share/applications", homedir) == -1) | 109 | if (asprintf(&user_apps_dir, "%s/.local/share/applications", homedir) == -1) |
110 | errExit("asprintf"); | 110 | errExit("asprintf"); |
111 | if (stat(user_apps_dir, &sb) == -1) { | 111 | if (stat(user_apps_dir, &sb) == -1) { |
112 | int rv = mkdir(user_apps_dir, 0700); | 112 | char *tmp; |
113 | if (asprintf(&tmp, "%s/.local", homedir) == -1) | ||
114 | errExit("asprintf"); | ||
115 | int rv = mkdir(tmp, 0755); | ||
116 | (void) rv; | ||
117 | free(tmp); | ||
118 | |||
119 | if (asprintf(&tmp, "%s/.local/share", homedir) == -1) | ||
120 | errExit("asprintf"); | ||
121 | rv = mkdir(tmp, 0755); | ||
122 | (void) rv; | ||
123 | free(tmp); | ||
124 | |||
125 | rv = mkdir(user_apps_dir, 0700); | ||
113 | if (rv) { | 126 | if (rv) { |
114 | fprintf(stderr, "Error: cannot create ~/.local/application directory\n"); | 127 | fprintf(stderr, "Error: cannot create ~/.local/application directory\n"); |
115 | perror("mkdir"); | 128 | perror("mkdir"); |