#
# 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 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Copyright (c) 2016 by Delphix. All rights reserved.
#
#
# DESCRIPTION:
#
# STRATEGY:
# 1. Create file and directory in zfs filesystem
# 2. Set special ACE to the file and directory
#
verify_runnable "both"
function cleanup
{
(( ${#cwd} != 0 )) && cd $cwd
(( ${#mask} != 0 )) && log_must umask $mask
}
function testing_mv #<flag for file|dir> <file1|dir1> <file2|dir2>
{
typeset flag=$1
set -A obj $2 $3
typeset -i i=0
typeset orig_acl=""
typeset orig_mode=""
typeset dst_acl=""
typeset dst_mode=""
while (( i < ${#obj[*]} ))
do
if (( i < 1 )); then
else
fi
log_fail "mv fails to keep the acl for file."
fi
(( i = i + 1 ))
done
else
while (( i < ${#obj[*]} ))
do
typeset orig_nested_acl=""
typeset orig_nested_mode=""
typeset dst_nested_acl=""
typeset dst_nested_mode=""
orig_nested_acl=$(get_acl ${obj[i]}/$nestedfile)
orig_nested_mode=$(get_mode ${obj[i]}/$nestedfile)
if (( i < 1 )); then
else
$TESTDIR1/${obj[i]}/$nestedfile)
$TESTDIR1/${obj[i]}/$nestedfile)
fi
"directory."
fi
(( i = i + 1 ))
done
fi
}
log_assert "Verify that 'mv' supports ZFS ACLs."
spec_ace="everyone@:execute:allow"
set -A orig_file "origfile1.$$" "origfile2.$$"
set -A orig_dir "origdir1.$$" "origdir2.$$"
nestedfile="nestedfile.$$"
mask=`umask`
umask 0022
#
# This assertion should only test 'mv' within the same filesystem
#
[[ ! -d $TESTDIR1 ]] && \
log_note "Create files and directories and set special ace on them for testing. "
cd $TESTDIR
typeset -i i=0
while (( i < ${#orig_file[*]} ))
do
(( i = i + 1 ))
done
i=0
while (( i < ${#orig_dir[*]} ))
do
log_must touch ${orig_dir[i]}/$nestedfile
for obj in ${orig_dir[i]} ${orig_dir[i]}/$nestedfile; do
done
(( i = i + 1 ))
done
log_pass "'mv' succeeds to support ZFS ACLs."