]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:lib: factor out stream name asserts to helper function
authorRalph Boehme <slow@samba.org>
Wed, 25 Sep 2019 17:18:03 +0000 (10:18 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 2 Oct 2019 08:01:39 +0000 (08:01 +0000)
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>
source3/lib/filename_util.c

index 165adb116b550dcebb8a78ff68be8715e8aa3b2e..7b3fab90c46ae0c96c8c6d1497bff9ffcf791c8d 100644 (file)
@@ -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;