{"action":"created","comment":{"url":"https://api.github.com/repos/openbsm/openbsm/pulls/comments/205918134","pull_request_review_id":141291295,"id":205918134,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTkxODEzNA==","diff_hunk":"@@ -42,6 +42,10 @@ The\n .Nm\n utility prints the contents of the audit trail files to the standard output in\n human-readable form.\n+.Nm\n+by default syncs to the start of next legitimate record if the initial part of","path":"bin/praudit/praudit.1","position":23,"original_position":23,"commit_id":"bf49cece391019ce6433ee29d1c4938a737c5e04","original_commit_id":"bf49cece391019ce6433ee29d1c4938a737c5e04","user":{"login":"aniketp","id":24573641,"node_id":"MDQ6VXNlcjI0NTczNjQx","avatar_url":"https://avatars3.githubusercontent.com/u/24573641?v=4","gravatar_id":"","url":"https://api.github.com/users/aniketp","html_url":"https://github.com/aniketp","followers_url":"https://api.github.com/users/aniketp/followers","following_url":"https://api.github.com/users/aniketp/following{/other_user}","gists_url":"https://api.github.com/users/aniketp/gists{/gist_id}","starred_url":"https://api.github.com/users/aniketp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aniketp/subscriptions","organizations_url":"https://api.github.com/users/aniketp/orgs","repos_url":"https://api.github.com/users/aniketp/repos","events_url":"https://api.github.com/users/aniketp/events{/privacy}","received_events_url":"https://api.github.com/users/aniketp/received_events","type":"User","site_admin":false},"body":"But isn't this a good info about partially corrupted records in case a user wants to know what happens with them?","created_at":"2018-07-27T23:00:41Z","updated_at":"2018-07-27T23:00:41Z","html_url":"https://github.com/openbsm/openbsm/pull/33#discussion_r205918134","pull_request_url":"https://api.github.com/repos/openbsm/openbsm/pulls/33","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openbsm/openbsm/pulls/comments/205918134"},"html":{"href":"https://github.com/openbsm/openbsm/pull/33#discussion_r205918134"},"pull_request":{"href":"https://api.github.com/repos/openbsm/openbsm/pulls/33"}},"in_reply_to_id":196083405},"pull_request":{"url":"https://api.github.com/repos/openbsm/openbsm/pulls/33","id":195496027,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1NDk2MDI3","html_url":"https://github.com/openbsm/openbsm/pull/33","diff_url":"https://github.com/openbsm/openbsm/pull/33.diff","patch_url":"https://github.com/openbsm/openbsm/pull/33.patch","issue_url":"https://api.github.com/repos/openbsm/openbsm/issues/33","number":33,"state":"open","locked":false,"title":"Fix CPU spinning issue with empty trail and make -p option the default behaviour","user":{"login":"aniketp","id":24573641,"node_id":"MDQ6VXNlcjI0NTczNjQx","avatar_url":"https://avatars3.githubusercontent.com/u/24573641?v=4","gravatar_id":"","url":"https://api.github.com/users/aniketp","html_url":"https://github.com/aniketp","followers_url":"https://api.github.com/users/aniketp/followers","following_url":"https://api.github.com/users/aniketp/following{/other_user}","gists_url":"https://api.github.com/users/aniketp/gists{/gist_id}","starred_url":"https://api.github.com/users/aniketp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aniketp/subscriptions","organizations_url":"https://api.github.com/users/aniketp/orgs","repos_url":"https://api.github.com/users/aniketp/repos","events_url":"https://api.github.com/users/aniketp/events{/privacy}","received_events_url":"https://api.github.com/users/aniketp/received_events","type":"User","site_admin":false},"body":"This PR introduces following changes\r\n* Enforce strict `exit(1)` return value at all reasonable failures\r\n* Remove `-p` option. Instead, make its behavior default.\r\n* Introduce a check for empty audit trail [Spinning CPU issue]\r\n\r\nThe `praudit -p` invocation syncs to the beginning of next legitimate audit record while ignoring the corrupted (incomplete) part. While the default option simply exits without even looking ahead. This behavior can cause uncertain decoding of audit trails which were say, picked up from the middle of an event.\r\n\r\nAlso, the code here:  [When -p option is enabled]\r\n``` C\r\ndo {\r\n\ttype = fgetc(fp);\r\n} while(type != AUT_HEADER32);\r\nungetc(type, fp);\r\n```\r\nLooks for next HEADER token. For an empty trail, with current \"-p\" option, this causes an infinite loop and the CPU starts shouting.\r\n\r\n### Test Plan\r\nHow the CPU issue is resolved\r\n``` bash\r\n$ touch emptyfile\r\n$ praudit emptyfile\r\n File is empty\r\n$ praudit emptyfile; echo $?\r\n File is empty\r\n 1\r\n```\r\nIntroduce a corrupted file\r\n``` bash\r\n$ cat trail\r\nSome random text in the beginning to make it corrupted\r\n  �[\u001ES�\u0002�-\u0001\u001Cdomain-\u0002\u0002type-\u0003\tprotocol$)7\u0012t�\u0004\r\n\u0002\u0002'\u0003\u0013�q\r\n$ praudit trail  # Earlier this could only be done with a -p option\r\nheader,113,11,socket(2),0,Mon Jun 11 10:50:20 2018, + 648 msec\r\nargument,1,0x1c,domain\r\nargument,2,0x2,type\r\nargument,3,0x0,protocol\r\nsubject,root,root,wheel,root,0,10551,4724,37636,10.0.2.2\r\nreturn,success,3\r\ntrailer,113\r\n```","created_at":"2018-06-18T11:31:29Z","updated_at":"2018-07-27T23:00:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c37d54127cd5ebc1d0919f4e199c0ad8face629","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openbsm/openbsm/pulls/33/commits","review_comments_url":"https://api.github.com/repos/openbsm/openbsm/pulls/33/comments","review_comment_url":"https://api.github.com/repos/openbsm/openbsm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openbsm/openbsm/issues/33/comments","statuses_url":"https://api.github.com/repos/openbsm/openbsm/statuses/bf49cece391019ce6433ee29d1c4938a737c5e04","head":{"label":"aniketp:master","ref":"master","sha":"bf49cece391019ce6433ee29d1c4938a737c5e04","user":{"login":"aniketp","id":24573641,"node_id":"MDQ6VXNlcjI0NTczNjQx","avatar_url":"https://avatars3.githubusercontent.com/u/24573641?v=4","gravatar_id":"","url":"https://api.github.com/users/aniketp","html_url":"https://github.com/aniketp","followers_url":"https://api.github.com/users/aniketp/followers","following_url":"https://api.github.com/users/aniketp/following{/other_user}","gists_url":"https://api.github.com/users/aniketp/gists{/gist_id}","starred_url":"https://api.github.com/users/aniketp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aniketp/subscriptions","organizations_url":"https://api.github.com/users/aniketp/orgs","repos_url":"https://api.github.com/users/aniketp/repos","events_url":"https://api.github.com/users/aniketp/events{/privacy}","received_events_url":"https://api.github.com/users/aniketp/received_events","type":"User","site_admin":false},"repo":{"id":119994419,"node_id":"MDEwOlJlcG9zaXRvcnkxMTk5OTQ0MTk=","name":"openbsm","full_name":"aniketp/openbsm","owner":{"login":"aniketp","id":24573641,"node_id":"MDQ6VXNlcjI0NTczNjQx","avatar_url":"https://avatars3.githubusercontent.com/u/24573641?v=4","gravatar_id":"","url":"https://api.github.com/users/aniketp","html_url":"https://github.com/aniketp","followers_url":"https://api.github.com/users/aniketp/followers","following_url":"https://api.github.com/users/aniketp/following{/other_user}","gists_url":"https://api.github.com/users/aniketp/gists{/gist_id}","starred_url":"https://api.github.com/users/aniketp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aniketp/subscriptions","organizations_url":"https://api.github.com/users/aniketp/orgs","repos_url":"https://api.github.com/users/aniketp/repos","events_url":"https://api.github.com/users/aniketp/events{/privacy}","received_events_url":"https://api.github.com/users/aniketp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aniketp/openbsm","description":"OpenBSM open audit implementation","fork":true,"url":"https://api.github.com/repos/aniketp/openbsm","forks_url":"https://api.github.com/repos/aniketp/openbsm/forks","keys_url":"https://api.github.com/repos/aniketp/openbsm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aniketp/openbsm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aniketp/openbsm/teams","hooks_url":"https://api.github.com/repos/aniketp/openbsm/hooks","issue_events_url":"https://api.github.com/repos/aniketp/openbsm/issues/events{/number}","events_url":"https://api.github.com/repos/aniketp/openbsm/events","assignees_url":"https://api.github.com/repos/aniketp/openbsm/assignees{/user}","branches_url":"https://api.github.com/repos/aniketp/openbsm/branches{/branch}","tags_url":"https://api.github.com/repos/aniketp/openbsm/tags","blobs_url":"https://api.github.com/repos/aniketp/openbsm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aniketp/openbsm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aniketp/openbsm/git/refs{/sha}","trees_url":"https://api.github.com/repos/aniketp/openbsm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aniketp/openbsm/statuses/{sha}","languages_url":"https://api.github.com/repos/aniketp/openbsm/languages","stargazers_url":"https://api.github.com/repos/aniketp/openbsm/stargazers","contributors_url":"https://api.github.com/repos/aniketp/openbsm/contributors","subscribers_url":"https://api.github.com/repos/aniketp/openbsm/subscribers","subscription_url":"https://api.github.com/repos/aniketp/openbsm/subscription","commits_url":"https://api.github.com/repos/aniketp/openbsm/commits{/sha}","git_commits_url":"https://api.github.com/repos/aniketp/openbsm/git/commits{/sha}","comments_url":"https://api.github.com/repos/aniketp/openbsm/comments{/number}","issue_comment_url":"https://api.github.com/repos/aniketp/openbsm/issues/comments{/number}","contents_url":"https://api.github.com/repos/aniketp/openbsm/contents/{+path}","compare_url":"https://api.github.com/repos/aniketp/openbsm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aniketp/openbsm/merges","archive_url":"https://api.github.com/repos/aniketp/openbsm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aniketp/openbsm/downloads","issues_url":"https://api.github.com/repos/aniketp/openbsm/issues{/number}","pulls_url":"https://api.github.com/repos/aniketp/openbsm/pulls{/number}","milestones_url":"https://api.github.com/repos/aniketp/openbsm/milestones{/number}","notifications_url":"https://api.github.com/repos/aniketp/openbsm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aniketp/openbsm/labels{/name}","releases_url":"https://api.github.com/repos/aniketp/openbsm/releases{/id}","deployments_url":"https://api.github.com/repos/aniketp/openbsm/deployments","created_at":"2018-02-02T14:55:45Z","updated_at":"2018-06-18T11:16:20Z","pushed_at":"2018-06-18T11:16:18Z","git_url":"git://github.com/aniketp/openbsm.git","ssh_url":"git@github.com:aniketp/openbsm.git","clone_url":"https://github.com/aniketp/openbsm.git","svn_url":"https://github.com/aniketp/openbsm","homepage":"http://www.openbsm.org","size":15352,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openbsm:master","ref":"master","sha":"ed83bb380e0f5353e0851ba643e55abd01b24abb","user":{"login":"openbsm","id":7904239,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MDQyMzk=","avatar_url":"https://avatars2.githubusercontent.com/u/7904239?v=4","gravatar_id":"","url":"https://api.github.com/users/openbsm","html_url":"https://github.com/openbsm","followers_url":"https://api.github.com/users/openbsm/followers","following_url":"https://api.github.com/users/openbsm/following{/other_user}","gists_url":"https://api.github.com/users/openbsm/gists{/gist_id}","starred_url":"https://api.github.com/users/openbsm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openbsm/subscriptions","organizations_url":"https://api.github.com/users/openbsm/orgs","repos_url":"https://api.github.com/users/openbsm/repos","events_url":"https://api.github.com/users/openbsm/events{/privacy}","received_events_url":"https://api.github.com/users/openbsm/received_events","type":"Organization","site_admin":false},"repo":{"id":20891149,"node_id":"MDEwOlJlcG9zaXRvcnkyMDg5MTE0OQ==","name":"openbsm","full_name":"openbsm/openbsm","owner":{"login":"openbsm","id":7904239,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MDQyMzk=","avatar_url":"https://avatars2.githubusercontent.com/u/7904239?v=4","gravatar_id":"","url":"https://api.github.com/users/openbsm","html_url":"https://github.com/openbsm","followers_url":"https://api.github.com/users/openbsm/followers","following_url":"https://api.github.com/users/openbsm/following{/other_user}","gists_url":"https://api.github.com/users/openbsm/gists{/gist_id}","starred_url":"https://api.github.com/users/openbsm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openbsm/subscriptions","organizations_url":"https://api.github.com/users/openbsm/orgs","repos_url":"https://api.github.com/users/openbsm/repos","events_url":"https://api.github.com/users/openbsm/events{/privacy}","received_events_url":"https://api.github.com/users/openbsm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openbsm/openbsm","description":"OpenBSM open audit implementation","fork":false,"url":"https://api.github.com/repos/openbsm/openbsm","forks_url":"https://api.github.com/repos/openbsm/openbsm/forks","keys_url":"https://api.github.com/repos/openbsm/openbsm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openbsm/openbsm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openbsm/openbsm/teams","hooks_url":"https://api.github.com/repos/openbsm/openbsm/hooks","issue_events_url":"https://api.github.com/repos/openbsm/openbsm/issues/events{/number}","events_url":"https://api.github.com/repos/openbsm/openbsm/events","assignees_url":"https://api.github.com/repos/openbsm/openbsm/assignees{/user}","branches_url":"https://api.github.com/repos/openbsm/openbsm/branches{/branch}","tags_url":"https://api.github.com/repos/openbsm/openbsm/tags","blobs_url":"https://api.github.com/repos/openbsm/openbsm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openbsm/openbsm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openbsm/openbsm/git/refs{/sha}","trees_url":"https://api.github.com/repos/openbsm/openbsm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openbsm/openbsm/statuses/{sha}","languages_url":"https://api.github.com/repos/openbsm/openbsm/languages","stargazers_url":"https://api.github.com/repos/openbsm/openbsm/stargazers","contributors_url":"https://api.github.com/repos/openbsm/openbsm/contributors","subscribers_url":"https://api.github.com/repos/openbsm/openbsm/subscribers","subscription_url":"https://api.github.com/repos/openbsm/openbsm/subscription","commits_url":"https://api.github.com/repos/openbsm/openbsm/commits{/sha}","git_commits_url":"https://api.github.com/repos/openbsm/openbsm/git/commits{/sha}","comments_url":"https://api.github.com/repos/openbsm/openbsm/comments{/number}","issue_comment_url":"https://api.github.com/repos/openbsm/openbsm/issues/comments{/number}","contents_url":"https://api.github.com/repos/openbsm/openbsm/contents/{+path}","compare_url":"https://api.github.com/repos/openbsm/openbsm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openbsm/openbsm/merges","archive_url":"https://api.github.com/repos/openbsm/openbsm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openbsm/openbsm/downloads","issues_url":"https://api.github.com/repos/openbsm/openbsm/issues{/number}","pulls_url":"https://api.github.com/repos/openbsm/openbsm/pulls{/number}","milestones_url":"https://api.github.com/repos/openbsm/openbsm/milestones{/number}","notifications_url":"https://api.github.com/repos/openbsm/openbsm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openbsm/openbsm/labels{/name}","releases_url":"https://api.github.com/repos/openbsm/openbsm/releases{/id}","deployments_url":"https://api.github.com/repos/openbsm/openbsm/deployments","created_at":"2014-06-16T16:01:59Z","updated_at":"2018-07-27T21:54:19Z","pushed_at":"2018-07-27T21:54:18Z","git_url":"git://github.com/openbsm/openbsm.git","ssh_url":"git@github.com:openbsm/openbsm.git","clone_url":"https://github.com/openbsm/openbsm.git","svn_url":"https://github.com/openbsm/openbsm","homepage":"http://www.openbsm.org","size":15353,"stargazers_count":66,"watchers_count":66,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":21,"open_issues":8,"watchers":66,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openbsm/openbsm/pulls/33"},"html":{"href":"https://github.com/openbsm/openbsm/pull/33"},"issue":{"href":"https://api.github.com/repos/openbsm/openbsm/issues/33"},"comments":{"href":"https://api.github.com/repos/openbsm/openbsm/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/openbsm/openbsm/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/openbsm/openbsm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openbsm/openbsm/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/openbsm/openbsm/statuses/bf49cece391019ce6433ee29d1c4938a737c5e04"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"aniketp"}}