Page MenuHomeFreeBSD

Little refactor to gefacl
ClosedPublic

Authored by arrowd on Nov 20 2020, 6:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 24 2024, 2:16 AM
Unknown Object (File)
Jan 4 2024, 1:34 AM
Unknown Object (File)
Jan 4 2024, 1:14 AM
Unknown Object (File)
Jan 4 2024, 1:14 AM
Unknown Object (File)
Jan 4 2024, 1:14 AM
Unknown Object (File)
Jan 4 2024, 12:57 AM
Unknown Object (File)
Dec 20 2023, 5:29 AM
Unknown Object (File)
Dec 4 2023, 5:18 AM
Subscribers

Details

Summary

The acl_from_stat function accepts a stat_t * argument, but only uses its st_mode field. There is no reason to pass the whole struct, so make it accept a mode_t and rename the function to acl_from_mode.

Linux has non-standard acl_from_mode function in its libacl, so naming the function this way may help discovering it during porting efforts.

Test Plan

Compiled, ran getfacl somefile and verified that the output is the same as before.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Seems to make sense. As you hint about compatibility with linux version, does this function produce the same results as linux version does?

markj added a subscriber: markj.

Seems reasonable to me.

This revision is now accepted and ready to land.Nov 23 2020, 1:48 PM

Seems to make sense. As you hint about compatibility with linux version, does this function produce the same results as linux version does?

I didn't try, but judging from http://git.savannah.nongnu.org/cgit/acl.git/tree/libacl/acl_from_mode.c it seem to work exactly the same way.