summary refs log tree commit diff
path: root/pkgs/applications/networking/sync
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/networking/sync')
-rw-r--r--pkgs/applications/networking/sync/backintime/qt.nix27
-rw-r--r--pkgs/applications/networking/sync/celeste/default.nix28
-rw-r--r--pkgs/applications/networking/sync/celeste/target-dir.patch16
-rw-r--r--pkgs/applications/networking/sync/rclone/default.nix11
-rw-r--r--pkgs/applications/networking/sync/rsync/default.nix6
-rw-r--r--pkgs/applications/networking/sync/rsync/rsync-fortified-strlcpy-fix.patch49
-rw-r--r--pkgs/applications/networking/sync/storj-uplink/default.nix6
-rw-r--r--pkgs/applications/networking/sync/unison/default.nix10
-rw-r--r--pkgs/applications/networking/sync/wdt/default.nix6
9 files changed, 104 insertions, 55 deletions
diff --git a/pkgs/applications/networking/sync/backintime/qt.nix b/pkgs/applications/networking/sync/backintime/qt.nix
index 419fabc9348..bd571b1aed3 100644
--- a/pkgs/applications/networking/sync/backintime/qt.nix
+++ b/pkgs/applications/networking/sync/backintime/qt.nix
@@ -1,4 +1,4 @@
-{ mkDerivation, backintime-common, python3 }:
+{ lib, mkDerivation, backintime-common, python3, polkit, which, su, coreutils, util-linux }:
 
 let
   python' = python3.withPackages (ps: with ps; [ pyqt5 backintime-common packaging ]);
@@ -21,6 +21,29 @@ mkDerivation {
 
   preFixup = ''
     wrapQtApp "$out/bin/backintime-qt" \
-      --prefix PATH : "${backintime-common}/bin:$PATH"
+      --prefix PATH : "${lib.getBin backintime-common}/bin:$PATH"
+
+    substituteInPlace "$out/share/polkit-1/actions/net.launchpad.backintime.policy" \
+      --replace "/usr/bin/backintime-qt" "$out/bin/backintime-qt"
+
+    substituteInPlace "$out/share/applications/backintime-qt-root.desktop" \
+      --replace "/usr/bin/backintime-qt" "backintime-qt"
+
+    substituteInPlace "$out/share/backintime/qt/serviceHelper.py" \
+      --replace "'which'" "'${lib.getBin which}/bin/which'" \
+      --replace "/bin/su" "${lib.getBin su}/bin/su" \
+      --replace "/usr/bin/backintime" "${lib.getBin backintime-common}/bin/backintime" \
+      --replace "/usr/bin/nice" "${lib.getBin coreutils}/bin/nice" \
+      --replace "/usr/bin/ionice" "${lib.getBin util-linux}/bin/ionice"
+
+    substituteInPlace "$out/share/dbus-1/system-services/net.launchpad.backintime.serviceHelper.service" \
+      --replace "/usr/bin/python3" "${lib.getBin python'}/bin/python3" \
+      --replace "/usr/share/backintime" "$out/share/backintime"
+
+    substituteInPlace "$out/bin/backintime-qt_polkit" \
+      --replace "/usr/bin/backintime-qt" "$out/bin/backintime-qt"
+
+    wrapProgram "$out/bin/backintime-qt_polkit" \
+      --prefix PATH : "${lib.getBin polkit}/bin:$PATH"
   '';
 }
