diff options
author | Corey Berla <corey@berla.me> | 2022-12-24 12:25:21 -0800 |
---|---|---|
committer | Corey Berla <corey@berla.me> | 2022-12-24 22:04:28 +0000 |
commit | a8a4288e0cfbc5684c76e7fedbaf3e7fb1fa8faf (patch) | |
tree | 83f8b00b9c6c125d9025080575a6a816d40ff8e6 /src | |
parent | a895fda83495c94a49f05ba9c37b7ca00fad0813 (diff) | |
download | nautilus-a8a4288e0cfbc5684c76e7fedbaf3e7fb1fa8faf.tar.gz |
file-operation: Apply FAT filename rules to samba shares
We check if a filesystem is FAT, NTFS, etc in order to apply windows
based filename rules, but if we are copying to a smb share, those filesystem
checks aren't performed. The simple solution is to check the "cifs"
filetype also, but this fails because the filesystem_type is never
checked since the smb share doesn't return the error INVALID_FILENAME.
Instead it returns INVALID_ARGUMENT (and NOT_DIRECTORY for '\').
Since we are not handling those errors anyways, to be safe let's handle
it the same way we do INVALID_FILENAME
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-file-operations.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c index b690ec2f2..1f62e3fd8 100644 --- a/src/nautilus-file-operations.c +++ b/src/nautilus-file-operations.c @@ -4307,6 +4307,7 @@ make_file_name_valid_for_dest_fs (char *filename, !strcmp (dest_fs_type, "fuse") || !strcmp (dest_fs_type, "ntfs") || !strcmp (dest_fs_type, "msdos") || + !strcmp (dest_fs_type, "cifs") || !strcmp (dest_fs_type, "msdosfs")) { gboolean ret; @@ -5595,8 +5596,13 @@ retry: return; } + /* On smb shares INVALID_ARGUMENT is typically returned instead of INVALID_FILENAME + * (i.e. FAT_FORBIDDEN_CHARACTER) except with '\' where NOT_DIRECTORY is returned + */ if (!handled_invalid_filename && - IS_IO_ERROR (error, INVALID_FILENAME)) + (IS_IO_ERROR (error, INVALID_FILENAME) || + IS_IO_ERROR (error, INVALID_ARGUMENT) || + IS_IO_ERROR (error, NOT_DIRECTORY))) { handled_invalid_filename = TRUE; |