Changeset 7eada71 in rtems for cpukit/libmisc/shell/main_help.c


Ignore:
Timestamp:
Nov 18, 2014, 6:35:30 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
478455e0
Parents:
ffd5285
git-author:
Sebastian Huber <sebastian.huber@…> (11/18/14 06:35:30)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/20/14 09:30:26)
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/shell/main_help.c

    rffd5285 r7eada71  
    2828 */
    2929static int rtems_shell_help_cmd(
    30   rtems_shell_cmd_t *shell_cmd
     30  const rtems_shell_cmd_t *shell_cmd
    3131)
    3232{
    3333  const char * pc;
    3434  int    col,line;
     35
     36  if (!rtems_shell_can_see_cmd(shell_cmd)) {
     37    return 0;
     38  }
    3539
    3640  printf("%-12.12s - ",shell_cmd->name);
     
    150154
    151155rtems_shell_cmd_t rtems_shell_HELP_Command  =  {
    152   "help",                                       /* name  */
    153    "help [topic] # list of usage of commands",  /* usage */
    154   "help",                                       /* topic */
    155   rtems_shell_help,                             /* command */
    156   NULL,                                         /* alias */
    157   NULL                                          /* next */
     156  .name = "help",
     157  .usage = "help [topic] # list of usage of commands",
     158  .topic = "help",
     159  .command = rtems_shell_help,
     160  .mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH
    158161};
Note: See TracChangeset for help on using the changeset viewer.