#
# 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) 2016 by Delphix. All rights reserved.
#
#
# DESCRIPTION:
# Verify chmod have correct behaviour to directory and file when setting
# different inherit strategy to them.
#
# 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. Separately chmod basedir with different inherite options.
# 4. Then create nested directories and files like the following.
#
# _ odir4
# |_ ofile4
# _ odir3 _|
# |_ ofile3
# _ odir1 _|
# |_ ofile2
# basefile |
# chmod --> basedir -|
# |_ nfile1
# |_ ndir1 _
# |_ nfile2
# |_ ndir2 _
# |_ nfile3
# |_ ndir3
#
# 5. Verify each directories and files have the correct access control
# capability.
#
verify_runnable "both"
function cleanup
{
if [[ -f $basefile ]]; then
fi
if [[ -d $basedir ]]; then
fi
}
log_assert "Verify chmod have correct behaviour to directory and file when " \
"setting different inherit strategies to them."
# Define inherit flag
# Defile the based directory and file
# Define the existed files and directories before chmod
# Define the files and directories will be created after chmod
# Verify all the node have expected correct access control
#
# According to inherited flag, verify subdirectories and files within it has
# correct inherited access control.
#
{
# Define the nodes which will be affected by inherit.
typeset inherit_nodes
typeset obj=$1
typeset str=$2
# Except for inherit_only, the basedir was affected always.
fi
# Get the files which inherited ACE.
fi
fi
# Get the directores which inherited ACE.
fi
fi
else
fi
done
}
(( ${#str} != 0 )) && inh_opt=$inh_opt/$str
aclspec="A+user:$ZFS_ACL_OTHER1:read_acl:$inh_opt:deny"
#
# Inherit flag can only be placed on a directory,
# otherwise it will fail.
#
#
# Place on a directory should succeed.
#
done
done
done
log_pass "Verify chmod inherit behaviour passed."