Increase carried_error if we skip a file due to an error. This ensures
that setfacl(1) exits with proper exit status on failure. PR: bin/149780 Submitted by: Ævar Arnfjörð Bjarmason (original version) Reviewed by: trasz MFC after: 3 weeks
This commit is contained in:
parent
547ffb85d9
commit
b38dc7ebea
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216922
@ -201,12 +201,14 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (stat(file->filename, &sb) == -1) {
|
if (stat(file->filename, &sb) == -1) {
|
||||||
warn("%s: stat() failed", file->filename);
|
warn("%s: stat() failed", file->filename);
|
||||||
|
carried_error++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (acl_type == ACL_TYPE_DEFAULT && S_ISDIR(sb.st_mode) == 0) {
|
if (acl_type == ACL_TYPE_DEFAULT && S_ISDIR(sb.st_mode) == 0) {
|
||||||
warnx("%s: default ACL may only be set on a directory",
|
warnx("%s: default ACL may only be set on a directory",
|
||||||
file->filename);
|
file->filename);
|
||||||
|
carried_error++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,6 +220,7 @@ main(int argc, char *argv[])
|
|||||||
if (acl_type == ACL_TYPE_DEFAULT) {
|
if (acl_type == ACL_TYPE_DEFAULT) {
|
||||||
warnx("%s: there are no default entries "
|
warnx("%s: there are no default entries "
|
||||||
"in NFSv4 ACLs", file->filename);
|
"in NFSv4 ACLs", file->filename);
|
||||||
|
carried_error++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
acl_type = ACL_TYPE_NFS4;
|
acl_type = ACL_TYPE_NFS4;
|
||||||
@ -240,6 +243,7 @@ main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
warn("%s: acl_get_file() failed",
|
warn("%s: acl_get_file() failed",
|
||||||
file->filename);
|
file->filename);
|
||||||
|
carried_error++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user