lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Mar 2010 13:32:57 +0100
From:	Philippe De Muyter <phdm@...qel.be>
To:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH vfat] allow retrieving entries with trailing dots

Hello Ogawa,

This fixes accessing vfat entries with trailing dots created by an external
vfat driver (like the one in IOMEGA home network hard drives)

Philippe

--

Some vfat-formatted network disks that are also usb disk do not discard
trailing dots when creating files or directories via ftp.
Connecting afterwards this drive via usb to a linux machine leads to the
following problem :
if one issues the `ls' or `find' command, one gets this message :

find: ./Simon_&_Garfunkel-Wednesday_Morning,_3_a.m.: No such file or directory

Fix that by first trying to retrieve the entry with the full name, and only if
that fails and there are trailing dots in the searched name, try then to find
the truncated name.

Signed-off-by: Philippe De Muyter <phdm@...qel.be>

--- a/fs/fat/namei_vfat.c	2009-09-10 00:13:59.000000000 +0200
+++ b/fs/fat/namei_vfat.c	2010-02-08 02:28:37.010096903 +0100
@@ -702,9 +702,22 @@
 static int vfat_find(struct inode *dir, struct qstr *qname,
 		     struct fat_slot_info *sinfo)
 {
-	unsigned int len = vfat_striptail_len(qname);
+	int err;
+	unsigned int len;
+
+	/* Some combined ethernet + usb external hard drive do not
+	 * remove the trailing dots when creating entries in ethernet mode.
+	 * (e.g. Iomega Home Network Hard Drive)
+	 * Make accessing those entries possible.
+	 */
+	err = fat_search_long(dir, qname->name, qname->len, sinfo);
+	if (!err)
+		return err;
+	len = vfat_striptail_len(qname);
 	if (len == 0)
 		return -ENOENT;
+	if (len == qname->len)
+		return err;
 	return fat_search_long(dir, qname->name, len, sinfo);
 }
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