usr/src/uts/common/fs/smbsrv/smb_trans2_query_path_info.c
changeset 7961 4b5e3051f38b
parent 7348 73b61202d5d6
child 8934 8ff6afa44187
equal deleted inserted replaced
7960:dab1829da853 7961:4b5e3051f38b
    21 /*
    21 /*
    22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
    22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
    23  * Use is subject to license terms.
    23  * Use is subject to license terms.
    24  */
    24  */
    25 
    25 
    26 #pragma ident	"@(#)smb_trans2_query_path_info.c	1.9	08/07/24 SMI"
       
    27 
    26 
    28 /*
    27 /*
    29  * SMB: trans2_query_path_information
    28  * SMB: trans2_query_path_information
    30  *
    29  *
    31  * This request is used to get information about a specific file or
    30  * This request is used to get information about a specific file or
    63  *  SMB_QUERY_FILE_NAME_INFO         0x104
    62  *  SMB_QUERY_FILE_NAME_INFO         0x104
    64  *  SMB_QUERY_FILE_ALL_INFO          0x107
    63  *  SMB_QUERY_FILE_ALL_INFO          0x107
    65  *  SMB_QUERY_FILE_ALT_NAME_INFO     0x108
    64  *  SMB_QUERY_FILE_ALT_NAME_INFO     0x108
    66  *  SMB_QUERY_FILE_STREAM_INFO       0x109
    65  *  SMB_QUERY_FILE_STREAM_INFO       0x109
    67  *  SMB_QUERY_FILE_COMPRESSION_INFO  0x10B
    66  *  SMB_QUERY_FILE_COMPRESSION_INFO  0x10B
       
    67  *  SMB_FILE_INTERNAL_INFORMATION    1006
    68  *
    68  *
    69  * The requested information is placed in the Data portion of the
    69  * The requested information is placed in the Data portion of the
    70  * transaction response.  For the information levels greater than 0x100,
    70  * transaction response.  For the information levels greater than 0x100,
    71  * the transaction response has 1 parameter word which should be ignored by
    71  * the transaction response has 1 parameter word which should be ignored by
    72  * the client.
    72  * the client.
   550 			    name, short_name, name83, 0);
   550 			    name, short_name, name83, 0);
   551 		}
   551 		}
   552 		alt_nm_ptr = ((*short_name == 0) ?
   552 		alt_nm_ptr = ((*short_name == 0) ?
   553 		    utf8_strupr(name) : short_name);
   553 		    utf8_strupr(name) : short_name);
   554 		(void) smb_mbc_encodef(&xa->rep_param_mb, "w", 0);
   554 		(void) smb_mbc_encodef(&xa->rep_param_mb, "w", 0);
   555 		(void) smb_mbc_encodef(&xa->rep_data_mb, "%lu", sr,
   555 		(void) smb_mbc_encodef(&xa->rep_data_mb, "%lU", sr,
   556 		    smb_ascii_or_unicode_strlen(sr, alt_nm_ptr), alt_nm_ptr);
   556 		    mts_wcequiv_strlen(alt_nm_ptr), alt_nm_ptr);
   557 		break;
   557 		break;
   558 
   558 
   559 	case SMB_QUERY_FILE_STREAM_INFO:
   559 	case SMB_QUERY_FILE_STREAM_INFO:
   560 		(void) smb_mbc_encodef(&xa->rep_param_mb, "w", 0);
   560 		(void) smb_mbc_encodef(&xa->rep_param_mb, "w", 0);
   561 		smb_encode_stream_info(sr, xa, node, ap);
   561 		smb_encode_stream_info(sr, xa, node, ap);
   563 
   563 
   564 	case SMB_QUERY_FILE_COMPRESSION_INFO:
   564 	case SMB_QUERY_FILE_COMPRESSION_INFO:
   565 		(void) smb_mbc_encodef(&xa->rep_param_mb, "w", 0);
   565 		(void) smb_mbc_encodef(&xa->rep_param_mb, "w", 0);
   566 		(void) smb_mbc_encodef(&xa->rep_data_mb,
   566 		(void) smb_mbc_encodef(&xa->rep_data_mb,
   567 		    "qwbbb3.", datasz, 0, 0, 0, 0);
   567 		    "qwbbb3.", datasz, 0, 0, 0, 0);
       
   568 		break;
       
   569 
       
   570 	case SMB_FILE_INTERNAL_INFORMATION:
       
   571 		(void) smb_mbc_encodef(&xa->rep_param_mb, "w", 0);
       
   572 		(void) smb_mbc_encodef(&xa->rep_data_mb, "q",
       
   573 		    ap->sa_vattr.va_nodeid);
   568 		break;
   574 		break;
   569 
   575 
   570 	default:
   576 	default:
   571 		smb_node_release(node);
   577 		smb_node_release(node);
   572 		kmem_free(name, MAXNAMELEN);
   578 		kmem_free(name, MAXNAMELEN);