{"action":"created","issue":{"url":"https://api.github.com/repos/acpica/acpica/issues/156","repository_url":"https://api.github.com/repos/acpica/acpica","labels_url":"https://api.github.com/repos/acpica/acpica/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/acpica/acpica/issues/156/comments","events_url":"https://api.github.com/repos/acpica/acpica/issues/156/events","html_url":"https://github.com/acpica/acpica/pull/156","id":167219885,"number":156,"title":"Fix deprecated functions when building for __APPLE__","user":{"login":"metacollin","id":181882,"avatar_url":"https://avatars.githubusercontent.com/u/181882?v=3","gravatar_id":"","url":"https://api.github.com/users/metacollin","html_url":"https://github.com/metacollin","followers_url":"https://api.github.com/users/metacollin/followers","following_url":"https://api.github.com/users/metacollin/following{/other_user}","gists_url":"https://api.github.com/users/metacollin/gists{/gist_id}","starred_url":"https://api.github.com/users/metacollin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metacollin/subscriptions","organizations_url":"https://api.github.com/users/metacollin/orgs","repos_url":"https://api.github.com/users/metacollin/repos","events_url":"https://api.github.com/users/metacollin/events{/privacy}","received_events_url":"https://api.github.com/users/metacollin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-24T06:26:15Z","updated_at":"2016-07-27T19:32:41Z","closed_at":"2016-07-27T19:32:41Z","pull_request":{"url":"https://api.github.com/repos/acpica/acpica/pulls/156","html_url":"https://github.com/acpica/acpica/pull/156","diff_url":"https://github.com/acpica/acpica/pull/156.diff","patch_url":"https://github.com/acpica/acpica/pull/156.patch"},"body":"The current ACPICA code will not compile with gcc or clang if building under OS X as it currently stands.  It calls two deprecated functions, sem_destroy and tmpnam.  Tmpnam is very insecure and can be used quite easily as a vehicle for privilege escalation via interprocess attacks.  mktemp behaves identically, including the way in which it fails (returns -1 etc), but is not deprecated and is secure.  It can be used as a simple drop-in replacement.  It is also safely tucked away inside an #ifdef __APPLE__ code block, so the effect it has is perfectly scoped.  \r\n\r\nThe other problem is that in a header file specific to the __APPLE__ platform, a macro is already in place and is clearly an attempt to expand sem_destroy (which is deprecated to the point that it is not even actually implemented in OS X, it is an optional part of the POSIX standard) with a perfectly valid alternative, sem_close.  Unfortunately, this macro is defined in a header file that is always included well before <semaphore.h> is included, so the declaration of sem_destroy (which is also where it is explicitly marked as deprecated) in semaphore.h is, just like was defined, expanded to sem_close by the preprocessor.  This results in sem_close being declared as deprecated, and wholly incorrectly, and the end result is nothing is actually solved.  So I simply made sure any such define was removed directly before including semaphore .h, then reapplied after, so it would have the intended effect throughout the rest of the code without the macro expansion polluting the semaphore.h system header.  \r\n\r\nOverall, this is almost on the level of a cosmetic change, and only effects OS X users, but it would be nice if typing `make` just worked for us too :).  \r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/acpica/acpica/issues/comments/235694687","html_url":"https://github.com/acpica/acpica/pull/156#issuecomment-235694687","issue_url":"https://api.github.com/repos/acpica/acpica/issues/156","id":235694687,"user":{"login":"acpibob","id":966572,"avatar_url":"https://avatars.githubusercontent.com/u/966572?v=3","gravatar_id":"","url":"https://api.github.com/users/acpibob","html_url":"https://github.com/acpibob","followers_url":"https://api.github.com/users/acpibob/followers","following_url":"https://api.github.com/users/acpibob/following{/other_user}","gists_url":"https://api.github.com/users/acpibob/gists{/gist_id}","starred_url":"https://api.github.com/users/acpibob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acpibob/subscriptions","organizations_url":"https://api.github.com/users/acpibob/orgs","repos_url":"https://api.github.com/users/acpibob/repos","events_url":"https://api.github.com/users/acpibob/events{/privacy}","received_events_url":"https://api.github.com/users/acpibob/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T19:32:41Z","updated_at":"2016-07-27T19:32:41Z","body":"I'll take this when there is agreement on it.\r\nbob\r\n"}}
{"actor":{"display_login":"acpibob"}}