Re: [E-devel] New patch for entranced and entrance

2006-08-30 Thread Essien Ita Essien


Eugen Minciu wrote:
> Hi, here's another patch for entrance.
>
> OK, I've done this acccording to what raster told me, I hope I
> understood these things properly.
>
> 1) A shell should be run, so the users's profile is loaded. After
> thinking about it, this is a great idea indeed, this way if I have a
> ~/bin in my PATH my wm can run those applications directly (no strings
> attatched) and it's the right thing to do.
>
> 2) The first attempted shell should be the users's shell. This is
> almost guaranteed to have -l. We only try to run this if the shell
> isn't "".
>
> 3) We run /bin/sh -l. If the users's shell with a '-l' didn't work
> (maybe because it was uninstalled or something) we may get to this point.
>
> 4) If the above didn't work, we log a warning message and try to run
> "/bin/sh" without -l anyway. Note that the users's PATH, will probably
> not be setup properly in this case (at least for me programs in
> /usr/local/bin weren't available with the run thingie and my eapps in
> the favorite applications menu were missing)
>
> Oh, btw does the run thingie have a name so I can stop calling it the
> run thingie? :)
Ofcourse the run thingie has a name silly... its called the... uhmm...
uhmmm... run thingie? ;)
>
> 5) If the above failed as well (the user's shell is uninstalled and
> /bin/sh was linking to it or whatever) we log an error message and cry
> :((
>
> Some things that should me noted about my patch
> 1) As before, X isn't started through a shell anymore. The cmdline is
> parsed and executed directly, since this was desired.
>
> 2) I've cleaned up the code in entrance_session_start_user_session if
> a few ways.
> a) there was a 'shell' variable which wasn't getting used. I found a
> good use for it.
> b) the current code is structured in a weird way imho. The call to
> execl() is outside the fork switch, so, somehow, it would call the
> session in the child pid and recall entrance_login in the parent pid.
>
> Why would we want to do that? X will restart and entrance_login will
> get called again anyway, when the program exits.
>
> In my patch, the parent calls wait(), holding its pants on until the
> child's session ends. No more sleep(), less code in the function and
> things look a bit more normal().
>
> 3) In _entrance_session_execute_in_shell, each shell is called inside
> a fork, and waited for by the parent process. This is done so we can
> catch errors like 'sh: Illegal option -l'. Is this in any way wrong?
>
> 4) Oh, and ecore_x_shutdown(); and ecore_shutdown() are being called
> now, just like the TODO says.
>
> 5) I've tested it in three ways.
> - working user shell
> - user shell not working, sh is a login shell
> - user shell not working, sh is not a login shell.
> Everything went well in all these circumstances.
>
>
> That's about it. Is this one any good?
oi! Patch looks visually good to me... I'll proceed with aforementioned
testing :)
Really good work. Thnx a mill.
> Cheers,
> Eugen.
>
> PS: Congrats Essien for changing the session handling. It works great now.
goodie! We're getting close to actual usability now :)
>
>
> On 8/29/06, *The Rasterman Carsten Haitzler* <[EMAIL PROTECTED]
> > wrote:

> +
> +   /* If /bin/sh isn't a login shell run /bin/sh without loading the profile
> +* Also log a warning because this will probably not behave correctly */
>   
actually here instead of logging this quietly to syslog, we should alert
the user via an Entrance_Dialog <--this doesn't exist yet :), By the
time I move entrance_edit_gui into entrance main, we should have ways to
talk to the user. Its on the Entrance TODO too, to be able to
communicate to the user on failed sessions. I'll try to speed the work
on this up so we can also have that option.
> +   if (WEXITSTATUS(status)==2) { 
> +  syslog(LOG_NOTICE, "Neither '%s' or '/bin/sh' are working login shells 
> for user '%s'. Your session may not function properly. ",shell,user);
> +  switch(pid=fork()) {
> +  case 0:
> + execl("/bin/sh", "/bin/sh", "-c", buf, NULL);
> +  break;
> +   case -1:
> +   return;
> +   default:
> +   wait(&status);
> +   break;
> +  }
> +   }
> +
> +   /* Damn, that didn't work either.
> +* Bye! We call it quits and log an error */
> +   if (WEXITSTATUS(status)==2) {
> +  syslog(LOG_CRIT, "Entrance could not find a working shell to start the 
> session for user: \"%s\".",user);
> +   }
> +}
> Index: src/daemon/entranced_display.c
> ===
> RCS file: /var/cvs/e/e17/apps/entrance/src/daemon/entranced_display.c,v
> retrieving revision 1.2
> diff -u -r1.2 entranced_display.c
> --- src/daemon/entranced_display.c1 Aug 2006 05:30:58 -   1.2
> +++ src/daemon/entranced_display.c30 Aug 2006 08:44:28 -
> @@ -124,6 +124,11 @@
> double start_time;
> char x_cmd[PATH_MAX];
>  
> +   int i;
> +   char *x_cmd_argv[32]; 
> +
> +   for (i=0;i<3

Re: [E-devel] New patch for entranced and entrance

2006-08-30 Thread Eugen Minciu
Hi, here's another patch for entrance.OK, I've done this acccording to what raster told me, I hope  I understood these things properly.1) A shell should be run, so the users's profile is loaded. After thinking about it, this is a great idea indeed, this way if I have a ~/bin in my PATH my wm can run those applications directly (no strings attatched) and it's the right thing to do.
2) The first attempted shell should be the users's shell. This is almost guaranteed to have -l. We only try to run this if the shell isn't "".3) We run /bin/sh -l. If the users's shell with a '-l' didn't work (maybe because it was uninstalled or something) we may get to this point.
4) If the above didn't work, we log a warning message and try to run "/bin/sh" without -l anyway. Note that the users's PATH, will probably not be setup properly in this case (at least for me programs in /usr/local/bin weren't available with the run thingie and my eapps in the favorite applications menu were missing)
Oh, btw does the run thingie have a name so I can stop calling it the run thingie? :)5) If the above failed as well (the user's shell is uninstalled and /bin/sh was linking to it or whatever) we log an error message and cry :((
Some things that should me noted about my patch1) As before, X isn't started through a shell anymore. The cmdline is parsed and executed directly, since this was desired.2) I've cleaned up the code in entrance_session_start_user_session if a few ways.
 a) there was a 'shell' variable which wasn't getting used. I found a good use for it.  b) the current code is structured in a weird way imho. The call to execl() is outside the fork switch, so, somehow, it would call the session in the child pid  and recall entrance_login in the parent pid.
Why would we want to do that? X will restart and entrance_login will get called again anyway, when the program exits.In my patch, the parent calls wait(), holding its pants on until the child's session ends. No more sleep(), less code in the function and things look a bit more normal().
3) In _entrance_session_execute_in_shell, each shell is called inside a fork, and waited for by the parent process. This is done so we can catch errors like 'sh: Illegal option -l'. Is this in any way wrong?

4)  Oh,  and ecore_x_shutdown(); and ecore_shutdown() are being called now, just like the TODO says.5) I've tested it in three ways. - working user shell - user shell not working, sh is a login shell - user shell not working, sh is not a login shell.
Everything went well in all these circumstances.That's about it. Is this one any good?Cheers,Eugen.PS: Congrats Essien for changing the session handling. It works great now. 

On 8/29/06, The Rasterman Carsten Haitzler <[EMAIL PROTECTED]> wrote:

