Skip to content

Remove keyring from gnome-compat-startup key#200

Open
milouse wants to merge 1 commit intomate-desktop:masterfrom
milouse:patch-1
Open

Remove keyring from gnome-compat-startup key#200
milouse wants to merge 1 commit intomate-desktop:masterfrom
milouse:patch-1

Conversation

@milouse
Copy link
Copy Markdown

@milouse milouse commented Mar 22, 2019

Mate Desktop support /etc/xdg/autostart elements and gnome-keyring-daemon (GKD) add entries, which mention explicitely Mate desktop there. Thus this entry is redundant. On the other hand, this entry is responsible for a "start-all-subcomponent" of GKD, which block fine selection of components to load at startup.

I think this compat element is not needed any more.

Fix: #182

Mate Desktop support /etc/xdg/autostart elements and gnome-keyring-daemon (GKD) add entries, which mention explicitely Mate desktop there. Thus this entry is redundant. On the other hand, this entry is responsible for a "start-all-subcomponent" of GKD, which block fine selection of components to load at startup.

I think this compat element is not needed any more.

Fix: mate-desktop#182
@raveit65
Copy link
Copy Markdown
Member

Hmm, with this commit my ssh key isn't unlock anymore after session start.

[rave@mother caja-actions]$ git pull
Enter passphrase for key '/home/rave/.ssh/id_rsa': 

All three gnome-keyring in autostart are there and enabled.

[root@mother rave]# ls -l /etc/xdg/autostart/ | grep gnome-keyring
-rw-r--r--  1 root root  8355  2. Mär 19:15 gnome-keyring-pkcs11.desktop
-rw-r--r--  1 root root  7976  2. Mär 19:15 gnome-keyring-secrets.desktop
-rw-r--r--  1 root root  6538  2. Mär 19:15 gnome-keyring-ssh.desktop
[rave@mother caja-actions]$ gsettings get org.mate.session gnome-compat-startup
['smproxy']

Looks like this is needed.

@milouse
Copy link
Copy Markdown
Author

milouse commented Mar 22, 2019

Hum… very weird… can you check if you see gnome-keyring-ssh.desktop in the « startup applications » gui ? If not, it may be disabled by something else. Do you have such an entry: ~/.config/autostart/gnome-keyring-ssh.desktop ?

If not, it's surely a bug in gnome-keyring-daemon.

@milouse
Copy link
Copy Markdown
Author

milouse commented Mar 22, 2019

Oh, no, forget about my previous message. Your behaviour is normal.

In fact, Mate Desktop will spawn gnome-keyring-daemon --login --daemonize when keyring is present in gnome-compat-startup. The --login switch implies the --unlock option by using the PAM password to unlocking compoment.

Without it, the later gnome-keyring-daemon --start will just enable component, without unlocking them.

Thus my PR is wrong. The problem seems not to be in mate itself, but because the --login switch somehow enable all components, instead of waiting for the corresponding --start call, as explained in the man page.

We should may be investigate on the GKD part for now.

@milouse
Copy link
Copy Markdown
Author

milouse commented Mar 22, 2019

Mmmmh I just found something unclear to me. This line seems to indicate that mate-desktop spawn gnome-keyring-daemon --start instead of gnome-keyring-daemon --login --daemonize.

I'm not a C expert, nor a Mate guru :( @raveit65, if you have time, can you check if it works for you when you:

  1. Keep the gnome-compat-startup value as ['keyring', 'smproxy']
  2. Replace the line 85 by : gchar *argv[4];
  3. Replace the above line 97-100 by:
argv[0] = GNOME_KEYRING_DAEMON;
argv[1] = "--login";
argv[2] = "--daemonize";
argv[3] = NULL;

Thank you very much!

@raveit65
Copy link
Copy Markdown
Member

raveit65 commented Mar 22, 2019

can you check if you see gnome-keyring-ssh.desktop in the « startup applications » gui ?

Yes, they are.

Do you have such an entry: ~/.config/autostart/gnome-keyring-ssh.desktop ?

No

[rave@mother ~]$ ls -l .config/autostart/ | grep keyring
[rave@mother ~]$ 

With you last suggestion

--- a/mate-session/msm-gnome.c
+++ b/mate-session/msm-gnome.c
@@ -82,7 +82,7 @@ gnome_keyring_daemon_startup (void)
   gint         status;
   glong        pid;
   gchar       *end;
-  gchar       *argv[3];
+  gchar       *argv[4];
   gchar       *p;
   gchar       *name;
   const gchar *value;
@@ -96,8 +96,9 @@ gnome_keyring_daemon_startup (void)
 
   error = NULL;
   argv[0] = GNOME_KEYRING_DAEMON;
-  argv[1] = "--start";
-  argv[2] = NULL;
+  argv[1] = "--login";
+  argv[2] = "--daemonize";
+  argv[3] = NULL;
   g_spawn_sync (NULL, argv, NULL,
                 G_SPAWN_SEARCH_PATH | G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
                 child_setup, NULL,

and

rave@mother ~]$ gsettings get org.mate.session gnome-compat-startup
['keyring', 'smproxy']

my login keyring won't be unlocked and after 10-15 sec a warning pops up.
Screenshot at 2019-03-22 16-23-04
After i unlocked my keyring my ssh-key isn't unlock again.

[rave@mother caja-actions]$ git pull
Enter passphrase for key '/home/rave/.ssh/id_rsa': 

So it is much worse than before.

During testing my system crashes and i couldn't start firefox for some reasons.
Sorry , at the moment i am not amused.
Please test more for yourself, i am happy to test again a 100% tested PR.

@lukefromdc lukefromdc requested a review from a team March 22, 2019 23:17
@milouse
Copy link
Copy Markdown
Author

milouse commented Mar 23, 2019

@raveit65 sorry for bothering you. In fact I'm not a mate developer and have no idea how to build and test part of mate desktop by myself. As you say in your first message that you were able to do so, I thought you were a Mate developer ready to help us.

I can try to test this by myself if you know where I can found some beginner information on how to build and test part of the desktop.

Thank you for your help and understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants