mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Update to use newer versions of libacl functions.
This commit is contained in:
+19
-6
@@ -66,6 +66,7 @@ main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
char *file;
|
char *file;
|
||||||
|
char *acl_text;
|
||||||
int getaccess = 0;
|
int getaccess = 0;
|
||||||
int getdefault = 0;
|
int getdefault = 0;
|
||||||
int usefd = 0;
|
int usefd = 0;
|
||||||
@@ -124,24 +125,36 @@ main(int argc, char **argv)
|
|||||||
acl = acl_get_file(file, ACL_TYPE_ACCESS);
|
acl = acl_get_file(file, ACL_TYPE_ACCESS);
|
||||||
}
|
}
|
||||||
if (acl == NULL) {
|
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));
|
prog, file, strerror(errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
printf("%s: access ", file);
|
acl_text = acl_to_any_text(acl, NULL, "", ',', "", TEXT_ABBREVIATE);
|
||||||
acl_print(stdout, acl, NULL, TEXT_ABBREVIATE||TEXT_NO_ENDOFLINE);
|
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);
|
acl_free(acl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getdefault) {
|
if (getdefault) {
|
||||||
acl = acl_get_file(file, ACL_TYPE_DEFAULT);
|
acl = acl_get_file(file, ACL_TYPE_DEFAULT);
|
||||||
if (acl == NULL) {
|
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));
|
prog, file, strerror(errno));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
printf("%s: default ", file);
|
acl_text = acl_to_any_text(acl, NULL, "", ',', "", TEXT_ABBREVIATE);
|
||||||
acl_print(stdout, acl, NULL, TEXT_ABBREVIATE||TEXT_NO_ENDOFLINE);
|
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);
|
acl_free(acl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -333,7 +333,7 @@ do
|
|||||||
|
|
||||||
*clean)
|
*clean)
|
||||||
# we need to configure or else we might fail to 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
|
do
|
||||||
cd $WORKAREA/cmd/$pkg
|
cd $WORKAREA/cmd/$pkg
|
||||||
_log " *** clean $pkg tools"
|
_log " *** clean $pkg tools"
|
||||||
@@ -386,7 +386,7 @@ do
|
|||||||
|| _fail " !!! build modules failed"
|
|| _fail " !!! build modules failed"
|
||||||
|
|
||||||
_log " *** build and install tools"
|
_log " *** build and install tools"
|
||||||
for pkg in attr xfsprogs dmapi xfsdump xfstests
|
for pkg in attr acl xfsprogs dmapi xfsdump xfstests
|
||||||
do
|
do
|
||||||
cd $WORKAREA/cmd/$pkg
|
cd $WORKAREA/cmd/$pkg
|
||||||
|
|
||||||
@@ -400,8 +400,8 @@ do
|
|||||||
_sudo make install install-dev 2>&1 \
|
_sudo make install install-dev 2>&1 \
|
||||||
|| _fail " !!! install $pkg failed"
|
|| _fail " !!! install $pkg failed"
|
||||||
|
|
||||||
# attr now has an install-lib target as well
|
# attr and acl now have install-lib targets as well
|
||||||
[ $pkg == "attr" ] || continue
|
[ $pkg == "attr" -o $pkg == "acl" ] || continue
|
||||||
_sudo make install-lib 2>&1 \
|
_sudo make install-lib 2>&1 \
|
||||||
|| _fail " !!! install $pkg failed"
|
|| _fail " !!! install $pkg failed"
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user