Add security check code 30/42030/2
authorJeongho Mok <jho.mok@samsung.com>
Mon, 4 May 2015 11:12:52 +0000 (20:12 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 24 Jun 2015 08:30:05 +0000 (01:30 -0700)
[Version] 0.5-16
[Profile] Common
[Issue Type] security

Change-Id: Ie72d71eba28870002c72adf0d4821897d947f145
Signed-off-by: Jeongho Mok <jho.mok@samsung.com>
packaging/pulseaudio.spec
src/pulse/def.h
src/pulse/error.c
src/pulsecore/protocol-native.c

index 9696380..36fc106 100644 (file)
@@ -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
index b7854a3..2c2c6bc 100644 (file)
@@ -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 */
 
index 751d42a..2ca6309 100644 (file)
@@ -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();
index e25f55f..ddb0694 100644 (file)
@@ -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)