summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-12 14:29:05 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-12 14:29:05 +0000
commitbd2560e616a9a5acbcdf8472ce8aa7c9fbc55227 (patch)
tree80d1501d7d9115fc25657914d949c848a04efd0f /lib
parent42dec3c472bc9c3c3afa07ed312881814bd5f84c (diff)
downloadruby-bd2560e616a9a5acbcdf8472ce8aa7c9fbc55227.tar.gz
ruby-bd2560e616a9a5acbcdf8472ce8aa7c9fbc55227.tar.xz
ruby-bd2560e616a9a5acbcdf8472ce8aa7c9fbc55227.zip
* lib/net/ftp.rb (login): use "anonymous@" as a default password.
[ruby-dev:39451] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/ftp.rb18
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 1641f04a3..8ae3e1610 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -363,22 +363,6 @@ module Net
end
private :transfercmd
- def getaddress
- thishost = Socket.gethostname
- if not thishost.index(".")
- thishost = Socket.gethostbyname(thishost)[0]
- end
- if ENV.has_key?("LOGNAME")
- realuser = ENV["LOGNAME"]
- elsif ENV.has_key?("USER")
- realuser = ENV["USER"]
- else
- realuser = "anonymous"
- end
- return realuser + "@" + thishost
- end
- private :getaddress
-
#
# Logs in to the remote host. The session must have been previously
# connected. If +user+ is the string "anonymous" and the +password+ is
@@ -389,7 +373,7 @@ module Net
#
def login(user = "anonymous", passwd = nil, acct = nil)
if user == "anonymous" and passwd == nil
- passwd = getaddress
+ passwd = "anonymous@"
end
resp = ""