Page MenuHomeFreeBSD

Little refactor to gefacl
ClosedPublic

Authored by arrowd on Fri, Nov 20, 6:45 AM.

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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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.Mon, Nov 23, 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.