* fhandler_disk_file.cc (fhandler_base::open_fs): Don't allow
opening directories for writing.
This commit is contained in:
parent
e66b2c9522
commit
375c7faa4c
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user