Print this page
NEX-19025 CIFS gets confused with filenames containing enhanced Unicode
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
and: (fix build, check-rtime)
NEX-4458 Incorrect directory listing response for non-UNICODE clients
Reviewed by: Matt Barden <Matt.Barden@nexenta.com>
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
re #6854 FindFirstFile,FindFirstFileEx,... are not working correctly on Nexenta CIFS-shares

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/smbsrv/string.h
          +++ new/usr/src/uts/common/smbsrv/string.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23      - * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
       23 + * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
  24   24   * Copyright (c) 2017 by Delphix. All rights reserved.
  25   25   */
  26   26  
  27   27  #ifndef _SMBSRV_STRING_H
  28   28  #define _SMBSRV_STRING_H
  29   29  
  30   30  #include <sys/types.h>
  31   31  
  32   32  #ifdef __cplusplus
  33   33  extern "C" {
↓ open down ↓ 44 lines elided ↑ open up ↑
  78   78          OEM_CPG_866,
  79   79          OEM_CPG_1255,
  80   80          OEM_CPG_862,
  81   81          OEM_CPG_1256,
  82   82          OEM_CPG_720
  83   83  } codepage_id_t;
  84   84  
  85   85  /*
  86   86   * Maximum number of bytes per multi-byte character.
  87   87   */
  88      -#define MTS_MB_CUR_MAX          3
       88 +#define MTS_MB_CUR_MAX          4
  89   89  #define MTS_MB_CHAR_MAX         MTS_MB_CUR_MAX
  90   90  
  91   91  typedef uint16_t smb_wchar_t;
  92   92  
  93   93  /*
  94   94   * Labels to define whether a code page table entry is an uppercase
  95   95   * character, a lowercase character or neither. One of these values
  96   96   * should appear in the ctype field of the code page tables.
  97   97   */
  98   98  #define CODEPAGE_ISNONE         0x00
↓ open down ↓ 12 lines elided ↑ open up ↑
 111  111          unsigned char ctype;
 112  112          smb_wchar_t upper;
 113  113          smb_wchar_t lower;
 114  114  } smb_codepage_t;
 115  115  
 116  116  void smb_codepage_init(void);
 117  117  void smb_codepage_fini(void);
 118  118  
 119  119  int smb_isupper(int);
 120  120  int smb_islower(int);
 121      -int smb_toupper(int);
 122      -int smb_tolower(int);
      121 +uint32_t smb_toupper(uint32_t);
      122 +uint32_t smb_tolower(uint32_t);
 123  123  char *smb_strupr(char *);
 124  124  char *smb_strlwr(char *);
 125  125  int smb_isstrupr(const char *);
 126  126  int smb_isstrlwr(const char *);
 127  127  int smb_strcasecmp(const char *, const char *, size_t);
 128  128  
 129  129  boolean_t smb_match(const char *, const char *, boolean_t);
 130  130  
 131  131  size_t smb_mbstowcs(smb_wchar_t *, const char *, size_t);
 132  132  size_t smb_wcstombs(char *, const smb_wchar_t *, size_t);
 133      -int smb_mbtowc(smb_wchar_t *, const char *, size_t);
 134      -int smb_wctomb(char *, smb_wchar_t);
      133 +int smb_mbtowc(uint32_t *, const char *, size_t);
      134 +int smb_wctomb(char *, uint32_t);
 135  135  
 136  136  size_t smb_wcequiv_strlen(const char *);
 137  137  size_t smb_sbequiv_strlen(const char *);
 138  138  
 139      -int smb_stombs(char *, char *, int);
 140      -int smb_mbstos(char *, const char *);
      139 +int smb_oemtombs(char *, const uint8_t *, int);
      140 +int smb_mbstooem(uint8_t *, const char *, int);
 141  141  
 142  142  size_t ucstooem(char *, const smb_wchar_t *, size_t, uint32_t);
 143  143  size_t oemtoucs(smb_wchar_t *, const char *, size_t, uint32_t);
 144  144  
 145  145  char *strsubst(char *, char, char);
 146  146  char *strsep(char **, const char *);
 147  147  char *strcanon(char *, const char *);
 148  148  
 149  149  typedef struct smb_unc {
 150  150          char             *unc_server;
↓ open down ↓ 13 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX