mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-16 14:16:16 -06:00
firecfg: use ignorelist also for .desktop files
Closes #5245. Relates to #5876.
This commit is contained in:
parent
358af63a1a
commit
a9c851ee48
2 changed files with 23 additions and 3 deletions
|
|
@ -118,6 +118,9 @@ void fix_desktop_files(const char *homedir) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
// build ignorelist
|
||||
parse_config_all(0);
|
||||
|
||||
// destination
|
||||
// create ~/.local/share/applications directory if necessary
|
||||
char *user_apps_dir;
|
||||
|
|
@ -173,8 +176,25 @@ void fix_desktop_files(const char *homedir) {
|
|||
continue;
|
||||
|
||||
// skip if not .desktop file
|
||||
if (strstr(filename, ".desktop") != (filename + strlen(filename) - 8))
|
||||
char *exec = strdup(filename);
|
||||
if (!exec)
|
||||
errExit("strdup");
|
||||
char *ptr = strstr(exec, ".desktop");
|
||||
if (ptr == NULL || *(ptr + 8) != '\0') {
|
||||
printf(" %s skipped (not a .desktop file)\n", exec);
|
||||
free(exec);
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip if program is in ignorelist
|
||||
*ptr = '\0';
|
||||
if (in_ignorelist(exec)) {
|
||||
printf(" %s ignored\n", exec);
|
||||
free(exec);
|
||||
continue;
|
||||
}
|
||||
|
||||
free(exec);
|
||||
|
||||
// skip links - Discord on Arch #4235 seems to be a symlink to /opt directory
|
||||
// if (is_link(filename))
|
||||
|
|
@ -220,7 +240,7 @@ void fix_desktop_files(const char *homedir) {
|
|||
}
|
||||
|
||||
// get executable name
|
||||
char *ptr = strstr(buf,"\nExec=");
|
||||
ptr = strstr(buf,"\nExec=");
|
||||
if (!ptr || strlen(ptr) < 7) {
|
||||
if (arg_debug)
|
||||
printf(" %s - skipped: wrong format?\n", filename);
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ Configuration file syntax:
|
|||
A line that starts with \fB#\fR is considered a comment.
|
||||
.br
|
||||
A line that starts with \fB!PROGRAM\fR means to ignore "PROGRAM" when creating
|
||||
symlinks.
|
||||
symlinks and fixing .desktop files.
|
||||
.br
|
||||
A line that starts with anything else is considered to be the name of an
|
||||
executable and firecfg will attempt to create a symlink for it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue