zfs_acl_chmod_inherit_004_pos.ksh revision d583b39bfb4e2571d3e41097c5c357ffe353ad45
#
# 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 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Copyright (c) 2012 by Delphix. All rights reserved.
#
#
# DESCRIPTION:
# Verify aclinherit=passthrough-x will inherit the 'x' bits while mode request.
#
# STRATEGY:
# 1. Loop super user and non-super user to run the test case.
# 2. Create basedir and a set of subdirectores and files within it.
# 3. Set aclinherit=passthrough-x
# 4. Verify only passthrough-x will inherit the 'x' bits while mode request.
#
verify_runnable "both"
function cleanup
{
if [[ -d $basedir ]]; then
fi
}
if (($? != 0)); then
log_unsupported "passthrough-x aclinherit not supported."
fi
log_assert "Verify aclinherit=passthrough-x will inherit the 'x' bits while" \
" mode request."
set -A aces \
"owner@:read_data/write_data/add_subdirectory/append_data/execute:dir_inherit/inherit_only:allow" \
"owner@:read_data/write_data/add_subdirectory/append_data/execute::allow" \
"group@:add_subdirectory/append_data/execute:dir_inherit/inherit_only:allow" \
"group@:add_subdirectory/append_data/execute::allow" \
"everyone@:add_subdirectory/append_data/execute:dir_inherit/inherit_only:allow" \
"everyone@:add_subdirectory/append_data/execute::allow" \
"owner@:read_data/write_data/add_subdirectory/append_data/execute:file_inherit/inherit_only:allow" \
"group@:read_data/add_subdirectory/append_data/execute:file_inherit/inherit_only:allow" \
"everyone@:read_data/add_subdirectory/append_data/execute:file_inherit/inherit_only:allow"
# Defile the based directory and file
#
# According to inherited flag, verify subdirectories and files within it has
# correct inherited access control.
#
function verify_inherit # <object>
{
typeset obj=$1
# Define the files and directories will be created after chmod
typeset -i i=0
while ((i < ${#aces[*]})); do
if ((i < 3)); then
else
fi
((i = i + 1))
done
#include <stdlib.h>
#include <stdio.h>
int main()
{ return 0; }
EOF
fi
fi
fi
fi
}
#
# Set aclmode=passthrough to make sure
# the acl will not change during chmod.
# A general testing should verify the combination of
# aclmode/aclinherit works well,
# here we just simple test them separately.
#
for user in root $ZFS_ACL_STAFF1; do
done
log_pass "Verify aclinherit=passthrough-x will inherit the 'x' bits while mode request."