diff options
author | netblue30 <netblue30@protonmail.com> | 2023-08-22 18:22:44 -0400 |
---|---|---|
committer | netblue30 <netblue30@protonmail.com> | 2023-08-22 18:22:44 -0400 |
commit | 7fd98fdeb2120fa19149c407ea5c4818590b7030 (patch) | |
tree | a38a018b9ec2dd956ae327d5424851680227afda | |
parent | disable all /bin/dpkg* programs in disable-common.inc (diff) | |
download | firejail-7fd98fdeb2120fa19149c407ea5c4818590b7030.tar.gz firejail-7fd98fdeb2120fa19149c407ea5c4818590b7030.tar.zst firejail-7fd98fdeb2120fa19149c407ea5c4818590b7030.zip |
more appimage fixes
-rw-r--r-- | src/firejail/appimage.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/firejail/appimage.c b/src/firejail/appimage.c index b2bccf225..bb20a0da6 100644 --- a/src/firejail/appimage.c +++ b/src/firejail/appimage.c | |||
@@ -43,6 +43,16 @@ int appimage_find_profile(const char *archive) { | |||
43 | assert(archive); | 43 | assert(archive); |
44 | assert(strlen(archive)); | 44 | assert(strlen(archive)); |
45 | 45 | ||
46 | // extract the name of the appimage from a full path | ||
47 | // example: archive = /opt/kdenlive-20.12.2-x86_64.appimage | ||
48 | const char *arc = strrchr(archive, '/'); | ||
49 | if (arc) | ||
50 | arc++; | ||
51 | else | ||
52 | arc = archive; | ||
53 | if (arg_debug) | ||
54 | printf("Looking for a %s profile\n", arc); | ||
55 | |||
46 | // try to match the name of the archive with the list of programs in /etc/firejail/firecfg.config | 56 | // try to match the name of the archive with the list of programs in /etc/firejail/firecfg.config |
47 | FILE *fp = fopen(SYSCONFDIR "/firecfg.config", "r"); | 57 | FILE *fp = fopen(SYSCONFDIR "/firecfg.config", "r"); |
48 | if (!fp) { | 58 | if (!fp) { |
@@ -56,8 +66,8 @@ int appimage_find_profile(const char *archive) { | |||
56 | char *ptr = strchr(buf, '\n'); | 66 | char *ptr = strchr(buf, '\n'); |
57 | if (ptr) | 67 | if (ptr) |
58 | *ptr = '\0'; | 68 | *ptr = '\0'; |
59 | char *found = strcasestr(archive, buf); | 69 | char *found = strcasestr(arc, buf); |
60 | if (found == archive) { | 70 | if (found == arc) { |
61 | fclose(fp); | 71 | fclose(fp); |
62 | return profile_find_firejail(buf, 1); | 72 | return profile_find_firejail(buf, 1); |
63 | } | 73 | } |