/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* ACL API for smbfs
*/
#include <sys/byteorder.h>
#include <errno.h>
#include <stdio.h>
#include <strings.h>
#include <unistd.h>
#include <umem.h>
#include <idmap.h>
#include <netsmb/smbfs_acl.h>
#include "smbfs_ntacl.h"
#include "private.h"
/* Sanity check SD sizes */
/* XXX: acl_common.h */
/*
* using the (private) smbfs ioctl mechanism.
* Note: Get allocates mbp->mb_top
*/
/* ARGSUSED */
int
{
struct mbuf *m;
int error;
if (error)
return (error);
/*
* This does the OTW Get.
*/
goto errout;
}
return (0);
return (error);
}
/* ARGSUSED */
int
{
struct mbuf *m;
int error;
/* Make the data contiguous. */
if (error)
return (error);
/*
* This does the OTW Set.
*/
return (error);
}
/*
* Get an NT SD from the open file via ioctl.
*/
int
{
int error;
/*
* Get the raw Windows SD via ioctl.
* Returns allocated mbchain in mbp.
*/
if (error == 0) {
/*
* Import the raw SD into "internal" form.
* (like "absolute" form per. NT docs)
* Returns allocated data in sdp
*/
}
return (error);
}
/*
* Set an NT SD onto the open file via ioctl.
*/
int
{
int error;
if (error)
return (error);
/*
* Export the "internal" SD into an mb chain.
* (a.k.a "self-relative" form per. NT docs)
* Returns allocated mbchain in mbp.
*/
if (error == 0) {
/*
* Set the raw Windows SD via ioctl.
*/
}
return (error);
}
/*
* Convenience function to Get security using a
* ZFS-style ACL (libsec acl, type=ACE_T)
* Intentionally similar to: facl_get(3SEC)
*/
int
{
int error;
/*
* Which parts of the SD are being requested?
* XXX: Should we request the SACL too? If so,
* might that cause this access to be denied?
* Or maybe: if we get access denied, try the
*/
selector = 0;
if (aclp)
if (uidp)
if (gidp)
if (selector == 0)
return (0);
/*
* Get the Windows SD via ioctl, in
* "internal" (absolute) form.
*/
if (error)
return (error);
/* Note: sd now holds allocated data. */
/*
* Convert the internal SD to a ZFS ACL.
*/
if (aclp) {
goto out;
}
}
if (error)
goto out;
/* Success! */
if (aclp) {
}
out:
if (acl)
return (error);
}
/*
* Convenience function to Set security using a
* ZFS-style ACL (libsec acl, type=ACE_T)
* Intentionally similar to: facl_set(3SEC)
*/
int
{
int error;
return (EINVAL);
/*
* Which parts of the SD are being modified?
* XXX: Ditto comments above re. SACL.
*/
selector = 0;
if (acl)
if (selector == 0)
return (0);
/*
* If not setting owner or group, we need the
* current owner and group for translating
* references via owner@ or group@ ACEs.
*/
return (errno);
}
/*
* Convert the ZFS ACL to an internal SD.
* Returns allocated data in sd
*/
if (error == 0)
return (error);
}