summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2019-09-25 10:18:03 -0700
committerRalph Boehme <slow@samba.org>2019-10-02 08:01:39 +0000
commitf9fdb8a2a6b9ad0fbb89a9734e81a8b1f527966f (patch)
tree4749497fdf83b49d6c9f674a67c94a7faaee2775 /source3/lib
parent6c1647ca7a2f68825c34e9ccc18b86ef911e14ac (diff)
downloadsamba-f9fdb8a2a6b9ad0fbb89a9734e81a8b1f527966f.tar.gz
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 <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/filename_util.c14
1 files 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;