← Back to team overview

nunit-core team mailing list archive

[Bug 631620] [NEW] UnauthorizedAccessException in DirectoryAssert

 

Public bug reported:

Running on Linux, the NUnit test method IsWithinPassesWithTempPath threw an UnauthorizedAccessException while trying to
access a restricted directory.

This is because DirectoryAssert.IsWithin checks against _all_ existing
paths under the expected root and can happen in any instance where the
path is not accessible.

DirectoryAssert is already deprecated and this indicates that it's
obsolescence should be accelerated. A simple solution would be to use
one of the PathConstraints in its implementation so that no access to
actual directories is required.

** Affects: nunitv2
     Importance: Medium
     Assignee: Charlie Poole (charlie.poole)
         Status: In Progress

** Changed in: nunitv2
       Status: New => In Progress

** Changed in: nunitv2
     Assignee: (unassigned) => Charlie Poole (charlie.poole)

** Changed in: nunitv2
   Importance: Undecided => Medium

** Changed in: nunitv2
    Milestone: None => 2.5.8

-- 
UnauthorizedAccessException in DirectoryAssert
https://bugs.launchpad.net/bugs/631620
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.

Status in NUnit V2 Test Framework: In Progress

Bug description:
Running on Linux, the NUnit test method IsWithinPassesWithTempPath threw an UnauthorizedAccessException while trying to
access a restricted directory.

This is because DirectoryAssert.IsWithin checks against _all_ existing paths under the expected root and can happen in any instance where the path is not accessible.

DirectoryAssert is already deprecated and this indicates that it's obsolescence should be accelerated. A simple solution would be to use one of the PathConstraints in its implementation so that no access to actual directories is required.





Follow ups

References