Commit Graph

93 Commits

Author SHA1 Message Date
Mike Blumenkrantz 9e8e755cdf formatting: all at once
SVN revision: 82625
2013-01-11 10:34:29 +00:00
Igor Murzov b96d338097 Fix inverted arguments for lseek()
Patch from Maxime Villard <rustyBSD@gmx.fr>
"Hum, I've made a mistake in e_fm_op.c with lseek(), I inverted
the two last arguments. However it's not harmful, as SEEK_SET=0.:


SVN revision: 81697
2012-12-25 18:12:31 +00:00
Carsten Haitzler 5ab8396f24 ok - strdupa make sure its defined after other includes in case,.. and
add to e_fm_ipc.c...



SVN revision: 81036
2012-12-16 01:17:45 +00:00
Carsten Haitzler 18b1eb7111 revert that.. its not a double free... its a bizarre-arse macro!
SVN revision: 81012
2012-12-15 07:44:11 +00:00
Carsten Haitzler 320ec625b0 wtf? thats like double-free land.. why strdupa at all? nuts! remove
strdupa's and make code consistent with neighbouring code.



SVN revision: 81006
2012-12-15 01:56:35 +00:00
Mike Blumenkrantz 679cae4fad patch from maxime villard fixing strdupa definition and moving a variable to local scope
SVN revision: 80990
2012-12-14 21:09:21 +00:00
Mike Blumenkrantz f4440456f7 actually we can just strdupa here instead
SVN revision: 80899
2012-12-13 21:28:54 +00:00
Mike Blumenkrantz 925645792e grr meant strncpy!
SVN revision: 80898
2012-12-13 21:25:29 +00:00
Mike Blumenkrantz 9b4ec19471 fix guaranteed crash in efm_op...rustyBSD check this if you happen to read
SVN revision: 80826
2012-12-13 11:49:07 +00:00
Mike Blumenkrantz 4a2837830b another efm_op leak, also wrong E_FREE usage
SVN revision: 80824
2012-12-13 11:34:09 +00:00
Mike Blumenkrantz e0926014a1 fix possible NULL deref in efm_op
SVN revision: 80823
2012-12-13 11:30:40 +00:00
Mike Blumenkrantz c637b2874f fix small leak in efm_op
SVN revision: 80822
2012-12-13 11:27:47 +00:00
Carsten Haitzler b000cf12d6 only srand once.
SVN revision: 80209
2012-12-05 06:21:41 +00:00
Mike Blumenkrantz 7c7927bd4e patch from Maxime Villard fixing a bug in EFM which could cause data loss when dragging directories onto external devices
SVN revision: 79319
2012-11-15 07:31:05 +00:00
Mike Blumenkrantz 568b106bd3 some patch from Maxime Villard for secure deletion fixes again
SVN revision: 78876
2012-11-02 21:02:26 +00:00
Mike Blumenkrantz 7de1d89a0b fix process updating for secure delete operations, efm_op now requires libmath
SVN revision: 78864
2012-11-02 13:44:37 +00:00
Vincent Torri a0bf30b75c E17:
I. Simplification, andif we cannot stat(), the best
thing to do is toswitch to a copy-delete operation.

II.Just stuff...

III. There is a problem with _e_fm_op_random_char().
When wewant to randomize a string we do srand(time())
foreachcharacter, so if the file is small enough
to be deleted inless than a second, it's not randomized.
And even if it's bigger, it's not goodly randomized.Sorry.

Patch by Maxime Villard rustyBSD


SVN revision: 78469
2012-10-25 17:43:52 +00:00
Mike Blumenkrantz 57d8dd8f9b fix cross-device cut+paste
ticket #1638


SVN revision: 78154
2012-10-18 07:55:34 +00:00
Mike Blumenkrantz f5dd030696 patch from rustyBSD fixing file moving to other devices
ticket #1581


SVN revision: 77342
2012-10-03 06:27:40 +00:00
Vincent Torri 0f76b94fc8 E17:
some trivial changes.

I.   _e_fm_op_stdin_handler is unused, so -> removed.

II.  if we cannot malloc _e_fm_op_stdin_buffer, we
     are in big shit, so nullcheck.

III. Formatting.

IV.  if argc < 4 we quit, so we don't need to check
     if argc >= 4.

V.   removed 'ret' variables. They are useless and
     they were not in old revisions.

