Codebase list realmd / 9ba96b9
Imported Upstream version 0.6 Laurent Bigonville 11 years ago
62 changed file(s) with 3077 addition(s) and 2129 deletion(s). Raw diff Collapse all Expand all
00 # 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(-)
1332
2333 commit 105aa6ee87ee5c468869b852aa6091c8b961c14f
3334 Author: Stef Walter <stefw@gnome.org>
3232
3333 upload-release: $(DIST_ARCHIVES)
3434 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.
11 # @configure_input@
22
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
65 # This Makefile.in is free software; the Free Software Foundation
76 # gives unlimited permission to copy and/or distribute it,
87 # with or without modifications, as long as this notice is preserved.
6463 CONFIG_HEADER = config.h
6564 CONFIG_CLEAN_FILES =
6665 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 = :
6770 AM_V_GEN = $(am__v_GEN_@AM_V@)
6871 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 =
7074 AM_V_at = $(am__v_at_@AM_V@)
7175 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
7276 am__v_at_0 = @
77 am__v_at_1 =
7378 SOURCES =
7479 DIST_SOURCES =
7580 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
8893 distclean-recursive maintainer-clean-recursive
8994 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
9095 $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
91 distdir dist dist-all distcheck
96 cscope distdir dist dist-all distcheck
9297 ETAGS = etags
9398 CTAGS = ctags
99 CSCOPE = cscope
94100 DIST_SUBDIRS = $(SUBDIRS)
95101 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
96102 distdir = $(PACKAGE)-$(VERSION)
101107 && rm -rf "$(distdir)" \
102108 || { sleep 5 && rm -rf "$(distdir)"; }; \
103109 else :; fi
110 am__post_remove_distdir = $(am__remove_distdir)
104111 am__relativize = \
105112 dir0=`pwd`; \
106113 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
128135 reldir="$$dir2"
129136 DIST_ARCHIVES = $(distdir).tar.gz
130137 GZIP_ENV = --best
138 DIST_TARGETS = dist-gzip
131139 distuninstallcheck_listfiles = find . -type f -print
132140 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
133141 | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
360368 -rm -f config.h stamp-h1
361369
362370 # 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):
369377 @fail= failcom='exit 1'; \
370378 for f in x $$MAKEFLAGS; do \
371379 case $$f in \
375383 done; \
376384 dot_seen=no; \
377385 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 \
379391 echo "Making $$target in $$subdir"; \
380392 if test "$$subdir" = "."; then \
381393 dot_seen=yes; \
389401 if test "$$dot_seen" = "no"; then \
390402 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
391403 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"
423404 tags-recursive:
424405 list='$(SUBDIRS)'; for subdir in $$list; do \
425406 test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
427408 ctags-recursive:
428409 list='$(SUBDIRS)'; for subdir in $$list; do \
429410 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); \
430415 done
431416
432417 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
491476 && $(am__cd) $(top_srcdir) \
492477 && gtags -i $(GTAGS_ARGS) "$$here"
493478
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
494502 distclean-tags:
495503 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
504 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
496505
497506 distdir: $(DISTFILES)
498507 $(am__remove_distdir)
563572 || chmod -R a+r "$(distdir)"
564573 dist-gzip: distdir
565574 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
566 $(am__remove_distdir)
575 $(am__post_remove_distdir)
567576
568577 dist-bzip2: distdir
569578 tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
570 $(am__remove_distdir)
579 $(am__post_remove_distdir)
571580
572581 dist-lzip: distdir
573582 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)
579584
580585 dist-xz: distdir
581586 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
582 $(am__remove_distdir)
587 $(am__post_remove_distdir)
583588
584589 dist-tarZ: distdir
585590 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
586 $(am__remove_distdir)
591 $(am__post_remove_distdir)
587592
588593 dist-shar: distdir
589594 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
590 $(am__remove_distdir)
595 $(am__post_remove_distdir)
591596
592597 dist-zip: distdir
593598 -rm -f $(distdir).zip
594599 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)
600605
601606 # This target untars the dist file and tries a VPATH configuration. Then
602607 # it guarantees that the distribution is self-contained by making another
607612 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
608613 *.tar.bz2*) \
609614 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
610 *.tar.lzma*) \
611 lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
612615 *.tar.lz*) \
613616 lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
614617 *.tar.xz*) \
620623 *.zip*) \
621624 unzip $(distdir).zip ;;\
622625 esac
623 chmod -R a-w $(distdir); chmod a+w $(distdir)
626 chmod -R a-w $(distdir); chmod u+w $(distdir)
624627 mkdir $(distdir)/_build
625628 mkdir $(distdir)/_inst
626629 chmod a-w $(distdir)
654657 && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
655658 && cd "$$am__cwd" \
656659 || exit 1
657 $(am__remove_distdir)
660 $(am__post_remove_distdir)
658661 @(echo "$(distdir) archives ready for distribution: "; \
659662 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
660663 sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
789792 uninstall-am:
790793
791794 .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
793797
794798 .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
809813
810814
811815 perform-memcheck: $(TEST_PROGS) $(TEST_SUPPRESSIONS)
862866
863867 upload-release: $(DIST_ARCHIVES)
864868 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
866870
867871 # Tell versions [3.59,3.63) of GNU make to not export all variables.
868872 # 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
08 0.5
19 * Implement login policy concept
210 * 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
54 # This file is free software; the Free Software Foundation
65 # gives unlimited permission to copy and/or distribute it,
76 # with or without modifications, as long as this notice is preserved.
1716 [m4_warning([this file was generated for autoconf 2.69.
1817 You have another version of autoconf. It may work, but is not guaranteed to.
1918 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'.])])
2120
2221 # Copyright (C) 1995-2002 Free Software Foundation, Inc.
2322 # Copyright (C) 2001-2003,2004 Red Hat, Inc.
649648 fi[]dnl
650649 ])# PKG_CHECK_MODULES
651650
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
660698
661699 # AM_AUTOMAKE_VERSION(VERSION)
662700 # ----------------------------
664702 # generated from the m4 files accompanying Automake X.Y.
665703 # (This private macro should not be called outside this file.)
666704 AC_DEFUN([AM_AUTOMAKE_VERSION],
667 [am__api_version='1.11'
705 [am__api_version='1.12'
668706 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
669707 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], [],
671709 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
672710 ])
673711
683721 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
684722 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
685723 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
686 [AM_AUTOMAKE_VERSION([1.11.5])dnl
724 [AM_AUTOMAKE_VERSION([1.12.2])dnl
687725 m4_ifndef([AC_AUTOCONF_VERSION],
688726 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
689727 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
690728
691729 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
692730
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
700738
701739 # 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/../..'.
704742 #
705743 # Of course, Automake must honor this variable whenever it calls a
706744 # tool from the auxiliary directory. The problem is that $srcdir (and
719757 #
720758 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
721759 # 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
723761 # start a VPATH build or use an absolute $srcdir.
724762 #
725763 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
745783
746784 # AM_CONDITIONAL -*- Autoconf -*-
747785
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
756793
757794 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
758795 # -------------------------------------
759796 # Define a conditional.
760797 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
764801 AC_SUBST([$1_TRUE])dnl
765802 AC_SUBST([$1_FALSE])dnl
766803 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
779816 Usually this means the macro was only invoked conditionally.]])
780817 fi])])
781818
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
792828 # written in clear, in which case automake, when reading aclocal.m4,
793829 # will think it sees a *use*, and therefore will trigger all it's
794830 # C support machinery. Also note that it means that autoscan, seeing
798834 # _AM_DEPENDENCIES(NAME)
799835 # ----------------------
800836 # 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".
802838 # We try a few techniques and use that to set a single cache variable.
803839 #
804840 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
811847 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
812848 AC_REQUIRE([AM_DEP_TRACK])dnl
813849
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=])
820857
821858 AC_CACHE_CHECK([dependency style of $depcc],
822859 [am_cv_$1_dependencies_compiler_type],
824861 # We make a subdir and do the tests there. Otherwise we can end up
825862 # making bogus files that we don't know about and never remove. For
826863 # 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".
829866 rm -rf conftest.dir
830867 mkdir conftest.dir
831868 # Copy depcomp to subdir because otherwise we won't find it if we're
865902 : > sub/conftest.c
866903 for i in 1 2 3 4 5 6; do
867904 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
871908 done
872909 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
873910
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"
875912 # 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.
878915 am__obj=sub/conftest.${OBJEXT-o}
879916 am__minus_obj="-o $am__obj"
880917 case $depmode in
883920 test "$am__universal" = false || continue
884921 ;;
885922 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.
888925 if test "x$enable_dependency_tracking" = xyes; then
889926 continue
890927 else
892929 fi
893930 ;;
894931 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
896933 # not run yet. These depmodes are late enough in the game, and
897934 # so weak that their functioning should not be impacted.
898935 am__obj=conftest.${OBJEXT-o}
940977 # AM_SET_DEPDIR
941978 # -------------
942979 # 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.
944981 AC_DEFUN([AM_SET_DEPDIR],
945982 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
946983 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
950987 # AM_DEP_TRACK
951988 # ------------
952989 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])])
956997 if test "x$enable_dependency_tracking" != xno; then
957998 am_depcomp="$ac_aux_dir/depcomp"
958999 AMDEPBACKSLASH='\'
9671008
9681009 # Generate code to set up dependency tracking. -*- Autoconf -*-
9691010
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
9781018
9791019 # _AM_OUTPUT_DEPENDENCY_COMMANDS
9801020 # ------------------------------
9931033 # Strip MF so we end up with the name of the file.
9941034 mf=`echo "$mf" | sed -e 's/:.*$//'`
9951035 # 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
9971037 # some people rename them; so instead we look at the file content.
9981038 # Grep'ing the first line is not enough: some people post-process
9991039 # each Makefile.in and add a new line on top of each file to say so.
10051045 continue
10061046 fi
10071047 # Extract the definition of DEPDIR, am__include, and am__quote
1008 # from the Makefile without running `make'.
1048 # from the Makefile without running 'make'.
10091049 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
10101050 test -z "$DEPDIR" && continue
10111051 am__include=`sed -n 's/^am__include = //p' < "$mf"`
10121052 test -z "am__include" && continue
10131053 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"`
10161054 # Find all dependency output files, they are included files with
10171055 # $(DEPDIR) in their names. We invoke sed twice because it is the
10181056 # simplest approach to changing $(DEPDIR) to its actual value in the
10191057 # expansion.
10201058 for file in `sed -n "
10211059 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
10231061 # Make sure the directory exists.
10241062 test -f "$dirpart/$file" && continue
10251063 fdir=`AS_DIRNAME(["$file"])`
10371075 # This macro should only be invoked once -- use via AC_REQUIRE.
10381076 #
10391077 # 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
10411079 # need in order to bootstrap the dependency handling code.
10421080 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
10431081 [AC_CONFIG_COMMANDS([depfiles],
10451083 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
10461084 ])
10471085
1048 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1049 # Free Software Foundation, Inc.
1086 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
10501087 #
10511088 # This file is free software; the Free Software Foundation
10521089 # gives unlimited permission to copy and/or distribute it,
10591096
10601097 # Do all the work for Automake. -*- Autoconf -*-
10611098
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
10701106
10711107 # This macro actually does too much. Some checks are only needed if
10721108 # your package does certain things. But this isn't really a big deal.
11121148 # Define the identity of the package.
11131149 dnl Distinguish between old-style and new-style calls.
11141150 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
11161155 AC_SUBST([PACKAGE], [$1])dnl
11171156 AC_SUBST([VERSION], [$2])],
11181157 [_AM_SET_OPTIONS([$1])dnl
11191158 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],,
11211162 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11221163 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11231164 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11241165
11251166 _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
11281169
11291170 # Some tools Automake needs.
11301171 AC_REQUIRE([AM_SANITY_CHECK])dnl
11311172 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])
11371178 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11381179 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)'])
11401186 # We need awk for the "check" target. The system "awk" is bad on
11411187 # some platforms.
11421188 AC_REQUIRE([AC_PROG_AWK])dnl
11471193 [_AM_PROG_TAR([v7])])])
11481194 _AM_IF_OPTION([no-dependencies],,
11491195 [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
11531199 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
11571203 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
11611214 ])
11621215 _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
11651218 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
11661219 AC_CONFIG_COMMANDS_PRE(dnl
11671220 [m4_provide_if([_AM_COMPILER_EXEEXT],
11681221 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11691222 ])
11701223
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
11721225 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11731226 dnl mangled by Autoconf and run in a shell conditional statement.
11741227 m4_define([_AC_COMPILER_EXEEXT],
11961249 done
11971250 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11981251
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
12071259
12081260 # AM_PROG_INSTALL_SH
12091261 # ------------------
12181270 install_sh="\${SHELL} $am_aux_dir/install-sh"
12191271 esac
12201272 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.
12241276 #
12251277 # This file is free software; the Free Software Foundation
12261278 # gives unlimited permission to copy and/or distribute it,
12441296 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
12451297 # From Jim Meyering
12461298
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
12551306
12561307 # AM_MAINTAINER_MODE([DEFAULT-MODE])
12571308 # ----------------------------------
12581309 # 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
12611312 # can override the default with the --enable/--disable switch.
12621313 AC_DEFUN([AM_MAINTAINER_MODE],
12631314 [m4_case(m4_default([$1], [disable]),
12681319 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
12691320 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
12701321 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]))
12751327 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
12761328 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
12771329 MAINT=$MAINTAINER_MODE_TRUE
12831335
12841336 # Check to see how 'make' treats includes. -*- Autoconf -*-
12851337
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
12931345
12941346 # AM_MAKE_INCLUDE()
12951347 # -----------------
13081360 _am_result=none
13091361 # First try GNU make style include.
13101362 echo "include confinc" > confmf
1311 # Ignore all kinds of additional output from `make'.
1363 # Ignore all kinds of additional output from 'make'.
13121364 case `$am_make -s -f confmf 2> /dev/null` in #(
13131365 *the\ am__doit\ target*)
13141366 am__include=include
13331385 rm -f confinc confmf
13341386 ])
13351387
1336 # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
1337 # Free Software Foundation, Inc.
1388 # Copyright (C) 1999-2012 Free Software Foundation, Inc.
13381389 #
13391390 # This file is free software; the Free Software Foundation
13401391 # gives unlimited permission to copy and/or distribute it,
13701421
13711422 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
13721423
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
13811431
13821432 # AM_MISSING_PROG(NAME, PROGRAM)
13831433 # ------------------------------
14071457 am_missing_run="$MISSING --run "
14081458 else
14091459 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])
14111461 fi
14121462 ])
14131463
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
14431464 # Helper functions for option handling. -*- Autoconf -*-
14441465
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
14531473
14541474 # _AM_MANGLE_OPTION(NAME)
14551475 # -----------------------
14601480 # --------------------
14611481 # Set option NAME. Presently that only means defining a flag for this option.
14621482 AC_DEFUN([_AM_SET_OPTION],
1463 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1483 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
14641484
14651485 # _AM_SET_OPTIONS(OPTIONS)
14661486 # ------------------------
14741494 AC_DEFUN([_AM_IF_OPTION],
14751495 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
14761496
1477 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1497 # Copyright (C) 2001-2012 Free Software Foundation, Inc.
14781498 #
14791499 # This file is free software; the Free Software Foundation
14801500 # gives unlimited permission to copy and/or distribute it,
14951515
14961516 # Check to make sure that the build environment is sane. -*- Autoconf -*-
14971517
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
15061525
15071526 # AM_SANITY_CHECK
15081527 # ---------------
15091528 AC_DEFUN([AM_SANITY_CHECK],
15101529 [AC_MSG_CHECKING([whether build environment is sane])
1511 # Just in case
1512 sleep 1
1513 echo timestamp > conftest.file
15141530 # Reject unsafe characters in $srcdir or the absolute working directory
15151531 # name. Accept space and tab only in the latter.
15161532 am_lf='
15211537 esac
15221538 case $srcdir in
15231539 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
1524 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
1540 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
15251541 esac
15261542
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
15281544 # arguments. Must try -L first in case configure is actually a
15291545 # symlink; some systems play weird games with the mod time of symlinks
15301546 # (eg FreeBSD returns the mod time of the symlink's containing
15311547 # directory).
15321548 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
15501574 test "$[2]" = conftest.file
15511575 )
15521576 then
15561580 AC_MSG_ERROR([newly created file is older than distributed files!
15571581 Check your system clock])
15581582 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
15681608
15691609 # AM_SILENT_RULES([DEFAULT])
15701610 # --------------------------
15711611 # 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).
15731613 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]);;
15811626 esac
15821627 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)
15841629 dnl do not support nested variable expansions.
15851630 dnl See automake bug#9928 and bug#10237.
15861631 am_make=${MAKE-make}
15981643 am_cv_make_support_nested_variables=no
15991644 fi])
16001645 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.
16021647 AM_V='$(V)'
16031648 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
16041649 else
16151660 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
16161661 ])
16171662
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
16251670
16261671 # AM_PROG_INSTALL_STRIP
16271672 # ---------------------
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
16291674 # specify the program used to strip binaries. This is especially
16301675 # annoying in cross-compiling environments, where the build's strip
16311676 # is unlikely to handle the host's binaries.
16321677 # 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
16341679 # STRIPPROG with the value of the STRIP variable (set by the user).
16351680 AC_DEFUN([AM_PROG_INSTALL_STRIP],
16361681 [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
16391684 # 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'.
16421687 if test "$cross_compiling" != no; then
16431688 AC_CHECK_TOOL([STRIP], [strip], :)
16441689 fi
16451690 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
16461691 AC_SUBST([INSTALL_STRIP_PROGRAM])])
16471692
1648 # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
1693 # Copyright (C) 2006-2012 Free Software Foundation, Inc.
16491694 #
16501695 # This file is free software; the Free Software Foundation
16511696 # gives unlimited permission to copy and/or distribute it,
16661711
16671712 # Check how to create a tarball. -*- Autoconf -*-
16681713
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
16761721
16771722 # _AM_PROG_TAR(FORMAT)
16781723 # --------------------
16791724 # 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'.
16811726 #
16821727 # Substitute a variable $(am__tar) that is a command
16831728 # writing to stdout a FORMAT-tarball containing the directory
17001745 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
17011746 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
17021747 # 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 '-'.
17041749 for _am_tool in $_am_tools
17051750 do
17061751 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.
11 # @configure_input@
22
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
65 # This Makefile.in is free software; the Free Software Foundation
76 # gives unlimited permission to copy and/or distribute it,
87 # with or without modifications, as long as this notice is preserved.
5958 CONFIG_HEADER = $(top_builddir)/config.h
6059 CONFIG_CLEAN_FILES =
6160 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 = :
6265 AM_V_GEN = $(am__v_GEN_@AM_V@)
6366 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 =
6569 AM_V_at = $(am__v_at_@AM_V@)
6670 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
6771 am__v_at_0 = @
72 am__v_at_1 =
6873 SOURCES =
6974 DIST_SOURCES =
7075 am__can_run_installinfo = \
277282 ctags: CTAGS
278283 CTAGS:
279284
285 cscope cscopelist:
286
280287
281288 distdir: $(DISTFILES)
282289 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
22
33 scriptversion=2012-03-05.13; # UTC
44
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.
76 # Written by Tom Tromey <tromey@cygnus.com>.
87 #
98 # This program is free software; you can redistribute it and/or modify
00 #! /bin/sh
11 # 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.
33 #
44 # Report bugs to <http://bugs.freedesktop.org/enter_bug.cgi?product=realmd>.
55 #
580580 # Identity of this package.
581581 PACKAGE_NAME='realmd'
582582 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'
585585 PACKAGE_BUGREPORT='http://bugs.freedesktop.org/enter_bug.cgi?product=realmd'
586586 PACKAGE_URL=''
587587
13591359 # Omit some internal or obsolete options to make the list less imposing.
13601360 # This message is too long to be a string in the A/UX 3.1 sh.
13611361 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.
13631363
13641364 Usage: $0 [OPTION]... [VAR=VALUE]...
13651365
14251425
14261426 if test -n "$ac_init_help"; then
14271427 case $ac_init_help in
1428 short | recursive ) echo "Configuration of realmd 0.5:";;
1428 short | recursive ) echo "Configuration of realmd 0.6:";;
14291429 esac
14301430 cat <<\_ACEOF
14311431
14331433 --disable-option-checking ignore unrecognized --enable/--with options
14341434 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
14351435 --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
14421445 --disable-nls do not use Native Language Support
14431446 --enable-debug=no/default/yes
14441447 Turn on or off debugging
15451548 test -n "$ac_init_help" && exit $ac_status
15461549 if $ac_init_version; then
15471550 cat <<\_ACEOF
1548 realmd configure 0.5
1551 realmd configure 0.6
15491552 generated by GNU Autoconf 2.69
15501553
15511554 Copyright (C) 2012 Free Software Foundation, Inc.
19141917 This file contains any messages produced by compilers while
19151918 running configure, to aid debugging if configure makes a mistake.
19161919
1917 It was created by realmd $as_me 0.5, which was
1920 It was created by realmd $as_me 0.6, which was
19181921 generated by GNU Autoconf 2.69. Invocation command line was
19191922
19201923 $ $0 $@
22662269 # -----------------------------------------------------------------------------
22672270
22682271
2269 am__api_version='1.11'
2272 am__api_version='1.12'
22702273
22712274 ac_aux_dir=
22722275 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
23922395
23932396 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
23942397 $as_echo_n "checking whether build environment is sane... " >&6; }
2395 # Just in case
2396 sleep 1
2397 echo timestamp > conftest.file
23982398 # Reject unsafe characters in $srcdir or the absolute working directory
23992399 # name. Accept space and tab only in the latter.
24002400 am_lf='
24052405 esac
24062406 case $srcdir in
24072407 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
2408 as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
2408 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
24092409 esac
24102410
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
24122412 # arguments. Must try -L first in case configure is actually a
24132413 # symlink; some systems play weird games with the mod time of symlinks
24142414 # (eg FreeBSD returns the mod time of the symlink's containing
24152415 # directory).
24162416 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
24342442 test "$2" = conftest.file
24352443 )
24362444 then
24422450 fi
24432451 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24442452 $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
24452463 test "$program_prefix" != NONE &&
24462464 program_transform_name="s&^&$program_prefix&;$program_transform_name"
24472465 # Use a double $ so make ignores it.
24682486 am_missing_run="$MISSING --run "
24692487 else
24702488 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;}
24732491 fi
24742492
24752493 if test x"${install_sh}" != xset; then
24812499 esac
24822500 fi
24832501
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
24862504 # 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.
24882506 if test "$cross_compiling" != no; then
24892507 if test -n "$ac_tool_prefix"; then
24902508 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
26232641 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
26242642 $as_echo "$MKDIR_P" >&6; }
26252643
2626 mkdir_p="$MKDIR_P"
2627 case $mkdir_p in
2628 [\\/$]* | ?:[\\/]*) ;;
2629 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2630 esac
2631
26322644 for ac_prog in gawk mawk nawk awk
26332645 do
26342646 # Extract the first word of "$ac_prog", so it can be a program name with args.
27332745
27342746 # Define the identity of the package.
27352747 PACKAGE='realmd'
2736 VERSION='0.5'
2748 VERSION='0.6'
27372749
27382750
27392751 cat >>confdefs.h <<_ACEOF
27602772
27612773
27622774 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)'
27632781
27642782 # We need awk for the "check" target. The system "awk" is bad on
27652783 # some platforms.
27742792 _am_tools='gnutar plaintar pax cpio none'
27752793 _am_tools=${am_cv_prog_tar_ustar-$_am_tools}
27762794 # 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 '-'.
27782796 for _am_tool in $_am_tools
27792797 do
27802798 case $_am_tool in
28562874
28572875 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
28582876 $as_echo_n "checking whether build environment is sane... " >&6; }
2859 # Just in case
2860 sleep 1
2861 echo timestamp > conftest.file
28622877 # Reject unsafe characters in $srcdir or the absolute working directory
28632878 # name. Accept space and tab only in the latter.
28642879 am_lf='
28692884 esac
28702885 case $srcdir in
28712886 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
2872 as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
2887 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
28732888 esac
28742889
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
28762891 # arguments. Must try -L first in case configure is actually a
28772892 # symlink; some systems play weird games with the mod time of symlinks
28782893 # (eg FreeBSD returns the mod time of the symlink's containing
28792894 # directory).
28802895 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
28982921 test "$2" = conftest.file
28992922 )
29002923 then
29062929 fi
29072930 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29082931 $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
29092942 ac_config_headers="$ac_config_headers config.h"
29102943
29112944
29142947 enableval=$enable_silent_rules;
29152948 fi
29162949
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;;
29212954 esac
29222955 am_make=${MAKE-make}
29232956 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
30523085 _am_result=none
30533086 # First try GNU make style include.
30543087 echo "include confinc" > confmf
3055 # Ignore all kinds of additional output from `make'.
3088 # Ignore all kinds of additional output from 'make'.
30563089 case `$am_make -s -f confmf 2> /dev/null` in #(
30573090 *the\ am__doit\ target*)
30583091 am__include=include
38963929 # We make a subdir and do the tests there. Otherwise we can end up
38973930 # making bogus files that we don't know about and never remove. For
38983931 # 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".
39013934 rm -rf conftest.dir
39023935 mkdir conftest.dir
39033936 # Copy depcomp to subdir because otherwise we won't find it if we're
39323965 : > sub/conftest.c
39333966 for i in 1 2 3 4 5 6; do
39343967 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
39383971 done
39393972 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
39403973
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"
39423975 # 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.
39453978 am__obj=sub/conftest.${OBJEXT-o}
39463979 am__minus_obj="-o $am__obj"
39473980 case $depmode in
39503983 test "$am__universal" = false || continue
39513984 ;;
39523985 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.
39553988 if test "x$enable_dependency_tracking" = xyes; then
39563989 continue
39573990 else
39593992 fi
39603993 ;;
39613994 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
39633996 # not run yet. These depmodes are late enough in the game, and
39643997 # so weak that their functioning should not be impacted.
39653998 am__obj=conftest.${OBJEXT-o}
50795112 # We make a subdir and do the tests there. Otherwise we can end up
50805113 # making bogus files that we don't know about and never remove. For
50815114 # 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".
50845117 rm -rf conftest.dir
50855118 mkdir conftest.dir
50865119 # Copy depcomp to subdir because otherwise we won't find it if we're
51155148 : > sub/conftest.c
51165149 for i in 1 2 3 4 5 6; do
51175150 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
51215154 done
51225155 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
51235156
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"
51255158 # 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.
51285161 am__obj=sub/conftest.${OBJEXT-o}
51295162 am__minus_obj="-o $am__obj"
51305163 case $depmode in
51335166 test "$am__universal" = false || continue
51345167 ;;
51355168 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.
51385171 if test "x$enable_dependency_tracking" = xyes; then
51395172 continue
51405173 else
51425175 fi
51435176 ;;
51445177 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
51465179 # not run yet. These depmodes are late enough in the game, and
51475180 # so weak that their functioning should not be impacted.
51485181 am__obj=conftest.${OBJEXT-o}
78687901 LTLIBOBJS=$ac_ltlibobjs
78697902
78707903
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; }
78717912 if test -n "$EXEEXT"; then
78727913 am__EXEEXT_TRUE=
78737914 am__EXEEXT_FALSE='#'
78767917 am__EXEEXT_FALSE=
78777918 fi
78787919
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; }
78797928 if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
78807929 as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
78817930 Usually this means the macro was only invoked conditionally." "$LINENO" 5
82978346 # report actual input values of CONFIG_FILES etc. instead of their
82988347 # values after options handling.
82998348 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
83018350 generated by GNU Autoconf 2.69. Invocation command line was
83028351
83038352 CONFIG_FILES = $CONFIG_FILES
83638412 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
83648413 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
83658414 ac_cs_version="\\
8366 realmd config.status 0.5
8415 realmd config.status 0.6
83678416 configured by $0, generated by GNU Autoconf 2.69,
83688417 with options \\"\$ac_cs_config\\"
83698418
91149163 # Strip MF so we end up with the name of the file.
91159164 mf=`echo "$mf" | sed -e 's/:.*$//'`
91169165 # 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
91189167 # some people rename them; so instead we look at the file content.
91199168 # Grep'ing the first line is not enough: some people post-process
91209169 # each Makefile.in and add a new line on top of each file to say so.
91489197 continue
91499198 fi
91509199 # Extract the definition of DEPDIR, am__include, and am__quote
9151 # from the Makefile without running `make'.
9200 # from the Makefile without running 'make'.
91529201 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
91539202 test -z "$DEPDIR" && continue
91549203 am__include=`sed -n 's/^am__include = //p' < "$mf"`
91559204 test -z "am__include" && continue
91569205 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"`
91599206 # Find all dependency output files, they are included files with
91609207 # $(DEPDIR) in their names. We invoke sed twice because it is the
91619208 # simplest approach to changing $(DEPDIR) to its actual value in the
91629209 # expansion.
91639210 for file in `sed -n "
91649211 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
91669213 # Make sure the directory exists.
91679214 test -f "$dirpart/$file" && continue
91689215 fdir=`$as_dirname -- "$file" ||
00 AC_PREREQ(2.63)
11
2 AC_INIT([realmd], [0.5],
2 AC_INIT([realmd], [0.6],
33 [http://bugs.freedesktop.org/enter_bug.cgi?product=realmd],
44 [realmd])
55
33 dbusservice_DATA = \
44 org.freedesktop.realmd.conf
55
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
126 servicedir = $(DBUS_SERVICES_DIR)
137 service_in_files = \
148 org.freedesktop.realmd.service.in \
159 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
1712 service_DATA = $(service_in_files:.service.in=.service)
1813
1914 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.
11 # @configure_input@
22
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
65 # This Makefile.in is free software; the Free Software Foundation
76 # gives unlimited permission to copy and/or distribute it,
87 # with or without modifications, as long as this notice is preserved.
5049 PRE_UNINSTALL = :
5150 POST_UNINSTALL = :
5251 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
53 $(top_srcdir)/Makefile.decl
52 $(top_srcdir)/Makefile.decl $(top_srcdir)/depcomp
5453 subdir = dbus
5554 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
5655 am__aclocal_m4_deps = $(top_srcdir)/build/m4/intltool.m4 \
6665 ARFLAGS = cru
6766 AM_V_AR = $(am__v_AR_@AM_V@)
6867 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 =
7370 librealm_dbus_a_AR = $(AR) $(ARFLAGS)
7471 librealm_dbus_a_LIBADD =
7572 am__objects_1 =
7875 nodist_librealm_dbus_a_OBJECTS = $(am__objects_2) $(am__objects_1)
7976 librealm_dbus_a_OBJECTS = $(am_librealm_dbus_a_OBJECTS) \
8077 $(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 =
8190 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
8291 depcomp = $(SHELL) $(top_srcdir)/depcomp
8392 am__depfiles_maybe = depfiles
8594 AM_V_lt = $(am__v_lt_@AM_V@)
8695 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
8796 am__v_lt_0 = --silent
97 am__v_lt_1 =
8898 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
8999 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
90100 AM_V_CC = $(am__v_CC_@AM_V@)
91101 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 =
93104 CCLD = $(CC)
94105 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
95106 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
96107 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 =
101110 SOURCES = $(librealm_dbus_a_SOURCES) $(nodist_librealm_dbus_a_SOURCES)
102111 DIST_SOURCES = $(librealm_dbus_a_SOURCES)
103112 am__can_run_installinfo = \
133142 $(am__cd) "$$dir" && rm -f $$files; }; \
134143 }
135144 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)
138147 ETAGS = etags
139148 CTAGS = ctags
140149 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
305314 dbusservice_DATA = \
306315 org.freedesktop.realmd.conf
307316
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
314317 servicedir = $(DBUS_SERVICES_DIR)
315318 service_in_files = \
316319 org.freedesktop.realmd.service.in \
317320 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
319323
320324 service_DATA = $(service_in_files:.service.in=.service)
321325 noinst_LIBRARIES = \
458462 @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \
459463 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
460464 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)
482465 install-serviceDATA: $(service_DATA)
483466 @$(NORMAL_INSTALL)
484467 @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \
549532 here=`$(am__cd) $(top_builddir) && pwd` \
550533 && $(am__cd) $(top_srcdir) \
551534 && 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
552549
553550 distclean-tags:
554551 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
588585 $(MAKE) $(AM_MAKEFLAGS) check-am
589586 all-am: Makefile $(LIBRARIES) $(DATA)
590587 installdirs:
591 for dir in "$(DESTDIR)$(dbusservicedir)" "$(DESTDIR)$(providerdir)" "$(DESTDIR)$(servicedir)"; do \
588 for dir in "$(DESTDIR)$(dbusservicedir)" "$(DESTDIR)$(servicedir)"; do \
592589 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
593590 done
594591 install: $(BUILT_SOURCES)
647644
648645 info-am:
649646
650 install-data-am: install-dbusserviceDATA install-providerDATA \
651 install-serviceDATA
647 install-data-am: install-dbusserviceDATA install-serviceDATA
652648
653649 install-dvi: install-dvi-am
654650
693689
694690 ps-am:
695691
696 uninstall-am: uninstall-dbusserviceDATA uninstall-providerDATA \
697 uninstall-serviceDATA
692 uninstall-am: uninstall-dbusserviceDATA uninstall-serviceDATA
698693
699694 .MAKE: all check install install-am install-strip
700695
701696 .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 \
709704 install-ps-am install-serviceDATA install-strip installcheck \
710705 installcheck-am installdirs maintainer-clean \
711706 maintainer-clean-generic mostlyclean mostlyclean-compile \
712707 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
715709
716710
717711 perform-memcheck: $(TEST_PROGS) $(TEST_SUPPRESSIONS)
+0
-4
dbus/org.freedesktop.realmd.Samba.provider less more
0 [provider]
1 name = org.freedesktop.realmd.Samba
2 type = org.freedesktop.realmd.Kerberos
3 path = /org/freedesktop/realmd/Samba
00 [D-BUS Service]
1 Name=org.freedesktop.realmd.SssdAd
1 Name=org.freedesktop.realmd.Samba
22 Exec=@privatedir@/realmd
33 User=root
+0
-4
dbus/org.freedesktop.realmd.SssdAd.provider less more
0 [provider]
1 name = org.freedesktop.realmd.SssdAd
2 type = org.freedesktop.realmd.Kerberos
3 path = /org/freedesktop/realmd/SssdAd
00 [D-BUS Service]
1 Name=org.freedesktop.realmd.Samba
1 Name=org.freedesktop.realmd.SssdAd
22 Exec=@privatedir@/realmd
33 User=root
+0
-4
dbus/org.freedesktop.realmd.SssdIpa.provider less more
0 [provider]
1 name = org.freedesktop.realmd.SssdIpa
2 type = org.freedesktop.realmd.Kerberos
3 path = /org/freedesktop/realmd/SssdIpa
0 [D-BUS Service]
1 Name=org.freedesktop.realmd.SssdIpa
2 Exec=@privatedir@/realmd
3 User=root
2424 <!--
2525 * A list of known, enrolled or discovered realms.
2626 * Each realm is a DBus object and is represeted by a:
27 * s: DBus bus name of the realm
2827 * o: DBus object path of the realm
2928 * s: DBus interface name, like 'ofr.Kerberos' (below)
3029 -->
31 <property name="Realms" type="a(sos)" access="read"/>
30 <property name="Realms" type="a(os)" access="read"/>
3231
3332 <!--
3433 * Discover whether a string represents a realm that a provider
3736 <method name="Discover">
3837 <!-- The input string -->
3938 <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"/>
4240
4341 <!-- Returned match relevance -->
4442 <arg name="relevance" type="i" direction="out"/>
4543
4644 <!-- 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"/>
4846 </method>
4947 </interface>
5048
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"/>
5852 </method>
59 </interface>
6053
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
6958 <signal name="Diagnostics">
7059 <arg name="data" type="s"/>
7160 <arg name="operation_id" type="s"/>
7261 </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>
7373 </interface>
7474
7575 <!--
103103 <property name="Enrolled" type="b" access="read"/>
104104
105105 <!--
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
108110 -->
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"/>
112117 <arg name="options" type="a{sv}" direction="in"/>
113 <arg name="operation_id" type="s" direction="in"/>
114118 </method>
115119
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"/>
125122 <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"/>
151123 </method>
152124
153125 <!--
177149 <arg name="login_policy" type="s" direction="in"/>
178150 <arg name="permitted_add" type="as" direction="in"/>
179151 <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"/>
181153 </method>
182154
183155 </interface>
2020
2121 G_BEGIN_DECLS
2222
23 #define REALM_DBUS_BUS_NAME "org.freedesktop.realmd"
24 #define REALM_DBUS_SERVICE_PATH "/org/freedesktop/realmd"
25
2326 #define DBUS_PEER_INTERFACE "org.freedesktop.DBus.Peer"
2427 #define DBUS_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
2528 #define DBUS_INTROSPECTABLE_INTERFACE "org.freedesktop.DBus.Introspectable"
2629
2730 #define REALM_DBUS_PROVIDER_INTERFACE "org.freedesktop.realmd.Provider"
2831 #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"
3033
3134 #define REALM_DBUS_DIAGNOSTICS_SIGNAL "Diagnostics"
3235
22
33 scriptversion=2012-03-27.16; # UTC
44
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.
76
87 # This program is free software; you can redistribute it and/or modify
98 # it under the terms of the GNU General Public License as published by
00 #!/bin/sh
11 # install - install a program, script, or datafile
22
3 scriptversion=2011-01-19.21; # UTC
3 scriptversion=2011-11-20.07; # UTC
44
55 # This originates from X11R5 (mit/util/scripts/install.sh), which was
66 # later released in X11R6 (xc/config/util/install.sh) with the
3434 # FSF changes to this file are in the public domain.
3535 #
3636 # 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
3838 # when there is no Makefile.
3939 #
4040 # This script is compatible with the BSD install script, but was written
155155 -s) stripcmd=$stripprog;;
156156
157157 -t) dst_arg=$2
158 # Protect names problematic for `test' and other utilities.
158 # Protect names problematic for 'test' and other utilities.
159159 case $dst_arg in
160160 -* | [=\(\)!]) dst_arg=./$dst_arg;;
161161 esac
189189 fi
190190 shift # arg
191191 dst_arg=$arg
192 # Protect names problematic for `test' and other utilities.
192 # Protect names problematic for 'test' and other utilities.
193193 case $dst_arg in
194194 -* | [=\(\)!]) dst_arg=./$dst_arg;;
195195 esac
201201 echo "$0: no input file specified." >&2
202202 exit 1
203203 fi
204 # It's OK to call `install-sh -d' without argument.
204 # It's OK to call 'install-sh -d' without argument.
205205 # This can happen when creating conditional directories.
206206 exit 0
207207 fi
239239
240240 for src
241241 do
242 # Protect names problematic for `test' and other utilities.
242 # Protect names problematic for 'test' and other utilities.
243243 case $src in
244244 -* | [=\(\)!]) src=./$src;;
245245 esac
353353 if test -z "$dir_arg" || {
354354 # Check for POSIX incompatibilities with -m.
355355 # 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.
357357 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
358358 ls_ld_tmpdir=`ls -ld "$tmpdir"`
359359 case $ls_ld_tmpdir in
00 #! /bin/sh
11 # Common stub for a few missing GNU programs while installing.
22
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.
76 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
87
98 # This program is free software; you can redistribute it and/or modify
2524 # the same distribution terms that you use for the rest of that program.
2625
2726 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"
2928 exit 1
3029 fi
3130
3332 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
3433 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
3534
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
3736 # srcdir already.
3837 if test -f configure.ac; then
3938 configure_ac=configure.ac
6463 echo "\
6564 $0 [OPTION]... PROGRAM [ARGUMENT]...
6665
67 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
66 Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
6867 error status if there is no known handling for PROGRAM.
6968
7069 Options:
7372 --run try to run the given command, and emulate it if it fails
7473
7574 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'
7978 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
8382 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
8584 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.
9089
9190 Send bug reports to <bug-automake@gnu.org>."
9291 exit $?
9897 ;;
9998
10099 -*)
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"
103102 exit 1
104103 ;;
105104
126125 exit 1
127126 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
128127 # 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
130129 # $TOOL exists and not knowing $TOOL uses missing.
131130 exit 1
132131 fi
138137 case $program in
139138 aclocal*)
140139 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
144143 any GNU archive site."
145144 touch aclocal.m4
146145 ;;
147146
148147 autoconf*)
149148 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
153152 archive site."
154153 touch configure
155154 ;;
156155
157156 autoheader*)
158157 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
162161 from any GNU archive site."
163162 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
164163 test -z "$files" && files="config.h"
175174
176175 automake*)
177176 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.
181180 Grab them from any GNU archive site."
182181 find . -type f -name Makefile.am -print |
183182 sed 's/\.am$/.in/' |
186185
187186 autom4te*)
188187 echo 1>&2 "\
189 WARNING: \`$1' is needed, but is $msg.
188 WARNING: '$1' is needed, but is $msg.
190189 You might have modified some files without having the
191190 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
193192 archive site."
194193
195194 file=`echo "$*" | sed -n "$sed_output"`
209208
210209 bison*|yacc*)
211210 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
214213 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."
216215 rm -f y.tab.c y.tab.h
217216 if test $# -ne 1; then
218217 eval LASTARG=\${$#}
239238
240239 lex*|flex*)
241240 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
244243 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."
246245 rm -f lex.yy.c
247246 if test $# -ne 1; then
248247 eval LASTARG=\${$#}
262261
263262 help2man*)
264263 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
266265 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."
269268
270269 file=`echo "$*" | sed -n "$sed_output"`
271270 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
280279
281280 makeinfo*)
282281 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
285284 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."
289288 # The file to touch is that specified with -o ...
290289 file=`echo "$*" | sed -n "$sed_output"`
291290 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
309308
310309 *)
311310 echo 1>&2 "\
312 WARNING: \`$1' is needed, and is $msg.
311 WARNING: '$1' is needed, and is $msg.
313312 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,
315314 it often tells you about the needed prerequisites for installing
316315 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."
318317 exit 1
319318 ;;
320319 esac
00 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
5454 -DPRIVATE_DIR="\"$(privatedir)\"" \
5555 -DSYSCONF_DIR="\"$(sysconfdir)\"" \
5656 -DPROVIDER_DIR="\"$(privatedir)/provider.d\"" \
57 -DLOCALEDIR=\""$(datadir)/locale"\" \
5758 $(PACKAGEKIT_CFLAGS) \
5859 $(POLKIT_CFLAGS) \
5960 $(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.
11 # @configure_input@
22
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
65 # This Makefile.in is free software; the Free Software Foundation
76 # gives unlimited permission to copy and/or distribute it,
87 # with or without modifications, as long as this notice is preserved.
5049 PRE_UNINSTALL = :
5150 POST_UNINSTALL = :
5251 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
53 $(top_srcdir)/Makefile.decl
52 $(top_srcdir)/Makefile.decl $(top_srcdir)/depcomp
5453 private_PROGRAMS = realmd$(EXEEXT)
5554 subdir = service
5655 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
9998 $(am__DEPENDENCIES_1)
10099 realmd_LINK = $(CCLD) $(realmd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
101100 $(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 =
102113 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
103114 depcomp = $(SHELL) $(top_srcdir)/depcomp
104115 am__depfiles_maybe = depfiles
106117 AM_V_lt = $(am__v_lt_@AM_V@)
107118 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
108119 am__v_lt_0 = --silent
120 am__v_lt_1 =
109121 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
110122 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
111123 AM_V_CC = $(am__v_CC_@AM_V@)
112124 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 =
117127 CCLD = $(CC)
118128 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
119129 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
120130 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 =
125133 SOURCES = $(realmd_SOURCES)
126134 DIST_SOURCES = $(realmd_SOURCES)
127135 am__can_run_installinfo = \
373381 -DPRIVATE_DIR="\"$(privatedir)\"" \
374382 -DSYSCONF_DIR="\"$(sysconfdir)\"" \
375383 -DPROVIDER_DIR="\"$(privatedir)/provider.d\"" \
384 -DLOCALEDIR=\""$(datadir)/locale"\" \
376385 $(PACKAGEKIT_CFLAGS) \
377386 $(POLKIT_CFLAGS) \
378387 $(GLIB_CFLAGS) \
10461055 here=`$(am__cd) $(top_builddir) && pwd` \
10471056 && $(am__cd) $(top_srcdir) \
10481057 && 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
10491072
10501073 distclean-tags:
10511074 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
11931216 .MAKE: install-am install-strip
11941217
11951218 .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
12091233
12101234
12111235 perform-memcheck: $(TEST_PROGS) $(TEST_SUPPRESSIONS)
302302 const Key *key = p;
303303
304304 return str_hash0 (key->string) ^
305 str_hash0 (realm_diagnostics_get_operation (key->invocation)) ^
305 str_hash0 (realm_diagnostics_get_operation_id (key->invocation)) ^
306306 str_hash0 (g_dbus_method_invocation_get_sender (key->invocation));
307307 }
308308
314314 const Key *k2 = v2;
315315
316316 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 &&
319319 g_strcmp0 (g_dbus_method_invocation_get_sender (k1->invocation),
320320 g_dbus_method_invocation_get_sender (k2->invocation)) == 0;
321321 }
2828 #include <errno.h>
2929 #include <string.h>
3030
31 typedef struct {
32 GDBusProxy *proxy;
33 guint diagnostics_sig;
34 } ProviderProxy;
35
3631 struct _RealmAllProvider {
3732 RealmProvider parent;
3833 GList *providers;
39 GHashTable *invocations;
4034 };
4135
4236 typedef struct {
4337 RealmProviderClass parent_class;
4438 } RealmAllProviderClass;
4539
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);
5641
5742 static void
5843 realm_all_provider_init (RealmAllProvider *self)
5944 {
60 self->invocations = g_hash_table_new_full (g_str_hash, g_str_equal,
61 g_free, g_object_unref);
62
6345 /* The dbus Name property of the provider */
6446 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;
10847 }
10948
11049 static GVariant *
14079 update_realms_property (RealmAllProvider *self)
14180 {
14281 GQueue realms = G_QUEUE_INIT;
143 ProviderProxy *prov;
14482 GVariant *variant;
14583 GList *l;
14684
14785 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);
15087 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)"));
15592 g_object_set (self, "realms", variant, NULL);
15693 g_variant_unref (variant);
15794 }
163100 }
164101
165102 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)
170106 {
171107 RealmAllProvider *self = REALM_ALL_PROVIDER (user_data);
172108 update_all_properties (self);
210146 gint relevance_b = 0;
211147 GVariant *realms;
212148
213 g_variant_get ((GVariant *)a, "(i@a(sos))", &relevance_a, &realms);
149 g_variant_get ((GVariant *)a, "(i@a(os))", &relevance_a, &realms);
214150 g_variant_unref (realms);
215151
216 g_variant_get ((GVariant *)b, "(i@a(sos))", &relevance_b, &realms);
152 g_variant_get ((GVariant *)b, "(i@a(os))", &relevance_b, &realms);
217153 g_variant_unref (realms);
218154
219155 return relevance_b - relevance_a;
239175 result = g_queue_pop_head (&discover->results);
240176 if (result == NULL)
241177 break;
242 g_variant_get (result, "(i@a(sos))", &relevance, &realms);
178 g_variant_get (result, "(i@a(os))", &relevance, &realms);
243179 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);
245183 g_ptr_array_add (results, realm);
184 }
246185 if (relevance > discover->relevance)
247186 discover->relevance = relevance;
248187 g_variant_unref (realms);
250189 any = TRUE;
251190 }
252191
253 discover->realms = g_variant_new_array (G_VARIANT_TYPE ("(sos)"),
192 discover->realms = g_variant_new_array (G_VARIANT_TYPE ("(os)"),
254193 (GVariant *const *)results->pdata,
255194 results->len);
256195 g_variant_ref_sink (discover->realms);
265204 }
266205
267206 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)
271210 {
272211 GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data);
273212 DiscoverClosure *discover = g_simple_async_result_get_op_res_gpointer (res);
274213 RealmAllProvider *self = REALM_ALL_PROVIDER (g_async_result_get_source_object (user_data));
275214 GError *error = NULL;
276215 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 {
282224 g_queue_push_tail (&discover->failures, error);
225 }
226
227 if (realms)
228 g_variant_unref (realms);
283229
284230 g_assert (discover->outstanding > 0);
285231 discover->outstanding--;
286232
287233 /* All done at this point? */
288234 if (!discover->completed && discover->outstanding == 0) {
289 g_hash_table_remove (self->invocations, discover->operation_id);
290235 discover_process_results (res, discover);
291236 discover->completed = TRUE;
292237 g_simple_async_result_complete (res);
329274 RealmAllProvider *self = REALM_ALL_PROVIDER (provider);
330275 GSimpleAsyncResult *res;
331276 DiscoverClosure *discover;
332 ProviderProxy *prov;
333277 GList *l;
334278
335279 res = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
337281 discover = g_slice_new0 (DiscoverClosure);
338282 g_queue_init (&discover->results);
339283 discover->invocation = g_object_ref (invocation);
340 discover->operation_id = g_strdup_printf ("realm-all-provider-%d", operation_unique_id++);
341284 discover->timeout_id = g_timeout_add_seconds (3, on_discover_timeout, res);
342285 g_simple_async_result_set_op_res_gpointer (res, discover, discover_closure_free);
343286
344287 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));
350290 discover->outstanding++;
351291 }
352292
355295 discover_process_results (res, discover);
356296 discover->completed = TRUE;
357297 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));
364298 }
365299
366300 g_object_unref (res);
390324 realm_all_provider_finalize (GObject *obj)
391325 {
392326 RealmAllProvider *self = REALM_ALL_PROVIDER (obj);
393 ProviderProxy *prov;
394327 GList *l;
395328
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);
408332
409333 G_OBJECT_CLASS (realm_all_provider_parent_class)->finalize (obj);
410334 }
417341
418342 object_class->finalize = realm_all_provider_finalize;
419343
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;
422345
423346 provider_class->discover_async = realm_all_provider_discover_async;
424347 provider_class->discover_finish = realm_all_provider_discover_finish;
425348 }
426349
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 }
1818
1919 #include <gio/gio.h>
2020
21 #include "realm-provider.h"
22
2123 G_BEGIN_DECLS
2224
2325 #define REALM_TYPE_ALL_PROVIDER (realm_all_provider_get_type ())
2830
2931 GType realm_all_provider_get_type (void) G_GNUC_CONST;
3032
33 void realm_all_provider_register (RealmProvider *all_provider,
34 RealmProvider *provider);
35
3136 G_END_DECLS
3237
3338 #endif /* __REALM_ALL_PROVIDER_H__ */
330330 /* Ignore cases where we've signaled the process because we were cancelled */
331331 if (!command->cancelled)
332332 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);
334334 }
335335
336336 for (i = 0; i < NUM_FDS; ++i) {
371371
372372 /* Set an error, which is respected when this actually completes. */
373373 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"));
375375 process_source->command->cancelled = TRUE;
376376
377377 /* Try and kill the child process */
1515
1616 #include "realm-all-provider.h"
1717 #include "realm-daemon.h"
18 #include "realm-dbus-constants.h"
19 #include "realm-dbus-generated.h"
1820 #define DEBUG_FLAG REALM_DEBUG_SERVICE
1921 #include "realm-debug.h"
2022 #include "realm-diagnostics.h"
23 #include "realm-errors.h"
2124 #include "realm-samba-provider.h"
2225 #include "realm-settings.h"
2326 #include "realm-sssd-ad-provider.h"
2427 #include "realm-sssd-ipa-provider.h"
2528
2629 #include <glib.h>
30 #include <glib/gi18n.h>
2731
2832 #include <polkit/polkit.h>
2933
3438 static GMainLoop *main_loop = NULL;
3539
3640 static gboolean service_persist = FALSE;
37 static GHashTable *service_holds = NULL;
41 static GHashTable *service_clients = NULL;
3842 static gint64 service_quit_at = 0;
3943 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;
4054
4155 /* We use a lock here because it's called from dbus threads */
4256 G_LOCK_DEFINE(polkit_authority);
8599
86100 /* Matches the hold in realm_daemon_lock_for_action() */
87101 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 */
88108 }
89109
90110 gboolean
148168 return ret;
149169 }
150170
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
151196 void
152197 realm_daemon_hold (const gchar *hold)
153198 {
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
154204 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))
157209 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));
159211 }
160212
161213 void
162214 realm_daemon_release (const gchar *hold)
163215 {
164216 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))
167220 g_critical ("realm_daemon_release: don't have hold: %s", hold);
168221 }
169222
175228
176229 service_timeout_id = 0;
177230
178 if (g_hash_table_size (service_holds) > 0)
231 if (g_hash_table_size (service_clients) > 0)
179232 return FALSE;
180233
181234 now = g_get_monotonic_time ();
196249 {
197250 if (service_persist)
198251 return;
199 if (g_hash_table_size (service_holds) > 0)
252 if (g_hash_table_size (service_clients) > 0)
200253 return;
201254 service_quit_at = g_get_monotonic_time () + (TIMEOUT * G_TIME_SPAN_SECOND);
202255 if (service_timeout_id == 0)
204257 }
205258
206259 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
219270 realm_daemon_poke ();
220271 }
221272
224275 {
225276 GDBusMessage *message = user_data;
226277 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);
247279 return FALSE; /* don't call again */
248280 }
249281
255287 {
256288 const gchar *own_name = user_data;
257289 GDBusMessageType type;
258 GDBusMessage *reply;
259 GError *error = NULL;
260290
261291 /* Each time we see an incoming function call, keep the service alive */
262292 if (incoming) {
263293 type = g_dbus_message_get_message_type (message);
264294 if (type == G_DBUS_MESSAGE_TYPE_METHOD_CALL) {
265295
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))) {
290301 g_idle_add_full (G_PRIORITY_DEFAULT,
291302 on_idle_hold_for_message,
292303 g_object_ref (message),
298309 return message;
299310 }
300311
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
301373 static void
302374 on_bus_get_connection (GObject *source,
303375 GAsyncResult *result,
306378 GError *error = NULL;
307379 GDBusConnection **connection = (GDBusConnection **)user_data;
308380 const gchar *self_name;
381 RealmProvider *all_provider;
382 RealmProvider *provider;
383 guint owner_id;
309384
310385 *connection = g_bus_get_finish (result, &error);
311386 if (error != NULL) {
312387 g_warning ("couldn't connect to bus: %s", error->message);
313388 g_main_loop_quit (main_loop);
314389 g_error_free (error);
390
315391 } else {
316392 realm_debug ("connected to bus");
317393
321397 (gchar *)self_name, NULL);
322398
323399 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;
328420 }
329421
330422 /* Matches the hold() in main() */
340432 char *argv[])
341433 {
342434 GDBusConnection *connection = NULL;
435 RealmDbusService *service;
343436 GOptionContext *context;
344437 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
345445 g_type_init ();
346446
347447 context = g_option_context_new ("realmd");
357457 service_persist = 1;
358458
359459 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);
362463 realm_daemon_hold ("main");
363464
364465 /* Load the platform specific data */
365466 realm_settings_init ();
366467
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
367473 realm_debug ("starting service");
368474 g_bus_get (G_BUS_TYPE_SYSTEM, NULL, on_bus_get_connection, &connection);
369475
371477
372478 g_main_loop_run (main_loop);
373479
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)
376483 g_object_unref (connection);
377 }
378484
379485 G_LOCK (polkit_authority);
380486 g_clear_object (&polkit_authority);
385491 g_main_loop_unref (main_loop);
386492 g_option_context_free (context);
387493
388 g_hash_table_unref (service_holds);
494 g_object_unref (service);
495 g_hash_table_unref (service_clients);
389496 return 0;
390497 }
2424
2525 void realm_daemon_unlock_for_action (GDBusMethodInvocation *invocation);
2626
27 void realm_daemon_set_locale_until_loop (GDBusMethodInvocation *invocation);
28
2729 void realm_daemon_hold (const gchar *identifier);
2830
2931 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);
3036
3137 void realm_daemon_poke (void);
3238
4242 { "daemon", REALM_DEBUG_SERVICE },
4343 { "packages", REALM_DEBUG_PACKAGES },
4444 { "provider", REALM_DEBUG_PROVIDER },
45 { "leave-temp-files", REALM_DEBUG_LEAVE_TEMP_FILES },
4546 { 0, }
4647 };
4748
3232 REALM_DEBUG_DIAGNOSTICS = 1 << 2,
3333 REALM_DEBUG_SERVICE = 1 << 3,
3434 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,
3637 } RealmDebugFlags;
3738
3839 void realm_debug_init (void);
4141 }
4242
4343 const gchar *
44 realm_diagnostics_get_operation (GDBusMethodInvocation *invocation)
44 realm_diagnostics_get_operation_id (GDBusMethodInvocation *invocation)
4545 {
4646 return g_object_get_qdata (G_OBJECT (invocation), operation_id_quark);
4747 }
4848
4949 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
5355 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 }
5862 }
5963
6064 static void
198202 return;
199203
200204 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)
203206 operation_id = "";
204 }
205207
206208 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 }
2222
2323 void realm_diagnostics_initialize (GDBusConnection *connection);
2424
25 void realm_diagnostics_mark_operation (GDBusMethodInvocation *invocation,
26 const gchar *operation_id);
25 void realm_diagnostics_setup_options (GDBusMethodInvocation *invocation,
26 GVariant *options);
2727
28 const gchar * realm_diagnostics_get_operation (GDBusMethodInvocation *invocation);
28 const gchar * realm_diagnostics_get_operation_id (GDBusMethodInvocation *invocation);
2929
3030 void realm_diagnostics_info (GDBusMethodInvocation *invocation,
3131 const gchar *format,
4747
4848 return (GQuark)quark_volatile;
4949 }
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 }
3636 _NUM_REALM_ERRORS
3737 } RealmErrorCodes;
3838
39 #define REALM_KRB5_ERROR (realm_krb5_error_quark ())
40
41 GQuark realm_krb5_error_quark (void) G_GNUC_CONST;
42
3943 G_END_DECLS
4044
4145 #endif /* __REALM_ERRORS_H__ */
665665 GBytes *bytes;
666666 gboolean ret = TRUE;
667667 const gchar *contents;
668 mode_t mask;
668 mode_t mask = 0;
669669 gsize length;
670670
671671 g_return_val_if_fail (REALM_IS_INI_CONFIG (self), FALSE);
758758 g_assert (sect->head != line);
759759
760760 remove_config_line (self, line);
761 if (!g_hash_table_remove (sect->parameters, line->name))
762 g_assert_not_reached ();
761763 config_line_free (line);
762764 }
763765 return;
505505 on_write_http_request, g_object_ref (self));
506506
507507 } 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);
509509 ipa_discover_step (self);
510510 }
511511
4949 G_IMPLEMENT_INTERFACE (REALM_DBUS_TYPE_KERBEROS, realm_kerberos_iface_init);
5050 );
5151
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
16952 typedef struct {
17053 RealmKerberos *self;
17154 GDBusMethodInvocation *invocation;
17558 method_closure_new (RealmKerberos *self,
17659 GDBusMethodInvocation *invocation)
17760 {
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;
18265 }
18366
18467 static void
19073 }
19174
19275 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
19397 on_enroll_complete (GObject *source,
19498 GAsyncResult *result,
19599 gpointer user_data)
199103 GError *error = NULL;
200104
201105 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);
203107
204108 (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 {
205119 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");
207421 g_dbus_method_invocation_return_value (closure->invocation, g_variant_new ("()"));
208422
209423 } else if (error != NULL &&
213427 g_error_free (error);
214428
215429 } 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 {
450430 realm_diagnostics_error (closure->invocation, error, "Failed to change permitted logins");
451431 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."));
453433 g_error_free (error);
454434 }
455435
463443 const gchar *login_policy,
464444 const gchar *const *add,
465445 const gchar *const *remove,
466 const gchar *operation_id)
446 GVariant *options)
467447 {
468448 RealmKerberosLoginPolicy policy = REALM_KERBEROS_POLICY_NOT_SET;
469449 RealmKerberos *self = REALM_KERBEROS (realm);
473453 gint i;
474454
475455 /* Make note of the current operation id, for diagnostics */
476 realm_diagnostics_mark_operation (invocation, operation_id);
456 realm_diagnostics_setup_options (invocation, options);
477457
478458 policies = g_strsplit_set (login_policy, ", \t", -1);
479459 for (i = 0; policies[i] != NULL; i++) {
506486
507487 if (!realm_daemon_lock_for_action (invocation)) {
508488 g_dbus_method_invocation_return_error (invocation, REALM_ERROR, REALM_ERROR_BUSY,
509 "Already running another action");
489 _("Already running another action"));
510490 return TRUE;
511491 }
512492
531511
532512 /* Each method has its own polkit authorization */
533513 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")) {
536515 action_id = "org.freedesktop.realmd.enroll-machine";
537516
538 } else if (g_str_equal (method, "UnenrollWithCredentialCache") ||
539 g_str_equal (method, "UnenrollWithPassword")) {
517 } else if (g_str_equal (method, "Unenroll")) {
540518 action_id = "org.freedesktop.realmd.unenroll-machine";
541519
542520 } else if (g_str_equal (method, "ChangeLoginPolicy")) {
559537 realm_debug ("rejecting access to: %s.%s method on %s",
560538 interface, method, g_dbus_method_invocation_get_object_path (invocation));
561539 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"));
563541 }
564542
565543 return ret;
642620 realm_kerberos_iface_init (RealmDbusKerberosIface *iface)
643621 {
644622 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;
649625 iface->handle_change_login_policy = handle_change_login_policy;
650626 }
651627
704680 if (format == NULL) {
705681 g_set_error (error, REALM_ERROR,
706682 REALM_ERROR_NOT_ENROLLED,
707 "The realm does not allow specifying logins");
683 _("The realm does not allow specifying logins"));
708684 return NULL;
709685 }
710686
712688 if (result == NULL) {
713689 g_set_error (error, G_DBUS_ERROR,
714690 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'"),
716692 failed ? " '" : "", failed, failed ? "'" : "", format);
717693 }
718694
734710
735711 return realm_login_name_format (format, user);
736712 }
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 }
1818
1919 #include <gio/gio.h>
2020
21 #include <krb5/krb5.h>
22
2123 #include "realm-dbus-generated.h"
2224
2325 G_BEGIN_DECLS
2830 REALM_KERBEROS_ALLOW_PERMITTED_LOGINS = 2,
2931 REALM_KERBEROS_DENY_ANY_LOGIN = 3,
3032 } 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;
3146
3247 #define REALM_TYPE_KERBEROS (realm_kerberos_get_type ())
3348 #define REALM_KERBEROS(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), REALM_TYPE_KERBEROS, RealmKerberos))
4863 struct _RealmKerberosClass {
4964 RealmDbusKerberosSkeletonClass parent_class;
5065
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);
5673
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);
6080
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);
6686
67 gboolean (* unenroll_finish) (RealmKerberos *realm,
68 GAsyncResult *result,
69 GError **error);
87 gboolean (* enroll_finish) (RealmKerberos *realm,
88 GAsyncResult *result,
89 GError **error);
7090
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);
7898
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);
82127
83128 };
84129
101146 gchar * realm_kerberos_format_login (RealmKerberos *self,
102147 const gchar *user);
103148
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
104165 G_END_DECLS
105166
106167 #endif /* __REALM_KERBEROS_H__ */
2727 #include <glib/gi18n.h>
2828 #include <gio/gio.h>
2929
30 static GHashTable *provider_owner_ids = NULL;
31
3230 static void realm_provider_iface_init (RealmDbusProviderIface *iface);
3331
3432 G_DEFINE_TYPE_WITH_CODE (RealmProvider, realm_provider, REALM_DBUS_TYPE_PROVIDER_SKELETON,
6866 gpointer user_data)
6967 {
7068 MethodClosure *closure = user_data;
71 RealmProviderClass *klass;
7269 GVariant *retval;
7370 GError *error = NULL;
7471 GVariant *realms = NULL;
7572 gint relevance;
7673
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);
8175 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);
8777 g_dbus_method_invocation_return_value (closure->invocation, retval);
8878 g_variant_unref (realms);
8979 } 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);
9182 realm_diagnostics_error (closure->invocation, error, NULL);
9283 g_dbus_method_invocation_return_gerror (closure->invocation, error);
84
9385 } else {
9486 realm_diagnostics_error (closure->invocation, error, "Failed to discover realm");
9587 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."));
9789 }
9890 g_error_free (error);
9991 }
10597 realm_provider_handle_discover (RealmDbusProvider *provider,
10698 GDBusMethodInvocation *invocation,
10799 const gchar *string,
108 const gchar *operation_id)
100 GVariant *options)
109101 {
110102 RealmProvider *self = REALM_PROVIDER (provider);
111 RealmProviderClass *klass;
112103
113104 /* 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,
121108 method_closure_new (self, invocation));
122109
123110 return TRUE;
153140 realm_debug ("rejecting access to: %s.%s method on %s",
154141 interface, method, g_dbus_method_invocation_get_object_path (invocation));
155142 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"));
157144 }
158145
159146 return ret;
174161 static void
175162 update_realms_property (RealmProvider *self)
176163 {
177 RealmProviderClass *provider_class;
178164 GHashTableIter iter;
179165 GDBusInterfaceSkeleton *realm;
180166 GVariantBuilder builder;
181167 const gchar *path;
182168 GVariant *variant;
183169
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)"));
188171
189172 g_hash_table_iter_init (&iter, self->pv->realms);
190173 while (g_hash_table_iter_next (&iter, NULL, (gpointer)&realm)) {
191174 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);
194176 }
195177
196178 variant = g_variant_builder_end (&builder);
228210 }
229211
230212 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,
233214 const gchar *interface)
234215 {
235 g_return_val_if_fail (g_dbus_is_name (bus_name), NULL);
236216 g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
237217 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);
239219 }
240220
241221 static void
299279 }
300280
301281 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
319282 provider_object_start (GDBusConnection *connection,
320283 RealmProvider *self)
321284 {
323286 RealmProviderClass *provider_class;
324287 GError *error = NULL;
325288 GHashTableIter iter;
326 guint owner_id;
327289
328290 provider_class = REALM_PROVIDER_GET_CLASS (self);
329 g_assert (provider_class->dbus_name);
330291
331292 g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (self),
332293 connection, provider_class->dbus_path,
341302 g_hash_table_iter_init (&iter, self->pv->realms);
342303 while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&realm))
343304 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 *
381308 realm_provider_start (GDBusConnection *connection,
382309 GType type)
383310 {
384311 RealmProvider *provider;
385312 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)) {
395317 provider = g_initable_new (type, NULL, &error, NULL);
396318 if (error == NULL) {
397319 provider_object_start (connection, provider);
398 g_object_unref (provider);
320 return provider;
399321
400322 } else {
401323 g_warning ("Failed to initialize realm provider: %s: %s",
402324 g_type_name (type), error->message);
403325 g_error_free (error);
326 return NULL;
404327 }
405328
406329 } else {
407330 provider = g_object_new (type, NULL);
408331 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 }
433334 }
434335
435336 gboolean
445346
446347 return result;
447348 }
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 }
4141 struct _RealmProviderClass {
4242 RealmDbusProviderSkeletonClass parent_class;
4343
44 const gchar *dbus_name;
4544 const gchar *dbus_path;
4645
4746 void (* discover_async) (RealmProvider *provider,
5857
5958 GType realm_provider_get_type (void) G_GNUC_CONST;
6059
61 void realm_provider_start (GDBusConnection *connection,
60 RealmProvider * realm_provider_start (GDBusConnection *connection,
6261 GType type);
6362
6463 void realm_provider_stop_all (void);
6564
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,
6866 const gchar *interface);
6967
7068 GDBusInterfaceSkeleton * realm_provider_lookup_or_register_realm (RealmProvider *self,
7472 gboolean realm_provider_is_default (const gchar *type,
7573 const gchar *name);
7674
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
7786 G_END_DECLS
7887
7988 #endif /* __REALM_KERBEROS_PROVIDER_H__ */
1515
1616 #include "realm-command.h"
1717 #include "realm-daemon.h"
18 #include "realm-debug.h"
1819 #include "realm-diagnostics.h"
1920 #include "realm-errors.h"
2021 #include "realm-samba-config.h"
4546 g_clear_object (&join->cancellable);
4647
4748 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) {
4951 g_warning ("couldn't remove kerberos cache file: %s: %s",
5052 join->kerberos_cache_filename, g_strerror (errno));
5153 }
302304 g_object_unref (res);
303305 }
304306
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
305335 void
306336 realm_samba_enroll_join_async (const gchar *realm,
307337 GBytes *admin_kerberos_cache,
325355 g_simple_async_result_complete_in_idle (res);
326356 } else {
327357 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);
330361 }
331362
332363 g_object_unref (res);
1818
1919 #include <gio/gio.h>
2020
21 #include <krb5.h>
22
2123 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 };
2231
2332 void realm_samba_enroll_join_async (const gchar *realm,
2433 GBytes *admin_kerberos_cache,
4646 PROP_SAMBA_CONFIG,
4747 };
4848
49 #define REALM_DBUS_SAMBA_NAME "org.freedesktop.realmd.Samba"
5049 #define REALM_DBUS_SAMBA_PATH "/org/freedesktop/realmd/Samba"
5150
5251 G_DEFINE_TYPE (RealmSambaProvider, realm_samba_provider, REALM_TYPE_PROVIDER);
8180
8281 g_free (name);
8382 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);
8494 }
8595
8696 static void
90100 GAsyncReadyCallback callback,
91101 gpointer user_data)
92102 {
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);
94111 }
95112
96113 static gint
100117 GError **error)
101118 {
102119 GDBusInterfaceSkeleton *realm;
120 GSimpleAsyncResult *async;
103121 GHashTable *discovery;
122 GAsyncResult *ad_result;
104123 const gchar *object_path;
105124 GVariant *realm_info;
106125 gchar *name;
107126
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);
109131 if (name == NULL)
110132 return 0;
111133
122144 realm_kerberos_set_discovery (REALM_KERBEROS (realm), discovery);
123145
124146 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);
128149 g_variant_ref_sink (*realms);
129150
130151 g_hash_table_unref (discovery);
167188 RealmProviderClass *provider_class = REALM_PROVIDER_CLASS (klass);
168189 GObjectClass *object_class = G_OBJECT_CLASS (klass);
169190
170 provider_class->dbus_name = REALM_DBUS_SAMBA_NAME;
171191 provider_class->dbus_path = REALM_DBUS_SAMBA_PATH;
172192
173193 provider_class->discover_async = realm_samba_provider_discover_async;
2828 #include "realm-samba-winbind.h"
2929
3030 #include <glib/gstdio.h>
31 #include <glib/gi18n.h>
3132
3233 #include <errno.h>
3334 #include <string.h>
3435
3536 struct _RealmSamba {
3637 RealmKerberos parent;
37 gchar *name;
3838 RealmIniConfig *config;
3939 gulong config_sig;
4040 };
4545
4646 enum {
4747 PROP_0,
48 PROP_NAME,
49 PROP_DOMAIN,
5048 PROP_PROVIDER,
5149 };
5250
5856 GPtrArray *entries;
5957 GVariant *entry;
6058 GVariant *details;
59 GVariant *supported;
6160
6261 entries = g_ptr_array_new ();
6362
6665 g_ptr_array_add (entries, entry);
6766
6867 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"));
7069 g_ptr_array_add (entries, entry);
7170
7271 details = g_variant_new_array (G_VARIANT_TYPE ("{ss}"),
7473 entries->len);
7574 g_variant_ref_sink (details);
7675
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
7786 g_object_set (self,
7887 "details", details,
7988 "suggested-administrator", "Administrator",
8089 "login-policy", REALM_DBUS_LOGIN_POLICY_ANY,
90 "supported-enroll-credentials", supported,
91 "supported-unenroll-credentials", supported,
8192 NULL);
8293
94 g_variant_unref (supported);
8395 g_variant_unref (details);
8496 g_ptr_array_free (entries, TRUE);
8597 }
99111 static gboolean
100112 lookup_is_enrolled (RealmSamba *self)
101113 {
114 const gchar *name;
102115 gchar *enrolled;
103 gboolean ret;
116 gboolean ret = FALSE;
104117
105118 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 }
108124
109125 return ret;
110126 }
128144
129145 typedef struct {
130146 GDBusMethodInvocation *invocation;
131 GBytes *admin_kerberos_cache;
147 GBytes *ccache;
132148 gchar *realm_name;
133 GHashTable *discovery;
134149 } EnrollClosure;
135150
136151 static void
139154 EnrollClosure *enroll = data;
140155 g_free (enroll->realm_name);
141156 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);
144158 g_slice_free (EnrollClosure, enroll);
145159 }
146160
170184 RealmSamba *self = REALM_SAMBA (g_async_result_get_source_object (G_ASYNC_RESULT (res)));
171185 GHashTable *settings = NULL;
172186 GError *error = NULL;
173 gchar *workgroup = NULL;
187 const gchar *workgroup = NULL;
174188
175189 realm_samba_enroll_join_finish (result, &settings, &error);
176190 if (error == NULL) {
177191 workgroup = g_hash_table_lookup (settings, "workgroup");
178192 if (workgroup == NULL) {
179193 g_set_error (&error, REALM_ERROR, REALM_ERROR_INTERNAL,
180 "Failed to calculate domain workgroup");
194 _("Failed to calculate domain workgroup"));
181195 }
182196 }
183197
199213
200214 if (settings)
201215 g_hash_table_unref (settings);
202 g_free (workgroup);
203216 g_object_unref (self);
204217 g_object_unref (res);
205218 }
215228
216229 realm_packages_install_finish (result, &error);
217230 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,
219232 enroll->invocation, on_join_do_winbind,
220233 g_object_ref (res));
221234
228241 }
229242
230243 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) {
242254 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);
257263 }
258264
259265 static void
260266 realm_samba_enroll_async (RealmKerberos *realm,
261 GBytes *admin_kerberos_cache,
267 const gchar *name,
268 const gchar *password,
269 RealmKerberosFlags flags,
262270 GDBusMethodInvocation *invocation,
263271 GAsyncReadyCallback callback,
264272 gpointer user_data)
271279 res = g_simple_async_result_new (G_OBJECT (realm), callback, user_data,
272280 realm_samba_enroll_async);
273281 enroll = g_slice_new0 (EnrollClosure);
274 enroll->realm_name = g_strdup (self->name);
282 g_object_get (realm, "name", &enroll->realm_name, NULL);
275283 enroll->invocation = g_object_ref (invocation);
276 enroll->admin_kerberos_cache = g_bytes_ref (admin_kerberos_cache);
277284 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);
282285
283286 /* Make sure not already enrolled in a realm */
284287 enrolled = lookup_enrolled_realm (self);
285288 if (enrolled != NULL) {
286289 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"));
288291 g_simple_async_result_complete_in_idle (res);
289292
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));
299296 }
300297
301298 g_free (enrolled);
366363 }
367364
368365 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
369391 realm_samba_unenroll_async (RealmKerberos *realm,
370 GBytes *admin_kerberos_cache,
392 const gchar *name,
393 const gchar *password,
394 RealmKerberosFlags flags,
371395 GDBusMethodInvocation *invocation,
372396 GAsyncReadyCallback callback,
373397 gpointer user_data)
375399 RealmSamba *self = REALM_SAMBA (realm);
376400 GSimpleAsyncResult *res;
377401 UnenrollClosure *unenroll;
402 const gchar *realm_name;
378403 gchar *enrolled;
404
405 realm_name = realm_dbus_kerberos_get_name (REALM_DBUS_KERBEROS (self));
379406
380407 res = g_simple_async_result_new (G_OBJECT (realm), callback, user_data,
381408 realm_samba_unenroll_async);
382409 unenroll = g_slice_new0 (UnenrollClosure);
383 unenroll->realm_name = g_strdup (self->name);
410 unenroll->realm_name = g_strdup (realm_name);
384411 unenroll->invocation = g_object_ref (invocation);
385412 g_simple_async_result_set_op_res_gpointer (res, unenroll, unenroll_closure_free);
386413
387414 /* Check that enrolled in this realm */
388415 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
392420 } else {
393421 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"));
395423 g_simple_async_result_complete_in_idle (res);
396424 }
397425
398426 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;
410427 }
411428
412429 static gboolean
423440
424441 if (!lookup_is_enrolled (self)) {
425442 g_set_error (error, REALM_ERROR, REALM_ERROR_NOT_ENROLLED,
426 "Not enrolled in this realm");
443 _("Not enrolled in this realm"));
427444 return FALSE;
428445 }
429446
465482 if (login_policy != REALM_KERBEROS_ALLOW_ANY_LOGIN &&
466483 login_policy != REALM_KERBEROS_POLICY_NOT_SET) {
467484 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."));
469486
470487 /* Make note of the permitted logins, so we can return them in the property */
471488 } else if (!realm_samba_change_logins (realm, invocation, add, remove, &error)) {
481498 {
482499 GPtrArray *permitted;
483500 gchar *login_format;
501 const gchar *name;
502 gchar *domain;
484503 gchar **values;
485504 gchar *prefix;
486505 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);
487513
488514 g_object_set (self, "enrolled", lookup_is_enrolled (self), NULL);
489515
509535 g_object_set (self, "permitted-logins", (gchar **)permitted->pdata, NULL);
510536 g_ptr_array_free (permitted, TRUE);
511537 g_strfreev (values);
538
539 g_object_thaw_notify (G_OBJECT (self));
512540 }
513541
514542 static void
518546 update_properties (REALM_SAMBA (user_data));
519547 }
520548
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;
537559 }
538560
539561 static void
544566 {
545567 RealmSamba *self = REALM_SAMBA (obj);
546568 RealmProvider *provider;
547 gchar *domain;
548569
549570 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;
556571 case PROP_PROVIDER:
557572 provider = g_value_get_object (value);
558573 g_object_get (provider, "samba-config", &self->config, NULL);
567582 }
568583
569584 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);
577592 }
578593
579594 static void
581596 {
582597 RealmSamba *self = REALM_SAMBA (obj);
583598
584 g_free (self->name);
585599 if (self->config)
586600 g_object_unref (self->config);
587601
594608 RealmKerberosClass *kerberos_class = REALM_KERBEROS_CLASS (klass);
595609 GObjectClass *object_class = G_OBJECT_CLASS (klass);
596610
597 kerberos_class->enroll_async = realm_samba_enroll_async;
611 kerberos_class->enroll_password_async = realm_samba_enroll_async;
598612 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;
600614 kerberos_class->unenroll_finish = realm_samba_generic_finish;
601615 kerberos_class->logins_async = realm_samba_logins_async;
602616 kerberos_class->logins_finish = realm_samba_generic_finish;
603617
604 object_class->constructed = realm_samba_consructed;
605 object_class->get_property = realm_samba_get_property;
606618 object_class->set_property = realm_samba_set_property;
619 object_class->notify = realm_samba_notify;
607620 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));
612621
613622 g_object_class_install_property (object_class, PROP_PROVIDER,
614623 g_param_spec_object ("provider", "Provider", "Samba Provider",
4444 PROP_SSSD_CONFIG,
4545 };
4646
47 #define REALM_DBUS_SSSD_AD_NAME "org.freedesktop.realmd.SssdAd"
4847 #define REALM_DBUS_SSSD_AD_PATH "/org/freedesktop/realmd/SssdAd"
4948
5049 G_DEFINE_TYPE (RealmSssdAdProvider, realm_sssd_ad_provider, REALM_TYPE_PROVIDER);
9291 }
9392
9493 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
95105 realm_sssd_ad_provider_discover_async (RealmProvider *provider,
96106 const gchar *string,
97107 GDBusMethodInvocation *invocation,
98108 GAsyncReadyCallback callback,
99109 gpointer user_data)
100110 {
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);
102119 }
103120
104121 static gint
107124 GVariant **realms,
108125 GError **error)
109126 {
127 GSimpleAsyncResult *async;
128 GAsyncResult *ad_result;
110129 GDBusInterfaceSkeleton *realm;
111130 GHashTable *discovery;
112131 const gchar *object_path;
113132 GVariant *realm_info;
114133 gchar *name;
115134
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);
117139 if (name == NULL)
118140 return 0;
119141
130152 realm_kerberos_set_discovery (REALM_KERBEROS (realm), discovery);
131153
132154 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);
136157 g_variant_ref_sink (*realms);
137158
138159 g_hash_table_unref (discovery);
175196 RealmProviderClass *provider_class = REALM_PROVIDER_CLASS (klass);
176197 GObjectClass *object_class = G_OBJECT_CLASS (klass);
177198
178 provider_class->dbus_name = REALM_DBUS_SSSD_AD_NAME;
179199 provider_class->dbus_path = REALM_DBUS_SSSD_AD_PATH;
180200 provider_class->discover_async = realm_sssd_ad_provider_discover_async;
181201 provider_class->discover_finish = realm_sssd_ad_provider_discover_finish;
1616 #include "realm-ad-discover.h"
1717 #include "realm-command.h"
1818 #include "realm-diagnostics.h"
19 #include "realm-discovery.h"
2019 #include "realm-errors.h"
2120 #include "realm-packages.h"
2221 #include "realm-samba-enroll.h"
2625 #include "realm-sssd-config.h"
2726
2827 #include <glib/gstdio.h>
28 #include <glib/gi18n.h>
2929
3030 #include <errno.h>
3131 #include <string.h>
4646 GPtrArray *entries;
4747 GVariant *entry;
4848 GVariant *details;
49 GVariant *supported;
4950
5051 entries = g_ptr_array_new ();
5152
6263 entries->len);
6364 g_variant_ref_sink (details);
6465
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
6576 g_object_set (self,
6677 "details", details,
6778 "suggested-administrator", "Administrator",
79 "supported-enroll-credentials", supported,
80 "supported-unenroll-credentials", supported,
6881 NULL);
6982
7083 g_variant_unref (details);
84 g_variant_unref (supported);
7185 g_ptr_array_free (entries, TRUE);
7286 }
7387
7488 typedef struct {
7589 GDBusMethodInvocation *invocation;
76 GBytes *admin_kerberos_cache;
90 GBytes *ccache;
7791 gchar *realm_name;
78 GHashTable *discovery;
7992 } EnrollClosure;
8093
8194 static void
8497 EnrollClosure *enroll = data;
8598 g_free (enroll->realm_name);
8699 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);
89101 g_slice_free (EnrollClosure, enroll);
90102 }
91103
101113 status = realm_command_run_finish (result, NULL, &error);
102114 if (error == NULL && status != 0)
103115 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."));
105117 if (error != NULL)
106118 g_simple_async_result_take_error (res, error);
107119
149161 workgroup = g_hash_table_lookup (settings, "workgroup");
150162 if (workgroup == NULL) {
151163 g_set_error (error, REALM_ERROR, REALM_ERROR_INTERNAL,
152 "Failed to calculate domain workgroup");
164 _("Failed to calculate domain workgroup"));
153165 return FALSE;
154166 }
155167
234246
235247 realm_packages_install_finish (result, &error);
236248 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,
238250 enroll->invocation, on_join_do_sssd,
239251 g_object_ref (res));
240252
247259 }
248260
249261 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)
253265 {
254266 GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data);
255267 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,
262273 on_install_do_join, g_object_ref (res));
263274
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);
267277 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);
276281 }
277282
278283 static void
279284 realm_sssd_ad_enroll_async (RealmKerberos *realm,
280 GBytes *admin_kerberos_cache,
285 const char *name,
286 const char *password,
287 RealmKerberosFlags flags,
281288 GDBusMethodInvocation *invocation,
282289 GAsyncReadyCallback callback,
283290 gpointer user_data)
291298 enroll = g_slice_new0 (EnrollClosure);
292299 g_object_get (sssd, "name", &enroll->realm_name, NULL);
293300 enroll->invocation = g_object_ref (invocation);
294 enroll->admin_kerberos_cache = g_bytes_ref (admin_kerberos_cache);
295301 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);
300302
301303 /* Make sure not already enrolled in a realm */
302304 if (realm_sssd_get_config_section (sssd) != NULL) {
303305 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"));
305307 g_simple_async_result_complete_in_idle (res);
306308
307309 } else if (realm_sssd_config_have_domain (realm_sssd_get_config (sssd), enroll->realm_name)) {
308310 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"));
310312 g_simple_async_result_complete_in_idle (res);
311313
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
317314 /* Already have discovery info, so go straight to install */
318315 } 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));
321318 }
322319
323320 g_object_unref (res);
412409 }
413410
414411 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
415437 realm_sssd_ad_unenroll_async (RealmKerberos *realm,
416 GBytes *admin_kerberos_cache,
438 const gchar *name,
439 const gchar *password,
440 RealmKerberosFlags flags,
417441 GDBusMethodInvocation *invocation,
418442 GAsyncReadyCallback callback,
419443 gpointer user_data)
431455
432456 /* Check that enrolled in this realm */
433457 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
436461 } else {
437462 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"));
439464 g_simple_async_result_complete_in_idle (res);
440465 }
441466
458483 {
459484 RealmKerberosClass *kerberos_class = REALM_KERBEROS_CLASS (klass);
460485
461 kerberos_class->enroll_async = realm_sssd_ad_enroll_async;
486 kerberos_class->enroll_password_async = realm_sssd_ad_enroll_async;
462487 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;
464489 kerberos_class->unenroll_finish = realm_sssd_ad_generic_finish;
465490 }
1717 #include "realm-ini-config.h"
1818 #include "realm-sssd-config.h"
1919 #include "realm-settings.h"
20
21 #include <glib/gi18n.h>
2022
2123 #include <string.h>
2224
118120 if (realm_ini_config_have_section (config, section)) {
119121 realm_ini_config_abort_change (config);
120122 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);
122124 g_free (section);
123125 return FALSE;
124126 }
9292 }
9393
9494 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
95106 realm_sssd_ipa_provider_discover_async (RealmProvider *provider,
96107 const gchar *string,
97108 GDBusMethodInvocation *invocation,
98109 GAsyncReadyCallback callback,
99110 gpointer user_data)
100111 {
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
102121 }
103122
104123 static gint
107126 GVariant **realms,
108127 GError **error)
109128 {
129 GSimpleAsyncResult *async;
130 GAsyncResult *ipa_result;
110131 GDBusInterfaceSkeleton *realm;
111132 GHashTable *discovery;
112133 const gchar *object_path;
113134 GVariant *realm_info;
114135 gchar *name;
115136
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);
117141 if (name == NULL)
118142 return 0;
119143
130154 realm_kerberos_set_discovery (REALM_KERBEROS (realm), discovery);
131155
132156 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);
136159 g_variant_ref_sink (*realms);
137160
138161 g_hash_table_unref (discovery);
173196 RealmProviderClass *provider_class = REALM_PROVIDER_CLASS (klass);
174197 GObjectClass *object_class = G_OBJECT_CLASS (klass);
175198
176 provider_class->dbus_name = REALM_DBUS_SSSD_IPA_NAME;
177199 provider_class->dbus_path = REALM_DBUS_SSSD_IPA_PATH;
178200 provider_class->discover_async = realm_sssd_ipa_provider_discover_async;
179201 provider_class->discover_finish = realm_sssd_ipa_provider_discover_finish;
4040 RealmSssdClass parent_class;
4141 } RealmSssdIpaClass;
4242
43 enum {
44 PROP_0,
45 PROP_NAME,
46 PROP_DOMAIN,
47 PROP_PROVIDER,
48 };
49
5043 G_DEFINE_TYPE (RealmSssdIpa, realm_sssd_ipa, REALM_TYPE_SSSD);
5144
5245 static void
5548 GPtrArray *entries;
5649 GVariant *entry;
5750 GVariant *details;
51 GVariant *supported;
5852
5953 entries = g_ptr_array_new ();
6054
7165 entries->len);
7266 g_variant_ref_sink (details);
7367
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
7474 g_object_set (self,
7575 "details", details,
7676 "suggested-administrator", "admin",
77 "supported-enroll-credentials", supported,
78 "supported-unenroll-credentials", supported,
7779 NULL);
7880
7981 g_variant_unref (details);
8385 static void
8486 realm_sssd_ipa_enroll_async (RealmKerberos *realm,
8587 GBytes *admin_kerberos_cache,
88 RealmKerberosFlags flags,
8689 GDBusMethodInvocation *invocation,
8790 GAsyncReadyCallback callback,
8891 gpointer user_data)
100103 static void
101104 realm_sssd_ipa_unenroll_async (RealmKerberos *realm,
102105 GBytes *admin_kerberos_cache,
106 RealmKerberosFlags flags,
103107 GDBusMethodInvocation *invocation,
104108 GAsyncReadyCallback callback,
105109 gpointer user_data)
129133 {
130134 RealmKerberosClass *kerberos_class = REALM_KERBEROS_CLASS (klass);
131135
132 kerberos_class->enroll_async = realm_sssd_ipa_enroll_async;
136 kerberos_class->enroll_ccache_async = realm_sssd_ipa_enroll_async;
133137 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;
135139 kerberos_class->unenroll_finish = realm_sssd_ipa_generic_finish;
136140 }
2727 #include <glib/gstdio.h>
2828
2929 struct _RealmSssdPrivate {
30 gchar *realm;
3130 gchar *domain;
3231 gchar *section;
3332 RealmIniConfig *config;
3635
3736 enum {
3837 PROP_0,
39 PROP_NAME,
40 PROP_DOMAIN,
4138 PROP_PROVIDER,
4239 };
4340
185182 static void
186183 update_domain (RealmSssd *self)
187184 {
185 const char *name;
188186 gchar *domain = NULL;
189187
190188 if (self->pv->section != NULL)
191189 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 }
194194 g_object_set (self, "domain", domain, NULL);
195195 g_free (domain);
196196 }
278278 update_properties (RealmSssd *self)
279279 {
280280 GObject *obj = G_OBJECT (self);
281 const gchar *name;
281282 gchar *section = NULL;
282283 gchar *domain = NULL;
283284 gchar **domains;
288289
289290 /* Find the config domain with our realm */
290291 domains = realm_sssd_config_get_domains (self->pv->config);
292 name = realm_dbus_kerberos_get_name (REALM_DBUS_KERBEROS (self));
291293 for (i = 0; domains && domains[i]; i++) {
292294 section = realm_sssd_config_domain_to_section (domains[i]);
293295 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) {
295297 domain = g_strdup (domains[i]);
296298 break;
297299 } else {
323325 }
324326
325327 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
344328 realm_sssd_set_property (GObject *obj,
345329 guint prop_id,
346330 const GValue *value,
350334 RealmProvider *provider;
351335
352336 switch (prop_id) {
353 case PROP_NAME:
354 self->pv->realm = g_value_dup_string (value);
355 break;
356337 case PROP_PROVIDER:
357338 provider = g_value_get_object (value);
358339 g_object_get (provider, "sssd-config", &self->pv->config, NULL);
367348 }
368349
369350 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);
377358 }
378359
379360 static void
397378 kerberos_class->logins_async = realm_sssd_logins_async;
398379 kerberos_class->logins_finish = realm_sssd_generic_finish;
399380
400 object_class->constructed = realm_sssd_consructed;
401 object_class->get_property = realm_sssd_get_property;
402381 object_class->set_property = realm_sssd_set_property;
382 object_class->notify = realm_sssd_notify;
403383 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));
408384
409385 g_object_class_install_property (object_class, PROP_PROVIDER,
410386 g_param_spec_object ("provider", "Provider", "SssdAd Provider",
1919 [commands]
2020
2121 [user]
22 shell = /bin/bash
22 shell = /bin/bash
0 # Makefile.in generated by automake 1.11.5 from Makefile.am.
0 # Makefile.in generated by automake 1.12.2 from Makefile.am.
11 # @configure_input@
22
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
65 # This Makefile.in is free software; the Free Software Foundation
76 # gives unlimited permission to copy and/or distribute it,
87 # with or without modifications, as long as this notice is preserved.
4948 PRE_UNINSTALL = :
5049 POST_UNINSTALL = :
5150 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
52 $(top_srcdir)/Makefile.decl
51 $(top_srcdir)/Makefile.decl $(top_srcdir)/depcomp
5352 check_PROGRAMS = $(am__EXEEXT_2)
5453 noinst_PROGRAMS = frob-install-packages$(EXEEXT) $(am__EXEEXT_1)
5554 subdir = tests
9291 test_sssd_config_OBJECTS = $(am_test_sssd_config_OBJECTS)
9392 test_sssd_config_LDADD = $(LDADD)
9493 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 =
95106 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
96107 depcomp = $(SHELL) $(top_srcdir)/depcomp
97108 am__depfiles_maybe = depfiles
99110 AM_V_lt = $(am__v_lt_@AM_V@)
100111 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
101112 am__v_lt_0 = --silent
113 am__v_lt_1 =
102114 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
103115 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
104116 AM_V_CC = $(am__v_CC_@AM_V@)
105117 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 =
110120 CCLD = $(CC)
111121 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
112122 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
113123 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 =
118126 SOURCES = frob-install-packages.c $(test_ini_config_SOURCES) \
119127 $(test_login_name_SOURCES) $(test_sssd_config_SOURCES)
120128 DIST_SOURCES = frob-install-packages.c $(test_ini_config_SOURCES) \
570578 && $(am__cd) $(top_srcdir) \
571579 && gtags -i $(GTAGS_ARGS) "$$here"
572580
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
573595 distclean-tags:
574596 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
575597
714736
715737 .PHONY: CTAGS GTAGS all all-am all-local check check-am check-local \
716738 clean clean-checkPROGRAMS clean-generic clean-noinstPROGRAMS \
717 ctags distclean distclean-compile distclean-generic \
739 cscopelist ctags distclean distclean-compile distclean-generic \
718740 distclean-tags distdir dvi dvi-am html html-am info info-am \
719741 install install-am install-data install-data-am install-dvi \
720742 install-dvi-am install-exec install-exec-am install-html \
1212 AM_CFLAGS = \
1313 -I$(top_srcdir)/dbus \
1414 -I$(top_builddir)/dbus \
15 -DLOCALEDIR=\""$(datadir)/locale"\" \
1516 $(GLIB_CFLAGS) \
1617 $(KRB5_CFLAGS) \
1718 $(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.
11 # @configure_input@
22
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
65 # This Makefile.in is free software; the Free Software Foundation
76 # gives unlimited permission to copy and/or distribute it,
87 # with or without modifications, as long as this notice is preserved.
4948 PRE_UNINSTALL = :
5049 POST_UNINSTALL = :
5150 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
52 $(top_srcdir)/Makefile.decl
51 $(top_srcdir)/Makefile.decl $(top_srcdir)/depcomp
5352 bin_PROGRAMS = realm$(EXEEXT)
5453 subdir = tools
5554 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
7372 realm_DEPENDENCIES = $(top_builddir)/dbus/librealm-dbus.a \
7473 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
7574 $(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 =
7687 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
7788 depcomp = $(SHELL) $(top_srcdir)/depcomp
7889 am__depfiles_maybe = depfiles
8192 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
8293 AM_V_CC = $(am__v_CC_@AM_V@)
8394 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 =
8897 CCLD = $(CC)
8998 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
9099 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
91100 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 =
96103 SOURCES = $(realm_SOURCES)
97104 DIST_SOURCES = $(realm_SOURCES)
98105 am__can_run_installinfo = \
276283 AM_CFLAGS = \
277284 -I$(top_srcdir)/dbus \
278285 -I$(top_builddir)/dbus \
286 -DLOCALEDIR=\""$(datadir)/locale"\" \
279287 $(GLIB_CFLAGS) \
280288 $(KRB5_CFLAGS) \
281289 $(NULL)
438446 here=`$(am__cd) $(top_builddir) && pwd` \
439447 && $(am__cd) $(top_srcdir) \
440448 && 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
441463
442464 distclean-tags:
443465 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
581603 .MAKE: install-am install-strip
582604
583605 .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 \
585607 distclean-generic distclean-tags distdir dvi dvi-am html \
586608 html-am info info-am install install-am install-binPROGRAMS \
587609 install-data install-data-am install-dvi install-dvi-am \
2222
2323 #include <glib.h>
2424 #include <glib/gstdio.h>
25 #include <glib/gi18n.h>
2526
2627 #include <sys/types.h>
2728 #include <sys/stat.h>
3334 print_realm_info (GVariant *realm_info)
3435 {
3536 RealmDbusKerberos *realm = NULL;
36 const gchar *bus_name;
3737 const gchar *object_path;
3838 const gchar *interface_name;
3939 GError *error = NULL;
4545 gchar *string;
4646 const gchar *policy;
4747
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);
4949
5050 if (!g_str_equal (interface_name, REALM_DBUS_KERBEROS_REALM_INTERFACE))
5151 return;
5252
5353 realm = realm_dbus_kerberos_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
5454 G_DBUS_PROXY_FLAGS_NONE,
55 bus_name, object_path,
55 REALM_DBUS_BUS_NAME, object_path,
5656 NULL, &error);
5757
5858 if (error != NULL) {
8787 g_object_unref (realm);
8888 }
8989
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
12390 typedef struct {
12491 GAsyncResult *result;
12592 GMainLoop *loop;
136103 }
137104
138105 static int
139 perform_discover (const gchar *string,
140 gboolean verbose)
106 perform_discover (GDBusConnection *connection,
107 const gchar *string)
141108 {
142109 RealmDbusProvider *provider;
143110 GVariant *realm_info;
147114 SyncClosure sync;
148115 GVariant *realms;
149116 gint relevance;
117 GVariant *options;
150118
151119 provider = realm_dbus_provider_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
152120 G_DBUS_PROXY_FLAGS_NONE,
153 "org.freedesktop.realmd",
154 "/org/freedesktop/realmd",
121 REALM_DBUS_BUS_NAME,
122 REALM_DBUS_SERVICE_PATH,
155123 NULL, &error);
156124 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"));
158126 return 2;
159127 }
160
161 /* Setup diagnostics */
162 if (verbose)
163 connect_to_diagnostics (G_DBUS_PROXY (provider));
164128
165129 sync.result = NULL;
166130 sync.loop = g_main_loop_new (NULL, FALSE);
167131
132 options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
133 g_variant_ref_sink (options);
134
168135 g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (provider), G_MAXINT);
169136 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);
172140
173141 /* This mainloop is quit by on_complete_get_result */
174142 g_main_loop_run (sync.loop);
180148 g_main_loop_unref (sync.loop);
181149
182150 if (error != NULL) {
183 realm_handle_error (error, "couldn't discover realm");
151 realm_handle_error (error, _("Couldn't discover realm"));
184152 return 2;
185153 }
186154
195163
196164 if (!found) {
197165 if (string == NULL)
198 realm_handle_error (NULL, "no default domain discovered");
166 realm_handle_error (NULL, _("No default realm discovered"));
199167 else
200 realm_handle_error (NULL, "no such realm found: %s", string);
168 realm_handle_error (NULL, _("No such realm found: %s"), string);
201169 return 1;
202170 }
203171
208176 realm_discover (int argc,
209177 char *argv[])
210178 {
179 GDBusConnection *connection;
211180 GOptionContext *context;
212181 gboolean arg_verbose = FALSE;
213182 GError *error = NULL;
216185 gint i;
217186
218187 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 },
220189 { NULL, }
221190 };
222191
223192 g_type_init ();
224193
225194 context = g_option_context_new ("realm-or-domain");
195 g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
226196 g_option_context_add_main_entries (context, option_entries, NULL);
227197
228198 if (!g_option_context_parse (context, &argc, &argv, &error)) {
231201 ret = 2;
232202 }
233203
204 connection = realm_get_connection (arg_verbose);
205 if (!connection) {
206 ret = 1;
207
234208 /* 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);
237212
238213 /* Specific realms */
239214 } else {
240215 for (i = 1; i < argc; i++) {
241 ret = perform_discover (argv[i], arg_verbose);
216 ret = perform_discover (connection, argv[i]);
242217 if (ret != 0)
243218 result = ret;
244219 }
220 g_object_unref (connection);
245221 }
246222
247223 g_option_context_free (context);
249225 }
250226
251227 static int
252 perform_list (gboolean verbose)
228 perform_list (GDBusConnection *connection,
229 gboolean verbose)
253230 {
254231 RealmDbusProvider *provider;
255232 GVariant *realms;
258235 GVariantIter iter;
259236 gboolean printed = FALSE;
260237
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);
266242 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"));
268244 return 1;
269245 }
270246
271247 realms = realm_dbus_provider_get_realms (provider);
272248 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)) {
274250 print_realm_info (realm_info);
275251 printed = TRUE;
276252 }
286262 realm_list (int argc,
287263 char *argv[])
288264 {
265 GDBusConnection *connection;
289266 GOptionContext *context;
290267 gboolean arg_verbose = FALSE;
291268 GError *error = NULL;
292269 gint ret = 0;
293270
294271 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 },
296273 { NULL, }
297274 };
298275
299276 context = g_option_context_new ("realm");
277 g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
300278 g_option_context_add_main_entries (context, option_entries, NULL);
301279
302280 if (!g_option_context_parse (context, &argc, &argv, &error)) {
309287 ret = 2;
310288
311289 } 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 }
313297 }
314298
315299 g_option_context_free (context);
2020 #include <krb5/krb5.h>
2121
2222 #include <glib.h>
23 #include <glib/gi18n.h>
2324 #include <glib/gstdio.h>
2425
2526 #include <sys/types.h>
2627 #include <sys/stat.h>
2728 #include <errno.h>
2829 #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>
3231
3332 static void
3433 handle_krb5_error (krb5_error_code code,
9594
9695 g_file_get_contents (filename, &contents, &length, &error);
9796 if (error != NULL) {
98 realm_handle_error (error, "couldn't read credential cache");
97 realm_handle_error (error, _("Couldn't read credential cache"));
9998 return NULL;
10099 }
101100
107106 }
108107
109108 static GVariant *
110 kinit_to_kerberos_cache (const gchar *name)
109 kinit_to_kerberos_cache (const gchar *name,
110 const gchar *realm)
111111 {
112112 krb5_get_init_creds_opt *options = NULL;
113113 krb5_context context = NULL;
121121
122122 code = krb5_init_context (&context);
123123 if (code != 0) {
124 handle_krb5_error (code, NULL, "couldn't initialize kerberos");
124 handle_krb5_error (code, NULL, _("Couldn't initialize kerberos"));
125125 goto cleanup;
126126 }
127127
128128 code = krb5_parse_name (context, name, &principal);
129129 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);
132138 }
133139
134140 code = krb5_get_init_creds_opt_alloc (context, &options);
135141 if (code != 0) {
136 handle_krb5_error (code, context, "couldn't setup options");
142 handle_krb5_error (code, context, _("Couldn't setup kerberos options"));
137143 goto cleanup;
138144 }
139145
140146 filename = g_build_filename (g_get_user_runtime_dir (), "realmd-krb5-cache.XXXXXX", NULL);
141147 temp_fd = g_mkstemp_full (filename, O_RDWR, S_IRUSR | S_IWUSR);
142148 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));
144150 goto cleanup;
145151 }
146152 close (temp_fd);
147153
148154 code = krb5_cc_resolve (context, filename, &ccache);
149155 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"));
151157 goto cleanup;
152158 }
153159
154160 code = krb5_get_init_creds_opt_set_out_ccache (context, options, ccache);
155161 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"));
157163 goto cleanup;
158164 }
159165
160166 code = krb5_get_init_creds_password (context, &my_creds, principal, NULL,
161167 krb5_prompter_posix, 0, 0, NULL, options);
162168 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);
164170 goto cleanup;
165171 }
166172
187193 return result;
188194 }
189195
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
224196 typedef struct {
225197 GAsyncResult *result;
226198 GMainLoop *loop;
236208 g_main_loop_quit (sync->loop);
237209 }
238210
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;
246246 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 }
251255
252256 if (user_name == NULL)
253257 user_name = realm_dbus_kerberos_get_suggested_administrator (realm);
256260
257261 /* Do a kinit for the given realm */
258262 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);
264303
265304 sync.result = NULL;
266305 sync.loop = g_main_loop_new (NULL, FALSE);
267
268 /* Setup diagnostics */
269 if (verbose)
270 connect_to_diagnostics (G_DBUS_PROXY (realm));
271306
272307 options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
273308 g_variant_ref_sink (options);
275310 /* Start actual operation */
276311 g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (realm), G_MAXINT);
277312 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);
281315 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);
285318
286319 g_variant_unref (options);
287 g_variant_unref (kerberos_cache);
320 g_variant_unref (creds);
288321
289322 /* This mainloop is quit by on_complete_get_result */
290323 g_main_loop_run (sync.loop);
291324
292325 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);
296327 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);
300329
301330 g_object_unref (sync.result);
302331 g_main_loop_unref (sync.loop);
303332
304333 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"));
306335 return 1;
307336 }
308337
310339 }
311340
312341 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)
316345 {
317346 RealmDbusKerberos *realm;
318347 RealmDbusProvider *provider;
348 GVariant *options;
319349 GError *error = NULL;
320350 GVariant *realms;
321351 gint relevance;
322352 gint ret;
323353
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);
329358 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"));
331360 return 1;
332361 }
333362
363 options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
364 g_variant_ref_sink (options);
365
334366 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,
336368 &relevance, &realms, NULL, &error);
337369
338370 g_object_unref (provider);
371 g_variant_unref (options);
339372
340373 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"));
342375 return 1;
343376 }
344377
346379 g_variant_unref (realms);
347380
348381 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);
350383 return 1;
351384 }
352385
353 ret = realm_join_or_leave (realm, user_name, verbose, TRUE);
386 ret = realm_join_or_leave (realm, user_name, TRUE);
354387 g_object_unref (realm);
355388
356389 return ret;
357390 }
358391
359392 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)
363396 {
364397 RealmDbusKerberos *realm;
365398 gint ret;
366399
367400 /* Find the right realm, but only enrolled */
368 realm = realm_name_to_enrolled (string);
401 realm = realm_name_to_enrolled (connection, string);
369402
370403 /* Message already printed */
371404 if (realm == NULL)
372405 return 1;
373406
374 ret = realm_join_or_leave (realm, user_name, verbose, FALSE);
407 ret = realm_join_or_leave (realm, user_name, FALSE);
375408 g_object_unref (realm);
376409
377410 return ret;
381414 realm_join (int argc,
382415 char *argv[])
383416 {
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;
384465 GOptionContext *context;
385466 gchar *arg_user = NULL;
386467 gboolean arg_verbose = FALSE;
389470 gint ret = 0;
390471
391472 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 },
394475 { NULL, }
395476 };
396477
397478 context = g_option_context_new ("realm");
479 g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
398480 g_option_context_add_main_entries (context, option_entries, NULL);
399481
400482 if (!g_option_context_parse (context, &argc, &argv, &error)) {
402484 g_error_free (error);
403485 ret = 2;
404486
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 ());
407489 ret = 2;
408490
409491 } 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 }
412500 }
413501
414502 g_free (arg_user);
415503 g_option_context_free (context);
416504 return ret;
417505 }
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 }
1818 #include "realm-dbus-generated.h"
1919
2020 #include <glib.h>
21 #include <glib/gi18n.h>
2122
2223 #include <string.h>
2324
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
2440 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,
2643 const gchar **logins,
2744 gint n_logins,
2845 gboolean permit)
2946 {
3047 RealmDbusKerberos *realm;
48 SyncClosure sync;
3149 gchar **add_or_remove;
3250 GError *error = NULL;
3351 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);
3655 if (realm == NULL)
3756 return 1;
3857
4059 add_or_remove = g_new0 (gchar *, n_logins + 1);
4160 memcpy (add_or_remove, logins, sizeof (gchar *) * n_logins);
4261
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);
4885
4986 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"));
5289 return 1;
5390 }
5491
5693 }
5794
5895 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,
6098 gboolean permit)
6199 {
62100 RealmDbusKerberos *realm;
63101 const gchar *policy;
64102 const gchar *logins[] = { NULL };
65103 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);
68107 if (realm == NULL)
69108 return 1;
109
110 options = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
111 g_variant_ref_sink (options);
70112
71113 policy = permit ? REALM_DBUS_LOGIN_POLICY_ANY : REALM_DBUS_LOGIN_POLICY_DENY;
72114 realm_dbus_kerberos_call_change_login_policy_sync (realm, policy,
73115 (const gchar * const *)logins,
74116 (const gchar * const *)logins,
75 realm_operation_id,
76 NULL, &error);
117 options, NULL, &error);
118
119 g_variant_unref (options);
77120
78121 if (error != NULL) {
79122 realm_handle_error (error, "couldn't %s all logins",
89132 int argc,
90133 char *argv[])
91134 {
135 GDBusConnection *connection;
92136 GOptionContext *context;
93137 gboolean arg_all = FALSE;
94138 gboolean arg_verbose = FALSE;
98142
99143 GOptionEntry option_entries[] = {
100144 { "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 },
104148 { NULL, }
105149 };
106150
107151 context = g_option_context_new ("realm");
152 g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
108153 g_option_context_add_main_entries (context, option_entries, NULL);
109154
110155 if (!g_option_context_parse (context, &argc, &argv, &error)) {
115160
116161 if (arg_all) {
117162 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 ());
119164 ret = 2;
120165 } 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 }
122173 }
123174 } 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"));
125177 ret = 2;
126178
127179 } 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 }
131189 }
132190
133191 g_free (realm_name);
1717 #include "realm-dbus-constants.h"
1818
1919 #include <glib.h>
20 #include <glib/gi18n.h>
2021 #include <glib-object.h>
22
23 #include <locale.h>
2124
2225 struct {
2326 const char *name;
2528 const char *usage;
2629 const char *description;
2730 } 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") },
3437 };
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 }
3558
3659 void
3760 realm_handle_error (GError *error,
6386 realm_info_to_realm_proxy (GVariant *realm_info)
6487 {
6588 RealmDbusKerberos *realm = NULL;
66 const gchar *bus_name;
6789 const gchar *object_path;
6890 const gchar *interface_name;
6991 GError *error = NULL;
7092
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);
7294
7395 if (g_str_equal (interface_name, REALM_DBUS_KERBEROS_REALM_INTERFACE)) {
7496 realm = realm_dbus_kerberos_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
7597 G_DBUS_PROXY_FLAGS_NONE,
76 bus_name, object_path,
98 REALM_DBUS_BUS_NAME, object_path,
7799 NULL, &error);
78100 }
79101
80102 if (error != NULL)
81 realm_handle_error (error, "couldn't use realm service");
103 realm_handle_error (error, _("Couldn't use realm service"));
82104 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);
84106
85107 return realm;
86108 }
110132 result = realm;
111133 realm = NULL;
112134 } 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"));
114136 g_object_unref (realm);
115137 g_object_unref (result);
116138 return NULL;
131153
132154 if (realm_name == NULL) {
133155 if (result == NULL)
134 realm_handle_error (NULL, "no enrolled realms found");
156 realm_handle_error (NULL, _("No enrolled realms found"));
135157 return result;
136158 }
137159
138 realm_handle_error (NULL, "enrolled realm not found: %s", realm_name);
160 realm_handle_error (NULL, _("Enrolled realm not found: %s"), realm_name);
139161 return NULL;
140162 }
141163
142164
143165 RealmDbusKerberos *
144 realm_name_to_enrolled (const gchar *realm_name)
166 realm_name_to_enrolled (GDBusConnection *connection,
167 const gchar *realm_name)
145168 {
146169 RealmDbusKerberos *realm;
147170 RealmDbusProvider *provider;
151174 if (realm_name != NULL && g_str_equal (realm_name, ""))
152175 realm_name = NULL;
153176
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);
159182 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"));
161184 return NULL;
162185 }
163186
169192 g_object_unref (provider);
170193
171194 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;
172235 }
173236
174237 static int
192255 {
193256 const gchar *command = NULL;
194257 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
195266
196267 g_type_init ();
197268
4141 int realm_deny (int argc,
4242 char *argv[]);
4343
44 GDBusConnection * realm_get_connection (gboolean verbose);
45
46 void realm_print_error (const gchar *format,
47 ...) G_GNUC_PRINTF (1, 2);
48
4449 void realm_handle_error (GError *error,
4550 const gchar *format,
4651 ...) G_GNUC_PRINTF (2, 3);
4752
4853 RealmDbusKerberos * realm_info_to_realm_proxy (GVariant *realm_info);
4954
50 RealmDbusKerberos * realm_name_to_enrolled (const gchar *realm_name);
55 RealmDbusKerberos * realm_name_to_enrolled (GDBusConnection *connection,
56 const gchar *realm_name);
5157
5258 G_END_DECLS
5359