s3:utils: Fix setting the debug level
[Samba.git] / source4 / auth / session.h
blob900b6ab3365f7c6334d6c3d12aa407662efab154
1 /*
2 Unix SMB/CIFS implementation.
3 Process and provide the logged on user's authorization token
4 Copyright (C) Andrew Bartlett 2001
5 Copyright (C) Stefan Metzmacher 2005
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef _SAMBA_AUTH_SESSION_H
22 #define _SAMBA_AUTH_SESSION_H
24 #include "librpc/gen_ndr/security.h"
25 #include "librpc/gen_ndr/netlogon.h"
26 #include "librpc/gen_ndr/auth.h"
28 struct tevent_context;
29 struct ldb_context;
30 struct ldb_dn;
31 /* Create a security token for a session SYSTEM (the most
32 * trusted/privileged account), including the local machine account as
33 * the off-host credentials */
34 struct auth_session_info *system_session(struct loadparm_context *lp_ctx) ;
36 NTSTATUS auth_anonymous_user_info_dc(TALLOC_CTX *mem_ctx,
37 const char *netbios_name,
38 struct auth_user_info_dc **interim_info);
39 NTSTATUS auth_generate_security_token(TALLOC_CTX *mem_ctx,
40 struct loadparm_context *lp_ctx, /* Optional, if you don't want privileges */
41 struct ldb_context *sam_ctx, /* Optional, if you don't want local groups */
42 const struct auth_user_info_dc *user_info_dc,
43 uint32_t session_info_flags,
44 struct security_token **_security_token);
45 NTSTATUS auth_generate_session_info(TALLOC_CTX *mem_ctx,
46 struct loadparm_context *lp_ctx, /* Optional, if you don't want privileges */
47 struct ldb_context *sam_ctx, /* Optional, if you don't want local groups */
48 const struct auth_user_info_dc *interim_info,
49 uint32_t session_info_flags,
50 struct auth_session_info **session_info);
51 NTSTATUS auth_anonymous_session_info(TALLOC_CTX *parent_ctx,
52 struct loadparm_context *lp_ctx,
53 struct auth_session_info **session_info);
54 struct auth_session_info *auth_session_info_from_transport(TALLOC_CTX *mem_ctx,
55 struct auth_session_info_transport *session_info_transport,
56 struct loadparm_context *lp_ctx,
57 const char **reason);
58 NTSTATUS auth_session_info_transport_from_session(TALLOC_CTX *mem_ctx,
59 struct auth_session_info *session_info,
60 struct tevent_context *event_ctx,
61 struct loadparm_context *lp_ctx,
62 struct auth_session_info_transport **transport_out);
64 /* Produce a session_info for an arbitary DN or principal in the local
65 * DB, assuming the local DB holds all the groups
67 * Supply either a principal or a DN
69 NTSTATUS authsam_get_session_info_principal(TALLOC_CTX *mem_ctx,
70 struct loadparm_context *lp_ctx,
71 struct ldb_context *sam_ctx,
72 const char *principal,
73 struct ldb_dn *user_dn,
74 uint32_t session_info_flags,
75 struct auth_session_info **session_info);
77 struct auth_session_info *anonymous_session(TALLOC_CTX *mem_ctx,
78 struct loadparm_context *lp_ctx);
80 struct auth_session_info *admin_session(TALLOC_CTX *mem_ctx,
81 struct loadparm_context *lp_ctx,
82 struct dom_sid *domain_sid);
85 #endif /* _SAMBA_AUTH_SESSION_H */