From ad300fcd5e497c401589d54efd9d80334ff41b1b Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 26 Sep 2014 14:27:04 +0200 Subject: [PATCH] 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 1e18a75c3..b675a4cc2 100644 --- a/fuse/test-fuse.c +++ b/fuse/test-fuse.c @@ -36,6 +36,7 @@ #ifdef HAVE_ACL #include +#include #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; }