Commit Graph

273 Commits

Author SHA1 Message Date
Sebastian Huber
50a50313cc score: Delete superfluous Heap_Statistics::instance
This value depends on the _Heap_Initialize() call sequence and carries
no useful information.
2015-01-22 07:52:50 +01:00
Sebastian Huber
26e04e2f02 shell: Add 'all' topic for help for all commands 2014-12-12 13:16:28 +01:00
Sebastian Huber
a2097c56ad shell: Avoid __DATE__ and adjust welcome message
The use of __DATE__ prevents reproducible builds.
2014-12-05 13:09:11 +01:00
Chris Johns
e37e8504f1 libmisc/shell: Edit history hack is corrupting memory. Remove it.
The hack was a debug aid and is not needed.

Close #2203.
2014-12-01 14:53:55 +11:00
Sebastian Huber
d006b46df3 score: Add heap statistics
Add lifetime bytes allocated and freed since they were present in the
malloc statistics.  Add number of failed allocations.
2014-11-28 13:09:11 +01:00
Sebastian Huber
2c3c657625 score: Return heap stats via _Heap_Get_information
Print out heap statistics via the MALLOC and WKSPACE shell commands.
2014-11-28 13:09:07 +01:00
Sebastian Huber
01557b0c6e libcsupport: Delete malloc statistics
Use the heap handler statistics instead.  Add heap walk option to MALLOC
shell command.

close #1367
2014-11-28 11:23:53 +01:00
Sebastian Huber
43b09a9865 shell: Make mv, cp and rm usable for applications
close #2030
2014-11-27 13:37:52 +01:00
Sebastian Huber
fdd1e20579 shell: Include missing header 2014-11-26 09:58:40 +01:00
Joel Sherrill
ebb39a216d hexdump-conv.c: Use proper printf() formatting for wchar_t 2014-11-25 12:58:00 -06:00
Joel Sherrill
3bd0cd1ad5 main_edit.c: Do not reference beyond end of array 2014-11-25 12:58:00 -06:00
Joel Sherrill
d15202490c shell/main_edit.c: Note return value not checked
Coverity Id 1255320 spotted an unchecked return value.
2014-11-25 12:57:09 -06:00
Joel Sherrill
630642e21c shell/main_blksync.c: Fix leak of file descriptor
Coverity Id 1063887. File descriptor not freed on error path.
2014-11-25 12:57:09 -06:00
Joel Sherrill
4afa216ba8 cpukit/libmisc/shell/main_edit.c: Fix use after free()
Coverity Id 1255353. Read from pointer after free().
2014-11-25 12:57:08 -06:00
Sebastian Huber
6b4a22e383 shell: Include <rtems/shell.h> early
This avoids a conflict with the global variable defines.
2014-11-20 10:30:26 +01:00
Sebastian Huber
3fe5d01bc0 shell: Add CMDLS, CMDCHOWN, CMDCHMOD commands 2014-11-20 10:30:26 +01:00
Sebastian Huber
478455e0ea shell: Fix help topic header 2014-11-20 10:30:26 +01:00
Sebastian Huber
7eada71e1b shell: Add mode, UID and GID to shell commands
Use this information to determine if a command is visible to the current
user and if the current user is allowed to execute this command.
2014-11-20 10:30:26 +01:00
Sebastian Huber
ffd5285844 shell: Inherit UID and GID if no login check
Use the UID and GID of the executing user for the real and effective UID
and GID of the shell task in case no login check is present.  This
prevents privilege escalation via shell scripts.
2014-11-20 10:30:25 +01:00
Sebastian Huber
5c141d6a25 shell: Add and use rtems_shell_execute_cmd() 2014-11-20 10:30:25 +01:00
Sebastian Huber
12278585c6 shell: Make rtems_shell_main_joel() static 2014-11-20 10:30:25 +01:00
Sebastian Huber
66da4844f4 shell: Print to stderr in TIME command 2014-11-20 10:30:25 +01:00
Sebastian Huber
7840b66f74 shell: Add initial commands and aliases only once
Make tables read-only.
2014-11-20 10:30:25 +01:00
Sebastian Huber
7a2c30faee shell: Simplify rtems_shell_add_cmd_struct() 2014-11-20 10:30:24 +01:00
Sebastian Huber
bac3d6df35 shell: Rename HALT to SHUTDOWN command
Use a normal command for shutdown via exit().
2014-11-20 10:30:24 +01:00
Sebastian Huber
fa028bb2ef shell: Do chroot() after successful login 2014-11-20 10:30:24 +01:00
Sebastian Huber
373ccbb938 shell: Use exiting once initialization
Avoid TOCTOU issues.  Avoid pull in of global buffers.
2014-11-20 10:30:24 +01:00
Sebastian Huber
065d72ce7e shell: Get supplementary group IDs in login check 2014-11-20 10:30:23 +01:00
Sebastian Huber
acf9a8dd54 shell: Use crypt_r() in rtems_shell_login_check()
Use '*" to disable shell login instead of '!' according to the Linux man
page.  Use getpwnam_r() instead of getpwnam().  Do not access the user
environment directly.  Update the user environment only after a
successful login check.
2014-11-20 10:30:22 +01:00
Joel Sherrill
54998f6ef1 shell/main_edit.c: Fix warnings 2014-11-05 09:29:47 -06:00
Jennifer Averett
a7817010c5 libmisc: Add top to shell. 2014-10-27 14:12:05 -05:00
Chris Johns
42c77e9982 shell: Add an editor to the shell.
This is a small (21K on sparc) editor that provides some powerful
features useful when a file needs editing on an embedded
board. No need to copy files off, edit, copy back.
2014-10-24 16:06:54 -07:00
Sebastian Huber
21021feb60 shell: Print null mount table entry via LSOF 2014-10-16 15:15:03 +02:00
Sebastian Huber
cb513f0a5a shell: Improve LSOF output 2014-10-16 13:02:03 +02:00
Joel Sherrill
308bb9b83f shell/main_cp.c: Delete unused -rtems_shell_cp_exit() 2014-10-13 10:32:39 -05:00
Sebastian Huber
1c1b08251f shell/lsof: Fix warnings 2014-10-10 10:28:04 +02:00
Chris Johns
56ed56a641 libmisc/shell: Remove the need for -lm when linking from the ping command.
Remove the use of sqrt and so the need to link to -lm.
Clean up some warnings.
2014-10-04 08:55:12 +10:00
Chris Johns
b299960aed shell: Add an md5 hash command for files.
This command lets you get an MD5 hash for a file in an RTEMS file system.
2014-09-16 15:19:58 +10:00
Chris Johns
a8fa078f1e shell: Add a ping command.
The ping code is taken from a recent FreeBSD release. Some options have been
tested, other not tested or do not work. This could be due to the age of
our TCP/IP stack.

