[EGIT] [efm2] 03/03: printf--

2024-06-12 Thread Enlightenment Git

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 6b4c58cc95146d327e32f699233cd98a0d866ba9
Author: Carsten Haitzler (Rasterman) 
AuthorDate: Wed Jun 12 09:59:09 2024 +0100

printf--
---
 src/backends/default/mv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/backends/default/mv.c b/src/backends/default/mv.c
index 6ce39b0..be38ea8 100644
--- a/src/backends/default/mv.c
+++ b/src/backends/default/mv.c
@@ -196,8 +196,7 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 else src_meta = meta_path_user_find(fs->src, "thumb.efm");
 if (dst_can_write) dst_meta = meta_path_find(dstfile, "thumb.efm");
 else dst_meta = meta_path_user_find(dstfile, "thumb.efm");
-fprintf(stderr, "MV: %i[%s] -> %i[%s]\n", src_can_write, src_meta,
-dst_can_write, dst_meta);
+
 if ((src_meta) && (dst_meta) && (meta_path_prepare(dstfile)))
   {
 status_count(1, src_meta);


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





[EGIT] [efm2] 02/03: fix drop over tracking

2024-06-12 Thread Enlightenment Git

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 97381d2fe5874327574fe57bc54bd3c136fc250f
Author: Carsten Haitzler (Rasterman) 
AuthorDate: Wed Jun 12 09:58:29 2024 +0100

fix drop over tracking
---
 src/efm/efm_dnd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/efm/efm_dnd.c b/src/efm/efm_dnd.c
index 55e6cb9..d476573 100644
--- a/src/efm/efm_dnd.c
+++ b/src/efm/efm_dnd.c
@@ -67,6 +67,7 @@ static void
 _dnd_over_none_handle(Smart_Data *sd)
 {
   if (sd->over_icon) _icon_over_off(sd->over_icon);
+  sd->over_icon = NULL;
 }
 
 static void
@@ -168,8 +169,8 @@ _cb_drop(void *data, Evas_Object *o EINA_UNUSED, Elm_Selection_Data *ev)
   printf("XXX: DND DROP OVER [%s]\n", sd->drop_over->info.file);
   _icon_path_cmd_strbuf_append(buf, "over", sd, sd->drop_over);
 }
-
   else printf("XXX: DND DROP ...\n");
+
   tmp = malloc(ev->len + 1);
   if (!tmp) goto err;
   memcpy(tmp, ev->data, ev->len);


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





[EGIT] [efm2] 01/03: fix meta write check for share dirs and dont use .efm/.tmp dir

2024-06-12 Thread Enlightenment Git

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 71551dd179b1184ca253361da270180ffe69f14f
Author: Carsten Haitzler (Rasterman) 
AuthorDate: Wed Jun 12 09:46:58 2024 +0100

fix meta write check for share dirs and dont use .efm/.tmp dir

use .efm/file.tmp filenames now...

mind you 8.3 ye olde fat may not like this...
---
 src/backends/default/meta.c  |  3 ++-
 src/backends/default/mv.c| 19 ---
 src/backends/default/thumb.c |  1 -
 3 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/backends/default/meta.c b/src/backends/default/meta.c
index 76233fc..a5fd2f5 100644
--- a/src/backends/default/meta.c
+++ b/src/backends/default/meta.c
@@ -415,7 +415,8 @@ meta_path_can_write(const char *path)
   // policy - we only consider dirs owned by the user writeable. want to
   // avoid e.g. root browsing then modifying dirs ownee by a user or dirs
   // that might have group write access being written to by multiple users
