[X2Go-Commits] [x2gothinclient] 01/01: usbmount/x2gousbmount: remove uni_xlate from ntfs and vfat mounts, add utf8 option to vfat mounts and document this choice.

git-admin at x2go.org git-admin at x2go.org
Thu Jan 24 08:45:54 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gothinclient.

commit bcfdb18f124b2dd09facc826b523184a47626395
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Jan 24 08:45:10 2019 +0100

    usbmount/x2gousbmount: remove uni_xlate from ntfs and vfat mounts, add utf8 option to vfat mounts and document this choice.
---
 debian/changelog      |  2 ++
 usbmount/x2gousbmount | 54 ++++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 6ba6b2d..10c72de 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ x2gothinclient (1.5.0.1-0x2go1) UNRELEASED; urgency=medium
   * usbmount/x2gousbmount:
     - Whitespace- and comment-only changes.
     - Rework x2gothinclientd check.
+    - Remove uni_xlate from ntfs and vfat mounts, add utf8 option to vfat
+      mounts and document this choice.
 
   [ Stefan Baur ]
   * New upstream release (1.5.0.1):
diff --git a/usbmount/x2gousbmount b/usbmount/x2gousbmount
index fca56ee..8eb4939 100755
--- a/usbmount/x2gousbmount
+++ b/usbmount/x2gousbmount
@@ -157,14 +157,62 @@ if ((check_x2gothinclientmode()) || (-x "/lib/live/config/2900-x2go-thinclientco
 
 		# mount the USB device
 		# sync is supported by all file systems
+		#
 		# uid is supported by vfat (via fat),ntfs,hfs,hpfs
-		# uni_xlate is supported by vfat,ntfs
+		#
+		# uni_xlate is supported by vfat and supposed to change "unhandled"
+		# Unicode characters into escape sequences; otherwise, such
+		# characters are replaced by a verbatim question mark, triggering
+		# information loss. Very old versions of ntfs used to "support" this
+		# option, but historic documents mention that it was broken and
+		# removed some time in the Linux 2.4 days.
+		# Character set handling under FAT is complicated to begin with.
+		# Apparently, 8.3 short file names (which really are the low-level
+		# and most compatible representation of file names) are always
+		# encoded with a specific 8-bit codepage - importantly, multi-byte
+		# encodings are not supported. This specific codepage can either be
+		# the default one set in the Linux kernel or any other supported one
+		# selected via the codepage=... mount option.
+		# Long file names are stored in "Unicode format" according to the
+		# kernel documentation, which seems to really be raw UCS-2, i.e.,
+		# the raw 2-byte-value of a code point. Consequently, only characters
+		# in the Basic Multilingual Plane (BMP) can be used in long file
+		# names and each file is restricted to a character length of at most
+		# 255, with the additional restriction of at most 256 characters per
+		# path. This "encoding" could be problematic since code points
+		# outside of the BMP are being used more and more nowadays, but most
+		# users should still be fine.
+		# Typically, systems are not using the UCS-2, but a different
+		# encoding like UTF-8 or UTF-16. These encodings can handle the full
+		# Unicode block, also code points after the BMP. Hence, the kernel
+		# has to perform some kind of conversion from UCS-2 to the desired
+		# encoding, which again can either be the default one set in the
+		# kernel or any other supported one set through the iocharset=...
+		# mount option.
+		# At that point, things get tricky. (V)FAT is typically a case-
+		# insensitive file system, which means that lower- and uppercase
+		# versions of a character should be handled as the same character.
+		# The Linux kernel developers do not want to store a lower- to
+		# uppercase mapping for the full Unicode set of characters, though,
+		# for space and performance reasons. Hence, file systems mounted via
+		# iocharset=utf8 will be completely case-sensitive. To work around
+		# that problem, another option called 'utf8' exists, which can be
+		# used in conjunction with an 8-bit encoding iocharset option.
+		# Apparently, with such a setup the kernel returns UTF-8-encoded
+		# data, but internal name mangling operations are carried out in the
+		# given iocharset encoding. Such a scenario is most useful when
+		# setting the iocharset parameter to an encoding for which lower-
+		# and uppercase pairs are defined properly.
+		# Enabling uni_xlate disables utf8 and is only useful when using
+		# an iocharset encoding not covering the UCS-2 range. We do not want
+		# to use this.
+		#
 		# we must not trigger on iso9660 and udf, or else hybrid USB media
 		# would only cause a mount of the iso9660 raw device,
 		# blocking the mount of individual partitions
 		# real optical media ->x2gocdmanager/x2gothinclient-cdmanager package
 
-		if (system("mount -tntfs $dev /media/$name/$ldev -o uid=$user,sync,uni_xlate") == 0)
+		if (system("mount -tntfs $dev /media/$name/$ldev -o uid=$user,sync") == 0)
 		{
 			syslog('notice', "USB device $name ($ldev) successfully mounted (ntfs detected)");
 			# if mounted, inform x2goclient about it...
@@ -173,7 +221,7 @@ if ((check_x2gothinclientmode()) || (-x "/lib/live/config/2900-x2go-thinclientco
 			print D "export=/media/$name/$ldev\n";
 			close (D);
 		}
-		elsif (system("mount -tvfat $dev /media/$name/$ldev -o uid=$user,sync,uni_xlate") == 0)
+		elsif (system("mount -tvfat $dev /media/$name/$ldev -o uid=$user,sync,utf8") == 0)
 		{
 			syslog('notice', "USB device $name ($ldev) successfully mounted (vfat detected)");
 			# if mounted, inform x2goclient about it...

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gothinclient.git


More information about the x2go-commits mailing list