Commit Graph

74 Commits

Author SHA1 Message Date
Wonguk Jeong e32f033853 efreet: check magic only for file which has size
Summary:
Due to unnecessary magic checking, there was freezing in /proc in efm.
Proc file's st_size is zero, but, it's readable. therfore, it takes unnecessary time in magic checking. And, there is no need to check magic in case of 0 sized regular files as well.

Therefore, skip magic check in case of st_size is zero.

Fixes T1173

Test Plan: enlightenment -> file browser (efm) -> get int /proc --> check whether efm freezes or not

Reviewers: raster, cedric, zmike

CC: seoz, cedric

Maniphest Tasks: T1173

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

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-04-17 19:34:38 +02:00
Mike Blumenkrantz d03ecb0f3d "whether" has 2x 'h' 2014-04-10 09:27:51 -04:00
Cedric BAIL d0a03f65dc efreet: fix build on windows by matching the #if around the if statement. 2014-01-09 14:30:13 +09:00
Carsten Haitzler e8c13118eb fix mingw build for setuid fix/checks 2014-01-08 22:06:41 +09:00
Carsten Haitzler b95ef3801f setuid safeness - ensure if an app that is setuid doesn't do bad things
this makes efl ignore certain env vars for thnigs and entirely removes
user modules (that no one ever used) etc. etc. to ensure that *IF* an
app is setuid, there isn't a priv escalation path that is easy.
2014-01-08 19:46:23 +09:00
Guillaume Friloux 6ea95af025 Fix documentation for efreet_desktop_exec(). 2014-01-01 21:39:14 +01:00
Guillaume Friloux defc1d1b1a Fix documentation for efreet_desktop_environment_get(). 2014-01-01 21:28:37 +01:00
Guillaume Friloux 42c32b48a6 Simplify code of efreet_desktop_environment_set(). 2014-01-01 21:27:19 +01: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
Sebastian Dransfeld 575f466a10 efreet: improve locking
Do find and ref inside lock, so no one can ref-- after we find desktop
2013-11-29 22:20:50 +01:00
Sebastian Dransfeld 233ca45db0 efreet: Only lock once for efficiency 2013-11-21 09:29:25 +01:00
Sebastian Dransfeld c85534af7e efreet: TODO++ 2013-11-21 09:29:25 +01:00
Sebastian Dransfeld e610047ef3 efreet: store volatile value locally before return 2013-11-21 09:29:25 +01:00
Carsten Haitzler b07c0a76ce alpha1 release autofoo/build tree work to pass distcheck and actually work 2013-11-04 18:33:35 +09:00
Sebastian Dransfeld 76721f4153 efreet: Check buffer size
CID 1039582, 1039583
2013-10-14 13:21:48 +02:00
Sebastian Dransfeld 7f30306031 efreet: Always '\0' terminate buf
CID 1039721
2013-10-14 11:54:51 +02:00
Sebastian Dransfeld 144ed4c10c efreet: Fix buffer overrun, leave space for '\0'
CID: #1039304, #1039305 and #1039306
2013-08-07 13:02:54 +02:00
Sebastian Dransfeld e011d5e67c efreet: be paranoid about '\0' termination
CID: #1039721
2013-08-07 13:02:54 +02:00
Sebastian Dransfeld 35a45eb062 efreet: formatting 2013-08-07 13:02:54 +02:00
Sebastian Dransfeld 2e4fb25922 efreet: clean up ugly internal_get function
CID: #1039186
2013-08-07 13:02:54 +02:00
Sebastian Dransfeld 75dd06bcb1 efreet: Remove dead code
CID: #1039942
2013-08-07 13:02:54 +02:00
Sebastian Dransfeld ed524d49cc efreet: Explicitly set num_pending to 0
CID: #1039185
2013-08-07 13:02:54 +02:00
Sebastian Dransfeld 9707fee051 efreet: Check return value of eet_list
CID: #1039327
2013-08-07 13:02:53 +02:00
Sebastian Dransfeld 8327903b99 efreet: fgetc returns int
CID: #1039720
2013-08-07 13:02:53 +02:00
Sebastian Dransfeld a8d70f803c efreet: Check return value of chmod
CID: #1039690
2013-08-07 13:02:53 +02:00
Sebastian Dransfeld 7d1703ea0d efreet: Be paranoid about '\0' termination
CID: #1039722
2013-08-07 13:02:53 +02:00
Sebastian Dransfeld 73ad466cbc efreet: TODO++ 2013-08-07 13:02:53 +02:00
Cedric Bail ea3f82fa1e efreet: let's pass memset parameter in the right order. 2013-08-06 09:17:46 +09:00
Chris Michael 80f2498909 efreet_menu_move_free will free "move" here so remove the menu from
the parent's list Before we free the menu.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 13:58:13 +01:00
Sebastian Dransfeld a76633b930 efreet: Fix allocated data size
Since we check for count < 10 and then add 1, we could get count == 11.
Also set array memory to 0 in one command.
2013-08-05 10:45:29 +02:00
Sebastian Dransfeld 92437d7204 efreet: Formatting 2013-08-05 10:45:29 +02:00
Carsten Haitzler 27553f0500 fix clang sizeof complaint 2013-07-16 19:49:31 +09:00
Chris Michael 57924e5824 Fix memleak reported by Coverity: Close the descriptor returned by
popen if we are going to error out.

