{"action":"created","comment":{"url":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/comments/37034142","id":37034142,"diff_hunk":"@@ -142,28 +135,64 @@ func main() {\n \t} else {\n \t\tserverAddr = strings.TrimPrefix(serverEnvVar, \"tcp://\")\n \t\tif serverAddr == serverEnvVar {\n-\t\t\tglog.Fatalf(\"client: invalid SERVER_PORT environment variable value '%s'\\n\", serverEnvVar)\n+\t\t\tusage(\"client: invalid SERVER_PORT environment variable value '%s'\\n\", serverEnvVar)\n \t\t}\n \t}\n \n \tswitch *demoAuth {\n \tcase \"tcp\", \"tls\", \"tao\":\n \tdefault:\n-\t\tglog.Fatalf(\"unrecognized authentication mode: %s\\n\", *demoAuth)\n+\t\tusage(\"unrecognized authentication mode: %s\\n\", *demoAuth)\n \t}\n \n-\tglog.Info(\"Go Tao Demo\")\n+\tfmt.Println(\"Go Tao Demo Client\")\n \n \tif tao.Parent() == nil {\n-\t\tglog.Fatal(\"can't continue: No host Tao available\")\n+\t\tfail(nil, \"can't continue: No host Tao available\")\n+\t}\n+\n+\tdomain, err := tao.LoadDomain(configPath(), nil)\n+\tfailIf(err, \"error: couldn't load the tao domain from %s\\n\", configPath())\n+\n+\tdoClient(domain)\n+\tfmt.Println(\"Client Done\")\n+}\n+\n+func domainPath() string {\n+\tif *domainPathFlag != \"\" {\n+\t\treturn *domainPathFlag\n+\t}\n+\tif path := os.Getenv(\"TAO_DOMAIN\"); path != \"\" {\n+\t\treturn path\n+\t}\n+\tusage(\"Must supply -tao_domain or set $TAO_DOMAIN\")\n+\treturn \"\"\n+}\n+\n+func configPath() string {\n+\treturn path.Join(domainPath(), \"tao.config\")\n+}\n+\n+func failIf(err error, msg string, args ...interface{}) {\n+\tif err != nil {\n+\t\tfail(err, msg, args...)\n \t}\n+}\n \n-\tdomain, err := tao.LoadDomain(*configPath, nil)\n+func fail(err error, msg string, args ...interface{}) {\n+\ts := fmt.Sprintf(msg, args...)\n \tif err != nil {\n-\t\tglog.Fatalf(\"error: couldn't load the tao domain from %s\\n\", *configPath)\n+\t\tfmt.Fprintf(os.Stderr, \"%v: %s\\n\", err, s)\n+\t} else {\n+\t\tfmt.Fprintf(os.Stderr, \"error: %s\\n\", s)\n \t}\n+\tos.Exit(2)\n+}\n \n-\tdoClient(domain)\n-\tglog.Info(\"Client Done\")\n-\tglog.Flush()\n+func usage(msg string, args ...interface{}) {\n+\ts := fmt.Sprintf(msg, args...)\n+\tfmt.Fprintf(os.Stderr, \"%s\\n\", s)","path":"go/apps/demo/demo_client/demo_client.go","position":180,"original_position":180,"commit_id":"a0a405a0582eff4d9a17df6fcf39593b9ddc8caf","original_commit_id":"103a6698031f3726d838e30460c4bcde9e832b79","user":{"login":"tmroeder","id":889223,"avatar_url":"https://avatars.githubusercontent.com/u/889223?v=3","gravatar_id":"","url":"https://api.github.com/users/tmroeder","html_url":"https://github.com/tmroeder","followers_url":"https://api.github.com/users/tmroeder/followers","following_url":"https://api.github.com/users/tmroeder/following{/other_user}","gists_url":"https://api.github.com/users/tmroeder/gists{/gist_id}","starred_url":"https://api.github.com/users/tmroeder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmroeder/subscriptions","organizations_url":"https://api.github.com/users/tmroeder/orgs","repos_url":"https://api.github.com/users/tmroeder/repos","events_url":"https://api.github.com/users/tmroeder/events{/privacy}","received_events_url":"https://api.github.com/users/tmroeder/received_events","type":"User","site_admin":false},"body":"I must be missing something here: why isn't this combined with the line above? Fprintf does the same string/vargs formatting as Sprintf.","created_at":"2015-08-13T22:39:24Z","updated_at":"2015-08-13T22:39:24Z","html_url":"https://github.com/jlmucb/cloudproxy/pull/13#discussion_r37034142","pull_request_url":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/comments/37034142"},"html":{"href":"https://github.com/jlmucb/cloudproxy/pull/13#discussion_r37034142"},"pull_request":{"href":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/13","id":40741856,"html_url":"https://github.com/jlmucb/cloudproxy/pull/13","diff_url":"https://github.com/jlmucb/cloudproxy/pull/13.diff","patch_url":"https://github.com/jlmucb/cloudproxy/pull/13.patch","issue_url":"https://api.github.com/repos/jlmucb/cloudproxy/issues/13","number":13,"state":"open","locked":false,"title":"Use stdio from tao_launcher when creating hosted processes","user":{"login":"kevinawalsh","id":7904642,"avatar_url":"https://avatars.githubusercontent.com/u/7904642?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinawalsh","html_url":"https://github.com/kevinawalsh","followers_url":"https://api.github.com/users/kevinawalsh/followers","following_url":"https://api.github.com/users/kevinawalsh/following{/other_user}","gists_url":"https://api.github.com/users/kevinawalsh/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinawalsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinawalsh/subscriptions","organizations_url":"https://api.github.com/users/kevinawalsh/orgs","repos_url":"https://api.github.com/users/kevinawalsh/repos","events_url":"https://api.github.com/users/kevinawalsh/events{/privacy}","received_events_url":"https://api.github.com/users/kevinawalsh/received_events","type":"User","site_admin":false},"body":"No rush on this, I'm just getting reoriented with the code base.\r\n\r\nThe child can now use stdin, stdout, stderr, which are all inherited both across the unix domain pipe (from launcher to admin host) and across the fork (from admin host to child). This addresses part of issue #8.\r\nStdout has been tested using linux process factory.\r\nStdin and stderr have not, nor have kvm or docker factories.\r\n\r\nNext up?\r\n\r\n* more testing\r\n* change directories to that of tao_launcher\r\n* inherit the controlling terminal as well (which probably requires changing the child to the process group of tao_launcher)  \r\n","created_at":"2015-07-24T04:27:03Z","updated_at":"2015-08-13T22:39:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4c4fcd2010f4332e8fe65dfcc121d927cb7d76e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/13/commits","review_comments_url":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/13/comments","review_comment_url":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jlmucb/cloudproxy/issues/13/comments","statuses_url":"https://api.github.com/repos/jlmucb/cloudproxy/statuses/a0a405a0582eff4d9a17df6fcf39593b9ddc8caf","head":{"label":"jlmucb:kwalsh","ref":"kwalsh","sha":"a0a405a0582eff4d9a17df6fcf39593b9ddc8caf","user":{"login":"jlmucb","id":7945170,"avatar_url":"https://avatars.githubusercontent.com/u/7945170?v=3","gravatar_id":"","url":"https://api.github.com/users/jlmucb","html_url":"https://github.com/jlmucb","followers_url":"https://api.github.com/users/jlmucb/followers","following_url":"https://api.github.com/users/jlmucb/following{/other_user}","gists_url":"https://api.github.com/users/jlmucb/gists{/gist_id}","starred_url":"https://api.github.com/users/jlmucb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlmucb/subscriptions","organizations_url":"https://api.github.com/users/jlmucb/orgs","repos_url":"https://api.github.com/users/jlmucb/repos","events_url":"https://api.github.com/users/jlmucb/events{/privacy}","received_events_url":"https://api.github.com/users/jlmucb/received_events","type":"User","site_admin":false},"repo":{"id":22765204,"name":"cloudproxy","full_name":"jlmucb/cloudproxy","owner":{"login":"jlmucb","id":7945170,"avatar_url":"https://avatars.githubusercontent.com/u/7945170?v=3","gravatar_id":"","url":"https://api.github.com/users/jlmucb","html_url":"https://github.com/jlmucb","followers_url":"https://api.github.com/users/jlmucb/followers","following_url":"https://api.github.com/users/jlmucb/following{/other_user}","gists_url":"https://api.github.com/users/jlmucb/gists{/gist_id}","starred_url":"https://api.github.com/users/jlmucb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlmucb/subscriptions","organizations_url":"https://api.github.com/users/jlmucb/orgs","repos_url":"https://api.github.com/users/jlmucb/repos","events_url":"https://api.github.com/users/jlmucb/events{/privacy}","received_events_url":"https://api.github.com/users/jlmucb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jlmucb/cloudproxy","description":"The CloudProxy Tao for Trustworthy Computing","fork":false,"url":"https://api.github.com/repos/jlmucb/cloudproxy","forks_url":"https://api.github.com/repos/jlmucb/cloudproxy/forks","keys_url":"https://api.github.com/repos/jlmucb/cloudproxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jlmucb/cloudproxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jlmucb/cloudproxy/teams","hooks_url":"https://api.github.com/repos/jlmucb/cloudproxy/hooks","issue_events_url":"https://api.github.com/repos/jlmucb/cloudproxy/issues/events{/number}","events_url":"https://api.github.com/repos/jlmucb/cloudproxy/events","assignees_url":"https://api.github.com/repos/jlmucb/cloudproxy/assignees{/user}","branches_url":"https://api.github.com/repos/jlmucb/cloudproxy/branches{/branch}","tags_url":"https://api.github.com/repos/jlmucb/cloudproxy/tags","blobs_url":"https://api.github.com/repos/jlmucb/cloudproxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jlmucb/cloudproxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jlmucb/cloudproxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jlmucb/cloudproxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jlmucb/cloudproxy/statuses/{sha}","languages_url":"https://api.github.com/repos/jlmucb/cloudproxy/languages","stargazers_url":"https://api.github.com/repos/jlmucb/cloudproxy/stargazers","contributors_url":"https://api.github.com/repos/jlmucb/cloudproxy/contributors","subscribers_url":"https://api.github.com/repos/jlmucb/cloudproxy/subscribers","subscription_url":"https://api.github.com/repos/jlmucb/cloudproxy/subscription","commits_url":"https://api.github.com/repos/jlmucb/cloudproxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jlmucb/cloudproxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jlmucb/cloudproxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jlmucb/cloudproxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jlmucb/cloudproxy/contents/{+path}","compare_url":"https://api.github.com/repos/jlmucb/cloudproxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jlmucb/cloudproxy/merges","archive_url":"https://api.github.com/repos/jlmucb/cloudproxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jlmucb/cloudproxy/downloads","issues_url":"https://api.github.com/repos/jlmucb/cloudproxy/issues{/number}","pulls_url":"https://api.github.com/repos/jlmucb/cloudproxy/pulls{/number}","milestones_url":"https://api.github.com/repos/jlmucb/cloudproxy/milestones{/number}","notifications_url":"https://api.github.com/repos/jlmucb/cloudproxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jlmucb/cloudproxy/labels{/name}","releases_url":"https://api.github.com/repos/jlmucb/cloudproxy/releases{/id}","created_at":"2014-08-08T17:04:43Z","updated_at":"2015-07-27T18:27:49Z","pushed_at":"2015-08-13T22:36:28Z","git_url":"git://github.com/jlmucb/cloudproxy.git","ssh_url":"git@github.com:jlmucb/cloudproxy.git","clone_url":"https://github.com/jlmucb/cloudproxy.git","svn_url":"https://github.com/jlmucb/cloudproxy","homepage":null,"size":27136,"stargazers_count":21,"watchers_count":21,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":8,"forks":3,"open_issues":8,"watchers":21,"default_branch":"master"}},"base":{"label":"jlmucb:master","ref":"master","sha":"78fb7a7b541251543471fa8e3b89cf6ed36e5dc4","user":{"login":"jlmucb","id":7945170,"avatar_url":"https://avatars.githubusercontent.com/u/7945170?v=3","gravatar_id":"","url":"https://api.github.com/users/jlmucb","html_url":"https://github.com/jlmucb","followers_url":"https://api.github.com/users/jlmucb/followers","following_url":"https://api.github.com/users/jlmucb/following{/other_user}","gists_url":"https://api.github.com/users/jlmucb/gists{/gist_id}","starred_url":"https://api.github.com/users/jlmucb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlmucb/subscriptions","organizations_url":"https://api.github.com/users/jlmucb/orgs","repos_url":"https://api.github.com/users/jlmucb/repos","events_url":"https://api.github.com/users/jlmucb/events{/privacy}","received_events_url":"https://api.github.com/users/jlmucb/received_events","type":"User","site_admin":false},"repo":{"id":22765204,"name":"cloudproxy","full_name":"jlmucb/cloudproxy","owner":{"login":"jlmucb","id":7945170,"avatar_url":"https://avatars.githubusercontent.com/u/7945170?v=3","gravatar_id":"","url":"https://api.github.com/users/jlmucb","html_url":"https://github.com/jlmucb","followers_url":"https://api.github.com/users/jlmucb/followers","following_url":"https://api.github.com/users/jlmucb/following{/other_user}","gists_url":"https://api.github.com/users/jlmucb/gists{/gist_id}","starred_url":"https://api.github.com/users/jlmucb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlmucb/subscriptions","organizations_url":"https://api.github.com/users/jlmucb/orgs","repos_url":"https://api.github.com/users/jlmucb/repos","events_url":"https://api.github.com/users/jlmucb/events{/privacy}","received_events_url":"https://api.github.com/users/jlmucb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jlmucb/cloudproxy","description":"The CloudProxy Tao for Trustworthy Computing","fork":false,"url":"https://api.github.com/repos/jlmucb/cloudproxy","forks_url":"https://api.github.com/repos/jlmucb/cloudproxy/forks","keys_url":"https://api.github.com/repos/jlmucb/cloudproxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jlmucb/cloudproxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jlmucb/cloudproxy/teams","hooks_url":"https://api.github.com/repos/jlmucb/cloudproxy/hooks","issue_events_url":"https://api.github.com/repos/jlmucb/cloudproxy/issues/events{/number}","events_url":"https://api.github.com/repos/jlmucb/cloudproxy/events","assignees_url":"https://api.github.com/repos/jlmucb/cloudproxy/assignees{/user}","branches_url":"https://api.github.com/repos/jlmucb/cloudproxy/branches{/branch}","tags_url":"https://api.github.com/repos/jlmucb/cloudproxy/tags","blobs_url":"https://api.github.com/repos/jlmucb/cloudproxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jlmucb/cloudproxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jlmucb/cloudproxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jlmucb/cloudproxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jlmucb/cloudproxy/statuses/{sha}","languages_url":"https://api.github.com/repos/jlmucb/cloudproxy/languages","stargazers_url":"https://api.github.com/repos/jlmucb/cloudproxy/stargazers","contributors_url":"https://api.github.com/repos/jlmucb/cloudproxy/contributors","subscribers_url":"https://api.github.com/repos/jlmucb/cloudproxy/subscribers","subscription_url":"https://api.github.com/repos/jlmucb/cloudproxy/subscription","commits_url":"https://api.github.com/repos/jlmucb/cloudproxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jlmucb/cloudproxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jlmucb/cloudproxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jlmucb/cloudproxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jlmucb/cloudproxy/contents/{+path}","compare_url":"https://api.github.com/repos/jlmucb/cloudproxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jlmucb/cloudproxy/merges","archive_url":"https://api.github.com/repos/jlmucb/cloudproxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jlmucb/cloudproxy/downloads","issues_url":"https://api.github.com/repos/jlmucb/cloudproxy/issues{/number}","pulls_url":"https://api.github.com/repos/jlmucb/cloudproxy/pulls{/number}","milestones_url":"https://api.github.com/repos/jlmucb/cloudproxy/milestones{/number}","notifications_url":"https://api.github.com/repos/jlmucb/cloudproxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jlmucb/cloudproxy/labels{/name}","releases_url":"https://api.github.com/repos/jlmucb/cloudproxy/releases{/id}","created_at":"2014-08-08T17:04:43Z","updated_at":"2015-07-27T18:27:49Z","pushed_at":"2015-08-13T22:36:28Z","git_url":"git://github.com/jlmucb/cloudproxy.git","ssh_url":"git@github.com:jlmucb/cloudproxy.git","clone_url":"https://github.com/jlmucb/cloudproxy.git","svn_url":"https://github.com/jlmucb/cloudproxy","homepage":null,"size":27136,"stargazers_count":21,"watchers_count":21,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":8,"forks":3,"open_issues":8,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/13"},"html":{"href":"https://github.com/jlmucb/cloudproxy/pull/13"},"issue":{"href":"https://api.github.com/repos/jlmucb/cloudproxy/issues/13"},"comments":{"href":"https://api.github.com/repos/jlmucb/cloudproxy/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jlmucb/cloudproxy/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/jlmucb/cloudproxy/statuses/a0a405a0582eff4d9a17df6fcf39593b9ddc8caf"}}}}