summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>2014-04-30 14:07:58 +0200
committerJean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>2014-05-22 15:36:27 +0200
commit49b5fb4bff0b046f779664d04a55b4338f0a48ab (patch)
treed329e3397be244691defa1c43860604bfa2ba01f
parent119de39565de2390bbc18a91e4b9d0c7b6b083a8 (diff)
downloadvconf-49b5fb4bff0b046f779664d04a55b4338f0a48ab.tar.gz
vconf-49b5fb4bff0b046f779664d04a55b4338f0a48ab.tar.bz2
vconf-49b5fb4bff0b046f779664d04a55b4338f0a48ab.zip
Add writing right on vconf directory for group
Change-Id: Ib7f019f528aa7a247cd517e8e83b5214d4e29e34 Signed-off-by: Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
-rw-r--r--packaging/vconf.manifest3
-rwxr-xr-xpackaging/vconf.spec3
-rwxr-xr-xvconftool.c8
3 files changed, 12 insertions, 2 deletions
diff --git a/packaging/vconf.manifest b/packaging/vconf.manifest
index 017d22d..5217a94 100644
--- a/packaging/vconf.manifest
+++ b/packaging/vconf.manifest
@@ -2,4 +2,7 @@
<request>
<domain name="_"/>
</request>
+ <assign>
+ <filesystem path="TZ_SYS_CONFIG/db" label="User" />
+ </assign>
</manifest>
diff --git a/packaging/vconf.spec b/packaging/vconf.spec
index 413fefd..77db5bf 100755
--- a/packaging/vconf.spec
+++ b/packaging/vconf.spec
@@ -40,6 +40,7 @@ Vconf key management header files
%prep
%setup -q -n %{name}-%{version}
+sed -i 's|TZ_SYS_CONFIG|%{TZ_SYS_CONFIG}|g' %{SOURCE1001}
cp %{SOURCE1001} .
%build
@@ -75,7 +76,7 @@ systemctl daemon-reload
%{_bindir}/vconf-init
%config(missingok) %attr(644,root,root) %{TZ_SYS_CONFIG}/kdb_first_boot
%{_libdir}/*.so.*
-%dir %attr(777,root,root) %{TZ_SYS_CONFIG}/db
+%dir %attr(777,root,%TZ_SYS_USER_GROUP) %{TZ_SYS_CONFIG}/db
%dir %attr(777,root,root) %{TZ_SYS_CONFIG}/db/.backup
%{_unitdir}/basic.target.wants/vconf-setup.service
%{_unitdir}/vconf-setup.service
diff --git a/vconftool.c b/vconftool.c
index de7fc61..1469b73 100755
--- a/vconftool.c
+++ b/vconftool.c
@@ -242,13 +242,19 @@ static int check_file_path_mode(char* file_path)
if (access(szPath, F_OK) != 0) {
/* fprintf(stderr,"parent dir does not exist\n"); */
- snprintf(szCmd, BUFSIZE, "/bin/mkdir %s -p --mode=755", szPath);
+ snprintf(szCmd, BUFSIZE, "/bin/mkdir %s -p --mode=775", szPath);
disable_invalid_char(szCmd);
if (__system(szCmd)) {
fprintf(stderr,"[%s:%d]Fail mkdir() szCmd=%s\n", __FILE__, __LINE__, szCmd);
return -1;
}
+ snprintf(szCmd, BUFSIZE, "/bin/chgrp %s %s",tzplatform_getenv(TZ_SYS_USER_GROUP), szPath);
+ if (__system(szCmd)) {
+ fprintf(stderr,"[%s:%d]Fail chgrp() szCmd=%s\n", __FILE__, __LINE__, szCmd);
+ return -1;
+ }
+
}
create_file = 1;