Print this page
NEX-18462 SMB can't view ACL if posix ID can't be mapped
Review by: Gordon Ross <gordon.ross@nexenta.com>
Review by: Evan Layton <evan.layton@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/idmap/idmap_kapi.c
          +++ new/usr/src/uts/common/idmap/idmap_kapi.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  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  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + *
       26 + * Copyright 2018 Nexenta Systems, Inc.
  25   27   */
  26   28  
  27   29  /*
  28   30   * Windows to Solaris Identity Mapping kernel API
  29   31   * This module provides an API to map Windows SIDs to
  30   32   * Solaris UID and GIDs.
  31   33   */
  32   34  
  33   35  
  34   36  #include <sys/types.h>
↓ open down ↓ 1265 lines elided ↑ open up ↑
1300 1302  
1301 1303                  case IDMAP_SID:
1302 1304                  case IDMAP_USID:
1303 1305                  case IDMAP_GSID:
1304 1306                          sid_prefix = kidmap_find_sid_prefix(
1305 1307                              id->idmap_id_u.sid.prefix);
1306 1308                          if (result->sid_prefix && result->rid) {
1307 1309                                  *result->sid_prefix = sid_prefix;
1308 1310                                  *result->rid = id->idmap_id_u.sid.rid;
1309 1311                          }
     1312 +                        if (*result->stat == IDMAP_ERR_NOTFOUND &&
     1313 +                            sid_prefix != NULL) {
     1314 +                                /* IDMAP generated a local SID. Use it. */
     1315 +                                *result->stat = IDMAP_SUCCESS;
     1316 +                        }
     1317 +
1310 1318                          if (*result->stat == IDMAP_SUCCESS &&
1311 1319                              request->id1.idtype == IDMAP_UID)
1312 1320                                  kidmap_cache_add_sid2uid(
1313 1321                                      cache, sid_prefix,
1314 1322                                      id->idmap_id_u.sid.rid,
1315 1323                                      request->id1.idmap_id_u.uid,
1316 1324                                      direction);
1317 1325                          else if (*result->stat == IDMAP_SUCCESS &&
1318 1326                              request->id1.idtype == IDMAP_GID)
1319 1327                                  kidmap_cache_add_sid2gid(
↓ open down ↓ 187 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX