usr/src/lib/smbsrv/libsmbrdr/common/smbrdr_ipc_util.c
author natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
Tue, 28 Oct 2008 03:34:04 -0700
changeset 7961 4b5e3051f38b
parent 5772 237ac22142fe
child 8334 5f1c6a3b0fad
permissions -rw-r--r--
6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory 6753904 SVCCTL server side service 6741484 Local users cannot connect to CIFS shares from MacOS 10.5 6746898 win98 can not overwrite *.files 6753310 Incorrect handling of SmbNegotiate request when invalid dialects are negotiated. 6751123 Unable to join domain, core dump generated with IPMP setting 6722437 SMB_TRANS2_FIND returns wrong status code when stream file is passed 6716578 can not delete file in extended attribute name space in cifs client when cifs server is solaris PSARC 2008/584 Correction in nbmand behavior 6734067 Long delay when viewing MS Word Read-only file properties with nbmand enabled. PSARC/2007/281 NFS share properties for Montana compatibility 6475452 Need Solaris support for Montana approve file functionality in NFS 6582170 Host-based access control (approve file) 6749075 Unable to join domain if user password exceeds 20 characters 6612716 Join domain fails if hostname is > 15 chars 6753251 server signing: wrong signature is generated for the NetShareEnum reply 6757521 SMB daemon leaks memory after displaying GSS status 6760315 Local user cannot connnect to CIFS shares if CIFS server's hostname is not specified 6757333 Share publisher thread runs into infinite loop of displaying GSS major/minor status 6757132 smbd crashes at smb_idmap_batch_getmappings 6760876 security descriptor decoding function has a glitch 6761491 Cannot open or delete a named stream on a directory file. 6741449 Cleanup list in smbns_ads module 6593958 Users with restore privilege can take ownership of files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
     1
/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
     2
 * CDDL HEADER START
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
     3
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
     5
 * Common Development and Distribution License (the "License").
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
     6
 * You may not use this file except in compliance with the License.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
     7
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    11
 * and limitations under the License.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    12
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    18
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    19
 * CDDL HEADER END
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    20
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    21
/*
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
    22
 * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    23
 * Use is subject to license terms.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    24
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    25
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    26
/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    27
 * The IPC connection information is encapsulated within SMB Redirector.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    28
 * Utility functions are defined here to allow other modules to get and
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    29
 * set the ipc configuration, as well as, to rollback or commit the
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    30
 * changes to the original authentication information.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    31
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    32
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    33
#include <string.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    34
#include <strings.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    35
#include <synch.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    36
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    37
#include <smbsrv/libsmbrdr.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    38
#include <smbsrv/mlsvc.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    39
#include <smbsrv/smbinfo.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    40
#include <smbrdr.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    41
#include <smbrdr_ipc_util.h>
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    42
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    43
#define	SMBRDR_IPC_GETDOMAIN_TIMEOUT	10000
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    44
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    45
static rwlock_t		smbrdr_ipc_lock;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    46
static smbrdr_ipc_t	ipc_info;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    47
static smbrdr_ipc_t	orig_ipc_info;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    48
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    49
static int
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    50
smbrdr_get_machine_pwd_hash(unsigned char *hash)
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    51
{
7961
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 5772
diff changeset
    52
	char pwd[SMB_PASSWD_MAXLEN + 1];
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    53
	int rc = 0;
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    54
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
    55
	rc = smb_config_getstr(SMB_CI_MACHINE_PASSWD, pwd, sizeof (pwd));
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
    56
	if ((rc != SMBD_SMF_OK) || *pwd == '\0') {
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    57
		return (-1);
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    58
	}
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    59
5772
237ac22142fe 6560095 SNAS shows SIDs for Built-in Groups members instead of name
as200622
parents: 5521
diff changeset
    60
	if (smb_auth_ntlm_hash(pwd, hash) != 0)
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    61
		rc = -1;
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    62
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    63
	return (rc);
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    64
}
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    65
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    66
/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    67
 * smbrdr_ipc_init
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    68
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    69
 * Get system configuration regarding IPC connection
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    70
 * credentials and initialize related variables.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    71
 * This function will normally be called at startup
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    72
 * (i.e. at the time smbrdr gets loaded).
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    73
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    74
void
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    75
smbrdr_ipc_init(void)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    76
{
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    77
	int rc;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    78
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    79
	(void) rw_wrlock(&smbrdr_ipc_lock);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    80
	bzero(&ipc_info, sizeof (smbrdr_ipc_t));
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    81
	bzero(&orig_ipc_info, sizeof (smbrdr_ipc_t));
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    82
7961
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 5772
diff changeset
    83
	(void) smb_getsamaccount(ipc_info.user, SMB_USERNAME_MAXLEN);
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    84
	rc = smbrdr_get_machine_pwd_hash(ipc_info.passwd);
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    85
	if (rc != 0)
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    86
		*ipc_info.passwd = 0;
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    87
	(void) rw_unlock(&smbrdr_ipc_lock);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    88
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    89
}
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    90
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    91
/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    92
 * smbrdr_ipc_set
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    93
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    94
 * The given username and password hash will be applied to the
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    95
 * ipc_info, which will be used for setting up the authenticated IPC
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    96
 * channel during join domain.
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
    97
 *
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    98
 * If domain join operation succeeds, smbrdr_ipc_commit() should be
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
    99
 * invoked to set the ipc_info with host credentials. Otherwise,
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   100
 * smbrdr_ipc_rollback() should be called to restore the previous
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   101
 * credentials.
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   102
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   103
void
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   104
smbrdr_ipc_set(char *plain_user, unsigned char *passwd_hash)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   105
{
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   106
	(void) rw_wrlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   107
	(void) strlcpy(ipc_info.user, plain_user, sizeof (ipc_info.user));
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   108
	(void) memcpy(ipc_info.passwd, passwd_hash, SMBAUTH_HASH_SZ);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   109
	(void) rw_unlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   110
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   111
}
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   112
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   113
/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   114
 * smbrdr_ipc_commit
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   115
 *
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   116
 * Save the host credentials, which will be used for any authenticated
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   117
 * IPC channel establishment after domain join.
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   118
 *
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   119
 * The host credentials is also saved to the original IPC info as
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   120
 * rollback data in case the join domain process fails in the future.
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   121
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   122
void
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   123
smbrdr_ipc_commit()
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   124
{
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   125
	(void) rw_wrlock(&smbrdr_ipc_lock);
7961
4b5e3051f38b 6751647 TRANS2_FIND_NEXT continuation by filename restarts search at beginning of directory
natalie li - Sun Microsystems - Irvine United States <Natalie.Li@Sun.COM>
parents: 5772
diff changeset
   126
	(void) smb_getsamaccount(ipc_info.user, SMB_USERNAME_MAXLEN);
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   127
	(void) smbrdr_get_machine_pwd_hash(ipc_info.passwd);
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   128
	(void) memcpy(&orig_ipc_info, &ipc_info, sizeof (smbrdr_ipc_t));
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   129
	(void) rw_unlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   130
}
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   131
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   132
/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   133
 * smbrdr_ipc_rollback
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   134
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   135
 * Restore the original credentials
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   136
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   137
void
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   138
smbrdr_ipc_rollback()
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   139
{
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   140
	(void) rw_wrlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   141
	(void) strlcpy(ipc_info.user, orig_ipc_info.user,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   142
	    sizeof (ipc_info.user));
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   143
	(void) memcpy(ipc_info.passwd, orig_ipc_info.passwd,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   144
	    sizeof (ipc_info.passwd));
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   145
	(void) rw_unlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   146
}
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   147
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   148
/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   149
 * Get & Set functions
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   150
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   151
char *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   152
smbrdr_ipc_get_user()
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   153
{
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   154
	char	*user;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   155
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   156
	(void) rw_rdlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   157
	user = ipc_info.user;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   158
	(void) rw_unlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   159
	return (user);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   160
}
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   161
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   162
unsigned char *
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   163
smbrdr_ipc_get_passwd()
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   164
{
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   165
	unsigned char	*passwd;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   166
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   167
	(void) rw_rdlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   168
	passwd = ipc_info.passwd;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   169
	(void) rw_unlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   170
	return (passwd);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   171
}
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   172
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   173
/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   174
 * smbrdr_ipc_skip_lsa_query
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   175
 *
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   176
 * Determine whether LSA monitor should skip the LSA query due to the
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   177
 * incomplete authentication information if IPC is configured to be
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   178
 * authenticated.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   179
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   180
int
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   181
smbrdr_ipc_skip_lsa_query()
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   182
{
5521
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   183
	char *user;
cf62335046cd 6575640 rename/rmdir/remove on mixed file systems work incorrectly for mangled names
as200622
parents: 5331
diff changeset
   184
	unsigned char *pwd;
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   185
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   186
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   187
	(void) rw_rdlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   188
	user = ipc_info.user;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   189
	pwd = ipc_info.passwd;
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   190
	(void) rw_unlock(&smbrdr_ipc_lock);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   191
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   192
	return (!(*user && *pwd));
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents:
diff changeset
   193
}