Update to use newer versions of libacl functions.
authorfsgqa <fsgqa>
Tue, 12 Mar 2002 20:55:52 +0000 (20:55 +0000)
committerfsgqa <fsgqa>
Tue, 12 Mar 2002 20:55:52 +0000 (20:55 +0000)
src/acl_get.c
tools/auto-qa

index f39fe1b20f75efc6c7c4b14ad4ad6fdcdc412f8c..ccaf958e9d24273021633e5abfd5b8ad2589b914 100644 (file)
@@ -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);
        }
 
index f7bbf6aa0ea928617daf9df634c00ab72e1a2904..46cf365d694662e13adea29af9f42ec941543d04 100755 (executable)
@@ -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