%build
%if 0%{?tizen_build_binary_release_type_eng}
-CXXFLAGS="$CXXFLAGS -D_SECURE_LOG"
+CFLAGS="$CFLAGS -D_SECURE_LOG"
%endif
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+
%ifarch %{ix86} x86_64
%if 0%{?simulator}
-CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+CFLAGS="$CFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
%else
-CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_" %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+CFLAGS="$CFLAGS -D_OSP_DEBUG_ -D_OSP_X86_" %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
%endif
%else
%if 0%{?tizen_build_binary_release_type_eng}
-CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_ -D_SECURE_LOG" %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+CFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_ -D_SECURE_LOG" %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
%else
-CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_" %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+CFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_" %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
%endif
%endif
char* app_rootpath = NULL;
char* delimiter = NULL;
size_t length = 0;
- /* e.g., The specified bin_path is "/opt/apps/com.samsung.basicapp/bin/basicapp" */
+ /* e.g., The specified bin_path is "/opt/apps/com.samsung.basicapp/bin/basicapp" */
length = strlen(bin_path);
app_rootpath = (char *)malloc(length + 1);
if(app_rootpath == NULL)
}
int
-do_pre_exe(const char* package_name, const char* bin_path, const char* package_id)
+do_pre_exe(const char* bin_path, const char* package_id)
{
char* app_rootpath = NULL;
int mmc_mounted = 0;
/* e.g., app_rootdir is "/opt/usr/apps/[pkgId] */
app_rootpath = get_app_rootpath_from_path(bin_path);
- _SECURE_LOGI("[data_caging] do_pre_exe() was called, package name: %s, package id: %s, binary: %s, app root: %s",
- package_name, package_id, bin_path, app_rootpath);
+ _SECURE_LOGI("[data_caging] do_pre_exe() was called, package id: %s, binary path: %s, app root: %s",
+ package_id, bin_path, app_rootpath);
umask(0000);
free(app_rootpath);
umask(0022);
- LOGI("[data_caging] do_pre_exec() succeeded.");
+ LOGI("[data_caging] do_pre_exe() succeeded.");
return 0;
ERROR:
free(app_rootpath);
umask(0022);
- LOGI("[data_caging] do_pre_exec() failed.");
+ LOGI("[data_caging] do_pre_exe() failed.");
return -1;
}
char osp_app_data_path[PATH_MAX] = { 0, };
int osp_compat = 0;
- _SECURE_LOGI("do_pre_exec() is called, package name: %s, binary path: %s", package_name, bin_path);
+ _SECURE_LOGI("do_pre_exec() is called, app name: %s, binary path: %s", package_name, bin_path);
app_rootpath = get_app_rootpath_from_path(bin_path);
osp_compat = 1;
}
- // XXX: temp code
- //if (package_name == NULL)
- {
- //LOGI("The package name is empty.");
- get_package_id_from_app_rootpath(app_rootpath, package_id);
- }
-#if 0
- else
- {
- get_package_id_from_package_name(package_name, package_id);
- }
-#endif
- // XXX-end
+ get_package_id_from_app_rootpath(app_rootpath, package_id);
- _SECURE_LOGI("package: %s (%s), binary: %s, OSP compat: %d", package_name, package_id, bin_path, osp_compat);
+ _SECURE_LOGI("package id: %s, binary path: %s, OSP compat: %d", package_id, bin_path, osp_compat);
// FIXME: Temporary code with security risk
prctl(PR_SET_KEEPCAPS, 1);
{
free(app_rootpath);
//unshare(CLONE_NEWNS);
- return do_pre_exe(package_name, bin_path, package_id);
+ return do_pre_exe(bin_path, package_id);
}
char virtual_root_file[PATH_MAX] = { 0, };