diff options
author | Ryan Moeller <freqlabs@FreeBSD.org> | 2020-05-21 01:55:35 +0000 |
---|---|---|
committer | Ryan Moeller <freqlabs@FreeBSD.org> | 2020-05-21 01:55:35 +0000 |
commit | 245bfd34da590e12884bd1a5677f3227a36d4bcf (patch) | |
tree | bd3f30b09ed71ce881641d920535207ad89d75dc /lib/libugidfw | |
parent | 49caa483b3fafffd9cf5197eb30e8bb235aa7410 (diff) |
Deduplicate fsid comparisons
Comparing fsid_t objects requires internal knowledge of the fsid structure
and yet this is duplicated across a number of places in the code.
Simplify by creating a fsidcmp function (macro).
Reviewed by: mjg, rmacklem
Approved by: mav (mentor)
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D24749
Notes
Notes:
svn path=/head/; revision=361313
Diffstat (limited to 'lib/libugidfw')
-rw-r--r-- | lib/libugidfw/ugidfw.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libugidfw/ugidfw.c b/lib/libugidfw/ugidfw.c index a77fd9d15bc6..4fc09bbb163f 100644 --- a/lib/libugidfw/ugidfw.c +++ b/lib/libugidfw/ugidfw.c @@ -334,9 +334,8 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, size_t buflen) if (rule->mbr_object.mbo_flags & MBO_FSID_DEFINED) { numfs = getmntinfo(&mntbuf, MNT_NOWAIT); for (i = 0; i < numfs; i++) - if (memcmp(&(rule->mbr_object.mbo_fsid), - &(mntbuf[i].f_fsid), - sizeof(mntbuf[i].f_fsid)) == 0) + if (fsidcmp(&rule->mbr_object.mbo_fsid, + &mntbuf[i].f_fsid) == 0) break; len = snprintf(cur, left, "filesys %s ", i == numfs ? "???" : mntbuf[i].f_mntonname); |