source:
proiecte/PPPP/gdm/debian/patches/17_add_failsafe.patch
@
141
Last change on this file since 141 was 134, checked in by , 14 years ago | |
---|---|
File size: 4.1 KB |
-
daemon/gdm-session-direct.c
# # Description: Support failsafe sessions # Upstream: https://bugzilla.gnome.org/show_bug.cgi?id=594833 #
old new 2032 2032 g_return_if_fail (impl->priv->is_running == FALSE); 2033 2033 2034 2034 command = get_session_command (impl); 2035 program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command); 2035 2036 if (gdm_session_direct_is_failsafe(impl) == FALSE) { 2037 program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command); 2038 } else { 2039 /* Failsafe session: bypass the Xsession script */ 2040 program = g_strdup (command); 2041 } 2042 2036 2043 g_free (command); 2037 2044 2038 2045 setup_session_environment (impl); … … 2123 2130 return g_strdup (session->priv->selected_user); 2124 2131 } 2125 2132 2133 gboolean 2134 gdm_session_direct_is_failsafe (GdmSessionDirect *session_direct) 2135 { 2136 GError *error; 2137 GKeyFile *key_file; 2138 gboolean res; 2139 gboolean failsafe = FALSE; 2140 char *filename; 2141 char *full_path; 2142 2143 g_return_val_if_fail (session_direct != NULL, FALSE); 2144 g_return_val_if_fail (GDM_IS_SESSION_DIRECT (session_direct), FALSE); 2145 2146 filename = g_strdup_printf ("%s.desktop", get_session_name (session_direct)); 2147 2148 key_file = g_key_file_new (); 2149 error = NULL; 2150 res = g_key_file_load_from_dirs (key_file, 2151 filename, 2152 get_system_session_dirs (), 2153 &full_path, 2154 G_KEY_FILE_NONE, 2155 &error); 2156 if (! res) { 2157 g_debug ("GdmSessionDirect: File '%s' not found: %s", filename, error->message); 2158 goto out; 2159 } 2160 2161 error = NULL; 2162 res = g_key_file_has_key (key_file, G_KEY_FILE_DESKTOP_GROUP, "X-GDM-FailSafe", NULL); 2163 if (!res) { 2164 failsafe = FALSE; 2165 goto out; 2166 } else { 2167 failsafe = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, "X-GDM-FailSafe", &error); 2168 if (error) { 2169 failsafe = FALSE; 2170 g_error_free (error); 2171 goto out; 2172 } else if (failsafe == TRUE) { 2173 g_debug ("GdmSessionDirect: Session %s is tagged as failsafe", filename); 2174 } 2175 } 2176 2177 out: 2178 g_free (filename); 2179 return failsafe; 2180 } 2181 2126 2182 static void 2127 2183 gdm_session_direct_select_session (GdmSession *session, 2128 2184 const char *text) -
daemon/gdm-session-direct.h
old new 56 56 gboolean display_is_local) G_GNUC_MALLOC; 57 57 58 58 char * gdm_session_direct_get_username (GdmSessionDirect *session_direct); 59 gboolean gdm_session_direct_is_failsafe (GdmSessionDirect *session_direct); 59 60 60 61 /* Exported methods */ 61 62 gboolean gdm_session_direct_restart (GdmSessionDirect *session_direct, -
daemon/gdm-simple-slave.c
old new 112 112 username = gdm_session_direct_get_username (slave->priv->session); 113 113 gdm_slave_run_script (GDM_SLAVE (slave), GDMCONFDIR "/PreSession", username); 114 114 115 /* FIXME: should we do something here? */ 115 /* FIXME: should we do something here? 116 * Note that error return status from PreSession script should 117 * be ignored in the case of a Failsafe session, which can be checked 118 * by calling: gdm_session_direct_is_failsafe(session) 119 */ 116 120 } 117 121 118 122 static void
Note: See TracBrowser
for help on using the repository browser.