diff --git a/pkgs/applications/networking/sync/celeste/default.nix b/pkgs/applications/networking/sync/celeste/default.nix
index b3b69571ade..7386c32c279 100644
--- a/pkgs/applications/networking/sync/celeste/default.nix
+++ b/pkgs/applications/networking/sync/celeste/default.nix
@@ -1,6 +1,5 @@
 { lib
 , stdenv
-, rust
 , rustPlatform
 , fetchFromGitHub
 , substituteAll
@@ -8,13 +7,12 @@
 , pkg-config
 , wrapGAppsHook4
 , cairo
+, dbus
 , gdk-pixbuf
 , glib
 , graphene
-, gtk3
 , gtk4
 , libadwaita
-, libappindicator-gtk3
 , librclone
 , pango
 , rclone
@@ -22,23 +20,16 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "celeste";
-  version = "0.5.8";
+  version = "0.8.0";
 
   src = fetchFromGitHub {
     owner = "hwittenborn";
     repo = "celeste";
     rev = "v${version}";
-    hash = "sha256-U/6aqQig+uuWj/B9CODnV6chxY+KfMH7DqnPtSTDSA0=";
+    hash = "sha256-U+2imF4hUDJAwwf/RFZXfOgTxA+O8c6C+CzQoEQreJw=";
   };
 
-  cargoHash = "sha256-69LK/oicfmSPbUGGzWV9kvXkHqMvEzCG8xCu61MxSdk=";
-
-  patches = [
-    (substituteAll {
-      src = ./target-dir.patch;
-      rustTarget = rust.toRustTarget stdenv.hostPlatform;
-    })
-  ];
+  cargoHash = "sha256-9DrJoXT/uD8y7y2r58DMuURSaic+TtlnPPbw/gq9jPA=";
 
   postPatch = ''
     pushd $cargoDepsCopy/librclone-sys
@@ -61,14 +52,6 @@ rustPlatform.buildRustPackage rec {
     cargo update --offline
   '';
 
-  # We need to build celeste-tray first because celeste/src/launch.rs reads that file at build time.
-  # Upstream does the same: https://github.com/hwittenborn/celeste/blob/765dfa2/justfile#L1-L3
-  cargoBuildFlags = [ "--bin" "celeste-tray" ];
-  postConfigure = ''
-    cargoBuildHook
-    cargoBuildFlags=
-  '';
-
   RUSTC_BOOTSTRAP = 1;
 
   nativeBuildInputs = [
@@ -80,10 +63,10 @@ rustPlatform.buildRustPackage rec {
 
   buildInputs = [
     cairo
+    dbus
     gdk-pixbuf
     glib
     graphene
-    gtk3
     gtk4
     libadwaita
     librclone
@@ -92,7 +75,6 @@ rustPlatform.buildRustPackage rec {
 
   preFixup = ''
     gappsWrapperArgs+=(
-      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libappindicator-gtk3 ]}"
       --prefix PATH : "${lib.makeBinPath [ rclone ]}"
     )
   '';
diff --git a/pkgs/applications/networking/sync/celeste/target-dir.patch b/pkgs/applications/networking/sync/celeste/target-dir.patch
deleted file mode 100644
index a8da72e77f7..00000000000
--- a/pkgs/applications/networking/sync/celeste/target-dir.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/celeste/src/launch.rs b/celeste/src/launch.rs
-index 5227170..e3cf189 100644
---- a/celeste/src/launch.rs
-+++ b/celeste/src/launch.rs
-@@ -172,10 +172,7 @@ impl TrayApp {
-         perms.set_mode(0o755);
-         file.set_permissions(perms).unwrap();
- 
--        #[cfg(debug_assertions)]
--        let tray_file = include_bytes!("../../target/debug/celeste-tray");
--        #[cfg(not(debug_assertions))]
--        let tray_file = include_bytes!("../../target/release/celeste-tray");
-+        let tray_file = include_bytes!(concat!("../../target/@rustTarget@/", env!("cargoBuildType"), "/celeste-tray"));
- 
-         file.write_all(tray_file).unwrap();
-         drop(file);
diff --git a/pkgs/applications/networking/sync/rclone/default.nix b/pkgs/applications/networking/sync/rclone/default.nix
index d82981f2f08..26343f6a76e 100644
--- a/pkgs/applications/networking/sync/rclone/default.nix
+++ b/pkgs/applications/networking/sync/rclone/default.nix
@@ -6,16 +6,16 @@
 
 buildGoModule rec {
   pname = "rclone";
-  version = "1.64.0";
+  version = "1.64.2";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-miXYBKUTmsqAvVLmxcVCpjgEO3HeKQpUZKSvzaxhqdU=";
+    hash = "sha256-gOFOcqCgFAiTc6W3v8Z917hGCzxluswqnuOoUht73GA=";
   };
 
-  vendorHash = "sha256-rpF44yd8ElOkXTT1lSW0l3ZwTqeNdGS1OxrvNY8atzA=";
+  vendorHash = "sha256-eYIGVCTvUfGbsIMFthEfD0r6aeA7Ly9xJ8PJ6hR2SjA=";
 
   subPackages = [ "." ];
 
@@ -41,6 +41,10 @@ buildGoModule rec {
         ${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
         installShellCompletion rclone.$shell
       done
+
+      # filesystem helpers
+      ln -s $out/bin/rclone $out/bin/rclonefs
+      ln -s $out/bin/rclone $out/bin/mount.rclone
     '' + lib.optionalString (enableCmount && !stdenv.isDarwin)
       # use --suffix here to ensure we don't shadow /run/wrappers/bin/fusermount,
       # as the setuid wrapper is required as non-root on NixOS.
@@ -59,6 +63,7 @@ buildGoModule rec {
     homepage = "https://rclone.org";
     changelog = "https://github.com/rclone/rclone/blob/v${version}/docs/content/changelog.md";
     license = licenses.mit;
+    mainProgram = "rclone";
     maintainers = with maintainers; [ marsam SuperSandro2000 ];
   };
 }
diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix
index 9df26b6bb84..1baf1c40eb1 100644
--- a/pkgs/applications/networking/sync/rsync/default.nix
+++ b/pkgs/applications/networking/sync/rsync/default.nix
@@ -30,6 +30,12 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ perl ];
 
+  patches = [
+    # https://github.com/WayneD/rsync/issues/511#issuecomment-1774612577
+    # original source: https://build.opensuse.org/package/view_file/network/rsync/rsync-fortified-strlcpy-fix.patch?expand=1&rev=3f8dd2f4a404c96c0f69176e60893714
+    ./rsync-fortified-strlcpy-fix.patch
+  ];
+
   buildInputs = [ libiconv zlib popt ]
     ++ lib.optional enableACLs acl
     ++ lib.optional enableZstd zstd
diff --git a/pkgs/applications/networking/sync/rsync/rsync-fortified-strlcpy-fix.patch b/pkgs/applications/networking/sync/rsync/rsync-fortified-strlcpy-fix.patch
new file mode 100644
index 00000000000..296445b4bb5
--- /dev/null
+++ b/pkgs/applications/networking/sync/rsync/rsync-fortified-strlcpy-fix.patch
@@ -0,0 +1,49 @@
+From 1f83963f59960150e8c46112daa8411324c1f209 Mon Sep 17 00:00:00 2001
+From: Jiri Slaby <jslaby@suse.cz>
+Date: Fri, 18 Aug 2023 08:26:20 +0200
+Subject: [PATCH] exclude: fix crashes with fortified strlcpy()
+
+Fortified (-D_FORTIFY_SOURCE=2 for gcc) builds make strlcpy() crash when
+its third parameter (size) is larger than the buffer:
+  $ rsync -FFXHav '--filter=merge global-rsync-filter' Align-37-43/ xxx
+  sending incremental file list
+  *** buffer overflow detected ***: terminated
+
+It's in the exclude code in setup_merge_file():
+  strlcpy(y, save, MAXPATHLEN);
+
+Note the 'y' pointer was incremented, so it no longer points to memory
+with MAXPATHLEN "owned" bytes.
+
+Fix it by remembering the number of copied bytes into the 'save' buffer
+and use that instead of MAXPATHLEN which is clearly incorrect.
+
+Fixes #511.
+---
+ exclude.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/exclude.c b/exclude.c
+index ffe55b167..1a5de3b9e 100644
+--- a/exclude.c
++++ b/exclude.c
+@@ -720,7 +720,8 @@ static BOOL setup_merge_file(int mergelist_num, filter_rule *ex,
+ 	parent_dirscan = True;
+ 	while (*y) {
+ 		char save[MAXPATHLEN];
+-		strlcpy(save, y, MAXPATHLEN);
++		/* copylen is strlen(y) which is < MAXPATHLEN. +1 for \0 */
++		size_t copylen = strlcpy(save, y, MAXPATHLEN) + 1;
+ 		*y = '\0';
+ 		dirbuf_len = y - dirbuf;
+ 		strlcpy(x, ex->pattern, MAXPATHLEN - (x - buf));
+@@ -734,7 +735,7 @@ static BOOL setup_merge_file(int mergelist_num, filter_rule *ex,
+ 			lp->head = NULL;
+ 		}
+ 		lp->tail = NULL;
+-		strlcpy(y, save, MAXPATHLEN);
++		strlcpy(y, save, copylen);
+ 		while ((*x++ = *y++) != '/') {}
+ 	}
+ 	parent_dirscan = False;
+
diff --git a/pkgs/applications/networking/sync/storj-uplink/default.nix b/pkgs/applications/networking/sync/storj-uplink/default.nix
index 65b9630fd5a..154906bf2ee 100644
--- a/pkgs/applications/networking/sync/storj-uplink/default.nix
+++ b/pkgs/applications/networking/sync/storj-uplink/default.nix
@@ -5,18 +5,18 @@
 
 buildGoModule rec {
   pname = "storj-uplink";
-  version = "1.87.3";
+  version = "1.90.2";
 
   src = fetchFromGitHub {
     owner = "storj";
     repo = "storj";
     rev = "v${version}";
-    hash = "sha256-16h7PzZVFnaHMyODLk9tSrW8OiXQlcuDobANG1ZQVxs=";
+    hash = "sha256-VEO9LV6hzEd4IDnSPE5H0CDlwgRFEg4cheDx/RUGQug=";
   };
 
   subPackages = [ "cmd/uplink" ];
 
-  vendorHash = "sha256-gskOhLdrRzbvZwuOlm04fjeSXhNr/cqVGejEPZVtuBk=";
+  vendorHash = "sha256-R713WhFrWT7Cgstk3SLuvvyk3/ZtT1LOH0qqmFcWzKw=";
 
   ldflags = [ "-s" "-w" ];
 
diff --git a/pkgs/applications/networking/sync/unison/default.nix b/pkgs/applications/networking/sync/unison/default.nix
index 3612892548f..10bc3ca6863 100644
--- a/pkgs/applications/networking/sync/unison/default.nix
+++ b/pkgs/applications/networking/sync/unison/default.nix
@@ -6,7 +6,6 @@
 , copyDesktopItems
 , makeDesktopItem
 , wrapGAppsHook
-, glib
 , gsettings-desktop-schemas
 , zlib
 , enableX11 ? true
@@ -26,10 +25,11 @@ stdenv.mkDerivation (finalAttrs: {
 
   strictDeps = true;
 
-  nativeBuildInputs = [ glib wrapGAppsHook ocamlPackages.ocaml ]
-    ++ lib.optional enableX11 copyDesktopItems;
-  buildInputs = [ gsettings-desktop-schemas ncurses zlib ]
-    ++ lib.optional stdenv.isDarwin Cocoa;
+  nativeBuildInputs = [ ocamlPackages.ocaml ]
+    ++ lib.optionals enableX11 [ copyDesktopItems wrapGAppsHook ];
+  buildInputs = [ ncurses zlib ]
+    ++ lib.optionals enableX11 [ gsettings-desktop-schemas ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa ];
 
   preBuild = lib.optionalString enableX11 ''
     sed -i "s|\(OCAMLOPT=.*\)$|\1 -I $(echo "${ocamlPackages.lablgtk3}"/lib/ocaml/*/site-lib/lablgtk3)|" src/Makefile.OCaml
diff --git a/pkgs/applications/networking/sync/wdt/default.nix b/pkgs/applications/networking/sync/wdt/default.nix
index 6c6dddee173..7424a3da049 100644
--- a/pkgs/applications/networking/sync/wdt/default.nix
+++ b/pkgs/applications/networking/sync/wdt/default.nix
@@ -14,13 +14,13 @@
 
 stdenv.mkDerivation {
   pname = "wdt";
-  version = "unstable-2022-12-19";
+  version = "unstable-2023-07-11";
 
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "wdt";
-    rev = "6a122f24deb4f2ff6c6f97b6a803301a7f7b666c";
-    sha256 = "sha256-fH4Inqy7DfMJbW1FYWanScLATu8cZA1n+Vas8ee3xwA=";
+    rev = "3b52ef573129fb799319630bd438717761111f57";
+    sha256 = "sha256-TwHWeTVzUo42t1erD7lMT4vdXiV3/9Hy1sPnrvJpQE8=";
   };
 
   nativeBuildInputs = [ cmake ];