Commit 1dca7ccf authored by Matthias Klumpp's avatar Matthias Klumpp

luks/localegen: Ensure pkexec finds a working shell set

parent 7f6ee723
......@@ -7,22 +7,46 @@ Last-Update: 2017-05-30
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/gnome-initial-setup/pages/language/gis-language-page.c
+++ b/gnome-initial-setup/pages/language/gis-language-page.c
@@ -62,6 +62,7 @@
@@ -62,6 +62,10 @@
GisLanguagePagePrivate *priv = gis_language_page_get_instance_private (self);
GVariantBuilder *b;
gchar *s;
+ g_autofree gchar *tmp = NULL;
+ gchar *argv[5];
+ gchar *envp[2];
+ g_autoptr(GError) error = NULL;
+
b = g_variant_builder_new (G_VARIANT_TYPE ("as"));
s = g_strconcat ("LANG=", priv->new_locale_id, NULL);
@@ -74,6 +75,10 @@
@@ -74,6 +78,31 @@
G_DBUS_CALL_FLAGS_NONE,
-1, NULL, NULL, NULL);
g_variant_builder_unref (b);
+
+ /* an absolutely awful hack, but it will do for now - however, we should not keep this */
+ tmp = g_strdup_printf ("pkexec python3 /usr/lib/gnome-initial-setup/install-locale.py %s", priv->new_locale_id);
+ g_spawn_command_line_sync (tmp, NULL, NULL, NULL, NULL);
+ argv[0] = "pkexec";
+ argv[1] = "/usr/bin/python3";
+ argv[2] = "/usr/lib/gnome-initial-setup/install-locale.py";
+ argv[3] = g_strdup (priv->new_locale_id);
+ argv[4] = NULL;
+
+ envp[0] = "SHELL=/bin/sh";
+ envp[1] = NULL;
+
+ /* FIXME: an absolutely awful hack, but it will do for now, until the locale-gen issue has been addressed in systemd */
+ if (!g_spawn_sync (NULL,
+ argv,
+ envp,
+ G_SPAWN_SEARCH_PATH,
+ NULL,
+ NULL,
+ NULL, /* stdout */
+ NULL, /* stderr */
+ NULL, /* exit status */
+ &error)) {
+ g_warning ("error: [%s]\n", error->message);
+ }
+
+ g_free (argv[3]);
}
static void
From efd9b2c6106c7ff933cd17e115fc40c2129d5970 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Thu, 15 Mar 2018 23:10:41 +0100
Subject: [PATCH] LUKS Page test
Subject: [PATCH] Add new LUKS page to set disk encryption password
This is highly PureOS specific and needs a customized Calamares to work,
so this change is likely only ever useful for PureOS.
---
gnome-initial-setup/gnome-initial-setup.c | 2 +
......@@ -82,7 +84,7 @@ Subject: [PATCH] LUKS Page test
+ $(resource_files)
--- /dev/null
+++ b/gnome-initial-setup/pages/luks/gis-luks-page.c
@@ -0,0 +1,295 @@
@@ -0,0 +1,300 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * Copyright (C) 2012 Red Hat
......@@ -157,21 +159,26 @@ Subject: [PATCH] LUKS Page test
+ GisLuksPagePrivate *priv = gis_luks_page_get_instance_private (page);
+ const gchar *password;
+ gchar *argv[6];
+ gchar *envp[2];
+ g_autoptr(GError) error = NULL;
+
+ password = gtk_entry_get_text (GTK_ENTRY (priv->password_entry));
+
+ argv[0] = "pkexec";
+ argv[1] = "python3";
+ argv[1] = "/usr/bin/python3";
+ argv[2] = "/usr/lib/gnome-initial-setup/cryptsetup-helper.py";
+ argv[3] = "--password";
+ argv[4] = g_strdup (password);
+ argv[5] = NULL;
+
+ /* FIXME: it is very ugly to call a Python script, and for the moment we don't even catch error properly... */
+ envp[0] = "SHELL=/bin/sh";
+ envp[1] = NULL;
+
+ /* FIXME: it is very ugly to call a Python script via pkexec, and for the moment we don't even catch errors properly... */
+ /* TODO: Maybe make the cryptsetup helper into a proper D-Bus activated PolKit service? */
+ if (!g_spawn_sync (NULL,
+ argv,
+ NULL,
+ envp,
+ G_SPAWN_SEARCH_PATH,
+ NULL,
+ NULL,
......
01_pureos-default-goa-providers.patch
02_pureos-data-transmission-privacy-default-off.patch
03_pureos-spawn-oem-installer-after-setup-on-live.patch
tmp_localegen-hack.patch
tmp_new-luks-page.patch
04_localegen-hack.patch
05_new-luks-page.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment