Browse Source

Removed leading slash from ServerService.PipeName and WorkstationService.PipeName

Tal Aloni 8 years ago
parent
commit
9265858968

+ 4 - 0
SMBLibrary/Server/Shares/NamedPipeShare.cs

@@ -39,6 +39,10 @@ namespace SMBLibrary.Server
 
         private RemoteService GetService(string path)
         {
+            if (path.StartsWith(@"\"))
+            {
+                path = path.Substring(1);
+            }
             foreach (RemoteService service in this)
             {
                 if (String.Equals(path, service.PipeName, StringComparison.InvariantCultureIgnoreCase))

+ 2 - 2
SMBLibrary/Services/RemoteServiceHelper.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  * 
  * You can redistribute this program and/or modify it under the terms of
  * the GNU Lesser Public License as published by the Free Software Foundation,
@@ -61,7 +61,7 @@ namespace SMBLibrary.Services
             {
                 bindAckPDU.AssociationGroupID = bindPDU.AssociationGroupID;
             }
-            bindAckPDU.SecondaryAddress = @"\PIPE" + service.PipeName;
+            bindAckPDU.SecondaryAddress = @"\PIPE\" + service.PipeName;
             bindAckPDU.MaxReceiveFragmentSize = bindPDU.MaxReceiveFragmentSize;
             bindAckPDU.MaxTransmitFragmentSize = bindPDU.MaxTransmitFragmentSize;
             foreach (ContextElement element in bindPDU.ContextList)

+ 2 - 2
SMBLibrary/Services/ServerService/ServerService.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  * 
  * You can redistribute this program and/or modify it under the terms of
  * the GNU Lesser Public License as published by the Free Software Foundation,
@@ -187,7 +187,7 @@ namespace SMBLibrary.Services
         {
             get
             {
-                return @"\srvsvc";
+                return "srvsvc";
             }
         }
     }

+ 2 - 2
SMBLibrary/Services/WorkstationService/WorkstationService.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  * 
  * You can redistribute this program and/or modify it under the terms of
  * the GNU Lesser Public License as published by the Free Software Foundation,
@@ -87,7 +87,7 @@ namespace SMBLibrary.Services
         {
             get
             {
-                return @"\wkssvc";
+                return "wkssvc";
             }
         }
     }