# Verify that mkdir's `-m MODE' option works properly
# with various umask settings.
-# Copyright (C) 2000, 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002-2009 Free Software Foundation, Inc.
# 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
mkdir $p $mode parent/sub || fail=1
- perms=`ls -ld parent | sed 's/ .*//; s/+$//'`
+ perms=$(stat --printf %A parent)
test "$parent_perms" = "$perms" \
|| { fail=1; echo parent: expected $parent_perms, got $perms; }
- perms=`ls -ld parent/sub | sed 's/ .*//; s/+$//'`
+ perms=$(stat --printf %A parent/sub)
test "$sub_perms" = "$perms" \
|| { fail=1; echo parent/sub: expected $sub_perms, got $perms; }
case $rwx in
[ld-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxtT-]) ;;
- [ld-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxtT-]+) ;;
+ [ld-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxsS-][rwx-][rwx-][rwxtT-][+.]) ;;
*) echo "$0: invalid mode string: $rwx" 1>&2; return;;
esac