#define OWNER_ROOT 0
#define GROUP_MENU 6010
#define BUFSZE 1024
-#define OPT_MANIFEST_DIRECTORY tzplatform_getenv(TZ_SYS_RW_PACKAGES)
-#define USR_MANIFEST_DIRECTORY tzplatform_getenv(TZ_SYS_RO_PACKAGES)
+#define SYS_MANIFEST_DIRECTORY tzplatform_getenv(TZ_SYS_RW_PACKAGES)
#define PACKAGE_INFO_DB_FILE tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_parser.db")
#define PACKAGE_INFO_DB_FILE_JOURNAL tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_parser.db-journal")
return 0;
}
- ret = initdb_load_directory(OPT_MANIFEST_DIRECTORY);
+ ret = initdb_load_directory(SYS_MANIFEST_DIRECTORY);
if (ret == -1) {
_E("cannot load opt manifest directory.");
}
- ret = initdb_load_directory(USR_MANIFEST_DIRECTORY);
- if (ret == -1) {
- _E("cannot load usr manifest directory.");
- }
ret = initdb_change_perm(PACKAGE_INFO_DB_FILE);
if (ret == -1) {
+++ /dev/null
-#!/bin/bash
-
-# This script is a workaround for bug TC-320 where pkgcmd doesn't work with xwalk
-#
-# - the real command pkgcmd is renamed pkgcmd.real
-# - the "new" pkgcmd command is only a small binary with setuid bit (executes as root)
-# - this script "pkgcmd.wrapper" decides what to do depending on arguments
-#
-# /-> xwalkctl (if install or uninstall)
-# sbdb -> (developer) pkgcmd (gets root) -> pkgcmd.wrapper
-# \-> pkgcmd.real (original binary in other cases)
-#
-# Authors:!
-# Stéphane Desneux <stephane.desneux@open.eurogiciel.org>
-# Baptiste Durand <baptiste.durand@open.eurogiciel.org>
-
-DEBUG=0
-[[ "$DEBUG" == 1 ]] && exec 2>>/tmp/pkgcmd.log || exec 2>/dev/null
-
-function debug() {
- [[ "$DEBUG" == 1 ]] && echo "$0: $@" >&2
-}
-
-TEMP=$(getopt -n 'pkgcmd' -o iurmcgCkaADL:lsd:p:t:n:T:T:S:qh --long install,uninstall,reinstall,move,clear,getsize,check,kill,app-path,activate,deactivate,activate\ with\ Label:,list,show,descriptor:,package-path:,package-type:,package-name:,move-type:,getsize-type:,csc:,quiet,help -- "$@")
-[[ $? != 0 ]] && { echo "pkgcmd.wrapper: invalid options. Terminating..." >&2; exit 1; }
-
-# save initial arguments
-ARGS="$@"
-debug "--------------------- new call -----------------------"
-debug "ARGS: $ARGS"
-
-# change args to getopt output
-debug "OPTS: $TEMP"
-eval set -- "$TEMP"
-
-op=
-while true; do
- case "$1" in
- -i|--install) op="install"; shift;;
- -u|--uninstall) op="uninstall"; shift;;
- -a|--app-path) op="app_path"; shift;;
- -l|--list) op="list"; shift;;
- -t|--package-type) pkgtype=$2; shift 2;;
- -p|--package-path) pkgpath=$2; shift 2;;
- -n|--package-name) pkgname=$2; shift 2;;
-
- # other options (we don't care of)
- -r|--reinstall) shift;;
- -m|--move) shift;;
- -c|--clear) shift;;
- -g|--getsize) shift;;
- -C|--check) shift;;
- -k|--kill) shift;;
- -A|--activate) shift;;
- -D|--deactivate) shift;;
- -s|--show) shift;;
- -q|--quiet) shift;;
- -h|--help) shift;;
-
- # other options with argument (we don't care of)
- -L|--activate\ with\ Label) shift 2;;
- -d|--descriptor) shift 2;;
- -T|--move-type|--getsize-type) shift 2;;
- -S|--csc) shift 2;;
- --) shift; break;;
- esac
-done
-
-debug "op=$op type=$pkgtype path=$pkgpath name=$pkgname"
-
-# get user to install to from USER env var (or 'guest' as fallback)
-USER=${USER:-root}
-
-if [[ "$USER" == "root" || "$USER" == "developer" ]]; then
- # root and developer don't install apps for themselves.
- # so take the first valid user: check app, check guest
- if getent passwd | grep -q "^app:"; then
- USER=app
- elif getent passwd | grep -q "^guest:"; then
- USER=guest
- else
- debug "Using 'app' user by default: 'app' or 'guest' not found"
- USER=app
- fi
-fi
-debug "user: $USER"
-
-shopt -s nocasematch
-if [[ "$op" == "list" ]]; then
- debug "list"
- su - app -c "bash -l -c 'xwalkctl'" | awk '/^\w+\s+\w+$/{printf("%s %s\n",$1,$2)}' | while read id name; do
- echo "pkg_type [wgt] pkgid [$id] name [$name] version [0.0]"
- done
- exec /usr/bin/pkgcmd.real $ARGS | grep -v "^You are not an authorized user"
-elif [[ "$op" == "app_path" ]]; then
- path=/tmp/app_rw
- mkdir -p $path
- chmod 777 $path
- chown app:app $path
- chsmack -a User $path
- debug "send app path: $path"
- echo "Tizen Application Installation Path: $path"
- echo "spend time for pkgcmd is [0]ms"
-elif [[ "$op" == "install" && "$pkgtype" =~ wgt ]]; then
- # call xwalkctl
- debug "run: xwalkctl -i $pkgpath"
- exec su - $USER -c "bash -l -c 'xwalkctl -i $pkgpath'"
-elif [[ "$op" == "uninstall" ]]; then
- # call xwalkctl
- debug "run xwalkctl -u $pkgname"
- exec su - $USER -c "bash -l -c 'xwalkctl -u $pkgname'"
-else
- # launch the real pkgcmd binary if we're not installing or uninstalling
- debug "run pkgcmd.real"
- exec su - $USER -c "bash -l -c '/usr/bin/pkgcmd.real $ARGS'" | grep -v "^You are not an authorized user"
-fi
-