* fhandler.cc (fhandler_base::fhaccess): Add check for R/O file system.

* security.cc (check_registry_access): Set errno to EROFS when checking
	for W_OK.
This commit is contained in:
Corinna Vinschen
2007-07-17 14:39:02 +00:00
parent a58a8938cc
commit 52a6e6d8c7
3 changed files with 16 additions and 1 deletions

View File

@ -443,6 +443,12 @@ fhandler_base::fhaccess (int flags)
eaccess_done:
set_errno (EACCES);
done:
if (!res && (flags & W_OK) && get_device () == FH_FS
&& (pc.fs_flags () & FILE_READ_ONLY_VOLUME))
{
set_errno (EROFS);
res = -1;
}
debug_printf ("returning %d", res);
return res;
}