DBus calls don't like at all beeing called with an empty argument (it crashes the process). I've identified cases (for example when /proc is mounted with hidepid>0) where session_id and sd_session_id might end up empty.
The two patches here try to improve the situation by falling back to XDG_SESSION_ID (for sd_session_id) and printing an error when session_id is NULL.
Also it might make sense at one point to rename session_id by session_path or something, because it's not an ID. Also sd_session_id can be deduced from the session_path so the library calls to sd_pid_get_session might be dropped (they won't work with hidepid anyway).
DBus calls don't like at all beeing called with an empty argument (it crashes the process). I've identified cases (for example when /proc is mounted with hidepid>0) where session_id and sd_session_id might end up empty.
The two patches here try to improve the situation by falling back to XDG_SESSION_ID (for sd_session_id) and printing an error when session_id is NULL.
Also it might make sense at one point to rename session_id by session_path or something, because it's not an ID. Also sd_session_id can be deduced from the session_path so the library calls to sd_pid_get_session might be dropped (they won't work with hidepid anyway).