]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Make hardlink_internals() call SMB_VFS_LINKAT() instead of SMB_VFS_LINK()
authorJeremy Allison <jra@samba.org>
Fri, 16 Aug 2019 23:16:48 +0000 (16:16 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 20 Aug 2019 21:09:29 +0000 (21:09 +0000)
Use conn->cwd_fsp as current src and dst fsp's.

No logic change for now.

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

index d054b111a90a5c5842d91b8cd715dcd053b6adce..fba6881f0fd64f82d2c03d41c33d48dc94f55f84 100644 (file)
@@ -6408,6 +6408,7 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
                struct smb_filename *smb_fname_new)
 {
        NTSTATUS status = NT_STATUS_OK;
+       int ret;
        bool ok;
 
        /* source must already exist. */
@@ -6454,7 +6455,14 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
        DEBUG(10,("hardlink_internals: doing hard link %s -> %s\n",
                  smb_fname_old->base_name, smb_fname_new->base_name));
 
-       if (SMB_VFS_LINK(conn, smb_fname_old, smb_fname_new) != 0) {
+       ret = SMB_VFS_LINKAT(conn,
+                       conn->cwd_fsp,
+                       smb_fname_old,
+                       conn->cwd_fsp,
+                       smb_fname_new,
+                       0);
+
+       if (ret != 0) {
                status = map_nt_error_from_unix(errno);
                DEBUG(3,("hardlink_internals: Error %s hard link %s -> %s\n",
                         nt_errstr(status), smb_fname_old->base_name,