This version of ping will not work if more than 64 file descriptors are
open at once because the select FD size is 64 as set in newlib.
2014-09-16 15:19:58 +10:00
Joel Sherrill
06ac8b7122 shell.c: Add cast to match printf() expectations for width specifier 2014-09-04 09:08:05 -05:00
Chris Johns
bb581906a6 shell: Add rtems_shell_dup_current_env to get a default env.
Remove rtems_current_shell_env as this is dangerous because
the env can be NULL if used outside of a valid shell with the
POSIX key to an env set up.

Clean up the usage of rtems_current_shell_env.
2014-06-04 22:32:55 +10:00
Sebastian Huber
5f0ab5cfb5 shell: Make rtems_global_shell_env public
Provide rtems_global_shell_env as a public read-only variable for
backward compatibility.
2014-05-28 17:39:27 +02:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Christian Mauderer
6cd4a5ca2e cpukit/shell: Replace task variables with posix keys.
Use posix keys for current shell environment instead of task variables. With
this patch the shell needs one posix-key and one posix-key-value-pair
configured.

Update documentation for the shell.

Adapt samples/fileio:
- Add necessary objects.
- Add login function and custom device name for better testing of the shell.
2014-03-20 09:10:26 +01:00
Ralf Kirchner
27545fcac8 network: Add help text for ifconfig 2014-03-13 16:10:52 +01:00
Chris Johns
259328a78d cpukit/shell: Control help break with SHELL_LINES env variable.
Control the help command break with the SHELL_LINES evironment variable
where the numeric value is the number of lines to break on. If the
value is 0 the output is not broken. The default is 16 lines.

Add shell documentation for the help command.
2013-12-16 11:59:51 +11:00
Joel Sherrill
db97feb50d internal.h/main_mdump.c: Convert main methods to static 2013-09-23 08:22:02 -05:00
Joel Sherrill
2cdace7e80 main_mv.c: Address set but not used warning
It looks like the paths that use tval are if 0'ed for RTEMS.
Making all conditional on __rtems__ including the declaration.
2013-09-21 15:45:51 -05:00
Gedare Bloom
96654dcc1a shell: Out-of-bounds access
In case the length of cwd path plus the userScriptName exceeds
PATH_MAX (255), the strncat calls will overflow scriptFile. Also
check for getcwd failure.
2013-09-05 12:15:27 -04:00
Sebastian Huber
ae75429ca1 PR766: Delete __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 2013-08-08 14:11:22 +02:00