ceph_openat() does not follow the convention of ignoring 'dirfd' when
the pathname is absolute, resulting in EBADF. As a temporary workaround,
handle this special case in cephwrap_openat() by calling ceph_open()
directly instead of ceph_openat().
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com>
Reviewed-by: Xavi Hernandez <xhernandez@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Mon Feb 16 17:27:03 UTC 2026 on atb-devel-224
became_root = true;
}
+ if (dirfd == -1 && smb_fname->base_name[0] == '/') {
+ result = ceph_open(handle->data,
+ smb_fname->base_name,
+ flags,
+ mode);
+ goto done;
+ }
+
result = ceph_openat(handle->data,
dirfd,
smb_fname->base_name,
flags,
mode);
+done:
if (became_root) {
unbecome_root();
}