From 9cbf59b7fd224f263fce77ef1dadd3be5439fc4f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 13 Jun 2011 01:17:20 +0200 Subject: [PATCH] acl: Complete the 2010-08-10 fix. * lib/file-has-acl.c (file_has_acl) [HP-UX]: Also test against ENOTSUP. * lib/set-mode-acl.c (qset_acl) [HP-UX]: Likewise. * lib/copy-acl.c (qcopy_acl) [HP-UX]: Test for the errno values explicitly. * tests/test-sameacls.c (main) [HP-UX]: Also test against ENOTSUP. Reported in . --- ChangeLog | 10 ++++++++++ lib/copy-acl.c | 4 ++-- lib/file-has-acl.c | 10 +++++++++- lib/set-mode-acl.c | 2 +- tests/test-sameacls.c | 6 ++++-- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 498caedfe..5a0d7af5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2011-06-12 Bruno Haible + acl: Complete the 2010-08-10 fix. + * lib/file-has-acl.c (file_has_acl) [HP-UX]: Also test against ENOTSUP. + * lib/set-mode-acl.c (qset_acl) [HP-UX]: Likewise. + * lib/copy-acl.c (qcopy_acl) [HP-UX]: Test for the errno values + explicitly. + * tests/test-sameacls.c (main) [HP-UX]: Also test against ENOTSUP. + Reported in . + +2011-06-12 Bruno Haible + spawn-pipe tests: Comments. * tests/test-spawn-pipe-child.c (main): Update comment. Reported by James Youngman . diff --git a/lib/copy-acl.c b/lib/copy-acl.c index f0dc1165d..d933fa2fa 100644 --- a/lib/copy-acl.c +++ b/lib/copy-acl.c @@ -420,7 +420,7 @@ qcopy_acl (const char *src_name, int source_desc, const char *dst_name, if (count < 0) { - if (ACL_NOT_WELL_SUPPORTED (errno)) + if (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP) { count = 0; break; @@ -455,7 +455,7 @@ qcopy_acl (const char *src_name, int source_desc, const char *dst_name, { int saved_errno = errno; - if (ACL_NOT_WELL_SUPPORTED (errno)) + if (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP) { struct stat source_statbuf; diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index a815e4c47..03decf46b 100644 --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -527,7 +527,15 @@ file_has_acl (char const *name, struct stat const *sb) count = getacl (name, 0, NULL); if (count < 0) - return (errno == ENOSYS || errno == EOPNOTSUPP ? 0 : -1); + { + /* ENOSYS is seen on newer HP-UX versions. + EOPNOTSUPP is typically seen on NFS mounts. + ENOTSUP was seen on Quantum StorNext file systems (cvfs). */ + if (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP) + return 0; + else + return -1; + } if (count == 0) return 0; diff --git a/lib/set-mode-acl.c b/lib/set-mode-acl.c index 377597c0f..1392378fd 100644 --- a/lib/set-mode-acl.c +++ b/lib/set-mode-acl.c @@ -432,7 +432,7 @@ qset_acl (char const *name, int desc, mode_t mode) ret = setacl (name, sizeof (entries) / sizeof (struct acl_entry), entries); if (ret < 0) { - if (errno == ENOSYS || errno == EOPNOTSUPP) + if (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP) return chmod_or_fchmod (name, desc, mode); return -1; } diff --git a/tests/test-sameacls.c b/tests/test-sameacls.c index 0f777b55b..661a9266a 100644 --- a/tests/test-sameacls.c +++ b/tests/test-sameacls.c @@ -360,10 +360,12 @@ main (int argc, char *argv[]) int count2; count1 = getacl (file1, 0, NULL); - if (count1 < 0 && (errno == ENOSYS || errno == EOPNOTSUPP)) + if (count1 < 0 + && (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP)) count1 = 0; count2 = getacl (file2, 0, NULL); - if (count2 < 0 && (errno == ENOSYS || errno == EOPNOTSUPP)) + if (count2 < 0 + && (errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP)) count2 = 0; if (count1 < 0) -- 2.11.0