From 4156b9e2b3b72c3050f9f9af2851980743b5cb16 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 30 Aug 2009 17:36:32 +0200 Subject: [PATCH] Work around deficient /usr/bin/id program on Solaris. --- ChangeLog | 8 ++++++++ tests/test-copy-acl.sh | 10 ++++++++-- tests/test-copy-file.sh | 10 ++++++++-- tests/test-file-has-acl.sh | 10 ++++++++-- tests/test-set-mode-acl.sh | 10 ++++++++-- 5 files changed, 40 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31aff13160..17549e271f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-08-30 Bruno Haible + + Work around deficient /usr/bin/id program on Solaris. + * tests/test-file-has-acl.sh (ID): New variable. + * tests/test-set-mode-acl.sh (ID): Likewise. + * tests/test-copy-acl.sh (ID): Likewise. + * tests/test-copy-file.sh (ID): Likewise. + 2009-08-30 Bruno Haible New module 'xstriconveh'. diff --git a/tests/test-copy-acl.sh b/tests/test-copy-acl.sh index 9e20e77cd2..a16990b217 100755 --- a/tests/test-copy-acl.sh +++ b/tests/test-copy-acl.sh @@ -187,10 +187,16 @@ cd "$builddir" || func_test_copy tmpfile0 tmpfile1 if test $acl_flavor != none; then + # A POSIX compliant 'id' program. + if test -f /usr/xpg4/bin/id; then + ID=/usr/xpg4/bin/id + else + ID=id + fi # Use a user and group id different from the current one, to avoid # redundant/ambiguous ACLs. - myuid=`id -u` - mygid=`id -g` + myuid=`$ID -u` + mygid=`$ID -g` auid=1 if test "$auid" = "$myuid"; then auid=2; fi agid=1 diff --git a/tests/test-copy-file.sh b/tests/test-copy-file.sh index ad7da7be1d..bf71b3b133 100755 --- a/tests/test-copy-file.sh +++ b/tests/test-copy-file.sh @@ -181,10 +181,16 @@ cd "$builddir" || func_test_copy tmpfile0 tmpfile1 if test "$USE_ACL" != 0 && test $acl_flavor != none; then + # A POSIX compliant 'id' program. + if test -f /usr/xpg4/bin/id; then + ID=/usr/xpg4/bin/id + else + ID=id + fi # Use a user and group id different from the current one, to avoid # redundant/ambiguous ACLs. - myuid=`id -u` - mygid=`id -g` + myuid=`$ID -u` + mygid=`$ID -g` auid=1 if test "$auid" = "$myuid"; then auid=2; fi agid=1 diff --git a/tests/test-file-has-acl.sh b/tests/test-file-has-acl.sh index 7064c1cdf0..db6738870a 100755 --- a/tests/test-file-has-acl.sh +++ b/tests/test-file-has-acl.sh @@ -187,10 +187,16 @@ cd "$builddir" || func_test_has_acl tmpdir0 no if test $acl_flavor != none; then + # A POSIX compliant 'id' program. + if test -f /usr/xpg4/bin/id; then + ID=/usr/xpg4/bin/id + else + ID=id + fi # Use a user and group id different from the current one, to avoid # redundant/ambiguous ACLs. - myuid=`id -u` - mygid=`id -g` + myuid=`$ID -u` + mygid=`$ID -g` auid=1 if test "$auid" = "$myuid"; then auid=2; fi agid=1 diff --git a/tests/test-set-mode-acl.sh b/tests/test-set-mode-acl.sh index 4e58e0be80..5d3d225196 100755 --- a/tests/test-set-mode-acl.sh +++ b/tests/test-set-mode-acl.sh @@ -107,10 +107,16 @@ cd "$builddir" || fi if test $acl_flavor != none; then + # A POSIX compliant 'id' program. + if test -f /usr/xpg4/bin/id; then + ID=/usr/xpg4/bin/id + else + ID=id + fi # Use a user and group id different from the current one, to avoid # redundant/ambiguous ACLs. - myuid=`id -u` - mygid=`id -g` + myuid=`$ID -u` + mygid=`$ID -g` auid=1 if test "$auid" = "$myuid"; then auid=2; fi agid=1 -- 2.30.2