Re: [E-devel] [e] FreeBSD patch
Le 01/12/2012 10:02, rustyBSD a écrit : We can also fix leaks. I. Removed useless 'buf[sizeof(buf) - 1] = 0;', fgets() already does that II. Ensure file descriptors are closed before 'goto error' III.We don't need to nullcheck before freeing a buf, as it's already done by free() So, what's new ? -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] FreeBSD patch
Le 01/12/2012 09:41, Michael Blumenkrantz a écrit : On Sat, 01 Dec 2012 08:01:28 +0100 rustyBSD rusty...@gmx.fr wrote: Hi, just a patch to avoid temperature/tempget.c: In function 'init': temperature/tempget.c:271: warning: passing argument 3 of 'sysctlnametomib' from incompatible pointer type temperature/tempget.c: In function 'check': temperature/tempget.c:379: warning: passing argument 4 of 'sysctl' from incompatible pointer type this file should be formatted thanks formatting done We can also fix leaks. I. Removed useless 'buf[sizeof(buf) - 1] = 0;', fgets() already does that II. Ensure file descriptors are closed before 'goto error' III.We don't need to nullcheck before freeing a buf, as it's already done by free() --- tempget.c 2012-12-01 09:55:42.451612136 +0100 +++ tempget.c 2012-12-01 09:55:32.426779004 +0100 @@ -376,6 +376,7 @@ int ret = 0; int temp = 0; char buf[4096]; + char *s = NULL; #ifdef __FreeBSD__ size_t len; size_t ftemp = 0; @@ -422,14 +423,14 @@ { char dummy[4096]; - if (fgets(buf, sizeof(buf), f) == NULL) goto error; + s = fgets(buf, sizeof(buf), f); + fclose(f); + if (!s) goto error; - buf[sizeof(buf) - 1] = 0; if (sscanf(buf, %s %s %i, dummy, dummy, temp) == 3) ret = 1; else goto error; - fclose(f); } else goto error; @@ -440,10 +441,10 @@ f = fopen(sensor_path, rb); if (f) { - if (fgets(buf, sizeof(buf), f) == NULL) goto error; - + s = fgets(buf, sizeof(buf), f); fclose(f); - buf[sizeof(buf) - 1] = 0; + if (!s) goto error; + if (sscanf(buf, %i, temp) == 1) ret = 1; else @@ -459,9 +460,9 @@ f = fopen(sensor_path, r); if (f) { - if (fgets(buf, sizeof(buf), f) == NULL) goto error; - - buf[sizeof(buf) - 1] = 0; + s = fgets(buf, sizeof(buf), f); + fclose(f); + if (!s) goto error; /* actually read the temp */ if (sscanf(buf, %i, temp) == 1) @@ -470,7 +471,6 @@ goto error; /* Hack for temp */ temp = temp / 1000; - fclose(f); } else goto error; @@ -480,9 +480,9 @@ f = fopen(sensor_path, r); if (f) { - if (fgets(buf, sizeof(buf), f) == NULL) goto error; - - buf[sizeof(buf) - 1] = 0; + s = fgets(buf, sizeof(buf), f); + fclose(f); + if (!s) goto error; /* actually read the temp */ if (sscanf(buf, %i, temp) == 1) @@ -491,7 +491,6 @@ goto error; /* Hack for temp */ temp = temp / 1000; - fclose(f); } else goto error; @@ -503,10 +502,10 @@ { char *p, *q; - if (fgets(buf, sizeof(buf), f) == NULL) goto error; - - buf[sizeof(buf) - 1] = 0; + s = fgets(buf, sizeof(buf), f); fclose(f); + if (!s) goto error; + p = strchr(buf, ':'); if (p) { @@ -529,10 +528,9 @@ f = fopen(sensor_path, r); if (f) { - if (fgets(buf, sizeof(buf), f) == NULL) goto error; - - buf[sizeof(buf) - 1] = 0; + s = fgets(buf, sizeof(buf), f); fclose(f); + if (!s) goto error; temp = atoi(buf); temp /= 1000; ret = 1; @@ -550,9 +548,9 @@ return -999; error: sensor_type = SENSOR_TYPE_NONE; - if (sensor_name) free(sensor_name); + free(sensor_name); sensor_name = NULL; - if (sensor_path) free(sensor_path); + free(sensor_path); sensor_path = NULL; return -999; } -- Keep yourself connected to Go Parallel: INSIGHTS What's next for parallel hardware, programming and related areas? Interviews and blogs by thought leaders keep you ahead of the curve. http://goparallel.sourceforge.net___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] This trac is a shit [Fwd: #1900: SIGSEGV OpenBSD]
I took 10 minutes to create a ticket, after 4 unsuccessful attemps, because SPANK SPANK SERVER IS DOWN Now that it works I wrongly hoped that I could join the backtrace, and now it tells me Submission rejected as potential spam So, here is the backtrace. Original Message Subject: #1900: SIGSEGV OpenBSD Date: Sat, 01 Dec 2012 11:11:39 - From: E-Trac t...@enlightenment.org Reply-To: enlightenment-devel@lists.sourceforge.net To: rusty...@gmx.fr CC: enlightenment-b...@lists.sourceforge.net #1900: SIGSEGV OpenBSD +-- Reporter: rustyBSD@… | Owner: raster Type: Bug| Status: new Priority: Critical | Milestone: Component: enlightenment | Keywords: segfaulf Blocked By: | Blocking: +-- Hi, when changing style of the shelf, it segfaults. right-click on shelf - configuration - style - alternate - apply - tadaa ! backtrace joined PS: I use the bw theme -- Ticket URL: http://trac.enlightenment.org/e/ticket/1900 Enlightenment http://www.enlightenment.org/ Enlightenment Project Program received signal SIGSEGV, Segmentation fault. 0x05ec2abaf32c in eo_data_get (obj=0x5ec20e706a0, klass=0x5ec232ea980) at lib/eo/eo.c:1429 1429 EO_MAGIC_RETURN_VAL(obj, EO_EINA_MAGIC, NULL); #0 0x05ec2abaf32c in eo_data_get (obj=0x5ec20e706a0, klass=0x5ec232ea980) at lib/eo/eo.c:1429 #1 0x05ec3325dca1 in evas_object_del (eo_obj=0x5ec20e706a0) at lib/evas/canvas/evas_object_main.c:508 #2 0x05ec435a85f8 in _pager_desk_free (pd=0x5ec29c1c880) at pager/e_mod_main.c:493 #3 0x05ec435a809e in _pager_empty (p=0x5ec29c1c180) at pager/e_mod_main.c:378 #4 0x05ec435a7ece in _pager_free (p=0x5ec29c1c180) at pager/e_mod_main.c:310 #5 0x05ec435a7bed in _gc_shutdown (gcc=0x5ec2fd61000) at pager/e_mod_main.c:241 #6 0x05ea20ac1d75 in _e_gadcon_client_delfn (d=0x0, o=0x5ec2fd61000) at e_gadcon.c:2070 #7 0x05ea20b03ecc in e_object_free (obj=0x5ec2fd61000) at e_object.c:97 #8 0x05ea20b03f9b in e_object_unref (obj=0x5ec2fd61000) at e_object.c:135 #9 0x05ea20ac1bda in _e_gadcon_client_event_free (d=0x0, e=0x5ec2786aff0) at e_gadcon.c:2032 #10 0x05ec25b18fa8 in _ecore_call_end_cb (func=0x5ea20ac1bb3 _e_gadcon_client_event_free, user_data=0x0, func_data=0x5ec2786aff0) at ecore_private.h:304 #11 0x05ec25b18f3e in _ecore_event_del (event=0x5ec233e50b0) at ecore_events.c:393 #12 0x05ec25b19001 in _ecore_event_purge_deleted () at ecore_events.c:411 #13 0x05ec25b1933e in _ecore_event_call () at ecore_events.c:593 #14 0x05ec25b22117 in _ecore_main_loop_iterate_internal (once_only=0) at ecore_main.c:1915 #15 0x05ec25b205ae in ecore_main_loop_begin () at ecore_main.c:939 #16 0x05ea20a37529 in main (argc=1, argv=0x7f7f6880) at e_main.c:1061-- Keep yourself connected to Go Parallel: INSIGHTS What's next for parallel hardware, programming and related areas? Interviews and blogs by thought leaders keep you ahead of the curve. http://goparallel.sourceforge.net___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] Test
Hi, I would like some guys to test this: plug an USBkey, then move a lot of files to thiskey by drag'n'dropping. Move A LOT OF files, not afolder containing these files. Tell me then if itworks or if it tells something like not available. PS: save your data before, and don't check 'Really Move'in EFM config. Thanks -- Keep yourself connected to Go Parallel: TUNE You got it built. Now make it sing. Tune shows you how. http://goparallel.sourceforge.net ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] FreeBSD patch
Hi, just a patch to avoid temperature/tempget.c: In function 'init': temperature/tempget.c:271: warning: passing argument 3 of 'sysctlnametomib' from incompatible pointer type temperature/tempget.c: In function 'check': temperature/tempget.c:379: warning: passing argument 4 of 'sysctl' from incompatible pointer type this file should be formatted thanks --- src/modules/temperature/tempget.c 2012-12-01 07:59:09.050896556 +0100 +++ src/modules/temperature/tempget.c 2012-12-01 07:58:56.591087282 +0100 @@ -95,7 +95,7 @@ Eina_List *therms; char path[PATH_MAX]; #ifdef __FreeBSD__ - int len; + size_t len; #endif if ((!sensor_type) || ((!sensor_name) || (sensor_name[0] == 0))) @@ -360,7 +360,7 @@ int temp = 0; char buf[4096]; #ifdef __FreeBSD__ - int len; + size_t len; size_t ftemp = 0; #endif -- Keep yourself connected to Go Parallel: INSIGHTS What's next for parallel hardware, programming and related areas? Interviews and blogs by thought leaders keep you ahead of the curve. http://goparallel.sourceforge.net___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [Edje/Ecore]SIGSEGV on BSD's
Hi, I have just created a ticket but I'm considered as a spammer and I can't send backtrace. So I post it here. Thanks #1804: SIGSEGV on BSD's -+ Reporter: rustyBSD@… | Owner: raster Type: Bug | Status: new Priority: Critical| Milestone: Component: edje| Keywords: sigsegv edje ecore Blocked By: | Blocking: -+ Hi, on BSD's, e17 is totally unusable. I just clicked on the keyboard icon-add language-french-ok, and it crashes. Here is OpenBSD's gdb output. Program received signal SIGSEGV, Segmentation fault. 0x06207da91290 in _edje_block_break (ed=0x620814819a8) at edje_util.c:6251 6251 if (ed-block_break) return 1; #0 0x06207da91290 in _edje_block_break (ed=0x620814819a8) at edje_util.c:6251 #1 0x06207da67519 in edje_match_callback_exec_check_finals (signal_ppat=0x6208147ca00, source_ppat=0x6208147cc00, signal_finals=0x6208147ca28, source_finals=0x6208147cc28, signal_states=0x62081482000, source_states=0x62083da1c80, sig=0x62076abe53c e,action,click, source=0x6207e47190a , callbacks=0x62083da38c0, ed=0x620814819a8, prop=0 '\0') at edje_match.c:501 #2 0x06207da67af2 in edje_match_callback_exec (ppat_signal=0x6208147ca00, ppat_source=0x6208147cc00, sig=0x62076abe53c e,action,click, source=0x6207e47190a , callbacks=0x62083da38c0, ed=0x620814819a8, prop=0 '\0') at edje_match.c:658 #3 0x06207da6efae in _edje_emit_cb (ed=0x620814819a8, sig=0x62076abe53c e,action,click, src=0x6207e47190a , data=0x0, prop=0 '\0') at edje_program.c:1411 #4 0x06207da6ee4b in _edje_emit_handle (ed=0x620814819a8, sig=0x62076abe53c e,action,click, src=0x6207e47190a , sdata=0x0, prop=0 '\0') at edje_program.c:1363 #5 0x06207da698ac in _edje_message_process (em=0x62076bc6880) at edje_message_queue.c:681 #6 0x06207da69ce7 in _edje_message_queue_process () at edje_message_queue.c:789 #7 0x06207da688fd in _edje_job (data=0x0) at edje_message_queue.c:185 #8 0x062078f1560b in _ecore_job_event_handler (data=0x0, type=10, ev=0x62099666390) at ecore_job.c:152 #9 0x062078f0f6fa in _ecore_call_handler_cb (func=0x62078f155de _ecore_job_event_handler, data=0x0, type=10, event=0x62099666390) at ecore_private.h:333 #10 0x062078f0f1dc in _ecore_event_call () at ecore_events.c:559 #11 0x062078f178b7 in _ecore_main_loop_iterate_internal (once_only=0) at ecore_main.c:1910 #12 0x062078f15d4e in ecore_main_loop_begin () at ecore_main.c:934 #13 0x061e75337599 in main (argc=1, argv=0x7f7f8dc0) at e_main.c:1061-- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] b_and_w theme
Grr did someone notice that the Black White theme is uncompilable ?? $ make edje_cc theme.edc b_and_w.edj edje_cc: Error. theme.edc:46 unhandled keyword spectrum edje_cc: Error. PARSE STACK: spectra.spectrum edje_cc: Error. PARAMS: -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] b_and_w theme
Le 16/11/2012 23:55, Michael Blumenkrantz a écrit : On Fri, 16 Nov 2012 23:44:07 +0100 rustyBSD rusty...@gmx.fr wrote: Grr did someone notice that the Black White theme is uncompilable ?? $ make edje_cc theme.edc b_and_w.edj edje_cc: Error. theme.edc:46 unhandled keyword spectrum edje_cc: Error. PARSE STACK: spectra.spectrum edje_cc: Error. PARAMS: that's not the bw theme. bw is in trunk/THEMES/b_and_w/e a ok thanks -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [PATCH] e17 BSD's
Le 12/11/2012 09:10, Vincent Torri a écrit : On Fri, Nov 9, 2012 at 7:08 PM, Vincent Torri vincent.to...@gmail.com wrote: On Fri, Nov 9, 2012 at 6:56 PM, rustyBSD rusty...@gmx.fr wrote: Le 09/11/2012 18:40, Vincent Torri a écrit : On Fri, Nov 9, 2012 at 6:18 PM, rustyBSD rusty...@gmx.fr wrote: Le 09/11/2012 16:39, Vincent Torri a écrit : I would suggest #if !defined(__OpenBSD) etc instead of #ifdef __linux__ As it will work for Mac OS X, and probably on Solaris too Btw, it's strange that it works on Mac OS X and not in FreeBSD. Ah yes, forgot it. Ialso tested on NetBSD, it doesn't have PTRACE_GETSIGINFO. what about PT_GETSIGINFO ? According to the man pages, no. http://www.unix.com/man-page/FreeBSD/2/ptrace http://www.openbsd.org/cgi-bin/man.cgi?query=ptracesektion=2format=html http://nixdoc.net/man-pages/NetBSD/ptrace.2.html ok, it's clear :) Vincent new patch: 1) i've added Mac SO X support as it has the same problem : no PTRACE_GETSIGINFO. 2) there was a mistake in the last #if with freebsd (should be !__FreeBSD__) Vincent Ok. Commit ? -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] OpenBSD
Hi, I just compiled e17 on OpenBSD, and when starting e I get this: Enlightenment was started without any configuration files available for the given profile (normally default or the last profile used or provided on the command-line with -profile etc.) Cannot contiue without configuration to work with. Please ensure you have system or user configuration for the profile you are using before proceeeding. What does that mean ? How can I get it work ? - And you forgot the 'n' in 'contiue'- -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [PATCH] e17 BSD's
Hi, here are patches to fix compilation on OpenBSD and FreeBSD (and NetBSD ?). - The 'tainted' variable is unused, so removed. - Switch to execv(), as FreeBSD and OpenBSD doesn't have PTRACE_GETSIGINFO - Just moved to size_t to avoid warning on FreeBSD Thanks --- src/bin/e_start_main.c 2012-11-09 16:23:40.487464346 +0100 +++ src/bin/e_start_main.c 2012-11-09 16:23:21.054770189 +0100 @@ -18,8 +18,6 @@ #include Eina.h -static Eina_Bool tainted = EINA_FALSE; - static void env_set(const char *var, const char *val); EAPI intprefix_determine(char *argv0); @@ -233,7 +231,11 @@ char valgrind_path[PATH_MAX] = ; const char *valgrind_log = NULL; Eina_Bool really_know = EINA_FALSE; + +#ifdef __linux__ Eina_Bool restart = EINA_TRUE; +#endif + struct sigaction action; action.sa_sigaction = _sigusr1; @@ -389,17 +391,19 @@ args[i++] = buf; copy_args(args + i, argv + 1, argc - 1); args[i + argc - 1] = NULL; - /* execv(args[0], args); */ - /* not run at the moment !! */ +#ifndef __linux__ + execv(args[0], args); +#endif + /* not run at the moment !! */ +#ifdef __linux__ /* Now looping until */ while (restart) { pid_t child; -tainted = EINA_FALSE; child = fork(); if (child 0) /* failed attempt */ @@ -533,6 +537,7 @@ } } +#endif /* __linux__ */ return -1; } --- src/modules/cpufreq/freqset.c 2012-11-09 15:29:25.510344614 +0100 +++ src/modules/cpufreq/freqset.c 2012-11-09 15:29:18.349457011 +0100 @@ -56,7 +56,7 @@ if (!strcmp(argv[1], frequency)) { int new_frequency = atoi(argv[2]); -int len = 4; +size_t len = sizeof(new_frequency); if (sysctlbyname(dev.cpu.0.freq, NULL, 0, new_frequency, len) == -1) { fprintf(stderr, Unable to open frequency interface for writing.\n); -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [PATCH] e17 BSD's
Le 09/11/2012 16:39, Vincent Torri a écrit : I would suggest #if !defined(__OpenBSD) etc instead of #ifdef __linux__ As it will work for Mac OS X, and probably on Solaris too Btw, it's strange that it works on Mac OS X and not in FreeBSD. Ah yes, forgot it. Ialso tested on NetBSD, it doesn't have PTRACE_GETSIGINFO. --- e_start_main.c 2012-11-09 18:14:01.060979399 +0100 +++ e_start_main.c 2012-11-09 18:12:26.164530869 +0100 @@ -18,7 +18,6 @@ #include Eina.h -static Eina_Bool tainted = EINA_FALSE; static Eina_Bool stop_ptrace = EINA_FALSE; static void env_set(const char *var, const char *val); @@ -241,9 +240,11 @@ char valgrind_path[PATH_MAX] = ; const char *valgrind_log = NULL; Eina_Bool really_know = EINA_FALSE; - Eina_Bool restart = EINA_TRUE; struct sigaction action; - +#if !defined(__OpenBSD__) !defined(__NetBSD__) !defined(__FreeBSD__) + Eina_Bool restart = EINA_TRUE; +#endif + action.sa_sigaction = _sigusr1; action.sa_flags = SA_RESETHAND; sigemptyset(action.sa_mask); @@ -397,17 +398,19 @@ args[i++] = buf; copy_args(args + i, argv + 1, argc - 1); args[i + argc - 1] = NULL; - /* execv(args[0], args); */ - /* not run at the moment !! */ +#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) + execv(args[0], args); +#endif + /* not run at the moment !! */ +#if !defined(__OpenBSD__) !defined(__NetBSD__) || defined(__FreeBSD__) /* Now looping until */ while (restart) { pid_t child; -tainted = EINA_FALSE; child = fork(); if (child 0) /* failed attempt */ @@ -552,6 +555,7 @@ } } } +#endif return -1; } -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E17 SRC is now in FEATURE FREEZE aka RELEASE MODE
Le 08/11/2012 23:54, Michael Blumenkrantz a écrit : Hi, This mail is the official mail informing anyone and everyone working on E17 that we are now in a feature freeze for the upcoming release. This means that NO new features should be added unless: 1) They are absolutely crucial for the release 2) They are discussed beforehand 3) A consensus is reached which determines that the feature in question must be added We will be doing continued releases twice every week (Monday and Friday, where possible) to try and increase improve user testing. This means that all changes made to the tree need to be tested prior to making a commit. Build breaks and SIGILL shenanigans from here on out are not encouraged (hi Cedric!). Please treat this just like any other release, though you don't have to add ChangeLog/NEWS entries for any fixes made...yet :) Thanks in advance for your cooperation, and I look forward to the coming end of the world. And this, can it be committed ? It's just a mistake in the path, nothing harmful. --- src/modules/temperature/tempget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/temperature/tempget.c b/src/modules/temperature/tempget.c index 3a1c346..ffbfb7f 100644 --- a/src/modules/temperature/tempget.c +++ b/src/modules/temperature/tempget.c @@ -343,7 +343,7 @@ init(void) break; case SENSOR_TYPE_LINUX_SYS: snprintf(path, sizeof(path), - /sys/class/thermal/thermal/%s/temp, sensor_name); + /sys/class/thermal/%s/temp, sensor_name); sensor_path = strdup(path); break; default: @@ -508,6 +508,7 @@ check(void) fclose(f); temp = atoi(buf); temp /= 1000; + ret = 1; } else goto error; -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] cpufreq
Le 30/10/2012 17:41, rustyBSD a écrit : Hi, here is a patch for e/src/modules/cpufreq/e_mod_main.c I. _cpufreq_status_check_available() always returns 1, so moved to void. II. Don't need to 'buf[sizeof(buf) - 1] = 0;', as it's already done by snprintf. III. Stuff for OpenBSD. IV. Fixed files descriptors leaks, and removed useless code. thanks _ : \ ;\ \_ _ ;@: ~: _,-;@) ;@: ;~: _,' _,'@; ;@; ;~; ,-' _,@@@,' |@( ; ) ,-'@@@-; ;@; |~~( _/ /@@/ \@\ ; _/ _/ /@@;~ \@\ / / ,'@@@,-'~ \\ ( ) :@@(~ ___ )-'`--/ ___ ( `--__,--' ) (~`- ___ \ / ___ -'~) __~\_( \_~~_/ )_/~__ /\ /\ /\ ,-'~`-._ 0\/0 _,-'~`-. | |: ::|; __ `' __: | `' `'|;{ \ ~ / } | \_ _/ `-._ ,-,' ~~ `.-. _,'|\ \ /_ `' ,' `, `' : \ |_( )`-._/#\_,-' : ) ,-' ~) _,--./ (###)__ : : (_) / ; `-' `--, | ; (~~~' ) ; /@@.`. | / `.HH~;,-' ,- |@@@ . `. .') `HH `. ,' / |@ . `. / /(~) HH \_ ,' _/`.|@ @; `. ; (~~) ~~`. \_,' / ; .@ @@;\_ \___ ; H~\) \_ _/`. |@@ @; \ `'_HH[~) \___/ `. :@ @@' \__,--' HH ~ __; |@@ @@@' HH _) \_, ; :@; ~~ _; \\ ,' |@: ,' ; : \_, :@@. `.__,-'~~`._,-. ,:@@`. \//: /,@@. |,@@@: |:@@@' `. \/ `@/( ) ~~~/\ \ : / \_\ (/ \_ `. / ; \_ `. / /\ `. / / `. \ ,' ,'/~~); / { `' ( / / `.___,-' \ / / __/ | / / /| : : __ :| ; : _; )__ ( | | / / `,' ~ )_ `-:__;-' : ,' ~~ ; / (_,--' ( ,-'~~ \__,-'~ -- LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central http://p.sf.net/sfu/logmein12331_d2d ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] Temperature module
Hi, I don't really know sensors on linux, but it seems that there is a mistake in the temperature module. Here are two patches: the first is for formatting (it was a shame),the second for the fix. thanks --- tempget.c 2012-11-02 16:09:54.045398884 +0100 +++ tempget.c 2012-11-02 16:10:24.195728698 +0100 @@ -345,7 +345,7 @@ break; case SENSOR_TYPE_LINUX_SYS: snprintf(path, sizeof(path), -/sys/class/thermal/thermal/%s/temp, sensor_name); +/sys/class/thermal/%s/temp, sensor_name); sensor_path = strdup(path); break; default: --- tempget.c 2012-11-02 16:06:59.442817832 +0100 +++ tempget.c 2012-11-02 16:06:52.480839157 +0100 @@ -37,7 +37,7 @@ #ifdef __OpenBSD__ static int dev, numt; -static struct sensordev snsrdev; +static struct sensordev snsrdev; static size_t sdlen = sizeof(snsrdev); static struct sensor snsr; static size_t slen = sizeof(snsr); @@ -104,46 +104,49 @@ if ((!sensor_type) || ((!sensor_name) || (sensor_name[0] == 0))) { - if (sensor_name) free(sensor_name); - if (sensor_path) free(sensor_path); - sensor_path = NULL; +if (sensor_name) free(sensor_name); +if (sensor_path) free(sensor_path); +sensor_path = NULL; #ifdef __FreeBSD__ - /* TODO: FreeBSD can also have more temperature sensors! */ - sensor_type = SENSOR_TYPE_FREEBSD; - sensor_name = strdup(tz0); +/* TODO: FreeBSD can also have more temperature sensors! */ +sensor_type = SENSOR_TYPE_FREEBSD; +sensor_name = strdup(tz0); #elif __OpenBSD__ - mib[0] = CTL_HW; - mib[1] = HW_SENSORS; +mib[0] = CTL_HW; +mib[1] = HW_SENSORS; - for (dev = 0; ; dev++) { - mib[2] = dev; - if (sysctl(mib, 3, snsrdev, sdlen, NULL, 0) == -1) { - if (errno == ENOENT)/* no further sensors */ -break; - else -continue; - } - if (strcmp(snsrdev.xname, cpu0) == 0) { - sensor_type = SENSOR_TYPE_OPENBSD; - sensor_name = strdup(cpu0); - break; - } - } +for (dev = 0; ; dev++) + { +mib[2] = dev; +if (sysctl(mib, 3, snsrdev, sdlen, NULL, 0) == -1) + { + if (errno == ENOENT) /* no further sensors */ + break; + else + continue; + } +if (strcmp(snsrdev.xname, cpu0) == 0) + { + sensor_type = SENSOR_TYPE_OPENBSD; + sensor_name = strdup(cpu0); + break; + } + } #else - therms = ecore_file_ls(/proc/acpi/thermal_zone); - if (therms) - { - char *name; - - name = eina_list_data_get(therms); - sensor_type = SENSOR_TYPE_LINUX_ACPI; - sensor_name = strdup(name); - - eina_list_free(therms); - } - else - { - eina_list_free(therms); +therms = ecore_file_ls(/proc/acpi/thermal_zone); +if (therms) + { + char *name; + + name = eina_list_data_get(therms); + sensor_type = SENSOR_TYPE_LINUX_ACPI; + sensor_name = strdup(name); + + eina_list_free(therms); + } +else + { + eina_list_free(therms); therms = ecore_file_ls(/sys/class/thermal); if (therms) { @@ -249,106 +252,105 @@ eina_list_free(therms); } } - } - } - } +} + } + } #endif } if ((sensor_type) (sensor_name) (!sensor_path)) { - char *name; +char *name; - switch (sensor_type) - { - case SENSOR_TYPE_NONE: - break; - case SENSOR_TYPE_FREEBSD: +switch (sensor_type) + { + case SENSOR_TYPE_NONE: + break; + case SENSOR_TYPE_FREEBSD: #ifdef __FreeBSD__ - snprintf(path, sizeof(path), hw.acpi.thermal.%s.temperature, - sensor_name); - sensor_path = strdup(path); - len = 5; - sysctlnametomib(sensor_path, mib, len); + snprintf(path, sizeof(path), hw.acpi.thermal.%s.temperature, +sensor_name); + sensor_path = strdup(path); + len = 5; + sysctlnametomib(sensor_path, mib, len); #endif - break; - case SENSOR_TYPE_OPENBSD: + break; + case SENSOR_TYPE_OPENBSD: #ifdef __OpenBSD__ - for (numt = 0; numt snsrdev.maxnumt[SENSOR_TEMP]; numt++) { - mib[4] = numt; - slen = sizeof(snsr); - if (sysctl(mib, 5, snsr, slen, NULL, 0) == -1) -continue; - if (slen 0 (snsr.flags SENSOR_FINVALID) == 0) { -break; - } - } + for (numt = 0; numt snsrdev.maxnumt[SENSOR_TEMP]; numt++) + { +mib[4] =
[E-devel] [e] e_sys_main.c
Hi, with recent changes fromCedric Bail in e/src/bin/e_sys_main.c, OpenBSD needs sys/wait.h. Also removed useless code. thanks --- e_sys_main.c Wed Oct 31 16:09:29 2012 +++ e_sys_main.c Wed Oct 31 16:07:00 2012 @@ -6,6 +6,7 @@ #include string.h #include sys/types.h #include sys/stat.h +#include sys/wait.h #include pwd.h #include grp.h #include fnmatch.h @@ -50,7 +51,7 @@ const char *act; #endif gid_t gid, gl[65536], egid; - int pid; + int pid = 0; for (i = 1; i argc; i++) { @@ -72,20 +73,21 @@ test = 1; action = argv[2]; } - else if ((argc == 4) (!strcmp(argv[1], gdb))) - { - char *end = NULL; + else if (!strcmp(argv[1], gdb)) + { +if (argc != 4) exit(1); +char *end = NULL; - action = argv[1]; - pid = strtoul(argv[2], end, 10); - if (end == NULL || *end != '\0') - { - printf(Invalid pid for '%s'.\n, argv[3]); - exit(0); - } +action = argv[1]; +pid = strtoul(argv[2], end, 10); +if (end == NULL || *end != '\0') + { + printf(Invalid pid for '%s'.\n, argv[3]); + exit(0); + } - output = argv[3]; - } +output = argv[3]; + } #ifdef HAVE_EEZE_MOUNT else { @@ -109,8 +111,8 @@ { exit(1); } - fprintf(stderr, action %s %i\n, action, argc); if (!action) exit(1); + fprintf(stderr, action %s %i\n, action, argc); uid = getuid(); gid = getgid(); @@ -152,13 +154,12 @@ exit(20); } - if (!(strcmp(argv[1], gdb))) + if (!strcmp(action, gdb)) { Eina_Prefix *pfx = NULL; char buffer[4096]; char *tmp; char *enlightenment_gdb; -char *batch; int fd; int r; @@ -171,12 +172,11 @@ snprintf(buffer, 4096, set logging file %s\nset logging on\nbacktrace full\n, output); -batch = strdup(buffer); tmp = strdup(/tmp/e-gdb-XX); fd = mkstemp(tmp); if (fd 0) exit(-1); -write(fd, batch, strlen(batch)); +write(fd, buffer, strlen(buffer)); close(fd); snprintf(buffer, 4096, @@ -192,7 +192,6 @@ unlink(tmp); free(enlightenment_gdb); -free(batch); free(tmp); exit(WEXITSTATUS(r)); -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] e_sys_main.c
Le 31/10/2012 16:41, Michael Blumenkrantz a écrit : in. for future diffs please separate out all formatting changes into separate patches. ok -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] e_fm_op.c: Gettext
Hi all, can someone add gettext support to e/src/bin/e_fm_op.c ? Thanks ! -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [ecore] Recursive rm
Le 15/10/2012 18:57, rustyBSD a écrit : Le 15/10/2012 10:03, Vincent Torri a écrit : Maxime: you can separate code with the _WIN32 macro. Can you update ecore and write a patch that use lstat on non win32 ? Ok. So, what's new ?? -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] e_fm_op.c: Gettext
Le 30/10/2012 11:44, Michael Blumenkrantz a écrit : any particular reason? For translation -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] cpufreq
Hi, here is a patch for e/src/modules/cpufreq/e_mod_main.c I. _cpufreq_status_check_available() always returns 1, so moved to void. II. Don't need to 'buf[sizeof(buf) - 1] = 0;', as it's already done by snprintf. III. Stuff for OpenBSD. IV. Fixed files descriptors leaks, and removed useless code. thanks --- e_mod_main.c Tue Oct 30 09:14:27 2012 +++ e_mod_main.c Tue Oct 30 09:14:24 2012 @@ -1,6 +1,11 @@ #include e.h #include e_mod_main.h +/* NOTE: for OpenBSD, as we cannot set the frequency but + * only its percent, we store percents 25-50-75-100 + * in s-frequencies instead of available frequencies. + */ + #if defined (__FreeBSD__) || defined (__OpenBSD__) # include sys/sysctl.h #endif @@ -38,7 +43,7 @@ static Eina_Bool _cpufreq_cb_check(void *data); static Status *_cpufreq_status_new(void); static void _cpufreq_status_free(Status *s); -static int _cpufreq_status_check_available(Status *s); +static void _cpufreq_status_check_available(Status *s); static int _cpufreq_status_check_current(Status *s); static int _cpufreq_cb_sort(const void *item1, const void *item2); static void _cpufreq_face_update_available(Instance *inst); @@ -301,7 +306,6 @@ frequency / 100.); #endif - buf[sizeof(buf) - 1] = 0; e_menu_item_label_set(mi, buf); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); @@ -556,7 +560,7 @@ return 0; } -static int +static void _cpufreq_status_check_available(Status *s) { char buf[4096]; @@ -564,36 +568,23 @@ // FIXME: this assumes all cores accept the same freqs/ might be wrong #if defined (__OpenBSD__) - int freq, mib[] = {CTL_HW, HW_CPUSPEED}; - size_t len = sizeof(freq); int p; - if (sysctl(mib, 2, freq, len, NULL, 0) == 0) + if (s-frequencies) { -if (s-frequencies) - { - eina_list_free(s-frequencies); - s-frequencies = NULL; - } - -if (s-governors) - { - for (l = s-governors; l; l = l-next) - free(l-data); - eina_list_free(s-governors); - s-governors = NULL; - } - -/* storing percents */ -p = 100; -s-frequencies = eina_list_append(s-frequencies, (void *)p); -p = 75; -s-frequencies = eina_list_append(s-frequencies, (void *)p); -p = 50; -s-frequencies = eina_list_append(s-frequencies, (void *)p); -p = 25; -s-frequencies = eina_list_append(s-frequencies, (void *)p); +eina_list_free(s-frequencies); +s-frequencies = NULL; } + + /* storing percents */ + p = 100; + s-frequencies = eina_list_append(s-frequencies, (void *)p); + p = 75; + s-frequencies = eina_list_append(s-frequencies, (void *)p); + p = 50; + s-frequencies = eina_list_append(s-frequencies, (void *)p); + p = 25; + s-frequencies = eina_list_append(s-frequencies, (void *)p); #elif defined (__FreeBSD__) int freq; size_t len = sizeof(buf); @@ -649,8 +640,11 @@ s-frequencies = NULL; } -if (fgets(buf, sizeof(buf), f) == NULL) return 1; -buf[sizeof(buf) - 1] = 0; +if (fgets(buf, sizeof(buf), f) == NULL) + { + fclose(f); + return; + } fclose(f); freq = strtok(buf, ); @@ -683,8 +677,11 @@ s-governors = NULL; } -if (fgets(buf, sizeof(buf), f) == NULL) return 1; -buf[sizeof(buf) - 1] = 0; +if (fgets(buf, sizeof(buf), f) == NULL) + { + fclose(f); + return; + } fclose(f); gov = strtok(buf, ); @@ -703,7 +700,6 @@ (int (*)(const void *, const void *))strcmp); } #endif - return 1; } static int @@ -736,6 +732,7 @@ s-can_set_frequency = 1; s-cur_governor = NULL; + #elif defined (__FreeBSD__) size_t len = sizeof(frequency); s-active = 0; @@ -752,6 +749,7 @@ /* hardcoded for testing */ s-can_set_frequency = 1; s-cur_governor = NULL; + #else char buf[4096]; FILE *f; @@ -770,8 +768,11 @@ f = fopen(buf, r); if (f) { - if (fgets(buf, sizeof(buf), f) == NULL) continue; - buf[sizeof(buf) - 1] = 0; + if (fgets(buf, sizeof(buf), f) == NULL) + { + fclose(f); + continue; + } fclose(f); frequency = atoi(buf); @@ -811,10 +812,13 @@ { char *p; -buf[0] = 0; -if (fgets(buf, sizeof(buf), f) == NULL) return ret; ; -buf[sizeof(buf) - 1] = 0; +if (fgets(buf, sizeof(buf), f) == NULL) + { + fclose(f); + return ret; + } fclose(f); + for (p
[E-devel] [e] Patch
Hi all, here is a patch for the randomization in e/src/bin/e_fm_op.c. 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. Thanks --- e_fm_op.c Sat Oct 20 16:28:10 2012 +++ e_fm_op.c Sat Oct 20 16:26:55 2012 @@ -106,7 +106,7 @@ static int _e_fm_op_rename_atom(E_Fm_Op_Task *task); static int _e_fm_op_destroy_atom(E_Fm_Op_Task *task); static void _e_fm_op_random_buf(char *buf, ssize_t len); -static char _e_fm_op_random_char(); +static void _e_fm_op_random_char(char *buf, size_t len); Eina_List *_e_fm_op_work_queue = NULL, *_e_fm_op_scan_queue = NULL; Ecore_Idler *_e_fm_op_work_idler_p = NULL, *_e_fm_op_scan_idler_p = NULL; @@ -311,12 +311,11 @@ if ((stat(argv[i], st1) == 0) (stat(buf, st2) == 0)) { - /* if files are on the same device */ - if (st1.st_dev == st2.st_dev) -type = E_FM_OP_RENAME; - else + /* if files are not on the same device */ + if (st1.st_dev != st2.st_dev) type = E_FM_OP_MOVE; } + else type = E_FM_OP_MOVE; } } @@ -1661,7 +1660,6 @@ return 0; } -/* EXPERIMENTAL */ static int _e_fm_op_destroy_atom(E_Fm_Op_Task *task) { @@ -1691,7 +1689,7 @@ if (st2.st_dev != task-src.st.st_dev || st2.st_ino != task-src.st.st_ino || - !S_ISREG(st2.st_mode)) + st2.st_mode != task-src.st.st_mode) goto finish; if ((buf = malloc(READBUFSIZE)) == NULL) @@ -1744,32 +1742,28 @@ _e_fm_op_random_buf(char *buf, ssize_t len) { int f = -1; - ssize_t i; if ((f = open(/dev/urandom, O_RDONLY)) == -1) { - for (i = 0; i len; i++) - { -buf[i] = _e_fm_op_random_char(); - } - return; +_e_fm_op_random_char(buf, len); +return; } if (read(f, buf, len) != len) - { - for (i = 0; i len; i++) - { -buf[i] = _e_fm_op_random_char(); - } - } + _e_fm_op_random_char(buf, len); close(f); return; } -static char -_e_fm_op_random_char() +static void +_e_fm_op_random_char(char *buf, size_t len) { + size_t i; srand((unsigned int)time(NULL)); - return (rand() % 256) + 'a'; + + for (i = 0; i len; i++) + { +buf[i] = (rand() % 256) + 'a'; + } } -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [ecore] Recursive rm
Le 15/10/2012 10:03, Vincent Torri a écrit : Maxime: you can separate code with the _WIN32 macro. Can you update ecore and write a patch that use lstat on non win32 ? Ok. --- ecore_file.c 2012-10-15 18:53:22.594116119 +0200 +++ ecore_file.c 2012-10-15 18:52:46.668671104 +0200 @@ -399,22 +399,27 @@ EAPI Eina_Bool ecore_file_recursive_rm(const char *dir) { - Eina_Iterator *it; - char buf[PATH_MAX]; struct stat st; - int ret; + +#ifdef _WIN32 + char buf[PATH_MAX]; if (readlink(dir, buf, sizeof(buf) - 1) 0) return ecore_file_unlink(dir); + if (stat(dir, st) == -1) + return EINA_FALSE; +#else + if (lstat(dir, st) == -1) + return EINA_FALSE; +#endif - ret = stat(dir, st); - if ((ret == 0) (S_ISDIR(st.st_mode))) + if (S_ISDIR(st.st_mode)) { Eina_File_Direct_Info *info; +Eina_Iterator *it; +int ret; ret = 1; -if (stat(dir, st) == -1) return EINA_FALSE; /* WOOT: WHY ARE WE CALLING STAT TWO TIMES ??? */ - it = eina_file_direct_ls(dir); EINA_ITERATOR_FOREACH(it, info) { @@ -431,7 +436,6 @@ } else { -if (ret == -1) return EINA_FALSE; return ecore_file_unlink(dir); } } -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [ecore] Recursive rm
Hi, I looked at the ecore_file_recursive_rm() function (in ecore/src/lib/ecore_file/), and I wonder why this is so ugly/complicated. We are doing a readlink() and two stat(). Why not simply do a lstat() ? It takes less memory and it's simplier. Here is a patch. Am I wrong ? (And readlink() is ssize_t) --- ecore_file.c 2012-10-06 13:11:59.884889232 +0200 +++ ecore_file.c 2012-10-06 13:08:24.569905570 +0200 @@ -399,21 +399,16 @@ EAPI Eina_Bool ecore_file_recursive_rm(const char *dir) { - Eina_Iterator *it; - char buf[PATH_MAX]; struct stat st; - int ret; - if (readlink(dir, buf, sizeof(buf) - 1) 0) - return ecore_file_unlink(dir); + if (lstat(dir, st) == -1) + return EINA_FALSE; - ret = stat(dir, st); - if ((ret == 0) (S_ISDIR(st.st_mode))) + if (S_ISDIR(st.st_mode)) { Eina_File_Direct_Info *info; - -ret = 1; -if (stat(dir, st) == -1) return EINA_FALSE; /* WOOT: WHY ARE WE CALLING STAT TWO TIMES ??? */ +Eina_Iterator *it; +int ret = 1; it = eina_file_direct_ls(dir); EINA_ITERATOR_FOREACH(it, info) @@ -429,11 +424,8 @@ else return EINA_FALSE; } - else - { -if (ret == -1) return EINA_FALSE; -return ecore_file_unlink(dir); - } + + return ecore_file_unlink(dir); } static inline Eina_Bool @@ -790,7 +782,7 @@ ecore_file_readlink(const char *lnk) { char buf[PATH_MAX]; - int count; + ssize_t count; if ((count = readlink(lnk, buf, sizeof(buf) - 1)) 0) return NULL; buf[count] = 0; -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [ecore] Recursive rm
Le 06/10/2012 14:03, Vincent Torri a écrit : Hi, I looked at the ecore_file_recursive_rm() function (in ecore/src/lib/ecore_file/), and I wonder why this is so ugly/complicated. We are doing a readlink() and two stat(). Why not simply do a lstat() ? note that lstat does not exist on Windows Vincent Ah ok, I didn't know. But the second stat() is still useless. -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] Translation broken !
Le 29/09/2012 13:27, rustyBSD a écrit : Mmmh... The translation of e/src/modules/notification seems to be broken. I don't know if it's the right thing to do, but I added entries in POTFILES.in/.skip. Then we can removee/src/modules/notification/po. Sometimes I wonder who I'm talking to -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] evas bad typedef
Le 01/10/2012 19:08, rustyBSD a écrit : Hi, == evas_gl_api_ext.h l.4 == The GLchar type is already defined on openbsd (/usr/X11R6/include/GL/glext.h), so it has to be renamed. You should really use another name.GLchar already comes with gl/opengl. OpenBSD and NetBSD don't like that. -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] cpufreq: OpenBSD support
On 09/30/12 14:11, rustyBSD wrote: are you sure about fresqet.c ? Just returning 1 ? Not really. I'm looking for a way to change the cpu freq Mmhh... The problem with openbsd's sysctl is that we get cpu freq in Mhz, but we can only set it in percents - and not up to 100%. So I put percents instead of Mhz in the menu, even if it sometimes causes some problems with the speedbar. But it works. I'll continue later. You can commit these patches. --- e_mod_main.cMon Oct 1 07:42:45 2012 +++ e_mod_main.cMon Oct 1 07:43:43 2012 @@ -1,9 +1,8 @@ #include e.h #include e_mod_main.h -#ifdef __FreeBSD__ -#include sys/types.h -#include sys/sysctl.h +#if defined (__FreeBSD__) || defined (__OpenBSD__) +# include sys/sysctl.h #endif /* gadcon requirements */ @@ -291,11 +290,17 @@ frequency = (long)l-data; mi = e_menu_item_new(mo); + +#ifdef __OpenBSD__ + snprintf(buf, sizeof(buf), _(%i %%), frequency); +#else if (frequency 100) snprintf(buf, sizeof(buf), _(%i MHz), frequency / 1000); else snprintf(buf, sizeof(buf), _(%'.1f GHz), frequency / 100.); +#endif + buf[sizeof(buf) - 1] = 0; e_menu_item_label_set(mi, buf); e_menu_item_radio_set(mi, 1); @@ -445,8 +451,10 @@ return; } - // change it to userspace +#ifndef __OpenBSD__ + /* OpenBSD doesn't have governors */ _cpufreq_set_governor(userspace); +#endif snprintf(buf, sizeof(buf), %s %s %i, cpufreq_config-set_exe_path, frequency, frequency); @@ -548,8 +556,40 @@ { char buf[4096]; Eina_List *l; - // FIXME: this sssumes all cores accept the same freqs/ might be wrong -#ifdef __FreeBSD__ + // FIXME: this assumes all cores accept the same freqs/ might be wrong + +#if defined (__OpenBSD__) + int freq, mib[] = {CTL_HW, HW_CPUSPEED}; + size_t len = sizeof(freq); + int p; + + if (sysctl(mib, 2, freq, len, NULL, 0) == 0) + { +if (s-frequencies) + { + eina_list_free(s-frequencies); + s-frequencies = NULL; + } + +if (s-governors) + { + for (l = s-governors; l; l = l-next) + free(l-data); + eina_list_free(s-governors); + s-governors = NULL; + } + +/* storing percents */ +p = 100; +s-frequencies = eina_list_append(s-frequencies, (void *)p); +p = 75; +s-frequencies = eina_list_append(s-frequencies, (void *)p); +p = 50; +s-frequencies = eina_list_append(s-frequencies, (void *)p); +p = 25; +s-frequencies = eina_list_append(s-frequencies, (void *)p); + } +#elif defined (__FreeBSD__) int freq, i; size_t len = 0; char *freqs, *pos, *q; @@ -665,15 +705,28 @@ static int _cpufreq_status_check_current(Status *s) { - char buf[4096]; - int i; - FILE *f; int ret = 0; int frequency = 0; - int frequency_min = 0x7fff; - int frequency_max = 0; - int freqtot = 0; -#ifdef __FreeBSD__ + +#if defined (__OpenBSD__) + size_t len = sizeof(frequency); + int mib[] = {CTL_HW, HW_CPUSPEED}; + s-active = 0; + + _cpufreq_status_check_available(s); + + if (sysctl(mib, 2, frequency, len, NULL, 0) == 0) + { +frequency *= 1000; +if (frequency != s-cur_frequency) ret = 1; +s-cur_frequency = frequency; +s-active = 1; + } + + s-can_set_frequency = 1; + s-cur_governor = NULL; + s-cur_frequency = frequency; +#elif defined (__FreeBSD__) int len = 4; s-active = 0; @@ -690,6 +743,13 @@ s-can_set_frequency = 1; s-cur_governor = NULL; #else + char buf[4096]; + FILE *f; + int frequency_min = 0x7fff; + int frequency_max = 0; + int freqtot = 0; + int i; + s-active = 0; _cpufreq_status_check_available(s); @@ -724,7 +784,7 @@ // printf(%i | %i %i\n, frequency, frequency_min, frequency_max); - // FIXME: this sssumes all cores are on the same governor + // FIXME: this assumes all cores are on the same governor f = fopen(/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed, r); if (f) { --- freqset.c Mon Oct 1 07:59:21 2012 +++ freqset.c Mon Oct 1 07:46:15 2012 @@ -5,10 +5,15 @@ #include string.h #ifdef __FreeBSD__ -#include sys/types.h -#include sys/sysctl.h +# include sys/sysctl.h #endif +#ifdef __OpenBSD__ +# include sys/param.h +# include sys/resource.h +# include sys/sysctl.h +#endif + static int sys_cpu_setall(const char *control, const char *value); static int sys_cpufreq_set(const char *control, const char *value); @@ -25,9 +30,29 @@ if (seteuid(0)) { fprintf(stderr, Unable to assume root privileges\n); +return 1; } -#ifdef __FreeBSD__ +#if defined __OpenBSD__ + if (!strcmp(argv[1
Re: [E-devel] [e] cpufreq: OpenBSD support
On 10/01/12 08:22, Vincent Torri wrote: maybe this could help you : http://stackoverflow.com/questions/4226353/show-memory-and-cpu-in-c Vincent ? There is no problem when getting the frequency. The only difference with linux is that instead of displaying available frequencies (in the menu), we display 25-50-75-100% - as we can only set percents. We unfortunately cannot get available levels, so we don't know what is the max/min frequency available for the processor, and it sometimes causes problem with the speedcounter, which doesn't know where to place the freq in the counter. PS: I forgot to mention that the freebsd support is broken. Here are patches again. This time it's really ok, I also quickly modified the freebsd code. --- e_mod_main.cMon Oct 1 14:58:24 2012 +++ e_mod_main.cMon Oct 1 14:41:45 2012 @@ -1,9 +1,8 @@ #include e.h #include e_mod_main.h -#ifdef __FreeBSD__ -#include sys/types.h -#include sys/sysctl.h +#if defined (__FreeBSD__) || defined (__OpenBSD__) +# include sys/sysctl.h #endif /* gadcon requirements */ @@ -291,17 +290,29 @@ frequency = (long)l-data; mi = e_menu_item_new(mo); + +#ifdef __OpenBSD__ + snprintf(buf, sizeof(buf), %i %%, frequency); +#else if (frequency 100) snprintf(buf, sizeof(buf), _(%i MHz), frequency / 1000); else snprintf(buf, sizeof(buf), _(%'.1f GHz), frequency / 100.); +#endif + buf[sizeof(buf) - 1] = 0; e_menu_item_label_set(mi, buf); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); + +#ifdef __OpenBSD__ + if (cpufreq_config-status-cur_percent == frequency) +e_menu_item_toggle_set(mi, 1); +#else if (cpufreq_config-status-cur_frequency == frequency) e_menu_item_toggle_set(mi, 1); +#endif e_menu_item_callback_set(mi, _cpufreq_menu_frequency, l-data); } } @@ -445,8 +456,10 @@ return; } - // change it to userspace +#ifndef __OpenBSD__ + /* OpenBSD doesn't have governors */ _cpufreq_set_governor(userspace); +#endif snprintf(buf, sizeof(buf), %s %s %i, cpufreq_config-set_exe_path, frequency, frequency); @@ -548,14 +561,45 @@ { char buf[4096]; Eina_List *l; - // FIXME: this sssumes all cores accept the same freqs/ might be wrong -#ifdef __FreeBSD__ - int freq, i; - size_t len = 0; + // FIXME: this assumes all cores accept the same freqs/ might be wrong + +#if defined (__OpenBSD__) + int freq, mib[] = {CTL_HW, HW_CPUSPEED}; + size_t len = sizeof(freq); + int p; + + if (sysctl(mib, 2, freq, len, NULL, 0) == 0) + { +if (s-frequencies) + { + eina_list_free(s-frequencies); + s-frequencies = NULL; + } + +if (s-governors) + { + for (l = s-governors; l; l = l-next) + free(l-data); + eina_list_free(s-governors); + s-governors = NULL; + } + +/* storing percents */ +p = 100; +s-frequencies = eina_list_append(s-frequencies, (void *)p); +p = 75; +s-frequencies = eina_list_append(s-frequencies, (void *)p); +p = 50; +s-frequencies = eina_list_append(s-frequencies, (void *)p); +p = 25; +s-frequencies = eina_list_append(s-frequencies, (void *)p); + } +#elif defined (__FreeBSD__) + int freq; + size_t len = sizeof(buf); char *freqs, *pos, *q; /* read freq_levels sysctl and store it in freq */ - len = sizeof(buf); if (sysctlbyname(dev.cpu.0.freq_levels, buf, len, NULL, 0) == 0) { /* sysctl returns 0 on success */ @@ -665,18 +709,37 @@ static int _cpufreq_status_check_current(Status *s) { - char buf[4096]; - int i; - FILE *f; int ret = 0; int frequency = 0; - int frequency_min = 0x7fff; - int frequency_max = 0; - int freqtot = 0; -#ifdef __FreeBSD__ - int len = 4; +#if defined (__OpenBSD__) + size_t len = sizeof(frequency); + int percent, mib[] = {CTL_HW, HW_CPUSPEED}; s-active = 0; + + _cpufreq_status_check_available(s); + + if (sysctl(mib, 2, frequency, len, NULL, 0) == 0) + { +frequency *= 1000; +if (frequency != s-cur_frequency) ret = 1; +s-cur_frequency = frequency; +s-active = 1; + } + + mib[1] = HW_SETPERF; + + if (sysctl(mib, 2, percent, len, NULL, 0) == 0) + { +s-cur_percent = percent; + } + + s-can_set_frequency = 1; + s-cur_governor = NULL; +#elif defined (__FreeBSD__) + size_t len = sizeof(frequency); + s-active = 0; + /* frequency is stored in dev.cpu.0.freq */ if (sysctlbyname(dev.cpu.0.freq, frequency, len, NULL, 0) == 0) { @@
Re: [E-devel] [e] cpufreq: OpenBSD support
On 10/01/12 15:20, Vincent Torri wrote: ? I have seen that : printf(CPU: %d MHz Free: %ld MB\n, cpuspeed, sysconf(_SC_AVPHYS_PAGES)*sysconf(_SC_PAGESIZE))20 so it displays the freq in Mhz, no ? My ? meant that it's not actually the problem. The freq is correctly displayed in the counter in Mhz, it's just the pointer which sometimes goes crazy, but we cannot do anything. -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] evas bad typedef
Hi, == evas_gl_api_ext.h l.4 == The GLchar type is already defined on openbsd (/usr/X11R6/include/GL/glext.h), so it has to be renamed. -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] cpufreq: OpenBSD support
On 10/01/12 19:41, Vincent Torri wrote: is the freebsd support still broken avec your changes ? Yes I think, but I'm not sure. -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] cpufreq: OpenBSD support
Hi, I added support for OpenBSD on the cpufreq module. Thanks --- e_mod_main.cSun Sep 30 11:16:50 2012 +++ e_mod_main.cSun Sep 30 11:11:57 2012 @@ -6,6 +6,12 @@ #include sys/sysctl.h #endif +#ifdef __OpenBSD__ +#include sys/types.h +#include sys/sysctl.h +#include sys/param.h +#endif + /* gadcon requirements */ static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style); static void _gc_shutdown(E_Gadcon_Client *gcc); @@ -422,7 +428,7 @@ char buf[4096]; int ret; -#ifdef __FreeBSD__ +#if defined (__FreeBSD__) || defined (__OpenBSD__) frequency /= 1000; #endif if (!cpufreq_config-status-can_set_frequency) @@ -548,8 +554,32 @@ { char buf[4096]; Eina_List *l; - // FIXME: this sssumes all cores accept the same freqs/ might be wrong -#ifdef __FreeBSD__ + // FIXME: this assumes all cores accept the same freqs/ might be wrong + +#ifdef __OpenBSD__ + int freq, getMhz[] = {CTL_HW, HW_CPUSPEED}; + size_t len = sizeof(buf); + + if (sysctl(getMhz, 2, buf, len, NULL, 0) == 0) + { +if (s-frequencies) + { + eina_list_free(s-frequencies); + s-frequencies = NULL; + } + +freq = atoi(buf); +s-frequencies = eina_list_append(s-frequencies, (void *)freq); + +if (s-governors) + { + for (l = s-governors; l; l = l-next) + free(l-data); + eina_list_free(s-governors); + s-governors = NULL; + } + } +#elif defined (__FreeBSD__) int freq, i; size_t len = 0; char *freqs, *pos, *q; @@ -665,15 +695,25 @@ static int _cpufreq_status_check_current(Status *s) { - char buf[4096]; - int i; - FILE *f; int ret = 0; int frequency = 0; - int frequency_min = 0x7fff; - int frequency_max = 0; - int freqtot = 0; -#ifdef __FreeBSD__ + +#if defined (__OpenBSD__) + size_t len = sizeof(frequency); + int getMhz[] = {CTL_HW, HW_CPUSPEED}; + s-active = 0; + + if (sysctl(getMhz, 2, frequency, len, NULL, 0) == 0) + { +frequency *= 1000; +if (frequency != s-cur_frequency) ret = 1; +s-cur_frequency = frequency; +s-active = 1; + } + + s-can_set_frequency = 0; + s-cur_governor = NULL; +#elif defined (__FreeBSD__) int len = 4; s-active = 0; @@ -690,6 +730,13 @@ s-can_set_frequency = 1; s-cur_governor = NULL; #else + char buf[4096]; + FILE *f; + int frequency_min = 0x7fff; + int frequency_max = 0; + int freqtot = 0; + int i; + s-active = 0; _cpufreq_status_check_available(s); @@ -724,7 +771,7 @@ // printf(%i | %i %i\n, frequency, frequency_min, frequency_max); - // FIXME: this sssumes all cores are on the same governor + // FIXME: this assumes all cores are on the same governor f = fopen(/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed, r); if (f) { --- freqset.c Sun Sep 30 11:19:34 2012 +++ freqset.c Sun Sep 30 11:14:48 2012 @@ -15,6 +15,11 @@ int main(int argc, char *argv[]) { + +#ifdef __OpenBSD__ + return 1; +#endif + if (argc != 3) { fprintf(stderr, Invalid command. Syntax:\n); -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] cpufreq: OpenBSD support
On 09/30/12 13:57, Vincent Torri wrote: are you sure about fresqet.c ? Just returning 1 ? Not really. I'm looking for a way to change the cpu freq -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] Patch
Hi, 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. Thanks ! --- e_fm_op.c 2012-09-29 09:02:41.187650273 +0200 +++ e_fm_op.c 2012-09-29 09:02:35.358737797 +0200 @@ -108,8 +108,6 @@ static void _e_fm_op_random_buf(char *buf, ssize_t len); static char _e_fm_op_random_char(); -Ecore_Fd_Handler *_e_fm_op_stdin_handler = NULL; - Eina_List *_e_fm_op_work_queue = NULL, *_e_fm_op_scan_queue = NULL; Ecore_Idler *_e_fm_op_work_idler_p = NULL, *_e_fm_op_scan_idler_p = NULL; @@ -172,10 +170,10 @@ eina_init(); _e_fm_op_stdin_buffer = malloc(READBUFSIZE); + if (!_e_fm_op_stdin_buffer) return 0; - _e_fm_op_stdin_handler = - ecore_main_fd_handler_add(STDIN_FILENO, ECORE_FD_READ, _e_fm_op_stdin_data, NULL, - NULL, NULL); + ecore_main_fd_handler_add(STDIN_FILENO, ECORE_FD_READ, _e_fm_op_stdin_data, + NULL, NULL, NULL); if (argc 3) return 0; @@ -198,8 +196,8 @@ if ((type == E_FM_OP_SECURE_REMOVE) || (type == E_FM_OP_MOVE)) { - _e_fm_op_work_queue = eina_list_append(_e_fm_op_work_queue, NULL); - _e_fm_op_separator = _e_fm_op_work_queue; +_e_fm_op_work_queue = eina_list_append(_e_fm_op_work_queue, NULL); +_e_fm_op_separator = _e_fm_op_work_queue; } if ((type == E_FM_OP_COPY) || @@ -209,7 +207,7 @@ { if (argc 4) goto quit; -if ((argc = 4) (ecore_file_is_dir(argv[last]))) +if (ecore_file_is_dir(argv[last])) { char buf[PATH_MAX]; char *p2, *p3; @@ -237,20 +235,17 @@ done = 0; total = last - 2; - char *p; - for (; i last; i++) { - p = argv[i]; const char *name; size_t name_len; /* Don't move a dir into itself */ - if (ecore_file_is_dir(p) - (strcmp(p, p2) == 0)) + if (ecore_file_is_dir(argv[i]) + (strcmp(argv[i], p2) == 0)) goto skip_arg; - name = ecore_file_file_get(p); + name = ecore_file_file_get(argv[i]); if (!name) goto skip_arg; name_len = strlen(name); if (p2_len + name_len = PATH_MAX) goto skip_arg; @@ -267,19 +262,19 @@ { if (type == E_FM_OP_RENAME) { -if (!strcmp(argv[i],buf)) +if (!strcmp(argv[i], buf)) goto skip_arg; -if (buf[0]!='/') +if (buf[0] != '/') _E_FM_OP_ERROR_SEND_SCAN(0, E_FM_OP_ERROR, Unknown destination '%s': %s., buf); } else if (type == E_FM_OP_MOVE) { -if (!strcmp(argv[i],buf)) +if (!strcmp(argv[i], buf)) goto skip_arg; -if (buf[0]!='/') +if (buf[0] != '/') _E_FM_OP_ERROR_SEND_SCAN(0, E_FM_OP_ERROR, Unknown destination '%s': %s., buf); @@ -673,7 +668,8 @@ *queue = eina_list_remove_list(*queue, *node); *node = NULL; *mark = 0; - /* Do not clean out _e_fm_op_error_response. This way when another error occures, it would be handled automatically. */ + /* Do not clean out _e_fm_op_error_response. This way when another error + * occures, it would be handled automatically. */ return 1; } } @@ -935,8 +931,6 @@ } else { -int ret = 0; - vsnprintf(str, READBUFSIZE - 3 * sizeof(int), fmt, ap); len = strlen(str); @@ -944,7 +938,7 @@ *((int *)(buf + sizeof(int))) = type; *((int *)(buf + (2 * sizeof(int = len + 1; -ret = write(STDOUT_FILENO, buf, (3 * sizeof(int)) + len + 1); +write(STDOUT_FILENO, buf, (3 * sizeof(int)) + len + 1); E_FM_OP_DEBUG(%s, str); E_FM_OP_DEBUG( Error sent.\n); @@ -993,8 +987,7 @@ const int magic = E_FM_OP_MAGIC; const int id = E_FM_OP_PROGRESS; char *p, *data; -
[E-devel] [e] Translation broken !
Mmmh... The translation of e/src/modules/notification seems to be broken. I don't know if it's the right thing to do, but I added entries in POTFILES.in/.skip. Then we can removee/src/modules/notification/po. --- po/POTFILES.in 2012-09-29 13:14:20.739145592 +0200 +++ po/POTFILES.in 2012-09-29 13:14:06.559345319 +0200 @@ -259,3 +259,7 @@ src/modules/xkbswitch/e_mod_main.c src/modules/xkbswitch/e_mod_config.c src/modules/xkbswitch/e_mod_parse.c +src/modules/notification/e_mod_box.c +src/modules/notification/e_mod_config_item.c +src/modules/notification/e_mod_main.c +src/modules/notification/e_mod_config.c --- po/POTFILES.skip 2012-09-29 13:14:24.064098773 +0200 +++ po/POTFILES.skip 2012-09-29 13:12:42.653529510 +0200 @@ -60,3 +60,4 @@ src/modules/conf_wallpaper2/e_int_config_wallpaper.c src/modules/conf_wallpaper2/e_mod_main.c src/modules/conf_wallpaper2/module.desktop.in +src/modules/notification/module.desktop.in -- How fast is your code? 3 out of 4 devs don\\\'t know how their code performs in production. Find out how slow your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219672;13503038;z? http://info.appdynamics.com/FreeJavaPerformanceDownload.html___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: caro trunk/e/src/bin
Le 28/09/2012 09:04, Carsten Haitzler (The Rasterman) a écrit : Can you please revert your changes ? why? its better than the code that was there (your patch). your patch did this: 1. find out size of file 2. alloc memory for ENTIRE file 3. fill buffer with random data or 0xff 4. write whole buffer in 1 write call 5. fsync the file this will be JUSt as slow and blocking as the code there now, except the code now doesn't need as much memory. if it was a 2gb file u'd need 2gb of ram or it'd fail. now it needs a fixed 64k. so why revert it? it's an improvement. You fucking don't understand what i told. I told that I HAVE ALREADY MADE A PATCH WHICH DOES A BETTER JOB THAN YOURS, AND THAT I'M JUST WAITING FOR VTORRI Isn't that fucking clear ? -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: caro trunk/e/src/bin
Le 28/09/2012 12:39, Carsten Haitzler (The Rasterman) a écrit : you're waiting for vincent to commit patches? what patches? where? by who? doing what? you planned to do something ... but never mention you did it. planning and doing are very different things. you didn't say that the patches you sent fix this. sorry but your mails are incredibly far from being clear on the topic. your first reply to me definitely is not. and then its revert changes which of course i refused as it'd make the code worse. could you please actually be clear before resorting to swearing and asking for reverts? You're not doing (overwrite_count) passes, but (overwrite_count*NB_PASS). You cannot cancel operation and see progression. Here is a patch. $ svn update -r77020 e_fm_op.c And then patch. So we are doing the same thing (I mean, in a loop), but correctly. (and ...random_buf() never returns -1, so - void). Discomfitor asked me to improve e_fm_op.c, and I started by adding this little feature. It's just that it make me angry when I'm in charge of something which is modified by others without asking anything. Then I loose my time to write mails, as if I had only that to do. --- e_fm_op.c 2012-09-28 17:01:30.375484254 +0200 +++ e_fm_op.c 2012-09-28 17:14:05.047492064 +0200 @@ -105,7 +105,7 @@ static int _e_fm_op_remove_atom(E_Fm_Op_Task *task); static int _e_fm_op_rename_atom(E_Fm_Op_Task *task); static int _e_fm_op_destroy_atom(E_Fm_Op_Task *task); -static int _e_fm_op_random_buf(char *buf, ssize_t len); +static void _e_fm_op_random_buf(char *buf, ssize_t len); static char _e_fm_op_random_char(); Ecore_Fd_Handler *_e_fm_op_stdin_handler = NULL; @@ -1679,6 +1679,9 @@ if (_e_fm_op_abort) goto finish; static int fd = -1; static char *buf = NULL; + static int passes = 0; + static off_t pos = 0; + off_t sz; if (fd == -1) { @@ -1702,27 +1705,39 @@ !S_ISREG(st2.st_mode)) goto finish; - if ((buf = malloc(st2.st_size)) == NULL) + if ((buf = malloc(READBUFSIZE)) == NULL) goto finish; task-src.st.st_size = st2.st_size; } - if (lseek(fd, SEEK_SET, 0) == -1) - goto finish; + if (pos + READBUFSIZE task-src.st.st_size) sz = task-src.st.st_size - pos; + else sz = READBUFSIZE; - if (_e_fm_op_random_buf(buf, task-src.st.st_size) == -1) - memset(buf, 0xFF, task-src.st.st_size); - if (write(fd, buf, task-src.st.st_size) != task-src.st.st_size) + _e_fm_op_random_buf(buf, sz); + if (write(fd, buf, sz) != sz) goto finish; if (fsync(fd) == -1) goto finish; - task-dst.done++; - _e_fm_op_update_progress_report_simple((double)task-dst.done/NB_PASS*100, /dev/urandom, task-src.name); + pos += sz; - if (task-dst.done == NB_PASS) - goto finish; + _e_fm_op_update_progress_report_simple((double) (pos + (passes * task-src.st.st_size)) / + (task-src.st.st_size * NB_PASS) * 100, + /dev/urandom, task-src.name); + + if (pos = task-src.st.st_size) + { + passes++; + + if (passes == NB_PASS) + goto finish; + if (lseek(fd, SEEK_SET, 0) == -1) + goto finish; + + pos = 0; + return 1; + } return 1; @@ -1730,11 +1745,13 @@ close(fd); fd = -1; E_FREE(buf); + passes = 0; + pos = 0; task-finished = 1; return 1; } -static int +static void _e_fm_op_random_buf(char *buf, ssize_t len) { int f = -1; @@ -1746,7 +1763,7 @@ { buf[i] = _e_fm_op_random_char(); } - return 0; + return; } if (read(f, buf, len) != len) @@ -1758,7 +1775,7 @@ } close(f); - return 0; + return; } static char -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: caro trunk/e/src/bin
Le 28/09/2012 19:21, Lucas De Marchi a écrit : There's no need for a revert here. Code now is better than it was before. If yours is indeed better yet (didn't look your patch), just re-diff it and *send* as an improvement. You didn't submit it before and raster committed a much more sane code. . --- e_fm_op.c 2012-09-28 20:49:39.744734480 +0200 +++ e_fm_op.c 2012-09-28 20:49:25.796987970 +0200 @@ -105,7 +105,7 @@ static int _e_fm_op_remove_atom(E_Fm_Op_Task *task); static int _e_fm_op_rename_atom(E_Fm_Op_Task *task); static int _e_fm_op_destroy_atom(E_Fm_Op_Task *task); -static int _e_fm_op_random_buf(char *buf, ssize_t len); +static void _e_fm_op_random_buf(char *buf, ssize_t len); static char _e_fm_op_random_char(); Ecore_Fd_Handler *_e_fm_op_stdin_handler = NULL; @@ -1679,10 +1679,9 @@ if (_e_fm_op_abort) goto finish; static int fd = -1; static char *buf = NULL; - off_t pos, sz; -// if we do this 7 times! we're -// int cnt, overwrite_count = 7; - int cnt, overwrite_count = 1; + static int passes = 0; + static off_t pos = 0; + off_t sz; if (fd == -1) { @@ -1706,39 +1705,39 @@ !S_ISREG(st2.st_mode)) goto finish; - if ((buf = malloc(65536)) == NULL) + if ((buf = malloc(READBUFSIZE)) == NULL) goto finish; task-src.st.st_size = st2.st_size; } - for (cnt = 0; cnt overwrite_count; cnt++) + if (pos + READBUFSIZE task-src.st.st_size) sz = task-src.st.st_size - pos; + else sz = READBUFSIZE; + + _e_fm_op_random_buf(buf, sz); + if (write(fd, buf, sz) != sz) + goto finish; + if (fsync(fd) == -1) + goto finish; + + pos += sz; + + _e_fm_op_update_progress_report_simple((double) (pos + (passes * task-src.st.st_size)) / + (task-src.st.st_size * NB_PASS) * 100, + /dev/urandom, task-src.name); + + if (pos = task-src.st.st_size) { -if (lseek(fd, SEEK_SET, 0) == -1) - goto finish; - -for (pos = 0; pos task-src.st.st_size; pos += 65536) - { - sz = 65536; - if ((task-src.st.st_size - pos) sz) sz = task-src.st.st_size - pos; - if (_e_fm_op_random_buf(buf, sz) == -1) - // alternate patterb between 0x00 and 0xff each round starting with 0xff - memset(buf, 0xff * ((cnt + 1) 0x1), sz); - if (write(fd, buf, sz) != sz) - { - fsync(fd); - goto finish; - } - } -if (fsync(fd) == -1) - goto finish; - } + passes++; - task-dst.done++; - _e_fm_op_update_progress_report_simple((double)task-dst.done/NB_PASS*100, /dev/urandom, task-src.name); + if (passes == NB_PASS) + goto finish; + if (lseek(fd, SEEK_SET, 0) == -1) + goto finish; - if (task-dst.done == NB_PASS) - goto finish; + pos = 0; + return 1; + } return 1; @@ -1746,11 +1745,13 @@ close(fd); fd = -1; E_FREE(buf); + passes = 0; + pos = 0; task-finished = 1; return 1; } -static int +static void _e_fm_op_random_buf(char *buf, ssize_t len) { int f = -1; @@ -1762,7 +1763,7 @@ { buf[i] = _e_fm_op_random_char(); } - return 0; + return; } if (read(f, buf, len) != len) @@ -1774,7 +1775,7 @@ } close(f); - return 0; + return; } static char -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: caro trunk/e/src/bin
Le 27/09/2012 12:10, Carsten Haitzler (The Rasterman) a écrit : and that's what i did. a fixed buffer of 64kb is malloced - and random filled or 0xff filled as per before - but just written 64k at a time. and yes - it handles the tail that may not be a full 64k too. here's the question... this is pretty lame security-wise. shouldn't we be military/cia/nsa spec and overwrite it at least 7 times? :) oh and this will probably/possible get screwed by logging fs's or flash media that may shuffle the blocks around on write :) ie it wont help. anyway... why not do it 7 times and then we can say not even the cia can get your warez after this! :) I planned to do something like this. I don't have commit access, and I wait for vtorri to commit other patches. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: caro trunk/e/src/bin
Le 27/09/2012 18:24, rustyBSD a écrit : Le 27/09/2012 12:10, Carsten Haitzler (The Rasterman) a écrit : and that's what i did. a fixed buffer of 64kb is malloced - and random filled or 0xff filled as per before - but just written 64k at a time. and yes - it handles the tail that may not be a full 64k too. here's the question... this is pretty lame security-wise. shouldn't we be military/cia/nsa spec and overwrite it at least 7 times? :) oh and this will probably/possible get screwed by logging fs's or flash media that may shuffle the blocks around on write :) ie it wont help. anyway... why not do it 7 times and then we can say not even the cia can get your warez after this! :) I planned to do something like this. I don't have commit access, and I wait for vtorri to commit other patches. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel Oh I just saw you already committed a patch. But... it's bad. If I'm removing a BIG ( 2go) file, how can I cancel ? I can't. And there is no progress bar. (and as I told, i'm just waiting to commit patches...) -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: caro trunk/e/src/bin
Le 27/09/2012 18:55, rustyBSD a écrit : Le 27/09/2012 18:24, rustyBSD a écrit : Le 27/09/2012 12:10, Carsten Haitzler (The Rasterman) a écrit : and that's what i did. a fixed buffer of 64kb is malloced - and random filled or 0xff filled as per before - but just written 64k at a time. and yes - it handles the tail that may not be a full 64k too. here's the question... this is pretty lame security-wise. shouldn't we be military/cia/nsa spec and overwrite it at least 7 times? :) oh and this will probably/possible get screwed by logging fs's or flash media that may shuffle the blocks around on write :) ie it wont help. anyway... why not do it 7 times and then we can say not even the cia can get your warez after this! :) I planned to do something like this. I don't have commit access, and I wait for vtorri to commit other patches. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel Oh I just saw you already committed a patch. But... it's bad. If I'm removing a BIG ( 2go) file, how can I cancel ? I can't. And there is no progress bar. (and as I told, i'm just waiting to commit patches...) -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel Please revert your changes -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: caro trunk/e/src/bin
Le 28/09/2012 01:41, Carsten Haitzler (The Rasterman) a écrit : On Thu, 27 Sep 2012 18:55:39 +0200 rustyBSD rusty...@gmx.fr said: Le 27/09/2012 18:24, rustyBSD a écrit : Le 27/09/2012 12:10, Carsten Haitzler (The Rasterman) a écrit : and that's what i did. a fixed buffer of 64kb is malloced - and random filled or 0xff filled as per before - but just written 64k at a time. and yes - it handles the tail that may not be a full 64k too. here's the question... this is pretty lame security-wise. shouldn't we be military/cia/nsa spec and overwrite it at least 7 times? :) oh and this will probably/possible get screwed by logging fs's or flash media that may shuffle the blocks around on write :) ie it wont help. anyway... why not do it 7 times and then we can say not even the cia can get your warez after this! :) I planned to do something like this. I don't have commit access, and I wait for vtorri to commit other patches. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel Oh I just saw you already committed a patch. But... it's bad. If I'm removing a BIG ( 2go) file, how can I cancel ? I can't. And there is no progress bar. well... it's no worse than your original patch/code... which would try allocate 2gb of ram... then write it all at once (and if alloc failed it'd refuse to do the rm overwrite at all_. :) Can you please revert your changes ? -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: caro trunk/e/src/bin
Le 25/09/2012 15:57, Sebastian Dransfeld a écrit : Something like this (untested!!). Hi, I use malloc() because OpenBSD's secure rm uses malloc too. I'm not sure mmap() is good, but I'll read some documentation. In all cases, your patch doesn't work, as eina_file_map_all() give a read access. So we can't write randomized data to the file (PROT_READ). -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] E SVN: caro trunk/e/src/bin
Le 25/09/2012 15:57, Sebastian Dransfeld a écrit : Something like this (untested!!). Hi, I use malloc() because OpenBSD's secure rm uses malloc too. I'm not sure mmap() is good, but I'll read some documentation. In all cases, your patch doesn't work, as eina_file_map_all() give a read access. So we can't write randomized data to the file (PROT_READ). -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] Segfault
Hi, == e_fm_op.c l.984 == if dst = NULL, strlen() sefaults. Here is a patch. --- e_fm_op.c Sat Sep 22 13:31:24 2012 +++ e_fm_op.c Sat Sep 22 13:31:19 2012 @@ -980,6 +980,8 @@ int size, src_len, dst_len; int ret = 0; + if (!dst) return; + src_len = strlen(src); dst_len = strlen(dst); -- How fast is your code? 3 out of 4 devs don\\\'t know how their code performs in production. Find out how slow your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219672;13503038;z? http://info.appdynamics.com/FreeJavaPerformanceDownload.html___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] e_malloc ?
Le 04/09/2012 01:54, Carsten Haitzler (The Rasterman) a écrit : agreed. if u abort() or segv() it makes little difference. for small data structs (linked list nodes for example) its VERY hard to recover sensibly from such an out-of-memory situation. but for large allocs its perfectly possible. a blanket abort on fail is bad. really bad. ESPECIALLY for a wm. we try and recover in a lot of cases. but there is a lot of allocation going on. also the same crash happens when you run out of stack space - no way to recover or detect actually... Ok, so what will we do for all unchecked calls to malloc, calloc, realloc(), [...] ? -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] e_malloc ?
Hi, in a lot of files, we use calloc(), malloc(), realloc(), ... Wouldn't it be good to have stuffs like g_malloc() which aborts when it cannot allocate memory ? Because there are a lot of un-null-checked calls, which could be problematic... -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] Int occupation
Hi, in src/bin/e_widget_check.c, the structure E_Widget_Data has 'int *valptr'. If I'm not mistaken, it's just used as boolean (true or false). So why not use Eina_Bool or anything else 'smaller' ? In e_fm_prop.c, for example, all int could be Eina_Bool; and if i'm not mistaken again, it takes less memory than int. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Int occupation
Le 02/09/2012 13:20, Daniel Juyung Seo a écrit : It looks like valptr is not always boolean. You can set int value to the check object. So it's int rather than Eina_Bool. But yes, most of cases it is used as if it was a boolean. Anybody has a historical idea on this? Daniel Juyung Seo (SeoZ) Mmhhh... In e_widget_check.c, i don't see where valptr isn't a boolean. Yes, argument passed to e_widget_check_add() is int, but as it's used as boolean, we also could replace all call to e_widget_check_add() to pass an Eina_Bool. It implies a lot of changes... but it uses less memory. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] Overflow ?
Le 22/08/2012 05:27, Carsten Haitzler (The Rasterman) a écrit : On Tue, 21 Aug 2012 18:01:05 +0200 rustyBSD rusty...@gmx.fr said: Hi, == e/src/modules/illume-keyboard/e_kbd_int.c == line 972: if (sscanf(buf, %4000s, str) != 1) continue; str is declared like this: char str[PATH_MAX]; Here, if PATH_MAX is 4000, it could overflow. On my bsd, PATH_MAX is 1024, and I get a warning. Idem at line 1015 and 1030. ok- fixed buffer. :) Forgot line 1015: char label[PATH_MAX]; if (sscanf(buf, %*s %4000s, label) != 1) continue; -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] Double define
Hi, == src/modules/conf_theme/e_int_config_color_classes.c == l. 235: OpenBSD's ctype.h already defines _X. ( http://ftp.cc.uoc.gr/mirrors/OpenBSD/src/include/ctype.h ) So we should use another name. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] desklock vuln
== src/bin/e_desklock.c == during auth, user's password may be written to disk (core dump). To avoid that, the solution is to limit core file size to 0 with|| setrlimit(). The problem is that once set to 0, the file size can't be raised; so we can't reset the size to the value it was before. Here is a little patch. Ok or not ? --- e_desklock.c 2012-08-22 12:45:13.650831422 +0200 +++ e_desklock.c 2012-08-22 12:43:46.449291918 +0200 @@ -196,6 +196,11 @@ E_Manager *man; int total_zone_num; E_Event_Desklock *ev; + struct rlimit limit; + + limit.rlim_cur = limit.rlim_max = 0; + if (setrlimit(RLIMIT_CORE, limit) != 0) + printf(ERROR: unable to set core limit: %s\n, strerror(errno)); if (_e_custom_desklock_exe) return 0; -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [e] desklock vuln
Le 22/08/2012 14:12, Tom Hacohen a écrit : On 22/08/12 15:04, Carsten Haitzler (The Rasterman) wrote: On Wed, 22 Aug 2012 14:54:30 +0300 Tom Hacohen tom.haco...@samsung.com said: On 22/08/12 14:51, Carsten Haitzler (The Rasterman) wrote: On Wed, 22 Aug 2012 14:46:50 +0300 Tom Hacohen tom.haco...@samsung.com said: To be honest, I don't know how secure we can get there because of entry. We only free (without explicitly erasing) the buffers used internally by entry (elm+edje) and textblock, so there might be cleartext copies of the pass in memory anyway... it doesnt use elm or edje entry or e entry.. its literally done by hand listening to keystrokes (whihc frankly if u can force coredumps u can divine the passwd thru keystroke memory history if u are lucky). :) So not entry, but it uses text/textblock to show the text, doesn't it? If so, the same logic applies. it only shows * so i guess u could find out how many chars the pw has.. that's it. evas only ever sees *** (and edje too). Ah, you are right. I remembered it had issues with handling hebrew passwords (it showed as many * as the bytes instead of the chars), but it's because the count was wrong, not a malfunction in edje/textblock. Now I remember. :) Ok, cool. -- Tom. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel https://www.securecoding.cert.org/confluence/display/seccode/MSC06-C.+Be+aware+of+compiler+optimization+when+dealing+with+sensitive+data Mmhhh... -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [e] useless operation
== src/bin/e_fm_op.c == l. 234 277: we are trying to createa symlink by using symlink(), and if it fails, we create a task which does exactly the same thing, but handles overwrite. Wouldn't it be better to directly create the task ? -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [PATCH] e_fm_op.c
Hi, 1. _e_fm_op_copy_link() 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. 2. _e_fm_op_symlink_atom() Just added overwrite handling. Maxime --- e_fm_op.c 2012-08-09 11:52:49.0 +0200 +++ e_fm_op.c 2012-08-12 12:46:32.846978686 +0200 @@ -1191,7 +1191,6 @@ task-dst.done += task-src.st.st_size; _e_fm_op_update_progress(task, task-src.st.st_size, 0); - _e_fm_op_copy_stat_info(task); task-finished = 1; @@ -1522,11 +1521,22 @@ _e_fm_op_symlink_atom(E_Fm_Op_Task *task) { if (_e_fm_op_abort) return 1; + if (_e_fm_op_handle_overwrite(task)) return 1; E_FM_OP_DEBUG(Symlink: %s - %s\n, task-src.name, task-dst.name); if (symlink(task-src.name, task-dst.name) != 0) - _E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot create link from '%s' to '%s': %s., task-src.name, task-dst.name); + { +if (errno == EEXIST) + { + if (unlink(task-dst.name) == -1) + _E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot unlink '%s': %s., task-dst.name); + if (symlink(task-src.name, task-dst.name) == -1) + _E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot create link from '%s' to '%s': %s., task-src.name, task-dst.name); + } +else + _E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot create link from '%s' to '%s': %s., task-src.name, task-dst.name); + } task-dst.done += REMOVECHUNKSIZE; _e_fm_op_update_progress(task, REMOVECHUNKSIZE, 0); -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] malloc()
Hi, == e/src/bin/e_fm.c == line 9261 - _e_fm_retry_abort_dialog(int pid, const char *str) There is no check if malloc() fails. Should add if (!id) return NULL; after id = malloc(sizeof(int));. It avoids null pointer dereference. Same problem in _e_fm_overwrite_dialog(int pid, const char *str) _e_fm_error_dialog(int pid, const char *str) _e_fm_string_append_char(char *str, size_t *size, size_t *len, char c) _e_fm2_typebuf_complete(Evas_Object *obj) Maxime -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] free() - FREE()
Hi, In e/src/bin/e_fm_op.c, free() is used. Should replace all free() by FREE(), as free() doesn't do p = NULL. FREE() avoids dangling pointers. Maxime -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] fopen() - fclose()
Hi, quick thing: === e/src/modules/wizard/page_080.c === line 18 - EAPI int wizard_page_show(E_Wizard_Page *pg __UNUSED__) Two fopen(), but one fclose(). Should add fclose(fin); before return 0; . Maxime -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] prop window
Hi, here is a patch which fixes some things of FIXME in file e_fm_prop.c. I added: - exec permission / group permission - location (dir) - last modified permission - last accessed date - occuped blocks on disk - notification of broken symlink I fixed size of icon (which was malformed). I also fixed some typos in comm... All seems to be ok. Maxime --- e_fm_prop.c 2012-07-28 18:21:44.746607343 +0200 +++ e_fm_prop.c 2012-07-28 18:13:36.0 +0200 @@ -5,6 +5,7 @@ * basic - * + show file * + show size + * + show last access date * + show modified date * + show mimetype * + show permissions (others read, others write) @@ -12,19 +13,18 @@ * + show owner * + show icon * * show symlink/fifo/socket/etc. status - * * show broken link status + * + show broken link status * + change icon for mime type * * change icon for just this file - * + change permissions (others read, others write) + * + change permissions * * advanced (extra) - - * * show access date * * show change date * * show comment * * show generic * * show mount status * * show setuid bit - * * show link destination (if symlink or link) + * + show link destination (if symlink or link) * * show group * * change link destination * * change app to open THIS file with (or dir) @@ -49,7 +49,7 @@ static void _cb_fsel_ok(void *data, E_Dialog *dia); static void _cb_fsel_cancel(void *data, E_Dialog *dia); -/* Actual config data we will be playing with whil the dialog is active */ +/* Actual config data we will be playing with while the dialog is active */ struct _E_Config_Dialog_Data { E_Fm2_Icon *ic; @@ -64,16 +64,25 @@ } gui; /*- BASIC -*/ char*file; + char*location; char*size; char*mod_date; + char*acc_date; + char*pms_date; char*mime; char*owner; char*link; char*plink; + char*blocks; int owner_read; int owner_write; + int owner_exec; int others_read; int others_write; + int others_exec; + int group_read; + int group_write; + int group_exec; int picon_type; int picon_mime; int picon_changed; @@ -101,7 +110,7 @@ v-advanced.apply_cfdata = _advanced_apply_data; v-advanced.create_widgets = _advanced_create_widgets; #endif - /* create config diaolg for NULL object/data */ + /* create config dialog for NULL object/data */ cfd = e_config_dialog_new(con, _(File Properties), E, _fm_prop, @@ -113,6 +122,8 @@ static void _fill_data(E_Config_Dialog_Data *cfdata, E_Fm2_Icon *ic) { + char loc[PATH_MAX]; + char blks[256]; struct passwd *pw; cfdata-ic = ic; @@ -120,15 +131,29 @@ if (cfdata-fi-file) cfdata-file = strdup(cfdata-fi-file); cfdata-size = e_util_size_string_get(cfdata-fi-statinfo.st_size); cfdata-mod_date = e_util_file_time_get(cfdata-fi-statinfo.st_mtime); + cfdata-acc_date = e_util_file_time_get(cfdata-fi-statinfo.st_atime); + cfdata-pms_date = e_util_file_time_get(cfdata-fi-statinfo.st_ctime); if (cfdata-fi-mime) cfdata-mime = strdup(cfdata-fi-mime); + + snprintf(blks,sizeof(blks),%d,cfdata-fi-statinfo.st_blocks); + cfdata-blocks = strdup(blks); + + snprintf(loc, sizeof(loc), %s, e_fm2_real_path_get(cfdata-fi-fm)); + cfdata-location = strdup(loc); + pw = getpwuid(cfdata-fi-statinfo.st_uid); if (pw) cfdata-owner = strdup(pw-pw_name); if (cfdata-fi-link) cfdata-link = strdup(cfdata-fi-link); if (cfdata-fi-link) cfdata-plink = strdup(cfdata-fi-link); if (cfdata-fi-statinfo.st_mode S_IRUSR) cfdata-owner_read = 1; if (cfdata-fi-statinfo.st_mode S_IWUSR) cfdata-owner_write = 1; + if (cfdata-fi-statinfo.st_mode S_IEXEC) cfdata-owner_exec = 1; if (cfdata-fi-statinfo.st_mode S_IROTH) cfdata-others_read = 1; if (cfdata-fi-statinfo.st_mode S_IWOTH) cfdata-others_write = 1; + if (cfdata-fi-statinfo.st_mode S_IXOTH) cfdata-others_exec = 1; + if (cfdata-fi-statinfo.st_mode S_IRGRP) cfdata-group_read = 1; + if (cfdata-fi-statinfo.st_mode S_IWGRP) cfdata-group_write = 1; + if (cfdata-fi-statinfo.st_mode S_IXGRP) cfdata-group_exec = 1; } static void * @@ -151,8 +176,12 @@ if (cfdata-gui.fsel) e_object_del(E_OBJECT(cfdata-gui.fsel)); E_FREE(cfdata-file); + E_FREE(cfdata-location); E_FREE(cfdata-size); + E_FREE(cfdata-blocks); E_FREE(cfdata-mod_date); + E_FREE(cfdata-acc_date); + E_FREE(cfdata-pms_date); E_FREE(cfdata-mime); E_FREE(cfdata-owner); E_FREE(cfdata-link); @@ -169,7 +198,7 @@ int fperm = 0; snprintf(buf, sizeof(buf), %s/%s, -e_fm2_real_path_get(cfdata-fi-fm), cfdata-fi-file); +
Re: [E-devel] Race condition
here i disagree. 1. if we copy a file as its downloading - we want to get the rest of the file that was appended to after the copy began, if we can. 2. try this with cp. cp behaves like efm. if you're telling me this is a security issue.. then it's a security issue in cp too.. and been there for a loong time. :) (i tested it) :) 3. this is only an issue if write rates to file 1 can exceed those to file 2. 4. it cant be going on forever as eventually filesystem fills up and first file stops filling up. :) Ok. Do as you want. I think this is more 'clean' to copy only the size of the file. I keep this for me. 1. your check for type wont detect if inode/mode etc. etc. etc. match which is actually possible given symlink vs dest file. :) so you still have your race. it's just a bit more selective 2. the solution to this is actually to unlink then open with O_CREAT|O_EXCL. :) or.. O_NOFOLLOW (freebsd extn also supported in linux) :) also throw in O_TRUNC as that's what we want in the above open will fail if someone slipped in a file or symlink in between 1. I don't very understand what you're telling me. If we replace the file by a symlink, _it is detected_. I hope this is clearer: https://www.securecoding.cert.org/confluence/display/seccode/POS35-C.+Avoid+race+conditions+while+checking+for+the+existence+of+a+symbolic+link 2. Mmhhh... Strange solution. It erases data. And I already open file with O_WRONLY | O_CREAT | O_EXCL , so if file already exists, it launches a dialog telling this (even if it's a symlink), instead of simply erase data by using unlink(). Maxime PS: I leave my home for ~2 weeks, and I'm not sure I will have internet where I go. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] Race condition
Hi, I was told that I have to explain race conditions I found. I. Copy file bytes It concerns 'e_fm_op.c.diff1'. When copying a file, the dest file is written with bytes read from source file. It only stops when we are at the end of the source file. The problem is that you just have to launch a program like this: #include stdio.h #include stdlib.h #include string.h int main() { char buf[] = a; FILE* f = fopen(file.txt, wb); if (f) { while(1) fwrite(buf, sizeof(buf), 1, f); } fclose(f); } And then right-click-copy 'file.txt' to another place to cause e to indefinitly copy the file (as it never arrives to the end of the file). This point is not discutable. When you copy a file, you ONLY must copy n bytes (got by xx.st_size) of source file. It's like in file transfer. You get size of file, you split it in blocks and send them, and you recalculate the size of the last block to have sent exactly the bytes of file. Otherwise, you can flood the server. Quick ex: block size - 100 b got file size - 246 b So: copy 100 b copy 100 b copy 46 b That's it. The file is copied at its original size, even if it has changed since the copy has been started. II. Copy file (2 race conditions) When copying a simple file, we do: 1. check type of file with stat(). 2. if dest file doesn't exist -- 2.1 if file is a regular file, then copy. -- 2.2 ... 3. else: ask for overwrite There is a TOCTOU. Betwenn 2 and 3, you just have to replace the file by a symlink to make the copy copy the file pointed by the link. Between 1 and 2, you just have to create a symlink to the destination, to make the copy copy the source file in the file pointed by the symlink. You can test: - add 'sleep(10);' to the line 1231 of 'e_fm_op.c' - copy a file to an empty folder - create quickly a symlink in the dest folder with the same name of the file which will be copied, pointing to another file - wait... and then, check the file pointed by the symlink: its content has been overwritten by the source file of the copy Now, keep the sleep(), apply all patches joined to this mail, and retry. You will see that e doesn't copy file, because it detects that file type has been changed. I was also told that my patches are causing problems and that there are no race condition (although if you test, you will see that there are), so I'm waiting for the response of raster to know what problem(s) it causes. Maxime. --- e_fm/e_fm_ipc.c 2012-07-22 16:47:04.0 +0200 +++ e_fm/e_fm_ipc.c 2012-07-22 17:05:43.138103151 +0200 @@ -1087,7 +1087,7 @@ // printf(MOD %s %3.3f\n, path, ecore_time_unix_get()); lnk = ecore_file_readlink(path); memset(st, 0, sizeof(struct stat)); - if (stat(path, st) == -1) + if (lstat(path, st) == -1) { if ((path[0] == 0) || (lnk)) broken_lnk = 1; else return; --- e_fm_op.c 2012-07-22 17:02:46.0 +0200 +++ e_fm_op.c 2012-07-22 17:14:15.19933 +0200 @@ -33,6 +33,8 @@ #include errno.h #include limits.h +#include fcntl.h + #include Ecore.h #include Ecore_File.h @@ -81,6 +83,7 @@ static int _e_fm_op_copy_link(E_Fm_Op_Task *task); static int _e_fm_op_copy_fifo(E_Fm_Op_Task *task); static int _e_fm_op_open_files(E_Fm_Op_Task *task); +static int _e_fm_op_check_race(E_Fm_Op_Task *task); static int _e_fm_op_copy_chunk(E_Fm_Op_Task *task); static int _e_fm_op_copy_atom(E_Fm_Op_Task *task); @@ -118,6 +121,7 @@ { const char *name; struct stat st; + struct stat st_fs; } src; struct @@ -1228,6 +1232,8 @@ _e_fm_op_open_files(E_Fm_Op_Task *task) { E_Fm_Op_Copy_Data *data = task-data; + int fd_from; + int fd_to; /* Ordinary file. */ if (!data) @@ -1240,14 +1246,43 @@ if (!data-from) { -data-from = fopen(task-src.name, rb); +fd_from = open(task-src.name, O_RDONLY); +if(fd_from == -1) + { +_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot open file '%s' for reading: %s., task-src.name); + } + +data-from = fdopen(fd_from, rb); if (!data-from) _E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot open file '%s' for reading: %s., task-src.name); + +if (fstat(fd_from, task-src.st_fs) == -1) + { +_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot fstat() file '%s'., task-src.name); + } + +if (_e_fm_op_check_race(task)) + { +fclose(data-from); +data-from = NULL; + +FREE(task-data); + +task-finished = 1; + +return 1; + } } if (!data-to) { -data-to = fopen(task-dst.name, wb); +fd_to = open(task-dst.name, O_WRONLY | O_CREAT | O_EXCL); +if(fd_to == -1) + { +_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot open file '%s' for
Re: [E-devel] [patch] Link copying fix
Strange thing you are telling me. $ svn update -r 74262 # just before my patch was committed ... $ ln -s /home link1 $ ln -s /home link2 right-click on link1 - copy to an empty folder right-click on link2 - copy to the same folder Annnd... File already exists. Of course, if you test with the actual svn revision, you can't see this problem. (And it's not a bug, just a misconception.) Le 23/07/2012 09:57, Carsten Haitzler (The Rasterman) a écrit : On Fri, 20 Jul 2012 22:43:21 +0200 rustyBSD rusty...@gmx.fr said: (re)Hi, 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. Here is a patch which corrects this. I also found other problems and bugs in file managing; I will look at it tomorrow. ps: I don't have svn commit access. i don't know about you.. but i'm happily copying a dir with 2 symlinks pointing to the same file. with efm. slight issue. it seems to make the file pointed to have the same perms as the symlinks. :) but if only 1 file points to it even. nb your patch also leaks memory. you don't free lnk_path or dst_dir - both of which are alloced. you recompose dst_path when task-desk.name is sufficient to use. also using ecore_readlink instead of readlink - fine, but i'm failing to see the bug you're fixing :( it does the exact same work, just using ecore calls... hmm looking at svn someone has committed half your patch with leaks fixed, but i'm failing to see the bug fix ? :) -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] [Enlightenment-intl] problem with contributions from batden
I'm French, and I also noticed a lot of spelling mistakes. I can retranslate if you want. Le 20/07/2012 11:46, Carsten Haitzler (The Rasterman) a écrit : On Wed, 11 Jul 2012 21:30:50 +0200 Chidambar 'ilLogict' Zinnoury illog...@online.fr said: still waiting on a reply from batden here. i'll give it another week before weighing in. Hi all. I'm reluctantly writing today to discuss a problem currently happening with Philippe Guillaumie (batden) and the French translation. I'm not sending this light-hearted, but because my attempts to communicate with him failed: I'm still waiting for a reply to my e-mail, and he's nowhere to be seen on IRC. A little bit over a month ago, a colleague of mine came to me to tell me about the poor state of the French translation in Enlightenment: some strings were undecipherable, whereas some were completely misleading and made him do wrong actions (especially Reboot and Restart Enlightenment). I then had a quick look a the file, which made me awe in shock by seeing the orthography and grammar mistakes, and moreover the poorly worded and syntaxed sentences (even on strings I happened to translate years ago!) They were certainly not up to the quality that could be expected. I thus made a quick fix for some strings (especially Reboot and friends), and changed at the same time the team's address back to enlightenment-intl from his own, as I felt it should be: a single individual (who moreover doesn't have commit access) shouldn't be the sole recipient of messages that are for the team. Oh that pissed him off. He addressed some messages to me on #e.fr (connecting, sending message, disconnecting, thus preventing any discussion from happening), stating that I had no right to commit without his permission, had to go through him, that it was how it worked and was non-negociable and that the team address was his because he was in charge of it. As I had no chance to discuss, as he was always disconnecting right after sending those messages, I sent him an e-mail, expressing my points of view: that I had right to contribute French translations, that being in my area of expertise, that never did he or anyone state that he was in charge and everything had to go through him, and the thing about the team address I stated before. I'm still waiting for a reply. The next day, he came to #e.fr, stating my inappropriate commit broke the system control dialog. Vincent and I replied that translations weren't to circumvent theme bugs, thanking him for the report: I said I'd have a look at it (true, I have yet to do that, completely forgot about it), which made him reply that he was doing something better: giving me charge of the translation, leaving immediately the project, and disconnected. For the record, everybody on #e.fr had been pretty stunned by his reaction. I committed a few days later a huge change, correcting many strings, but still leaving many untouched, as I felt I'd better be doing some code, and that translation could wait a little bit. Fast-forward to earlier this week, when he sent a new PO file to e-intl. I was actually pretty happy about it, until I had a look at the contents. All my corrections were gone. Everything was back to how they were before: hi again spelling and grammar mistakes, and welcome back poorly-worded sentences, which, for a nitpicker and perfectionist like I tend to be, are blood-tearing. I thus asked on #edevelop for people not to commit it, and sent an e-mail to Massimo stating the same (he did commit it anyway). I sent an e-mail to Philippe, stating that while I was happy he wanted to be part of the project again, I was wondering why he reverted all my changes. As expected, I have yet to hear back from him. I didn't want to revert, as I feel there's no need to play who's the most childish. After discussing with others, conclusion was that best thing to do was to go public, as I have yet to hear anything from him, hence this pretty long message. I'm hoping that Philippe will finally come out of his mutism and state what he has to say. Thank you for reading. Cheers! Chidambar -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Enlightenment-intl mailing list enlightenment-i...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-intl -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has
[E-devel] Possible vulnerability in fm
Hi, the 'e_fm_op.c' file uses readlink() function, which doesn't close path char at end. In this code: size_t len; char path[PATH_MAX]; len = readlink(task-src.name, path[0], PATH_MAX); path[len] = 0; the '\0' is placed one byte past the end of path[], so if path[] is equal or up to PATH_MAX, the null byte overflows. Moreover, if readlink fails it returns -1, and it makes an underflow (path[-1] = 0). The correct use should be: size_t len; char path[PATH_MAX]; if(len = readlink(task-src.name, path[0], PATH_MAX-1) != -1); path[len] = '\0'; If my memory is good, it was an old vulnerability in linux kernel. Maxime -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [patch] Link copying fix
(re)Hi, 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. Here is a patch which corrects this. I also found other problems and bugs in file managing; I will look at it tomorrow. ps: I don't have svn commit access. Thanks, Maxime --- e_fm_op.c 2012-07-20 20:34:03.0 +0200 +++ e_fm_op.c 2012-07-20 21:09:15.828917681 +0200 @@ -1163,29 +1163,37 @@ static int _e_fm_op_copy_link(E_Fm_Op_Task *task) { - int len; - char path[PATH_MAX]; + char dst_path[PATH_MAX]; + char *dst_dir, *lnk_path; + const char *dst_name; - len = readlink(task-src.name, path, sizeof(path) - 1); - if (len 0) + lnk_path = ecore_file_readlink(task-src.name); + if (!lnk_path) { _E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot read link '%s'., task-src.name); } else { -path[len] = 0; +dst_dir = ecore_file_dir_get(task-dst.name); +dst_name = ecore_file_file_get(task-src.name); -if (symlink(path, task-dst.name) != 0) +if ((strlen(dst_dir)+strlen(dst_name)) = PATH_MAX) + _E_FM_OP_ERROR_SEND_WORK(task, 0, Not copying: path too long, dst_path); + +snprintf(dst_path, sizeof(dst_path), %s/%s, dst_dir, dst_name); +E_FM_OP_DEBUG(Creating link from '%s' to '%s'\n, lnk_path, dst_path); + +if (symlink(lnk_path, dst_path) != 0) { if (errno == EEXIST) { - if (unlink(task-dst.name) == -1) -_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot unlink '%s': %s., task-dst.name); - if (symlink(path, task-dst.name) == -1) -_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot create link from '%s' to '%s': %s., path, task-dst.name); + if (unlink(dst_path) == -1) +_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot unlink '%s': %s., dst_path); + if (symlink(lnk_path, dst_path) == -1) +_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot create link from '%s' to '%s': %s., lnk_path, dst_path); } else - _E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot create link from '%s' to '%s': %s., path, task-dst.name); + _E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, Cannot create link from '%s' to '%s': %s., lnk_path, dst_path); } } task-dst.done += task-src.st.st_size; -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] [PATCH] e/src/bin/e_fm_prop.c
(re)Hi, I added time of last access in file properties. Here is a patch. It works for me, but i'm not familiar with the API, so if someone could review it... Thanks, Maxime --- e_fm_prop.c.orig 2012-07-18 15:13:42.0 +0200 +++ e_fm_prop.c 2012-07-18 15:53:28.080852267 +0200 @@ -49,7 +49,7 @@ static void _cb_fsel_ok(void *data, E_Dialog *dia); static void _cb_fsel_cancel(void *data, E_Dialog *dia); -/* Actual config data we will be playing with whil the dialog is active */ +/* Actual config data we will be playing with while the dialog is active */ struct _E_Config_Dialog_Data { E_Fm2_Icon *ic; @@ -66,6 +66,7 @@ char*file; char*size; char*mod_date; + char*acc_date; char*mime; char*owner; char*link; @@ -101,7 +102,7 @@ v-advanced.apply_cfdata = _advanced_apply_data; v-advanced.create_widgets = _advanced_create_widgets; #endif - /* create config diaolg for NULL object/data */ + /* create config dialog for NULL object/data */ cfd = e_config_dialog_new(con, _(File Properties), E, _fm_prop, @@ -120,6 +121,7 @@ if (cfdata-fi-file) cfdata-file = strdup(cfdata-fi-file); cfdata-size = e_util_size_string_get(cfdata-fi-statinfo.st_size); cfdata-mod_date = e_util_file_time_get(cfdata-fi-statinfo.st_mtime); + cfdata-acc_date = e_util_file_time_get(cfdata-fi-statinfo.st_atime); if (cfdata-fi-mime) cfdata-mime = strdup(cfdata-fi-mime); pw = getpwuid(cfdata-fi-statinfo.st_uid); if (pw) cfdata-owner = strdup(pw-pw_name); @@ -153,6 +155,7 @@ E_FREE(cfdata-file); E_FREE(cfdata-size); E_FREE(cfdata-mod_date); + E_FREE(cfdata-acc_date); E_FREE(cfdata-mime); E_FREE(cfdata-owner); E_FREE(cfdata-link); @@ -345,20 +348,27 @@ e_widget_entry_readonly_set(ob, 1); e_widget_table_object_append(ot, ob, 1, 1, 1, 1, 1, 0, 1, 0); - ob = e_widget_label_add(evas, _(Last Modified:)); + ob = e_widget_label_add(evas, _(Last Accessed:)); e_widget_table_object_append(ot, ob, 0, 2, 1, 1, 1, 0, 1, 0); - ob = e_widget_entry_add(evas, (cfdata-mod_date), NULL, NULL, NULL); + ob = e_widget_entry_add(evas, (cfdata-acc_date), NULL, NULL, NULL); e_widget_size_min_set(ob, 140, -1); e_widget_entry_readonly_set(ob, 1); e_widget_table_object_append(ot, ob, 1, 2, 1, 1, 1, 0, 1, 0); - ob = e_widget_label_add(evas, _(File Type:)); + ob = e_widget_label_add(evas, _(Last Modified:)); e_widget_table_object_append(ot, ob, 0, 3, 1, 1, 1, 0, 1, 0); - ob = e_widget_entry_add(evas, (cfdata-mime), NULL, NULL, NULL); + ob = e_widget_entry_add(evas, (cfdata-mod_date), NULL, NULL, NULL); e_widget_size_min_set(ob, 140, -1); e_widget_entry_readonly_set(ob, 1); e_widget_table_object_append(ot, ob, 1, 3, 1, 1, 1, 0, 1, 0); + ob = e_widget_label_add(evas, _(File Type:)); + e_widget_table_object_append(ot, ob, 0, 4, 1, 1, 1, 0, 1, 0); + ob = e_widget_entry_add(evas, (cfdata-mime), NULL, NULL, NULL); + e_widget_size_min_set(ob, 140, -1); + e_widget_entry_readonly_set(ob, 1); + e_widget_table_object_append(ot, ob, 1, 4, 1, 1, 1, 0, 1, 0); + of = e_widget_frametable_add(evas, _(Permissions), 0); ob = e_widget_label_add(evas, _(Owner:)); e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 1); @@ -374,7 +384,7 @@ e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 1, 1); ob = e_widget_check_add(evas, _(Owner can write), (cfdata-owner_write)); e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 1, 1, 1); - e_widget_table_object_append(ot, of, 0, 4, 2, 1, 1, 0, 1, 0); + e_widget_table_object_append(ot, of, 0, 5, 2, 1, 1, 0, 1, 0); e_widget_table_object_append(o, ot, 0, 0, 1, 1, 1, 1, 1, 1); -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel