You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.142
Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
This commit is contained in:
parent
e52655b4dc
commit
0abdbe5a7d
@ -146,9 +146,26 @@ namespace MonoTests.System.IO
|
||||
}
|
||||
}
|
||||
|
||||
internal const string LIBC = "libc";
|
||||
// geteuid(2)
|
||||
// uid_t geteuid(void);
|
||||
[DllImport (LIBC, SetLastError=true)]
|
||||
static extern uint geteuid ();
|
||||
|
||||
static bool RunningAsRoot // FIXME?
|
||||
{
|
||||
get {
|
||||
//return RunningOnUnix && System.Security.WindowsIdentity.GetCurrentToken () == IntPtr.Zero;
|
||||
return RunningOnUnix && geteuid () == 0;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Create_Path_ReadOnly ()
|
||||
{
|
||||
if (RunningAsRoot) // FIXME?
|
||||
Assert.Ignore ("Setting readonly in Mono does not block root writes.");
|
||||
|
||||
string path = Path.Combine (tmpFolder, "foo");
|
||||
File.Create (path).Close ();
|
||||
File.SetAttributes (path, FileAttributes.ReadOnly);
|
||||
@ -169,6 +186,8 @@ namespace MonoTests.System.IO
|
||||
[Test]
|
||||
public void Create_Path_Whitespace ()
|
||||
{
|
||||
// FIXME? This is valid on Unix and can work on Windows.
|
||||
// This test and Mono have in mind an incorrect low common denominator.
|
||||
try {
|
||||
File.Create (" ");
|
||||
Assert.Fail ("#1");
|
||||
@ -619,6 +638,9 @@ namespace MonoTests.System.IO
|
||||
[Test]
|
||||
public void GetAttributes_ReadOnly ()
|
||||
{
|
||||
if (RunningAsRoot) // FIXME?
|
||||
Assert.Ignore ("Setting readonly in Mono does not block root writes.");
|
||||
|
||||
FileAttributes attrs;
|
||||
|
||||
string path = Path.Combine (tmpFolder, "GetAttributes.tmp");
|
||||
|
Reference in New Issue
Block a user