acl_api.c revision 02d09e03eb27f3a2dc299de704e45dae5173f43f
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * CDDL HEADER START
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * The contents of this file are subject to the terms of the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Common Development and Distribution License (the "License").
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * You may not use this file except in compliance with the License.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * or http://www.opensolaris.org/os/licensing.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * See the License for the specific language governing permissions
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * and limitations under the License.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * When distributing Covered Code, include this CDDL HEADER in each
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * If applicable, add the following below this CDDL HEADER, with the
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * fields enclosed by brackets "[]" replaced with your own identifying
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * information: Portions Copyright [yyyy] [name of copyright owner]
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * CDDL HEADER END
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Use is subject to license terms.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * ACL API for smbfs
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy/* Sanity check SD sizes */
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Get/set a Windows security descriptor (SD)
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * using the (private) smbfs ioctl mechanism.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * Note: Get allocates mbp->mb_top
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedysmbfs_acl_iocget(int fd, uint32_t selector, mbdata_t *mbp)
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy * This does the OTW Get.
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy if (ioctl(fd, SMBFSIO_GETSD, &iocb) < 0) {
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedysmbfs_acl_iocset(int fd, uint32_t selector, mbdata_t *mbp)
f38cb554a534c6df738be3f4d23327e69888e634John Wren Kennedy /* Make the data contiguous. */
if (error)
return (error);
return (error);
int error;
if (error == 0) {
return (error);
int error;
if (error)
return (error);
if (error == 0) {
return (error);
int error;
selector = 0;
if (aclp)
if (uidp)
if (gidp)
if (selector == 0)
if (error)
return (error);
if (aclp) {
goto out;
if (error)
goto out;
if (aclp) {
out:
if (acl)
return (error);
int error;
selector = 0;
if (acl)
if (selector == 0)
return (EINVAL);
if (error == 0)
return (error);