Skip to content

Commit

Permalink
Use a regex with a negative lookbehind to cope with CNs that contain …
Browse files Browse the repository at this point in the history
…commas
  • Loading branch information
stufus committed Dec 21, 2015
1 parent b0fca76 commit e8c8c54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/post/windows/gather/enum_ad_managedby_groups.rb
Expand Up @@ -94,7 +94,7 @@ def parse_results(results)
end
if datastore['RESOLVE_MANAGERS']
begin
managedby_cn = result[2][:value].split(',')[0]
managedby_cn = result[2][:value].split(/,(?<!\\,)/)[0]
m = query("(&(objectClass=user)(objectCategory=person)(#{managedby_cn}))", 1, ['sAMAccountName'])
if !m.nil? && !m[:results].empty?
row << m[:results][0][0][:value]
Expand Down

0 comments on commit e8c8c54

Please sign in to comment.