* dir.cc (rmdir): Streamline. Detect attempts to remove directories from

"read-only" virtual devices.  (Suggested by Pavel Tsekov)
* syscalls.cc (unlink): Detect attempts to remove directories from "read-only"
virtual devices.  (From Pavel Tsekov)
This commit is contained in:
Christopher Faylor
2002-06-05 16:01:55 +00:00
parent 2bb6b3e506
commit ea4e6ec8f9
3 changed files with 34 additions and 26 deletions

View File

@@ -94,6 +94,7 @@ extern "C" int
_unlink (const char *ourname)
{
int res = -1;
DWORD devn;
sigframe thisframe (mainthread);
path_conv win32_name (ourname, PC_SYM_NOFOLLOW | PC_FULL);
@@ -104,6 +105,13 @@ _unlink (const char *ourname)
goto done;
}
if ((devn = win32_name.get_devn ()) == FH_PROC || devn == FH_REGISTRY
|| devn == FH_PROCESS)
{
set_errno (EROFS);
goto done;
}
syscall_printf ("_unlink (%s)", win32_name.get_win32 ());
if (!win32_name.exists ())