[1.2.8] Removed smack dependency 70/324970/1 accepted/tizen_unified accepted/tizen_unified_x tizen accepted/tizen/unified/20250604.163016 accepted/tizen/unified/x/20250604.211356
authorEunhye Choi <eunhae1.choi@samsung.com>
Thu, 29 May 2025 10:44:43 +0000 (19:44 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Thu, 29 May 2025 10:44:45 +0000 (19:44 +0900)
- Removed smack dependency by using cynara api

Change-Id: If60457de58882c524d5ae5bbded9036a72da07f5

CMakeLists.txt
packaging/capi-media-transporter.spec
src/MediaTransporterReceiver.cpp
src/MediaTransporterUtil.cpp

index d0130fdd6dc7e009088cd8c7b3f765ae602ec3c0..9cbc7fd489c70c3c01c0bea6e0c22665e18719fe 100644 (file)
@@ -12,7 +12,7 @@ INCLUDE_DIRECTORIES(${INC_DIR})
 
 SET(dependents "dlog glib-2.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 \
                 gstreamer-allocators-1.0 iniparser mm-common capi-media-tool mm-display-interface \
-                cynara-client libsmack libtbm capi-system-info \
+                cynara-client cynara-creds-self libtbm capi-system-info \
                 capi-media-sound-manager gstreamer-rtsp-server-1.0 libpulse")
 
 IF(NOT TIZEN_PROFILE_TV)
index 2a3e25e99ca151521797389ba285d5361deceec0..4c322fc2b586603899a2ca09785d5564c9801bd5 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-transporter
 Summary:    A Media Transporter library in Tizen Native API
-Version:    1.2.7
+Version:    1.2.8
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
@@ -23,7 +23,7 @@ BuildRequires:  pkgconfig(iniparser)
 BuildRequires:  pkgconfig(mm-display-interface)
 BuildRequires:  pkgconfig(mm-common)
 BuildRequires:  pkgconfig(cynara-client)
-BuildRequires:  pkgconfig(libsmack)
+BuildRequires:  pkgconfig(cynara-creds-self)
 BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(libtbm)
 BuildRequires:  pkgconfig(capi-media-sound-manager)
index 551a9991f8be3cbab8af47c03f12e01fb1cb5272..0392bafbb364a642169d82a785a985ce15096226 100644 (file)
@@ -862,7 +862,7 @@ void MediaTransporterReceiver::setDisplay(std::shared_ptr<MediaTransporterDispla
 
 void MediaTransporterReceiver::setSoundStreamInfo(sound_stream_info_h streamInfo)
 {
-       char *stream_type;
+       charstream_type;
        int stream_index;
 
        RET_IF(!streamInfo, "streamInfo is NULL");
index da6b29c95da21c83a4456fee56bada62e37d4b5b..0a1d1a81a5b51b5c0c3b5479db28cdca7af468a2 100644 (file)
@@ -22,7 +22,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <cynara-client.h>
-#include <sys/smack.h>
+#include <cynara-creds-self.h>
 #include <system_info.h>
 #include <glib.h>
 
@@ -32,21 +32,21 @@ using namespace tizen_media_transporter;
 void util::throwIfNotPrivileged(const std::string& privilege)
 {
        cynara* cynara_h = nullptr;
-       g_autofree char* smack_label = nullptr;
+       g_autofree char* client_identification = nullptr;
 
        try {
                if (cynara_initialize(&cynara_h, NULL) != CYNARA_API_SUCCESS)
                        throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION,
                                                                                        "failed to cynara_initialize()");
 
-               if (smack_new_label_from_self(&smack_label) == -1)
+               if (cynara_creds_self_get_client(CLIENT_METHOD_DEFAULT, &client_identification) != CYNARA_API_SUCCESS)
                        throw MediaTransporterException(MTPR_ERROR_INVALID_OPERATION,
-                                                                                       "failed to smack_new_label_from_self()");
+                                                                                       "failed to cynara_creds_self_get_client()");
 
                char uid[10];
                snprintf(uid, sizeof(uid), "%d", getuid());
 
-               if (cynara_check(cynara_h, smack_label, "", uid, privilege.c_str()) != CYNARA_API_ACCESS_ALLOWED)
+               if (cynara_check(cynara_h, client_identification, "", uid, privilege.c_str()) != CYNARA_API_ACCESS_ALLOWED)
                        throw MediaTransporterException(MTPR_ERROR_PERMISSION_DENIED,
                                                                                        "[" + privilege + "] is NOT ALLOWED");