{"action":"opened","issue":{"url":"https://api.github.com/repos/puppet-community/puppet-staging/issues/79","labels_url":"https://api.github.com/repos/puppet-community/puppet-staging/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/puppet-community/puppet-staging/issues/79/comments","events_url":"https://api.github.com/repos/puppet-community/puppet-staging/issues/79/events","html_url":"https://github.com/puppet-community/puppet-staging/issues/79","id":97082267,"number":79,"title":"File source http/https with username/password fails with certain password character sequences","user":{"login":"bcornies","id":1640520,"avatar_url":"https://avatars.githubusercontent.com/u/1640520?v=3","gravatar_id":"","url":"https://api.github.com/users/bcornies","html_url":"https://github.com/bcornies","followers_url":"https://api.github.com/users/bcornies/followers","following_url":"https://api.github.com/users/bcornies/following{/other_user}","gists_url":"https://api.github.com/users/bcornies/gists{/gist_id}","starred_url":"https://api.github.com/users/bcornies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcornies/subscriptions","organizations_url":"https://api.github.com/users/bcornies/orgs","repos_url":"https://api.github.com/users/bcornies/repos","events_url":"https://api.github.com/users/bcornies/events{/privacy}","received_events_url":"https://api.github.com/users/bcornies/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-24T15:55:55Z","updated_at":"2015-07-24T15:55:55Z","closed_at":null,"body":"When a password used with an https file source has characters that contain special meaning to the shell, various errors can occur. For example, if the char sequence `!2` exists in a password (which it happened to for mine) bash interprets that as the 2nd command in my history and interpolates that into the `curl` command.\r\n\r\nSample Puppet code:\r\n```\r\nstaging::file { 'somefile':\r\n    source => 'https://host/path/to/file',\r\n    username => 'myuser',\r\n    password => 'password!2',\r\n    target   => '/tmp/myfile',\r\n}\r\n```\r\n\r\nExecuting this will result in one of two results, depending on whether you have run at least 2 shell commands prior to executing Puppet. I've only sampled the resulting curl commands in the examples here.\r\n\r\n```\r\n[root@rpilproxy vagrant]# curl  -f -L -o /tmp/myfile -u user:password!2 https://host/path/to/file\r\nbash: !2: event not found\r\n```\r\n\r\n...or it will output the following if `ls -la` happened to be the 15th command in my history...\r\n\r\n```\r\n[root@rpilproxy vagrant]# curl  -f -L -o /tmp/myfile -u user:password!15 https://host/path/to/file\r\ncurl  -f -L -o /tmp/myfile -u user:passwordls -la https://host/path/to/file\r\n\r\ncurl: (6) Couldn't resolve host 'host' # <- this particular error isn't significant, the curl command will still attempt to run the new command with the history interpolation\r\n```\r\n\r\nI believe the solution to be simply wrapping the username:password in the curl request with single quotes."}}