On Tue, 29 Aug 2006 06:12:47 +0200 Sebastian Dransfeld <[EMAIL PROTECTED]>babbled:> Carsten Haitzler (The Rasterman) wrote:
> > On Mon, 28 Aug 2006 16:55:19 +0200 Sebastian Dransfeld
> > <[EMAIL PROTECTED]> babbled:> >> >> Eugen Minciu wrote:
> >>> On Mon, 28 Aug 2006 14:29:08 +0100> >>> Essien Ita Essien <
[EMAIL PROTECTED]> wrote:>  >>> Well .. then maybe we shouldn't clearenv() in the first place? We may not
> >>> need to, since setenv(x,y,1) is called, which overwrites the var's
> >>> contents anyway. I didn't want to try it before because I suspected> >>> clearenv() was there for good reasons (and it feels right, too).>  >>> However, it's strange you should mention this .. there is:
> >>> entrance_auth_setup_environment(Entrance_Auth * e, const char *display,> >>> const char *path) so the display is sent as a paramter and it _should be_> >>> set by the function itself.
>  >>> Could you investigate this a bit further? I'm willing to try not clearenv> >>> ()> >>> - ing but it may introduce some even subtler (and weirder) problems. If
> >>> you think it shouldn't though I'll try it out later on tonight, when I've> >>> some free time on my hands.> >> clearenv must stay. The user must not inherit any environment from
> >> entrance.> >> > well- it does NEED to inherit DISPLAY... for starters. :) the problem is> > actually entrance executing enlightenment directly. no other dm does this as
> > best i know. every login session is first executed by a shell which then
> > executes the wm or session manager etc. thus the behavior issues. wm's like> > e expect to have a users environment already loaded by the time they run.> > (ie users $PATH is set and all the other goodies a user wants in their
> > SHELL)>> DISPLAY is set by entrance for the user, so I would not call it inherit> from entrance. clearenv first, then set user environment (DISPLAY++),> then launch user session in a login shell.
well the only way to set an env var in  child process is to set it before theprocess runs (either in the parent env or explicitly in the exec) :)but edoesnt magically set it itself :)--- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]裸好多

Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread The Rasterman
On Tue, 29 Aug 2006 06:12:47 +0200 Sebastian Dransfeld <[EMAIL PROTECTED]>
babbled:

> Carsten Haitzler (The Rasterman) wrote:
> > On Mon, 28 Aug 2006 16:55:19 +0200 Sebastian Dransfeld
> > <[EMAIL PROTECTED]> babbled:
> > 
> >> Eugen Minciu wrote:
> >>> On Mon, 28 Aug 2006 14:29:08 +0100
> >>> Essien Ita Essien <[EMAIL PROTECTED]> wrote:
> >>>
> >>> Well .. then maybe we shouldn't clearenv() in the first place? We may not
> >>> need to, since setenv(x,y,1) is called, which overwrites the var's
> >>> contents anyway. I didn't want to try it before because I suspected
> >>> clearenv() was there for good reasons (and it feels right, too).
> >>>
> >>> However, it's strange you should mention this .. there is:
> >>> entrance_auth_setup_environment(Entrance_Auth * e, const char *display,
> >>> const char *path) so the display is sent as a paramter and it _should be_
> >>> set by the function itself.
> >>>
> >>> Could you investigate this a bit further? I'm willing to try not clearenv
> >>> ()
> >>> - ing but it may introduce some even subtler (and weirder) problems. If
> >>> you think it shouldn't though I'll try it out later on tonight, when I've
> >>> some free time on my hands.
> >> clearenv must stay. The user must not inherit any environment from
> >> entrance.
> > 
> > well- it does NEED to inherit DISPLAY... for starters. :) the problem is
> > actually entrance executing enlightenment directly. no other dm does this as
> > best i know. every login session is first executed by a shell which then
> > executes the wm or session manager etc. thus the behavior issues. wm's like
> > e expect to have a users environment already loaded by the time they run.
> > (ie users $PATH is set and all the other goodies a user wants in their
> > SHELL)
> 
> DISPLAY is set by entrance for the user, so I would not call it inherit 
> from entrance. clearenv first, then set user environment (DISPLAY++), 
> then launch user session in a login shell.

well the only way to set an env var in  child process is to set it before the
process runs (either in the parent env or explicitly in the exec) :)but e
doesnt magically set it itself :)

-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]
裸好多
Tokyo, Japan (東京 日本)

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread Sebastian Dransfeld
Carsten Haitzler (The Rasterman) wrote:
> On Mon, 28 Aug 2006 16:55:19 +0200 Sebastian Dransfeld <[EMAIL PROTECTED]>
> babbled:
> 
>> Eugen Minciu wrote:
>>> On Mon, 28 Aug 2006 14:29:08 +0100
>>> Essien Ita Essien <[EMAIL PROTECTED]> wrote:
>>>
>>> Well .. then maybe we shouldn't clearenv() in the first place? We may not
>>> need to, since setenv(x,y,1) is called, which overwrites the var's contents
>>> anyway. I didn't want to try it before because I suspected clearenv() was
>>> there for good reasons (and it feels right, too).
>>>
>>> However, it's strange you should mention this .. there is:
>>> entrance_auth_setup_environment(Entrance_Auth * e, const char *display,
>>> const char *path) so the display is sent as a paramter and it _should be_
>>> set by the function itself.
>>>
>>> Could you investigate this a bit further? I'm willing to try not clearenv()
>>> - ing but it may introduce some even subtler (and weirder) problems. If you
>>> think it shouldn't though I'll try it out later on tonight, when I've some
>>> free time on my hands.
>> clearenv must stay. The user must not inherit any environment from entrance.
> 
> well- it does NEED to inherit DISPLAY... for starters. :) the problem is
> actually entrance executing enlightenment directly. no other dm does this as
> best i know. every login session is first executed by a shell which then
> executes the wm or session manager etc. thus the behavior issues. wm's like e
> expect to have a users environment already loaded by the time they run. (ie
> users $PATH is set and all the other goodies a user wants in their SHELL)

DISPLAY is set by entrance for the user, so I would not call it inherit 
from entrance. clearenv first, then set user environment (DISPLAY++), 
then launch user session in a login shell.

Sebastian

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread The Rasterman
On Tue, 29 Aug 2006 00:50:31 +0100 Essien Ita Essien <[EMAIL PROTECTED]>
babbled:

> Justin Patrin wrote:
> > On 8/28/06, The Rasterman Carsten Haitzler <[EMAIL PROTECTED]> wrote:
> >   
> >> On Mon, 28 Aug 2006 16:55:19 +0200 Sebastian Dransfeld
> >> <[EMAIL PROTECTED]> babbled:
> >>
> >> 
> >>> Eugen Minciu wrote:
> >>>   
>  On Mon, 28 Aug 2006 14:29:08 +0100
>  Essien Ita Essien <[EMAIL PROTECTED]> wrote:
> 
>  Well .. then maybe we shouldn't clearenv() in the first place? We may not
>  need to, since setenv(x,y,1) is called, which overwrites the var's
>  contents anyway. I didn't want to try it before because I suspected
>  clearenv() was there for good reasons (and it feels right, too).
> 
>  However, it's strange you should mention this .. there is:
>  entrance_auth_setup_environment(Entrance_Auth * e, const char *display,
>  const char *path) so the display is sent as a paramter and it _should be_
>  set by the function itself.
> 
>  Could you investigate this a bit further? I'm willing to try not clearenv
>  ()
>  - ing but it may introduce some even subtler (and weirder) problems. If
>  you think it shouldn't though I'll try it out later on tonight, when
>  I've some free time on my hands.
>  
> >>> clearenv must stay. The user must not inherit any environment from
> >>> entrance. 
> >> well- it does NEED to inherit DISPLAY... for starters. :) the problem is
> >> actually entrance executing enlightenment directly. no other dm does this
> >> as best i know. every login session is first executed by a shell which then
> >> executes the wm or session manager etc. thus the behavior issues. wm's
> >> like e expect to have a users environment already loaded by the time they
> >> run. (ie users $PATH is set and all the other goodies a user wants in
> >> their SHELL)
> >>
> >> 
> >
> > FWIW I have also modified entrance to start a shell script instead of
> > X directly for use in OpenZaurus to allow the normal X startup scripts
> > to be run.
> >
> >   
> In that case, what's the right approach here? I don't pretend to know 
> which is prefarable really. Raster, is there something unique about E 
> that necessitated Entrance to be written that way? Or would it be better 
> for E as a whole if it where changed to be more like others... roughly 
> in the direction that Justin has gone for OpenZaurus?

there is nothing unique or special about e17 that entrance needs to worry or
care about. entrance and e are entirely separate things. they are only related
in that they use the same libraries and look similar. e needs/wants nothing
special from entrance that it doesnt expect from any login manager or x launch
script/setup (ie it expects that by the time e runs the users environment is
loaded and e will inherit it)

