1*b819cea2SGordon Ross /*
2*b819cea2SGordon Ross * CDDL HEADER START
3*b819cea2SGordon Ross *
4*b819cea2SGordon Ross * The contents of this file are subject to the terms of the
5*b819cea2SGordon Ross * Common Development and Distribution License (the "License").
6*b819cea2SGordon Ross * You may not use this file except in compliance with the License.
7*b819cea2SGordon Ross *
8*b819cea2SGordon Ross * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*b819cea2SGordon Ross * or http://www.opensolaris.org/os/licensing.
10*b819cea2SGordon Ross * See the License for the specific language governing permissions
11*b819cea2SGordon Ross * and limitations under the License.
12*b819cea2SGordon Ross *
13*b819cea2SGordon Ross * When distributing Covered Code, include this CDDL HEADER in each
14*b819cea2SGordon Ross * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*b819cea2SGordon Ross * If applicable, add the following below this CDDL HEADER, with the
16*b819cea2SGordon Ross * fields enclosed by brackets "[]" replaced with your own identifying
17*b819cea2SGordon Ross * information: Portions Copyright [yyyy] [name of copyright owner]
18*b819cea2SGordon Ross *
19*b819cea2SGordon Ross * CDDL HEADER END
20*b819cea2SGordon Ross */
21*b819cea2SGordon Ross /*
22*b819cea2SGordon Ross * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23*b819cea2SGordon Ross * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
24*b819cea2SGordon Ross */
25*b819cea2SGordon Ross
26*b819cea2SGordon Ross #include <sys/types.h>
27*b819cea2SGordon Ross #include <sys/sid.h>
28*b819cea2SGordon Ross #include <sys/priv_names.h>
29*b819cea2SGordon Ross #include <sys/socket.h>
30*b819cea2SGordon Ross #include <netinet/in.h>
31*b819cea2SGordon Ross #include <smbsrv/smb_idmap.h>
32*b819cea2SGordon Ross #include <smbsrv/smb_kproto.h>
33*b819cea2SGordon Ross #include <smbsrv/smb_token.h>
34*b819cea2SGordon Ross
35*b819cea2SGordon Ross
36*b819cea2SGordon Ross /*
37*b819cea2SGordon Ross * Kind of a hack here. In this user-space test implementation,
38*b819cea2SGordon Ross * we don't bother with real credential. Everything here uses
39*b819cea2SGordon Ross * the ordinary credentials of the process running this.
40*b819cea2SGordon Ross */
41*b819cea2SGordon Ross cred_t *
smb_cred_create(smb_token_t * token)42*b819cea2SGordon Ross smb_cred_create(smb_token_t *token)
43*b819cea2SGordon Ross {
44*b819cea2SGordon Ross cred_t *cr;
45*b819cea2SGordon Ross cr = (cred_t *)token; /* hack */
46*b819cea2SGordon Ross return (cr);
47*b819cea2SGordon Ross }
48*b819cea2SGordon Ross
49*b819cea2SGordon Ross void
smb_user_setcred(smb_user_t * user,cred_t * cr,uint32_t privileges)50*b819cea2SGordon Ross smb_user_setcred(smb_user_t *user, cred_t *cr, uint32_t privileges)
51*b819cea2SGordon Ross {
52*b819cea2SGordon Ross user->u_cred = cr;
53*b819cea2SGordon Ross user->u_privcred = NULL;
54*b819cea2SGordon Ross user->u_privileges = privileges;
55*b819cea2SGordon Ross }
56