Line data Source code
1 : /*
2 : Unix SMB/CIFS implementation.
3 :
4 : debug print helpers
5 :
6 : Copyright (C) Guenther Deschner 2008
7 :
8 : This program is free software; you can redistribute it and/or modify
9 : it under the terms of the GNU General Public License as published by
10 : the Free Software Foundation; either version 3 of the License, or
11 : (at your option) any later version.
12 :
13 : This program is distributed in the hope that it will be useful,
14 : but WITHOUT ANY WARRANTY; without even the implied warranty of
15 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 : GNU General Public License for more details.
17 :
18 : You should have received a copy of the GNU General Public License
19 : along with this program. If not, see <http://www.gnu.org/licenses/>.
20 : */
21 :
22 : #include "includes.h"
23 : #include "ads.h"
24 : #include "../librpc/gen_ndr/ndr_netlogon.h"
25 : #include "../librpc/ndr/libndr.h"
26 : #include "lib/param/loadparm.h"
27 :
28 0 : static void ndr_print_ads_auth_flags(struct ndr_print *ndr, const char *name, uint32_t r)
29 : {
30 0 : ndr_print_uint32(ndr, name, r);
31 0 : ndr->depth++;
32 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ADS_AUTH_DISABLE_KERBEROS", ADS_AUTH_DISABLE_KERBEROS, r);
33 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ADS_AUTH_NO_BIND", ADS_AUTH_NO_BIND, r);
34 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ADS_AUTH_ANON_BIND", ADS_AUTH_ANON_BIND, r);
35 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ADS_AUTH_SIMPLE_BIND", ADS_AUTH_SIMPLE_BIND, r);
36 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ADS_AUTH_ALLOW_NTLMSSP", ADS_AUTH_ALLOW_NTLMSSP, r);
37 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ADS_AUTH_SASL_SIGN", ADS_AUTH_SASL_SIGN, r);
38 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ADS_AUTH_SASL_SEAL", ADS_AUTH_SASL_SEAL, r);
39 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ADS_AUTH_SASL_FORCE", ADS_AUTH_SASL_FORCE, r);
40 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "ADS_AUTH_USER_CREDS", ADS_AUTH_USER_CREDS, r);
41 0 : ndr->depth--;
42 0 : }
43 :
44 0 : void ndr_print_ads_struct(struct ndr_print *ndr, const char *name, const struct ads_struct *r)
45 : {
46 0 : ndr_print_struct(ndr, name, "ads_struct");
47 0 : ndr->depth++;
48 0 : ndr_print_struct(ndr, name, "server");
49 0 : ndr->depth++;
50 0 : ndr_print_string(ndr, "realm", r->server.realm);
51 0 : ndr_print_string(ndr, "workgroup", r->server.workgroup);
52 0 : ndr_print_string(ndr, "ldap_server", r->server.ldap_server);
53 0 : ndr_print_bool(ndr, "gc", r->server.gc);
54 0 : ndr_print_bool(ndr, "no_fallback", r->server.no_fallback);
55 0 : ndr->depth--;
56 0 : ndr_print_struct(ndr, name, "auth");
57 0 : ndr->depth++;
58 0 : ndr_print_string(ndr, "realm", r->auth.realm);
59 : #ifdef DEBUG_PASSWORD
60 0 : ndr_print_string(ndr, "password", r->auth.password);
61 : #else
62 : ndr_print_string(ndr, "password", "(PASSWORD omitted)");
63 : #endif
64 0 : ndr_print_string(ndr, "user_name", r->auth.user_name);
65 0 : ndr_print_string(ndr, "kdc_server", r->auth.kdc_server);
66 0 : ndr_print_ads_auth_flags(ndr, "flags", r->auth.flags);
67 0 : ndr_print_uint32(ndr, "time_offset", r->auth.time_offset);
68 0 : ndr_print_string(ndr, "ccache_name", r->auth.ccache_name);
69 0 : ndr_print_time_t(ndr, "tgt_expire", r->auth.tgt_expire);
70 0 : ndr_print_time_t(ndr, "tgs_expire", r->auth.tgs_expire);
71 0 : ndr_print_time_t(ndr, "renewable", r->auth.renewable);
72 0 : ndr->depth--;
73 0 : ndr_print_struct(ndr, name, "config");
74 0 : ndr->depth++;
75 0 : ndr_print_netr_DsR_DcFlags(ndr, "flags", r->config.flags);
76 0 : ndr_print_string(ndr, "realm", r->config.realm);
77 0 : ndr_print_string(ndr, "bind_path", r->config.bind_path);
78 0 : ndr_print_string(ndr, "ldap_server_name", r->config.ldap_server_name);
79 0 : ndr_print_string(ndr, "server_site_name", r->config.server_site_name);
80 0 : ndr_print_string(ndr, "client_site_name", r->config.client_site_name);
81 0 : ndr_print_time_t(ndr, "current_time", r->config.current_time);
82 0 : ndr_print_string(ndr, "schema_path", r->config.schema_path);
83 0 : ndr_print_string(ndr, "config_path", r->config.config_path);
84 0 : ndr->depth--;
85 : #ifdef HAVE_LDAP
86 0 : ndr_print_struct(ndr, name, "ldap");
87 0 : ndr->depth++;
88 0 : ndr_print_ptr(ndr, "ld", r->ldap.ld);
89 0 : ndr_print_sockaddr_storage(ndr, "ss", &r->ldap.ss);
90 0 : ndr_print_time_t(ndr, "last_attempt", r->ldap.last_attempt);
91 0 : ndr_print_uint32(ndr, "port", r->ldap.port);
92 0 : ndr_print_ads_saslwrap_struct(ndr, "saslwrap", &(r->ldap_wrap_data));
93 0 : ndr->depth--;
94 0 : ndr->depth--;
95 : #endif /* HAVE_LDAP */
96 0 : ndr->depth--;
97 0 : }
|