-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]
裸好多
Tokyo, Japan (東京 日本)

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread Eugen Minciu
It _should_ inherit DISPLAY (as it's passed through a parameter to the function. This thing does work on my machine, remember?Also Essien told me he is currently working on fixing up session detection through ecore_desktop, so this may just be a case of our code not playing nice together ;)
Could someone else test this? Pretty please? .If this doesn't work and you decide you do want a shell to be launched (it might be better indeed), could we at least do the 'bash first' thing so systems with /bin/sh linking to braindamaged shells like dash can work? (as long as the _do_ have bash). We could also try other ones, bash is just the only one I know that works for sure with the SIGUSR1 thingie.
Cheers,Eugen.On 8/29/06, Essien Ita Essien <
[EMAIL PROTECTED]> wrote:
Justin Patrin wrote:> On 8/28/06, The Rasterman Carsten Haitzler <[EMAIL PROTECTED]> wrote:
>>> On Mon, 28 Aug 2006 16:55:19 +0200 Sebastian Dransfeld <
[EMAIL PROTECTED]>>> babbled:>>> Eugen Minciu wrote:
>>> On Mon, 28 Aug 2006 14:29:08 +0100
 Essien Ita Essien <[EMAIL PROTECTED]> wrote: Well .. then maybe we shouldn't clearenv() in the first place? We may not
 need to, since setenv(x,y,1) is called, which overwrites the var's contents anyway. I didn't want to try it before because I suspected clearenv() was there for good reasons (and it feels right, too).
 However, it's strange you should mention this .. there is: entrance_auth_setup_environment(Entrance_Auth * e, const char *display, const char *path) so the display is sent as a paramter and it _should be_
 set by the function itself. Could you investigate this a bit further? I'm willing to try not clearenv() - ing but it may introduce some even subtler (and weirder) problems. If you
 think it shouldn't though I'll try it out later on tonight, when I've some free time on my hands.>>> clearenv must stay. The user must not inherit any environment from entrance.
> well- it does NEED to inherit DISPLAY... for starters. :) the problem is>> actually entrance executing enlightenment directly. no other dm does this as>> best i know. every login session is first executed by a shell which then
>> executes the wm or session manager etc. thus the behavior issues. wm's like e>> expect to have a users environment already loaded by the time they run. (ie>> users $PATH is set and all the other goodies a user wants in their SHELL)
>> FWIW I have also modified entrance to start a shell script instead of> X directly for use in OpenZaurus to allow the normal X startup scripts> to be run.>
>
In that case, what's the right approach here? I don't pretend to knowwhich is prefarable really. Raster, is there something unique about Ethat necessitated Entrance to be written that way? Or would it be better
for E as a whole if it where changed to be more like others... roughlyin the direction that Justin has gone for OpenZaurus?-Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easierDownload IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___enlightenment-devel mailing list

enlightenment-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/enlightenment-devel



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread Essien Ita Essien
Justin Patrin wrote:
> On 8/28/06, The Rasterman Carsten Haitzler <[EMAIL PROTECTED]> wrote:
>   
>> On Mon, 28 Aug 2006 16:55:19 +0200 Sebastian Dransfeld <[EMAIL PROTECTED]>
>> babbled:
>>
>> 
>>> Eugen Minciu wrote:
>>>   
 On Mon, 28 Aug 2006 14:29:08 +0100
 Essien Ita Essien <[EMAIL PROTECTED]> wrote:

 Well .. then maybe we shouldn't clearenv() in the first place? We may not
 need to, since setenv(x,y,1) is called, which overwrites the var's contents
 anyway. I didn't want to try it before because I suspected clearenv() was
 there for good reasons (and it feels right, too).

 However, it's strange you should mention this .. there is:
 entrance_auth_setup_environment(Entrance_Auth * e, const char *display,
 const char *path) so the display is sent as a paramter and it _should be_
 set by the function itself.

 Could you investigate this a bit further? I'm willing to try not clearenv()
 - ing but it may introduce some even subtler (and weirder) problems. If you
 think it shouldn't though I'll try it out later on tonight, when I've some
 free time on my hands.
 
>>> clearenv must stay. The user must not inherit any environment from entrance.
>>>   
>> well- it does NEED to inherit DISPLAY... for starters. :) the problem is
>> actually entrance executing enlightenment directly. no other dm does this as
>> best i know. every login session is first executed by a shell which then
>> executes the wm or session manager etc. thus the behavior issues. wm's like e
>> expect to have a users environment already loaded by the time they run. (ie
>> users $PATH is set and all the other goodies a user wants in their SHELL)
>>
>> 
>
> FWIW I have also modified entrance to start a shell script instead of
> X directly for use in OpenZaurus to allow the normal X startup scripts
> to be run.
>
>   
In that case, what's the right approach here? I don't pretend to know 
which is prefarable really. Raster, is there something unique about E 
that necessitated Entrance to be written that way? Or would it be better 
for E as a whole if it where changed to be more like others... roughly 
in the direction that Justin has gone for OpenZaurus?

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread Justin Patrin
On 8/28/06, The Rasterman Carsten Haitzler <[EMAIL PROTECTED]> wrote:
> On Mon, 28 Aug 2006 16:55:19 +0200 Sebastian Dransfeld <[EMAIL PROTECTED]>
> babbled:
>
> > Eugen Minciu wrote:
> > > On Mon, 28 Aug 2006 14:29:08 +0100
> > > Essien Ita Essien <[EMAIL PROTECTED]> wrote:
> > >
> > > Well .. then maybe we shouldn't clearenv() in the first place? We may not
> > > need to, since setenv(x,y,1) is called, which overwrites the var's 
> > > contents
> > > anyway. I didn't want to try it before because I suspected clearenv() was
> > > there for good reasons (and it feels right, too).
> > >
> > > However, it's strange you should mention this .. there is:
> > > entrance_auth_setup_environment(Entrance_Auth * e, const char *display,
> > > const char *path) so the display is sent as a paramter and it _should be_
> > > set by the function itself.
> > >
> > > Could you investigate this a bit further? I'm willing to try not 
> > > clearenv()
> > > - ing but it may introduce some even subtler (and weirder) problems. If 
> > > you
> > > think it shouldn't though I'll try it out later on tonight, when I've some
> > > free time on my hands.
> >
> > clearenv must stay. The user must not inherit any environment from entrance.
>
> well- it does NEED to inherit DISPLAY... for starters. :) the problem is
> actually entrance executing enlightenment directly. no other dm does this as
> best i know. every login session is first executed by a shell which then
> executes the wm or session manager etc. thus the behavior issues. wm's like e
> expect to have a users environment already loaded by the time they run. (ie
> users $PATH is set and all the other goodies a user wants in their SHELL)
>

FWIW I have also modified entrance to start a shell script instead of
X directly for use in OpenZaurus to allow the normal X startup scripts
to be run.

-- 
Justin Patrin

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread The Rasterman
On Mon, 28 Aug 2006 16:55:19 +0200 Sebastian Dransfeld <[EMAIL PROTECTED]>
babbled:

> Eugen Minciu wrote:
> > On Mon, 28 Aug 2006 14:29:08 +0100
> > Essien Ita Essien <[EMAIL PROTECTED]> wrote:
> > 
> > Well .. then maybe we shouldn't clearenv() in the first place? We may not
> > need to, since setenv(x,y,1) is called, which overwrites the var's contents
> > anyway. I didn't want to try it before because I suspected clearenv() was
> > there for good reasons (and it feels right, too).
> > 
> > However, it's strange you should mention this .. there is:
> > entrance_auth_setup_environment(Entrance_Auth * e, const char *display,
> > const char *path) so the display is sent as a paramter and it _should be_
> > set by the function itself.
> > 
> > Could you investigate this a bit further? I'm willing to try not clearenv()
> > - ing but it may introduce some even subtler (and weirder) problems. If you
> > think it shouldn't though I'll try it out later on tonight, when I've some
> > free time on my hands.
> 
> clearenv must stay. The user must not inherit any environment from entrance.

well- it does NEED to inherit DISPLAY... for starters. :) the problem is
actually entrance executing enlightenment directly. no other dm does this as
best i know. every login session is first executed by a shell which then
executes the wm or session manager etc. thus the behavior issues. wm's like e
expect to have a users environment already loaded by the time they run. (ie
users $PATH is set and all the other goodies a user wants in their SHELL)

> Sebastian
> 
> -
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)[EMAIL PROTECTED]
裸好多
Tokyo, Japan (東京 日本)

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread The Rasterman
On Mon, 28 Aug 2006 16:57:13 +0300 Eugen Minciu <[EMAIL PROTECTED]> babbled:

