diff options
| author | Matthias Clasen <mclasen@redhat.com> | 2019-01-20 13:18:26 -0500 |
|---|---|---|
| committer | Atomic Bot <atomic-devel@projectatomic.io> | 2019-01-21 09:17:29 +0000 |
| commit | ae1dc979df67229f8e10f4add05815f81b2bb91a (patch) | |
| tree | d6947796bc26b6485d250b53b29db910fff08d9e | |
| parent | 39152a6d4095af8ba3e075e1b464633b04f909c8 (diff) | |
| download | flatpak-ae1dc979df67229f8e10f4add05815f81b2bb91a.tar.gz | |
Make tests work
We can't look at the FLATPAK_VALIDATE_ICON environment variable
inside the sandbox. Use /proc/self/exe to find the binary to reexec.
Closes: #2618
Approved by: alexlarsson
| -rw-r--r-- | icon-validator/validate-icon.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/icon-validator/validate-icon.c b/icon-validator/validate-icon.c index 4902b56b..2646018f 100644 --- a/icon-validator/validate-icon.c +++ b/icon-validator/validate-icon.c @@ -20,6 +20,7 @@ #include <gdk-pixbuf/gdk-pixbuf.h> #include <glib/gstdio.h> +#include <unistd.h> static int validate_icon (const char *arg_width, @@ -131,12 +132,9 @@ rerun_in_sandbox (const char *arg_width, g_autofree char *err = NULL; int status; g_autoptr(GError) error = NULL; - const char *validate_icon; + char validate_icon[256]; - if (g_getenv ("FLATPAK_VALIDATE_ICON")) - validate_icon = g_getenv ("FLATPAK_VALIDATE_ICON"); - else - validate_icon = LIBEXECDIR "/flatpak-validate-icon"; + readlink ("/proc/self/exe", validate_icon, 256); add_args (args, flatpak_get_bwrap (), @@ -145,6 +143,7 @@ rerun_in_sandbox (const char *arg_width, "--unshare-pid", "--ro-bind", "/usr", "/usr", "--ro-bind", "/etc/ld.so.cache", "/etc/ld.so.cache", + "--ro-bind", validate_icon, validate_icon, NULL); /* These directories might be symlinks into /usr/... */ @@ -223,7 +222,6 @@ main (int argc, char *argv[]) GOptionContext *context; GError *error = NULL; - g_print ("%s\n", g_strjoinv (" ", argv)); context = g_option_context_new ("WIDTH HEIGHT PATH"); g_option_context_add_main_entries (context, entries, NULL); if (!g_option_context_parse (context, &argc, &argv, &error)) |
