loadrandom() status should be ignored, so that we do not loop.
authorderaadt <deraadt@openbsd.org>
Thu, 2 Jan 2014 00:03:04 +0000 (00:03 +0000)
committerderaadt <deraadt@openbsd.org>
Thu, 2 Jan 2014 00:03:04 +0000 (00:03 +0000)
issue reported by halex

sys/stand/boot/boot.c

index 7c8b6eb..91ed765 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: boot.c,v 1.38 2013/12/28 02:51:07 deraadt Exp $       */
+/*     $OpenBSD: boot.c,v 1.39 2014/01/02 00:03:04 deraadt Exp $       */
 
 /*
  * Copyright (c) 2003 Dale Rahn
@@ -88,16 +88,17 @@ boot(dev_t bootdev)
                                printf("boot> ");
                        } while(!getcmd());
                }
-               st = 0;
-               bootprompt = 1; /* allow reselect should we fail */
 
                st = loadrandom(BOOTRANDOM, rnddata, sizeof(rnddata));
-               if (st != 0)
+               if (st)
                        printf("loadrandom: error %d\n", st);
 #ifdef MDRANDOM
                mdrandom(rnddata, sizeof(rnddata));
 #endif
 
+               st = 0;
+               bootprompt = 1; /* allow reselect should we fail */
+
                printf("booting %s: ", cmd.path);
                marks[MARK_START] = (u_long)cmd.addr;
                if ((fd = loadfile(cmd.path, marks, LOAD_ALL)) != -1) {