Changeset ec9d486 in rtems
- Timestamp:
- Apr 16, 2011, 3:47:32 AM (10 years ago)
- Branches:
- 4.10
- Children:
- 701d4d84
- Parents:
- 17cc97d
- Location:
- cpukit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/ChangeLog
r17cc97d rec9d486 1 2011-04-16 Chris Johns <chrisj@rtems.org> 2 3 PR 1774/filesystem 4 * libfs/src/imfs/imfs_eval.c: Fix the IMFS eval and eval for make 5 handlers to not inspect a mounted file sytems path. 6 1 7 2011-04-04 Sebastien Bourdeauducq <sebastien.bourdeauducq@gmail.com> 2 8 -
cpukit/libfs/src/imfs/imfs_eval.c
r17cc97d rec9d486 307 307 */ 308 308 pathlen = strlen( path ); 309 309 310 /* 310 311 * Evaluate all tokens until we are done or an error occurs. … … 336 337 /* 337 338 * Am I at the root of all filesystems? (chroot'ed?) 338 339 */ 339 340 340 341 if ( pathloc->node_access == rtems_filesystem_root.node_access ) … … 342 343 343 344 344 /* 345 * Am I at the root of this mounted filesystem? 346 */ 347 348 if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){ 345 /* 346 * Am I at the root of this mounted filesystem? 347 */ 348 349 if (pathloc->node_access == 350 pathloc->mt_entry->mt_fs_root.node_access){ 349 351 350 352 /* 351 352 353 * Am I at the root of all filesystems? 354 */ 353 355 354 356 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { 355 357 break; 356 357 } else { 358 } else { 358 359 newloc = pathloc->mt_entry->mt_point_node; 359 360 *pathloc = newloc; 360 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 361 } 362 } else { 363 361 return (*pathloc->ops->evalformake_h)( &path[i], pathloc, name ); 362 } 363 } else { 364 364 if ( !node->Parent ) 365 365 rtems_set_errno_and_return_minus_one( ENOENT ); 366 366 367 367 node = node->Parent; 368 368 } 369 369 370 370 pathloc->node_access = node; … … 372 372 373 373 case IMFS_NAME: 374 375 if ( node->type == IMFS_HARD_LINK ) { 374 /* 375 * If we are at a link follow it. 376 */ 377 378 if ( node->type == IMFS_HARD_LINK ) { 376 379 377 380 result = IMFS_evaluate_link( pathloc, 0 ); … … 379 382 return -1; 380 383 381 384 } else if ( node->type == IMFS_SYM_LINK ) { 382 385 383 386 result = IMFS_evaluate_link( pathloc, 0 ); … … 385 388 if ( result == -1 ) 386 389 return -1; 387 390 } 388 391 389 392 node = pathloc->node_access; … … 393 396 /* 394 397 * Only a directory can be decended into. 395 398 */ 396 399 397 400 if ( node->type != IMFS_DIRECTORY ) 398 401 rtems_set_errno_and_return_minus_one( ENOTDIR ); 399 402 400 /* 401 * If we are at a node that is a mount point. Set loc to the 402 * new fs root node and let them finish evaluating the path. 403 */ 404 405 if ( node->info.directory.mt_fs != NULL ) { 406 newloc = node->info.directory.mt_fs->mt_fs_root; 407 *pathloc = newloc; 408 return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); 409 } 410 411 /* 412 * Otherwise find the token name in the present location. 413 */ 403 /* 404 * Otherwise find the token name in the present location. 405 */ 414 406 415 407 node = IMFS_find_match_in_dir( node, token ); 416 408 417 418 409 /* 410 * If there is no node we have found the name of the node we 419 411 * wish to create. 420 412 */ 421 413 422 414 if ( ! node ) 423 415 done = true; 424 else 416 else { 417 /* 418 * If we are at a node that is a mount point. Set loc to the 419 * new fs root node and let them finish evaluating the path. 420 */ 421 422 if ( node->info.directory.mt_fs != NULL ) { 423 newloc = node->info.directory.mt_fs->mt_fs_root; 424 *pathloc = newloc; 425 return (*pathloc->ops->evalformake_h)( &path[i], pathloc, name ); 426 } 427 425 428 pathloc->node_access = node; 426 429 } 427 430 break; 428 431 … … 559 562 newloc = pathloc->mt_entry->mt_point_node; 560 563 *pathloc = newloc; 561 return (*pathloc->ops->evalpath_h)(&(pathname[i -len]),562 pathnamelen +len,564 return (*pathloc->ops->evalpath_h)(&(pathname[i]), 565 pathnamelen, 563 566 flags,pathloc); 564 567 } 565 568 } else { 566 567 569 if ( !node->Parent ) 568 570 rtems_set_errno_and_return_minus_one( ENOENT ); 569 571 570 572 node = node->Parent; 571 pathloc->node_access = node;572 573 573 } 574 574 … … 606 606 607 607 /* 608 * Otherwise find the token name in the present location. 609 */ 610 611 node = IMFS_find_match_in_dir( node, token ); 612 613 if ( !node ) 614 rtems_set_errno_and_return_minus_one( ENOENT ); 615 616 617 /* 618 * Set the node access to the point we have found. 619 */ 620 621 pathloc->node_access = node; 622 623 /* 608 624 * If we are at a node that is a mount point. Set loc to the 609 625 * new fs root node and let them finish evaluating the path. … … 613 629 newloc = node->info.directory.mt_fs->mt_fs_root; 614 630 *pathloc = newloc; 615 return (*pathloc->ops->evalpath_h)( &pathname[i -len],616 pathnamelen +len,631 return (*pathloc->ops->evalpath_h)( &pathname[i], 632 pathnamelen, 617 633 flags, pathloc ); 618 634 } 619 620 /*621 * Otherwise find the token name in the present location.622 */623 624 node = IMFS_find_match_in_dir( node, token );625 if ( !node )626 rtems_set_errno_and_return_minus_one( ENOENT );627 628 /*629 * Set the node access to the point we have found.630 */631 632 pathloc->node_access = node;633 635 break; 634 636
Note: See TracChangeset
for help on using the changeset viewer.