* tar.c (tar_read_header): Fix pathname canonicalization.

This commit is contained in:
Roland Illig 2004-11-01 07:49:36 +00:00
parent 5b57056d23
commit 75ec336c52
2 changed files with 5 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2004-11-01 Leonard den Ottolander <leonard * den ottolander nl>
* tar.c (tar_read_header): Fix pathname canonicalization.
2004-10-29 Pavel S. Shirshov <me@pavelsh.pp.ru>
* extfs/iso9660.in (mcisofs_list): Fix regular expression for stripping

View File

@ -465,10 +465,8 @@ tar_read_header (struct vfs_class *me, struct vfs_s_super *archive,
current_file_name =
(next_long_name ? next_long_name :
g_strdup (header->header.arch_name));
canonicalize_pathname (current_file_name);
len = strlen (current_file_name);
if (current_file_name[len - 1] == '/') {
current_file_name[len - 1] = 0;
}
data_position = current_tar_position;
@ -479,13 +477,7 @@ tar_read_header (struct vfs_class *me, struct vfs_s_super *archive,
} else {
*(p++) = 0;
q = current_file_name;
/* FIXME: should be q = vfs_normalize_dir(q) */
while (q[0] == '.' && q[1] == '/')
q += 2;
if (*q == '.' && *(q+1) == '\0')
q++;
}
canonicalize_pathname(q);
parent =
vfs_s_find_inode (me, archive, q, LINK_NO_FOLLOW, FL_MKDIR);