bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] test-lchown, test-chown: also skip test if lchown/chown fails wi


From: Bernhard Voelker
Subject: [PATCH] test-lchown, test-chown: also skip test if lchown/chown fails with EPERM
Date: Wed, 22 May 2013 01:01:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

I found this one while testing the new nap() code on FAT
(as a non-root user).

WDYT?

Have a nice day,
Berny


>From d76591d41230f06a7002336c3f4111de5ab2f27b Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <address@hidden>
Date: Wed, 22 May 2013 00:53:50 +0200
Subject: [PATCH] test-lchown, test-chown: also skip test if lchown/chown fails
 with EPERM

The above tests abort on FAT file systems right after the test for
filtering out situation without ownership support; errno is EPERM
in such a case.

* tests/test-lchown.h (test_lchown): Add EPERM to the condition to
skip this test.
* tests/test-chown.h (test_chown): Likewise.
---
 tests/test-chown.h  | 4 ++--
 tests/test-lchown.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/test-chown.h b/tests/test-chown.h
index 1f66d4c..1e56b75 100644
--- a/tests/test-chown.h
+++ b/tests/test-chown.h
@@ -57,9 +57,9 @@ test_chown (int (*func) (char const *, uid_t, gid_t), bool 
print)
   ASSERT (mkdir (BASE "dir", 0700) == 0);
   ASSERT (stat (BASE "dir", &st1) == 0);

-  /* Filter out mingw, which has no concept of groups.  */
+  /* Filter out mingw and file systems which have no concept of groups.  */
   result = func (BASE "dir", st1.st_uid, getegid ());
-  if (result == -1 && errno == ENOSYS)
+  if (result == -1 && (errno == ENOSYS || errno == EPERM))
     {
       ASSERT (rmdir (BASE "dir") == 0);
       if (print)
diff --git a/tests/test-lchown.h b/tests/test-lchown.h
index d4e66e7..7a66c10 100644
--- a/tests/test-lchown.h
+++ b/tests/test-lchown.h
@@ -65,9 +65,9 @@ test_lchown (int (*func) (char const *, uid_t, gid_t), bool 
print)
   ASSERT (mkdir (BASE "dir", 0700) == 0);
   ASSERT (stat (BASE "dir", &st1) == 0);

-  /* Filter out mingw, which has no concept of groups.  */
+  /* Filter out mingw and file systems which have no concept of groups.  */
   result = func (BASE "dir", st1.st_uid, getegid ());
-  if (result == -1 && errno == ENOSYS)
+  if (result == -1 && (errno == ENOSYS || errno == EPERM))
     {
       ASSERT (rmdir (BASE "dir") == 0);
       if (print)
-- 
1.8.2.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]