summaryrefslogtreecommitdiff
path: root/core/fs
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2011-04-04 16:14:37 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2011-04-04 16:14:37 -0700
commit7557067a64696f1136952a8815562e670205b38c (patch)
treeafe9e7bb57c9bc4619f823b2cdcba3c28052035f /core/fs
parentca785c7e715a74dac0fd8e537ef8cf4e5a655171 (diff)
downloadsyslinux-7557067a64696f1136952a8815562e670205b38c.tar.gz
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@linux.intel.com>
Diffstat (limited to 'core/fs')
-rw-r--r--core/fs/iso9660/iso9660.c50
1 files changed, 1 insertions, 49 deletions
diff --git a/core/fs/iso9660/iso9660.c b/core/fs/iso9660/iso9660.c
index 5c04528e..3cd3ac46 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,