[Mono-bugs] [Bug 80337][Wis] New - FtpWebRequest domain construction faulty

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Dec 21 15:16:35 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by einki.ml at gmx.net.

http://bugzilla.ximian.com/show_bug.cgi?id=80337

--- shadow/80337	2006-12-21 15:16:35.000000000 -0500
+++ shadow/80337.tmp.11731	2006-12-21 15:16:35.000000000 -0500
@@ -0,0 +1,54 @@
+Bug#: 80337
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: einKI.ml at gmx.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: FtpWebRequest domain construction faulty
+
+When login to an anonymous FtpWebRequest and domain not set
+or = null or = string.Empty a 
+
+"System.Net.WebException: Server returned an error: 530 This FTP server is
+anonymous only."
+
+exception is thrown.
+
+Steps to reproduce the problem:
+
+FtpWebRequest fwr =
+(FtpWebRequest)WebRequest.Create("ftp://XX.XX.XX.XX/fileName");
+fwr.Method = WebRequestMethods.Ftp.DownloadFile;
+fwr.GetResponse().GetResponseStream();
+
+Actual Results:
+System.Net.WebException
+
+Expected Results:
+connect to the specified server
+
+How often does this happen? 
+always
+
+Solution:
+
+if (domain != null || domain != String.Empty)
+  username = domain + '\\' + username;
+
+should be changed to
+
+if (domain != null && domain != String.Empty)
+  username = domain + '\\' + username;
+
+because currently whatever domain is the if statement is always true
+yielding username = "\anonymous" instead of "anonymous"


More information about the mono-bugs mailing list