[nautilus-actions] src/utils/na-gconf2key.sh.in: fix permissions when creating the configuration directory
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] src/utils/na-gconf2key.sh.in: fix permissions when creating the configuration directory
- Date: Tue, 6 Dec 2011 23:32:55 +0000 (UTC)
commit 42a9a7c8f260d1038da3068d5e75707e5f2e856a
Author: Pierre Wieser <pwieser trychlos org>
Date: Wed Dec 7 00:31:54 2011 +0100
src/utils/na-gconf2key.sh.in: fix permissions when creating the configuration directory
ChangeLog | 3 +++
src/utils/na-gconf2key.sh.in | 21 +++++++++++++++------
2 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c7d93e4..e5e1dfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2011-12-06 Pierre Wieser <pwieser trychlos org>
+ * src/utils/na-gconf2key.sh.in:
+ Fix permissions when creating the configuration directory.
+
* src/core/na-settings.c (settings_new):
* src/io-desktop/nadp-writer.c
(nadp_iio_provider_is_able_to_write, nadp_iio_provider_write_item):
diff --git a/src/utils/na-gconf2key.sh.in b/src/utils/na-gconf2key.sh.in
index 4eb7494..765680c 100644
--- a/src/utils/na-gconf2key.sh.in
+++ b/src/utils/na-gconf2key.sh.in
@@ -186,9 +186,19 @@ done
# reset now arguments so that they can be scanned again in main script
set -- ${my_parms}
+# setting defaults
+if [ $(id -u) -eq 0 ]; then
+ opt_dir_def="/usr"
+ conf_dir="@sysconfdir@/xdg"
+ dir_mode="0755"
+else
+ opt_dir_def="${HOME}/.local"
+ conf_dir="${HOME}/.config"
+ dir_mode="0750"
+fi
+
# interpreting command-line arguments
opt_dir=
-[ $(id -u) -eq 0 ] && opt_dir_def="/usr" || opt_dir_def="${HOME}/.local"
opt_dir_def="${opt_dir_def}/share/file-manager/actions"
# default is to not force rewriting of already existing items
@@ -400,7 +410,7 @@ function create_first_level
which gconftool-2 1>/dev/null 2>&1 || { msg "gconftool-2: not available"; exit 1; }
# create the destination directory if it does not yet exist
-command "mkdir -p ${opt_dir} || exit 1"
+command "mkdir -m ${dir_mode} -p ${opt_dir} || exit 1"
let nbitems=0
@@ -426,13 +436,12 @@ done
msg "${nbitems} migrated items"
# we are using this same script to migrate preferences to .conf files
-# mandatory preferences go to SYSCONFDIR/xdg/nautilus-actions.conf
-# while user preferences go to HOME/.config/nautilus-actions.conf
+# mandatory preferences go to SYSCONFDIR/xdg/nautilus-actions/nautilus-actions.conf
+# while user preferences go to HOME/.config/nautilus-actions/nautilus-actions.conf
# Note also that the GConf I/O provider will be disabled for writings
# after this migration
-[ $(id -u) -eq 0 ] && destdir= sysconfdir@/xdg || destdir=${HOME}/.config
destdir=${destdir}/@PACKAGE@
-command "mkdir -p ${destdir}"
+command "mkdir -m ${dir_mode} -p ${destdir}"
destconf=${destdir}/@PACKAGE conf
rm -f ${my_tmproot}.nact
rm -f ${my_tmproot}.runtime
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]