Add writing right on vconf directory for group sandbox/jbmartin/devel
authorJean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Wed, 30 Apr 2014 12:07:58 +0000 (14:07 +0200)
committerJean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Wed, 21 May 2014 08:43:49 +0000 (10:43 +0200)
Change-Id: Ib7f019f528aa7a247cd517e8e83b5214d4e29e34
Signed-off-by: Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
packaging/vconf.manifest
packaging/vconf.spec
vconftool.c

index 017d22d3aff3db1cd32736351140c2fed580d1c0..9aba7b01a7a835b1381ed676ec8cb58e2450507c 100644 (file)
@@ -2,4 +2,7 @@
  <request>
     <domain name="_"/>
  </request>
+ <assign>
+    <filesystem path="/usr/kdb/db/" label="User" />
+ </assign>
 </manifest>
index 413fefdb98f82b3e4139f9fbf71e5256f7989711..d72702d6e2e2f8478e67b30d1688252c3e9737d4 100755 (executable)
@@ -40,8 +40,10 @@ 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
 %cmake . \
        -DTZ_SYS_CONFIG=%{TZ_SYS_CONFIG}
@@ -75,7 +77,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
index de7fc61f3415f7117aa9cefdd460a331726a5316..1469b73640b2106833be3fb377ead0b41481500c 100755 (executable)
@@ -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;