From 585cb81a5cf3bc59d289d3fcf43df627d8e069a0 Mon Sep 17 00:00:00 2001 From: Tim Shimmin Date: Wed, 6 Jun 2001 04:55:01 +0000 Subject: [PATCH] Update for extra output from src/acl_test. --- 058.out | 4 ++++ src/acl_test.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/058.out b/058.out index d55bc915..92a6a309 100644 --- a/058.out +++ b/058.out @@ -232,3 +232,7 @@ Get 26th entry on filled ACL acl_get_entry -> 0 Get 27th entry on filled ACL acl_get_entry -> 0 +*** test out ACL to text for empty ACL*** +acl_to_text(empty_acl,NULL) -> "" +acl_to_text(empty_acl,NULL) -> "", len = 0 +acl_to_text(NULL,NULL) -> "NULL" diff --git a/src/acl_test.c b/src/acl_test.c index 4f66a9b7..41afd994 100644 --- a/src/acl_test.c +++ b/src/acl_test.c @@ -207,6 +207,23 @@ main(int argc, char **argv) dump_acl_by_entry(acl3); /* ---------------------------------------------- */ + printf("*** test out ACL to text for empty ACL***\n"); + { + char *text; + ssize_t len; + acl_t empty_acl = acl_init(0); + text = acl_to_text(empty_acl, NULL); + printf("acl_to_text(empty_acl,NULL) -> \"%s\"\n", text); + text = acl_to_text(empty_acl, &len); + printf("acl_to_text(empty_acl,NULL) -> \"%s\", len = %u\n", text, len); + text = acl_to_text(NULL, NULL); + printf("acl_to_text(NULL,NULL) -> \"%s\"\n", text==NULL?"NULL":text); + } + /* NOTE: Other tests will test out the text for ACLs with ACEs. + * So don't have to test it here. + * It is simplest to choose ids not in /etc/passwd /etc/group + * which is done already in a script. + */ return 0; } -- 2.30.2