-  if ((st.st_uid == uid) && (st.st_mode & S_IWUSR))
+  if (((st.st_uid == uid) && (st.st_mode & S_IWUSR)) ||
+  (access(dir, W_OK) == 0))
 {
   snprintf(buf, sizeof(buf), "%s/.efm", dir);
   res = mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH
diff --git a/src/backends/default/mv.c b/src/backends/default/mv.c
index 16ded30..6ce39b0 100644
--- a/src/backends/default/mv.c
+++ b/src/backends/default/mv.c
@@ -145,14 +145,6 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 eina_strbuf_append(buf, "/.efm");
 prev_umask = umask(0);
 ret= mkdir(eina_strbuf_string_get(buf), st.st_mode);
-if ((ret != 0) && (errno != EEXIST))
-  {
-status_error(fs->src, eina_strbuf_string_get(buf),
- "Cannot create directory");
-break;
-  }
-eina_strbuf_append(buf, "/.tmp");
-ret = mkdir(eina_strbuf_string_get(buf), st.st_mode);
 if ((ret != 0) && (errno != EEXIST))
   {
 status_error(fs->src, eina_strbuf_string_get(buf),
@@ -163,8 +155,9 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 
 eina_strbuf_reset(buf);
 eina_strbuf_append(buf, fs->dst);
-eina_strbuf_append(buf, "/.efm/.tmp/");
+eina_strbuf_append(buf, "/.efm/");
 eina_strbuf_append(buf, fname);
+eina_strbuf_append(buf, ".tmp");
 // mv the file ...
 if (fs_mv(fs->src, eina_strbuf_string_get(buf), EINA_TRUE))
   { // it worked so deal with meta/thumbs
@@ -203,6 +196,8 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 else src_meta = meta_path_user_find(fs->src, "thumb.efm");
 if (dst_can_write) dst_meta = meta_path_find(dstfile, "thumb.efm");
 else dst_meta = meta_path_user_find(dstfile, "thumb.efm");
+fprintf(stderr, "MV: %i[%s] -> %i[%s]\n", src_can_write, src_meta,
+dst_can_write, dst_meta);
 if ((src_meta) && (dst_meta) && (meta_path_prepare(dstfile)))
   {
 status_count(1, src_meta);
@@ -210,8 +205,9 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 // fix up the oprig stat info to match so thub is valid
 eina_strbuf_reset(buf);
 eina_strbuf_append(buf, fs->dst);
-eina_strbuf_append(buf, "/.efm/.tmp/");
+eina_strbuf_append(buf, "/.efm/");
 eina_strbuf_append(buf, fname);
+eina_strbuf_append(buf, ".tmp");
 // get stat info of new mv'd file
 if (stat(eina_strbuf_string_get(buf), &st) == 0)
   {
@@ -240,8 +236,9 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 // are ok/valid
 eina_strbuf_reset(buf);
 eina_strbuf_append(buf, fs->dst);
-eina_strbuf_append(buf, "/.efm/.tmp/");
+eina_strbuf_append(buf, "/.efm/");
 eina_strbuf_append(buf, fname);
+eina_strbuf_append(buf, ".tmp");
 eina_strbuf_reset(buf2);
 eina_strbuf_append(buf2, fs->dst);
 eina_strbuf_append(buf2, "/");
diff --git a/src/backends/default/thumb.c b/src/backends/default/thumb.c
index 01310e1..011cca1 100644
--- a/src/backends/default/thumb.c
+++ b/src/backends/default/thumb.c
@@ -1,5 +1,4 @@
 #include "thumb.h"
-#include "meta.h"
 
 Evas_Object *win= NULL;
 Evas_Object *subwin = NULL;


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





[EGIT] [efm2] 01/01: test meta write - longer name to catch 8.3 fs's

2024-06-12 Thread Enlightenment Git

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 ec1dfa1dbcdee40616b09bdf8cc3b18da79f
Author: Carsten Haitzler (Rasterman) 
AuthorDate: Wed Jun 12 10:57:44 2024 +0100

test meta write - longer name to catch 8.3 fs's
---
 src/backends/default/meta.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/backends/default/meta.c b/src/backends/default/meta.c
index a5fd2f5..72fef83 100644
--- a/src/backends/default/meta.c
+++ b/src/backends/default/meta.c
@@ -430,7 +430,8 @@ meta_path_can_write(const char *path)
 {
   if (errno == EEXIST)
 { // dir exists - test we can create a file in it
-  snprintf(buf, sizeof(buf), "%s/.efm/.t", dir);
+  snprintf(buf, sizeof(buf),
+   "%s/.efm/.testfilename.extension.efm", dir);
   res = open(buf, O_WRONLY | O_CREAT | O_CLOEXEC, S_IWUSR);
   if (res >= 0)
 { // we can create and write to file - remove it now


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





[EGIT] [efm2] 02/02: meta - preparing meta dir - use parent mode+uid/gid

2024-06-12 Thread Enlightenment Git

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) 
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 
 #include 
 #include 
+#include 
 #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_Boolret = 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.





[EGIT] [efm2] 01/02: clean up path builds and del empty efm dirs

2024-06-12 Thread Enlightenment Git

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 594004c1faabe610239ca8aadefa56bc6ba11d45
Author: Carsten Haitzler (Rasterman) 
AuthorDate: Wed Jun 12 11:52:30 2024 +0100

clean up path builds and del empty efm dirs
---
 src/backends/default/mv.c | 131 ++
 1 file changed, 74 insertions(+), 57 deletions(-)

diff --git a/src/backends/default/mv.c b/src/backends/default/mv.c
index be38ea8..6ca7c4c 100644
--- a/src/backends/default/mv.c
+++ b/src/backends/default/mv.c
@@ -48,11 +48,11 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 { // mv [src] [dstdir]
   const char  *fname, *home_dir;
   Eina_Strbuf *buf   = NULL;
-  Eina_Strbuf *buf2   = NULL;
   Eina_List   *files = NULL, *l;
   File_Set*fs;
   size_t   sz;
-  char*src = "" *dst = NULL;
+  char*src = "" *srctmpdir = NULL, *srcdir = NULL;
+  char*dst = NULL, *dsttmpdir = NULL, *dsttmpfile = NULL;
   char sbuf[PATH_MAX + 256];
   int  ret;
   struct stat  st;
@@ -89,6 +89,7 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 }
   if (src) free(src);
   if (dst) free(dst);
+  src = "" = NULL;
 
   config_dir = getenv("E_HOME_DIR");
   home_dir   = getenv("HOME");
@@ -102,12 +103,12 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 
   buf = eina_strbuf_new();
   if (!buf) goto err;
-  buf2 = eina_strbuf_new();
-  if (!buf2) goto err;
 
+  // set up status files for the op
   status_begin();
   status_op("mv");
 
+  // build up a list of all files to mv and scan them to find how much
   EINA_LIST_FOREACH(files, l, fs)
   {
 struct stat stsrc, stdst;
@@ -128,23 +129,59 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 status_dst(fs->dst);
 ret = stat(fs->dst, &st);
 if (ret != 0)
-  {
+  { // if we can't stat the dstdir then we have issues
 status_error(fs->src, fs->dst, "Cannot stat destination");
 break;
   }
 
-src_can_write = meta_path_can_write(fs->src);
+// free up previous loop stuff
+free(src);
+free(srctmpdir);
+free(dst);
+free(dsttmpdir);
+free(dsttmpfile);
+src = "" = dst = dsttmpdir = dsttmpfile = NULL;
+
+// src and src temp dir
+src = ""
+srcdir = ecore_file_dir_get(fs->src);
+if (!srcdir)
+  {
+status_error(fs->src, fs->dst, "Cannot get source dir");
+break;
+  }
+eina_strbuf_reset(buf);
+eina_strbuf_append(buf, srcdir);
+eina_strbuf_append(buf, "/.efm");
+srctmpdir = strdup(eina_strbuf_string_get(buf));
+free(srcdir);
+
+// final dest file path - can we write to the meta there?
 eina_strbuf_reset(buf);
 eina_strbuf_append(buf, fs->dst);
 eina_strbuf_append(buf, "/");
 eina_strbuf_append(buf, fname);
-dst_can_write = meta_path_can_write(eina_strbuf_string_get(buf));
-
+dst = strdup(eina_strbuf_string_get(buf));
 eina_strbuf_reset(buf);
 eina_strbuf_append(buf, fs->dst);
 eina_strbuf_append(buf, "/.efm");
+dsttmpdir = strdup(eina_strbuf_string_get(buf));
+eina_strbuf_reset(buf);
+eina_strbuf_append(buf, fs->dst);
+eina_strbuf_append(buf, "/.efm");
+eina_strbuf_append(buf, fname);
+eina_strbuf_append(buf, ".tmp");
+dsttmpfile = strdup(eina_strbuf_string_get(buf));
+if ((!src) || (!srctmpdir) || (!dst) || (!dsttmpdir) || (!dsttmpfile)) mem_abort();
+
+// can we modify the meta files in the src? (like mv/rm them?)
+src_can_write = meta_path_can_write(src);
+dst_can_write = meta_path_can_write(dst);
+
+// mkdir the /dstdir/.efm dir in the dest as we'll use it for tmp files
 prev_umask = umask(0);
-ret= mkdir(eina_strbuf_string_get(buf), st.st_mode);
+// make the dir using the same mode as the parent
+ret= mkdir(dsttmpdir, st.st_mode);
 if ((ret != 0) && (errno != EEXIST))
   {
 status_error(fs->src, eina_strbuf_string_get(buf),
@@ -153,30 +190,17 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
   }
 umask(prev_umask);
 
-eina_strbuf_reset(buf);
-eina_strbuf_append(buf, fs->dst);
-eina_strbuf_append(buf, "/.efm/");
-eina_strbuf_append(buf, fname);
-eina_strbuf_append(buf, ".tmp");
-// mv the file ...
-if (fs_mv(fs->src, eina_strbuf_string_get(buf), EINA_TRUE))
+// mv the file to a tmp file: mv /srcdir/filename /dstdir/.efm/filename.tmp
+if (fs_mv(src, dsttmpfile, EINA_TRUE))
   { // it worked so deal with meta/thumbs
-const char *dstfile;
-char   *src_meta, *dst_meta, *dstpath;
-
-eina_strbuf_reset(buf);
-eina_strbuf_append(buf, fs->dst);
-eina_strbuf_append(buf, "/");
-eina_strbuf_append(buf, fname);
-dstfile = eina_strbuf_string_get(buf);
-dstpath = strdup(dstfile);
+char *src_meta, *dst_meta;
 
 // metadata file fo

[EGIT] [efm2] 01/01: efm thumbs - dup permission of the dir they are in

2024-06-12 Thread Enlightenment Git

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 aa1a6162c275472abde98201090ded128240dfd5
Author: Carsten Haitzler (Rasterman) 
AuthorDate: Wed Jun 12 19:12:41 2024 +0100

efm thumbs - dup permission of the dir they are in
---
 src/backends/default/thumb.c | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/backends/default/thumb.c b/src/backends/default/thumb.c
index 011cca1..e0aa90b 100644
--- a/src/backends/default/thumb.c
+++ b/src/backends/default/thumb.c
@@ -25,10 +25,24 @@ _thumb_output_open(const char *thumb)
 static void
 _thumb_output_close(Eet_File *ef, const char *thumb)
 { // close thumnb file and atomically rename tmp file on top of target
-  char buf[PATH_MAX];
+  char buf[PATH_MAX], *dir;
+  struct stat st;
 
   eet_close(ef);
   snprintf(buf, sizeof(buf), "%s.tmp", thumb);
+  // fix permissions on file to match parent dir
+  dir = ecore_file_dir_get(buf);
+  if (dir)
+{
+  if (lstat(dir, &st) == 0)
+{
+  chown(buf, st.st_uid, st.st_gid);
+  chmod(buf, st.st_mode
+   & (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
+  | S_IWOTH));
+}
+  free(dir);
+}
   ecore_file_mv(buf, thumb);
 }
 
@@ -90,8 +104,8 @@ elm_main(int argc, char **argv)
   // write out the original file path so we could walk through all thumbs
   // and find which thumbs no longer have an original file left
   eet_write(ef, "orig/path", path, strlen(path), EET_COMPRESSION_LOW);
-  // write out our sha1 of the file stat info - quick and mostly right way
-  // to heck if the thumb is up to date with file
+  // write out our sha1 of the file stat info - quick and mostly right
+  // way to check if the thumb is up to date with file
   eet_write(ef, "orig/stat/sha1", statsha1, 20, EET_COMPRESSION_NONE);
   // done - finish file write and atomic rename
   _thumb_output_close(ef, thumb);


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





[EGIT] [efm2] 01/01: add to todo

2024-06-12 Thread Enlightenment Git

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 4dc6a3070e8cbdb130bfe83353f40396467f3464
Author: Carsten Haitzler (Rasterman) 
AuthorDate: Wed Jun 12 19:48:44 2024 +0100

add to todo
---
 TODO.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/TODO.md b/TODO.md
index 4a22f75..3fdc432 100644
--- a/TODO.md
+++ b/TODO.md
@@ -53,6 +53,7 @@
 * Callbacks when column sizes change
 * Lock view mode from backend
 * Disable dnd/cnp from backend
+* Handle del of file in dir to del thumb+meta
 
 ## Medium term
 


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