{"action":"created","issue":{"url":"https://api.github.com/repos/Fourdee/DietPi/issues/424","repository_url":"https://api.github.com/repos/Fourdee/DietPi","labels_url":"https://api.github.com/repos/Fourdee/DietPi/issues/424/labels{/name}","comments_url":"https://api.github.com/repos/Fourdee/DietPi/issues/424/comments","events_url":"https://api.github.com/repos/Fourdee/DietPi/issues/424/events","html_url":"https://github.com/Fourdee/DietPi/issues/424","id":164995648,"number":424,"title":"DietPi utility aliases fail to work with sudo","user":{"login":"Stickerpants","id":2053862,"avatar_url":"https://avatars.githubusercontent.com/u/2053862?v=3","gravatar_id":"","url":"https://api.github.com/users/Stickerpants","html_url":"https://github.com/Stickerpants","followers_url":"https://api.github.com/users/Stickerpants/followers","following_url":"https://api.github.com/users/Stickerpants/following{/other_user}","gists_url":"https://api.github.com/users/Stickerpants/gists{/gist_id}","starred_url":"https://api.github.com/users/Stickerpants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stickerpants/subscriptions","organizations_url":"https://api.github.com/users/Stickerpants/orgs","repos_url":"https://api.github.com/users/Stickerpants/repos","events_url":"https://api.github.com/users/Stickerpants/events{/privacy}","received_events_url":"https://api.github.com/users/Stickerpants/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Fourdee/DietPi/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Fourdee/DietPi/milestones/23","html_url":"https://github.com/Fourdee/DietPi/milestones/v123","labels_url":"https://api.github.com/repos/Fourdee/DietPi/milestones/23/labels","id":1859593,"number":23,"title":"v123","description":"","creator":{"login":"Fourdee","id":7077026,"avatar_url":"https://avatars.githubusercontent.com/u/7077026?v=3","gravatar_id":"","url":"https://api.github.com/users/Fourdee","html_url":"https://github.com/Fourdee","followers_url":"https://api.github.com/users/Fourdee/followers","following_url":"https://api.github.com/users/Fourdee/following{/other_user}","gists_url":"https://api.github.com/users/Fourdee/gists{/gist_id}","starred_url":"https://api.github.com/users/Fourdee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fourdee/subscriptions","organizations_url":"https://api.github.com/users/Fourdee/orgs","repos_url":"https://api.github.com/users/Fourdee/repos","events_url":"https://api.github.com/users/Fourdee/events{/privacy}","received_events_url":"https://api.github.com/users/Fourdee/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":12,"state":"open","created_at":"2016-07-01T11:05:06Z","updated_at":"2016-07-12T11:34:17Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2016-07-12T05:13:52Z","updated_at":"2016-07-13T23:42:47Z","closed_at":null,"body":"This is mostly for awareness, since it's a pretty minor detail. As explained [in this post](http://askubuntu.com/a/22043), it seems like aliases fail to expand when they are not the first word in a call.\r\n\r\nAs a result, attempting to call `sudo dietpi-config` (like it instructs you to, if not run as root) gives the error `sudo: dietpi-config: command not found`. Of course, we can run the scripts direct by specifying the path to the ramdisk directly via `/DietPi/dietpi/dietpi-config`.\r\n\r\nThere's a few options to this end - what if we put `/DietPi/dietpi/` on the path? Then there's no need to deal with alias expansion.\r\n\r\nI do recognize that this is a very minor issue - maybe the best solution here is just to strip out the messages that tell people to use `sudo` to run the scripts, and instead replace it with a message telling people to `su` instead."},"comment":{"url":"https://api.github.com/repos/Fourdee/DietPi/issues/comments/232518472","html_url":"https://github.com/Fourdee/DietPi/issues/424#issuecomment-232518472","issue_url":"https://api.github.com/repos/Fourdee/DietPi/issues/424","id":232518472,"user":{"login":"rhkean","id":15089796,"avatar_url":"https://avatars.githubusercontent.com/u/15089796?v=3","gravatar_id":"","url":"https://api.github.com/users/rhkean","html_url":"https://github.com/rhkean","followers_url":"https://api.github.com/users/rhkean/followers","following_url":"https://api.github.com/users/rhkean/following{/other_user}","gists_url":"https://api.github.com/users/rhkean/gists{/gist_id}","starred_url":"https://api.github.com/users/rhkean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhkean/subscriptions","organizations_url":"https://api.github.com/users/rhkean/orgs","repos_url":"https://api.github.com/users/rhkean/repos","events_url":"https://api.github.com/users/rhkean/events{/privacy}","received_events_url":"https://api.github.com/users/rhkean/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T23:42:47Z","updated_at":"2016-07-13T23:42:47Z","body":"my proposed fix is to \r\n\r\n1.  add `/DietPi/dietpi` to the secure_path in the `sudoers` file \r\n2.  add `/DietPi/dietpi` to the PATH in `/etc/profile`\r\n3.  in `dietpi-services` when the `dietpi-*` files are copied to `/DietPi/dietpi` directory, perform a `chmod 744 /DietPi/dietpi/dietpi-*`  (or some variant that makes sense for limiting which scripts are executable)\r\n\r\nthis will \r\n1.  allow for `sudo` use\r\n2.  prevent scripts that we don't want run from getting run accidentally\r\n3.  let us avoid using hacks to circumvent the security feature"}}
{"actor":{"display_login":"rhkean"}}