/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _SMB_TOKEN_H
#define _SMB_TOKEN_H
#include <smbsrv/smb_inet.h>
#include <smbsrv/smb_privilege.h>
/*
* Don't want <smbsrv/netrauth.h> in here, but
* wants this. Todo: cleanup
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* 32-bit opaque buffer (non-null terminated strings)
* See also: smb_buf32_xdr()
*/
typedef struct smb_buf32 {
} smb_buf32_t;
/*
* Access Token
*
* An access token identifies a user, the user's privileges and the
* list of groups of which the user is a member. This information is
* used when access is requested to an object by comparing this
* information with the DACL in the object's security descriptor.
*
* There should be one unique token per user per session per client.
*
* Access Token Flags
*
* SMB_ATF_GUEST Token belongs to guest user
* SMB_ATF_ANON Token belongs to anonymous user
* and it's only good for IPC Connection.
* SMB_ATF_POWERUSER Token belongs to a Power User member
* SMB_ATF_BACKUPOP Token belongs to a Power User member
* SMB_ATF_ADMIN Token belongs to a Domain Admins member
*/
#define SMB_POSIX_GRPS_SIZE(n) \
/*
* It consists of the primary and supplementary POSIX groups.
* See also: smb_posix_grps_xdr()
*/
typedef struct smb_posix_grps {
/*
* An NT-style logon "token" (NT terminology)
* See also: smb_token_xdr()
*/
typedef struct smb_token {
char *tkn_account_name;
char *tkn_domain_name;
} smb_token_t;
/*
* Details required to authenticate a user.
* See also: smb_logon_xdr()
*/
typedef struct smb_logon {
char *lg_workstation;
int lg_native_os;
int lg_native_lm;
} smb_logon_t;
/*
* This is the name of the local (AF_UNIX) socket
* where the SMB auth. service listens.
*/
/*
* Maximum number of authentcation conversations at one time.
* Note this is _NOT_ the max. number of logged on users,
* which can be much larger.
*/
/*
* Messages to and from the local security authority
* Type codes:
*/
typedef enum smb_lsa_mtype {
/* reply types */
LSA_MTYPE_OK = 0,
/* request types */
/*
* msg: header common to all message types
*/
typedef struct smb_lsa_msg_hdr {
/*
* eresp: error response
* msgtype: LSA_MTYPE_ERESP
*/
typedef struct smb_lsa_eresp {
/*
* Message for LSA_MTYPE_CLINFO
*/
typedef struct smb_lsa_clinfo {
int lci_native_os;
int lci_native_lm;
struct XDR;
#if defined(_KERNEL) || defined(_FAKE_KERNEL)
void smb_token_free(smb_token_t *);
#else /* _KERNEL */
void smb_logon_abort(void);
void smb_token_destroy(smb_token_t *);
void smb_token_log(smb_token_t *);
void smb_logon_free(smb_logon_t *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SMB_TOKEN_H */