{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/4907","repository_url":"https://api.github.com/repos/chef/chef","labels_url":"https://api.github.com/repos/chef/chef/issues/4907/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/4907/comments","events_url":"https://api.github.com/repos/chef/chef/issues/4907/events","html_url":"https://github.com/chef/chef/pull/4907","id":153532896,"number":4907,"title":"reject malformed ini content in systemd_unit resource","user":{"login":"nathwill","id":371597,"avatar_url":"https://avatars.githubusercontent.com/u/371597?v=3","gravatar_id":"","url":"https://api.github.com/users/nathwill","html_url":"https://github.com/nathwill","followers_url":"https://api.github.com/users/nathwill/followers","following_url":"https://api.github.com/users/nathwill/following{/other_user}","gists_url":"https://api.github.com/users/nathwill/gists{/gist_id}","starred_url":"https://api.github.com/users/nathwill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathwill/subscriptions","organizations_url":"https://api.github.com/users/nathwill/orgs","repos_url":"https://api.github.com/users/nathwill/repos","events_url":"https://api.github.com/users/nathwill/events{/privacy}","received_events_url":"https://api.github.com/users/nathwill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-05-06T20:35:14Z","updated_at":"2016-05-13T18:34:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chef/chef/pulls/4907","html_url":"https://github.com/chef/chef/pull/4907","diff_url":"https://github.com/chef/chef/pull/4907.diff","patch_url":"https://github.com/chef/chef/pull/4907.patch"},"body":"was thinking about this the other day, and wanted to send a PR to raise the subject:\r\n\r\ncurrently, we pass the content string through as-is, which means it's possible to give bad input to systemd. this fixes it so that it will at least be enforced as a well-formed ini-formatted string, but it's not perfect...\r\n\r\npro: ensure well-formed ini content string by attempting to parse as ini before converting back to string\r\n\r\ncon: `IniParse.parse(str).to_s` reformats the string with spaces between the `=` and an empty line between headings, so it's possible that a valid ini string may not match the exact string as rendered on disk, thus breaking idempotency :frowning:...\r\n\r\nmaybe this is a case that should just be covered by integration testing, but i figured i'd raise the subject and see what Chef maintainers thought about how best to handle it."},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/219124890","html_url":"https://github.com/chef/chef/pull/4907#issuecomment-219124890","issue_url":"https://api.github.com/repos/chef/chef/issues/4907","id":219124890,"user":{"login":"lamont-granquist","id":454857,"avatar_url":"https://avatars.githubusercontent.com/u/454857?v=3","gravatar_id":"","url":"https://api.github.com/users/lamont-granquist","html_url":"https://github.com/lamont-granquist","followers_url":"https://api.github.com/users/lamont-granquist/followers","following_url":"https://api.github.com/users/lamont-granquist/following{/other_user}","gists_url":"https://api.github.com/users/lamont-granquist/gists{/gist_id}","starred_url":"https://api.github.com/users/lamont-granquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamont-granquist/subscriptions","organizations_url":"https://api.github.com/users/lamont-granquist/orgs","repos_url":"https://api.github.com/users/lamont-granquist/repos","events_url":"https://api.github.com/users/lamont-granquist/events{/privacy}","received_events_url":"https://api.github.com/users/lamont-granquist/received_events","type":"User","site_admin":false},"created_at":"2016-05-13T18:34:38Z","updated_at":"2016-05-13T18:34:38Z","body":"👍 \r\n\r\n@thommay?"}}