Skip to content

Commit f396b51

Browse files
committed
Remove Flatpak filesystem permissions
(Using Sonny Piers’s technique in GNOME Commit)
1 parent edc93bf commit f396b51

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Testing with the Flatpak build is slower but you can be sure that you’re seein
220220
2. Either carry out a `git commit` or, to run Comet using one of the test messages:
221221

222222
```shell
223-
flatpak run org.small_tech.comet tests/<name of test message>
223+
flatpak run --file-forwarding org.small_tech.comet tests/<name of test message>
224224
```
225225

226226
To test the Welcome screen, either launch Comet from the Applications Menu or, via Terminal, run the Comet flatpak without passing it any arguments:

org.small_tech.comet.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ finish-args:
4747
# - https://flatkill.org/2020/
4848
# - https://github.com/flatpak/flatpak/issues/3637
4949

50-
# Host permissions are necessary as this is a developer tool and people
51-
# can mount external drives and network shares in a plethora of different locations.
52-
- '--filesystem=host'
53-
54-
# For use if a developer clones an app into the /tmp folder and attempts to
55-
# make a commit.
56-
- '--filesystem=/tmp'
57-
5850
# Necessary to configure Git from the welcome screen using flatpak-spawn --host.
5951
- '--talk-name=org.freedesktop.Flatpak'
6052

src/WelcomeWindow.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Comet {
99

1010
private string GIT_CONFIG_GLOBAL_CORE_EDITOR = "git config --global core.editor";
1111
private string FLATPAK_SPAWN_HOST = "flatpak-spawn --host";
12-
private string FLATPAK_RUN = "flatpak run";
12+
private string FLATPAK_RUN = "flatpak run --file-forwarding";
1313

1414
private string? current_editor {
1515
owned get {
@@ -174,7 +174,7 @@ namespace Comet {
174174

175175
private bool is_comet_enabled () {
176176
var comet_path = Application.is_running_as_flatpak ?
177-
@"$(FLATPAK_RUN) $(Application.flatpak_id)" :
177+
@"$(FLATPAK_RUN) $(Application.flatpak_id) @@" :
178178
Application.binary_path;
179179

180180
return current_editor == comet_path;
@@ -185,7 +185,7 @@ namespace Comet {
185185
Comet.saved_state.set("previous-editor", "s", current_editor);
186186

187187
var command = Application.is_running_as_flatpak ?
188-
@"$(FLATPAK_SPAWN_HOST) $(GIT_CONFIG_GLOBAL_CORE_EDITOR) \"$(FLATPAK_RUN) $(Application.flatpak_id)\""
188+
@"$(FLATPAK_SPAWN_HOST) $(GIT_CONFIG_GLOBAL_CORE_EDITOR) \"$(FLATPAK_RUN) $(Application.flatpak_id) @@\""
189189
: @"$(GIT_CONFIG_GLOBAL_CORE_EDITOR) $(Application.binary_path)";
190190

191191
var result = Posix.system (command);

0 commit comments

Comments
 (0)