* 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:
@@ -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 ())
|
||||
|
Reference in New Issue
Block a user