This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efm2.

View the commit online.

commit 72abb3947a8fd85e8cee5b3575c35707b8a639c0
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Wed Jun 12 16:00:16 2024 +0100

    meta - preparing meta dir - use parent mode+uid/gid
---
 src/backends/default/meta.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/backends/default/meta.c b/src/backends/default/meta.c
index 72fef83..83384ca 100644
--- a/src/backends/default/meta.c
+++ b/src/backends/default/meta.c
@@ -4,6 +4,7 @@
 #include <Ecore.h>
 #include <Ecore_File.h>
 #include <fcntl.h>
+#include <sys/stat.h>
 #include "sha.h"
 #include "meta.h"
 
@@ -380,8 +381,10 @@ meta_path_user_find(const char *path, const char *extn)
 Eina_Bool
 meta_path_prepare(const char *path)
 { // "path" is the path returned by meta_path_user_find() or meta_path_find()
-  Eina_Bool ret = EINA_FALSE;
-  char     *dir = ecore_file_dir_get(path);
+  struct stat  st;
+  Eina_Bool    ret = EINA_FALSE;
+  char        *dir_parent;
+  char        *dir = ecore_file_dir_get(path);
 
   if (!dir) return ret;
   if (ecore_file_is_dir(dir)) ret = EINA_TRUE;
@@ -390,6 +393,17 @@ meta_path_prepare(const char *path)
       if (ecore_file_mkdir(dir)) ret = EINA_TRUE;
       else if (ecore_file_mkpath(dir)) ret = EINA_TRUE;
     }
+  dir_parent = ecore_file_dir_get(dir);
+  if (dir_parent)
+    {
+      // copy the parent dir mode to the child .efm
+      if (lstat(dir_parent, &st) == 0)
+        {
+          chown(dir, st.st_uid, st.st_gid);
+          chmod(dir, st.st_mode);
+        }
+      free(dir_parent);
+    }
   free(dir);
   return ret;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to