]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: vfs_unityed_media. Implement readlinkat().
authorJeremy Allison <jra@samba.org>
Thu, 22 Aug 2019 21:31:29 +0000 (14:31 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 23 Aug 2019 18:49:36 +0000 (18:49 +0000)
Currently identical to readlink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source3/modules/vfs_unityed_media.c

index 1816943a29d63ee6e24c594c0511a28ed69ece74..c6e636ea57512faecf1f7cffd8181105f8811500 100644 (file)
@@ -1393,6 +1393,42 @@ err:
        return status;
 }
 
+static int um_readlinkat(vfs_handle_struct *handle,
+                       files_struct *dirfsp,
+                       const struct smb_filename *smb_fname,
+                       char *buf,
+                       size_t bufsiz)
+{
+       int status;
+       struct smb_filename *client_fname = NULL;
+
+       DEBUG(10, ("Entering um_readlinkat\n"));
+
+       if (!is_in_media_files(smb_fname->base_name)) {
+               return SMB_VFS_NEXT_READLINKAT(handle,
+                               dirfsp,
+                               smb_fname,
+                               buf,
+                               bufsiz);
+       }
+
+       status = alloc_get_client_smb_fname(handle, talloc_tos(),
+                                           smb_fname, &client_fname);
+       if (status != 0) {
+               goto err;
+       }
+
+       status = SMB_VFS_NEXT_READLINKAT(handle,
+                               dirfsp,
+                               client_fname,
+                               buf,
+                               bufsiz);
+
+err:
+       TALLOC_FREE(client_fname);
+       return status;
+}
+
 static int um_linkat(vfs_handle_struct *handle,
                        files_struct *srcfsp,
                        const struct smb_filename *old_smb_fname,
@@ -1925,6 +1961,7 @@ static struct vfs_fn_pointers vfs_um_fns = {
        .ntimes_fn = um_ntimes,
        .symlink_fn = um_symlink,
        .readlink_fn = um_readlink,
+       .readlinkat_fn = um_readlinkat,
        .linkat_fn = um_linkat,
        .mknodat_fn = um_mknodat,
        .realpath_fn = um_realpath,