瀏覽代碼

use guest login credentials if no login credentials where given for SMB/DSM

Tobias Conradi 9 年之前
父節點
當前提交
e3042777aa
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      SharedSources/ServerBrowsing/SMB/VLCLocalNetworkServiceBrowserDSM.m

+ 6 - 0
SharedSources/ServerBrowsing/SMB/VLCLocalNetworkServiceBrowserDSM.m

@@ -73,6 +73,12 @@ NSString *const VLCNetworkServerProtocolIdentifierSMB = @"smb";
 
 + (instancetype)SMBNetworkServerBrowserWithURL:(NSURL *)url username:(NSString *)username password:(NSString *)password workgroup:(NSString *)workgroup {
 
+    BOOL guestLogin = username.length == 0 && password.length == 0;
+    if (guestLogin) {
+        username = @"Guest";
+        password = @"Guest";
+    }
+
 	VLCMedia *media = [VLCMedia mediaWithURL:url];
 	NSDictionary *mediaOptions = @{@"smb-user" : username ?: @"",
 								   @"smb-pwd" : password ?: @"",