Codebase list realmd / 14e1b61
Imported Upstream version 0.4 Laurent Bigonville 11 years ago
8 changed file(s) with 93 addition(s) and 64 deletion(s). Raw diff Collapse all Expand all
11 Version 2, June 1991
22
33 Copyright (C) 1991 Free Software Foundation, Inc.
4 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
55 Everyone is permitted to copy and distribute verbatim copies
66 of this license document, but changing it is not allowed.
77
463463
464464 You should have received a copy of the GNU Library General Public
465465 License along with this library; if not, write to the
466 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
467 Boston, MA 02111-1307 USA.
466 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
467 02110-1301 USA
468468
469469 Also add information on how to contact you by electronic and paper mail.
470470
00 # Generate automatically. Do not edit.
1
2 commit 8575685f6c14990d4062c3e2eb5d5f92b72eda64
3 Author: Stef Walter <stefw@gnome.org>
4 Date: 2012-06-21
5
6 Release version 0.4
7
8 NEWS | 4 ++++
9 configure.ac | 2 +-
10 2 files changed, 5 insertions(+), 1 deletion(-)
11
12 commit fd8db9355784e768784ee9e42de8a1a8ea1e2238
13 Author: Stef Walter <stefw@gnome.org>
14 Date: 2012-06-21
15
16 Licensing fixes
17
18 * Simpler license header for realm-command.[ch]
19 * Cleanup rpmlint warnings
20 * Fix addresses in COPYING
21
22 COPYING | 6 +++---
23 service/realm-command.c | 18 +++++-------------
24 service/realm-command.h | 18 +++++-------------
25 3 files changed, 13 insertions(+), 29 deletions(-)
26
27 commit 80b59926e68813fa5de94911b8c0be70b5f84938
28 Author: Stef Walter <stefw@gnome.org>
29 Date: 2012-06-21
30
31 Don't use SOA for MSDCS subdomain, use SRV record directly
32
33 When determining whether this is an active directory domain
34 we use the _msdcs subdomain. However this may not necessarily
35 be an actual zone. So lookup the DNS SRV records directly
36 gets around that problem. Eg:
37
38 _kerberos._tcp.dc._msdcs.example.com
39
40 service/realm-ad-discover.c | 48 +++++++++++++++++++++----------------------
41 1 file changed, 24 insertions(+), 24 deletions(-)
142
243 commit 9fd945e402702592c537f13be23175d2826ec76d
344 Author: Stef Walter <stefw@gnome.org>
0 0.4
1 * Fix up license headers
2 * Don't use SOA for MSDCS subdomain, use SRV record directly
3
04 0.3
15 * Build and packaging fixes
26
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.68 for realmd 0.3.
2 # Generated by GNU Autoconf 2.68 for realmd 0.4.
33 #
44 # Report bugs to <http://bugs.freedesktop.org/enter_bug.cgi?product=realmd>.
55 #
560560 # Identity of this package.
561561 PACKAGE_NAME='realmd'
562562 PACKAGE_TARNAME='realmd'
563 PACKAGE_VERSION='0.3'
564 PACKAGE_STRING='realmd 0.3'
563 PACKAGE_VERSION='0.4'
564 PACKAGE_STRING='realmd 0.4'
565565 PACKAGE_BUGREPORT='http://bugs.freedesktop.org/enter_bug.cgi?product=realmd'
566566 PACKAGE_URL=''
567567
13411341 # Omit some internal or obsolete options to make the list less imposing.
13421342 # This message is too long to be a string in the A/UX 3.1 sh.
13431343 cat <<_ACEOF
1344 \`configure' configures realmd 0.3 to adapt to many kinds of systems.
1344 \`configure' configures realmd 0.4 to adapt to many kinds of systems.
13451345
13461346 Usage: $0 [OPTION]... [VAR=VALUE]...
13471347
14071407
14081408 if test -n "$ac_init_help"; then
14091409 case $ac_init_help in
1410 short | recursive ) echo "Configuration of realmd 0.3:";;
1410 short | recursive ) echo "Configuration of realmd 0.4:";;
14111411 esac
14121412 cat <<\_ACEOF
14131413
15271527 test -n "$ac_init_help" && exit $ac_status
15281528 if $ac_init_version; then
15291529 cat <<\_ACEOF
1530 realmd configure 0.3
1530 realmd configure 0.4
15311531 generated by GNU Autoconf 2.68
15321532
15331533 Copyright (C) 2010 Free Software Foundation, Inc.
18961896 This file contains any messages produced by compilers while
18971897 running configure, to aid debugging if configure makes a mistake.
18981898
1899 It was created by realmd $as_me 0.3, which was
1899 It was created by realmd $as_me 0.4, which was
19001900 generated by GNU Autoconf 2.68. Invocation command line was
19011901
19021902 $ $0 $@
27152715
27162716 # Define the identity of the package.
27172717 PACKAGE='realmd'
2718 VERSION='0.3'
2718 VERSION='0.4'
27192719
27202720
27212721 cat >>confdefs.h <<_ACEOF
82928292 # report actual input values of CONFIG_FILES etc. instead of their
82938293 # values after options handling.
82948294 ac_log="
8295 This file was extended by realmd $as_me 0.3, which was
8295 This file was extended by realmd $as_me 0.4, which was
82968296 generated by GNU Autoconf 2.68. Invocation command line was
82978297
82988298 CONFIG_FILES = $CONFIG_FILES
83588358 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
83598359 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
83608360 ac_cs_version="\\
8361 realmd config.status 0.3
8361 realmd config.status 0.4
83628362 configured by $0, generated by GNU Autoconf 2.68,
83638363 with options \\"\$ac_cs_config\\"
83648364
00 AC_PREREQ(2.63)
11
2 AC_INIT([realmd], [0.3],
2 AC_INIT([realmd], [0.4],
33 [http://bugs.freedesktop.org/enter_bug.cgi?product=realmd],
44 [realmd])
55
2828 GHashTable *discovery;
2929 gchar *domain;
3030 GVariant *servers;
31 gboolean found_kerberos_srv;
32 gboolean finished_srv;
33 gboolean found_msdcs_soa;
34 gboolean finished_soa;
31 gboolean found_kerberos;
32 gboolean finished_kerberos;
33 gboolean found_msdcs;
34 gboolean finished_msdcs;
3535 } DiscoverClosure;
3636
3737 static void
5151 maybe_complete_discover (GSimpleAsyncResult *res,
5252 DiscoverClosure *discover)
5353 {
54 if (!discover->finished_srv || !discover->finished_soa)
54 if (!discover->finished_kerberos || !discover->finished_msdcs)
5555 return;
5656
57 if (discover->found_kerberos_srv && discover->found_msdcs_soa)
57 if (discover->found_kerberos && discover->found_msdcs)
5858 realm_diagnostics_info (discover->invocation, "Found AD style DNS records on domain");
5959 else
6060 realm_diagnostics_info (discover->invocation, "Couldn't find AD style DNS records on domain");
6363 }
6464
6565 static void
66 on_resolve_kerberos_srv (GObject *source,
67 GAsyncResult *result,
68 gpointer user_data)
66 on_resolve_kerberos (GObject *source,
67 GAsyncResult *result,
68 gpointer user_data)
6969 {
7070 GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data);
7171 DiscoverClosure *discover = g_simple_async_result_get_op_res_gpointer (res);
8888 servers = g_ptr_array_new ();
8989
9090 for (l = targets; l != NULL; l = g_list_next (l)) {
91 discover->found_kerberos_srv = TRUE;
91 discover->found_kerberos = TRUE;
9292 server = g_strdup_printf ("%s:%d", g_srv_target_get_hostname (l->data),
9393 (int)g_srv_target_get_port (l->data));
9494 g_ptr_array_add (servers, g_variant_new_string (server));
9999
100100 g_list_free (targets);
101101
102 if (discover->found_kerberos_srv)
102 if (discover->found_kerberos)
103103 realm_diagnostics_info (discover->invocation, "%s", info->str);
104104 else
105105 realm_diagnostics_info (discover->invocation, "No kerberos SRV records");
118118 g_simple_async_result_take_error (res, error);
119119 }
120120
121 discover->finished_srv = TRUE;
121 discover->finished_kerberos = TRUE;
122122 maybe_complete_discover (res, discover);
123123 g_object_unref (res);
124124 }
125125
126126 static void
127 on_resolve_msdcs_soa (GObject *source,
128 GAsyncResult *result,
129 gpointer user_data)
127 on_resolve_msdcs (GObject *source,
128 GAsyncResult *result,
129 gpointer user_data)
130130 {
131131 GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data);
132132 DiscoverClosure *discover = g_simple_async_result_get_op_res_gpointer (res);
136136
137137 records = g_resolver_lookup_records_finish (resolver, result, &error);
138138 if (error == NULL || g_error_matches (error, G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND)) {
139 discover->found_msdcs_soa = (records != NULL);
139 discover->found_msdcs = (records != NULL);
140140 g_list_free_full (records, (GDestroyNotify)g_variant_unref);
141141
142142 } else {
143 realm_diagnostics_error (discover->invocation, error, "Failure to lookup domain SOA record");
143 realm_diagnostics_error (discover->invocation, error, "Failure to lookup domain MSDCS records");
144144 g_simple_async_result_take_error (res, error);
145145 }
146146
147 discover->finished_soa = TRUE;
147 discover->finished_msdcs = TRUE;
148148 maybe_complete_discover (res, discover);
149149 g_object_unref (res);
150150 }
164164
165165 resolver = g_resolver_get_default ();
166166 g_resolver_lookup_service_async (resolver, "kerberos", "udp", discover->domain, NULL,
167 on_resolve_kerberos_srv, g_object_ref (res));
167 on_resolve_kerberos, g_object_ref (res));
168168
169169 /* Active Directory DNS zones have this subzone */
170 msdcs = g_strdup_printf ("_msdcs.%s", discover->domain);
170 msdcs = g_strdup_printf ("dc._msdcs.%s", discover->domain);
171171
172172 realm_diagnostics_info (discover->invocation,
173 "Searching for sub zone on domain: %s",
173 "Searching for MSDCS SRV records on domain: _kerberos._tcp.%s",
174174 msdcs);
175175
176 g_resolver_lookup_records_async (resolver, msdcs, G_RESOLVER_RECORD_SOA, NULL,
177 on_resolve_msdcs_soa, g_object_ref (res));
176 g_resolver_lookup_service_async (resolver, "kerberos", "tcp", msdcs, NULL,
177 on_resolve_msdcs, g_object_ref (res));
178178
179179 g_free (msdcs);
180180
260260 discover = g_simple_async_result_get_op_res_gpointer (res);
261261
262262 /* Didn't find a valid domain */
263 if (!discover->found_kerberos_srv || !discover->found_msdcs_soa)
263 if (!discover->found_kerberos || !discover->found_msdcs)
264264 return NULL;
265265
266266 realm = g_ascii_strup (discover->domain, -1);
11 * Copyright (C) 2011 Collabora Ltd.
22 * Copyright (C) 2012 Red Hat Inc.
33 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published
6 * by the Free Software Foundation; either version 2.1 of the licence or (at
7 * your option) any later version.
88 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 * 02111-1307, USA.
9 * See the included COPYING file for more information.
1810 *
1911 * Author: Stef Walter <stefw@collabora.co.uk>
2012 */
11 * Copyright (C) 2011 Collabora Ltd.
22 * Copyright (C) 2012 Red Hat Inc.
33 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2.1 of
7 * the License, or (at your option) any later version.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published
6 * by the Free Software Foundation; either version 2.1 of the licence or (at
7 * your option) any later version.
88 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17 * 02111-1307, USA.
9 * See the included COPYING file for more information.
1810 *
1911 * Author: Stef Walter <stefw@collabora.co.uk>
2012 */