acl.y revision 5a5eeccada4b11bc692e9a5015d5f4a4f188226c
%{
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <aclutils.h>
extern int yyinteractive;
%}
%union {
char *str;
int val;
struct acl_perm_type acl_perm;
}
%%
{
yyacl = $1;
return (0);
}
/* This seems illegal, but the old aclfromtext() allows it */
{
yyacl = $1;
return (0);
}
{
yyacl = $1;
return (0);
}
{
return (EACL_MEM_ERROR);
}
$$ = yyacl;
return (EACL_DIFF_TYPE);
}
return (EACL_MEM_ERROR);
}
$$->acl_cnt++;
}
| aclent
{
return (EACL_MEM_ERROR);
}
$$ = yyacl;
" with POSIX draft ACL entries\n"));
return (EACL_DIFF_TYPE);
}
return (EACL_MEM_ERROR);
}
$$->acl_cnt++;
}
{
int error;
int id;
int mask;
if (error) {
free($2);
return (EACL_INVALID_USER_GROUP);
}
free($2);
if (error)
return (error);
$$.a_type = $4;
}
{
int error;
int id;
if (yyinteractive) {
"ACL specification\n"));
return (EACL_UNKNOWN_DATA);
}
if (error) {
$$.a_who = $6;
} else {
}
free($2);
if (error)
return (error);
$$.a_type = $4;
}
{
int error;
int id;
if (error) {
free($2);
return (EACL_INVALID_USER_GROUP);
}
free($2);
if (error)
return (error);
$$.a_type = $5;
$$.a_flags |= $4;
}
{
int error;
int id;
if (yyinteractive) {
"ACL specification\n"));
return (EACL_UNKNOWN_DATA);
}
if (error) {
$$.a_who = $7;
} else {
}
free($2);
if (error)
return (error);
$$.a_type = $5;
$$.a_flags |= $4;
}
{
int error;
$$.a_who = -1;
if (error) {
return (error);
}
$$.a_type = $3;
}
{
if (yyinteractive) {
"ACL specification\n"));
return (EACL_UNKNOWN_DATA);
}
return (EACL_ENTRY_ERROR);
}
{
int error;
$$.a_who = -1;
if (error)
return (error);
$$.a_type = $4;
$$.a_flags |= $3;
}
{
if (yyinteractive) {
"ACL specification\n"));
return (EACL_UNKNOWN_DATA);
}
return (EACL_ENTRY_ERROR);
}
{
int error;
int id;
if (error) {
$2);
free($2);
return (EACL_INVALID_USER_GROUP);
}
if (error) {
free($2);
"Invalid permission(s) '%s' specified\n"),
$3.perm_str);
return (error);
}
free($2);
if (error) {
gettext("Invalid ACL entry type '%s' specified\n"),
$1);
return (error);
}
}
{
int error;
if (error) {
"Invalid permission(s) '%s' specified\n"),
$3.perm_str);
return (error);
}
$$.a_id = -1;
if (error) {
gettext("Invalid ACL entry type '%s' specified\n"),
$1);
return (error);
}
}
{
if (yyinteractive) {
"ACL specification\n"));
return (EACL_UNKNOWN_DATA);
}
return (EACL_ENTRY_ERROR);
}
{
int error;
int id;
if (yyinteractive) {
"ACL specification\n"));
return (EACL_UNKNOWN_DATA);
}
if (error) {
free($2);
"Invalid permission(s) '%s' specified\n"),
$3.perm_str);
return (error);
}
if (error)
$$.a_id = $5;
else
free($2);
if (error) {
gettext("Invalid ACL entry type '%s' specified\n"),
$1);
return (error);
}
}
{
int error;
if (error) {
"Invalid permission(s) '%s' specified\n"),
$2.perm_str);
return (error);
}
$$.a_id = -1;
if (error) {
gettext("Invalid ACL entry type specified %d\n"),
error);
return (error);
}
}
{
if (yyinteractive) {
"ACL specification\n"));
return (EACL_UNKNOWN_DATA);
}
return (EACL_ENTRY_ERROR);
}
| COLON {$$ = 0;}
{
int error;
if (error) {
"'%s' specified\n"), $1);
free($1);
return (error);
}
$$ = iflags;
}
{
" verbose inheritance flags\n"));
return (EACL_INHERIT_ERROR);
}
{
" compact inheritance flags\n"));
return (EACL_INHERIT_ERROR);
}
{
$$.perm_style = PERM_TYPE_UNKNOWN;
$$.perm_str = $1;
$$.perm_val = 0;
}
{
"specified\n"));
return ($2);
}
| ERROR {return ($1);}
| ERROR {return ($1);}
| ERROR {return ($1);}
{
$$.perm_style = PERM_TYPE_ACE;
$$.perm_val |= $1;
}
{
$$.perm_style = PERM_TYPE_ACE;
}
{
" compact permission\n"));
return (EACL_PERM_MASK_ERROR);
}
| ERROR {return ($1);}