Commit Graph

67 Commits

Author SHA1 Message Date
Elyes HAOUAS 9170072d47 Fix typos - (Part #2)
Fix some typos

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12016
2020-07-06 10:52:49 +02:00
Elyes HAOUAS 1a9b5fcf70 Get rid of trailing whitespaces (7 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12005
2020-06-23 10:30:05 +02:00
Vincent Torri f7c560c311 replace hton and ntoh family functions with ones defined in eina
Summary: This fixes especially the execution of edje_cc on Windows

Test Plan: execution of edje_cc

Reviewers: cedric, raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7834
2019-02-01 14:25:35 +00:00
Mike Blumenkrantz a1f649fa9d eet: add counter for number of frees needed in each directory
Summary:
further optimize the eet_shutdown case of closing files and avoid
endlessly looping over empty nodes
Depends on D5950

Reviewers: cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D5951
2018-04-25 12:00:11 -04:00
Mike Blumenkrantz e917be8831 eet: simplify shutdown file closing
no need to free mempool memory when the mempool is about to be freed,
and eet_clearcache duplicates existing shutdown functionality

Differential Revision: https://phab.enlightenment.org/D5950
2018-04-25 12:00:11 -04:00
Subodh Kumar e5a588b0bf eet: wrong comparision to less than zero with unsigned integer.
Summary:
Unsigned interger should not be compared to less than zero.
@fix

Test Plan: Na

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5264

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-10-06 09:51:19 -07:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Cedric BAIL fed9ca47f2 eet: use new API eina_file_close_on_exec. 2017-04-18 16:54:44 -07:00
Ivan Furs f7c1ac94f7 eet_lib: changed unlink to eina_file_unlink
Summary: changed unlink to eina_file_unlink

Reviewers: cedric, raster, an.kroitor, rimmed, FurryMyad, NikaWhite, vtorri

Subscribers: artem.popov, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4698
2017-03-06 18:02:11 +09:00
Jiwon Kim 9fa4a5fb6d eet: read sould be failed if cipher_key exist but file not ciphered
Summary:
Currentely, if eet_read_cipher()'s cipher_key param is exist but file
not ciphered, function always read and return successful result.
But, this behavior can not check data integrity.

e.g.
1. App create config file using eet with encryption key.
2. Attacker replace config to malicious config (not encryted).
3. App can not notice if eet_read_cipher() read that successfully.

@fix

Test Plan:
$eet -e test.cfg my_config test.src 1
$eet -d test.cfg my_config decode_res.txt my_encrytion_key

(Currentely decode success, but should be failed)

Reviewers: woohyun, raster

Subscribers: id213sin, akanad, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4563

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-07 15:14:54 -08:00
Carsten Haitzler 679af3271f eet - fix possible integer overflow in ptr diff on parse
coverity spotted this - with silly long strings (like 1gb in size or+)
it might happen. fix CID 1256196
2016-07-11 21:54:57 +09:00
Cedric BAIL 6a7257f5a7 eet: improve error message during eet_close. 2015-11-24 14:27:13 -08:00
Carsten Haitzler a5747f1ab3 eet - be robust about garbage at the end that looks like an idenity
if there is an identity signaure at the end, ONLY check it if it looks
like a real one (correct magic number, cert and sig size fields are
sane etc.). this means eet opens dont fail for files that may have
trailing garbage or padding that is not an eet identity signature.
2015-10-07 17:50:18 +09:00
Carsten Haitzler 7b018a9740 eet - fix signature alignment and position 2015-10-07 15:47:59 +09:00
Carsten Haitzler 0a77262524 eet - improve eet file storage when encoding by aligning data
this forces data when written to be aligned to 8 bytes. this makes
mapping keys directly far better as from now on you can assume all
data is aligned to 8 bytes allowing you, if you want, to use eet files
as caches for raw binary data you mmap directly and just use (not
portable though).

@feat
2015-08-28 12:56:18 +09:00
Cedric BAIL 02bfb82da0 eet: fix interger overflow
CID 1256196
2015-04-25 20:14:26 +02:00
Cedric BAIL 0e5686de73 eet: remove use of deprecated Eina_Binbuf functions. 2015-03-17 09:58:21 +01:00
Cedric BAIL 90d8932a03 emile: remove binbuf from emile compression functions. 2015-03-17 09:58:20 +01:00
Cedric BAIL a2385e2ebc emile: follow convention for Emile_Compressor_Level. 2015-03-17 09:58:20 +01:00
Cedric BAIL 8f3ec959b9 emile: change the API to allow supporting other cipher in the future. 2015-03-17 09:58:19 +01:00
Cedric BAIL f9dd639a92 eet: use Emile instead of Zlib and LZ4 directly. 2015-03-17 09:58:17 +01:00
Cedric BAIL 2d342c2814 emile: move GNUTLS and OpenSSL initialization logic from Eet to Emile. 2015-03-17 09:58:17 +01:00
Stefan Schmidt 6b27d7add2 eet: Switch from obsolete LZ4_uncompress function to LZ4_decompress_fast
The function is declared as obsolete and in some newer headers it is no
longer defined. The new function is the same besides the name change.
2014-12-10 14:52:58 +01:00
Carsten Haitzler 8669ab8a98 eet - add new api to verify eet file against stored cert
this api makes it far more obvious as to how to verify an eet file via
the eet identify mechanisms that use x509 certificates to sign files.
this is consistent with the api used to generate the key for sigining
thus you can use the same certificate file to compare against for
identify.

@feature
2014-11-28 17:56:27 +09:00
Jérémy Zurcher 2e5a5d6656 eet: call LOCK_CACHE before altering Eet_File
even if not necessary in this particular case,
do as in eet_mmap() and eet_open(),
lock the cache before altering Eet_File struct.

fix CID 1039366 1039367 1039368 1039369
2014-09-08 22:37:09 +02:00
Carsten Haitzler b0adec349f eet - handle fcntl error
fix CID 1039691
2014-08-27 16:35:48 +09:00
Stefan Schmidt 3fe554e0b6 build: Allow to use external liblz4 instead of embedded copy
While we are likely will keep the embedded copy for a while to avoid a really
new dependency we allow now to use the external liblz4. You need at least
revision r120 and a package that ships the pc file for it.

Personally I would like to get rid of it rather sooner than later due to the
security implications and a bunch of code we ship but have no idea about.
Reality is that it will need some time until this new lib is actually
packaged and shipped with releases for a a majority of people.

This patch was co-worked with Doug Newgard <scimmia22@outlook.com>
2014-08-22 16:27:28 +02:00
Carsten Haitzler 2bd42962e3 eet init - fix structurally dead code
CID 1039542
2014-08-14 20:17:16 +09:00
Albin Tonnerre 62efaed9dc comments: typo fix - s/dictionnary/dictionary
Reviewers: cedric

Reviewed By: cedric

CC: cedric

Differential Revision: https://phab.enlightenment.org/D533

Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2014-02-10 10:40:12 +09:00
Carsten Haitzler 414b447f54 Revert "eet: do not load data when the file is open in read/write mode."
This reverts commit f8b0322704.

this breaks efreets icon cache. i have been noticing this since
yesterday across all my machines once i update just efl. i tracked it
down to this commit.
2014-01-21 09:18:52 +09:00
Cedric BAIL f8b0322704 eet: do not load data when the file is open in read/write mode.
I do think that it was a left over from previous file format. Removing
this memcpy should make Enlightenment startup faster and should reduce
by 500KB the memory it use.
2014-01-20 13:04:07 +09:00
Cedric BAIL 00d4f5cf1c eet: reduce memory usage of Eet internal structure by removing useless structure. 2014-01-20 13:04:06 +09:00
Daniel Juyung Seo 76d8532b54 efl: Unified eina critical manro to CRI.
Being annoyed by different types of eina critical macros - CRI, CRIT,
 CRITICAL -, I concluded to unify them to one. Discussed on IRC and
 finally, CRI was chosen to meet the consistency with other macros -
 ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
2013-12-26 12:27:13 +09:00
Cedric Bail 440471e599 eet: shutup a warning and use the right pointer source even if they are the same. 2013-11-04 12:46:48 +09:00
Cedric Bail 07c306a272 eet: let's use const Eina_File here to. 2013-11-04 11:28:56 +09:00
Cedric Bail 1a3c9d68d0 eet: help the kernel to actually load the eet file in memory more efficiently.
When you open a theme, it is very likely that most of the data in it will be needed
at some point, that's why it is a good idea to tell it in advance to the kernel so
it could load them if it has some spare ressource.

We can't just blindly turn EINA_FILE_WILLNEED on any file or a wrong eet file would
be loaded in memory when we don't need it. So we shall keep the sequential load until
we are sure that the file is correct and then explicitely tell the kernel that the
rest of the data should be loaded in ram.
2013-10-28 18:32:40 +09:00
Chris Michael cc0bbacb89 open() can fail for various reasons, so check for valid 'fd' return
before calling fdopen.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 11:34:34 +01:00
Chris Michael 1054d49941 Fix missing unlock reported by Coverity
NB: Fixes Coverity CID1039384

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 14:20:22 +01:00
Chris Michael 3891bdcb15 Fix missing unlock (reported by Coverity).
- Instead of just returning NULL, use the existing goto on_error to
handle the unlock and return NULL.

NB: Fixes Coverity CID1039383

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 14:18:06 +01:00
Chris Michael b72e694573 Fix memleak reported by Coverity
NB: Fixes Coverity CID1039261

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 11:31:17 +01:00
Cedric Bail dba4a080d9 eet: for more safety let eet handle the reference to the file. 2013-06-04 15:04:19 +09:00
Carsten Haitzler 95b91ad9b9 eet_mmap uses reader/writers caches for lookup.. but never ADDs to
these caches! bad bad bad!
2013-05-10 09:00:02 +09:00
Carsten Haitzler 425986b4fe do not make eet files get refcounts of 2 on eet_mmap so they then never free.
we set references to 1 then on success references++... thus ALWAYS
being on 2.
2013-05-10 08:54:50 +09:00
Cedric Bail ffba364857 eet: initialize it to zero. 2013-05-09 17:22:00 +09:00
Cedric Bail a299e0723a eet: more meaningful message. 2013-05-08 18:17:00 +09:00
Cedric Bail 8fc58ae405 eet: be picky and really use the correct format without shitty cast. 2013-04-10 14:55:24 +09:00
Tom Hacohen bf8a49d9a2 Eet: Pass the correct parameter to the correct format. 2013-04-09 15:19:40 +01:00
Cedric BAIL 359d7034ba eet: enable more debug information regarding memory allocation. 2013-04-05 12:20:37 +09:00
Cedric BAIL 5465eb3acc eet: remove use of prev to reduce memory usage (30KB on 32bits system). 2013-04-05 12:14:50 +09:00
Cedric BAIL f001cfac38 eet: do the correct math for allocation. 2013-04-05 11:50:54 +09:00