Skip to content

Commit

Permalink
sys: Mark ACL conversion routines as __result_use_check
Browse files Browse the repository at this point in the history
Both acl_copy_oldacl_into_acl() and acl_copy_acl_into_oldacl() may fail
in some circumstances (e.g., acl.acl_cnt exceeding the capacity of
OLDACL_MAX_ENTRIES).  This change marks both routines with
__result_use_check, enforcing check for errors by the caller.

Suggested by:	markj
Reviewed by:	markj, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46254

(cherry picked from commit ef9fc96)
(cherry picked from commit 82fd921)
  • Loading branch information
khorben authored and emaste committed Sep 9, 2024
1 parent a954348 commit df2f511
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/sys/acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ void acl_nfs4_compute_inherited_acl(
const struct acl *parent_aclp,
struct acl *child_aclp, mode_t mode,
int file_owner_id, int is_directory);
int acl_copy_oldacl_into_acl(const struct oldacl *source,
int __result_use_check acl_copy_oldacl_into_acl(const struct oldacl *source,
struct acl *dest);
int acl_copy_acl_into_oldacl(const struct acl *source,
int __result_use_check acl_copy_acl_into_oldacl(const struct acl *source,
struct oldacl *dest);

/*
Expand Down

0 comments on commit df2f511

Please sign in to comment.