]> git.ipfire.org Git - thirdparty/samba.git/commit
vfs_ceph_new: handle case of readlinkat with empty name string
authorShachar Sharon <ssharon@redhat.com>
Tue, 20 Aug 2024 09:45:07 +0000 (12:45 +0300)
committerAnoop C S <anoopcs@samba.org>
Fri, 30 Aug 2024 10:42:27 +0000 (10:42 +0000)
commit22182f90e8e7876a9895f77e736d2b96b18b174f
tree3bdc94ef8c2be0e7c2afd6162d5ca1b9ddcc6d61
parent574f2c3ed8dde01610ad9a36d57cc30d6d0008ed
vfs_ceph_new: handle case of readlinkat with empty name string

Commit 53c9269b (vfs_ceph_new: use low-level APIs for symlink/readlink)
introduced readlinkat using libcephfs low-level APIs. However, it does
not handle properly the case where readlinkat operates on empty name
string (see man readlinkat(2)), such as:

  fd = openat(dirfd, symname, O_PATH | O_NOFOLLOW, 0);
  readlinkat(fd, "", buf, bufsiz);

Handle this special case of readlinkat with empty name string by using
a reference to the symlink inode itself.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15686

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Aug 30 10:42:27 UTC 2024 on atb-devel-224
source3/modules/vfs_ceph_new.c