Changeset de691e6 in rtems


Ignore:
Timestamp:
Nov 25, 2003, 5:26:45 PM (16 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
3959276e
Parents:
ba77fe60
Message:

2003-11-25 Jennifer Averett <jennifer@…>

PR 519/filesystem

  • include/rtems/libio_.h, src/eval.c, src/rmdir.c, src/unlink.c: Check write permissions in parent directory for file or directory delete
Location:
cpukit/libcsupport
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/ChangeLog

    rba77fe60 rde691e6  
     12003-11-25      Jennifer Averett <jennifer@OARcorp.com>
     2
     3        PR 519/filesystem
     4        * include/rtems/libio_.h, src/eval.c, src/rmdir.c, src/unlink.c: Check
     5        write permissions in parent directory for file or directory delete
     6
    172003-11-22      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    28
  • cpukit/libcsupport/include/rtems/libio_.h

    rba77fe60 rde691e6  
    228228);
    229229
     230int rtems_filesystem_evaluate_parent(
     231  int                                flags,
     232  rtems_filesystem_location_info_t  *pathloc
     233);
     234
    230235void rtems_filesystem_initialize();
    231236
  • cpukit/libcsupport/src/eval.c

    rba77fe60 rde691e6  
    9898}
    9999
     100
     101int rtems_filesystem_evaluate_parent(
     102  int                                flags,
     103  rtems_filesystem_location_info_t  *pathloc
     104)
     105{
     106  rtems_filesystem_location_info_t  parent;
     107  int                               result;
     108
     109  if ( !pathloc )
     110    rtems_set_errno_and_return_minus_one( EIO );       /* should never happen */
     111 
     112  if ( !pathloc->ops->evalpath_h )
     113    rtems_set_errno_and_return_minus_one( ENOTSUP );
     114
     115  parent = *pathloc;
     116  result = (*pathloc->ops->evalpath_h)( "..", flags, &parent );
     117  if (result != 0){
     118    return -1;
     119  }
     120  rtems_filesystem_freenode( &parent );
     121
     122  return result;
     123}
     124
  • cpukit/libcsupport/src/rmdir.c

    rba77fe60 rde691e6  
    4040     return -1;
    4141
     42  result = rtems_filesystem_evaluate_parent(RTEMS_LIBIO_PERMS_WRITE, &loc );
     43  if (result != 0){
     44    rtems_filesystem_freenode( &loc );
     45    return -1;
     46  }
     47
    4248  /*
    4349   * Verify you can remove this node as a directory.
  • cpukit/libcsupport/src/unlink.c

    rba77fe60 rde691e6  
    3636     return -1;
    3737 
     38  result = rtems_filesystem_evaluate_parent(RTEMS_LIBIO_PERMS_WRITE, &loc );
     39  if (result != 0){
     40    rtems_filesystem_freenode( &loc );
     41    return -1;
     42  }
     43
    3844  if ( !loc.ops->node_type_h ) {
    3945    rtems_filesystem_freenode( &loc );
Note: See TracChangeset for help on using the changeset viewer.