osd/OSDCap: fix allow_all() check

Only return true for the global "allow all" if the match does not constrain
us at all.  This matches the set_allow_all() method.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: add new MonCap implementation

This is a new class with a new grammer.  Implementation is modeled after
OSDCap, and the semantics are based on the old MonCaps, although somewhat
different (though not in too many important ways, I think).

Note that we complete drop auid support; the semantics for that were a
complete mess.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: make encodable

Note that we are not backward compatible with the MonCaps struct.  This is
only passed over the wire, so that's okay; we protect this change with a
wire protocol version bump.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: bump wire protocol version

We have changed MonCap encoding and command semantics (which affects
forwarding).  Bump the wire protocol version.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: transition from MonCap -> MonCaps

Convert all monitor users to use the new MonCap class.

Simplify the semantics around auids by essentially dropping any meaningful
permissions enforcement around them.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: avoid typedef for mon_rwxa_t

This conflicts later because we have an operator<< for __u8 in OSDCap, too.
That one also needs to be similarly converted.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/OSDCap: avoid typedef for rwxa_t; rename to osd_rwxa_t

Avoid implementing an operator<< on __u8, and make the naming less likely
to conflict with others.

We did a similar thing with MonCap.

Signed-off-by: Sage Weil <sage@inktank.com>
ceph-object-corpus: note MForward encoding change

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MOnCap: fix command parsing

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: add 'allow profile <foo> x'

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: revise grammar

 allow rwx
 allow service rwx
 allow profile foo
 allow command bar
 allow command bar with k1=v1 k2=v2

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: define a few profiles

 - osd, mds, mon (daemons)
 - fs-client (can mount fs)
 - simple-rados-client (can use existing rados pools)

Signed-off-by: Sage Weil <sage@inktank.com>
vstart.sh: use new mon cap profiles

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: debug is_capable

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: fix is_capable()

Explicitly allow_all.

Fix rwxa enforcement flow.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: add bootstrap-{mds,osd} profiles

Use simple profile cap, and then whitelist the specific things that
are needed for bootstrap in MonCap.cc (which more sophisticated argument
validation).

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: pass entity_name_t into is_capable()

We will have some profile operations dependent on who the actor is.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: allow daemons access to config-keys $name/*

With tests.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: use fusion instead of phoenix rules

Signed-off-by: Sage Weil <sage@inktank.com>
mon: wire new command map to new caps

We can drop the fullcmd nonsense entirely, yay!

Signed-off-by: Sage Weil <sage@inktank.com>