From b88695698ce8406f38a069f0d02d8f306958d49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ertu=C4=9Frul=20Erata?= Date: Sat, 26 May 2018 01:20:31 +0300 Subject: [PATCH 1/2] flatpak update --- .../files/libglnx_submodule.patch | 1600 +++++++++++------ .../virtualization/flatpak-builder/pspec.xml | 19 +- hardware/virtualization/flatpak/actions.py | 1 + .../files/bubblewrap_libglnx_submodule.patch | 851 ++++----- hardware/virtualization/flatpak/pspec.xml | 11 +- hardware/virtualization/ostree/actions.py | 1 + .../files/bsdiff_libglnx_submodule.patch | 323 ++-- hardware/virtualization/ostree/pspec.xml | 9 +- 8 files changed, 1653 insertions(+), 1162 deletions(-) diff --git a/hardware/virtualization/flatpak-builder/files/libglnx_submodule.patch b/hardware/virtualization/flatpak-builder/files/libglnx_submodule.patch index 0cb68a075f..094a7d35ca 100644 --- a/hardware/virtualization/flatpak-builder/files/libglnx_submodule.patch +++ b/hardware/virtualization/flatpak-builder/files/libglnx_submodule.patch @@ -1,6 +1,6 @@ -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/COPYING flatpak-builder-0.10.6/libglnx/COPYING ---- flatpak-builder-0.10.6.orig/libglnx/COPYING 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/COPYING 2018-02-11 12:03:43.448373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/COPYING flatpak-builder-0.10.10/libglnx/COPYING +--- flatpak-builder-0.10.10.orig/libglnx/COPYING 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/COPYING 2018-02-11 12:03:43.448373307 +0300 @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 @@ -504,14 +504,14 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/COPYING flatpak-builder-0.10.6/li + Ty Coon, President of Vice + +That's all there is to it! -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/.git flatpak-builder-0.10.6/libglnx/.git ---- flatpak-builder-0.10.6.orig/libglnx/.git 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/.git 2018-02-11 12:03:43.426373306 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/.git flatpak-builder-0.10.10/libglnx/.git +--- flatpak-builder-0.10.10.orig/libglnx/.git 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/.git 2018-02-11 12:03:43.426373306 +0300 @@ -0,0 +1 @@ +gitdir: ../.git/modules/libglnx -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/.gitignore flatpak-builder-0.10.6/libglnx/.gitignore ---- flatpak-builder-0.10.6.orig/libglnx/.gitignore 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/.gitignore 2018-02-11 12:03:43.447373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/.gitignore flatpak-builder-0.10.10/libglnx/.gitignore +--- flatpak-builder-0.10.10.orig/libglnx/.gitignore 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/.gitignore 2018-02-11 12:03:43.447373307 +0300 @@ -0,0 +1,16 @@ +# A path ostree writes to work around automake bug with +# subdir-objects @@ -529,9 +529,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/.gitignore flatpak-builder-0.10.6 +*.stamp +*~ + -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-backport-autocleanups.h flatpak-builder-0.10.6/libglnx/glnx-backport-autocleanups.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-backport-autocleanups.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-backport-autocleanups.h 2018-02-11 12:03:43.448373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-backport-autocleanups.h flatpak-builder-0.10.10/libglnx/glnx-backport-autocleanups.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-backport-autocleanups.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-backport-autocleanups.h 2018-02-11 12:03:43.448373307 +0300 @@ -0,0 +1,124 @@ +/* + * Copyright © 2015 Canonical Limited @@ -657,9 +657,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-backport-autocleanups.h flat +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GString, g_autoptr_cleanup_gstring_free) + +#endif -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-backport-autoptr.h flatpak-builder-0.10.6/libglnx/glnx-backport-autoptr.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-backport-autoptr.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-backport-autoptr.h 2018-02-11 12:03:43.448373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-backport-autoptr.h flatpak-builder-0.10.10/libglnx/glnx-backport-autoptr.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-backport-autoptr.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-backport-autoptr.h 2018-02-11 12:03:43.448373307 +0300 @@ -0,0 +1,133 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -794,9 +794,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-backport-autoptr.h flatpak-b +#endif /* !GLIB_CHECK_VERSION(2, 43, 3) */ + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-backports.c flatpak-builder-0.10.6/libglnx/glnx-backports.c ---- flatpak-builder-0.10.6.orig/libglnx/glnx-backports.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-backports.c 2018-02-11 12:03:43.448373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-backports.c flatpak-builder-0.10.10/libglnx/glnx-backports.c +--- flatpak-builder-0.10.10.orig/libglnx/glnx-backports.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-backports.c 2018-02-11 12:03:43.448373307 +0300 @@ -0,0 +1,61 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -859,9 +859,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-backports.c flatpak-builder- + return TRUE; +} +#endif -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-backports.h flatpak-builder-0.10.6/libglnx/glnx-backports.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-backports.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-backports.h 2018-02-11 12:03:43.448373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-backports.h flatpak-builder-0.10.10/libglnx/glnx-backports.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-backports.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-backports.h 2018-02-11 12:03:43.448373307 +0300 @@ -0,0 +1,46 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -909,10 +909,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-backports.h flatpak-builder- +#endif /* !GLIB_CHECK_VERSION(2, 44, 0) */ + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.c flatpak-builder-0.10.6/libglnx/glnx-console.c ---- flatpak-builder-0.10.6.orig/libglnx/glnx-console.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-console.c 2018-02-11 12:03:43.448373307 +0300 -@@ -0,0 +1,309 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-console.c flatpak-builder-0.10.10/libglnx/glnx-console.c +--- flatpak-builder-0.10.10.orig/libglnx/glnx-console.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-console.c 2018-05-26 01:11:39.785067515 +0300 +@@ -0,0 +1,359 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2013,2014,2015 Colin Walters @@ -944,12 +944,25 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.c flatpak-builder-0. +#include +#include + -+static char *current_text = NULL; -+static gint current_percent = -1; -+static gboolean locked; ++/* For people with widescreen monitors and maximized terminals, it looks pretty ++ * bad to have an enormous progress bar. For much the same reason as web pages ++ * tend to have a maximum width; ++ * https://ux.stackexchange.com/questions/48982/suggest-good-max-width-for-fluid-width-design ++ */ ++#define MAX_PROGRESSBAR_COLUMNS 20 + -+static gboolean -+stdout_is_tty (void) ++/* Max updates output per second. On a tty there's no point to rendering ++ * extremely fast; and for a non-tty we're probably in a Jenkins job ++ * or whatever and having percentages spam multiple lines there is annoying. ++ */ ++#define MAX_TTY_UPDATE_HZ (5) ++#define MAX_NONTTY_UPDATE_HZ (1) ++ ++static gboolean locked; ++static guint64 last_update_ms; /* monotonic time in millis we last updated */ ++ ++gboolean ++glnx_stdout_is_tty (void) +{ + static gsize initialized = 0; + static gboolean stdout_is_tty_v; @@ -1058,12 +1071,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.c flatpak-builder-0. + g_return_if_fail (!locked); + g_return_if_fail (!console->locked); + -+ console->is_tty = stdout_is_tty (); ++ console->is_tty = glnx_stdout_is_tty (); + + locked = console->locked = TRUE; + -+ current_percent = 0; -+ + if (console->is_tty) + { + if (g_once_init_enter (&sigwinch_initialized)) @@ -1096,6 +1107,26 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.c flatpak-builder-0. +text_percent_internal (const char *text, + int percentage) +{ ++ /* Check whether we're trying to render too fast; unless percentage is 100, in ++ * which case we assume this is the last call, so we always render it. ++ */ ++ const guint64 current_ms = g_get_monotonic_time () / 1000; ++ if (percentage != 100) ++ { ++ const guint64 diff_ms = current_ms - last_update_ms; ++ if (glnx_stdout_is_tty ()) ++ { ++ if (diff_ms < (1000/MAX_TTY_UPDATE_HZ)) ++ return; ++ } ++ else ++ { ++ if (diff_ms < (1000/MAX_NONTTY_UPDATE_HZ)) ++ return; ++ } ++ } ++ last_update_ms = current_ms; ++ + static const char equals[] = "===================="; + const guint n_equals = sizeof (equals) - 1; + static const char spaces[] = " "; @@ -1108,11 +1139,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.c flatpak-builder-0. + + const guint input_textlen = text ? strlen (text) : 0; + -+ if (percentage == current_percent -+ && g_strcmp0 (text, current_text) == 0) -+ return; -+ -+ if (!stdout_is_tty ()) ++ if (!glnx_stdout_is_tty ()) + { + if (text) + fprintf (stdout, "%s", text); @@ -1147,7 +1174,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.c flatpak-builder-0. + else + { + const guint textlen = MIN (input_textlen, ncolumns - bar_min); -+ const guint barlen = ncolumns - (textlen + 1);; ++ const guint barlen = MIN (MAX_PROGRESSBAR_COLUMNS, ncolumns - (textlen + 1)); + + if (textlen > 0) + { @@ -1160,7 +1187,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.c flatpak-builder-0. + const guint textpercent_len = 5; + const guint bar_internal_len = barlen - nbraces - textpercent_len; + const guint eqlen = bar_internal_len * (percentage / 100.0); -+ const guint spacelen = bar_internal_len - eqlen; ++ const guint spacelen = bar_internal_len - eqlen; + + fputc ('[', stdout); + printpad (equals, n_equals, eqlen); @@ -1195,6 +1222,32 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.c flatpak-builder-0. + text_percent_internal (text, percentage); +} + ++/** ++ * glnx_console_progress_n_items: ++ * @text: Show this text before the progress bar ++ * @current: An integer for how many items have been processed ++ * @total: An integer for how many items there are total ++ * ++ * On a tty, print to the console @text followed by [@current/@total], ++ * then an ASCII art progress bar, like glnx_console_progress_text_percent(). ++ * ++ * You must have called glnx_console_lock() before invoking this ++ * function. ++ */ ++void ++glnx_console_progress_n_items (const char *text, ++ guint current, ++ guint total) ++{ ++ g_return_if_fail (current <= total); ++ g_return_if_fail (total > 0); ++ ++ g_autofree char *newtext = g_strdup_printf ("%s (%u/%u)", text, current, total); ++ /* Special case current == total to ensure we end at 100% */ ++ int percentage = (current == total) ? 100 : (((double)current) / total * 100); ++ glnx_console_progress_text_percent (newtext, percentage); ++} ++ +void +glnx_console_text (const char *text) +{ @@ -1214,18 +1267,15 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.c flatpak-builder-0. + g_return_if_fail (locked); + g_return_if_fail (console->locked); + -+ current_percent = -1; -+ g_clear_pointer (¤t_text, g_free); -+ + if (console->is_tty) + fputc ('\n', stdout); + + locked = console->locked = FALSE; +} -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.h flatpak-builder-0.10.6/libglnx/glnx-console.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-console.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-console.h 2018-02-11 12:03:43.448373307 +0300 -@@ -0,0 +1,55 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-console.h flatpak-builder-0.10.10/libglnx/glnx-console.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-console.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-console.h 2018-05-26 01:11:39.785067515 +0300 +@@ -0,0 +1,61 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2013,2014,2015 Colin Walters @@ -1259,12 +1309,18 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.h flatpak-builder-0. + +typedef struct GLnxConsoleRef GLnxConsoleRef; + ++gboolean glnx_stdout_is_tty (void); ++ +void glnx_console_lock (GLnxConsoleRef *ref); + +void glnx_console_text (const char *text); + +void glnx_console_progress_text_percent (const char *text, -+ guint percentage); ++ guint percentage); ++ ++void glnx_console_progress_n_items (const char *text, ++ guint current, ++ guint total); + +void glnx_console_unlock (GLnxConsoleRef *ref); + @@ -1281,10 +1337,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-console.h flatpak-builder-0. +G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxConsoleRef, glnx_console_ref_cleanup) + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.c flatpak-builder-0.10.6/libglnx/glnx-dirfd.c ---- flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-dirfd.c 2018-02-11 12:03:43.448373307 +0300 -@@ -0,0 +1,390 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-dirfd.c flatpak-builder-0.10.10/libglnx/glnx-dirfd.c +--- flatpak-builder-0.10.10.orig/libglnx/glnx-dirfd.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-dirfd.c 2018-05-26 01:11:39.785067515 +0300 +@@ -0,0 +1,425 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -1310,8 +1366,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.c flatpak-builder-0.10 +#include + +#include ++#include +#include +#include ++#include + +/** + * glnx_opendirat_with_errno: @@ -1384,7 +1442,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.c flatpak-builder-0.10 + GLnxDirFdIterator *out_dfd_iter, + GError **error) +{ -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + if (!glnx_opendirat (dfd, path, follow, &fd, error)) + return FALSE; + @@ -1475,23 +1533,20 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.c flatpak-builder-0.10 + GCancellable *cancellable, + GError **error) +{ -+ struct dirent *ret_dent; -+ + g_return_val_if_fail (out_dent, FALSE); + + if (!glnx_dirfd_iterator_next_dent (dfd_iter, out_dent, cancellable, error)) + return FALSE; + -+ ret_dent = *out_dent; -+ ++ struct dirent *ret_dent = *out_dent; + if (ret_dent) + { + + if (ret_dent->d_type == DT_UNKNOWN) + { + struct stat stbuf; -+ if (TEMP_FAILURE_RETRY (fstatat (dfd_iter->fd, ret_dent->d_name, &stbuf, AT_SYMLINK_NOFOLLOW)) != 0) -+ return glnx_throw_errno (error); ++ if (!glnx_fstatat (dfd_iter->fd, ret_dent->d_name, &stbuf, AT_SYMLINK_NOFOLLOW, error)) ++ return FALSE; + ret_dent->d_type = IFTODT (stbuf.st_mode); + } + } @@ -1550,47 +1605,52 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.c flatpak-builder-0.10 +void +glnx_gen_temp_name (gchar *tmpl) +{ -+ size_t len; -+ char *XXXXXX; -+ int i; ++ g_return_if_fail (tmpl != NULL); ++ const size_t len = strlen (tmpl); ++ g_return_if_fail (len >= 6); ++ + static const char letters[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + static const int NLETTERS = sizeof (letters) - 1; + -+ g_return_if_fail (tmpl != NULL); -+ len = strlen (tmpl); -+ g_return_if_fail (len >= 6); -+ -+ XXXXXX = tmpl + (len - 6); -+ -+ for (i = 0; i < 6; i++) ++ char *XXXXXX = tmpl + (len - 6); ++ for (int i = 0; i < 6; i++) + XXXXXX[i] = letters[g_random_int_range(0, NLETTERS)]; +} + +/** + * glnx_mkdtempat: + * @dfd: Directory fd -+ * @tmpl: (type filename): template directory name, last 6 characters will be replaced -+ * @mode: permissions to create the temporary directory with ++ * @tmpl: (type filename): Initial template directory name, last 6 characters will be replaced ++ * @mode: permissions with which to create the temporary directory ++ * @out_tmpdir: (out caller-allocates): Initialized tempdir structure + * @error: Error + * -+ * Similar to g_mkdtemp_full, but using openat. ++ * Somewhat similar to g_mkdtemp_full(), but fd-relative, and returns a ++ * structure that uses autocleanups. Note that the supplied @dfd lifetime ++ * must match or exceed that of @out_tmpdir in order to remove the directory. + */ +gboolean -+glnx_mkdtempat (int dfd, -+ gchar *tmpl, -+ int mode, -+ GError **error) ++glnx_mkdtempat (int dfd, const char *tmpl, int mode, ++ GLnxTmpDir *out_tmpdir, GError **error) +{ -+ int count; ++ g_return_val_if_fail (tmpl != NULL, FALSE); ++ g_return_val_if_fail (out_tmpdir != NULL, FALSE); ++ g_return_val_if_fail (!out_tmpdir->initialized, FALSE); + -+ g_return_val_if_fail (tmpl != NULL, -1); ++ dfd = glnx_dirfd_canonicalize (dfd); + -+ for (count = 0; count < 100; count++) ++ g_autofree char *path = g_strdup (tmpl); ++ for (int count = 0; count < 100; count++) + { -+ glnx_gen_temp_name (tmpl); ++ glnx_gen_temp_name (path); + -+ if (mkdirat (dfd, tmpl, mode) == -1) ++ /* Ideally we could use openat(O_DIRECTORY | O_CREAT | O_EXCL) here ++ * to create and open the directory atomically, but that’s not supported by ++ * current kernel versions: http://www.openwall.com/lists/oss-security/2014/11/26/14 ++ * (Tested on kernel 4.10.10-200.fc25.x86_64). For the moment, accept a ++ * TOCTTOU race here. */ ++ if (mkdirat (dfd, path, mode) == -1) + { + if (errno == EEXIST) + continue; @@ -1601,84 +1661,115 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.c flatpak-builder-0.10 + return glnx_throw_errno_prefix (error, "mkdirat"); + } + ++ /* And open it */ ++ glnx_autofd int ret_dfd = -1; ++ if (!glnx_opendirat (dfd, path, FALSE, &ret_dfd, error)) ++ { ++ /* If we fail to open, let's try to clean up */ ++ (void)unlinkat (dfd, path, AT_REMOVEDIR); ++ return FALSE; ++ } ++ ++ /* Return the initialized directory struct */ ++ out_tmpdir->initialized = TRUE; ++ out_tmpdir->src_dfd = dfd; /* referenced; see above docs */ ++ out_tmpdir->fd = glnx_steal_fd (&ret_dfd); ++ out_tmpdir->path = g_steal_pointer (&path); + return TRUE; + } + ++ /* Failure */ + g_set_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS, -+ "mkstempat ran out of combinations to try."); ++ "glnx_mkdtempat ran out of combinations to try"); + return FALSE; +} + +/** -+ * glnx_mkdtempat_open: -+ * @dfd: Directory FD -+ * @tmpl: (type filename): template directory name, last 6 characters will be replaced ++ * glnx_mkdtemp: ++ * @tmpl: (type filename): Source template directory name, last 6 characters will be replaced + * @mode: permissions to create the temporary directory with -+ * @out_dfd: (out caller-allocates): Return location for an FD for the new -+ * temporary directory, or `-1` on error ++ * @out_tmpdir: (out caller-allocates): Return location for tmpdir data + * @error: Return location for a #GError, or %NULL + * -+ * Similar to glnx_mkdtempat(), except it will open the resulting temporary -+ * directory and return a directory FD to it. ++ * Similar to glnx_mkdtempat(), but will use g_get_tmp_dir() as the parent ++ * directory to @tmpl. + * + * Returns: %TRUE on success, %FALSE otherwise + * Since: UNRELEASED + */ +gboolean -+glnx_mkdtempat_open (int dfd, -+ gchar *tmpl, -+ int mode, -+ int *out_dfd, -+ GError **error) ++glnx_mkdtemp (const gchar *tmpl, ++ int mode, ++ GLnxTmpDir *out_tmpdir, ++ GError **error) +{ -+ /* FIXME: Ideally we could use openat(O_DIRECTORY | O_CREAT | O_EXCL) here -+ * to create and open the directory atomically, but that’s not supported by -+ * current kernel versions: http://www.openwall.com/lists/oss-security/2014/11/26/14 -+ * (Tested on kernel 4.10.10-200.fc25.x86_64). For the moment, accept a -+ * TOCTTOU race here. */ -+ *out_dfd = -1; ++ g_autofree char *path = g_build_filename (g_get_tmp_dir (), tmpl, NULL); ++ return glnx_mkdtempat (AT_FDCWD, path, mode, ++ out_tmpdir, error); ++} + -+ if (!glnx_mkdtempat (dfd, tmpl, mode, error)) -+ return FALSE; -+ -+ return glnx_opendirat (dfd, tmpl, FALSE, out_dfd, error); ++static gboolean ++_glnx_tmpdir_free (GLnxTmpDir *tmpd, ++ gboolean delete_dir, ++ GCancellable *cancellable, ++ GError **error) ++{ ++ /* Support being passed NULL so we work nicely in a GPtrArray */ ++ if (!(tmpd && tmpd->initialized)) ++ return TRUE; ++ g_assert_cmpint (tmpd->fd, !=, -1); ++ glnx_close_fd (&tmpd->fd); ++ g_assert (tmpd->path); ++ g_assert_cmpint (tmpd->src_dfd, !=, -1); ++ g_autofree char *path = tmpd->path; /* Take ownership */ ++ tmpd->initialized = FALSE; ++ if (delete_dir) ++ { ++ if (!glnx_shutil_rm_rf_at (tmpd->src_dfd, path, cancellable, error)) ++ return FALSE; ++ } ++ return TRUE; +} + +/** -+ * glnx_mkdtempat_open_in_system: -+ * @tmpl: (type filename): template directory name, last 6 characters will be replaced -+ * @mode: permissions to create the temporary directory with -+ * @out_dfd: (out caller-allocates): Return location for an FD for the new -+ * temporary directory, or `-1` on error -+ * @error: Return location for a #GError, or %NULL ++ * glnx_tmpdir_delete: ++ * @tmpf: Temporary dir ++ * @cancellable: Cancellable ++ * @error: Error + * -+ * Similar to glnx_mkdtempat_open(), except it will use the system temporary -+ * directory (from g_get_tmp_dir()) as the parent directory to @tmpl. ++ * Deallocate a tmpdir, closing the fd and recursively deleting the path. This ++ * is normally called indirectly via glnx_tmpdir_cleanup() by the autocleanup ++ * attribute, but you can also invoke this directly. + * -+ * Returns: %TRUE on success, %FALSE otherwise -+ * Since: UNRELEASED ++ * If an error occurs while deleting the filesystem path, @tmpf will still have ++ * been deallocated and should not be reused. ++ * ++ * See also `glnx_tmpdir_unset` to avoid deleting the path. + */ +gboolean -+glnx_mkdtempat_open_in_system (gchar *tmpl, -+ int mode, -+ int *out_dfd, -+ GError **error) ++glnx_tmpdir_delete (GLnxTmpDir *tmpf, GCancellable *cancellable, GError **error) +{ -+ glnx_fd_close int tmp_dfd = -1; -+ -+ *out_dfd = -1; -+ -+ if (!glnx_opendirat (-1, g_get_tmp_dir (), TRUE, &tmp_dfd, error)) -+ return FALSE; -+ -+ return glnx_mkdtempat_open (tmp_dfd, tmpl, mode, out_dfd, error); ++ return _glnx_tmpdir_free (tmpf, TRUE, cancellable, error); +} + -+ -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.h flatpak-builder-0.10.6/libglnx/glnx-dirfd.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-dirfd.h 2018-02-11 12:03:43.448373307 +0300 -@@ -0,0 +1,132 @@ ++/** ++ * glnx_tmpdir_unset: ++ * @tmpf: Temporary dir ++ * @cancellable: Cancellable ++ * @error: Error ++ * ++ * Deallocate a tmpdir, but do not delete the filesystem path. See also ++ * `glnx_tmpdir_delete()`. ++ */ ++void ++glnx_tmpdir_unset (GLnxTmpDir *tmpf) ++{ ++ (void) _glnx_tmpdir_free (tmpf, FALSE, NULL, NULL); ++} +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-dirfd.h flatpak-builder-0.10.10/libglnx/glnx-dirfd.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-dirfd.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-dirfd.h 2018-05-26 01:11:39.785067515 +0300 +@@ -0,0 +1,137 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -1773,7 +1864,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.h flatpak-builder-0.10 + * @mode: Mode + * @error: Return location for a #GError, or %NULL + * -+ * Wrapper around mkdirat() which ignores adds #GError support, ensures that ++ * Wrapper around mkdirat() which adds #GError support, ensures that + * it retries on %EINTR, and also ignores `EEXIST`. + * + * See also `glnx_shutil_mkdir_p_at()` for recursive handling. @@ -1794,27 +1885,32 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-dirfd.h flatpak-builder-0.10 + return TRUE; +} + -+gboolean glnx_mkdtempat (int dfd, -+ gchar *tmpl, -+ int mode, -+ GError **error); ++typedef struct { ++ gboolean initialized; ++ int src_dfd; ++ int fd; ++ char *path; ++} GLnxTmpDir; ++gboolean glnx_tmpdir_delete (GLnxTmpDir *tmpf, GCancellable *cancellable, GError **error); ++void glnx_tmpdir_unset (GLnxTmpDir *tmpf); ++static inline void ++glnx_tmpdir_cleanup (GLnxTmpDir *tmpf) ++{ ++ (void)glnx_tmpdir_delete (tmpf, NULL, NULL); ++} ++G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxTmpDir, glnx_tmpdir_cleanup) + -+gboolean glnx_mkdtempat_open (int dfd, -+ gchar *tmpl, -+ int mode, -+ int *out_dfd, -+ GError **error); ++gboolean glnx_mkdtempat (int dfd, const char *tmpl, int mode, ++ GLnxTmpDir *out_tmpdir, GError **error); + -+gboolean glnx_mkdtempat_open_in_system (gchar *tmpl, -+ int mode, -+ int *out_dfd, -+ GError **error); ++gboolean glnx_mkdtemp (const char *tmpl, int mode, ++ GLnxTmpDir *out_tmpdir, GError **error); + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-errors.c flatpak-builder-0.10.6/libglnx/glnx-errors.c ---- flatpak-builder-0.10.6.orig/libglnx/glnx-errors.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-errors.c 2018-02-11 12:03:43.448373307 +0300 -@@ -0,0 +1,56 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-errors.c flatpak-builder-0.10.10/libglnx/glnx-errors.c +--- flatpak-builder-0.10.10.orig/libglnx/glnx-errors.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-errors.c 2018-05-26 01:11:39.785067515 +0300 +@@ -0,0 +1,131 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -1840,6 +1936,32 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-errors.c flatpak-builder-0.1 +#include +#include + ++/* Set @error with G_IO_ERROR/G_IO_ERROR_FAILED. ++ * ++ * This function returns %FALSE so it can be used conveniently in a single ++ * statement: ++ * ++ * ``` ++ * if (strcmp (foo, "somevalue") != 0) ++ * return glnx_throw (error, "key must be somevalue, not '%s'", foo); ++ * ``` ++ */ ++gboolean ++glnx_throw (GError **error, ++ const char *fmt, ++ ...) ++{ ++ if (error == NULL) ++ return FALSE; ++ ++ va_list args; ++ va_start (args, fmt); ++ GError *new = g_error_new_valist (G_IO_ERROR, G_IO_ERROR_FAILED, fmt, args); ++ va_end (args); ++ g_propagate_error (error, g_steal_pointer (&new)); ++ return FALSE; ++} ++ +void +glnx_real_set_prefix_error_va (GError *error, + const char *format, @@ -1856,6 +1978,30 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-errors.c flatpak-builder-0.1 + error->message = g_string_free (g_steal_pointer (&buf), FALSE); +} + ++/* Prepend to @error's message by `$prefix: ` where `$prefix` is computed via ++ * printf @fmt. Returns %FALSE so it can be used conveniently in a single ++ * statement: ++ * ++ * ``` ++ * if (!function_that_fails (s, error)) ++ * return glnx_throw_prefix (error, "while handling '%s'", s); ++ * ``` ++ * */ ++gboolean ++glnx_prefix_error (GError **error, ++ const char *fmt, ++ ...) ++{ ++ if (error == NULL) ++ return FALSE; ++ ++ va_list args; ++ va_start (args, fmt); ++ glnx_real_set_prefix_error_va (*error, fmt, args); ++ va_end (args); ++ return FALSE; ++} ++ +void +glnx_real_set_prefix_error_from_errno_va (GError **error, + gint errsv, @@ -1871,10 +2017,35 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-errors.c flatpak-builder-0.1 + g_strerror (errsv)); + glnx_real_set_prefix_error_va (*error, format, args); +} -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-errors.h flatpak-builder-0.10.6/libglnx/glnx-errors.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-errors.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-errors.h 2018-02-11 12:03:43.448373307 +0300 -@@ -0,0 +1,197 @@ ++ ++/* Set @error using the value of `$prefix: g_strerror (errno)` where `$prefix` ++ * is computed via printf @fmt. ++ * ++ * This function returns %FALSE so it can be used conveniently in a single ++ * statement: ++ * ++ * ``` ++ * return glnx_throw_errno_prefix (error, "unlinking %s", pathname); ++ * ``` ++ */ ++gboolean ++glnx_throw_errno_prefix (GError **error, ++ const char *fmt, ++ ...) ++{ ++ int errsv = errno; ++ va_list args; ++ va_start (args, fmt); ++ glnx_real_set_prefix_error_from_errno_va (error, errsv, fmt, args); ++ va_end (args); ++ /* See comment in glnx_throw_errno() about preserving errno */ ++ errno = errsv; ++ return FALSE; ++} +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-errors.h flatpak-builder-0.10.10/libglnx/glnx-errors.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-errors.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-errors.h 2018-05-26 01:11:39.785067515 +0300 +@@ -0,0 +1,134 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -1902,29 +2073,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-errors.h flatpak-builder-0.1 + +G_BEGIN_DECLS + -+/* Set @error with G_IO_ERROR/G_IO_ERROR_FAILED. -+ * -+ * This function returns %FALSE so it can be used conveniently in a single -+ * statement: -+ * -+ * ``` -+ * if (strcmp (foo, "somevalue") != 0) -+ * return glnx_throw (error, "key must be somevalue, not '%s'", foo); -+ * ``` -+ */ -+static inline gboolean G_GNUC_PRINTF (2,3) -+glnx_throw (GError **error, const char *fmt, ...) -+{ -+ if (error == NULL) -+ return FALSE; -+ -+ va_list args; -+ va_start (args, fmt); -+ GError *new = g_error_new_valist (G_IO_ERROR, G_IO_ERROR_FAILED, fmt, args); -+ va_end (args); -+ g_propagate_error (error, g_steal_pointer (&new)); -+ return FALSE; -+} ++gboolean glnx_throw (GError **error, const char *fmt, ...) G_GNUC_PRINTF (2,3); + +/* Like `glnx_throw ()`, but returns %NULL. */ +#define glnx_null_throw(error, args...) \ @@ -1935,27 +2084,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-errors.h flatpak-builder-0.1 + const char *format, + va_list args) G_GNUC_PRINTF (2,0); + -+/* Prepend to @error's message by `$prefix: ` where `$prefix` is computed via -+ * printf @fmt. Returns %FALSE so it can be used conveniently in a single -+ * statement: -+ * -+ * ``` -+ * if (!function_that_fails (s, error)) -+ * return glnx_throw_prefix (error, "while handling '%s'", s); -+ * ``` -+ * */ -+static inline gboolean G_GNUC_PRINTF (2,3) -+glnx_prefix_error (GError **error, const char *fmt, ...) -+{ -+ if (error == NULL) -+ return FALSE; -+ -+ va_list args; -+ va_start (args, fmt); -+ glnx_real_set_prefix_error_va (*error, fmt, args); -+ va_end (args); -+ return FALSE; -+} ++gboolean glnx_prefix_error (GError **error, const char *fmt, ...) G_GNUC_PRINTF (2,3); + +/* Like `glnx_prefix_error ()`, but returns %NULL. */ +#define glnx_prefix_error_null(error, args...) \ @@ -2032,28 +2161,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-errors.h flatpak-builder-0.1 + const char *format, + va_list args) G_GNUC_PRINTF (3,0); + -+/* Set @error using the value of `$prefix: g_strerror (errno)` where `$prefix` -+ * is computed via printf @fmt. -+ * -+ * This function returns %FALSE so it can be used conveniently in a single -+ * statement: -+ * -+ * ``` -+ * return glnx_throw_errno_prefix (error, "unlinking %s", pathname); -+ * ``` -+ */ -+static inline gboolean G_GNUC_PRINTF (2,3) -+glnx_throw_errno_prefix (GError **error, const char *fmt, ...) -+{ -+ int errsv = errno; -+ va_list args; -+ va_start (args, fmt); -+ glnx_real_set_prefix_error_from_errno_va (error, errsv, fmt, args); -+ va_end (args); -+ /* See comment above about preserving errno */ -+ errno = errsv; -+ return FALSE; -+} ++gboolean glnx_throw_errno_prefix (GError **error, const char *fmt, ...) G_GNUC_PRINTF (2,3); + +/* Like glnx_throw_errno_prefix(), but yields a NULL pointer. */ +#define glnx_null_throw_errno_prefix(error, args...) \ @@ -2072,10 +2180,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-errors.h flatpak-builder-0.1 + } while (0); + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10.6/libglnx/glnx-fdio.c ---- flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-fdio.c 2018-02-11 12:03:43.449373307 +0300 -@@ -0,0 +1,1111 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-fdio.c flatpak-builder-0.10.10/libglnx/glnx-fdio.c +--- flatpak-builder-0.10.10.orig/libglnx/glnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-fdio.c 2018-05-26 01:11:39.785067515 +0300 +@@ -0,0 +1,1106 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -2190,7 +2298,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + return TRUE; + } + else -+ return glnx_throw_errno (error); ++ return glnx_throw_errno_prefix (error, "renameat"); + } + return TRUE; +} @@ -2219,7 +2327,14 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. +#endif + + /* Fallback */ -+ { const char *old_tmp_name = glnx_strjoina (oldpath, ".XXXXXX"); ++ { char *old_tmp_name_buf = glnx_strjoina (oldpath, ".XXXXXX"); ++ /* This obviously isn't race-free, but doing better gets tricky, since if ++ * we're here the kernel isn't likely to support RENAME_NOREPLACE either. ++ * Anyways, upgrade the kernel. Failing that, avoid use of this function in ++ * shared subdirectories like /tmp. ++ */ ++ glnx_gen_temp_name (old_tmp_name_buf); ++ const char *old_tmp_name = old_tmp_name_buf; + + /* Move old out of the way */ + if (renameat (olddirfd, oldpath, olddirfd, old_tmp_name) < 0) @@ -2246,9 +2361,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + return; + if (!tmpf->initialized) + return; -+ if (tmpf->fd == -1) -+ return; -+ (void) close (tmpf->fd); ++ glnx_close_fd (&tmpf->fd); + /* If ->path is set, we're likely aborting due to an error. Clean it up */ + if (tmpf->path) + { @@ -2258,30 +2371,17 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + tmpf->initialized = FALSE; +} + -+/* Allocate a temporary file, using Linux O_TMPFILE if available. The file mode -+ * will be 0600. -+ * -+ * The result will be stored in @out_tmpf, which is caller allocated -+ * so you can store it on the stack in common scenarios. -+ * -+ * The directory fd @dfd must live at least as long as the output @out_tmpf. -+ */ -+gboolean -+glnx_open_tmpfile_linkable_at (int dfd, -+ const char *subpath, -+ int flags, -+ GLnxTmpfile *out_tmpf, -+ GError **error) ++static gboolean ++open_tmpfile_core (int dfd, const char *subpath, ++ int flags, ++ GLnxTmpfile *out_tmpf, ++ GError **error) +{ ++ /* Picked this to match mkstemp() */ + const guint mode = 0600; -+ glnx_fd_close int fd = -1; -+ int count; + + dfd = glnx_dirfd_canonicalize (dfd); + -+ /* Don't allow O_EXCL, as that has a special meaning for O_TMPFILE */ -+ g_return_val_if_fail ((flags & O_EXCL) == 0, FALSE); -+ + /* Creates a temporary file, that shall be renamed to "target" + * later. If possible, this uses O_TMPFILE – in which case + * "ret_path" will be returned as NULL. If not possible a the @@ -2289,33 +2389,35 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + * link_tmpfile() below to rename the result after writing the file + * in full. */ +#if defined(O_TMPFILE) && !defined(DISABLE_OTMPFILE) && !defined(ENABLE_WRPSEUDO_COMPAT) -+ fd = openat (dfd, subpath, O_TMPFILE|flags, mode); -+ if (fd == -1 && !(G_IN_SET(errno, ENOSYS, EISDIR, EOPNOTSUPP))) -+ return glnx_throw_errno_prefix (error, "open(O_TMPFILE)"); -+ if (fd != -1) -+ { -+ /* Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=17523 -+ * See also https://github.com/ostreedev/ostree/issues/991 -+ */ -+ if (fchmod (fd, mode) < 0) -+ return glnx_throw_errno_prefix (error, "fchmod"); -+ out_tmpf->initialized = TRUE; -+ out_tmpf->src_dfd = dfd; /* Copied; caller must keep open */ -+ out_tmpf->fd = glnx_steal_fd (&fd); -+ out_tmpf->path = NULL; -+ return TRUE; -+ } ++ { ++ glnx_autofd int fd = openat (dfd, subpath, O_TMPFILE|flags, mode); ++ if (fd == -1 && !(G_IN_SET(errno, ENOSYS, EISDIR, EOPNOTSUPP))) ++ return glnx_throw_errno_prefix (error, "open(O_TMPFILE)"); ++ if (fd != -1) ++ { ++ /* Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=17523 ++ * See also https://github.com/ostreedev/ostree/issues/991 ++ */ ++ if (fchmod (fd, mode) < 0) ++ return glnx_throw_errno_prefix (error, "fchmod"); ++ out_tmpf->initialized = TRUE; ++ out_tmpf->src_dfd = dfd; /* Copied; caller must keep open */ ++ out_tmpf->fd = glnx_steal_fd (&fd); ++ out_tmpf->path = NULL; ++ return TRUE; ++ } ++ } + /* Fallthrough */ +#endif + ++ const guint count_max = 100; + { g_autofree char *tmp = g_strconcat (subpath, "/tmp.XXXXXX", NULL); -+ const guint count_max = 100; + -+ for (count = 0; count < count_max; count++) ++ for (int count = 0; count < count_max; count++) + { + glnx_gen_temp_name (tmp); + -+ fd = openat (dfd, tmp, O_CREAT|O_EXCL|O_NOFOLLOW|O_NOCTTY|flags, mode); ++ glnx_autofd int fd = openat (dfd, tmp, O_CREAT|O_EXCL|O_NOFOLLOW|O_NOCTTY|flags, mode); + if (fd < 0) + { + if (errno == EEXIST) @@ -2334,10 +2436,33 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + } + } + g_set_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS, -+ "Exhausted %u attempts to create temporary file", count); ++ "Exhausted %u attempts to create temporary file", count_max); + return FALSE; +} + ++/* Allocate a temporary file, using Linux O_TMPFILE if available. The file mode ++ * will be 0600. ++ * ++ * The result will be stored in @out_tmpf, which is caller allocated ++ * so you can store it on the stack in common scenarios. ++ * ++ * The directory fd @dfd must live at least as long as the output @out_tmpf. ++ */ ++gboolean ++glnx_open_tmpfile_linkable_at (int dfd, ++ const char *subpath, ++ int flags, ++ GLnxTmpfile *out_tmpf, ++ GError **error) ++{ ++ /* Don't allow O_EXCL, as that has a special meaning for O_TMPFILE; ++ * it's used for glnx_open_anonymous_tmpfile(). ++ */ ++ g_return_val_if_fail ((flags & O_EXCL) == 0, FALSE); ++ ++ return open_tmpfile_core (dfd, subpath, flags, out_tmpf, error); ++} ++ +/* A variant of `glnx_open_tmpfile_linkable_at()` which doesn't support linking. + * Useful for true temporary storage. The fd will be allocated in /var/tmp to + * ensure maximum storage space. @@ -2347,7 +2472,8 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + GLnxTmpfile *out_tmpf, + GError **error) +{ -+ if (!glnx_open_tmpfile_linkable_at (AT_FDCWD, "/var/tmp", flags, out_tmpf, error)) ++ /* Add in O_EXCL */ ++ if (!open_tmpfile_core (AT_FDCWD, "/var/tmp", flags | O_EXCL, out_tmpf, error)) + return FALSE; + if (out_tmpf->path) + { @@ -2420,9 +2546,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + char *dnbuf = strdupa (target); + const char *dn = dirname (dnbuf); + char *tmpname_buf = glnx_strjoina (dn, "/tmp.XXXXXX"); -+ guint count; -+ const guint count_max = 100; + ++ const guint count_max = 100; ++ guint count; + for (count = 0; count < count_max; count++) + { + glnx_gen_temp_name (tmpname_buf); @@ -2506,8 +2632,8 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + const guint maxreadlen = 4096; + + struct stat stbuf; -+ if (TEMP_FAILURE_RETRY (fstat (fd, &stbuf)) < 0) -+ return glnx_null_throw_errno (error); ++ if (!glnx_fstat (fd, &stbuf, error)) ++ return FALSE; + + gsize buf_allocated; + if (S_ISREG (stbuf.st_mode) && stbuf.st_size > 0) @@ -2633,7 +2759,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. +{ + dfd = glnx_dirfd_canonicalize (dfd); + -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + if (!glnx_openat_rdonly (dfd, subpath, TRUE, &fd, error)) + return NULL; + @@ -2663,19 +2789,15 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + GCancellable *cancellable, + GError **error) +{ -+ size_t l = 100; -+ + dfd = glnx_dirfd_canonicalize (dfd); + ++ size_t l = 100; + for (;;) + { -+ g_autofree char *c = NULL; -+ ssize_t n; -+ -+ c = g_malloc (l); -+ n = TEMP_FAILURE_RETRY (readlinkat (dfd, subpath, c, l-1)); ++ g_autofree char *c = g_malloc (l); ++ ssize_t n = TEMP_FAILURE_RETRY (readlinkat (dfd, subpath, c, l-1)); + if (n < 0) -+ return glnx_null_throw_errno (error); ++ return glnx_null_throw_errno_prefix (error, "readlinkat"); + + if ((size_t) n < l-1) + { @@ -2722,7 +2844,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + if (TEMP_FAILURE_RETRY (fchownat (dest_dfd, dest_subpath, + src_stbuf->st_uid, src_stbuf->st_gid, + AT_SYMLINK_NOFOLLOW)) != 0) -+ return glnx_throw_errno (error); ++ return glnx_throw_errno_prefix (error, "fchownat"); + + return TRUE; +} @@ -2743,18 +2865,15 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. +int +glnx_loop_write(int fd, const void *buf, size_t nbytes) +{ -+ const uint8_t *p = buf; -+ -+ g_return_val_if_fail(fd >= 0, -1); -+ g_return_val_if_fail(buf, -1); ++ g_return_val_if_fail (fd >= 0, -1); ++ g_return_val_if_fail (buf, -1); + + errno = 0; + ++ const uint8_t *p = buf; + while (nbytes > 0) + { -+ ssize_t k; -+ -+ k = write(fd, p, nbytes); ++ ssize_t k = write(fd, p, nbytes); + if (k < 0) + { + if (errno == EINTR) @@ -2930,17 +3049,22 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + * glnx_file_copy_at: + * @src_dfd: Source directory fd + * @src_subpath: Subpath relative to @src_dfd ++ * @src_stbuf: (allow-none): Optional stat buffer for source; if a stat() has already been done + * @dest_dfd: Target directory fd + * @dest_subpath: Destination name + * @copyflags: Flags + * @cancellable: cancellable + * @error: Error + * -+ * Perform a full copy of the regular file or -+ * symbolic link from @src_subpath to @dest_subpath. ++ * Perform a full copy of the regular file or symbolic link from @src_subpath to ++ * @dest_subpath; if @src_subpath is anything other than a regular file or ++ * symbolic link, an error will be returned. + * -+ * If @src_subpath is anything other than a regular -+ * file or symbolic link, an error will be returned. ++ * If the source is a regular file and the destination exists as a symbolic ++ * link, the symbolic link will not be followed; rather the link itself will be ++ * replaced. Related to this: for regular files, when `GLNX_FILE_COPY_OVERWRITE` ++ * is specified, this function always uses `O_TMPFILE` (if available) and does a ++ * rename-into-place rather than `open(O_TRUNC)`. + */ +gboolean +glnx_file_copy_at (int src_dfd, @@ -2952,31 +3076,23 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + GCancellable *cancellable, + GError **error) +{ -+ gboolean ret = FALSE; -+ int r; -+ int dest_open_flags; -+ struct timespec ts[2]; -+ glnx_fd_close int src_fd = -1; -+ glnx_fd_close int dest_fd = -1; -+ struct stat local_stbuf; -+ -+ if (g_cancellable_set_error_if_cancelled (cancellable, error)) -+ goto out; -+ ++ /* Canonicalize dfds */ + src_dfd = glnx_dirfd_canonicalize (src_dfd); + dest_dfd = glnx_dirfd_canonicalize (dest_dfd); + ++ if (g_cancellable_set_error_if_cancelled (cancellable, error)) ++ return FALSE; ++ + /* Automatically do stat() if no stat buffer was supplied */ ++ struct stat local_stbuf; + if (!src_stbuf) + { -+ if (fstatat (src_dfd, src_subpath, &local_stbuf, AT_SYMLINK_NOFOLLOW) != 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } ++ if (!glnx_fstatat (src_dfd, src_subpath, &local_stbuf, AT_SYMLINK_NOFOLLOW, error)) ++ return FALSE; + src_stbuf = &local_stbuf; + } + ++ /* For symlinks, defer entirely to copy_symlink_at() */ + if (S_ISLNK (src_stbuf->st_mode)) + { + return copy_symlink_at (src_dfd, src_subpath, src_stbuf, @@ -2988,47 +3104,31 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + "Cannot copy non-regular/non-symlink file: %s", src_subpath); -+ goto out; ++ return FALSE; + } + ++ /* Regular file path below here */ ++ ++ glnx_autofd int src_fd = -1; + if (!glnx_openat_rdonly (src_dfd, src_subpath, FALSE, &src_fd, error)) -+ goto out; ++ return FALSE; + -+ dest_open_flags = O_WRONLY | O_CREAT | O_CLOEXEC | O_NOCTTY; -+ if (!(copyflags & GLNX_FILE_COPY_OVERWRITE)) -+ dest_open_flags |= O_EXCL; -+ else -+ dest_open_flags |= O_TRUNC; ++ /* Open a tmpfile for dest. Particularly for AT_FDCWD calls, we really want to ++ * open in the target directory, otherwise we may not be able to link. ++ */ ++ g_auto(GLnxTmpfile) tmp_dest = { 0, }; ++ { char *dnbuf = strdupa (dest_subpath); ++ const char *dn = dirname (dnbuf); ++ if (!glnx_open_tmpfile_linkable_at (dest_dfd, dn, O_WRONLY | O_CLOEXEC, ++ &tmp_dest, error)) ++ return FALSE; ++ } + -+ dest_fd = TEMP_FAILURE_RETRY (openat (dest_dfd, dest_subpath, dest_open_flags, src_stbuf->st_mode)); -+ if (dest_fd == -1) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } ++ if (glnx_regfile_copy_bytes (src_fd, tmp_dest.fd, (off_t) -1) < 0) ++ return glnx_throw_errno_prefix (error, "regfile copy"); + -+ r = glnx_regfile_copy_bytes (src_fd, dest_fd, (off_t) -1); -+ if (r < 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } -+ -+ if (fchown (dest_fd, src_stbuf->st_uid, src_stbuf->st_gid) != 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } -+ -+ if (fchmod (dest_fd, src_stbuf->st_mode & 07777) != 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } -+ -+ ts[0] = src_stbuf->st_atim; -+ ts[1] = src_stbuf->st_mtim; -+ (void) futimens (dest_fd, ts); ++ if (fchown (tmp_dest.fd, src_stbuf->st_uid, src_stbuf->st_gid) != 0) ++ return glnx_throw_errno_prefix (error, "fchown"); + + if (!(copyflags & GLNX_FILE_COPY_NOXATTRS)) + { @@ -3036,35 +3136,40 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + + if (!glnx_fd_get_all_xattrs (src_fd, &xattrs, + cancellable, error)) -+ goto out; ++ return FALSE; + -+ if (!glnx_fd_set_all_xattrs (dest_fd, xattrs, ++ if (!glnx_fd_set_all_xattrs (tmp_dest.fd, xattrs, + cancellable, error)) -+ goto out; ++ return FALSE; + } + ++ /* Always chmod after setting xattrs, in case the file has mode 0400 or less, ++ * like /etc/shadow. Linux currently allows write() on non-writable open files ++ * but not fsetxattr(). ++ */ ++ if (fchmod (tmp_dest.fd, src_stbuf->st_mode & 07777) != 0) ++ return glnx_throw_errno_prefix (error, "fchmod"); ++ ++ struct timespec ts[2]; ++ ts[0] = src_stbuf->st_atim; ++ ts[1] = src_stbuf->st_mtim; ++ (void) futimens (tmp_dest.fd, ts); ++ + if (copyflags & GLNX_FILE_COPY_DATASYNC) + { -+ if (fdatasync (dest_fd) < 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } -+ } -+ -+ r = close (dest_fd); -+ dest_fd = -1; -+ if (r < 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; ++ if (fdatasync (tmp_dest.fd) < 0) ++ return glnx_throw_errno_prefix (error, "fdatasync"); + } + -+ ret = TRUE; -+ out: -+ if (!ret) -+ (void) unlinkat (dest_dfd, dest_subpath, 0); -+ return ret; ++ const GLnxLinkTmpfileReplaceMode replacemode = ++ (copyflags & GLNX_FILE_COPY_OVERWRITE) ? ++ GLNX_LINK_TMPFILE_REPLACE : ++ GLNX_LINK_TMPFILE_NOREPLACE; ++ ++ if (!glnx_link_tmpfile_at (&tmp_dest, replacemode, dest_dfd, dest_subpath, error)) ++ return FALSE; ++ ++ return TRUE; +} + +/** @@ -3149,19 +3254,17 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + return FALSE; + + if (glnx_loop_write (tmpf.fd, buf, len) < 0) -+ return glnx_throw_errno (error); ++ return glnx_throw_errno_prefix (error, "write"); + + if (!(flags & GLNX_FILE_REPLACE_NODATASYNC)) + { + struct stat stbuf; + gboolean do_sync; + -+ if (fstatat (dfd, subpath, &stbuf, AT_SYMLINK_NOFOLLOW) != 0) -+ { -+ if (errno != ENOENT) -+ return glnx_throw_errno (error); -+ do_sync = (flags & GLNX_FILE_REPLACE_DATASYNC_NEW) > 0; -+ } ++ if (!glnx_fstatat_allow_noent (dfd, subpath, &stbuf, AT_SYMLINK_NOFOLLOW, error)) ++ return FALSE; ++ if (errno == ENOENT) ++ do_sync = (flags & GLNX_FILE_REPLACE_DATASYNC_NEW) > 0; + else + do_sync = TRUE; + @@ -3175,11 +3278,11 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + if (uid != (uid_t) -1) + { + if (fchown (tmpf.fd, uid, gid) != 0) -+ return glnx_throw_errno (error); ++ return glnx_throw_errno_prefix (error, "fchown"); + } + + if (fchmod (tmpf.fd, mode) != 0) -+ return glnx_throw_errno (error); ++ return glnx_throw_errno_prefix (error, "fchmod"); + + if (!glnx_link_tmpfile_at (&tmpf, GLNX_LINK_TMPFILE_REPLACE, + dfd, subpath, error)) @@ -3187,10 +3290,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.c flatpak-builder-0.10. + + return TRUE; +} -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.h flatpak-builder-0.10.6/libglnx/glnx-fdio.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-fdio.h 2018-02-11 12:03:43.449373307 +0300 -@@ -0,0 +1,333 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-fdio.h flatpak-builder-0.10.10/libglnx/glnx-fdio.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-fdio.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-fdio.h 2018-05-26 01:11:39.785067515 +0300 +@@ -0,0 +1,369 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -3222,12 +3325,8 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.h flatpak-builder-0.10. +#include +#include +#include -+/* From systemd/src/shared/util.h */ -+/* When we include libgen.h because we need dirname() we immediately -+ * undefine basename() since libgen.h defines it as a macro to the XDG -+ * version which is really broken. */ ++// For dirname(), and previously basename() +#include -+#undef basename + +#include +#include @@ -3240,7 +3339,12 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.h flatpak-builder-0.10. +static inline +const char *glnx_basename (const char *path) +{ -+ return (basename) (path); ++ gchar *base = strrchr (path, G_DIR_SEPARATOR); ++ ++ if (base) ++ return base + 1; ++ ++ return path; +} + +/* Utilities for standard FILE* */ @@ -3489,6 +3593,41 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.h flatpak-builder-0.10. +} + +/** ++ * glnx_fstatat_allow_noent: ++ * @dfd: Directory FD to stat beneath ++ * @path: Path to stat beneath @dfd ++ * @buf: (out caller-allocates) (allow-none): Return location for stat details ++ * @flags: Flags to pass to fstatat() ++ * @error: Return location for a #GError, or %NULL ++ * ++ * Like glnx_fstatat(), but handles `ENOENT` in a non-error way. Instead, ++ * on success `errno` will be zero, otherwise it will be preserved. Hence ++ * you can test `if (errno == 0)` to conditionalize on the file existing, ++ * or `if (errno == ENOENT)` for non-existence. ++ * ++ * Returns: %TRUE on success, %FALSE otherwise (errno is preserved) ++ * Since: UNRELEASED ++ */ ++static inline gboolean ++glnx_fstatat_allow_noent (int dfd, ++ const char *path, ++ struct stat *out_buf, ++ int flags, ++ GError **error) ++{ ++ G_GNUC_UNUSED struct stat unused_stbuf; ++ if (TEMP_FAILURE_RETRY (fstatat (dfd, path, out_buf ? out_buf : &unused_stbuf, flags)) != 0) ++ { ++ if (errno != ENOENT) ++ return glnx_throw_errno_prefix (error, "fstatat(%s)", path); ++ /* Note we preserve errno as ENOENT */ ++ } ++ else ++ errno = 0; ++ return TRUE; ++} ++ ++/** + * glnx_renameat: + * + * Wrapper around renameat() which adds #GError support and ensures that it @@ -3524,9 +3663,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-fdio.h flatpak-builder-0.10. +} + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-local-alloc.c flatpak-builder-0.10.6/libglnx/glnx-local-alloc.c ---- flatpak-builder-0.10.6.orig/libglnx/glnx-local-alloc.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-local-alloc.c 2018-02-11 12:03:43.449373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-local-alloc.c flatpak-builder-0.10.10/libglnx/glnx-local-alloc.c +--- flatpak-builder-0.10.10.orig/libglnx/glnx-local-alloc.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-local-alloc.c 2018-02-11 12:03:43.449373307 +0300 @@ -0,0 +1,72 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -3600,10 +3739,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-local-alloc.c flatpak-builde + * + * + */ -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-local-alloc.h flatpak-builder-0.10.6/libglnx/glnx-local-alloc.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-local-alloc.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-local-alloc.h 2018-02-11 12:03:43.449373307 +0300 -@@ -0,0 +1,77 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-local-alloc.h flatpak-builder-0.10.10/libglnx/glnx-local-alloc.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-local-alloc.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-local-alloc.h 2018-05-26 01:11:39.785067515 +0300 +@@ -0,0 +1,91 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2012,2015 Colin Walters . @@ -3648,14 +3787,30 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-local-alloc.h flatpak-builde +} +#define glnx_unref_object __attribute__ ((cleanup(glnx_local_obj_unref))) + -+static inline void -+glnx_cleanup_close_fdp (int *fdp) ++static inline int ++glnx_steal_fd (int *fdp) +{ -+ int fd, errsv; ++ int fd = *fdp; ++ *fdp = -1; ++ return fd; ++} ++ ++/** ++ * glnx_close_fd: ++ * @fdp: Pointer to fd ++ * ++ * Effectively `close (glnx_steal_fd (&fd))`. Also ++ * asserts that `close()` did not raise `EBADF` - encountering ++ * that error is usually a critical bug in the program. ++ */ ++static inline void ++glnx_close_fd (int *fdp) ++{ ++ int errsv; + + g_assert (fdp); + -+ fd = *fdp; ++ int fd = glnx_steal_fd (fdp); + if (fd >= 0) + { + errsv = errno; @@ -3668,23 +3823,21 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-local-alloc.h flatpak-builde +/** + * glnx_fd_close: + * ++ * Deprecated in favor of `glnx_autofd`. ++ */ ++#define glnx_fd_close __attribute__((cleanup(glnx_close_fd))) ++/** ++ * glnx_autofd: ++ * + * Call close() on a variable location when it goes out of scope. + */ -+#define glnx_fd_close __attribute__((cleanup(glnx_cleanup_close_fdp))) -+ -+static inline int -+glnx_steal_fd (int *fdp) -+{ -+ int fd = *fdp; -+ *fdp = -1; -+ return fd; -+} ++#define glnx_autofd __attribute__((cleanup(glnx_close_fd))) + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-lockfile.c flatpak-builder-0.10.6/libglnx/glnx-lockfile.c ---- flatpak-builder-0.10.6.orig/libglnx/glnx-lockfile.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-lockfile.c 2018-02-11 12:03:43.449373307 +0300 -@@ -0,0 +1,185 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-lockfile.c flatpak-builder-0.10.10/libglnx/glnx-lockfile.c +--- flatpak-builder-0.10.10.orig/libglnx/glnx-lockfile.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-lockfile.c 2018-05-26 01:11:39.786067515 +0300 +@@ -0,0 +1,179 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** @@ -3748,7 +3901,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-lockfile.c flatpak-builder-0 + */ +gboolean +glnx_make_lock_file(int dfd, const char *p, int operation, GLnxLockFile *out_lock, GError **error) { -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + g_autofree char *t = NULL; + int r; + @@ -3792,7 +3945,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-lockfile.c flatpak-builder-0 + r = flock(fd, operation); + + if (r < 0) -+ return glnx_throw_errno(error); ++ return glnx_throw_errno_prefix (error, "flock"); + } + + /* If we acquired the lock, let's check if the file @@ -3801,34 +3954,29 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-lockfile.c flatpak-builder-0 + * it. In such a case our acquired lock is worthless, + * hence try again. */ + -+ r = fstat(fd, &st); -+ if (r < 0) -+ return glnx_throw_errno(error); ++ if (!glnx_fstat (fd, &st, error)) ++ return FALSE; + if (st.st_nlink > 0) + break; + -+ (void) close(fd); -+ fd = -1; ++ glnx_close_fd (&fd); + } + + /* Note that if this is not AT_FDCWD, the caller takes responsibility + * for the fd's lifetime being >= that of the lock. + */ ++ out_lock->initialized = TRUE; + out_lock->dfd = dfd; -+ out_lock->path = t; -+ out_lock->fd = fd; ++ out_lock->path = g_steal_pointer (&t); ++ out_lock->fd = glnx_steal_fd (&fd); + out_lock->operation = operation; -+ -+ fd = -1; -+ t = NULL; -+ + return TRUE; +} + +void glnx_release_lock_file(GLnxLockFile *f) { + int r; + -+ if (!f) ++ if (!(f && f->initialized)) + return; + + if (f->path) { @@ -3865,15 +4013,14 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-lockfile.c flatpak-builder-0 + f->path = NULL; + } + -+ if (f->fd != -1) -+ (void) close (f->fd); -+ f->fd = -1; ++ glnx_close_fd (&f->fd); + f->operation = 0; ++ f->initialized = FALSE; +} -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-lockfile.h flatpak-builder-0.10.6/libglnx/glnx-lockfile.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-lockfile.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-lockfile.h 2018-02-11 12:03:43.449373307 +0300 -@@ -0,0 +1,41 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-lockfile.h flatpak-builder-0.10.10/libglnx/glnx-lockfile.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-lockfile.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-lockfile.h 2018-05-26 01:11:39.786067515 +0300 +@@ -0,0 +1,40 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +#pragma once @@ -3903,6 +4050,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-lockfile.h flatpak-builder-0 +#include "glnx-backport-autoptr.h" + +typedef struct GLnxLockFile { ++ gboolean initialized; + int dfd; + char *path; + int fd; @@ -3913,11 +4061,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-lockfile.h flatpak-builder-0 +void glnx_release_lock_file(GLnxLockFile *f); + +G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxLockFile, glnx_release_lock_file) -+ -+#define GLNX_LOCK_FILE_INIT { .fd = -1, .dfd = AT_FDCWD, .path = NULL } -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-macros.h flatpak-builder-0.10.6/libglnx/glnx-macros.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-macros.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-macros.h 2018-02-11 12:03:43.449373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-macros.h flatpak-builder-0.10.10/libglnx/glnx-macros.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-macros.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-macros.h 2018-05-26 01:11:39.786067515 +0300 @@ -0,0 +1,189 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -3959,7 +4105,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-macros.h flatpak-builder-0.1 + ({ \ + const char *_appendees_[] = { a, __VA_ARGS__ }; \ + char *_d_, *_p_; \ -+ int _len_ = 0; \ ++ size_t _len_ = 0; \ + unsigned _i_; \ + for (_i_ = 0; _i_ < G_N_ELEMENTS(_appendees_) && _appendees_[_i_]; _i_++) \ + _len_ += strlen(_appendees_[_i_]); \ @@ -4108,10 +4254,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-macros.h flatpak-builder-0.1 +#endif /* GI_SCANNER */ + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-missing.h flatpak-builder-0.10.6/libglnx/glnx-missing.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-missing.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-missing.h 2018-02-11 12:03:43.449373307 +0300 -@@ -0,0 +1,55 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-missing.h flatpak-builder-0.10.10/libglnx/glnx-missing.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-missing.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-missing.h 2018-05-26 01:11:39.786067515 +0300 +@@ -0,0 +1,95 @@ +#pragma once + +/*** @@ -4133,7 +4279,17 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-missing.h flatpak-builder-0. + along with systemd; If not, see . +***/ + -+/* Missing glibc definitions to access certain kernel APIs */ ++/* Missing glibc definitions to access certain kernel APIs. ++ This file is last updated from systemd git: ++ ++ commit 71e5200f94b22589922704aa4abdf95d4fe2e528 ++ Author: Daniel Mack ++ AuthorDate: Tue Oct 18 17:57:10 2016 +0200 ++ Commit: Lennart Poettering ++ CommitDate: Fri Sep 22 15:24:54 2017 +0200 ++ ++ Add abstraction model for BPF programs ++*/ + +#include +#include @@ -4143,22 +4299,30 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-missing.h flatpak-builder-0. +#include +#include + -+#if defined(__i386__) || defined(__x86_64__) -+ -+/* The precise definition of __O_TMPFILE is arch specific, so let's -+ * just define this on x86 where we know the value. */ ++/* The precise definition of __O_TMPFILE is arch specific; use the ++ * values defined by the kernel (note: some are hexa, some are octal, ++ * duplicated as-is from the kernel definitions): ++ * - alpha, parisc, sparc: each has a specific value; ++ * - others: they use the "generic" value. ++ */ + +#ifndef __O_TMPFILE ++#if defined(__alpha__) ++#define __O_TMPFILE 0100000000 ++#elif defined(__parisc__) || defined(__hppa__) ++#define __O_TMPFILE 0400000000 ++#elif defined(__sparc__) || defined(__sparc64__) ++#define __O_TMPFILE 0x2000000 ++#else +#define __O_TMPFILE 020000000 +#endif ++#endif + +/* a horrid kludge trying to make sure that this will fail on old kernels */ +#ifndef O_TMPFILE +#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) +#endif + -+#endif -+ +#ifndef RENAME_NOREPLACE +#define RENAME_NOREPLACE (1 << 0) +#endif @@ -4166,11 +4330,33 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-missing.h flatpak-builder-0. +#define RENAME_EXCHANGE (1 << 1) +#endif + ++#ifndef F_LINUX_SPECIFIC_BASE ++#define F_LINUX_SPECIFIC_BASE 1024 ++#endif ++ ++#ifndef F_ADD_SEALS ++#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) ++#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) ++ ++#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */ ++#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */ ++#define F_SEAL_GROW 0x0004 /* prevent file from growing */ ++#define F_SEAL_WRITE 0x0008 /* prevent writes */ ++#endif ++ ++#ifndef MFD_ALLOW_SEALING ++#define MFD_ALLOW_SEALING 0x0002U ++#endif ++ ++#ifndef MFD_CLOEXEC ++#define MFD_CLOEXEC 0x0001U ++#endif ++ +#include "glnx-missing-syscall.h" -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-missing-syscall.h flatpak-builder-0.10.6/libglnx/glnx-missing-syscall.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-missing-syscall.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-missing-syscall.h 2018-02-11 12:03:43.449373307 +0300 -@@ -0,0 +1,95 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-missing-syscall.h flatpak-builder-0.10.10/libglnx/glnx-missing-syscall.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-missing-syscall.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-missing-syscall.h 2018-05-26 01:11:39.786067515 +0300 +@@ -0,0 +1,154 @@ +/*** + This file was originally part of systemd. + @@ -4191,7 +4377,19 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-missing-syscall.h flatpak-bu + along with systemd; If not, see . +***/ + -+/* Missing glibc definitions to access certain kernel APIs */ ++/* Missing glibc definitions to access certain kernel APIs. ++ This file is last updated from systemd git: ++ ++ commit 71e5200f94b22589922704aa4abdf95d4fe2e528 ++ Author: Daniel Mack ++ AuthorDate: Tue Oct 18 17:57:10 2016 +0200 ++ Commit: Lennart Poettering ++ CommitDate: Fri Sep 22 15:24:54 2017 +0200 ++ ++ Add abstraction model for BPF programs ++*/ ++ ++#include "config.h" + +#if !HAVE_DECL_RENAMEAT2 +# ifndef __NR_renameat2 @@ -4199,6 +4397,8 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-missing-syscall.h flatpak-bu +# define __NR_renameat2 316 +# elif defined __arm__ +# define __NR_renameat2 382 ++# elif defined __aarch64__ ++# define __NR_renameat2 276 +# elif defined _MIPS_SIM +# if _MIPS_SIM == _MIPS_SIM_ABI32 +# define __NR_renameat2 4351 @@ -4211,6 +4411,12 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-missing-syscall.h flatpak-bu +# endif +# elif defined __i386__ +# define __NR_renameat2 353 ++# elif defined __powerpc64__ ++# define __NR_renameat2 357 ++# elif defined __s390__ || defined __s390x__ ++# define __NR_renameat2 347 ++# elif defined __arc__ ++# define __NR_renameat2 276 +# else +# warning "__NR_renameat2 unknown for your architecture" +# endif @@ -4226,6 +4432,45 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-missing-syscall.h flatpak-bu +} +#endif + ++#if !HAVE_DECL_MEMFD_CREATE ++# ifndef __NR_memfd_create ++# if defined __x86_64__ ++# define __NR_memfd_create 319 ++# elif defined __arm__ ++# define __NR_memfd_create 385 ++# elif defined __aarch64__ ++# define __NR_memfd_create 279 ++# elif defined __s390__ ++# define __NR_memfd_create 350 ++# elif defined _MIPS_SIM ++# if _MIPS_SIM == _MIPS_SIM_ABI32 ++# define __NR_memfd_create 4354 ++# endif ++# if _MIPS_SIM == _MIPS_SIM_NABI32 ++# define __NR_memfd_create 6318 ++# endif ++# if _MIPS_SIM == _MIPS_SIM_ABI64 ++# define __NR_memfd_create 5314 ++# endif ++# elif defined __i386__ ++# define __NR_memfd_create 356 ++# elif defined __arc__ ++# define __NR_memfd_create 279 ++# else ++# warning "__NR_memfd_create unknown for your architecture" ++# endif ++# endif ++ ++static inline int memfd_create(const char *name, unsigned int flags) { ++# ifdef __NR_memfd_create ++ return syscall(__NR_memfd_create, name, flags); ++# else ++ errno = ENOSYS; ++ return -1; ++# endif ++} ++#endif ++ +/* Copied from systemd git: + commit 6bda23dd6aaba50cf8e3e6024248cf736cc443ca + Author: Yu Watanabe @@ -4266,10 +4511,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-missing-syscall.h flatpak-bu +# endif +} +#endif -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-shutil.c flatpak-builder-0.10.6/libglnx/glnx-shutil.c ---- flatpak-builder-0.10.6.orig/libglnx/glnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-shutil.c 2018-02-11 12:03:43.449373307 +0300 -@@ -0,0 +1,252 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-shutil.c flatpak-builder-0.10.10/libglnx/glnx-shutil.c +--- flatpak-builder-0.10.10.orig/libglnx/glnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-shutil.c 2018-05-26 01:11:39.786067515 +0300 +@@ -0,0 +1,260 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -4356,14 +4601,12 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-shutil.c flatpak-builder-0.1 + GCancellable *cancellable, + GError **error) +{ -+ glnx_fd_close int target_dfd = -1; -+ g_auto(GLnxDirFdIterator) dfd_iter = { 0, }; -+ + dfd = glnx_dirfd_canonicalize (dfd); + ++ + /* With O_NOFOLLOW first */ -+ target_dfd = openat (dfd, path, -+ O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW); ++ glnx_autofd int target_dfd = ++ openat (dfd, path, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW); + + if (target_dfd == -1) + { @@ -4382,6 +4625,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-shutil.c flatpak-builder-0.1 + } + else + { ++ g_auto(GLnxDirFdIterator) dfd_iter = { 0, }; + if (!glnx_dirfd_iterator_init_take_fd (&target_dfd, &dfd_iter, error)) + return FALSE; + @@ -4420,7 +4664,13 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-shutil.c flatpak-builder-0.1 + g_assert (!did_recurse); + + lastslash = strrchr (path, '/'); -+ g_assert (lastslash != NULL); ++ if (lastslash == NULL) ++ { ++ /* This can happen if @dfd was deleted between being opened and ++ * passed to mkdir_p_at_internal(). */ ++ return glnx_throw_errno_prefix (error, "mkdir(%s)", path); ++ } ++ + /* Note we can mutate the buffer as we dup'd it */ + *lastslash = '\0'; + @@ -4459,6 +4709,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-shutil.c flatpak-builder-0.1 + * directory fd @dfd. + * + * See also glnx_ensure_dir() for a non-recursive version. ++ * ++ * This will return %G_IO_ERROR_NOT_FOUND if @dfd has been deleted since being ++ * opened. It may return other errors from mkdirat() in other situations. + */ +gboolean +glnx_shutil_mkdir_p_at (int dfd, @@ -4522,9 +4775,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-shutil.c flatpak-builder-0.1 + + return glnx_opendirat (dfd, path, TRUE, out_dfd, error); +} -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-shutil.h flatpak-builder-0.10.6/libglnx/glnx-shutil.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-shutil.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-shutil.h 2018-02-11 12:03:43.449373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-shutil.h flatpak-builder-0.10.10/libglnx/glnx-shutil.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-shutil.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-shutil.h 2018-02-11 12:03:43.449373307 +0300 @@ -0,0 +1,48 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -4574,9 +4827,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-shutil.h flatpak-builder-0.1 + GError **error); + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-xattrs.c flatpak-builder-0.10.6/libglnx/glnx-xattrs.c ---- flatpak-builder-0.10.6.orig/libglnx/glnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-xattrs.c 2018-02-11 12:03:43.449373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-xattrs.c flatpak-builder-0.10.10/libglnx/glnx-xattrs.c +--- flatpak-builder-0.10.10.orig/libglnx/glnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-xattrs.c 2018-02-11 12:03:43.449373307 +0300 @@ -0,0 +1,444 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -5022,9 +5275,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-xattrs.c flatpak-builder-0.1 + return TRUE; +} + -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-xattrs.h flatpak-builder-0.10.6/libglnx/glnx-xattrs.h ---- flatpak-builder-0.10.6.orig/libglnx/glnx-xattrs.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/glnx-xattrs.h 2018-02-11 12:03:43.449373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/glnx-xattrs.h flatpak-builder-0.10.10/libglnx/glnx-xattrs.h +--- flatpak-builder-0.10.10.orig/libglnx/glnx-xattrs.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/glnx-xattrs.h 2018-02-11 12:03:43.449373307 +0300 @@ -0,0 +1,78 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -5104,9 +5357,9 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/glnx-xattrs.h flatpak-builder-0.1 + GError **error); + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/libglnx.doap flatpak-builder-0.10.6/libglnx/libglnx.doap ---- flatpak-builder-0.10.6.orig/libglnx/libglnx.doap 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/libglnx.doap 2018-02-11 12:03:43.449373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/libglnx.doap flatpak-builder-0.10.10/libglnx/libglnx.doap +--- flatpak-builder-0.10.10.orig/libglnx/libglnx.doap 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/libglnx.doap 2018-02-11 12:03:43.449373307 +0300 @@ -0,0 +1,31 @@ + + + + -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/libglnx.h flatpak-builder-0.10.6/libglnx/libglnx.h ---- flatpak-builder-0.10.6.orig/libglnx/libglnx.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/libglnx.h 2018-02-11 12:03:43.449373307 +0300 -@@ -0,0 +1,39 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/libglnx.h flatpak-builder-0.10.10/libglnx/libglnx.h +--- flatpak-builder-0.10.10.orig/libglnx/libglnx.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/libglnx.h 2018-05-26 01:11:39.786067515 +0300 +@@ -0,0 +1,40 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2012,2013,2015 Colin Walters . @@ -5170,6 +5423,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/libglnx.h flatpak-builder-0.10.6/ +G_BEGIN_DECLS + +#include ++#include +#include +#include +#include @@ -5182,15 +5436,16 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/libglnx.h flatpak-builder-0.10.6/ +#include + +G_END_DECLS -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/libglnx.m4 flatpak-builder-0.10.6/libglnx/libglnx.m4 ---- flatpak-builder-0.10.6.orig/libglnx/libglnx.m4 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/libglnx.m4 2018-02-11 12:03:43.449373307 +0300 -@@ -0,0 +1,31 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/libglnx.m4 flatpak-builder-0.10.10/libglnx/libglnx.m4 +--- flatpak-builder-0.10.10.orig/libglnx/libglnx.m4 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/libglnx.m4 2018-05-26 01:11:39.807067515 +0300 +@@ -0,0 +1,33 @@ +AC_DEFUN([LIBGLNX_CONFIGURE], +[ +AC_CHECK_DECLS([ + renameat2, -+ ], ++ memfd_create, ++ copy_file_range], + [], [], [[ +#include +#include @@ -5199,6 +5454,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/libglnx.m4 flatpak-builder-0.10.6 +#include +#include +#include ++#include +]]) + +AC_ARG_ENABLE(otmpfile, @@ -5217,10 +5473,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/libglnx.m4 flatpak-builder-0.10.6 + +dnl end LIBGLNX_CONFIGURE +]) -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/Makefile-libglnx.am flatpak-builder-0.10.6/libglnx/Makefile-libglnx.am ---- flatpak-builder-0.10.6.orig/libglnx/Makefile-libglnx.am 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/Makefile-libglnx.am 2018-02-11 12:03:43.448373307 +0300 -@@ -0,0 +1,73 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/Makefile-libglnx.am flatpak-builder-0.10.10/libglnx/Makefile-libglnx.am +--- flatpak-builder-0.10.10.orig/libglnx/Makefile-libglnx.am 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/Makefile-libglnx.am 2018-05-26 01:11:39.785067515 +0300 +@@ -0,0 +1,78 @@ +# Copyright (C) 2015 Colin Walters +# +# This library is free software; you can redistribute it and/or @@ -5269,13 +5525,14 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/Makefile-libglnx.am flatpak-build + $(libglnx_srcpath)/glnx-shutil.h \ + $(libglnx_srcpath)/glnx-shutil.c \ + $(libglnx_srcpath)/libglnx.h \ ++ $(libglnx_srcpath)/tests/libglnx-testlib.h \ + $(NULL) + +libglnx_la_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags) +libglnx_la_LDFLAGS = -avoid-version -Bsymbolic-functions -export-symbols-regex "^glnx_" -no-undefined -export-dynamic +libglnx_la_LIBADD = $(libglnx_libs) + -+libglnx_tests = test-libglnx-xattrs test-libglnx-fdio test-libglnx-errors test-libglnx-macros ++libglnx_tests = test-libglnx-xattrs test-libglnx-fdio test-libglnx-errors test-libglnx-macros test-libglnx-shutil +TESTS += $(libglnx_tests) + +check_PROGRAMS += $(libglnx_tests) @@ -5294,9 +5551,13 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/Makefile-libglnx.am flatpak-build +test_libglnx_macros_SOURCES = $(libglnx_srcpath)/tests/test-libglnx-macros.c +test_libglnx_macros_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags) +test_libglnx_macros_LDADD = $(libglnx_libs) libglnx.la -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/README.md flatpak-builder-0.10.6/libglnx/README.md ---- flatpak-builder-0.10.6.orig/libglnx/README.md 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/README.md 2018-02-11 12:03:43.448373307 +0300 ++ ++test_libglnx_shutil_SOURCES = $(libglnx_srcpath)/tests/test-libglnx-shutil.c ++test_libglnx_shutil_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags) ++test_libglnx_shutil_LDADD = $(libglnx_libs) libglnx.la +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/README.md flatpak-builder-0.10.10/libglnx/README.md +--- flatpak-builder-0.10.10.orig/libglnx/README.md 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/README.md 2018-05-26 01:11:39.785067515 +0300 @@ -0,0 +1,52 @@ +libglnx is the successor to libgsystem: https://git.gnome.org/browse/libgsystem + @@ -5337,7 +5598,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/README.md flatpak-builder-0.10.6/ + +For local allocation macros, you should start using the `g_auto` +macros from GLib. A backport is included in libglnx. There are a few -+APIs not defined in GLib yet, such as `glnx_fd_close`. ++APIs not defined in GLib yet, such as `glnx_autofd`. + +`gs_transfer_out_value` is replaced by `g_steal_pointer`. + @@ -5350,9 +5611,47 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/README.md flatpak-builder-0.10.6/ +https://github.com/GNOME/libglnx/pulls + +Or alternatively, email one of the maintainers directly. -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-errors.c flatpak-builder-0.10.6/libglnx/tests/test-libglnx-errors.c ---- flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-errors.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/tests/test-libglnx-errors.c 2018-02-11 12:03:43.450373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/tests/libglnx-testlib.h flatpak-builder-0.10.10/libglnx/tests/libglnx-testlib.h +--- flatpak-builder-0.10.10.orig/libglnx/tests/libglnx-testlib.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/tests/libglnx-testlib.h 2018-05-26 01:11:39.807067515 +0300 +@@ -0,0 +1,34 @@ ++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- ++ * ++ * Copyright (C) 2017 Red Hat, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++ * Boston, MA 02111-1307, USA. ++ */ ++ ++#pragma once ++ ++typedef GError _GLnxTestAutoError; ++static inline void ++_glnx_test_auto_error_cleanup (_GLnxTestAutoError *autoerror) ++{ ++ g_assert_no_error (autoerror); ++ /* We could add a clear call here, but no point...we'll have aborted */ ++} ++G_DEFINE_AUTOPTR_CLEANUP_FUNC(_GLnxTestAutoError, _glnx_test_auto_error_cleanup); ++ ++#define _GLNX_TEST_DECLARE_ERROR(local_error, error) \ ++ g_autoptr(_GLnxTestAutoError) local_error = NULL; \ ++ GError **error = &local_error +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/tests/test-libglnx-errors.c flatpak-builder-0.10.10/libglnx/tests/test-libglnx-errors.c +--- flatpak-builder-0.10.10.orig/libglnx/tests/test-libglnx-errors.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/tests/test-libglnx-errors.c 2018-02-11 12:03:43.450373307 +0300 @@ -0,0 +1,183 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -5537,10 +5836,10 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-errors.c flatp + + return ret; +} -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-fdio.c flatpak-builder-0.10.6/libglnx/tests/test-libglnx-fdio.c ---- flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/tests/test-libglnx-fdio.c 2018-02-11 12:03:43.450373307 +0300 -@@ -0,0 +1,206 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/tests/test-libglnx-fdio.c flatpak-builder-0.10.10/libglnx/tests/test-libglnx-fdio.c +--- flatpak-builder-0.10.10.orig/libglnx/tests/test-libglnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/tests/test-libglnx-fdio.c 2018-05-26 01:11:39.822067516 +0300 +@@ -0,0 +1,254 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2017 Red Hat, Inc. @@ -5569,12 +5868,14 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-fdio.c flatpak +#include +#include + ++#include "libglnx-testlib.h" ++ +static gboolean +renameat_test_setup (int *out_srcfd, int *out_destfd, + GError **error) +{ -+ glnx_fd_close int srcfd = -1; -+ glnx_fd_close int destfd = -1; ++ glnx_autofd int srcfd = -1; ++ glnx_autofd int destfd = -1; + + (void) glnx_shutil_rm_rf_at (AT_FDCWD, "srcdir", NULL, NULL); + if (mkdir ("srcdir", 0755) < 0) @@ -5602,14 +5903,13 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-fdio.c flatpak +static void +test_renameat2_noreplace (void) +{ -+ g_autoptr(GError) local_error = NULL; -+ GError **error = &local_error; -+ glnx_fd_close int srcfd = -1; -+ glnx_fd_close int destfd = -1; ++ _GLNX_TEST_DECLARE_ERROR(local_error, error); ++ glnx_autofd int srcfd = -1; ++ glnx_autofd int destfd = -1; + struct stat stbuf; + + if (!renameat_test_setup (&srcfd, &destfd, error)) -+ goto out; ++ return; + + if (glnx_renameat2_noreplace (srcfd, "foo", destfd, "bar") == 0) + g_assert_not_reached (); @@ -5619,117 +5919,162 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-fdio.c flatpak + } + + if (glnx_renameat2_noreplace (srcfd, "foo", destfd, "baz") < 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } ++ return (void)glnx_throw_errno_prefix (error, "renameat"); + if (!glnx_fstatat (destfd, "bar", &stbuf, AT_SYMLINK_NOFOLLOW, error)) -+ goto out; ++ return; + + if (fstatat (srcfd, "foo", &stbuf, AT_SYMLINK_NOFOLLOW) == 0) + g_assert_not_reached (); + else + g_assert_cmpint (errno, ==, ENOENT); -+ -+ out: -+ g_assert_no_error (local_error); +} + +static void +test_renameat2_exchange (void) +{ -+ g_autoptr(GError) local_error = NULL; -+ GError **error = &local_error; -+ glnx_fd_close int srcfd = -1; -+ glnx_fd_close int destfd = -1; -+ struct stat stbuf; ++ _GLNX_TEST_DECLARE_ERROR(local_error, error); + ++ glnx_autofd int srcfd = -1; ++ glnx_autofd int destfd = -1; + if (!renameat_test_setup (&srcfd, &destfd, error)) -+ goto out; ++ return; + + if (glnx_renameat2_exchange (AT_FDCWD, "srcdir", AT_FDCWD, "destdir") < 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } ++ return (void)glnx_throw_errno_prefix (error, "renameat"); + + /* Ensure the dir fds are the same */ -+ if (fstatat (srcfd, "foo", &stbuf, AT_SYMLINK_NOFOLLOW) < 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } -+ if (fstatat (destfd, "bar", &stbuf, AT_SYMLINK_NOFOLLOW) < 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } ++ struct stat stbuf; ++ if (!glnx_fstatat (srcfd, "foo", &stbuf, AT_SYMLINK_NOFOLLOW, error)) ++ return; ++ if (!glnx_fstatat (destfd, "bar", &stbuf, AT_SYMLINK_NOFOLLOW, error)) ++ return; + /* But the dirs should be swapped */ -+ if (fstatat (AT_FDCWD, "destdir/foo", &stbuf, AT_SYMLINK_NOFOLLOW) < 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } -+ if (fstatat (AT_FDCWD, "srcdir/bar", &stbuf, AT_SYMLINK_NOFOLLOW) < 0) -+ { -+ glnx_set_error_from_errno (error); -+ goto out; -+ } -+ -+ out: -+ g_assert_no_error (local_error); ++ if (!glnx_fstatat (AT_FDCWD, "destdir/foo", &stbuf, AT_SYMLINK_NOFOLLOW, error)) ++ return; ++ if (!glnx_fstatat (AT_FDCWD, "srcdir/bar", &stbuf, AT_SYMLINK_NOFOLLOW, error)) ++ return; +} + +static void +test_tmpfile (void) +{ -+ g_autoptr(GError) local_error = NULL; -+ GError **error = &local_error; ++ _GLNX_TEST_DECLARE_ERROR(local_error, error); ++ + g_auto(GLnxTmpfile) tmpf = { 0, }; -+ + if (!glnx_open_tmpfile_linkable_at (AT_FDCWD, ".", O_WRONLY|O_CLOEXEC, &tmpf, error)) -+ goto out; -+ ++ return; + if (glnx_loop_write (tmpf.fd, "foo", strlen ("foo")) < 0) -+ { -+ (void)glnx_throw_errno_prefix (error, "write"); -+ goto out; -+ } -+ ++ return (void)glnx_throw_errno_prefix (error, "write"); + if (glnx_link_tmpfile_at (&tmpf, GLNX_LINK_TMPFILE_NOREPLACE, AT_FDCWD, "foo", error)) -+ goto out; -+ -+ out: -+ g_assert_no_error (local_error); ++ return; +} + +static void +test_stdio_file (void) +{ -+ g_autoptr(GError) local_error = NULL; -+ GError **error = &local_error; ++ _GLNX_TEST_DECLARE_ERROR(local_error, error); + g_auto(GLnxTmpfile) tmpf = { 0, }; + g_autoptr(FILE) f = NULL; + + if (!glnx_open_anonymous_tmpfile (O_RDWR|O_CLOEXEC, &tmpf, error)) -+ goto out; ++ return; + f = fdopen (tmpf.fd, "w"); ++ tmpf.fd = -1; /* Ownership was transferred via fdopen() */ + if (!f) -+ { -+ (void)glnx_throw_errno_prefix (error, "fdopen"); -+ goto out; -+ } -+ ++ return (void)glnx_throw_errno_prefix (error, "fdopen"); + if (fwrite ("hello", 1, strlen ("hello"), f) != strlen ("hello")) -+ { -+ (void)glnx_throw_errno_prefix (error, "fwrite"); -+ goto out; -+ } ++ return (void)glnx_throw_errno_prefix (error, "fwrite"); + if (!glnx_stdio_file_flush (f, error)) -+ goto out; ++ return; ++} + -+ out: ++static void ++test_fstatat (void) ++{ ++ _GLNX_TEST_DECLARE_ERROR(local_error, error); ++ struct stat stbuf = { 0, }; ++ ++ if (!glnx_fstatat_allow_noent (AT_FDCWD, ".", &stbuf, 0, error)) ++ return; ++ g_assert_cmpint (errno, ==, 0); + g_assert_no_error (local_error); ++ g_assert (S_ISDIR (stbuf.st_mode)); ++ if (!glnx_fstatat_allow_noent (AT_FDCWD, "nosuchfile", &stbuf, 0, error)) ++ return; ++ g_assert_cmpint (errno, ==, ENOENT); ++ g_assert_no_error (local_error); ++ ++ /* test NULL parameter for stat */ ++ if (!glnx_fstatat_allow_noent (AT_FDCWD, ".", NULL, 0, error)) ++ return; ++ g_assert_cmpint (errno, ==, 0); ++ g_assert_no_error (local_error); ++ if (!glnx_fstatat_allow_noent (AT_FDCWD, "nosuchfile", NULL, 0, error)) ++ return; ++ g_assert_cmpint (errno, ==, ENOENT); ++ g_assert_no_error (local_error); ++} ++ ++static void ++test_filecopy (void) ++{ ++ _GLNX_TEST_DECLARE_ERROR(local_error, error); ++ const char foo[] = "foo"; ++ struct stat stbuf; ++ ++ if (!glnx_ensure_dir (AT_FDCWD, "subdir", 0755, error)) ++ return; ++ ++ if (!glnx_file_replace_contents_at (AT_FDCWD, foo, (guint8*)foo, sizeof (foo), ++ GLNX_FILE_REPLACE_NODATASYNC, NULL, error)) ++ return; ++ ++ /* Copy it into both the same dir and a subdir */ ++ if (!glnx_file_copy_at (AT_FDCWD, foo, NULL, AT_FDCWD, "bar", ++ GLNX_FILE_COPY_NOXATTRS, NULL, error)) ++ return; ++ if (!glnx_file_copy_at (AT_FDCWD, foo, NULL, AT_FDCWD, "subdir/bar", ++ GLNX_FILE_COPY_NOXATTRS, NULL, error)) ++ return; ++ if (!glnx_fstatat (AT_FDCWD, "subdir/bar", &stbuf, 0, error)) ++ return; ++ ++ if (glnx_file_copy_at (AT_FDCWD, foo, NULL, AT_FDCWD, "bar", ++ GLNX_FILE_COPY_NOXATTRS, NULL, error)) ++ g_assert_not_reached (); ++ g_assert_error (local_error, G_IO_ERROR, G_IO_ERROR_EXISTS); ++ g_clear_error (&local_error); ++ ++ if (!glnx_file_copy_at (AT_FDCWD, foo, NULL, AT_FDCWD, "bar", ++ GLNX_FILE_COPY_NOXATTRS | GLNX_FILE_COPY_OVERWRITE, ++ NULL, error)) ++ return; ++ ++ if (symlinkat ("nosuchtarget", AT_FDCWD, "link") < 0) ++ return (void) glnx_throw_errno_prefix (error, "symlinkat"); ++ ++ /* Shouldn't be able to overwrite a symlink without GLNX_FILE_COPY_OVERWRITE */ ++ if (glnx_file_copy_at (AT_FDCWD, foo, NULL, AT_FDCWD, "link", ++ GLNX_FILE_COPY_NOXATTRS, ++ NULL, error)) ++ g_assert_not_reached (); ++ g_assert_error (local_error, G_IO_ERROR, G_IO_ERROR_EXISTS); ++ g_clear_error (&local_error); ++ ++ /* Test overwriting symlink */ ++ if (!glnx_file_copy_at (AT_FDCWD, foo, NULL, AT_FDCWD, "link", ++ GLNX_FILE_COPY_NOXATTRS | GLNX_FILE_COPY_OVERWRITE, ++ NULL, error)) ++ return; ++ ++ if (!glnx_fstatat_allow_noent (AT_FDCWD, "nosuchtarget", &stbuf, AT_SYMLINK_NOFOLLOW, error)) ++ return; ++ g_assert_cmpint (errno, ==, ENOENT); ++ g_assert_no_error (local_error); ++ ++ if (!glnx_fstatat (AT_FDCWD, "link", &stbuf, AT_SYMLINK_NOFOLLOW, error)) ++ return; ++ g_assert (S_ISREG (stbuf.st_mode)); +} + +int main (int argc, char **argv) @@ -5740,16 +6085,18 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-fdio.c flatpak + + g_test_add_func ("/tmpfile", test_tmpfile); + g_test_add_func ("/stdio-file", test_stdio_file); ++ g_test_add_func ("/filecopy", test_filecopy); + g_test_add_func ("/renameat2-noreplace", test_renameat2_noreplace); + g_test_add_func ("/renameat2-exchange", test_renameat2_exchange); ++ g_test_add_func ("/fstat", test_fstatat); + + ret = g_test_run(); + + return ret; +} -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-macros.c flatpak-builder-0.10.6/libglnx/tests/test-libglnx-macros.c ---- flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-macros.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/tests/test-libglnx-macros.c 2018-02-11 12:03:43.450373307 +0300 +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/tests/test-libglnx-macros.c flatpak-builder-0.10.10/libglnx/tests/test-libglnx-macros.c +--- flatpak-builder-0.10.10.orig/libglnx/tests/test-libglnx-macros.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/tests/test-libglnx-macros.c 2018-02-11 12:03:43.450373307 +0300 @@ -0,0 +1,109 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -5860,10 +6207,77 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-macros.c flatp + g_test_add_func ("/hash_table_foreach", test_hash_table_foreach); + return g_test_run(); +} -diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-xattrs.c flatpak-builder-0.10.6/libglnx/tests/test-libglnx-xattrs.c ---- flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-builder-0.10.6/libglnx/tests/test-libglnx-xattrs.c 2018-02-11 12:03:43.450373307 +0300 -@@ -0,0 +1,287 @@ +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/tests/test-libglnx-shutil.c flatpak-builder-0.10.10/libglnx/tests/test-libglnx-shutil.c +--- flatpak-builder-0.10.10.orig/libglnx/tests/test-libglnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/tests/test-libglnx-shutil.c 2018-05-26 01:11:39.822067516 +0300 +@@ -0,0 +1,63 @@ ++/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- ++ * ++ * Copyright © 2017 Endless Mobile, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++ * Boston, MA 02111-1307, USA. ++ */ ++ ++#include "config.h" ++#include "libglnx.h" ++#include ++#include ++#include ++#include ++#include ++ ++#include "libglnx-testlib.h" ++ ++static void ++test_mkdir_p_enoent (void) ++{ ++ _GLNX_TEST_DECLARE_ERROR(local_error, error); ++ glnx_autofd int dfd = -1; ++ ++ if (!glnx_ensure_dir (AT_FDCWD, "test", 0755, error)) ++ return; ++ if (!glnx_opendirat (AT_FDCWD, "test", FALSE, &dfd, error)) ++ return; ++ if (rmdir ("test") < 0) ++ return (void) glnx_throw_errno_prefix (error, "rmdir(%s)", "test"); ++ ++ /* This should fail with ENOENT. */ ++ glnx_shutil_mkdir_p_at (dfd, "blah/baz", 0755, NULL, error); ++ g_assert_error (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND); ++ g_clear_error (&local_error); ++} ++ ++int ++main (int argc, ++ char **argv) ++{ ++ int ret; ++ ++ g_test_init (&argc, &argv, NULL); ++ ++ g_test_add_func ("/mkdir-p/enoent", test_mkdir_p_enoent); ++ ++ ret = g_test_run(); ++ ++ return ret; ++} +diff -Nuar flatpak-builder-0.10.10.orig/libglnx/tests/test-libglnx-xattrs.c flatpak-builder-0.10.10/libglnx/tests/test-libglnx-xattrs.c +--- flatpak-builder-0.10.10.orig/libglnx/tests/test-libglnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-builder-0.10.10/libglnx/tests/test-libglnx-xattrs.c 2018-05-26 01:11:39.822067516 +0300 +@@ -0,0 +1,283 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2017 Red Hat, Inc. @@ -5948,7 +6362,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-xattrs.c flatp + { + guint32 randname_v = g_random_int (); + g_autofree char *randname = g_strdup_printf ("file%u", randname_v); -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + + again: + fd = openat (dfd_iter->fd, randname, O_CREAT | O_EXCL, 0644); @@ -5979,7 +6393,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-xattrs.c flatp + if (!dent) + break; + -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + if (!glnx_openat_rdonly (dfd_iter->fd, dent->d_name, FALSE, &fd, error)) + return FALSE; + @@ -6023,7 +6437,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-xattrs.c flatp + if (!dent) + break; + -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + if (!glnx_openat_rdonly (dfd_iter->fd, dent->d_name, FALSE, &fd, error)) + return FALSE; + @@ -6089,19 +6503,17 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-xattrs.c flatp + GThread *threads[nprocs]; + g_autoptr(GError) local_error = NULL; + GError **error = &local_error; -+ glnx_fd_close int dfd = -1; -+ g_autofree char *tmpdir = g_strdup_printf ("%s/libglnx-xattrs-XXXXXX", -+ getenv ("TMPDIR") ?: "/var/tmp"); ++ g_auto(GLnxTmpDir) tmpdir = { 0, }; ++ g_autofree char *tmpdir_path = g_strdup_printf ("%s/libglnx-xattrs-XXXXXX", ++ getenv ("TMPDIR") ?: "/var/tmp"); + guint nread = 0; + -+ if (!glnx_mkdtempat (AT_FDCWD, tmpdir, 0700, error)) -+ goto out; -+ -+ if (!glnx_opendirat (AT_FDCWD, tmpdir, TRUE, &dfd, error)) ++ if (!glnx_mkdtempat (AT_FDCWD, tmpdir_path, 0700, ++ &tmpdir, error)) + goto out; + + /* Support people building/testing on tmpfs https://github.com/flatpak/flatpak/issues/686 */ -+ if (fsetxattr (dfd, "user.test", "novalue", strlen ("novalue"), 0) < 0) ++ if (fsetxattr (tmpdir.fd, "user.test", "novalue", strlen ("novalue"), 0) < 0) + { + if (errno == EOPNOTSUPP) + { @@ -6118,7 +6530,7 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-xattrs.c flatp + for (guint i = 0; i < nprocs; i++) + { + struct XattrWorker *worker = &wdata[i]; -+ worker->dfd = dfd; ++ worker->dfd = tmpdir.fd; + worker->is_writer = i % 2 == 0; + threads[i] = g_thread_new (NULL, xattr_thread, worker); + } @@ -6133,8 +6545,6 @@ diff -Nuar flatpak-builder-0.10.6.orig/libglnx/tests/test-libglnx-xattrs.c flatp + + g_print ("Read %u xattrs race free!\n", nread); + -+ (void) glnx_shutil_rm_rf_at (AT_FDCWD, tmpdir, NULL, NULL); -+ + out: + g_assert_no_error (local_error); +} diff --git a/hardware/virtualization/flatpak-builder/pspec.xml b/hardware/virtualization/flatpak-builder/pspec.xml index 1aaa8ae36c..a11a26fdd1 100644 --- a/hardware/virtualization/flatpak-builder/pspec.xml +++ b/hardware/virtualization/flatpak-builder/pspec.xml @@ -12,10 +12,10 @@ app:console Tool to build flatpaks from sources Tool for building flatpaks from sources - https://github.com/flatpak/flatpak-builder/archive/0.10.8.tar.gz + https://github.com/flatpak/flatpak-builder/archive/0.10.10.tar.gz - flatpak-devel - ostree-devel + flatpak-devel + ostree-devel util-linux libxslt xmlto @@ -24,6 +24,7 @@ elfutils glib2-devel libxml2-devel + libyaml-devel libglnx_submodule.patch @@ -33,13 +34,14 @@ flatpak-builder - flatpak - ostree + flatpak + ostree libsoup elfutils glib2 libxml2 json-glib + libyaml /usr/bin @@ -49,6 +51,13 @@ + + 2018-05-26 + 0.10.10 + Version bump. + Ertuğrul Erata + ertugrulerata@gmail.com + 2018-02-16 0.10.8 diff --git a/hardware/virtualization/flatpak/actions.py b/hardware/virtualization/flatpak/actions.py index d9d41a72ff..6045087cb1 100644 --- a/hardware/virtualization/flatpak/actions.py +++ b/hardware/virtualization/flatpak/actions.py @@ -18,6 +18,7 @@ def setup(): --enable-xauth \ --with-system-bubblewrap \ --enable-docbook-docs \ + --disable-static \ --enable-sandboxed-triggers") pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ") diff --git a/hardware/virtualization/flatpak/files/bubblewrap_libglnx_submodule.patch b/hardware/virtualization/flatpak/files/bubblewrap_libglnx_submodule.patch index a3570fff27..6112240639 100644 --- a/hardware/virtualization/flatpak/files/bubblewrap_libglnx_submodule.patch +++ b/hardware/virtualization/flatpak/files/bubblewrap_libglnx_submodule.patch @@ -1,6 +1,6 @@ -diff -Nuar flatpak-0.10.3.orig/bubblewrap/autogen.sh flatpak-0.10.3/bubblewrap/autogen.sh ---- flatpak-0.10.3.orig/bubblewrap/autogen.sh 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/autogen.sh 2018-02-03 21:26:06.272233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/autogen.sh flatpak-0.11.7/bubblewrap/autogen.sh +--- flatpak-0.11.7.orig/bubblewrap/autogen.sh 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/autogen.sh 2018-02-03 21:26:06.272233339 +0300 @@ -0,0 +1,19 @@ +#!/bin/sh + @@ -21,9 +21,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/autogen.sh flatpak-0.10.3/bubblewrap/a + +cd $olddir +test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" -diff -Nuar flatpak-0.10.3.orig/bubblewrap/bind-mount.c flatpak-0.10.3/bubblewrap/bind-mount.c ---- flatpak-0.10.3.orig/bubblewrap/bind-mount.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/bind-mount.c 2018-02-03 21:26:06.272233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/bind-mount.c flatpak-0.11.7/bubblewrap/bind-mount.c +--- flatpak-0.11.7.orig/bubblewrap/bind-mount.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/bind-mount.c 2018-02-03 21:26:06.272233339 +0300 @@ -0,0 +1,440 @@ +/* bubblewrap + * Copyright (C) 2016 Alexander Larsson @@ -465,9 +465,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/bind-mount.c flatpak-0.10.3/bubblewrap + + return 0; +} -diff -Nuar flatpak-0.10.3.orig/bubblewrap/bind-mount.h flatpak-0.10.3/bubblewrap/bind-mount.h ---- flatpak-0.10.3.orig/bubblewrap/bind-mount.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/bind-mount.h 2018-02-03 21:26:06.272233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/bind-mount.h flatpak-0.11.7/bubblewrap/bind-mount.h +--- flatpak-0.11.7.orig/bubblewrap/bind-mount.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/bind-mount.h 2018-02-03 21:26:06.272233339 +0300 @@ -0,0 +1,30 @@ +/* bubblewrap + * Copyright (C) 2016 Alexander Larsson @@ -499,9 +499,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/bind-mount.h flatpak-0.10.3/bubblewrap + const char *src, + const char *dest, + bind_option_t options); -diff -Nuar flatpak-0.10.3.orig/bubblewrap/bubblewrap.c flatpak-0.10.3/bubblewrap/bubblewrap.c ---- flatpak-0.10.3.orig/bubblewrap/bubblewrap.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/bubblewrap.c 2018-02-03 21:26:06.272233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/bubblewrap.c flatpak-0.11.7/bubblewrap/bubblewrap.c +--- flatpak-0.11.7.orig/bubblewrap/bubblewrap.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/bubblewrap.c 2018-02-03 21:26:06.272233339 +0300 @@ -0,0 +1,2223 @@ +/* bubblewrap + * Copyright (C) 2016 Alexander Larsson @@ -2726,9 +2726,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/bubblewrap.c flatpak-0.10.3/bubblewrap + + return 0; +} -diff -Nuar flatpak-0.10.3.orig/bubblewrap/bubblewrap.jpg flatpak-0.10.3/bubblewrap/bubblewrap.jpg ---- flatpak-0.10.3.orig/bubblewrap/bubblewrap.jpg 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/bubblewrap.jpg 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/bubblewrap.jpg flatpak-0.11.7/bubblewrap/bubblewrap.jpg +--- flatpak-0.11.7.orig/bubblewrap/bubblewrap.jpg 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/bubblewrap.jpg 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,143 @@ +JFIFHHCC  + c6M5G?ory-=:I.l֯v+ܐjJN턐1%=U ɮP|5q6`: y/M=.q$ l_ӛg7} < @@ -2874,9 +2874,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/bubblewrap.jpg flatpak-0.10.3/bubblewr +6Tk`)kj}Ҫ tu )Շ Tf,sB,fţy[6(#hMjkE MkE/\alu-X$_\ r_X 5u97sN=X;Y$1w(yB́lWV%@|xа2:Aˢo=—4^d1K 9I"5E6;f3.26 Yv|7B%ڀ꺾xhk3)iPd#,l6\C=RN#x9Ă :3leS`.“2 >4EdPt' +vɲ]0>g+ \ Dosya sonunda yenisatır yok. -diff -Nuar flatpak-0.10.3.orig/bubblewrap/bwrap.xml flatpak-0.10.3/bubblewrap/bwrap.xml ---- flatpak-0.10.3.orig/bubblewrap/bwrap.xml 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/bwrap.xml 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/bwrap.xml flatpak-0.11.7/bubblewrap/bwrap.xml +--- flatpak-0.11.7.orig/bubblewrap/bwrap.xml 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/bwrap.xml 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,320 @@ + + + + -diff -Nuar flatpak-0.10.3.orig/bubblewrap/ci/redhat-ci.sh flatpak-0.10.3/bubblewrap/ci/redhat-ci.sh ---- flatpak-0.10.3.orig/bubblewrap/ci/redhat-ci.sh 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/ci/redhat-ci.sh 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/ci/redhat-ci.sh flatpak-0.11.7/bubblewrap/ci/redhat-ci.sh +--- flatpak-0.11.7.orig/bubblewrap/ci/redhat-ci.sh 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/ci/redhat-ci.sh 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + @@ -3249,9 +3249,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/ci/redhat-ci.sh flatpak-0.10.3/bubblew +else + buildinstall_to_host +fi -diff -Nuar flatpak-0.10.3.orig/bubblewrap/completions/bash/bwrap flatpak-0.10.3/bubblewrap/completions/bash/bwrap ---- flatpak-0.10.3.orig/bubblewrap/completions/bash/bwrap 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/completions/bash/bwrap 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/completions/bash/bwrap flatpak-0.11.7/bubblewrap/completions/bash/bwrap +--- flatpak-0.11.7.orig/bubblewrap/completions/bash/bwrap 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/completions/bash/bwrap 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,60 @@ +#!/bin/bash +# @@ -3313,9 +3313,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/completions/bash/bwrap flatpak-0.10.3/ + return 0 +} +complete -F _bwrap bwrap -diff -Nuar flatpak-0.10.3.orig/bubblewrap/configure.ac flatpak-0.10.3/bubblewrap/configure.ac ---- flatpak-0.10.3.orig/bubblewrap/configure.ac 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/configure.ac 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/configure.ac flatpak-0.11.7/bubblewrap/configure.ac +--- flatpak-0.11.7.orig/bubblewrap/configure.ac 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/configure.ac 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,127 @@ +AC_PREREQ([2.63]) +AC_INIT([bubblewrap], [0.1.8], [atomic-devel@projectatomic.io]) @@ -3444,9 +3444,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/configure.ac flatpak-0.10.3/bubblewrap + require default userns: $enable_require_userns + mysteriously satisfying to pop: yes" +echo "" -diff -Nuar flatpak-0.10.3.orig/bubblewrap/COPYING flatpak-0.10.3/bubblewrap/COPYING ---- flatpak-0.10.3.orig/bubblewrap/COPYING 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/COPYING 2018-02-03 21:26:06.271233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/COPYING flatpak-0.11.7/bubblewrap/COPYING +--- flatpak-0.11.7.orig/bubblewrap/COPYING 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/COPYING 2018-02-03 21:26:06.271233339 +0300 @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 @@ -3929,9 +3929,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/COPYING flatpak-0.10.3/bubblewrap/COPY + Ty Coon, President of Vice + +That's all there is to it! -diff -Nuar flatpak-0.10.3.orig/bubblewrap/demos/bubblewrap-shell.sh flatpak-0.10.3/bubblewrap/demos/bubblewrap-shell.sh ---- flatpak-0.10.3.orig/bubblewrap/demos/bubblewrap-shell.sh 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/demos/bubblewrap-shell.sh 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/demos/bubblewrap-shell.sh flatpak-0.11.7/bubblewrap/demos/bubblewrap-shell.sh +--- flatpak-0.11.7.orig/bubblewrap/demos/bubblewrap-shell.sh 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/demos/bubblewrap-shell.sh 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Use bubblewrap to run /bin/sh reusing the host OS binaries (/usr), but with @@ -3966,16 +3966,16 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/demos/bubblewrap-shell.sh flatpak-0.10 + /bin/sh) \ + 11< <(getent passwd $UID 65534) \ + 12< <(getent group $(id -g) 65534) -diff -Nuar flatpak-0.10.3.orig/bubblewrap/demos/flatpak.bpf flatpak-0.10.3/bubblewrap/demos/flatpak.bpf ---- flatpak-0.10.3.orig/bubblewrap/demos/flatpak.bpf 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/demos/flatpak.bpf 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/demos/flatpak.bpf flatpak-0.11.7/bubblewrap/demos/flatpak.bpf +--- flatpak-0.11.7.orig/bubblewrap/demos/flatpak.bpf 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/demos/flatpak.bpf 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,2 @@ + >> WeVgUTSRQPONMLKJIH*Gg@F@E@D@C@B@A@@@?@>@=@<@;*@: @9@838@8 T/2)@ 5*) -) 5 5$ '      @ 3Vg{  & 6 += Pf ax T \ Dosya sonunda yenisatır yok. -diff -Nuar flatpak-0.10.3.orig/bubblewrap/demos/flatpak-run.sh flatpak-0.10.3/bubblewrap/demos/flatpak-run.sh ---- flatpak-0.10.3.orig/bubblewrap/demos/flatpak-run.sh 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/demos/flatpak-run.sh 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/demos/flatpak-run.sh flatpak-0.11.7/bubblewrap/demos/flatpak-run.sh +--- flatpak-0.11.7.orig/bubblewrap/demos/flatpak-run.sh 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/demos/flatpak-run.sh 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,65 @@ +#!/bin/bash +# For this to work you first have to run these commands: @@ -4042,14 +4042,14 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/demos/flatpak-run.sh flatpak-0.10.3/bu +name=org.gnome.Weather +runtime=runtime/org.gnome.Platform/x86_64/master +EOF -diff -Nuar flatpak-0.10.3.orig/bubblewrap/.dir-locals.el flatpak-0.10.3/bubblewrap/.dir-locals.el ---- flatpak-0.10.3.orig/bubblewrap/.dir-locals.el 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/.dir-locals.el 2018-02-03 21:26:06.271233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/.dir-locals.el flatpak-0.11.7/bubblewrap/.dir-locals.el +--- flatpak-0.11.7.orig/bubblewrap/.dir-locals.el 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/.dir-locals.el 2018-02-03 21:26:06.271233339 +0300 @@ -0,0 +1 @@ +((c-mode . ((indent-tabs-mode . nil) (c-file-style . "gnu")))) -diff -Nuar flatpak-0.10.3.orig/bubblewrap/.editorconfig flatpak-0.10.3/bubblewrap/.editorconfig ---- flatpak-0.10.3.orig/bubblewrap/.editorconfig 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/.editorconfig 2018-02-03 21:26:06.271233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/.editorconfig flatpak-0.11.7/bubblewrap/.editorconfig +--- flatpak-0.11.7.orig/bubblewrap/.editorconfig 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/.editorconfig 2018-02-03 21:26:06.271233339 +0300 @@ -0,0 +1,6 @@ +[*.[ch]] +indent_style = space @@ -4057,14 +4057,14 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/.editorconfig flatpak-0.10.3/bubblewra +trim_trailing_whitespace = true +indent_brace_style = gnu + -diff -Nuar flatpak-0.10.3.orig/bubblewrap/.git flatpak-0.10.3/bubblewrap/.git ---- flatpak-0.10.3.orig/bubblewrap/.git 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/.git 2018-02-03 21:25:59.242232860 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/.git flatpak-0.11.7/bubblewrap/.git +--- flatpak-0.11.7.orig/bubblewrap/.git 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/.git 2018-02-03 21:25:59.242232860 +0300 @@ -0,0 +1 @@ +gitdir: ../.git/modules/bubblewrap -diff -Nuar flatpak-0.10.3.orig/bubblewrap/git.mk flatpak-0.10.3/bubblewrap/git.mk ---- flatpak-0.10.3.orig/bubblewrap/git.mk 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/git.mk 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/git.mk flatpak-0.11.7/bubblewrap/git.mk +--- flatpak-0.11.7.orig/bubblewrap/git.mk 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/git.mk 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,348 @@ +# git.mk, a small Makefile to autogenerate .gitignore files +# for autotools-based projects. @@ -4414,9 +4414,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/git.mk flatpak-0.10.3/bubblewrap/git.m + -rm -f $(srcdir)/.gitignore + +.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe -diff -Nuar flatpak-0.10.3.orig/bubblewrap/LICENSE flatpak-0.10.3/bubblewrap/LICENSE ---- flatpak-0.10.3.orig/bubblewrap/LICENSE 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/LICENSE 2018-02-03 21:26:06.271233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/LICENSE flatpak-0.11.7/bubblewrap/LICENSE +--- flatpak-0.11.7.orig/bubblewrap/LICENSE 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/LICENSE 2018-02-03 21:26:06.271233339 +0300 @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 @@ -4899,9 +4899,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/LICENSE flatpak-0.10.3/bubblewrap/LICE + Ty Coon, President of Vice + +That's all there is to it! -diff -Nuar flatpak-0.10.3.orig/bubblewrap/m4/attributes.m4 flatpak-0.10.3/bubblewrap/m4/attributes.m4 ---- flatpak-0.10.3.orig/bubblewrap/m4/attributes.m4 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/m4/attributes.m4 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/m4/attributes.m4 flatpak-0.11.7/bubblewrap/m4/attributes.m4 +--- flatpak-0.11.7.orig/bubblewrap/m4/attributes.m4 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/m4/attributes.m4 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,292 @@ +dnl Macros to check the presence of generic (non-typed) symbols. +dnl Copyright (c) 2006-2008 Diego Pettenò @@ -5195,9 +5195,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/m4/attributes.m4 flatpak-0.10.3/bubble + [Define the highest alignment supported]) + fi +]) -diff -Nuar flatpak-0.10.3.orig/bubblewrap/Makefile.am flatpak-0.10.3/bubblewrap/Makefile.am ---- flatpak-0.10.3.orig/bubblewrap/Makefile.am 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/Makefile.am 2018-02-03 21:26:06.271233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/Makefile.am flatpak-0.11.7/bubblewrap/Makefile.am +--- flatpak-0.11.7.orig/bubblewrap/Makefile.am 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/Makefile.am 2018-02-03 21:26:06.271233339 +0300 @@ -0,0 +1,46 @@ +AM_CFLAGS = $(WARN_CFLAGS) +CLEANFILES = @@ -5245,9 +5245,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/Makefile.am flatpak-0.10.3/bubblewrap/ +AM_DISTCHECK_CONFIGURE_FLAGS = \ + --with-bash-completion-dir="\$(datadir)"/bash-completion/ \ + $(NULL) -diff -Nuar flatpak-0.10.3.orig/bubblewrap/Makefile-bwrap.am flatpak-0.10.3/bubblewrap/Makefile-bwrap.am ---- flatpak-0.10.3.orig/bubblewrap/Makefile-bwrap.am 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/Makefile-bwrap.am 2018-02-03 21:26:06.271233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/Makefile-bwrap.am flatpak-0.11.7/bubblewrap/Makefile-bwrap.am +--- flatpak-0.11.7.orig/bubblewrap/Makefile-bwrap.am 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/Makefile-bwrap.am 2018-02-03 21:26:06.271233339 +0300 @@ -0,0 +1,13 @@ + +bwrap_SOURCES = \ @@ -5262,9 +5262,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/Makefile-bwrap.am flatpak-0.10.3/bubbl + +bwrap_CFLAGS = $(AM_CFLAGS) +bwrap_LDADD = $(SELINUX_LIBS) -diff -Nuar flatpak-0.10.3.orig/bubblewrap/Makefile-docs.am flatpak-0.10.3/bubblewrap/Makefile-docs.am ---- flatpak-0.10.3.orig/bubblewrap/Makefile-docs.am 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/Makefile-docs.am 2018-02-03 21:26:06.271233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/Makefile-docs.am flatpak-0.11.7/bubblewrap/Makefile-docs.am +--- flatpak-0.11.7.orig/bubblewrap/Makefile-docs.am 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/Makefile-docs.am 2018-02-03 21:26:06.271233339 +0300 @@ -0,0 +1,18 @@ +XSLTPROC = xsltproc + @@ -5284,9 +5284,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/Makefile-docs.am flatpak-0.10.3/bubble +CLEANFILES += $(man_MANS) +endif +EXTRA_DIST += bwrap.xml -diff -Nuar flatpak-0.10.3.orig/bubblewrap/network.c flatpak-0.10.3/bubblewrap/network.c ---- flatpak-0.10.3.orig/bubblewrap/network.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/network.c 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/network.c flatpak-0.11.7/bubblewrap/network.c +--- flatpak-0.11.7.orig/bubblewrap/network.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/network.c 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,198 @@ +/* bubblewrap + * Copyright (C) 2016 Alexander Larsson @@ -5486,9 +5486,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/network.c flatpak-0.10.3/bubblewrap/ne + if (rtnl_do_request (rtnl_fd, header) != 0) + die_with_error ("loopback: Failed RTM_NEWLINK"); +} -diff -Nuar flatpak-0.10.3.orig/bubblewrap/network.h flatpak-0.10.3/bubblewrap/network.h ---- flatpak-0.10.3.orig/bubblewrap/network.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/network.h 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/network.h flatpak-0.11.7/bubblewrap/network.h +--- flatpak-0.11.7.orig/bubblewrap/network.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/network.h 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,21 @@ +/* bubblewrap + * Copyright (C) 2016 Alexander Larsson @@ -5511,9 +5511,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/network.h flatpak-0.10.3/bubblewrap/ne +#pragma once + +void loopback_setup (void); -diff -Nuar flatpak-0.10.3.orig/bubblewrap/packaging/bubblewrap.spec flatpak-0.10.3/bubblewrap/packaging/bubblewrap.spec ---- flatpak-0.10.3.orig/bubblewrap/packaging/bubblewrap.spec 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/packaging/bubblewrap.spec 2018-02-03 21:26:06.273233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/packaging/bubblewrap.spec flatpak-0.11.7/bubblewrap/packaging/bubblewrap.spec +--- flatpak-0.11.7.orig/bubblewrap/packaging/bubblewrap.spec 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/packaging/bubblewrap.spec 2018-02-03 21:26:06.273233339 +0300 @@ -0,0 +1,49 @@ +%global commit0 66d12bb23b04e201c5846e325f0b10930ed802f8 +%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) @@ -5564,9 +5564,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/packaging/bubblewrap.spec flatpak-0.10 +%endif +%{_mandir}/man1/* + -diff -Nuar flatpak-0.10.3.orig/bubblewrap/README.md flatpak-0.10.3/bubblewrap/README.md ---- flatpak-0.10.3.orig/bubblewrap/README.md 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/README.md 2018-02-03 21:26:06.272233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/README.md flatpak-0.11.7/bubblewrap/README.md +--- flatpak-0.11.7.orig/bubblewrap/README.md 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/README.md 2018-02-03 21:26:06.272233339 +0300 @@ -0,0 +1,179 @@ +Bubblewrap +========== @@ -5747,9 +5747,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/README.md flatpak-0.10.3/bubblewrap/RE +![](bubblewrap.jpg) + +(Bubblewrap cat by [dancing_stupidity](https://www.flickr.com/photos/27549668@N03/)) -diff -Nuar flatpak-0.10.3.orig/bubblewrap/.redhat-ci.yml flatpak-0.10.3/bubblewrap/.redhat-ci.yml ---- flatpak-0.10.3.orig/bubblewrap/.redhat-ci.yml 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/.redhat-ci.yml 2018-02-03 21:26:06.271233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/.redhat-ci.yml flatpak-0.11.7/bubblewrap/.redhat-ci.yml +--- flatpak-0.11.7.orig/bubblewrap/.redhat-ci.yml 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/.redhat-ci.yml 2018-02-03 21:26:06.271233339 +0300 @@ -0,0 +1,25 @@ +context: centos7 +required: true @@ -5776,9 +5776,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/.redhat-ci.yml flatpak-0.10.3/bubblewr + +tests: + - env CFLAGS='-g -Og -fsanitize=undefined -fsanitize=address' ./ci/redhat-ci.sh fedora:25 -diff -Nuar flatpak-0.10.3.orig/bubblewrap/tests/test-run.sh flatpak-0.10.3/bubblewrap/tests/test-run.sh ---- flatpak-0.10.3.orig/bubblewrap/tests/test-run.sh 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/tests/test-run.sh 2018-02-03 21:26:06.274233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/tests/test-run.sh flatpak-0.11.7/bubblewrap/tests/test-run.sh +--- flatpak-0.11.7.orig/bubblewrap/tests/test-run.sh 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/tests/test-run.sh 2018-02-03 21:26:06.274233339 +0300 @@ -0,0 +1,132 @@ +#!/bin/bash + @@ -5912,9 +5912,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/tests/test-run.sh flatpak-0.10.3/bubbl +done + +echo OK -diff -Nuar flatpak-0.10.3.orig/bubblewrap/.travis.yml flatpak-0.10.3/bubblewrap/.travis.yml ---- flatpak-0.10.3.orig/bubblewrap/.travis.yml 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/.travis.yml 2018-02-03 21:26:06.271233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/.travis.yml flatpak-0.11.7/bubblewrap/.travis.yml +--- flatpak-0.11.7.orig/bubblewrap/.travis.yml 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/.travis.yml 2018-02-03 21:26:06.271233339 +0300 @@ -0,0 +1,25 @@ +language: c +dist: trusty @@ -5941,9 +5941,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/.travis.yml flatpak-0.10.3/bubblewrap/ + only: + - auto + -diff -Nuar flatpak-0.10.3.orig/bubblewrap/uncrustify.cfg flatpak-0.10.3/bubblewrap/uncrustify.cfg ---- flatpak-0.10.3.orig/bubblewrap/uncrustify.cfg 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/uncrustify.cfg 2018-02-03 21:26:06.274233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/uncrustify.cfg flatpak-0.11.7/bubblewrap/uncrustify.cfg +--- flatpak-0.11.7.orig/bubblewrap/uncrustify.cfg 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/uncrustify.cfg 2018-02-03 21:26:06.274233339 +0300 @@ -0,0 +1,136 @@ +newlines lf + @@ -6081,15 +6081,15 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/uncrustify.cfg flatpak-0.10.3/bubblewr +# positioning +pos_bool Trail +pos_conditional Trail -diff -Nuar flatpak-0.10.3.orig/bubblewrap/uncrustify.sh flatpak-0.10.3/bubblewrap/uncrustify.sh ---- flatpak-0.10.3.orig/bubblewrap/uncrustify.sh 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/uncrustify.sh 2018-02-03 21:26:06.274233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/uncrustify.sh flatpak-0.11.7/bubblewrap/uncrustify.sh +--- flatpak-0.11.7.orig/bubblewrap/uncrustify.sh 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/uncrustify.sh 2018-02-03 21:26:06.274233339 +0300 @@ -0,0 +1,2 @@ +#!/bin/sh +uncrustify -c uncrustify.cfg --no-backup `git ls-tree --name-only -r HEAD | grep \\\.[ch]$` -diff -Nuar flatpak-0.10.3.orig/bubblewrap/utils.c flatpak-0.10.3/bubblewrap/utils.c ---- flatpak-0.10.3.orig/bubblewrap/utils.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/utils.c 2018-02-03 21:26:06.274233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/utils.c flatpak-0.11.7/bubblewrap/utils.c +--- flatpak-0.11.7.orig/bubblewrap/utils.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/utils.c 2018-02-03 21:26:06.274233339 +0300 @@ -0,0 +1,709 @@ +/* bubblewrap + * Copyright (C) 2016 Alexander Larsson @@ -6800,9 +6800,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/utils.c flatpak-0.10.3/bubblewrap/util +#endif + return 0; +} -diff -Nuar flatpak-0.10.3.orig/bubblewrap/utils.h flatpak-0.10.3/bubblewrap/utils.h ---- flatpak-0.10.3.orig/bubblewrap/utils.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/bubblewrap/utils.h 2018-02-03 21:26:06.274233339 +0300 +diff -Nuar flatpak-0.11.7.orig/bubblewrap/utils.h flatpak-0.11.7/bubblewrap/utils.h +--- flatpak-0.11.7.orig/bubblewrap/utils.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/bubblewrap/utils.h 2018-02-03 21:26:06.274233339 +0300 @@ -0,0 +1,166 @@ +/* bubblewrap + * Copyright (C) 2016 Alexander Larsson @@ -6970,9 +6970,9 @@ diff -Nuar flatpak-0.10.3.orig/bubblewrap/utils.h flatpak-0.10.3/bubblewrap/util +/* type safety */ +#define steal_pointer(pp) \ + (0 ? (*(pp)) : (steal_pointer) (pp)) -diff -Nuar flatpak-0.10.3.orig/libglnx/COPYING flatpak-0.10.3/libglnx/COPYING ---- flatpak-0.10.3.orig/libglnx/COPYING 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/COPYING 2018-02-03 21:26:06.307233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/COPYING flatpak-0.11.7/libglnx/COPYING +--- flatpak-0.11.7.orig/libglnx/COPYING 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/COPYING 2018-02-03 21:26:06.307233341 +0300 @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 @@ -7476,14 +7476,14 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/COPYING flatpak-0.10.3/libglnx/COPYING + Ty Coon, President of Vice + +That's all there is to it! -diff -Nuar flatpak-0.10.3.orig/libglnx/.git flatpak-0.10.3/libglnx/.git ---- flatpak-0.10.3.orig/libglnx/.git 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/.git 2018-02-03 21:26:06.241233337 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/.git flatpak-0.11.7/libglnx/.git +--- flatpak-0.11.7.orig/libglnx/.git 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/.git 2018-02-03 21:26:06.241233337 +0300 @@ -0,0 +1 @@ +gitdir: ../.git/modules/libglnx -diff -Nuar flatpak-0.10.3.orig/libglnx/.gitignore flatpak-0.10.3/libglnx/.gitignore ---- flatpak-0.10.3.orig/libglnx/.gitignore 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/.gitignore 2018-02-03 21:26:06.307233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/.gitignore flatpak-0.11.7/libglnx/.gitignore +--- flatpak-0.11.7.orig/libglnx/.gitignore 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/.gitignore 2018-02-03 21:26:06.307233341 +0300 @@ -0,0 +1,16 @@ +# A path ostree writes to work around automake bug with +# subdir-objects @@ -7501,9 +7501,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/.gitignore flatpak-0.10.3/libglnx/.gitign +*.stamp +*~ + -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-backport-autocleanups.h flatpak-0.10.3/libglnx/glnx-backport-autocleanups.h ---- flatpak-0.10.3.orig/libglnx/glnx-backport-autocleanups.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-backport-autocleanups.h 2018-02-03 21:26:06.307233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-backport-autocleanups.h flatpak-0.11.7/libglnx/glnx-backport-autocleanups.h +--- flatpak-0.11.7.orig/libglnx/glnx-backport-autocleanups.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-backport-autocleanups.h 2018-02-03 21:26:06.307233341 +0300 @@ -0,0 +1,124 @@ +/* + * Copyright © 2015 Canonical Limited @@ -7629,9 +7629,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-backport-autocleanups.h flatpak-0.10 +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GString, g_autoptr_cleanup_gstring_free) + +#endif -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-backport-autoptr.h flatpak-0.10.3/libglnx/glnx-backport-autoptr.h ---- flatpak-0.10.3.orig/libglnx/glnx-backport-autoptr.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-backport-autoptr.h 2018-02-03 21:26:06.308233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-backport-autoptr.h flatpak-0.11.7/libglnx/glnx-backport-autoptr.h +--- flatpak-0.11.7.orig/libglnx/glnx-backport-autoptr.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-backport-autoptr.h 2018-02-03 21:26:06.308233341 +0300 @@ -0,0 +1,133 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -7766,9 +7766,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-backport-autoptr.h flatpak-0.10.3/li +#endif /* !GLIB_CHECK_VERSION(2, 43, 3) */ + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-backports.c flatpak-0.10.3/libglnx/glnx-backports.c ---- flatpak-0.10.3.orig/libglnx/glnx-backports.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-backports.c 2018-02-03 21:26:06.308233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-backports.c flatpak-0.11.7/libglnx/glnx-backports.c +--- flatpak-0.11.7.orig/libglnx/glnx-backports.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-backports.c 2018-02-03 21:26:06.308233341 +0300 @@ -0,0 +1,61 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -7831,9 +7831,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-backports.c flatpak-0.10.3/libglnx/g + return TRUE; +} +#endif -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-backports.h flatpak-0.10.3/libglnx/glnx-backports.h ---- flatpak-0.10.3.orig/libglnx/glnx-backports.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-backports.h 2018-02-03 21:26:06.308233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-backports.h flatpak-0.11.7/libglnx/glnx-backports.h +--- flatpak-0.11.7.orig/libglnx/glnx-backports.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-backports.h 2018-02-03 21:26:06.308233341 +0300 @@ -0,0 +1,46 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -7881,10 +7881,10 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-backports.h flatpak-0.10.3/libglnx/g +#endif /* !GLIB_CHECK_VERSION(2, 44, 0) */ + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.c flatpak-0.10.3/libglnx/glnx-console.c ---- flatpak-0.10.3.orig/libglnx/glnx-console.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-console.c 2018-02-03 21:26:06.308233341 +0300 -@@ -0,0 +1,309 @@ +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-console.c flatpak-0.11.7/libglnx/glnx-console.c +--- flatpak-0.11.7.orig/libglnx/glnx-console.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-console.c 2018-05-26 00:50:25.433037228 +0300 +@@ -0,0 +1,359 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2013,2014,2015 Colin Walters @@ -7916,12 +7916,25 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.c flatpak-0.10.3/libglnx/gln +#include +#include + -+static char *current_text = NULL; -+static gint current_percent = -1; -+static gboolean locked; ++/* For people with widescreen monitors and maximized terminals, it looks pretty ++ * bad to have an enormous progress bar. For much the same reason as web pages ++ * tend to have a maximum width; ++ * https://ux.stackexchange.com/questions/48982/suggest-good-max-width-for-fluid-width-design ++ */ ++#define MAX_PROGRESSBAR_COLUMNS 20 + -+static gboolean -+stdout_is_tty (void) ++/* Max updates output per second. On a tty there's no point to rendering ++ * extremely fast; and for a non-tty we're probably in a Jenkins job ++ * or whatever and having percentages spam multiple lines there is annoying. ++ */ ++#define MAX_TTY_UPDATE_HZ (5) ++#define MAX_NONTTY_UPDATE_HZ (1) ++ ++static gboolean locked; ++static guint64 last_update_ms; /* monotonic time in millis we last updated */ ++ ++gboolean ++glnx_stdout_is_tty (void) +{ + static gsize initialized = 0; + static gboolean stdout_is_tty_v; @@ -8030,12 +8043,10 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.c flatpak-0.10.3/libglnx/gln + g_return_if_fail (!locked); + g_return_if_fail (!console->locked); + -+ console->is_tty = stdout_is_tty (); ++ console->is_tty = glnx_stdout_is_tty (); + + locked = console->locked = TRUE; + -+ current_percent = 0; -+ + if (console->is_tty) + { + if (g_once_init_enter (&sigwinch_initialized)) @@ -8068,6 +8079,26 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.c flatpak-0.10.3/libglnx/gln +text_percent_internal (const char *text, + int percentage) +{ ++ /* Check whether we're trying to render too fast; unless percentage is 100, in ++ * which case we assume this is the last call, so we always render it. ++ */ ++ const guint64 current_ms = g_get_monotonic_time () / 1000; ++ if (percentage != 100) ++ { ++ const guint64 diff_ms = current_ms - last_update_ms; ++ if (glnx_stdout_is_tty ()) ++ { ++ if (diff_ms < (1000/MAX_TTY_UPDATE_HZ)) ++ return; ++ } ++ else ++ { ++ if (diff_ms < (1000/MAX_NONTTY_UPDATE_HZ)) ++ return; ++ } ++ } ++ last_update_ms = current_ms; ++ + static const char equals[] = "===================="; + const guint n_equals = sizeof (equals) - 1; + static const char spaces[] = " "; @@ -8080,11 +8111,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.c flatpak-0.10.3/libglnx/gln + + const guint input_textlen = text ? strlen (text) : 0; + -+ if (percentage == current_percent -+ && g_strcmp0 (text, current_text) == 0) -+ return; -+ -+ if (!stdout_is_tty ()) ++ if (!glnx_stdout_is_tty ()) + { + if (text) + fprintf (stdout, "%s", text); @@ -8119,7 +8146,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.c flatpak-0.10.3/libglnx/gln + else + { + const guint textlen = MIN (input_textlen, ncolumns - bar_min); -+ const guint barlen = ncolumns - (textlen + 1);; ++ const guint barlen = MIN (MAX_PROGRESSBAR_COLUMNS, ncolumns - (textlen + 1)); + + if (textlen > 0) + { @@ -8132,7 +8159,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.c flatpak-0.10.3/libglnx/gln + const guint textpercent_len = 5; + const guint bar_internal_len = barlen - nbraces - textpercent_len; + const guint eqlen = bar_internal_len * (percentage / 100.0); -+ const guint spacelen = bar_internal_len - eqlen; ++ const guint spacelen = bar_internal_len - eqlen; + + fputc ('[', stdout); + printpad (equals, n_equals, eqlen); @@ -8167,6 +8194,32 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.c flatpak-0.10.3/libglnx/gln + text_percent_internal (text, percentage); +} + ++/** ++ * glnx_console_progress_n_items: ++ * @text: Show this text before the progress bar ++ * @current: An integer for how many items have been processed ++ * @total: An integer for how many items there are total ++ * ++ * On a tty, print to the console @text followed by [@current/@total], ++ * then an ASCII art progress bar, like glnx_console_progress_text_percent(). ++ * ++ * You must have called glnx_console_lock() before invoking this ++ * function. ++ */ ++void ++glnx_console_progress_n_items (const char *text, ++ guint current, ++ guint total) ++{ ++ g_return_if_fail (current <= total); ++ g_return_if_fail (total > 0); ++ ++ g_autofree char *newtext = g_strdup_printf ("%s (%u/%u)", text, current, total); ++ /* Special case current == total to ensure we end at 100% */ ++ int percentage = (current == total) ? 100 : (((double)current) / total * 100); ++ glnx_console_progress_text_percent (newtext, percentage); ++} ++ +void +glnx_console_text (const char *text) +{ @@ -8186,18 +8239,15 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.c flatpak-0.10.3/libglnx/gln + g_return_if_fail (locked); + g_return_if_fail (console->locked); + -+ current_percent = -1; -+ g_clear_pointer (¤t_text, g_free); -+ + if (console->is_tty) + fputc ('\n', stdout); + + locked = console->locked = FALSE; +} -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.h flatpak-0.10.3/libglnx/glnx-console.h ---- flatpak-0.10.3.orig/libglnx/glnx-console.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-console.h 2018-02-03 21:26:06.308233341 +0300 -@@ -0,0 +1,55 @@ +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-console.h flatpak-0.11.7/libglnx/glnx-console.h +--- flatpak-0.11.7.orig/libglnx/glnx-console.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-console.h 2018-05-26 00:50:25.433037228 +0300 +@@ -0,0 +1,61 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2013,2014,2015 Colin Walters @@ -8231,12 +8281,18 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.h flatpak-0.10.3/libglnx/gln + +typedef struct GLnxConsoleRef GLnxConsoleRef; + ++gboolean glnx_stdout_is_tty (void); ++ +void glnx_console_lock (GLnxConsoleRef *ref); + +void glnx_console_text (const char *text); + +void glnx_console_progress_text_percent (const char *text, -+ guint percentage); ++ guint percentage); ++ ++void glnx_console_progress_n_items (const char *text, ++ guint current, ++ guint total); + +void glnx_console_unlock (GLnxConsoleRef *ref); + @@ -8253,10 +8309,10 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-console.h flatpak-0.10.3/libglnx/gln +G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxConsoleRef, glnx_console_ref_cleanup) + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-dirfd.c flatpak-0.10.3/libglnx/glnx-dirfd.c ---- flatpak-0.10.3.orig/libglnx/glnx-dirfd.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-dirfd.c 2018-02-03 21:26:06.308233341 +0300 -@@ -0,0 +1,432 @@ +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-dirfd.c flatpak-0.11.7/libglnx/glnx-dirfd.c +--- flatpak-0.11.7.orig/libglnx/glnx-dirfd.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-dirfd.c 2018-05-26 00:50:25.433037228 +0300 +@@ -0,0 +1,425 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -8358,7 +8414,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-dirfd.c flatpak-0.10.3/libglnx/glnx- + GLnxDirFdIterator *out_dfd_iter, + GError **error) +{ -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + if (!glnx_opendirat (dfd, path, follow, &fd, error)) + return FALSE; + @@ -8449,15 +8505,12 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-dirfd.c flatpak-0.10.3/libglnx/glnx- + GCancellable *cancellable, + GError **error) +{ -+ struct dirent *ret_dent; -+ + g_return_val_if_fail (out_dent, FALSE); + + if (!glnx_dirfd_iterator_next_dent (dfd_iter, out_dent, cancellable, error)) + return FALSE; + -+ ret_dent = *out_dent; -+ ++ struct dirent *ret_dent = *out_dent; + if (ret_dent) + { + @@ -8524,20 +8577,16 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-dirfd.c flatpak-0.10.3/libglnx/glnx- +void +glnx_gen_temp_name (gchar *tmpl) +{ -+ size_t len; -+ char *XXXXXX; -+ int i; ++ g_return_if_fail (tmpl != NULL); ++ const size_t len = strlen (tmpl); ++ g_return_if_fail (len >= 6); ++ + static const char letters[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + static const int NLETTERS = sizeof (letters) - 1; + -+ g_return_if_fail (tmpl != NULL); -+ len = strlen (tmpl); -+ g_return_if_fail (len >= 6); -+ -+ XXXXXX = tmpl + (len - 6); -+ -+ for (i = 0; i < 6; i++) ++ char *XXXXXX = tmpl + (len - 6); ++ for (int i = 0; i < 6; i++) + XXXXXX[i] = letters[g_random_int_range(0, NLETTERS)]; +} + @@ -8585,7 +8634,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-dirfd.c flatpak-0.10.3/libglnx/glnx- + } + + /* And open it */ -+ glnx_fd_close int ret_dfd = -1; ++ glnx_autofd int ret_dfd = -1; + if (!glnx_opendirat (dfd, path, FALSE, &ret_dfd, error)) + { + /* If we fail to open, let's try to clean up */ @@ -8689,9 +8738,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-dirfd.c flatpak-0.10.3/libglnx/glnx- +{ + (void) _glnx_tmpdir_free (tmpf, FALSE, NULL, NULL); +} -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-dirfd.h flatpak-0.10.3/libglnx/glnx-dirfd.h ---- flatpak-0.10.3.orig/libglnx/glnx-dirfd.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-dirfd.h 2018-02-03 21:26:06.308233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-dirfd.h flatpak-0.11.7/libglnx/glnx-dirfd.h +--- flatpak-0.11.7.orig/libglnx/glnx-dirfd.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-dirfd.h 2018-02-03 21:26:06.308233341 +0300 @@ -0,0 +1,137 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -8830,10 +8879,10 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-dirfd.h flatpak-0.10.3/libglnx/glnx- + GLnxTmpDir *out_tmpdir, GError **error); + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-errors.c flatpak-0.10.3/libglnx/glnx-errors.c ---- flatpak-0.10.3.orig/libglnx/glnx-errors.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-errors.c 2018-02-03 21:26:06.308233341 +0300 -@@ -0,0 +1,56 @@ +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-errors.c flatpak-0.11.7/libglnx/glnx-errors.c +--- flatpak-0.11.7.orig/libglnx/glnx-errors.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-errors.c 2018-05-26 00:50:25.433037228 +0300 +@@ -0,0 +1,131 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -8859,6 +8908,32 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-errors.c flatpak-0.10.3/libglnx/glnx +#include +#include + ++/* Set @error with G_IO_ERROR/G_IO_ERROR_FAILED. ++ * ++ * This function returns %FALSE so it can be used conveniently in a single ++ * statement: ++ * ++ * ``` ++ * if (strcmp (foo, "somevalue") != 0) ++ * return glnx_throw (error, "key must be somevalue, not '%s'", foo); ++ * ``` ++ */ ++gboolean ++glnx_throw (GError **error, ++ const char *fmt, ++ ...) ++{ ++ if (error == NULL) ++ return FALSE; ++ ++ va_list args; ++ va_start (args, fmt); ++ GError *new = g_error_new_valist (G_IO_ERROR, G_IO_ERROR_FAILED, fmt, args); ++ va_end (args); ++ g_propagate_error (error, g_steal_pointer (&new)); ++ return FALSE; ++} ++ +void +glnx_real_set_prefix_error_va (GError *error, + const char *format, @@ -8875,6 +8950,30 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-errors.c flatpak-0.10.3/libglnx/glnx + error->message = g_string_free (g_steal_pointer (&buf), FALSE); +} + ++/* Prepend to @error's message by `$prefix: ` where `$prefix` is computed via ++ * printf @fmt. Returns %FALSE so it can be used conveniently in a single ++ * statement: ++ * ++ * ``` ++ * if (!function_that_fails (s, error)) ++ * return glnx_throw_prefix (error, "while handling '%s'", s); ++ * ``` ++ * */ ++gboolean ++glnx_prefix_error (GError **error, ++ const char *fmt, ++ ...) ++{ ++ if (error == NULL) ++ return FALSE; ++ ++ va_list args; ++ va_start (args, fmt); ++ glnx_real_set_prefix_error_va (*error, fmt, args); ++ va_end (args); ++ return FALSE; ++} ++ +void +glnx_real_set_prefix_error_from_errno_va (GError **error, + gint errsv, @@ -8890,10 +8989,35 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-errors.c flatpak-0.10.3/libglnx/glnx + g_strerror (errsv)); + glnx_real_set_prefix_error_va (*error, format, args); +} -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-errors.h flatpak-0.10.3/libglnx/glnx-errors.h ---- flatpak-0.10.3.orig/libglnx/glnx-errors.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-errors.h 2018-02-03 21:26:06.308233341 +0300 -@@ -0,0 +1,197 @@ ++ ++/* Set @error using the value of `$prefix: g_strerror (errno)` where `$prefix` ++ * is computed via printf @fmt. ++ * ++ * This function returns %FALSE so it can be used conveniently in a single ++ * statement: ++ * ++ * ``` ++ * return glnx_throw_errno_prefix (error, "unlinking %s", pathname); ++ * ``` ++ */ ++gboolean ++glnx_throw_errno_prefix (GError **error, ++ const char *fmt, ++ ...) ++{ ++ int errsv = errno; ++ va_list args; ++ va_start (args, fmt); ++ glnx_real_set_prefix_error_from_errno_va (error, errsv, fmt, args); ++ va_end (args); ++ /* See comment in glnx_throw_errno() about preserving errno */ ++ errno = errsv; ++ return FALSE; ++} +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-errors.h flatpak-0.11.7/libglnx/glnx-errors.h +--- flatpak-0.11.7.orig/libglnx/glnx-errors.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-errors.h 2018-05-26 00:50:25.433037228 +0300 +@@ -0,0 +1,134 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -8921,29 +9045,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-errors.h flatpak-0.10.3/libglnx/glnx + +G_BEGIN_DECLS + -+/* Set @error with G_IO_ERROR/G_IO_ERROR_FAILED. -+ * -+ * This function returns %FALSE so it can be used conveniently in a single -+ * statement: -+ * -+ * ``` -+ * if (strcmp (foo, "somevalue") != 0) -+ * return glnx_throw (error, "key must be somevalue, not '%s'", foo); -+ * ``` -+ */ -+static inline gboolean G_GNUC_PRINTF (2,3) -+glnx_throw (GError **error, const char *fmt, ...) -+{ -+ if (error == NULL) -+ return FALSE; -+ -+ va_list args; -+ va_start (args, fmt); -+ GError *new = g_error_new_valist (G_IO_ERROR, G_IO_ERROR_FAILED, fmt, args); -+ va_end (args); -+ g_propagate_error (error, g_steal_pointer (&new)); -+ return FALSE; -+} ++gboolean glnx_throw (GError **error, const char *fmt, ...) G_GNUC_PRINTF (2,3); + +/* Like `glnx_throw ()`, but returns %NULL. */ +#define glnx_null_throw(error, args...) \ @@ -8954,27 +9056,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-errors.h flatpak-0.10.3/libglnx/glnx + const char *format, + va_list args) G_GNUC_PRINTF (2,0); + -+/* Prepend to @error's message by `$prefix: ` where `$prefix` is computed via -+ * printf @fmt. Returns %FALSE so it can be used conveniently in a single -+ * statement: -+ * -+ * ``` -+ * if (!function_that_fails (s, error)) -+ * return glnx_throw_prefix (error, "while handling '%s'", s); -+ * ``` -+ * */ -+static inline gboolean G_GNUC_PRINTF (2,3) -+glnx_prefix_error (GError **error, const char *fmt, ...) -+{ -+ if (error == NULL) -+ return FALSE; -+ -+ va_list args; -+ va_start (args, fmt); -+ glnx_real_set_prefix_error_va (*error, fmt, args); -+ va_end (args); -+ return FALSE; -+} ++gboolean glnx_prefix_error (GError **error, const char *fmt, ...) G_GNUC_PRINTF (2,3); + +/* Like `glnx_prefix_error ()`, but returns %NULL. */ +#define glnx_prefix_error_null(error, args...) \ @@ -9051,28 +9133,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-errors.h flatpak-0.10.3/libglnx/glnx + const char *format, + va_list args) G_GNUC_PRINTF (3,0); + -+/* Set @error using the value of `$prefix: g_strerror (errno)` where `$prefix` -+ * is computed via printf @fmt. -+ * -+ * This function returns %FALSE so it can be used conveniently in a single -+ * statement: -+ * -+ * ``` -+ * return glnx_throw_errno_prefix (error, "unlinking %s", pathname); -+ * ``` -+ */ -+static inline gboolean G_GNUC_PRINTF (2,3) -+glnx_throw_errno_prefix (GError **error, const char *fmt, ...) -+{ -+ int errsv = errno; -+ va_list args; -+ va_start (args, fmt); -+ glnx_real_set_prefix_error_from_errno_va (error, errsv, fmt, args); -+ va_end (args); -+ /* See comment above about preserving errno */ -+ errno = errsv; -+ return FALSE; -+} ++gboolean glnx_throw_errno_prefix (GError **error, const char *fmt, ...) G_GNUC_PRINTF (2,3); + +/* Like glnx_throw_errno_prefix(), but yields a NULL pointer. */ +#define glnx_null_throw_errno_prefix(error, args...) \ @@ -9091,10 +9152,10 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-errors.h flatpak-0.10.3/libglnx/glnx + } while (0); + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-fdio.c ---- flatpak-0.10.3.orig/libglnx/glnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-fdio.c 2018-02-03 21:26:06.308233341 +0300 -@@ -0,0 +1,1116 @@ +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-fdio.c flatpak-0.11.7/libglnx/glnx-fdio.c +--- flatpak-0.11.7.orig/libglnx/glnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-fdio.c 2018-05-26 00:50:25.434037228 +0300 +@@ -0,0 +1,1106 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -9272,11 +9333,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-f + return; + if (!tmpf->initialized) + return; -+ if (tmpf->fd != -1) -+ { -+ if (close (tmpf->fd) < 0) -+ g_assert (errno != EBADF); -+ } ++ glnx_close_fd (&tmpf->fd); + /* If ->path is set, we're likely aborting due to an error. Clean it up */ + if (tmpf->path) + { @@ -9292,9 +9349,8 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-f + GLnxTmpfile *out_tmpf, + GError **error) +{ ++ /* Picked this to match mkstemp() */ + const guint mode = 0600; -+ glnx_fd_close int fd = -1; -+ int count; + + dfd = glnx_dirfd_canonicalize (dfd); + @@ -9305,33 +9361,35 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-f + * link_tmpfile() below to rename the result after writing the file + * in full. */ +#if defined(O_TMPFILE) && !defined(DISABLE_OTMPFILE) && !defined(ENABLE_WRPSEUDO_COMPAT) -+ fd = openat (dfd, subpath, O_TMPFILE|flags, mode); -+ if (fd == -1 && !(G_IN_SET(errno, ENOSYS, EISDIR, EOPNOTSUPP))) -+ return glnx_throw_errno_prefix (error, "open(O_TMPFILE)"); -+ if (fd != -1) -+ { -+ /* Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=17523 -+ * See also https://github.com/ostreedev/ostree/issues/991 -+ */ -+ if (fchmod (fd, mode) < 0) -+ return glnx_throw_errno_prefix (error, "fchmod"); -+ out_tmpf->initialized = TRUE; -+ out_tmpf->src_dfd = dfd; /* Copied; caller must keep open */ -+ out_tmpf->fd = glnx_steal_fd (&fd); -+ out_tmpf->path = NULL; -+ return TRUE; -+ } ++ { ++ glnx_autofd int fd = openat (dfd, subpath, O_TMPFILE|flags, mode); ++ if (fd == -1 && !(G_IN_SET(errno, ENOSYS, EISDIR, EOPNOTSUPP))) ++ return glnx_throw_errno_prefix (error, "open(O_TMPFILE)"); ++ if (fd != -1) ++ { ++ /* Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=17523 ++ * See also https://github.com/ostreedev/ostree/issues/991 ++ */ ++ if (fchmod (fd, mode) < 0) ++ return glnx_throw_errno_prefix (error, "fchmod"); ++ out_tmpf->initialized = TRUE; ++ out_tmpf->src_dfd = dfd; /* Copied; caller must keep open */ ++ out_tmpf->fd = glnx_steal_fd (&fd); ++ out_tmpf->path = NULL; ++ return TRUE; ++ } ++ } + /* Fallthrough */ +#endif + ++ const guint count_max = 100; + { g_autofree char *tmp = g_strconcat (subpath, "/tmp.XXXXXX", NULL); -+ const guint count_max = 100; + -+ for (count = 0; count < count_max; count++) ++ for (int count = 0; count < count_max; count++) + { + glnx_gen_temp_name (tmp); + -+ fd = openat (dfd, tmp, O_CREAT|O_EXCL|O_NOFOLLOW|O_NOCTTY|flags, mode); ++ glnx_autofd int fd = openat (dfd, tmp, O_CREAT|O_EXCL|O_NOFOLLOW|O_NOCTTY|flags, mode); + if (fd < 0) + { + if (errno == EEXIST) @@ -9350,7 +9408,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-f + } + } + g_set_error (error, G_IO_ERROR, G_IO_ERROR_EXISTS, -+ "Exhausted %u attempts to create temporary file", count); ++ "Exhausted %u attempts to create temporary file", count_max); + return FALSE; +} + @@ -9460,9 +9518,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-f + char *dnbuf = strdupa (target); + const char *dn = dirname (dnbuf); + char *tmpname_buf = glnx_strjoina (dn, "/tmp.XXXXXX"); -+ guint count; -+ const guint count_max = 100; + ++ const guint count_max = 100; ++ guint count; + for (count = 0; count < count_max; count++) + { + glnx_gen_temp_name (tmpname_buf); @@ -9673,7 +9731,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-f +{ + dfd = glnx_dirfd_canonicalize (dfd); + -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + if (!glnx_openat_rdonly (dfd, subpath, TRUE, &fd, error)) + return NULL; + @@ -9703,17 +9761,13 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-f + GCancellable *cancellable, + GError **error) +{ -+ size_t l = 100; -+ + dfd = glnx_dirfd_canonicalize (dfd); + ++ size_t l = 100; + for (;;) + { -+ g_autofree char *c = NULL; -+ ssize_t n; -+ -+ c = g_malloc (l); -+ n = TEMP_FAILURE_RETRY (readlinkat (dfd, subpath, c, l-1)); ++ g_autofree char *c = g_malloc (l); ++ ssize_t n = TEMP_FAILURE_RETRY (readlinkat (dfd, subpath, c, l-1)); + if (n < 0) + return glnx_null_throw_errno_prefix (error, "readlinkat"); + @@ -9783,18 +9837,15 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-f +int +glnx_loop_write(int fd, const void *buf, size_t nbytes) +{ -+ const uint8_t *p = buf; -+ -+ g_return_val_if_fail(fd >= 0, -1); -+ g_return_val_if_fail(buf, -1); ++ g_return_val_if_fail (fd >= 0, -1); ++ g_return_val_if_fail (buf, -1); + + errno = 0; + ++ const uint8_t *p = buf; + while (nbytes > 0) + { -+ ssize_t k; -+ -+ k = write(fd, p, nbytes); ++ ssize_t k = write(fd, p, nbytes); + if (k < 0) + { + if (errno == EINTR) @@ -10030,7 +10081,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-f + + /* Regular file path below here */ + -+ glnx_fd_close int src_fd = -1; ++ glnx_autofd int src_fd = -1; + if (!glnx_openat_rdonly (src_dfd, src_subpath, FALSE, &src_fd, error)) + return FALSE; + @@ -10211,10 +10262,10 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.c flatpak-0.10.3/libglnx/glnx-f + + return TRUE; +} -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.h flatpak-0.10.3/libglnx/glnx-fdio.h ---- flatpak-0.10.3.orig/libglnx/glnx-fdio.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-fdio.h 2018-02-03 21:26:06.308233341 +0300 -@@ -0,0 +1,372 @@ +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-fdio.h flatpak-0.11.7/libglnx/glnx-fdio.h +--- flatpak-0.11.7.orig/libglnx/glnx-fdio.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-fdio.h 2018-05-26 00:50:25.434037228 +0300 +@@ -0,0 +1,369 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -10246,12 +10297,8 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.h flatpak-0.10.3/libglnx/glnx-f +#include +#include +#include -+/* From systemd/src/shared/util.h */ -+/* When we include libgen.h because we need dirname() we immediately -+ * undefine basename() since libgen.h defines it as a macro to the XDG -+ * version which is really broken. */ ++// For dirname(), and previously basename() +#include -+#undef basename + +#include +#include @@ -10264,7 +10311,12 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.h flatpak-0.10.3/libglnx/glnx-f +static inline +const char *glnx_basename (const char *path) +{ -+ return (basename) (path); ++ gchar *base = strrchr (path, G_DIR_SEPARATOR); ++ ++ if (base) ++ return base + 1; ++ ++ return path; +} + +/* Utilities for standard FILE* */ @@ -10535,16 +10587,12 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.h flatpak-0.10.3/libglnx/glnx-f + int flags, + GError **error) +{ -+ struct stat stbuf; -+ if (TEMP_FAILURE_RETRY (fstatat (dfd, path, out_buf ?: &stbuf, flags)) != 0) ++ G_GNUC_UNUSED struct stat unused_stbuf; ++ if (TEMP_FAILURE_RETRY (fstatat (dfd, path, out_buf ? out_buf : &unused_stbuf, flags)) != 0) + { + if (errno != ENOENT) -+ { -+ int errsv = errno; -+ (void) glnx_throw_errno_prefix (error, "fstatat(%s)", path); -+ errno = errsv; -+ return FALSE; -+ } ++ return glnx_throw_errno_prefix (error, "fstatat(%s)", path); ++ /* Note we preserve errno as ENOENT */ + } + else + errno = 0; @@ -10587,9 +10635,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-fdio.h flatpak-0.10.3/libglnx/glnx-f +} + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-local-alloc.c flatpak-0.10.3/libglnx/glnx-local-alloc.c ---- flatpak-0.10.3.orig/libglnx/glnx-local-alloc.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-local-alloc.c 2018-02-03 21:26:06.308233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-local-alloc.c flatpak-0.11.7/libglnx/glnx-local-alloc.c +--- flatpak-0.11.7.orig/libglnx/glnx-local-alloc.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-local-alloc.c 2018-02-03 21:26:06.308233341 +0300 @@ -0,0 +1,72 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -10663,9 +10711,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-local-alloc.c flatpak-0.10.3/libglnx + * + * + */ -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-local-alloc.h flatpak-0.10.3/libglnx/glnx-local-alloc.h ---- flatpak-0.10.3.orig/libglnx/glnx-local-alloc.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-local-alloc.h 2018-02-03 21:26:06.308233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-local-alloc.h flatpak-0.11.7/libglnx/glnx-local-alloc.h +--- flatpak-0.11.7.orig/libglnx/glnx-local-alloc.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-local-alloc.h 2018-02-03 21:26:06.308233341 +0300 @@ -0,0 +1,91 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -10758,9 +10806,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-local-alloc.h flatpak-0.10.3/libglnx +#define glnx_autofd __attribute__((cleanup(glnx_close_fd))) + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-lockfile.c flatpak-0.10.3/libglnx/glnx-lockfile.c ---- flatpak-0.10.3.orig/libglnx/glnx-lockfile.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-lockfile.c 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-lockfile.c flatpak-0.11.7/libglnx/glnx-lockfile.c +--- flatpak-0.11.7.orig/libglnx/glnx-lockfile.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-lockfile.c 2018-05-26 00:50:25.434037228 +0300 @@ -0,0 +1,179 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + @@ -10825,7 +10873,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-lockfile.c flatpak-0.10.3/libglnx/gl + */ +gboolean +glnx_make_lock_file(int dfd, const char *p, int operation, GLnxLockFile *out_lock, GError **error) { -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + g_autofree char *t = NULL; + int r; + @@ -10941,9 +10989,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-lockfile.c flatpak-0.10.3/libglnx/gl + f->operation = 0; + f->initialized = FALSE; +} -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-lockfile.h flatpak-0.10.3/libglnx/glnx-lockfile.h ---- flatpak-0.10.3.orig/libglnx/glnx-lockfile.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-lockfile.h 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-lockfile.h flatpak-0.11.7/libglnx/glnx-lockfile.h +--- flatpak-0.11.7.orig/libglnx/glnx-lockfile.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-lockfile.h 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,40 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + @@ -10985,9 +11033,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-lockfile.h flatpak-0.10.3/libglnx/gl +void glnx_release_lock_file(GLnxLockFile *f); + +G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxLockFile, glnx_release_lock_file) -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-macros.h flatpak-0.10.3/libglnx/glnx-macros.h ---- flatpak-0.10.3.orig/libglnx/glnx-macros.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-macros.h 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-macros.h flatpak-0.11.7/libglnx/glnx-macros.h +--- flatpak-0.11.7.orig/libglnx/glnx-macros.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-macros.h 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,189 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -11178,9 +11226,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-macros.h flatpak-0.10.3/libglnx/glnx +#endif /* GI_SCANNER */ + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-missing.h flatpak-0.10.3/libglnx/glnx-missing.h ---- flatpak-0.10.3.orig/libglnx/glnx-missing.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-missing.h 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-missing.h flatpak-0.11.7/libglnx/glnx-missing.h +--- flatpak-0.11.7.orig/libglnx/glnx-missing.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-missing.h 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,95 @@ +#pragma once + @@ -11277,10 +11325,10 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-missing.h flatpak-0.10.3/libglnx/gln +#endif + +#include "glnx-missing-syscall.h" -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-missing-syscall.h flatpak-0.10.3/libglnx/glnx-missing-syscall.h ---- flatpak-0.10.3.orig/libglnx/glnx-missing-syscall.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-missing-syscall.h 2018-02-03 21:26:06.309233341 +0300 -@@ -0,0 +1,153 @@ +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-missing-syscall.h flatpak-0.11.7/libglnx/glnx-missing-syscall.h +--- flatpak-0.11.7.orig/libglnx/glnx-missing-syscall.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-missing-syscall.h 2018-05-26 00:50:25.434037228 +0300 +@@ -0,0 +1,154 @@ +/*** + This file was originally part of systemd. + @@ -11313,6 +11361,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-missing-syscall.h flatpak-0.10.3/lib + Add abstraction model for BPF programs +*/ + ++#include "config.h" + +#if !HAVE_DECL_RENAMEAT2 +# ifndef __NR_renameat2 @@ -11434,10 +11483,10 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-missing-syscall.h flatpak-0.10.3/lib +# endif +} +#endif -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-shutil.c flatpak-0.10.3/libglnx/glnx-shutil.c ---- flatpak-0.10.3.orig/libglnx/glnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-shutil.c 2018-02-03 21:26:06.309233341 +0300 -@@ -0,0 +1,261 @@ +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-shutil.c flatpak-0.11.7/libglnx/glnx-shutil.c +--- flatpak-0.11.7.orig/libglnx/glnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-shutil.c 2018-05-26 00:50:25.434037228 +0300 +@@ -0,0 +1,260 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2014,2015 Colin Walters . @@ -11524,14 +11573,12 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-shutil.c flatpak-0.10.3/libglnx/glnx + GCancellable *cancellable, + GError **error) +{ -+ glnx_fd_close int target_dfd = -1; -+ g_auto(GLnxDirFdIterator) dfd_iter = { 0, }; -+ + dfd = glnx_dirfd_canonicalize (dfd); + ++ + /* With O_NOFOLLOW first */ -+ target_dfd = openat (dfd, path, -+ O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW); ++ glnx_autofd int target_dfd = ++ openat (dfd, path, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW); + + if (target_dfd == -1) + { @@ -11550,6 +11597,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-shutil.c flatpak-0.10.3/libglnx/glnx + } + else + { ++ g_auto(GLnxDirFdIterator) dfd_iter = { 0, }; + if (!glnx_dirfd_iterator_init_take_fd (&target_dfd, &dfd_iter, error)) + return FALSE; + @@ -11699,9 +11747,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-shutil.c flatpak-0.10.3/libglnx/glnx + + return glnx_opendirat (dfd, path, TRUE, out_dfd, error); +} -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-shutil.h flatpak-0.10.3/libglnx/glnx-shutil.h ---- flatpak-0.10.3.orig/libglnx/glnx-shutil.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-shutil.h 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-shutil.h flatpak-0.11.7/libglnx/glnx-shutil.h +--- flatpak-0.11.7.orig/libglnx/glnx-shutil.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-shutil.h 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,48 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -11751,9 +11799,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-shutil.h flatpak-0.10.3/libglnx/glnx + GError **error); + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-xattrs.c flatpak-0.10.3/libglnx/glnx-xattrs.c ---- flatpak-0.10.3.orig/libglnx/glnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-xattrs.c 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-xattrs.c flatpak-0.11.7/libglnx/glnx-xattrs.c +--- flatpak-0.11.7.orig/libglnx/glnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-xattrs.c 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,444 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -12199,9 +12247,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-xattrs.c flatpak-0.10.3/libglnx/glnx + return TRUE; +} + -diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-xattrs.h flatpak-0.10.3/libglnx/glnx-xattrs.h ---- flatpak-0.10.3.orig/libglnx/glnx-xattrs.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/glnx-xattrs.h 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/glnx-xattrs.h flatpak-0.11.7/libglnx/glnx-xattrs.h +--- flatpak-0.11.7.orig/libglnx/glnx-xattrs.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/glnx-xattrs.h 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,78 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -12281,9 +12329,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/glnx-xattrs.h flatpak-0.10.3/libglnx/glnx + GError **error); + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/libglnx.doap flatpak-0.10.3/libglnx/libglnx.doap ---- flatpak-0.10.3.orig/libglnx/libglnx.doap 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/libglnx.doap 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/libglnx.doap flatpak-0.11.7/libglnx/libglnx.doap +--- flatpak-0.11.7.orig/libglnx/libglnx.doap 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/libglnx.doap 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,31 @@ + + + + -diff -Nuar flatpak-0.10.3.orig/libglnx/libglnx.h flatpak-0.10.3/libglnx/libglnx.h ---- flatpak-0.10.3.orig/libglnx/libglnx.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/libglnx.h 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/libglnx.h flatpak-0.11.7/libglnx/libglnx.h +--- flatpak-0.11.7.orig/libglnx/libglnx.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/libglnx.h 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,40 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -12360,13 +12408,16 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/libglnx.h flatpak-0.10.3/libglnx/libglnx. +#include + +G_END_DECLS -diff -Nuar flatpak-0.10.3.orig/libglnx/libglnx.m4 flatpak-0.10.3/libglnx/libglnx.m4 ---- flatpak-0.10.3.orig/libglnx/libglnx.m4 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/libglnx.m4 2018-02-03 21:26:06.309233341 +0300 -@@ -0,0 +1,29 @@ +diff -Nuar flatpak-0.11.7.orig/libglnx/libglnx.m4 flatpak-0.11.7/libglnx/libglnx.m4 +--- flatpak-0.11.7.orig/libglnx/libglnx.m4 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/libglnx.m4 2018-05-26 00:50:25.434037228 +0300 +@@ -0,0 +1,33 @@ +AC_DEFUN([LIBGLNX_CONFIGURE], +[ -+AC_CHECK_DECLS([renameat2, memfd_create], ++AC_CHECK_DECLS([ ++ renameat2, ++ memfd_create, ++ copy_file_range], + [], [], [[ +#include +#include @@ -12375,6 +12426,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/libglnx.m4 flatpak-0.10.3/libglnx/libglnx +#include +#include +#include ++#include +]]) + +AC_ARG_ENABLE(otmpfile, @@ -12393,9 +12445,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/libglnx.m4 flatpak-0.10.3/libglnx/libglnx + +dnl end LIBGLNX_CONFIGURE +]) -diff -Nuar flatpak-0.10.3.orig/libglnx/Makefile-libglnx.am flatpak-0.10.3/libglnx/Makefile-libglnx.am ---- flatpak-0.10.3.orig/libglnx/Makefile-libglnx.am 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/Makefile-libglnx.am 2018-02-03 21:26:06.307233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/Makefile-libglnx.am flatpak-0.11.7/libglnx/Makefile-libglnx.am +--- flatpak-0.11.7.orig/libglnx/Makefile-libglnx.am 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/Makefile-libglnx.am 2018-02-03 21:26:06.307233341 +0300 @@ -0,0 +1,78 @@ +# Copyright (C) 2015 Colin Walters +# @@ -12475,9 +12527,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/Makefile-libglnx.am flatpak-0.10.3/libgln +test_libglnx_shutil_SOURCES = $(libglnx_srcpath)/tests/test-libglnx-shutil.c +test_libglnx_shutil_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags) +test_libglnx_shutil_LDADD = $(libglnx_libs) libglnx.la -diff -Nuar flatpak-0.10.3.orig/libglnx/README.md flatpak-0.10.3/libglnx/README.md ---- flatpak-0.10.3.orig/libglnx/README.md 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/README.md 2018-02-03 21:26:06.307233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/README.md flatpak-0.11.7/libglnx/README.md +--- flatpak-0.11.7.orig/libglnx/README.md 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/README.md 2018-05-26 00:50:25.433037228 +0300 @@ -0,0 +1,52 @@ +libglnx is the successor to libgsystem: https://git.gnome.org/browse/libgsystem + @@ -12518,7 +12570,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/README.md flatpak-0.10.3/libglnx/README.m + +For local allocation macros, you should start using the `g_auto` +macros from GLib. A backport is included in libglnx. There are a few -+APIs not defined in GLib yet, such as `glnx_fd_close`. ++APIs not defined in GLib yet, such as `glnx_autofd`. + +`gs_transfer_out_value` is replaced by `g_steal_pointer`. + @@ -12531,9 +12583,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/README.md flatpak-0.10.3/libglnx/README.m +https://github.com/GNOME/libglnx/pulls + +Or alternatively, email one of the maintainers directly. -diff -Nuar flatpak-0.10.3.orig/libglnx/tests/libglnx-testlib.h flatpak-0.10.3/libglnx/tests/libglnx-testlib.h ---- flatpak-0.10.3.orig/libglnx/tests/libglnx-testlib.h 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/tests/libglnx-testlib.h 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/tests/libglnx-testlib.h flatpak-0.11.7/libglnx/tests/libglnx-testlib.h +--- flatpak-0.11.7.orig/libglnx/tests/libglnx-testlib.h 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/tests/libglnx-testlib.h 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,34 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -12569,9 +12621,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/libglnx-testlib.h flatpak-0.10.3/li +#define _GLNX_TEST_DECLARE_ERROR(local_error, error) \ + g_autoptr(_GLnxTestAutoError) local_error = NULL; \ + GError **error = &local_error -diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-errors.c flatpak-0.10.3/libglnx/tests/test-libglnx-errors.c ---- flatpak-0.10.3.orig/libglnx/tests/test-libglnx-errors.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/tests/test-libglnx-errors.c 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/tests/test-libglnx-errors.c flatpak-0.11.7/libglnx/tests/test-libglnx-errors.c +--- flatpak-0.11.7.orig/libglnx/tests/test-libglnx-errors.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/tests/test-libglnx-errors.c 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,183 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -12756,10 +12808,10 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-errors.c flatpak-0.10. + + return ret; +} -diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-fdio.c flatpak-0.10.3/libglnx/tests/test-libglnx-fdio.c ---- flatpak-0.10.3.orig/libglnx/tests/test-libglnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/tests/test-libglnx-fdio.c 2018-02-03 21:26:06.309233341 +0300 -@@ -0,0 +1,255 @@ +diff -Nuar flatpak-0.11.7.orig/libglnx/tests/test-libglnx-fdio.c flatpak-0.11.7/libglnx/tests/test-libglnx-fdio.c +--- flatpak-0.11.7.orig/libglnx/tests/test-libglnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/tests/test-libglnx-fdio.c 2018-05-26 00:50:25.435037228 +0300 +@@ -0,0 +1,254 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2017 Red Hat, Inc. @@ -12794,8 +12846,8 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-fdio.c flatpak-0.10.3/ +renameat_test_setup (int *out_srcfd, int *out_destfd, + GError **error) +{ -+ glnx_fd_close int srcfd = -1; -+ glnx_fd_close int destfd = -1; ++ glnx_autofd int srcfd = -1; ++ glnx_autofd int destfd = -1; + + (void) glnx_shutil_rm_rf_at (AT_FDCWD, "srcdir", NULL, NULL); + if (mkdir ("srcdir", 0755) < 0) @@ -12824,8 +12876,8 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-fdio.c flatpak-0.10.3/ +test_renameat2_noreplace (void) +{ + _GLNX_TEST_DECLARE_ERROR(local_error, error); -+ glnx_fd_close int srcfd = -1; -+ glnx_fd_close int destfd = -1; ++ glnx_autofd int srcfd = -1; ++ glnx_autofd int destfd = -1; + struct stat stbuf; + + if (!renameat_test_setup (&srcfd, &destfd, error)) @@ -12854,8 +12906,8 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-fdio.c flatpak-0.10.3/ +{ + _GLNX_TEST_DECLARE_ERROR(local_error, error); + -+ glnx_fd_close int srcfd = -1; -+ glnx_fd_close int destfd = -1; ++ glnx_autofd int srcfd = -1; ++ glnx_autofd int destfd = -1; + if (!renameat_test_setup (&srcfd, &destfd, error)) + return; + @@ -12939,7 +12991,6 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-fdio.c flatpak-0.10.3/ +test_filecopy (void) +{ + _GLNX_TEST_DECLARE_ERROR(local_error, error); -+ g_auto(GLnxTmpfile) tmpf = { 0, }; + const char foo[] = "foo"; + struct stat stbuf; + @@ -13015,9 +13066,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-fdio.c flatpak-0.10.3/ + + return ret; +} -diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-macros.c flatpak-0.10.3/libglnx/tests/test-libglnx-macros.c ---- flatpak-0.10.3.orig/libglnx/tests/test-libglnx-macros.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/tests/test-libglnx-macros.c 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/tests/test-libglnx-macros.c flatpak-0.11.7/libglnx/tests/test-libglnx-macros.c +--- flatpak-0.11.7.orig/libglnx/tests/test-libglnx-macros.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/tests/test-libglnx-macros.c 2018-02-03 21:26:06.309233341 +0300 @@ -0,0 +1,109 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -13128,9 +13179,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-macros.c flatpak-0.10. + g_test_add_func ("/hash_table_foreach", test_hash_table_foreach); + return g_test_run(); +} -diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-shutil.c flatpak-0.10.3/libglnx/tests/test-libglnx-shutil.c ---- flatpak-0.10.3.orig/libglnx/tests/test-libglnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/tests/test-libglnx-shutil.c 2018-02-03 21:26:06.309233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/tests/test-libglnx-shutil.c flatpak-0.11.7/libglnx/tests/test-libglnx-shutil.c +--- flatpak-0.11.7.orig/libglnx/tests/test-libglnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/tests/test-libglnx-shutil.c 2018-05-26 00:50:25.435037228 +0300 @@ -0,0 +1,63 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -13166,7 +13217,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-shutil.c flatpak-0.10. +test_mkdir_p_enoent (void) +{ + _GLNX_TEST_DECLARE_ERROR(local_error, error); -+ glnx_fd_close int dfd = -1; ++ glnx_autofd int dfd = -1; + + if (!glnx_ensure_dir (AT_FDCWD, "test", 0755, error)) + return; @@ -13195,9 +13246,9 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-shutil.c flatpak-0.10. + + return ret; +} -diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-xattrs.c flatpak-0.10.3/libglnx/tests/test-libglnx-xattrs.c ---- flatpak-0.10.3.orig/libglnx/tests/test-libglnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 -+++ flatpak-0.10.3/libglnx/tests/test-libglnx-xattrs.c 2018-02-03 21:26:06.310233341 +0300 +diff -Nuar flatpak-0.11.7.orig/libglnx/tests/test-libglnx-xattrs.c flatpak-0.11.7/libglnx/tests/test-libglnx-xattrs.c +--- flatpak-0.11.7.orig/libglnx/tests/test-libglnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 ++++ flatpak-0.11.7/libglnx/tests/test-libglnx-xattrs.c 2018-05-26 00:50:25.435037228 +0300 @@ -0,0 +1,283 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -13283,7 +13334,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-xattrs.c flatpak-0.10. + { + guint32 randname_v = g_random_int (); + g_autofree char *randname = g_strdup_printf ("file%u", randname_v); -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + + again: + fd = openat (dfd_iter->fd, randname, O_CREAT | O_EXCL, 0644); @@ -13314,7 +13365,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-xattrs.c flatpak-0.10. + if (!dent) + break; + -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + if (!glnx_openat_rdonly (dfd_iter->fd, dent->d_name, FALSE, &fd, error)) + return FALSE; + @@ -13358,7 +13409,7 @@ diff -Nuar flatpak-0.10.3.orig/libglnx/tests/test-libglnx-xattrs.c flatpak-0.10. + if (!dent) + break; + -+ glnx_fd_close int fd = -1; ++ glnx_autofd int fd = -1; + if (!glnx_openat_rdonly (dfd_iter->fd, dent->d_name, FALSE, &fd, error)) + return FALSE; + diff --git a/hardware/virtualization/flatpak/pspec.xml b/hardware/virtualization/flatpak/pspec.xml index 4a7ee2acb7..3fc7461497 100644 --- a/hardware/virtualization/flatpak/pspec.xml +++ b/hardware/virtualization/flatpak/pspec.xml @@ -11,7 +11,7 @@ LGPLv2 Application distribution framework Linux application sandboxing and distribution framework, formerly xdg-app - https://github.com/flatpak/flatpak/archive/0.11.1.tar.gz + https://github.com/flatpak/flatpak/archive/0.11.7.tar.gz util-linux gtk-doc @@ -22,7 +22,7 @@ dbus-devel json-glib-devel appstream-glib-devel - ostree-devel + ostree-devel bubblewrap_libglnx_submodule.patch @@ -93,6 +93,13 @@ + + 2018-05-26 + 0.11.7 + Version bump. + Ertuğrul Erata + ertugrulerata@gmail.com + 2018-02-16 0.11.1 diff --git a/hardware/virtualization/ostree/actions.py b/hardware/virtualization/ostree/actions.py index b9da1e1317..8258ed87ba 100644 --- a/hardware/virtualization/ostree/actions.py +++ b/hardware/virtualization/ostree/actions.py @@ -15,6 +15,7 @@ def setup(): shelltools.system("env NOCONFIGURE=1 ./autogen.sh") autotools.configure("--enable-rust \ + --enable-trivial-httpd-cmdline \ --with-openssl \ --disable-static \ --without-dracut \ diff --git a/hardware/virtualization/ostree/files/bsdiff_libglnx_submodule.patch b/hardware/virtualization/ostree/files/bsdiff_libglnx_submodule.patch index 61b6d94465..e3708d677e 100644 --- a/hardware/virtualization/ostree/files/bsdiff_libglnx_submodule.patch +++ b/hardware/virtualization/ostree/files/bsdiff_libglnx_submodule.patch @@ -1,6 +1,6 @@ -diff -Nuar ostree-2018.1.orig/bsdiff/autogen.sh ostree-2018.1/bsdiff/autogen.sh ---- ostree-2018.1.orig/bsdiff/autogen.sh 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/autogen.sh 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/autogen.sh ostree-2018.5/bsdiff/autogen.sh +--- ostree-2018.5.orig/bsdiff/autogen.sh 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/autogen.sh 2018-05-26 00:37:31.985018846 +0300 @@ -0,0 +1,6 @@ +#!/bin/sh + @@ -8,9 +8,9 @@ diff -Nuar ostree-2018.1.orig/bsdiff/autogen.sh ostree-2018.1/bsdiff/autogen.sh +cp LICENSE COPYING + +autoreconf -fis -diff -Nuar ostree-2018.1.orig/bsdiff/bsdiff.c ostree-2018.1/bsdiff/bsdiff.c ---- ostree-2018.1.orig/bsdiff/bsdiff.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/bsdiff.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/bsdiff.c ostree-2018.5/bsdiff/bsdiff.c +--- ostree-2018.5.orig/bsdiff/bsdiff.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/bsdiff.c 2018-05-26 00:37:31.985018846 +0300 @@ -0,0 +1,445 @@ +/*- + * Copyright 2003-2005 Colin Percival @@ -457,9 +457,9 @@ diff -Nuar ostree-2018.1.orig/bsdiff/bsdiff.c ostree-2018.1/bsdiff/bsdiff.c +} + +#endif -diff -Nuar ostree-2018.1.orig/bsdiff/bsdiff.h ostree-2018.1/bsdiff/bsdiff.h ---- ostree-2018.1.orig/bsdiff/bsdiff.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/bsdiff.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/bsdiff.h ostree-2018.5/bsdiff/bsdiff.h +--- ostree-2018.5.orig/bsdiff/bsdiff.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/bsdiff.h 2018-05-26 00:37:31.985018846 +0300 @@ -0,0 +1,45 @@ +/*- + * Copyright 2003-2005 Colin Percival @@ -506,9 +506,9 @@ diff -Nuar ostree-2018.1.orig/bsdiff/bsdiff.h ostree-2018.1/bsdiff/bsdiff.h +int bsdiff(const uint8_t* old, int64_t oldsize, const uint8_t* new, int64_t newsize, struct bsdiff_stream* stream); + +#endif -diff -Nuar ostree-2018.1.orig/bsdiff/bspatch.c ostree-2018.1/bsdiff/bspatch.c ---- ostree-2018.1.orig/bsdiff/bspatch.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/bspatch.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/bspatch.c ostree-2018.5/bsdiff/bspatch.c +--- ostree-2018.5.orig/bsdiff/bspatch.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/bspatch.c 2018-05-26 00:37:31.985018846 +0300 @@ -0,0 +1,187 @@ +/*- + * Copyright 2003-2005 Colin Percival @@ -697,9 +697,9 @@ diff -Nuar ostree-2018.1.orig/bsdiff/bspatch.c ostree-2018.1/bsdiff/bspatch.c +} + +#endif -diff -Nuar ostree-2018.1.orig/bsdiff/bspatch.h ostree-2018.1/bsdiff/bspatch.h ---- ostree-2018.1.orig/bsdiff/bspatch.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/bspatch.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/bspatch.h ostree-2018.5/bsdiff/bspatch.h +--- ostree-2018.5.orig/bsdiff/bspatch.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/bspatch.h 2018-05-26 00:37:31.985018846 +0300 @@ -0,0 +1,42 @@ +/*- + * Copyright 2003-2005 Colin Percival @@ -743,9 +743,9 @@ diff -Nuar ostree-2018.1.orig/bsdiff/bspatch.h ostree-2018.1/bsdiff/bspatch.h + +#endif + -diff -Nuar ostree-2018.1.orig/bsdiff/configure.ac ostree-2018.1/bsdiff/configure.ac ---- ostree-2018.1.orig/bsdiff/configure.ac 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/configure.ac 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/configure.ac ostree-2018.5/bsdiff/configure.ac +--- ostree-2018.5.orig/bsdiff/configure.ac 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/configure.ac 2018-05-26 00:37:31.985018846 +0300 @@ -0,0 +1,30 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. @@ -777,14 +777,14 @@ diff -Nuar ostree-2018.1.orig/bsdiff/configure.ac ostree-2018.1/bsdiff/configure + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT -diff -Nuar ostree-2018.1.orig/bsdiff/.git ostree-2018.1/bsdiff/.git ---- ostree-2018.1.orig/bsdiff/.git 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/.git 2018-02-02 23:13:23.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/.git ostree-2018.5/bsdiff/.git +--- ostree-2018.5.orig/bsdiff/.git 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/.git 2018-05-26 00:37:14.345018427 +0300 @@ -0,0 +1 @@ +gitdir: ../.git/modules/bsdiff -diff -Nuar ostree-2018.1.orig/bsdiff/.gitignore ostree-2018.1/bsdiff/.gitignore ---- ostree-2018.1.orig/bsdiff/.gitignore 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/.gitignore 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/.gitignore ostree-2018.5/bsdiff/.gitignore +--- ostree-2018.5.orig/bsdiff/.gitignore 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/.gitignore 2018-05-26 00:37:31.984018846 +0300 @@ -0,0 +1,11 @@ +.deps/* +.libs/* @@ -797,9 +797,9 @@ diff -Nuar ostree-2018.1.orig/bsdiff/.gitignore ostree-2018.1/bsdiff/.gitignore +README +ChangeLog +COPYING -diff -Nuar ostree-2018.1.orig/bsdiff/LICENSE ostree-2018.1/bsdiff/LICENSE ---- ostree-2018.1.orig/bsdiff/LICENSE 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/LICENSE 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/LICENSE ostree-2018.5/bsdiff/LICENSE +--- ostree-2018.5.orig/bsdiff/LICENSE 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/LICENSE 2018-05-26 00:37:31.984018846 +0300 @@ -0,0 +1,24 @@ + Copyright 2003-2005 Colin Percival + Copyright 2012 Matthew Endsley @@ -825,9 +825,9 @@ diff -Nuar ostree-2018.1.orig/bsdiff/LICENSE ostree-2018.1/bsdiff/LICENSE + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. -diff -Nuar ostree-2018.1.orig/bsdiff/Makefile.am ostree-2018.1/bsdiff/Makefile.am ---- ostree-2018.1.orig/bsdiff/Makefile.am 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/Makefile.am 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/Makefile.am ostree-2018.5/bsdiff/Makefile.am +--- ostree-2018.5.orig/bsdiff/Makefile.am 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/Makefile.am 2018-05-26 00:37:31.984018846 +0300 @@ -0,0 +1,11 @@ +bin_PROGRAMS = bsdiff bspatch + @@ -840,9 +840,9 @@ diff -Nuar ostree-2018.1.orig/bsdiff/Makefile.am ostree-2018.1/bsdiff/Makefile.a + +EXTRA_DIST = bsdiff.h bspatch.h + -diff -Nuar ostree-2018.1.orig/bsdiff/Makefile-bsdiff.am ostree-2018.1/bsdiff/Makefile-bsdiff.am ---- ostree-2018.1.orig/bsdiff/Makefile-bsdiff.am 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/Makefile-bsdiff.am 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/Makefile-bsdiff.am ostree-2018.5/bsdiff/Makefile-bsdiff.am +--- ostree-2018.5.orig/bsdiff/Makefile-bsdiff.am 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/Makefile-bsdiff.am 2018-05-26 00:37:31.984018846 +0300 @@ -0,0 +1,32 @@ +# Copyright (C) 2015 Giuseppe Scrivano +# @@ -876,9 +876,9 @@ diff -Nuar ostree-2018.1.orig/bsdiff/Makefile-bsdiff.am ostree-2018.1/bsdiff/Mak + $(NULL) + +libbsdiff_la_CFLAGS = $(AM_CFLAGS) -diff -Nuar ostree-2018.1.orig/bsdiff/README.md ostree-2018.1/bsdiff/README.md ---- ostree-2018.1.orig/bsdiff/README.md 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/bsdiff/README.md 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/bsdiff/README.md ostree-2018.5/bsdiff/README.md +--- ostree-2018.5.orig/bsdiff/README.md 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/bsdiff/README.md 2018-05-26 00:37:31.985018846 +0300 @@ -0,0 +1,129 @@ +bsdiff/bspatch +============== @@ -1009,9 +1009,9 @@ diff -Nuar ostree-2018.1.orig/bsdiff/README.md ostree-2018.1/bsdiff/README.md + +`bspatch` returns `0` on success and `-1` on failure. On success, `new` contains +the data for the patched file. -diff -Nuar ostree-2018.1.orig/libglnx/COPYING ostree-2018.1/libglnx/COPYING ---- ostree-2018.1.orig/libglnx/COPYING 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/COPYING 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/COPYING ostree-2018.5/libglnx/COPYING +--- ostree-2018.5.orig/libglnx/COPYING 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/COPYING 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 @@ -1515,14 +1515,14 @@ diff -Nuar ostree-2018.1.orig/libglnx/COPYING ostree-2018.1/libglnx/COPYING + Ty Coon, President of Vice + +That's all there is to it! -diff -Nuar ostree-2018.1.orig/libglnx/.git ostree-2018.1/libglnx/.git ---- ostree-2018.1.orig/libglnx/.git 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/.git 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/.git ostree-2018.5/libglnx/.git +--- ostree-2018.5.orig/libglnx/.git 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/.git 2018-05-26 00:37:31.964018845 +0300 @@ -0,0 +1 @@ +gitdir: ../.git/modules/libglnx -diff -Nuar ostree-2018.1.orig/libglnx/.gitignore ostree-2018.1/libglnx/.gitignore ---- ostree-2018.1.orig/libglnx/.gitignore 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/.gitignore 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/.gitignore ostree-2018.5/libglnx/.gitignore +--- ostree-2018.5.orig/libglnx/.gitignore 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/.gitignore 2018-05-26 00:37:32.005018846 +0300 @@ -0,0 +1,16 @@ +# A path ostree writes to work around automake bug with +# subdir-objects @@ -1540,9 +1540,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/.gitignore ostree-2018.1/libglnx/.gitignor +*.stamp +*~ + -diff -Nuar ostree-2018.1.orig/libglnx/glnx-backport-autocleanups.h ostree-2018.1/libglnx/glnx-backport-autocleanups.h ---- ostree-2018.1.orig/libglnx/glnx-backport-autocleanups.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-backport-autocleanups.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-backport-autocleanups.h ostree-2018.5/libglnx/glnx-backport-autocleanups.h +--- ostree-2018.5.orig/libglnx/glnx-backport-autocleanups.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-backport-autocleanups.h 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,124 @@ +/* + * Copyright © 2015 Canonical Limited @@ -1668,9 +1668,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-backport-autocleanups.h ostree-2018.1 +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GString, g_autoptr_cleanup_gstring_free) + +#endif -diff -Nuar ostree-2018.1.orig/libglnx/glnx-backport-autoptr.h ostree-2018.1/libglnx/glnx-backport-autoptr.h ---- ostree-2018.1.orig/libglnx/glnx-backport-autoptr.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-backport-autoptr.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-backport-autoptr.h ostree-2018.5/libglnx/glnx-backport-autoptr.h +--- ostree-2018.5.orig/libglnx/glnx-backport-autoptr.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-backport-autoptr.h 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,133 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -1805,9 +1805,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-backport-autoptr.h ostree-2018.1/libg +#endif /* !GLIB_CHECK_VERSION(2, 43, 3) */ + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/glnx-backports.c ostree-2018.1/libglnx/glnx-backports.c ---- ostree-2018.1.orig/libglnx/glnx-backports.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-backports.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-backports.c ostree-2018.5/libglnx/glnx-backports.c +--- ostree-2018.5.orig/libglnx/glnx-backports.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-backports.c 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,61 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -1870,9 +1870,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-backports.c ostree-2018.1/libglnx/gln + return TRUE; +} +#endif -diff -Nuar ostree-2018.1.orig/libglnx/glnx-backports.h ostree-2018.1/libglnx/glnx-backports.h ---- ostree-2018.1.orig/libglnx/glnx-backports.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-backports.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-backports.h ostree-2018.5/libglnx/glnx-backports.h +--- ostree-2018.5.orig/libglnx/glnx-backports.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-backports.h 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,46 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -1920,9 +1920,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-backports.h ostree-2018.1/libglnx/gln +#endif /* !GLIB_CHECK_VERSION(2, 44, 0) */ + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/glnx-console.c ostree-2018.1/libglnx/glnx-console.c ---- ostree-2018.1.orig/libglnx/glnx-console.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-console.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-console.c ostree-2018.5/libglnx/glnx-console.c +--- ostree-2018.5.orig/libglnx/glnx-console.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-console.c 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,359 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -1972,8 +1972,8 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-console.c ostree-2018.1/libglnx/glnx- +static gboolean locked; +static guint64 last_update_ms; /* monotonic time in millis we last updated */ + -+static gboolean -+stdout_is_tty (void) ++gboolean ++glnx_stdout_is_tty (void) +{ + static gsize initialized = 0; + static gboolean stdout_is_tty_v; @@ -2082,7 +2082,7 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-console.c ostree-2018.1/libglnx/glnx- + g_return_if_fail (!locked); + g_return_if_fail (!console->locked); + -+ console->is_tty = stdout_is_tty (); ++ console->is_tty = glnx_stdout_is_tty (); + + locked = console->locked = TRUE; + @@ -2125,7 +2125,7 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-console.c ostree-2018.1/libglnx/glnx- + if (percentage != 100) + { + const guint64 diff_ms = current_ms - last_update_ms; -+ if (stdout_is_tty ()) ++ if (glnx_stdout_is_tty ()) + { + if (diff_ms < (1000/MAX_TTY_UPDATE_HZ)) + return; @@ -2150,7 +2150,7 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-console.c ostree-2018.1/libglnx/glnx- + + const guint input_textlen = text ? strlen (text) : 0; + -+ if (!stdout_is_tty ()) ++ if (!glnx_stdout_is_tty ()) + { + if (text) + fprintf (stdout, "%s", text); @@ -2283,10 +2283,10 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-console.c ostree-2018.1/libglnx/glnx- + + locked = console->locked = FALSE; +} -diff -Nuar ostree-2018.1.orig/libglnx/glnx-console.h ostree-2018.1/libglnx/glnx-console.h ---- ostree-2018.1.orig/libglnx/glnx-console.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-console.h 2018-02-02 23:13:30.000000000 +0300 -@@ -0,0 +1,59 @@ +diff -Nuar ostree-2018.5.orig/libglnx/glnx-console.h ostree-2018.5/libglnx/glnx-console.h +--- ostree-2018.5.orig/libglnx/glnx-console.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-console.h 2018-05-26 00:37:32.006018846 +0300 +@@ -0,0 +1,61 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * + * Copyright (C) 2013,2014,2015 Colin Walters @@ -2320,6 +2320,8 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-console.h ostree-2018.1/libglnx/glnx- + +typedef struct GLnxConsoleRef GLnxConsoleRef; + ++gboolean glnx_stdout_is_tty (void); ++ +void glnx_console_lock (GLnxConsoleRef *ref); + +void glnx_console_text (const char *text); @@ -2346,9 +2348,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-console.h ostree-2018.1/libglnx/glnx- +G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxConsoleRef, glnx_console_ref_cleanup) + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/glnx-dirfd.c ostree-2018.1/libglnx/glnx-dirfd.c ---- ostree-2018.1.orig/libglnx/glnx-dirfd.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-dirfd.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-dirfd.c ostree-2018.5/libglnx/glnx-dirfd.c +--- ostree-2018.5.orig/libglnx/glnx-dirfd.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-dirfd.c 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,425 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -2775,9 +2777,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-dirfd.c ostree-2018.1/libglnx/glnx-di +{ + (void) _glnx_tmpdir_free (tmpf, FALSE, NULL, NULL); +} -diff -Nuar ostree-2018.1.orig/libglnx/glnx-dirfd.h ostree-2018.1/libglnx/glnx-dirfd.h ---- ostree-2018.1.orig/libglnx/glnx-dirfd.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-dirfd.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-dirfd.h ostree-2018.5/libglnx/glnx-dirfd.h +--- ostree-2018.5.orig/libglnx/glnx-dirfd.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-dirfd.h 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,137 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -2916,9 +2918,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-dirfd.h ostree-2018.1/libglnx/glnx-di + GLnxTmpDir *out_tmpdir, GError **error); + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/glnx-errors.c ostree-2018.1/libglnx/glnx-errors.c ---- ostree-2018.1.orig/libglnx/glnx-errors.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-errors.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-errors.c ostree-2018.5/libglnx/glnx-errors.c +--- ostree-2018.5.orig/libglnx/glnx-errors.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-errors.c 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,131 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -3051,9 +3053,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-errors.c ostree-2018.1/libglnx/glnx-e + errno = errsv; + return FALSE; +} -diff -Nuar ostree-2018.1.orig/libglnx/glnx-errors.h ostree-2018.1/libglnx/glnx-errors.h ---- ostree-2018.1.orig/libglnx/glnx-errors.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-errors.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-errors.h ostree-2018.5/libglnx/glnx-errors.h +--- ostree-2018.5.orig/libglnx/glnx-errors.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-errors.h 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,134 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -3189,9 +3191,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-errors.h ostree-2018.1/libglnx/glnx-e + } while (0); + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/glnx-fdio.c ostree-2018.1/libglnx/glnx-fdio.c ---- ostree-2018.1.orig/libglnx/glnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-fdio.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-fdio.c ostree-2018.5/libglnx/glnx-fdio.c +--- ostree-2018.5.orig/libglnx/glnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-fdio.c 2018-05-26 00:37:32.007018846 +0300 @@ -0,0 +1,1106 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -4299,9 +4301,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-fdio.c ostree-2018.1/libglnx/glnx-fdi + + return TRUE; +} -diff -Nuar ostree-2018.1.orig/libglnx/glnx-fdio.h ostree-2018.1/libglnx/glnx-fdio.h ---- ostree-2018.1.orig/libglnx/glnx-fdio.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-fdio.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-fdio.h ostree-2018.5/libglnx/glnx-fdio.h +--- ostree-2018.5.orig/libglnx/glnx-fdio.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-fdio.h 2018-05-26 00:37:32.007018846 +0300 @@ -0,0 +1,369 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -4672,9 +4674,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-fdio.h ostree-2018.1/libglnx/glnx-fdi +} + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/glnx-local-alloc.c ostree-2018.1/libglnx/glnx-local-alloc.c ---- ostree-2018.1.orig/libglnx/glnx-local-alloc.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-local-alloc.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-local-alloc.c ostree-2018.5/libglnx/glnx-local-alloc.c +--- ostree-2018.5.orig/libglnx/glnx-local-alloc.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-local-alloc.c 2018-05-26 00:37:32.007018846 +0300 @@ -0,0 +1,72 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -4748,9 +4750,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-local-alloc.c ostree-2018.1/libglnx/g + * + * + */ -diff -Nuar ostree-2018.1.orig/libglnx/glnx-local-alloc.h ostree-2018.1/libglnx/glnx-local-alloc.h ---- ostree-2018.1.orig/libglnx/glnx-local-alloc.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-local-alloc.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-local-alloc.h ostree-2018.5/libglnx/glnx-local-alloc.h +--- ostree-2018.5.orig/libglnx/glnx-local-alloc.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-local-alloc.h 2018-05-26 00:37:32.007018846 +0300 @@ -0,0 +1,91 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -4843,9 +4845,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-local-alloc.h ostree-2018.1/libglnx/g +#define glnx_autofd __attribute__((cleanup(glnx_close_fd))) + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/glnx-lockfile.c ostree-2018.1/libglnx/glnx-lockfile.c ---- ostree-2018.1.orig/libglnx/glnx-lockfile.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-lockfile.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-lockfile.c ostree-2018.5/libglnx/glnx-lockfile.c +--- ostree-2018.5.orig/libglnx/glnx-lockfile.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-lockfile.c 2018-05-26 00:37:32.007018846 +0300 @@ -0,0 +1,179 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + @@ -5026,9 +5028,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-lockfile.c ostree-2018.1/libglnx/glnx + f->operation = 0; + f->initialized = FALSE; +} -diff -Nuar ostree-2018.1.orig/libglnx/glnx-lockfile.h ostree-2018.1/libglnx/glnx-lockfile.h ---- ostree-2018.1.orig/libglnx/glnx-lockfile.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-lockfile.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-lockfile.h ostree-2018.5/libglnx/glnx-lockfile.h +--- ostree-2018.5.orig/libglnx/glnx-lockfile.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-lockfile.h 2018-05-26 00:37:32.007018846 +0300 @@ -0,0 +1,40 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + @@ -5070,9 +5072,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-lockfile.h ostree-2018.1/libglnx/glnx +void glnx_release_lock_file(GLnxLockFile *f); + +G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxLockFile, glnx_release_lock_file) -diff -Nuar ostree-2018.1.orig/libglnx/glnx-macros.h ostree-2018.1/libglnx/glnx-macros.h ---- ostree-2018.1.orig/libglnx/glnx-macros.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-macros.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-macros.h ostree-2018.5/libglnx/glnx-macros.h +--- ostree-2018.5.orig/libglnx/glnx-macros.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-macros.h 2018-05-26 00:37:32.007018846 +0300 @@ -0,0 +1,189 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -5263,9 +5265,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-macros.h ostree-2018.1/libglnx/glnx-m +#endif /* GI_SCANNER */ + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/glnx-missing.h ostree-2018.1/libglnx/glnx-missing.h ---- ostree-2018.1.orig/libglnx/glnx-missing.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-missing.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-missing.h ostree-2018.5/libglnx/glnx-missing.h +--- ostree-2018.5.orig/libglnx/glnx-missing.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-missing.h 2018-05-26 00:37:32.007018846 +0300 @@ -0,0 +1,95 @@ +#pragma once + @@ -5362,10 +5364,10 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-missing.h ostree-2018.1/libglnx/glnx- +#endif + +#include "glnx-missing-syscall.h" -diff -Nuar ostree-2018.1.orig/libglnx/glnx-missing-syscall.h ostree-2018.1/libglnx/glnx-missing-syscall.h ---- ostree-2018.1.orig/libglnx/glnx-missing-syscall.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-missing-syscall.h 2018-02-02 23:13:30.000000000 +0300 -@@ -0,0 +1,154 @@ +diff -Nuar ostree-2018.5.orig/libglnx/glnx-missing-syscall.h ostree-2018.5/libglnx/glnx-missing-syscall.h +--- ostree-2018.5.orig/libglnx/glnx-missing-syscall.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-missing-syscall.h 2018-05-26 00:37:32.007018846 +0300 +@@ -0,0 +1,156 @@ +/*** + This file was originally part of systemd. + @@ -5508,10 +5510,10 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-missing-syscall.h ostree-2018.1/libgl +# endif +# endif + -+static inline ssize_t copy_file_range(int fd_in, loff_t *off_in, -+ int fd_out, loff_t *off_out, -+ size_t len, -+ unsigned int flags) { ++static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in, ++ int fd_out, loff_t *off_out, ++ size_t len, ++ unsigned int flags) { +# ifdef __NR_copy_file_range + return syscall(__NR_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags); +# else @@ -5519,10 +5521,12 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-missing-syscall.h ostree-2018.1/libgl + return -1; +# endif +} ++ ++# define copy_file_range missing_copy_file_range +#endif -diff -Nuar ostree-2018.1.orig/libglnx/glnx-shutil.c ostree-2018.1/libglnx/glnx-shutil.c ---- ostree-2018.1.orig/libglnx/glnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-shutil.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-shutil.c ostree-2018.5/libglnx/glnx-shutil.c +--- ostree-2018.5.orig/libglnx/glnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-shutil.c 2018-05-26 00:37:32.007018846 +0300 @@ -0,0 +1,260 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -5784,9 +5788,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-shutil.c ostree-2018.1/libglnx/glnx-s + + return glnx_opendirat (dfd, path, TRUE, out_dfd, error); +} -diff -Nuar ostree-2018.1.orig/libglnx/glnx-shutil.h ostree-2018.1/libglnx/glnx-shutil.h ---- ostree-2018.1.orig/libglnx/glnx-shutil.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-shutil.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-shutil.h ostree-2018.5/libglnx/glnx-shutil.h +--- ostree-2018.5.orig/libglnx/glnx-shutil.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-shutil.h 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,48 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -5836,9 +5840,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-shutil.h ostree-2018.1/libglnx/glnx-s + GError **error); + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/glnx-xattrs.c ostree-2018.1/libglnx/glnx-xattrs.c ---- ostree-2018.1.orig/libglnx/glnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-xattrs.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-xattrs.c ostree-2018.5/libglnx/glnx-xattrs.c +--- ostree-2018.5.orig/libglnx/glnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-xattrs.c 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,444 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -6284,9 +6288,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-xattrs.c ostree-2018.1/libglnx/glnx-x + return TRUE; +} + -diff -Nuar ostree-2018.1.orig/libglnx/glnx-xattrs.h ostree-2018.1/libglnx/glnx-xattrs.h ---- ostree-2018.1.orig/libglnx/glnx-xattrs.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/glnx-xattrs.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/glnx-xattrs.h ostree-2018.5/libglnx/glnx-xattrs.h +--- ostree-2018.5.orig/libglnx/glnx-xattrs.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/glnx-xattrs.h 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,78 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -6366,9 +6370,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/glnx-xattrs.h ostree-2018.1/libglnx/glnx-x + GError **error); + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/libglnx.doap ostree-2018.1/libglnx/libglnx.doap ---- ostree-2018.1.orig/libglnx/libglnx.doap 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/libglnx.doap 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/libglnx.doap ostree-2018.5/libglnx/libglnx.doap +--- ostree-2018.5.orig/libglnx/libglnx.doap 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/libglnx.doap 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,31 @@ + + + + -diff -Nuar ostree-2018.1.orig/libglnx/libglnx.h ostree-2018.1/libglnx/libglnx.h ---- ostree-2018.1.orig/libglnx/libglnx.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/libglnx.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/libglnx.h ostree-2018.5/libglnx/libglnx.h +--- ostree-2018.5.orig/libglnx/libglnx.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/libglnx.h 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,40 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -6445,10 +6449,10 @@ diff -Nuar ostree-2018.1.orig/libglnx/libglnx.h ostree-2018.1/libglnx/libglnx.h +#include + +G_END_DECLS -diff -Nuar ostree-2018.1.orig/libglnx/libglnx.m4 ostree-2018.1/libglnx/libglnx.m4 ---- ostree-2018.1.orig/libglnx/libglnx.m4 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/libglnx.m4 2018-02-02 23:13:30.000000000 +0300 -@@ -0,0 +1,32 @@ +diff -Nuar ostree-2018.5.orig/libglnx/libglnx.m4 ostree-2018.5/libglnx/libglnx.m4 +--- ostree-2018.5.orig/libglnx/libglnx.m4 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/libglnx.m4 2018-05-26 00:37:32.008018846 +0300 +@@ -0,0 +1,33 @@ +AC_DEFUN([LIBGLNX_CONFIGURE], +[ +AC_CHECK_DECLS([ @@ -6463,6 +6467,7 @@ diff -Nuar ostree-2018.1.orig/libglnx/libglnx.m4 ostree-2018.1/libglnx/libglnx.m +#include +#include +#include ++#include +]]) + +AC_ARG_ENABLE(otmpfile, @@ -6481,9 +6486,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/libglnx.m4 ostree-2018.1/libglnx/libglnx.m + +dnl end LIBGLNX_CONFIGURE +]) -diff -Nuar ostree-2018.1.orig/libglnx/Makefile-libglnx.am ostree-2018.1/libglnx/Makefile-libglnx.am ---- ostree-2018.1.orig/libglnx/Makefile-libglnx.am 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/Makefile-libglnx.am 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/Makefile-libglnx.am ostree-2018.5/libglnx/Makefile-libglnx.am +--- ostree-2018.5.orig/libglnx/Makefile-libglnx.am 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/Makefile-libglnx.am 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,78 @@ +# Copyright (C) 2015 Colin Walters +# @@ -6563,9 +6568,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/Makefile-libglnx.am ostree-2018.1/libglnx/ +test_libglnx_shutil_SOURCES = $(libglnx_srcpath)/tests/test-libglnx-shutil.c +test_libglnx_shutil_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags) +test_libglnx_shutil_LDADD = $(libglnx_libs) libglnx.la -diff -Nuar ostree-2018.1.orig/libglnx/README.md ostree-2018.1/libglnx/README.md ---- ostree-2018.1.orig/libglnx/README.md 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/README.md 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/README.md ostree-2018.5/libglnx/README.md +--- ostree-2018.5.orig/libglnx/README.md 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/README.md 2018-05-26 00:37:32.006018846 +0300 @@ -0,0 +1,52 @@ +libglnx is the successor to libgsystem: https://git.gnome.org/browse/libgsystem + @@ -6619,9 +6624,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/README.md ostree-2018.1/libglnx/README.md +https://github.com/GNOME/libglnx/pulls + +Or alternatively, email one of the maintainers directly. -diff -Nuar ostree-2018.1.orig/libglnx/tests/libglnx-testlib.h ostree-2018.1/libglnx/tests/libglnx-testlib.h ---- ostree-2018.1.orig/libglnx/tests/libglnx-testlib.h 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/tests/libglnx-testlib.h 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/tests/libglnx-testlib.h ostree-2018.5/libglnx/tests/libglnx-testlib.h +--- ostree-2018.5.orig/libglnx/tests/libglnx-testlib.h 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/tests/libglnx-testlib.h 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,34 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -6657,9 +6662,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/tests/libglnx-testlib.h ostree-2018.1/libg +#define _GLNX_TEST_DECLARE_ERROR(local_error, error) \ + g_autoptr(_GLnxTestAutoError) local_error = NULL; \ + GError **error = &local_error -diff -Nuar ostree-2018.1.orig/libglnx/tests/test-libglnx-errors.c ostree-2018.1/libglnx/tests/test-libglnx-errors.c ---- ostree-2018.1.orig/libglnx/tests/test-libglnx-errors.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/tests/test-libglnx-errors.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/tests/test-libglnx-errors.c ostree-2018.5/libglnx/tests/test-libglnx-errors.c +--- ostree-2018.5.orig/libglnx/tests/test-libglnx-errors.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/tests/test-libglnx-errors.c 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,183 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -6844,9 +6849,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/tests/test-libglnx-errors.c ostree-2018.1/ + + return ret; +} -diff -Nuar ostree-2018.1.orig/libglnx/tests/test-libglnx-fdio.c ostree-2018.1/libglnx/tests/test-libglnx-fdio.c ---- ostree-2018.1.orig/libglnx/tests/test-libglnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/tests/test-libglnx-fdio.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/tests/test-libglnx-fdio.c ostree-2018.5/libglnx/tests/test-libglnx-fdio.c +--- ostree-2018.5.orig/libglnx/tests/test-libglnx-fdio.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/tests/test-libglnx-fdio.c 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,254 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -7102,9 +7107,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/tests/test-libglnx-fdio.c ostree-2018.1/li + + return ret; +} -diff -Nuar ostree-2018.1.orig/libglnx/tests/test-libglnx-macros.c ostree-2018.1/libglnx/tests/test-libglnx-macros.c ---- ostree-2018.1.orig/libglnx/tests/test-libglnx-macros.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/tests/test-libglnx-macros.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/tests/test-libglnx-macros.c ostree-2018.5/libglnx/tests/test-libglnx-macros.c +--- ostree-2018.5.orig/libglnx/tests/test-libglnx-macros.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/tests/test-libglnx-macros.c 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,109 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -7215,9 +7220,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/tests/test-libglnx-macros.c ostree-2018.1/ + g_test_add_func ("/hash_table_foreach", test_hash_table_foreach); + return g_test_run(); +} -diff -Nuar ostree-2018.1.orig/libglnx/tests/test-libglnx-shutil.c ostree-2018.1/libglnx/tests/test-libglnx-shutil.c ---- ostree-2018.1.orig/libglnx/tests/test-libglnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/tests/test-libglnx-shutil.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/tests/test-libglnx-shutil.c ostree-2018.5/libglnx/tests/test-libglnx-shutil.c +--- ostree-2018.5.orig/libglnx/tests/test-libglnx-shutil.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/tests/test-libglnx-shutil.c 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,63 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * @@ -7282,9 +7287,9 @@ diff -Nuar ostree-2018.1.orig/libglnx/tests/test-libglnx-shutil.c ostree-2018.1/ + + return ret; +} -diff -Nuar ostree-2018.1.orig/libglnx/tests/test-libglnx-xattrs.c ostree-2018.1/libglnx/tests/test-libglnx-xattrs.c ---- ostree-2018.1.orig/libglnx/tests/test-libglnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 -+++ ostree-2018.1/libglnx/tests/test-libglnx-xattrs.c 2018-02-02 23:13:30.000000000 +0300 +diff -Nuar ostree-2018.5.orig/libglnx/tests/test-libglnx-xattrs.c ostree-2018.5/libglnx/tests/test-libglnx-xattrs.c +--- ostree-2018.5.orig/libglnx/tests/test-libglnx-xattrs.c 1970-01-01 02:00:00.000000000 +0200 ++++ ostree-2018.5/libglnx/tests/test-libglnx-xattrs.c 2018-05-26 00:37:32.008018846 +0300 @@ -0,0 +1,283 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * diff --git a/hardware/virtualization/ostree/pspec.xml b/hardware/virtualization/ostree/pspec.xml index c09938853b..3756d86b76 100644 --- a/hardware/virtualization/ostree/pspec.xml +++ b/hardware/virtualization/ostree/pspec.xml @@ -12,7 +12,7 @@ app:console Operating system and container binary deployment and upgrades OSTree is a tool for managing bootable, immutable, versioned filesystem trees - https://github.com/ostreedev/ostree/archive/v2018.2.tar.gz + https://github.com/ostreedev/ostree/archive/v2018.5.tar.gz gtk-doc rust @@ -85,6 +85,13 @@ + + 2018-05-24 + 2018.5 + Version bump. + Ertuğrul Erata + ertugrulerata@gmail.com + 2018-02-16 2018.2 From 00b6aff7ed932689e5da0f9fc1d1e2dcc53f59c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ertu=C4=9Frul=20Erata?= Date: Tue, 29 May 2018 02:10:08 +0300 Subject: [PATCH 2/2] bubblewrap update --- hardware/virtualization/bubblewrap/pspec.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hardware/virtualization/bubblewrap/pspec.xml b/hardware/virtualization/bubblewrap/pspec.xml index 1f12c4b468..d1be848eca 100644 --- a/hardware/virtualization/bubblewrap/pspec.xml +++ b/hardware/virtualization/bubblewrap/pspec.xml @@ -11,7 +11,7 @@ LGPLv2 Unprivileged sandboxing tool is a core execution engine for unprivileged containers that works as a setuid binary on kernels without user namespaces. - https://github.com/projectatomic/bubblewrap/archive/v0.2.0.tar.gz + https://github.com/projectatomic/bubblewrap/archive/v0.2.1.tar.gz libcap-devel bash-completion @@ -34,6 +34,13 @@ + + 2018-05-29 + 0.2.1 + Version bump. + Ertuğrul Erata + ertugrulerata@gmail.com + 2018-02-03 0.2.0