Currently it is possible to connect a socket by calling "connectat(AT_FDCWD, ...)" even in capabilties mode. This combination should probably be treated the same as a call to connect (i.e. forbidden in capabilities mode).
This patch disables connectat/bindat with AT_FDCWD in capabilities mode, fixes up the documentation and adds some tests.
See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222632.