diff options
author | mm <mm@FreeBSD.org> | 2010-07-22 23:30:24 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2010-07-22 23:30:24 +0000 |
commit | db407a02da63b59d3fd78135076c38541d36d751 (patch) | |
tree | 79204465759cc7e3d317ad501d1b07dc6bc344ff /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c | |
parent | 1ac6286cc1262c7b3da9e7a6759f6bf6fbe447ad (diff) | |
download | FreeBSD-src-db407a02da63b59d3fd78135076c38541d36d751.zip FreeBSD-src-db407a02da63b59d3fd78135076c38541d36d751.tar.gz |
Enable fake resolving of SMB RIDs by using nulldomain and UID_NOBODY
- fixes panics when Solaris/OpenSolaris pools that contain files
uploaded with the SMB protocol are accessed
Enable seting/unsetting the sharesmb property (dummy action)
- allows users who import pools from Solaris/Opensolaris to unset
the sharesmb property and get rid of annoying messages
PR: kern/145778, kern/148709
Approved by: pjd, delphij (mentor)
MFC after: 7 weeks
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c index 4d5b194..8090ec1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c @@ -410,7 +410,7 @@ zfs_fuid_map_id(zfsvfs_t *zfsvfs, uint64_t fuid, domain = zfs_fuid_find_by_idx(zfsvfs, index); ASSERT(domain != NULL); -#ifdef TODO +#ifdef sun if (type == ZFS_OWNER || type == ZFS_ACE_USER) { (void) kidmap_getuidbysid(crgetzone(cr), domain, FUID_RID(fuid), &id); @@ -418,9 +418,9 @@ zfs_fuid_map_id(zfsvfs_t *zfsvfs, uint64_t fuid, (void) kidmap_getgidbysid(crgetzone(cr), domain, FUID_RID(fuid), &id); } -#else - panic(__func__); -#endif +#else /* sun */ + id = UID_NOBODY; +#endif /* sun */ return (id); } @@ -514,21 +514,21 @@ zfs_fuid_create_cred(zfsvfs_t *zfsvfs, zfs_fuid_type_t type, if (!zfsvfs->z_use_fuids || !IS_EPHEMERAL(id)) return ((uint64_t)id); -#ifdef TODO +#ifdef sun ksid = crgetsid(cr, (type == ZFS_OWNER) ? KSID_OWNER : KSID_GROUP); VERIFY(ksid != NULL); rid = ksid_getrid(ksid); domain = ksid_getdomain(ksid); - +#else /* sun */ + rid = UID_NOBODY; + domain = nulldomain; +#endif /* sun */ idx = zfs_fuid_find_by_domain(zfsvfs, domain, &kdomain, B_TRUE); zfs_fuid_node_add(fuidp, kdomain, rid, idx, id, type); return (FUID_ENCODE(idx, rid)); -#else - panic(__func__); -#endif } /* @@ -597,7 +597,7 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64_t id, cred_t *cr, }; domain = fuidp->z_domain_table[idx -1]; } else { -#ifdef TODO +#ifdef sun if (type == ZFS_OWNER || type == ZFS_ACE_USER) status = kidmap_getsidbyuid(crgetzone(cr), id, &domain, &rid); @@ -606,6 +606,7 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64_t id, cred_t *cr, &domain, &rid); if (status != 0) { +#endif /* sun */ /* * When returning nobody we will need to * make a dummy fuid table entry for logging @@ -613,10 +614,9 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64_t id, cred_t *cr, */ rid = UID_NOBODY; domain = nulldomain; +#ifdef sun } -#else - panic(__func__); -#endif +#endif /* sun */ } idx = zfs_fuid_find_by_domain(zfsvfs, domain, &kdomain, B_TRUE); |