]> git.hungrycats.org Git - linux/commitdiff
udf: Treat symlink component of type 2 as /
authorJan Kara <jack@suse.cz>
Mon, 12 Dec 2011 14:13:50 +0000 (15:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Sep 2015 11:51:55 +0000 (13:51 +0200)
commit fef2e9f3301934773e4f1b3cc5c7bffb119346b8 upstream.

Currently, we ignore symlink component of type 2. But mkisofs and other OS'
seem to treat it as / so do the same for compatibility.

Reported-by: "Gábor S." <otnaccess@hotmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
[bwh: Needed for the following fix]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/udf/symlink.c

index e28a9024eeada88f44178c56a3fa6e603d8cf20d..2d60484e5d02fe6339c9017c40f8a58f85332bd3 100644 (file)
@@ -43,10 +43,16 @@ static void udf_pc_to_char(struct super_block *sb, char *from, int fromlen,
                pc = (struct pathComponent *)(from + elen);
                switch (pc->componentType) {
                case 1:
-                       if (pc->lengthComponentIdent == 0) {
-                               p = to;
-                               *p++ = '/';
-                       }
+                       /*
+                        * Symlink points to some place which should be agreed
+                        * upon between originator and receiver of the media. Ignore.
+                        */
+                       if (pc->lengthComponentIdent > 0)
+                               break;
+                       /* Fall through */
+               case 2:
+                       p = to;
+                       *p++ = '/';
                        break;
                case 3:
                        memcpy(p, "../", 3);