diff -Nru budgie-extras-1.7.0/debian/changelog budgie-extras-1.7.0/debian/changelog --- budgie-extras-1.7.0/debian/changelog 2023-09-12 20:01:35.000000000 +0100 +++ budgie-extras-1.7.0/debian/changelog 2023-11-07 19:03:41.000000000 +0000 @@ -1,3 +1,57 @@ +budgie-extras (1.7.0-3.0ubuntu1) mantic-security; urgency=medium + + * SECURITY UPDATE: Predictable /tmp path could lead to + denial-of-service/manipulation of data for clockworks applet + (LP: #2044373) + - d/patches/clockwork-tmpxdg.patch: change /tmp path + usage to use XDG_RUNTIME_DIR/HOME user-space locations, + thanks to original author + d/patches/clockwork-tmpxdg-pep8.patch: resolve pep8 + package test failure, thanks to original author + - CVE-2023-49342 + * SECURITY UPDATE: Predictable /tmp path could lead to + denial-of-service/manipulation of data for dropby applet + (LP: #2044373) + - d/patches/dropby-tmpxdg.patch: change /tmp path + usage to use XDG_RUNTIME_DIR/HOME user-space locations + d/patches/dropby-tmpxdg-pep8.patch: resolve pep8 + package test failure, thanks to original author + - CVE-2023-49343 + * SECURITY UPDATE: Predictable /tmp path could lead to + denial-of-service/manipulation of data for shuffler app + (LP: #2044373) + - d/patches/shuffler-tmpxdg.patch: change /tmp path + usage to use XDG_RUNTIME_DIR/HOME user-space locations, + thanks to original author + - CVE-2023-49344 + * SECURITY UPDATE: Predictable /tmp path could lead to + denial-of-service/manipulation of data for takeabreak + applet (LP: #2044373) + - d/patches/takeabreak-tmpxdg.patch: change /tmp path + usage to use XDG_RUNTIME_DIR/HOME user-space locations, + thanks to original author + d/patches/takeabreak-tmpxdg-pep8.patch: resolve pep8 + package test failure, thanks to original author + d/patches/takeabreak-tmpxdg-pep8_part2.patch: resolve pep8 + package test failure, thanks to original author + - CVE-2023-49345 + * SECURITY UPDATE: Predictable /tmp path could lead to + denial-of-service/manipulation of data for weathershow + applet (LP: #2044373) + - d/patches/weathershow-tmpxdg.patch: change /tmp path + usage to use XDG_RUNTIME_DIR/HOME user-space locations, + thanks to original author + - CVE-2023-49346 + * SECURITY UPDATE: Predictable /tmp path could lead to + denial-of-service/manipulation of data for window + previews applet (LP: #2044373) + - d/patches/wpreviews-tmpxdg.patch: change /tmp path + usage to use XDG_RUNTIME_DIR/HOME user-space locations, + thanks to original author + - CVE-2023-49347 + + -- David Mohammed Tue, 07 Nov 2023 19:03:41 +0000 + budgie-extras (1.7.0-3) unstable; urgency=medium * Bug-fix diff -Nru budgie-extras-1.7.0/debian/patches/clockwork-tmpxdg.patch budgie-extras-1.7.0/debian/patches/clockwork-tmpxdg.patch --- budgie-extras-1.7.0/debian/patches/clockwork-tmpxdg.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/clockwork-tmpxdg.patch 2023-11-07 19:03:41.000000000 +0000 @@ -0,0 +1,30 @@ +Applied-Upstream: commit:d03083732569126d2f21c8810d5a69554ccc5900 +Author: Samuel Lane +Last-Update: 2023-10-19 +Description: [PATCH 5/8] Resolves clockworks - fallback will use the existing + applet-created clockwork path in .config - fallback does not handle deletion + of temp files - this is mitigated by all clockwork files being kept + together + +--- + budgie-clockworks/cwtools.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/budgie-clockworks/cwtools.py b/budgie-clockworks/cwtools.py +index e0d4f36..dc22ed3 100644 +--- a/budgie-clockworks/cwtools.py ++++ b/budgie-clockworks/cwtools.py +@@ -36,8 +36,8 @@ settingsdir = os.path.join(home, ".config/budgie-extras/clockworks") + hrs_path = os.path.join(settingsdir, "hrs") + mins_path = os.path.join(settingsdir, "mins") + misc_dir = os.path.join(settingsdir, "misc") +-user = os.environ["USER"] +-tmp = os.path.join("/tmp", user + "_clockworks") ++tmpdir = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else settingsdir ++tmp = os.path.join(tmpdir, ".clockworks") + clock_datafile = os.path.join(settingsdir, "clockdata") + key = "org.ubuntubudgie.plugins.budgie-clockworks" + subkeys = ["background", "hour", "minute"] +-- +2.34.1 + diff -Nru budgie-extras-1.7.0/debian/patches/clockwork-tmpxdg-pep8.patch budgie-extras-1.7.0/debian/patches/clockwork-tmpxdg-pep8.patch --- budgie-extras-1.7.0/debian/patches/clockwork-tmpxdg-pep8.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/clockwork-tmpxdg-pep8.patch 2023-11-07 19:03:41.000000000 +0000 @@ -0,0 +1,26 @@ +Applied-Upstream: commit:5f0129923ea608deef3b48dc723b57b18e5e9e7f +Author: David Mohammed +Last-Update: 2023-11-07 +Description: [PATCH 3/4] resolve clockworks pep8 + +--- + budgie-clockworks/cwtools.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/budgie-clockworks/cwtools.py b/budgie-clockworks/cwtools.py +index dc22ed3..437f541 100644 +--- a/budgie-clockworks/cwtools.py ++++ b/budgie-clockworks/cwtools.py +@@ -36,7 +36,8 @@ settingsdir = os.path.join(home, ".config/budgie-extras/clockworks") + hrs_path = os.path.join(settingsdir, "hrs") + mins_path = os.path.join(settingsdir, "mins") + misc_dir = os.path.join(settingsdir, "misc") +-tmpdir = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else settingsdir ++tmpdir = os.getenv("XDG_RUNTIME_DIR") \ ++ if "XDG_RUNTIME_DIR" in os.environ else settingsdir + tmp = os.path.join(tmpdir, ".clockworks") + clock_datafile = os.path.join(settingsdir, "clockdata") + key = "org.ubuntubudgie.plugins.budgie-clockworks" +-- +2.40.1 + diff -Nru budgie-extras-1.7.0/debian/patches/dropby-tmpxdg.patch budgie-extras-1.7.0/debian/patches/dropby-tmpxdg.patch --- budgie-extras-1.7.0/debian/patches/dropby-tmpxdg.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/dropby-tmpxdg.patch 2023-11-07 19:03:41.000000000 +0000 @@ -0,0 +1,98 @@ +Applied-Upstream: commit:e75c94af249191bdbd33eebf7a62d4234a0d8be5 +Author: Samuel Lane +Last-Update: 2023-10-19 +Description: [PATCH 6/8] Resolves dropby + +--- + budgie-dropby/budgie_dropby.py | 7 +++---- + budgie-dropby/checkonwin | 4 ++-- + budgie-dropby/copy_flash | 4 ++-- + budgie-dropby/dropover | 9 ++++----- + 4 files changed, 11 insertions(+), 13 deletions(-) + +diff --git a/budgie-dropby/budgie_dropby.py b/budgie-dropby/budgie_dropby.py +index b634ae4..b766f6c 100644 +--- a/budgie-dropby/budgie_dropby.py ++++ b/budgie-dropby/budgie_dropby.py +@@ -108,8 +108,8 @@ class BudgieDropByApplet(Budgie.Applet): + self.uuid = uuid + self.connect("destroy", Gtk.main_quit) + app_path = os.path.dirname(os.path.abspath(__file__)) +- user = os.environ["USER"] +- self.copytrigger = "/tmp/" + user + "_dropby_icon_copy" ++ self.tmp_path = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++ self.copytrigger = os.path.join(self.tmp_path, ".dropby_icon_copy") + self.copying = False + self.winpath = os.path.join(app_path, "dropover") + self.box = Gtk.EventBox() +@@ -188,8 +188,7 @@ class BudgieDropByApplet(Budgie.Applet): + + def create_windowtrigger(self, *args): + if not self.check_winexists(): +- user = os.environ["USER"] +- open("/tmp/" + user + "_call_dropby", "wt").write("") ++ open(os.path.join(self.tmp_path, ".call_dropby"), "wt").write("") + + def start_dropover(self): + try: +diff --git a/budgie-dropby/checkonwin b/budgie-dropby/checkonwin +index 5c5f069..cc048d9 100755 +--- a/budgie-dropby/checkonwin ++++ b/budgie-dropby/checkonwin +@@ -19,8 +19,8 @@ should have received a copy of the GNU General Public License along with this + program. If not, see . + """ + +-dropby_user = os.environ["USER"] +-timer = "/tmp/" + dropby_user + "_keepdropbywin" ++tmp_path = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++timer = os.path.join(tmp_path, ".keepdropbywin") + + + try: +diff --git a/budgie-dropby/copy_flash b/budgie-dropby/copy_flash +index 4632f05..920f49b 100755 +--- a/budgie-dropby/copy_flash ++++ b/budgie-dropby/copy_flash +@@ -87,8 +87,8 @@ def copy(source, targetdir): + + + # get targeted path +-user = os.environ["USER"] +-cptrigger = "/tmp/" + user + "_dropby_icon_copy" ++tmp_path = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++cptrigger = os.path.join(tmp_path, ".dropby_icon_copy") + try: + target = subprocess.check_output([ + "/usr/bin/zenity", "--file-selection", "--directory", +diff --git a/budgie-dropby/dropover b/budgie-dropby/dropover +index 9263a09..e1b5f9a 100755 +--- a/budgie-dropby/dropover ++++ b/budgie-dropby/dropover +@@ -62,10 +62,10 @@ class WatchVolumes: + app_path = os.path.dirname(os.path.abspath(__file__)) + self.copyscript = os.path.join(app_path, "copy_flash") + self.start_timer = os.path.join(app_path, "checkonwin") +- user = os.environ["USER"] +- self.timer = "/tmp/" + user + "_keepdropbywin" ++ self.tmp_path = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++ self.timer = os.path.join(self.tmp_path, ".keepdropbywin") + # setup watching trigger (uncomment below lines if) +- infofile = Gio.File.new_for_path("/tmp") ++ infofile = Gio.File.new_for_path(self.tmp_path) + monitor = infofile.monitor(Gio.FileMonitorFlags.NONE, None) + monitor.connect("changed", self.actonfile) + # setup watching applet presence +@@ -100,8 +100,7 @@ class WatchVolumes: + + def actonfile(self, arg1, arg2, arg3, event): + # ok, let's replace once dbus is a fact +- user = os.environ["USER"] +- trigger = "/tmp/" + user + "_call_dropby" ++ trigger = os.path.join(self.tmp_path, ".call_dropby") + if all([ + event == Gio.FileMonitorEvent.CREATED, + os.path.exists(trigger) +-- +2.34.1 + diff -Nru budgie-extras-1.7.0/debian/patches/dropby-tmpxdg-pep8.patch budgie-extras-1.7.0/debian/patches/dropby-tmpxdg-pep8.patch --- budgie-extras-1.7.0/debian/patches/dropby-tmpxdg-pep8.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/dropby-tmpxdg-pep8.patch 2023-11-07 19:03:41.000000000 +0000 @@ -0,0 +1,71 @@ +Applied-Upstream: commit:fa3525c06b213ab83423d2256972de066e30a78d +Author: David Mohammed +Last-Update: 20203-11-07 +Description: [PATCH 2/4] Resolve dropby pep8 + +--- + budgie-dropby/budgie_dropby.py | 3 ++- + budgie-dropby/checkonwin | 3 ++- + budgie-dropby/copy_flash | 3 ++- + budgie-dropby/dropover | 3 ++- + 4 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/budgie-dropby/budgie_dropby.py b/budgie-dropby/budgie_dropby.py +index b766f6c..b2eddeb 100644 +--- a/budgie-dropby/budgie_dropby.py ++++ b/budgie-dropby/budgie_dropby.py +@@ -108,7 +108,8 @@ class BudgieDropByApplet(Budgie.Applet): + self.uuid = uuid + self.connect("destroy", Gtk.main_quit) + app_path = os.path.dirname(os.path.abspath(__file__)) +- self.tmp_path = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++ self.tmp_path = os.getenv("XDG_RUNTIME_DIR") \ ++ if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") + self.copytrigger = os.path.join(self.tmp_path, ".dropby_icon_copy") + self.copying = False + self.winpath = os.path.join(app_path, "dropover") +diff --git a/budgie-dropby/checkonwin b/budgie-dropby/checkonwin +index cc048d9..36c0069 100755 +--- a/budgie-dropby/checkonwin ++++ b/budgie-dropby/checkonwin +@@ -19,7 +19,8 @@ should have received a copy of the GNU General Public License along with this + program. If not, see . + """ + +-tmp_path = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++tmp_path = os.getenv("XDG_RUNTIME_DIR") \ ++ if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") + timer = os.path.join(tmp_path, ".keepdropbywin") + + +diff --git a/budgie-dropby/copy_flash b/budgie-dropby/copy_flash +index 920f49b..de215de 100755 +--- a/budgie-dropby/copy_flash ++++ b/budgie-dropby/copy_flash +@@ -87,7 +87,8 @@ def copy(source, targetdir): + + + # get targeted path +-tmp_path = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++tmp_path = os.getenv("XDG_RUNTIME_DIR") \ ++ if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") + cptrigger = os.path.join(tmp_path, ".dropby_icon_copy") + try: + target = subprocess.check_output([ +diff --git a/budgie-dropby/dropover b/budgie-dropby/dropover +index e1b5f9a..40f8438 100755 +--- a/budgie-dropby/dropover ++++ b/budgie-dropby/dropover +@@ -62,7 +62,8 @@ class WatchVolumes: + app_path = os.path.dirname(os.path.abspath(__file__)) + self.copyscript = os.path.join(app_path, "copy_flash") + self.start_timer = os.path.join(app_path, "checkonwin") +- self.tmp_path = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++ self.tmp_path = os.getenv("XDG_RUNTIME_DIR") \ ++ if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") + self.timer = os.path.join(self.tmp_path, ".keepdropbywin") + # setup watching trigger (uncomment below lines if) + infofile = Gio.File.new_for_path(self.tmp_path) +-- +2.40.1 + diff -Nru budgie-extras-1.7.0/debian/patches/series budgie-extras-1.7.0/debian/patches/series --- budgie-extras-1.7.0/debian/patches/series 2023-09-12 20:01:35.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/series 2023-11-07 19:03:41.000000000 +0000 @@ -1 +1,11 @@ Update-Trash-ID.patch +clockwork-tmpxdg.patch +clockwork-tmpxdg-pep8.patch +dropby-tmpxdg.patch +dropby-tmpxdg-pep8.patch +shuffler-tmpxdg.patch +takeabreak-tmpxdg.patch +takeabreak-tmpxdg-pep8.patch +takeabreak-tmpxdg-pep8_part2.patch +weathershow-tmpxdg.patch +wpreviews-tmpxdg.patch diff -Nru budgie-extras-1.7.0/debian/patches/shuffler-tmpxdg.patch budgie-extras-1.7.0/debian/patches/shuffler-tmpxdg.patch --- budgie-extras-1.7.0/debian/patches/shuffler-tmpxdg.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/shuffler-tmpxdg.patch 2023-11-07 19:03:41.000000000 +0000 @@ -0,0 +1,245 @@ +Applied-Upstream: commit:11b02011ad2f6d46485b292713af09f7314843a5 +Author: Samuel Lane +Last-Update: 2023-10-20 +Description: [PATCH 8/8] Resolves 1 (1.1 - 1.6) - resolves 1.1 - resolves 1.2 - + resolves 1.3 - resolves 1.4 - resolves 1.5 - resolves 1.6 + +--- + .../applet/src/ShufflerApplet.vala | 5 ++--- + budgie-window-shuffler/src/gridwindow.vala | 5 ++--- + budgie-window-shuffler/src/layouts_popup.vala | 12 +++++------- + budgie-window-shuffler/src/run_layout.vala | 15 +++++---------- + budgie-window-shuffler/src/shuffler_control.vala | 5 ++--- + .../src/sizeexceeds_warning.vala | 6 ++++-- + .../src/toggle_layouts_popup.vala | 7 +++---- + budgie-window-shuffler/src/togglegui.vala | 5 ++--- + .../src/windowshufflerdaemon.vala | 11 +++++------ + 9 files changed, 30 insertions(+), 41 deletions(-) + +diff --git a/budgie-window-shuffler/applet/src/ShufflerApplet.vala b/budgie-window-shuffler/applet/src/ShufflerApplet.vala +index 84c7e36..c86122d 100644 +--- a/budgie-window-shuffler/applet/src/ShufflerApplet.vala ++++ b/budgie-window-shuffler/applet/src/ShufflerApplet.vala +@@ -85,11 +85,10 @@ namespace ShufflerApplet { + + private void open_shufflersettings() { + if (procruns(Config.SHUFFLER_DIR + "/shuffler_control")) { +- string user = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); + try { + File showpage_trigger = File.new_for_path( +- tmp + @"shufflerapplettrigger_$user" ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".shufflerapplettrigger") + ); + showpage_trigger.create(FileCreateFlags.NONE); + } +diff --git a/budgie-window-shuffler/src/gridwindow.vala b/budgie-window-shuffler/src/gridwindow.vala +index 6a8472a..7151d2a 100644 +--- a/budgie-window-shuffler/src/gridwindow.vala ++++ b/budgie-window-shuffler/src/gridwindow.vala +@@ -628,10 +628,9 @@ namespace GridWindowSection { + timestamp_window = new Gdk.X11.Window.foreign_for_display(display, xwindow); + // monitoring files / dirs + FileMonitor monitor; +- string user = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); + gridtrigger = File.new_for_path( +- tmp.concat(user, "_gridtrigger") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".gridtrigger") + ); + try { + monitor = gridtrigger.monitor(FileMonitorFlags.NONE, null); +diff --git a/budgie-window-shuffler/src/layouts_popup.vala b/budgie-window-shuffler/src/layouts_popup.vala +index 3a82751..ca64bc6 100644 +--- a/budgie-window-shuffler/src/layouts_popup.vala ++++ b/budgie-window-shuffler/src/layouts_popup.vala +@@ -36,7 +36,6 @@ namespace LayoutsPopup { + Wnck.Screen wnck_scr; + Gtk.Dialog? get_task; + Gtk.Dialog? ask_confirmdialog; +- string username; + string homedir; + string triggerfpath; + +@@ -487,8 +486,8 @@ namespace LayoutsPopup { + targetfile = File.new_for_path(path); + } + else { +- var tmp = Environment.get_tmp_dir() + "/"; +- string runfile = tmp.concat(username, "_istestingtask"); ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); ++ string runfile = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".istestingtask"); + targetfile = File.new_for_path(runfile); + } + if (targetfile.query_exists ()) { +@@ -1372,16 +1371,15 @@ namespace LayoutsPopup { + searchpath = create_dirs_file( + ".config/budgie-extras/shuffler/layouts", true + ); +- username = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); + string triggerpath = create_dirs_file( +- tmp.concat(username, "_shufflertriggers") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".shufflertriggers") + ); + // watch triggerfile + // containing dir + File triggerdir = File.new_for_path(triggerpath); + // triggerfilepath +- triggerfpath = triggerpath.concat("/layoutspopup"); ++ triggerfpath = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, triggerpath, "layoutspopup"); + popuptrigger = File.new_for_path(triggerfpath); + FileMonitor? triggerpath_monitor = null; + try { +diff --git a/budgie-window-shuffler/src/run_layout.vala b/budgie-window-shuffler/src/run_layout.vala +index 1a035df..2983563 100644 +--- a/budgie-window-shuffler/src/run_layout.vala ++++ b/budgie-window-shuffler/src/run_layout.vala +@@ -198,9 +198,8 @@ namespace ShufflerLayouts { + + private void create_busyfile (File busyfile) { + // create triggerfile to temporarily disable possibly set windowrules +- string user = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; +- File busy = File.new_for_path (tmp.concat(user, "_running_layout")); ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); ++ File busy = File.new_for_path (GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".running_layout")); + try { + if (!busy.query_exists()) { + busy.create(FileCreateFlags.REPLACE_DESTINATION); +@@ -374,11 +373,8 @@ namespace ShufflerLayouts { + indices_done = {}; + xids_moved_windows = {}; + // define & create triggerfile (putting rules on hold) +- string user = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; +- File busyfile = File.new_for_path ( +- tmp.concat(user, "_running_layout") +- ); ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); ++ File busyfile = File.new_for_path (GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".running_layout")); + create_busyfile(busyfile); + // get windowlist (xid) of windows that existed on launch + Gtk.init(ref args); +@@ -403,8 +399,7 @@ namespace ShufflerLayouts { + validpaths = {searchpath.concat("/", args[2])}; + } + else { +- string username = Environment.get_user_name(); +- validpaths = {tmp.concat(username, "_istestingtask")}; ++ validpaths = {GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".istestingtask")}; + } + } + else { +diff --git a/budgie-window-shuffler/src/shuffler_control.vala b/budgie-window-shuffler/src/shuffler_control.vala +index 113f85c..ab54986 100644 +--- a/budgie-window-shuffler/src/shuffler_control.vala ++++ b/budgie-window-shuffler/src/shuffler_control.vala +@@ -1736,10 +1736,9 @@ namespace ShufflerControl2 { + } + new ShufflerControlWindow(page); + // watch trigger to switch to applet settings +- string user = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir(); ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); + File showpage_trigger = File.new_for_path( +- tmp + @"/shufflerapplettrigger_$user" ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".shufflerapplettrigger") + ); + delete_file(showpage_trigger); + FileMonitor monitor_showpage_trigger; +diff --git a/budgie-window-shuffler/src/sizeexceeds_warning.vala b/budgie-window-shuffler/src/sizeexceeds_warning.vala +index 1ad9d0b..3c34e70 100644 +--- a/budgie-window-shuffler/src/sizeexceeds_warning.vala ++++ b/budgie-window-shuffler/src/sizeexceeds_warning.vala +@@ -64,8 +64,10 @@ namespace ShufflerExceedsWarning { + sc.add_class ("header"); + label.xalign = (float)0.5; + this.add (maingrid); +- var tmp = Environment.get_tmp_dir(); +- Gtk.Image img = new Gtk.Image.from_file (tmp + "/shuffler-warning.png"); ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); ++ Gtk.Image img = new Gtk.Image.from_file ( ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".shuffler-warning.png") ++ ); + maingrid.attach (label, 0, 0, 1, 1); + maingrid.attach (img, 0, 0, 1, 1); + this.destroy.connect (Gtk.main_quit); +diff --git a/budgie-window-shuffler/src/toggle_layouts_popup.vala b/budgie-window-shuffler/src/toggle_layouts_popup.vala +index 065603b..c4b41cf 100644 +--- a/budgie-window-shuffler/src/toggle_layouts_popup.vala ++++ b/budgie-window-shuffler/src/toggle_layouts_popup.vala +@@ -57,13 +57,12 @@ namespace ToggleShufflerGUI { + print(@"$fromcontrol\n"); + + // make sure triggerdir exists +- string username = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); + string triggerpath = create_dirs_file( +- tmp.concat(username, "_shufflertriggers") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".shufflertriggers") + ); + // then define trigger +- File popuptrigger = File.new_for_path(triggerpath.concat("/layoutspopup")); ++ File popuptrigger = File.new_for_path(GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, triggerpath, "layoutspopup")); + bool popuptriggerexists = popuptrigger.query_exists(); + if (!popuptriggerexists) { + create_trigger(popuptrigger, fromcontrol); +diff --git a/budgie-window-shuffler/src/togglegui.vala b/budgie-window-shuffler/src/togglegui.vala +index 0666728..47ec4af 100644 +--- a/budgie-window-shuffler/src/togglegui.vala ++++ b/budgie-window-shuffler/src/togglegui.vala +@@ -28,10 +28,9 @@ namespace ToggleShufflerGUI { + } + + public static void main (string[] args) { +- string user = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); + File gridtrigger = File.new_for_path( +- tmp.concat(user, "_gridtrigger") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".gridtrigger") + ); + bool gridtriggerexists = gridtrigger.query_exists(); + if (!gridtriggerexists) { +diff --git a/budgie-window-shuffler/src/windowshufflerdaemon.vala b/budgie-window-shuffler/src/windowshufflerdaemon.vala +index 30e92f4..f624f96 100644 +--- a/budgie-window-shuffler/src/windowshufflerdaemon.vala ++++ b/budgie-window-shuffler/src/windowshufflerdaemon.vala +@@ -1013,8 +1013,8 @@ namespace ShufflerEssentialInfo { + create_box (surface, context, {30, 30, 8, 8}, {1, 1, 1, 1}); + create_box (surface, context, {40, 20, 8, 8}, {1, 1, 1, 1}); + // Save the image: +- var tmp = Environment.get_tmp_dir(); +- surface.write_to_png (tmp + "/shuffler-warning.png"); ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); ++ surface.write_to_png (GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".shuffler-warning.png")); + } + + private void create_box ( +@@ -1101,15 +1101,14 @@ namespace ShufflerEssentialInfo { + // FileMonitor stuff, see if gui runs (disable jump & tileactive) + gridguiruns = false; + FileMonitor monitor; +- string user = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); + // layout_busy triggerfile for run_layout + layout_busy = File.new_for_path ( +- tmp.concat(user, @"_running_layout") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".running_layout") + ); + // and one for grid + File gridtrigger = File.new_for_path( +- tmp.concat(user, "_gridtrigger") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".gridtrigger") + ); + try { + monitor = gridtrigger.monitor(FileMonitorFlags.NONE, null); +-- +2.34.1 + diff -Nru budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg.patch budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg.patch --- budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg.patch 2023-11-07 19:03:41.000000000 +0000 @@ -0,0 +1,53 @@ +Applied-Upstream: commit:ffa29d4bfe880217e28d99de99026760ae6fe1d4 +Author: Samuel Lane +Last-Update: 2023-10-18 +Description: [PATCH 4/8] Resolves 3 / 3.1 - resolves 3.1 (entirety of no. 3) + +--- + budgie-takeabreak/budgie_takeabreak.py | 6 +++--- + budgie-takeabreak/takeabreak_run | 5 +++-- + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/budgie-takeabreak/budgie_takeabreak.py b/budgie-takeabreak/budgie_takeabreak.py +index 2bc25c7..495707c 100644 +--- a/budgie-takeabreak/budgie_takeabreak.py ++++ b/budgie-takeabreak/budgie_takeabreak.py +@@ -23,9 +23,8 @@ program. If not, see . + """ + + +-user = os.environ["USER"] +-tmp = GLib.get_tmp_dir() +-nextbreakfile = tmp + "/nextbreak_" + user ++tmp = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++nextbreakfile = os.path.join(tmp, ".nextbreak") + tab_settings = Gio.Settings.new("org.ubuntubudgie.plugins.takeabreak") + + +@@ -261,6 +260,7 @@ class BudgieTakeaBreakApplet(Budgie.Applet): + return False + + def kill_runner(self): ++ user = os.environ["USER"] + try: + # I know, old school, but it works well + pid = subprocess.check_output([ +diff --git a/budgie-takeabreak/takeabreak_run b/budgie-takeabreak/takeabreak_run +index 9abbedd..e2078ea 100755 +--- a/budgie-takeabreak/takeabreak_run ++++ b/budgie-takeabreak/takeabreak_run +@@ -76,8 +76,9 @@ def subprocess_tasks(task, command_list, fallbackval=None): + + def write_nextbreak(): + next_break = time.time() + awaketime +- tmp = GLib.get_tmp_dir() +- open(tmp + "/nextbreak_" + user, "wt").write(str(next_break)) ++ tmp = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++ nextbreakfile = os.path.join(tmp, ".nextbreak") ++ open(nextbreakfile, "wt").write(str(next_break)) + + + def sendmessage(title, message, icon=""): +-- +2.34.1 + diff -Nru budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg-pep8_part2.patch budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg-pep8_part2.patch --- budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg-pep8_part2.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg-pep8_part2.patch 2023-11-07 19:03:41.000000000 +0000 @@ -0,0 +1,26 @@ +Applied-Upstream: commit:45f1a54258aaaa27459b25f476d96ca5b1f2b25f +Author: David Mohammed +Last-Update: 2023-11-07 +Description: [PATCH 4/4] resolve takeabreak pep8 + +--- + budgie-takeabreak/budgie_takeabreak.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/budgie-takeabreak/budgie_takeabreak.py b/budgie-takeabreak/budgie_takeabreak.py +index 495707c..cbb53ef 100644 +--- a/budgie-takeabreak/budgie_takeabreak.py ++++ b/budgie-takeabreak/budgie_takeabreak.py +@@ -23,7 +23,8 @@ program. If not, see . + """ + + +-tmp = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++tmp = os.getenv("XDG_RUNTIME_DIR") \ ++ if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") + nextbreakfile = os.path.join(tmp, ".nextbreak") + tab_settings = Gio.Settings.new("org.ubuntubudgie.plugins.takeabreak") + +-- +2.40.1 + diff -Nru budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg-pep8.patch budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg-pep8.patch --- budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg-pep8.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/takeabreak-tmpxdg-pep8.patch 2023-11-07 19:03:41.000000000 +0000 @@ -0,0 +1,26 @@ +Applied-Upstream: commit:c2889de3c02ce7e447bdf8efa569fe7b4fb641ca +Description: David Mohammed +Last-Update: 2023-11-07 +Description: [PATCH 1/4] takeabreak pep8 correction + +--- + budgie-takeabreak/takeabreak_run | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/budgie-takeabreak/takeabreak_run b/budgie-takeabreak/takeabreak_run +index e2078ea..62db505 100755 +--- a/budgie-takeabreak/takeabreak_run ++++ b/budgie-takeabreak/takeabreak_run +@@ -76,7 +76,8 @@ def subprocess_tasks(task, command_list, fallbackval=None): + + def write_nextbreak(): + next_break = time.time() + awaketime +- tmp = os.getenv("XDG_RUNTIME_DIR") if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") ++ tmp = os.getenv("XDG_RUNTIME_DIR") \ ++ if "XDG_RUNTIME_DIR" in os.environ else os.getenv("HOME") + nextbreakfile = os.path.join(tmp, ".nextbreak") + open(nextbreakfile, "wt").write(str(next_break)) + +-- +2.40.1 + diff -Nru budgie-extras-1.7.0/debian/patches/weathershow-tmpxdg.patch budgie-extras-1.7.0/debian/patches/weathershow-tmpxdg.patch --- budgie-extras-1.7.0/debian/patches/weathershow-tmpxdg.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/weathershow-tmpxdg.patch 2023-11-07 19:03:41.000000000 +0000 @@ -0,0 +1,45 @@ +Applied-Upstream: commit:0092025ef25b48c287a75946c0ee797d3c142760 +Author: Samuel Lane +Last-Update: 2023-10-18 +Description: [PATCH 3/8] Resolves 4 / 4.1 - resolves 4.1 (entirety of No. 4) + +--- + budgie-weathershow/src/desktop_weather/desktop_weather.vala | 5 ++--- + budgie-weathershow/src/weathershow/WeatherShow.vala | 5 ++--- + 2 files changed, 4 insertions(+), 6 deletions(-) + +diff --git a/budgie-weathershow/src/desktop_weather/desktop_weather.vala b/budgie-weathershow/src/desktop_weather/desktop_weather.vala +index 7b85dc6..7a20798 100644 +--- a/budgie-weathershow/src/desktop_weather/desktop_weather.vala ++++ b/budgie-weathershow/src/desktop_weather/desktop_weather.vala +@@ -134,9 +134,8 @@ public class DesktopWeather : Gtk.Window { + this.set_visual(visual); + this.draw.connect(on_draw); + // monitored datafile +- string username = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; +- string src = tmp.concat(username, "_weatherdata"); ++ string tmpdir = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); ++ string src = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmpdir, ".weatherdata"); + datasrc = File.new_for_path(src); + // report + maingrid = new Gtk.Grid(); +diff --git a/budgie-weathershow/src/weathershow/WeatherShow.vala b/budgie-weathershow/src/weathershow/WeatherShow.vala +index cfa71e2..ce1f30c 100644 +--- a/budgie-weathershow/src/weathershow/WeatherShow.vala ++++ b/budgie-weathershow/src/weathershow/WeatherShow.vala +@@ -348,9 +348,8 @@ namespace WeatherShowApplet { + string result_current = weather_obj.get_current(); + // write to file only for desktop show + if (show_ondesktop == true) { +- string username = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; +- string src = tmp.concat(username, "_weatherdata"); ++ string tmpdir = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); ++ string src = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmpdir, ".weatherdata"); + WeatherShowFunctions.write_tofile(src, result_current); + } + } +-- +2.34.1 + diff -Nru budgie-extras-1.7.0/debian/patches/wpreviews-tmpxdg.patch budgie-extras-1.7.0/debian/patches/wpreviews-tmpxdg.patch --- budgie-extras-1.7.0/debian/patches/wpreviews-tmpxdg.patch 1970-01-01 01:00:00.000000000 +0100 +++ budgie-extras-1.7.0/debian/patches/wpreviews-tmpxdg.patch 2023-11-07 19:03:41.000000000 +0000 @@ -0,0 +1,144 @@ +Applied-Upstream: commit:588cbe6ffa72df904213d77728a3fd5bfae7195e +Author: Samuel Lane +Last-Update: 2023-10-20 +Description: [PATCH 7/8] Resolves 2 - 2.1 / 2.2 - resolves 2.1 - resolves 2.2 + +--- + budgie-wpreviews/src/previews_creator.vala | 5 ++--- + budgie-wpreviews/src/previews_daemon.vala | 20 +++++++++----------- + budgie-wpreviews/src/previews_triggers.vala | 17 ++++++++--------- + budgie-wpreviews/src/separate_shot.vala | 5 ++--- + 4 files changed, 21 insertions(+), 26 deletions(-) + +diff --git a/budgie-wpreviews/src/previews_creator.vala b/budgie-wpreviews/src/previews_creator.vala +index c7e7924..6ecd11b 100644 +--- a/budgie-wpreviews/src/previews_creator.vala ++++ b/budgie-wpreviews/src/previews_creator.vala +@@ -56,9 +56,8 @@ namespace create_previews { + if (wnck_scr == null) return; // usually if not run on X11 + gdk_scr = Gdk.Screen.get_default(); + if (gdk_scr == null) return; // usually if there is no display +- string user = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; +- previewspath = tmp.concat(user, "_window-previews"); ++ string tmpdir = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); ++ previewspath = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmpdir, ".windows-previews"); + update_winlist(); + wnck_scr.window_opened.connect(update_winlist); + wnck_scr.window_opened.connect(refresh_new); +diff --git a/budgie-wpreviews/src/previews_daemon.vala b/budgie-wpreviews/src/previews_daemon.vala +index ce7fb82..b9afa11 100644 +--- a/budgie-wpreviews/src/previews_daemon.vala ++++ b/budgie-wpreviews/src/previews_daemon.vala +@@ -31,7 +31,6 @@ namespace NewPreviews { + bool showtooltips; + bool allapps; + Gtk.Button[] currbuttons; +- string user; + File triggerdir; + File nexttrigger; + File allappstrigger; +@@ -661,25 +660,25 @@ namespace NewPreviews { + allworkspaces = previews_settings.get_boolean("allworkspaces"); + showtooltips = previews_settings.get_boolean("showtooltips"); + }); +- var tmp = Environment.get_tmp_dir() + "/"; ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); + triggerdir = File.new_for_path(tmp); + allappstrigger = File.new_for_path( +- tmp.concat(user, "_prvtrigger_all") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".prvtrigger_all") + ); + allappstriggerhotc = File.new_for_path( +- tmp.concat(user, "_prvtrigger_all_hotcorner") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".prvtrigger_all_hotcorner") + ); + currapptriggerhotc = File.new_for_path( +- tmp.concat(user, "_prvtrigger_curr_hotcorner") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".prvtrigger_curr_hotcorner") + ); + nexttrigger = File.new_for_path( +- tmp.concat(user, "_nexttrigger") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".nexttrigger") + ); + previoustrigger = File.new_for_path( +- tmp.concat(user, "_previoustrigger") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".previoustrigger") + ); + triggercurrent = File.new_for_path( +- tmp.concat(user, "_prvtrigger_current") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".prvtrigger_current") + ); + // start with a clean plate please + cleanup(); +@@ -711,9 +710,8 @@ namespace NewPreviews { + } + + public static void main (string[] args) { +- user = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; +- previewspath = tmp.concat(user, "_window-previews"); ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); ++ previewspath = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".windows-previews"); + try { + File file = File.new_for_commandline_arg (previewspath); + file.make_directory (); +diff --git a/budgie-wpreviews/src/previews_triggers.vala b/budgie-wpreviews/src/previews_triggers.vala +index 9f37ff8..7e57b20 100644 +--- a/budgie-wpreviews/src/previews_triggers.vala ++++ b/budgie-wpreviews/src/previews_triggers.vala +@@ -37,27 +37,26 @@ namespace previews_triggers { + + public static void main (string[] args) { + +- // user +- string user = Environment.get_user_name(); ++ // user dir ++ string tmp = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); + // files +- var tmp = Environment.get_tmp_dir() + "/"; + File allappstrigger = File.new_for_path( +- tmp.concat(user, "_prvtrigger_all") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".prvtrigger_all") + ); + File nexttrigger = File.new_for_path( +- tmp.concat(user, "_nexttrigger") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".nexttrigger") + ); + File previoustrigger = File.new_for_path( +- tmp.concat(user, "_previoustrigger") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".previoustrigger") + ); + File triggercurrent = File.new_for_path( +- tmp.concat(user, "_prvtrigger_current") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".prvtrigger_current") + ); + File allappstriggerhotc = File.new_for_path( +- tmp.concat(user, "_prvtrigger_all_hotcorner") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".prvtrigger_all_hotcorner") + ); + File currapptriggerhotc = File.new_for_path( +- tmp.concat(user, "_prvtrigger_curr_hotcorner") ++ GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmp, ".prvtrigger_curr_hotcorner") + ); + + File trg = nexttrigger; +diff --git a/budgie-wpreviews/src/separate_shot.vala b/budgie-wpreviews/src/separate_shot.vala +index 94b53f0..38d267b 100644 +--- a/budgie-wpreviews/src/separate_shot.vala ++++ b/budgie-wpreviews/src/separate_shot.vala +@@ -34,9 +34,8 @@ namespace fixpreviews { + + private void make_prvpath () { + // make previews path +- string user = Environment.get_user_name(); +- var tmp = Environment.get_tmp_dir() + "/"; +- previewspath = tmp.concat(user, "_window-previews"); ++ string tmpdir = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); ++ previewspath = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmpdir, ".windows-previews"); + + try { + File file = File.new_for_commandline_arg (previewspath); +-- +2.34.1 +