[Pkg-libvirt-commits] [libguestfs] 08/17: fuse: test-fuse: use acl_to_any_text

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:48:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.55-1
in repository libguestfs.

commit ad300fcd5e497c401589d54efd9d80334ff41b1b
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Fri Sep 26 14:27:04 2014 +0200

    fuse: test-fuse: use acl_to_any_text
    
    Switch from acl_to_text to acl_to_any_text, so it is possible to specify
    options, like forcing the numeric IDs for users/groups. This ensure the
    resulting string has always numberic IDs, so the comparison can always
    succeed.
    
    Adapt the comparison string to the lack of final endline now.
---
 fuse/test-fuse.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fuse/test-fuse.c b/fuse/test-fuse.c
index 1e18a75..b675a4c 100644
--- a/fuse/test-fuse.c
+++ b/fuse/test-fuse.c
@@ -36,6 +36,7 @@
 
 #ifdef HAVE_ACL
 #include <sys/acl.h>
+#include <acl/libacl.h>
 #endif
 
 #ifdef HAVE_ATTR_XATTR_H
@@ -646,12 +647,12 @@ test_fuse (void)
       perror ("acl_get_file: acl");
       return -1;
     }
-    acl_text = acl_to_text (acl, NULL);
+    acl_text = acl_to_any_text (acl, NULL, '\n', TEXT_SOME_EFFECTIVE | TEXT_NUMERIC_IDS);
     if (acl_text == NULL) {
-      perror ("acl_to_text: acl");
+      perror ("acl_to_any_text: acl");
       return -1;
     }
-    if (STRNEQ (acl_text, "user::rwx\nuser:500:r--\ngroup::rwx\nmask::rwx\nother::r-x\n")) {
+    if (STRNEQ (acl_text, "user::rwx\nuser:500:r--\ngroup::rwx\nmask::rwx\nother::r-x")) {
       fprintf (stderr, "unexpected acl: %s\n", acl_text);
       return -1;
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list