summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-04 20:26:50 +0100
committerinfirit <[email protected]>2014-11-04 22:08:50 +0100
commit5fe70eb9aa653c1218d9e420d369819e7d54a9c8 (patch)
tree24da8e87dbf31c89eceaf1f640e2e3a05e29b269
parent89dc9f01e88055d61245024d2e414727982c63e4 (diff)
downloadmate-session-manager-5fe70eb9aa653c1218d9e420d369819e7d54a9c8.tar.bz2
mate-session-manager-5fe70eb9aa653c1218d9e420d369819e7d54a9c8.tar.xz
Improve logout lockdown
Taken from gnome-session commit: 1e3e0b475cfd352d4abe7ace4ee5a40be04a8b42 From: Ray Strode <[email protected]>
-rw-r--r--mate-session/gsm-manager.c16
-rw-r--r--mate-session/gsm-manager.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/mate-session/gsm-manager.c b/mate-session/gsm-manager.c
index 66ae3a6..a880fb3 100644
--- a/mate-session/gsm-manager.c
+++ b/mate-session/gsm-manager.c
@@ -215,6 +215,7 @@ gsm_manager_error_get_type (void)
ENUM_ENTRY (GSM_MANAGER_ERROR_ALREADY_REGISTERED, "AlreadyRegistered"),
ENUM_ENTRY (GSM_MANAGER_ERROR_NOT_REGISTERED, "NotRegistered"),
ENUM_ENTRY (GSM_MANAGER_ERROR_INVALID_OPTION, "InvalidOption"),
+ ENUM_ENTRY (GSM_MANAGER_ERROR_LOCKED_DOWN, "LockedDown"),
{ 0, 0, 0 }
};
@@ -3303,6 +3304,13 @@ gsm_manager_request_reboot (GsmManager *manager,
return TRUE;
}
+static gboolean
+_log_out_is_locked_down (GsmManager *manager)
+{
+ return g_settings_get_boolean (manager->priv->settings_lockdown,
+ "disable-log-out");
+}
+
gboolean
gsm_manager_shutdown (GsmManager *manager,
GError **error)
@@ -3386,6 +3394,14 @@ gsm_manager_logout (GsmManager *manager,
return FALSE;
}
+ if (_log_out_is_locked_down (manager)) {
+ g_set_error (error,
+ GSM_MANAGER_ERROR,
+ GSM_MANAGER_ERROR_LOCKED_DOWN,
+ "Logout has been locked down");
+ return FALSE;
+ }
+
switch (logout_mode) {
case GSM_MANAGER_LOGOUT_MODE_NORMAL:
case GSM_MANAGER_LOGOUT_MODE_NO_CONFIRMATION:
diff --git a/mate-session/gsm-manager.h b/mate-session/gsm-manager.h
index c9170df..035d11b 100644
--- a/mate-session/gsm-manager.h
+++ b/mate-session/gsm-manager.h
@@ -96,6 +96,7 @@ typedef enum
GSM_MANAGER_ERROR_ALREADY_REGISTERED,
GSM_MANAGER_ERROR_NOT_REGISTERED,
GSM_MANAGER_ERROR_INVALID_OPTION,
+ GSM_MANAGER_ERROR_LOCKED_DOWN,
GSM_MANAGER_NUM_ERRORS
} GsmManagerError;