Changeset e565720a in rtems


Ignore:
Timestamp:
05/24/01 21:43:08 (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
b2712e3
Parents:
aaf6063
Message:

2000-05-24 Fernando Ruiz Casas <fernando.ruiz@…>

  • libc/ttyname.c (ttyname_r): Removed duplicate call to closedir().
  • libc/getpwent.c: Create a more robust /etc/passwd and /etc/group.
  • libc/base_fs.c: Change permissions of files and directories. Now uses octal constants.
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libcsupport/src/base_fs.c

    raaf6063 re565720a  
    5555   */
    5656
    57   rtems_filesystem_umask = S_IWOTH | S_IROTH;
     57  rtems_filesystem_umask = 022;
     58
    5859
    5960  init_fs_mount_table();
     
    7879  rtems_filesystem_current     = rtems_filesystem_root;
    7980
     81
    8082  /*
    8183   *  Traditionally RTEMS devices are under "/dev" so install this directory.
     
    8587   *  NOTE: UNIX root is 755 and owned by root/root (0/0).
    8688   */
     89  status=chmod("/", 0755);
     90  if ( status != 0 )
     91    rtems_fatal_error_occurred( 0xABCD0003 );
    8792
    88   status = mkdir( "/dev", S_IRWXU | S_IRWXG | S_IRWXO );
     93  status = mkdir( "/dev", 0777);
    8994  if ( status != 0 )
    9095    rtems_fatal_error_occurred( 0xABCD0003 );
  • c/src/exec/libcsupport/src/getpwent.c

    raaf6063 re565720a  
    5858  etc_passwd_initted = 1;
    5959 
    60   (void) mkdir( "/etc", S_IRWXU | S_IRWXG | S_IRWXO );
     60  (void) mkdir( "/etc", 0777);
    6161
    6262  /*
     
    6767    return;
    6868
    69   fprintf( fp, "root:*:0:0:root,,,,:/tmp:/bin/false\n"
    70                "rtems:*:1:1:RTEMS Application,,,,:/tmp:/bin/false\n" );
     69  fprintf( fp, "root:*:0:0:root,,,,:/:/bin/sh\n"
     70               "rtems:*:1:1:RTEMS Application,,,,:/:/bin/sh\n"
     71               "tty:!:2:2:tty owner,,,,:/:/bin/false\n" );
    7172
    7273  fclose( fp );
     
    7980    return;
    8081
    81   fprintf( fp, "root::0:root\n"
    82                "rtems::0:rtems\n" );
     82  fprintf( fp, "root:x:0:root\n"
     83               "rtems:x:1:rtems\n"
     84               "tty:x:2:tty\n" );
    8385
    8486  fclose( fp );
  • c/src/exec/libcsupport/src/ttyname.c

    raaf6063 re565720a  
    4040
    4141  /* Must be a character device. */
    42   if (_fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
     42  if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
    4343    set_errno_and_return_minus_one(EBADF);
    4444
     
    5454          sb.st_ino != dsb.st_ino)
    5555        continue;
    56       (void) closedir (dp);
    5756      rval = name;
    5857      break;
  • c/src/lib/ChangeLog

    raaf6063 re565720a  
     12000-05-24      Fernando Ruiz Casas <fernando.ruiz@ctv.es>
     2
     3        * libc/ttyname.c (ttyname_r): Removed duplicate call to closedir().
     4        * libc/getpwent.c: Create a more robust /etc/passwd and /etc/group.
     5        * libc/base_fs.c: Change permissions of files and directories.  Now uses
     6        octal constants.
     7
    182001-05-11      Joel Sherrill <joel@OARcorp.com>
    29
  • c/src/lib/libc/base_fs.c

    raaf6063 re565720a  
    5555   */
    5656
    57   rtems_filesystem_umask = S_IWOTH | S_IROTH;
     57  rtems_filesystem_umask = 022;
     58
    5859
    5960  init_fs_mount_table();
     
    7879  rtems_filesystem_current     = rtems_filesystem_root;
    7980
     81
    8082  /*
    8183   *  Traditionally RTEMS devices are under "/dev" so install this directory.
     
    8587   *  NOTE: UNIX root is 755 and owned by root/root (0/0).
    8688   */
     89  status=chmod("/", 0755);
     90  if ( status != 0 )
     91    rtems_fatal_error_occurred( 0xABCD0003 );
    8792
    88   status = mkdir( "/dev", S_IRWXU | S_IRWXG | S_IRWXO );
     93  status = mkdir( "/dev", 0777);
    8994  if ( status != 0 )
    9095    rtems_fatal_error_occurred( 0xABCD0003 );
  • c/src/lib/libc/getpwent.c

    raaf6063 re565720a  
    5858  etc_passwd_initted = 1;
    5959 
    60   (void) mkdir( "/etc", S_IRWXU | S_IRWXG | S_IRWXO );
     60  (void) mkdir( "/etc", 0777);
    6161
    6262  /*
     
    6767    return;
    6868
    69   fprintf( fp, "root:*:0:0:root,,,,:/tmp:/bin/false\n"
    70                "rtems:*:1:1:RTEMS Application,,,,:/tmp:/bin/false\n" );
     69  fprintf( fp, "root:*:0:0:root,,,,:/:/bin/sh\n"
     70               "rtems:*:1:1:RTEMS Application,,,,:/:/bin/sh\n"
     71               "tty:!:2:2:tty owner,,,,:/:/bin/false\n" );
    7172
    7273  fclose( fp );
     
    7980    return;
    8081
    81   fprintf( fp, "root::0:root\n"
    82                "rtems::0:rtems\n" );
     82  fprintf( fp, "root:x:0:root\n"
     83               "rtems:x:1:rtems\n"
     84               "tty:x:2:tty\n" );
    8385
    8486  fclose( fp );
  • c/src/lib/libc/ttyname.c

    raaf6063 re565720a  
    4040
    4141  /* Must be a character device. */
    42   if (_fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
     42  if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
    4343    set_errno_and_return_minus_one(EBADF);
    4444
     
    5454          sb.st_ino != dsb.st_ino)
    5555        continue;
    56       (void) closedir (dp);
    5756      rval = name;
    5857      break;
  • cpukit/libcsupport/src/base_fs.c

    raaf6063 re565720a  
    5555   */
    5656
    57   rtems_filesystem_umask = S_IWOTH | S_IROTH;
     57  rtems_filesystem_umask = 022;
     58
    5859
    5960  init_fs_mount_table();
     
    7879  rtems_filesystem_current     = rtems_filesystem_root;
    7980
     81
    8082  /*
    8183   *  Traditionally RTEMS devices are under "/dev" so install this directory.
     
    8587   *  NOTE: UNIX root is 755 and owned by root/root (0/0).
    8688   */
     89  status=chmod("/", 0755);
     90  if ( status != 0 )
     91    rtems_fatal_error_occurred( 0xABCD0003 );
    8792
    88   status = mkdir( "/dev", S_IRWXU | S_IRWXG | S_IRWXO );
     93  status = mkdir( "/dev", 0777);
    8994  if ( status != 0 )
    9095    rtems_fatal_error_occurred( 0xABCD0003 );
  • cpukit/libcsupport/src/getpwent.c

    raaf6063 re565720a  
    5858  etc_passwd_initted = 1;
    5959 
    60   (void) mkdir( "/etc", S_IRWXU | S_IRWXG | S_IRWXO );
     60  (void) mkdir( "/etc", 0777);
    6161
    6262  /*
     
    6767    return;
    6868
    69   fprintf( fp, "root:*:0:0:root,,,,:/tmp:/bin/false\n"
    70                "rtems:*:1:1:RTEMS Application,,,,:/tmp:/bin/false\n" );
     69  fprintf( fp, "root:*:0:0:root,,,,:/:/bin/sh\n"
     70               "rtems:*:1:1:RTEMS Application,,,,:/:/bin/sh\n"
     71               "tty:!:2:2:tty owner,,,,:/:/bin/false\n" );
    7172
    7273  fclose( fp );
     
    7980    return;
    8081
    81   fprintf( fp, "root::0:root\n"
    82                "rtems::0:rtems\n" );
     82  fprintf( fp, "root:x:0:root\n"
     83               "rtems:x:1:rtems\n"
     84               "tty:x:2:tty\n" );
    8385
    8486  fclose( fp );
  • cpukit/libcsupport/src/ttyname.c

    raaf6063 re565720a  
    4040
    4141  /* Must be a character device. */
    42   if (_fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
     42  if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
    4343    set_errno_and_return_minus_one(EBADF);
    4444
     
    5454          sb.st_ino != dsb.st_ino)
    5555        continue;
    56       (void) closedir (dp);
    5756      rval = name;
    5857      break;
Note: See TracChangeset for help on using the changeset viewer.