4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-18 23:12:15 +08:00

* fhandler.cc (fhandler_disk_file::fstat): Properly set executable bits for

directory when !ntsec && !ntea.  Also move common code prior to call to
get_attributes.
This commit is contained in:
Christopher Faylor 2001-06-15 00:21:06 +00:00
parent 47132198ad
commit e8d6e78f34
2 changed files with 40 additions and 44 deletions

View File

@ -1,3 +1,9 @@
Thu Jun 14 20:19:46 2001 Christopher Faylor <cgf@cygnus.com>
* fhandler.cc (fhandler_disk_file::fstat): Properly set executable bits
for directory when !ntsec && !ntea. Also move common code prior to
call to get_attributes.
Fri June 15 09:25:00 Robert Collins <rbtcollins@hotmail.com>
* thread.cc (pthread_cond::Signal): Release the condition access

View File

@ -928,27 +928,20 @@ fhandler_disk_file::fstat (struct stat *buf)
/* Using a side effect: get_file_attibutes checks for
directory. This is used, to set S_ISVTX, if needed. */
if (local.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
buf->st_mode |= S_IFDIR;
if (get_symlink_p ())
buf->st_mode |= S_IFLNK;
if (!get_file_attribute (has_acls (),
get_win32_name (),
&buf->st_mode,
&buf->st_uid,
&buf->st_gid))
buf->st_mode = S_IFDIR;
else if (get_symlink_p ())
buf->st_mode = S_IFLNK;
else if (get_socket_p ())
buf->st_mode = S_IFSOCK;
if (get_file_attribute (has_acls (), get_win32_name (), &buf->st_mode,
&buf->st_uid, &buf->st_gid) == 0)
{
/* If read-only attribute is set, modify ntsec return value */
if ((local.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
&& !get_symlink_p ())
buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
if (buf->st_mode & S_IFMT)
/* already set */;
else if (get_socket_p ())
buf->st_mode |= S_IFSOCK;
else if (local.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
buf->st_mode |= S_IFDIR;
else
if (!(buf->st_mode & S_IFMT))
buf->st_mode |= S_IFREG;
}
else
@ -959,8 +952,10 @@ fhandler_disk_file::fstat (struct stat *buf)
buf->st_mode |= STD_WBITS;
/* | S_IWGRP | S_IWOTH; we don't give write to group etc */
if (buf->st_mode & S_IFMT)
/* already set */;
if (buf->st_mode & S_IFDIR)
buf->st_mode |= S_IFDIR | STD_XBITS;
else if (buf->st_mode & S_IFMT)
/* nothing */;
else if (get_socket_p ())
buf->st_mode |= S_IFSOCK;
else
@ -971,10 +966,6 @@ fhandler_disk_file::fstat (struct stat *buf)
buf->st_mode |= S_IFCHR;
break;
case FILE_TYPE_DISK:
if (local.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
buf->st_mode |= S_IFDIR | STD_XBITS;
else
{
buf->st_mode |= S_IFREG;
if (!dont_care_if_execable () && !get_execable_p ())
{
@ -999,7 +990,6 @@ fhandler_disk_file::fstat (struct stat *buf)
}
if (get_execable_p ())
buf->st_mode |= STD_XBITS;
}
break;
case FILE_TYPE_PIPE:
buf->st_mode |= S_IFSOCK;