From 6cceac3b3eca9ce2cc13cde4d16f7291b565c720 Mon Sep 17 00:00:00 2001 From: Ulrike Uhlig Date: Wed, 18 Jan 2017 20:58:03 +0100 Subject: [PATCH 1/3] Improve AppArmor profiles and enforce them. Work from Tails Developers, main git repository, currently devel branch. Upstream commits: commit 6e7ad41ca9664246856fe9553c202f09a1d1066b Remove superfluous AppArmor rule. The pattern `[^.]*` matches a subset of `[^.]**`, so we only need to keep the latter. commit b3a827d8e3c3fee78ec18450dfaf38a3d4eaf270 Make onionshare-gui able to access folders beneath $HOME. Without this change e.g. ~/Documents is inaccessible. To be honest, this does not makes sense to me, as my interpretation of the old patterns clearly should allow subfolders and files therein. commit db2b3a3f73aa01a54c9b7cb5ab83da1d083b7169 WIP: AppArmor profile improvements. --- apparmor/abstractions/onionshare | 18 ++++++++---------- apparmor/usr.bin.onionshare | 2 +- apparmor/usr.bin.onionshare-gui | 8 +++++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apparmor/abstractions/onionshare b/apparmor/abstractions/onionshare index d5c7c184..fa94e68d 100644 --- a/apparmor/abstractions/onionshare +++ b/apparmor/abstractions/onionshare @@ -1,5 +1,6 @@ #include #include +#include #include # Why are these not in abstractions/python? @@ -16,16 +17,13 @@ /sbin/ldconfig rix, /sbin/ldconfig.real rix, /bin/uname rix, -/{,lib/live/mount/rootfs/filesystem.squashfs/}etc/mime.types r, -/{,lib/live/mount/rootfs/filesystem.squashfs/}usr/share/onionshare/ r, -/{,lib/live/mount/rootfs/filesystem.squashfs/}usr/share/onionshare/** r, +/etc/mime.types r, +/usr/share/onionshare/ r, +/usr/share/onionshare/** r, /tmp/ rw, /tmp/** rw, -# Allow all user data except .gnupg, .ssh and other potential -# places for critically sensitive application data. -audit deny @{HOME}/.* mrwkl, -audit deny @{HOME}/.*/ mrwkl, -audit deny @{HOME}/.*/** mrwkl, -owner @{HOME}/ r, -owner @{HOME}/** r, +# Allow read on almost anything in @{HOME}. Lenient, but +# private-files-strict is in effect. +owner @{HOME}/ r, +owner @{HOME}/[^.]** r, diff --git a/apparmor/usr.bin.onionshare b/apparmor/usr.bin.onionshare index 225e5458..1c14ccc1 100644 --- a/apparmor/usr.bin.onionshare +++ b/apparmor/usr.bin.onionshare @@ -1,6 +1,6 @@ #include -/usr/bin/onionshare flags=(complain) { +/usr/bin/onionshare { #include /usr/bin/ r, diff --git a/apparmor/usr.bin.onionshare-gui b/apparmor/usr.bin.onionshare-gui index ed69e832..746dadc1 100644 --- a/apparmor/usr.bin.onionshare-gui +++ b/apparmor/usr.bin.onionshare-gui @@ -1,6 +1,6 @@ #include -/usr/bin/onionshare-gui flags=(complain) { +/usr/bin/onionshare-gui { #include #include #include @@ -8,14 +8,16 @@ /usr/bin/ r, /usr/bin/onionshare-gui r, /proc/*/cmdline r, - /usr/share/icons/Adwaita/index.theme r, + + # The freedesktop.org abstraction doesn't allow `k` + /usr/share/icons/*/index.theme k, # Why do these still emit audit journal entries? owner @{HOME}/.config/ibus/bus/ rw, owner @{HOME}/.config/ibus/bus/* rw, deny @{HOME}/.ICEauthority r, - deny /{,lib/live/mount/rootfs/filesystem.squashfs/}etc/machine-id r, + deny /etc/machine-id r, deny /var/lib/dbus/machine-id.* rw, # Accessibility support From 91c24291517f7237a39340a5387a6896345a03e7 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 30 Jan 2017 16:50:20 -0800 Subject: [PATCH 2/3] Version bump to 1.0dev --- resources/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/version.txt b/resources/version.txt index 2003b639..d822536b 100644 --- a/resources/version.txt +++ b/resources/version.txt @@ -1 +1 @@ -0.9.2 +1.0dev From 7b068fee3535b9cf7fbb5fe164bfc621cc21789e Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 30 Jan 2017 16:54:31 -0800 Subject: [PATCH 3/3] Change 'Stop sharing automatically' option to 'Stop After First Download', to reduce confusion (fixes #349) --- resources/locale/en.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/locale/en.json b/resources/locale/en.json index 74fe4739..99b340ed 100644 --- a/resources/locale/en.json +++ b/resources/locale/en.json @@ -11,7 +11,7 @@ "not_a_file": "{0:s} is not a file.", "download_page_loaded": "Download page loaded", "other_page_loaded": "URL loaded", - "close_on_finish": "Stop sharing automatically", + "close_on_finish": "Stop After First Download", "closing_automatically": "Closing automatically because download finished", "large_filesize": "Warning: Sending large files could take hours", "error_tails_invalid_port": "Invalid value, port must be an integer", @@ -53,8 +53,8 @@ "error_rate_limit": "An attacker might be trying to guess your URL. To prevent this, OnionShare has automatically stopped the server. To share the files you must start it again and share the new URL.", "zip_progress_bar_format": "Crunching files: %p%", "error_stealth_not_supported": "To create stealth onion services, you need at least Tor 0.2.9.1-alpha (or Tor Browser 6.5) and at least python3-stem 1.5.0.", - "gui_advanced_options": "Advanced options", - "gui_create_stealth": "Create stealth onion service", + "gui_advanced_options": "Advanced Options", + "gui_create_stealth": "Create Stealth Onion Service", "gui_menu_file_menu": "&File", "gui_menu_settings_action": "&Settings", "gui_menu_quit_action": "&Quit",