* 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:
parent
47132198ad
commit
e8d6e78f34
|
@ -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>
|
Fri June 15 09:25:00 Robert Collins <rbtcollins@hotmail.com>
|
||||||
|
|
||||||
* thread.cc (pthread_cond::Signal): Release the condition access
|
* thread.cc (pthread_cond::Signal): Release the condition access
|
||||||
|
|
|
@ -928,27 +928,20 @@ fhandler_disk_file::fstat (struct stat *buf)
|
||||||
/* Using a side effect: get_file_attibutes checks for
|
/* Using a side effect: get_file_attibutes checks for
|
||||||
directory. This is used, to set S_ISVTX, if needed. */
|
directory. This is used, to set S_ISVTX, if needed. */
|
||||||
if (local.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
if (local.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
buf->st_mode |= S_IFDIR;
|
buf->st_mode = S_IFDIR;
|
||||||
if (get_symlink_p ())
|
else if (get_symlink_p ())
|
||||||
buf->st_mode |= S_IFLNK;
|
buf->st_mode = S_IFLNK;
|
||||||
if (!get_file_attribute (has_acls (),
|
else if (get_socket_p ())
|
||||||
get_win32_name (),
|
buf->st_mode = S_IFSOCK;
|
||||||
&buf->st_mode,
|
if (get_file_attribute (has_acls (), get_win32_name (), &buf->st_mode,
|
||||||
&buf->st_uid,
|
&buf->st_uid, &buf->st_gid) == 0)
|
||||||
&buf->st_gid))
|
|
||||||
{
|
{
|
||||||
/* If read-only attribute is set, modify ntsec return value */
|
/* If read-only attribute is set, modify ntsec return value */
|
||||||
if ((local.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
|
if ((local.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
|
||||||
&& !get_symlink_p ())
|
&& !get_symlink_p ())
|
||||||
buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
|
buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
|
||||||
|
|
||||||
if (buf->st_mode & S_IFMT)
|
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
|
|
||||||
buf->st_mode |= S_IFREG;
|
buf->st_mode |= S_IFREG;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -959,8 +952,10 @@ fhandler_disk_file::fstat (struct stat *buf)
|
||||||
buf->st_mode |= STD_WBITS;
|
buf->st_mode |= STD_WBITS;
|
||||||
/* | S_IWGRP | S_IWOTH; we don't give write to group etc */
|
/* | S_IWGRP | S_IWOTH; we don't give write to group etc */
|
||||||
|
|
||||||
if (buf->st_mode & S_IFMT)
|
if (buf->st_mode & S_IFDIR)
|
||||||
/* already set */;
|
buf->st_mode |= S_IFDIR | STD_XBITS;
|
||||||
|
else if (buf->st_mode & S_IFMT)
|
||||||
|
/* nothing */;
|
||||||
else if (get_socket_p ())
|
else if (get_socket_p ())
|
||||||
buf->st_mode |= S_IFSOCK;
|
buf->st_mode |= S_IFSOCK;
|
||||||
else
|
else
|
||||||
|
@ -971,10 +966,6 @@ fhandler_disk_file::fstat (struct stat *buf)
|
||||||
buf->st_mode |= S_IFCHR;
|
buf->st_mode |= S_IFCHR;
|
||||||
break;
|
break;
|
||||||
case FILE_TYPE_DISK:
|
case FILE_TYPE_DISK:
|
||||||
if (local.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
|
||||||
buf->st_mode |= S_IFDIR | STD_XBITS;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buf->st_mode |= S_IFREG;
|
buf->st_mode |= S_IFREG;
|
||||||
if (!dont_care_if_execable () && !get_execable_p ())
|
if (!dont_care_if_execable () && !get_execable_p ())
|
||||||
{
|
{
|
||||||
|
@ -999,7 +990,6 @@ fhandler_disk_file::fstat (struct stat *buf)
|
||||||
}
|
}
|
||||||
if (get_execable_p ())
|
if (get_execable_p ())
|
||||||
buf->st_mode |= STD_XBITS;
|
buf->st_mode |= STD_XBITS;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case FILE_TYPE_PIPE:
|
case FILE_TYPE_PIPE:
|
||||||
buf->st_mode |= S_IFSOCK;
|
buf->st_mode |= S_IFSOCK;
|
||||||
|
|
Loading…
Reference in New Issue