blob: 011858e80c3560ea2afabf8ebdd53da1e31a680e [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001From 8327383e262e1e7f32750a8a2d3dd708195b0f53 Mon Sep 17 00:00:00 2001
2From: Alex Stewart <alex.stewart@ni.com>
3Date: Wed, 14 Dec 2022 03:05:45 -0600
4Subject: [PATCH] daemon: PATH-expand the sftp backend ssh client
5
6Meson is currently configured to search the gvfs builder's PATH for an
7ssh client, and hardcode its fullpath as the canonical ssh client for
8the gvfs sftp backend.
9
10This setup breaks in cases where the builder has a different ssh client
11from the final runtime root, or where the client's pathes differ.
12Builders using OpenEmbedded or buildroot workspaces are particularly
13affected.
14
15Instead, set SSH_PROGRAM to `ssh` so that it gets PATH-expanded at
16runtime.
17
18Closes: https://gitlab.gnome.org/GNOME/gvfs/-/issues/465
19Signed-off-by: Alex Stewart <alex.stewart@ni.com>
20
21Upstream-Status: Accepted
22* https://gitlab.gnome.org/GNOME/gvfs/-/merge_requests/157
23 * Expect upstream merge in GNOME 44
24
25---
26 daemon/meson.build | 2 +-
27 meson.build | 4 ----
28 2 files changed, 1 insertion(+), 5 deletions(-)
29
30diff --git a/daemon/meson.build b/daemon/meson.build
31index e20ada29..72a16890 100644
32--- a/daemon/meson.build
33+++ b/daemon/meson.build
34@@ -256,7 +256,7 @@ if enable_sftp
35 '-DDEFAULT_BACKEND_TYPE=sftp',
36 '-DBACKEND_TYPES="sftp", G_VFS_TYPE_BACKEND_SFTP,',
37 '-DMAX_JOB_THREADS=1',
38- '-DSSH_PROGRAM="@0@"'.format(ssh.full_path()),
39+ '-DSSH_PROGRAM="ssh"',
40 ]
41
42 programs += {'gvfsd-sftp': {'sources': sources, 'dependencies': deps, 'c_args': cflags}}
43diff --git a/meson.build b/meson.build
44index 7fd67427..a84c0104 100644
45--- a/meson.build
46+++ b/meson.build
47@@ -457,10 +457,6 @@ endif
48
49 # *** SFTP backend ***
50 enable_sftp = get_option('sftp')
51-if enable_sftp
52- ssh = find_program('ssh', required: false)
53- assert(ssh.found(), 'SFTP backend requested but a ssh client is required')
54-endif
55
56 # *** Enable development utils ***
57 enable_devel_utils = get_option('devel_utils')
58--
592.38.1
60