NB: Fixes Coverity CID1039184

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 11:25:59 +01:00
Chris Michael aeb4b7f7b9 Fix memleak reported by Coverity: If we fail to allocate a new
internal menu, then free the previously allocated memory for xml file.

NB: Fixed Coverity CID 1039183

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 11:19:37 +01:00
Chris Michael c04cfde0e5 Fix mem leak reported by Coverity: If we fail to create a new internal
menu, then free the previously allocated xml file.

NB: Fixes Coverity CID 1039182

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-08 11:17:13 +01:00
Cedric Bail 267b9e4c29 efreet: always sanitize path. 2013-06-27 15:19:44 +09:00
Cedric Bail 61396654a5 efreet: cleanup code by using Eina_File infra. 2013-06-27 15:19:43 +09:00
Carsten Haitzler 33678961b6 efreet: and dont try change mode if runtime dir is /tmp 2013-06-26 12:16:50 +09:00
Cedric Bail e920c2cc76 efreet: make geteuid an optional function. 2013-06-26 11:24:29 +09:00
Sebastian Dransfeld 71122d5920 efreet: Init no longer fails without dbus session
Allow programs to use efreet without requiering a dbus session. This
gives limited functionality, as efreet_icon wont work without a cache.
efreet_desktop will partially work, as it reads info from files directly
if cache is missing.
2013-06-25 04:32:26 +02:00
Carsten Haitzler 8e3d94d661 efreet: don't try change permissions on runtime dir we don't own. 2013-06-24 12:00:30 +09:00
Sebastian Dransfeld a0ba7941ad efreet: Use end cb of thread to run cb 2013-06-21 12:56:21 +02:00
Mike Blumenkrantz 51246fff68 efreet menu cbs don't return a value and take const data params 2013-06-21 09:50:03 +01:00
Sebastian Dransfeld aa8565b372 efreet: Add data to async request 2013-06-21 10:39:40 +02:00
Sebastian Dransfeld ebcd97cc93 efreet: Create cache dir in efreet_cache_init
efreetd used efreet functions before efreet init which fails.
2013-06-21 10:00:20 +02:00
Sebastian Dransfeld 336f6ec328 efl: formatting 2013-06-20 13:28:18 +02:00
Sebastian Dransfeld b1c97a0da4 efreet: Create a temp XDG_RUNTIME_DIR if not set
Using /tmp as XDG_RUNTIME_DIR is pointless if we want it to be mode 0700
2013-06-20 13:27:20 +02:00
Sebastian Dransfeld 9aada5f735 efreet: @since 2013-06-20 11:57:23 +02:00
Sebastian Dransfeld 5b3cd4cde1 efreet: Add async menu parsing 2013-06-20 11:56:46 +02:00
Sebastian Dransfeld 0c317eaca2 efreet: Make _path_to_file_id threadsafe 2013-06-20 11:56:46 +02:00