Imported Upstream version 0.6
Laurent Bigonville
11 years ago
0 | 0 | # Generate automatically. Do not edit. |
1 | ||
2 | commit 1b4ab68e5def95f807fe9aea43b39fbfefe0190b | |
3 | Author: Stef Walter <stefw@gnome.org> | |
4 | Date: 2012-08-03 | |
5 | ||
6 | Release version 0.6 | |
7 | ||
8 | NEWS | 8 ++++++++ | |
9 | po/POTFILES.in | 11 +++++++++++ | |
10 | 2 files changed, 19 insertions(+) | |
11 | ||
12 | commit 256f1a428586de3a14608af9c4e5f8c004e8eab1 | |
13 | Author: Stef Walter <stefw@gnome.org> | |
14 | Date: 2012-08-02 | |
15 | ||
16 | Switch default AD client to sssd | |
17 | ||
18 | service/realmd-defaults.conf | 2 +- | |
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
20 | ||
21 | commit 46ac85091cb600e476e2e376b4568ecfd6f93168 | |
22 | Author: Stef Walter <stefw@gnome.org> | |
23 | Date: 2012-07-31 | |
24 | ||
25 | Bump version number | |
26 | ||
27 | configure.ac | 2 +- | |
28 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
29 | ||
30 | commit cde46e6884fb027f6e54d04f9efec7557d469b1b | |
31 | Author: Stef Walter <stefw@gnome.org> | |
32 | Date: 2012-07-31 | |
33 | ||
34 | Make sure callers get properly notified about property changes | |
35 | ||
36 | * We were blocking the lower level GObjectClass.notify callbacks | |
37 | and thus had regressed on notifying callers about property changes | |
38 | ||
39 | service/realm-samba.c | 2 ++ | |
40 | service/realm-sssd.c | 2 ++ | |
41 | 2 files changed, 4 insertions(+) | |
42 | ||
43 | commit acc7a2ccd9d14f9ef589ab37bc335f716f92f708 | |
44 | Author: Stef Walter <stefw@gnome.org> | |
45 | Date: 2012-07-31 | |
46 | ||
47 | Fix double free of memory | |
48 | ||
49 | service/realm-samba.c | 3 +-- | |
50 | 1 file changed, 1 insertion(+), 2 deletions(-) | |
51 | ||
52 | commit 853308e5c56ae7bb13aabb1c0fbcda2e261f5555 | |
53 | Author: Stef Walter <stefw@gnome.org> | |
54 | Date: 2012-07-30 | |
55 | ||
56 | Support building with automake 1.12.x | |
57 | ||
58 | autogen.sh | 20 +++++++++++--------- | |
59 | 1 file changed, 11 insertions(+), 9 deletions(-) | |
60 | ||
61 | commit 43a878acd8228726f8a781f5edbd6f0eeef973c5 | |
62 | Author: Stef Walter <stefw@gnome.org> | |
63 | Date: 2012-07-30 | |
64 | ||
65 | Change default AD client back to winbind for now | |
66 | ||
67 | * SSSD breaks on rawhide in strange ways, will research | |
68 | ||
69 | service/realm-samba.c | 2 +- | |
70 | service/realmd-defaults.conf | 4 ++-- | |
71 | 2 files changed, 3 insertions(+), 3 deletions(-) | |
72 | ||
73 | commit 3bde274d8746c0bf55b6707cc12be1513e3ee971 | |
74 | Author: Stef Walter <stefw@gnome.org> | |
75 | Date: 2012-07-30 | |
76 | ||
77 | Remove warning when calls are made without an operation id | |
78 | ||
79 | service/realm-diagnostics.c | 4 +--- | |
80 | 1 file changed, 1 insertion(+), 3 deletions(-) | |
81 | ||
82 | commit 515473c356aca81b676b9dac176c88eb1660836b | |
83 | Author: Stef Walter <stefw@gnome.org> | |
84 | Date: 2012-07-28 | |
85 | ||
86 | Stub out API for Cancelling operations | |
87 | ||
88 | * Actual cancellation is not yet implemented, but trying to | |
89 | get API to a complete state. | |
90 | ||
91 | dbus/org.freedesktop.realmd.xml | 4 ++++ | |
92 | service/realm-daemon.c | 11 +++++++++++ | |
93 | 2 files changed, 15 insertions(+) | |
94 | ||
95 | commit 4a14fb81c536a6792f0b8136d0633f6368f2c3d1 | |
96 | Author: Stef Walter <stefw@gnome.org> | |
97 | Date: 2012-07-28 | |
98 | ||
99 | Pass the operation_id in the options argument | |
100 | ||
101 | * And add options a{sv} arguments to relevant methods | |
102 | * operation-id is optional and can be missing from options | |
103 | ||
104 | dbus/org.freedesktop.realmd.xml | 7 ++----- | |
105 | service/realm-ad-discover.c | 6 +++--- | |
106 | service/realm-diagnostics.c | 16 ++++++++++------ | |
107 | service/realm-diagnostics.h | 6 +++--- | |
108 | service/realm-kerberos.c | 14 ++++++-------- | |
109 | service/realm-provider.c | 4 ++-- | |
110 | tools/realm-discover.c | 9 +++++++-- | |
111 | tools/realm-enroll.c | 14 ++++++++------ | |
112 | tools/realm-logins.c | 18 ++++++++++++++---- | |
113 | 9 files changed, 55 insertions(+), 39 deletions(-) | |
114 | ||
115 | commit d10d9ec579dd037b9fb4ab51df9f932f2519041a | |
116 | Author: Stef Walter <stefw@gnome.org> | |
117 | Date: 2012-07-28 | |
118 | ||
119 | Add SetLocale to Service DBus interface | |
120 | ||
121 | * And track the locales for each client. | |
122 | * Add lots of translatable messages. | |
123 | * We don't yet properly setlocale() in the daemon. Need to figure out how | |
124 | to do that in a threadsafe way. | |
125 | ||
126 | dbus/org.freedesktop.realmd.xml | 4 + | |
127 | service/Makefile.am | 1 + | |
128 | service/realm-command.c | 4 +- | |
129 | service/realm-daemon.c | 177 +++++++++++++++++++++++++--------------- | |
130 | service/realm-daemon.h | 6 ++ | |
131 | service/realm-kerberos.c | 34 ++++---- | |
132 | service/realm-provider.c | 4 +- | |
133 | service/realm-samba.c | 11 +-- | |
134 | service/realm-sssd-ad.c | 11 +-- | |
135 | service/realm-sssd-config.c | 4 +- | |
136 | tools/Makefile.am | 1 + | |
137 | tools/realm-discover.c | 17 ++-- | |
138 | tools/realm-enroll.c | 45 +++++----- | |
139 | tools/realm-logins.c | 17 ++-- | |
140 | tools/realm.c | 37 ++++++--- | |
141 | 15 files changed, 228 insertions(+), 145 deletions(-) | |
142 | ||
143 | commit 458627c17a61a9c2fdb47811a7eee716605c4c7f | |
144 | Author: Stef Walter <stefw@gnome.org> | |
145 | Date: 2012-07-28 | |
146 | ||
147 | Global diagnostics signal. Refactor stuff into 'Service' interface | |
148 | ||
149 | * New 'Service' DBus interface, instead of 'Daemon' | |
150 | * Move diagnostics stuff to it. | |
151 | * Make --verbose work reliably in the realm tool | |
152 | ||
153 | dbus/org.freedesktop.realmd.xml | 28 ++++++------- | |
154 | dbus/realm-dbus-constants.h | 3 +- | |
155 | service/realm-all-provider.c | 4 +- | |
156 | service/realm-daemon.c | 8 ++-- | |
157 | service/realm-diagnostics.c | 12 +++--- | |
158 | tools/realm-discover.c | 79 +++++++++++++----------------------- | |
159 | tools/realm-enroll.c | 88 +++++++++++++++-------------------------- | |
160 | tools/realm-logins.c | 71 +++++++++++++++++++++++++++------ | |
161 | tools/realm.c | 53 ++++++++++++++++++++++--- | |
162 | tools/realm.h | 5 ++- | |
163 | 10 files changed, 193 insertions(+), 158 deletions(-) | |
164 | ||
165 | commit c1ef1acb837ad7c7001765b8abeded1d3f29c39f | |
166 | Author: Stef Walter <stefw@gnome.org> | |
167 | Date: 2012-07-27 | |
168 | ||
169 | Remove support for out of process providers | |
170 | ||
171 | * This just overcomplicates everything. Happy to accept | |
172 | other providers into the tree. | |
173 | * No more provider files needed | |
174 | ||
175 | dbus/Makefile.am | 6 - | |
176 | dbus/org.freedesktop.realmd.Samba.provider | 4 - | |
177 | dbus/org.freedesktop.realmd.SssdAd.provider | 4 - | |
178 | dbus/org.freedesktop.realmd.SssdIpa.provider | 4 - | |
179 | dbus/org.freedesktop.realmd.xml | 5 +- | |
180 | dbus/realm-dbus-constants.h | 2 + | |
181 | service/realm-all-provider.c | 317 ++++----------------------- | |
182 | service/realm-all-provider.h | 5 + | |
183 | service/realm-daemon.c | 58 ++++- | |
184 | service/realm-provider.c | 172 +++++---------- | |
185 | service/realm-provider.h | 17 +- | |
186 | service/realm-samba-provider.c | 34 ++- | |
187 | service/realm-sssd-ad-provider.c | 34 ++- | |
188 | service/realm-sssd-ipa-provider.c | 34 ++- | |
189 | tools/realm-discover.c | 7 +- | |
190 | tools/realm.c | 5 +- | |
191 | 16 files changed, 261 insertions(+), 447 deletions(-) | |
192 | ||
193 | commit 15cf8e7e2a91b99a5f8e15bb07f18774113aaaf2 | |
194 | Author: Stef Walter <stefw@gnome.org> | |
195 | Date: 2012-07-24 | |
196 | ||
197 | Use GDBusInterfaceSkeleton properties | |
198 | ||
199 | * This way the GDBusinterface property accessors work without having | |
200 | to override the interface. | |
201 | * Update realm properties correctly | |
202 | ||
203 | service/realm-samba.c | 91 ++++++++++++++++++++---------------------------- | |
204 | service/realm-sssd-ipa.c | 7 ---- | |
205 | service/realm-sssd.c | 52 +++++++-------------------- | |
206 | 3 files changed, 50 insertions(+), 100 deletions(-) | |
207 | ||
208 | commit fd0444aa007853bd1eff7e7584af8275c5e9a399 | |
209 | Author: Stef Walter <stefw@gnome.org> | |
210 | Date: 2012-07-24 | |
211 | ||
212 | Fix use after free when removing a config parameter | |
213 | ||
214 | * In RealmIniConfig when removing a config parameter, we didn't | |
215 | remove it from the parameter hashtable. | |
216 | ||
217 | service/realm-ini-config.c | 2 ++ | |
218 | 1 file changed, 2 insertions(+) | |
219 | ||
220 | commit ad41424b8a3fdeb909e3ada561b214ebfbdbefa6 | |
221 | Author: Stef Walter <stefw@gnome.org> | |
222 | Date: 2012-07-24 | |
223 | ||
224 | Rework the way credentials are passed to realmd | |
225 | ||
226 | * We need password credentials for some methods of joining | |
227 | (like 'net ads join' because samba3 doesn't support AES | |
228 | kerberos stuff), or IPA (because ipa-client-install doesn't | |
229 | support being passed a ccache). | |
230 | * Also add but don't yet implement support for empty credentials | |
231 | (used for automatic enrolling) and one time passwords. | |
232 | ||
233 | https://bugs.freedesktop.org/show_bug.cgi?id=52390 | |
234 | ||
235 | dbus/org.freedesktop.realmd.xml | 46 +-- | |
236 | service/realm-errors.c | 11 + | |
237 | service/realm-errors.h | 4 + | |
238 | service/realm-kerberos.c | 811 ++++++++++++++++++++++++++-------------- | |
239 | service/realm-kerberos.h | 123 ++++-- | |
240 | service/realm-samba-enroll.h | 9 + | |
241 | service/realm-samba.c | 108 +++--- | |
242 | service/realm-sssd-ad.c | 98 +++-- | |
243 | service/realm-sssd-ipa.c | 15 +- | |
244 | tools/realm-enroll.c | 132 +++++-- | |
245 | tools/realm.c | 20 + | |
246 | tools/realm.h | 3 + | |
247 | 12 files changed, 927 insertions(+), 453 deletions(-) | |
248 | ||
249 | commit 375175f39652804bfb7e3abd6cd9bc533c6cbb7c | |
250 | Author: Stef Walter <stefw@gnome.org> | |
251 | Date: 2012-07-24 | |
252 | ||
253 | Add a debug flag for leaving temp files around | |
254 | ||
255 | service/realm-debug.c | 1 + | |
256 | service/realm-debug.h | 3 ++- | |
257 | service/realm-kerberos.c | 3 ++- | |
258 | service/realm-samba-enroll.c | 4 +++- | |
259 | 4 files changed, 8 insertions(+), 3 deletions(-) | |
260 | ||
261 | commit d48aaf2034912511b1d3d803d9fffceff9e0bf5b | |
262 | Author: Stef Walter <stefw@gnome.org> | |
263 | Date: 2012-07-24 | |
264 | ||
265 | Set the new path for uploading releases | |
266 | ||
267 | https://bugs.freedesktop.org/show_bug.cgi?id=50960 | |
268 | ||
269 | Makefile.am | 2 +- | |
270 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
271 | ||
272 | commit 9079724f38fa3566ef7ae90481e2bcd5e193536e | |
273 | Author: Stef Walter <stefw@gnome.org> | |
274 | Date: 2012-07-18 | |
275 | ||
276 | Fix dbus service files for various providers | |
277 | ||
278 | ... and add one for SssdIpa which was missing | |
279 | ||
280 | dbus/Makefile.am | 3 ++- | |
281 | dbus/org.freedesktop.realmd.Samba.service.in | 2 +- | |
282 | dbus/org.freedesktop.realmd.SssdAd.service.in | 2 +- | |
283 | dbus/org.freedesktop.realmd.SssdIpa.service.in | 4 ++++ | |
284 | 4 files changed, 8 insertions(+), 3 deletions(-) | |
285 | ||
286 | commit f1720129742fac6bfc94805895fe064d5183d1ae | |
287 | Author: Stef Walter <stefw@gnome.org> | |
288 | Date: 2012-07-18 | |
289 | ||
290 | Prevent piling up of dbus error codes in the GError message | |
291 | ||
292 | service/realm-provider.c | 4 +++- | |
293 | 1 file changed, 3 insertions(+), 1 deletion(-) | |
294 | ||
295 | commit 935050ed77791be4f201bd4312279dabfd5760f4 | |
296 | Author: Stef Walter <stefw@gnome.org> | |
297 | Date: 2012-07-18 | |
298 | ||
299 | Clearer message when IPA discovery fails due to firewall | |
300 | ||
301 | service/realm-ipa-discover.c | 2 +- | |
302 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
303 | ||
304 | commit 493ad549af8e5f17cfe6b79801d74699dfc2087c | |
305 | Author: Stef Walter <stefw@gnome.org> | |
306 | Date: 2012-07-18 | |
307 | ||
308 | Register dbus error domain correctly on realmd startup | |
309 | ||
310 | service/realm-daemon.c | 5 +++++ | |
311 | 1 file changed, 5 insertions(+) | |
312 | ||
313 | commit 8aa3a494080bda75c36ed2682dc4da1480f3f874 | |
314 | Author: Stef Walter <stefw@gnome.org> | |
315 | Date: 2012-07-18 | |
316 | ||
317 | Reset the configured realm in samba registry before join | |
318 | ||
319 | * Otherwise its used to try and connect to the domain | |
320 | ||
321 | service/realm-samba-enroll.c | 33 +++++++++++++++++++++++++++++++-- | |
322 | 1 file changed, 31 insertions(+), 2 deletions(-) | |
323 | ||
324 | commit 9bcb3fea5d7c9ad859308e168d58e775941d864f | |
325 | Author: Stef Walter <stefw@gnome.org> | |
326 | Date: 2012-07-18 | |
327 | ||
328 | Fix innocuous warning about uninitialized variable being used | |
329 | ||
330 | service/realm-ini-config.c | 2 +- | |
331 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
1 | 332 | |
2 | 333 | commit 105aa6ee87ee5c468869b852aa6091c8b961c14f |
3 | 334 | Author: Stef Walter <stefw@gnome.org> |
32 | 32 | |
33 | 33 | upload-release: $(DIST_ARCHIVES) |
34 | 34 | gpg --detach-sign --local-user 'stef@thewalter.net' $(DIST_ARCHIVES) |
35 | scp $(DIST_ARCHIVES) $(DIST_ARCHIVES).sig people.freedesktop.org:/home/stefw/public_html/source | |
35 | scp $(DIST_ARCHIVES) $(DIST_ARCHIVES).sig anarchy.freedesktop.org:stefw@annarchy:/srv/www.freedesktop.org/www/software/realmd/releases |
0 | # Makefile.in generated by automake 1.11.5 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.12.2 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | |
4 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software | |
5 | # Foundation, Inc. | |
3 | # Copyright (C) 1994-2012 Free Software Foundation, Inc. | |
4 | ||
6 | 5 | # This Makefile.in is free software; the Free Software Foundation |
7 | 6 | # gives unlimited permission to copy and/or distribute it, |
8 | 7 | # with or without modifications, as long as this notice is preserved. |
64 | 63 | CONFIG_HEADER = config.h |
65 | 64 | CONFIG_CLEAN_FILES = |
66 | 65 | CONFIG_CLEAN_VPATH_FILES = |
66 | AM_V_P = $(am__v_P_@AM_V@) | |
67 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) | |
68 | am__v_P_0 = false | |
69 | am__v_P_1 = : | |
67 | 70 | AM_V_GEN = $(am__v_GEN_@AM_V@) |
68 | 71 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) |
69 | am__v_GEN_0 = @echo " GEN " $@; | |
72 | am__v_GEN_0 = @echo " GEN " $@; | |
73 | am__v_GEN_1 = | |
70 | 74 | AM_V_at = $(am__v_at_@AM_V@) |
71 | 75 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) |
72 | 76 | am__v_at_0 = @ |
77 | am__v_at_1 = | |
73 | 78 | SOURCES = |
74 | 79 | DIST_SOURCES = |
75 | 80 | RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ |
88 | 93 | distclean-recursive maintainer-clean-recursive |
89 | 94 | AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ |
90 | 95 | $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ |
91 | distdir dist dist-all distcheck | |
96 | cscope distdir dist dist-all distcheck | |
92 | 97 | ETAGS = etags |
93 | 98 | CTAGS = ctags |
99 | CSCOPE = cscope | |
94 | 100 | DIST_SUBDIRS = $(SUBDIRS) |
95 | 101 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
96 | 102 | distdir = $(PACKAGE)-$(VERSION) |
101 | 107 | && rm -rf "$(distdir)" \ |
102 | 108 | || { sleep 5 && rm -rf "$(distdir)"; }; \ |
103 | 109 | else :; fi |
110 | am__post_remove_distdir = $(am__remove_distdir) | |
104 | 111 | am__relativize = \ |
105 | 112 | dir0=`pwd`; \ |
106 | 113 | sed_first='s,^\([^/]*\)/.*$$,\1,'; \ |
128 | 135 | reldir="$$dir2" |
129 | 136 | DIST_ARCHIVES = $(distdir).tar.gz |
130 | 137 | GZIP_ENV = --best |
138 | DIST_TARGETS = dist-gzip | |
131 | 139 | distuninstallcheck_listfiles = find . -type f -print |
132 | 140 | am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ |
133 | 141 | | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' |
360 | 368 | -rm -f config.h stamp-h1 |
361 | 369 | |
362 | 370 | # This directory's subdirectories are mostly independent; you can cd |
363 | # into them and run `make' without going through this Makefile. | |
364 | # To change the values of `make' variables: instead of editing Makefiles, | |
365 | # (1) if the variable is set in `config.status', edit `config.status' | |
366 | # (which will cause the Makefiles to be regenerated when you run `make'); | |
367 | # (2) otherwise, pass the desired values on the `make' command line. | |
368 | $(RECURSIVE_TARGETS): | |
371 | # into them and run 'make' without going through this Makefile. | |
372 | # To change the values of 'make' variables: instead of editing Makefiles, | |
373 | # (1) if the variable is set in 'config.status', edit 'config.status' | |
374 | # (which will cause the Makefiles to be regenerated when you run 'make'); | |
375 | # (2) otherwise, pass the desired values on the 'make' command line. | |
376 | $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): | |
369 | 377 | @fail= failcom='exit 1'; \ |
370 | 378 | for f in x $$MAKEFLAGS; do \ |
371 | 379 | case $$f in \ |
375 | 383 | done; \ |
376 | 384 | dot_seen=no; \ |
377 | 385 | target=`echo $@ | sed s/-recursive//`; \ |
378 | list='$(SUBDIRS)'; for subdir in $$list; do \ | |
386 | case "$@" in \ | |
387 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ | |
388 | *) list='$(SUBDIRS)' ;; \ | |
389 | esac; \ | |
390 | for subdir in $$list; do \ | |
379 | 391 | echo "Making $$target in $$subdir"; \ |
380 | 392 | if test "$$subdir" = "."; then \ |
381 | 393 | dot_seen=yes; \ |
389 | 401 | if test "$$dot_seen" = "no"; then \ |
390 | 402 | $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ |
391 | 403 | fi; test -z "$$fail" |
392 | ||
393 | $(RECURSIVE_CLEAN_TARGETS): | |
394 | @fail= failcom='exit 1'; \ | |
395 | for f in x $$MAKEFLAGS; do \ | |
396 | case $$f in \ | |
397 | *=* | --[!k]*);; \ | |
398 | *k*) failcom='fail=yes';; \ | |
399 | esac; \ | |
400 | done; \ | |
401 | dot_seen=no; \ | |
402 | case "$@" in \ | |
403 | distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ | |
404 | *) list='$(SUBDIRS)' ;; \ | |
405 | esac; \ | |
406 | rev=''; for subdir in $$list; do \ | |
407 | if test "$$subdir" = "."; then :; else \ | |
408 | rev="$$subdir $$rev"; \ | |
409 | fi; \ | |
410 | done; \ | |
411 | rev="$$rev ."; \ | |
412 | target=`echo $@ | sed s/-recursive//`; \ | |
413 | for subdir in $$rev; do \ | |
414 | echo "Making $$target in $$subdir"; \ | |
415 | if test "$$subdir" = "."; then \ | |
416 | local_target="$$target-am"; \ | |
417 | else \ | |
418 | local_target="$$target"; \ | |
419 | fi; \ | |
420 | ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ | |
421 | || eval $$failcom; \ | |
422 | done && test -z "$$fail" | |
423 | 404 | tags-recursive: |
424 | 405 | list='$(SUBDIRS)'; for subdir in $$list; do \ |
425 | 406 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ |
427 | 408 | ctags-recursive: |
428 | 409 | list='$(SUBDIRS)'; for subdir in $$list; do \ |
429 | 410 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ |
411 | done | |
412 | cscopelist-recursive: | |
413 | list='$(SUBDIRS)'; for subdir in $$list; do \ | |
414 | test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ | |
430 | 415 | done |
431 | 416 | |
432 | 417 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) |
491 | 476 | && $(am__cd) $(top_srcdir) \ |
492 | 477 | && gtags -i $(GTAGS_ARGS) "$$here" |
493 | 478 | |
479 | cscope: cscope.files | |
480 | test ! -s cscope.files \ | |
481 | || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) | |
482 | ||
483 | clean-cscope: | |
484 | -rm -f cscope.files | |
485 | ||
486 | cscope.files: clean-cscope cscopelist-recursive cscopelist | |
487 | ||
488 | cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) | |
489 | list='$(SOURCES) $(HEADERS) $(LISP)'; \ | |
490 | case "$(srcdir)" in \ | |
491 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ | |
492 | *) sdir=$(subdir)/$(srcdir) ;; \ | |
493 | esac; \ | |
494 | for i in $$list; do \ | |
495 | if test -f "$$i"; then \ | |
496 | echo "$(subdir)/$$i"; \ | |
497 | else \ | |
498 | echo "$$sdir/$$i"; \ | |
499 | fi; \ | |
500 | done >> $(top_builddir)/cscope.files | |
501 | ||
494 | 502 | distclean-tags: |
495 | 503 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags |
504 | -rm -f cscope.out cscope.in.out cscope.po.out cscope.files | |
496 | 505 | |
497 | 506 | distdir: $(DISTFILES) |
498 | 507 | $(am__remove_distdir) |
563 | 572 | || chmod -R a+r "$(distdir)" |
564 | 573 | dist-gzip: distdir |
565 | 574 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz |
566 | $(am__remove_distdir) | |
575 | $(am__post_remove_distdir) | |
567 | 576 | |
568 | 577 | dist-bzip2: distdir |
569 | 578 | tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 |
570 | $(am__remove_distdir) | |
579 | $(am__post_remove_distdir) | |
571 | 580 | |
572 | 581 | dist-lzip: distdir |
573 | 582 | tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz |
574 | $(am__remove_distdir) | |
575 | ||
576 | dist-lzma: distdir | |
577 | tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma | |
578 | $(am__remove_distdir) | |
583 | $(am__post_remove_distdir) | |
579 | 584 | |
580 | 585 | dist-xz: distdir |
581 | 586 | tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz |
582 | $(am__remove_distdir) | |
587 | $(am__post_remove_distdir) | |
583 | 588 | |
584 | 589 | dist-tarZ: distdir |
585 | 590 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z |
586 | $(am__remove_distdir) | |
591 | $(am__post_remove_distdir) | |
587 | 592 | |
588 | 593 | dist-shar: distdir |
589 | 594 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz |
590 | $(am__remove_distdir) | |
595 | $(am__post_remove_distdir) | |
591 | 596 | |
592 | 597 | dist-zip: distdir |
593 | 598 | -rm -f $(distdir).zip |
594 | 599 | zip -rq $(distdir).zip $(distdir) |
595 | $(am__remove_distdir) | |
596 | ||
597 | dist dist-all: distdir | |
598 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz | |
599 | $(am__remove_distdir) | |
600 | $(am__post_remove_distdir) | |
601 | ||
602 | dist dist-all: | |
603 | $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' | |
604 | $(am__post_remove_distdir) | |
600 | 605 | |
601 | 606 | # This target untars the dist file and tries a VPATH configuration. Then |
602 | 607 | # it guarantees that the distribution is self-contained by making another |
607 | 612 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ |
608 | 613 | *.tar.bz2*) \ |
609 | 614 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ |
610 | *.tar.lzma*) \ | |
611 | lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ | |
612 | 615 | *.tar.lz*) \ |
613 | 616 | lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ |
614 | 617 | *.tar.xz*) \ |
620 | 623 | *.zip*) \ |
621 | 624 | unzip $(distdir).zip ;;\ |
622 | 625 | esac |
623 | chmod -R a-w $(distdir); chmod a+w $(distdir) | |
626 | chmod -R a-w $(distdir); chmod u+w $(distdir) | |
624 | 627 | mkdir $(distdir)/_build |
625 | 628 | mkdir $(distdir)/_inst |
626 | 629 | chmod a-w $(distdir) |
654 | 657 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ |
655 | 658 | && cd "$$am__cwd" \ |
656 | 659 | || exit 1 |
657 | $(am__remove_distdir) | |
660 | $(am__post_remove_distdir) | |
658 | 661 | @(echo "$(distdir) archives ready for distribution: "; \ |
659 | 662 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ |
660 | 663 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' |
789 | 792 | uninstall-am: |
790 | 793 | |
791 | 794 | .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ |
792 | ctags-recursive install-am install-strip tags-recursive | |
795 | cscopelist-recursive ctags-recursive install-am install-strip \ | |
796 | tags-recursive | |
793 | 797 | |
794 | 798 | .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ |
795 | all all-am am--refresh check check-am clean clean-generic \ | |
796 | ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ | |
797 | dist-hook dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ | |
798 | dist-zip distcheck distclean distclean-generic distclean-hdr \ | |
799 | distclean-tags distcleancheck distdir distuninstallcheck dvi \ | |
800 | dvi-am html html-am info info-am install install-am \ | |
801 | install-data install-data-am install-dvi install-dvi-am \ | |
802 | install-exec install-exec-am install-html install-html-am \ | |
803 | install-info install-info-am install-man install-pdf \ | |
804 | install-pdf-am install-ps install-ps-am install-strip \ | |
805 | installcheck installcheck-am installdirs installdirs-am \ | |
806 | maintainer-clean maintainer-clean-generic mostlyclean \ | |
807 | mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ | |
808 | uninstall uninstall-am | |
799 | all all-am am--refresh check check-am clean clean-cscope \ | |
800 | clean-generic cscope cscopelist cscopelist-recursive ctags \ | |
801 | ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \ | |
802 | dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ | |
803 | distclean distclean-generic distclean-hdr distclean-tags \ | |
804 | distcleancheck distdir distuninstallcheck dvi dvi-am html \ | |
805 | html-am info info-am install install-am install-data \ | |
806 | install-data-am install-dvi install-dvi-am install-exec \ | |
807 | install-exec-am install-html install-html-am install-info \ | |
808 | install-info-am install-man install-pdf install-pdf-am \ | |
809 | install-ps install-ps-am install-strip installcheck \ | |
810 | installcheck-am installdirs installdirs-am maintainer-clean \ | |
811 | maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ | |
812 | pdf-am ps ps-am tags tags-recursive uninstall uninstall-am | |
809 | 813 | |
810 | 814 | |
811 | 815 | perform-memcheck: $(TEST_PROGS) $(TEST_SUPPRESSIONS) |
862 | 866 | |
863 | 867 | upload-release: $(DIST_ARCHIVES) |
864 | 868 | gpg --detach-sign --local-user 'stef@thewalter.net' $(DIST_ARCHIVES) |
865 | scp $(DIST_ARCHIVES) $(DIST_ARCHIVES).sig people.freedesktop.org:/home/stefw/public_html/source | |
869 | scp $(DIST_ARCHIVES) $(DIST_ARCHIVES).sig anarchy.freedesktop.org:stefw@annarchy:/srv/www.freedesktop.org/www/software/realmd/releases | |
866 | 870 | |
867 | 871 | # Tell versions [3.59,3.63) of GNU make to not export all variables. |
868 | 872 | # Otherwise a system limit (for SysV at least) may be exceeded. |
0 | 0.6 | |
1 | * Switch default AD client to sssd | |
2 | * Support building with automake 1.12.x | |
3 | * Cleaner DBus API which handles password based authentication | |
4 | required for samba3's net command. | |
5 | * Remove support for out of process providers | |
6 | * Lots of bug fixes | |
7 | ||
0 | 8 | 0.5 |
1 | 9 | * Implement login policy concept |
2 | 10 | * Make the daemon exit-after-timeout work better |
0 | # generated automatically by aclocal 1.11.5 -*- Autoconf -*- | |
1 | ||
2 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, | |
3 | # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, | |
4 | # Inc. | |
0 | # generated automatically by aclocal 1.12.2 -*- Autoconf -*- | |
1 | ||
2 | # Copyright (C) 1996-2012 Free Software Foundation, Inc. | |
3 | ||
5 | 4 | # This file is free software; the Free Software Foundation |
6 | 5 | # gives unlimited permission to copy and/or distribute it, |
7 | 6 | # with or without modifications, as long as this notice is preserved. |
17 | 16 | [m4_warning([this file was generated for autoconf 2.69. |
18 | 17 | You have another version of autoconf. It may work, but is not guaranteed to. |
19 | 18 | If you have problems, you may need to regenerate the build system entirely. |
20 | To do so, use the procedure documented by the package, typically `autoreconf'.])]) | |
19 | To do so, use the procedure documented by the package, typically 'autoreconf'.])]) | |
21 | 20 | |
22 | 21 | # Copyright (C) 1995-2002 Free Software Foundation, Inc. |
23 | 22 | # Copyright (C) 2001-2003,2004 Red Hat, Inc. |
649 | 648 | fi[]dnl |
650 | 649 | ])# PKG_CHECK_MODULES |
651 | 650 | |
652 | # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software | |
653 | # Foundation, Inc. | |
654 | # | |
655 | # This file is free software; the Free Software Foundation | |
656 | # gives unlimited permission to copy and/or distribute it, | |
657 | # with or without modifications, as long as this notice is preserved. | |
658 | ||
659 | # serial 1 | |
651 | ||
652 | # PKG_INSTALLDIR(DIRECTORY) | |
653 | # ------------------------- | |
654 | # Substitutes the variable pkgconfigdir as the location where a module | |
655 | # should install pkg-config .pc files. By default the directory is | |
656 | # $libdir/pkgconfig, but the default can be changed by passing | |
657 | # DIRECTORY. The user can override through the --with-pkgconfigdir | |
658 | # parameter. | |
659 | AC_DEFUN([PKG_INSTALLDIR], | |
660 | [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) | |
661 | m4_pushdef([pkg_description], | |
662 | [pkg-config installation directory @<:@]pkg_default[@:>@]) | |
663 | AC_ARG_WITH([pkgconfigdir], | |
664 | [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, | |
665 | [with_pkgconfigdir=]pkg_default) | |
666 | AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) | |
667 | m4_popdef([pkg_default]) | |
668 | m4_popdef([pkg_description]) | |
669 | ]) dnl PKG_INSTALLDIR | |
670 | ||
671 | ||
672 | # PKG_NOARCH_INSTALLDIR(DIRECTORY) | |
673 | # ------------------------- | |
674 | # Substitutes the variable noarch_pkgconfigdir as the location where a | |
675 | # module should install arch-independent pkg-config .pc files. By | |
676 | # default the directory is $datadir/pkgconfig, but the default can be | |
677 | # changed by passing DIRECTORY. The user can override through the | |
678 | # --with-noarch-pkgconfigdir parameter. | |
679 | AC_DEFUN([PKG_NOARCH_INSTALLDIR], | |
680 | [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) | |
681 | m4_pushdef([pkg_description], | |
682 | [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) | |
683 | AC_ARG_WITH([noarch-pkgconfigdir], | |
684 | [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, | |
685 | [with_noarch_pkgconfigdir=]pkg_default) | |
686 | AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) | |
687 | m4_popdef([pkg_default]) | |
688 | m4_popdef([pkg_description]) | |
689 | ]) dnl PKG_NOARCH_INSTALLDIR | |
690 | ||
691 | # Copyright (C) 2002-2012 Free Software Foundation, Inc. | |
692 | # | |
693 | # This file is free software; the Free Software Foundation | |
694 | # gives unlimited permission to copy and/or distribute it, | |
695 | # with or without modifications, as long as this notice is preserved. | |
696 | ||
697 | # serial 8 | |
660 | 698 | |
661 | 699 | # AM_AUTOMAKE_VERSION(VERSION) |
662 | 700 | # ---------------------------- |
664 | 702 | # generated from the m4 files accompanying Automake X.Y. |
665 | 703 | # (This private macro should not be called outside this file.) |
666 | 704 | AC_DEFUN([AM_AUTOMAKE_VERSION], |
667 | [am__api_version='1.11' | |
705 | [am__api_version='1.12' | |
668 | 706 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to |
669 | 707 | dnl require some minimum version. Point them to the right macro. |
670 | m4_if([$1], [1.11.5], [], | |
708 | m4_if([$1], [1.12.2], [], | |
671 | 709 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl |
672 | 710 | ]) |
673 | 711 | |
683 | 721 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. |
684 | 722 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
685 | 723 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
686 | [AM_AUTOMAKE_VERSION([1.11.5])dnl | |
724 | [AM_AUTOMAKE_VERSION([1.12.2])dnl | |
687 | 725 | m4_ifndef([AC_AUTOCONF_VERSION], |
688 | 726 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
689 | 727 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
690 | 728 | |
691 | 729 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- |
692 | 730 | |
693 | # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. | |
694 | # | |
695 | # This file is free software; the Free Software Foundation | |
696 | # gives unlimited permission to copy and/or distribute it, | |
697 | # with or without modifications, as long as this notice is preserved. | |
698 | ||
699 | # serial 1 | |
731 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | |
732 | # | |
733 | # This file is free software; the Free Software Foundation | |
734 | # gives unlimited permission to copy and/or distribute it, | |
735 | # with or without modifications, as long as this notice is preserved. | |
736 | ||
737 | # serial 2 | |
700 | 738 | |
701 | 739 | # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets |
702 | # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to | |
703 | # `$srcdir', `$srcdir/..', or `$srcdir/../..'. | |
740 | # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to | |
741 | # '$srcdir', '$srcdir/..', or '$srcdir/../..'. | |
704 | 742 | # |
705 | 743 | # Of course, Automake must honor this variable whenever it calls a |
706 | 744 | # tool from the auxiliary directory. The problem is that $srcdir (and |
719 | 757 | # |
720 | 758 | # The reason of the latter failure is that $top_srcdir and $ac_aux_dir |
721 | 759 | # are both prefixed by $srcdir. In an in-source build this is usually |
722 | # harmless because $srcdir is `.', but things will broke when you | |
760 | # harmless because $srcdir is '.', but things will broke when you | |
723 | 761 | # start a VPATH build or use an absolute $srcdir. |
724 | 762 | # |
725 | 763 | # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, |
745 | 783 | |
746 | 784 | # AM_CONDITIONAL -*- Autoconf -*- |
747 | 785 | |
748 | # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 | |
749 | # Free Software Foundation, Inc. | |
750 | # | |
751 | # This file is free software; the Free Software Foundation | |
752 | # gives unlimited permission to copy and/or distribute it, | |
753 | # with or without modifications, as long as this notice is preserved. | |
754 | ||
755 | # serial 9 | |
786 | # Copyright (C) 1997-2012 Free Software Foundation, Inc. | |
787 | # | |
788 | # This file is free software; the Free Software Foundation | |
789 | # gives unlimited permission to copy and/or distribute it, | |
790 | # with or without modifications, as long as this notice is preserved. | |
791 | ||
792 | # serial 10 | |
756 | 793 | |
757 | 794 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) |
758 | 795 | # ------------------------------------- |
759 | 796 | # Define a conditional. |
760 | 797 | AC_DEFUN([AM_CONDITIONAL], |
761 | [AC_PREREQ(2.52)dnl | |
762 | ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], | |
763 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl | |
798 | [AC_PREREQ([2.52])dnl | |
799 | m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], | |
800 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl | |
764 | 801 | AC_SUBST([$1_TRUE])dnl |
765 | 802 | AC_SUBST([$1_FALSE])dnl |
766 | 803 | _AM_SUBST_NOTMAKE([$1_TRUE])dnl |
779 | 816 | Usually this means the macro was only invoked conditionally.]]) |
780 | 817 | fi])]) |
781 | 818 | |
782 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, | |
783 | # 2010, 2011 Free Software Foundation, Inc. | |
784 | # | |
785 | # This file is free software; the Free Software Foundation | |
786 | # gives unlimited permission to copy and/or distribute it, | |
787 | # with or without modifications, as long as this notice is preserved. | |
788 | ||
789 | # serial 12 | |
790 | ||
791 | # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be | |
819 | # Copyright (C) 1999-2012 Free Software Foundation, Inc. | |
820 | # | |
821 | # This file is free software; the Free Software Foundation | |
822 | # gives unlimited permission to copy and/or distribute it, | |
823 | # with or without modifications, as long as this notice is preserved. | |
824 | ||
825 | # serial 17 | |
826 | ||
827 | # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be | |
792 | 828 | # written in clear, in which case automake, when reading aclocal.m4, |
793 | 829 | # will think it sees a *use*, and therefore will trigger all it's |
794 | 830 | # C support machinery. Also note that it means that autoscan, seeing |
798 | 834 | # _AM_DEPENDENCIES(NAME) |
799 | 835 | # ---------------------- |
800 | 836 | # See how the compiler implements dependency checking. |
801 | # NAME is "CC", "CXX", "GCJ", or "OBJC". | |
837 | # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". | |
802 | 838 | # We try a few techniques and use that to set a single cache variable. |
803 | 839 | # |
804 | 840 | # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was |
811 | 847 | AC_REQUIRE([AM_MAKE_INCLUDE])dnl |
812 | 848 | AC_REQUIRE([AM_DEP_TRACK])dnl |
813 | 849 | |
814 | ifelse([$1], CC, [depcc="$CC" am_compiler_list=], | |
815 | [$1], CXX, [depcc="$CXX" am_compiler_list=], | |
816 | [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], | |
817 | [$1], UPC, [depcc="$UPC" am_compiler_list=], | |
818 | [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], | |
819 | [depcc="$$1" am_compiler_list=]) | |
850 | m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], | |
851 | [$1], [CXX], [depcc="$CXX" am_compiler_list=], | |
852 | [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], | |
853 | [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], | |
854 | [$1], [UPC], [depcc="$UPC" am_compiler_list=], | |
855 | [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], | |
856 | [depcc="$$1" am_compiler_list=]) | |
820 | 857 | |
821 | 858 | AC_CACHE_CHECK([dependency style of $depcc], |
822 | 859 | [am_cv_$1_dependencies_compiler_type], |
824 | 861 | # We make a subdir and do the tests there. Otherwise we can end up |
825 | 862 | # making bogus files that we don't know about and never remove. For |
826 | 863 | # instance it was reported that on HP-UX the gcc test will end up |
827 | # making a dummy file named `D' -- because `-MD' means `put the output | |
828 | # in D'. | |
864 | # making a dummy file named 'D' -- because '-MD' means "put the output | |
865 | # in D". | |
829 | 866 | rm -rf conftest.dir |
830 | 867 | mkdir conftest.dir |
831 | 868 | # Copy depcomp to subdir because otherwise we won't find it if we're |
865 | 902 | : > sub/conftest.c |
866 | 903 | for i in 1 2 3 4 5 6; do |
867 | 904 | echo '#include "conftst'$i'.h"' >> sub/conftest.c |
868 | # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with | |
869 | # Solaris 8's {/usr,}/bin/sh. | |
870 | touch sub/conftst$i.h | |
905 | # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with | |
906 | # Solaris 10 /bin/sh. | |
907 | echo '/* dummy */' > sub/conftst$i.h | |
871 | 908 | done |
872 | 909 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf |
873 | 910 | |
874 | # We check with `-c' and `-o' for the sake of the "dashmstdout" | |
911 | # We check with '-c' and '-o' for the sake of the "dashmstdout" | |
875 | 912 | # mode. It turns out that the SunPro C++ compiler does not properly |
876 | # handle `-M -o', and we need to detect this. Also, some Intel | |
877 | # versions had trouble with output in subdirs | |
913 | # handle '-M -o', and we need to detect this. Also, some Intel | |
914 | # versions had trouble with output in subdirs. | |
878 | 915 | am__obj=sub/conftest.${OBJEXT-o} |
879 | 916 | am__minus_obj="-o $am__obj" |
880 | 917 | case $depmode in |
883 | 920 | test "$am__universal" = false || continue |
884 | 921 | ;; |
885 | 922 | nosideeffect) |
886 | # after this tag, mechanisms are not by side-effect, so they'll | |
887 | # only be used when explicitly requested | |
923 | # After this tag, mechanisms are not by side-effect, so they'll | |
924 | # only be used when explicitly requested. | |
888 | 925 | if test "x$enable_dependency_tracking" = xyes; then |
889 | 926 | continue |
890 | 927 | else |
892 | 929 | fi |
893 | 930 | ;; |
894 | 931 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
895 | # This compiler won't grok `-c -o', but also, the minuso test has | |
932 | # This compiler won't grok '-c -o', but also, the minuso test has | |
896 | 933 | # not run yet. These depmodes are late enough in the game, and |
897 | 934 | # so weak that their functioning should not be impacted. |
898 | 935 | am__obj=conftest.${OBJEXT-o} |
940 | 977 | # AM_SET_DEPDIR |
941 | 978 | # ------------- |
942 | 979 | # Choose a directory name for dependency files. |
943 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES | |
980 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES. | |
944 | 981 | AC_DEFUN([AM_SET_DEPDIR], |
945 | 982 | [AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
946 | 983 | AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl |
950 | 987 | # AM_DEP_TRACK |
951 | 988 | # ------------ |
952 | 989 | AC_DEFUN([AM_DEP_TRACK], |
953 | [AC_ARG_ENABLE(dependency-tracking, | |
954 | [ --disable-dependency-tracking speeds up one-time build | |
955 | --enable-dependency-tracking do not reject slow dependency extractors]) | |
990 | [AC_ARG_ENABLE([dependency-tracking], [dnl | |
991 | AS_HELP_STRING( | |
992 | [--enable-dependency-tracking], | |
993 | [do not reject slow dependency extractors]) | |
994 | AS_HELP_STRING( | |
995 | [--disable-dependency-tracking], | |
996 | [speeds up one-time build])]) | |
956 | 997 | if test "x$enable_dependency_tracking" != xno; then |
957 | 998 | am_depcomp="$ac_aux_dir/depcomp" |
958 | 999 | AMDEPBACKSLASH='\' |
967 | 1008 | |
968 | 1009 | # Generate code to set up dependency tracking. -*- Autoconf -*- |
969 | 1010 | |
970 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 | |
971 | # Free Software Foundation, Inc. | |
972 | # | |
973 | # This file is free software; the Free Software Foundation | |
974 | # gives unlimited permission to copy and/or distribute it, | |
975 | # with or without modifications, as long as this notice is preserved. | |
976 | ||
977 | #serial 5 | |
1011 | # Copyright (C) 1999-2012 Free Software Foundation, Inc. | |
1012 | # | |
1013 | # This file is free software; the Free Software Foundation | |
1014 | # gives unlimited permission to copy and/or distribute it, | |
1015 | # with or without modifications, as long as this notice is preserved. | |
1016 | ||
1017 | # serial 6 | |
978 | 1018 | |
979 | 1019 | # _AM_OUTPUT_DEPENDENCY_COMMANDS |
980 | 1020 | # ------------------------------ |
993 | 1033 | # Strip MF so we end up with the name of the file. |
994 | 1034 | mf=`echo "$mf" | sed -e 's/:.*$//'` |
995 | 1035 | # Check whether this is an Automake generated Makefile or not. |
996 | # We used to match only the files named `Makefile.in', but | |
1036 | # We used to match only the files named 'Makefile.in', but | |
997 | 1037 | # some people rename them; so instead we look at the file content. |
998 | 1038 | # Grep'ing the first line is not enough: some people post-process |
999 | 1039 | # each Makefile.in and add a new line on top of each file to say so. |
1005 | 1045 | continue |
1006 | 1046 | fi |
1007 | 1047 | # Extract the definition of DEPDIR, am__include, and am__quote |
1008 | # from the Makefile without running `make'. | |
1048 | # from the Makefile without running 'make'. | |
1009 | 1049 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` |
1010 | 1050 | test -z "$DEPDIR" && continue |
1011 | 1051 | am__include=`sed -n 's/^am__include = //p' < "$mf"` |
1012 | 1052 | test -z "am__include" && continue |
1013 | 1053 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` |
1014 | # When using ansi2knr, U may be empty or an underscore; expand it | |
1015 | U=`sed -n 's/^U = //p' < "$mf"` | |
1016 | 1054 | # Find all dependency output files, they are included files with |
1017 | 1055 | # $(DEPDIR) in their names. We invoke sed twice because it is the |
1018 | 1056 | # simplest approach to changing $(DEPDIR) to its actual value in the |
1019 | 1057 | # expansion. |
1020 | 1058 | for file in `sed -n " |
1021 | 1059 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ |
1022 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do | |
1060 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do | |
1023 | 1061 | # Make sure the directory exists. |
1024 | 1062 | test -f "$dirpart/$file" && continue |
1025 | 1063 | fdir=`AS_DIRNAME(["$file"])` |
1037 | 1075 | # This macro should only be invoked once -- use via AC_REQUIRE. |
1038 | 1076 | # |
1039 | 1077 | # This code is only required when automatic dependency tracking |
1040 | # is enabled. FIXME. This creates each `.P' file that we will | |
1078 | # is enabled. FIXME. This creates each '.P' file that we will | |
1041 | 1079 | # need in order to bootstrap the dependency handling code. |
1042 | 1080 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], |
1043 | 1081 | [AC_CONFIG_COMMANDS([depfiles], |
1045 | 1083 | [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) |
1046 | 1084 | ]) |
1047 | 1085 | |
1048 | # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 | |
1049 | # Free Software Foundation, Inc. | |
1086 | # Copyright (C) 1996-2012 Free Software Foundation, Inc. | |
1050 | 1087 | # |
1051 | 1088 | # This file is free software; the Free Software Foundation |
1052 | 1089 | # gives unlimited permission to copy and/or distribute it, |
1059 | 1096 | |
1060 | 1097 | # Do all the work for Automake. -*- Autoconf -*- |
1061 | 1098 | |
1062 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, | |
1063 | # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. | |
1064 | # | |
1065 | # This file is free software; the Free Software Foundation | |
1066 | # gives unlimited permission to copy and/or distribute it, | |
1067 | # with or without modifications, as long as this notice is preserved. | |
1068 | ||
1069 | # serial 16 | |
1099 | # Copyright (C) 1996-2012 Free Software Foundation, Inc. | |
1100 | # | |
1101 | # This file is free software; the Free Software Foundation | |
1102 | # gives unlimited permission to copy and/or distribute it, | |
1103 | # with or without modifications, as long as this notice is preserved. | |
1104 | ||
1105 | # serial 19 | |
1070 | 1106 | |
1071 | 1107 | # This macro actually does too much. Some checks are only needed if |
1072 | 1108 | # your package does certain things. But this isn't really a big deal. |
1112 | 1148 | # Define the identity of the package. |
1113 | 1149 | dnl Distinguish between old-style and new-style calls. |
1114 | 1150 | m4_ifval([$2], |
1115 | [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl | |
1151 | [AC_DIAGNOSE([obsolete], | |
1152 | [$0: two- and three-arguments forms are deprecated. For more info, see: | |
1153 | http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation]) | |
1154 | m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl | |
1116 | 1155 | AC_SUBST([PACKAGE], [$1])dnl |
1117 | 1156 | AC_SUBST([VERSION], [$2])], |
1118 | 1157 | [_AM_SET_OPTIONS([$1])dnl |
1119 | 1158 | dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. |
1120 | m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, | |
1159 | m4_if( | |
1160 | m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), | |
1161 | [ok:ok],, | |
1121 | 1162 | [m4_fatal([AC_INIT should be called with package and version arguments])])dnl |
1122 | 1163 | AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl |
1123 | 1164 | AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl |
1124 | 1165 | |
1125 | 1166 | _AM_IF_OPTION([no-define],, |
1126 | [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) | |
1127 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl | |
1167 | [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) | |
1168 | AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl | |
1128 | 1169 | |
1129 | 1170 | # Some tools Automake needs. |
1130 | 1171 | AC_REQUIRE([AM_SANITY_CHECK])dnl |
1131 | 1172 | AC_REQUIRE([AC_ARG_PROGRAM])dnl |
1132 | AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) | |
1133 | AM_MISSING_PROG(AUTOCONF, autoconf) | |
1134 | AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) | |
1135 | AM_MISSING_PROG(AUTOHEADER, autoheader) | |
1136 | AM_MISSING_PROG(MAKEINFO, makeinfo) | |
1173 | AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) | |
1174 | AM_MISSING_PROG([AUTOCONF], [autoconf]) | |
1175 | AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) | |
1176 | AM_MISSING_PROG([AUTOHEADER], [autoheader]) | |
1177 | AM_MISSING_PROG([MAKEINFO], [makeinfo]) | |
1137 | 1178 | AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
1138 | 1179 | AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl |
1139 | AC_REQUIRE([AM_PROG_MKDIR_P])dnl | |
1180 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl | |
1181 | # For better backward compatibility. To be removed once Automake 1.9.x | |
1182 | # dies out for good. For more background, see: | |
1183 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> | |
1184 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> | |
1185 | AC_SUBST([mkdir_p], ['$(MKDIR_P)']) | |
1140 | 1186 | # We need awk for the "check" target. The system "awk" is bad on |
1141 | 1187 | # some platforms. |
1142 | 1188 | AC_REQUIRE([AC_PROG_AWK])dnl |
1147 | 1193 | [_AM_PROG_TAR([v7])])]) |
1148 | 1194 | _AM_IF_OPTION([no-dependencies],, |
1149 | 1195 | [AC_PROVIDE_IFELSE([AC_PROG_CC], |
1150 | [_AM_DEPENDENCIES(CC)], | |
1151 | [define([AC_PROG_CC], | |
1152 | defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl | |
1196 | [_AM_DEPENDENCIES([CC])], | |
1197 | [m4_define([AC_PROG_CC], | |
1198 | m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl | |
1153 | 1199 | AC_PROVIDE_IFELSE([AC_PROG_CXX], |
1154 | [_AM_DEPENDENCIES(CXX)], | |
1155 | [define([AC_PROG_CXX], | |
1156 | defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl | |
1200 | [_AM_DEPENDENCIES([CXX])], | |
1201 | [m4_define([AC_PROG_CXX], | |
1202 | m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl | |
1157 | 1203 | AC_PROVIDE_IFELSE([AC_PROG_OBJC], |
1158 | [_AM_DEPENDENCIES(OBJC)], | |
1159 | [define([AC_PROG_OBJC], | |
1160 | defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl | |
1204 | [_AM_DEPENDENCIES([OBJC])], | |
1205 | [m4_define([AC_PROG_OBJC], | |
1206 | m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl | |
1207 | dnl Support for Objective C++ was only introduced in Autoconf 2.65, | |
1208 | dnl but we still cater to Autoconf 2.62. | |
1209 | m4_ifdef([AC_PROG_OBJCXX], | |
1210 | [AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], | |
1211 | [_AM_DEPENDENCIES([OBJCXX])], | |
1212 | [m4_define([AC_PROG_OBJCXX], | |
1213 | m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl | |
1161 | 1214 | ]) |
1162 | 1215 | _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl |
1163 | dnl The `parallel-tests' driver may need to know about EXEEXT, so add the | |
1164 | dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro | |
1216 | dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the | |
1217 | dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro | |
1165 | 1218 | dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. |
1166 | 1219 | AC_CONFIG_COMMANDS_PRE(dnl |
1167 | 1220 | [m4_provide_if([_AM_COMPILER_EXEEXT], |
1168 | 1221 | [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl |
1169 | 1222 | ]) |
1170 | 1223 | |
1171 | dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not | |
1224 | dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not | |
1172 | 1225 | dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further |
1173 | 1226 | dnl mangled by Autoconf and run in a shell conditional statement. |
1174 | 1227 | m4_define([_AC_COMPILER_EXEEXT], |
1196 | 1249 | done |
1197 | 1250 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) |
1198 | 1251 | |
1199 | # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, | |
1200 | # Inc. | |
1201 | # | |
1202 | # This file is free software; the Free Software Foundation | |
1203 | # gives unlimited permission to copy and/or distribute it, | |
1204 | # with or without modifications, as long as this notice is preserved. | |
1205 | ||
1206 | # serial 1 | |
1252 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | |
1253 | # | |
1254 | # This file is free software; the Free Software Foundation | |
1255 | # gives unlimited permission to copy and/or distribute it, | |
1256 | # with or without modifications, as long as this notice is preserved. | |
1257 | ||
1258 | # serial 8 | |
1207 | 1259 | |
1208 | 1260 | # AM_PROG_INSTALL_SH |
1209 | 1261 | # ------------------ |
1218 | 1270 | install_sh="\${SHELL} $am_aux_dir/install-sh" |
1219 | 1271 | esac |
1220 | 1272 | fi |
1221 | AC_SUBST(install_sh)]) | |
1222 | ||
1223 | # Copyright (C) 2003, 2005 Free Software Foundation, Inc. | |
1273 | AC_SUBST([install_sh])]) | |
1274 | ||
1275 | # Copyright (C) 2003-2012 Free Software Foundation, Inc. | |
1224 | 1276 | # |
1225 | 1277 | # This file is free software; the Free Software Foundation |
1226 | 1278 | # gives unlimited permission to copy and/or distribute it, |
1244 | 1296 | # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- |
1245 | 1297 | # From Jim Meyering |
1246 | 1298 | |
1247 | # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, | |
1248 | # 2011 Free Software Foundation, Inc. | |
1249 | # | |
1250 | # This file is free software; the Free Software Foundation | |
1251 | # gives unlimited permission to copy and/or distribute it, | |
1252 | # with or without modifications, as long as this notice is preserved. | |
1253 | ||
1254 | # serial 5 | |
1299 | # Copyright (C) 1996-2012 Free Software Foundation, Inc. | |
1300 | # | |
1301 | # This file is free software; the Free Software Foundation | |
1302 | # gives unlimited permission to copy and/or distribute it, | |
1303 | # with or without modifications, as long as this notice is preserved. | |
1304 | ||
1305 | # serial 7 | |
1255 | 1306 | |
1256 | 1307 | # AM_MAINTAINER_MODE([DEFAULT-MODE]) |
1257 | 1308 | # ---------------------------------- |
1258 | 1309 | # Control maintainer-specific portions of Makefiles. |
1259 | # Default is to disable them, unless `enable' is passed literally. | |
1260 | # For symmetry, `disable' may be passed as well. Anyway, the user | |
1310 | # Default is to disable them, unless 'enable' is passed literally. | |
1311 | # For symmetry, 'disable' may be passed as well. Anyway, the user | |
1261 | 1312 | # can override the default with the --enable/--disable switch. |
1262 | 1313 | AC_DEFUN([AM_MAINTAINER_MODE], |
1263 | 1314 | [m4_case(m4_default([$1], [disable]), |
1268 | 1319 | AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
1269 | 1320 | dnl maintainer-mode's default is 'disable' unless 'enable' is passed |
1270 | 1321 | AC_ARG_ENABLE([maintainer-mode], |
1271 | [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful | |
1272 | (and sometimes confusing) to the casual installer], | |
1273 | [USE_MAINTAINER_MODE=$enableval], | |
1274 | [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) | |
1322 | [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], | |
1323 | am_maintainer_other[ make rules and dependencies not useful | |
1324 | (and sometimes confusing) to the casual installer])], | |
1325 | [USE_MAINTAINER_MODE=$enableval], | |
1326 | [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) | |
1275 | 1327 | AC_MSG_RESULT([$USE_MAINTAINER_MODE]) |
1276 | 1328 | AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) |
1277 | 1329 | MAINT=$MAINTAINER_MODE_TRUE |
1283 | 1335 | |
1284 | 1336 | # Check to see how 'make' treats includes. -*- Autoconf -*- |
1285 | 1337 | |
1286 | # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. | |
1287 | # | |
1288 | # This file is free software; the Free Software Foundation | |
1289 | # gives unlimited permission to copy and/or distribute it, | |
1290 | # with or without modifications, as long as this notice is preserved. | |
1291 | ||
1292 | # serial 4 | |
1338 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | |
1339 | # | |
1340 | # This file is free software; the Free Software Foundation | |
1341 | # gives unlimited permission to copy and/or distribute it, | |
1342 | # with or without modifications, as long as this notice is preserved. | |
1343 | ||
1344 | # serial 5 | |
1293 | 1345 | |
1294 | 1346 | # AM_MAKE_INCLUDE() |
1295 | 1347 | # ----------------- |
1308 | 1360 | _am_result=none |
1309 | 1361 | # First try GNU make style include. |
1310 | 1362 | echo "include confinc" > confmf |
1311 | # Ignore all kinds of additional output from `make'. | |
1363 | # Ignore all kinds of additional output from 'make'. | |
1312 | 1364 | case `$am_make -s -f confmf 2> /dev/null` in #( |
1313 | 1365 | *the\ am__doit\ target*) |
1314 | 1366 | am__include=include |
1333 | 1385 | rm -f confinc confmf |
1334 | 1386 | ]) |
1335 | 1387 | |
1336 | # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 | |
1337 | # Free Software Foundation, Inc. | |
1388 | # Copyright (C) 1999-2012 Free Software Foundation, Inc. | |
1338 | 1389 | # |
1339 | 1390 | # This file is free software; the Free Software Foundation |
1340 | 1391 | # gives unlimited permission to copy and/or distribute it, |
1370 | 1421 | |
1371 | 1422 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- |
1372 | 1423 | |
1373 | # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 | |
1374 | # Free Software Foundation, Inc. | |
1375 | # | |
1376 | # This file is free software; the Free Software Foundation | |
1377 | # gives unlimited permission to copy and/or distribute it, | |
1378 | # with or without modifications, as long as this notice is preserved. | |
1379 | ||
1380 | # serial 6 | |
1424 | # Copyright (C) 1997-2012 Free Software Foundation, Inc. | |
1425 | # | |
1426 | # This file is free software; the Free Software Foundation | |
1427 | # gives unlimited permission to copy and/or distribute it, | |
1428 | # with or without modifications, as long as this notice is preserved. | |
1429 | ||
1430 | # serial 7 | |
1381 | 1431 | |
1382 | 1432 | # AM_MISSING_PROG(NAME, PROGRAM) |
1383 | 1433 | # ------------------------------ |
1407 | 1457 | am_missing_run="$MISSING --run " |
1408 | 1458 | else |
1409 | 1459 | am_missing_run= |
1410 | AC_MSG_WARN([`missing' script is too old or missing]) | |
1460 | AC_MSG_WARN(['missing' script is too old or missing]) | |
1411 | 1461 | fi |
1412 | 1462 | ]) |
1413 | 1463 | |
1414 | # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, | |
1415 | # Inc. | |
1416 | # | |
1417 | # This file is free software; the Free Software Foundation | |
1418 | # gives unlimited permission to copy and/or distribute it, | |
1419 | # with or without modifications, as long as this notice is preserved. | |
1420 | ||
1421 | # serial 1 | |
1422 | ||
1423 | # AM_PROG_MKDIR_P | |
1424 | # --------------- | |
1425 | # Check for `mkdir -p'. | |
1426 | AC_DEFUN([AM_PROG_MKDIR_P], | |
1427 | [AC_PREREQ([2.60])dnl | |
1428 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl | |
1429 | dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, | |
1430 | dnl while keeping a definition of mkdir_p for backward compatibility. | |
1431 | dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. | |
1432 | dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of | |
1433 | dnl Makefile.ins that do not define MKDIR_P, so we do our own | |
1434 | dnl adjustment using top_builddir (which is defined more often than | |
1435 | dnl MKDIR_P). | |
1436 | AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl | |
1437 | case $mkdir_p in | |
1438 | [[\\/$]]* | ?:[[\\/]]*) ;; | |
1439 | */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; | |
1440 | esac | |
1441 | ]) | |
1442 | ||
1443 | 1464 | # Helper functions for option handling. -*- Autoconf -*- |
1444 | 1465 | |
1445 | # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software | |
1446 | # Foundation, Inc. | |
1447 | # | |
1448 | # This file is free software; the Free Software Foundation | |
1449 | # gives unlimited permission to copy and/or distribute it, | |
1450 | # with or without modifications, as long as this notice is preserved. | |
1451 | ||
1452 | # serial 5 | |
1466 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | |
1467 | # | |
1468 | # This file is free software; the Free Software Foundation | |
1469 | # gives unlimited permission to copy and/or distribute it, | |
1470 | # with or without modifications, as long as this notice is preserved. | |
1471 | ||
1472 | # serial 6 | |
1453 | 1473 | |
1454 | 1474 | # _AM_MANGLE_OPTION(NAME) |
1455 | 1475 | # ----------------------- |
1460 | 1480 | # -------------------- |
1461 | 1481 | # Set option NAME. Presently that only means defining a flag for this option. |
1462 | 1482 | AC_DEFUN([_AM_SET_OPTION], |
1463 | [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) | |
1483 | [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) | |
1464 | 1484 | |
1465 | 1485 | # _AM_SET_OPTIONS(OPTIONS) |
1466 | 1486 | # ------------------------ |
1474 | 1494 | AC_DEFUN([_AM_IF_OPTION], |
1475 | 1495 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) |
1476 | 1496 | |
1477 | # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. | |
1497 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | |
1478 | 1498 | # |
1479 | 1499 | # This file is free software; the Free Software Foundation |
1480 | 1500 | # gives unlimited permission to copy and/or distribute it, |
1495 | 1515 | |
1496 | 1516 | # Check to make sure that the build environment is sane. -*- Autoconf -*- |
1497 | 1517 | |
1498 | # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 | |
1499 | # Free Software Foundation, Inc. | |
1500 | # | |
1501 | # This file is free software; the Free Software Foundation | |
1502 | # gives unlimited permission to copy and/or distribute it, | |
1503 | # with or without modifications, as long as this notice is preserved. | |
1504 | ||
1505 | # serial 5 | |
1518 | # Copyright (C) 1996-2012 Free Software Foundation, Inc. | |
1519 | # | |
1520 | # This file is free software; the Free Software Foundation | |
1521 | # gives unlimited permission to copy and/or distribute it, | |
1522 | # with or without modifications, as long as this notice is preserved. | |
1523 | ||
1524 | # serial 9 | |
1506 | 1525 | |
1507 | 1526 | # AM_SANITY_CHECK |
1508 | 1527 | # --------------- |
1509 | 1528 | AC_DEFUN([AM_SANITY_CHECK], |
1510 | 1529 | [AC_MSG_CHECKING([whether build environment is sane]) |
1511 | # Just in case | |
1512 | sleep 1 | |
1513 | echo timestamp > conftest.file | |
1514 | 1530 | # Reject unsafe characters in $srcdir or the absolute working directory |
1515 | 1531 | # name. Accept space and tab only in the latter. |
1516 | 1532 | am_lf=' |
1521 | 1537 | esac |
1522 | 1538 | case $srcdir in |
1523 | 1539 | *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) |
1524 | AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; | |
1540 | AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; | |
1525 | 1541 | esac |
1526 | 1542 | |
1527 | # Do `set' in a subshell so we don't clobber the current shell's | |
1543 | # Do 'set' in a subshell so we don't clobber the current shell's | |
1528 | 1544 | # arguments. Must try -L first in case configure is actually a |
1529 | 1545 | # symlink; some systems play weird games with the mod time of symlinks |
1530 | 1546 | # (eg FreeBSD returns the mod time of the symlink's containing |
1531 | 1547 | # directory). |
1532 | 1548 | if ( |
1533 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` | |
1534 | if test "$[*]" = "X"; then | |
1535 | # -L didn't work. | |
1536 | set X `ls -t "$srcdir/configure" conftest.file` | |
1537 | fi | |
1538 | rm -f conftest.file | |
1539 | if test "$[*]" != "X $srcdir/configure conftest.file" \ | |
1540 | && test "$[*]" != "X conftest.file $srcdir/configure"; then | |
1541 | ||
1542 | # If neither matched, then we have a broken ls. This can happen | |
1543 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
1544 | # broken ls alias from the environment. This has actually | |
1545 | # happened. Such a system could not be considered "sane". | |
1546 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
1547 | alias in your environment]) | |
1548 | fi | |
1549 | ||
1549 | am_has_slept=no | |
1550 | for am_try in 1 2; do | |
1551 | echo "timestamp, slept: $am_has_slept" > conftest.file | |
1552 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` | |
1553 | if test "$[*]" = "X"; then | |
1554 | # -L didn't work. | |
1555 | set X `ls -t "$srcdir/configure" conftest.file` | |
1556 | fi | |
1557 | if test "$[*]" != "X $srcdir/configure conftest.file" \ | |
1558 | && test "$[*]" != "X conftest.file $srcdir/configure"; then | |
1559 | ||
1560 | # If neither matched, then we have a broken ls. This can happen | |
1561 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
1562 | # broken ls alias from the environment. This has actually | |
1563 | # happened. Such a system could not be considered "sane". | |
1564 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
1565 | alias in your environment]) | |
1566 | fi | |
1567 | if test "$[2]" = conftest.file || test $am_try -eq 2; then | |
1568 | break | |
1569 | fi | |
1570 | # Just in case. | |
1571 | sleep 1 | |
1572 | am_has_slept=yes | |
1573 | done | |
1550 | 1574 | test "$[2]" = conftest.file |
1551 | 1575 | ) |
1552 | 1576 | then |
1556 | 1580 | AC_MSG_ERROR([newly created file is older than distributed files! |
1557 | 1581 | Check your system clock]) |
1558 | 1582 | fi |
1559 | AC_MSG_RESULT(yes)]) | |
1560 | ||
1561 | # Copyright (C) 2009, 2011 Free Software Foundation, Inc. | |
1562 | # | |
1563 | # This file is free software; the Free Software Foundation | |
1564 | # gives unlimited permission to copy and/or distribute it, | |
1565 | # with or without modifications, as long as this notice is preserved. | |
1566 | ||
1567 | # serial 2 | |
1583 | AC_MSG_RESULT([yes]) | |
1584 | # If we didn't sleep, we still need to ensure time stamps of config.status and | |
1585 | # generated files are strictly newer. | |
1586 | am_sleep_pid= | |
1587 | if grep 'slept: no' conftest.file >/dev/null 2>&1; then | |
1588 | ( sleep 1 ) & | |
1589 | am_sleep_pid=$! | |
1590 | fi | |
1591 | AC_CONFIG_COMMANDS_PRE( | |
1592 | [AC_MSG_CHECKING([that generated files are newer than configure]) | |
1593 | if test -n "$am_sleep_pid"; then | |
1594 | # Hide warnings about reused PIDs. | |
1595 | wait $am_sleep_pid 2>/dev/null | |
1596 | fi | |
1597 | AC_MSG_RESULT([done])]) | |
1598 | rm -f conftest.file | |
1599 | ]) | |
1600 | ||
1601 | # Copyright (C) 2009-2012 Free Software Foundation, Inc. | |
1602 | # | |
1603 | # This file is free software; the Free Software Foundation | |
1604 | # gives unlimited permission to copy and/or distribute it, | |
1605 | # with or without modifications, as long as this notice is preserved. | |
1606 | ||
1607 | # serial 3 | |
1568 | 1608 | |
1569 | 1609 | # AM_SILENT_RULES([DEFAULT]) |
1570 | 1610 | # -------------------------- |
1571 | 1611 | # Enable less verbose build rules; with the default set to DEFAULT |
1572 | # (`yes' being less verbose, `no' or empty being verbose). | |
1612 | # ("yes" being less verbose, "no" or empty being verbose). | |
1573 | 1613 | AC_DEFUN([AM_SILENT_RULES], |
1574 | [AC_ARG_ENABLE([silent-rules], | |
1575 | [ --enable-silent-rules less verbose build output (undo: `make V=1') | |
1576 | --disable-silent-rules verbose build output (undo: `make V=0')]) | |
1577 | case $enable_silent_rules in | |
1578 | yes) AM_DEFAULT_VERBOSITY=0;; | |
1579 | no) AM_DEFAULT_VERBOSITY=1;; | |
1580 | *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; | |
1614 | [AC_ARG_ENABLE([silent-rules], [dnl | |
1615 | AS_HELP_STRING( | |
1616 | [--enable-silent-rules], | |
1617 | [less verbose build output (undo: "make V=1")]) | |
1618 | AS_HELP_STRING( | |
1619 | [--disable-silent-rules], | |
1620 | [verbose build output (undo: "make V=0")])dnl | |
1621 | ]) | |
1622 | case $enable_silent_rules in @%:@ ((( | |
1623 | yes) AM_DEFAULT_VERBOSITY=0;; | |
1624 | no) AM_DEFAULT_VERBOSITY=1;; | |
1625 | *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; | |
1581 | 1626 | esac |
1582 | 1627 | dnl |
1583 | dnl A few `make' implementations (e.g., NonStop OS and NextStep) | |
1628 | dnl A few 'make' implementations (e.g., NonStop OS and NextStep) | |
1584 | 1629 | dnl do not support nested variable expansions. |
1585 | 1630 | dnl See automake bug#9928 and bug#10237. |
1586 | 1631 | am_make=${MAKE-make} |
1598 | 1643 | am_cv_make_support_nested_variables=no |
1599 | 1644 | fi]) |
1600 | 1645 | if test $am_cv_make_support_nested_variables = yes; then |
1601 | dnl Using `$V' instead of `$(V)' breaks IRIX make. | |
1646 | dnl Using '$V' instead of '$(V)' breaks IRIX make. | |
1602 | 1647 | AM_V='$(V)' |
1603 | 1648 | AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' |
1604 | 1649 | else |
1615 | 1660 | _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl |
1616 | 1661 | ]) |
1617 | 1662 | |
1618 | # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. | |
1619 | # | |
1620 | # This file is free software; the Free Software Foundation | |
1621 | # gives unlimited permission to copy and/or distribute it, | |
1622 | # with or without modifications, as long as this notice is preserved. | |
1623 | ||
1624 | # serial 1 | |
1663 | # Copyright (C) 2001-2012 Free Software Foundation, Inc. | |
1664 | # | |
1665 | # This file is free software; the Free Software Foundation | |
1666 | # gives unlimited permission to copy and/or distribute it, | |
1667 | # with or without modifications, as long as this notice is preserved. | |
1668 | ||
1669 | # serial 2 | |
1625 | 1670 | |
1626 | 1671 | # AM_PROG_INSTALL_STRIP |
1627 | 1672 | # --------------------- |
1628 | # One issue with vendor `install' (even GNU) is that you can't | |
1673 | # One issue with vendor 'install' (even GNU) is that you can't | |
1629 | 1674 | # specify the program used to strip binaries. This is especially |
1630 | 1675 | # annoying in cross-compiling environments, where the build's strip |
1631 | 1676 | # is unlikely to handle the host's binaries. |
1632 | 1677 | # Fortunately install-sh will honor a STRIPPROG variable, so we |
1633 | # always use install-sh in `make install-strip', and initialize | |
1678 | # always use install-sh in "make install-strip", and initialize | |
1634 | 1679 | # STRIPPROG with the value of the STRIP variable (set by the user). |
1635 | 1680 | AC_DEFUN([AM_PROG_INSTALL_STRIP], |
1636 | 1681 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
1637 | # Installed binaries are usually stripped using `strip' when the user | |
1638 | # run `make install-strip'. However `strip' might not be the right | |
1682 | # Installed binaries are usually stripped using 'strip' when the user | |
1683 | # run "make install-strip". However 'strip' might not be the right | |
1639 | 1684 | # tool to use in cross-compilation environments, therefore Automake |
1640 | # will honor the `STRIP' environment variable to overrule this program. | |
1641 | dnl Don't test for $cross_compiling = yes, because it might be `maybe'. | |
1685 | # will honor the 'STRIP' environment variable to overrule this program. | |
1686 | dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. | |
1642 | 1687 | if test "$cross_compiling" != no; then |
1643 | 1688 | AC_CHECK_TOOL([STRIP], [strip], :) |
1644 | 1689 | fi |
1645 | 1690 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" |
1646 | 1691 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
1647 | 1692 | |
1648 | # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. | |
1693 | # Copyright (C) 2006-2012 Free Software Foundation, Inc. | |
1649 | 1694 | # |
1650 | 1695 | # This file is free software; the Free Software Foundation |
1651 | 1696 | # gives unlimited permission to copy and/or distribute it, |
1666 | 1711 | |
1667 | 1712 | # Check how to create a tarball. -*- Autoconf -*- |
1668 | 1713 | |
1669 | # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. | |
1670 | # | |
1671 | # This file is free software; the Free Software Foundation | |
1672 | # gives unlimited permission to copy and/or distribute it, | |
1673 | # with or without modifications, as long as this notice is preserved. | |
1674 | ||
1675 | # serial 2 | |
1714 | # Copyright (C) 2004-2012 Free Software Foundation, Inc. | |
1715 | # | |
1716 | # This file is free software; the Free Software Foundation | |
1717 | # gives unlimited permission to copy and/or distribute it, | |
1718 | # with or without modifications, as long as this notice is preserved. | |
1719 | ||
1720 | # serial 3 | |
1676 | 1721 | |
1677 | 1722 | # _AM_PROG_TAR(FORMAT) |
1678 | 1723 | # -------------------- |
1679 | 1724 | # Check how to create a tarball in format FORMAT. |
1680 | # FORMAT should be one of `v7', `ustar', or `pax'. | |
1725 | # FORMAT should be one of 'v7', 'ustar', or 'pax'. | |
1681 | 1726 | # |
1682 | 1727 | # Substitute a variable $(am__tar) that is a command |
1683 | 1728 | # writing to stdout a FORMAT-tarball containing the directory |
1700 | 1745 | _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' |
1701 | 1746 | _am_tools=${am_cv_prog_tar_$1-$_am_tools} |
1702 | 1747 | # Do not fold the above two line into one, because Tru64 sh and |
1703 | # Solaris sh will not grok spaces in the rhs of `-'. | |
1748 | # Solaris sh will not grok spaces in the rhs of '-'. | |
1704 | 1749 | for _am_tool in $_am_tools |
1705 | 1750 | do |
1706 | 1751 | case $_am_tool in |
0 | # Makefile.in generated by automake 1.11.5 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.12.2 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | |
4 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software | |
5 | # Foundation, Inc. | |
3 | # Copyright (C) 1994-2012 Free Software Foundation, Inc. | |
4 | ||
6 | 5 | # This Makefile.in is free software; the Free Software Foundation |
7 | 6 | # gives unlimited permission to copy and/or distribute it, |
8 | 7 | # with or without modifications, as long as this notice is preserved. |
59 | 58 | CONFIG_HEADER = $(top_builddir)/config.h |
60 | 59 | CONFIG_CLEAN_FILES = |
61 | 60 | CONFIG_CLEAN_VPATH_FILES = |
61 | AM_V_P = $(am__v_P_@AM_V@) | |
62 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) | |
63 | am__v_P_0 = false | |
64 | am__v_P_1 = : | |
62 | 65 | AM_V_GEN = $(am__v_GEN_@AM_V@) |
63 | 66 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) |
64 | am__v_GEN_0 = @echo " GEN " $@; | |
67 | am__v_GEN_0 = @echo " GEN " $@; | |
68 | am__v_GEN_1 = | |
65 | 69 | AM_V_at = $(am__v_at_@AM_V@) |
66 | 70 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) |
67 | 71 | am__v_at_0 = @ |
72 | am__v_at_1 = | |
68 | 73 | SOURCES = |
69 | 74 | DIST_SOURCES = |
70 | 75 | am__can_run_installinfo = \ |
277 | 282 | ctags: CTAGS |
278 | 283 | CTAGS: |
279 | 284 | |
285 | cscope cscopelist: | |
286 | ||
280 | 287 | |
281 | 288 | distdir: $(DISTFILES) |
282 | 289 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ |
2 | 2 | |
3 | 3 | scriptversion=2012-03-05.13; # UTC |
4 | 4 | |
5 | # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free | |
6 | # Software Foundation, Inc. | |
5 | # Copyright (C) 1999-2012 Free Software Foundation, Inc. | |
7 | 6 | # Written by Tom Tromey <tromey@cygnus.com>. |
8 | 7 | # |
9 | 8 | # This program is free software; you can redistribute it and/or modify |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for realmd 0.5. | |
2 | # Generated by GNU Autoconf 2.69 for realmd 0.6. | |
3 | 3 | # |
4 | 4 | # Report bugs to <http://bugs.freedesktop.org/enter_bug.cgi?product=realmd>. |
5 | 5 | # |
580 | 580 | # Identity of this package. |
581 | 581 | PACKAGE_NAME='realmd' |
582 | 582 | PACKAGE_TARNAME='realmd' |
583 | PACKAGE_VERSION='0.5' | |
584 | PACKAGE_STRING='realmd 0.5' | |
583 | PACKAGE_VERSION='0.6' | |
584 | PACKAGE_STRING='realmd 0.6' | |
585 | 585 | PACKAGE_BUGREPORT='http://bugs.freedesktop.org/enter_bug.cgi?product=realmd' |
586 | 586 | PACKAGE_URL='' |
587 | 587 | |
1359 | 1359 | # Omit some internal or obsolete options to make the list less imposing. |
1360 | 1360 | # This message is too long to be a string in the A/UX 3.1 sh. |
1361 | 1361 | cat <<_ACEOF |
1362 | \`configure' configures realmd 0.5 to adapt to many kinds of systems. | |
1362 | \`configure' configures realmd 0.6 to adapt to many kinds of systems. | |
1363 | 1363 | |
1364 | 1364 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1365 | 1365 | |
1425 | 1425 | |
1426 | 1426 | if test -n "$ac_init_help"; then |
1427 | 1427 | case $ac_init_help in |
1428 | short | recursive ) echo "Configuration of realmd 0.5:";; | |
1428 | short | recursive ) echo "Configuration of realmd 0.6:";; | |
1429 | 1429 | esac |
1430 | 1430 | cat <<\_ACEOF |
1431 | 1431 | |
1433 | 1433 | --disable-option-checking ignore unrecognized --enable/--with options |
1434 | 1434 | --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) |
1435 | 1435 | --enable-FEATURE[=ARG] include FEATURE [ARG=yes] |
1436 | --enable-silent-rules less verbose build output (undo: `make V=1') | |
1437 | --disable-silent-rules verbose build output (undo: `make V=0') | |
1438 | --disable-maintainer-mode disable make rules and dependencies not useful | |
1439 | (and sometimes confusing) to the casual installer | |
1440 | --disable-dependency-tracking speeds up one-time build | |
1441 | --enable-dependency-tracking do not reject slow dependency extractors | |
1436 | --enable-silent-rules less verbose build output (undo: "make V=1") | |
1437 | --disable-silent-rules verbose build output (undo: "make V=0") | |
1438 | --disable-maintainer-mode | |
1439 | disable make rules and dependencies not useful (and | |
1440 | sometimes confusing) to the casual installer | |
1441 | --enable-dependency-tracking | |
1442 | do not reject slow dependency extractors | |
1443 | --disable-dependency-tracking | |
1444 | speeds up one-time build | |
1442 | 1445 | --disable-nls do not use Native Language Support |
1443 | 1446 | --enable-debug=no/default/yes |
1444 | 1447 | Turn on or off debugging |
1545 | 1548 | test -n "$ac_init_help" && exit $ac_status |
1546 | 1549 | if $ac_init_version; then |
1547 | 1550 | cat <<\_ACEOF |
1548 | realmd configure 0.5 | |
1551 | realmd configure 0.6 | |
1549 | 1552 | generated by GNU Autoconf 2.69 |
1550 | 1553 | |
1551 | 1554 | Copyright (C) 2012 Free Software Foundation, Inc. |
1914 | 1917 | This file contains any messages produced by compilers while |
1915 | 1918 | running configure, to aid debugging if configure makes a mistake. |
1916 | 1919 | |
1917 | It was created by realmd $as_me 0.5, which was | |
1920 | It was created by realmd $as_me 0.6, which was | |
1918 | 1921 | generated by GNU Autoconf 2.69. Invocation command line was |
1919 | 1922 | |
1920 | 1923 | $ $0 $@ |
2266 | 2269 | # ----------------------------------------------------------------------------- |
2267 | 2270 | |
2268 | 2271 | |
2269 | am__api_version='1.11' | |
2272 | am__api_version='1.12' | |
2270 | 2273 | |
2271 | 2274 | ac_aux_dir= |
2272 | 2275 | for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do |
2392 | 2395 | |
2393 | 2396 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 |
2394 | 2397 | $as_echo_n "checking whether build environment is sane... " >&6; } |
2395 | # Just in case | |
2396 | sleep 1 | |
2397 | echo timestamp > conftest.file | |
2398 | 2398 | # Reject unsafe characters in $srcdir or the absolute working directory |
2399 | 2399 | # name. Accept space and tab only in the latter. |
2400 | 2400 | am_lf=' |
2405 | 2405 | esac |
2406 | 2406 | case $srcdir in |
2407 | 2407 | *[\\\"\#\$\&\'\`$am_lf\ \ ]*) |
2408 | as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; | |
2408 | as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; | |
2409 | 2409 | esac |
2410 | 2410 | |
2411 | # Do `set' in a subshell so we don't clobber the current shell's | |
2411 | # Do 'set' in a subshell so we don't clobber the current shell's | |
2412 | 2412 | # arguments. Must try -L first in case configure is actually a |
2413 | 2413 | # symlink; some systems play weird games with the mod time of symlinks |
2414 | 2414 | # (eg FreeBSD returns the mod time of the symlink's containing |
2415 | 2415 | # directory). |
2416 | 2416 | if ( |
2417 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` | |
2418 | if test "$*" = "X"; then | |
2419 | # -L didn't work. | |
2420 | set X `ls -t "$srcdir/configure" conftest.file` | |
2421 | fi | |
2422 | rm -f conftest.file | |
2423 | if test "$*" != "X $srcdir/configure conftest.file" \ | |
2424 | && test "$*" != "X conftest.file $srcdir/configure"; then | |
2425 | ||
2426 | # If neither matched, then we have a broken ls. This can happen | |
2427 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
2428 | # broken ls alias from the environment. This has actually | |
2429 | # happened. Such a system could not be considered "sane". | |
2430 | as_fn_error $? "ls -t appears to fail. Make sure there is not a broken | |
2431 | alias in your environment" "$LINENO" 5 | |
2432 | fi | |
2433 | ||
2417 | am_has_slept=no | |
2418 | for am_try in 1 2; do | |
2419 | echo "timestamp, slept: $am_has_slept" > conftest.file | |
2420 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` | |
2421 | if test "$*" = "X"; then | |
2422 | # -L didn't work. | |
2423 | set X `ls -t "$srcdir/configure" conftest.file` | |
2424 | fi | |
2425 | if test "$*" != "X $srcdir/configure conftest.file" \ | |
2426 | && test "$*" != "X conftest.file $srcdir/configure"; then | |
2427 | ||
2428 | # If neither matched, then we have a broken ls. This can happen | |
2429 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
2430 | # broken ls alias from the environment. This has actually | |
2431 | # happened. Such a system could not be considered "sane". | |
2432 | as_fn_error $? "ls -t appears to fail. Make sure there is not a broken | |
2433 | alias in your environment" "$LINENO" 5 | |
2434 | fi | |
2435 | if test "$2" = conftest.file || test $am_try -eq 2; then | |
2436 | break | |
2437 | fi | |
2438 | # Just in case. | |
2439 | sleep 1 | |
2440 | am_has_slept=yes | |
2441 | done | |
2434 | 2442 | test "$2" = conftest.file |
2435 | 2443 | ) |
2436 | 2444 | then |
2442 | 2450 | fi |
2443 | 2451 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
2444 | 2452 | $as_echo "yes" >&6; } |
2453 | # If we didn't sleep, we still need to ensure time stamps of config.status and | |
2454 | # generated files are strictly newer. | |
2455 | am_sleep_pid= | |
2456 | if grep 'slept: no' conftest.file >/dev/null 2>&1; then | |
2457 | ( sleep 1 ) & | |
2458 | am_sleep_pid=$! | |
2459 | fi | |
2460 | ||
2461 | rm -f conftest.file | |
2462 | ||
2445 | 2463 | test "$program_prefix" != NONE && |
2446 | 2464 | program_transform_name="s&^&$program_prefix&;$program_transform_name" |
2447 | 2465 | # Use a double $ so make ignores it. |
2468 | 2486 | am_missing_run="$MISSING --run " |
2469 | 2487 | else |
2470 | 2488 | am_missing_run= |
2471 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 | |
2472 | $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} | |
2489 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 | |
2490 | $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} | |
2473 | 2491 | fi |
2474 | 2492 | |
2475 | 2493 | if test x"${install_sh}" != xset; then |
2481 | 2499 | esac |
2482 | 2500 | fi |
2483 | 2501 | |
2484 | # Installed binaries are usually stripped using `strip' when the user | |
2485 | # run `make install-strip'. However `strip' might not be the right | |
2502 | # Installed binaries are usually stripped using 'strip' when the user | |
2503 | # run "make install-strip". However 'strip' might not be the right | |
2486 | 2504 | # tool to use in cross-compilation environments, therefore Automake |
2487 | # will honor the `STRIP' environment variable to overrule this program. | |
2505 | # will honor the 'STRIP' environment variable to overrule this program. | |
2488 | 2506 | if test "$cross_compiling" != no; then |
2489 | 2507 | if test -n "$ac_tool_prefix"; then |
2490 | 2508 | # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. |
2623 | 2641 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 |
2624 | 2642 | $as_echo "$MKDIR_P" >&6; } |
2625 | 2643 | |
2626 | mkdir_p="$MKDIR_P" | |
2627 | case $mkdir_p in | |
2628 | [\\/$]* | ?:[\\/]*) ;; | |
2629 | */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; | |
2630 | esac | |
2631 | ||
2632 | 2644 | for ac_prog in gawk mawk nawk awk |
2633 | 2645 | do |
2634 | 2646 | # Extract the first word of "$ac_prog", so it can be a program name with args. |
2733 | 2745 | |
2734 | 2746 | # Define the identity of the package. |
2735 | 2747 | PACKAGE='realmd' |
2736 | VERSION='0.5' | |
2748 | VERSION='0.6' | |
2737 | 2749 | |
2738 | 2750 | |
2739 | 2751 | cat >>confdefs.h <<_ACEOF |
2760 | 2772 | |
2761 | 2773 | |
2762 | 2774 | MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} |
2775 | ||
2776 | # For better backward compatibility. To be removed once Automake 1.9.x | |
2777 | # dies out for good. For more background, see: | |
2778 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> | |
2779 | # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> | |
2780 | mkdir_p='$(MKDIR_P)' | |
2763 | 2781 | |
2764 | 2782 | # We need awk for the "check" target. The system "awk" is bad on |
2765 | 2783 | # some platforms. |
2774 | 2792 | _am_tools='gnutar plaintar pax cpio none' |
2775 | 2793 | _am_tools=${am_cv_prog_tar_ustar-$_am_tools} |
2776 | 2794 | # Do not fold the above two line into one, because Tru64 sh and |
2777 | # Solaris sh will not grok spaces in the rhs of `-'. | |
2795 | # Solaris sh will not grok spaces in the rhs of '-'. | |
2778 | 2796 | for _am_tool in $_am_tools |
2779 | 2797 | do |
2780 | 2798 | case $_am_tool in |
2856 | 2874 | |
2857 | 2875 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 |
2858 | 2876 | $as_echo_n "checking whether build environment is sane... " >&6; } |
2859 | # Just in case | |
2860 | sleep 1 | |
2861 | echo timestamp > conftest.file | |
2862 | 2877 | # Reject unsafe characters in $srcdir or the absolute working directory |
2863 | 2878 | # name. Accept space and tab only in the latter. |
2864 | 2879 | am_lf=' |
2869 | 2884 | esac |
2870 | 2885 | case $srcdir in |
2871 | 2886 | *[\\\"\#\$\&\'\`$am_lf\ \ ]*) |
2872 | as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; | |
2887 | as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; | |
2873 | 2888 | esac |
2874 | 2889 | |
2875 | # Do `set' in a subshell so we don't clobber the current shell's | |
2890 | # Do 'set' in a subshell so we don't clobber the current shell's | |
2876 | 2891 | # arguments. Must try -L first in case configure is actually a |
2877 | 2892 | # symlink; some systems play weird games with the mod time of symlinks |
2878 | 2893 | # (eg FreeBSD returns the mod time of the symlink's containing |
2879 | 2894 | # directory). |
2880 | 2895 | if ( |
2881 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` | |
2882 | if test "$*" = "X"; then | |
2883 | # -L didn't work. | |
2884 | set X `ls -t "$srcdir/configure" conftest.file` | |
2885 | fi | |
2886 | rm -f conftest.file | |
2887 | if test "$*" != "X $srcdir/configure conftest.file" \ | |
2888 | && test "$*" != "X conftest.file $srcdir/configure"; then | |
2889 | ||
2890 | # If neither matched, then we have a broken ls. This can happen | |
2891 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
2892 | # broken ls alias from the environment. This has actually | |
2893 | # happened. Such a system could not be considered "sane". | |
2894 | as_fn_error $? "ls -t appears to fail. Make sure there is not a broken | |
2895 | alias in your environment" "$LINENO" 5 | |
2896 | fi | |
2897 | ||
2896 | am_has_slept=no | |
2897 | for am_try in 1 2; do | |
2898 | echo "timestamp, slept: $am_has_slept" > conftest.file | |
2899 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` | |
2900 | if test "$*" = "X"; then | |
2901 | # -L didn't work. | |
2902 | set X `ls -t "$srcdir/configure" conftest.file` | |
2903 | fi | |
2904 | if test "$*" != "X $srcdir/configure conftest.file" \ | |
2905 | && test "$*" != "X conftest.file $srcdir/configure"; then | |
2906 | ||
2907 | # If neither matched, then we have a broken ls. This can happen | |
2908 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
2909 | # broken ls alias from the environment. This has actually | |
2910 | # happened. Such a system could not be considered "sane". | |
2911 | as_fn_error $? "ls -t appears to fail. Make sure there is not a broken | |
2912 | alias in your environment" "$LINENO" 5 | |
2913 | fi | |
2914 | if test "$2" = conftest.file || test $am_try -eq 2; then | |
2915 | break | |
2916 | fi | |
2917 | # Just in case. | |
2918 | sleep 1 | |
2919 | am_has_slept=yes | |
2920 | done | |
2898 | 2921 | test "$2" = conftest.file |
2899 | 2922 | ) |
2900 | 2923 | then |
2906 | 2929 | fi |
2907 | 2930 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
2908 | 2931 | $as_echo "yes" >&6; } |
2932 | # If we didn't sleep, we still need to ensure time stamps of config.status and | |
2933 | # generated files are strictly newer. | |
2934 | am_sleep_pid= | |
2935 | if grep 'slept: no' conftest.file >/dev/null 2>&1; then | |
2936 | ( sleep 1 ) & | |
2937 | am_sleep_pid=$! | |
2938 | fi | |
2939 | ||
2940 | rm -f conftest.file | |
2941 | ||
2909 | 2942 | ac_config_headers="$ac_config_headers config.h" |
2910 | 2943 | |
2911 | 2944 | |
2914 | 2947 | enableval=$enable_silent_rules; |
2915 | 2948 | fi |
2916 | 2949 | |
2917 | case $enable_silent_rules in | |
2918 | yes) AM_DEFAULT_VERBOSITY=0;; | |
2919 | no) AM_DEFAULT_VERBOSITY=1;; | |
2920 | *) AM_DEFAULT_VERBOSITY=0;; | |
2950 | case $enable_silent_rules in # ((( | |
2951 | yes) AM_DEFAULT_VERBOSITY=0;; | |
2952 | no) AM_DEFAULT_VERBOSITY=1;; | |
2953 | *) AM_DEFAULT_VERBOSITY=0;; | |
2921 | 2954 | esac |
2922 | 2955 | am_make=${MAKE-make} |
2923 | 2956 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 |
3052 | 3085 | _am_result=none |
3053 | 3086 | # First try GNU make style include. |
3054 | 3087 | echo "include confinc" > confmf |
3055 | # Ignore all kinds of additional output from `make'. | |
3088 | # Ignore all kinds of additional output from 'make'. | |
3056 | 3089 | case `$am_make -s -f confmf 2> /dev/null` in #( |
3057 | 3090 | *the\ am__doit\ target*) |
3058 | 3091 | am__include=include |
3896 | 3929 | # We make a subdir and do the tests there. Otherwise we can end up |
3897 | 3930 | # making bogus files that we don't know about and never remove. For |
3898 | 3931 | # instance it was reported that on HP-UX the gcc test will end up |
3899 | # making a dummy file named `D' -- because `-MD' means `put the output | |
3900 | # in D'. | |
3932 | # making a dummy file named 'D' -- because '-MD' means "put the output | |
3933 | # in D". | |
3901 | 3934 | rm -rf conftest.dir |
3902 | 3935 | mkdir conftest.dir |
3903 | 3936 | # Copy depcomp to subdir because otherwise we won't find it if we're |
3932 | 3965 | : > sub/conftest.c |
3933 | 3966 | for i in 1 2 3 4 5 6; do |
3934 | 3967 | echo '#include "conftst'$i'.h"' >> sub/conftest.c |
3935 | # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with | |
3936 | # Solaris 8's {/usr,}/bin/sh. | |
3937 | touch sub/conftst$i.h | |
3968 | # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with | |
3969 | # Solaris 10 /bin/sh. | |
3970 | echo '/* dummy */' > sub/conftst$i.h | |
3938 | 3971 | done |
3939 | 3972 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf |
3940 | 3973 | |
3941 | # We check with `-c' and `-o' for the sake of the "dashmstdout" | |
3974 | # We check with '-c' and '-o' for the sake of the "dashmstdout" | |
3942 | 3975 | # mode. It turns out that the SunPro C++ compiler does not properly |
3943 | # handle `-M -o', and we need to detect this. Also, some Intel | |
3944 | # versions had trouble with output in subdirs | |
3976 | # handle '-M -o', and we need to detect this. Also, some Intel | |
3977 | # versions had trouble with output in subdirs. | |
3945 | 3978 | am__obj=sub/conftest.${OBJEXT-o} |
3946 | 3979 | am__minus_obj="-o $am__obj" |
3947 | 3980 | case $depmode in |
3950 | 3983 | test "$am__universal" = false || continue |
3951 | 3984 | ;; |
3952 | 3985 | nosideeffect) |
3953 | # after this tag, mechanisms are not by side-effect, so they'll | |
3954 | # only be used when explicitly requested | |
3986 | # After this tag, mechanisms are not by side-effect, so they'll | |
3987 | # only be used when explicitly requested. | |
3955 | 3988 | if test "x$enable_dependency_tracking" = xyes; then |
3956 | 3989 | continue |
3957 | 3990 | else |
3959 | 3992 | fi |
3960 | 3993 | ;; |
3961 | 3994 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
3962 | # This compiler won't grok `-c -o', but also, the minuso test has | |
3995 | # This compiler won't grok '-c -o', but also, the minuso test has | |
3963 | 3996 | # not run yet. These depmodes are late enough in the game, and |
3964 | 3997 | # so weak that their functioning should not be impacted. |
3965 | 3998 | am__obj=conftest.${OBJEXT-o} |
5079 | 5112 | # We make a subdir and do the tests there. Otherwise we can end up |
5080 | 5113 | # making bogus files that we don't know about and never remove. For |
5081 | 5114 | # instance it was reported that on HP-UX the gcc test will end up |
5082 | # making a dummy file named `D' -- because `-MD' means `put the output | |
5083 | # in D'. | |
5115 | # making a dummy file named 'D' -- because '-MD' means "put the output | |
5116 | # in D". | |
5084 | 5117 | rm -rf conftest.dir |
5085 | 5118 | mkdir conftest.dir |
5086 | 5119 | # Copy depcomp to subdir because otherwise we won't find it if we're |
5115 | 5148 | : > sub/conftest.c |
5116 | 5149 | for i in 1 2 3 4 5 6; do |
5117 | 5150 | echo '#include "conftst'$i'.h"' >> sub/conftest.c |
5118 | # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with | |
5119 | # Solaris 8's {/usr,}/bin/sh. | |
5120 | touch sub/conftst$i.h | |
5151 | # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with | |
5152 | # Solaris 10 /bin/sh. | |
5153 | echo '/* dummy */' > sub/conftst$i.h | |
5121 | 5154 | done |
5122 | 5155 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf |
5123 | 5156 | |
5124 | # We check with `-c' and `-o' for the sake of the "dashmstdout" | |
5157 | # We check with '-c' and '-o' for the sake of the "dashmstdout" | |
5125 | 5158 | # mode. It turns out that the SunPro C++ compiler does not properly |
5126 | # handle `-M -o', and we need to detect this. Also, some Intel | |
5127 | # versions had trouble with output in subdirs | |
5159 | # handle '-M -o', and we need to detect this. Also, some Intel | |
5160 | # versions had trouble with output in subdirs. | |
5128 | 5161 | am__obj=sub/conftest.${OBJEXT-o} |
5129 | 5162 | am__minus_obj="-o $am__obj" |
5130 | 5163 | case $depmode in |
5133 | 5166 | test "$am__universal" = false || continue |
5134 | 5167 | ;; |
5135 | 5168 | nosideeffect) |
5136 | # after this tag, mechanisms are not by side-effect, so they'll | |
5137 | # only be used when explicitly requested | |
5169 | # After this tag, mechanisms are not by side-effect, so they'll | |
5170 | # only be used when explicitly requested. | |
5138 | 5171 | if test "x$enable_dependency_tracking" = xyes; then |
5139 | 5172 | continue |
5140 | 5173 | else |
5142 | 5175 | fi |
5143 | 5176 | ;; |
5144 | 5177 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
5145 | # This compiler won't grok `-c -o', but also, the minuso test has | |
5178 | # This compiler won't grok '-c -o', but also, the minuso test has | |
5146 | 5179 | # not run yet. These depmodes are late enough in the game, and |
5147 | 5180 | # so weak that their functioning should not be impacted. |
5148 | 5181 | am__obj=conftest.${OBJEXT-o} |
7868 | 7901 | LTLIBOBJS=$ac_ltlibobjs |
7869 | 7902 | |
7870 | 7903 | |
7904 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 | |
7905 | $as_echo_n "checking that generated files are newer than configure... " >&6; } | |
7906 | if test -n "$am_sleep_pid"; then | |
7907 | # Hide warnings about reused PIDs. | |
7908 | wait $am_sleep_pid 2>/dev/null | |
7909 | fi | |
7910 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 | |
7911 | $as_echo "done" >&6; } | |
7871 | 7912 | if test -n "$EXEEXT"; then |
7872 | 7913 | am__EXEEXT_TRUE= |
7873 | 7914 | am__EXEEXT_FALSE='#' |
7876 | 7917 | am__EXEEXT_FALSE= |
7877 | 7918 | fi |
7878 | 7919 | |
7920 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 | |
7921 | $as_echo_n "checking that generated files are newer than configure... " >&6; } | |
7922 | if test -n "$am_sleep_pid"; then | |
7923 | # Hide warnings about reused PIDs. | |
7924 | wait $am_sleep_pid 2>/dev/null | |
7925 | fi | |
7926 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 | |
7927 | $as_echo "done" >&6; } | |
7879 | 7928 | if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then |
7880 | 7929 | as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. |
7881 | 7930 | Usually this means the macro was only invoked conditionally." "$LINENO" 5 |
8297 | 8346 | # report actual input values of CONFIG_FILES etc. instead of their |
8298 | 8347 | # values after options handling. |
8299 | 8348 | ac_log=" |
8300 | This file was extended by realmd $as_me 0.5, which was | |
8349 | This file was extended by realmd $as_me 0.6, which was | |
8301 | 8350 | generated by GNU Autoconf 2.69. Invocation command line was |
8302 | 8351 | |
8303 | 8352 | CONFIG_FILES = $CONFIG_FILES |
8363 | 8412 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
8364 | 8413 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
8365 | 8414 | ac_cs_version="\\ |
8366 | realmd config.status 0.5 | |
8415 | realmd config.status 0.6 | |
8367 | 8416 | configured by $0, generated by GNU Autoconf 2.69, |
8368 | 8417 | with options \\"\$ac_cs_config\\" |
8369 | 8418 | |
9114 | 9163 | # Strip MF so we end up with the name of the file. |
9115 | 9164 | mf=`echo "$mf" | sed -e 's/:.*$//'` |
9116 | 9165 | # Check whether this is an Automake generated Makefile or not. |
9117 | # We used to match only the files named `Makefile.in', but | |
9166 | # We used to match only the files named 'Makefile.in', but | |
9118 | 9167 | # some people rename them; so instead we look at the file content. |
9119 | 9168 | # Grep'ing the first line is not enough: some people post-process |
9120 | 9169 | # each Makefile.in and add a new line on top of each file to say so. |
9148 | 9197 | continue |
9149 | 9198 | fi |
9150 | 9199 | # Extract the definition of DEPDIR, am__include, and am__quote |
9151 | # from the Makefile without running `make'. | |
9200 | # from the Makefile without running 'make'. | |
9152 | 9201 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` |
9153 | 9202 | test -z "$DEPDIR" && continue |
9154 | 9203 | am__include=`sed -n 's/^am__include = //p' < "$mf"` |
9155 | 9204 | test -z "am__include" && continue |
9156 | 9205 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` |
9157 | # When using ansi2knr, U may be empty or an underscore; expand it | |
9158 | U=`sed -n 's/^U = //p' < "$mf"` | |
9159 | 9206 | # Find all dependency output files, they are included files with |
9160 | 9207 | # $(DEPDIR) in their names. We invoke sed twice because it is the |
9161 | 9208 | # simplest approach to changing $(DEPDIR) to its actual value in the |
9162 | 9209 | # expansion. |
9163 | 9210 | for file in `sed -n " |
9164 | 9211 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ |
9165 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do | |
9212 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do | |
9166 | 9213 | # Make sure the directory exists. |
9167 | 9214 | test -f "$dirpart/$file" && continue |
9168 | 9215 | fdir=`$as_dirname -- "$file" || |
0 | 0 | AC_PREREQ(2.63) |
1 | 1 | |
2 | AC_INIT([realmd], [0.5], | |
2 | AC_INIT([realmd], [0.6], | |
3 | 3 | [http://bugs.freedesktop.org/enter_bug.cgi?product=realmd], |
4 | 4 | [realmd]) |
5 | 5 |
3 | 3 | dbusservice_DATA = \ |
4 | 4 | org.freedesktop.realmd.conf |
5 | 5 | |
6 | providerdir = $(privatedir)/provider.d | |
7 | provider_DATA = \ | |
8 | org.freedesktop.realmd.Samba.provider \ | |
9 | org.freedesktop.realmd.SssdAd.provider \ | |
10 | org.freedesktop.realmd.SssdIpa.provider | |
11 | ||
12 | 6 | servicedir = $(DBUS_SERVICES_DIR) |
13 | 7 | service_in_files = \ |
14 | 8 | org.freedesktop.realmd.service.in \ |
15 | 9 | org.freedesktop.realmd.Samba.service.in \ |
16 | org.freedesktop.realmd.SssdAd.service.in | |
10 | org.freedesktop.realmd.SssdAd.service.in \ | |
11 | org.freedesktop.realmd.SssdIpa.service.in | |
17 | 12 | service_DATA = $(service_in_files:.service.in=.service) |
18 | 13 | |
19 | 14 | noinst_LIBRARIES = \ |
0 | # Makefile.in generated by automake 1.11.5 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.12.2 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | |
4 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software | |
5 | # Foundation, Inc. | |
3 | # Copyright (C) 1994-2012 Free Software Foundation, Inc. | |
4 | ||
6 | 5 | # This Makefile.in is free software; the Free Software Foundation |
7 | 6 | # gives unlimited permission to copy and/or distribute it, |
8 | 7 | # with or without modifications, as long as this notice is preserved. |
50 | 49 | PRE_UNINSTALL = : |
51 | 50 | POST_UNINSTALL = : |
52 | 51 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ |
53 | $(top_srcdir)/Makefile.decl | |
52 | $(top_srcdir)/Makefile.decl $(top_srcdir)/depcomp | |
54 | 53 | subdir = dbus |
55 | 54 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
56 | 55 | am__aclocal_m4_deps = $(top_srcdir)/build/m4/intltool.m4 \ |
66 | 65 | ARFLAGS = cru |
67 | 66 | AM_V_AR = $(am__v_AR_@AM_V@) |
68 | 67 | am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) |
69 | am__v_AR_0 = @echo " AR " $@; | |
70 | AM_V_at = $(am__v_at_@AM_V@) | |
71 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | |
72 | am__v_at_0 = @ | |
68 | am__v_AR_0 = @echo " AR " $@; | |
69 | am__v_AR_1 = | |
73 | 70 | librealm_dbus_a_AR = $(AR) $(ARFLAGS) |
74 | 71 | librealm_dbus_a_LIBADD = |
75 | 72 | am__objects_1 = |
78 | 75 | nodist_librealm_dbus_a_OBJECTS = $(am__objects_2) $(am__objects_1) |
79 | 76 | librealm_dbus_a_OBJECTS = $(am_librealm_dbus_a_OBJECTS) \ |
80 | 77 | $(nodist_librealm_dbus_a_OBJECTS) |
78 | AM_V_P = $(am__v_P_@AM_V@) | |
79 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) | |
80 | am__v_P_0 = false | |
81 | am__v_P_1 = : | |
82 | AM_V_GEN = $(am__v_GEN_@AM_V@) | |
83 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | |
84 | am__v_GEN_0 = @echo " GEN " $@; | |
85 | am__v_GEN_1 = | |
86 | AM_V_at = $(am__v_at_@AM_V@) | |
87 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | |
88 | am__v_at_0 = @ | |
89 | am__v_at_1 = | |
81 | 90 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) |
82 | 91 | depcomp = $(SHELL) $(top_srcdir)/depcomp |
83 | 92 | am__depfiles_maybe = depfiles |
85 | 94 | AM_V_lt = $(am__v_lt_@AM_V@) |
86 | 95 | am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) |
87 | 96 | am__v_lt_0 = --silent |
97 | am__v_lt_1 = | |
88 | 98 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
89 | 99 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
90 | 100 | AM_V_CC = $(am__v_CC_@AM_V@) |
91 | 101 | am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) |
92 | am__v_CC_0 = @echo " CC " $@; | |
102 | am__v_CC_0 = @echo " CC " $@; | |
103 | am__v_CC_1 = | |
93 | 104 | CCLD = $(CC) |
94 | 105 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ |
95 | 106 | AM_V_CCLD = $(am__v_CCLD_@AM_V@) |
96 | 107 | am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) |
97 | am__v_CCLD_0 = @echo " CCLD " $@; | |
98 | AM_V_GEN = $(am__v_GEN_@AM_V@) | |
99 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | |
100 | am__v_GEN_0 = @echo " GEN " $@; | |
108 | am__v_CCLD_0 = @echo " CCLD " $@; | |
109 | am__v_CCLD_1 = | |
101 | 110 | SOURCES = $(librealm_dbus_a_SOURCES) $(nodist_librealm_dbus_a_SOURCES) |
102 | 111 | DIST_SOURCES = $(librealm_dbus_a_SOURCES) |
103 | 112 | am__can_run_installinfo = \ |
133 | 142 | $(am__cd) "$$dir" && rm -f $$files; }; \ |
134 | 143 | } |
135 | 144 | am__installdirs = "$(DESTDIR)$(dbusservicedir)" \ |
136 | "$(DESTDIR)$(providerdir)" "$(DESTDIR)$(servicedir)" | |
137 | DATA = $(dbusservice_DATA) $(provider_DATA) $(service_DATA) | |
145 | "$(DESTDIR)$(servicedir)" | |
146 | DATA = $(dbusservice_DATA) $(service_DATA) | |
138 | 147 | ETAGS = etags |
139 | 148 | CTAGS = ctags |
140 | 149 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
305 | 314 | dbusservice_DATA = \ |
306 | 315 | org.freedesktop.realmd.conf |
307 | 316 | |
308 | providerdir = $(privatedir)/provider.d | |
309 | provider_DATA = \ | |
310 | org.freedesktop.realmd.Samba.provider \ | |
311 | org.freedesktop.realmd.SssdAd.provider \ | |
312 | org.freedesktop.realmd.SssdIpa.provider | |
313 | ||
314 | 317 | servicedir = $(DBUS_SERVICES_DIR) |
315 | 318 | service_in_files = \ |
316 | 319 | org.freedesktop.realmd.service.in \ |
317 | 320 | org.freedesktop.realmd.Samba.service.in \ |
318 | org.freedesktop.realmd.SssdAd.service.in | |
321 | org.freedesktop.realmd.SssdAd.service.in \ | |
322 | org.freedesktop.realmd.SssdIpa.service.in | |
319 | 323 | |
320 | 324 | service_DATA = $(service_in_files:.service.in=.service) |
321 | 325 | noinst_LIBRARIES = \ |
458 | 462 | @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ |
459 | 463 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ |
460 | 464 | dir='$(DESTDIR)$(dbusservicedir)'; $(am__uninstall_files_from_dir) |
461 | install-providerDATA: $(provider_DATA) | |
462 | @$(NORMAL_INSTALL) | |
463 | @list='$(provider_DATA)'; test -n "$(providerdir)" || list=; \ | |
464 | if test -n "$$list"; then \ | |
465 | echo " $(MKDIR_P) '$(DESTDIR)$(providerdir)'"; \ | |
466 | $(MKDIR_P) "$(DESTDIR)$(providerdir)" || exit 1; \ | |
467 | fi; \ | |
468 | for p in $$list; do \ | |
469 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | |
470 | echo "$$d$$p"; \ | |
471 | done | $(am__base_list) | \ | |
472 | while read files; do \ | |
473 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(providerdir)'"; \ | |
474 | $(INSTALL_DATA) $$files "$(DESTDIR)$(providerdir)" || exit $$?; \ | |
475 | done | |
476 | ||
477 | uninstall-providerDATA: | |
478 | @$(NORMAL_UNINSTALL) | |
479 | @list='$(provider_DATA)'; test -n "$(providerdir)" || list=; \ | |
480 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ | |
481 | dir='$(DESTDIR)$(providerdir)'; $(am__uninstall_files_from_dir) | |
482 | 465 | install-serviceDATA: $(service_DATA) |
483 | 466 | @$(NORMAL_INSTALL) |
484 | 467 | @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ |
549 | 532 | here=`$(am__cd) $(top_builddir) && pwd` \ |
550 | 533 | && $(am__cd) $(top_srcdir) \ |
551 | 534 | && gtags -i $(GTAGS_ARGS) "$$here" |
535 | ||
536 | cscopelist: $(HEADERS) $(SOURCES) $(LISP) | |
537 | list='$(SOURCES) $(HEADERS) $(LISP)'; \ | |
538 | case "$(srcdir)" in \ | |
539 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ | |
540 | *) sdir=$(subdir)/$(srcdir) ;; \ | |
541 | esac; \ | |
542 | for i in $$list; do \ | |
543 | if test -f "$$i"; then \ | |
544 | echo "$(subdir)/$$i"; \ | |
545 | else \ | |
546 | echo "$$sdir/$$i"; \ | |
547 | fi; \ | |
548 | done >> $(top_builddir)/cscope.files | |
552 | 549 | |
553 | 550 | distclean-tags: |
554 | 551 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags |
588 | 585 | $(MAKE) $(AM_MAKEFLAGS) check-am |
589 | 586 | all-am: Makefile $(LIBRARIES) $(DATA) |
590 | 587 | installdirs: |
591 | for dir in "$(DESTDIR)$(dbusservicedir)" "$(DESTDIR)$(providerdir)" "$(DESTDIR)$(servicedir)"; do \ | |
588 | for dir in "$(DESTDIR)$(dbusservicedir)" "$(DESTDIR)$(servicedir)"; do \ | |
592 | 589 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ |
593 | 590 | done |
594 | 591 | install: $(BUILT_SOURCES) |
647 | 644 | |
648 | 645 | info-am: |
649 | 646 | |
650 | install-data-am: install-dbusserviceDATA install-providerDATA \ | |
651 | install-serviceDATA | |
647 | install-data-am: install-dbusserviceDATA install-serviceDATA | |
652 | 648 | |
653 | 649 | install-dvi: install-dvi-am |
654 | 650 | |
693 | 689 | |
694 | 690 | ps-am: |
695 | 691 | |
696 | uninstall-am: uninstall-dbusserviceDATA uninstall-providerDATA \ | |
697 | uninstall-serviceDATA | |
692 | uninstall-am: uninstall-dbusserviceDATA uninstall-serviceDATA | |
698 | 693 | |
699 | 694 | .MAKE: all check install install-am install-strip |
700 | 695 | |
701 | 696 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ |
702 | clean-noinstLIBRARIES ctags distclean distclean-compile \ | |
703 | distclean-generic distclean-tags distdir dvi dvi-am html \ | |
704 | html-am info info-am install install-am install-data \ | |
705 | install-data-am install-dbusserviceDATA install-dvi \ | |
706 | install-dvi-am install-exec install-exec-am install-html \ | |
707 | install-html-am install-info install-info-am install-man \ | |
708 | install-pdf install-pdf-am install-providerDATA install-ps \ | |
697 | clean-noinstLIBRARIES cscopelist ctags distclean \ | |
698 | distclean-compile distclean-generic distclean-tags distdir dvi \ | |
699 | dvi-am html html-am info info-am install install-am \ | |
700 | install-data install-data-am install-dbusserviceDATA \ | |
701 | install-dvi install-dvi-am install-exec install-exec-am \ | |
702 | install-html install-html-am install-info install-info-am \ | |
703 | install-man install-pdf install-pdf-am install-ps \ | |
709 | 704 | install-ps-am install-serviceDATA install-strip installcheck \ |
710 | 705 | installcheck-am installdirs maintainer-clean \ |
711 | 706 | maintainer-clean-generic mostlyclean mostlyclean-compile \ |
712 | 707 | mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ |
713 | uninstall-am uninstall-dbusserviceDATA uninstall-providerDATA \ | |
714 | uninstall-serviceDATA | |
708 | uninstall-am uninstall-dbusserviceDATA uninstall-serviceDATA | |
715 | 709 | |
716 | 710 | |
717 | 711 | perform-memcheck: $(TEST_PROGS) $(TEST_SUPPRESSIONS) |
0 | [provider] | |
1 | name = org.freedesktop.realmd.Samba | |
2 | type = org.freedesktop.realmd.Kerberos | |
3 | path = /org/freedesktop/realmd/Samba |
0 | 0 | [D-BUS Service] |
1 | Name=org.freedesktop.realmd.SssdAd | |
1 | Name=org.freedesktop.realmd.Samba | |
2 | 2 | Exec=@privatedir@/realmd |
3 | 3 | User=root |
0 | [provider] | |
1 | name = org.freedesktop.realmd.SssdAd | |
2 | type = org.freedesktop.realmd.Kerberos | |
3 | path = /org/freedesktop/realmd/SssdAd |
0 | 0 | [D-BUS Service] |
1 | Name=org.freedesktop.realmd.Samba | |
1 | Name=org.freedesktop.realmd.SssdAd | |
2 | 2 | Exec=@privatedir@/realmd |
3 | 3 | User=root |
0 | [provider] | |
1 | name = org.freedesktop.realmd.SssdIpa | |
2 | type = org.freedesktop.realmd.Kerberos | |
3 | path = /org/freedesktop/realmd/SssdIpa |
24 | 24 | <!-- |
25 | 25 | * A list of known, enrolled or discovered realms. |
26 | 26 | * Each realm is a DBus object and is represeted by a: |
27 | * s: DBus bus name of the realm | |
28 | 27 | * o: DBus object path of the realm |
29 | 28 | * s: DBus interface name, like 'ofr.Kerberos' (below) |
30 | 29 | --> |
31 | <property name="Realms" type="a(sos)" access="read"/> | |
30 | <property name="Realms" type="a(os)" access="read"/> | |
32 | 31 | |
33 | 32 | <!-- |
34 | 33 | * Discover whether a string represents a realm that a provider |
37 | 36 | <method name="Discover"> |
38 | 37 | <!-- The input string --> |
39 | 38 | <arg name="string" type="s" direction="in"/> |
40 | ||
41 | <arg name="operation_id" type="s" direction="in"/> | |
39 | <arg name="options" type="a{sv}" direction="in"/> | |
42 | 40 | |
43 | 41 | <!-- Returned match relevance --> |
44 | 42 | <arg name="relevance" type="i" direction="out"/> |
45 | 43 | |
46 | 44 | <!-- The realm objects: bus name, object path, interface --> |
47 | <arg name="realm" type="a(sos)" direction="out"/> | |
45 | <arg name="realm" type="a(os)" direction="out"/> | |
48 | 46 | </method> |
49 | 47 | </interface> |
50 | 48 | |
51 | <interface name="org.freedesktop.realmd.Daemon"> | |
52 | <!-- | |
53 | * Normally realmd waits until all clients have disconnected | |
54 | * before exiting. For long lived clients, they can call | |
55 | * Release() allow realmd to quit. | |
56 | --> | |
57 | <method name="ReleaseDaemon"> | |
49 | <interface name="org.freedesktop.realmd.Service"> | |
50 | <method name="Cancel"> | |
51 | <arg name="operation_id" type="s" direction="in"/> | |
58 | 52 | </method> |
59 | </interface> | |
60 | 53 | |
61 | <!-- | |
62 | * This interface is implemented by Providers and Realms to provide | |
63 | * additional information when an long running operation is happening | |
64 | * | |
65 | * In particular you can connect to the "Diagnostics" signal when | |
66 | * during an enroll or unenroll to get details. | |
67 | --> | |
68 | <interface name="org.freedesktop.realmd.Diagnostics"> | |
54 | <method name="SetLocale"> | |
55 | <arg name="locale" type="s" direction="in"/> | |
56 | </method> | |
57 | ||
69 | 58 | <signal name="Diagnostics"> |
70 | 59 | <arg name="data" type="s"/> |
71 | 60 | <arg name="operation_id" type="s"/> |
72 | 61 | </signal> |
62 | ||
63 | <!-- | |
64 | * Normally realmd waits until all clients have disconnected | |
65 | * before exiting. For long lived clients, they can call | |
66 | * Release() allow realmd to quit. This is an optimization. | |
67 | * The daemon will not exit immediately. It is safe to call | |
68 | * this multiple times. | |
69 | --> | |
70 | <method name="Release"> | |
71 | <!-- no arguments --> | |
72 | </method> | |
73 | 73 | </interface> |
74 | 74 | |
75 | 75 | <!-- |
103 | 103 | <property name="Enrolled" type="b" access="read"/> |
104 | 104 | |
105 | 105 | <!-- |
106 | * Enroll the machine in this realm using an administrative | |
107 | * account and a password. | |
106 | * Credentials: (ssv) | |
107 | * type: 'ccache', 'password', 'automatic' | |
108 | * who: 'administrator', 'user', 'computer', 'secret' | |
109 | * contents: ay, ss, b | |
108 | 110 | --> |
109 | <method name="EnrollWithPassword"> | |
110 | <arg name="principal" type="s" direction="in"/> | |
111 | <arg name="password" type="s" direction="in"/> | |
111 | <property name="SupportedEnrollCredentials" type="a(ss)" access="read"/> | |
112 | ||
113 | <property name="SupportedUnenrollCredentials" type="a(ss)" access="read"/> | |
114 | ||
115 | <method name="Enroll"> | |
116 | <arg name="credentials" type="(ssv)" direction="in"/> | |
112 | 117 | <arg name="options" type="a{sv}" direction="in"/> |
113 | <arg name="operation_id" type="s" direction="in"/> | |
114 | 118 | </method> |
115 | 119 | |
116 | <!-- | |
117 | * Enroll the machine in this realm using kerberos cached | |
118 | * administrative credentials. | |
119 | --> | |
120 | <method name="EnrollWithCredentialCache"> | |
121 | <!-- The contents of a kerberos cache file containing administrative credentials --> | |
122 | <arg name="kerberos_cache" type="ay" direction="in"> | |
123 | <annotation name="org.gtk.GDBus.C.ForceGVariant" value="yup"/> | |
124 | </arg> | |
120 | <method name="Unenroll"> | |
121 | <arg name="credentials" type="(ssv)" direction="in"/> | |
125 | 122 | <arg name="options" type="a{sv}" direction="in"/> |
126 | <arg name="operation_id" type="s" direction="in"/> | |
127 | </method> | |
128 | ||
129 | <!-- | |
130 | * Unenroll the machine from this realm using an administrative | |
131 | * account and a password. | |
132 | --> | |
133 | <method name="UnenrollWithPassword"> | |
134 | <arg name="principal" type="s" direction="in"/> | |
135 | <arg name="password" type="s" direction="in"/> | |
136 | <arg name="options" type="a{sv}" direction="in"/> | |
137 | <arg name="operation_id" type="s" direction="in"/> | |
138 | </method> | |
139 | ||
140 | <!-- | |
141 | * Unenroll the machine from this realm using a kerberos cached | |
142 | * administrative credentials. | |
143 | --> | |
144 | <method name="UnenrollWithCredentialCache"> | |
145 | <!-- The contents of a kerberos cache file containing administrative credentials --> | |
146 | <arg name="kerberos_cache" type="ay" direction="in"> | |
147 | <annotation name="org.gtk.GDBus.C.ForceGVariant" value="yup"/> | |
148 | </arg> | |
149 | <arg name="options" type="a{sv}" direction="in"/> | |
150 | <arg name="operation_id" type="s" direction="in"/> | |
151 | 123 | </method> |
152 | 124 | |
153 | 125 | <!-- |
177 | 149 | <arg name="login_policy" type="s" direction="in"/> |
178 | 150 | <arg name="permitted_add" type="as" direction="in"/> |
179 | 151 | <arg name="permitted_remove" type="as" direction="in"/> |
180 | <arg name="operation_id" type="s" direction="in"/> | |
152 | <arg name="options" type="a{sv}" direction="in"/> | |
181 | 153 | </method> |
182 | 154 | |
183 | 155 | </interface> |
20 | 20 | |
21 | 21 | G_BEGIN_DECLS |
22 | 22 | |
23 | #define REALM_DBUS_BUS_NAME "org.freedesktop.realmd" | |
24 | #define REALM_DBUS_SERVICE_PATH "/org/freedesktop/realmd" | |
25 | ||
23 | 26 | #define DBUS_PEER_INTERFACE "org.freedesktop.DBus.Peer" |
24 | 27 | #define DBUS_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties" |
25 | 28 | #define DBUS_INTROSPECTABLE_INTERFACE "org.freedesktop.DBus.Introspectable" |
26 | 29 | |
27 | 30 | #define REALM_DBUS_PROVIDER_INTERFACE "org.freedesktop.realmd.Provider" |
28 | 31 | #define REALM_DBUS_KERBEROS_REALM_INTERFACE "org.freedesktop.realmd.Kerberos" |
29 | #define REALM_DBUS_DIAGNOSTICS_INTERFACE "org.freedesktop.realmd.Diagnostics" | |
32 | #define REALM_DBUS_SERVICE_INTERFACE "org.freedesktop.realmd.Service" | |
30 | 33 | |
31 | 34 | #define REALM_DBUS_DIAGNOSTICS_SIGNAL "Diagnostics" |
32 | 35 |
2 | 2 | |
3 | 3 | scriptversion=2012-03-27.16; # UTC |
4 | 4 | |
5 | # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, | |
6 | # 2011, 2012 Free Software Foundation, Inc. | |
5 | # Copyright (C) 1999-2012 Free Software Foundation, Inc. | |
7 | 6 | |
8 | 7 | # This program is free software; you can redistribute it and/or modify |
9 | 8 | # it under the terms of the GNU General Public License as published by |
0 | 0 | #!/bin/sh |
1 | 1 | # install - install a program, script, or datafile |
2 | 2 | |
3 | scriptversion=2011-01-19.21; # UTC | |
3 | scriptversion=2011-11-20.07; # UTC | |
4 | 4 | |
5 | 5 | # This originates from X11R5 (mit/util/scripts/install.sh), which was |
6 | 6 | # later released in X11R6 (xc/config/util/install.sh) with the |
34 | 34 | # FSF changes to this file are in the public domain. |
35 | 35 | # |
36 | 36 | # Calling this script install-sh is preferred over install.sh, to prevent |
37 | # `make' implicit rules from creating a file called install from it | |
37 | # 'make' implicit rules from creating a file called install from it | |
38 | 38 | # when there is no Makefile. |
39 | 39 | # |
40 | 40 | # This script is compatible with the BSD install script, but was written |
155 | 155 | -s) stripcmd=$stripprog;; |
156 | 156 | |
157 | 157 | -t) dst_arg=$2 |
158 | # Protect names problematic for `test' and other utilities. | |
158 | # Protect names problematic for 'test' and other utilities. | |
159 | 159 | case $dst_arg in |
160 | 160 | -* | [=\(\)!]) dst_arg=./$dst_arg;; |
161 | 161 | esac |
189 | 189 | fi |
190 | 190 | shift # arg |
191 | 191 | dst_arg=$arg |
192 | # Protect names problematic for `test' and other utilities. | |
192 | # Protect names problematic for 'test' and other utilities. | |
193 | 193 | case $dst_arg in |
194 | 194 | -* | [=\(\)!]) dst_arg=./$dst_arg;; |
195 | 195 | esac |
201 | 201 | echo "$0: no input file specified." >&2 |
202 | 202 | exit 1 |
203 | 203 | fi |
204 | # It's OK to call `install-sh -d' without argument. | |
204 | # It's OK to call 'install-sh -d' without argument. | |
205 | 205 | # This can happen when creating conditional directories. |
206 | 206 | exit 0 |
207 | 207 | fi |
239 | 239 | |
240 | 240 | for src |
241 | 241 | do |
242 | # Protect names problematic for `test' and other utilities. | |
242 | # Protect names problematic for 'test' and other utilities. | |
243 | 243 | case $src in |
244 | 244 | -* | [=\(\)!]) src=./$src;; |
245 | 245 | esac |
353 | 353 | if test -z "$dir_arg" || { |
354 | 354 | # Check for POSIX incompatibilities with -m. |
355 | 355 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or |
356 | # other-writeable bit of parent directory when it shouldn't. | |
356 | # other-writable bit of parent directory when it shouldn't. | |
357 | 357 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. |
358 | 358 | ls_ld_tmpdir=`ls -ld "$tmpdir"` |
359 | 359 | case $ls_ld_tmpdir in |
0 | 0 | #! /bin/sh |
1 | 1 | # Common stub for a few missing GNU programs while installing. |
2 | 2 | |
3 | scriptversion=2012-01-06.13; # UTC | |
4 | ||
5 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, | |
6 | # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. | |
3 | scriptversion=2012-01-06.18; # UTC | |
4 | ||
5 | # Copyright (C) 1996-2012 Free Software Foundation, Inc. | |
7 | 6 | # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. |
8 | 7 | |
9 | 8 | # This program is free software; you can redistribute it and/or modify |
25 | 24 | # the same distribution terms that you use for the rest of that program. |
26 | 25 | |
27 | 26 | if test $# -eq 0; then |
28 | echo 1>&2 "Try \`$0 --help' for more information" | |
27 | echo 1>&2 "Try '$0 --help' for more information" | |
29 | 28 | exit 1 |
30 | 29 | fi |
31 | 30 | |
33 | 32 | sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' |
34 | 33 | sed_minuso='s/.* -o \([^ ]*\).*/\1/p' |
35 | 34 | |
36 | # In the cases where this matters, `missing' is being run in the | |
35 | # In the cases where this matters, 'missing' is being run in the | |
37 | 36 | # srcdir already. |
38 | 37 | if test -f configure.ac; then |
39 | 38 | configure_ac=configure.ac |
64 | 63 | echo "\ |
65 | 64 | $0 [OPTION]... PROGRAM [ARGUMENT]... |
66 | 65 | |
67 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an | |
66 | Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an | |
68 | 67 | error status if there is no known handling for PROGRAM. |
69 | 68 | |
70 | 69 | Options: |
73 | 72 | --run try to run the given command, and emulate it if it fails |
74 | 73 | |
75 | 74 | Supported PROGRAM values: |
76 | aclocal touch file \`aclocal.m4' | |
77 | autoconf touch file \`configure' | |
78 | autoheader touch file \`config.h.in' | |
75 | aclocal touch file 'aclocal.m4' | |
76 | autoconf touch file 'configure' | |
77 | autoheader touch file 'config.h.in' | |
79 | 78 | autom4te touch the output file, or create a stub one |
80 | automake touch all \`Makefile.in' files | |
81 | bison create \`y.tab.[ch]', if possible, from existing .[ch] | |
82 | flex create \`lex.yy.c', if possible, from existing .c | |
79 | automake touch all 'Makefile.in' files | |
80 | bison create 'y.tab.[ch]', if possible, from existing .[ch] | |
81 | flex create 'lex.yy.c', if possible, from existing .c | |
83 | 82 | help2man touch the output file |
84 | lex create \`lex.yy.c', if possible, from existing .c | |
83 | lex create 'lex.yy.c', if possible, from existing .c | |
85 | 84 | makeinfo touch the output file |
86 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] | |
87 | ||
88 | Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and | |
89 | \`g' are ignored when checking the name. | |
85 | yacc create 'y.tab.[ch]', if possible, from existing .[ch] | |
86 | ||
87 | Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and | |
88 | 'g' are ignored when checking the name. | |
90 | 89 | |
91 | 90 | Send bug reports to <bug-automake@gnu.org>." |
92 | 91 | exit $? |
98 | 97 | ;; |
99 | 98 | |
100 | 99 | -*) |
101 | echo 1>&2 "$0: Unknown \`$1' option" | |
102 | echo 1>&2 "Try \`$0 --help' for more information" | |
100 | echo 1>&2 "$0: Unknown '$1' option" | |
101 | echo 1>&2 "Try '$0 --help' for more information" | |
103 | 102 | exit 1 |
104 | 103 | ;; |
105 | 104 | |
126 | 125 | exit 1 |
127 | 126 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then |
128 | 127 | # Could not run --version or --help. This is probably someone |
129 | # running `$TOOL --version' or `$TOOL --help' to check whether | |
128 | # running '$TOOL --version' or '$TOOL --help' to check whether | |
130 | 129 | # $TOOL exists and not knowing $TOOL uses missing. |
131 | 130 | exit 1 |
132 | 131 | fi |
138 | 137 | case $program in |
139 | 138 | aclocal*) |
140 | 139 | echo 1>&2 "\ |
141 | WARNING: \`$1' is $msg. You should only need it if | |
142 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want | |
143 | to install the \`Automake' and \`Perl' packages. Grab them from | |
140 | WARNING: '$1' is $msg. You should only need it if | |
141 | you modified 'acinclude.m4' or '${configure_ac}'. You might want | |
142 | to install the Automake and Perl packages. Grab them from | |
144 | 143 | any GNU archive site." |
145 | 144 | touch aclocal.m4 |
146 | 145 | ;; |
147 | 146 | |
148 | 147 | autoconf*) |
149 | 148 | echo 1>&2 "\ |
150 | WARNING: \`$1' is $msg. You should only need it if | |
151 | you modified \`${configure_ac}'. You might want to install the | |
152 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU | |
149 | WARNING: '$1' is $msg. You should only need it if | |
150 | you modified '${configure_ac}'. You might want to install the | |
151 | Autoconf and GNU m4 packages. Grab them from any GNU | |
153 | 152 | archive site." |
154 | 153 | touch configure |
155 | 154 | ;; |
156 | 155 | |
157 | 156 | autoheader*) |
158 | 157 | echo 1>&2 "\ |
159 | WARNING: \`$1' is $msg. You should only need it if | |
160 | you modified \`acconfig.h' or \`${configure_ac}'. You might want | |
161 | to install the \`Autoconf' and \`GNU m4' packages. Grab them | |
158 | WARNING: '$1' is $msg. You should only need it if | |
159 | you modified 'acconfig.h' or '${configure_ac}'. You might want | |
160 | to install the Autoconf and GNU m4 packages. Grab them | |
162 | 161 | from any GNU archive site." |
163 | 162 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` |
164 | 163 | test -z "$files" && files="config.h" |
175 | 174 | |
176 | 175 | automake*) |
177 | 176 | echo 1>&2 "\ |
178 | WARNING: \`$1' is $msg. You should only need it if | |
179 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. | |
180 | You might want to install the \`Automake' and \`Perl' packages. | |
177 | WARNING: '$1' is $msg. You should only need it if | |
178 | you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'. | |
179 | You might want to install the Automake and Perl packages. | |
181 | 180 | Grab them from any GNU archive site." |
182 | 181 | find . -type f -name Makefile.am -print | |
183 | 182 | sed 's/\.am$/.in/' | |
186 | 185 | |
187 | 186 | autom4te*) |
188 | 187 | echo 1>&2 "\ |
189 | WARNING: \`$1' is needed, but is $msg. | |
188 | WARNING: '$1' is needed, but is $msg. | |
190 | 189 | You might have modified some files without having the |
191 | 190 | proper tools for further handling them. |
192 | You can get \`$1' as part of \`Autoconf' from any GNU | |
191 | You can get '$1' as part of Autoconf from any GNU | |
193 | 192 | archive site." |
194 | 193 | |
195 | 194 | file=`echo "$*" | sed -n "$sed_output"` |
209 | 208 | |
210 | 209 | bison*|yacc*) |
211 | 210 | echo 1>&2 "\ |
212 | WARNING: \`$1' $msg. You should only need it if | |
213 | you modified a \`.y' file. You may need the \`Bison' package | |
211 | WARNING: '$1' $msg. You should only need it if | |
212 | you modified a '.y' file. You may need the Bison package | |
214 | 213 | in order for those modifications to take effect. You can get |
215 | \`Bison' from any GNU archive site." | |
214 | Bison from any GNU archive site." | |
216 | 215 | rm -f y.tab.c y.tab.h |
217 | 216 | if test $# -ne 1; then |
218 | 217 | eval LASTARG=\${$#} |
239 | 238 | |
240 | 239 | lex*|flex*) |
241 | 240 | echo 1>&2 "\ |
242 | WARNING: \`$1' is $msg. You should only need it if | |
243 | you modified a \`.l' file. You may need the \`Flex' package | |
241 | WARNING: '$1' is $msg. You should only need it if | |
242 | you modified a '.l' file. You may need the Flex package | |
244 | 243 | in order for those modifications to take effect. You can get |
245 | \`Flex' from any GNU archive site." | |
244 | Flex from any GNU archive site." | |
246 | 245 | rm -f lex.yy.c |
247 | 246 | if test $# -ne 1; then |
248 | 247 | eval LASTARG=\${$#} |
262 | 261 | |
263 | 262 | help2man*) |
264 | 263 | echo 1>&2 "\ |
265 | WARNING: \`$1' is $msg. You should only need it if | |
264 | WARNING: '$1' is $msg. You should only need it if | |
266 | 265 | you modified a dependency of a manual page. You may need the |
267 | \`Help2man' package in order for those modifications to take | |
268 | effect. You can get \`Help2man' from any GNU archive site." | |
266 | Help2man package in order for those modifications to take | |
267 | effect. You can get Help2man from any GNU archive site." | |
269 | 268 | |
270 | 269 | file=`echo "$*" | sed -n "$sed_output"` |
271 | 270 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` |
280 | 279 | |
281 | 280 | makeinfo*) |
282 | 281 | echo 1>&2 "\ |
283 | WARNING: \`$1' is $msg. You should only need it if | |
284 | you modified a \`.texi' or \`.texinfo' file, or any other file | |
282 | WARNING: '$1' is $msg. You should only need it if | |
283 | you modified a '.texi' or '.texinfo' file, or any other file | |
285 | 284 | indirectly affecting the aspect of the manual. The spurious |
286 | call might also be the consequence of using a buggy \`make' (AIX, | |
287 | DU, IRIX). You might want to install the \`Texinfo' package or | |
288 | the \`GNU make' package. Grab either from any GNU archive site." | |
285 | call might also be the consequence of using a buggy 'make' (AIX, | |
286 | DU, IRIX). You might want to install the Texinfo package or | |
287 | the GNU make package. Grab either from any GNU archive site." | |
289 | 288 | # The file to touch is that specified with -o ... |
290 | 289 | file=`echo "$*" | sed -n "$sed_output"` |
291 | 290 | test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` |
309 | 308 | |
310 | 309 | *) |
311 | 310 | echo 1>&2 "\ |
312 | WARNING: \`$1' is needed, and is $msg. | |
311 | WARNING: '$1' is needed, and is $msg. | |
313 | 312 | You might have modified some files without having the |
314 | proper tools for further handling them. Check the \`README' file, | |
313 | proper tools for further handling them. Check the 'README' file, | |
315 | 314 | it often tells you about the needed prerequisites for installing |
316 | 315 | this package. You may also peek at any GNU archive site, in case |
317 | some other package would contain this missing \`$1' program." | |
316 | some other package would contain this missing '$1' program." | |
318 | 317 | exit 1 |
319 | 318 | ;; |
320 | 319 | esac |
0 | 0 | service/org.freedesktop.realmd.policy.in |
1 | service/realm-command.c | |
2 | service/realm-kerberos.c | |
3 | service/realm-provider.c | |
4 | service/realm-samba.c | |
5 | service/realm-sssd-ad.c | |
6 | service/realm-sssd-config.c | |
7 | tools/realm-discover.c | |
8 | tools/realm-enroll.c | |
9 | tools/realm-logins.c | |
10 | tools/realm.c | |
11 |
54 | 54 | -DPRIVATE_DIR="\"$(privatedir)\"" \ |
55 | 55 | -DSYSCONF_DIR="\"$(sysconfdir)\"" \ |
56 | 56 | -DPROVIDER_DIR="\"$(privatedir)/provider.d\"" \ |
57 | -DLOCALEDIR=\""$(datadir)/locale"\" \ | |
57 | 58 | $(PACKAGEKIT_CFLAGS) \ |
58 | 59 | $(POLKIT_CFLAGS) \ |
59 | 60 | $(GLIB_CFLAGS) \ |
0 | # Makefile.in generated by automake 1.11.5 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.12.2 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | |
4 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software | |
5 | # Foundation, Inc. | |
3 | # Copyright (C) 1994-2012 Free Software Foundation, Inc. | |
4 | ||
6 | 5 | # This Makefile.in is free software; the Free Software Foundation |
7 | 6 | # gives unlimited permission to copy and/or distribute it, |
8 | 7 | # with or without modifications, as long as this notice is preserved. |
50 | 49 | PRE_UNINSTALL = : |
51 | 50 | POST_UNINSTALL = : |
52 | 51 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ |
53 | $(top_srcdir)/Makefile.decl | |
52 | $(top_srcdir)/Makefile.decl $(top_srcdir)/depcomp | |
54 | 53 | private_PROGRAMS = realmd$(EXEEXT) |
55 | 54 | subdir = service |
56 | 55 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
99 | 98 | $(am__DEPENDENCIES_1) |
100 | 99 | realmd_LINK = $(CCLD) $(realmd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ |
101 | 100 | $(LDFLAGS) -o $@ |
101 | AM_V_P = $(am__v_P_@AM_V@) | |
102 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) | |
103 | am__v_P_0 = false | |
104 | am__v_P_1 = : | |
105 | AM_V_GEN = $(am__v_GEN_@AM_V@) | |
106 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | |
107 | am__v_GEN_0 = @echo " GEN " $@; | |
108 | am__v_GEN_1 = | |
109 | AM_V_at = $(am__v_at_@AM_V@) | |
110 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | |
111 | am__v_at_0 = @ | |
112 | am__v_at_1 = | |
102 | 113 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) |
103 | 114 | depcomp = $(SHELL) $(top_srcdir)/depcomp |
104 | 115 | am__depfiles_maybe = depfiles |
106 | 117 | AM_V_lt = $(am__v_lt_@AM_V@) |
107 | 118 | am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) |
108 | 119 | am__v_lt_0 = --silent |
120 | am__v_lt_1 = | |
109 | 121 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
110 | 122 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
111 | 123 | AM_V_CC = $(am__v_CC_@AM_V@) |
112 | 124 | am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) |
113 | am__v_CC_0 = @echo " CC " $@; | |
114 | AM_V_at = $(am__v_at_@AM_V@) | |
115 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | |
116 | am__v_at_0 = @ | |
125 | am__v_CC_0 = @echo " CC " $@; | |
126 | am__v_CC_1 = | |
117 | 127 | CCLD = $(CC) |
118 | 128 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ |
119 | 129 | AM_V_CCLD = $(am__v_CCLD_@AM_V@) |
120 | 130 | am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) |
121 | am__v_CCLD_0 = @echo " CCLD " $@; | |
122 | AM_V_GEN = $(am__v_GEN_@AM_V@) | |
123 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | |
124 | am__v_GEN_0 = @echo " GEN " $@; | |
131 | am__v_CCLD_0 = @echo " CCLD " $@; | |
132 | am__v_CCLD_1 = | |
125 | 133 | SOURCES = $(realmd_SOURCES) |
126 | 134 | DIST_SOURCES = $(realmd_SOURCES) |
127 | 135 | am__can_run_installinfo = \ |
373 | 381 | -DPRIVATE_DIR="\"$(privatedir)\"" \ |
374 | 382 | -DSYSCONF_DIR="\"$(sysconfdir)\"" \ |
375 | 383 | -DPROVIDER_DIR="\"$(privatedir)/provider.d\"" \ |
384 | -DLOCALEDIR=\""$(datadir)/locale"\" \ | |
376 | 385 | $(PACKAGEKIT_CFLAGS) \ |
377 | 386 | $(POLKIT_CFLAGS) \ |
378 | 387 | $(GLIB_CFLAGS) \ |
1046 | 1055 | here=`$(am__cd) $(top_builddir) && pwd` \ |
1047 | 1056 | && $(am__cd) $(top_srcdir) \ |
1048 | 1057 | && gtags -i $(GTAGS_ARGS) "$$here" |
1058 | ||
1059 | cscopelist: $(HEADERS) $(SOURCES) $(LISP) | |
1060 | list='$(SOURCES) $(HEADERS) $(LISP)'; \ | |
1061 | case "$(srcdir)" in \ | |
1062 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ | |
1063 | *) sdir=$(subdir)/$(srcdir) ;; \ | |
1064 | esac; \ | |
1065 | for i in $$list; do \ | |
1066 | if test -f "$$i"; then \ | |
1067 | echo "$(subdir)/$$i"; \ | |
1068 | else \ | |
1069 | echo "$$sdir/$$i"; \ | |
1070 | fi; \ | |
1071 | done >> $(top_builddir)/cscope.files | |
1049 | 1072 | |
1050 | 1073 | distclean-tags: |
1051 | 1074 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags |
1193 | 1216 | .MAKE: install-am install-strip |
1194 | 1217 | |
1195 | 1218 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ |
1196 | clean-privatePROGRAMS ctags distclean distclean-compile \ | |
1197 | distclean-generic distclean-tags distdir dvi dvi-am html \ | |
1198 | html-am info info-am install install-am install-data \ | |
1199 | install-data-am install-data-local install-dvi install-dvi-am \ | |
1200 | install-exec install-exec-am install-html install-html-am \ | |
1201 | install-info install-info-am install-man install-pdf \ | |
1202 | install-pdf-am install-polkit_policyDATA install-privateDATA \ | |
1203 | install-privatePROGRAMS install-ps install-ps-am install-strip \ | |
1204 | installcheck installcheck-am installdirs maintainer-clean \ | |
1205 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | |
1206 | mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ | |
1207 | uninstall-am uninstall-local uninstall-polkit_policyDATA \ | |
1208 | uninstall-privateDATA uninstall-privatePROGRAMS | |
1219 | clean-privatePROGRAMS cscopelist ctags distclean \ | |
1220 | distclean-compile distclean-generic distclean-tags distdir dvi \ | |
1221 | dvi-am html html-am info info-am install install-am \ | |
1222 | install-data install-data-am install-data-local install-dvi \ | |
1223 | install-dvi-am install-exec install-exec-am install-html \ | |
1224 | install-html-am install-info install-info-am install-man \ | |
1225 | install-pdf install-pdf-am install-polkit_policyDATA \ | |
1226 | install-privateDATA install-privatePROGRAMS install-ps \ | |
1227 | install-ps-am install-strip installcheck installcheck-am \ | |
1228 | installdirs maintainer-clean maintainer-clean-generic \ | |
1229 | mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ | |
1230 | ps ps-am tags uninstall uninstall-am uninstall-local \ | |
1231 | uninstall-polkit_policyDATA uninstall-privateDATA \ | |
1232 | uninstall-privatePROGRAMS | |
1209 | 1233 | |
1210 | 1234 | |
1211 | 1235 | perform-memcheck: $(TEST_PROGS) $(TEST_SUPPRESSIONS) |
302 | 302 | const Key *key = p; |
303 | 303 | |
304 | 304 | return str_hash0 (key->string) ^ |
305 | str_hash0 (realm_diagnostics_get_operation (key->invocation)) ^ | |
305 | str_hash0 (realm_diagnostics_get_operation_id (key->invocation)) ^ | |
306 | 306 | str_hash0 (g_dbus_method_invocation_get_sender (key->invocation)); |
307 | 307 | } |
308 | 308 | |
314 | 314 | const Key *k2 = v2; |
315 | 315 | |
316 | 316 | return g_strcmp0 (k1->string, k2->string) == 0 && |
317 | g_strcmp0 (realm_diagnostics_get_operation (k1->invocation), | |
318 | realm_diagnostics_get_operation (k2->invocation)) == 0 && | |
317 | g_strcmp0 (realm_diagnostics_get_operation_id (k1->invocation), | |
318 | realm_diagnostics_get_operation_id (k2->invocation)) == 0 && | |
319 | 319 | g_strcmp0 (g_dbus_method_invocation_get_sender (k1->invocation), |
320 | 320 | g_dbus_method_invocation_get_sender (k2->invocation)) == 0; |
321 | 321 | } |
28 | 28 | #include <errno.h> |
29 | 29 | #include <string.h> |
30 | 30 | |
31 | typedef struct { | |
32 | GDBusProxy *proxy; | |
33 | guint diagnostics_sig; | |
34 | } ProviderProxy; | |
35 | ||
36 | 31 | struct _RealmAllProvider { |
37 | 32 | RealmProvider parent; |
38 | 33 | GList *providers; |
39 | GHashTable *invocations; | |
40 | 34 | }; |
41 | 35 | |
42 | 36 | typedef struct { |
43 | 37 | RealmProviderClass parent_class; |
44 | 38 | } RealmAllProviderClass; |
45 | 39 | |
46 | static guint operation_unique_id = 0; | |
47 | ||
48 | #define REALM_DBUS_ALL_PROVIDER_NAME "org.freedesktop.realmd" | |
49 | #define REALM_DBUS_ALL_PROVIDER_PATH "/org/freedesktop/realmd" | |
50 | ||
51 | static void realm_all_provider_async_initable_iface (GAsyncInitableIface *iface); | |
52 | ||
53 | G_DEFINE_TYPE_WITH_CODE (RealmAllProvider, realm_all_provider, REALM_TYPE_PROVIDER, | |
54 | G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, realm_all_provider_async_initable_iface); | |
55 | ); | |
40 | G_DEFINE_TYPE (RealmAllProvider, realm_all_provider, REALM_TYPE_PROVIDER); | |
56 | 41 | |
57 | 42 | static void |
58 | 43 | realm_all_provider_init (RealmAllProvider *self) |
59 | 44 | { |
60 | self->invocations = g_hash_table_new_full (g_str_hash, g_str_equal, | |
61 | g_free, g_object_unref); | |
62 | ||
63 | 45 | /* The dbus Name property of the provider */ |
64 | 46 | g_object_set (self, "name", "All", NULL); |
65 | } | |
66 | ||
67 | static gboolean | |
68 | provider_load (const gchar *filename, | |
69 | gchar **name, | |
70 | gchar **path) | |
71 | { | |
72 | gboolean ret = TRUE; | |
73 | GError *error = NULL; | |
74 | GKeyFile *key_file; | |
75 | ||
76 | g_assert (name != NULL); | |
77 | g_assert (path != NULL); | |
78 | ||
79 | *name = NULL; | |
80 | *path = NULL; | |
81 | ||
82 | key_file = g_key_file_new (); | |
83 | g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, &error); | |
84 | if (error == NULL) | |
85 | *name = g_key_file_get_string (key_file, "provider", "name", &error); | |
86 | if (error == NULL) | |
87 | *path = g_key_file_get_string (key_file, "provider", "path", &error); | |
88 | if (error == NULL && (!g_dbus_is_name (*name) || g_dbus_is_unique_name (*name))) | |
89 | g_set_error (&error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE, | |
90 | "Invalid DBus name: %s", *name); | |
91 | if (error == NULL && !g_variant_is_object_path (*path)) { | |
92 | g_set_error (&error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE, | |
93 | "Invalid DBus object path: %s", *path); | |
94 | } | |
95 | ||
96 | if (error != NULL) { | |
97 | g_warning ("Couldn't load provider information from: %s: %s", | |
98 | filename, error->message); | |
99 | g_error_free (error); | |
100 | g_free (*name); | |
101 | g_free (*path); | |
102 | *name = *path = NULL; | |
103 | ret = FALSE; | |
104 | } | |
105 | ||
106 | g_key_file_free (key_file); | |
107 | return ret; | |
108 | 47 | } |
109 | 48 | |
110 | 49 | static GVariant * |
140 | 79 | update_realms_property (RealmAllProvider *self) |
141 | 80 | { |
142 | 81 | GQueue realms = G_QUEUE_INIT; |
143 | ProviderProxy *prov; | |
144 | 82 | GVariant *variant; |
145 | 83 | GList *l; |
146 | 84 | |
147 | 85 | for (l = self->providers; l != NULL; l = g_list_next (l)) { |
148 | prov = l->data; | |
149 | variant = g_dbus_proxy_get_cached_property (prov->proxy, "Realms"); | |
86 | variant = realm_dbus_provider_get_realms (l->data); | |
150 | 87 | if (variant) |
151 | g_queue_push_tail (&realms, variant); | |
152 | } | |
153 | ||
154 | variant = g_variant_ref_sink (reduce_array (&realms, "a(sos)")); | |
88 | g_queue_push_tail (&realms, g_variant_ref (variant)); | |
89 | } | |
90 | ||
91 | variant = g_variant_ref_sink (reduce_array (&realms, "a(os)")); | |
155 | 92 | g_object_set (self, "realms", variant, NULL); |
156 | 93 | g_variant_unref (variant); |
157 | 94 | } |
163 | 100 | } |
164 | 101 | |
165 | 102 | static void |
166 | on_proxy_properties_changed (GDBusProxy *proxy, | |
167 | GVariant *changed_properties, | |
168 | GStrv invalidated_properties, | |
169 | gpointer user_data) | |
103 | on_provider_notify (GObject *obj, | |
104 | GParamSpec *spec, | |
105 | gpointer user_data) | |
170 | 106 | { |
171 | 107 | RealmAllProvider *self = REALM_ALL_PROVIDER (user_data); |
172 | 108 | update_all_properties (self); |
210 | 146 | gint relevance_b = 0; |
211 | 147 | GVariant *realms; |
212 | 148 | |
213 | g_variant_get ((GVariant *)a, "(i@a(sos))", &relevance_a, &realms); | |
149 | g_variant_get ((GVariant *)a, "(i@a(os))", &relevance_a, &realms); | |
214 | 150 | g_variant_unref (realms); |
215 | 151 | |
216 | g_variant_get ((GVariant *)b, "(i@a(sos))", &relevance_b, &realms); | |
152 | g_variant_get ((GVariant *)b, "(i@a(os))", &relevance_b, &realms); | |
217 | 153 | g_variant_unref (realms); |
218 | 154 | |
219 | 155 | return relevance_b - relevance_a; |
239 | 175 | result = g_queue_pop_head (&discover->results); |
240 | 176 | if (result == NULL) |
241 | 177 | break; |
242 | g_variant_get (result, "(i@a(sos))", &relevance, &realms); | |
178 | g_variant_get (result, "(i@a(os))", &relevance, &realms); | |
243 | 179 | g_variant_iter_init (&iter, realms); |
244 | while ((realm = g_variant_iter_next_value (&iter)) != NULL) | |
180 | while ((realm = g_variant_iter_next_value (&iter)) != NULL) { | |
181 | const gchar *iface, *path; | |
182 | g_variant_get (realm, "(&o&s)", &iface, &path); | |
245 | 183 | g_ptr_array_add (results, realm); |
184 | } | |
246 | 185 | if (relevance > discover->relevance) |
247 | 186 | discover->relevance = relevance; |
248 | 187 | g_variant_unref (realms); |
250 | 189 | any = TRUE; |
251 | 190 | } |
252 | 191 | |
253 | discover->realms = g_variant_new_array (G_VARIANT_TYPE ("(sos)"), | |
192 | discover->realms = g_variant_new_array (G_VARIANT_TYPE ("(os)"), | |
254 | 193 | (GVariant *const *)results->pdata, |
255 | 194 | results->len); |
256 | 195 | g_variant_ref_sink (discover->realms); |
265 | 204 | } |
266 | 205 | |
267 | 206 | static void |
268 | on_proxy_discover (GObject *source, | |
269 | GAsyncResult *result, | |
270 | gpointer user_data) | |
207 | on_provider_discover (GObject *source, | |
208 | GAsyncResult *result, | |
209 | gpointer user_data) | |
271 | 210 | { |
272 | 211 | GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data); |
273 | 212 | DiscoverClosure *discover = g_simple_async_result_get_op_res_gpointer (res); |
274 | 213 | RealmAllProvider *self = REALM_ALL_PROVIDER (g_async_result_get_source_object (user_data)); |
275 | 214 | GError *error = NULL; |
276 | 215 | GVariant *retval; |
277 | ||
278 | retval = g_dbus_proxy_call_finish (G_DBUS_PROXY (source), result, &error); | |
279 | if (error == NULL) | |
280 | g_queue_push_tail (&discover->results, retval); | |
281 | else | |
216 | GVariant *realms; | |
217 | gint relevance; | |
218 | ||
219 | relevance = realm_provider_discover_finish (REALM_PROVIDER (source), result, &realms, &error); | |
220 | if (error == NULL) { | |
221 | retval = g_variant_new ("(i@a(os))", relevance, realms); | |
222 | g_queue_push_tail (&discover->results, g_variant_ref_sink (retval)); | |
223 | } else { | |
282 | 224 | g_queue_push_tail (&discover->failures, error); |
225 | } | |
226 | ||
227 | if (realms) | |
228 | g_variant_unref (realms); | |
283 | 229 | |
284 | 230 | g_assert (discover->outstanding > 0); |
285 | 231 | discover->outstanding--; |
286 | 232 | |
287 | 233 | /* All done at this point? */ |
288 | 234 | if (!discover->completed && discover->outstanding == 0) { |
289 | g_hash_table_remove (self->invocations, discover->operation_id); | |
290 | 235 | discover_process_results (res, discover); |
291 | 236 | discover->completed = TRUE; |
292 | 237 | g_simple_async_result_complete (res); |
329 | 274 | RealmAllProvider *self = REALM_ALL_PROVIDER (provider); |
330 | 275 | GSimpleAsyncResult *res; |
331 | 276 | DiscoverClosure *discover; |
332 | ProviderProxy *prov; | |
333 | 277 | GList *l; |
334 | 278 | |
335 | 279 | res = g_simple_async_result_new (G_OBJECT (self), callback, user_data, |
337 | 281 | discover = g_slice_new0 (DiscoverClosure); |
338 | 282 | g_queue_init (&discover->results); |
339 | 283 | discover->invocation = g_object_ref (invocation); |
340 | discover->operation_id = g_strdup_printf ("realm-all-provider-%d", operation_unique_id++); | |
341 | 284 | discover->timeout_id = g_timeout_add_seconds (3, on_discover_timeout, res); |
342 | 285 | g_simple_async_result_set_op_res_gpointer (res, discover, discover_closure_free); |
343 | 286 | |
344 | 287 | for (l = self->providers; l != NULL; l = g_list_next (l)) { |
345 | prov = l->data; | |
346 | g_dbus_proxy_call (prov->proxy, "Discover", | |
347 | g_variant_new ("(ss)", string, discover->operation_id), | |
348 | G_DBUS_CALL_FLAGS_NONE, G_MAXINT, NULL, | |
349 | on_proxy_discover, g_object_ref (res)); | |
288 | realm_provider_discover (l->data, string, invocation, on_provider_discover, | |
289 | g_object_ref (res)); | |
350 | 290 | discover->outstanding++; |
351 | 291 | } |
352 | 292 | |
355 | 295 | discover_process_results (res, discover); |
356 | 296 | discover->completed = TRUE; |
357 | 297 | g_simple_async_result_complete_in_idle (res); |
358 | ||
359 | /* Here we mark down our operation_id so diagnostics work */ | |
360 | } else { | |
361 | g_hash_table_insert (self->invocations, | |
362 | g_strdup (discover->operation_id), | |
363 | g_object_ref (invocation)); | |
364 | 298 | } |
365 | 299 | |
366 | 300 | g_object_unref (res); |
390 | 324 | realm_all_provider_finalize (GObject *obj) |
391 | 325 | { |
392 | 326 | RealmAllProvider *self = REALM_ALL_PROVIDER (obj); |
393 | ProviderProxy *prov; | |
394 | 327 | GList *l; |
395 | 328 | |
396 | for (l = self->providers; l != NULL; l = g_list_next (l)) { | |
397 | prov = l->data; | |
398 | if (prov->diagnostics_sig) { | |
399 | g_dbus_connection_signal_unsubscribe (g_dbus_proxy_get_connection (prov->proxy), | |
400 | prov->diagnostics_sig); | |
401 | } | |
402 | g_object_unref (prov->proxy); | |
403 | g_slice_free (ProviderProxy, prov); | |
404 | } | |
405 | g_list_free (self->providers); | |
406 | ||
407 | g_hash_table_destroy (self->invocations); | |
329 | for (l = self->providers; l != NULL; l = g_list_next (l)) | |
330 | g_signal_handlers_disconnect_by_func (l->data, on_provider_notify, self); | |
331 | g_list_free_full (self->providers, g_object_unref); | |
408 | 332 | |
409 | 333 | G_OBJECT_CLASS (realm_all_provider_parent_class)->finalize (obj); |
410 | 334 | } |
417 | 341 | |
418 | 342 | object_class->finalize = realm_all_provider_finalize; |
419 | 343 | |
420 | provider_class->dbus_name = REALM_DBUS_ALL_PROVIDER_NAME; | |
421 | provider_class->dbus_path = REALM_DBUS_ALL_PROVIDER_PATH; | |
344 | provider_class->dbus_path = REALM_DBUS_SERVICE_PATH; | |
422 | 345 | |
423 | 346 | provider_class->discover_async = realm_all_provider_discover_async; |
424 | 347 | provider_class->discover_finish = realm_all_provider_discover_finish; |
425 | 348 | } |
426 | 349 | |
427 | typedef struct { | |
428 | gint outstanding; | |
429 | } InitClosure; | |
430 | ||
431 | static void | |
432 | init_closure_free (gpointer data) | |
433 | { | |
434 | InitClosure *init = data; | |
435 | g_slice_free (InitClosure, init); | |
436 | } | |
437 | ||
438 | static void | |
439 | on_provider_proxy_diagnostics (GDBusConnection *connection, | |
440 | const gchar *sender_name, | |
441 | const gchar *object_path, | |
442 | const gchar *interface_name, | |
443 | const gchar *signal_name, | |
444 | GVariant *parameters, | |
445 | gpointer user_data) | |
446 | { | |
447 | RealmAllProvider *self = REALM_ALL_PROVIDER (user_data); | |
448 | GDBusMethodInvocation *invocation; | |
449 | const gchar *operation_id; | |
450 | const gchar *data; | |
451 | ||
452 | /* Here we relay diagnostic information from separate providers back to caller */ | |
453 | g_return_if_fail (g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(ss)"))); | |
454 | g_variant_get (parameters, "(&s&s)", &data, &operation_id); | |
455 | invocation = g_hash_table_lookup (self->invocations, operation_id); | |
456 | if (invocation != NULL) | |
457 | realm_diagnostics_signal (invocation, data); | |
458 | } | |
459 | ||
460 | static void | |
461 | on_provider_proxy_created (GObject *source, | |
462 | GAsyncResult *result, | |
463 | gpointer user_data) | |
464 | { | |
465 | GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data); | |
466 | InitClosure *init = g_simple_async_result_get_op_res_gpointer (res); | |
467 | RealmAllProvider *self = REALM_ALL_PROVIDER (g_async_result_get_source_object (user_data)); | |
468 | GDBusProxy *proxy; | |
469 | ProviderProxy *prov; | |
470 | GError *error = NULL; | |
471 | guint sig; | |
472 | ||
473 | proxy = g_dbus_proxy_new_for_bus_finish (result, &error); | |
474 | if (error == NULL) { | |
475 | g_signal_connect (proxy, "g-properties-changed", | |
476 | G_CALLBACK (on_proxy_properties_changed), self); | |
477 | ||
478 | sig = g_dbus_connection_signal_subscribe (g_dbus_proxy_get_connection (proxy), | |
479 | g_dbus_proxy_get_name (proxy), | |
480 | "org.freedesktop.realmd.Diagnostics", | |
481 | "Diagnostics", | |
482 | g_dbus_proxy_get_object_path (proxy), | |
483 | NULL, | |
484 | G_DBUS_SIGNAL_FLAGS_NONE, | |
485 | on_provider_proxy_diagnostics, | |
486 | self, NULL); | |
487 | ||
488 | prov = g_slice_new0 (ProviderProxy); | |
489 | prov->proxy = proxy; | |
490 | prov->diagnostics_sig = sig; | |
491 | self->providers = g_list_prepend (self->providers, prov); | |
492 | ||
493 | } else { | |
494 | g_warning ("Couldn't load realm provider: %s", error->message); | |
495 | g_error_free (error); | |
496 | } | |
497 | ||
498 | init->outstanding--; | |
499 | if (init->outstanding == 0) { | |
500 | update_all_properties (self); | |
501 | g_simple_async_result_complete (res); | |
502 | } | |
503 | ||
504 | g_object_unref (self); | |
505 | g_object_unref (res); | |
506 | } | |
507 | ||
508 | static void | |
509 | realm_all_provider_init_async (GAsyncInitable *initable, | |
510 | int io_priority, | |
511 | GCancellable *cancellable, | |
512 | GAsyncReadyCallback callback, | |
513 | gpointer user_data) | |
514 | { | |
515 | RealmAllProvider *self = REALM_ALL_PROVIDER (initable); | |
516 | GSimpleAsyncResult *res; | |
517 | InitClosure *init; | |
518 | GError *error = NULL; | |
519 | GDir *dir = NULL; | |
520 | gchar *filename; | |
521 | const gchar *name; | |
522 | gchar *provider_name; | |
523 | gchar *provider_path; | |
524 | ||
525 | res = g_simple_async_result_new (G_OBJECT (self), callback, user_data, | |
526 | realm_all_provider_init_async); | |
527 | init = g_slice_new0 (InitClosure); | |
528 | g_simple_async_result_set_op_res_gpointer (res, init, init_closure_free); | |
529 | ||
530 | dir = g_dir_open (PROVIDER_DIR, 0, &error); | |
531 | if (g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) | |
532 | g_clear_error (&error); | |
533 | if (error != NULL) { | |
534 | g_warning ("Couldn't list provider directory: %s: %s", | |
535 | PROVIDER_DIR, error->message); | |
536 | g_clear_error (&error); | |
537 | dir = NULL; | |
538 | } | |
539 | ||
540 | for (;;) { | |
541 | if (dir == NULL) | |
542 | name = NULL; | |
543 | else | |
544 | name = g_dir_read_name (dir); | |
545 | if (name == NULL) | |
546 | break; | |
547 | ||
548 | /* Only files ending in *.provider are loaded */ | |
549 | if (!g_pattern_match_simple ("*.provider", name)) | |
550 | continue; | |
551 | ||
552 | filename = g_build_filename (PROVIDER_DIR, name, NULL); | |
553 | if (provider_load (filename, &provider_name, &provider_path)) { | |
554 | g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, | |
555 | realm_dbus_provider_interface_info (), | |
556 | provider_name, provider_path, | |
557 | REALM_DBUS_PROVIDER_INTERFACE, | |
558 | cancellable, on_provider_proxy_created, | |
559 | g_object_ref (res)); | |
560 | ||
561 | realm_debug ("Initializing provider: %s", provider_name); | |
562 | ||
563 | g_free (provider_name); | |
564 | g_free (provider_path); | |
565 | init->outstanding++; | |
566 | } | |
567 | ||
568 | g_free (filename); | |
569 | } | |
570 | ||
571 | if (init->outstanding == 0) { | |
572 | realm_debug ("No realm providers found"); | |
573 | g_simple_async_result_complete_in_idle (res); | |
574 | } | |
575 | ||
576 | g_object_unref (res); | |
577 | } | |
578 | ||
579 | static gboolean | |
580 | realm_all_provider_init_finish (GAsyncInitable *initable, | |
581 | GAsyncResult *result, | |
582 | GError **error) | |
583 | { | |
584 | if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) | |
585 | return FALSE; | |
586 | ||
587 | return TRUE; | |
588 | } | |
589 | ||
590 | static void | |
591 | realm_all_provider_async_initable_iface (GAsyncInitableIface *iface) | |
592 | { | |
593 | iface->init_async = realm_all_provider_init_async; | |
594 | iface->init_finish = realm_all_provider_init_finish; | |
595 | } | |
350 | void | |
351 | realm_all_provider_register (RealmProvider *all_provider, | |
352 | RealmProvider *provider) | |
353 | { | |
354 | RealmAllProvider *self; | |
355 | ||
356 | g_return_if_fail (REALM_IS_ALL_PROVIDER (all_provider)); | |
357 | g_return_if_fail (REALM_IS_PROVIDER (provider)); | |
358 | ||
359 | self = REALM_ALL_PROVIDER (all_provider); | |
360 | self->providers = g_list_prepend (self->providers, g_object_ref (provider)); | |
361 | ||
362 | update_all_properties (self); | |
363 | g_signal_connect (provider, "notify", G_CALLBACK (on_provider_notify), self); | |
364 | } |
18 | 18 | |
19 | 19 | #include <gio/gio.h> |
20 | 20 | |
21 | #include "realm-provider.h" | |
22 | ||
21 | 23 | G_BEGIN_DECLS |
22 | 24 | |
23 | 25 | #define REALM_TYPE_ALL_PROVIDER (realm_all_provider_get_type ()) |
28 | 30 | |
29 | 31 | GType realm_all_provider_get_type (void) G_GNUC_CONST; |
30 | 32 | |
33 | void realm_all_provider_register (RealmProvider *all_provider, | |
34 | RealmProvider *provider); | |
35 | ||
31 | 36 | G_END_DECLS |
32 | 37 | |
33 | 38 | #endif /* __REALM_ALL_PROVIDER_H__ */ |
330 | 330 | /* Ignore cases where we've signaled the process because we were cancelled */ |
331 | 331 | if (!command->cancelled) |
332 | 332 | g_simple_async_result_set_error (process_source->res, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED, |
333 | "Process was terminated with signal: %d", code); | |
333 | _("Process was terminated with signal: %d"), code); | |
334 | 334 | } |
335 | 335 | |
336 | 336 | for (i = 0; i < NUM_FDS; ++i) { |
371 | 371 | |
372 | 372 | /* Set an error, which is respected when this actually completes. */ |
373 | 373 | g_simple_async_result_set_error (process_source->res, G_IO_ERROR, G_IO_ERROR_CANCELLED, |
374 | "The operation was cancelled"); | |
374 | _("The operation was cancelled")); | |
375 | 375 | process_source->command->cancelled = TRUE; |
376 | 376 | |
377 | 377 | /* Try and kill the child process */ |
15 | 15 | |
16 | 16 | #include "realm-all-provider.h" |
17 | 17 | #include "realm-daemon.h" |
18 | #include "realm-dbus-constants.h" | |
19 | #include "realm-dbus-generated.h" | |
18 | 20 | #define DEBUG_FLAG REALM_DEBUG_SERVICE |
19 | 21 | #include "realm-debug.h" |
20 | 22 | #include "realm-diagnostics.h" |
23 | #include "realm-errors.h" | |
21 | 24 | #include "realm-samba-provider.h" |
22 | 25 | #include "realm-settings.h" |
23 | 26 | #include "realm-sssd-ad-provider.h" |
24 | 27 | #include "realm-sssd-ipa-provider.h" |
25 | 28 | |
26 | 29 | #include <glib.h> |
30 | #include <glib/gi18n.h> | |
27 | 31 | |
28 | 32 | #include <polkit/polkit.h> |
29 | 33 | |
34 | 38 | static GMainLoop *main_loop = NULL; |
35 | 39 | |
36 | 40 | static gboolean service_persist = FALSE; |
37 | static GHashTable *service_holds = NULL; | |
41 | static GHashTable *service_clients = NULL; | |
38 | 42 | static gint64 service_quit_at = 0; |
39 | 43 | static guint service_timeout_id = 0; |
44 | static guint service_bus_name_owner_id = 0; | |
45 | static gboolean service_bus_name_claimed = FALSE; | |
46 | ||
47 | typedef struct { | |
48 | guint watch; | |
49 | gchar *locale; | |
50 | } RealmClient; | |
51 | ||
52 | /* We use this for registering the dbus errors */ | |
53 | GQuark realm_error = 0; | |
40 | 54 | |
41 | 55 | /* We use a lock here because it's called from dbus threads */ |
42 | 56 | G_LOCK_DEFINE(polkit_authority); |
85 | 99 | |
86 | 100 | /* Matches the hold in realm_daemon_lock_for_action() */ |
87 | 101 | realm_daemon_release ("current-invocation"); |
102 | } | |
103 | ||
104 | void | |
105 | realm_daemon_set_locale_until_loop (GDBusMethodInvocation *invocation) | |
106 | { | |
107 | /* TODO: Not yet implemented, need threadsafe implementation */ | |
88 | 108 | } |
89 | 109 | |
90 | 110 | gboolean |
148 | 168 | return ret; |
149 | 169 | } |
150 | 170 | |
171 | static void | |
172 | on_client_vanished (GDBusConnection *connection, | |
173 | const gchar *name, | |
174 | gpointer user_data) | |
175 | { | |
176 | g_hash_table_remove (service_clients, name); | |
177 | } | |
178 | ||
179 | static RealmClient * | |
180 | lookup_or_register_client (const gchar *sender) | |
181 | { | |
182 | RealmClient *client; | |
183 | ||
184 | client = g_hash_table_lookup (service_clients, sender); | |
185 | if (!client) { | |
186 | client = g_slice_new0 (RealmClient); | |
187 | client->watch = g_bus_watch_name (G_BUS_TYPE_SYSTEM, sender, | |
188 | G_BUS_NAME_WATCHER_FLAGS_NONE, | |
189 | NULL, on_client_vanished, NULL, NULL); | |
190 | g_hash_table_insert (service_clients, g_strdup (sender), client); | |
191 | } | |
192 | ||
193 | return client; | |
194 | } | |
195 | ||
151 | 196 | void |
152 | 197 | realm_daemon_hold (const gchar *hold) |
153 | 198 | { |
199 | /* | |
200 | * We register these holds in the same table as the clients | |
201 | * so need to make sure they don't colide with them. | |
202 | */ | |
203 | ||
154 | 204 | g_assert (hold != NULL); |
155 | ||
156 | if (g_hash_table_lookup (service_holds, hold)) | |
205 | g_assert (!g_dbus_is_unique_name (hold)); | |
206 | ||
207 | ||
208 | if (g_hash_table_lookup (service_clients, hold)) | |
157 | 209 | g_critical ("realm_daemon_hold: already have hold: %s", hold); |
158 | g_hash_table_insert (service_holds, g_strdup (hold), HOLD_INTERNAL); | |
210 | g_hash_table_insert (service_clients, g_strdup (hold), g_slice_new0 (RealmClient)); | |
159 | 211 | } |
160 | 212 | |
161 | 213 | void |
162 | 214 | realm_daemon_release (const gchar *hold) |
163 | 215 | { |
164 | 216 | g_assert (hold != NULL); |
165 | ||
166 | if (!g_hash_table_remove (service_holds, hold)) | |
217 | g_assert (!g_dbus_is_unique_name (hold)); | |
218 | ||
219 | if (!g_hash_table_remove (service_clients, hold)) | |
167 | 220 | g_critical ("realm_daemon_release: don't have hold: %s", hold); |
168 | 221 | } |
169 | 222 | |
175 | 228 | |
176 | 229 | service_timeout_id = 0; |
177 | 230 | |
178 | if (g_hash_table_size (service_holds) > 0) | |
231 | if (g_hash_table_size (service_clients) > 0) | |
179 | 232 | return FALSE; |
180 | 233 | |
181 | 234 | now = g_get_monotonic_time (); |
196 | 249 | { |
197 | 250 | if (service_persist) |
198 | 251 | return; |
199 | if (g_hash_table_size (service_holds) > 0) | |
252 | if (g_hash_table_size (service_clients) > 0) | |
200 | 253 | return; |
201 | 254 | service_quit_at = g_get_monotonic_time () + (TIMEOUT * G_TIME_SPAN_SECOND); |
202 | 255 | if (service_timeout_id == 0) |
204 | 257 | } |
205 | 258 | |
206 | 259 | static void |
207 | on_client_vanished (GDBusConnection *connection, | |
208 | const gchar *name, | |
209 | gpointer user_data) | |
210 | { | |
211 | g_hash_table_remove (service_holds, name); | |
212 | } | |
213 | ||
214 | static void | |
215 | unwatch_if_watched (gpointer data) | |
216 | { | |
217 | if (data != HOLD_INTERNAL) | |
218 | g_bus_unwatch_name (GPOINTER_TO_UINT (data)); | |
260 | realm_client_unwatch_and_free (gpointer data) | |
261 | { | |
262 | RealmClient *client = data; | |
263 | ||
264 | g_assert (data != NULL); | |
265 | if (client->watch) | |
266 | g_bus_unwatch_name (client->watch); | |
267 | g_free (client->locale); | |
268 | g_slice_free (RealmClient, client); | |
269 | ||
219 | 270 | realm_daemon_poke (); |
220 | 271 | } |
221 | 272 | |
224 | 275 | { |
225 | 276 | GDBusMessage *message = user_data; |
226 | 277 | const gchar *sender = g_dbus_message_get_sender (message); |
227 | guint watch; | |
228 | ||
229 | if (!g_hash_table_lookup (service_holds, sender)) { | |
230 | watch = g_bus_watch_name (G_BUS_TYPE_SYSTEM, sender, | |
231 | G_BUS_NAME_WATCHER_FLAGS_NONE, | |
232 | NULL, on_client_vanished, NULL, NULL); | |
233 | g_hash_table_insert (service_holds, g_strdup (sender), | |
234 | GUINT_TO_POINTER (watch)); | |
235 | } | |
236 | ||
237 | return FALSE; /* don't call again */ | |
238 | } | |
239 | ||
240 | static gboolean | |
241 | on_idle_release_for_message (gpointer user_data) | |
242 | { | |
243 | GDBusMessage *message = user_data; | |
244 | const gchar *sender = g_dbus_message_get_sender (message); | |
245 | ||
246 | g_hash_table_remove (service_holds, sender); | |
278 | lookup_or_register_client (sender); | |
247 | 279 | return FALSE; /* don't call again */ |
248 | 280 | } |
249 | 281 | |
255 | 287 | { |
256 | 288 | const gchar *own_name = user_data; |
257 | 289 | GDBusMessageType type; |
258 | GDBusMessage *reply; | |
259 | GError *error = NULL; | |
260 | 290 | |
261 | 291 | /* Each time we see an incoming function call, keep the service alive */ |
262 | 292 | if (incoming) { |
263 | 293 | type = g_dbus_message_get_message_type (message); |
264 | 294 | if (type == G_DBUS_MESSAGE_TYPE_METHOD_CALL) { |
265 | 295 | |
266 | /* Is a client calling to release from the daemon? */ | |
267 | if (g_strcmp0 (g_dbus_message_get_path (message), "/org/freedesktop/realmd") == 0 && | |
268 | g_strcmp0 (g_dbus_message_get_member (message), "ReleaseDaemon") == 0 && | |
269 | g_strcmp0 (g_dbus_message_get_interface (message), "org.freedesktop.realmd.Daemon") == 0) { | |
270 | g_idle_add_full (G_PRIORITY_DEFAULT, | |
271 | on_idle_release_for_message, | |
272 | g_object_ref (message), | |
273 | g_object_unref); | |
274 | ||
275 | /* Reply to this message */ | |
276 | reply = g_dbus_message_new_method_reply (message); | |
277 | g_dbus_message_set_body (reply, g_variant_new ("()")); | |
278 | g_dbus_connection_send_message (connection, reply, | |
279 | G_DBUS_SEND_MESSAGE_FLAGS_NONE, | |
280 | NULL, &error); | |
281 | if (error != NULL) { | |
282 | g_critical ("Couldn't send ReleaseDaemon reply message: %s", error->message); | |
283 | g_error_free (error); | |
284 | } | |
285 | g_object_unref (message); | |
286 | return NULL; | |
287 | ||
288 | /* Another method call, watch the client and don't go away until they do, or release */ | |
289 | } else if (g_strcmp0 (own_name, g_dbus_message_get_sender (message)) != 0) { | |
296 | /* All methods besides 'Release' on the Service interface cause us to watch client */ | |
297 | if (g_str_equal (own_name , g_dbus_message_get_sender (message)) && | |
298 | (!g_str_equal (g_dbus_message_get_path (message), REALM_DBUS_SERVICE_PATH) || | |
299 | !g_str_equal (g_dbus_message_get_member (message), "Release") || | |
300 | !g_str_equal (g_dbus_message_get_interface (message), REALM_DBUS_SERVICE_INTERFACE))) { | |
290 | 301 | g_idle_add_full (G_PRIORITY_DEFAULT, |
291 | 302 | on_idle_hold_for_message, |
292 | 303 | g_object_ref (message), |
298 | 309 | return message; |
299 | 310 | } |
300 | 311 | |
312 | static gboolean | |
313 | on_service_release (RealmDbusService *object, | |
314 | GDBusMethodInvocation *invocation) | |
315 | { | |
316 | const char *sender; | |
317 | ||
318 | sender = g_dbus_method_invocation_get_sender (invocation); | |
319 | g_hash_table_remove (service_clients, sender); | |
320 | ||
321 | return TRUE; | |
322 | } | |
323 | ||
324 | static gboolean | |
325 | on_service_cancel (RealmDbusService *object, | |
326 | GDBusMethodInvocation *invocation, | |
327 | const gchar *operation_id) | |
328 | { | |
329 | /* TODO: Needs implementation */ | |
330 | realm_dbus_service_complete_cancel (object, invocation); | |
331 | return TRUE; | |
332 | } | |
333 | ||
334 | static gboolean | |
335 | on_service_set_locale (RealmDbusService *object, | |
336 | GDBusMethodInvocation *invocation, | |
337 | const gchar *arg_locale) | |
338 | { | |
339 | RealmClient *client; | |
340 | const gchar *sender; | |
341 | ||
342 | sender = g_dbus_method_invocation_get_sender (invocation); | |
343 | client = lookup_or_register_client (sender); | |
344 | ||
345 | g_free (client->locale); | |
346 | client->locale = g_strdup (arg_locale); | |
347 | ||
348 | realm_dbus_service_complete_set_locale (object, invocation); | |
349 | return TRUE; | |
350 | } | |
351 | ||
352 | static void | |
353 | on_name_acquired (GDBusConnection *connection, | |
354 | const gchar *name, | |
355 | gpointer user_data) | |
356 | { | |
357 | service_bus_name_claimed = TRUE; | |
358 | realm_debug ("claimed name on bus: %s", name); | |
359 | realm_daemon_poke (); | |
360 | } | |
361 | ||
362 | static void | |
363 | on_name_lost (GDBusConnection *connection, | |
364 | const gchar *name, | |
365 | gpointer user_data) | |
366 | { | |
367 | if (!service_bus_name_claimed) | |
368 | g_printerr ("couldn't claim service name on DBus bus: %s", name); | |
369 | else | |
370 | g_warning ("lost service name on DBus bus: %s", name); | |
371 | } | |
372 | ||
301 | 373 | static void |
302 | 374 | on_bus_get_connection (GObject *source, |
303 | 375 | GAsyncResult *result, |
306 | 378 | GError *error = NULL; |
307 | 379 | GDBusConnection **connection = (GDBusConnection **)user_data; |
308 | 380 | const gchar *self_name; |
381 | RealmProvider *all_provider; | |
382 | RealmProvider *provider; | |
383 | guint owner_id; | |
309 | 384 | |
310 | 385 | *connection = g_bus_get_finish (result, &error); |
311 | 386 | if (error != NULL) { |
312 | 387 | g_warning ("couldn't connect to bus: %s", error->message); |
313 | 388 | g_main_loop_quit (main_loop); |
314 | 389 | g_error_free (error); |
390 | ||
315 | 391 | } else { |
316 | 392 | realm_debug ("connected to bus"); |
317 | 393 | |
321 | 397 | (gchar *)self_name, NULL); |
322 | 398 | |
323 | 399 | realm_diagnostics_initialize (*connection); |
324 | realm_provider_start (*connection, REALM_TYPE_SSSD_AD_PROVIDER); | |
325 | realm_provider_start (*connection, REALM_TYPE_SSSD_IPA_PROVIDER); | |
326 | realm_provider_start (*connection, REALM_TYPE_SAMBA_PROVIDER); | |
327 | realm_provider_start (*connection, REALM_TYPE_ALL_PROVIDER); | |
400 | all_provider = realm_provider_start (*connection, REALM_TYPE_ALL_PROVIDER); | |
401 | ||
402 | provider = realm_provider_start (*connection, REALM_TYPE_SSSD_AD_PROVIDER); | |
403 | realm_all_provider_register (all_provider, provider); | |
404 | g_object_unref (provider); | |
405 | ||
406 | provider = realm_provider_start (*connection, REALM_TYPE_SSSD_IPA_PROVIDER); | |
407 | realm_all_provider_register (all_provider, provider); | |
408 | g_object_unref (provider); | |
409 | ||
410 | provider = realm_provider_start (*connection, REALM_TYPE_SAMBA_PROVIDER); | |
411 | realm_all_provider_register (all_provider, provider); | |
412 | g_object_unref (provider); | |
413 | ||
414 | owner_id = g_bus_own_name_on_connection (*connection, | |
415 | REALM_DBUS_BUS_NAME, | |
416 | G_BUS_NAME_OWNER_FLAGS_NONE, | |
417 | on_name_acquired, on_name_lost, | |
418 | all_provider, g_object_unref); | |
419 | service_bus_name_owner_id = owner_id; | |
328 | 420 | } |
329 | 421 | |
330 | 422 | /* Matches the hold() in main() */ |
340 | 432 | char *argv[]) |
341 | 433 | { |
342 | 434 | GDBusConnection *connection = NULL; |
435 | RealmDbusService *service; | |
343 | 436 | GOptionContext *context; |
344 | 437 | GError *error = NULL; |
438 | ||
439 | #ifdef ENABLE_NLS | |
440 | bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); | |
441 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); | |
442 | textdomain (GETTEXT_PACKAGE); | |
443 | #endif | |
444 | ||
345 | 445 | g_type_init (); |
346 | 446 | |
347 | 447 | context = g_option_context_new ("realmd"); |
357 | 457 | service_persist = 1; |
358 | 458 | |
359 | 459 | realm_debug_init (); |
360 | service_holds = g_hash_table_new_full (g_str_hash, g_str_equal, | |
361 | g_free, unwatch_if_watched); | |
460 | realm_error = realm_error_quark (); | |
461 | service_clients = g_hash_table_new_full (g_str_hash, g_str_equal, | |
462 | g_free, realm_client_unwatch_and_free); | |
362 | 463 | realm_daemon_hold ("main"); |
363 | 464 | |
364 | 465 | /* Load the platform specific data */ |
365 | 466 | realm_settings_init (); |
366 | 467 | |
468 | service = realm_dbus_service_skeleton_new (); | |
469 | g_signal_connect (service, "handle-release", G_CALLBACK (on_service_release), NULL); | |
470 | g_signal_connect (service, "handle-set-locale", G_CALLBACK (on_service_set_locale), NULL); | |
471 | g_signal_connect (service, "handle-cancel", G_CALLBACK (on_service_cancel), NULL); | |
472 | ||
367 | 473 | realm_debug ("starting service"); |
368 | 474 | g_bus_get (G_BUS_TYPE_SYSTEM, NULL, on_bus_get_connection, &connection); |
369 | 475 | |
371 | 477 | |
372 | 478 | g_main_loop_run (main_loop); |
373 | 479 | |
374 | if (connection != NULL) { | |
375 | realm_provider_stop_all (); | |
480 | if (service_bus_name_owner_id != 0) | |
481 | g_bus_unown_name (service_bus_name_owner_id); | |
482 | if (connection != NULL) | |
376 | 483 | g_object_unref (connection); |
377 | } | |
378 | 484 | |
379 | 485 | G_LOCK (polkit_authority); |
380 | 486 | g_clear_object (&polkit_authority); |
385 | 491 | g_main_loop_unref (main_loop); |
386 | 492 | g_option_context_free (context); |
387 | 493 | |
388 | g_hash_table_unref (service_holds); | |
494 | g_object_unref (service); | |
495 | g_hash_table_unref (service_clients); | |
389 | 496 | return 0; |
390 | 497 | } |
24 | 24 | |
25 | 25 | void realm_daemon_unlock_for_action (GDBusMethodInvocation *invocation); |
26 | 26 | |
27 | void realm_daemon_set_locale_until_loop (GDBusMethodInvocation *invocation); | |
28 | ||
27 | 29 | void realm_daemon_hold (const gchar *identifier); |
28 | 30 | |
29 | 31 | void realm_daemon_release (const gchar *identifier); |
32 | ||
33 | void realm_daemon_set_locale (const gchar *sender, | |
34 | const gchar *locale, | |
35 | const gchar *operation_id); | |
30 | 36 | |
31 | 37 | void realm_daemon_poke (void); |
32 | 38 |
42 | 42 | { "daemon", REALM_DEBUG_SERVICE }, |
43 | 43 | { "packages", REALM_DEBUG_PACKAGES }, |
44 | 44 | { "provider", REALM_DEBUG_PROVIDER }, |
45 | { "leave-temp-files", REALM_DEBUG_LEAVE_TEMP_FILES }, | |
45 | 46 | { 0, } |
46 | 47 | }; |
47 | 48 |
32 | 32 | REALM_DEBUG_DIAGNOSTICS = 1 << 2, |
33 | 33 | REALM_DEBUG_SERVICE = 1 << 3, |
34 | 34 | REALM_DEBUG_PACKAGES = 1 << 4, |
35 | REALM_DEBUG_PROVIDER = 1 << 5 | |
35 | REALM_DEBUG_PROVIDER = 1 << 5, | |
36 | REALM_DEBUG_LEAVE_TEMP_FILES = 1 << 6, | |
36 | 37 | } RealmDebugFlags; |
37 | 38 | |
38 | 39 | void realm_debug_init (void); |
41 | 41 | } |
42 | 42 | |
43 | 43 | const gchar * |
44 | realm_diagnostics_get_operation (GDBusMethodInvocation *invocation) | |
44 | realm_diagnostics_get_operation_id (GDBusMethodInvocation *invocation) | |
45 | 45 | { |
46 | 46 | return g_object_get_qdata (G_OBJECT (invocation), operation_id_quark); |
47 | 47 | } |
48 | 48 | |
49 | 49 | void |
50 | realm_diagnostics_mark_operation (GDBusMethodInvocation *invocation, | |
51 | const gchar *operation_id) | |
52 | { | |
50 | realm_diagnostics_setup_options (GDBusMethodInvocation *invocation, | |
51 | GVariant *options) | |
52 | { | |
53 | gchar *operation_id; | |
54 | ||
53 | 55 | g_return_if_fail (G_IS_DBUS_METHOD_INVOCATION (invocation)); |
54 | g_return_if_fail (operation_id != NULL); | |
55 | ||
56 | g_object_set_qdata_full (G_OBJECT (invocation), operation_id_quark, | |
57 | g_strdup (operation_id), g_free); | |
56 | g_return_if_fail (options != NULL); | |
57 | ||
58 | if (g_variant_lookup (options, "operation-id", "(s)", &operation_id)) { | |
59 | g_object_set_qdata_full (G_OBJECT (invocation), operation_id_quark, | |
60 | operation_id, g_free); | |
61 | } | |
58 | 62 | } |
59 | 63 | |
60 | 64 | static void |
198 | 202 | return; |
199 | 203 | |
200 | 204 | operation_id = g_object_get_qdata (G_OBJECT (invocation), operation_id_quark); |
201 | if (operation_id == NULL) { | |
202 | g_warning ("method invocation not marked with operation_id"); | |
205 | if (operation_id == NULL) | |
203 | 206 | operation_id = ""; |
204 | } | |
205 | 207 | |
206 | 208 | g_dbus_connection_emit_signal (the_connection, g_dbus_method_invocation_get_sender (invocation), |
207 | g_dbus_method_invocation_get_object_path (invocation), | |
208 | REALM_DBUS_DIAGNOSTICS_INTERFACE, REALM_DBUS_DIAGNOSTICS_SIGNAL, | |
209 | g_variant_new ("(ss)", data, operation_id), &error); | |
210 | ||
211 | if (error != NULL) | |
212 | g_warning ("couldn't emit the Diagnostics signal: %s", error->message); | |
213 | } | |
209 | REALM_DBUS_SERVICE_PATH, REALM_DBUS_SERVICE_INTERFACE, | |
210 | REALM_DBUS_DIAGNOSTICS_SIGNAL, g_variant_new ("(ss)", data, operation_id), | |
211 | &error); | |
212 | ||
213 | if (error != NULL) { | |
214 | g_warning ("couldn't emit the %s signal: %s", REALM_DBUS_DIAGNOSTICS_SIGNAL, error->message); | |
215 | g_error_free (error); | |
216 | } | |
217 | } |
22 | 22 | |
23 | 23 | void realm_diagnostics_initialize (GDBusConnection *connection); |
24 | 24 | |
25 | void realm_diagnostics_mark_operation (GDBusMethodInvocation *invocation, | |
26 | const gchar *operation_id); | |
25 | void realm_diagnostics_setup_options (GDBusMethodInvocation *invocation, | |
26 | GVariant *options); | |
27 | 27 | |
28 | const gchar * realm_diagnostics_get_operation (GDBusMethodInvocation *invocation); | |
28 | const gchar * realm_diagnostics_get_operation_id (GDBusMethodInvocation *invocation); | |
29 | 29 | |
30 | 30 | void realm_diagnostics_info (GDBusMethodInvocation *invocation, |
31 | 31 | const gchar *format, |
47 | 47 | |
48 | 48 | return (GQuark)quark_volatile; |
49 | 49 | } |
50 | ||
51 | GQuark | |
52 | realm_krb5_error_quark (void) | |
53 | { | |
54 | static volatile gsize quark_volatile = 0; | |
55 | ||
56 | if (quark_volatile == 0) | |
57 | quark_volatile = g_quark_from_static_string ("krb5-error"); | |
58 | ||
59 | return (GQuark)quark_volatile; | |
60 | } |
36 | 36 | _NUM_REALM_ERRORS |
37 | 37 | } RealmErrorCodes; |
38 | 38 | |
39 | #define REALM_KRB5_ERROR (realm_krb5_error_quark ()) | |
40 | ||
41 | GQuark realm_krb5_error_quark (void) G_GNUC_CONST; | |
42 | ||
39 | 43 | G_END_DECLS |
40 | 44 | |
41 | 45 | #endif /* __REALM_ERRORS_H__ */ |
665 | 665 | GBytes *bytes; |
666 | 666 | gboolean ret = TRUE; |
667 | 667 | const gchar *contents; |
668 | mode_t mask; | |
668 | mode_t mask = 0; | |
669 | 669 | gsize length; |
670 | 670 | |
671 | 671 | g_return_val_if_fail (REALM_IS_INI_CONFIG (self), FALSE); |
758 | 758 | g_assert (sect->head != line); |
759 | 759 | |
760 | 760 | remove_config_line (self, line); |
761 | if (!g_hash_table_remove (sect->parameters, line->name)) | |
762 | g_assert_not_reached (); | |
761 | 763 | config_line_free (line); |
762 | 764 | } |
763 | 765 | return; |
505 | 505 | on_write_http_request, g_object_ref (self)); |
506 | 506 | |
507 | 507 | } else { |
508 | ipa_discover_take_error (self, "Couldn't connect to host", error); | |
508 | ipa_discover_take_error (self, "Couldn't connect to check for IPA domain", error); | |
509 | 509 | ipa_discover_step (self); |
510 | 510 | } |
511 | 511 |
49 | 49 | G_IMPLEMENT_INTERFACE (REALM_DBUS_TYPE_KERBEROS, realm_kerberos_iface_init); |
50 | 50 | ); |
51 | 51 | |
52 | static void | |
53 | handle_krb5_error (GDBusMethodInvocation *invocation, | |
54 | krb5_error_code code, | |
55 | krb5_context context, | |
56 | const gchar *message, | |
57 | ...) | |
58 | { | |
59 | gchar *string; | |
60 | va_list va; | |
61 | ||
62 | va_start (va, message); | |
63 | string = g_strdup_vprintf (message, va); | |
64 | va_end (va); | |
65 | ||
66 | realm_diagnostics_error (invocation, NULL, "%s: %s", string, | |
67 | krb5_get_error_message (context, code)); | |
68 | g_free (string); | |
69 | } | |
70 | ||
71 | static GBytes * | |
72 | kinit_to_kerberos_cache (GDBusMethodInvocation *invocation, | |
73 | const gchar *principal_name, | |
74 | const gchar *password) | |
75 | { | |
76 | krb5_get_init_creds_opt *options = NULL; | |
77 | krb5_context context = NULL; | |
78 | krb5_principal principal = NULL; | |
79 | krb5_error_code code; | |
80 | gchar *filename = NULL; | |
81 | krb5_ccache ccache = NULL; | |
82 | krb5_creds my_creds; | |
83 | GBytes *result = NULL; | |
84 | gchar *contents; | |
85 | gsize length; | |
86 | GError *error = NULL; | |
87 | int temp_fd; | |
88 | ||
89 | code = krb5_init_context (&context); | |
90 | if (code != 0) { | |
91 | handle_krb5_error (invocation, code, NULL, | |
92 | "Couldn't initialize kerberos"); | |
93 | goto cleanup; | |
94 | } | |
95 | ||
96 | code = krb5_parse_name (context, principal_name, &principal); | |
97 | if (code != 0) { | |
98 | handle_krb5_error (invocation, code, context, | |
99 | "Couldn't parse principal: %s", principal_name); | |
100 | goto cleanup; | |
101 | } | |
102 | ||
103 | code = krb5_get_init_creds_opt_alloc (context, &options); | |
104 | if (code != 0) { | |
105 | g_warning ("Couldn't setup kerberos options: %s", | |
106 | krb5_get_error_message (context, code)); | |
107 | goto cleanup; | |
108 | } | |
109 | ||
110 | filename = g_build_filename (g_get_tmp_dir (), "realmd-krb5-cache.XXXXXX", NULL); | |
111 | temp_fd = g_mkstemp_full (filename, O_RDWR, S_IRUSR | S_IWUSR); | |
112 | if (temp_fd == -1) { | |
113 | realm_diagnostics_error (invocation, NULL, | |
114 | "Couldn't create credential cache file: %s", | |
115 | g_strerror (errno)); | |
116 | goto cleanup; | |
117 | } | |
118 | close (temp_fd); | |
119 | ||
120 | code = krb5_cc_resolve (context, filename, &ccache); | |
121 | if (code != 0) { | |
122 | handle_krb5_error (invocation, code, context, | |
123 | "Couldn't resolve credential cache: %s", filename); | |
124 | goto cleanup; | |
125 | } | |
126 | ||
127 | code = krb5_get_init_creds_opt_set_out_ccache (context, options, ccache); | |
128 | if (code != 0) { | |
129 | g_warning ("Couldn't setup credential cache: %s", | |
130 | krb5_get_error_message (context, code)); | |
131 | goto cleanup; | |
132 | } | |
133 | ||
134 | code = krb5_get_init_creds_password (context, &my_creds, principal, | |
135 | (char *)password, NULL, 0, 0, NULL, options); | |
136 | if (code != 0) { | |
137 | handle_krb5_error (invocation, code, context, | |
138 | "Couldn't authenticate as: %s", principal_name); | |
139 | goto cleanup; | |
140 | } | |
141 | ||
142 | krb5_cc_close (context, ccache); | |
143 | ccache = NULL; | |
144 | ||
145 | g_file_get_contents (filename, &contents, &length, &error); | |
146 | if (error != NULL) { | |
147 | realm_diagnostics_error (invocation, error, "Couldn't read credential cache"); | |
148 | g_error_free (error); | |
149 | } | |
150 | result = g_bytes_new_take (contents, length); | |
151 | ||
152 | cleanup: | |
153 | if (filename) { | |
154 | g_unlink (filename); | |
155 | g_free (filename); | |
156 | } | |
157 | ||
158 | if (options) | |
159 | krb5_get_init_creds_opt_free (context, options); | |
160 | if (principal) | |
161 | krb5_free_principal (context, principal); | |
162 | if (ccache) | |
163 | krb5_cc_close (context, ccache); | |
164 | if (context) | |
165 | krb5_free_context (context); | |
166 | return result; | |
167 | } | |
168 | ||
169 | 52 | typedef struct { |
170 | 53 | RealmKerberos *self; |
171 | 54 | GDBusMethodInvocation *invocation; |
175 | 58 | method_closure_new (RealmKerberos *self, |
176 | 59 | GDBusMethodInvocation *invocation) |
177 | 60 | { |
178 | MethodClosure *closure = g_slice_new (MethodClosure); | |
179 | closure->self = g_object_ref (self); | |
180 | closure->invocation = g_object_ref (invocation); | |
181 | return closure; | |
61 | MethodClosure *method = g_slice_new (MethodClosure); | |
62 | method->self = g_object_ref (self); | |
63 | method->invocation = g_object_ref (invocation); | |
64 | return method; | |
182 | 65 | } |
183 | 66 | |
184 | 67 | static void |
190 | 73 | } |
191 | 74 | |
192 | 75 | static void |
76 | enroll_method_reply (GDBusMethodInvocation *invocation, | |
77 | GError *error) | |
78 | { | |
79 | if (error == NULL) { | |
80 | realm_diagnostics_info (invocation, "Successfully enrolled machine in realm"); | |
81 | g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); | |
82 | ||
83 | } else if (error->domain == REALM_ERROR || error->domain == G_DBUS_ERROR) { | |
84 | realm_diagnostics_error (invocation, error, NULL); | |
85 | g_dbus_method_invocation_return_gerror (invocation, error); | |
86 | ||
87 | } else { | |
88 | realm_diagnostics_error (invocation, error, "Failed to enroll machine in realm"); | |
89 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_ENROLL_FAILED, | |
90 | _("Failed to enroll machine in realm. See diagnostics.")); | |
91 | } | |
92 | ||
93 | realm_daemon_unlock_for_action (invocation); | |
94 | } | |
95 | ||
96 | static void | |
193 | 97 | on_enroll_complete (GObject *source, |
194 | 98 | GAsyncResult *result, |
195 | 99 | gpointer user_data) |
199 | 103 | GError *error = NULL; |
200 | 104 | |
201 | 105 | klass = REALM_KERBEROS_GET_CLASS (closure->self); |
202 | g_return_if_fail (klass->enroll_finish != NULL); | |
106 | g_return_if_fail (klass->unenroll_finish != NULL); | |
203 | 107 | |
204 | 108 | (klass->enroll_finish) (closure->self, result, &error); |
109 | enroll_method_reply (closure->invocation, error); | |
110 | ||
111 | g_clear_error (&error); | |
112 | method_closure_free (closure); | |
113 | } | |
114 | ||
115 | static void | |
116 | unenroll_method_reply (GDBusMethodInvocation *invocation, | |
117 | GError *error) | |
118 | { | |
205 | 119 | if (error == NULL) { |
206 | realm_diagnostics_info (closure->invocation, "Successfully enrolled machine in realm"); | |
120 | realm_diagnostics_info (invocation, "Successfully unenrolled machine from realm"); | |
121 | g_dbus_method_invocation_return_value (invocation, g_variant_new ("()")); | |
122 | ||
123 | } else if (error->domain == REALM_ERROR || error->domain == G_DBUS_ERROR) { | |
124 | realm_diagnostics_error (invocation, error, NULL); | |
125 | g_dbus_method_invocation_return_gerror (invocation, error); | |
126 | ||
127 | } else { | |
128 | realm_diagnostics_error (invocation, error, "Failed to unenroll machine from realm"); | |
129 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_UNENROLL_FAILED, | |
130 | _("Failed to unenroll machine from domain. See diagnostics.")); | |
131 | } | |
132 | ||
133 | realm_daemon_unlock_for_action (invocation); | |
134 | } | |
135 | ||
136 | static void | |
137 | on_unenroll_complete (GObject *source, | |
138 | GAsyncResult *result, | |
139 | gpointer user_data) | |
140 | { | |
141 | MethodClosure *closure = user_data; | |
142 | RealmKerberosClass *klass; | |
143 | GError *error = NULL; | |
144 | ||
145 | klass = REALM_KERBEROS_GET_CLASS (closure->self); | |
146 | g_return_if_fail (klass->unenroll_finish != NULL); | |
147 | ||
148 | (klass->unenroll_finish) (closure->self, result, &error); | |
149 | unenroll_method_reply (closure->invocation, error); | |
150 | ||
151 | g_clear_error (&error); | |
152 | method_closure_free (closure); | |
153 | } | |
154 | ||
155 | static void | |
156 | enroll_or_unenroll_with_ccache (RealmKerberos *self, | |
157 | RealmKerberosFlags flags, | |
158 | GDBusMethodInvocation *invocation, | |
159 | GVariant *ccache, | |
160 | gboolean enroll) | |
161 | { | |
162 | RealmKerberosClass *klass = REALM_KERBEROS_GET_CLASS (self); | |
163 | const guchar *data; | |
164 | GBytes *bytes; | |
165 | gsize length; | |
166 | ||
167 | if ((enroll && klass->enroll_ccache_async == NULL) || | |
168 | (!enroll && klass->unenroll_ccache_async == NULL)) { | |
169 | g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, | |
170 | enroll ? | |
171 | _("Enrolling this realm using a credential cache is not supported") : | |
172 | _("Unenrolling this realm using a credential cache is not supported")); | |
173 | return; | |
174 | } | |
175 | ||
176 | data = g_variant_get_fixed_array (ccache, &length, 1); | |
177 | if (length == 0) { | |
178 | g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, | |
179 | _("Invalid zero length credential cache argument")); | |
180 | return; | |
181 | } | |
182 | ||
183 | if (!realm_daemon_lock_for_action (invocation)) { | |
184 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_BUSY, | |
185 | _("Already running another action")); | |
186 | return; | |
187 | } | |
188 | ||
189 | bytes = g_bytes_new_with_free_func (data, length, | |
190 | (GDestroyNotify)g_variant_unref, | |
191 | g_variant_ref (ccache)); | |
192 | ||
193 | if (enroll) { | |
194 | g_return_if_fail (klass->enroll_finish != NULL); | |
195 | (klass->enroll_ccache_async) (self, bytes, flags, invocation, on_enroll_complete, | |
196 | method_closure_new (self, invocation)); | |
197 | } else { | |
198 | g_return_if_fail (klass->unenroll_finish != NULL); | |
199 | (klass->unenroll_ccache_async) (self, bytes, flags, invocation, on_unenroll_complete, | |
200 | method_closure_new (self, invocation)); | |
201 | } | |
202 | ||
203 | g_bytes_unref (bytes); | |
204 | } | |
205 | ||
206 | static void | |
207 | enroll_or_unenroll_with_password (RealmKerberos *self, | |
208 | RealmKerberosFlags flags, | |
209 | GDBusMethodInvocation *invocation, | |
210 | const gchar *name, | |
211 | const gchar *password, | |
212 | gboolean enroll) | |
213 | { | |
214 | RealmKerberosClass *klass = REALM_KERBEROS_GET_CLASS (self); | |
215 | ||
216 | if (enroll && klass->enroll_password_async == NULL) { | |
217 | g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, | |
218 | enroll ? | |
219 | _("Enrolling this realm using a password is not supported") : | |
220 | _("Unenrolling this realm using a password is not supported")); | |
221 | return; | |
222 | } | |
223 | ||
224 | if (!realm_daemon_lock_for_action (invocation)) { | |
225 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_BUSY, | |
226 | _("Already running another action")); | |
227 | return; | |
228 | } | |
229 | ||
230 | ||
231 | if (enroll) { | |
232 | g_return_if_fail (klass->enroll_finish != NULL); | |
233 | (klass->enroll_password_async) (self, name, password, flags, invocation, on_enroll_complete, | |
234 | method_closure_new (self, invocation)); | |
235 | ||
236 | } else { | |
237 | g_return_if_fail (klass->unenroll_finish != NULL); | |
238 | (klass->unenroll_password_async) (self, name, password, flags, invocation, on_unenroll_complete, | |
239 | method_closure_new (self, invocation)); | |
240 | } | |
241 | } | |
242 | ||
243 | static void | |
244 | enroll_or_unenroll_with_automatic (RealmKerberos *self, | |
245 | RealmKerberosFlags flags, | |
246 | GDBusMethodInvocation *invocation, | |
247 | gboolean enroll) | |
248 | { | |
249 | RealmKerberosClass *klass = REALM_KERBEROS_GET_CLASS (self); | |
250 | ||
251 | if ((enroll && klass->enroll_automatic_async == NULL) || | |
252 | (!enroll && klass->unenroll_automatic_async == NULL)) { | |
253 | g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, | |
254 | enroll ? | |
255 | _("Enrolling this realm without credentials is not supported") : | |
256 | _("Unenrolling this realm without credentials is not supported")); | |
257 | return; | |
258 | } | |
259 | ||
260 | if (!realm_daemon_lock_for_action (invocation)) { | |
261 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_BUSY, | |
262 | _("Already running another action")); | |
263 | return; | |
264 | } | |
265 | ||
266 | if (enroll) { | |
267 | g_return_if_fail (klass->enroll_finish != NULL); | |
268 | (klass->enroll_automatic_async) (self, flags, invocation, on_enroll_complete, | |
269 | method_closure_new (self, invocation)); | |
270 | } else { | |
271 | g_return_if_fail (klass->enroll_finish != NULL); | |
272 | (klass->unenroll_automatic_async) (self, flags, invocation, on_unenroll_complete, | |
273 | method_closure_new (self, invocation)); | |
274 | } | |
275 | } | |
276 | ||
277 | static gboolean | |
278 | validate_and_parse_credentials (GDBusMethodInvocation *invocation, | |
279 | GVariant *input, | |
280 | RealmKerberosFlags *flags, | |
281 | RealmKerberosCredential *cred_type, | |
282 | GVariant **creds) | |
283 | { | |
284 | GVariant *outer; | |
285 | const char *owner, *type; | |
286 | ||
287 | g_variant_get (input, "(&s&s@v)", &type, &owner, &outer); | |
288 | ||
289 | if (g_str_equal (owner, "administrator")) | |
290 | *flags |= REALM_KERBEROS_CREDENTIAL_ADMIN; | |
291 | else if (g_str_equal (owner, "user")) | |
292 | *flags |= REALM_KERBEROS_CREDENTIAL_USER; | |
293 | else if (g_str_equal (owner, "computer")) | |
294 | *flags |= REALM_KERBEROS_CREDENTIAL_COMPUTER; | |
295 | else if (g_str_equal (owner, "secret")) | |
296 | *flags |= REALM_KERBEROS_CREDENTIAL_SECRET; | |
297 | ||
298 | *creds = g_variant_get_variant (outer); | |
299 | g_variant_unref (outer); | |
300 | ||
301 | if (g_str_equal (type, "ccache")) { | |
302 | if (g_variant_is_of_type (*creds, G_VARIANT_TYPE ("ay"))) { | |
303 | *cred_type = REALM_KERBEROS_CREDENTIAL_CCACHE; | |
304 | return TRUE; | |
305 | } else { | |
306 | g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, | |
307 | "Credential cache argument is of wrong type"); | |
308 | } | |
309 | ||
310 | } else if (g_str_equal (type, "password")) { | |
311 | if (g_variant_is_of_type (*creds, G_VARIANT_TYPE ("(ss)"))) { | |
312 | *cred_type = REALM_KERBEROS_CREDENTIAL_PASSWORD; | |
313 | return TRUE; | |
314 | } else { | |
315 | g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, | |
316 | "Password credentials are of wrong type"); | |
317 | } | |
318 | ||
319 | } else if (g_str_equal (type, "automatic")) { | |
320 | *cred_type = REALM_KERBEROS_CREDENTIAL_AUTOMATIC; | |
321 | return TRUE; | |
322 | ||
323 | } else { | |
324 | g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, | |
325 | "Invalid or unsupported credential type"); | |
326 | } | |
327 | ||
328 | /* Parsing failed */ | |
329 | g_variant_unref (*creds); | |
330 | return FALSE; | |
331 | } | |
332 | ||
333 | static gboolean | |
334 | handle_enroll (RealmDbusKerberos *realm, | |
335 | GDBusMethodInvocation *invocation, | |
336 | GVariant *credentials, | |
337 | GVariant *options) | |
338 | { | |
339 | RealmKerberos *self = REALM_KERBEROS (realm); | |
340 | const char *name, *password; | |
341 | RealmKerberosFlags flags = 0; | |
342 | GVariant *creds; | |
343 | RealmKerberosCredential cred_type; | |
344 | ||
345 | /* Make note of the current operation id, for diagnostics */ | |
346 | realm_diagnostics_setup_options (invocation, options); | |
347 | ||
348 | if (!validate_and_parse_credentials (invocation, credentials, &flags, &cred_type, &creds)) | |
349 | return TRUE; | |
350 | ||
351 | switch (cred_type) { | |
352 | case REALM_KERBEROS_CREDENTIAL_CCACHE: | |
353 | enroll_or_unenroll_with_ccache (self, flags, invocation, creds, TRUE); | |
354 | break; | |
355 | case REALM_KERBEROS_CREDENTIAL_PASSWORD: | |
356 | g_variant_get (creds, "(&s&s)", &name, &password); | |
357 | enroll_or_unenroll_with_password (self, flags, invocation, name, password, TRUE); | |
358 | break; | |
359 | case REALM_KERBEROS_CREDENTIAL_AUTOMATIC: | |
360 | enroll_or_unenroll_with_automatic (self, flags, invocation, TRUE); | |
361 | break; | |
362 | default: | |
363 | g_assert_not_reached (); | |
364 | } | |
365 | ||
366 | g_variant_unref (creds); | |
367 | return TRUE; | |
368 | } | |
369 | ||
370 | static gboolean | |
371 | handle_unenroll (RealmDbusKerberos *realm, | |
372 | GDBusMethodInvocation *invocation, | |
373 | GVariant *credentials, | |
374 | GVariant *options) | |
375 | { | |
376 | RealmKerberos *self = REALM_KERBEROS (realm); | |
377 | const char *name, *password; | |
378 | RealmKerberosFlags flags = 0; | |
379 | GVariant *creds; | |
380 | RealmKerberosCredential cred_type; | |
381 | ||
382 | /* Make note of the current operation id, for diagnostics */ | |
383 | realm_diagnostics_setup_options (invocation, options); | |
384 | ||
385 | if (!validate_and_parse_credentials (invocation, credentials, &flags, &cred_type, &creds)) | |
386 | return TRUE; | |
387 | ||
388 | switch (cred_type) { | |
389 | case REALM_KERBEROS_CREDENTIAL_CCACHE: | |
390 | enroll_or_unenroll_with_ccache (self, flags, invocation, creds, FALSE); | |
391 | break; | |
392 | case REALM_KERBEROS_CREDENTIAL_PASSWORD: | |
393 | g_variant_get (creds, "(&s&s)", &name, &password); | |
394 | enroll_or_unenroll_with_password (self, flags, invocation, name, password, FALSE); | |
395 | break; | |
396 | case REALM_KERBEROS_CREDENTIAL_AUTOMATIC: | |
397 | enroll_or_unenroll_with_automatic (self, flags, invocation, FALSE); | |
398 | break; | |
399 | default: | |
400 | g_assert_not_reached (); | |
401 | } | |
402 | ||
403 | g_variant_unref (creds); | |
404 | return TRUE; | |
405 | } | |
406 | ||
407 | static void | |
408 | on_logins_complete (GObject *source, | |
409 | GAsyncResult *result, | |
410 | gpointer user_data) | |
411 | { | |
412 | MethodClosure *closure = user_data; | |
413 | RealmKerberosClass *klass; | |
414 | GError *error = NULL; | |
415 | ||
416 | klass = REALM_KERBEROS_GET_CLASS (closure->self); | |
417 | g_return_if_fail (klass->logins_finish != NULL); | |
418 | ||
419 | if ((klass->logins_finish) (closure->self, result, &error)) { | |
420 | realm_diagnostics_info (closure->invocation, "Successfully changed permitted logins for realm"); | |
207 | 421 | g_dbus_method_invocation_return_value (closure->invocation, g_variant_new ("()")); |
208 | 422 | |
209 | 423 | } else if (error != NULL && |
213 | 427 | g_error_free (error); |
214 | 428 | |
215 | 429 | } else { |
216 | realm_diagnostics_error (closure->invocation, error, "Failed to enroll machine in realm"); | |
217 | g_dbus_method_invocation_return_error (closure->invocation, REALM_ERROR, REALM_ERROR_ENROLL_FAILED, | |
218 | "Failed to enroll machine in realm. See diagnostics."); | |
219 | g_error_free (error); | |
220 | } | |
221 | ||
222 | realm_daemon_unlock_for_action (closure->invocation); | |
223 | method_closure_free (closure); | |
224 | } | |
225 | ||
226 | static gboolean | |
227 | handle_enroll_with_credential_cache (RealmDbusKerberos *realm, | |
228 | GDBusMethodInvocation *invocation, | |
229 | GVariant *admin_cache, | |
230 | GVariant *options, | |
231 | const gchar *operation_id) | |
232 | { | |
233 | RealmKerberos *self = REALM_KERBEROS (realm); | |
234 | GBytes *admin_kerberos_cache; | |
235 | RealmKerberosClass *klass; | |
236 | const guchar *data; | |
237 | gsize length; | |
238 | ||
239 | /* Make note of the current operation id, for diagnostics */ | |
240 | realm_diagnostics_mark_operation (invocation, operation_id); | |
241 | ||
242 | data = g_variant_get_fixed_array (admin_cache, &length, 1); | |
243 | if (length == 0) { | |
244 | g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, | |
245 | "Invalid zero length credential cache argument"); | |
246 | return TRUE; | |
247 | } | |
248 | ||
249 | if (!realm_daemon_lock_for_action (invocation)) { | |
250 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_BUSY, | |
251 | "Already running another action"); | |
252 | return TRUE; | |
253 | } | |
254 | ||
255 | klass = REALM_KERBEROS_GET_CLASS (self); | |
256 | g_return_val_if_fail (klass->enroll_async != NULL, FALSE); | |
257 | g_return_val_if_fail (klass->enroll_finish != NULL, FALSE); | |
258 | ||
259 | admin_kerberos_cache = g_bytes_new_with_free_func (data, length, | |
260 | (GDestroyNotify)g_variant_unref, | |
261 | g_variant_ref (admin_cache)); | |
262 | ||
263 | (klass->enroll_async) (self, admin_kerberos_cache, invocation, | |
264 | on_enroll_complete, method_closure_new (self, invocation)); | |
265 | ||
266 | g_bytes_unref (admin_kerberos_cache); | |
267 | return TRUE; | |
268 | } | |
269 | ||
270 | static gboolean | |
271 | handle_enroll_with_password (RealmDbusKerberos *realm, | |
272 | GDBusMethodInvocation *invocation, | |
273 | const gchar *principal, | |
274 | const gchar *password, | |
275 | GVariant *options, | |
276 | const gchar *operation_id) | |
277 | { | |
278 | RealmKerberos *self = REALM_KERBEROS (realm); | |
279 | GBytes *admin_kerberos_cache; | |
280 | RealmKerberosClass *klass; | |
281 | ||
282 | /* Make note of the current operation id, for diagnostics */ | |
283 | realm_diagnostics_mark_operation (invocation, operation_id); | |
284 | ||
285 | admin_kerberos_cache = kinit_to_kerberos_cache (invocation, principal, password); | |
286 | if (admin_kerberos_cache == NULL) { | |
287 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_AUTH_FAILED, | |
288 | "Failed to authenticate with password"); | |
289 | return TRUE; | |
290 | } | |
291 | ||
292 | if (!realm_daemon_lock_for_action (invocation)) { | |
293 | g_bytes_unref (admin_kerberos_cache); | |
294 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_BUSY, | |
295 | "Already running another action"); | |
296 | return TRUE; | |
297 | } | |
298 | ||
299 | klass = REALM_KERBEROS_GET_CLASS (self); | |
300 | g_return_val_if_fail (klass->enroll_async != NULL, FALSE); | |
301 | g_return_val_if_fail (klass->enroll_finish != NULL, FALSE); | |
302 | ||
303 | (klass->enroll_async) (self, admin_kerberos_cache, invocation, | |
304 | on_enroll_complete, method_closure_new (self, invocation)); | |
305 | ||
306 | g_bytes_unref (admin_kerberos_cache); | |
307 | return TRUE; | |
308 | } | |
309 | ||
310 | static void | |
311 | on_unenroll_complete (GObject *source, | |
312 | GAsyncResult *result, | |
313 | gpointer user_data) | |
314 | { | |
315 | MethodClosure *closure = user_data; | |
316 | RealmKerberosClass *klass; | |
317 | GError *error = NULL; | |
318 | ||
319 | klass = REALM_KERBEROS_GET_CLASS (closure->self); | |
320 | g_return_if_fail (klass->unenroll_finish != NULL); | |
321 | ||
322 | if ((klass->unenroll_finish) (closure->self, result, &error)) { | |
323 | realm_diagnostics_info (closure->invocation, "Successfully unenrolled machine from realm"); | |
324 | g_dbus_method_invocation_return_value (closure->invocation, g_variant_new ("()")); | |
325 | ||
326 | } else if (error != NULL && | |
327 | (error->domain == REALM_ERROR || error->domain == G_DBUS_ERROR)) { | |
328 | realm_diagnostics_error (closure->invocation, error, NULL); | |
329 | g_dbus_method_invocation_return_gerror (closure->invocation, error); | |
330 | g_error_free (error); | |
331 | ||
332 | } else { | |
333 | realm_diagnostics_error (closure->invocation, error, "Failed to unenroll machine from realm"); | |
334 | g_dbus_method_invocation_return_error (closure->invocation, REALM_ERROR, REALM_ERROR_UNENROLL_FAILED, | |
335 | "Failed to unenroll machine from domain. See diagnostics."); | |
336 | g_error_free (error); | |
337 | } | |
338 | ||
339 | realm_daemon_unlock_for_action (closure->invocation); | |
340 | method_closure_free (closure); | |
341 | } | |
342 | ||
343 | static gboolean | |
344 | handle_unenroll_with_credential_cache (RealmDbusKerberos *realm, | |
345 | GDBusMethodInvocation *invocation, | |
346 | GVariant *admin_cache, | |
347 | GVariant *options, | |
348 | const gchar *operation_id) | |
349 | { | |
350 | RealmKerberos *self = REALM_KERBEROS (realm); | |
351 | RealmKerberosClass *klass; | |
352 | GBytes *admin_kerberos_cache; | |
353 | const guchar *data; | |
354 | gsize length; | |
355 | ||
356 | /* Make note of the current operation id, for diagnostics */ | |
357 | realm_diagnostics_mark_operation (invocation, operation_id); | |
358 | ||
359 | data = g_variant_get_fixed_array (admin_cache, &length, 1); | |
360 | if (length == 0) { | |
361 | g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, | |
362 | "Invalid zero length credential cache argument"); | |
363 | return TRUE; | |
364 | } | |
365 | ||
366 | if (!realm_daemon_lock_for_action (invocation)) { | |
367 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_BUSY, | |
368 | "Already running another action"); | |
369 | return TRUE; | |
370 | } | |
371 | ||
372 | klass = REALM_KERBEROS_GET_CLASS (self); | |
373 | g_return_val_if_fail (klass->unenroll_async != NULL, FALSE); | |
374 | g_return_val_if_fail (klass->unenroll_finish != NULL, FALSE); | |
375 | ||
376 | admin_kerberos_cache = g_bytes_new_with_free_func (data, length, | |
377 | (GDestroyNotify)g_variant_unref, | |
378 | g_variant_ref (admin_cache)); | |
379 | ||
380 | (klass->unenroll_async) (self, admin_kerberos_cache, invocation, | |
381 | on_unenroll_complete, method_closure_new (self, invocation)); | |
382 | ||
383 | g_bytes_unref (admin_kerberos_cache); | |
384 | return TRUE; | |
385 | } | |
386 | ||
387 | static gboolean | |
388 | handle_unenroll_with_password (RealmDbusKerberos *realm, | |
389 | GDBusMethodInvocation *invocation, | |
390 | const gchar *principal, | |
391 | const gchar *password, | |
392 | GVariant *options, | |
393 | const gchar *operation_id) | |
394 | { | |
395 | RealmKerberos *self = REALM_KERBEROS (realm); | |
396 | RealmKerberosClass *klass; | |
397 | GBytes *admin_kerberos_cache; | |
398 | ||
399 | /* Make note of the current operation id, for diagnostics */ | |
400 | realm_diagnostics_mark_operation (invocation, operation_id); | |
401 | ||
402 | admin_kerberos_cache = kinit_to_kerberos_cache (invocation, principal, password); | |
403 | if (admin_kerberos_cache == NULL) { | |
404 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_AUTH_FAILED, | |
405 | "Failed to authenticate with password"); | |
406 | return TRUE; | |
407 | } | |
408 | ||
409 | if (!realm_daemon_lock_for_action (invocation)) { | |
410 | g_bytes_unref (admin_kerberos_cache); | |
411 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_BUSY, | |
412 | "Already running another action"); | |
413 | return TRUE; | |
414 | } | |
415 | ||
416 | klass = REALM_KERBEROS_GET_CLASS (self); | |
417 | g_return_val_if_fail (klass->unenroll_async != NULL, FALSE); | |
418 | g_return_val_if_fail (klass->unenroll_finish != NULL, FALSE); | |
419 | ||
420 | (klass->unenroll_async) (self, admin_kerberos_cache, invocation, | |
421 | on_unenroll_complete, method_closure_new (self, invocation)); | |
422 | ||
423 | g_bytes_unref (admin_kerberos_cache); | |
424 | return TRUE; | |
425 | } | |
426 | ||
427 | static void | |
428 | on_logins_complete (GObject *source, | |
429 | GAsyncResult *result, | |
430 | gpointer user_data) | |
431 | { | |
432 | MethodClosure *closure = user_data; | |
433 | RealmKerberosClass *klass; | |
434 | GError *error = NULL; | |
435 | ||
436 | klass = REALM_KERBEROS_GET_CLASS (closure->self); | |
437 | g_return_if_fail (klass->logins_finish != NULL); | |
438 | ||
439 | if ((klass->logins_finish) (closure->self, result, &error)) { | |
440 | realm_diagnostics_info (closure->invocation, "Successfully changed permitted logins for realm"); | |
441 | g_dbus_method_invocation_return_value (closure->invocation, g_variant_new ("()")); | |
442 | ||
443 | } else if (error != NULL && | |
444 | (error->domain == REALM_ERROR || error->domain == G_DBUS_ERROR)) { | |
445 | realm_diagnostics_error (closure->invocation, error, NULL); | |
446 | g_dbus_method_invocation_return_gerror (closure->invocation, error); | |
447 | g_error_free (error); | |
448 | ||
449 | } else { | |
450 | 430 | realm_diagnostics_error (closure->invocation, error, "Failed to change permitted logins"); |
451 | 431 | g_dbus_method_invocation_return_error (closure->invocation, REALM_ERROR, REALM_ERROR_INTERNAL, |
452 | "Failed to change permitted logins. See diagnostics."); | |
432 | _("Failed to change permitted logins. See diagnostics.")); | |
453 | 433 | g_error_free (error); |
454 | 434 | } |
455 | 435 | |
463 | 443 | const gchar *login_policy, |
464 | 444 | const gchar *const *add, |
465 | 445 | const gchar *const *remove, |
466 | const gchar *operation_id) | |
446 | GVariant *options) | |
467 | 447 | { |
468 | 448 | RealmKerberosLoginPolicy policy = REALM_KERBEROS_POLICY_NOT_SET; |
469 | 449 | RealmKerberos *self = REALM_KERBEROS (realm); |
473 | 453 | gint i; |
474 | 454 | |
475 | 455 | /* Make note of the current operation id, for diagnostics */ |
476 | realm_diagnostics_mark_operation (invocation, operation_id); | |
456 | realm_diagnostics_setup_options (invocation, options); | |
477 | 457 | |
478 | 458 | policies = g_strsplit_set (login_policy, ", \t", -1); |
479 | 459 | for (i = 0; policies[i] != NULL; i++) { |
506 | 486 | |
507 | 487 | if (!realm_daemon_lock_for_action (invocation)) { |
508 | 488 | g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_BUSY, |
509 | "Already running another action"); | |
489 | _("Already running another action")); | |
510 | 490 | return TRUE; |
511 | 491 | } |
512 | 492 | |
531 | 511 | |
532 | 512 | /* Each method has its own polkit authorization */ |
533 | 513 | if (g_str_equal (interface, REALM_DBUS_KERBEROS_REALM_INTERFACE)) { |
534 | if (g_str_equal (method, "EnrollWithCredentialCache") || | |
535 | g_str_equal (method, "EnrollWithPassword")) { | |
514 | if (g_str_equal (method, "Enroll")) { | |
536 | 515 | action_id = "org.freedesktop.realmd.enroll-machine"; |
537 | 516 | |
538 | } else if (g_str_equal (method, "UnenrollWithCredentialCache") || | |
539 | g_str_equal (method, "UnenrollWithPassword")) { | |
517 | } else if (g_str_equal (method, "Unenroll")) { | |
540 | 518 | action_id = "org.freedesktop.realmd.unenroll-machine"; |
541 | 519 | |
542 | 520 | } else if (g_str_equal (method, "ChangeLoginPolicy")) { |
559 | 537 | realm_debug ("rejecting access to: %s.%s method on %s", |
560 | 538 | interface, method, g_dbus_method_invocation_get_object_path (invocation)); |
561 | 539 | g_dbus_method_invocation_return_dbus_error (invocation, REALM_DBUS_ERROR_NOT_AUTHORIZED, |
562 | "Not authorized to perform this action"); | |
540 | _("Not authorized to perform this action")); | |
563 | 541 | } |
564 | 542 | |
565 | 543 | return ret; |
642 | 620 | realm_kerberos_iface_init (RealmDbusKerberosIface *iface) |
643 | 621 | { |
644 | 622 | memcpy (iface, g_type_interface_peek_parent (iface), sizeof (*iface)); |
645 | iface->handle_enroll_with_password = handle_enroll_with_password; | |
646 | iface->handle_unenroll_with_password = handle_unenroll_with_password; | |
647 | iface->handle_enroll_with_credential_cache = handle_enroll_with_credential_cache; | |
648 | iface->handle_unenroll_with_credential_cache = handle_unenroll_with_credential_cache; | |
623 | iface->handle_enroll = handle_enroll; | |
624 | iface->handle_unenroll = handle_unenroll; | |
649 | 625 | iface->handle_change_login_policy = handle_change_login_policy; |
650 | 626 | } |
651 | 627 | |
704 | 680 | if (format == NULL) { |
705 | 681 | g_set_error (error, REALM_ERROR, |
706 | 682 | REALM_ERROR_NOT_ENROLLED, |
707 | "The realm does not allow specifying logins"); | |
683 | _("The realm does not allow specifying logins")); | |
708 | 684 | return NULL; |
709 | 685 | } |
710 | 686 | |
712 | 688 | if (result == NULL) { |
713 | 689 | g_set_error (error, G_DBUS_ERROR, |
714 | 690 | G_DBUS_ERROR_INVALID_ARGS, |
715 | "Invalid login argument%s%s%s does not match the login format '%s'", | |
691 | _("Invalid login argument%s%s%s does not match the login format '%s'"), | |
716 | 692 | failed ? " '" : "", failed, failed ? "'" : "", format); |
717 | 693 | } |
718 | 694 | |
734 | 710 | |
735 | 711 | return realm_login_name_format (format, user); |
736 | 712 | } |
713 | ||
714 | GVariant * | |
715 | realm_kerberos_build_supported_credentials (RealmKerberosCredential cred_type, | |
716 | RealmKerberosFlags cred_owner, | |
717 | ...) | |
718 | { | |
719 | GPtrArray *elements; | |
720 | GVariant *tuple[2]; | |
721 | const gchar *string; | |
722 | GVariant *supported; | |
723 | va_list va; | |
724 | ||
725 | va_start (va, cred_owner); | |
726 | elements = g_ptr_array_new (); | |
727 | ||
728 | while (cred_type != 0) { | |
729 | if (cred_owner & REALM_KERBEROS_CREDENTIAL_ADMIN) | |
730 | string = "administrator"; | |
731 | else if (cred_owner & REALM_KERBEROS_CREDENTIAL_USER) | |
732 | string = "user"; | |
733 | else if (cred_owner & REALM_KERBEROS_CREDENTIAL_COMPUTER) | |
734 | string = "computer"; | |
735 | else if (cred_owner & REALM_KERBEROS_CREDENTIAL_SECRET) | |
736 | string = "secret"; | |
737 | else | |
738 | g_assert_not_reached (); | |
739 | ||
740 | tuple[1] = g_variant_new_string (string); | |
741 | ||
742 | switch (cred_type) { | |
743 | case REALM_KERBEROS_CREDENTIAL_CCACHE: | |
744 | string = "ccache"; | |
745 | break; | |
746 | case REALM_KERBEROS_CREDENTIAL_PASSWORD: | |
747 | string = "password"; | |
748 | break; | |
749 | case REALM_KERBEROS_CREDENTIAL_AUTOMATIC: | |
750 | string = "automatic"; | |
751 | break; | |
752 | default: | |
753 | g_assert_not_reached (); | |
754 | break; | |
755 | } | |
756 | ||
757 | tuple[0] = g_variant_new_string (string); | |
758 | ||
759 | g_ptr_array_add (elements, g_variant_new_tuple (tuple, 2)); | |
760 | ||
761 | cred_type = va_arg (va, RealmKerberosCredential); | |
762 | if (cred_type != 0) | |
763 | cred_owner = va_arg (va, RealmKerberosFlags); | |
764 | } | |
765 | ||
766 | va_end (va); | |
767 | ||
768 | supported = g_variant_new_array (G_VARIANT_TYPE ("(ss)"), | |
769 | (GVariant *const *)elements->pdata, | |
770 | elements->len); | |
771 | ||
772 | g_ptr_array_free (elements, TRUE); | |
773 | g_variant_ref_sink (supported); | |
774 | return supported; | |
775 | } | |
776 | ||
777 | typedef struct { | |
778 | GDBusMethodInvocation *invocation; | |
779 | gchar *principal; | |
780 | gchar *password; | |
781 | krb5_enctype *enctypes; | |
782 | gint n_enctypes; | |
783 | GBytes *ccache; | |
784 | } KinitClosure; | |
785 | ||
786 | static void | |
787 | kinit_closure_free (gpointer data) | |
788 | { | |
789 | KinitClosure *kinit = data; | |
790 | g_object_unref (kinit->invocation); | |
791 | g_free (kinit->principal); | |
792 | g_free (kinit->password); | |
793 | g_free (kinit->enctypes); | |
794 | if (kinit->ccache) | |
795 | g_bytes_unref (kinit->ccache); | |
796 | g_slice_free (KinitClosure, kinit); | |
797 | } | |
798 | ||
799 | ||
800 | static void | |
801 | kinit_handle_error (GSimpleAsyncResult *async, | |
802 | krb5_error_code code, | |
803 | krb5_context context, | |
804 | const gchar *message, | |
805 | ...) | |
806 | { | |
807 | gchar *string; | |
808 | va_list va; | |
809 | ||
810 | va_start (va, message); | |
811 | string = g_strdup_vprintf (message, va); | |
812 | va_end (va); | |
813 | ||
814 | g_simple_async_result_set_error (async, REALM_KRB5_ERROR, code, | |
815 | "%s: %s", string, krb5_get_error_message (context, code)); | |
816 | g_free (string); | |
817 | } | |
818 | ||
819 | static void | |
820 | kinit_ccache_thread_func (GSimpleAsyncResult *async, | |
821 | GObject *object, | |
822 | GCancellable *cancellable) | |
823 | { | |
824 | KinitClosure *kinit = g_simple_async_result_get_op_res_gpointer (async); | |
825 | krb5_get_init_creds_opt *options = NULL; | |
826 | krb5_context context = NULL; | |
827 | krb5_principal principal = NULL; | |
828 | krb5_error_code code; | |
829 | gchar *filename = NULL; | |
830 | krb5_ccache ccache = NULL; | |
831 | krb5_creds my_creds; | |
832 | gchar *contents; | |
833 | gsize length; | |
834 | GError *error = NULL; | |
835 | int temp_fd; | |
836 | ||
837 | code = krb5_init_context (&context); | |
838 | if (code != 0) { | |
839 | kinit_handle_error (async, code, NULL, "Couldn't initialize kerberos"); | |
840 | goto cleanup; | |
841 | } | |
842 | ||
843 | code = krb5_parse_name (context, kinit->principal, &principal); | |
844 | if (code != 0) { | |
845 | kinit_handle_error (async, code, context, | |
846 | "Couldn't parse principal: %s", kinit->principal); | |
847 | goto cleanup; | |
848 | } | |
849 | ||
850 | code = krb5_get_init_creds_opt_alloc (context, &options); | |
851 | if (code != 0) { | |
852 | g_warning ("Couldn't setup kerberos options: %s", | |
853 | krb5_get_error_message (context, code)); | |
854 | goto cleanup; | |
855 | } | |
856 | ||
857 | filename = g_build_filename (g_get_tmp_dir (), "realmd-krb5-cache.XXXXXX", NULL); | |
858 | temp_fd = g_mkstemp_full (filename, O_RDWR, S_IRUSR | S_IWUSR); | |
859 | if (temp_fd == -1) { | |
860 | g_simple_async_result_set_error (async, G_FILE_ERROR, g_file_error_from_errno (errno), | |
861 | "Couldn't create credential cache file: %s", | |
862 | g_strerror (errno)); | |
863 | goto cleanup; | |
864 | } | |
865 | close (temp_fd); | |
866 | ||
867 | code = krb5_cc_resolve (context, filename, &ccache); | |
868 | if (code != 0) { | |
869 | kinit_handle_error (async, code, context, | |
870 | "Couldn't resolve credential cache: %s", filename); | |
871 | goto cleanup; | |
872 | } | |
873 | ||
874 | if (kinit->enctypes) | |
875 | krb5_get_init_creds_opt_set_etype_list (options, kinit->enctypes, kinit->n_enctypes); | |
876 | ||
877 | code = krb5_get_init_creds_opt_set_out_ccache (context, options, ccache); | |
878 | if (code != 0) { | |
879 | g_warning ("Couldn't setup credential cache: %s", | |
880 | krb5_get_error_message (context, code)); | |
881 | goto cleanup; | |
882 | } | |
883 | ||
884 | code = krb5_get_init_creds_password (context, &my_creds, principal, | |
885 | kinit->password, NULL, 0, 0, NULL, options); | |
886 | if (code != 0) { | |
887 | kinit_handle_error (async, code, context, | |
888 | "Couldn't authenticate as: %s", kinit->principal); | |
889 | goto cleanup; | |
890 | } | |
891 | ||
892 | krb5_cc_close (context, ccache); | |
893 | ccache = NULL; | |
894 | ||
895 | g_file_get_contents (filename, &contents, &length, &error); | |
896 | if (error != NULL) { | |
897 | g_simple_async_result_take_error (async, error); | |
898 | goto cleanup; | |
899 | } | |
900 | ||
901 | kinit->ccache = g_bytes_new_take (contents, length); | |
902 | ||
903 | cleanup: | |
904 | if (filename) { | |
905 | if (!realm_debug_flag_is_set (REALM_DEBUG_LEAVE_TEMP_FILES)) | |
906 | g_unlink (filename); | |
907 | g_free (filename); | |
908 | } | |
909 | ||
910 | if (options) | |
911 | krb5_get_init_creds_opt_free (context, options); | |
912 | if (principal) | |
913 | krb5_free_principal (context, principal); | |
914 | if (ccache) | |
915 | krb5_cc_close (context, ccache); | |
916 | if (context) | |
917 | krb5_free_context (context); | |
918 | } | |
919 | ||
920 | void | |
921 | realm_kerberos_kinit_ccache_async (RealmKerberos *self, | |
922 | const gchar *name, | |
923 | const gchar *password, | |
924 | const krb5_enctype *enctypes, | |
925 | GDBusMethodInvocation *invocation, | |
926 | GAsyncReadyCallback callback, | |
927 | gpointer user_data) | |
928 | { | |
929 | GSimpleAsyncResult *async; | |
930 | KinitClosure *kinit; | |
931 | ||
932 | g_return_if_fail (REALM_IS_KERBEROS (self)); | |
933 | g_return_if_fail (name != NULL); | |
934 | g_return_if_fail (password != NULL); | |
935 | ||
936 | async = g_simple_async_result_new (G_OBJECT (self), callback, user_data, | |
937 | realm_kerberos_kinit_ccache_async); | |
938 | kinit = g_slice_new0 (KinitClosure); | |
939 | kinit->password = g_strdup (password); | |
940 | kinit->invocation = g_object_ref (invocation); | |
941 | ||
942 | if (enctypes != NULL) { | |
943 | while (enctypes[kinit->n_enctypes]) | |
944 | kinit->n_enctypes++; | |
945 | kinit->enctypes = g_memdup (enctypes, sizeof (krb5_enctype) * kinit->n_enctypes); | |
946 | } | |
947 | ||
948 | if (strchr (name, '@') == NULL) { | |
949 | kinit->principal = g_strdup_printf ("%s@%s", name, | |
950 | realm_dbus_kerberos_get_name (REALM_DBUS_KERBEROS (self))); | |
951 | } else { | |
952 | kinit->principal = g_strdup (name); | |
953 | } | |
954 | ||
955 | g_simple_async_result_set_op_res_gpointer (async, kinit, kinit_closure_free); | |
956 | g_simple_async_result_run_in_thread (async, kinit_ccache_thread_func, G_PRIORITY_DEFAULT, NULL); | |
957 | g_object_unref (async); | |
958 | } | |
959 | ||
960 | GBytes * | |
961 | realm_kerberos_kinit_ccache_finish (RealmKerberos *self, | |
962 | GAsyncResult *result, | |
963 | GError **error) | |
964 | { | |
965 | GSimpleAsyncResult *async; | |
966 | KinitClosure *kinit; | |
967 | GError *krb5_error = NULL; | |
968 | ||
969 | g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), | |
970 | realm_kerberos_kinit_ccache_async), NULL); | |
971 | g_return_val_if_fail (error == NULL || *error == NULL, NULL); | |
972 | ||
973 | async = G_SIMPLE_ASYNC_RESULT (result); | |
974 | kinit = g_simple_async_result_get_op_res_gpointer (async); | |
975 | ||
976 | if (g_simple_async_result_propagate_error (async, &krb5_error)) { | |
977 | realm_diagnostics_error (kinit->invocation, krb5_error, NULL); | |
978 | ||
979 | if (g_error_matches (krb5_error, REALM_KRB5_ERROR, KRB5KDC_ERR_PREAUTH_FAILED) || | |
980 | g_error_matches (krb5_error, REALM_KRB5_ERROR, KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN) || | |
981 | g_error_matches (krb5_error, REALM_KRB5_ERROR, KRB5KDC_ERR_KEY_EXP) || | |
982 | g_error_matches (krb5_error, REALM_KRB5_ERROR, KRB5KDC_ERR_CLIENT_REVOKED) || | |
983 | g_error_matches (krb5_error, REALM_KRB5_ERROR, KRB5KDC_ERR_POLICY) || | |
984 | g_error_matches (krb5_error, REALM_KRB5_ERROR, KRB5KDC_ERR_ETYPE_NOSUPP)) { | |
985 | g_set_error (error, REALM_ERROR, REALM_ERROR_AUTH_FAILED, | |
986 | "Couldn't authenticate as: %s: %s", kinit->principal, | |
987 | krb5_error->message); | |
988 | g_error_free (krb5_error); | |
989 | return NULL; | |
990 | } | |
991 | ||
992 | g_propagate_error (error, krb5_error); | |
993 | return NULL; | |
994 | } | |
995 | ||
996 | g_return_val_if_fail (kinit->ccache != NULL, NULL); | |
997 | return g_bytes_ref (kinit->ccache); | |
998 | } |
18 | 18 | |
19 | 19 | #include <gio/gio.h> |
20 | 20 | |
21 | #include <krb5/krb5.h> | |
22 | ||
21 | 23 | #include "realm-dbus-generated.h" |
22 | 24 | |
23 | 25 | G_BEGIN_DECLS |
28 | 30 | REALM_KERBEROS_ALLOW_PERMITTED_LOGINS = 2, |
29 | 31 | REALM_KERBEROS_DENY_ANY_LOGIN = 3, |
30 | 32 | } RealmKerberosLoginPolicy; |
33 | ||
34 | typedef enum { | |
35 | REALM_KERBEROS_CREDENTIAL_ADMIN = 1 << 1, | |
36 | REALM_KERBEROS_CREDENTIAL_USER = 1 << 2, | |
37 | REALM_KERBEROS_CREDENTIAL_COMPUTER = 1 << 3, | |
38 | REALM_KERBEROS_CREDENTIAL_SECRET = 1 << 4, | |
39 | } RealmKerberosFlags; | |
40 | ||
41 | typedef enum { | |
42 | REALM_KERBEROS_CREDENTIAL_CCACHE = 1, | |
43 | REALM_KERBEROS_CREDENTIAL_PASSWORD, | |
44 | REALM_KERBEROS_CREDENTIAL_AUTOMATIC, | |
45 | } RealmKerberosCredential; | |
31 | 46 | |
32 | 47 | #define REALM_TYPE_KERBEROS (realm_kerberos_get_type ()) |
33 | 48 | #define REALM_KERBEROS(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), REALM_TYPE_KERBEROS, RealmKerberos)) |
48 | 63 | struct _RealmKerberosClass { |
49 | 64 | RealmDbusKerberosSkeletonClass parent_class; |
50 | 65 | |
51 | void (* enroll_async) (RealmKerberos *realm, | |
52 | GBytes *admin_kerberos_cache, | |
53 | GDBusMethodInvocation *invocation, | |
54 | GAsyncReadyCallback callback, | |
55 | gpointer user_data); | |
66 | void (* enroll_password_async) (RealmKerberos *realm, | |
67 | const char *name, | |
68 | const char *password, | |
69 | RealmKerberosFlags flags, | |
70 | GDBusMethodInvocation *invocation, | |
71 | GAsyncReadyCallback callback, | |
72 | gpointer user_data); | |
56 | 73 | |
57 | gboolean (* enroll_finish) (RealmKerberos *realm, | |
58 | GAsyncResult *result, | |
59 | GError **error); | |
74 | void (* enroll_ccache_async) (RealmKerberos *realm, | |
75 | GBytes *ccache, | |
76 | RealmKerberosFlags flags, | |
77 | GDBusMethodInvocation *invocation, | |
78 | GAsyncReadyCallback callback, | |
79 | gpointer user_data); | |
60 | 80 | |
61 | void (* unenroll_async) (RealmKerberos *realm, | |
62 | GBytes *admin_kerberos_cache, | |
63 | GDBusMethodInvocation *invocation, | |
64 | GAsyncReadyCallback callback, | |
65 | gpointer user_data); | |
81 | void (* enroll_automatic_async) (RealmKerberos *realm, | |
82 | RealmKerberosFlags flags, | |
83 | GDBusMethodInvocation *invocation, | |
84 | GAsyncReadyCallback callback, | |
85 | gpointer user_data); | |
66 | 86 | |
67 | gboolean (* unenroll_finish) (RealmKerberos *realm, | |
68 | GAsyncResult *result, | |
69 | GError **error); | |
87 | gboolean (* enroll_finish) (RealmKerberos *realm, | |
88 | GAsyncResult *result, | |
89 | GError **error); | |
70 | 90 | |
71 | void (* logins_async) (RealmKerberos *realm, | |
72 | GDBusMethodInvocation *invocation, | |
73 | RealmKerberosLoginPolicy login_policy, | |
74 | const gchar **permitted_add, | |
75 | const gchar **permitted_remove, | |
76 | GAsyncReadyCallback callback, | |
77 | gpointer user_data); | |
91 | void (* unenroll_password_async) (RealmKerberos *realm, | |
92 | const char *name, | |
93 | const char *password, | |
94 | RealmKerberosFlags flags, | |
95 | GDBusMethodInvocation *invocation, | |
96 | GAsyncReadyCallback callback, | |
97 | gpointer user_data); | |
78 | 98 | |
79 | gboolean (* logins_finish) (RealmKerberos *realm, | |
80 | GAsyncResult *result, | |
81 | GError **error); | |
99 | void (* unenroll_ccache_async) (RealmKerberos *realm, | |
100 | GBytes *ccache, | |
101 | RealmKerberosFlags flags, | |
102 | GDBusMethodInvocation *invocation, | |
103 | GAsyncReadyCallback callback, | |
104 | gpointer user_data); | |
105 | ||
106 | void (* unenroll_automatic_async) (RealmKerberos *realm, | |
107 | RealmKerberosFlags flags, | |
108 | GDBusMethodInvocation *invocation, | |
109 | GAsyncReadyCallback callback, | |
110 | gpointer user_data); | |
111 | ||
112 | gboolean (* unenroll_finish) (RealmKerberos *realm, | |
113 | GAsyncResult *result, | |
114 | GError **error); | |
115 | ||
116 | void (* logins_async) (RealmKerberos *realm, | |
117 | GDBusMethodInvocation *invocation, | |
118 | RealmKerberosLoginPolicy login_policy, | |
119 | const gchar **permitted_add, | |
120 | const gchar **permitted_remove, | |
121 | GAsyncReadyCallback callback, | |
122 | gpointer user_data); | |
123 | ||
124 | gboolean (* logins_finish) (RealmKerberos *realm, | |
125 | GAsyncResult *result, | |
126 | GError **error); | |
82 | 127 | |
83 | 128 | }; |
84 | 129 | |
101 | 146 | gchar * realm_kerberos_format_login (RealmKerberos *self, |
102 | 147 | const gchar *user); |
103 | 148 | |
149 | GVariant * realm_kerberos_build_supported_credentials (RealmKerberosCredential cred_type, | |
150 | RealmKerberosFlags cred_owner, | |
151 | ...); | |
152 | ||
153 | void realm_kerberos_kinit_ccache_async (RealmKerberos *self, | |
154 | const gchar *name, | |
155 | const gchar *password, | |
156 | const krb5_enctype *enctypes, | |
157 | GDBusMethodInvocation *invocation, | |
158 | GAsyncReadyCallback callback, | |
159 | gpointer user_data); | |
160 | ||
161 | GBytes * realm_kerberos_kinit_ccache_finish (RealmKerberos *self, | |
162 | GAsyncResult *result, | |
163 | GError **error); | |
164 | ||
104 | 165 | G_END_DECLS |
105 | 166 | |
106 | 167 | #endif /* __REALM_KERBEROS_H__ */ |
27 | 27 | #include <glib/gi18n.h> |
28 | 28 | #include <gio/gio.h> |
29 | 29 | |
30 | static GHashTable *provider_owner_ids = NULL; | |
31 | ||
32 | 30 | static void realm_provider_iface_init (RealmDbusProviderIface *iface); |
33 | 31 | |
34 | 32 | G_DEFINE_TYPE_WITH_CODE (RealmProvider, realm_provider, REALM_DBUS_TYPE_PROVIDER_SKELETON, |
68 | 66 | gpointer user_data) |
69 | 67 | { |
70 | 68 | MethodClosure *closure = user_data; |
71 | RealmProviderClass *klass; | |
72 | 69 | GVariant *retval; |
73 | 70 | GError *error = NULL; |
74 | 71 | GVariant *realms = NULL; |
75 | 72 | gint relevance; |
76 | 73 | |
77 | klass = REALM_PROVIDER_GET_CLASS (closure->self); | |
78 | g_return_if_fail (klass->discover_finish != NULL); | |
79 | ||
80 | relevance = (klass->discover_finish) (closure->self, result, &realms, &error); | |
74 | relevance = realm_provider_discover_finish (closure->self, result, &realms, &error); | |
81 | 75 | if (error == NULL) { |
82 | if (realms == NULL) { | |
83 | realms = g_variant_new_array (G_VARIANT_TYPE ("(sos)"), NULL, 0); | |
84 | g_variant_ref_sink (realms); | |
85 | } | |
86 | retval = g_variant_new ("(i@a(sos))", relevance, realms); | |
76 | retval = g_variant_new ("(i@a(os))", relevance, realms); | |
87 | 77 | g_dbus_method_invocation_return_value (closure->invocation, retval); |
88 | 78 | g_variant_unref (realms); |
89 | 79 | } else { |
90 | if (error->domain == REALM_ERROR) { | |
80 | if (error->domain == REALM_ERROR || error->domain == G_DBUS_ERROR) { | |
81 | g_dbus_error_strip_remote_error (error); | |
91 | 82 | realm_diagnostics_error (closure->invocation, error, NULL); |
92 | 83 | g_dbus_method_invocation_return_gerror (closure->invocation, error); |
84 | ||
93 | 85 | } else { |
94 | 86 | realm_diagnostics_error (closure->invocation, error, "Failed to discover realm"); |
95 | 87 | g_dbus_method_invocation_return_error (closure->invocation, REALM_ERROR, REALM_ERROR_DISCOVERY_FAILED, |
96 | "Failed to discover realm. See diagnostics."); | |
88 | _("Failed to discover realm. See diagnostics.")); | |
97 | 89 | } |
98 | 90 | g_error_free (error); |
99 | 91 | } |
105 | 97 | realm_provider_handle_discover (RealmDbusProvider *provider, |
106 | 98 | GDBusMethodInvocation *invocation, |
107 | 99 | const gchar *string, |
108 | const gchar *operation_id) | |
100 | GVariant *options) | |
109 | 101 | { |
110 | 102 | RealmProvider *self = REALM_PROVIDER (provider); |
111 | RealmProviderClass *klass; | |
112 | 103 | |
113 | 104 | /* Make note of the current operation id, for diagnostics */ |
114 | realm_diagnostics_mark_operation (invocation, operation_id); | |
115 | ||
116 | klass = REALM_PROVIDER_GET_CLASS (self); | |
117 | g_return_val_if_fail (klass->discover_async != NULL, FALSE); | |
118 | g_return_val_if_fail (klass->discover_finish != NULL, FALSE); | |
119 | ||
120 | (klass->discover_async) (self, string, invocation, on_discover_complete, | |
105 | realm_diagnostics_setup_options (invocation, options); | |
106 | ||
107 | realm_provider_discover (self, string, invocation, on_discover_complete, | |
121 | 108 | method_closure_new (self, invocation)); |
122 | 109 | |
123 | 110 | return TRUE; |
153 | 140 | realm_debug ("rejecting access to: %s.%s method on %s", |
154 | 141 | interface, method, g_dbus_method_invocation_get_object_path (invocation)); |
155 | 142 | g_dbus_method_invocation_return_dbus_error (invocation, REALM_DBUS_ERROR_NOT_AUTHORIZED, |
156 | "Not authorized to perform this action"); | |
143 | _("Not authorized to perform this action")); | |
157 | 144 | } |
158 | 145 | |
159 | 146 | return ret; |
174 | 161 | static void |
175 | 162 | update_realms_property (RealmProvider *self) |
176 | 163 | { |
177 | RealmProviderClass *provider_class; | |
178 | 164 | GHashTableIter iter; |
179 | 165 | GDBusInterfaceSkeleton *realm; |
180 | 166 | GVariantBuilder builder; |
181 | 167 | const gchar *path; |
182 | 168 | GVariant *variant; |
183 | 169 | |
184 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(sos)")); | |
185 | ||
186 | provider_class = REALM_PROVIDER_GET_CLASS (self); | |
187 | g_assert (provider_class->dbus_name); | |
170 | g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(os)")); | |
188 | 171 | |
189 | 172 | g_hash_table_iter_init (&iter, self->pv->realms); |
190 | 173 | while (g_hash_table_iter_next (&iter, NULL, (gpointer)&realm)) { |
191 | 174 | path = g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (realm)); |
192 | g_variant_builder_add (&builder, "(sos)", provider_class->dbus_name, path, | |
193 | REALM_DBUS_KERBEROS_REALM_INTERFACE); | |
175 | g_variant_builder_add (&builder, "(os)", path, REALM_DBUS_KERBEROS_REALM_INTERFACE); | |
194 | 176 | } |
195 | 177 | |
196 | 178 | variant = g_variant_builder_end (&builder); |
228 | 210 | } |
229 | 211 | |
230 | 212 | GVariant * |
231 | realm_provider_new_realm_info (const gchar *bus_name, | |
232 | const gchar *object_path, | |
213 | realm_provider_new_realm_info (const gchar *object_path, | |
233 | 214 | const gchar *interface) |
234 | 215 | { |
235 | g_return_val_if_fail (g_dbus_is_name (bus_name), NULL); | |
236 | 216 | g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); |
237 | 217 | g_return_val_if_fail (g_dbus_is_interface_name (interface), NULL); |
238 | return g_variant_new ("(sos)", bus_name, object_path, interface); | |
218 | return g_variant_new ("(os)", object_path, interface); | |
239 | 219 | } |
240 | 220 | |
241 | 221 | static void |
299 | 279 | } |
300 | 280 | |
301 | 281 | static void |
302 | on_name_acquired (GDBusConnection *connection, | |
303 | const gchar *name, | |
304 | gpointer user_data) | |
305 | { | |
306 | realm_debug ("claimed name on bus: %s", name); | |
307 | realm_daemon_poke (); | |
308 | } | |
309 | ||
310 | static void | |
311 | on_name_lost (GDBusConnection *connection, | |
312 | const gchar *name, | |
313 | gpointer user_data) | |
314 | { | |
315 | g_warning ("couldn't claim service name on DBus bus: %s", name); | |
316 | } | |
317 | ||
318 | static void | |
319 | 282 | provider_object_start (GDBusConnection *connection, |
320 | 283 | RealmProvider *self) |
321 | 284 | { |
323 | 286 | RealmProviderClass *provider_class; |
324 | 287 | GError *error = NULL; |
325 | 288 | GHashTableIter iter; |
326 | guint owner_id; | |
327 | 289 | |
328 | 290 | provider_class = REALM_PROVIDER_GET_CLASS (self); |
329 | g_assert (provider_class->dbus_name); | |
330 | 291 | |
331 | 292 | g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (self), |
332 | 293 | connection, provider_class->dbus_path, |
341 | 302 | g_hash_table_iter_init (&iter, self->pv->realms); |
342 | 303 | while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&realm)) |
343 | 304 | export_realm_if_possible (self, realm); |
344 | ||
345 | owner_id = g_bus_own_name_on_connection (connection, | |
346 | provider_class->dbus_name, | |
347 | G_BUS_NAME_OWNER_FLAGS_NONE, | |
348 | on_name_acquired, on_name_lost, | |
349 | g_object_ref (self), g_object_unref); | |
350 | ||
351 | if (provider_owner_ids == NULL) | |
352 | provider_owner_ids = g_hash_table_new (g_direct_hash, g_direct_equal); | |
353 | g_hash_table_add (provider_owner_ids, GUINT_TO_POINTER (owner_id)); | |
354 | } | |
355 | ||
356 | static void | |
357 | on_provider_inited (GObject *source, | |
358 | GAsyncResult *result, | |
359 | gpointer user_data) | |
360 | { | |
361 | GDBusConnection *connection = G_DBUS_CONNECTION (user_data); | |
362 | GObject *provider; | |
363 | GError *error = NULL; | |
364 | ||
365 | provider = g_async_initable_new_finish (G_ASYNC_INITABLE (source), | |
366 | result, &error); | |
367 | if (error == NULL) { | |
368 | provider_object_start (connection, REALM_PROVIDER (provider)); | |
369 | g_object_unref (provider); | |
370 | ||
371 | } else { | |
372 | g_warning ("Couldn't initialize realm provider: %s: %s", | |
373 | G_OBJECT_TYPE_NAME (source), error->message); | |
374 | g_error_free (error); | |
375 | } | |
376 | ||
377 | g_object_unref (connection); | |
378 | } | |
379 | ||
380 | void | |
305 | } | |
306 | ||
307 | RealmProvider * | |
381 | 308 | realm_provider_start (GDBusConnection *connection, |
382 | 309 | GType type) |
383 | 310 | { |
384 | 311 | RealmProvider *provider; |
385 | 312 | GError *error = NULL; |
386 | g_return_if_fail (G_IS_DBUS_CONNECTION (connection)); | |
387 | g_return_if_fail (g_type_is_a (type, REALM_TYPE_PROVIDER)); | |
388 | ||
389 | if (g_type_is_a (type, G_TYPE_ASYNC_INITABLE)) { | |
390 | g_async_initable_new_async (type, G_PRIORITY_DEFAULT, NULL, | |
391 | on_provider_inited, g_object_ref (connection), | |
392 | NULL); | |
393 | ||
394 | } else if (g_type_is_a (type, G_TYPE_INITABLE)) { | |
313 | g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); | |
314 | g_return_val_if_fail (g_type_is_a (type, REALM_TYPE_PROVIDER), NULL); | |
315 | ||
316 | if (g_type_is_a (type, G_TYPE_INITABLE)) { | |
395 | 317 | provider = g_initable_new (type, NULL, &error, NULL); |
396 | 318 | if (error == NULL) { |
397 | 319 | provider_object_start (connection, provider); |
398 | g_object_unref (provider); | |
320 | return provider; | |
399 | 321 | |
400 | 322 | } else { |
401 | 323 | g_warning ("Failed to initialize realm provider: %s: %s", |
402 | 324 | g_type_name (type), error->message); |
403 | 325 | g_error_free (error); |
326 | return NULL; | |
404 | 327 | } |
405 | 328 | |
406 | 329 | } else { |
407 | 330 | provider = g_object_new (type, NULL); |
408 | 331 | provider_object_start (connection, provider); |
409 | g_object_unref (provider); | |
410 | } | |
411 | } | |
412 | ||
413 | void | |
414 | realm_provider_stop_all (void) | |
415 | { | |
416 | GHashTableIter iter; | |
417 | GHashTable *owner_ids; | |
418 | guint owner_id; | |
419 | gpointer key; | |
420 | ||
421 | if (!provider_owner_ids) | |
422 | return; | |
423 | ||
424 | owner_ids = provider_owner_ids; | |
425 | provider_owner_ids = NULL; | |
426 | ||
427 | g_hash_table_iter_init (&iter, owner_ids); | |
428 | while (g_hash_table_iter_next (&iter, &key, NULL)) { | |
429 | owner_id = GPOINTER_TO_UINT (key); | |
430 | g_bus_unown_name (owner_id); | |
431 | } | |
432 | g_hash_table_destroy (owner_ids); | |
332 | return provider; | |
333 | } | |
433 | 334 | } |
434 | 335 | |
435 | 336 | gboolean |
445 | 346 | |
446 | 347 | return result; |
447 | 348 | } |
349 | ||
350 | void | |
351 | realm_provider_discover (RealmProvider *self, | |
352 | const gchar *string, | |
353 | GDBusMethodInvocation *invocation, | |
354 | GAsyncReadyCallback callback, | |
355 | gpointer user_data) | |
356 | { | |
357 | RealmProviderClass *klass; | |
358 | ||
359 | klass = REALM_PROVIDER_GET_CLASS (self); | |
360 | g_return_if_fail (klass->discover_async != NULL); | |
361 | ||
362 | (klass->discover_async) (self, string, invocation, callback, user_data); | |
363 | } | |
364 | ||
365 | gint | |
366 | realm_provider_discover_finish (RealmProvider *self, | |
367 | GAsyncResult *result, | |
368 | GVariant **realms, | |
369 | GError **error) | |
370 | { | |
371 | RealmProviderClass *klass; | |
372 | gint relevance; | |
373 | GError *sub_error = NULL; | |
374 | ||
375 | klass = REALM_PROVIDER_GET_CLASS (self); | |
376 | g_return_val_if_fail (klass->discover_finish != NULL, -1); | |
377 | ||
378 | *realms = NULL; | |
379 | ||
380 | relevance = (klass->discover_finish) (self, result, realms, &sub_error); | |
381 | if (sub_error == NULL) { | |
382 | if (realms != NULL && *realms == NULL) { | |
383 | *realms = g_variant_new_array (G_VARIANT_TYPE ("(os)"), NULL, 0); | |
384 | g_variant_ref_sink (*realms); | |
385 | } | |
386 | } else { | |
387 | g_propagate_error (error, sub_error); | |
388 | } | |
389 | ||
390 | return relevance; | |
391 | } |
41 | 41 | struct _RealmProviderClass { |
42 | 42 | RealmDbusProviderSkeletonClass parent_class; |
43 | 43 | |
44 | const gchar *dbus_name; | |
45 | 44 | const gchar *dbus_path; |
46 | 45 | |
47 | 46 | void (* discover_async) (RealmProvider *provider, |
58 | 57 | |
59 | 58 | GType realm_provider_get_type (void) G_GNUC_CONST; |
60 | 59 | |
61 | void realm_provider_start (GDBusConnection *connection, | |
60 | RealmProvider * realm_provider_start (GDBusConnection *connection, | |
62 | 61 | GType type); |
63 | 62 | |
64 | 63 | void realm_provider_stop_all (void); |
65 | 64 | |
66 | GVariant * realm_provider_new_realm_info (const gchar *bus_name, | |
67 | const gchar *object_path, | |
65 | GVariant * realm_provider_new_realm_info (const gchar *object_path, | |
68 | 66 | const gchar *interface); |
69 | 67 | |
70 | 68 | GDBusInterfaceSkeleton * realm_provider_lookup_or_register_realm (RealmProvider *self, |
74 | 72 | gboolean realm_provider_is_default (const gchar *type, |
75 | 73 | const gchar *name); |
76 | 74 | |
75 | void realm_provider_discover (RealmProvider *self, | |
76 | const gchar *string, | |
77 | GDBusMethodInvocation *invocation, | |
78 | GAsyncReadyCallback callback, | |
79 | gpointer user_data); | |
80 | ||
81 | gint realm_provider_discover_finish (RealmProvider *self, | |
82 | GAsyncResult *result, | |
83 | GVariant **realms, | |
84 | GError **error); | |
85 | ||
77 | 86 | G_END_DECLS |
78 | 87 | |
79 | 88 | #endif /* __REALM_KERBEROS_PROVIDER_H__ */ |
15 | 15 | |
16 | 16 | #include "realm-command.h" |
17 | 17 | #include "realm-daemon.h" |
18 | #include "realm-debug.h" | |
18 | 19 | #include "realm-diagnostics.h" |
19 | 20 | #include "realm-errors.h" |
20 | 21 | #include "realm-samba-config.h" |
45 | 46 | g_clear_object (&join->cancellable); |
46 | 47 | |
47 | 48 | if (join->kerberos_cache_filename) { |
48 | if (g_unlink (join->kerberos_cache_filename) < 0) { | |
49 | if (!realm_debug_flag_is_set (REALM_DEBUG_LEAVE_TEMP_FILES) && | |
50 | g_unlink (join->kerberos_cache_filename) < 0) { | |
49 | 51 | g_warning ("couldn't remove kerberos cache file: %s: %s", |
50 | 52 | join->kerberos_cache_filename, g_strerror (errno)); |
51 | 53 | } |
302 | 304 | g_object_unref (res); |
303 | 305 | } |
304 | 306 | |
307 | static void | |
308 | on_conf_do_join (GObject *source, | |
309 | GAsyncResult *result, | |
310 | gpointer user_data) | |
311 | { | |
312 | GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data); | |
313 | JoinClosure *join = g_simple_async_result_get_op_res_gpointer (res); | |
314 | GError *error = NULL; | |
315 | gint status; | |
316 | ||
317 | status = realm_command_run_finish (result, NULL, &error); | |
318 | if (error == NULL && status != 0) { | |
319 | g_set_error (&error, REALM_ERROR, REALM_ERROR_INTERNAL, | |
320 | "Configuring samba failed"); | |
321 | } | |
322 | ||
323 | if (error == NULL) { | |
324 | begin_net_process (join, on_join_do_keytab, g_object_ref (res), | |
325 | "-k", "ads", "join", join->realm, NULL); | |
326 | ||
327 | } else { | |
328 | g_simple_async_result_take_error (res, error); | |
329 | g_simple_async_result_complete (res); | |
330 | } | |
331 | ||
332 | g_object_unref (res); | |
333 | } | |
334 | ||
305 | 335 | void |
306 | 336 | realm_samba_enroll_join_async (const gchar *realm, |
307 | 337 | GBytes *admin_kerberos_cache, |
325 | 355 | g_simple_async_result_complete_in_idle (res); |
326 | 356 | } else { |
327 | 357 | g_simple_async_result_set_op_res_gpointer (res, join, join_closure_free); |
328 | begin_net_process (join, on_join_do_keytab, g_object_ref (res), | |
329 | "-k", "ads", "join", join->realm, NULL); | |
358 | begin_net_process (join, on_conf_do_join, g_object_ref (res), | |
359 | "conf", "setparm", REALM_SAMBA_CONFIG_GLOBAL, | |
360 | "realm", join->realm, NULL); | |
330 | 361 | } |
331 | 362 | |
332 | 363 | g_object_unref (res); |
18 | 18 | |
19 | 19 | #include <gio/gio.h> |
20 | 20 | |
21 | #include <krb5.h> | |
22 | ||
21 | 23 | G_BEGIN_DECLS |
24 | ||
25 | const static krb5_enctype REALM_SAMBA_ENROLL_ENC_TYPES[] = { | |
26 | ENCTYPE_ARCFOUR_HMAC, | |
27 | ENCTYPE_DES_CBC_MD5, | |
28 | ENCTYPE_DES_CBC_CRC, | |
29 | 0 | |
30 | }; | |
22 | 31 | |
23 | 32 | void realm_samba_enroll_join_async (const gchar *realm, |
24 | 33 | GBytes *admin_kerberos_cache, |
46 | 46 | PROP_SAMBA_CONFIG, |
47 | 47 | }; |
48 | 48 | |
49 | #define REALM_DBUS_SAMBA_NAME "org.freedesktop.realmd.Samba" | |
50 | 49 | #define REALM_DBUS_SAMBA_PATH "/org/freedesktop/realmd/Samba" |
51 | 50 | |
52 | 51 | G_DEFINE_TYPE (RealmSambaProvider, realm_samba_provider, REALM_TYPE_PROVIDER); |
81 | 80 | |
82 | 81 | g_free (name); |
83 | 82 | g_free (security); |
83 | } | |
84 | ||
85 | static void | |
86 | on_ad_discover (GObject *source, | |
87 | GAsyncResult *result, | |
88 | gpointer user_data) | |
89 | { | |
90 | GSimpleAsyncResult *async = G_SIMPLE_ASYNC_RESULT (user_data); | |
91 | g_simple_async_result_set_op_res_gpointer (async, g_object_ref (result), g_object_unref); | |
92 | g_simple_async_result_complete (async); | |
93 | g_object_unref (async); | |
84 | 94 | } |
85 | 95 | |
86 | 96 | static void |
90 | 100 | GAsyncReadyCallback callback, |
91 | 101 | gpointer user_data) |
92 | 102 | { |
93 | realm_ad_discover_async (string, invocation, callback, user_data); | |
103 | GSimpleAsyncResult *async; | |
104 | ||
105 | async = g_simple_async_result_new (G_OBJECT (provider), callback, user_data, | |
106 | realm_samba_provider_discover_async); | |
107 | ||
108 | realm_ad_discover_async (string, invocation, on_ad_discover, g_object_ref (async)); | |
109 | ||
110 | g_object_unref (async); | |
94 | 111 | } |
95 | 112 | |
96 | 113 | static gint |
100 | 117 | GError **error) |
101 | 118 | { |
102 | 119 | GDBusInterfaceSkeleton *realm; |
120 | GSimpleAsyncResult *async; | |
103 | 121 | GHashTable *discovery; |
122 | GAsyncResult *ad_result; | |
104 | 123 | const gchar *object_path; |
105 | 124 | GVariant *realm_info; |
106 | 125 | gchar *name; |
107 | 126 | |
108 | name = realm_ad_discover_finish (result, &discovery, error); | |
127 | async = G_SIMPLE_ASYNC_RESULT (result); | |
128 | ad_result = g_simple_async_result_get_op_res_gpointer (async); | |
129 | ||
130 | name = realm_ad_discover_finish (ad_result, &discovery, error); | |
109 | 131 | if (name == NULL) |
110 | 132 | return 0; |
111 | 133 | |
122 | 144 | realm_kerberos_set_discovery (REALM_KERBEROS (realm), discovery); |
123 | 145 | |
124 | 146 | object_path = g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (realm)); |
125 | realm_info = realm_provider_new_realm_info (REALM_DBUS_SAMBA_NAME, object_path, | |
126 | REALM_DBUS_KERBEROS_REALM_INTERFACE); | |
127 | *realms = g_variant_new_array (G_VARIANT_TYPE ("(sos)"), &realm_info, 1); | |
147 | realm_info = realm_provider_new_realm_info (object_path, REALM_DBUS_KERBEROS_REALM_INTERFACE); | |
148 | *realms = g_variant_new_array (G_VARIANT_TYPE ("(os)"), &realm_info, 1); | |
128 | 149 | g_variant_ref_sink (*realms); |
129 | 150 | |
130 | 151 | g_hash_table_unref (discovery); |
167 | 188 | RealmProviderClass *provider_class = REALM_PROVIDER_CLASS (klass); |
168 | 189 | GObjectClass *object_class = G_OBJECT_CLASS (klass); |
169 | 190 | |
170 | provider_class->dbus_name = REALM_DBUS_SAMBA_NAME; | |
171 | 191 | provider_class->dbus_path = REALM_DBUS_SAMBA_PATH; |
172 | 192 | |
173 | 193 | provider_class->discover_async = realm_samba_provider_discover_async; |
28 | 28 | #include "realm-samba-winbind.h" |
29 | 29 | |
30 | 30 | #include <glib/gstdio.h> |
31 | #include <glib/gi18n.h> | |
31 | 32 | |
32 | 33 | #include <errno.h> |
33 | 34 | #include <string.h> |
34 | 35 | |
35 | 36 | struct _RealmSamba { |
36 | 37 | RealmKerberos parent; |
37 | gchar *name; | |
38 | 38 | RealmIniConfig *config; |
39 | 39 | gulong config_sig; |
40 | 40 | }; |
45 | 45 | |
46 | 46 | enum { |
47 | 47 | PROP_0, |
48 | PROP_NAME, | |
49 | PROP_DOMAIN, | |
50 | 48 | PROP_PROVIDER, |
51 | 49 | }; |
52 | 50 | |
58 | 56 | GPtrArray *entries; |
59 | 57 | GVariant *entry; |
60 | 58 | GVariant *details; |
59 | GVariant *supported; | |
61 | 60 | |
62 | 61 | entries = g_ptr_array_new (); |
63 | 62 | |
66 | 65 | g_ptr_array_add (entries, entry); |
67 | 66 | |
68 | 67 | entry = g_variant_new_dict_entry (g_variant_new_string ("client-software"), |
69 | g_variant_new_string ("samba-winbind")); | |
68 | g_variant_new_string ("winbind")); | |
70 | 69 | g_ptr_array_add (entries, entry); |
71 | 70 | |
72 | 71 | details = g_variant_new_array (G_VARIANT_TYPE ("{ss}"), |
74 | 73 | entries->len); |
75 | 74 | g_variant_ref_sink (details); |
76 | 75 | |
76 | /* | |
77 | * Each line is a combination of owner and what kind of credentials are supported, | |
78 | * same for enroll/unenroll. We can't accept a ccache, because samba3 needs | |
79 | * to have credentials limited to RC4. | |
80 | */ | |
81 | supported = realm_kerberos_build_supported_credentials ( | |
82 | REALM_KERBEROS_CREDENTIAL_PASSWORD, REALM_KERBEROS_CREDENTIAL_ADMIN, | |
83 | REALM_KERBEROS_CREDENTIAL_PASSWORD, REALM_KERBEROS_CREDENTIAL_USER, | |
84 | 0); | |
85 | ||
77 | 86 | g_object_set (self, |
78 | 87 | "details", details, |
79 | 88 | "suggested-administrator", "Administrator", |
80 | 89 | "login-policy", REALM_DBUS_LOGIN_POLICY_ANY, |
90 | "supported-enroll-credentials", supported, | |
91 | "supported-unenroll-credentials", supported, | |
81 | 92 | NULL); |
82 | 93 | |
94 | g_variant_unref (supported); | |
83 | 95 | g_variant_unref (details); |
84 | 96 | g_ptr_array_free (entries, TRUE); |
85 | 97 | } |
99 | 111 | static gboolean |
100 | 112 | lookup_is_enrolled (RealmSamba *self) |
101 | 113 | { |
114 | const gchar *name; | |
102 | 115 | gchar *enrolled; |
103 | gboolean ret; | |
116 | gboolean ret = FALSE; | |
104 | 117 | |
105 | 118 | enrolled = lookup_enrolled_realm (self); |
106 | ret = g_strcmp0 (self->name, enrolled) == 0; | |
107 | g_free (enrolled); | |
119 | if (enrolled != NULL) { | |
120 | name = realm_dbus_kerberos_get_name (REALM_DBUS_KERBEROS (self)); | |
121 | ret = g_strcmp0 (name, enrolled) == 0; | |
122 | g_free (enrolled); | |
123 | } | |
108 | 124 | |
109 | 125 | return ret; |
110 | 126 | } |
128 | 144 | |
129 | 145 | typedef struct { |
130 | 146 | GDBusMethodInvocation *invocation; |
131 | GBytes *admin_kerberos_cache; | |
147 | GBytes *ccache; | |
132 | 148 | gchar *realm_name; |
133 | GHashTable *discovery; | |
134 | 149 | } EnrollClosure; |
135 | 150 | |
136 | 151 | static void |
139 | 154 | EnrollClosure *enroll = data; |
140 | 155 | g_free (enroll->realm_name); |
141 | 156 | g_object_unref (enroll->invocation); |
142 | g_bytes_unref (enroll->admin_kerberos_cache); | |
143 | g_hash_table_unref (enroll->discovery); | |
157 | g_bytes_unref (enroll->ccache); | |
144 | 158 | g_slice_free (EnrollClosure, enroll); |
145 | 159 | } |
146 | 160 | |
170 | 184 | RealmSamba *self = REALM_SAMBA (g_async_result_get_source_object (G_ASYNC_RESULT (res))); |
171 | 185 | GHashTable *settings = NULL; |
172 | 186 | GError *error = NULL; |
173 | gchar *workgroup = NULL; | |
187 | const gchar *workgroup = NULL; | |
174 | 188 | |
175 | 189 | realm_samba_enroll_join_finish (result, &settings, &error); |
176 | 190 | if (error == NULL) { |
177 | 191 | workgroup = g_hash_table_lookup (settings, "workgroup"); |
178 | 192 | if (workgroup == NULL) { |
179 | 193 | g_set_error (&error, REALM_ERROR, REALM_ERROR_INTERNAL, |
180 | "Failed to calculate domain workgroup"); | |
194 | _("Failed to calculate domain workgroup")); | |
181 | 195 | } |
182 | 196 | } |
183 | 197 | |
199 | 213 | |
200 | 214 | if (settings) |
201 | 215 | g_hash_table_unref (settings); |
202 | g_free (workgroup); | |
203 | 216 | g_object_unref (self); |
204 | 217 | g_object_unref (res); |
205 | 218 | } |
215 | 228 | |
216 | 229 | realm_packages_install_finish (result, &error); |
217 | 230 | if (error == NULL) { |
218 | realm_samba_enroll_join_async (enroll->realm_name, enroll->admin_kerberos_cache, | |
231 | realm_samba_enroll_join_async (enroll->realm_name, enroll->ccache, | |
219 | 232 | enroll->invocation, on_join_do_winbind, |
220 | 233 | g_object_ref (res)); |
221 | 234 | |
228 | 241 | } |
229 | 242 | |
230 | 243 | static void |
231 | on_discover_do_install (GObject *source, | |
232 | GAsyncResult *result, | |
233 | gpointer user_data) | |
234 | { | |
235 | GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data); | |
236 | EnrollClosure *enroll = g_simple_async_result_get_op_res_gpointer (res); | |
237 | GHashTable *discovery = NULL; | |
238 | GError *error = NULL; | |
239 | ||
240 | if (realm_ad_discover_finish (result, &discovery, &error)) { | |
241 | enroll->discovery = discovery; | |
244 | on_kinit_do_install (GObject *source, | |
245 | GAsyncResult *result, | |
246 | gpointer user_data) | |
247 | { | |
248 | GSimpleAsyncResult *async = G_SIMPLE_ASYNC_RESULT (user_data); | |
249 | EnrollClosure *enroll = g_simple_async_result_get_op_res_gpointer (async); | |
250 | GError *error = NULL; | |
251 | ||
252 | enroll->ccache = realm_kerberos_kinit_ccache_finish (REALM_KERBEROS (source), result, &error); | |
253 | if (error == NULL) { | |
242 | 254 | realm_packages_install_async ("samba-packages", enroll->invocation, |
243 | on_install_do_join, g_object_ref (res)); | |
244 | ||
245 | } else if (error == NULL) { | |
246 | g_simple_async_result_set_error (res, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, | |
247 | "Invalid or unusable realm argument"); | |
248 | g_simple_async_result_complete (res); | |
249 | ||
250 | } else { | |
251 | g_simple_async_result_take_error (res, error); | |
252 | g_simple_async_result_complete (res); | |
253 | } | |
254 | ||
255 | g_object_unref (res); | |
256 | ||
255 | on_install_do_join, g_object_ref (async)); | |
256 | ||
257 | } else { | |
258 | g_simple_async_result_take_error (async, error); | |
259 | g_simple_async_result_complete (async); | |
260 | } | |
261 | ||
262 | g_object_unref (async); | |
257 | 263 | } |
258 | 264 | |
259 | 265 | static void |
260 | 266 | realm_samba_enroll_async (RealmKerberos *realm, |
261 | GBytes *admin_kerberos_cache, | |
267 | const gchar *name, | |
268 | const gchar *password, | |
269 | RealmKerberosFlags flags, | |
262 | 270 | GDBusMethodInvocation *invocation, |
263 | 271 | GAsyncReadyCallback callback, |
264 | 272 | gpointer user_data) |
271 | 279 | res = g_simple_async_result_new (G_OBJECT (realm), callback, user_data, |
272 | 280 | realm_samba_enroll_async); |
273 | 281 | enroll = g_slice_new0 (EnrollClosure); |
274 | enroll->realm_name = g_strdup (self->name); | |
282 | g_object_get (realm, "name", &enroll->realm_name, NULL); | |
275 | 283 | enroll->invocation = g_object_ref (invocation); |
276 | enroll->admin_kerberos_cache = g_bytes_ref (admin_kerberos_cache); | |
277 | 284 | g_simple_async_result_set_op_res_gpointer (res, enroll, enroll_closure_free); |
278 | ||
279 | enroll->discovery = realm_kerberos_get_discovery (realm); | |
280 | if (enroll->discovery) | |
281 | g_hash_table_ref (enroll->discovery); | |
282 | 285 | |
283 | 286 | /* Make sure not already enrolled in a realm */ |
284 | 287 | enrolled = lookup_enrolled_realm (self); |
285 | 288 | if (enrolled != NULL) { |
286 | 289 | g_simple_async_result_set_error (res, REALM_ERROR, REALM_ERROR_ALREADY_ENROLLED, |
287 | "Already enrolled in a realm"); | |
290 | _("Already enrolled in a realm")); | |
288 | 291 | g_simple_async_result_complete_in_idle (res); |
289 | 292 | |
290 | /* Caller didn't discover first time around, so do that now */ | |
291 | } else if (enroll->discovery == NULL) { | |
292 | realm_ad_discover_async (self->name, invocation, | |
293 | on_discover_do_install, g_object_ref (res)); | |
294 | ||
295 | /* Already have discovery info, so go straight to install */ | |
296 | } else { | |
297 | realm_packages_install_async ("samba-packages", invocation, | |
298 | on_install_do_join, g_object_ref (res)); | |
293 | } else { | |
294 | realm_kerberos_kinit_ccache_async (realm, name, password, REALM_SAMBA_ENROLL_ENC_TYPES, | |
295 | invocation, on_kinit_do_install, g_object_ref (res)); | |
299 | 296 | } |
300 | 297 | |
301 | 298 | g_free (enrolled); |
366 | 363 | } |
367 | 364 | |
368 | 365 | static void |
366 | on_kinit_do_leave (GObject *source, | |
367 | GAsyncResult *result, | |
368 | gpointer user_data) | |
369 | { | |
370 | GSimpleAsyncResult *async = G_SIMPLE_ASYNC_RESULT (user_data); | |
371 | UnenrollClosure *unenroll = g_simple_async_result_get_op_res_gpointer (async); | |
372 | RealmSamba *self = REALM_SAMBA (source); | |
373 | GError *error = NULL; | |
374 | GBytes *ccache; | |
375 | ||
376 | ccache = realm_kerberos_kinit_ccache_finish (REALM_KERBEROS (self), result, &error); | |
377 | if (error == NULL) { | |
378 | realm_samba_enroll_leave_async (unenroll->realm_name, ccache, unenroll->invocation, | |
379 | on_leave_do_winbind, g_object_ref (async)); | |
380 | g_bytes_unref (ccache); | |
381 | ||
382 | } else { | |
383 | g_simple_async_result_take_error (async, error); | |
384 | g_simple_async_result_complete (async); | |
385 | } | |
386 | ||
387 | g_object_unref (async); | |
388 | } | |
389 | ||
390 | static void | |
369 | 391 | realm_samba_unenroll_async (RealmKerberos *realm, |
370 | GBytes *admin_kerberos_cache, | |
392 | const gchar *name, | |
393 | const gchar *password, | |
394 | RealmKerberosFlags flags, | |
371 | 395 | GDBusMethodInvocation *invocation, |
372 | 396 | GAsyncReadyCallback callback, |
373 | 397 | gpointer user_data) |
375 | 399 | RealmSamba *self = REALM_SAMBA (realm); |
376 | 400 | GSimpleAsyncResult *res; |
377 | 401 | UnenrollClosure *unenroll; |
402 | const gchar *realm_name; | |
378 | 403 | gchar *enrolled; |
404 | ||
405 | realm_name = realm_dbus_kerberos_get_name (REALM_DBUS_KERBEROS (self)); | |
379 | 406 | |
380 | 407 | res = g_simple_async_result_new (G_OBJECT (realm), callback, user_data, |
381 | 408 | realm_samba_unenroll_async); |
382 | 409 | unenroll = g_slice_new0 (UnenrollClosure); |
383 | unenroll->realm_name = g_strdup (self->name); | |
410 | unenroll->realm_name = g_strdup (realm_name); | |
384 | 411 | unenroll->invocation = g_object_ref (invocation); |
385 | 412 | g_simple_async_result_set_op_res_gpointer (res, unenroll, unenroll_closure_free); |
386 | 413 | |
387 | 414 | /* Check that enrolled in this realm */ |
388 | 415 | enrolled = lookup_enrolled_realm (self); |
389 | if (g_strcmp0 (enrolled, self->name) == 0) { | |
390 | realm_samba_enroll_leave_async (self->name, admin_kerberos_cache, invocation, | |
391 | on_leave_do_winbind, g_object_ref (res)); | |
416 | if (g_strcmp0 (enrolled, realm_name) == 0) { | |
417 | realm_kerberos_kinit_ccache_async (realm, name, password, REALM_SAMBA_ENROLL_ENC_TYPES, | |
418 | invocation, on_kinit_do_leave, g_object_ref (res)); | |
419 | ||
392 | 420 | } else { |
393 | 421 | g_simple_async_result_set_error (res, REALM_ERROR, REALM_ERROR_NOT_ENROLLED, |
394 | "Not currently enrolled in the realm"); | |
422 | _("Not currently enrolled in the realm")); | |
395 | 423 | g_simple_async_result_complete_in_idle (res); |
396 | 424 | } |
397 | 425 | |
398 | 426 | g_object_unref (res); |
399 | } | |
400 | ||
401 | static gboolean | |
402 | realm_samba_generic_finish (RealmKerberos *realm, | |
403 | GAsyncResult *result, | |
404 | GError **error) | |
405 | { | |
406 | if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) | |
407 | return FALSE; | |
408 | ||
409 | return TRUE; | |
410 | 427 | } |
411 | 428 | |
412 | 429 | static gboolean |
423 | 440 | |
424 | 441 | if (!lookup_is_enrolled (self)) { |
425 | 442 | g_set_error (error, REALM_ERROR, REALM_ERROR_NOT_ENROLLED, |
426 | "Not enrolled in this realm"); | |
443 | _("Not enrolled in this realm")); | |
427 | 444 | return FALSE; |
428 | 445 | } |
429 | 446 | |
465 | 482 | if (login_policy != REALM_KERBEROS_ALLOW_ANY_LOGIN && |
466 | 483 | login_policy != REALM_KERBEROS_POLICY_NOT_SET) { |
467 | 484 | g_simple_async_result_set_error (async, G_DBUS_ERROR, G_DBUS_ERROR_NOT_SUPPORTED, |
468 | "The Samba provider cannot restrict permitted logins."); | |
485 | _("The Samba provider cannot restrict permitted logins.")); | |
469 | 486 | |
470 | 487 | /* Make note of the permitted logins, so we can return them in the property */ |
471 | 488 | } else if (!realm_samba_change_logins (realm, invocation, add, remove, &error)) { |
481 | 498 | { |
482 | 499 | GPtrArray *permitted; |
483 | 500 | gchar *login_format; |
501 | const gchar *name; | |
502 | gchar *domain; | |
484 | 503 | gchar **values; |
485 | 504 | gchar *prefix; |
486 | 505 | gint i; |
506 | ||
507 | g_object_freeze_notify (G_OBJECT (self)); | |
508 | ||
509 | name = realm_dbus_kerberos_get_name (REALM_DBUS_KERBEROS (self)); | |
510 | domain = name ? g_ascii_strdown (name, -1) : NULL; | |
511 | g_object_set (self, "domain", domain, NULL); | |
512 | g_free (domain); | |
487 | 513 | |
488 | 514 | g_object_set (self, "enrolled", lookup_is_enrolled (self), NULL); |
489 | 515 | |
509 | 535 | g_object_set (self, "permitted-logins", (gchar **)permitted->pdata, NULL); |
510 | 536 | g_ptr_array_free (permitted, TRUE); |
511 | 537 | g_strfreev (values); |
538 | ||
539 | g_object_thaw_notify (G_OBJECT (self)); | |
512 | 540 | } |
513 | 541 | |
514 | 542 | static void |
518 | 546 | update_properties (REALM_SAMBA (user_data)); |
519 | 547 | } |
520 | 548 | |
521 | static void | |
522 | realm_samba_get_property (GObject *obj, | |
523 | guint prop_id, | |
524 | GValue *value, | |
525 | GParamSpec *pspec) | |
526 | { | |
527 | RealmSamba *self = REALM_SAMBA (obj); | |
528 | ||
529 | switch (prop_id) { | |
530 | case PROP_NAME: | |
531 | g_value_set_string (value, self->name); | |
532 | break; | |
533 | default: | |
534 | G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); | |
535 | break; | |
536 | } | |
549 | static gboolean | |
550 | realm_samba_generic_finish (RealmKerberos *realm, | |
551 | GAsyncResult *result, | |
552 | GError **error) | |
553 | { | |
554 | if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error)) | |
555 | return FALSE; | |
556 | ||
557 | update_properties (REALM_SAMBA (realm)); | |
558 | return TRUE; | |
537 | 559 | } |
538 | 560 | |
539 | 561 | static void |
544 | 566 | { |
545 | 567 | RealmSamba *self = REALM_SAMBA (obj); |
546 | 568 | RealmProvider *provider; |
547 | gchar *domain; | |
548 | 569 | |
549 | 570 | switch (prop_id) { |
550 | case PROP_NAME: | |
551 | self->name = g_value_dup_string (value); | |
552 | domain = g_ascii_strdown (self->name, -1); | |
553 | g_object_set (self, "domain", domain, NULL); | |
554 | g_free (domain); | |
555 | break; | |
556 | 571 | case PROP_PROVIDER: |
557 | 572 | provider = g_value_get_object (value); |
558 | 573 | g_object_get (provider, "samba-config", &self->config, NULL); |
567 | 582 | } |
568 | 583 | |
569 | 584 | static void |
570 | realm_samba_consructed (GObject *obj) | |
571 | { | |
572 | RealmSamba *self = REALM_SAMBA (obj); | |
573 | ||
574 | G_OBJECT_CLASS (realm_samba_parent_class)->constructed (obj); | |
575 | ||
576 | update_properties (self); | |
585 | realm_samba_notify (GObject *obj, | |
586 | GParamSpec *spec) | |
587 | { | |
588 | if (g_str_equal (spec->name, "name")) | |
589 | update_properties (REALM_SAMBA (obj)); | |
590 | ||
591 | G_OBJECT_CLASS (realm_samba_parent_class)->notify (obj, spec); | |
577 | 592 | } |
578 | 593 | |
579 | 594 | static void |
581 | 596 | { |
582 | 597 | RealmSamba *self = REALM_SAMBA (obj); |
583 | 598 | |
584 | g_free (self->name); | |
585 | 599 | if (self->config) |
586 | 600 | g_object_unref (self->config); |
587 | 601 | |
594 | 608 | RealmKerberosClass *kerberos_class = REALM_KERBEROS_CLASS (klass); |
595 | 609 | GObjectClass *object_class = G_OBJECT_CLASS (klass); |
596 | 610 | |
597 | kerberos_class->enroll_async = realm_samba_enroll_async; | |
611 | kerberos_class->enroll_password_async = realm_samba_enroll_async; | |
598 | 612 | kerberos_class->enroll_finish = realm_samba_generic_finish; |
599 | kerberos_class->unenroll_async = realm_samba_unenroll_async; | |
613 | kerberos_class->unenroll_password_async = realm_samba_unenroll_async; | |
600 | 614 | kerberos_class->unenroll_finish = realm_samba_generic_finish; |
601 | 615 | kerberos_class->logins_async = realm_samba_logins_async; |
602 | 616 | kerberos_class->logins_finish = realm_samba_generic_finish; |
603 | 617 | |
604 | object_class->constructed = realm_samba_consructed; | |
605 | object_class->get_property = realm_samba_get_property; | |
606 | 618 | object_class->set_property = realm_samba_set_property; |
619 | object_class->notify = realm_samba_notify; | |
607 | 620 | object_class->finalize = realm_samba_finalize; |
608 | ||
609 | g_object_class_install_property (object_class, PROP_NAME, | |
610 | g_param_spec_string ("name", "Name", "Realm Name", | |
611 | "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); | |
612 | 621 | |
613 | 622 | g_object_class_install_property (object_class, PROP_PROVIDER, |
614 | 623 | g_param_spec_object ("provider", "Provider", "Samba Provider", |
44 | 44 | PROP_SSSD_CONFIG, |
45 | 45 | }; |
46 | 46 | |
47 | #define REALM_DBUS_SSSD_AD_NAME "org.freedesktop.realmd.SssdAd" | |
48 | 47 | #define REALM_DBUS_SSSD_AD_PATH "/org/freedesktop/realmd/SssdAd" |
49 | 48 | |
50 | 49 | G_DEFINE_TYPE (RealmSssdAdProvider, realm_sssd_ad_provider, REALM_TYPE_PROVIDER); |
92 | 91 | } |
93 | 92 | |
94 | 93 | static void |
94 | on_ad_discover (GObject *source, | |
95 | GAsyncResult *result, | |
96 | gpointer user_data) | |
97 | { | |
98 | GSimpleAsyncResult *async = G_SIMPLE_ASYNC_RESULT (user_data); | |
99 | g_simple_async_result_set_op_res_gpointer (async, g_object_ref (result), g_object_unref); | |
100 | g_simple_async_result_complete (async); | |
101 | g_object_unref (async); | |
102 | } | |
103 | ||
104 | static void | |
95 | 105 | realm_sssd_ad_provider_discover_async (RealmProvider *provider, |
96 | 106 | const gchar *string, |
97 | 107 | GDBusMethodInvocation *invocation, |
98 | 108 | GAsyncReadyCallback callback, |
99 | 109 | gpointer user_data) |
100 | 110 | { |
101 | realm_ad_discover_async (string, invocation, callback, user_data); | |
111 | GSimpleAsyncResult *async; | |
112 | ||
113 | async = g_simple_async_result_new (G_OBJECT (provider), callback, user_data, | |
114 | realm_sssd_ad_provider_discover_async); | |
115 | ||
116 | realm_ad_discover_async (string, invocation, on_ad_discover, g_object_ref (async)); | |
117 | ||
118 | g_object_unref (async); | |
102 | 119 | } |
103 | 120 | |
104 | 121 | static gint |
107 | 124 | GVariant **realms, |
108 | 125 | GError **error) |
109 | 126 | { |
127 | GSimpleAsyncResult *async; | |
128 | GAsyncResult *ad_result; | |
110 | 129 | GDBusInterfaceSkeleton *realm; |
111 | 130 | GHashTable *discovery; |
112 | 131 | const gchar *object_path; |
113 | 132 | GVariant *realm_info; |
114 | 133 | gchar *name; |
115 | 134 | |
116 | name = realm_ad_discover_finish (result, &discovery, error); | |
135 | async = G_SIMPLE_ASYNC_RESULT (result); | |
136 | ad_result = g_simple_async_result_get_op_res_gpointer (async); | |
137 | ||
138 | name = realm_ad_discover_finish (ad_result, &discovery, error); | |
117 | 139 | if (name == NULL) |
118 | 140 | return 0; |
119 | 141 | |
130 | 152 | realm_kerberos_set_discovery (REALM_KERBEROS (realm), discovery); |
131 | 153 | |
132 | 154 | object_path = g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (realm)); |
133 | realm_info = realm_provider_new_realm_info (REALM_DBUS_SSSD_AD_NAME, object_path, | |
134 | REALM_DBUS_KERBEROS_REALM_INTERFACE); | |
135 | *realms = g_variant_new_array (G_VARIANT_TYPE ("(sos)"), &realm_info, 1); | |
155 | realm_info = realm_provider_new_realm_info (object_path, REALM_DBUS_KERBEROS_REALM_INTERFACE); | |
156 | *realms = g_variant_new_array (G_VARIANT_TYPE ("(os)"), &realm_info, 1); | |
136 | 157 | g_variant_ref_sink (*realms); |
137 | 158 | |
138 | 159 | g_hash_table_unref (discovery); |
175 | 196 | RealmProviderClass *provider_class = REALM_PROVIDER_CLASS (klass); |
176 | 197 | GObjectClass *object_class = G_OBJECT_CLASS (klass); |
177 | 198 | |
178 | provider_class->dbus_name = REALM_DBUS_SSSD_AD_NAME; | |
179 | 199 | provider_class->dbus_path = REALM_DBUS_SSSD_AD_PATH; |
180 | 200 | provider_class->discover_async = realm_sssd_ad_provider_discover_async; |
181 | 201 | provider_class->discover_finish = realm_sssd_ad_provider_discover_finish; |
16 | 16 | #include "realm-ad-discover.h" |
17 | 17 | #include "realm-command.h" |
18 | 18 | #include "realm-diagnostics.h" |
19 | #include "realm-discovery.h" | |
20 | 19 | #include "realm-errors.h" |
21 | 20 | #include "realm-packages.h" |
22 | 21 | #include "realm-samba-enroll.h" |
26 | 25 | #include "realm-sssd-config.h" |
27 | 26 | |
28 | 27 | #include <glib/gstdio.h> |
28 | #include <glib/gi18n.h> | |
29 | 29 | |
30 | 30 | #include <errno.h> |
31 | 31 | #include <string.h> |
46 | 46 | GPtrArray *entries; |
47 | 47 | GVariant *entry; |
48 | 48 | GVariant *details; |
49 | GVariant *supported; | |
49 | 50 | |
50 | 51 | entries = g_ptr_array_new (); |
51 | 52 | |
62 | 63 | entries->len); |
63 | 64 | g_variant_ref_sink (details); |
64 | 65 | |
66 | /* | |
67 | * Each line is a combination of owner and what kind of credentials are supported, | |
68 | * same for enroll/unenroll. We can't accept a ccache, because samba3 needs | |
69 | * to have credentials limited to RC4. | |
70 | */ | |
71 | supported = realm_kerberos_build_supported_credentials ( | |
72 | REALM_KERBEROS_CREDENTIAL_PASSWORD, REALM_KERBEROS_CREDENTIAL_ADMIN, | |
73 | REALM_KERBEROS_CREDENTIAL_PASSWORD, REALM_KERBEROS_CREDENTIAL_USER, | |
74 | 0); | |
75 | ||
65 | 76 | g_object_set (self, |
66 | 77 | "details", details, |
67 | 78 | "suggested-administrator", "Administrator", |
79 | "supported-enroll-credentials", supported, | |
80 | "supported-unenroll-credentials", supported, | |
68 | 81 | NULL); |
69 | 82 | |
70 | 83 | g_variant_unref (details); |
84 | g_variant_unref (supported); | |
71 | 85 | g_ptr_array_free (entries, TRUE); |
72 | 86 | } |
73 | 87 | |
74 | 88 | typedef struct { |
75 | 89 | GDBusMethodInvocation *invocation; |
76 | GBytes *admin_kerberos_cache; | |
90 | GBytes *ccache; | |
77 | 91 | gchar *realm_name; |
78 | GHashTable *discovery; | |
79 | 92 | } EnrollClosure; |
80 | 93 | |
81 | 94 | static void |
84 | 97 | EnrollClosure *enroll = data; |
85 | 98 | g_free (enroll->realm_name); |
86 | 99 | g_object_unref (enroll->invocation); |
87 | g_bytes_unref (enroll->admin_kerberos_cache); | |
88 | g_hash_table_unref (enroll->discovery); | |
100 | g_bytes_unref (enroll->ccache); | |
89 | 101 | g_slice_free (EnrollClosure, enroll); |
90 | 102 | } |
91 | 103 | |
101 | 113 | status = realm_command_run_finish (result, NULL, &error); |
102 | 114 | if (error == NULL && status != 0) |
103 | 115 | g_set_error (&error, REALM_ERROR, REALM_ERROR_INTERNAL, |
104 | "Enabling sssd in nsswitch.conf and pam failed"); | |
116 | _("Enabling SSSD in nsswitch.conf and PAM failed.")); | |
105 | 117 | if (error != NULL) |
106 | 118 | g_simple_async_result_take_error (res, error); |
107 | 119 | |
149 | 161 | workgroup = g_hash_table_lookup (settings, "workgroup"); |
150 | 162 | if (workgroup == NULL) { |
151 | 163 | g_set_error (error, REALM_ERROR, REALM_ERROR_INTERNAL, |
152 | "Failed to calculate domain workgroup"); | |
164 | _("Failed to calculate domain workgroup")); | |
153 | 165 | return FALSE; |
154 | 166 | } |
155 | 167 | |
234 | 246 | |
235 | 247 | realm_packages_install_finish (result, &error); |
236 | 248 | if (error == NULL) { |
237 | realm_samba_enroll_join_async (enroll->realm_name, enroll->admin_kerberos_cache, | |
249 | realm_samba_enroll_join_async (enroll->realm_name, enroll->ccache, | |
238 | 250 | enroll->invocation, on_join_do_sssd, |
239 | 251 | g_object_ref (res)); |
240 | 252 | |
247 | 259 | } |
248 | 260 | |
249 | 261 | static void |
250 | on_discover_do_install (GObject *source, | |
251 | GAsyncResult *result, | |
252 | gpointer user_data) | |
262 | on_kinit_do_install (GObject *source, | |
263 | GAsyncResult *result, | |
264 | gpointer user_data) | |
253 | 265 | { |
254 | 266 | GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data); |
255 | 267 | EnrollClosure *enroll = g_simple_async_result_get_op_res_gpointer (res); |
256 | GHashTable *discovery = NULL; | |
257 | GError *error = NULL; | |
258 | ||
259 | if (realm_ad_discover_finish (result, &discovery, &error)) { | |
260 | enroll->discovery = discovery; | |
261 | realm_packages_install_async ("sssd_ad-packages", enroll->invocation, | |
268 | GError *error = NULL; | |
269 | ||
270 | enroll->ccache = realm_kerberos_kinit_ccache_finish (REALM_KERBEROS (source), result, &error); | |
271 | if (error == NULL) { | |
272 | realm_packages_install_async ("sssd-ad-packages", enroll->invocation, | |
262 | 273 | on_install_do_join, g_object_ref (res)); |
263 | 274 | |
264 | } else if (error == NULL) { | |
265 | g_simple_async_result_set_error (res, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, | |
266 | "Invalid or unusable realm argument"); | |
275 | } else { | |
276 | g_simple_async_result_take_error (res, error); | |
267 | 277 | g_simple_async_result_complete (res); |
268 | ||
269 | } else { | |
270 | g_simple_async_result_take_error (res, error); | |
271 | g_simple_async_result_complete (res); | |
272 | } | |
273 | ||
274 | g_object_unref (res); | |
275 | ||
278 | } | |
279 | ||
280 | g_object_unref (res); | |
276 | 281 | } |
277 | 282 | |
278 | 283 | static void |
279 | 284 | realm_sssd_ad_enroll_async (RealmKerberos *realm, |
280 | GBytes *admin_kerberos_cache, | |
285 | const char *name, | |
286 | const char *password, | |
287 | RealmKerberosFlags flags, | |
281 | 288 | GDBusMethodInvocation *invocation, |
282 | 289 | GAsyncReadyCallback callback, |
283 | 290 | gpointer user_data) |
291 | 298 | enroll = g_slice_new0 (EnrollClosure); |
292 | 299 | g_object_get (sssd, "name", &enroll->realm_name, NULL); |
293 | 300 | enroll->invocation = g_object_ref (invocation); |
294 | enroll->admin_kerberos_cache = g_bytes_ref (admin_kerberos_cache); | |
295 | 301 | g_simple_async_result_set_op_res_gpointer (res, enroll, enroll_closure_free); |
296 | ||
297 | enroll->discovery = realm_kerberos_get_discovery (realm); | |
298 | if (enroll->discovery) | |
299 | g_hash_table_ref (enroll->discovery); | |
300 | 302 | |
301 | 303 | /* Make sure not already enrolled in a realm */ |
302 | 304 | if (realm_sssd_get_config_section (sssd) != NULL) { |
303 | 305 | g_simple_async_result_set_error (res, REALM_ERROR, REALM_ERROR_ALREADY_ENROLLED, |
304 | "Already enrolled in this realm"); | |
306 | _("Already enrolled in this realm")); | |
305 | 307 | g_simple_async_result_complete_in_idle (res); |
306 | 308 | |
307 | 309 | } else if (realm_sssd_config_have_domain (realm_sssd_get_config (sssd), enroll->realm_name)) { |
308 | 310 | g_simple_async_result_set_error (res, REALM_ERROR, REALM_ERROR_ALREADY_ENROLLED, |
309 | "This domain is already configured"); | |
311 | _("This domain is already configured")); | |
310 | 312 | g_simple_async_result_complete_in_idle (res); |
311 | 313 | |
312 | /* Caller didn't discover first time around, so do that now */ | |
313 | } else if (enroll->discovery == NULL) { | |
314 | realm_ad_discover_async (enroll->realm_name, invocation, | |
315 | on_discover_do_install, g_object_ref (res)); | |
316 | ||
317 | 314 | /* Already have discovery info, so go straight to install */ |
318 | 315 | } else { |
319 | realm_packages_install_async ("sssd-ad-packages", invocation, | |
320 | on_install_do_join, g_object_ref (res)); | |
316 | realm_kerberos_kinit_ccache_async (realm, name, password, REALM_SAMBA_ENROLL_ENC_TYPES, | |
317 | invocation, on_kinit_do_install, g_object_ref (res)); | |
321 | 318 | } |
322 | 319 | |
323 | 320 | g_object_unref (res); |
412 | 409 | } |
413 | 410 | |
414 | 411 | static void |
412 | on_kinit_do_leave (GObject *source, | |
413 | GAsyncResult *result, | |
414 | gpointer user_data) | |
415 | { | |
416 | GSimpleAsyncResult *async = G_SIMPLE_ASYNC_RESULT (user_data); | |
417 | UnenrollClosure *unenroll = g_simple_async_result_get_op_res_gpointer (async); | |
418 | RealmSssd *self = REALM_SSSD (source); | |
419 | GError *error = NULL; | |
420 | GBytes *ccache; | |
421 | ||
422 | ccache = realm_kerberos_kinit_ccache_finish (REALM_KERBEROS (self), result, &error); | |
423 | if (error == NULL) { | |
424 | realm_samba_enroll_leave_async (unenroll->realm_name, ccache, unenroll->invocation, | |
425 | on_leave_do_sssd, g_object_ref (async)); | |
426 | g_bytes_unref (ccache); | |
427 | ||
428 | } else { | |
429 | g_simple_async_result_take_error (async, error); | |
430 | g_simple_async_result_complete (async); | |
431 | } | |
432 | ||
433 | g_object_unref (async); | |
434 | } | |
435 | ||
436 | static void | |
415 | 437 | realm_sssd_ad_unenroll_async (RealmKerberos *realm, |
416 | GBytes *admin_kerberos_cache, | |
438 | const gchar *name, | |
439 | const gchar *password, | |
440 | RealmKerberosFlags flags, | |
417 | 441 | GDBusMethodInvocation *invocation, |
418 | 442 | GAsyncReadyCallback callback, |
419 | 443 | gpointer user_data) |
431 | 455 | |
432 | 456 | /* Check that enrolled in this realm */ |
433 | 457 | if (realm_sssd_get_config_section (sssd)) { |
434 | realm_samba_enroll_leave_async (unenroll->realm_name, admin_kerberos_cache, invocation, | |
435 | on_leave_do_sssd, g_object_ref (res)); | |
458 | realm_kerberos_kinit_ccache_async (realm, name, password, REALM_SAMBA_ENROLL_ENC_TYPES, | |
459 | invocation, on_kinit_do_leave, g_object_ref (res)); | |
460 | ||
436 | 461 | } else { |
437 | 462 | g_simple_async_result_set_error (res, REALM_ERROR, REALM_ERROR_NOT_ENROLLED, |
438 | "Not currently enrolled in the realm"); | |
463 | _("Not currently enrolled in the realm")); | |
439 | 464 | g_simple_async_result_complete_in_idle (res); |
440 | 465 | } |
441 | 466 | |
458 | 483 | { |
459 | 484 | RealmKerberosClass *kerberos_class = REALM_KERBEROS_CLASS (klass); |
460 | 485 | |
461 | kerberos_class->enroll_async = realm_sssd_ad_enroll_async; | |
486 | kerberos_class->enroll_password_async = realm_sssd_ad_enroll_async; | |
462 | 487 | kerberos_class->enroll_finish = realm_sssd_ad_generic_finish; |
463 | kerberos_class->unenroll_async = realm_sssd_ad_unenroll_async; | |
488 | kerberos_class->unenroll_password_async = realm_sssd_ad_unenroll_async; | |
464 | 489 | kerberos_class->unenroll_finish = realm_sssd_ad_generic_finish; |
465 | 490 | } |
17 | 17 | #include "realm-ini-config.h" |
18 | 18 | #include "realm-sssd-config.h" |
19 | 19 | #include "realm-settings.h" |
20 | ||
21 | #include <glib/gi18n.h> | |
20 | 22 | |
21 | 23 | #include <string.h> |
22 | 24 | |
118 | 120 | if (realm_ini_config_have_section (config, section)) { |
119 | 121 | realm_ini_config_abort_change (config); |
120 | 122 | g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_EXIST, |
121 | "Already have domain %s in sssd.conf config file", domain); | |
123 | _("Already have domain %s in sssd.conf config file"), domain); | |
122 | 124 | g_free (section); |
123 | 125 | return FALSE; |
124 | 126 | } |
92 | 92 | } |
93 | 93 | |
94 | 94 | static void |
95 | on_ipa_discover (GObject *source, | |
96 | GAsyncResult *result, | |
97 | gpointer user_data) | |
98 | { | |
99 | GSimpleAsyncResult *async = G_SIMPLE_ASYNC_RESULT (user_data); | |
100 | g_simple_async_result_set_op_res_gpointer (async, g_object_ref (result), g_object_unref); | |
101 | g_simple_async_result_complete (async); | |
102 | g_object_unref (async); | |
103 | } | |
104 | ||
105 | static void | |
95 | 106 | realm_sssd_ipa_provider_discover_async (RealmProvider *provider, |
96 | 107 | const gchar *string, |
97 | 108 | GDBusMethodInvocation *invocation, |
98 | 109 | GAsyncReadyCallback callback, |
99 | 110 | gpointer user_data) |
100 | 111 | { |
101 | realm_ipa_discover_async (string, invocation, callback, user_data); | |
112 | GSimpleAsyncResult *async; | |
113 | ||
114 | async = g_simple_async_result_new (G_OBJECT (provider), callback, user_data, | |
115 | realm_sssd_ipa_provider_discover_async); | |
116 | ||
117 | realm_ipa_discover_async (string, invocation, on_ipa_discover, g_object_ref (async)); | |
118 | ||
119 | g_object_unref (async); | |
120 | ||
102 | 121 | } |
103 | 122 | |
104 | 123 | static gint |
107 | 126 | GVariant **realms, |
108 | 127 | GError **error) |
109 | 128 | { |
129 | GSimpleAsyncResult *async; | |
130 | GAsyncResult *ipa_result; | |
110 | 131 | GDBusInterfaceSkeleton *realm; |
111 | 132 | GHashTable *discovery; |
112 | 133 | const gchar *object_path; |
113 | 134 | GVariant *realm_info; |
114 | 135 | gchar *name; |
115 | 136 | |
116 | name = realm_ipa_discover_finish (result, &discovery, error); | |
137 | async = G_SIMPLE_ASYNC_RESULT (result); | |
138 | ipa_result = g_simple_async_result_get_op_res_gpointer (async); | |
139 | ||
140 | name = realm_ipa_discover_finish (ipa_result, &discovery, error); | |
117 | 141 | if (name == NULL) |
118 | 142 | return 0; |
119 | 143 | |
130 | 154 | realm_kerberos_set_discovery (REALM_KERBEROS (realm), discovery); |
131 | 155 | |
132 | 156 | object_path = g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (realm)); |
133 | realm_info = realm_provider_new_realm_info (REALM_DBUS_SSSD_IPA_NAME, object_path, | |
134 | REALM_DBUS_KERBEROS_REALM_INTERFACE); | |
135 | *realms = g_variant_new_array (G_VARIANT_TYPE ("(sos)"), &realm_info, 1); | |
157 | realm_info = realm_provider_new_realm_info (object_path, REALM_DBUS_KERBEROS_REALM_INTERFACE); | |
158 | *realms = g_variant_new_array (G_VARIANT_TYPE ("(os)"), &realm_info, 1); | |
136 | 159 | g_variant_ref_sink (*realms); |
137 | 160 | |
138 | 161 | g_hash_table_unref (discovery); |
173 | 196 | RealmProviderClass *provider_class = REALM_PROVIDER_CLASS (klass); |
174 | 197 | GObjectClass *object_class = G_OBJECT_CLASS (klass); |
175 | 198 | |
176 | provider_class->dbus_name = REALM_DBUS_SSSD_IPA_NAME; | |
177 | 199 | provider_class->dbus_path = REALM_DBUS_SSSD_IPA_PATH; |
178 | 200 | provider_class->discover_async = realm_sssd_ipa_provider_discover_async; |
179 | 201 | provider_class->discover_finish = realm_sssd_ipa_provider_discover_finish; |
40 | 40 | RealmSssdClass parent_class; |
41 | 41 | } RealmSssdIpaClass; |
42 | 42 | |
43 | enum { | |
44 | PROP_0, | |
45 | PROP_NAME, | |
46 | PROP_DOMAIN, | |
47 | PROP_PROVIDER, | |
48 | }; | |
49 | ||
50 | 43 | G_DEFINE_TYPE (RealmSssdIpa, realm_sssd_ipa, REALM_TYPE_SSSD); |
51 | 44 | |
52 | 45 | static void |
55 | 48 | GPtrArray *entries; |
56 | 49 | GVariant *entry; |
57 | 50 | GVariant *details; |
51 | GVariant *supported; | |
58 | 52 | |
59 | 53 | entries = g_ptr_array_new (); |
60 | 54 | |
71 | 65 | entries->len); |
72 | 66 | g_variant_ref_sink (details); |
73 | 67 | |
68 | /* | |
69 | * Each line is a combination of owner and what kind of credentials are supported, | |
70 | * same for enroll/unenroll. Enroll is not currently implemented: empty. | |
71 | */ | |
72 | supported = realm_kerberos_build_supported_credentials (0, 0); | |
73 | ||
74 | 74 | g_object_set (self, |
75 | 75 | "details", details, |
76 | 76 | "suggested-administrator", "admin", |
77 | "supported-enroll-credentials", supported, | |
78 | "supported-unenroll-credentials", supported, | |
77 | 79 | NULL); |
78 | 80 | |
79 | 81 | g_variant_unref (details); |
83 | 85 | static void |
84 | 86 | realm_sssd_ipa_enroll_async (RealmKerberos *realm, |
85 | 87 | GBytes *admin_kerberos_cache, |
88 | RealmKerberosFlags flags, | |
86 | 89 | GDBusMethodInvocation *invocation, |
87 | 90 | GAsyncReadyCallback callback, |
88 | 91 | gpointer user_data) |
100 | 103 | static void |
101 | 104 | realm_sssd_ipa_unenroll_async (RealmKerberos *realm, |
102 | 105 | GBytes *admin_kerberos_cache, |
106 | RealmKerberosFlags flags, | |
103 | 107 | GDBusMethodInvocation *invocation, |
104 | 108 | GAsyncReadyCallback callback, |
105 | 109 | gpointer user_data) |
129 | 133 | { |
130 | 134 | RealmKerberosClass *kerberos_class = REALM_KERBEROS_CLASS (klass); |
131 | 135 | |
132 | kerberos_class->enroll_async = realm_sssd_ipa_enroll_async; | |
136 | kerberos_class->enroll_ccache_async = realm_sssd_ipa_enroll_async; | |
133 | 137 | kerberos_class->enroll_finish = realm_sssd_ipa_generic_finish; |
134 | kerberos_class->unenroll_async = realm_sssd_ipa_unenroll_async; | |
138 | kerberos_class->unenroll_ccache_async = realm_sssd_ipa_unenroll_async; | |
135 | 139 | kerberos_class->unenroll_finish = realm_sssd_ipa_generic_finish; |
136 | 140 | } |
27 | 27 | #include <glib/gstdio.h> |
28 | 28 | |
29 | 29 | struct _RealmSssdPrivate { |
30 | gchar *realm; | |
31 | 30 | gchar *domain; |
32 | 31 | gchar *section; |
33 | 32 | RealmIniConfig *config; |
36 | 35 | |
37 | 36 | enum { |
38 | 37 | PROP_0, |
39 | PROP_NAME, | |
40 | PROP_DOMAIN, | |
41 | 38 | PROP_PROVIDER, |
42 | 39 | }; |
43 | 40 | |
185 | 182 | static void |
186 | 183 | update_domain (RealmSssd *self) |
187 | 184 | { |
185 | const char *name; | |
188 | 186 | gchar *domain = NULL; |
189 | 187 | |
190 | 188 | if (self->pv->section != NULL) |
191 | 189 | domain = realm_ini_config_get (self->pv->config, self->pv->section, "dns_discovery_domain"); |
192 | if (domain == NULL) | |
193 | domain = g_ascii_strdown (self->pv->realm, -1); | |
190 | if (domain == NULL) { | |
191 | name = realm_dbus_kerberos_get_name (REALM_DBUS_KERBEROS (self)); | |
192 | domain = name ? g_ascii_strdown (name, -1) : NULL; | |
193 | } | |
194 | 194 | g_object_set (self, "domain", domain, NULL); |
195 | 195 | g_free (domain); |
196 | 196 | } |
278 | 278 | update_properties (RealmSssd *self) |
279 | 279 | { |
280 | 280 | GObject *obj = G_OBJECT (self); |
281 | const gchar *name; | |
281 | 282 | gchar *section = NULL; |
282 | 283 | gchar *domain = NULL; |
283 | 284 | gchar **domains; |
288 | 289 | |
289 | 290 | /* Find the config domain with our realm */ |
290 | 291 | domains = realm_sssd_config_get_domains (self->pv->config); |
292 | name = realm_dbus_kerberos_get_name (REALM_DBUS_KERBEROS (self)); | |
291 | 293 | for (i = 0; domains && domains[i]; i++) { |
292 | 294 | section = realm_sssd_config_domain_to_section (domains[i]); |
293 | 295 | realm = realm_ini_config_get (self->pv->config, section, "krb5_realm"); |
294 | if (g_strcmp0 (realm, self->pv->realm) == 0) { | |
296 | if (g_strcmp0 (realm, name) == 0) { | |
295 | 297 | domain = g_strdup (domains[i]); |
296 | 298 | break; |
297 | 299 | } else { |
323 | 325 | } |
324 | 326 | |
325 | 327 | static void |
326 | realm_sssd_get_property (GObject *obj, | |
327 | guint prop_id, | |
328 | GValue *value, | |
329 | GParamSpec *pspec) | |
330 | { | |
331 | RealmSssd *self = REALM_SSSD (obj); | |
332 | ||
333 | switch (prop_id) { | |
334 | case PROP_NAME: | |
335 | g_value_set_string (value, self->pv->realm); | |
336 | break; | |
337 | default: | |
338 | G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); | |
339 | break; | |
340 | } | |
341 | } | |
342 | ||
343 | static void | |
344 | 328 | realm_sssd_set_property (GObject *obj, |
345 | 329 | guint prop_id, |
346 | 330 | const GValue *value, |
350 | 334 | RealmProvider *provider; |
351 | 335 | |
352 | 336 | switch (prop_id) { |
353 | case PROP_NAME: | |
354 | self->pv->realm = g_value_dup_string (value); | |
355 | break; | |
356 | 337 | case PROP_PROVIDER: |
357 | 338 | provider = g_value_get_object (value); |
358 | 339 | g_object_get (provider, "sssd-config", &self->pv->config, NULL); |
367 | 348 | } |
368 | 349 | |
369 | 350 | static void |
370 | realm_sssd_consructed (GObject *obj) | |
371 | { | |
372 | RealmSssd *self = REALM_SSSD (obj); | |
373 | ||
374 | G_OBJECT_CLASS (realm_sssd_parent_class)->constructed (obj); | |
375 | ||
376 | update_properties (self); | |
351 | realm_sssd_notify (GObject *obj, | |
352 | GParamSpec *spec) | |
353 | { | |
354 | if (g_str_equal (spec->name, "name")) | |
355 | update_properties (REALM_SSSD (obj)); | |
356 | ||
357 | G_OBJECT_CLASS (realm_sssd_parent_class)->notify (obj, spec); | |
377 | 358 | } |
378 | 359 | |
379 | 360 | static void |
397 | 378 | kerberos_class->logins_async = realm_sssd_logins_async; |
398 | 379 | kerberos_class->logins_finish = realm_sssd_generic_finish; |
399 | 380 | |
400 | object_class->constructed = realm_sssd_consructed; | |
401 | object_class->get_property = realm_sssd_get_property; | |
402 | 381 | object_class->set_property = realm_sssd_set_property; |
382 | object_class->notify = realm_sssd_notify; | |
403 | 383 | object_class->finalize = realm_sssd_finalize; |
404 | ||
405 | g_object_class_install_property (object_class, PROP_NAME, | |
406 | g_param_spec_string ("name", "Name", "Realm Name", | |
407 | "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); | |
408 | 384 | |
409 | 385 | g_object_class_install_property (object_class, PROP_PROVIDER, |
410 | 386 | g_param_spec_object ("provider", "Provider", "SssdAd Provider", |
0 | # Makefile.in generated by automake 1.11.5 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.12.2 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | |
4 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software | |
5 | # Foundation, Inc. | |
3 | # Copyright (C) 1994-2012 Free Software Foundation, Inc. | |
4 | ||
6 | 5 | # This Makefile.in is free software; the Free Software Foundation |
7 | 6 | # gives unlimited permission to copy and/or distribute it, |
8 | 7 | # with or without modifications, as long as this notice is preserved. |
49 | 48 | PRE_UNINSTALL = : |
50 | 49 | POST_UNINSTALL = : |
51 | 50 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ |
52 | $(top_srcdir)/Makefile.decl | |
51 | $(top_srcdir)/Makefile.decl $(top_srcdir)/depcomp | |
53 | 52 | check_PROGRAMS = $(am__EXEEXT_2) |
54 | 53 | noinst_PROGRAMS = frob-install-packages$(EXEEXT) $(am__EXEEXT_1) |
55 | 54 | subdir = tests |
92 | 91 | test_sssd_config_OBJECTS = $(am_test_sssd_config_OBJECTS) |
93 | 92 | test_sssd_config_LDADD = $(LDADD) |
94 | 93 | test_sssd_config_DEPENDENCIES = $(am__DEPENDENCIES_1) |
94 | AM_V_P = $(am__v_P_@AM_V@) | |
95 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) | |
96 | am__v_P_0 = false | |
97 | am__v_P_1 = : | |
98 | AM_V_GEN = $(am__v_GEN_@AM_V@) | |
99 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | |
100 | am__v_GEN_0 = @echo " GEN " $@; | |
101 | am__v_GEN_1 = | |
102 | AM_V_at = $(am__v_at_@AM_V@) | |
103 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | |
104 | am__v_at_0 = @ | |
105 | am__v_at_1 = | |
95 | 106 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) |
96 | 107 | depcomp = $(SHELL) $(top_srcdir)/depcomp |
97 | 108 | am__depfiles_maybe = depfiles |
99 | 110 | AM_V_lt = $(am__v_lt_@AM_V@) |
100 | 111 | am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) |
101 | 112 | am__v_lt_0 = --silent |
113 | am__v_lt_1 = | |
102 | 114 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
103 | 115 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
104 | 116 | AM_V_CC = $(am__v_CC_@AM_V@) |
105 | 117 | am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) |
106 | am__v_CC_0 = @echo " CC " $@; | |
107 | AM_V_at = $(am__v_at_@AM_V@) | |
108 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | |
109 | am__v_at_0 = @ | |
118 | am__v_CC_0 = @echo " CC " $@; | |
119 | am__v_CC_1 = | |
110 | 120 | CCLD = $(CC) |
111 | 121 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ |
112 | 122 | AM_V_CCLD = $(am__v_CCLD_@AM_V@) |
113 | 123 | am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) |
114 | am__v_CCLD_0 = @echo " CCLD " $@; | |
115 | AM_V_GEN = $(am__v_GEN_@AM_V@) | |
116 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | |
117 | am__v_GEN_0 = @echo " GEN " $@; | |
124 | am__v_CCLD_0 = @echo " CCLD " $@; | |
125 | am__v_CCLD_1 = | |
118 | 126 | SOURCES = frob-install-packages.c $(test_ini_config_SOURCES) \ |
119 | 127 | $(test_login_name_SOURCES) $(test_sssd_config_SOURCES) |
120 | 128 | DIST_SOURCES = frob-install-packages.c $(test_ini_config_SOURCES) \ |
570 | 578 | && $(am__cd) $(top_srcdir) \ |
571 | 579 | && gtags -i $(GTAGS_ARGS) "$$here" |
572 | 580 | |
581 | cscopelist: $(HEADERS) $(SOURCES) $(LISP) | |
582 | list='$(SOURCES) $(HEADERS) $(LISP)'; \ | |
583 | case "$(srcdir)" in \ | |
584 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ | |
585 | *) sdir=$(subdir)/$(srcdir) ;; \ | |
586 | esac; \ | |
587 | for i in $$list; do \ | |
588 | if test -f "$$i"; then \ | |
589 | echo "$(subdir)/$$i"; \ | |
590 | else \ | |
591 | echo "$$sdir/$$i"; \ | |
592 | fi; \ | |
593 | done >> $(top_builddir)/cscope.files | |
594 | ||
573 | 595 | distclean-tags: |
574 | 596 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags |
575 | 597 | |
714 | 736 | |
715 | 737 | .PHONY: CTAGS GTAGS all all-am all-local check check-am check-local \ |
716 | 738 | clean clean-checkPROGRAMS clean-generic clean-noinstPROGRAMS \ |
717 | ctags distclean distclean-compile distclean-generic \ | |
739 | cscopelist ctags distclean distclean-compile distclean-generic \ | |
718 | 740 | distclean-tags distdir dvi dvi-am html html-am info info-am \ |
719 | 741 | install install-am install-data install-data-am install-dvi \ |
720 | 742 | install-dvi-am install-exec install-exec-am install-html \ |
12 | 12 | AM_CFLAGS = \ |
13 | 13 | -I$(top_srcdir)/dbus \ |
14 | 14 | -I$(top_builddir)/dbus \ |
15 | -DLOCALEDIR=\""$(datadir)/locale"\" \ | |
15 | 16 | $(GLIB_CFLAGS) \ |
16 | 17 | $(KRB5_CFLAGS) \ |
17 | 18 | $(NULL) |
0 | # Makefile.in generated by automake 1.11.5 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.12.2 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | |
4 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software | |
5 | # Foundation, Inc. | |
3 | # Copyright (C) 1994-2012 Free Software Foundation, Inc. | |
4 | ||
6 | 5 | # This Makefile.in is free software; the Free Software Foundation |
7 | 6 | # gives unlimited permission to copy and/or distribute it, |
8 | 7 | # with or without modifications, as long as this notice is preserved. |
49 | 48 | PRE_UNINSTALL = : |
50 | 49 | POST_UNINSTALL = : |
51 | 50 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ |
52 | $(top_srcdir)/Makefile.decl | |
51 | $(top_srcdir)/Makefile.decl $(top_srcdir)/depcomp | |
53 | 52 | bin_PROGRAMS = realm$(EXEEXT) |
54 | 53 | subdir = tools |
55 | 54 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
73 | 72 | realm_DEPENDENCIES = $(top_builddir)/dbus/librealm-dbus.a \ |
74 | 73 | $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ |
75 | 74 | $(am__DEPENDENCIES_1) |
75 | AM_V_P = $(am__v_P_@AM_V@) | |
76 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) | |
77 | am__v_P_0 = false | |
78 | am__v_P_1 = : | |
79 | AM_V_GEN = $(am__v_GEN_@AM_V@) | |
80 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | |
81 | am__v_GEN_0 = @echo " GEN " $@; | |
82 | am__v_GEN_1 = | |
83 | AM_V_at = $(am__v_at_@AM_V@) | |
84 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | |
85 | am__v_at_0 = @ | |
86 | am__v_at_1 = | |
76 | 87 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) |
77 | 88 | depcomp = $(SHELL) $(top_srcdir)/depcomp |
78 | 89 | am__depfiles_maybe = depfiles |
81 | 92 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) |
82 | 93 | AM_V_CC = $(am__v_CC_@AM_V@) |
83 | 94 | am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) |
84 | am__v_CC_0 = @echo " CC " $@; | |
85 | AM_V_at = $(am__v_at_@AM_V@) | |
86 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) | |
87 | am__v_at_0 = @ | |
95 | am__v_CC_0 = @echo " CC " $@; | |
96 | am__v_CC_1 = | |
88 | 97 | CCLD = $(CC) |
89 | 98 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ |
90 | 99 | AM_V_CCLD = $(am__v_CCLD_@AM_V@) |
91 | 100 | am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) |
92 | am__v_CCLD_0 = @echo " CCLD " $@; | |
93 | AM_V_GEN = $(am__v_GEN_@AM_V@) | |
94 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) | |
95 | am__v_GEN_0 = @echo " GEN " $@; | |
101 | am__v_CCLD_0 = @echo " CCLD " $@; | |
102 | am__v_CCLD_1 = | |
96 | 103 | SOURCES = $(realm_SOURCES) |
97 | 104 | DIST_SOURCES = $(realm_SOURCES) |
98 | 105 | am__can_run_installinfo = \ |
276 | 283 | AM_CFLAGS = \ |
277 | 284 | -I$(top_srcdir)/dbus \ |
278 | 285 | -I$(top_builddir)/dbus \ |
286 | -DLOCALEDIR=\""$(datadir)/locale"\" \ | |
279 | 287 | $(GLIB_CFLAGS) \ |
280 | 288 | $(KRB5_CFLAGS) \ |
281 | 289 | $(NULL) |
438 | 446 | here=`$(am__cd) $(top_builddir) && pwd` \ |
439 | 447 | && $(am__cd) $(top_srcdir) \ |
440 | 448 | && gtags -i $(GTAGS_ARGS) "$$here" |
449 | ||
450 | cscopelist: $(HEADERS) $(SOURCES) $(LISP) | |
451 | list='$(SOURCES) $(HEADERS) $(LISP)'; \ | |
452 | case "$(srcdir)" in \ | |
453 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ | |
454 | *) sdir=$(subdir)/$(srcdir) ;; \ | |
455 | esac; \ | |
456 | for i in $$list; do \ | |
457 | if test -f "$$i"; then \ | |
458 | echo "$(subdir)/$$i"; \ | |
459 | else \ | |
460 | echo "$$sdir/$$i"; \ | |
461 | fi; \ | |
462 | done >> $(top_builddir)/cscope.files | |
441 | 463 | |
442 | 464 | distclean-tags: |
443 | 465 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags |
581 | 603 | .MAKE: install-am install-strip |
582 | 604 | |
583 | 605 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ |
584 | clean-generic ctags distclean distclean-compile \ | |
606 | clean-generic cscopelist ctags distclean distclean-compile \ | |
585 | 607 | distclean-generic distclean-tags distdir dvi dvi-am html \ |
586 | 608 | html-am info info-am install install-am install-binPROGRAMS \ |
587 | 609 | install-data install-data-am install-dvi install-dvi-am \ |
22 | 22 | |
23 | 23 | #include <glib.h> |
24 | 24 | #include <glib/gstdio.h> |
25 | #include <glib/gi18n.h> | |
25 | 26 | |
26 | 27 | #include <sys/types.h> |
27 | 28 | #include <sys/stat.h> |
33 | 34 | print_realm_info (GVariant *realm_info) |
34 | 35 | { |
35 | 36 | RealmDbusKerberos *realm = NULL; |
36 | const gchar *bus_name; | |
37 | 37 | const gchar *object_path; |
38 | 38 | const gchar *interface_name; |
39 | 39 | GError *error = NULL; |
45 | 45 | gchar *string; |
46 | 46 | const gchar *policy; |
47 | 47 | |
48 | g_variant_get (realm_info, "(&s&o&s)", &bus_name, &object_path, &interface_name); | |
48 | g_variant_get (realm_info, "(&o&s)", &object_path, &interface_name); | |
49 | 49 | |
50 | 50 | if (!g_str_equal (interface_name, REALM_DBUS_KERBEROS_REALM_INTERFACE)) |
51 | 51 | return; |
52 | 52 | |
53 | 53 | realm = realm_dbus_kerberos_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, |
54 | 54 | G_DBUS_PROXY_FLAGS_NONE, |
55 | bus_name, object_path, | |
55 | REALM_DBUS_BUS_NAME, object_path, | |
56 | 56 | NULL, &error); |
57 | 57 | |
58 | 58 | if (error != NULL) { |
87 | 87 | g_object_unref (realm); |
88 | 88 | } |
89 | 89 | |
90 | static void | |
91 | on_diagnostics_signal (GDBusConnection *connection, | |
92 | const gchar *sender_name, | |
93 | const gchar *object_path, | |
94 | const gchar *interface_name, | |
95 | const gchar *signal_name, | |
96 | GVariant *parameters, | |
97 | gpointer user_data) | |
98 | { | |
99 | const gchar *data; | |
100 | const gchar *unused; | |
101 | g_variant_get (parameters, "(&s&s)", &data, &unused); | |
102 | g_printerr ("%s", data); | |
103 | } | |
104 | ||
105 | static void | |
106 | connect_to_diagnostics (GDBusProxy *proxy) | |
107 | { | |
108 | GDBusConnection *connection; | |
109 | const gchar *bus_name; | |
110 | const gchar *object_path; | |
111 | ||
112 | connection = g_dbus_proxy_get_connection (proxy); | |
113 | bus_name = g_dbus_proxy_get_name (proxy); | |
114 | object_path = g_dbus_proxy_get_object_path (proxy); | |
115 | ||
116 | g_dbus_connection_signal_subscribe (connection, bus_name, | |
117 | REALM_DBUS_DIAGNOSTICS_INTERFACE, | |
118 | REALM_DBUS_DIAGNOSTICS_SIGNAL, | |
119 | object_path, NULL, G_DBUS_SIGNAL_FLAGS_NONE, | |
120 | on_diagnostics_signal, NULL, NULL); | |
121 | } | |
122 | ||
123 | 90 | typedef struct { |
124 | 91 | GAsyncResult *result; |
125 | 92 | GMainLoop *loop; |
136 | 103 | } |
137 | 104 | |
138 | 105 | static int |
139 | perform_discover (const gchar *string, | |
140 | gboolean verbose) | |
106 | perform_discover (GDBusConnection *connection, | |
107 | const gchar *string) | |
141 | 108 | { |
142 | 109 | RealmDbusProvider *provider; |
143 | 110 | GVariant *realm_info; |
147 | 114 | SyncClosure sync; |
148 | 115 | GVariant *realms; |
149 | 116 | gint relevance; |
117 | GVariant *options; | |
150 | 118 | |
151 | 119 | provider = realm_dbus_provider_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, |
152 | 120 | G_DBUS_PROXY_FLAGS_NONE, |
153 | "org.freedesktop.realmd", | |
154 | "/org/freedesktop/realmd", | |
121 | REALM_DBUS_BUS_NAME, | |
122 | REALM_DBUS_SERVICE_PATH, | |
155 | 123 | NULL, &error); |
156 | 124 | if (error != NULL) { |
157 | realm_handle_error (error, "couldn't connect to realm service"); | |
125 | realm_handle_error (error, _("Couldn't connect to realmd service")); | |
158 | 126 | return 2; |
159 | 127 | } |
160 | ||
161 | /* Setup diagnostics */ | |
162 | if (verbose) | |
163 | connect_to_diagnostics (G_DBUS_PROXY (provider)); | |
164 | 128 | |
165 | 129 | sync.result = NULL; |
166 | 130 | sync.loop = g_main_loop_new (NULL, FALSE); |
167 | 131 | |
132 | options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0); | |
133 | g_variant_ref_sink (options); | |
134 | ||
168 | 135 | g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (provider), G_MAXINT); |
169 | 136 | realm_dbus_provider_call_discover (provider, string ? string : "", |
170 | "unused-operation-id", | |
171 | NULL, on_complete_get_result, &sync); | |
137 | options, NULL, on_complete_get_result, &sync); | |
138 | ||
139 | g_variant_unref (options); | |
172 | 140 | |
173 | 141 | /* This mainloop is quit by on_complete_get_result */ |
174 | 142 | g_main_loop_run (sync.loop); |
180 | 148 | g_main_loop_unref (sync.loop); |
181 | 149 | |
182 | 150 | if (error != NULL) { |
183 | realm_handle_error (error, "couldn't discover realm"); | |
151 | realm_handle_error (error, _("Couldn't discover realm")); | |
184 | 152 | return 2; |
185 | 153 | } |
186 | 154 | |
195 | 163 | |
196 | 164 | if (!found) { |
197 | 165 | if (string == NULL) |
198 | realm_handle_error (NULL, "no default domain discovered"); | |
166 | realm_handle_error (NULL, _("No default realm discovered")); | |
199 | 167 | else |
200 | realm_handle_error (NULL, "no such realm found: %s", string); | |
168 | realm_handle_error (NULL, _("No such realm found: %s"), string); | |
201 | 169 | return 1; |
202 | 170 | } |
203 | 171 | |
208 | 176 | realm_discover (int argc, |
209 | 177 | char *argv[]) |
210 | 178 | { |
179 | GDBusConnection *connection; | |
211 | 180 | GOptionContext *context; |
212 | 181 | gboolean arg_verbose = FALSE; |
213 | 182 | GError *error = NULL; |
216 | 185 | gint i; |
217 | 186 | |
218 | 187 | GOptionEntry option_entries[] = { |
219 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose, "Verbose output", NULL }, | |
188 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose, N_("Verbose output"), NULL }, | |
220 | 189 | { NULL, } |
221 | 190 | }; |
222 | 191 | |
223 | 192 | g_type_init (); |
224 | 193 | |
225 | 194 | context = g_option_context_new ("realm-or-domain"); |
195 | g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); | |
226 | 196 | g_option_context_add_main_entries (context, option_entries, NULL); |
227 | 197 | |
228 | 198 | if (!g_option_context_parse (context, &argc, &argv, &error)) { |
231 | 201 | ret = 2; |
232 | 202 | } |
233 | 203 | |
204 | connection = realm_get_connection (arg_verbose); | |
205 | if (!connection) { | |
206 | ret = 1; | |
207 | ||
234 | 208 | /* The default realm? */ |
235 | if (argc == 1) { | |
236 | ret = perform_discover (NULL, arg_verbose); | |
209 | } else if (argc == 1) { | |
210 | ret = perform_discover (connection, NULL); | |
211 | g_object_unref (connection); | |
237 | 212 | |
238 | 213 | /* Specific realms */ |
239 | 214 | } else { |
240 | 215 | for (i = 1; i < argc; i++) { |
241 | ret = perform_discover (argv[i], arg_verbose); | |
216 | ret = perform_discover (connection, argv[i]); | |
242 | 217 | if (ret != 0) |
243 | 218 | result = ret; |
244 | 219 | } |
220 | g_object_unref (connection); | |
245 | 221 | } |
246 | 222 | |
247 | 223 | g_option_context_free (context); |
249 | 225 | } |
250 | 226 | |
251 | 227 | static int |
252 | perform_list (gboolean verbose) | |
228 | perform_list (GDBusConnection *connection, | |
229 | gboolean verbose) | |
253 | 230 | { |
254 | 231 | RealmDbusProvider *provider; |
255 | 232 | GVariant *realms; |
258 | 235 | GVariantIter iter; |
259 | 236 | gboolean printed = FALSE; |
260 | 237 | |
261 | provider = realm_dbus_provider_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, | |
262 | G_DBUS_PROXY_FLAGS_NONE, | |
263 | "org.freedesktop.realmd", | |
264 | "/org/freedesktop/realmd", | |
265 | NULL, &error); | |
238 | provider = realm_dbus_provider_proxy_new_sync (connection, G_DBUS_PROXY_FLAGS_NONE, | |
239 | REALM_DBUS_BUS_NAME, | |
240 | REALM_DBUS_SERVICE_PATH, | |
241 | NULL, &error); | |
266 | 242 | if (error != NULL) { |
267 | realm_handle_error (error, "couldn't connect to realm service"); | |
243 | realm_handle_error (error, _("Couldn't connect to realmd service")); | |
268 | 244 | return 1; |
269 | 245 | } |
270 | 246 | |
271 | 247 | realms = realm_dbus_provider_get_realms (provider); |
272 | 248 | g_variant_iter_init (&iter, realms); |
273 | while (g_variant_iter_loop (&iter, "@(sos)", &realm_info)) { | |
249 | while (g_variant_iter_loop (&iter, "@(os)", &realm_info)) { | |
274 | 250 | print_realm_info (realm_info); |
275 | 251 | printed = TRUE; |
276 | 252 | } |
286 | 262 | realm_list (int argc, |
287 | 263 | char *argv[]) |
288 | 264 | { |
265 | GDBusConnection *connection; | |
289 | 266 | GOptionContext *context; |
290 | 267 | gboolean arg_verbose = FALSE; |
291 | 268 | GError *error = NULL; |
292 | 269 | gint ret = 0; |
293 | 270 | |
294 | 271 | GOptionEntry option_entries[] = { |
295 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose, "Verbose output", NULL }, | |
272 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose, N_("Verbose output"), NULL }, | |
296 | 273 | { NULL, } |
297 | 274 | }; |
298 | 275 | |
299 | 276 | context = g_option_context_new ("realm"); |
277 | g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); | |
300 | 278 | g_option_context_add_main_entries (context, option_entries, NULL); |
301 | 279 | |
302 | 280 | if (!g_option_context_parse (context, &argc, &argv, &error)) { |
309 | 287 | ret = 2; |
310 | 288 | |
311 | 289 | } else { |
312 | ret = perform_list (arg_verbose); | |
290 | connection = realm_get_connection (arg_verbose); | |
291 | if (connection) { | |
292 | ret = perform_list (connection, arg_verbose); | |
293 | g_object_unref (connection); | |
294 | } else { | |
295 | ret = 1; | |
296 | } | |
313 | 297 | } |
314 | 298 | |
315 | 299 | g_option_context_free (context); |
20 | 20 | #include <krb5/krb5.h> |
21 | 21 | |
22 | 22 | #include <glib.h> |
23 | #include <glib/gi18n.h> | |
23 | 24 | #include <glib/gstdio.h> |
24 | 25 | |
25 | 26 | #include <sys/types.h> |
26 | 27 | #include <sys/stat.h> |
27 | 28 | #include <errno.h> |
28 | 29 | #include <fcntl.h> |
29 | ||
30 | /* Only one operation at a time per process, so fine to do this */ | |
31 | static const gchar *operation_id = "realm-enroll"; | |
30 | #include <string.h> | |
32 | 31 | |
33 | 32 | static void |
34 | 33 | handle_krb5_error (krb5_error_code code, |
95 | 94 | |
96 | 95 | g_file_get_contents (filename, &contents, &length, &error); |
97 | 96 | if (error != NULL) { |
98 | realm_handle_error (error, "couldn't read credential cache"); | |
97 | realm_handle_error (error, _("Couldn't read credential cache")); | |
99 | 98 | return NULL; |
100 | 99 | } |
101 | 100 | |
107 | 106 | } |
108 | 107 | |
109 | 108 | static GVariant * |
110 | kinit_to_kerberos_cache (const gchar *name) | |
109 | kinit_to_kerberos_cache (const gchar *name, | |
110 | const gchar *realm) | |
111 | 111 | { |
112 | 112 | krb5_get_init_creds_opt *options = NULL; |
113 | 113 | krb5_context context = NULL; |
121 | 121 | |
122 | 122 | code = krb5_init_context (&context); |
123 | 123 | if (code != 0) { |
124 | handle_krb5_error (code, NULL, "couldn't initialize kerberos"); | |
124 | handle_krb5_error (code, NULL, _("Couldn't initialize kerberos")); | |
125 | 125 | goto cleanup; |
126 | 126 | } |
127 | 127 | |
128 | 128 | code = krb5_parse_name (context, name, &principal); |
129 | 129 | if (code != 0) { |
130 | handle_krb5_error (code, context, "couldn't parse user name"); | |
131 | goto cleanup; | |
130 | handle_krb5_error (code, context, _("Couldn't parse user name: %s"), name); | |
131 | goto cleanup; | |
132 | } | |
133 | ||
134 | /* Use our realm as the default */ | |
135 | if (strchr (name, '@') == NULL) { | |
136 | code = krb5_set_principal_realm (context, principal, realm); | |
137 | g_return_val_if_fail (code == 0, NULL); | |
132 | 138 | } |
133 | 139 | |
134 | 140 | code = krb5_get_init_creds_opt_alloc (context, &options); |
135 | 141 | if (code != 0) { |
136 | handle_krb5_error (code, context, "couldn't setup options"); | |
142 | handle_krb5_error (code, context, _("Couldn't setup kerberos options")); | |
137 | 143 | goto cleanup; |
138 | 144 | } |
139 | 145 | |
140 | 146 | filename = g_build_filename (g_get_user_runtime_dir (), "realmd-krb5-cache.XXXXXX", NULL); |
141 | 147 | temp_fd = g_mkstemp_full (filename, O_RDWR, S_IRUSR | S_IWUSR); |
142 | 148 | if (temp_fd == -1) { |
143 | realm_handle_error (NULL, "couldn't create credential cache file: %s", g_strerror (errno)); | |
149 | realm_handle_error (NULL, _("Couldn't create credential cache file: %s"), g_strerror (errno)); | |
144 | 150 | goto cleanup; |
145 | 151 | } |
146 | 152 | close (temp_fd); |
147 | 153 | |
148 | 154 | code = krb5_cc_resolve (context, filename, &ccache); |
149 | 155 | if (code != 0) { |
150 | handle_krb5_error (code, context, "couldn't resolve credential cache"); | |
156 | handle_krb5_error (code, context, _("Couldn't resolve credential cache")); | |
151 | 157 | goto cleanup; |
152 | 158 | } |
153 | 159 | |
154 | 160 | code = krb5_get_init_creds_opt_set_out_ccache (context, options, ccache); |
155 | 161 | if (code != 0) { |
156 | handle_krb5_error (code, context, "couldn't setup credential cache"); | |
162 | handle_krb5_error (code, context, _("Couldn't setup credential cache")); | |
157 | 163 | goto cleanup; |
158 | 164 | } |
159 | 165 | |
160 | 166 | code = krb5_get_init_creds_password (context, &my_creds, principal, NULL, |
161 | 167 | krb5_prompter_posix, 0, 0, NULL, options); |
162 | 168 | if (code != 0) { |
163 | handle_krb5_error (code, context, "couldn't authenticate as %s", name); | |
169 | handle_krb5_error (code, context, _("Couldn't authenticate as %s"), name); | |
164 | 170 | goto cleanup; |
165 | 171 | } |
166 | 172 | |
187 | 193 | return result; |
188 | 194 | } |
189 | 195 | |
190 | static void | |
191 | on_diagnostics_signal (GDBusConnection *connection, | |
192 | const gchar *sender_name, | |
193 | const gchar *object_path, | |
194 | const gchar *interface_name, | |
195 | const gchar *signal_name, | |
196 | GVariant *parameters, | |
197 | gpointer user_data) | |
198 | { | |
199 | const gchar *operation_id; | |
200 | const gchar *data; | |
201 | ||
202 | g_variant_get (parameters, "(&s&s)", &data, &operation_id); | |
203 | g_printerr ("%s", data); | |
204 | } | |
205 | ||
206 | static void | |
207 | connect_to_diagnostics (GDBusProxy *proxy) | |
208 | { | |
209 | GDBusConnection *connection; | |
210 | const gchar *bus_name; | |
211 | const gchar *object_path; | |
212 | ||
213 | connection = g_dbus_proxy_get_connection (proxy); | |
214 | bus_name = g_dbus_proxy_get_name (proxy); | |
215 | object_path = g_dbus_proxy_get_object_path (proxy); | |
216 | ||
217 | g_dbus_connection_signal_subscribe (connection, bus_name, | |
218 | REALM_DBUS_DIAGNOSTICS_INTERFACE, | |
219 | REALM_DBUS_DIAGNOSTICS_SIGNAL, | |
220 | object_path, NULL, G_DBUS_SIGNAL_FLAGS_NONE, | |
221 | on_diagnostics_signal, NULL, NULL); | |
222 | } | |
223 | ||
224 | 196 | typedef struct { |
225 | 197 | GAsyncResult *result; |
226 | 198 | GMainLoop *loop; |
236 | 208 | g_main_loop_quit (sync->loop); |
237 | 209 | } |
238 | 210 | |
239 | static int | |
240 | realm_join_or_leave (RealmDbusKerberos *realm, | |
241 | const gchar *user_name, | |
242 | gboolean verbose, | |
243 | gboolean join) | |
244 | { | |
245 | GVariant *kerberos_cache; | |
211 | static const gchar * | |
212 | find_appropriate_cred_type (RealmDbusKerberos *realm, | |
213 | gboolean join, | |
214 | const gchar **owner) | |
215 | { | |
216 | GVariant *supported; | |
217 | GVariantIter iter; | |
218 | const gchar *cred_owner; | |
219 | const gchar *cred_type; | |
220 | ||
221 | if (join) | |
222 | supported = realm_dbus_kerberos_get_supported_enroll_credentials (realm); | |
223 | else | |
224 | supported = realm_dbus_kerberos_get_supported_unenroll_credentials (realm); | |
225 | ||
226 | g_variant_iter_init (&iter, supported); | |
227 | while (g_variant_iter_loop (&iter, "(&s&s)", &cred_type, &cred_owner)) { | |
228 | if (g_str_equal (cred_type, "ccache") || g_str_equal (cred_type, "password")) { | |
229 | *owner = g_intern_string (cred_owner); | |
230 | return g_intern_string (cred_type); | |
231 | } | |
232 | } | |
233 | ||
234 | return NULL; | |
235 | } | |
236 | ||
237 | static GVariant * | |
238 | build_ccache_or_password_creds (RealmDbusKerberos *realm, | |
239 | const gchar *user_name, | |
240 | gboolean join) | |
241 | { | |
242 | GVariant *contents; | |
243 | const gchar *cred_type; | |
244 | const gchar *cred_owner; | |
245 | GVariant *creds = NULL; | |
246 | 246 | const gchar *realm_name; |
247 | GError *error = NULL; | |
248 | GVariant *options; | |
249 | SyncClosure sync; | |
250 | gchar *principal; | |
247 | gchar *password; | |
248 | gchar *prompt; | |
249 | ||
250 | cred_type = find_appropriate_cred_type (realm, join, &cred_owner); | |
251 | if (cred_type == NULL) { | |
252 | realm_handle_error (NULL, _("Realm has no supported way to authenticate")); | |
253 | return NULL; | |
254 | } | |
251 | 255 | |
252 | 256 | if (user_name == NULL) |
253 | 257 | user_name = realm_dbus_kerberos_get_suggested_administrator (realm); |
256 | 260 | |
257 | 261 | /* Do a kinit for the given realm */ |
258 | 262 | realm_name = realm_dbus_kerberos_get_name (realm); |
259 | principal = g_strdup_printf ("%s@%s", user_name, realm_name); | |
260 | kerberos_cache = kinit_to_kerberos_cache (principal); | |
261 | g_free (principal); | |
262 | if (kerberos_cache == NULL) | |
263 | return 1; | |
263 | if (g_str_equal (cred_type, "ccache")) { | |
264 | contents = kinit_to_kerberos_cache (user_name, realm_name); | |
265 | ||
266 | } else if (g_str_equal (cred_type, "password")) { | |
267 | prompt = g_strdup_printf (_("Password for %s: "), user_name); | |
268 | password = getpass (prompt); | |
269 | g_free (prompt); | |
270 | ||
271 | if (password == NULL) { | |
272 | realm_print_error (_("Couldn't prompt for password: %s"), g_strerror (errno)); | |
273 | contents = NULL; | |
274 | } else { | |
275 | contents = g_variant_new ("(ss)", user_name, password); | |
276 | memset (password, 0, strlen (password)); | |
277 | } | |
278 | ||
279 | } else { | |
280 | g_assert_not_reached (); | |
281 | } | |
282 | ||
283 | if (contents) { | |
284 | creds = g_variant_new ("(ss@v)", cred_type, cred_owner, | |
285 | g_variant_new_variant (contents)); | |
286 | g_variant_ref_sink (creds); | |
287 | } | |
288 | ||
289 | return creds; | |
290 | } | |
291 | ||
292 | static int | |
293 | realm_join_or_leave (RealmDbusKerberos *realm, | |
294 | const gchar *user_name, | |
295 | gboolean join) | |
296 | { | |
297 | GError *error = NULL; | |
298 | GVariant *options; | |
299 | GVariant *creds; | |
300 | SyncClosure sync; | |
301 | ||
302 | creds = build_ccache_or_password_creds (realm, user_name, join); | |
264 | 303 | |
265 | 304 | sync.result = NULL; |
266 | 305 | sync.loop = g_main_loop_new (NULL, FALSE); |
267 | ||
268 | /* Setup diagnostics */ | |
269 | if (verbose) | |
270 | connect_to_diagnostics (G_DBUS_PROXY (realm)); | |
271 | 306 | |
272 | 307 | options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0); |
273 | 308 | g_variant_ref_sink (options); |
275 | 310 | /* Start actual operation */ |
276 | 311 | g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (realm), G_MAXINT); |
277 | 312 | if (join) |
278 | realm_dbus_kerberos_call_enroll_with_credential_cache (realm, kerberos_cache, options, | |
279 | operation_id, NULL, | |
280 | on_complete_get_result, &sync); | |
313 | realm_dbus_kerberos_call_enroll (realm, creds, options, | |
314 | NULL, on_complete_get_result, &sync); | |
281 | 315 | else |
282 | realm_dbus_kerberos_call_unenroll_with_credential_cache (realm, kerberos_cache, options, | |
283 | operation_id, NULL, | |
284 | on_complete_get_result, &sync); | |
316 | realm_dbus_kerberos_call_unenroll (realm, creds, options, | |
317 | NULL, on_complete_get_result, &sync); | |
285 | 318 | |
286 | 319 | g_variant_unref (options); |
287 | g_variant_unref (kerberos_cache); | |
320 | g_variant_unref (creds); | |
288 | 321 | |
289 | 322 | /* This mainloop is quit by on_complete_get_result */ |
290 | 323 | g_main_loop_run (sync.loop); |
291 | 324 | |
292 | 325 | if (join) |
293 | realm_dbus_kerberos_call_enroll_with_credential_cache_finish (realm, | |
294 | sync.result, | |
295 | &error); | |
326 | realm_dbus_kerberos_call_enroll_finish (realm, sync.result, &error); | |
296 | 327 | else |
297 | realm_dbus_kerberos_call_unenroll_with_credential_cache_finish (realm, | |
298 | sync.result, | |
299 | &error); | |
328 | realm_dbus_kerberos_call_unenroll_finish (realm, sync.result, &error); | |
300 | 329 | |
301 | 330 | g_object_unref (sync.result); |
302 | 331 | g_main_loop_unref (sync.loop); |
303 | 332 | |
304 | 333 | if (error != NULL) { |
305 | realm_handle_error (error, join ? "couldn't join realm" : "couldn't leave realm"); | |
334 | realm_handle_error (error, join ? _("Couldn't join realm") : _("Couldn't leave realm")); | |
306 | 335 | return 1; |
307 | 336 | } |
308 | 337 | |
310 | 339 | } |
311 | 340 | |
312 | 341 | static int |
313 | perform_join (const gchar *string, | |
314 | const gchar *user_name, | |
315 | gboolean verbose) | |
342 | perform_join (GDBusConnection *connection, | |
343 | const gchar *string, | |
344 | const gchar *user_name) | |
316 | 345 | { |
317 | 346 | RealmDbusKerberos *realm; |
318 | 347 | RealmDbusProvider *provider; |
348 | GVariant *options; | |
319 | 349 | GError *error = NULL; |
320 | 350 | GVariant *realms; |
321 | 351 | gint relevance; |
322 | 352 | gint ret; |
323 | 353 | |
324 | provider = realm_dbus_provider_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, | |
325 | G_DBUS_PROXY_FLAGS_NONE, | |
326 | "org.freedesktop.realmd", | |
327 | "/org/freedesktop/realmd", | |
328 | NULL, &error); | |
354 | provider = realm_dbus_provider_proxy_new_sync (connection, G_DBUS_PROXY_FLAGS_NONE, | |
355 | REALM_DBUS_BUS_NAME, | |
356 | REALM_DBUS_SERVICE_PATH, | |
357 | NULL, &error); | |
329 | 358 | if (error != NULL) { |
330 | realm_handle_error (error, "couldn't connect to realm service"); | |
359 | realm_handle_error (error, _("Couldn't connect to realm service")); | |
331 | 360 | return 1; |
332 | 361 | } |
333 | 362 | |
363 | options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0); | |
364 | g_variant_ref_sink (options); | |
365 | ||
334 | 366 | g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (provider), G_MAXINT); |
335 | realm_dbus_provider_call_discover_sync (provider, string, operation_id, | |
367 | realm_dbus_provider_call_discover_sync (provider, string, options, | |
336 | 368 | &relevance, &realms, NULL, &error); |
337 | 369 | |
338 | 370 | g_object_unref (provider); |
371 | g_variant_unref (options); | |
339 | 372 | |
340 | 373 | if (error != NULL) { |
341 | realm_handle_error (error, "couldn't connect to realm service"); | |
374 | realm_handle_error (error, _("Couldn't connect to realm service")); | |
342 | 375 | return 1; |
343 | 376 | } |
344 | 377 | |
346 | 379 | g_variant_unref (realms); |
347 | 380 | |
348 | 381 | if (realm == NULL) { |
349 | realm_handle_error (NULL, "no such realm found: %s", string); | |
382 | realm_handle_error (NULL, _("No such realm found: %s"), string); | |
350 | 383 | return 1; |
351 | 384 | } |
352 | 385 | |
353 | ret = realm_join_or_leave (realm, user_name, verbose, TRUE); | |
386 | ret = realm_join_or_leave (realm, user_name, TRUE); | |
354 | 387 | g_object_unref (realm); |
355 | 388 | |
356 | 389 | return ret; |
357 | 390 | } |
358 | 391 | |
359 | 392 | static int |
360 | perform_leave (const gchar *string, | |
361 | const gchar *user_name, | |
362 | gboolean verbose) | |
393 | perform_leave (GDBusConnection *connection, | |
394 | const gchar *string, | |
395 | const gchar *user_name) | |
363 | 396 | { |
364 | 397 | RealmDbusKerberos *realm; |
365 | 398 | gint ret; |
366 | 399 | |
367 | 400 | /* Find the right realm, but only enrolled */ |
368 | realm = realm_name_to_enrolled (string); | |
401 | realm = realm_name_to_enrolled (connection, string); | |
369 | 402 | |
370 | 403 | /* Message already printed */ |
371 | 404 | if (realm == NULL) |
372 | 405 | return 1; |
373 | 406 | |
374 | ret = realm_join_or_leave (realm, user_name, verbose, FALSE); | |
407 | ret = realm_join_or_leave (realm, user_name, FALSE); | |
375 | 408 | g_object_unref (realm); |
376 | 409 | |
377 | 410 | return ret; |
381 | 414 | realm_join (int argc, |
382 | 415 | char *argv[]) |
383 | 416 | { |
417 | GOptionContext *context; | |
418 | GDBusConnection *connection; | |
419 | gchar *arg_user = NULL; | |
420 | gboolean arg_verbose = FALSE; | |
421 | GError *error = NULL; | |
422 | const gchar *realm_name; | |
423 | gint ret = 0; | |
424 | ||
425 | GOptionEntry option_entries[] = { | |
426 | { "user", 'U', 0, G_OPTION_ARG_STRING, &arg_user, N_("User name to use for enrollment"), NULL }, | |
427 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose, N_("Verbose output"), NULL }, | |
428 | { NULL, } | |
429 | }; | |
430 | ||
431 | context = g_option_context_new ("realm"); | |
432 | g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); | |
433 | g_option_context_add_main_entries (context, option_entries, NULL); | |
434 | ||
435 | if (!g_option_context_parse (context, &argc, &argv, &error)) { | |
436 | g_printerr ("%s: %s\n", g_get_prgname (), error->message); | |
437 | g_error_free (error); | |
438 | ret = 2; | |
439 | ||
440 | } else if (argc > 2) { | |
441 | g_printerr ("%s: %s\n", _("Specify one realm to join"), g_get_prgname ()); | |
442 | ret = 2; | |
443 | ||
444 | } else { | |
445 | connection = realm_get_connection (arg_verbose); | |
446 | if (connection) { | |
447 | realm_name = argc < 2 ? "" : argv[1]; | |
448 | ret = perform_join (connection, realm_name, arg_user); | |
449 | g_object_unref (connection); | |
450 | } else { | |
451 | ret = 1; | |
452 | } | |
453 | } | |
454 | ||
455 | g_free (arg_user); | |
456 | g_option_context_free (context); | |
457 | return ret; | |
458 | } | |
459 | ||
460 | int | |
461 | realm_leave (int argc, | |
462 | char *argv[]) | |
463 | { | |
464 | GDBusConnection *connection; | |
384 | 465 | GOptionContext *context; |
385 | 466 | gchar *arg_user = NULL; |
386 | 467 | gboolean arg_verbose = FALSE; |
389 | 470 | gint ret = 0; |
390 | 471 | |
391 | 472 | GOptionEntry option_entries[] = { |
392 | { "user", 'U', 0, G_OPTION_ARG_STRING, &arg_user, "User name to use for enrollment", NULL }, | |
393 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose, "Verbose output", NULL }, | |
473 | { "user", 'U', 0, G_OPTION_ARG_STRING, &arg_user, N_("User name to use for enrollment"), NULL }, | |
474 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose, N_("Verbose output"), NULL }, | |
394 | 475 | { NULL, } |
395 | 476 | }; |
396 | 477 | |
397 | 478 | context = g_option_context_new ("realm"); |
479 | g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); | |
398 | 480 | g_option_context_add_main_entries (context, option_entries, NULL); |
399 | 481 | |
400 | 482 | if (!g_option_context_parse (context, &argc, &argv, &error)) { |
402 | 484 | g_error_free (error); |
403 | 485 | ret = 2; |
404 | 486 | |
405 | } else if (argc > 2) { | |
406 | g_printerr ("%s: specify one realm to join\n", g_get_prgname ()); | |
487 | } else if (argc < 2) { | |
488 | g_printerr ("%s: %s\n", _("Specify one realm to leave"), g_get_prgname ()); | |
407 | 489 | ret = 2; |
408 | 490 | |
409 | 491 | } else { |
410 | realm_name = argc < 2 ? "" : argv[1]; | |
411 | ret = perform_join (realm_name, arg_user, arg_verbose); | |
492 | connection = realm_get_connection (arg_verbose); | |
493 | if (connection) { | |
494 | realm_name = argc < 2 ? NULL : argv[1]; | |
495 | ret = perform_leave (connection, realm_name, arg_user); | |
496 | g_object_unref (connection); | |
497 | } else { | |
498 | ret = 1; | |
499 | } | |
412 | 500 | } |
413 | 501 | |
414 | 502 | g_free (arg_user); |
415 | 503 | g_option_context_free (context); |
416 | 504 | return ret; |
417 | 505 | } |
418 | ||
419 | int | |
420 | realm_leave (int argc, | |
421 | char *argv[]) | |
422 | { | |
423 | GOptionContext *context; | |
424 | gchar *arg_user = NULL; | |
425 | gboolean arg_verbose = FALSE; | |
426 | GError *error = NULL; | |
427 | const gchar *realm_name; | |
428 | gint ret = 0; | |
429 | ||
430 | GOptionEntry option_entries[] = { | |
431 | { "user", 'U', 0, G_OPTION_ARG_STRING, &arg_user, "User name to use for enrollment", NULL }, | |
432 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose, "Verbose output", NULL }, | |
433 | { NULL, } | |
434 | }; | |
435 | ||
436 | context = g_option_context_new ("realm"); | |
437 | g_option_context_add_main_entries (context, option_entries, NULL); | |
438 | ||
439 | if (!g_option_context_parse (context, &argc, &argv, &error)) { | |
440 | g_printerr ("%s: %s\n", g_get_prgname (), error->message); | |
441 | g_error_free (error); | |
442 | ret = 2; | |
443 | ||
444 | } else if (argc < 2) { | |
445 | g_printerr ("%s: specify one realm to join\n", g_get_prgname ()); | |
446 | ret = 2; | |
447 | ||
448 | } else { | |
449 | realm_name = argc < 2 ? NULL : argv[1]; | |
450 | ret = perform_leave (realm_name, arg_user, arg_verbose); | |
451 | } | |
452 | ||
453 | g_free (arg_user); | |
454 | g_option_context_free (context); | |
455 | return ret; | |
456 | } |
18 | 18 | #include "realm-dbus-generated.h" |
19 | 19 | |
20 | 20 | #include <glib.h> |
21 | #include <glib/gi18n.h> | |
21 | 22 | |
22 | 23 | #include <string.h> |
23 | 24 | |
25 | typedef struct { | |
26 | GAsyncResult *result; | |
27 | GMainLoop *loop; | |
28 | } SyncClosure; | |
29 | ||
30 | static void | |
31 | on_complete_get_result (GObject *source, | |
32 | GAsyncResult *result, | |
33 | gpointer user_data) | |
34 | { | |
35 | SyncClosure *sync = user_data; | |
36 | sync->result = g_object_ref (result); | |
37 | g_main_loop_quit (sync->loop); | |
38 | } | |
39 | ||
24 | 40 | static int |
25 | perform_permit_or_deny_logins (const gchar *realm_name, | |
41 | perform_permit_or_deny_logins (GDBusConnection *connection, | |
42 | const gchar *realm_name, | |
26 | 43 | const gchar **logins, |
27 | 44 | gint n_logins, |
28 | 45 | gboolean permit) |
29 | 46 | { |
30 | 47 | RealmDbusKerberos *realm; |
48 | SyncClosure sync; | |
31 | 49 | gchar **add_or_remove; |
32 | 50 | GError *error = NULL; |
33 | 51 | const gchar *empty[] = { NULL }; |
34 | ||
35 | realm = realm_name_to_enrolled (realm_name); | |
52 | GVariant *options; | |
53 | ||
54 | realm = realm_name_to_enrolled (connection, realm_name); | |
36 | 55 | if (realm == NULL) |
37 | 56 | return 1; |
38 | 57 | |
40 | 59 | add_or_remove = g_new0 (gchar *, n_logins + 1); |
41 | 60 | memcpy (add_or_remove, logins, sizeof (gchar *) * n_logins); |
42 | 61 | |
43 | realm_dbus_kerberos_call_change_login_policy_sync (realm, REALM_DBUS_LOGIN_POLICY_PERMITTED, | |
44 | permit ? (const gchar * const*)add_or_remove : empty, | |
45 | permit ? empty : (const gchar * const*)add_or_remove, | |
46 | realm_operation_id, | |
47 | NULL, &error); | |
62 | sync.result = NULL; | |
63 | sync.loop = g_main_loop_new (NULL, FALSE); | |
64 | ||
65 | /* Start actual operation */ | |
66 | g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (realm), G_MAXINT); | |
67 | ||
68 | options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0); | |
69 | g_variant_ref_sink (options); | |
70 | ||
71 | realm_dbus_kerberos_call_change_login_policy (realm, REALM_DBUS_LOGIN_POLICY_PERMITTED, | |
72 | permit ? (const gchar * const*)add_or_remove : empty, | |
73 | permit ? empty : (const gchar * const*)add_or_remove, | |
74 | options, NULL, on_complete_get_result, &sync); | |
75 | ||
76 | g_variant_unref (options); | |
77 | ||
78 | /* This mainloop is quit by on_complete_get_result */ | |
79 | g_main_loop_run (sync.loop); | |
80 | ||
81 | realm_dbus_kerberos_call_change_login_policy_finish (realm, sync.result, &error); | |
82 | ||
83 | g_object_unref (sync.result); | |
84 | g_main_loop_unref (sync.loop); | |
48 | 85 | |
49 | 86 | if (error != NULL) { |
50 | realm_handle_error (error, "couldn't %s logins", | |
51 | permit ? "permit" : "deny"); | |
87 | realm_handle_error (error, | |
88 | permit ? _("Couldn't permit logins") : _("Couldn't deny logins")); | |
52 | 89 | return 1; |
53 | 90 | } |
54 | 91 | |
56 | 93 | } |
57 | 94 | |
58 | 95 | static int |
59 | perform_permit_or_deny_all (const gchar *realm_name, | |
96 | perform_permit_or_deny_all (GDBusConnection *connection, | |
97 | const gchar *realm_name, | |
60 | 98 | gboolean permit) |
61 | 99 | { |
62 | 100 | RealmDbusKerberos *realm; |
63 | 101 | const gchar *policy; |
64 | 102 | const gchar *logins[] = { NULL }; |
65 | 103 | GError *error = NULL; |
66 | ||
67 | realm = realm_name_to_enrolled (realm_name); | |
104 | GVariant *options; | |
105 | ||
106 | realm = realm_name_to_enrolled (connection, realm_name); | |
68 | 107 | if (realm == NULL) |
69 | 108 | return 1; |
109 | ||
110 | options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0); | |
111 | g_variant_ref_sink (options); | |
70 | 112 | |
71 | 113 | policy = permit ? REALM_DBUS_LOGIN_POLICY_ANY : REALM_DBUS_LOGIN_POLICY_DENY; |
72 | 114 | realm_dbus_kerberos_call_change_login_policy_sync (realm, policy, |
73 | 115 | (const gchar * const *)logins, |
74 | 116 | (const gchar * const *)logins, |
75 | realm_operation_id, | |
76 | NULL, &error); | |
117 | options, NULL, &error); | |
118 | ||
119 | g_variant_unref (options); | |
77 | 120 | |
78 | 121 | if (error != NULL) { |
79 | 122 | realm_handle_error (error, "couldn't %s all logins", |
89 | 132 | int argc, |
90 | 133 | char *argv[]) |
91 | 134 | { |
135 | GDBusConnection *connection; | |
92 | 136 | GOptionContext *context; |
93 | 137 | gboolean arg_all = FALSE; |
94 | 138 | gboolean arg_verbose = FALSE; |
98 | 142 | |
99 | 143 | GOptionEntry option_entries[] = { |
100 | 144 | { "all", 'a', 0, G_OPTION_ARG_NONE, &arg_all, |
101 | permit ? "Permit any domain user login" : "Deny any domain user login", NULL }, | |
102 | { "realm", 'R', 0, G_OPTION_ARG_STRING, &realm_name, "Realm to permit/deny logins for", NULL }, | |
103 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose, "Verbose output", NULL }, | |
145 | permit ? N_("Permit any domain user login") : N_("Deny any domain user login"), NULL }, | |
146 | { "realm", 'R', 0, G_OPTION_ARG_STRING, &realm_name, N_("Realm to permit/deny logins for"), NULL }, | |
147 | { "verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose, N_("Verbose output"), NULL }, | |
104 | 148 | { NULL, } |
105 | 149 | }; |
106 | 150 | |
107 | 151 | context = g_option_context_new ("realm"); |
152 | g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); | |
108 | 153 | g_option_context_add_main_entries (context, option_entries, NULL); |
109 | 154 | |
110 | 155 | if (!g_option_context_parse (context, &argc, &argv, &error)) { |
115 | 160 | |
116 | 161 | if (arg_all) { |
117 | 162 | if (argc != 1) { |
118 | g_printerr ("%s: no users should be specified with -a or --all\n", g_get_prgname ()); | |
163 | g_printerr ("%s: %s\n", _("No users should be specified with -a or --all"), g_get_prgname ()); | |
119 | 164 | ret = 2; |
120 | 165 | } else { |
121 | ret = perform_permit_or_deny_all (realm_name, permit); | |
166 | connection = realm_get_connection (arg_verbose); | |
167 | if (connection) { | |
168 | ret = perform_permit_or_deny_all (connection, realm_name, permit); | |
169 | g_object_unref (connection); | |
170 | } else { | |
171 | ret = 1; | |
172 | } | |
122 | 173 | } |
123 | 174 | } else if (argc < 2) { |
124 | g_printerr ("%s: specify users to %s\n", g_get_prgname (), permit ? "permit" : "deny"); | |
175 | g_printerr ("%s: %s\n", g_get_prgname (), | |
176 | permit ? _("Specify users to permit") : _("Specify users to deny")); | |
125 | 177 | ret = 2; |
126 | 178 | |
127 | 179 | } else { |
128 | ret = perform_permit_or_deny_logins (realm_name, | |
129 | (const gchar **)(argv + 1), | |
130 | argc - 1, permit); | |
180 | connection = realm_get_connection (arg_verbose); | |
181 | if (connection) { | |
182 | ret = perform_permit_or_deny_logins (connection, realm_name, | |
183 | (const gchar **)(argv + 1), | |
184 | argc - 1, permit); | |
185 | g_object_unref (connection); | |
186 | } else { | |
187 | ret = 1; | |
188 | } | |
131 | 189 | } |
132 | 190 | |
133 | 191 | g_free (realm_name); |
17 | 17 | #include "realm-dbus-constants.h" |
18 | 18 | |
19 | 19 | #include <glib.h> |
20 | #include <glib/gi18n.h> | |
20 | 21 | #include <glib-object.h> |
22 | ||
23 | #include <locale.h> | |
21 | 24 | |
22 | 25 | struct { |
23 | 26 | const char *name; |
25 | 28 | const char *usage; |
26 | 29 | const char *description; |
27 | 30 | } realm_commands[] = { |
28 | { "discover", realm_discover, "realm discover -v [realm-name]", "Discover available realm" }, | |
29 | { "join", realm_join, "realm join -v [-U user] realm-name", "Enroll this machine in a realm" }, | |
30 | { "leave", realm_leave, "realm leave -v [-U user] [realm-name]", "Unenroll this machine from a realm" }, | |
31 | { "list", realm_list, "realm list", "List known realms" }, | |
32 | { "permit", realm_permit, "realm permit [-a] [-R realm] user ...", "Permit user logins" }, | |
33 | { "deny", realm_deny, "realm deny [-a] [-R realm] user ...", "Deny user logins" }, | |
31 | { "discover", realm_discover, "realm discover -v [realm-name]", N_("Discover available realm") }, | |
32 | { "join", realm_join, "realm join -v [-U user] realm-name", N_("Enroll this machine in a realm") }, | |
33 | { "leave", realm_leave, "realm leave -v [-U user] [realm-name]", N_("Unenroll this machine from a realm") }, | |
34 | { "list", realm_list, "realm list", N_("List known realms") }, | |
35 | { "permit", realm_permit, "realm permit [-a] [-R realm] user ...", N_("Permit user logins") }, | |
36 | { "deny", realm_deny, "realm deny [-a] [-R realm] user ...", N_("Deny user logins") }, | |
34 | 37 | }; |
38 | ||
39 | void | |
40 | realm_print_error (const gchar *format, | |
41 | ...) | |
42 | { | |
43 | GString *message; | |
44 | va_list va; | |
45 | ||
46 | va_start (va, format); | |
47 | ||
48 | message = g_string_new (""); | |
49 | g_string_append_printf (message, "%s: ", g_get_prgname ()); | |
50 | ||
51 | va_start (va, format); | |
52 | g_string_append_vprintf (message, format, va); | |
53 | va_end (va); | |
54 | ||
55 | g_printerr ("%s\n", message->str); | |
56 | g_string_free (message, TRUE); | |
57 | } | |
35 | 58 | |
36 | 59 | void |
37 | 60 | realm_handle_error (GError *error, |
63 | 86 | realm_info_to_realm_proxy (GVariant *realm_info) |
64 | 87 | { |
65 | 88 | RealmDbusKerberos *realm = NULL; |
66 | const gchar *bus_name; | |
67 | 89 | const gchar *object_path; |
68 | 90 | const gchar *interface_name; |
69 | 91 | GError *error = NULL; |
70 | 92 | |
71 | g_variant_get (realm_info, "(&s&o&s)", &bus_name, &object_path, &interface_name); | |
93 | g_variant_get (realm_info, "(&o&s)", &object_path, &interface_name); | |
72 | 94 | |
73 | 95 | if (g_str_equal (interface_name, REALM_DBUS_KERBEROS_REALM_INTERFACE)) { |
74 | 96 | realm = realm_dbus_kerberos_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, |
75 | 97 | G_DBUS_PROXY_FLAGS_NONE, |
76 | bus_name, object_path, | |
98 | REALM_DBUS_BUS_NAME, object_path, | |
77 | 99 | NULL, &error); |
78 | 100 | } |
79 | 101 | |
80 | 102 | if (error != NULL) |
81 | realm_handle_error (error, "couldn't use realm service"); | |
103 | realm_handle_error (error, _("Couldn't use realm service")); | |
82 | 104 | else if (realm == NULL) |
83 | realm_handle_error (NULL, "unsupported realm type: %s", interface_name); | |
105 | realm_handle_error (NULL, _("Unsupported realm type: %s"), interface_name); | |
84 | 106 | |
85 | 107 | return realm; |
86 | 108 | } |
110 | 132 | result = realm; |
111 | 133 | realm = NULL; |
112 | 134 | } else { |
113 | realm_handle_error (NULL, "more than one enrolled realm, please specify the realm name"); | |
135 | realm_handle_error (NULL, N_("More than one enrolled realm, please specify the realm name")); | |
114 | 136 | g_object_unref (realm); |
115 | 137 | g_object_unref (result); |
116 | 138 | return NULL; |
131 | 153 | |
132 | 154 | if (realm_name == NULL) { |
133 | 155 | if (result == NULL) |
134 | realm_handle_error (NULL, "no enrolled realms found"); | |
156 | realm_handle_error (NULL, _("No enrolled realms found")); | |
135 | 157 | return result; |
136 | 158 | } |
137 | 159 | |
138 | realm_handle_error (NULL, "enrolled realm not found: %s", realm_name); | |
160 | realm_handle_error (NULL, _("Enrolled realm not found: %s"), realm_name); | |
139 | 161 | return NULL; |
140 | 162 | } |
141 | 163 | |
142 | 164 | |
143 | 165 | RealmDbusKerberos * |
144 | realm_name_to_enrolled (const gchar *realm_name) | |
166 | realm_name_to_enrolled (GDBusConnection *connection, | |
167 | const gchar *realm_name) | |
145 | 168 | { |
146 | 169 | RealmDbusKerberos *realm; |
147 | 170 | RealmDbusProvider *provider; |
151 | 174 | if (realm_name != NULL && g_str_equal (realm_name, "")) |
152 | 175 | realm_name = NULL; |
153 | 176 | |
154 | provider = realm_dbus_provider_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, | |
155 | G_DBUS_PROXY_FLAGS_NONE, | |
156 | "org.freedesktop.realmd", | |
157 | "/org/freedesktop/realmd", | |
158 | NULL, &error); | |
177 | provider = realm_dbus_provider_proxy_new_sync (connection, | |
178 | G_DBUS_PROXY_FLAGS_NONE, | |
179 | REALM_DBUS_BUS_NAME, | |
180 | REALM_DBUS_SERVICE_PATH, | |
181 | NULL, &error); | |
159 | 182 | if (error != NULL) { |
160 | realm_handle_error (error, "couldn't connect to realm service"); | |
183 | realm_handle_error (error, _("Couldn't connect to realm service")); | |
161 | 184 | return NULL; |
162 | 185 | } |
163 | 186 | |
169 | 192 | g_object_unref (provider); |
170 | 193 | |
171 | 194 | return realm; |
195 | } | |
196 | ||
197 | static void | |
198 | on_diagnostics_signal (GDBusConnection *connection, | |
199 | const gchar *sender_name, | |
200 | const gchar *object_path, | |
201 | const gchar *interface_name, | |
202 | const gchar *signal_name, | |
203 | GVariant *parameters, | |
204 | gpointer user_data) | |
205 | { | |
206 | const gchar *operation_id; | |
207 | const gchar *data; | |
208 | ||
209 | g_variant_get (parameters, "(&s&s)", &data, &operation_id); | |
210 | g_printerr ("%s", data); | |
211 | } | |
212 | ||
213 | GDBusConnection * | |
214 | realm_get_connection (gboolean verbose) | |
215 | { | |
216 | GDBusConnection *connection; | |
217 | GError *error = NULL; | |
218 | ||
219 | connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); | |
220 | if (error == NULL) { | |
221 | if (verbose) { | |
222 | g_dbus_connection_signal_subscribe (connection, REALM_DBUS_BUS_NAME, | |
223 | REALM_DBUS_SERVICE_INTERFACE, | |
224 | REALM_DBUS_DIAGNOSTICS_SIGNAL, | |
225 | REALM_DBUS_SERVICE_PATH, | |
226 | NULL, G_DBUS_SIGNAL_FLAGS_NONE, | |
227 | on_diagnostics_signal, NULL, NULL); | |
228 | } | |
229 | ||
230 | } else { | |
231 | realm_handle_error (error, _("Couldn't connect to system bus")); | |
232 | } | |
233 | ||
234 | return connection; | |
172 | 235 | } |
173 | 236 | |
174 | 237 | static int |
192 | 255 | { |
193 | 256 | const gchar *command = NULL; |
194 | 257 | gint i; |
258 | ||
259 | setlocale (LC_ALL, ""); | |
260 | ||
261 | #ifdef ENABLE_NLS | |
262 | bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); | |
263 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); | |
264 | textdomain (GETTEXT_PACKAGE); | |
265 | #endif | |
195 | 266 | |
196 | 267 | g_type_init (); |
197 | 268 |
41 | 41 | int realm_deny (int argc, |
42 | 42 | char *argv[]); |
43 | 43 | |
44 | GDBusConnection * realm_get_connection (gboolean verbose); | |
45 | ||
46 | void realm_print_error (const gchar *format, | |
47 | ...) G_GNUC_PRINTF (1, 2); | |
48 | ||
44 | 49 | void realm_handle_error (GError *error, |
45 | 50 | const gchar *format, |
46 | 51 | ...) G_GNUC_PRINTF (2, 3); |
47 | 52 | |
48 | 53 | RealmDbusKerberos * realm_info_to_realm_proxy (GVariant *realm_info); |
49 | 54 | |
50 | RealmDbusKerberos * realm_name_to_enrolled (const gchar *realm_name); | |
55 | RealmDbusKerberos * realm_name_to_enrolled (GDBusConnection *connection, | |
56 | const gchar *realm_name); | |
51 | 57 | |
52 | 58 | G_END_DECLS |
53 | 59 |