mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Tests from UDFQA ported to FSQA.
simple attr tests for EAs.
This commit is contained in:
+46
-32
@@ -1,37 +1,24 @@
|
||||
##/bin/sh
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of version 2 of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# Further, this software is distributed without any warranty that it is
|
||||
# free of the rightful claim of any third person regarding infringement
|
||||
# or the like. Any license provided herein, whether implied or
|
||||
# otherwise, applies only to this software file. Patent licenses, if
|
||||
# any, provided herein do not apply to combinations of this program with
|
||||
# other software, or any other product whatsoever.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write the Free Software Foundation, Inc., 59
|
||||
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
|
||||
#
|
||||
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
|
||||
# Mountain View, CA 94043, or:
|
||||
#
|
||||
# http://www.sgi.com
|
||||
#
|
||||
# For further information regarding this notice, see:
|
||||
#
|
||||
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
# USA
|
||||
#
|
||||
# Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
|
||||
# Mountain View, CA 94043, USA, or: http://www.sgi.com
|
||||
#-----------------------------------------------------------------------
|
||||
# common extended attribute and ACL support
|
||||
|
||||
# pick three unused user/group ids, store them as $acl[1-3]
|
||||
@@ -80,7 +67,7 @@ _acl_list()
|
||||
_file1=$1
|
||||
|
||||
if [ $HOSTOS = "IRIX" ]; then
|
||||
ls -D $_file1 | _acl_filter_id
|
||||
ls -dD $_file1 | _acl_filter_id
|
||||
else
|
||||
chacl -l $_file1 | _acl_filter_id
|
||||
fi
|
||||
@@ -137,5 +124,32 @@ _acl_requirements()
|
||||
fi
|
||||
}
|
||||
|
||||
# filter user ace names to user ids
|
||||
#
|
||||
_filter_aces()
|
||||
{
|
||||
tr '\[' '\012' |\
|
||||
tr ']' '\012' |\
|
||||
tr ',' '\012' |\
|
||||
$AWK_PROG '
|
||||
BEGIN {
|
||||
FS=":"
|
||||
while ( getline <"/etc/passwd" > 0 ) {
|
||||
idlist[$1] = $3
|
||||
}
|
||||
}
|
||||
/^u/ { if ($2 in idlist) sub($2, idlist[$2]); print; next}
|
||||
{print}
|
||||
' |\
|
||||
sed -e 's/u:/user:/' -e 's/g:/group:/' -e 's/o:/other:/' -e 's/m:/mask:/'
|
||||
}
|
||||
|
||||
_list_acl()
|
||||
{
|
||||
file=$1
|
||||
|
||||
ls -dD $file | _acl_filter_id
|
||||
}
|
||||
|
||||
# make sure this script returns success
|
||||
/bin/true
|
||||
|
||||
Reference in New Issue
Block a user