Pick up the right revokefs-fuse binary

In the normal case, pass the full LIBEXEC path, and in the tests,
pass the path via the env var FLATPAK_REVOKEFS_FUSE.

Closes: #2657
Approved by: alexlarsson
This commit is contained in:
Alexander Larsson
2019-04-03 18:04:38 +02:00
committed by Atomic Bot
parent cd53f71f9e
commit 42e42ddc86
5 changed files with 13 additions and 3 deletions

View File

@@ -141,6 +141,7 @@ libflatpak_common_la_CFLAGS = \
$(INTERNAL_GPGME_CFLAGS) \
$(SYSTEMD_CFLAGS) \
$(DCONF_CFLAGS) \
-DLIBEXECDIR=\"$(libexecdir)\" \
-I$(srcdir)/dbus-proxy \
$(NULL)
libflatpak_common_la_LIBADD = $(AM_LIBADD) libglnx.la $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(JSON_LIBS) $(XAUTH_LIBS) $(LIBSECCOMP_LIBS) $(INTERNAL_GPGME_LIBS) $(SYSTEMD_LIBS) $(DCONF_LIBS)

View File

@@ -7842,6 +7842,10 @@ flatpak_dir_setup_revokefs_fuse_mount (FlatpakDir *self,
g_autofree gchar *mnt_dir_tmp = NULL;
gint socket = -1;
gboolean res = FALSE;
const char *revokefs_fuse_bin = LIBEXECDIR "/revokefs-fuse";
if (g_getenv ("FLATPAK_REVOKEFS_FUSE"))
revokefs_fuse_bin = g_getenv ("FLATPAK_REVOKEFS_FUSE");
if (!flatpak_dir_system_helper_call_get_revokefs_fd (self,
FLATPAK_HELPER_GET_REVOKEFS_FD_FLAGS_NONE,
@@ -7877,7 +7881,7 @@ flatpak_dir_setup_revokefs_fuse_mount (FlatpakDir *self,
g_subprocess_launcher_take_fd (launcher, socket, 3);
revokefs_fuse = g_subprocess_launcher_spawn (launcher,
&local_error,
"revokefs-fuse", "-o", client_uid, "--socket=3",
revokefs_fuse_bin, "-o", client_uid, "--socket=3",
src_dir_tmp, mnt_dir_tmp, NULL);
if (revokefs_fuse == NULL ||
!g_subprocess_wait_check (revokefs_fuse, NULL, &local_error))

View File

@@ -19,7 +19,7 @@ flatpak_system_helper_SOURCES = \
$(NULL)
flatpak_system_helper_LDADD = $(BASE_LIBS) $(OSTREE_LIBS) $(JSON_LIBS) $(POLKIT_LIBS) libflatpak-common.la
flatpak_system_helper_CFLAGS = $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(APPSTREAM_GLIB_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(POLKIT_CFLAGS) -DFLATPAK_COMPILATION
flatpak_system_helper_CFLAGS = $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(APPSTREAM_GLIB_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(POLKIT_CFLAGS) -DFLATPAK_COMPILATION -DLIBEXECDIR=\"$(libexecdir)\"
system-helper/org.freedesktop.Flatpak.rules: system-helper/org.freedesktop.Flatpak.rules.in
$(AM_V_GEN) $(SED) -e "s|\@privileged_group\@|$(PRIVILEGED_GROUP)|" $< > $@

View File

@@ -1501,6 +1501,7 @@ ongoing_pull_new (FlatpakSystemHelper *object,
g_autoptr(OngoingPull) pull = NULL;
g_autoptr(GSubprocessLauncher) launcher = NULL;
int sockets[2], exit_sockets[2];
const char *revokefs_fuse_bin = LIBEXECDIR "/revokefs-fuse";
pull = g_slice_new0 (OngoingPull);
pull->object = object;
@@ -1541,9 +1542,12 @@ ongoing_pull_new (FlatpakSystemHelper *object,
g_subprocess_launcher_take_fd (launcher, exit_sockets[0], 4);
pull->backend_exit_socket = exit_sockets[1];
if (g_getenv ("FLATPAK_REVOKEFS_FUSE"))
revokefs_fuse_bin = g_getenv ("FLATPAK_REVOKEFS_FUSE");
pull->revokefs_backend = g_subprocess_launcher_spawn (launcher,
error,
"revokefs-fuse",
revokefs_fuse_bin,
"--backend",
"--socket=3",
"--exit-with-fd=4",

View File

@@ -2,6 +2,7 @@ AM_TESTS_ENVIRONMENT = FLATPAK_TESTS_DEBUG=1 \
FLATPAK_CONFIG_DIR=/dev/null \
FLATPAK_TRIGGERSDIR=$$(cd $(top_srcdir) && pwd)/triggers \
FLATPAK_VALIDATE_ICON=$$(cd $(top_builddir) && pwd)/flatpak-validate-icon \
FLATPAK_REVOKEFS_FUSE=$$(cd $(top_builddir) && pwd)/revokefs-fuse \
FLATPAK_DBUSPROXY=$$(cd $(top_builddir) && pwd)/flatpak-dbus-proxy \
GI_TYPELIB_PATH=$$(cd $(top_builddir) && pwd)$${GI_TYPELIB_PATH:+:$$GI_TYPELIB_PATH} \
LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && pwd)$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \