forked from Imagelibrary/rtems
Patch from Wayne Bullaughey <wayne@wmi.com>. Comments follow:
I'm working on code to mount my host based file system on the base file system (imfs) and have a suggestion for a change to eval.c in the c/src/lib/libc directory of the 8/20/1999 snapshot. The current version does not test the result value returned from the evalpath callback (line 47) in the case where follow_link is true. Attached is my suggested change. Without this test the node_type callback may be called after evalpath failed. node_type could set the type to some value other then RTEMS_FILESYSTEM_HARD_LINK or RTEMS_FILESYSTEM_SYM_LINK but it seems cleaner to add the check on result.
This commit is contained in:
@@ -51,7 +51,7 @@ int rtems_filesystem_evaluate_path(
|
|||||||
* not.
|
* not.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( follow_link ) {
|
if ( (result == 0) && follow_link ) {
|
||||||
|
|
||||||
if ( !pathloc->ops->node_type )
|
if ( !pathloc->ops->node_type )
|
||||||
set_errno_and_return_minus_one( ENOTSUP );
|
set_errno_and_return_minus_one( ENOTSUP );
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ int rtems_filesystem_evaluate_path(
|
|||||||
* not.
|
* not.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( follow_link ) {
|
if ( (result == 0) && follow_link ) {
|
||||||
|
|
||||||
if ( !pathloc->ops->node_type )
|
if ( !pathloc->ops->node_type )
|
||||||
set_errno_and_return_minus_one( ENOTSUP );
|
set_errno_and_return_minus_one( ENOTSUP );
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ int rtems_filesystem_evaluate_path(
|
|||||||
* not.
|
* not.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( follow_link ) {
|
if ( (result == 0) && follow_link ) {
|
||||||
|
|
||||||
if ( !pathloc->ops->node_type )
|
if ( !pathloc->ops->node_type )
|
||||||
set_errno_and_return_minus_one( ENOTSUP );
|
set_errno_and_return_minus_one( ENOTSUP );
|
||||||
|
|||||||
Reference in New Issue
Block a user