Use length for comparision

bug/bundler_fix
jvazquez-r7 2014-07-31 13:11:00 -05:00 committed by Brent Cook
parent e903044fd5
commit 7596d211e9
2 changed files with 4 additions and 4 deletions

View File

@ -239,7 +239,7 @@ class ClientCore < Extension
if client.platform =~ /linux/i
socket_path = File.join(writable_dir, Rex::Text.rand_text_alpha_lower(5 + rand(5)))
if socket_path > UNIX_PATH_MAX - 1
if socket_path.length > UNIX_PATH_MAX - 1
raise RuntimeError, "The writable dir is too long", caller
end

View File

@ -351,7 +351,7 @@ class Console::CommandDispatcher::Core
end
if client.platform =~ /linux/
writable_dir = (args.length >= 2) ? args[1] : "/tmp/"
writable_dir = (args.length >= 2) ? args[1] : "/tmp/"
end
begin
@ -395,9 +395,9 @@ class Console::CommandDispatcher::Core
# Do this thang.
if client.platform =~ /linux/
client.core.migrate(pid)
else
client.core.migrate(pid, writable_dir)
else
client.core.migrate(pid)
end
print_status("Migration completed successfully.")