$OpenBSD: patch-src_update-desktop-database_c,v 1.15 2018/09/27 06:34:34 jasper Exp $

- unveil the required directory with .desktop files and where the cache file needs
  to be written out to.
- pledge
  https://bugs.freedesktop.org/show_bug.cgi?id=104367

Index: src/update-desktop-database.c
--- src/update-desktop-database.c.orig
+++ src/update-desktop-database.c
@@ -450,6 +450,18 @@ main (int    argc,
      { NULL }
    };
 
+#ifdef notyet
+  if (unveil("${PREFIX}/share/applications", "rwc") == -1) {
+    g_printerr ("unveil\n");
+    return 1;
+  }
+#endif
+
+  if (pledge("stdio rpath wpath cpath fattr", NULL) == -1) {
+    g_printerr ("pledge\n");
+    return 1;
+  }
+
   context = g_option_context_new ("");
   g_option_context_set_summary (context, _("Build cache database of MIME types handled by desktop files."));
   g_option_context_add_main_entries (context, options, NULL);
