]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: selftest: Add share definition [bad_iconv] in fileserver.
authorJeremy Allison <jra@samba.org>
Mon, 11 May 2020 21:10:54 +0000 (14:10 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 12 May 2020 19:53:46 +0000 (19:53 +0000)
Creates a utf8 valid filename within that is invalid in CP850.
Useful to test smbclient list directory character set conversions.

https://bugzilla.samba.org/show_bug.cgi?id=14374

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
selftest/target/Samba3.pm

index 083846c87b6af6d1bdda888927c9ca4b4705e832..e988ef7210bc45be4d9023c40d9ff81874ec9e1b 100755 (executable)
@@ -1287,6 +1287,9 @@ sub setup_fileserver
        my $dropbox_sharedir="$share_dir/dropbox";
        push(@dirs,$dropbox_sharedir);
 
+       my $bad_iconv_sharedir="$share_dir/bad_iconv";
+       push(@dirs, $bad_iconv_sharedir);
+
        my $ip4 = Samba::get_ipv4_addr("FILESERVER");
        my $fileserver_options = "
        kernel change notify = yes
@@ -1382,6 +1385,11 @@ sub setup_fileserver
        writeable = yes
        vfs objects =
 
+[bad_iconv]
+       path = $bad_iconv_sharedir
+       comment = smb username is [%U]
+       vfs objects =
+
 [homes]
        comment = Home directories
        browseable = No
@@ -1454,6 +1462,11 @@ sub setup_fileserver
        ##
        create_file_chmod("$valid_users_sharedir/foo", 0644) or return undef;
 
+       ##
+       ## create a valid utf8 filename which is invalid as a CP850 conversion
+       ##
+       create_file_chmod("$bad_iconv_sharedir/\xED\x9F\xBF", 0644) or return undef;
+
        return $vars;
 }