summaryrefslogtreecommitdiffstats
path: root/src/dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-10-25 08:08:05 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-10-25 08:08:05 +0200
commit55b6af72342882f912dfe5ef767d537a7a328279 (patch)
treec55d0eaccf0990f4f9c76d0c6febd3ac8e66b641 /src/dir.c
parentc82323c870a69afefd33c6aa0fe7b32a644660d6 (diff)
Don't follow ".." when listing the whole filesystem
Diffstat (limited to 'src/dir.c')
-rw-r--r--src/dir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dir.c b/src/dir.c
index 276dbc5..3fe8cf1 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -311,6 +311,8 @@ static int dir_whole_partition_log_aux(disk_t *disk, const partition_t *partitio
for(i=0;i<dir_nbr && new_inode_ok!=0;i++)
if(new_inode==inode_known[i]) /* Avoid loop */
new_inode_ok=0;
+ if(strcmp(current_file->name, "..")==0)
+ new_inode_ok=0;
if(new_inode_ok>0)
{
if(strlen(dir_data->current_directory)+1+strlen(current_file->name)<sizeof(dir_data->current_directory)-1)