Page MenuHomeFreeBSD

Little refactor to gefacl
ClosedPublic

Authored by arrowd on Nov 20 2020, 6:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 6, 4:17 AM
Unknown Object (File)
Fri, Dec 6, 4:17 AM
Unknown Object (File)
Fri, Dec 6, 4:17 AM
Unknown Object (File)
Wed, Dec 4, 9:51 AM
Unknown Object (File)
Mon, Dec 2, 3:00 AM
Unknown Object (File)
Sat, Nov 30, 8:27 PM
Unknown Object (File)
Fri, Nov 29, 11:43 PM
Unknown Object (File)
Fri, Nov 29, 12:40 PM
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.