Page MenuHomeFreeBSD

Add some more non-portable acl_* functions.
Needs ReviewPublic

Authored by arrowd on Jan 20 2021, 3:55 PM.

Details

Summary

This review adds acl_from_mode_np, acl_cmp_np and acl_equiv_mode_np functions.
These functions without _np prefix are present in Linux libacl and some software
(KDE, specifically) uses them along with standard POSIX ACL functions.

It is impossible to implement some of them outside of libc, and since we already
have a bit of *_np functions, I decided to implement these.

Test Plan

I did no testing for these functions. I guess, getting this in requires adding
some regressions tests? If yes, I need a guide on how to write and execute tests,
and then I'm happy to do the work.

Special attention should be payed to man pages - I both non-native English
speaker and non-proficient with mandoc.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 36629
Build 33518: arc lint + arc unit

Event Timeline

Interacting with kyau, the test suite, is described here on the wiki.

lib/libc/posix1e/acl_cmp_np.3
53

Another instance of referring to spec making it seem to differ from implementation, as described below.

55

Same as above.

lib/libc/posix1e/acl_equiv_mode_np.3
26

I don't believe &FreeBSD& is needed or encouraged anymore, as it's not used by git - but someone else should probably confirm this.

44

You missed a word here.

46

A bit of wordsmithing to help ledgibility

53–54

Is it supposed to be 'mode values or 'a mode value'?

56

Missed a letter here.

67

Same as above.

lib/libc/posix1e/acl_from_mode_np.3
51

I think it's better to stick with terminology that relates to the VM subsystem here? The dash is optional, but I think it looks better with it.

57

'shall return' makes it sounds like a spec is being quoted, and that the implementation doesn't follow this - I assume that's not the intention?

62

Same as above.

64

Same as above.

68

Same as above.

arrowd marked 12 inline comments as done.
  • Address comments on man pages.

Interacting with kyau, the test suite, is described here on the wiki.

Thanks for the link, I'll look into that.

lib/libc/posix1e/acl_equiv_mode_np.3
53–54

The latter, thanks.

lib/libc/posix1e/acl_from_mode_np.3
57

That's right - there is no spec as these functions are non-standard.

From a manual page point of view, this looks good to me.

I can't speak to the actual code and whether it matches the documentation, though.

  • Add ATF C test for newly added acl_* functions.

I've added an ATF test for new functions. For now, the issues are

  • I had to remove assert(_acl_brand(a) != ACL_BRAND_UNKNOWN) from acl_support.c. I don't quite see why these asserts were there in first place, but I need them removed to make use of _acl_differs in acl_cmp_np.
  • The acl_equiv_mode is very similar to our acl_is_trivial_np. I wonder if something should be done about this.
  • I plan to run the same ATF test on Linux to ensure identical semantics Done, test passes.