Imported Upstream version 0.4
Laurent Bigonville
11 years ago
1 | 1 | Version 2, June 1991 |
2 | 2 | |
3 | 3 | 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 | |
5 | 5 | Everyone is permitted to copy and distribute verbatim copies |
6 | 6 | of this license document, but changing it is not allowed. |
7 | 7 | |
463 | 463 | |
464 | 464 | You should have received a copy of the GNU Library General Public |
465 | 465 | 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 | |
468 | 468 | |
469 | 469 | Also add information on how to contact you by electronic and paper mail. |
470 | 470 |
0 | 0 | # 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(-) | |
1 | 42 | |
2 | 43 | commit 9fd945e402702592c537f13be23175d2826ec76d |
3 | 44 | 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 | ||
0 | 4 | 0.3 |
1 | 5 | * Build and packaging fixes |
2 | 6 |
0 | 0 | #! /bin/sh |
1 | 1 | # 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. | |
3 | 3 | # |
4 | 4 | # Report bugs to <http://bugs.freedesktop.org/enter_bug.cgi?product=realmd>. |
5 | 5 | # |
560 | 560 | # Identity of this package. |
561 | 561 | PACKAGE_NAME='realmd' |
562 | 562 | 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' | |
565 | 565 | PACKAGE_BUGREPORT='http://bugs.freedesktop.org/enter_bug.cgi?product=realmd' |
566 | 566 | PACKAGE_URL='' |
567 | 567 | |
1341 | 1341 | # Omit some internal or obsolete options to make the list less imposing. |
1342 | 1342 | # This message is too long to be a string in the A/UX 3.1 sh. |
1343 | 1343 | 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. | |
1345 | 1345 | |
1346 | 1346 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1347 | 1347 | |
1407 | 1407 | |
1408 | 1408 | if test -n "$ac_init_help"; then |
1409 | 1409 | case $ac_init_help in |
1410 | short | recursive ) echo "Configuration of realmd 0.3:";; | |
1410 | short | recursive ) echo "Configuration of realmd 0.4:";; | |
1411 | 1411 | esac |
1412 | 1412 | cat <<\_ACEOF |
1413 | 1413 | |
1527 | 1527 | test -n "$ac_init_help" && exit $ac_status |
1528 | 1528 | if $ac_init_version; then |
1529 | 1529 | cat <<\_ACEOF |
1530 | realmd configure 0.3 | |
1530 | realmd configure 0.4 | |
1531 | 1531 | generated by GNU Autoconf 2.68 |
1532 | 1532 | |
1533 | 1533 | Copyright (C) 2010 Free Software Foundation, Inc. |
1896 | 1896 | This file contains any messages produced by compilers while |
1897 | 1897 | running configure, to aid debugging if configure makes a mistake. |
1898 | 1898 | |
1899 | It was created by realmd $as_me 0.3, which was | |
1899 | It was created by realmd $as_me 0.4, which was | |
1900 | 1900 | generated by GNU Autoconf 2.68. Invocation command line was |
1901 | 1901 | |
1902 | 1902 | $ $0 $@ |
2715 | 2715 | |
2716 | 2716 | # Define the identity of the package. |
2717 | 2717 | PACKAGE='realmd' |
2718 | VERSION='0.3' | |
2718 | VERSION='0.4' | |
2719 | 2719 | |
2720 | 2720 | |
2721 | 2721 | cat >>confdefs.h <<_ACEOF |
8292 | 8292 | # report actual input values of CONFIG_FILES etc. instead of their |
8293 | 8293 | # values after options handling. |
8294 | 8294 | 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 | |
8296 | 8296 | generated by GNU Autoconf 2.68. Invocation command line was |
8297 | 8297 | |
8298 | 8298 | CONFIG_FILES = $CONFIG_FILES |
8358 | 8358 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
8359 | 8359 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
8360 | 8360 | ac_cs_version="\\ |
8361 | realmd config.status 0.3 | |
8361 | realmd config.status 0.4 | |
8362 | 8362 | configured by $0, generated by GNU Autoconf 2.68, |
8363 | 8363 | with options \\"\$ac_cs_config\\" |
8364 | 8364 |
0 | 0 | AC_PREREQ(2.63) |
1 | 1 | |
2 | AC_INIT([realmd], [0.3], | |
2 | AC_INIT([realmd], [0.4], | |
3 | 3 | [http://bugs.freedesktop.org/enter_bug.cgi?product=realmd], |
4 | 4 | [realmd]) |
5 | 5 |
28 | 28 | GHashTable *discovery; |
29 | 29 | gchar *domain; |
30 | 30 | 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; | |
35 | 35 | } DiscoverClosure; |
36 | 36 | |
37 | 37 | static void |
51 | 51 | maybe_complete_discover (GSimpleAsyncResult *res, |
52 | 52 | DiscoverClosure *discover) |
53 | 53 | { |
54 | if (!discover->finished_srv || !discover->finished_soa) | |
54 | if (!discover->finished_kerberos || !discover->finished_msdcs) | |
55 | 55 | return; |
56 | 56 | |
57 | if (discover->found_kerberos_srv && discover->found_msdcs_soa) | |
57 | if (discover->found_kerberos && discover->found_msdcs) | |
58 | 58 | realm_diagnostics_info (discover->invocation, "Found AD style DNS records on domain"); |
59 | 59 | else |
60 | 60 | realm_diagnostics_info (discover->invocation, "Couldn't find AD style DNS records on domain"); |
63 | 63 | } |
64 | 64 | |
65 | 65 | 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) | |
69 | 69 | { |
70 | 70 | GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data); |
71 | 71 | DiscoverClosure *discover = g_simple_async_result_get_op_res_gpointer (res); |
88 | 88 | servers = g_ptr_array_new (); |
89 | 89 | |
90 | 90 | for (l = targets; l != NULL; l = g_list_next (l)) { |
91 | discover->found_kerberos_srv = TRUE; | |
91 | discover->found_kerberos = TRUE; | |
92 | 92 | server = g_strdup_printf ("%s:%d", g_srv_target_get_hostname (l->data), |
93 | 93 | (int)g_srv_target_get_port (l->data)); |
94 | 94 | g_ptr_array_add (servers, g_variant_new_string (server)); |
99 | 99 | |
100 | 100 | g_list_free (targets); |
101 | 101 | |
102 | if (discover->found_kerberos_srv) | |
102 | if (discover->found_kerberos) | |
103 | 103 | realm_diagnostics_info (discover->invocation, "%s", info->str); |
104 | 104 | else |
105 | 105 | realm_diagnostics_info (discover->invocation, "No kerberos SRV records"); |
118 | 118 | g_simple_async_result_take_error (res, error); |
119 | 119 | } |
120 | 120 | |
121 | discover->finished_srv = TRUE; | |
121 | discover->finished_kerberos = TRUE; | |
122 | 122 | maybe_complete_discover (res, discover); |
123 | 123 | g_object_unref (res); |
124 | 124 | } |
125 | 125 | |
126 | 126 | 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) | |
130 | 130 | { |
131 | 131 | GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data); |
132 | 132 | DiscoverClosure *discover = g_simple_async_result_get_op_res_gpointer (res); |
136 | 136 | |
137 | 137 | records = g_resolver_lookup_records_finish (resolver, result, &error); |
138 | 138 | 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); | |
140 | 140 | g_list_free_full (records, (GDestroyNotify)g_variant_unref); |
141 | 141 | |
142 | 142 | } 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"); | |
144 | 144 | g_simple_async_result_take_error (res, error); |
145 | 145 | } |
146 | 146 | |
147 | discover->finished_soa = TRUE; | |
147 | discover->finished_msdcs = TRUE; | |
148 | 148 | maybe_complete_discover (res, discover); |
149 | 149 | g_object_unref (res); |
150 | 150 | } |
164 | 164 | |
165 | 165 | resolver = g_resolver_get_default (); |
166 | 166 | 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)); | |
168 | 168 | |
169 | 169 | /* 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); | |
171 | 171 | |
172 | 172 | realm_diagnostics_info (discover->invocation, |
173 | "Searching for sub zone on domain: %s", | |
173 | "Searching for MSDCS SRV records on domain: _kerberos._tcp.%s", | |
174 | 174 | msdcs); |
175 | 175 | |
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)); | |
178 | 178 | |
179 | 179 | g_free (msdcs); |
180 | 180 | |
260 | 260 | discover = g_simple_async_result_get_op_res_gpointer (res); |
261 | 261 | |
262 | 262 | /* Didn't find a valid domain */ |
263 | if (!discover->found_kerberos_srv || !discover->found_msdcs_soa) | |
263 | if (!discover->found_kerberos || !discover->found_msdcs) | |
264 | 264 | return NULL; |
265 | 265 | |
266 | 266 | realm = g_ascii_strup (discover->domain, -1); |
1 | 1 | * Copyright (C) 2011 Collabora Ltd. |
2 | 2 | * Copyright (C) 2012 Red Hat Inc. |
3 | 3 | * |
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. | |
8 | 8 | * |
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. | |
18 | 10 | * |
19 | 11 | * Author: Stef Walter <stefw@collabora.co.uk> |
20 | 12 | */ |
1 | 1 | * Copyright (C) 2011 Collabora Ltd. |
2 | 2 | * Copyright (C) 2012 Red Hat Inc. |
3 | 3 | * |
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. | |
8 | 8 | * |
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. | |
18 | 10 | * |
19 | 11 | * Author: Stef Walter <stefw@collabora.co.uk> |
20 | 12 | */ |