Revert "Addd to check privilege for capture" 63/169563/2
authortaeyoon0.lee <taeyoon0.lee@samsung.com>
Wed, 7 Feb 2018 12:02:13 +0000 (21:02 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Mon, 19 Feb 2018 05:08:01 +0000 (14:08 +0900)
This reverts commit 2f71ccfddcf54295092429d3b987fdc8ad010217.

Change-Id: Ia305a646f8257085c986f4977df1e3ac5bc4555d

build/tizen/adaptor/Makefile.am
build/tizen/adaptor/configure.ac
dali/internal/system/tizen/capture-impl-tizen.cpp [changed mode: 0644->0755]
dali/internal/system/tizen/capture-impl.h [changed mode: 0644->0755]
dali/public-api/capture/capture.h
packaging/dali-adaptor.spec

index eb692be..f5171f1 100644 (file)
@@ -471,13 +471,11 @@ LIBDALI_ADAPTOR_LA_CXXFLAGS += \
                       $(HAPTIC_CFLAGS) \
                       $(EFL_ASSIST_CFLAGS) \
                       $(SCREENCONNECTORPROVIDER_CFLAGS) \
-                      $(APPCORE_WATCH_CFLAGS) \
-                      $(CYNARA_CLIENT_CFLAGS)
+                      $(APPCORE_WATCH_CFLAGS)
 
 LIBDALI_ADAPTOR_LA_LIBADD += \
                       $(SCREENCONNECTORPROVIDER_LIBS) \
-                      $(APPCORE_WATCH_LIBS) \
-                      $(CYNARA_CLIENT_LIBS)
+                      $(APPCORE_WATCH_LIBS)
 endif
 
 if TV_PROFILE
index 79126f4..cb48b5f 100644 (file)
@@ -236,7 +236,6 @@ PKG_CHECK_MODULES(SCREENCONNECTORPROVIDER, screen_connector_provider)
 PKG_CHECK_MODULES(APPFW_WATCH, capi-appfw-watch-application,
    [watch_available=yes], [watch_available=no] )
 PKG_CHECK_MODULES(APPCORE_WATCH, appcore-watch)
-PKG_CHECK_MODULES(CYNARA_CLIENT, cynara-client)
 if test "x$watch_available" = "xyes"; then
   DALI_ADAPTOR_CFLAGS="$DALI_ADAPTOR_CFLAGS -DAPPCORE_WATCH_AVAILABLE"
 fi
old mode 100644 (file)
new mode 100755 (executable)
index 98d6077..917c15d
 #include <dali/integration-api/debug.h>
 #include <fstream>
 #include <string.h>
-#include <cynara-client.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <system_info.h>
 
 // INTERNAL INCLUDES
 #include <adaptor.h>
 namespace
 {
 unsigned int TIME_OUT_DURATION = 1000;
-const int SMACK_LABEL_LENGTH = 255;
-
-const char* const CYNARA_CHECK_FILE = "/proc/self/attr/current";
-const char* const SCREEN_SHOT_PRIVILEGE = "http://tizen.org/privilege/screenshot";
 }
 
 namespace Dali
@@ -76,12 +68,6 @@ CapturePtr Capture::New()
 {
   CapturePtr pWorker = new Capture();
 
-  if( pWorker->CheckPrivilege( SCREEN_SHOT_PRIVILEGE ) == false )
-  {
-    DALI_LOG_ERROR( "Capture privilege error: permission denied\n" );
-    return NULL;
-  }
-
   return pWorker;
 }
 
@@ -89,12 +75,6 @@ CapturePtr Capture::New( Dali::CameraActor cameraActor )
 {
   CapturePtr pWorker = new Capture( cameraActor );
 
-  if( pWorker->CheckPrivilege( SCREEN_SHOT_PRIVILEGE ) == false )
-  {
-    DALI_LOG_ERROR( "Capture privilege error: permission denied\n" );
-    return NULL;
-  }
-
   return pWorker;
 }
 
@@ -378,52 +358,6 @@ bool Capture::Save()
   return mNativeImageSourcePtr->EncodeToFile( mPath );
 }
 
-bool Capture::CheckPrivilege( const char* privilege ) const
-{
-  cynara* cynara;
-  int fd = 0;
-  int ret = 0;
-  char subjectLabel[SMACK_LABEL_LENGTH + 1] = "";
-  char uid[10] = { 0, };
-  const char* clientSession = "";
-
-  ret = cynara_initialize( &cynara, NULL );
-  if( ret != CYNARA_API_SUCCESS )
-  {
-    return false;
-  }
-
-  fd = open( CYNARA_CHECK_FILE, O_RDONLY );
-  if( fd < 0 )
-  {
-    cynara_finish( cynara );
-    return false;
-  }
-
-  ret = read( fd, subjectLabel, SMACK_LABEL_LENGTH );
-  if( ret < 0 )
-  {
-    close( fd );
-    cynara_finish( cynara );
-    return false;
-  }
-
-  close( fd );
-
-  snprintf( uid, 10, "%d", getuid() );
-
-  ret = cynara_check( cynara, subjectLabel, clientSession, uid, privilege );
-  if( ret != CYNARA_API_ACCESS_ALLOWED )
-  {
-    cynara_finish( cynara );
-    return false;
-  }
-
-  cynara_finish( cynara );
-
-  return true;
-}
-
 }  // End of namespace Adaptor
 
 }  // End of namespace Internal
old mode 100644 (file)
new mode 100755 (executable)
index d172fdd..4f124c8
@@ -199,14 +199,6 @@ private:
    */
   bool Save();
 
-  /**
-   * @brief Checks privilege for Capture
-   *
-   * @param[in] privilege The capture privilege
-   * @return True if input is capture privilege, false otherwise
-   */
-  bool CheckPrivilege( const char* privilege ) const;
-
 private:
 
   // Undefined
index 58ee9d8..635a1e0 100644 (file)
@@ -106,28 +106,22 @@ public:
   Capture();
 
   /**
-   * @PRIVLEVEL_PLATFORM
    * @brief Create an initialized Capture.
    *
    * @SINCE_1_3_4
-   * @PRIVILEGE_CAPTURE
    *
    * @return A handle to a newly allocated Dali resource.
    * @note Projection mode of default cameraActor is Dali::Camera::PERSPECTIVE_PROJECTION
-   * @note If permission denied by privilege occurs, a uninitialized handle is returned
    */
   static Capture New();
 
   /**
-   * @PRIVLEVEL_PLATFORM
    * @brief Create an initialized Capture.
    *
    * @SINCE_1_3_4
-   * @PRIVILEGE_CAPTURE
    *
    * @param[in] cameraActor An initialized CameraActor.
    * @return A handle to a newly allocated Dali resource.
-   * @note If permission denied by privilege occurs, a uninitialized handle is returned
    */
   static Capture New( Dali::CameraActor cameraActor );
 
index 5d9c7d0..a4ae273 100644 (file)
@@ -53,7 +53,6 @@ BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(capi-appfw-watch-application)
 BuildRequires:  pkgconfig(appcore-watch)
 BuildRequires:  pkgconfig(screen_connector_provider)
-BuildRequires:  pkgconfig(cynara-client)
 %endif
 
 BuildRequires:  pkgconfig(gles20)