{"action":"created","comment":{"url":"https://api.github.com/repos/kerl/kerl/pulls/comments/62329404","id":62329404,"diff_hunk":"@@ -733,6 +743,63 @@ do_deploy()\n     echo \"kerl_deactivate\"\n }\n \n+is_valid_install_path()\n+{\n+    # don't allow installs into home directory\n+    if [ \"$1\" = \"$HOME\" ]; then\n+        echo \"ERROR: You cannot install a build into $HOME. It's a really bad idea.\"\n+        return 1\n+    fi\n+\n+    # don't allow installs into .erlang because\n+    # it's a special configuration file location\n+    # for OTP\n+    if [ \"$1\" = \"$HOME/.erlang\" ]; then\n+        echo \"ERROR: You cannot install a build into $HOME/.erlang. (It's a special configuration file location for OTP.)\"\n+        return 1\n+    fi\n+\n+    # don't install into .kerl either.\n+    if [ \"$1\" = \"$HOME/.kerl\" ]; then","path":"kerl","position":133,"original_position":133,"commit_id":"d7a6709aeb63345d1fc6d86e058df7fd6e33dd4c","original_commit_id":"d7a6709aeb63345d1fc6d86e058df7fd6e33dd4c","user":{"login":"sanmiguel","id":2122822,"avatar_url":"https://avatars.githubusercontent.com/u/2122822?v=3","gravatar_id":"","url":"https://api.github.com/users/sanmiguel","html_url":"https://github.com/sanmiguel","followers_url":"https://api.github.com/users/sanmiguel/followers","following_url":"https://api.github.com/users/sanmiguel/following{/other_user}","gists_url":"https://api.github.com/users/sanmiguel/gists{/gist_id}","starred_url":"https://api.github.com/users/sanmiguel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanmiguel/subscriptions","organizations_url":"https://api.github.com/users/sanmiguel/orgs","repos_url":"https://api.github.com/users/sanmiguel/repos","events_url":"https://api.github.com/users/sanmiguel/events{/privacy}","received_events_url":"https://api.github.com/users/sanmiguel/received_events","type":"User","site_admin":false},"body":"Damn, that felt so right, too. I guess we could go down the rabbit-hole of different things for Dawin and *n*x, but that feels like we're going too far. Do we do it anywhere else?","created_at":"2016-05-06T13:30:26Z","updated_at":"2016-05-06T13:30:26Z","html_url":"https://github.com/kerl/kerl/pull/127#discussion_r62329404","pull_request_url":"https://api.github.com/repos/kerl/kerl/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/kerl/kerl/pulls/comments/62329404"},"html":{"href":"https://github.com/kerl/kerl/pull/127#discussion_r62329404"},"pull_request":{"href":"https://api.github.com/repos/kerl/kerl/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/kerl/kerl/pulls/127","id":68817126,"html_url":"https://github.com/kerl/kerl/pull/127","diff_url":"https://github.com/kerl/kerl/pull/127.diff","patch_url":"https://github.com/kerl/kerl/pull/127.patch","issue_url":"https://api.github.com/repos/kerl/kerl/issues/127","number":127,"state":"open","locked":false,"title":"Be more careful about paths before install and delete operations","user":{"login":"mrallen1","id":204728,"avatar_url":"https://avatars.githubusercontent.com/u/204728?v=3","gravatar_id":"","url":"https://api.github.com/users/mrallen1","html_url":"https://github.com/mrallen1","followers_url":"https://api.github.com/users/mrallen1/followers","following_url":"https://api.github.com/users/mrallen1/following{/other_user}","gists_url":"https://api.github.com/users/mrallen1/gists{/gist_id}","starred_url":"https://api.github.com/users/mrallen1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrallen1/subscriptions","organizations_url":"https://api.github.com/users/mrallen1/orgs","repos_url":"https://api.github.com/users/mrallen1/repos","events_url":"https://api.github.com/users/mrallen1/events{/privacy}","received_events_url":"https://api.github.com/users/mrallen1/received_events","type":"User","site_admin":false},"body":"As detailed in #113, #108, #52 kerl can make you very very sad if you try to install or remove a build into bad places.  I don't think this is a silver bullet for this problem but it should make it much more difficult to do something *unfortunate* by accident.\r\n\r\nTested on OS X and Ubuntu 14.04 LTS.","created_at":"2016-05-04T06:46:29Z","updated_at":"2016-05-06T13:30:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b501a0385bce11bf3338cfb212460986996b3658","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kerl/kerl/pulls/127/commits","review_comments_url":"https://api.github.com/repos/kerl/kerl/pulls/127/comments","review_comment_url":"https://api.github.com/repos/kerl/kerl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kerl/kerl/issues/127/comments","statuses_url":"https://api.github.com/repos/kerl/kerl/statuses/d7a6709aeb63345d1fc6d86e058df7fd6e33dd4c","head":{"label":"kerl:check_paths","ref":"check_paths","sha":"d7a6709aeb63345d1fc6d86e058df7fd6e33dd4c","user":{"login":"kerl","id":18472926,"avatar_url":"https://avatars.githubusercontent.com/u/18472926?v=3","gravatar_id":"","url":"https://api.github.com/users/kerl","html_url":"https://github.com/kerl","followers_url":"https://api.github.com/users/kerl/followers","following_url":"https://api.github.com/users/kerl/following{/other_user}","gists_url":"https://api.github.com/users/kerl/gists{/gist_id}","starred_url":"https://api.github.com/users/kerl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kerl/subscriptions","organizations_url":"https://api.github.com/users/kerl/orgs","repos_url":"https://api.github.com/users/kerl/repos","events_url":"https://api.github.com/users/kerl/events{/privacy}","received_events_url":"https://api.github.com/users/kerl/received_events","type":"Organization","site_admin":false},"repo":{"id":2000878,"name":"kerl","full_name":"kerl/kerl","owner":{"login":"kerl","id":18472926,"avatar_url":"https://avatars.githubusercontent.com/u/18472926?v=3","gravatar_id":"","url":"https://api.github.com/users/kerl","html_url":"https://github.com/kerl","followers_url":"https://api.github.com/users/kerl/followers","following_url":"https://api.github.com/users/kerl/following{/other_user}","gists_url":"https://api.github.com/users/kerl/gists{/gist_id}","starred_url":"https://api.github.com/users/kerl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kerl/subscriptions","organizations_url":"https://api.github.com/users/kerl/orgs","repos_url":"https://api.github.com/users/kerl/repos","events_url":"https://api.github.com/users/kerl/events{/privacy}","received_events_url":"https://api.github.com/users/kerl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kerl/kerl","description":"Easy building and installing of Erlang/OTP instances","fork":false,"url":"https://api.github.com/repos/kerl/kerl","forks_url":"https://api.github.com/repos/kerl/kerl/forks","keys_url":"https://api.github.com/repos/kerl/kerl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kerl/kerl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kerl/kerl/teams","hooks_url":"https://api.github.com/repos/kerl/kerl/hooks","issue_events_url":"https://api.github.com/repos/kerl/kerl/issues/events{/number}","events_url":"https://api.github.com/repos/kerl/kerl/events","assignees_url":"https://api.github.com/repos/kerl/kerl/assignees{/user}","branches_url":"https://api.github.com/repos/kerl/kerl/branches{/branch}","tags_url":"https://api.github.com/repos/kerl/kerl/tags","blobs_url":"https://api.github.com/repos/kerl/kerl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kerl/kerl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kerl/kerl/git/refs{/sha}","trees_url":"https://api.github.com/repos/kerl/kerl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kerl/kerl/statuses/{sha}","languages_url":"https://api.github.com/repos/kerl/kerl/languages","stargazers_url":"https://api.github.com/repos/kerl/kerl/stargazers","contributors_url":"https://api.github.com/repos/kerl/kerl/contributors","subscribers_url":"https://api.github.com/repos/kerl/kerl/subscribers","subscription_url":"https://api.github.com/repos/kerl/kerl/subscription","commits_url":"https://api.github.com/repos/kerl/kerl/commits{/sha}","git_commits_url":"https://api.github.com/repos/kerl/kerl/git/commits{/sha}","comments_url":"https://api.github.com/repos/kerl/kerl/comments{/number}","issue_comment_url":"https://api.github.com/repos/kerl/kerl/issues/comments{/number}","contents_url":"https://api.github.com/repos/kerl/kerl/contents/{+path}","compare_url":"https://api.github.com/repos/kerl/kerl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kerl/kerl/merges","archive_url":"https://api.github.com/repos/kerl/kerl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kerl/kerl/downloads","issues_url":"https://api.github.com/repos/kerl/kerl/issues{/number}","pulls_url":"https://api.github.com/repos/kerl/kerl/pulls{/number}","milestones_url":"https://api.github.com/repos/kerl/kerl/milestones{/number}","notifications_url":"https://api.github.com/repos/kerl/kerl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kerl/kerl/labels{/name}","releases_url":"https://api.github.com/repos/kerl/kerl/releases{/id}","deployments_url":"https://api.github.com/repos/kerl/kerl/deployments","created_at":"2011-07-05T14:35:55Z","updated_at":"2016-05-06T12:58:58Z","pushed_at":"2016-05-04T06:46:30Z","git_url":"git://github.com/kerl/kerl.git","ssh_url":"git@github.com:kerl/kerl.git","clone_url":"https://github.com/kerl/kerl.git","svn_url":"https://github.com/kerl/kerl","homepage":"","size":207,"stargazers_count":665,"watchers_count":665,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":128,"mirror_url":null,"open_issues_count":17,"forks":128,"open_issues":17,"watchers":665,"default_branch":"master"}},"base":{"label":"kerl:master","ref":"master","sha":"092fc73dde5a1161112ab87db5fc64a0f9269703","user":{"login":"kerl","id":18472926,"avatar_url":"https://avatars.githubusercontent.com/u/18472926?v=3","gravatar_id":"","url":"https://api.github.com/users/kerl","html_url":"https://github.com/kerl","followers_url":"https://api.github.com/users/kerl/followers","following_url":"https://api.github.com/users/kerl/following{/other_user}","gists_url":"https://api.github.com/users/kerl/gists{/gist_id}","starred_url":"https://api.github.com/users/kerl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kerl/subscriptions","organizations_url":"https://api.github.com/users/kerl/orgs","repos_url":"https://api.github.com/users/kerl/repos","events_url":"https://api.github.com/users/kerl/events{/privacy}","received_events_url":"https://api.github.com/users/kerl/received_events","type":"Organization","site_admin":false},"repo":{"id":2000878,"name":"kerl","full_name":"kerl/kerl","owner":{"login":"kerl","id":18472926,"avatar_url":"https://avatars.githubusercontent.com/u/18472926?v=3","gravatar_id":"","url":"https://api.github.com/users/kerl","html_url":"https://github.com/kerl","followers_url":"https://api.github.com/users/kerl/followers","following_url":"https://api.github.com/users/kerl/following{/other_user}","gists_url":"https://api.github.com/users/kerl/gists{/gist_id}","starred_url":"https://api.github.com/users/kerl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kerl/subscriptions","organizations_url":"https://api.github.com/users/kerl/orgs","repos_url":"https://api.github.com/users/kerl/repos","events_url":"https://api.github.com/users/kerl/events{/privacy}","received_events_url":"https://api.github.com/users/kerl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kerl/kerl","description":"Easy building and installing of Erlang/OTP instances","fork":false,"url":"https://api.github.com/repos/kerl/kerl","forks_url":"https://api.github.com/repos/kerl/kerl/forks","keys_url":"https://api.github.com/repos/kerl/kerl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kerl/kerl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kerl/kerl/teams","hooks_url":"https://api.github.com/repos/kerl/kerl/hooks","issue_events_url":"https://api.github.com/repos/kerl/kerl/issues/events{/number}","events_url":"https://api.github.com/repos/kerl/kerl/events","assignees_url":"https://api.github.com/repos/kerl/kerl/assignees{/user}","branches_url":"https://api.github.com/repos/kerl/kerl/branches{/branch}","tags_url":"https://api.github.com/repos/kerl/kerl/tags","blobs_url":"https://api.github.com/repos/kerl/kerl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kerl/kerl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kerl/kerl/git/refs{/sha}","trees_url":"https://api.github.com/repos/kerl/kerl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kerl/kerl/statuses/{sha}","languages_url":"https://api.github.com/repos/kerl/kerl/languages","stargazers_url":"https://api.github.com/repos/kerl/kerl/stargazers","contributors_url":"https://api.github.com/repos/kerl/kerl/contributors","subscribers_url":"https://api.github.com/repos/kerl/kerl/subscribers","subscription_url":"https://api.github.com/repos/kerl/kerl/subscription","commits_url":"https://api.github.com/repos/kerl/kerl/commits{/sha}","git_commits_url":"https://api.github.com/repos/kerl/kerl/git/commits{/sha}","comments_url":"https://api.github.com/repos/kerl/kerl/comments{/number}","issue_comment_url":"https://api.github.com/repos/kerl/kerl/issues/comments{/number}","contents_url":"https://api.github.com/repos/kerl/kerl/contents/{+path}","compare_url":"https://api.github.com/repos/kerl/kerl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kerl/kerl/merges","archive_url":"https://api.github.com/repos/kerl/kerl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kerl/kerl/downloads","issues_url":"https://api.github.com/repos/kerl/kerl/issues{/number}","pulls_url":"https://api.github.com/repos/kerl/kerl/pulls{/number}","milestones_url":"https://api.github.com/repos/kerl/kerl/milestones{/number}","notifications_url":"https://api.github.com/repos/kerl/kerl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kerl/kerl/labels{/name}","releases_url":"https://api.github.com/repos/kerl/kerl/releases{/id}","deployments_url":"https://api.github.com/repos/kerl/kerl/deployments","created_at":"2011-07-05T14:35:55Z","updated_at":"2016-05-06T12:58:58Z","pushed_at":"2016-05-04T06:46:30Z","git_url":"git://github.com/kerl/kerl.git","ssh_url":"git@github.com:kerl/kerl.git","clone_url":"https://github.com/kerl/kerl.git","svn_url":"https://github.com/kerl/kerl","homepage":"","size":207,"stargazers_count":665,"watchers_count":665,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":128,"mirror_url":null,"open_issues_count":17,"forks":128,"open_issues":17,"watchers":665,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kerl/kerl/pulls/127"},"html":{"href":"https://github.com/kerl/kerl/pull/127"},"issue":{"href":"https://api.github.com/repos/kerl/kerl/issues/127"},"comments":{"href":"https://api.github.com/repos/kerl/kerl/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/kerl/kerl/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/kerl/kerl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kerl/kerl/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/kerl/kerl/statuses/d7a6709aeb63345d1fc6d86e058df7fd6e33dd4c"}}}}