Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
No build reason found for images:i586
home:lafenghu
gnome-keyring
gnome-keyring-check-session.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gnome-keyring-check-session.patch of Package gnome-keyring
Index: gnome-keyring-3.1.91/pam/gkr-pam-module.c =================================================================== --- gnome-keyring-3.1.91.orig/pam/gkr-pam-module.c +++ gnome-keyring-3.1.91/pam/gkr-pam-module.c @@ -91,10 +91,49 @@ enum { #endif #endif +static const char* get_any_env (pam_handle_t *ph, const char *name); + /* ----------------------------------------------------------------------------- * HELPERS */ - + +/* We don't want to start the keyring if the session is not GNOME, Xfce + * or LXDE. Note that this only works if the service is gdm, lxdm or + * lightdm, so we return TRUE in all other cases. */ +static int +starting_supported_desktop (pam_handle_t *ph) +{ + const char *session = NULL; + const void *service = NULL; + + if (pam_get_item (ph, PAM_SERVICE, &service) != PAM_SUCCESS) + return 1; + + if (!service) + return 1; + + if (strcmp (service, "gdm") != 0 && + strcmp (service, "gdm-password") != 0 && + strcmp (service, "lxdm") != 0 && + strcmp (service, "lightdm") != 0) + return 1; + + session = get_any_env (ph, "DESKTOP_SESSION"); + if (!session) + return 0; + + if (strcmp (session, "gnome") == 0) + return 1; + if (strcmp (session, "gnome3") == 0) + return 1; + if (strcmp (session, "xfce") == 0) + return 1; + if (strcmp (session, "LXDE") == 0) + return 1; + + return 0; +} + static void close_safe (int fd) { @@ -867,7 +906,7 @@ pam_sm_authenticate (pam_handle_t *ph, i started_daemon = 0; /* Should we start the daemon? */ - if (args & ARG_AUTO_START) { + if ((args & ARG_AUTO_START) && starting_supported_desktop (ph)) { ret = start_daemon_if_necessary (ph, pwd, password, &started_daemon); if (ret != PAM_SUCCESS) return ret; @@ -939,7 +978,7 @@ pam_sm_open_session (pam_handle_t *ph, i started_daemon = 0; /* Should we start the daemon? */ - if (args & ARG_AUTO_START) { + if ((args & ARG_AUTO_START) && starting_supported_desktop (ph)) { ret = start_daemon_if_necessary (ph, pwd, password, &started_daemon); if (ret != PAM_SUCCESS) return ret;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor