* errno.cc (errmap): Map ERROR_BAD_NET_RESP to ENOSYS.
* fhandler_disk_file.cc (fhandler_disk_file::facl): Handle ENOSYS and point to the explanation. * ntdll.h (STATUS_NOT_IMPLEMENTED): Define. * path.cc (symlink_info::check): Handle the inability of NT4 to use FileNetworkOpenInformation on share root dirs in either direction. * path.h (slash_unc_prefix_p): Remove unused declaration. * security.cc (get_info_from_sd): Handle ENOSYS from get_file_sd. Explain when this happens.
This commit is contained in:
parent
b375557956
commit
3498f76deb
@ -1,3 +1,15 @@
|
|||||||
|
2010-09-24 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* errno.cc (errmap): Map ERROR_BAD_NET_RESP to ENOSYS.
|
||||||
|
* fhandler_disk_file.cc (fhandler_disk_file::facl): Handle ENOSYS and
|
||||||
|
point to the explanation.
|
||||||
|
* ntdll.h (STATUS_NOT_IMPLEMENTED): Define.
|
||||||
|
* path.cc (symlink_info::check): Handle the inability of NT4 to use
|
||||||
|
FileNetworkOpenInformation on share root dirs in either direction.
|
||||||
|
* path.h (slash_unc_prefix_p): Remove unused declaration.
|
||||||
|
* security.cc (get_info_from_sd): Handle ENOSYS from get_file_sd.
|
||||||
|
Explain when this happens.
|
||||||
|
|
||||||
2010-09-23 Christopher Faylor <me+cygwin@cgf.cx>
|
2010-09-23 Christopher Faylor <me+cygwin@cgf.cx>
|
||||||
|
|
||||||
* autoload.cc (std_dll_init): Use correct format type when displaying
|
* autoload.cc (std_dll_init): Use correct format type when displaying
|
||||||
|
@ -39,6 +39,7 @@ static NO_COPY struct
|
|||||||
X (BAD_DEVICE, ENODEV),
|
X (BAD_DEVICE, ENODEV),
|
||||||
X (BAD_NETPATH, ENOENT),
|
X (BAD_NETPATH, ENOENT),
|
||||||
X (BAD_NET_NAME, ENOENT),
|
X (BAD_NET_NAME, ENOENT),
|
||||||
|
X (BAD_NET_RESP, ENOSYS),
|
||||||
X (BAD_PATHNAME, ENOENT),
|
X (BAD_PATHNAME, ENOENT),
|
||||||
X (BAD_PIPE, EINVAL),
|
X (BAD_PIPE, EINVAL),
|
||||||
X (BAD_UNIT, ENODEV),
|
X (BAD_UNIT, ENODEV),
|
||||||
|
@ -1054,9 +1054,15 @@ cant_access_acl:
|
|||||||
set_errno(EFAULT);
|
set_errno(EFAULT);
|
||||||
else
|
else
|
||||||
res = getacl (get_stat_handle (), pc, nentries, aclbufp);
|
res = getacl (get_stat_handle (), pc, nentries, aclbufp);
|
||||||
|
/* For this ENOSYS case, see security.cc:get_file_attribute(). */
|
||||||
|
if (res == -1 && get_errno () == ENOSYS)
|
||||||
|
goto cant_access_acl;
|
||||||
break;
|
break;
|
||||||
case GETACLCNT:
|
case GETACLCNT:
|
||||||
res = getacl (get_stat_handle (), pc, 0, NULL);
|
res = getacl (get_stat_handle (), pc, 0, NULL);
|
||||||
|
/* Ditto. */
|
||||||
|
if (res == -1 && get_errno () == ENOSYS)
|
||||||
|
goto cant_access_acl;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
set_errno (EINVAL);
|
set_errno (EINVAL);
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
define to avoid warnings. */
|
define to avoid warnings. */
|
||||||
#define STATUS_INVALID_INFO_CLASS ((NTSTATUS) 0xc0000003)
|
#define STATUS_INVALID_INFO_CLASS ((NTSTATUS) 0xc0000003)
|
||||||
#endif
|
#endif
|
||||||
|
#define STATUS_NOT_IMPLEMENTED ((NTSTATUS) 0xc0000002)
|
||||||
#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS) 0xc0000004)
|
#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS) 0xc0000004)
|
||||||
#define STATUS_INVALID_PARAMETER ((NTSTATUS) 0xc000000d)
|
#define STATUS_INVALID_PARAMETER ((NTSTATUS) 0xc000000d)
|
||||||
#define STATUS_NO_SUCH_FILE ((NTSTATUS) 0xc000000f)
|
#define STATUS_NO_SUCH_FILE ((NTSTATUS) 0xc000000f)
|
||||||
|
@ -2421,6 +2421,23 @@ restart:
|
|||||||
{
|
{
|
||||||
status = NtQueryInformationFile (h, &io, pfnoi, sizeof *pfnoi,
|
status = NtQueryInformationFile (h, &io, pfnoi, sizeof *pfnoi,
|
||||||
FileNetworkOpenInformation);
|
FileNetworkOpenInformation);
|
||||||
|
if ((status == STATUS_INVALID_PARAMETER
|
||||||
|
|| status == STATUS_NOT_IMPLEMENTED)
|
||||||
|
&& RtlEqualUnicodePathPrefix (&upath, &ro_u_uncp, FALSE))
|
||||||
|
{
|
||||||
|
/* This occurs when accessing SMB share root dirs hosted on
|
||||||
|
NT4 (STATUS_INVALID_PARAMETER), or when trying to access
|
||||||
|
SMB share root dirs from NT4 (STATUS_NOT_IMPLEMENTED). */
|
||||||
|
status = NtQueryInformationFile (h, &io, &fbi, sizeof fbi,
|
||||||
|
FileBasicInformation);
|
||||||
|
if (NT_SUCCESS (status))
|
||||||
|
{
|
||||||
|
memcpy (pfnoi, &fbi, 4 * sizeof (LARGE_INTEGER));
|
||||||
|
pfnoi->EndOfFile.QuadPart
|
||||||
|
= pfnoi->AllocationSize.QuadPart = 0;
|
||||||
|
pfnoi->FileAttributes = fbi.FileAttributes;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (NT_SUCCESS (status))
|
if (NT_SUCCESS (status))
|
||||||
fileattr = pfnoi->FileAttributes;
|
fileattr = pfnoi->FileAttributes;
|
||||||
}
|
}
|
||||||
|
@ -343,8 +343,6 @@ class path_conv
|
|||||||
/* Interix symlink marker */
|
/* Interix symlink marker */
|
||||||
#define INTERIX_SYMLINK_COOKIE "IntxLNK\1"
|
#define INTERIX_SYMLINK_COOKIE "IntxLNK\1"
|
||||||
|
|
||||||
int __stdcall slash_unc_prefix_p (const char *path) __attribute__ ((regparm(1)));
|
|
||||||
|
|
||||||
enum fe_types
|
enum fe_types
|
||||||
{
|
{
|
||||||
FE_NADA = 0, /* Nothing special */
|
FE_NADA = 0, /* Nothing special */
|
||||||
|
@ -358,7 +358,12 @@ get_file_attribute (HANDLE handle, path_conv &pc,
|
|||||||
get_info_from_sd (sd, attribute, uidret, gidret);
|
get_info_from_sd (sd, attribute, uidret, gidret);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
/* ENOSYS is returned by get_file_sd if fetching the DACL from a remote
|
||||||
|
share returns STATUS_INVALID_NETWORK_RESPONSE, which in turn is
|
||||||
|
converted to ERROR_BAD_NET_RESP. This potentially occurs when trying
|
||||||
|
to fetch DACLs from a NT4 machine which is not part of the domain of
|
||||||
|
the requesting machine. */
|
||||||
|
else if (get_errno () != ENOSYS)
|
||||||
{
|
{
|
||||||
if (uidret)
|
if (uidret)
|
||||||
*uidret = ILLEGAL_UID;
|
*uidret = ILLEGAL_UID;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user