Bug 214599

Summary: Add a cap_fill_flag function to copy a flag from one cap_t to another cap_t
Product: Tools Reporter: Andrew G. Morgan (agm)
Component: libcapAssignee: Andrew G. Morgan (morgan)
Status: RESOLVED CODE_FIX    
Severity: normal CC: morgan
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: n/a Subsystem:
Regression: No Bisected commit-id:
Attachments: implement cap_fill_flag()

Description Andrew G. Morgan 2021-10-01 20:45:12 UTC
Some user feedback: I would have been preferable to implement the following API for filling a capability (cap_fill isn't as generally useful):

  int cap_fill_flag(cap_t working, cap_flag_t to,
      const cap_t ref, cap_flag_t from);

a function that would transcribe from one capability set's from flag to the other's to flag.
Comment 1 Andrew G. Morgan 2021-10-01 23:29:04 UTC
Created attachment 299053 [details]
implement cap_fill_flag()

Here is a patch.