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.
This commit is contained in:
Pino Toscano
2014-09-26 14:27:04 +02:00
parent 0db22ee7a7
commit ad300fcd5e

View File

@@ -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;
}