VI.  _e_fm_op_copy_atom always returns 1, so we don't
     need to always check and return 1.

Patch by Maxime Villard (rustyBSD)


SVN revision: 77221
2012-09-30 08:47:07 +00:00
rustyBSD 1093c09cab From: rustyBSD <rustyBSD@gmx.fr>
Subject: Re: [E-devel] E SVN: caro trunk/e/src/bin



SVN revision: 77216
2012-09-29 02:22:43 +00:00
Carsten Haitzler dfb8541aad allow secure remove to be able to write multiple times... in theory...
but for now it's once. :)



SVN revision: 77147
2012-09-27 10:10:20 +00:00
Carsten Haitzler 17ce568685 lets "secure rm" with buffers of 64k per write and handle dangling
tail too.



SVN revision: 77146
2012-09-27 09:59:36 +00:00
Vincent Torri a7f6c22f5d E17: Added secure delete option (experimental !). Wait for discomfitor to add it to EFM conf panel
When removing a file, we store a E_FM_OP_DESTROY task,
which overwrites file with 3 passes of (~)randomized
data, and when we store a E_FM_OP_REMOVE task, to remove
the randomized file.

If it's a dir, skip E_FM_OP_DESTROY.

Patch by Maxime Villard (rustyBSD)


SVN revision: 77020
2012-09-22 18:29:03 +00:00
Vincent Torri d5e3385fd9 E17: avoid seg fault when the string passed to strlen() is NULL
Patch by Maxime Villard (rustyBSD)


SVN revision: 77016
2012-09-22 12:07:49 +00:00
Vincent Torri 7f93d7305b E17: Patch from Maxime Villard (rustyBSD)
I.
    (strncmp(p, p2, PATH_MAX) == 0) &&
    ((p[p2_len] == '/') || (p[p2_len] == '\0')))

Here we want to know if p and p2 are the same.
It's easier to do a simple 'strcmp(p, p2)', and it's
useless to check the value of p[p2_len], because if
p = p2, p[p2_len] will always be \0.

II. Check the string as for E_FM_OP_MOVE.

III. Just a simplification.
it was something like:
    if (type == E_FM_OP_COPY)
        X;
    if (type == E_FM_OP_COPY)
        Y;
    else ...

I just replaced by
    if (type == E_FM_OP_COPY)
    {
        X;
        Y;
    }
    else ...


SVN revision: 77015
2012-09-22 12:04:42 +00:00
Vincent Torri 8d8f697a3f E17: useless header, useless 'else' and 2 times the same check
Patch by Maxime Villard (rustyBSD)


SVN revision: 76773
2012-09-17 17:25:44 +00:00
Maxime Villard 3dc989c695 From: Maxime Villard <rustyBSD@gmx.fr>
There is a problem with the realpath() call. When moving
a symlink, realpath() gets the path of the pointed file,
and the name assigned to the copied link is the name of
this file.

So we shouldn't use realpath(), but I don't know an equivalent
which doesn't take care of symlinks.

Here is an example patch.


SVN revision: 76721
2012-09-17 03:57:04 +00:00
Mike Blumenkrantz affc6d8d25 another efm_op patch from Maxime Villard, I don't even know what it does
SVN revision: 76686
2012-09-14 17:00:41 +00:00
Mike Blumenkrantz 80c6165036 with the work of Maxime Villard <rustyBSD@gmx.fr>, efm_op can now move files directly when they're on the same device instead of copying then deleting the original
SVN revision: 76674
2012-09-14 15:09:05 +00:00
Maxime Villard 0d45c19468 From: Maxime Villard <rustyBSD@gmx.fr>
$ mkdir /home/test/EMPTY
 $ mkdir /home/test/FULL
 $ cd /home/test
 $ ln -s EMPTY link

 Now move (with EFM) the 'FULL' folder to the 'link' (without
 opening it), and 'FULL' diseappear.

 As the symlink points directly to 'EMPTY', we have not the
 full path. So the 'FULL' directory is moved to ~/, instead
 of the desired dest.

 Here is a quickly-made a patch.


