Author: tfaber
Date: Sun Jul 30 12:40:24 2017
New Revision: 75453
URL:
http://svn.reactos.org/svn/reactos?rev=75453&view=rev
Log:
[0.4.6]
- Merge NFS symbolic link fix (r75451) by Pierre
CORE-13615
Modified:
branches/ros-branch-0_4_6/ (props changed)
branches/ros-branch-0_4_6/reactos/ (props changed)
branches/ros-branch-0_4_6/reactos/sdk/lib/drivers/rdbsslib/rdbss.c
Propchange: branches/ros-branch-0_4_6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jul 30 12:40:24 2017
@@ -1 +1,2 @@
/branches/colins-printing-for-freedom:67543-68405,68407-68414,68417-70595
+/trunk:75451
Propchange: branches/ros-branch-0_4_6/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jul 30 12:40:24 2017
@@ -23,3 +23,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
+/trunk/reactos:75451
Modified: branches/ros-branch-0_4_6/reactos/sdk/lib/drivers/rdbsslib/rdbss.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_6/reactos/sdk/li…
==============================================================================
--- branches/ros-branch-0_4_6/reactos/sdk/lib/drivers/rdbsslib/rdbss.c [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_6/reactos/sdk/lib/drivers/rdbsslib/rdbss.c [iso-8859-1] Sun
Jul 30 12:40:24 2017
@@ -7492,6 +7492,9 @@
return Status;
}
+/*
+ * @implemented
+ */
NTSTATUS
NTAPI
RxPrepareToReparseSymbolicLink(
@@ -7501,8 +7504,74 @@
BOOLEAN NewPathIsAbsolute,
PBOOLEAN ReparseRequired)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ PWSTR NewBuffer;
+ USHORT NewLength;
+ PFILE_OBJECT FileObject;
+
+ /* Assume no reparse is required first */
+ *ReparseRequired = FALSE;
+
+ /* Only supported for IRP_MJ_CREATE */
+ if (RxContext->MajorFunction != IRP_MJ_CREATE)
+ {
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ /* If symbolic link is not embedded, and DELETE is specified, fail */
+ if (!SymbolicLinkEmbeddedInOldPath)
+ {
+ /* Excepted if DELETE is the only flag specified, then, open has to succeed
+ * See:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff554649(v=vs.85)…
(remarks)
+ */
+ if (BooleanFlagOn(RxContext->Create.NtCreateParameters.DesiredAccess, DELETE)
&&
+ BooleanFlagOn(RxContext->Create.NtCreateParameters.DesiredAccess,
~DELETE))
+ {
+ return STATUS_ACCESS_DENIED;
+ }
+ }
+
+ /* At that point, assume reparse will be required */
+ *ReparseRequired = TRUE;
+
+ /* If new path isn't absolute, it's up to us to make it absolute */
+ if (!NewPathIsAbsolute)
+ {
+ /* The prefix will be \Device\Mup */
+ NewLength = NewPath->Length + (sizeof(L"\\Device\\Mup") -
sizeof(UNICODE_NULL));
+ NewBuffer = ExAllocatePoolWithTag(PagedPool | POOL_COLD_ALLOCATION, NewLength,
+ RX_MISC_POOLTAG);
+ if (NewBuffer == NULL)
+ {
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ /* Copy data for the new path */
+ RtlMoveMemory(NewBuffer, L"\\Device\\Mup",
(sizeof(L"\\Device\\Mup") - sizeof(UNICODE_NULL)));
+ RtlMoveMemory(Add2Ptr(NewBuffer, (sizeof(L"\\Device\\Mup") -
sizeof(UNICODE_NULL))),
+ NewPath->Buffer, NewPath->Length);
+ }
+ /* Otherwise, use caller path as it */
+ else
+ {
+ NewLength = NewPath->Length;
+ NewBuffer = NewPath->Buffer;
+ }
+
+ /* Get the FILE_OBJECT we'll modify */
+ FileObject = RxContext->CurrentIrpSp->FileObject;
+
+ /* Free old path first */
+ ExFreePoolWithTag(FileObject->FileName.Buffer, 0);
+ /* And setup new one */
+ FileObject->FileName.Length = NewLength;
+ FileObject->FileName.MaximumLength = NewLength;
+ FileObject->FileName.Buffer = NewBuffer;
+
+ /* And set reparse flag */
+ SetFlag(RxContext->Create.Flags, RX_CONTEXT_CREATE_FLAG_REPARSE);
+
+ /* Done! */
+ return STATUS_SUCCESS;
}
/*