Using "if not" conditionals with or and else conditions is usually hard to
follow, so I agree, this should be written as a regular, positive
if/elsif/else

On Sep 28, 2013 1:13 PM, "SteveJM" <notifications@github.com> wrote:
>
> In scripts/meterpreter/persistence.rb:
>
> >  # Function to install payload as a service
> >
#-------------------------------------------------------------------------------
> >  def install_as_service(script_on_target)
> > - if not is_uac_enabled? or is_admin?
> > - print_status("Installing as service..")
> > - nam = Rex::Text.rand_text_alpha(rand(8)+8)
> > - print_status("Creating service #{nam}")
> > - service_create(nam, nam, "cscript \"#{script_on_target}\"")
> > - file_local_write(@clean_up_rc, "execute -H -f sc -a \"delete
#{nam}\"\n")
> > - else
> > - print_error("Insufficient privileges to create service")
> > - end
> > +  if not is_uac_enabled? or is_admin?
>
> This comment is incorrect as the 'unless' will reverse the logic of the
"is_admin?".
>
> —
> Reply to this email directly or view it on GitHub.