Re: [PATCH] libmisc/shell: Fix the handling of joel scripts in telnet

2020-02-17 Thread Chris Johns
On 17/2/20 8:47 pm, Chris Johns wrote:
> 
>> On 17 Feb 2020, at 5:51 pm, Sebastian Huber 
>>  wrote:
>>
>> On 17/02/2020 07:05, chr...@rtems.org wrote:
>>> From: Chris Johns
>>> - Fix the passing of std[in/out] to child threads
>>> - Fix deleting of managed memory in the key destructor
>>> - Only set the key in the main loop thread
>>> - Only allocate a shell env outside of the main loop
>>> - Work around #3970
>>> - Fix memory leak if the task start fails
>>> - Remove error level from shell env, it cannot be returned this way. Add
>>>   exit_code but the API is broken so it cannot be returned.
>>> Closes #3859
>>
>> Any changes required in existing Telnet application code after this patch?
> 
> No. The intention is to not break telnet.

Actually this may not be true, it depends on how the user has implemented their
telnet command. If it is similar to the libbsd telnet test it will build but
fail at runtime. The call `rtems_shell_dup_current_env` needs to be made. I am
going enforce this by checking the magic number in the struct in the shell main
loop call.

The libbsd telnet test needs to be ...

static void
telnet_shell(char *name, void *arg)
{
rtems_shell_env_t env;

rtems_shell_dup_current_env(&env);

env.devname = name;
env.taskname = "TLNT";
env.login_check = NULL;
env.forever = false;

rtems_shell_main_loop(&env);
}

The env dup call is present in 4.11.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] libmisc/shell: Fix the handling of joel scripts in telnet

2020-02-17 Thread Chris Johns

> On 17 Feb 2020, at 5:51 pm, Sebastian Huber 
>  wrote:
> 
> On 17/02/2020 07:05, chr...@rtems.org wrote:
>> From: Chris Johns
>> - Fix the passing of std[in/out] to child threads
>> - Fix deleting of managed memory in the key destructor
>> - Only set the key in the main loop thread
>> - Only allocate a shell env outside of the main loop
>> - Work around #3970
>> - Fix memory leak if the task start fails
>> - Remove error level from shell env, it cannot be returned this way. Add
>>   exit_code but the API is broken so it cannot be returned.
>> Closes #3859
> 
> Any changes required in existing Telnet application code after this patch?

No. The intention is to not break telnet. 

Chris

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] libmisc/shell: Fix the handling of joel scripts in telnet

2020-02-16 Thread Sebastian Huber

On 17/02/2020 07:05, chr...@rtems.org wrote:

From: Chris Johns

- Fix the passing of std[in/out] to child threads
- Fix deleting of managed memory in the key destructor
- Only set the key in the main loop thread
- Only allocate a shell env outside of the main loop
- Work around #3970
- Fix memory leak if the task start fails
- Remove error level from shell env, it cannot be returned this way. Add
   exit_code but the API is broken so it cannot be returned.

Closes #3859


Any changes required in existing Telnet application code after this patch?

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel