From: Jeremy Allison Date: Fri, 16 Aug 2019 23:16:48 +0000 (-0700) Subject: s3: smbd: Make hardlink_internals() call SMB_VFS_LINKAT() instead of SMB_VFS_LINK() X-Git-Tag: tevent-0.10.1~296 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea637f002d0b0e30c29814fc6d8c137103deaa23;p=thirdparty%2Fsamba.git s3: smbd: Make hardlink_internals() call SMB_VFS_LINKAT() instead of SMB_VFS_LINK() Use conn->cwd_fsp as current src and dst fsp's. No logic change for now. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index d054b111a90..fba6881f0fd 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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,