[gnome-screensaver] prefs: drop max lock and logout timeout
- From: Milan Bouchet-Valat <milanbv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screensaver] prefs: drop max lock and logout timeout
- Date: Tue, 17 Jan 2012 14:20:15 +0000 (UTC)
commit b782e17b60d5e9314b80f0b8c86d6227309622e6
Author: Milan Bouchet-Valat <nalimilan club fr>
Date: Tue Jan 17 15:12:28 2012 +0100
prefs: drop max lock and logout timeout
Previously, gnome-screensaver would enforce a maximum to lock
and logout timeouts to prevent situations where the screen could
have locking enabled, but never lock in practice.
The screen control panel enforces a maximum of 1h, but the
GSettings schema allows arbitrarily large values. There's no
reason to have two out of sync maximums, so this commit removes
the gnome-screensaver one.
https://bugzilla.gnome.org/show_bug.cgi?id=668039
src/gs-prefs.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/gs-prefs.c b/src/gs-prefs.c
index faf82cc..52f04c1 100644
--- a/src/gs-prefs.c
+++ b/src/gs-prefs.c
@@ -128,10 +128,10 @@ static void
_gs_prefs_set_lock_timeout (GSPrefs *prefs,
guint value)
{
- /* pick a reasonable large number for the
- upper bound */
- if (value > 28800)
- value = 28800;
+ /* prevent overflow when converting to milliseconds */
+ if (value > G_MAXUINT / 1000) {
+ value = G_MAXUINT / 1000;
+ }
prefs->lock_timeout = value * 1000;
}
@@ -217,10 +217,10 @@ static void
_gs_prefs_set_logout_timeout (GSPrefs *prefs,
guint value)
{
- /* pick a reasonable large number for the
- upper bound */
- if (value > 28800)
- value = 28800;
+ /* prevent overflow when converting to milliseconds */
+ if (value > G_MAXUINT / 1000) {
+ value = G_MAXUINT / 1000;
+ }
prefs->logout_timeout = value * 1000;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]