@@ -46,7 +46,7 @@ def initialize(info={})
46
46
def run
47
47
# Get current process information
48
48
@original_pid = client . sys . process . open . pid
49
- @original_name = client . sys . process . open . name
49
+ @original_name = client . sys . process . open . name . downcase
50
50
print_status ( "Current session process is #{ @original_name } (#{ @original_pid } ) as: #{ client . sys . config . getuid } " )
51
51
unless migrate_admin
52
52
if is_admin? && !datastore [ 'NOFAIL' ]
@@ -66,7 +66,7 @@ def run
66
66
def get_pid ( proc_name )
67
67
processes = client . sys . process . get_processes
68
68
processes . each do |proc |
69
- if proc [ 'name' ] == proc_name && proc [ 'user' ] != ""
69
+ if proc [ 'name' ] . downcase == proc_name && proc [ 'user' ] != ""
70
70
return proc [ 'pid' ]
71
71
end
72
72
end
@@ -127,9 +127,10 @@ def migrate(target_pid, proc_name, current_pid)
127
127
# @return [FalseClass] if it failed to migrate
128
128
def migrate_admin
129
129
if is_admin?
130
- # Populate target array
130
+ # Populate target array and Downcase all Targets
131
131
admin_targets = DEFAULT_ADMIN_TARGETS . dup
132
132
admin_targets . unshift ( datastore [ 'ANAME' ] ) if datastore [ 'ANAME' ]
133
+ admin_targets . map! ( &:downcase )
133
134
134
135
if is_system?
135
136
print_status ( "Session is already Admin and System." )
@@ -157,9 +158,11 @@ def migrate_admin
157
158
# @return [TrueClass] if it successfully migrated
158
159
# @return [FalseClass] if it failed to migrate
159
160
def migrate_user
160
- # Populate Target Array
161
+ # Populate Target Array and Downcase all Targets
161
162
user_targets = DEFAULT_USER_TARGETS . dup
162
163
user_targets . unshift ( datastore [ 'NAME' ] ) if datastore [ 'NAME' ]
164
+ user_targets . map! ( &:downcase )
165
+
163
166
print_status ( "Will attempt to migrate to a User level process." )
164
167
165
168
# Try to migrate to user level processes in the list. If it does not exist or cannot migrate, try spawning it then migrating.
0 commit comments