aboutsummaryrefslogtreecommitdiffstats
path: root/meta-multimedia
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-06-26 22:57:08 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2017-07-01 09:59:26 +0200
commitd193035a51c0b10cdfe72e728541ab7ca447e995 (patch)
tree7a44e7bea62e1c4e97584d7a2f85ef90096daefc /meta-multimedia
parent6fb9a9e7a2288d8cef253beb6c5ad0a7e5daa669 (diff)
downloadmeta-openembedded-contrib-d193035a51c0b10cdfe72e728541ab7ca447e995.tar.gz
cdparanoia: Fix build with security flags
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-multimedia')
-rw-r--r--meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb4
-rw-r--r--meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch31
-rw-r--r--meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch32
3 files changed, 66 insertions, 1 deletions
diff --git a/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb b/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb
index e846e3a973..30d71ff2c0 100644
--- a/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb
+++ b/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb
@@ -13,7 +13,9 @@ SRC_URI = "http://downloads.xiph.org/releases/cdparanoia/cdparanoia-III-${PV}.sr
file://0003-Fix-missing-shared-object-LDFLAGS.patch \
file://dont-use-internal-configs.patch \
file://out-of-tree-build.patch \
-"
+ file://0001-check-for-null-buffer-before-trying-a-byteswap.patch \
+ file://0002-Fix-printf-format-errors.patch \
+ "
SRC_URI[md5sum] = "b304bbe8ab63373924a744eac9ebc652"
SRC_URI[sha256sum] = "005db45ef4ee017f5c32ec124f913a0546e77014266c6a1c50df902a55fe64df"
diff --git a/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch b/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch
new file mode 100644
index 0000000000..682cf6e033
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch
@@ -0,0 +1,31 @@
+From c760c5d31f2412a5be5ac6896e6069d1cea08527 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 26 Jun 2017 22:31:45 -0700
+Subject: [PATCH 1/2] check for null buffer before trying a byteswap
+
+Author: Monty <paranoia@xiph.org>
+
+Patch from debian
+http://sources.debian.net/src/cdparanoia/3.10.2%2Bdebian-11/debian/patches/04-endian.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ interface/interface.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/interface/interface.c b/interface/interface.c
+index 526c2a9..763a0ea 100644
+--- a/interface/interface.c
++++ b/interface/interface.c
+@@ -118,7 +118,7 @@ long cdda_read_timed(cdrom_drive *d, void *buffer, long beginsector, long sector
+ if(d->bigendianp==-1) /* not determined yet */
+ d->bigendianp=data_bigendianp(d);
+
+- if(d->bigendianp!=bigendianp()){
++ if(buffer && d->bigendianp!=bigendianp()){
+ int i;
+ u_int16_t *p=(u_int16_t *)buffer;
+ long els=sectors*CD_FRAMESIZE_RAW/2;
+--
+2.13.2
+
diff --git a/meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch b/meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch
new file mode 100644
index 0000000000..024479ca7d
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch
@@ -0,0 +1,32 @@
+From f4f81bdadb9515938b3b5d13707bd4b9322fd967 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 26 Jun 2017 22:37:13 -0700
+Subject: [PATCH 2/2] Fix printf format errors
+
+error: format not a string literal and no format arguments
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ main.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/main.c b/main.c
+index 664acac..d568fb1 100644
+--- a/main.c
++++ b/main.c
+@@ -588,10 +588,10 @@ static void callback(long inpos, int function){
+ buffer[aheadposition+19]='>';
+ }
+
+- fprintf(stderr,buffer);
++ fprintf(stderr, "%s", buffer);
+
+ if (logfile != NULL && function==-1) {
+- fprintf(logfile,buffer+1);
++ fprintf(logfile, "%s", buffer+1);
+ fprintf(logfile,"\n\n");
+ fflush(logfile);
+ }
+--
+2.13.2
+
g-symlink-fix'>paule/libcap-ng-symlink-fix OpenEmbedded Core user contribution treesGrokmirror user
summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/toaster-eventreplay
blob: 8fa4ab7116b63ee3c79bea20dfadfedb6103211f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/env python3
#
# Copyright (C) 2014        Alex Damian
#
# SPDX-License-Identifier: GPL-2.0-only
#
# This file re-uses code spread throughout other Bitbake source files.
# As such, all other copyrights belong to their own right holders.
#

"""
This command takes a filename as a single parameter. The filename is read
as a build eventlog, and the ToasterUI is used to process events in the file
and log data in the database
"""

import os
import sys
import json
import pickle
import codecs

from collections import namedtuple

# mangle syspath to allow easy import of modules
from os.path import join, dirname, abspath
sys.path.insert(0, join(dirname(dirname(abspath(__file__))), 'lib'))

import bb.cooker
from bb.ui import toasterui

class EventPlayer:
    """Emulate a connection to a bitbake server."""

    def __init__(self, eventfile, variables):
        self.eventfile = eventfile
        self.variables = variables
        self.eventmask = []

    def waitEvent(self, _timeout):
        """Read event from the file."""
        line = self.eventfile.readline().strip()
        if not line:
            return
        try:
            event_str = json.loads(line)['vars'].encode('utf-8')
            event = pickle.loads(codecs.decode(event_str, 'base64'))
            event_name = "%s.%s" % (event.__module__, event.__class__.__name__)
            if event_name not in self.eventmask:
                return
            return event
        except ValueError as err:
            print("Failed loading ", line)
            raise err

    def runCommand(self, command_line):
        """Emulate running a command on the server."""
        name = command_line[0]

        if name == "getVariable":
            var_name = command_line[1]
            variable = self.variables.get(var_name)
            if variable:
                return variable['v'], None
            return None, "Missing variable %s" % var_name

        elif name == "getAllKeysWithFlags":
            dump = {}
            flaglist = command_line[1]
            for key, val in self.variables.items():
                try:
                    if not key.startswith("__"):
                        dump[key] = {
                            'v': val['v'],
                            'history' : val['history'],
                        }
                        for flag in flaglist:
                            dump[key][flag] = val[flag]
                except Exception as err:
                    print(err)
            return (dump, None)

        elif name == 'setEventMask':
            self.eventmask = command_line[-1]
            return True, None

        else:
            raise Exception("Command %s not implemented" % command_line[0])

    def getEventHandle(self):
        """
        This method is called by toasterui.
        The return value is passed to self.runCommand but not used there.
        """
        pass

def main(argv):
    with open(argv[-1]) as eventfile:
        # load variables from the first line
        variables = json.loads(eventfile.readline().strip())['allvariables']

        params = namedtuple('ConfigParams', ['observe_only'])(True)
        player = EventPlayer(eventfile, variables)

        return toasterui.main(player, player, params)

# run toaster ui on our mock bitbake class
if __name__ == "__main__":
    if len(sys.argv) != 2:
        print("Usage: %s <event file>" % os.path.basename(sys.argv[0]))
        sys.exit(1)

    sys.exit(main(sys.argv))