Gentoo Archives: gentoo-commits

From: "Gilles Dartiguelongue (eva)" <eva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-auth/policykit/files: policykit-0.9-consolekit03.patch policykit-0.9-pk-debug.patch policykit-0.9-pam-headers.patch policykit-0.7-completions.patch
Date: Mon, 01 Dec 2008 22:14:09
Message-Id: E1L7H1R-0000iy-71@stork.gentoo.org
1 eva 08/12/01 22:13:41
2
3 Added: policykit-0.9-consolekit03.patch
4 policykit-0.9-pk-debug.patch
5 policykit-0.9-pam-headers.patch
6 policykit-0.7-completions.patch
7 Log:
8 Bump to 0.9. Fix bug #214801.
9 (Portage version: 2.2_rc16/cvs/Linux 2.6.24-gentoo-r8-mactel x86_64)
10
11 Revision Changes Path
12 1.1 sys-auth/policykit/files/policykit-0.9-consolekit03.patch
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-auth/policykit/files/policykit-0.9-consolekit03.patch?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-auth/policykit/files/policykit-0.9-consolekit03.patch?rev=1.1&content-type=text/plain
16
17 Index: policykit-0.9-consolekit03.patch
18 ===================================================================
19 # Description: Make PolicyKit work with ConsoleKit 0.3 API as well
20 # Ubuntu: https://bugs.launchpad.net/273711
21 # Upstream: http://cvs.fedoraproject.org/viewvc/rpms/PolicyKit/devel/pk-ck-api-change.patch?view=markup
22 --- policykit-0.9/src/polkit-dbus/polkit-dbus.c 2008-05-30 23:24:44.000000000 +0200
23 +++ policykit-0.9.new/src/polkit-dbus/polkit-dbus.c 2008-09-24 13:40:37.000000000 +0200
24 @@ -214,11 +214,17 @@
25 dbus_message_unref (reply);
26 goto out;
27 }
28 + /* GetUnixUser API Changed in CK 0.3.0 */
29 if (!dbus_message_get_args (reply, NULL,
30 - DBUS_TYPE_INT32, &uid,
31 + DBUS_TYPE_UINT32, &uid,
32 DBUS_TYPE_INVALID)) {
33 - kit_warning ("Invalid GetUnixUser reply from CK");
34 - goto out;
35 + /* try the older API */
36 + if (!dbus_message_get_args (reply, NULL,
37 + DBUS_TYPE_INT32, &uid,
38 + DBUS_TYPE_INVALID)) {
39 + kit_warning ("Invalid GetUnixUser reply from CK");
40 + goto out;
41 + }
42 }
43 dbus_message_unref (message);
44 dbus_message_unref (reply);
45 @@ -1326,16 +1332,21 @@
46
47 dbus_error_init (&error);
48 seat_objpath = dbus_message_get_path (message);
49 - if (!dbus_message_get_args (message, &error,
50 - DBUS_TYPE_STRING, &session_objpath,
51 + /* API fixed in CK 0.3 to match spec */
52 + if (!dbus_message_get_args (message, &error,
53 + DBUS_TYPE_OBJECT_PATH, &session_objpath,
54 DBUS_TYPE_INVALID)) {
55 + if (!dbus_message_get_args (message, &error,
56 + DBUS_TYPE_STRING, &session_objpath,
57 + DBUS_TYPE_INVALID)) {
58 +
59 + /* TODO: should be _pk_critical */
60 + kit_warning ("The SessionAdded signal on the org.freedesktop.ConsoleKit.Seat "
61 + "interface for object %s has the wrong signature! "
62 + "Your system is misconfigured.", seat_objpath);
63
64 - /* TODO: should be _pk_critical */
65 - kit_warning ("The SessionAdded signal on the org.freedesktop.ConsoleKit.Seat "
66 - "interface for object %s has the wrong signature! "
67 - "Your system is misconfigured.", seat_objpath);
68 -
69 - goto out;
70 + goto out;
71 + }
72 }
73
74 /* TODO: add to sessions - see polkit_tracker_is_authorization_relevant() */
75 @@ -1353,16 +1364,21 @@
76
77 dbus_error_init (&error);
78 seat_objpath = dbus_message_get_path (message);
79 - if (!dbus_message_get_args (message, &error,
80 - DBUS_TYPE_STRING, &session_objpath,
81 + /* API fixed in CK 0.3 to match spec */
82 + if (!dbus_message_get_args (message, &error,
83 + DBUS_TYPE_OBJECT_PATH, &session_objpath,
84 DBUS_TYPE_INVALID)) {
85 + if (!dbus_message_get_args (message, &error,
86 + DBUS_TYPE_STRING, &session_objpath,
87 + DBUS_TYPE_INVALID)) {
88 +
89 + /* TODO: should be _pk_critical */
90 + kit_warning ("The SessionRemoved signal on the org.freedesktop.ConsoleKit.Seat "
91 + "interface for object %s has the wrong signature! "
92 + "Your system is misconfigured.", seat_objpath);
93
94 - /* TODO: should be _pk_critical */
95 - kit_warning ("The SessionRemoved signal on the org.freedesktop.ConsoleKit.Seat "
96 - "interface for object %s has the wrong signature! "
97 - "Your system is misconfigured.", seat_objpath);
98 -
99 - goto out;
100 + goto out;
101 + }
102 }
103
104 _remove_caller_by_session (pk_tracker, session_objpath);
105
106
107
108 1.1 sys-auth/policykit/files/policykit-0.9-pk-debug.patch
109
110 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-auth/policykit/files/policykit-0.9-pk-debug.patch?rev=1.1&view=markup
111 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-auth/policykit/files/policykit-0.9-pk-debug.patch?rev=1.1&content-type=text/plain
112
113 Index: policykit-0.9-pk-debug.patch
114 ===================================================================
115 #
116 # Fix use of undefined _pk_debug
117 #
118 # Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=239573
119 # Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=17904
120 #
121 --- a/src/polkit/polkit-authorization-db-dummy.c 2008-05-31 07:24:44.000000000 +1000
122 +++ b/src/polkit/polkit-authorization-db-dummy.c 2008-10-05 03:54:29.000000000 +1100
123 @@ -105,7 +105,7 @@
124 polkit_authorization_db_debug (PolKitAuthorizationDB *authdb)
125 {
126 kit_return_if_fail (authdb != NULL);
127 - _pk_debug ("PolKitAuthorizationDB: refcount=%d", authdb->refcount);
128 + polkit_debug ("PolKitAuthorizationDB: refcount=%d", authdb->refcount);
129 }
130
131 polkit_bool_t
132
133
134
135 1.1 sys-auth/policykit/files/policykit-0.9-pam-headers.patch
136
137 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-auth/policykit/files/policykit-0.9-pam-headers.patch?rev=1.1&view=markup
138 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-auth/policykit/files/policykit-0.9-pam-headers.patch?rev=1.1&content-type=text/plain
139
140 Index: policykit-0.9-pam-headers.patch
141 ===================================================================
142 # Remove unwanted pam header
143 #
144 # Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=239554
145 # Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=16131
146 #
147 diff --git a/src/polkit-dbus/polkit-resolve-exe-helper.c b/src/polkit-dbus/polkit-resolve-exe-helper.c
148 index c56b2f5..5992b67 100644
149 --- a/src/polkit-dbus/polkit-resolve-exe-helper.c
150 +++ b/src/polkit-dbus/polkit-resolve-exe-helper.c
151 @@ -43,7 +43,6 @@
152 #ifdef HAVE_FREEBSD
153 #include <sys/param.h>
154 #endif
155 -#include <security/pam_appl.h>
156 #include <grp.h>
157 #include <pwd.h>
158 #include <syslog.h>
159
160
161
162 1.1 sys-auth/policykit/files/policykit-0.7-completions.patch
163
164 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-auth/policykit/files/policykit-0.7-completions.patch?rev=1.1&view=markup
165 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-auth/policykit/files/policykit-0.7-completions.patch?rev=1.1&content-type=text/plain
166
167 Index: policykit-0.7-completions.patch
168 ===================================================================
169 commit afb4535accaa08e20050a7b2d508d884b02f45a0
170 Author: Saleem Abdulrasool <compnerd@××××××××.org>
171 Date: Mon Nov 19 15:35:03 2007 -0800
172
173 add zsh completion and optionalize bash and zsh completion
174
175 Signed-off-by: Saleem Abdulrasool <compnerd@××××××××.org>
176
177 diff --git a/configure.in b/configure.in
178 index 2fdb935..a9ea35a 100644
179 --- a/configure.in
180 +++ b/configure.in
181 @@ -495,6 +495,21 @@ AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_PASSWORD, "$PAM_FILE_INCLUDE_PASSWORD", [pam
182 AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_SESSION, "$PAM_FILE_INCLUDE_SESSION", [pam file session])
183
184 # ********************
185 +# Shell Completion
186 +# ********************
187 +
188 +AC_ARG_WITH([bash-completion],
189 + AC_HELP_STRING([--with-bash-completion],[Install bash completion scripts]),,
190 + [with_bash_completion=yes])
191 +
192 +AC_ARG_WITH([zsh-completion],
193 + AC_HELP_STRING([--with-zsh-completion],[Install zsh completion scripts]),,
194 + [with_zsh_completion=no])
195 +
196 +AM_CONDITIONAL([WITH_BASH_COMPLETION], test x"$with_bash_completion" != x"no")
197 +AM_CONDITIONAL([WITH_ZSH_COMPLETION], test x"$with_zsh_completion" != x"no")
198 +
199 +# ********************
200 # Internationalisation
201 # ********************
202
203 diff --git a/tools/Makefile.am b/tools/Makefile.am
204 index a76e9fc..0449e12 100644
205 --- a/tools/Makefile.am
206 +++ b/tools/Makefile.am
207 @@ -25,10 +25,17 @@ polkit_auth_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ $(top_builddir)/src/polkit/libpolkit
208 polkit_action_SOURCES = polkit-action.c
209 polkit_action_LDADD = $(top_builddir)/src/polkit/libpolkit.la
210
211 +if WITH_BASH_COMPLETION
212 profiledir = $(sysconfdir)/profile.d
213 profile_SCRIPTS = polkit-bash-completion.sh
214 +endif
215
216 -EXTRA_DIST = $(profile_SCRIPTS)
217 +if WITH_ZSH_COMPLETION
218 +zshcompletiondir = $(DESTDIR)$(datadir)/zsh/site-functions
219 +zshcompletion_SCRIPTS = _polkit _polkit_auth _polkit_action
220 +endif
221 +
222 +EXTRA_DIST = polkit-bash-completion.sh _polkit _polkit_auth _polkit_action
223
224 clean-local :
225 rm -f *~ polkit-reload-config
226 diff --git a/tools/_polkit b/tools/_polkit
227 new file mode 100644
228 index 0000000..bc7bdac
229 --- /dev/null
230 +++ b/tools/_polkit
231 @@ -0,0 +1,54 @@
232 +#autoload
233 +
234 +# vim: set et sw=3 sts=3 ts=3 ft=zsh:
235 +# ZSH Completion for polkit-auth
236 +# Written by Saleem Abdulrasool <compnerd@××××××××.org>
237 +# Usage: _polkit actions|constraints|authorization|overriden-actions|obtainable-actions|authorized-actions
238 +
239 +_polkit_actions() {
240 + local actions
241 + actions=( $(polkit-action) )
242 + compadd "$@" -k actions
243 +}
244 +
245 +_polkit_constraints() {
246 + local constraints
247 + constraints=( local active local+active )
248 + compadd "$@" -k constraints
249 +}
250 +
251 +_polkit_authorization() {
252 + local authorization
253 + authorization=( no auth_admin_one_shot auth_admin auth_admin_keep_session auth_admin_keep_always auth_self_one_shot auth_self auth_self_keep_session auth_self_keep_always yes )
254 + compadd "$@" -k authorization
255 +}
256 +
257 +_polkit_overriden_actions() {
258 + local overrides
259 + overrides=( $(polkit-action --show-overrides) )
260 + compadd "$@" -k overrides
261 +}
262 +
263 +_polkit_obtainable_actions() {
264 + local actions
265 + actions=( $(polkit-auth --show-obtainable) )
266 + compadd "$@" -k actions
267 +}
268 +
269 +_polkit_authorized_actions() {
270 + local actions
271 + actions=( $(polkit-auth --explicit) )
272 + compadd "$@" -k actions
273 +}
274 +
275 +_polkit() {
276 + local command="$argv[$#]"
277 +
278 + [[ "$command" == (actions|constraints|authorization|overriden-actions|obtainable-actions|authorized-actions) ]] || {
279 + _message "unknown command: $command"
280 + }
281 +
282 + _polkit_${command/-/_}
283 +}
284 +
285 +_polkit "$@"
286 diff --git a/tools/_polkit_action b/tools/_polkit_action
287 new file mode 100644
288 index 0000000..7ec7365
289 --- /dev/null
290 +++ b/tools/_polkit_action
291 @@ -0,0 +1,24 @@
292 +#compdef polkit-action
293 +
294 +# vim: set et sw=3 sts=3 ts=3 ft=zsh:
295 +# ZSH Completion for polkit-action
296 +# Written by Saleem Abdulrasool <compnerd@××××××××.org>
297 +
298 +_polkit_action() {
299 + local arguments
300 +
301 + arguments=(
302 + "(-)--action[Show detailed information about a specific action]:action:_polkit actions"
303 + "(-)--reset-defaults[Reset the defaults for the specified action]:Overridden Action:_polkit overriden-actions"
304 + "(-)--show-overrides[List actions where the defaults are overridden]"
305 + "(-)--set-defaults-any[Override the any stanza for an action]:Action:_polkit _actions:Authorization:_polkit authorization"
306 + "(-)--set-defaults-inactive[Override the inactive stanza for an action]:Action:polkit _actions:Authorization:_polkit authorization"
307 + "(-)--set-defaults-active[Override the active stanza for an action]:Action:polkit _actions:Authorization:_polkit authorization"
308 + "(-)--version[Display program version]"
309 + "(-)--help[Display program help]"
310 + )
311 +
312 + _arguments $arguments
313 +}
314 +
315 +_polkit_action "$@"
316 diff --git a/tools/_polkit_auth b/tools/_polkit_auth
317 new file mode 100644
318 index 0000000..e70f1a0
319 --- /dev/null
320 +++ b/tools/_polkit_auth
321 @@ -0,0 +1,50 @@
322 +#compdef polkit-auth
323 +
324 +# vim: set et sw=3 sts=3 ts=3 ft=zsh:
325 +# ZSH Completion for polkit-auth
326 +# Written by Saleem Abdulrasool <compnerd@××××××××.org>
327 +
328 +_polkit_auth() {
329 + local arguments action_arguments user_arguments grant_arguments
330 + local commands actions grant=0
331 +
332 + commands=( --show-obtainable --version --help )
333 + actions=( --obtain --explicit --explicit-detail --grant --revoke )
334 +
335 + for (( i = 0 ; i < ${#words[@]} ; i++ )) ; do
336 + if [[ "${words[$i]##--#}" == "grant" ]] ; then
337 + grant=1
338 + break
339 + fi
340 + done
341 +
342 + arguments=(
343 + '(-)--show-obtainable[Show all actions that can be obtained via authentication]'
344 + '(-)--version[Show version and exit]'
345 + '(-)--help[Show help information]'
346 + )
347 +
348 + action_arguments=(
349 + "($commands $actions)--obtain[Attempt to obtain authorization to do an action]:Obtainable Actions:_polkit obtainable-actions"
350 + "($commands $actions)--explicit[Show explicit authorizations]"
351 + "($commands $actions)--explicit-detail[Show detailed information about explicit authorizations]"
352 + "($commands $actions)--grant[Grant an authorization for an action]:Obtainable Actions:_polkit actions"
353 + "($commands $actions)--revoke[Revoke all authorization for an action]:Authorized Actions:_polkit authorized-actions"
354 + )
355 +
356 + user_arguments=(
357 + "($commands)--user[The user the authorization applies to]:User:_users"
358 + )
359 +
360 + grant_arguments=(
361 + "($commands)--constraint[Optional constraints on the granted authorization]:Constraint:_polkit constraints"
362 + )
363 +
364 + if [[ grant -eq 1 ]] ; then
365 + _arguments $arguments $user_arguments $action_arguments $grant_arguments
366 + else
367 + _arguments $arguments $user_arguments $action_arguments
368 + fi
369 +}
370 +
371 +_polkit_auth "$@"