summaryrefslogtreecommitdiff
path: root/vconf-compat
diff options
context:
space:
mode:
authorJiwoong Im <jiwoong.im@samsung.com>2017-03-14 11:12:01 +0900
committerJiwoong Im <jiwoong.im@samsung.com>2017-03-20 18:32:43 +0900
commit62576e26b61f56bdb84aa6c736cbfb5afe6a052a (patch)
treecbb5ab77d2525ae202bc2c21e720921c153fe4f5 /vconf-compat
parentb6453a6687364d05b306bdfed2359509617aed74 (diff)
downloadbuxton2-62576e26b61f56bdb84aa6c736cbfb5afe6a052a.tar.gz
buxton2-62576e26b61f56bdb84aa6c736cbfb5afe6a052a.tar.bz2
buxton2-62576e26b61f56bdb84aa6c736cbfb5afe6a052a.zip
Fix some option in vconftool
- Enable force option for 2.4 compatibility. Disable Smack option because buxton's access control is based on privilege. Change-Id: I9acee5b0ca8a38e12316e0beb032fe2547ce8c51 Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
Diffstat (limited to 'vconf-compat')
-rwxr-xr-xvconf-compat/vconftool33
1 files changed, 19 insertions, 14 deletions
diff --git a/vconf-compat/vconftool b/vconf-compat/vconftool
index a0110a5..ad2808e 100755
--- a/vconf-compat/vconftool
+++ b/vconf-compat/vconftool
@@ -7,8 +7,8 @@ OPT_DIRECT=""
OPT_TYPE=""
OPT_RECUR=0
OPT_INIT=""
-OPT_LABEL=""
OPT_DEBUG=0
+OPT_FORCE=0
usage() {
COMM=`basename $0`
@@ -24,8 +24,8 @@ cat << EOF
-u, --uid=UID User ID (for compatibility, ignored)
-g, --gid=GID Gourp ID (for compatibility, ignored)
-i, --install Install memory type key
- -s, --smack=LABEL Set a SMACK label
- -f, --force Overwrite by force (for compatibility, ignored)
+ -s, --smack=LABEL Set a SMACK label (for compatibility, ignored)
+ -f, --force Overwrite by force
ex)
$COMM set -t string db/testapp/key1 "This is test"
@@ -117,9 +117,9 @@ do_create() {
[ -z "${TYPE}" ] && echo "Type '${OPT_TYPE}': Invalid type" && usage
dbg ${BUXTONTOOL} ${OPT_DIRECT} create-${TYPE} \
- ${LAYER} ${OPT_KEY} \"${OPT_VAL}\" \"\" \"${OPT_LABEL}\"
+ ${LAYER} ${OPT_KEY} \"${OPT_VAL}\" \"\" \"\"
RES=`${BUXTONTOOL} ${OPT_DIRECT} create-${TYPE} \
- ${LAYER} ${OPT_KEY} "${OPT_VAL}" "" "${OPT_LABEL}" 2>&1`
+ ${LAYER} ${OPT_KEY} "${OPT_VAL}" "" "" 2>&1`
[ $? -ne 0 ] && echo "Error: $RES" && exit 1
exit 0
}
@@ -131,6 +131,14 @@ do_set() {
TYPE=`get_type ${OPT_TYPE}`
[ -z "${TYPE}" ] && echo "Type '${OPT_TYPE}': Invalid type" && usage
+ RES=`${BUXTONTOOL} ${OPT_DIRECT} get ${LAYER} ${OPT_KEY} 2>&1`
+ if [ $? -eq 0 ]; then
+ if [ ${OPT_FORCE} -eq 0 ]; then
+ echo "Key already exist. Use -f option to force update"
+ exit 1
+ fi
+ fi
+
dbg ${BUXTONTOOL} ${OPT_DIRECT} ${OPT_INIT} set-${TYPE} \
${LAYER} ${OPT_KEY} \"${OPT_VAL}\"
RES=`${BUXTONTOOL} ${OPT_DIRECT} ${OPT_INIT} set-${TYPE} \
@@ -146,13 +154,6 @@ do_set() {
exit 1
fi
- [ -z "${OPT_LABEL}" ] && exit 0
-
- dbg ${BUXTONTOOL} ${OPT_DIRECT} set-write-priv \
- ${LAYER} ${OPT_KEY} \"${OPT_LABEL}\"
- RES=`${BUXTONTOOL} ${OPT_DIRECT} set-write-priv \
- ${LAYER} ${OPT_KEY} "${OPT_LABEL}" 2>&1 `
- [ $? -ne 0 ] && echo "Error: $RES" && exit 1
exit 0
}
@@ -188,7 +189,11 @@ while [ "$1" != "--" ]; do
# ignore
shift 2
;;
- -f|--force|-v|--verbose|-q|--quiet)
+ -f|--force)
+ OPT_FORCE=1
+ shift
+ ;;
+ -v|--verbose|-q|--quiet)
# ignore
shift
;;
@@ -197,7 +202,7 @@ while [ "$1" != "--" ]; do
shift
;;
-s|--smack)
- OPT_LABEL="$2"
+ # ignore
shift 2
;;
-d|--debug)