* fhandler_disk_file.cc (fhandler_base::open_fs): Don't allow

opening directories for writing.
This commit is contained in:
Corinna Vinschen 2005-01-06 17:43:55 +00:00
parent e66b2c9522
commit 375c7faa4c
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-01-06 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_base::open_fs): Don't allow
opening directories for writing.
2005-01-06 Christopher Faylor <cgf@timesys.com>
* timer.cc (timer_thread): Pass sigev pointer value as per SuSv3 rather

View File

@ -568,6 +568,14 @@ fhandler_base::open_fs (int flags, mode_t mode)
return 0;
}
/* Unfortunately NT allows to open directories for writing, but that's
disallowed according to SUSv3. */
if (pc.isdir () && (flags & (O_WRONLY | O_RDWR)))
{
set_errno (EISDIR);
return 0;
}
int res = fhandler_base::open (flags | O_DIROPEN, mode);
if (!res)
goto out;