From 1ea6225e60469b26a0639dc75ed53afa500eaa24 Mon Sep 17 00:00:00 2001 From: fsgqa Date: Tue, 12 Mar 2002 20:55:52 +0000 Subject: [PATCH] Update to use newer versions of libacl functions. --- src/acl_get.c | 25 +++++++++++++++++++------ tools/auto-qa | 8 ++++---- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/acl_get.c b/src/acl_get.c index f39fe1b2..ccaf958e 100644 --- a/src/acl_get.c +++ b/src/acl_get.c @@ -66,6 +66,7 @@ main(int argc, char **argv) { int c; char *file; + char *acl_text; int getaccess = 0; int getdefault = 0; int usefd = 0; @@ -124,24 +125,36 @@ main(int argc, char **argv) acl = acl_get_file(file, ACL_TYPE_ACCESS); } if (acl == NULL) { - fprintf (stderr, "%s: error getting access ACL on \"%s\": %s\n", + fprintf(stderr, "%s: error getting access ACL on \"%s\": %s\n", prog, file, strerror(errno)); return 0; } - printf("%s: access ", file); - acl_print(stdout, acl, NULL, TEXT_ABBREVIATE||TEXT_NO_ENDOFLINE); + acl_text = acl_to_any_text(acl, NULL, "", ',', "", TEXT_ABBREVIATE); + if (acl_text == NULL) { + fprintf(stderr, "%s: cannot get access ACL text on '%s': %s\n", + prog, file, strerror(errno)); + return 0; + } + printf("%s: access %s", file, acl_text); + acl_free(acl_text); acl_free(acl); } if (getdefault) { acl = acl_get_file(file, ACL_TYPE_DEFAULT); if (acl == NULL) { - fprintf (stderr, "%s: error getting default ACL on \"%s\": %s\n", + fprintf(stderr, "%s: error getting default ACL on \"%s\": %s\n", prog, file, strerror(errno)); return 0; } - printf("%s: default ", file); - acl_print(stdout, acl, NULL, TEXT_ABBREVIATE||TEXT_NO_ENDOFLINE); + acl_text = acl_to_any_text(acl, NULL, "", ',', "", TEXT_ABBREVIATE); + if (acl_text == NULL) { + fprintf(stderr, "%s: cannot get default ACL text on '%s': %s\n", + prog, file, strerror(errno)); + return 0; + } + printf("%s: default %s", file, acl_text); + acl_free(acl_text); acl_free(acl); } diff --git a/tools/auto-qa b/tools/auto-qa index f7bbf6aa..46cf365d 100755 --- a/tools/auto-qa +++ b/tools/auto-qa @@ -333,7 +333,7 @@ do *clean) # we need to configure or else we might fail to clean - for pkg in attr xfsprogs dmapi xfsdump xfstests + for pkg in attr acl xfsprogs dmapi xfsdump xfstests do cd $WORKAREA/cmd/$pkg _log " *** clean $pkg tools" @@ -386,7 +386,7 @@ do || _fail " !!! build modules failed" _log " *** build and install tools" - for pkg in attr xfsprogs dmapi xfsdump xfstests + for pkg in attr acl xfsprogs dmapi xfsdump xfstests do cd $WORKAREA/cmd/$pkg @@ -400,8 +400,8 @@ do _sudo make install install-dev 2>&1 \ || _fail " !!! install $pkg failed" - # attr now has an install-lib target as well - [ $pkg == "attr" ] || continue + # attr and acl now have install-lib targets as well + [ $pkg == "attr" -o $pkg == "acl" ] || continue _sudo make install-lib 2>&1 \ || _fail " !!! install $pkg failed" done -- 2.39.5