patches/gnome-panel-15-use-time-admin.diff
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 16553 11e13d0e977f
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446

/jds/bin/diff -uprN gnome-panel-2.27.92.old/applets/clock/clock.c gnome-panel-2.27.92/applets/clock/clock.c
--- gnome-panel-2.27.92.old/applets/clock/clock.c	2009-09-14 12:10:47.125484000 +0100
+++ gnome-panel-2.27.92/applets/clock/clock.c	2009-09-14 12:12:17.726975000 +0100
@@ -40,6 +40,7 @@
 #include <sys/time.h>
 #include <math.h>
 #include <locale.h>
+#include <stdlib.h>
 
 #include <panel-applet.h>
 #include <panel-applet-gconf.h>
@@ -1882,14 +1883,16 @@ ensure_time_settings_window_is_created (
 static void
 run_time_settings (GtkWidget *unused, ClockData *cd)
 {
-	ensure_time_settings_window_is_created (cd);
-	fill_time_settings_window (cd);
-
-	update_set_time_button (cd);
-
-	gtk_window_present (GTK_WINDOW (cd->set_time_window));
-
-        refresh_click_timeout_time_only (cd);
+    /* Launch time-admin to set the timezone/and system time */
+    /* This is a Solaris specific workaround as we don't have PolicyKit */
+    /* To determine if user has permissions */
+    gchar *time_admin = g_find_program_in_path ("time-admin");
+
+    if (time_admin) {
+        system (time_admin);
+        g_free (time_admin);
+    }
+    refresh_clock_timeout (cd);
 }
 
 static void
/jds/bin/diff -uprN gnome-panel-2.27.92.old/applets/clock/set-timezone-dummy.c gnome-panel-2.27.92/applets/clock/set-timezone-dummy.c
--- gnome-panel-2.27.92.old/applets/clock/set-timezone-dummy.c	2009-09-14 12:10:47.141765000 +0100
+++ gnome-panel-2.27.92/applets/clock/set-timezone-dummy.c	2009-09-14 12:13:07.772153000 +0100
@@ -23,14 +23,24 @@
 gint
 can_set_system_timezone (void)
 {
-	return 0;
+    /* Workaround for Solaris as PolicyKit does not exist */
+    gchar *time_admin = g_find_program_in_path ("time-admin");
+    gint ret_val = 0;
+
+    if (time_admin)
+	    ret_val = 1;
+
+    g_free (time_admin);
+
+	return (ret_val);
 }
 
 
 gint
 can_set_system_time (void)
 {
-	return 0;
+    /* Workaround for Solaris as PolicyKit does not exist */
+    return (can_set_system_timezone ());
 }
 
 void