comparison ffstools/tiffs-rd/basics.c @ 232:73372cfdaf7f

tiffs IVA: object name validation implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 26 Jan 2014 08:42:59 +0000
parents 5ceacdbd4490
children 43642cf7c98c
comparison
equal deleted inserted replaced
231:5ceacdbd4490 232:73372cfdaf7f
10 #include <stdlib.h> 10 #include <stdlib.h>
11 #include <unistd.h> 11 #include <unistd.h>
12 #include <string.h> 12 #include <string.h>
13 #include <strings.h> 13 #include <strings.h>
14 #include "types.h" 14 #include "types.h"
15 #include "struct.h"
15 #include "globals.h" 16 #include "globals.h"
16 17
17 u8 tiffs_header[6] = {'F', 'f', 's', '#', 0x10, 0x02}; 18 u8 tiffs_header[6] = {'F', 'f', 's', '#', 0x10, 0x02};
18 19
19 read_ffs_image() 20 read_ffs_image()
134 find_inode_block(); 135 find_inode_block();
135 printf("Active inode block (AB) is block #%d\n", index_blk_num); 136 printf("Active inode block (AB) is block #%d\n", index_blk_num);
136 alloc_inode_table(); 137 alloc_inode_table();
137 find_root_inode(); 138 find_root_inode();
138 printf("Root inode is #%x\n", root_inode); 139 printf("Root inode is #%x\n", root_inode);
139 exit(0); 140 if (validate_obj_name(root_inode, 1)) {
141 printf("Root inode (format) name: %s\n",
142 inode_info[root_inode]->dataptr);
143 exit(0);
144 } else {
145 printf("No valid name found in the root inode!\n");
146 exit(1);
147 }
140 } 148 }