[syslinux:master] iso9660: use generic_mangle_name

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Mon Apr 4 16:18:01 PDT 2011


Commit-ID:  7557067a64696f1136952a8815562e670205b38c
Gitweb:     http://syslinux.zytor.com/commit/7557067a64696f1136952a8815562e670205b38c
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Mon, 4 Apr 2011 16:14:37 -0700
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Mon, 4 Apr 2011 16:14:37 -0700

iso9660: use generic_mangle_name

There is no longer any need to do special name-mangling for iso9660,
and doing so, in fact, breaks the handling of paths starting with ../.

Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>


---
 core/fs/iso9660/iso9660.c |   50 +--------------------------------------------
 1 files changed, 1 insertions(+), 49 deletions(-)

diff --git a/core/fs/iso9660/iso9660.c b/core/fs/iso9660/iso9660.c
index 5c04528..3cd3ac4 100644
--- a/core/fs/iso9660/iso9660.c
+++ b/core/fs/iso9660/iso9660.c
@@ -27,54 +27,6 @@ static inline struct iso_sb_info *ISO_SB(struct fs_info *fs)
     return fs->fs_info;
 }
 
-/*
- * Mangle a filename pointed to by src into a buffer pointed
- * to by dst; ends on encountering any whitespace.
- * dst is preserved.
- *
- * This verifies that a filename is < FilENAME_MAX characters,
- * doesn't contain whitespace, zero-pads the output buffer,
- * and removes trailing dots and redumndant slashes, so "repe
- * cmpsb" can do a compare, and the path-searching routine gets
- * a bit of an easier job.
- *
- */
-static void iso_mangle_name(char *dst, const char *src)
-{
-    char *p = dst;
-    int i = FILENAME_MAX - 1;
-
-    while (not_whitespace(*src)) {
-        if ( *src == '/' ) {
-            if ( *(src+1) == '/' ) {
-                i--;
-                src++;
-                continue;
-            }
-        }
-
-        *dst++ = *src ++;
-        i--;
-    }
-
-    while ( 1 ) {
-        if ( dst == p )
-            break;
-
-        if ( (*(dst-1) != '.') && (*(dst-1) != '/') )
-            break;
-	if ((dst[-1] == '/') && ((dst - 1) == p))
-	    break;
-
-        dst --;
-        i ++;
-    }
-
-    i ++;
-    for (; i > 0; i -- )
-        *dst++ = '\0';
-}
-
 static size_t iso_convert_name(char *dst, const char *src, int len)
 {
     char *p = dst;
@@ -340,7 +292,7 @@ const struct fs_ops iso_fs_ops = {
     .searchdir     = NULL, 
     .getfssec      = generic_getfssec,
     .close_file    = generic_close_file,
-    .mangle_name   = iso_mangle_name,
+    .mangle_name   = generic_mangle_name,
     .load_config   = iso_load_config,
     .iget_root     = iso_iget_root,
     .iget          = iso_iget,



More information about the Syslinux-commits mailing list