1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
diff -up gnome-panel-2.21.5/applets/clock/gnome-clock-applet-mechanism.policy.glue gnome-panel-2.21.5/applets/clock/gnome-clock-applet-mechanism.policy
--- gnome-panel-2.21.5/applets/clock/gnome-clock-applet-mechanism.policy.glue 2008-01-16 10:57:15.000000000 -0500
+++ gnome-panel-2.21.5/applets/clock/gnome-clock-applet-mechanism.policy 2008-01-16 10:56:56.000000000 -0500
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
+
+<!-- needs i18n work -->
+
+<policyconfig>
+
+ <action id="org.gnome.clockapplet.mechanism.settimezone">
+ <description>Change system time zone</description>
+ <message>Changing the system time zone requires privileges.</message>
+ <defaults>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_self_keep_always</allow_active>
+ </defaults>
+ </action>
+
+ <action id="org.gnome.clockapplet.mechanism.settime">
+ <description>Change system time</description>
+ <message>Changing the system time requires privileges.</message>
+ <defaults>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_self_keep_always</allow_active>
+ </defaults>
+ </action>
+
+ <action id="org.gnome.clockapplet.mechanism.configurehwclock">
+ <description>Configure hardware clock</description>
+ <message>Configuring the hardware clock requires privileges.</message>
+ <defaults>
+ <allow_inactive>no</allow_inactive>
+ <allow_active>auth_self_keep_always</allow_active>
+ </defaults>
+ </action>
+
+</policyconfig>
diff -up gnome-panel-2.21.5/applets/clock/Makefile.am.glue gnome-panel-2.21.5/applets/clock/Makefile.am
--- gnome-panel-2.21.5/applets/clock/Makefile.am.glue 2008-01-14 18:05:22.000000000 -0500
+++ gnome-panel-2.21.5/applets/clock/Makefile.am 2008-01-16 10:54:37.000000000 -0500
@@ -138,7 +138,7 @@ gnome_clock_applet_mechanism_SOURCES =
gnome-clock-applet-mechanism-main.c
if HAVE_POLKIT
-BUILT_SOURCES += gnome-clock-applet-mechanism.h
+BUILT_SOURCES += gnome-clock-applet-mechanism-glue.h
endif
gnome_clock_applet_mechanism_INCLUDES = \
diff -up gnome-panel-2.21.5/applets/clock/Makefile.in.glue gnome-panel-2.21.5/applets/clock/Makefile.in
--- gnome-panel-2.21.5/applets/clock/Makefile.in.glue 2008-01-14 18:18:16.000000000 -0500
+++ gnome-panel-2.21.5/applets/clock/Makefile.in 2008-01-16 10:54:43.000000000 -0500
@@ -34,7 +34,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@HAVE_POLKIT_TRUE@am__append_1 = gnome-clock-applet-mechanism.h
+@HAVE_POLKIT_TRUE@am__append_1 = gnome-clock-applet-mechanism-glue.h
@CLOCK_INPROCESS_FALSE@libexec_PROGRAMS = clock-applet$(EXEEXT) \
@CLOCK_INPROCESS_FALSE@ $(am__EXEEXT_1)
@CLOCK_INPROCESS_TRUE@libexec_PROGRAMS = $(am__EXEEXT_1)
@@ -43,6 +43,7 @@ subdir = applets/clock
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/d-type.m4 \
+ $(top_srcdir)/m4/gnome-compiler-flags.m4 \
$(top_srcdir)/m4/gnome-doc-utils.m4 \
$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/intltool.m4 \
$(top_srcdir)/configure.in
@@ -80,7 +81,7 @@ am__libclock_applet_la_SOURCES_DIST = ca
clock-zonetable.c clock-zonetable.h gweather-xml.c \
gweather-xml.h clock-marshallers.c clock-marshallers.h \
clock-typebuiltins.c clock-typebuiltins.h \
- gnome-clock-applet-mechanism.h calendar-client.c \
+ gnome-clock-applet-mechanism-glue.h calendar-client.c \
calendar-client.h calendar-sources.c calendar-sources.h \
calendar-debug.h set-timezone-dummy.c set-timezone.h \
set-timezone.c
@@ -132,7 +133,7 @@ am__clock_applet_SOURCES_DIST = calendar
clock-zoneinfo.h clock-zonetable.c clock-zonetable.h \
gweather-xml.c gweather-xml.h clock-marshallers.c \
clock-marshallers.h clock-typebuiltins.c clock-typebuiltins.h \
- gnome-clock-applet-mechanism.h calendar-client.c \
+ gnome-clock-applet-mechanism-glue.h calendar-client.c \
calendar-client.h calendar-sources.c calendar-sources.h \
calendar-debug.h set-timezone-dummy.c set-timezone.h \
set-timezone.c
@@ -346,6 +347,7 @@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE
RANLIB = @RANLIB@
REBUILD = @REBUILD@
SCROLLKEEPER_CONFIG = @SCROLLKEEPER_CONFIG@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
diff -up /dev/null gnome-panel-2.21.5/applets/clock/org.gnome.ClockApplet.Mechanism.service.in
--- /dev/null 2008-01-16 08:23:02.430982355 -0500
+++ gnome-panel-2.21.5/applets/clock/org.gnome.ClockApplet.Mechanism.service.in 2008-01-16 10:54:37.000000000 -0500
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=org.gnome.ClockApplet.Mechanism
+Exec=@LIBEXECDIR@/gnome-clock-applet-mechanism
+User=root
diff -up /dev/null gnome-panel-2.21.5/applets/clock/org.gnome.ClockApplet.Mechanism.conf
--- /dev/null 2008-01-16 08:23:02.430982355 -0500
+++ gnome-panel-2.21.5/applets/clock/org.gnome.ClockApplet.Mechanism.conf 2008-01-16 10:54:37.000000000 -0500
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?> <!-- -*- XML -*- -->
+
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- Only root can own the service -->
+ <policy user="root">
+ <allow own="org.gnome.ClockApplet.Mechanism"/>
+ <allow send_interface="org.gnome.ClockApplet.Mechanism.SetTimezoneInterface"/>
+ </policy>
+
+ <!-- Allow anyone to invoke methods on the interfaces -->
+ <policy context="default">
+ <allow send_interface="org.gnome.ClockApplet.Mechanism.SetTimezoneInterface"/>
+ </policy>
+
+</busconfig>
|