summaryrefslogtreecommitdiff
path: root/app-misc/beep
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-04-05 21:52:00 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-04-05 21:52:00 +0100
commit2d446203bcf1a0db08e99abca43513d246dfa73d (patch)
treeec623bb5f1f389976977e375342ec59ff441eab7 /app-misc/beep
parent171a011ad3a131671aeb5a98b9e3adf219ad2865 (diff)
gentoo resync : 05.04.2018
Diffstat (limited to 'app-misc/beep')
-rw-r--r--app-misc/beep/Manifest2
-rw-r--r--app-misc/beep/beep-1.3-r3.ebuild37
-rw-r--r--app-misc/beep/files/beep-1.3-CVE-2018-0492.patch106
3 files changed, 145 insertions, 0 deletions
diff --git a/app-misc/beep/Manifest b/app-misc/beep/Manifest
index e780a41c2352..af990013bf60 100644
--- a/app-misc/beep/Manifest
+++ b/app-misc/beep/Manifest
@@ -1,4 +1,6 @@
+AUX beep-1.3-CVE-2018-0492.patch 3292 BLAKE2B fafed7dbe65438869adccf674b19c4e5b6655dca794043bbb9914879fc8e9bb6eac67b35254f47ec61a9ad5147aac6b819edb3fc8633e81c79d555023a422147 SHA512 e7ba3db3e70d2560c2a8701d9424db43a2e94988728b84bc84c5e6d777fc1e0596d767470fca41774a104cba9d2e58ef59f6449570c3d3887c1bf97861bc5bad
AUX beep-1.3-Makefile.patch 516 BLAKE2B f69b5907e7a1342a574bedc273e609415e5853939aa694894c732333e482f2507462748cfb9ba1f0945f4778653d44c3fa04c4aca3eb78afb7152597beba759a SHA512 b21f788780a13bbef436b80ec020b8727b9c1a8ddac3552cb8bf05d7ab937851d05d72279b53b51dd0ae1f99e44f55caa494b7e61b59800d91dd186497b65009
DIST beep-1.3.tar.gz 19344 BLAKE2B 4f9cf12f6983eeb53502fd85e5e1d428e1c1af481f8f424f6ae18cbe104462e8fdcc96670a72daa8a8a0d1430d00824d8795b4db53437e7bb7320cddfd84cfd3 SHA512 3f71146202208fa0c0cda360d125dd972ea003cf8cd62da21d67eb544c92f7b82640e7ce7c3835cbc65c75909a882edfa54dbd8d8b748d6f243711ea331477fd
EBUILD beep-1.3-r2.ebuild 639 BLAKE2B dc9f0e4ce7d73941801fff7c7a872f1295c2b59aec1a076b3700aca6aa21520ac71a104e0e84c60545684120e6d619e82117e8e145e48c803a85887cb7f82c58 SHA512 8efda568f0faa4471f495c243ab64fa0fc360ad6e05fb7752b615a8ecd527a44667a2829eab35413cb0642805abd387e0033dedca05affc5269f68178fbbe485
+EBUILD beep-1.3-r3.ebuild 684 BLAKE2B 261c3dd6a2e90c923f74ba01d66a2d29873dfd411ac50bc49375aa8c672995f12d21757ffefecc41eca0b7c8fc80c79cb002470f774e8aeaa7099c998968228f SHA512 29560fd571aa6ad5d7222223b54330e278ff33c5ad69dd68440333dafc3cec128f3b24baebeff2abd4fda3f148caa79ccd2bca93ba3a5e18557509e5b490e31f
MISC metadata.xml 271 BLAKE2B 46146f4bf13e9f4d33435225ec1012dd9bb89b20812963dc50368cab2a60a3c542052cb72f8963cc72074b2c13a5b054c77152de1d108027752601a349bc4ef8 SHA512 3e98f5382cf789992bdfc0f32e6e36eba31944be654c03f2ed9bd00baf56c8b768c256c4f8778d5775d6df38da4afcf8e32b6e6495a1ecfc8e7982c7c8943b1b
diff --git a/app-misc/beep/beep-1.3-r3.ebuild b/app-misc/beep/beep-1.3-r3.ebuild
new file mode 100644
index 000000000000..123132094977
--- /dev/null
+++ b/app-misc/beep/beep-1.3-r3.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="The advanced PC speaker beeper"
+HOMEPAGE="http://www.johnath.com/beep"
+SRC_URI="http://www.johnath.com/beep/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ~ppc ~ppc64 ~sparc x86"
+IUSE="suid"
+
+PATCHES=(
+ "${FILESDIR}/${P}-Makefile.patch"
+ "${FILESDIR}/${P}-CVE-2018-0492.patch"
+)
+
+pkg_setup() {
+ tc-export CC
+}
+
+src_install() {
+ dobin beep
+ if use suid; then
+ fowners :audio /usr/bin/beep
+ fperms 4710 /usr/bin/beep
+ else
+ fperms 0711 /usr/bin/beep
+ fi
+ unpack "./${PN}.1.gz"
+ doman "${PN}.1"
+ einstalldocs
+}
diff --git a/app-misc/beep/files/beep-1.3-CVE-2018-0492.patch b/app-misc/beep/files/beep-1.3-CVE-2018-0492.patch
new file mode 100644
index 000000000000..f4894b51fc81
--- /dev/null
+++ b/app-misc/beep/files/beep-1.3-CVE-2018-0492.patch
@@ -0,0 +1,106 @@
+diff --git a/beep.c b/beep.c
+index 7da2e70..4323d31 100644
+--- beep.c
++++ beep.c
+@@ -109,6 +109,7 @@ void do_beep(int freq) {
+ /* BEEP_TYPE_EVDEV */
+ struct input_event e;
+
++ memset(&e, 0, sizeof(e));
+ e.type = EV_SND;
+ e.code = SND_TONE;
+ e.value = freq;
+@@ -124,10 +125,6 @@ void do_beep(int freq) {
+ /* If we get interrupted, it would be nice to not leave the speaker beeping in
+ perpetuity. */
+ void handle_signal(int signum) {
+-
+- if(console_device)
+- free(console_device);
+-
+ switch(signum) {
+ case SIGINT:
+ case SIGTERM:
+@@ -257,7 +254,7 @@ void parse_command_line(int argc, char **argv, beep_parms_t *result) {
+ result->verbose = 1;
+ break;
+ case 'e' : /* also --device */
+- console_device = strdup(optarg);
++ console_device = optarg;
+ break;
+ case 'h' : /* notice that this is also --help */
+ default :
+@@ -276,26 +273,6 @@ void play_beep(beep_parms_t parms) {
+ "%d delay after) @ %.2f Hz\n",
+ parms.reps, parms.length, parms.delay, parms.end_delay, parms.freq);
+
+- /* try to snag the console */
+- if(console_device)
+- console_fd = open(console_device, O_WRONLY);
+- else
+- if((console_fd = open("/dev/tty0", O_WRONLY)) == -1)
+- console_fd = open("/dev/vc/0", O_WRONLY);
+-
+- if(console_fd == -1) {
+- fprintf(stderr, "Could not open %s for writing\n",
+- console_device != NULL ? console_device : "/dev/tty0 or /dev/vc/0");
+- printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */
+- perror("open");
+- exit(1);
+- }
+-
+- if (ioctl(console_fd, EVIOCGSND(0)) != -1)
+- console_type = BEEP_TYPE_EVDEV;
+- else
+- console_type = BEEP_TYPE_CONSOLE;
+-
+ /* Beep */
+ for (i = 0; i < parms.reps; i++) { /* start beep */
+ do_beep(parms.freq);
+@@ -305,8 +282,6 @@ void play_beep(beep_parms_t parms) {
+ if(parms.end_delay || (i+1 < parms.reps))
+ usleep(1000*parms.delay); /* wait... */
+ } /* repeat. */
+-
+- close(console_fd);
+ }
+
+
+@@ -328,6 +303,26 @@ int main(int argc, char **argv) {
+ signal(SIGTERM, handle_signal);
+ parse_command_line(argc, argv, parms);
+
++ /* try to snag the console */
++ if(console_device)
++ console_fd = open(console_device, O_WRONLY);
++ else
++ if((console_fd = open("/dev/tty0", O_WRONLY)) == -1)
++ console_fd = open("/dev/vc/0", O_WRONLY);
++
++ if(console_fd == -1) {
++ fprintf(stderr, "Could not open %s for writing\n",
++ console_device != NULL ? console_device : "/dev/tty0 or /dev/vc/0");
++ printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */
++ perror("open");
++ exit(1);
++ }
++
++ if (ioctl(console_fd, EVIOCGSND(0)) != -1)
++ console_type = BEEP_TYPE_EVDEV;
++ else
++ console_type = BEEP_TYPE_CONSOLE;
++
+ /* this outermost while loop handles the possibility that -n/--new has been
+ used, i.e. that we have multiple beeps specified. Each iteration will
+ play, then free() one parms instance. */
+@@ -365,8 +360,8 @@ int main(int argc, char **argv) {
+ parms = next;
+ }
+
+- if(console_device)
+- free(console_device);
++ close(console_fd);
++ console_fd = -1;
+
+ return EXIT_SUCCESS;
+ }