uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,130 @@
From 6f172007452b39bfda5062fc29ea5382671ac16e Mon Sep 17 00:00:00 2001
From: Alexander Ried <ried@mytum.de>
Date: Thu, 26 May 2016 19:54:21 +0200
Subject: [PATCH] Disable methods that change files in /etc
Only if environment variable NIXOS_USERS_PURE is set.
---
src/daemon.c | 10 ++++++++++
src/user.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+)
diff --git a/src/daemon.c b/src/daemon.c
index e62e124..87459b2 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -931,6 +931,11 @@ daemon_create_user (AccountsAccounts *accounts,
const gchar *real_name,
gint account_type)
{
+ if (getenv("NIXOS_USERS_PURE")) {
+ throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
+ return;
+ }
+
Daemon *daemon = (Daemon*)accounts;
CreateUserData *data;
@@ -1138,6 +1143,11 @@ daemon_delete_user (AccountsAccounts *accounts,
gint64 uid,
gboolean remove_files)
{
+ if (getenv("NIXOS_USERS_PURE")) {
+ throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
+ return;
+ }
+
Daemon *daemon = (Daemon*)accounts;
DeleteUserData *data;
diff --git a/src/user.c b/src/user.c
index 0fb1a17..dbdebaf 100644
--- a/src/user.c
+++ b/src/user.c
@@ -904,6 +904,11 @@ user_set_real_name (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *real_name)
{
+ if (getenv("NIXOS_USERS_PURE")) {
+ throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
+ return;
+ }
+
User *user = (User*)auser;
int uid;
const gchar *action_id;
@@ -981,6 +986,11 @@ user_set_user_name (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *user_name)
{
+ if (getenv("NIXOS_USERS_PURE")) {
+ throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
+ return;
+ }
+
User *user = (User*)auser;
daemon_local_check_auth (user->daemon,
user,
@@ -1263,6 +1273,11 @@ user_set_home_directory (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *home_dir)
{
+ if (getenv("NIXOS_USERS_PURE")) {
+ throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
+ return;
+ }
+
User *user = (User*)auser;
daemon_local_check_auth (user->daemon,
user,
@@ -1322,6 +1337,11 @@ user_set_shell (AccountsUser *auser,
GDBusMethodInvocation *context,
const gchar *shell)
{
+ if (getenv("NIXOS_USERS_PURE")) {
+ throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
+ return;
+ }
+
User *user = (User*)auser;
daemon_local_check_auth (user->daemon,
user,
@@ -1602,6 +1622,11 @@ user_set_locked (AccountsUser *auser,
GDBusMethodInvocation *context,
gboolean locked)
{
+ if (getenv("NIXOS_USERS_PURE")) {
+ throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
+ return;
+ }
+
User *user = (User*)auser;
daemon_local_check_auth (user->daemon,
user,
@@ -1814,6 +1839,11 @@ user_set_password_mode (AccountsUser *auser,
GDBusMethodInvocation *context,
gint mode)
{
+ if (getenv("NIXOS_USERS_PURE")) {
+ throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
+ return;
+ }
+
User *user = (User*)auser;
const gchar *action_id;
@@ -1905,6 +1935,11 @@ user_set_password (AccountsUser *auser,
const gchar *password,
const gchar *hint)
{
+ if (getenv("NIXOS_USERS_PURE")) {
+ throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
+ return;
+ }
+
User *user = (User*)auser;
gchar **data;
--
2.9.3

View file

@ -0,0 +1,84 @@
{ lib
, stdenv
, fetchurl
, substituteAll
, pkg-config
, glib
, shadow
, gobject-introspection
, polkit
, systemd
, coreutils
, meson
, dbus
, ninja
, python3
, vala
, gettext
}:
stdenv.mkDerivation rec {
pname = "accountsservice";
version = "22.08.8";
outputs = [ "out" "dev" ];
src = fetchurl {
url = "https://www.freedesktop.org/software/accountsservice/accountsservice-${version}.tar.xz";
sha256 = "kJmXp2kZ/n3BOKmgHOpwvWItWpMtvJ+xMBARMCOno5E=";
};
patches = [
# Hardcode dependency paths.
(substituteAll {
src = ./fix-paths.patch;
inherit shadow coreutils;
})
# Do not try to create directories in /var, that will not work in Nix sandbox.
./no-create-dirs.patch
# Disable mutating D-Bus methods with immutable /etc.
./Disable-methods-that-change-files-in-etc.patch
# Do not ignore third-party (e.g Pantheon) extensions not matching FHS path scheme.
# Fixes https://github.com/NixOS/nixpkgs/issues/72396
./drop-prefix-check-extensions.patch
];
nativeBuildInputs = [
dbus
gettext
gobject-introspection
meson
ninja
pkg-config
python3
vala
];
buildInputs = [
glib
polkit
systemd
];
mesonFlags = [
"-Dadmin_group=wheel"
"-Dlocalstatedir=/var"
"-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
];
postPatch = ''
chmod +x meson_post_install.py
patchShebangs meson_post_install.py
'';
meta = with lib; {
description = "D-Bus interface for user account query and manipulation";
homepage = "https://www.freedesktop.org/wiki/Software/AccountsService";
license = licenses.gpl3Plus;
maintainers = teams.freedesktop.members ++ (with maintainers; [ pSub ]);
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,22 @@
diff --git a/src/extensions.c b/src/extensions.c
index 038dcb2..830465d 100644
--- a/src/extensions.c
+++ b/src/extensions.c
@@ -121,16 +121,7 @@ daemon_read_extension_directory (GHashTable *ifaces,
continue;
}
- /* Ensure it looks like "../../dbus-1/interfaces/${name}" */
- const gchar * const prefix = "../../dbus-1/interfaces/";
- if (g_str_has_prefix (symlink, prefix) && g_str_equal (symlink + strlen (prefix), name)) {
- daemon_read_extension_file (ifaces, filename);
- }
- else {
- g_warning ("Found accounts service vendor extension symlink %s, but it must be exactly "
- "equal to '../../dbus-1/interfaces/%s' for forwards-compatibility reasons.",
- filename, name);
- }
+ daemon_read_extension_file (ifaces, filename);
}
g_dir_close (dir);

View file

@ -0,0 +1,125 @@
diff --git a/src/daemon.c b/src/daemon.c
index c8b6320..2b74949 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -1102,7 +1102,7 @@ daemon_create_user_authorized_cb (Daemon *daemon,
sys_log (context, "create user '%s'", cd->user_name);
- argv[0] = "/usr/sbin/useradd";
+ argv[0] = "@shadow@/bin/useradd";
argv[1] = "-m";
argv[2] = "-c";
argv[3] = cd->real_name;
@@ -1335,7 +1335,7 @@ daemon_delete_user_authorized_cb (Daemon *daemon,
}
free (resolved_homedir);
- argv[0] = "/usr/sbin/userdel";
+ argv[0] = "@shadow@/bin/userdel";
if (ud->remove_files) {
argv[1] = "-f";
argv[2] = "-r";
diff --git a/src/user.c b/src/user.c
index 189b2c5..5358c02 100644
--- a/src/user.c
+++ b/src/user.c
@@ -1145,7 +1145,7 @@ user_change_real_name_authorized_cb (Daemon *daemon,
new_gecos = g_strdup (name);
}
- argv[0] = "/usr/sbin/usermod";
+ argv[0] = "@shadow@/bin/usermod";
argv[1] = "-c";
argv[2] = new_gecos;
argv[3] = "--";
@@ -1218,7 +1218,7 @@ user_change_user_name_authorized_cb (Daemon *daemon,
accounts_user_get_uid (ACCOUNTS_USER (user)),
name);
- argv[0] = "/usr/sbin/usermod";
+ argv[0] = "@shadow@/bin/usermod";
argv[1] = "-l";
argv[2] = name;
argv[3] = "--";
@@ -1627,7 +1627,7 @@ user_change_home_dir_authorized_cb (Daemon *daemon,
accounts_user_get_uid (ACCOUNTS_USER (user)),
home_dir);
- argv[0] = "/usr/sbin/usermod";
+ argv[0] = "@shadow@/bin/usermod";
argv[1] = "-m";
argv[2] = "-d";
argv[3] = home_dir;
@@ -1683,7 +1683,7 @@ user_change_shell_authorized_cb (Daemon *daemon,
accounts_user_get_uid (ACCOUNTS_USER (user)),
shell);
- argv[0] = "/usr/sbin/usermod";
+ argv[0] = "@shadow@/bin/usermod";
argv[1] = "-s";
argv[2] = shell;
argv[3] = "--";
@@ -1824,7 +1824,7 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
return;
}
- argv[0] = "/bin/cat";
+ argv[0] = "@coreutils@/bin/cat";
argv[1] = filename;
argv[2] = NULL;
@@ -1904,7 +1904,7 @@ user_change_locked_authorized_cb (Daemon *daemon,
locked ? "locking" : "unlocking",
accounts_user_get_user_name (ACCOUNTS_USER (user)),
accounts_user_get_uid (ACCOUNTS_USER (user)));
- argv[0] = "/usr/sbin/usermod";
+ argv[0] = "@shadow@/bin/usermod";
argv[1] = locked ? "-L" : "-U";
argv[2] = "--";
argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
@@ -2026,7 +2026,7 @@ user_change_account_type_authorized_cb (Daemon *daemon,
g_free (groups);
- argv[0] = "/usr/sbin/usermod";
+ argv[0] = "@shadow@/bin/usermod";
argv[1] = "-G";
argv[2] = str->str;
argv[3] = "--";
@@ -2093,7 +2093,7 @@ user_change_password_mode_authorized_cb (Daemon *daemon,
if (mode == PASSWORD_MODE_SET_AT_LOGIN ||
mode == PASSWORD_MODE_NONE) {
- argv[0] = "/usr/bin/passwd";
+ argv[0] = "/run/wrappers/bin/passwd";
argv[1] = "-d";
argv[2] = "--";
argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
@@ -2105,7 +2105,7 @@ user_change_password_mode_authorized_cb (Daemon *daemon,
}
if (mode == PASSWORD_MODE_SET_AT_LOGIN) {
- argv[0] = "/usr/bin/chage";
+ argv[0] = "@shadow@/bin/chage";
argv[1] = "-d";
argv[2] = "0";
argv[3] = "--";
@@ -2126,7 +2126,7 @@ user_change_password_mode_authorized_cb (Daemon *daemon,
accounts_user_set_locked (ACCOUNTS_USER (user), FALSE);
}
else if (accounts_user_get_locked (ACCOUNTS_USER (user))) {
- argv[0] = "/usr/sbin/usermod";
+ argv[0] = "@shadow@/bin/usermod";
argv[1] = "-U";
argv[2] = "--";
argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
@@ -2203,7 +2203,7 @@ user_change_password_authorized_cb (Daemon *daemon,
g_object_freeze_notify (G_OBJECT (user));
- argv[0] = "/usr/sbin/usermod";
+ argv[0] = "@shadow@/bin/usermod";
argv[1] = "-p";
argv[2] = strings[0];
argv[3] = "--";

View file

@ -0,0 +1,17 @@
diff --git a/meson_post_install.py b/meson_post_install.py
index d8c3dd1..620f714 100644
--- a/meson_post_install.py
+++ b/meson_post_install.py
@@ -9,9 +9,9 @@ localstatedir = os.path.normpath(destdir + os.sep + sys.argv[1])
# FIXME: meson will not track the creation of these directories
# https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
dst_dirs = [
- (os.path.join(localstatedir, 'lib'), 0o755),
- (os.path.join(localstatedir, 'lib', 'AccountsService', 'icons'), 0o775),
- (os.path.join(localstatedir, 'lib', 'AccountsService', 'users'), 0o700),
+ # (os.path.join(localstatedir, 'lib'), 0o755),
+ # (os.path.join(localstatedir, 'lib', 'AccountsService', 'icons'), 0o775),
+ # (os.path.join(localstatedir, 'lib', 'AccountsService', 'users'), 0o700),
]
for (dst_dir, dst_dir_mode) in dst_dirs: