When renameat(2) is used with:
- absolute path for to;
- tofd not set to AT_FDCWD
- the target exists
kern_renameat() requires CAP_UNLINK capability on tofd, but corresponding namei ni_filecap is not initialized at all because the lookup is absolute. As result the check was done against empty filecap and syscall fails erronously.
Fix it by creating a return flags namei member and reporting if the lookup was absolute, then do not touch to.ni_filecaps at all.
PR: 222258
MFC note: this breaks struct namei layout. Do we want the merge ?