NARKOZ / hacker-scripts

Based on a true story
47.56k stars 6.65k forks source link

Possibly badly-terminated string in PowerShell script #157

Open neaorin opened 7 years ago

neaorin commented 7 years ago

Issue Description

I've been running the PowerShell version of smack_my_bitch_up in production for a couple of weeks now, and while everything seemed to work great at first, after a few days I began to encounter some erratic behavior - things like no dinner on the table, the cold shoulder treatment, "you're sleeping on the sofa tonight", "no, everything is Just. Fine" and other similar, weird response codes.

Steps to Reproduce

Sadly, I don't have a clear repro on the issue as each run seemed to produce different results, and thus I've been unable to pin down the exact behavior. However, I have since made some changes to the script by adding some randomly-selected string terminators to the $message variable:

$STRTERMS =
  'Love u',
  'You''re beautiful',
  'I''m cooking dinner tomorrow',
  'Girls trip this weekend?'
$term = $STRTERMS | Get-Random
$message = "Late at work. $reason. $term."

While this change did not get rid of all the random issues, it does seem to have taken care of the worst symptoms. For one, I am very happy to report that I've gone back to sleeping in my own bed.

I have no idea whether this is happening due to some specific issue with my production setup, or some weird PowerShell bug I'm unaware of.

I was gonna submit a pull request but I'm not sure my (partial) solution is generally applicable, and unfortunately I don't have the time or resources to set up a separate test environment.

Has anyone else encountered similar issues with this script in the past?

thanks

My Environment

kodbilenadam commented 6 years ago

You may want try to get a ❤️ emoji at the end. This may fix some remaining problems.

I will be following this issue in case might occur in my environment.