Imported Upstream version 5.18.0.142

Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-09 08:20:59 +00:00
parent e52655b4dc
commit 0abdbe5a7d
1547 changed files with 93792 additions and 47893 deletions

View File

@ -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");