• 5 Posts
  • 334 Comments
Joined 1 year ago
cake
Cake day: June 30th, 2023

help-circle




  • No, you’re still misunderstanding what’s being done. ${server_service} is an injected string, the string is the whole contents of the file. That file is not stored locally on the server, except through being injected here(by a terraform file template). And no, printf won’t be any better than echo because its not format string, and I don’t want any formatting from printf applied to it.


  • I’m reading this and interpreting that line 27 of that script is

    And your interpretation is wrong. Line 27 is actuallly

    sudo echo "${server_service}" > /lib/systemd/system/server.service

    ${server_service} is read from the file I posted in the 2nd image. Since it was a test script I hadn’t bothered implementing any escaping tools, I wanted to make sure terraform allowed this first.





  • No, because neither of those are the inputs. The input was the systemd file in the image. The whole command was not printed in the error, only surrounding context. The single-quote was indicating the ending of that context(because it was the end of the line) printed by the error.

    The same thing was done with `)' on the first line of error



  • Sadly no, its injected with terraform templatefile, I already looked for a normal way to autoescape it, but from a brief look I couldn’t find one. I know there is a replace function that can take regex(RE2, which from my understanding prohibits * in lookbehinds)- but the simplest regex I could think of at nearly 6am for capturing only non-escaped quotes is /(?:^|[^\\])(?:(?:\\\\)+|[^\\]|^)(?'quote'")/gm. Though, I just realized if the quotes are escaped I would want to double escape them, so actually replacing all quotes with escaped quotes should be fine, also another limitation of this method is lines can’t have trailing \










  • Employees do not share in the profits so should not have to bear ANY of the risks. (No, the fact they have a job at all is NOT sharing in the profit).

    How is it not? In small businesses wages are often more than the dividends. As in, employees get paid first, ask any small business owner about that.

    Cost of recruitment is just cost of doing business. (There is no cost if you don’t have to recruit).

    Yes. But it means you’re not wanting to fire people randomly most of the time.

    Making employees disposable just means the employer has no exposure there, while the employee has it all.

    It doesn’t make employees disposable, see above. People quit far more often than they’re fired.

    But like I said, I’m not even talking about this from the perspective of the employer, but instead from the employee. Money is more replaceable than time, and it is not ethical to trap someone in a situation that makes them hate their life for a month.