> On Mon, 28 Aug 2006 14:29:08 +0100
> Essien Ita Essien <[EMAIL PROTECTED]> wrote:
> 
> Well .. then maybe we shouldn't clearenv() in the first place? We may not
> need to, since setenv(x,y,1) is called, which overwrites the var's contents
> anyway. I didn't want to try it before because I suspected clearenv() was
> there for good reasons (and it feels right, too).

clearenv() i think is just trying to do some security stuff - if entrance
happens to inherit env vars from init/boot - start from scratch. that's why you
lose DISPLAY.

> However, it's strange you should mention this .. there is:
> entrance_auth_setup_environment(Entrance_Auth * e, const char *display, const
> char *path) so the display is sent as a paramter and it _should be_ set by
> the function itself.
> 
> Could you investigate this a bit further? I'm willing to try not clearenv() -
> ing but it may introduce some even subtler (and weirder) problems. If you
> think it shouldn't though I'll try it out later on tonight, when I've some
> free time on my hands.
> 
> One more thing, this could actually be caused by the parsing thingie. Maybe
> just using strtok() on spaces is breaking something? What are the command
> lines for X, entranced, entrance and e? on your system. (both with and
> without the patch) ?
> 
> If you can't find anything I might find some time to look through xdm's code
> tonight. I hope I don't have to look at the other two :)
> 
> Cheers,
> Eugen.
> 
> > Eugen Minciu wrote:
> > > On Mon, 28 Aug 2006 08:01:54 +0300
> > > Eugen Minciu <[EMAIL PROTECTED]> wrote:
> > >
> > > And here is another version that frees the memory it allocates in the
> > > correct place.
> > >
> > > Sorry about so many posts on what should have been a simple thingie. It's
> > > the first patch I'm sending you guys, I promise I'll try to shut up a bit
> > > more from now on ;) 
> > I've tested this here and it doesn't start Enlightement at all. The 
> > DISPLAY environment variable is not set, but I'm not sure that simply 
> > setting it like you set the PATH variable is a good work-around. It will 
> > probably hide something else untill it blows up in our collective faces :)
> > 
> > I'm going to commit the bash before sh work around, which at least works.
> > 
> > Do you think you could find out how gdm and kdm even xdm solves this 
> > problem? Display Managers have evolved so I'm guessing this is an 
> > already solved problem. If you think you need anyhelp... shout... at me 
> > even :). Other safe targets for *help-me* are (in no order of preference 
> > really), raster, raster, raster, rephorm, rephorm, rephorm, Codewarrior, 
> > Codewarrior, Codewarrior [there... without adding me, you now have 9 
> > ppl!!! you can get help from) :P
> > 
> > /me boards the next space-shuttle headed for pluto - catch me if you can ;)
> > 
> > Cheers,
> > Essien
> > >   
> > >> On Mon, 28 Aug 2006 05:04:10 +0100
> > >> Essien Ita Essien <[EMAIL PROTECTED]> wrote:
> > >>
> > >> Ouch, sorry, lol :)
> > >> Here it is
> > >>
> > >> 
> > >>> Eugen Minciu wrote:
> > >>>   
> >  On Sun, 27 Aug 2006 23:22:38 +0300
> >  Eugen Minciu <[EMAIL PROTECTED]> wrote:
> >  And finally, I've got it.
> > 
> >  The problem was in entrance_auth_setup_environment() which called
> >  clearenv().
> > 
> >  For some reasong calling getenv() there did not return the path
> >  either. So I added an extra parameter, const char *path.
> > 
> >  This finally works, I can run apps and everything appears to be
> >  working correctly. 
> >  
> > >>> Nice, but no patch attached ;)
> > >>>   
> >  Eugen. 
> >    
> >  
> > > On Sun, 27 Aug 2006 22:36:31 +0300
> > > Eugen Minciu <[EMAIL PROTECTED]> wrote:
> > > I've figured out what causes the problem, but I don't know how to fix
> > > it this time.
> > >
> > > This happens because once I replace the execl() call in
> > > entrance_session_start_user_session, the environment variables for
> > > the user are no longer loaded. If anyone could tell me how to load
> > > these settings from C code, I'd very much appreciate it.
> > >
> > > As things stand, at this point, entrance does work with this, and the
> > > E17 session starts, but many issues can quickly be noticed, probably
> > > caused by not setting the environment variables to some proper values.
> > >
> > > 
> > >   
> > >> On Sun, 27 Aug 2006 22:30:58 +0300
> > >> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> > >>
> > >> Sorry, it seems that if I use this I get some issues within e. If I
> > >> try to start an application from the run command thingie, it will
> > >> tell me that the application failed to start.
> > >>
> > >> I'll try to see what causes this. If anyone would be willing to
> > >> investigate and/or gi

Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread Sebastian Dransfeld
Eugen Minciu wrote:
> On Mon, 28 Aug 2006 14:29:08 +0100
> Essien Ita Essien <[EMAIL PROTECTED]> wrote:
> 
> Well .. then maybe we shouldn't clearenv() in the first place? We may not 
> need to, since setenv(x,y,1) is called, which overwrites the var's contents 
> anyway. I didn't want to try it before because I suspected clearenv() was 
> there for good reasons (and it feels right, too).
> 
> However, it's strange you should mention this .. there is:
> entrance_auth_setup_environment(Entrance_Auth * e, const char *display, const 
> char *path)
> so the display is sent as a paramter and it _should be_ set by the function 
> itself.
> 
> Could you investigate this a bit further? I'm willing to try not clearenv() - 
> ing but it may introduce some even subtler (and weirder) problems. If you 
> think it shouldn't though I'll try it out later on tonight, when I've some 
> free time on my hands.

clearenv must stay. The user must not inherit any environment from entrance.

Sebastian

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread Essien Ita Essien
Eugen Minciu wrote:
> On Mon, 28 Aug 2006 08:01:54 +0300
> Eugen Minciu <[EMAIL PROTECTED]> wrote:
>
> And here is another version that frees the memory it allocates in the correct 
> place.
>
> Sorry about so many posts on what should have been a simple thingie. It's the 
> first patch I'm sending you guys, I promise I'll try to shut up a bit more 
> from now on ;)
>   
I've tested this here and it doesn't start Enlightement at all. The 
DISPLAY environment variable is not set, but I'm not sure that simply 
setting it like you set the PATH variable is a good work-around. It will 
probably hide something else untill it blows up in our collective faces :)

I'm going to commit the bash before sh work around, which at least works.

Do you think you could find out how gdm and kdm even xdm solves this 
problem? Display Managers have evolved so I'm guessing this is an 
already solved problem. If you think you need anyhelp... shout... at me 
even :). Other safe targets for *help-me* are (in no order of preference 
really), raster, raster, raster, rephorm, rephorm, rephorm, Codewarrior, 
Codewarrior, Codewarrior [there... without adding me, you now have 9 
ppl!!! you can get help from) :P

/me boards the next space-shuttle headed for pluto - catch me if you can ;)

Cheers,
Essien
>   
>> On Mon, 28 Aug 2006 05:04:10 +0100
>> Essien Ita Essien <[EMAIL PROTECTED]> wrote:
>>
>> Ouch, sorry, lol :)
>> Here it is
>>
>> 
>>> Eugen Minciu wrote:
>>>   
 On Sun, 27 Aug 2006 23:22:38 +0300
 Eugen Minciu <[EMAIL PROTECTED]> wrote:
 And finally, I've got it.

 The problem was in entrance_auth_setup_environment() which called 
 clearenv().

 For some reasong calling getenv() there did not return the path either. So 
 I added an extra parameter, const char *path.

 This finally works, I can run apps and everything appears to be working 
 correctly.
   
 
>>> Nice, but no patch attached ;)
>>>   
 Eugen. 
   
 
