{"action":"created","comment":{"url":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/comments/177493633","pull_request_review_id":107374105,"id":177493633,"diff_hunk":"@@ -0,0 +1,131 @@\n+/**\n+ * xrdp: A Remote Desktop Protocol server.\n+ *\n+ * Copyright (C) Emmanuel Blindauer 2017\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+/**\n+ *\n+ * @file sessionrecord.c\n+ * @brief utmp/wtmp handling code\n+ * Idea: Only implement actual utmp, i.e. utmpx for 99%.\n+ *       See http://80386.nl/unix/utmpx/\n+ */\n+\n+#if defined(HAVE_CONFIG_H)\n+#include <config_ac.h>\n+#endif\n+\n+#include <paths.h>\n+#include <pwd.h>\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <sys/time.h>\n+#include <unistd.h>\n+\n+#include \"log.h\"\n+#include \"os_calls.h\"\n+#include \"sessionrecord.h\"\n+\n+/*\n+ * Prepare the utmp/ struct and write it.\n+ * this can handle login and logout at once with the 'state' parameter\n+ */\n+\n+int\n+add_xtmp_entry(int pid, const char *line, const char *user, const char *rhostname, short state)","path":"sesman/sessionrecord.c","position":49,"original_position":49,"commit_id":"8dbda1abcc720dec0a73879b5d03f3f9a15e3ae6","original_commit_id":"8dbda1abcc720dec0a73879b5d03f3f9a15e3ae6","user":{"login":"moobyfr","id":628573,"avatar_url":"https://avatars0.githubusercontent.com/u/628573?v=4","gravatar_id":"","url":"https://api.github.com/users/moobyfr","html_url":"https://github.com/moobyfr","followers_url":"https://api.github.com/users/moobyfr/followers","following_url":"https://api.github.com/users/moobyfr/following{/other_user}","gists_url":"https://api.github.com/users/moobyfr/gists{/gist_id}","starred_url":"https://api.github.com/users/moobyfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moobyfr/subscriptions","organizations_url":"https://api.github.com/users/moobyfr/orgs","repos_url":"https://api.github.com/users/moobyfr/repos","events_url":"https://api.github.com/users/moobyfr/events{/privacy}","received_events_url":"https://api.github.com/users/moobyfr/received_events","type":"User","site_admin":false},"body":"They are used in ``utmp_login`` and ``utmp_logout``, ``state`` is set to  ``USER_PROCESS`` or ``DEAD_PROCESS``","created_at":"2018-03-27T16:43:02Z","updated_at":"2018-03-27T16:43:03Z","html_url":"https://github.com/neutrinolabs/xrdp/pull/1077#discussion_r177493633","pull_request_url":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/1077","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/comments/177493633"},"html":{"href":"https://github.com/neutrinolabs/xrdp/pull/1077#discussion_r177493633"},"pull_request":{"href":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/1077"}},"in_reply_to_id":177309967},"pull_request":{"url":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/1077","id":177056235,"html_url":"https://github.com/neutrinolabs/xrdp/pull/1077","diff_url":"https://github.com/neutrinolabs/xrdp/pull/1077.diff","patch_url":"https://github.com/neutrinolabs/xrdp/pull/1077.patch","issue_url":"https://api.github.com/repos/neutrinolabs/xrdp/issues/1077","number":1077,"state":"open","locked":false,"title":"Wtmp","user":{"login":"moobyfr","id":628573,"avatar_url":"https://avatars0.githubusercontent.com/u/628573?v=4","gravatar_id":"","url":"https://api.github.com/users/moobyfr","html_url":"https://github.com/moobyfr","followers_url":"https://api.github.com/users/moobyfr/followers","following_url":"https://api.github.com/users/moobyfr/following{/other_user}","gists_url":"https://api.github.com/users/moobyfr/gists{/gist_id}","starred_url":"https://api.github.com/users/moobyfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moobyfr/subscriptions","organizations_url":"https://api.github.com/users/moobyfr/orgs","repos_url":"https://api.github.com/users/moobyfr/repos","events_url":"https://api.github.com/users/moobyfr/events{/privacy}","received_events_url":"https://api.github.com/users/moobyfr/received_events","type":"User","site_admin":false},"body":"Add the utmp/wtmp support.","created_at":"2018-03-23T12:30:15Z","updated_at":"2018-03-27T16:43:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d37772d4a1d67cf0ae5d89b52c495b59620b253c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/1077/commits","review_comments_url":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/1077/comments","review_comment_url":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neutrinolabs/xrdp/issues/1077/comments","statuses_url":"https://api.github.com/repos/neutrinolabs/xrdp/statuses/8dbda1abcc720dec0a73879b5d03f3f9a15e3ae6","head":{"label":"neutrinolabs:wtmp","ref":"wtmp","sha":"8dbda1abcc720dec0a73879b5d03f3f9a15e3ae6","user":{"login":"neutrinolabs","id":2615587,"avatar_url":"https://avatars0.githubusercontent.com/u/2615587?v=4","gravatar_id":"","url":"https://api.github.com/users/neutrinolabs","html_url":"https://github.com/neutrinolabs","followers_url":"https://api.github.com/users/neutrinolabs/followers","following_url":"https://api.github.com/users/neutrinolabs/following{/other_user}","gists_url":"https://api.github.com/users/neutrinolabs/gists{/gist_id}","starred_url":"https://api.github.com/users/neutrinolabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutrinolabs/subscriptions","organizations_url":"https://api.github.com/users/neutrinolabs/orgs","repos_url":"https://api.github.com/users/neutrinolabs/repos","events_url":"https://api.github.com/users/neutrinolabs/events{/privacy}","received_events_url":"https://api.github.com/users/neutrinolabs/received_events","type":"Organization","site_admin":false},"repo":{"id":1660127,"name":"xrdp","full_name":"neutrinolabs/xrdp","owner":{"login":"neutrinolabs","id":2615587,"avatar_url":"https://avatars0.githubusercontent.com/u/2615587?v=4","gravatar_id":"","url":"https://api.github.com/users/neutrinolabs","html_url":"https://github.com/neutrinolabs","followers_url":"https://api.github.com/users/neutrinolabs/followers","following_url":"https://api.github.com/users/neutrinolabs/following{/other_user}","gists_url":"https://api.github.com/users/neutrinolabs/gists{/gist_id}","starred_url":"https://api.github.com/users/neutrinolabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutrinolabs/subscriptions","organizations_url":"https://api.github.com/users/neutrinolabs/orgs","repos_url":"https://api.github.com/users/neutrinolabs/repos","events_url":"https://api.github.com/users/neutrinolabs/events{/privacy}","received_events_url":"https://api.github.com/users/neutrinolabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neutrinolabs/xrdp","description":"xrdp: an open source RDP server","fork":false,"url":"https://api.github.com/repos/neutrinolabs/xrdp","forks_url":"https://api.github.com/repos/neutrinolabs/xrdp/forks","keys_url":"https://api.github.com/repos/neutrinolabs/xrdp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neutrinolabs/xrdp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neutrinolabs/xrdp/teams","hooks_url":"https://api.github.com/repos/neutrinolabs/xrdp/hooks","issue_events_url":"https://api.github.com/repos/neutrinolabs/xrdp/issues/events{/number}","events_url":"https://api.github.com/repos/neutrinolabs/xrdp/events","assignees_url":"https://api.github.com/repos/neutrinolabs/xrdp/assignees{/user}","branches_url":"https://api.github.com/repos/neutrinolabs/xrdp/branches{/branch}","tags_url":"https://api.github.com/repos/neutrinolabs/xrdp/tags","blobs_url":"https://api.github.com/repos/neutrinolabs/xrdp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neutrinolabs/xrdp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neutrinolabs/xrdp/git/refs{/sha}","trees_url":"https://api.github.com/repos/neutrinolabs/xrdp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neutrinolabs/xrdp/statuses/{sha}","languages_url":"https://api.github.com/repos/neutrinolabs/xrdp/languages","stargazers_url":"https://api.github.com/repos/neutrinolabs/xrdp/stargazers","contributors_url":"https://api.github.com/repos/neutrinolabs/xrdp/contributors","subscribers_url":"https://api.github.com/repos/neutrinolabs/xrdp/subscribers","subscription_url":"https://api.github.com/repos/neutrinolabs/xrdp/subscription","commits_url":"https://api.github.com/repos/neutrinolabs/xrdp/commits{/sha}","git_commits_url":"https://api.github.com/repos/neutrinolabs/xrdp/git/commits{/sha}","comments_url":"https://api.github.com/repos/neutrinolabs/xrdp/comments{/number}","issue_comment_url":"https://api.github.com/repos/neutrinolabs/xrdp/issues/comments{/number}","contents_url":"https://api.github.com/repos/neutrinolabs/xrdp/contents/{+path}","compare_url":"https://api.github.com/repos/neutrinolabs/xrdp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neutrinolabs/xrdp/merges","archive_url":"https://api.github.com/repos/neutrinolabs/xrdp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neutrinolabs/xrdp/downloads","issues_url":"https://api.github.com/repos/neutrinolabs/xrdp/issues{/number}","pulls_url":"https://api.github.com/repos/neutrinolabs/xrdp/pulls{/number}","milestones_url":"https://api.github.com/repos/neutrinolabs/xrdp/milestones{/number}","notifications_url":"https://api.github.com/repos/neutrinolabs/xrdp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neutrinolabs/xrdp/labels{/name}","releases_url":"https://api.github.com/repos/neutrinolabs/xrdp/releases{/id}","deployments_url":"https://api.github.com/repos/neutrinolabs/xrdp/deployments","created_at":"2011-04-25T14:31:17Z","updated_at":"2018-03-27T14:46:32Z","pushed_at":"2018-03-27T06:22:51Z","git_url":"git://github.com/neutrinolabs/xrdp.git","ssh_url":"git@github.com:neutrinolabs/xrdp.git","clone_url":"https://github.com/neutrinolabs/xrdp.git","svn_url":"https://github.com/neutrinolabs/xrdp","homepage":"http://www.xrdp.org/","size":12349,"stargazers_count":790,"watchers_count":790,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":264,"mirror_url":null,"archived":false,"open_issues_count":177,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":264,"open_issues":177,"watchers":790,"default_branch":"devel"}},"base":{"label":"neutrinolabs:devel","ref":"devel","sha":"37d5430123b677b94f0bdaaa6ec1aee3cf50788b","user":{"login":"neutrinolabs","id":2615587,"avatar_url":"https://avatars0.githubusercontent.com/u/2615587?v=4","gravatar_id":"","url":"https://api.github.com/users/neutrinolabs","html_url":"https://github.com/neutrinolabs","followers_url":"https://api.github.com/users/neutrinolabs/followers","following_url":"https://api.github.com/users/neutrinolabs/following{/other_user}","gists_url":"https://api.github.com/users/neutrinolabs/gists{/gist_id}","starred_url":"https://api.github.com/users/neutrinolabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutrinolabs/subscriptions","organizations_url":"https://api.github.com/users/neutrinolabs/orgs","repos_url":"https://api.github.com/users/neutrinolabs/repos","events_url":"https://api.github.com/users/neutrinolabs/events{/privacy}","received_events_url":"https://api.github.com/users/neutrinolabs/received_events","type":"Organization","site_admin":false},"repo":{"id":1660127,"name":"xrdp","full_name":"neutrinolabs/xrdp","owner":{"login":"neutrinolabs","id":2615587,"avatar_url":"https://avatars0.githubusercontent.com/u/2615587?v=4","gravatar_id":"","url":"https://api.github.com/users/neutrinolabs","html_url":"https://github.com/neutrinolabs","followers_url":"https://api.github.com/users/neutrinolabs/followers","following_url":"https://api.github.com/users/neutrinolabs/following{/other_user}","gists_url":"https://api.github.com/users/neutrinolabs/gists{/gist_id}","starred_url":"https://api.github.com/users/neutrinolabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neutrinolabs/subscriptions","organizations_url":"https://api.github.com/users/neutrinolabs/orgs","repos_url":"https://api.github.com/users/neutrinolabs/repos","events_url":"https://api.github.com/users/neutrinolabs/events{/privacy}","received_events_url":"https://api.github.com/users/neutrinolabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neutrinolabs/xrdp","description":"xrdp: an open source RDP server","fork":false,"url":"https://api.github.com/repos/neutrinolabs/xrdp","forks_url":"https://api.github.com/repos/neutrinolabs/xrdp/forks","keys_url":"https://api.github.com/repos/neutrinolabs/xrdp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neutrinolabs/xrdp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neutrinolabs/xrdp/teams","hooks_url":"https://api.github.com/repos/neutrinolabs/xrdp/hooks","issue_events_url":"https://api.github.com/repos/neutrinolabs/xrdp/issues/events{/number}","events_url":"https://api.github.com/repos/neutrinolabs/xrdp/events","assignees_url":"https://api.github.com/repos/neutrinolabs/xrdp/assignees{/user}","branches_url":"https://api.github.com/repos/neutrinolabs/xrdp/branches{/branch}","tags_url":"https://api.github.com/repos/neutrinolabs/xrdp/tags","blobs_url":"https://api.github.com/repos/neutrinolabs/xrdp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neutrinolabs/xrdp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neutrinolabs/xrdp/git/refs{/sha}","trees_url":"https://api.github.com/repos/neutrinolabs/xrdp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neutrinolabs/xrdp/statuses/{sha}","languages_url":"https://api.github.com/repos/neutrinolabs/xrdp/languages","stargazers_url":"https://api.github.com/repos/neutrinolabs/xrdp/stargazers","contributors_url":"https://api.github.com/repos/neutrinolabs/xrdp/contributors","subscribers_url":"https://api.github.com/repos/neutrinolabs/xrdp/subscribers","subscription_url":"https://api.github.com/repos/neutrinolabs/xrdp/subscription","commits_url":"https://api.github.com/repos/neutrinolabs/xrdp/commits{/sha}","git_commits_url":"https://api.github.com/repos/neutrinolabs/xrdp/git/commits{/sha}","comments_url":"https://api.github.com/repos/neutrinolabs/xrdp/comments{/number}","issue_comment_url":"https://api.github.com/repos/neutrinolabs/xrdp/issues/comments{/number}","contents_url":"https://api.github.com/repos/neutrinolabs/xrdp/contents/{+path}","compare_url":"https://api.github.com/repos/neutrinolabs/xrdp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neutrinolabs/xrdp/merges","archive_url":"https://api.github.com/repos/neutrinolabs/xrdp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neutrinolabs/xrdp/downloads","issues_url":"https://api.github.com/repos/neutrinolabs/xrdp/issues{/number}","pulls_url":"https://api.github.com/repos/neutrinolabs/xrdp/pulls{/number}","milestones_url":"https://api.github.com/repos/neutrinolabs/xrdp/milestones{/number}","notifications_url":"https://api.github.com/repos/neutrinolabs/xrdp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neutrinolabs/xrdp/labels{/name}","releases_url":"https://api.github.com/repos/neutrinolabs/xrdp/releases{/id}","deployments_url":"https://api.github.com/repos/neutrinolabs/xrdp/deployments","created_at":"2011-04-25T14:31:17Z","updated_at":"2018-03-27T14:46:32Z","pushed_at":"2018-03-27T06:22:51Z","git_url":"git://github.com/neutrinolabs/xrdp.git","ssh_url":"git@github.com:neutrinolabs/xrdp.git","clone_url":"https://github.com/neutrinolabs/xrdp.git","svn_url":"https://github.com/neutrinolabs/xrdp","homepage":"http://www.xrdp.org/","size":12349,"stargazers_count":790,"watchers_count":790,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":264,"mirror_url":null,"archived":false,"open_issues_count":177,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":264,"open_issues":177,"watchers":790,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/1077"},"html":{"href":"https://github.com/neutrinolabs/xrdp/pull/1077"},"issue":{"href":"https://api.github.com/repos/neutrinolabs/xrdp/issues/1077"},"comments":{"href":"https://api.github.com/repos/neutrinolabs/xrdp/issues/1077/comments"},"review_comments":{"href":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/1077/comments"},"review_comment":{"href":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neutrinolabs/xrdp/pulls/1077/commits"},"statuses":{"href":"https://api.github.com/repos/neutrinolabs/xrdp/statuses/8dbda1abcc720dec0a73879b5d03f3f9a15e3ae6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"moobyfr"}}