SVN revision: 76591
2012-09-13 08:34:24 +00:00
Mike Blumenkrantz 3e1bb5843c send initial progress from efm slave to set src and dest paths in efm
SVN revision: 76416
2012-09-10 15:46:38 +00:00
Mike Blumenkrantz f59fa03035 send progress of 0% when overwrite warning is sent to ensure that we have the src and dest accessible in efm
SVN revision: 76412
2012-09-10 14:39:07 +00:00
Mike Blumenkrantz 5e7a8a0892 SVN revision: 75698
SPANK SPANK SPANK, DO NOT COMMIT PATCHES YOU DO NOT UNDERSTAND OR HAVE NOT TESTED.


SVN revision: 75988
2012-09-03 09:39:30 +00:00
Vincent Torri f84af67928 E17: remove useless symlink (as we don't rename anymore) and remove useless function _e_fm_op_update_progress_report_simple()
Patch by Maxime Villard

SVN revision: 75698
2012-08-25 09:22:09 +00:00
Vincent Torri 4812a5f372 E: minor changes
* useless define
 * formatting and useless comment
 * fread() returns a number >= 0
 * symlink returns -1 on error

SVN revision: 75687
2012-08-24 22:18:43 +00:00
Vincent Torri 053476d676 E: managing overwrite when moving files
The rename() function deletes dest file if it exists,
so there is no overwrite handling. Instead of
testing a rename() and if it fails creating a task
to copy-delete the file, we directly create this
task, which handles overwrite.

Patch by Maxime Villard (rustyBSD)


SVN revision: 75489
2012-08-21 07:40:31 +00:00
Vincent Torri 25aa4e5a89 E: add overwrite handling.
Patch by Maxime Villard (rustyBSD)

SVN revision: 75436
2012-08-19 18:35:10 +00:00
Vincent Torri d9f3d89a07 E: remove useless op
we chmod the created symlink. It's useless, because
we use stat() which gives st_mode of pointed file/folder,
and then we use chmod(), which follows symlink; so we
are chmoding a file to the same permissions it had
before.

Patch by Maxile Villard

SVN revision: 75435
2012-08-19 18:27:18 +00:00
Mike Blumenkrantz e7c7be6b1a replace FREE with E_FREE for consistency, use E_FREE instead of free
SVN revision: 74626
2012-07-31 09:06:26 +00:00
Vincent Torri 72c6b4e4a3 E17: fix race condition when copying a file
during the copy, the file can be accessed by users.
See http://cwe.mitre.org/data/definitions/689.html
So we apply the access rights after the creation of
the dest file.

Patch by Maxime Villard


SVN revision: 74284
2012-07-21 18:20:19 +00:00
Vincent Torri 6b430e4489 E17: fix typo
Patch by Maxime Villard


SVN revision: 74281
2012-07-21 18:02:07 +00:00
Vincent Torri 435a620992 check if the name has a 'file' part
SVN revision: 74266
2012-07-21 13:53:54 +00:00
Vincent Torri 4d0cfed7b9 whitespaces--
SVN revision: 74265
2012-07-21 13:51:04 +00:00
Vincent Torri 7e40b5f15a E17: symlink fixes
when copying symlinks, it creates a symlink to the
destination but with the name of the pointed file/folder.

It causes problems, ex: we can't copy two symlinks
pointing to the same file, because they will have the
same name.

Also when copying, if it's a link, we fill the destination
in the struct task, then, after we check overwrite with
_e_fm_op_handle_overwrite()

Here is a patch which corrects this.

Patch by Maxime Villard (rustyBSD), modified a bit by me (add 2 free() + formatting)


SVN revision: 74264
2012-07-21 13:48:35 +00:00
Carsten Haitzler 7ac8b4fd31 that is bad code as rusty says - though fix it a different way.
SVN revision: 74252
2012-07-20 14:40:19 +00:00
Vincent Torri c3b0637802 e17: whitespaces--
SVN revision: 72561
2012-06-21 06:19:43 +00:00
Mike Blumenkrantz 1807ea8dae on second thought, don't remove the delete task if we're still waiting for an overwrite confirmation
SVN revision: 72396
2012-06-18 13:21:52 +00:00
Mike Blumenkrantz 251a9b479a delete the rm task from the efm slave if there is a failure during the copy task
this should fix the problem described by the very angry message in ticket #729


SVN revision: 72395
2012-06-18 13:17:48 +00:00
Mike Blumenkrantz bd73abaffa formatting
SVN revision: 72392
2012-06-18 12:49:07 +00:00