> On Sun, 27 Aug 2006 22:36:31 +0300
> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> I've figured out what causes the problem, but I don't know how to fix it 
> this time.
>
> This happens because once I replace the execl() call in 
> entrance_session_start_user_session, the environment variables for the 
> user are no longer loaded. If anyone could tell me how to load these 
> settings from C code, I'd very much appreciate it.
>
> As things stand, at this point, entrance does work with this, and the E17 
> session starts, but many issues can quickly be noticed, probably caused 
> by not setting the environment variables to some proper values.
>
> 
>   
>> On Sun, 27 Aug 2006 22:30:58 +0300
>> Eugen Minciu <[EMAIL PROTECTED]> wrote:
>>
>> Sorry, it seems that if I use this I get some issues within e. If I try 
>> to start an application from the run command thingie, it will tell me 
>> that the application failed to start.
>>
>> I'll try to see what causes this. If anyone would be willing to 
>> investigate and/or give me any clues it would be appreciated.
>>
>>   
>> 
>>> Here's a new patch for entranced and entrance.
>>>
>>> This time I did what the comment suggested in both places. I used 
>>> strtok and parsed directly into a char ** which then gets run by 
>>> execv/execvp.
>>>
>>> If my code strikes you as ugly (I'm not sure if it should) be sure to 
>>> tell me what I did wrong and I'll try to fix it some more.
>>>
>>> BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what 
>>> you meant or should I have made it dirrectly from e17/ ?
>>>
>>> Eugen.
>>>
>>> 
>>>   
 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job 
 easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

   
 
>> 
>>
>> Index: src/client/entrance_auth.c
>> ===
>> RCS file: /var/cvs/e/e17/apps/entrance/src/client/entrance_auth.c,v
>> retrieving revision 1.26
>> diff -u -r1.26 entrance_auth.c
>> --- src/client/entrance_auth.c   9 Aug 2005 08:11:32 -   1.26
>> +++ src/client/entrance_auth.c   28 Aug 2006 08:15:59 -
>> @@ -377,7 +377,7 @@
>>   * I'm not sure

Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread Eugen Minciu
On Mon, 28 Aug 2006 14:29:08 +0100
Essien Ita Essien <[EMAIL PROTECTED]> wrote:

Well .. then maybe we shouldn't clearenv() in the first place? We may not need 
to, since setenv(x,y,1) is called, which overwrites the var's contents anyway. 
I didn't want to try it before because I suspected clearenv() was there for 
good reasons (and it feels right, too).

However, it's strange you should mention this .. there is:
entrance_auth_setup_environment(Entrance_Auth * e, const char *display, const 
char *path)
so the display is sent as a paramter and it _should be_ set by the function 
itself.

Could you investigate this a bit further? I'm willing to try not clearenv() - 
ing but it may introduce some even subtler (and weirder) problems. If you think 
it shouldn't though I'll try it out later on tonight, when I've some free time 
on my hands.

One more thing, this could actually be caused by the parsing thingie. Maybe 
just using strtok() on spaces is breaking something? What are the command lines 
for X, entranced, entrance and e? on your system. (both with and without the 
patch) ?

If you can't find anything I might find some time to look through xdm's code 
tonight. I hope I don't have to look at the other two :)

Cheers,
Eugen.

> Eugen Minciu wrote:
> > On Mon, 28 Aug 2006 08:01:54 +0300
> > Eugen Minciu <[EMAIL PROTECTED]> wrote:
> >
> > And here is another version that frees the memory it allocates in the 
> > correct place.
> >
> > Sorry about so many posts on what should have been a simple thingie. It's 
> > the first patch I'm sending you guys, I promise I'll try to shut up a bit 
> > more from now on ;)
> >   
> I've tested this here and it doesn't start Enlightement at all. The 
> DISPLAY environment variable is not set, but I'm not sure that simply 
> setting it like you set the PATH variable is a good work-around. It will 
> probably hide something else untill it blows up in our collective faces :)
> 
> I'm going to commit the bash before sh work around, which at least works.
> 
> Do you think you could find out how gdm and kdm even xdm solves this 
> problem? Display Managers have evolved so I'm guessing this is an 
> already solved problem. If you think you need anyhelp... shout... at me 
> even :). Other safe targets for *help-me* are (in no order of preference 
> really), raster, raster, raster, rephorm, rephorm, rephorm, Codewarrior, 
> Codewarrior, Codewarrior [there... without adding me, you now have 9 
> ppl!!! you can get help from) :P
> 
> /me boards the next space-shuttle headed for pluto - catch me if you can ;)
> 
> Cheers,
> Essien
> >   
> >> On Mon, 28 Aug 2006 05:04:10 +0100
> >> Essien Ita Essien <[EMAIL PROTECTED]> wrote:
> >>
> >> Ouch, sorry, lol :)
> >> Here it is
> >>
> >> 
> >>> Eugen Minciu wrote:
> >>>   
>  On Sun, 27 Aug 2006 23:22:38 +0300
>  Eugen Minciu <[EMAIL PROTECTED]> wrote:
>  And finally, I've got it.
> 
>  The problem was in entrance_auth_setup_environment() which called 
>  clearenv().
> 
>  For some reasong calling getenv() there did not return the path either. 
>  So I added an extra parameter, const char *path.
> 
>  This finally works, I can run apps and everything appears to be working 
>  correctly.
>    
>  
> >>> Nice, but no patch attached ;)
> >>>   
>  Eugen. 
>    
>  
> > On Sun, 27 Aug 2006 22:36:31 +0300
> > Eugen Minciu <[EMAIL PROTECTED]> wrote:
> > I've figured out what causes the problem, but I don't know how to fix 
> > it this time.
> >
> > This happens because once I replace the execl() call in 
> > entrance_session_start_user_session, the environment variables for the 
> > user are no longer loaded. If anyone could tell me how to load these 
> > settings from C code, I'd very much appreciate it.
> >
> > As things stand, at this point, entrance does work with this, and the 
> > E17 session starts, but many issues can quickly be noticed, probably 
> > caused by not setting the environment variables to some proper values.
> >
> > 
> >   
> >> On Sun, 27 Aug 2006 22:30:58 +0300
> >> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> >>
> >> Sorry, it seems that if I use this I get some issues within e. If I 
> >> try to start an application from the run command thingie, it will tell 
> >> me that the application failed to start.
> >>
> >> I'll try to see what causes this. If anyone would be willing to 
> >> investigate and/or give me any clues it would be appreciated.
> >>
> >>   
> >> 
> >>> Here's a new patch for entranced and entrance.
> >>>
> >>> This time I did what the comment suggested in both places. I used 
> >>> strtok and parsed directly into a char ** which then gets run by 
> >>> execv/execvp.
> >>>
> >>> If my code strikes you as ugly (I'm not sure if it should) be sure to 
> 

Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread Essien Ita Essien
Eugen Minciu wrote:
> On Mon, 28 Aug 2006 08:01:54 +0300
> Eugen Minciu <[EMAIL PROTECTED]> wrote:
>
> And here is another version that frees the memory it allocates in the correct 
> place.
>
> Sorry about so many posts on what should have been a simple thingie. It's the 
> first patch I'm sending you guys, I promise I'll try to shut up a bit more 
> from now on ;)
>   

hahaha... i'll wait a couple of hours for good measure then I'll commit ;)

thx for actually taking the time to solve this.
>   
>> On Mon, 28 Aug 2006 05:04:10 +0100
>> Essien Ita Essien <[EMAIL PROTECTED]> wrote:
>>
>> Ouch, sorry, lol :)
>> Here it is
>>
>> 
>>> Eugen Minciu wrote:
>>>   
 On Sun, 27 Aug 2006 23:22:38 +0300
 Eugen Minciu <[EMAIL PROTECTED]> wrote:
 And finally, I've got it.

 The problem was in entrance_auth_setup_environment() which called 
 clearenv().

 For some reasong calling getenv() there did not return the path either. So 
 I added an extra parameter, const char *path.

 This finally works, I can run apps and everything appears to be working 
 correctly.
   
 
>>> Nice, but no patch attached ;)
>>>   
 Eugen. 
   
 
