* fhandler.cc (fhandler_base::open): Set win32 access flags

to 0, when requested.
* fhandler.h: New status flag FH_QUERYOPEN.
(fhandler::get_query_open): New function.
(fhandler::set_query_open): Ditto.
* syscalls.cc (stat_worker): Request query-only open mode.
This commit is contained in:
Egor Duda 2001-06-14 18:21:17 +00:00
parent c66261a731
commit 96d95e535e
4 changed files with 39 additions and 20 deletions

View File

@ -1,3 +1,12 @@
2001-06-14 Egor Duda <deo@logos-m.ru>
* fhandler.cc (fhandler_base::open): Set win32 access flags
to 0, when requested.
* fhandler.h: New status flag FH_QUERYOPEN.
(fhandler::get_query_open): New function.
(fhandler::set_query_open): Ditto.
* syscalls.cc (stat_worker): Request query-only open mode.
2001-06-12 Egor Duda <deo@logos-m.ru> 2001-06-12 Egor Duda <deo@logos-m.ru>
* environ.cc (set_file_api_mode): New function. Move setting * environ.cc (set_file_api_mode): New function. Move setting

View File

@ -308,7 +308,11 @@ fhandler_base::open (int flags, mode_t mode)
goto done; goto done;
} }
if (get_device () == FH_TAPE) if (get_query_open ())
{
access = 0;
}
else if (get_device () == FH_TAPE)
{ {
access = GENERIC_READ | GENERIC_WRITE; access = GENERIC_READ | GENERIC_WRITE;
} }

View File

@ -62,18 +62,20 @@ enum
FH_SYMLINK = 0x00100000, /* is a symlink */ FH_SYMLINK = 0x00100000, /* is a symlink */
FH_EXECABL = 0x00200000, /* file looked like it would run: FH_EXECABL = 0x00200000, /* file looked like it would run:
* ends in .exe or .bat or begins with #! */ * ends in .exe or .bat or begins with #! */
FH_W95LSBUG= 0x00400000, /* set when lseek is called as a flag that FH_W95LSBUG = 0x00400000, /* set when lseek is called as a flag that
* _write should check if we've moved beyond * _write should check if we've moved beyond
* EOF, zero filling if so. */ * EOF, zero filling if so. */
FH_NOFRNAME= 0x00800000, /* Set if shouldn't free unix_path_name and FH_NOFRNAME = 0x00800000, /* Set if shouldn't free unix_path_name and
windows_path_name_ on destruction. */ windows_path_name_ on destruction. */
FH_NOEINTR = 0x01000000, /* Set if I/O should be uninterruptible. */ FH_NOEINTR = 0x01000000, /* Set if I/O should be uninterruptible. */
FH_FFIXUP = 0x02000000, /* Set if need to fixup after fork. */ FH_FFIXUP = 0x02000000, /* Set if need to fixup after fork. */
FH_LOCAL = 0x04000000, /* File is unix domain socket */ FH_LOCAL = 0x04000000, /* File is unix domain socket */
FH_FIFO = 0x08000000, /* File is FIFO */ FH_FIFO = 0x08000000, /* File is FIFO */
FH_ISREMOTE= 0x10000000, /* File is on a remote drive */ FH_ISREMOTE = 0x10000000, /* File is on a remote drive */
FH_DCEXEC = 0x20000000, /* Don't care if this is executable */ FH_DCEXEC = 0x20000000, /* Don't care if this is executable */
FH_HASACLS = 0x40000000, /* True if fs of file has ACLS */ FH_HASACLS = 0x40000000, /* True if fs of file has ACLS */
FH_QUERYOPEN = 0x80000000, /* open file without requesting either read
or write access */
/* Device flags */ /* Device flags */
@ -252,6 +254,9 @@ public:
void set_append_p (int val) { FHCONDSETF (val, APPEND); } void set_append_p (int val) { FHCONDSETF (val, APPEND); }
void set_append_p () { FHSETF (APPEND); } void set_append_p () { FHSETF (APPEND); }
int get_query_open () { return FHISSETF (QUERYOPEN); }
void set_query_open (int val) { FHCONDSETF (val, QUERYOPEN); }
int get_readahead_valid () { return raixget < ralen; } int get_readahead_valid () { return raixget < ralen; }
int puts_readahead (const char *s, size_t len = (size_t) -1); int puts_readahead (const char *s, size_t len = (size_t) -1);
int put_readahead (char value); int put_readahead (char value);

View File

@ -1048,6 +1048,7 @@ stat_worker (const char *caller, const char *name, struct stat *buf,
&& dtype != DRIVE_NO_ROOT_DIR && dtype != DRIVE_NO_ROOT_DIR
&& dtype != DRIVE_UNKNOWN))) && dtype != DRIVE_UNKNOWN)))
{ {
fh.set_query_open (TRUE);
oret = fh.open (real_path, O_RDONLY | O_BINARY | O_DIROPEN | oret = fh.open (real_path, O_RDONLY | O_BINARY | O_DIROPEN |
(nofollow ? O_NOSYMLINK : 0), 0); (nofollow ? O_NOSYMLINK : 0), 0);
/* Check a special case here. If ntsec is ON it happens /* Check a special case here. If ntsec is ON it happens