From: Volker Lendecke Date: Mon, 18 Mar 2019 11:24:25 +0000 (+0100) Subject: smbd: Enhance debugging for setting hard links X-Git-Tag: talloc-2.2.0~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74ca95f804a1dd385d33deaf07d47659aaa049f5;p=thirdparty%2Fsamba.git smbd: Enhance debugging for setting hard links Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 108bd570922..a5750a31e52 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -6128,6 +6128,7 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx, struct smb_filename *smb_fname_new) { NTSTATUS status = NT_STATUS_OK; + bool ok; /* source must already exist. */ if (!VALID_STAT(smb_fname_old->st)) { @@ -6159,8 +6160,14 @@ NTSTATUS hardlink_internals(TALLOC_CTX *ctx, } /* Setting a hardlink to/from a stream isn't currently supported. */ - if (is_ntfs_stream_smb_fname(smb_fname_old) || - is_ntfs_stream_smb_fname(smb_fname_new)) { + ok = is_ntfs_stream_smb_fname(smb_fname_old); + if (ok) { + DBG_DEBUG("Old name has streams\n"); + return NT_STATUS_INVALID_PARAMETER; + } + ok = is_ntfs_stream_smb_fname(smb_fname_new); + if (ok) { + DBG_DEBUG("New name has streams\n"); return NT_STATUS_INVALID_PARAMETER; }