From: Jeongho Mok Date: Mon, 4 May 2015 11:12:52 +0000 (+0900) Subject: Add security check code X-Git-Tag: accepted/tizen/mobile/20150717.002852~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F30%2F42030%2F2;p=platform%2Fupstream%2Fpulseaudio.git Add security check code [Version] 0.5-16 [Profile] Common [Issue Type] security Change-Id: Ie72d71eba28870002c72adf0d4821897d947f145 Signed-off-by: Jeongho Mok --- diff --git a/packaging/pulseaudio.spec b/packaging/pulseaudio.spec index 9696380..36fc106 100644 --- a/packaging/pulseaudio.spec +++ b/packaging/pulseaudio.spec @@ -11,7 +11,7 @@ Name: pulseaudio Summary: Improved Linux sound server Version: 5.0 -Release: 15 +Release: 16 Group: Multimedia/Audio License: GPL-2.0+ and LGPL-2.1+ URL: http://pulseaudio.org diff --git a/src/pulse/def.h b/src/pulse/def.h index b7854a3..2c2c6bc 100644 --- a/src/pulse/def.h +++ b/src/pulse/def.h @@ -487,6 +487,9 @@ typedef enum pa_error_code { PA_ERR_FORKED, /**< The caller forked without calling execve() and tried to reuse the context. \since 0.9.15 */ PA_ERR_IO, /**< An IO error happened. \since 0.9.16 */ PA_ERR_BUSY, /**< Device or resource busy. \since 0.9.17 */ +#ifdef __TIZEN__ + PA_ERR_ACCESS_BY_SECURITY, /**< Access failure by security */ +#endif PA_ERR_MAX /**< Not really an error but the first invalid error code */ } pa_error_code_t; @@ -516,6 +519,9 @@ typedef enum pa_error_code { #define PA_ERR_OBSOLETE PA_ERR_OBSOLETE #define PA_ERR_NOTIMPLEMENTED PA_ERR_NOTIMPLEMENTED #define PA_ERR_FORKED PA_ERR_FORKED +#ifdef __TIZEN__ +#define PA_ERR_ACCESS_BY_SECURITY PA_ERR_ACCESS_BY_SECURITY +#endif #define PA_ERR_MAX PA_ERR_MAX /** \endcond */ diff --git a/src/pulse/error.c b/src/pulse/error.c index 751d42a..2ca6309 100644 --- a/src/pulse/error.c +++ b/src/pulse/error.c @@ -64,6 +64,9 @@ const char*pa_strerror(int error) { [PA_ERR_FORKED] = N_("Client forked"), [PA_ERR_IO] = N_("Input/Output error"), [PA_ERR_BUSY] = N_("Device or resource busy") +#ifdef __TIZEN__ + ,[PA_ERR_ACCESS_BY_SECURITY] = N_("Access denied by security check") +#endif }; pa_init_i18n(); diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index e25f55f..ddb0694 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -2487,6 +2487,9 @@ static void command_create_record_stream(pa_pdispatch *pd, uint32_t command, uin CHECK_VALIDITY_GOTO(c->pstream, source_index == PA_INVALID_INDEX || !source_name, tag, PA_ERR_INVALID, finish); CHECK_VALIDITY_GOTO(c->pstream, !source_name || source_index == PA_INVALID_INDEX, tag, PA_ERR_INVALID, finish); +#ifdef USE_SECURITY + CHECK_VALIDITY(c->pstream, pa_pstream_check_security(c->pstream), tag, PA_ERR_ACCESS_BY_SECURITY); +#endif /* USE_SECURITY */ p = pa_proplist_new(); if (name)