diff options
Diffstat (limited to 'sys-apps/grub/files/grub-0.90/grub-0.90-passwordprompt.patch')
-rw-r--r-- | sys-apps/grub/files/grub-0.90/grub-0.90-passwordprompt.patch | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/sys-apps/grub/files/grub-0.90/grub-0.90-passwordprompt.patch b/sys-apps/grub/files/grub-0.90/grub-0.90-passwordprompt.patch deleted file mode 100644 index 47810a9ca9b9..000000000000 --- a/sys-apps/grub/files/grub-0.90/grub-0.90-passwordprompt.patch +++ /dev/null @@ -1,146 +0,0 @@ -diff -ur grub-0.90/stage2/stage2.c grub/stage2/stage2.c ---- grub-0.90/stage2/stage2.c Thu Jul 19 01:58:59 2001 -+++ grub/stage2/stage2.c Thu Jul 19 01:59:11 2001 -@@ -316,6 +316,7 @@ - char *cur_entry = 0; - int disp_up = DISP_UP; - int disp_down = DISP_DOWN; -+ int ask_pass = 0; - - /* - * Main loop for menu UI. -@@ -423,8 +424,72 @@ - grub_printf ("\n\ - Use the %c and %c keys to select which entry is highlighted.\n", - disp_up, disp_down); -- -- if (! auth && password) -+ -+ if (! auth && password && ask_pass) -+ { -+ /* Do password check here! */ -+ char entered[32]; -+ char *pptr = password; -+ -+ /* we've asked, so don't ask again */ -+ ask_pass = 0; -+ -+ if (terminal & TERMINAL_DUMB) -+ grub_printf ("\n\nThe selected entry is %d ", entryno); -+ else -+ { -+ print_entries (view_y0 + 3, 12, first_entry, menu_entries); -+ /* highlight initial line */ -+ set_line_highlight (view_y0 + 4 + entryno, first_entry + entryno, -+ menu_entries); -+ } -+ -+ /* Wipe out the previously entered password */ -+ memset (entered, 0, sizeof (entered)); -+ gotoxy (view_x0 + 1, view_y0 + 16); -+ get_cmdline (" Password: ", entered, 31, '*', 0); -+ -+ while (! isspace (*pptr) && *pptr) -+ pptr++; -+ -+ /* Make sure that PASSWORD is NUL-terminated. */ -+ *pptr++ = 0; -+ -+ if (! check_password (entered, password, password_type)) -+ { -+ char *new_file = config_file; -+ -+ while (isspace (*pptr)) -+ pptr++; -+ -+ /* If *PPTR is NUL, then allow the user to use -+ privileged instructions, otherwise, load -+ another configuration file. */ -+ if (*pptr != 0) -+ { -+ while ((*(new_file++) = *(pptr++)) != 0) -+ ; -+ -+ /* Make sure that the user will not have -+ authority in the next configuration. */ -+ auth = 0; -+ return; -+ } -+ else -+ { -+ /* Now the user is superhuman. */ -+ auth = 1; -+ goto restart; -+ } -+ } -+ else -+ { -+ printf (" Failed!\n Press any key to continue..."); -+ getkey (); -+ goto restart; -+ } -+ } -+ else if (! auth && password) - { - printf ("\ - Press enter to boot the selected OS or \'p\' to enter a\n\ -@@ -637,57 +702,8 @@ - { - if (c == 'p') - { -- /* Do password check here! */ -- char entered[32]; -- char *pptr = password; -- -- if (terminal & TERMINAL_DUMB) -- grub_printf ("\r "); -- else -- gotoxy (view_x0 + 1, view_y1 + 21); -- -- /* Wipe out the previously entered password */ -- memset (entered, 0, sizeof (entered)); -- get_cmdline (" Password: ", entered, 31, '*', 0); -- -- while (! isspace (*pptr) && *pptr) -- pptr++; -- -- /* Make sure that PASSWORD is NUL-terminated. */ -- *pptr++ = 0; -- -- if (! check_password (entered, password, password_type)) -- { -- char *new_file = config_file; -- while (isspace (*pptr)) -- pptr++; -- -- /* If *PPTR is NUL, then allow the user to use -- privileged instructions, otherwise, load -- another configuration file. */ -- if (*pptr != 0) -- { -- while ((*(new_file++) = *(pptr++)) != 0) -- ; -- -- /* Make sure that the user will not have -- authority in the next configuration. */ -- auth = 0; -- return; -- } -- else -- { -- /* Now the user is superhuman. */ -- auth = 1; -- goto restart; -- } -- } -- else -- { -- printf ("Failed!\n Press any key to continue..."); -- getkey (); -- goto restart; -- } -+ ask_pass = 1; -+ goto restart; - } - } - else |