Skip to content

Commit

Permalink
[DDW-1213] Add libsystemd--device-monitor.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrus committed Jun 5, 2023
1 parent b319759 commit 9105b4e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
17 changes: 17 additions & 0 deletions nix/libsystemd--device-monitor.patch
@@ -0,0 +1,17 @@
diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c
index fd5900704d..f9106fdbe5 100644
--- a/src/libsystemd/sd-device/device-monitor.c
+++ b/src/libsystemd/sd-device/device-monitor.c
@@ -445,9 +445,9 @@ int device_monitor_receive_device(sd_device_monitor *m, sd_device **ret) {
"sd-device-monitor: No sender credentials received, message ignored.");

cred = (struct ucred*) CMSG_DATA(cmsg);
- if (cred->uid != 0)
- return log_debug_errno(SYNTHETIC_ERRNO(EAGAIN),
- "sd-device-monitor: Sender uid="UID_FMT", message ignored.", cred->uid);
+ //if (cred->uid != 0)
+ // return log_debug_errno(SYNTHETIC_ERRNO(EAGAIN),
+ // "sd-device-monitor: Sender uid="UID_FMT", message ignored.", cred->uid);

if (streq(buf.raw, "libudev")) {
/* udev message needs proper version magic */
14 changes: 13 additions & 1 deletion nix/old-default.nix
Expand Up @@ -8,7 +8,19 @@ let
system = {
x86_64-windows = "x86_64-linux"; # Windows can only be cross-built from Linux now
}.${target} or target;
pkgs = inputs.nixpkgs.legacyPackages.${system};
pkgs =
if target != "x86_64-linux"
then inputs.nixpkgs.legacyPackages.${system}
else import inputs.nixpkgs {
inherit system;
config.packageOverrides = super: {
# XXX: non-root users need to be able to use sd-device/device-monitor.c to detect Ledger:
# FIXME: find the correct (minimal) place to override this:
systemd = super.systemd.overrideAttrs (oldAttrs: {
patches = oldAttrs.patches ++ [./libsystemd--device-monitor.patch];
});
};
};
walletFlake = (import inputs.flake-compat {
# FIXME: add patches in `flake.nix` after <https://github.com/NixOS/nix/issues/3920>
src = pkgs.runCommand "cardano-wallet" {} ''
Expand Down

0 comments on commit 9105b4e

Please sign in to comment.