diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-10-08 13:40:13 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-10-08 13:40:13 +0000 |
commit | 373a931f456740d06753b8a302d20b6ce80d8f28 (patch) | |
tree | bc557f92467ac3e0cc7e3c58cf2beb71e696a465 /serverboot | |
parent | c32ebe9139fdfd56904e8743c3aea55ed267b159 (diff) |
1999-10-08 Thomas Bushnell, BSG <tb@mit.edu>
* bootstrap.c: (DEFAULT_ROOT): Remove macro.
(main): If no root device was specified, then prompt as if the
user had specified -a. Don't use strcpy to move NEW_ROOT into
ROOT_NAME; that's unsafe.
Diffstat (limited to 'serverboot')
-rw-r--r-- | serverboot/ChangeLog | 3 | ||||
-rw-r--r-- | serverboot/bootstrap.c | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/serverboot/ChangeLog b/serverboot/ChangeLog index 3b25fce8..3b878676 100644 --- a/serverboot/ChangeLog +++ b/serverboot/ChangeLog @@ -2,7 +2,8 @@ * bootstrap.c: (DEFAULT_ROOT): Remove macro. (main): If no root device was specified, then prompt as if the - user had specified -a. + user had specified -a. Don't use strcpy to move NEW_ROOT into + ROOT_NAME; that's unsafe. 1999-10-06 Roland McGrath <roland@baalperazim.frob.com> diff --git a/serverboot/bootstrap.c b/serverboot/bootstrap.c index 69e4f892..f6d6050a 100644 --- a/serverboot/bootstrap.c +++ b/serverboot/bootstrap.c @@ -237,14 +237,14 @@ main(argc, argv) * root device was specificed, ask for the root device. */ - if (root_name [0] == '\0' || index(flag_string, 'a')) { + if (!root_name || root_name [0] == '\0' || index(flag_string, 'a')) { static char new_root[16]; - + printf("root device? [%s] ", root_name); safe_gets(new_root, sizeof(new_root)); if (new_root[0] != '\0') - strcpy (root_name, new_root); + root_name = new_root; } (void) strbuild(boot_script_name, |