Commit Graph

29 Commits

Author SHA1 Message Date
Cedric Bail 687e4ae744 eina: roll const into Eina_File API.
Note that eina_file_dup is const from the caller perspective as it
will return a fresh "non const" Eina_File that it will be able to
manipulate as it like.
2013-11-04 11:26:59 +09:00
Cedric Bail 60a34c1cd0 eina: avoid possible race condition when unreffing an Eina_File. 2013-10-28 18:32:40 +09:00
Cedric Bail 46447c95aa eina: just for a little bit of better portability. 2013-10-16 16:54:36 +09:00
Sebastian Dransfeld 0b26b1bd89 eina: And guard the right function with umask
Thanks Cedric.
2013-10-16 04:56:51 +02:00
Sebastian Dransfeld 7576ff00f3 Set secure file permissions for temporary file
From glibc mkstemp man page:
       In glibc versions 2.06 and earlier, the file is created with
       permissions 0666, that is, read and write for all users.  This old
       behavior may be a security risk, especially since other UNIX flavors
       use 0600, and somebody might overlook this detail when porting
       programs.  POSIX.1-2008 adds a requirement that the file be created
       with mode 0600.

       More generally, the POSIX specification of mkstemp() does not say
       anything about file modes, so the application should make sure its
       file mode creation mask (see umask(2)) is set appropriately before
       calling mkstemp() (and mkostemp()).

And:
	http://cwe.mitre.org/data/definitions/377.html
2013-10-16 04:28:53 +02:00
ChunEon Park 18be4c50d9 eina/eina_file - fix eina_file_map_lines() to not drop of one character in the last line. 2013-10-04 01:58:35 +09:00
Cedric Bail d7c8d221b0 eina: forgotten lock, thanks coverity. 2013-09-03 12:58:51 +09:00
Cedric Bail 64823141f6 eina: fix typo and use the right refcount. 2013-09-02 11:16:59 +09:00
Jean-Philippe Andre deacfdce24 eina: Fix invalid check on Eina_File::global_map
global_map is set to MAP_FAILED in case of error after mmap.
So, it is initialized to MAP_FAILED and considered valid
otherwise.

So, we don't want to set the map to NULL or even check again NULL.
2013-08-27 17:31:12 +09:00
Cedric Bail d72239a118 eina: remove a warning. 2013-08-12 12:11:56 +09:00
Cedric Bail 861823848a eina: change eina_file_virtualize to be able to provide a fake name. 2013-08-09 20:50:54 +09:00
Cedric Bail c4beec0127 eina: fix compilation of Eina_File on windows. 2013-08-08 17:05:14 +09:00
Cedric Bail c90179ce86 eina: fix build on FreeBSD. 2013-08-06 15:44:22 +09:00
Chris Michael a97f3c0b9b Fix eina_file_virtual_map_new function (/me glares at Frenchie).
- Spank Cedric !!!!!

NB: How about we actually fill in "map" after allocation ??

NB: Previously we would malloc "map" and immediately exit without
filling it in, without adding it to the hash....nothing. Just allocate
and get out. Bad Frenchie !!!

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 13:01:52 +01:00
Cedric Bail 4dd259f3b1 eina: add eina_file_refresh(). 2013-07-31 17:16:40 +09:00
Cedric Bail f2de8970a1 eina: add support for in memory only Eina_File. 2013-07-31 11:51:51 +09:00
Chris Michael a144495daa Initialize 'd' to -1 so we can check on 'end' if it needs closing
Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-07-08 16:05:12 +01:00
Chris Michael 2aa12782b6 If we open a file for copying, then we should also Close that file
when the copy is done.

NB: Fixes Coverity CID1039181

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 11:13:56 +01:00
Sebastian Dransfeld 336f6ec328 efl: formatting 2013-06-20 13:28:18 +02:00
Cedric Bail 06cd16548c eina: add eina_file_dup. 2013-06-04 15:04:19 +09:00
Cedric Bail 574e9015f1 eina: whitespace--; 2013-05-08 18:17:00 +09:00
Cedric Bail 5da94cfc89 eina: add <errno.h> for build on Win32. 2013-03-30 18:20:19 +09:00
Vladislav Brovko 7584a7e84d eina: add eina_file_mkdtemp and tests for Eina_File.
Test added for :
eina_file_direct_ls_simple
eina_file_ls_simple

Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2013-03-27 22:45:34 +09:00
Cedric BAIL 70f8bd50eb eina: add eina_file_mkstemp. 2013-03-25 18:45:42 +09:00
Cedric BAIL 6b4ba5cead eina: a little bit sleepy, put that in the right file. 2013-03-15 16:47:05 +09:00
Cedric BAIL 0dde9a6574 eina: share eina_file_copy code accross platform. 2013-03-15 16:05:39 +09:00
Cedric BAIL e70502f1a1 eina: improve portability of Eina_File. 2013-03-15 11:05:25 +09:00
Daniel Willmann f90726cf35 Revert "eina: improve portability of Eina_File."
This reverts commit c002d113f1.

This commit reliably breaks builds with clang. Please test with
export CC=clang before you commit again.

export CC=clang
./autogen.sh --enable-multisense && make -j 10

The error Jenkins gets (I confirmed locally):

/bin/bash: line 1: 13549 Segmentation fault      (core dumped) EFL_RUN_IN_TREE=1 ./bin/edje/edje_cc -id . -fd . -id ./tests/emotion/data tests/emotion/data/theme.edc tests/emotion/data/theme.edj
2013-03-14 17:21:48 +00:00
Cedric BAIL c002d113f1 eina: improve portability of Eina_File. 2013-03-14 20:52:37 +09:00