> On Sun, 27 Aug 2006 22:36:31 +0300
> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> I've figured out what causes the problem, but I don't know how to fix it 
> this time.
>
> This happens because once I replace the execl() call in 
> entrance_session_start_user_session, the environment variables for the 
> user are no longer loaded. If anyone could tell me how to load these 
> settings from C code, I'd very much appreciate it.
>
> As things stand, at this point, entrance does work with this, and the E17 
> session starts, but many issues can quickly be noticed, probably caused 
> by not setting the environment variables to some proper values.
>
> 
>   
>> On Sun, 27 Aug 2006 22:30:58 +0300
>> Eugen Minciu <[EMAIL PROTECTED]> wrote:
>>
>> Sorry, it seems that if I use this I get some issues within e. If I try 
>> to start an application from the run command thingie, it will tell me 
>> that the application failed to start.
>>
>> I'll try to see what causes this. If anyone would be willing to 
>> investigate and/or give me any clues it would be appreciated.
>>
>>   
>> 
>>> Here's a new patch for entranced and entrance.
>>>
>>> This time I did what the comment suggested in both places. I used 
>>> strtok and parsed directly into a char ** which then gets run by 
>>> execv/execvp.
>>>
>>> If my code strikes you as ugly (I'm not sure if it should) be sure to 
>>> tell me what I did wrong and I'll try to fix it some more.
>>>
>>> BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what 
>>> you meant or should I have made it dirrectly from e17/ ?
>>>
>>> Eugen.
>>>
>>> 
>>>   
 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job 
 easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

   
 
>> 
>>
>> Index: src/client/entrance_auth.c
>> ===
>> RCS file: /var/cvs/e/e17/apps/entrance/src/client/entrance_auth.c,v
>> retrieving revision 1.26
>> diff -u -r1.26 entrance_auth.c
>> --- src/client/entrance_auth.c   9 Aug 2005 08:11:32 -   1.26
>> +++ src/client/entrance_auth.c   28 Aug 2006 08:15:59 -
>> @@ -377,7 +377,7 @@
>>   * I'm not sure if this is correct, but for now it works.
>>   */
>>  void
>> -entrance_auth_setup_environment(Entrance_Auth * e, const char *display)
>> +entrance_auth_setup_environment(Entrance_Auth * e, const char *display, 
>> const char *path)
>>  {
>> extern char **environ;
>> int size;
>> @@ -394,10 +394,15 @@
>> environ = NULL;
>>  #endif
>>  
>> +   /* We purge the config but keep $PATH in place */
>> +   /* We need this because we're not running "sh -l" anymore */
>> +
>> +
>> e->env = environ;
>> snprintf(buf, PATH_MAX, "%s/.Xauthority", e->pw->pw_dir);
>> setenv("XAUTHORITY", buf, 1);
>> setenv("TERM", "vt100", 0);  // TERM=linux?
>> +   setenv("PATH", path, 1);
>> setenv("HOME", e->pw->pw_dir, 1);
>> setenv("SHELL", e->pw->pw_shell, 1);
>> setenv

Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread Eugen Minciu
On Mon, 28 Aug 2006 08:01:54 +0300
Eugen Minciu <[EMAIL PROTECTED]> wrote:

And here is another version that frees the memory it allocates in the correct 
place.

Sorry about so many posts on what should have been a simple thingie. It's the 
first patch I'm sending you guys, I promise I'll try to shut up a bit more from 
now on ;)

> On Mon, 28 Aug 2006 05:04:10 +0100
> Essien Ita Essien <[EMAIL PROTECTED]> wrote:
> 
> Ouch, sorry, lol :)
> Here it is
> 
> > Eugen Minciu wrote:
> > > On Sun, 27 Aug 2006 23:22:38 +0300
> > > Eugen Minciu <[EMAIL PROTECTED]> wrote:
> > > And finally, I've got it.
> > >
> > > The problem was in entrance_auth_setup_environment() which called 
> > > clearenv().
> > >
> > > For some reasong calling getenv() there did not return the path either. 
> > > So I added an extra parameter, const char *path.
> > >
> > > This finally works, I can run apps and everything appears to be working 
> > > correctly.
> > >   
> > Nice, but no patch attached ;)
> > > Eugen. 
> > >   
> > >> On Sun, 27 Aug 2006 22:36:31 +0300
> > >> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> > >> I've figured out what causes the problem, but I don't know how to fix it 
> > >> this time.
> > >>
> > >> This happens because once I replace the execl() call in 
> > >> entrance_session_start_user_session, the environment variables for the 
> > >> user are no longer loaded. If anyone could tell me how to load these 
> > >> settings from C code, I'd very much appreciate it.
> > >>
> > >> As things stand, at this point, entrance does work with this, and the 
> > >> E17 session starts, but many issues can quickly be noticed, probably 
> > >> caused by not setting the environment variables to some proper values.
> > >>
> > >> 
> > >>> On Sun, 27 Aug 2006 22:30:58 +0300
> > >>> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> > >>>
> > >>> Sorry, it seems that if I use this I get some issues within e. If I try 
> > >>> to start an application from the run command thingie, it will tell me 
> > >>> that the application failed to start.
> > >>>
> > >>> I'll try to see what causes this. If anyone would be willing to 
> > >>> investigate and/or give me any clues it would be appreciated.
> > >>>
> > >>>   
> >  Here's a new patch for entranced and entrance.
> > 
> >  This time I did what the comment suggested in both places. I used 
> >  strtok and parsed directly into a char ** which then gets run by 
> >  execv/execvp.
> > 
> >  If my code strikes you as ugly (I'm not sure if it should) be sure to 
> >  tell me what I did wrong and I'll try to fix it some more.
> > 
> >  BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what 
> >  you meant or should I have made it dirrectly from e17/ ?
> > 
> >  Eugen.
> > 
> >  
> > >
> > > -
> > > Using Tomcat but need to do more? Need to support web services, security?
> > > Get stuff done quickly with pre-integrated technology to make your job 
> > > easier
> > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > > ___
> > > enlightenment-devel mailing list
> > > enlightenment-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> > >
> > >   
> > 
> 
Index: src/client/entrance_auth.c
===
RCS file: /var/cvs/e/e17/apps/entrance/src/client/entrance_auth.c,v
retrieving revision 1.26
diff -u -r1.26 entrance_auth.c
--- src/client/entrance_auth.c  9 Aug 2005 08:11:32 -   1.26
+++ src/client/entrance_auth.c  28 Aug 2006 08:15:59 -
@@ -377,7 +377,7 @@
  * I'm not sure if this is correct, but for now it works.
  */
 void
-entrance_auth_setup_environment(Entrance_Auth * e, const char *display)
+entrance_auth_setup_environment(Entrance_Auth * e, const char *display, const 
char *path)
 {
extern char **environ;
int size;
@@ -394,10 +394,15 @@
environ = NULL;
 #endif
 
+   /* We purge the config but keep $PATH in place */
+   /* We need this because we're not running "sh -l" anymore */
+
+
e->env = environ;
snprintf(buf, PATH_MAX, "%s/.Xauthority", e->pw->pw_dir);
setenv("XAUTHORITY", buf, 1);
setenv("TERM", "vt100", 0);  // TERM=linux?
+   setenv("PATH", path, 1);
setenv("HOME", e->pw->pw_dir, 1);
setenv("SHELL", e->pw->pw_shell, 1);
setenv("USER", e->pw->pw_name, 1);
Index: src/client/entrance_auth.h
===
RCS file: /var/cvs/e/e17/apps/entrance/src/client/entrance_auth.h,v
retrieving revision 1.13
diff -u -r1.13 entrance_auth.h
--- src/client/entrance_auth.h  28 May 2005 09:31:14 -  1.13
+++ src/client/entrance_auth.h  28 Aug 2006 08:15:59 -
@@ -77,7 +77,7 @@
 
 /* 0 on 

Re: [E-devel] New patch for entranced and entrance

2006-08-28 Thread Eugen Minciu
On Mon, 28 Aug 2006 05:04:10 +0100
Essien Ita Essien <[EMAIL PROTECTED]> wrote:

Ouch, sorry, lol :)
Here it is

> Eugen Minciu wrote:
> > On Sun, 27 Aug 2006 23:22:38 +0300
> > Eugen Minciu <[EMAIL PROTECTED]> wrote:
> > And finally, I've got it.
> >
> > The problem was in entrance_auth_setup_environment() which called 
> > clearenv().
> >
> > For some reasong calling getenv() there did not return the path either. So 
> > I added an extra parameter, const char *path.
> >
> > This finally works, I can run apps and everything appears to be working 
> > correctly.
> >   
> Nice, but no patch attached ;)
> > Eugen. 
> >   
> >> On Sun, 27 Aug 2006 22:36:31 +0300
> >> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> >> I've figured out what causes the problem, but I don't know how to fix it 
> >> this time.
> >>
> >> This happens because once I replace the execl() call in 
> >> entrance_session_start_user_session, the environment variables for the 
> >> user are no longer loaded. If anyone could tell me how to load these 
> >> settings from C code, I'd very much appreciate it.
> >>
> >> As things stand, at this point, entrance does work with this, and the E17 
> >> session starts, but many issues can quickly be noticed, probably caused by 
> >> not setting the environment variables to some proper values.
> >>
> >> 
> >>> On Sun, 27 Aug 2006 22:30:58 +0300
> >>> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> >>>
> >>> Sorry, it seems that if I use this I get some issues within e. If I try 
> >>> to start an application from the run command thingie, it will tell me 
> >>> that the application failed to start.
> >>>
> >>> I'll try to see what causes this. If anyone would be willing to 
> >>> investigate and/or give me any clues it would be appreciated.
> >>>
> >>>   
>  Here's a new patch for entranced and entrance.
> 
>  This time I did what the comment suggested in both places. I used strtok 
>  and parsed directly into a char ** which then gets run by execv/execvp.
> 
>  If my code strikes you as ugly (I'm not sure if it should) be sure to 
>  tell me what I did wrong and I'll try to fix it some more.
> 
>  BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what 
>  you meant or should I have made it dirrectly from e17/ ?
> 
>  Eugen.
> 
>  
> >
> > -
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job 
> > easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > ___
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
> >   
> 
? entrance_no_shell.diff
? doc/html
? doc/latex
? doc/man
? src/client/entrace_session_try_bash.diff
Index: src/client/entrance_auth.c
===
RCS file: /var/cvs/e/e17/apps/entrance/src/client/entrance_auth.c,v
retrieving revision 1.26
diff -u -r1.26 entrance_auth.c
--- src/client/entrance_auth.c  9 Aug 2005 08:11:32 -   1.26
+++ src/client/entrance_auth.c  28 Aug 2006 03:23:14 -
@@ -377,7 +377,7 @@
  * I'm not sure if this is correct, but for now it works.
  */
 void
-entrance_auth_setup_environment(Entrance_Auth * e, const char *display)
+entrance_auth_setup_environment(Entrance_Auth * e, const char *display, const 
char *path)
 {
extern char **environ;
int size;
@@ -394,10 +394,14 @@
environ = NULL;
 #endif
 
+   /* We purge the config but keep $PATH in place */
+   /* We need this because we're not running "sh -l" anymore */
+
e->env = environ;
snprintf(buf, PATH_MAX, "%s/.Xauthority", e->pw->pw_dir);
setenv("XAUTHORITY", buf, 1);
setenv("TERM", "vt100", 0);  // TERM=linux?
+   setenv("PATH", path, 1);
setenv("HOME", e->pw->pw_dir, 1);
setenv("SHELL", e->pw->pw_shell, 1);
setenv("USER", e->pw->pw_name, 1);
@@ -410,6 +414,7 @@
snprintf(mail, size, "%s/%s", _PATH_MAILDIR, e->pw->pw_name);
setenv("MAIL", mail, 1);
free(mail);
+   free(path);
 
chdir(e->pw->pw_dir);
 }
Index: src/client/entrance_auth.h
===
RCS file: /var/cvs/e/e17/apps/entrance/src/client/entrance_auth.h,v
retrieving revision 1.13
diff -u -r1.13 entrance_auth.h
--- src/client/entrance_auth.h  28 May 2005 09:31:14 -  1.13
+++ src/client/entrance_auth.h  28 Aug 2006 03:23:14 -
@@ -77,7 +77,7 @@
 
 /* 0 on success, 1 on no user by that name */
 int entrance_auth_user_set(Entrance_Auth * e, const char *str);
-void entrance_auth_setup_environment(Entrance_Auth * e, const char *display);
+void entrance_auth_setup_environment(Entr

Re: [E-devel] New patch for entranced and entrance

2006-08-27 Thread Essien Ita Essien
Eugen Minciu wrote:
> On Sun, 27 Aug 2006 23:22:38 +0300
> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> And finally, I've got it.
>
> The problem was in entrance_auth_setup_environment() which called clearenv().
>
> For some reasong calling getenv() there did not return the path either. So I 
> added an extra parameter, const char *path.
>
> This finally works, I can run apps and everything appears to be working 
> correctly.
>   
Nice, but no patch attached ;)
> Eugen. 
>   
>> On Sun, 27 Aug 2006 22:36:31 +0300
>> Eugen Minciu <[EMAIL PROTECTED]> wrote:
>> I've figured out what causes the problem, but I don't know how to fix it 
>> this time.
>>
>> This happens because once I replace the execl() call in 
>> entrance_session_start_user_session, the environment variables for the user 
>> are no longer loaded. If anyone could tell me how to load these settings 
>> from C code, I'd very much appreciate it.
>>
>> As things stand, at this point, entrance does work with this, and the E17 
>> session starts, but many issues can quickly be noticed, probably caused by 
>> not setting the environment variables to some proper values.
>>
>> 
>>> On Sun, 27 Aug 2006 22:30:58 +0300
>>> Eugen Minciu <[EMAIL PROTECTED]> wrote:
>>>
>>> Sorry, it seems that if I use this I get some issues within e. If I try to 
>>> start an application from the run command thingie, it will tell me that the 
>>> application failed to start.
>>>
>>> I'll try to see what causes this. If anyone would be willing to investigate 
>>> and/or give me any clues it would be appreciated.
>>>
>>>   
 Here's a new patch for entranced and entrance.

 This time I did what the comment suggested in both places. I used strtok 
 and parsed directly into a char ** which then gets run by execv/execvp.

 If my code strikes you as ugly (I'm not sure if it should) be sure to tell 
 me what I did wrong and I'll try to fix it some more.

 BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what you 
 meant or should I have made it dirrectly from e17/ ?

 Eugen.

 
>
> -
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
>   


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-27 Thread Eugen Minciu
On Sun, 27 Aug 2006 23:22:38 +0300
Eugen Minciu <[EMAIL PROTECTED]> wrote:
And finally, I've got it.

The problem was in entrance_auth_setup_environment() which called clearenv().

For some reasong calling getenv() there did not return the path either. So I 
added an extra parameter, const char *path.

This finally works, I can run apps and everything appears to be working 
correctly.

Eugen. 
> On Sun, 27 Aug 2006 22:36:31 +0300
> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> I've figured out what causes the problem, but I don't know how to fix it this 
> time.
> 
> This happens because once I replace the execl() call in 
> entrance_session_start_user_session, the environment variables for the user 
> are no longer loaded. If anyone could tell me how to load these settings from 
> C code, I'd very much appreciate it.
> 
> As things stand, at this point, entrance does work with this, and the E17 
> session starts, but many issues can quickly be noticed, probably caused by 
> not setting the environment variables to some proper values.
> 
> > On Sun, 27 Aug 2006 22:30:58 +0300
> > Eugen Minciu <[EMAIL PROTECTED]> wrote:
> > 
> > Sorry, it seems that if I use this I get some issues within e. If I try to 
> > start an application from the run command thingie, it will tell me that the 
> > application failed to start.
> > 
> > I'll try to see what causes this. If anyone would be willing to investigate 
> > and/or give me any clues it would be appreciated.
> > 
> > > Here's a new patch for entranced and entrance.
> > > 
> > > This time I did what the comment suggested in both places. I used strtok 
> > > and parsed directly into a char ** which then gets run by execv/execvp.
> > > 
> > > If my code strikes you as ugly (I'm not sure if it should) be sure to 
> > > tell me what I did wrong and I'll try to fix it some more.
> > > 
> > > BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what 
> > > you meant or should I have made it dirrectly from e17/ ?
> > > 
> > > Eugen.
> > > 

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-27 Thread Eugen Minciu
On Sun, 27 Aug 2006 23:49:40 +0100
Essien Ita Essien <[EMAIL PROTECTED]> wrote:

Indeed. But it seems that just passing the environ pointer to an execve() call 
is not sufficient. What bash -l does is invoke /etc/profile ~/.bash_profile etc.

So I need a way to parse those files (at least from a command line).
The problems comes from the fact that my torture shell of the day (dash) does 
not implement a '-l' option.

While I can easily run any other shell besides dash (and right now I run bash, 
for the time being), doing so does not hide the problem. It may be possible 
that other shells besides dash do not implement the -l option either.

But for now, just applying the part of the patch that reffers to 
src/daemon/entranced_display.c means Entrance will work for shells that don't 
do SIGUSR1 but _do_ implement a -l option. So this may actually do some good 
(not sure though). 
> Eugen Minciu wrote:
> > On Sun, 27 Aug 2006 22:30:58 +0300
> > Eugen Minciu <[EMAIL PROTECTED]> wrote:
> >
> > Sorry, it seems that if I use this I get some issues within e. If I try to 
> > start an application from the run command thingie, it will tell me that the 
> > application failed to start.
> >
> > I'll try to see what causes this. If anyone would be willing to investigate 
> > and/or give me any clues it would be appreciated.
> >
> >   
> I'm not sure... but can you check that your environment variables are 
> intact? It seems you'll need to pass the environment with the exec call 
> so entrance can also pass that to e when it spawns e.
> 
> Good job tackling that tho... appreciated :)
> >> Here's a new patch for entranced and entrance.
> >>
> >> This time I did what the comment suggested in both places. I used strtok 
> >> and parsed directly into a char ** which then gets run by execv/execvp.
> >>
> >> If my code strikes you as ugly (I'm not sure if it should) be sure to tell 
> >> me what I did wrong and I'll try to fix it some more.
> >>
> >> BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what you 
> >> meant or should I have made it dirrectly from e17/ ?
> >>
> >> Eugen.
> >>
> >> 
> >
> > -
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job 
> > easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > ___
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >   
> 

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-27 Thread Eugen Minciu
On Sun, 27 Aug 2006 22:36:31 +0300
Eugen Minciu <[EMAIL PROTECTED]> wrote:
I've figured out what causes the problem, but I don't know how to fix it this 
time.

This happens because once I replace the execl() call in 
entrance_session_start_user_session, the environment variables for the user are 
no longer loaded. If anyone could tell me how to load these settings from C 
code, I'd very much appreciate it.

As things stand, at this point, entrance does work with this, and the E17 
session starts, but many issues can quickly be noticed, probably caused by not 
setting the environment variables to some proper values.

> On Sun, 27 Aug 2006 22:30:58 +0300
> Eugen Minciu <[EMAIL PROTECTED]> wrote:
> 
> Sorry, it seems that if I use this I get some issues within e. If I try to 
> start an application from the run command thingie, it will tell me that the 
> application failed to start.
> 
> I'll try to see what causes this. If anyone would be willing to investigate 
> and/or give me any clues it would be appreciated.
> 
> > Here's a new patch for entranced and entrance.
> > 
> > This time I did what the comment suggested in both places. I used strtok 
> > and parsed directly into a char ** which then gets run by execv/execvp.
> > 
> > If my code strikes you as ugly (I'm not sure if it should) be sure to tell 
> > me what I did wrong and I'll try to fix it some more.
> > 
> > BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what you 
> > meant or should I have made it dirrectly from e17/ ?
> > 
> > Eugen.
> > 

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-27 Thread Essien Ita Essien
Eugen Minciu wrote:
> On Sun, 27 Aug 2006 22:30:58 +0300
> Eugen Minciu <[EMAIL PROTECTED]> wrote:
>
> Sorry, it seems that if I use this I get some issues within e. If I try to 
> start an application from the run command thingie, it will tell me that the 
> application failed to start.
>
> I'll try to see what causes this. If anyone would be willing to investigate 
> and/or give me any clues it would be appreciated.
>
>   
I'm not sure... but can you check that your environment variables are 
intact? It seems you'll need to pass the environment with the exec call 
so entrance can also pass that to e when it spawns e.

Good job tackling that tho... appreciated :)
>> Here's a new patch for entranced and entrance.
>>
>> This time I did what the comment suggested in both places. I used strtok and 
>> parsed directly into a char ** which then gets run by execv/execvp.
>>
>> If my code strikes you as ugly (I'm not sure if it should) be sure to tell 
>> me what I did wrong and I'll try to fix it some more.
>>
>> BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what you 
>> meant or should I have made it dirrectly from e17/ ?
>>
>> Eugen.
>>
>> 
>
> -
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>   


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] New patch for entranced and entrance

2006-08-27 Thread Eugen Minciu
On Sun, 27 Aug 2006 22:30:58 +0300
Eugen Minciu <[EMAIL PROTECTED]> wrote:

Sorry, it seems that if I use this I get some issues within e. If I try to 
start an application from the run command thingie, it will tell me that the 
application failed to start.

I'll try to see what causes this. If anyone would be willing to investigate 
and/or give me any clues it would be appreciated.

> Here's a new patch for entranced and entrance.
> 
> This time I did what the comment suggested in both places. I used strtok and 
> parsed directly into a char ** which then gets run by execv/execvp.
> 
> If my code strikes you as ugly (I'm not sure if it should) be sure to tell me 
> what I did wrong and I'll try to fix it some more.
> 
> BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what you 
> meant or should I have made it dirrectly from e17/ ?
> 
> Eugen.
> 

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] New patch for entranced and entrance

2006-08-27 Thread Eugen Minciu
Here's a new patch for entranced and entrance.

This time I did what the comment suggested in both places. I used strtok and 
parsed directly into a char ** which then gets run by execv/execvp.

If my code strikes you as ugly (I'm not sure if it should) be sure to tell me 
what I did wrong and I'll try to fix it some more.

BTW, this diff is made from e17/apps/entrance. I'm sorry, is this what you 
meant or should I have made it dirrectly from e17/ ?

Eugen.
Index: src/client/entrance_session.c
===
RCS file: /var/cvs/e/e17/apps/entrance/src/client/entrance_session.c,v
retrieving revision 1.84
diff -u -r1.84 entrance_session.c
--- src/client/entrance_session.c   3 Jun 2006 07:24:49 -   1.84
+++ src/client/entrance_session.c   27 Aug 2006 22:25:00 -
@@ -377,10 +377,16 @@
 {
pid_t pid;
char buf[PATH_MAX];
+   char *session_cmd_argv[32];
+
char *shell = NULL;
struct passwd *pwent = NULL;
Entrance_X_Session *exs = NULL;
 
+   int i;
+
+   for (i=0;i<32;i++) session_cmd_argv[i]=NULL;
+
if (e->session)
   exs = evas_hash_find(e->config->sessions.hash, e->session);
 
@@ -497,7 +503,13 @@
entrance_session_free(e);
/* replace this process with a clean small one that just waits for its */
/* child to exit.. passed on the cmd-line */
-   execl("/bin/sh", "/bin/sh", "-l", "-c", buf, NULL);
+
+   session_cmd_argv[0]=strtok(buf," ");
+   i=1;
+   while ((session_cmd_argv[i]=strtok(NULL," "))!=NULL) {
+  i++;
+   }
+   execvp(session_cmd_argv[0], session_cmd_argv);
 }
 
 
Index: src/daemon/entranced_display.c
===
RCS file: /var/cvs/e/e17/apps/entrance/src/daemon/entranced_display.c,v
retrieving revision 1.2
diff -u -r1.2 entranced_display.c
--- src/daemon/entranced_display.c  1 Aug 2006 05:30:58 -   1.2
+++ src/daemon/entranced_display.c  27 Aug 2006 22:25:00 -
@@ -124,6 +124,11 @@
double start_time;
char x_cmd[PATH_MAX];
 
+   int i;
+   char *x_cmd_argv[32]; 
+
+   for (i=0;i<32;i++) x_cmd_argv[i]=NULL;
+
/* Ecore_Exe *x_exe; */
pid_t xpid;
 
@@ -160,9 +165,15 @@
 _entrance_x_sa.sa_flags = 0;
 sigemptyset(&_entrance_x_sa.sa_mask);
 sigaction(SIGUSR1, &_entrance_x_sa, NULL);
-  /* FIXME: need to parse command and NOT go thru /bin/sh */
-  /* why? some /bin/sh's wont pass on this SIGUSR1 thing... */
-execl("/bin/sh", "/bin/sh", "-c", x_cmd, NULL);
+
+   x_cmd_argv[0]=strtok(x_cmd," ");
+   i=1;
+
+   while ((x_cmd_argv[i]=strtok(NULL," "))!=NULL) {
+  i++;
+   }
+
+execvp(x_cmd_argv[0], x_cmd_argv);
 syslog(LOG_WARNING, "Could not execute X server.");
 exit(1);
  default:
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel