# Add patch from Michał Mirosław <mirq-deboogs@rere.qmqm.pl> to fix a timeout
# in notify-send.
# Closes: #1024426
# Additional fixed later:
# Closes: #1079666

diff -Naur needrestart-3.6.orig/ex/notify.d/400-notify-send needrestart-3.6/ex/notify.d/400-notify-send
--- needrestart-3.6.orig/ex/notify.d/400-notify-send	2022-05-17 16:59:22.000000000 +0200
+++ needrestart-3.6/ex/notify.d/400-notify-send	2024-04-03 10:46:56.521125082 +0200
@@ -48,7 +48,7 @@
     MSGBODY=$(gettext 'Your session is running obsolete binaries or libraries as listed below.
 <i><b>Please consider a relogin or restart of the affected processes!</b></i>')'\n'$(cat)
 
-    su -p -s /bin/sh -c "$NSEND -a needrestart -u critical -i dialog-warning \"$MSGTITLE\" \"$MSGBODY\"" "$NR_USERNAME"
+    runuser -p -u "$NR_USERNAME" -- "$NSEND" -a needrestart -u critical -i dialog-warning "$MSGTITLE" "$MSGBODY"
     ;;
   *)
     echo "[$0] skip session '$NR_SESSION'" 1>&2
