Commit a39d3336 authored by Patrick J Cherry's avatar Patrick J Cherry
Browse files

ftpd: Changed login failure message to allow the next auth message in certain circumstances

The auth program should only return -1 if it does not make sense to try
any further authentication methods.

In fact the only time we don't want to continue is if the user's
password is wrong,
parent 213b21d2
......@@ -116,11 +116,11 @@ begin
#
# username sanity check
#
if username.nil?
if username.nil?
syslog.info "No username given from #{ip} for #{service} service"
syslog.err "#{service} login failure from IP: #{ip} username: nil"
print "auth_ok:-1\nend\n"
print "auth_ok:0\nend\n"
exit PERMANENT_ERROR
end
......@@ -141,7 +141,7 @@ begin
syslog.info "Non-existent domain #{ldomain.inspect} from #{ip} for #{service} service"
syslog.err "#{service} login failure from IP: #{ip} username: #{username}"
print "auth_ok:-1\nend\n"
print "auth_ok:0\nend\n"
exit PERMANENT_ERROR
end
......@@ -154,7 +154,7 @@ begin
syslog.info "Unknown FTP mode #{mode} for domain #{domain.name} from #{ip} for #{service} service"
syslog.err "#{service} login failure from IP: #{ip} username: #{username}"
print "auth_ok:-1\nend\n"
print "auth_ok:0\nend\n"
exit PERMANENT_ERROR
end
......@@ -162,7 +162,7 @@ begin
syslog.info "Non-existent #{mode} user #{username.inspect} for domain #{domain.name} from #{ip} for #{service} service"
syslog.err "#{service} login failure from IP: #{ip} username: #{username}"
print "auth_ok:-1\nend\n"
print "auth_ok:0\nend\n"
exit PERMANENT_ERROR
end
......@@ -185,7 +185,7 @@ begin
"dir:#{user.chroot_dir}" ]
results << "user_quota_size:#{user.quota}" unless user.quota.nil? or user.quota == 0
#
# Woo-hoo success!
#
......@@ -205,7 +205,7 @@ rescue => err
end
#
#
# We should never get this far.
#
syslog.err "Something has gone badly wrong whilst authenticating username #{username}@#{ldomain} from #{ip} for #{service} service"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment