GNOME Bugzilla – Bug 616706
Make getting the environment from gnome-session more robust
Last modified: 2010-05-09 20:36:11 UTC
readlink() on /proc/<pid>/exe can have results like: /usr/bin/gnome-keyring-daemon.#prelink#.5DFZsF (deleted) /usr/bin/gnome-session (deleted) To find gnome-session in a more robust way, read /proc/<pid>/cmdline instead.
Created attachment 159472 [details] [review] Make getting the environment from gnome-session more robust readlink() on /proc/<pid>/exe can have results like: /usr/bin/gnome-keyring-daemon.#prelink#.5DFZsF (deleted) /usr/bin/gnome-session (deleted) To find gnome-session in a more robust way, read /proc/<pid>/cmdline instead.
Review of attachment 159472 [details] [review]: ::: src/gnome-shell.in @@ +44,3 @@ continue + command = command.split()[0] + command = command.replace("\x00", "") Shouldn't that be: command = command.split("\x00") The null character separates the arguments as far as I know, so just dropping them then splitting on whitespace won't work unless the command only has one argument (which is probably why it works for just "gnome-session").
Created attachment 160652 [details] [review] Make getting the environment from gnome-session more robust Same but with: + # /proc/cmdline is separated and terminated by NULs + command = command.split("\x00")[0]
Review of attachment 160652 [details] [review]: Looks fine.
Attachment 160652 [details] pushed as c4406d4 - Make getting the environment from gnome-session more robust