From f9fdb8a2a6b9ad0fbb89a9734e81a8b1f527966f Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Wed, 25 Sep 2019 10:18:03 -0700 Subject: [PATCH] s3:lib: factor out stream name asserts to helper function BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/lib/filename_util.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source3/lib/filename_util.c b/source3/lib/filename_util.c index 165adb116b5..7b3fab90c46 100644 --- a/source3/lib/filename_util.c +++ b/source3/lib/filename_util.c @@ -239,10 +239,7 @@ struct smb_filename *cp_smb_filename(TALLOC_CTX *mem_ctx, return out; } -/**************************************************************************** - Simple check to determine if the filename is a stream. - ***************************************************************************/ -bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname) +static void assert_valid_stream_smb_fname(const struct smb_filename *smb_fname) { /* stream_name must always be NULL if there is no stream. */ if (smb_fname->stream_name) { @@ -252,6 +249,15 @@ bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname) if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) { SMB_ASSERT(smb_fname->stream_name == NULL); } +} + +/**************************************************************************** + Simple check to determine if the filename is a stream. + ***************************************************************************/ + +bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname) +{ + assert_valid_stream_smb_fname(smb_fname); if (smb_fname->stream_name == NULL) { return false; -- 2.47.3