* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Nevermind. Revert

everything to previous state wrt ntsec and exec bits.
This commit is contained in:
Christopher Faylor 2002-10-23 02:32:34 +00:00
parent 082512aea1
commit 281e3b2423
2 changed files with 30 additions and 27 deletions

View File

@ -1,3 +1,8 @@
2002-10-22 Christopher Faylor <cgf@redhat.com>
* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Nevermind.
Revert everything to previous state wrt ntsec and exec bits.
2002-10-22 Christopher Faylor <cgf@redhat.com> 2002-10-22 Christopher Faylor <cgf@redhat.com>
* shared.cc (shared_info::initialize): Use correct value for version * shared.cc (shared_info::initialize): Use correct value for version

View File

@ -300,14 +300,7 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc,
else else
{ {
buf->st_mode |= S_IFREG; buf->st_mode |= S_IFREG;
} if (pc->exec_state () == dont_know_if_executable)
if (pc->exec_state () == is_executable)
buf->st_mode |= STD_XBITS;
}
if (buf->st_mode & STD_XBITS)
/* already derived */;
else if (pc->exec_state () == dont_know_if_executable)
{ {
DWORD cur, done; DWORD cur, done;
char magic[3]; char magic[3];
@ -321,16 +314,21 @@ fhandler_disk_file::fstat_helper (struct __stat64 *buf, path_conv *pc,
{ {
/* FIXME should we use /etc/magic ? */ /* FIXME should we use /etc/magic ? */
magic[0] = magic[1] = magic[2] = '\0'; magic[0] = magic[1] = magic[2] = '\0';
if (ReadFile (get_handle (), magic, 3, &done, NULL) && if (ReadFile (get_handle (), magic, 3, &done, NULL)
has_exec_chars (magic, done)) && has_exec_chars (magic, done))
{ {
set_execable_p (); set_execable_p ();
pc->set_exec (); pc->set_exec ();
buf->st_mode |= STD_XBITS; buf->st_mode |= STD_XBITS;
} }
SetFilePointer (get_handle (), cur, NULL, FILE_BEGIN); (void) SetFilePointer (get_handle (), cur, NULL, FILE_BEGIN);
} }
} }
}
if (pc->exec_state () == is_executable)
buf->st_mode |= STD_XBITS;
}
buf->st_uid = uid; buf->st_uid = uid;
buf->st_gid = gid; buf->st_gid = gid;