2 samba -- Unix SMB/CIFS implementation.
4 Client credentials structure
6 Copyright (C) Jelmer Vernooij 2004-2005
7 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2005
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 struct ccache_container;
26 /* In order of priority */
27 enum credentials_obtained {
28 CRED_UNINITIALISED = 0, /* We don't even have a guess yet */
29 CRED_GUESS_ENV, /* Current value should be used, which was guessed */
30 CRED_CALLBACK, /* Callback should be used to obtain value */
31 CRED_GUESS_FILE, /* A guess from a file (or file pointed at in env variable) */
32 CRED_SPECIFIED /* Was explicitly specified on the command-line */
35 struct cli_credentials {
36 /* Preferred methods, NULL means default */
37 const char **preferred_methods;
39 enum credentials_obtained workstation_obtained;
40 enum credentials_obtained username_obtained;
41 enum credentials_obtained password_obtained;
42 enum credentials_obtained domain_obtained;
43 enum credentials_obtained realm_obtained;
44 enum credentials_obtained ccache_obtained;
45 enum credentials_obtained principal_obtained;
47 const char *workstation;
52 const char *principal;
54 struct samr_Password *nt_hash;
56 struct ccache_container *ccache;
58 const char *(*workstation_cb) (struct cli_credentials *);
59 const char *(*password_cb) (struct cli_credentials *);
60 const char *(*username_cb) (struct cli_credentials *);
61 const char *(*domain_cb) (struct cli_credentials *);
62 const char *(*realm_cb) (struct cli_credentials *);
63 const char *(*principal_cb) (struct cli_credentials *);
65 /* Private handle for the callback routines to use */
68 struct creds_CredentialState *netlogon_creds;
69 enum netr_SchannelType secure_channel_type;
72 /* We are flagged to get machine account details from the
73 * secrets.ldb when we are asked for a username or password */
75 BOOL machine_account_pending;