#include "ext2_fs.h"
#include "ext2fs.h"
+#include "ext2fsP.h"
struct dir_list {
char *name;
struct dir_list *list = 0, *new_list = 0;
struct dir_list *current;
char *ret_path = 0;
+ int level = 0;
/*
* Add the starting directories to search...
if (list == 0) {
list = new_list;
new_list = 0;
+ /* Avoid infinite loop */
+ if (++level >= EXT2FS_MAX_NESTED_LINKS)
+ break;
}
}
free_dirlist(&list);
#include "ext2_fs.h"
#include "ext2fs.h"
+#include "ext2fsP.h"
static errcode_t open_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t base,
const char *pathname, size_t pathlen, int follow,
*res_inode = inode;
return 0;
}
- if (link_count++ > 5) {
+ if (link_count++ >= EXT2FS_MAX_NESTED_LINKS)
return EXT2_ET_SYMLINK_LOOP;
- }
+
/* FIXME-64: Actually, this is FIXME EXTENTS */
if (ext2fs_inode_data_blocks(fs,&ei)) {
retval = ext2fs_get_mem(fs->blocksize, &buffer);