[PATCH]Fix querying symlinks

ronnie sahlberg ronniesahlberg at gmail.com
Tue Jul 2 04:13:57 UTC 2019


On Fri, Jun 28, 2019 at 5:09 PM Steve French <smfrench at gmail.com> wrote:
>
> Querying of symlinks to the Samba server with POSIX extensions works!
>
> (Also would work for querying symlinks generated in Windows NFS server)
>
> # stat /mnt1/symlink-source
>   File: /mnt1/symlink-source -> symlink-target
>   Size: 14            Blocks: 2048       IO Block: 16384  symbolic link
> Device: 39h/57d    Inode: 10354691    Links: 1
> Access: (0000/l---------)  Uid: (    0/    root)   Gid: (    0/    root)
> Access: 2019-06-28 01:43:37.145324400 -0500
> Modify: 2019-06-28 01:43:37.145324400 -0500
> Change: 2019-06-28 01:43:37.145324400 -0500
>  Birth: -
>
>

Very nice.

Change parse_reparse_point() to take a struct reparse_data_buffer as
argument, not a reparse_symlink_data_buffer.
i.e.
parse_reparse_point(struct reparse_data_buffer *reparse_buf,

Then this check should probably be in parse_reparse_point() and not in
parse_reparse_posix() since we will need this check for every type of
reparse point:
  + if (len + sizeof(struct reparse_data_buffer) > plen) {
  + cifs_dbg(VFS, "srv returned malformed symlink buffer\n");
  + return -EINVAL;
  + }

If you do that, then you can remove the equivalent check in
smb2_query_symlink() :
if (plen < le16_to_cpu(reparse_buf->ReparseDataLength) + 8) {
...



> --
> Thanks,
>
> Steve



More information about the samba-technical mailing list