the-cavalry / light-locker

A simple session-locker for lightdm
GNU General Public License v2.0
222 stars 22 forks source link

Improve session id handling #123

Closed corsac-s closed 5 years ago

corsac-s commented 5 years ago

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).

ochosi commented 5 years ago

Looks harmless and meaningful at the same time - thanks! :)