bug #60114: The "Backspace" key doesn't work correctly in the superuser authentication prompt.

2021-02-26 Thread Egor Ignatov
Hi, yesterday I submitted a bug report about wrong backspace key 
behavior in superuser login prompt and I finally found it. So I attach 
patch with my fix so it can be merged into upstream.


>From a227f1a2c54aa420e016ffb5ca1c41fe93a2bd68 Mon Sep 17 00:00:00 2001
From: Egor Ignatov 
Date: Fri, 26 Feb 2021 12:08:23 +0300
Subject: [PATCH] Fix backspace in username prompt

---
 grub-core/normal/auth.c|  4 +++-
 grub-core/normal/charset.c |  1 +
 grub-core/term/gfxterm.c   | 11 +--
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
index 6be678c0d..ffbf6d890 100644
--- a/grub-core/normal/auth.c
+++ b/grub-core/normal/auth.c
@@ -177,7 +177,9 @@ grub_username_get (char buf[], unsigned buf_size)
 	  if (cur_len)
 	{
 	  cur_len--;
-	  grub_printf ("\b \b");
+	  grub_printf ("\b");
+	  grub_printf (" ");
+	  grub_printf ("\b");
 	}
 	  continue;
 	}
diff --git a/grub-core/normal/charset.c b/grub-core/normal/charset.c
index 4dfcc3107..77073c12f 100644
--- a/grub-core/normal/charset.c
+++ b/grub-core/normal/charset.c
@@ -931,6 +931,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t *logical,
 	pop_stack ();
 	break;
 	  case GRUB_BIDI_TYPE_BN:
+	visual_len++;
 	break;
 	  case GRUB_BIDI_TYPE_R:
 	  case GRUB_BIDI_TYPE_AL:
diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c
index af7c090a3..130d33988 100644
--- a/grub-core/term/gfxterm.c
+++ b/grub-core/term/gfxterm.c
@@ -846,8 +846,15 @@ grub_gfxterm_putchar (struct grub_term_output *term,
   switch (c->base)
 {
 case '\b':
-  if (virtual_screen.cursor_x > 0)
-virtual_screen.cursor_x--;
+	  if (virtual_screen.cursor_x > 0)
+	{
+	  virtual_screen.cursor_x--;
+	}
+	  else if (virtual_screen.cursor_y > 0)
+	{
+	  virtual_screen.cursor_y--;
+	  virtual_screen.cursor_x = virtual_screen.columns-2;
+	}
   break;
 
 case '\n':
-- 
2.25.4

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] password: Fix backspace in username prompt

2021-03-01 Thread Egor Ignatov
From: Egor Ignatov 

Make backspace work in superuser login prompt.

The problem was that bidi logical to visual ignored BN type,
so you couldn't print control characters.

Use grub_printf() 3 times, because a line wrap will cause
the cursor to get stuck at the end of the terminal line.

Resolves: #60114
Signed-off-by: Egor Ignatov 
---
 grub-core/normal/auth.c|  4 +++-
 grub-core/normal/charset.c |  1 +
 grub-core/term/gfxterm.c   | 11 +--
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
index 6be678c0d..ffbf6d890 100644
--- a/grub-core/normal/auth.c
+++ b/grub-core/normal/auth.c
@@ -177,7 +177,9 @@ grub_username_get (char buf[], unsigned buf_size)
  if (cur_len)
{
  cur_len--;
- grub_printf ("\b \b");
+ grub_printf ("\b");
+ grub_printf (" ");
+ grub_printf ("\b");
}
  continue;
}
diff --git a/grub-core/normal/charset.c b/grub-core/normal/charset.c
index 4dfcc3107..77073c12f 100644
--- a/grub-core/normal/charset.c
+++ b/grub-core/normal/charset.c
@@ -931,6 +931,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t 
*logical,
pop_stack ();
break;
  case GRUB_BIDI_TYPE_BN:
+   visual_len++;
break;
  case GRUB_BIDI_TYPE_R:
  case GRUB_BIDI_TYPE_AL:
diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c
index af7c090a3..b6f384796 100644
--- a/grub-core/term/gfxterm.c
+++ b/grub-core/term/gfxterm.c
@@ -846,8 +846,15 @@ grub_gfxterm_putchar (struct grub_term_output *term,
   switch (c->base)
 {
 case '\b':
-  if (virtual_screen.cursor_x > 0)
-virtual_screen.cursor_x--;
+ if (virtual_screen.cursor_x > 0)
+   {
+ virtual_screen.cursor_x--;
+   }
+ else if (virtual_screen.cursor_y > 0)
+   {
+ virtual_screen.cursor_y--;
+ virtual_screen.cursor_x = virtual_screen.columns-2;
+   }
   break;
 
 case '\n':
-- 
2.25.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] password: Fix backspace in username prompt

2021-03-01 Thread Egor Ignatov
From: Egor Ignatov 

Make backspace work in superuser login prompt.

The problem was that bidi logical to visual ignored BN type,
so you couldn't print control characters.

Use grub_printf() 3 times, because a line wrap will cause
the cursor to get stuck at the end of the terminal line.

Resolves: #60114
Signed-off-by: Egor Ignatov 
---
 grub-core/normal/auth.c| 4 +++-
 grub-core/normal/charset.c | 1 +
 grub-core/term/gfxterm.c   | 9 -
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
index 6be678c0d..ffbf6d890 100644
--- a/grub-core/normal/auth.c
+++ b/grub-core/normal/auth.c
@@ -177,7 +177,9 @@ grub_username_get (char buf[], unsigned buf_size)
  if (cur_len)
{
  cur_len--;
- grub_printf ("\b \b");
+ grub_printf ("\b");
+ grub_printf (" ");
+ grub_printf ("\b");
}
  continue;
}
diff --git a/grub-core/normal/charset.c b/grub-core/normal/charset.c
index 4dfcc3107..77073c12f 100644
--- a/grub-core/normal/charset.c
+++ b/grub-core/normal/charset.c
@@ -931,6 +931,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t 
*logical,
pop_stack ();
break;
  case GRUB_BIDI_TYPE_BN:
+   visual_len++;
break;
  case GRUB_BIDI_TYPE_R:
  case GRUB_BIDI_TYPE_AL:
diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c
index af7c090a3..5b0660cd2 100644
--- a/grub-core/term/gfxterm.c
+++ b/grub-core/term/gfxterm.c
@@ -847,7 +847,14 @@ grub_gfxterm_putchar (struct grub_term_output *term,
 {
 case '\b':
   if (virtual_screen.cursor_x > 0)
-virtual_screen.cursor_x--;
+{
+  virtual_screen.cursor_x--;
+}
+  else if (virtual_screen.cursor_y > 0)
+{
+  virtual_screen.cursor_y--;
+  virtual_screen.cursor_x = virtual_screen.columns-2;
+}
   break;
 
 case '\n':
-- 
2.25.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] password: Fix backspace in username prompt

2021-03-01 Thread Egor Ignatov
Make backspace work in superuser login prompt.

The problem was that bidi logical to visual ignored BN type,
so you couldn't print control characters.

Use grub_printf() 3 times, because a line wrap will cause
the cursor to get stuck at the end of the terminal line.

Resolves: #60114
Signed-off-by: Egor Ignatov 
---
 grub-core/normal/auth.c| 4 +++-
 grub-core/normal/charset.c | 1 +
 grub-core/term/gfxterm.c   | 9 -
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
index 6be678c0d..ffbf6d890 100644
--- a/grub-core/normal/auth.c
+++ b/grub-core/normal/auth.c
@@ -177,7 +177,9 @@ grub_username_get (char buf[], unsigned buf_size)
  if (cur_len)
{
  cur_len--;
- grub_printf ("\b \b");
+ grub_printf ("\b");
+ grub_printf (" ");
+ grub_printf ("\b");
}
  continue;
}
diff --git a/grub-core/normal/charset.c b/grub-core/normal/charset.c
index 4dfcc3107..77073c12f 100644
--- a/grub-core/normal/charset.c
+++ b/grub-core/normal/charset.c
@@ -931,6 +931,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t 
*logical,
pop_stack ();
break;
  case GRUB_BIDI_TYPE_BN:
+   visual_len++;
break;
  case GRUB_BIDI_TYPE_R:
  case GRUB_BIDI_TYPE_AL:
diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c
index af7c090a3..5b0660cd2 100644
--- a/grub-core/term/gfxterm.c
+++ b/grub-core/term/gfxterm.c
@@ -847,7 +847,14 @@ grub_gfxterm_putchar (struct grub_term_output *term,
 {
 case '\b':
   if (virtual_screen.cursor_x > 0)
-virtual_screen.cursor_x--;
+{
+  virtual_screen.cursor_x--;
+}
+  else if (virtual_screen.cursor_y > 0)
+{
+  virtual_screen.cursor_y--;
+  virtual_screen.cursor_x = virtual_screen.columns-2;
+}
   break;
 
 case '\n':
-- 
2.25.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] password: Fix backspace in username prompt

2021-03-02 Thread Egor Ignatov
I used grub_printf 3 times, because for some reason (line wrapping I 
guess) if you print "\b \b" at once the backspace key doesn't work on 
the second last character in the terminal line. The visual cursor gets 
stuck there and doesn't remove characters anymore, although you can 
still type more.
This may be irrelevant because I doubt anyone is using a username longer 
than one line, but it solves the problem.


On 3/1/21 8:26 PM, Lennart Sorensen wrote:

On Mon, Mar 01, 2021 at 10:58:40AM +0300, Egor Ignatov wrote:

From: Egor Ignatov 

Make backspace work in superuser login prompt.

The problem was that bidi logical to visual ignored BN type,
so you couldn't print control characters.

Use grub_printf() 3 times, because a line wrap will cause
the cursor to get stuck at the end of the terminal line.

Resolves: #60114
Signed-off-by: Egor Ignatov 
---
  grub-core/normal/auth.c|  4 +++-
  grub-core/normal/charset.c |  1 +
  grub-core/term/gfxterm.c   | 11 +--
  3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
index 6be678c0d..ffbf6d890 100644
--- a/grub-core/normal/auth.c
+++ b/grub-core/normal/auth.c
@@ -177,7 +177,9 @@ grub_username_get (char buf[], unsigned buf_size)
  if (cur_len)
{
  cur_len--;
- grub_printf ("\b \b");
+ grub_printf ("\b");
+ grub_printf (" ");
+ grub_printf ("\b");
}
  continue;
}

Is this the part that the commit message refers to?  I must admit I
am not quite sure why this change makes a difference, but if it does,
perhaps it is important (and non obvious) enough that the code should
actually have a comment explaining it, or someone might come by and
clean it up again later.



___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] password: Fix backspace in username prompt

2021-03-04 Thread Egor Ignatov
From: Egor Ignatov 

Make backspace work in superuser login prompt.

The problem was that bidi logical to visual ignored BN type,
so you couldn't print control characters.

Use grub_printf() 3 times, because if you print "\b \b" at
once the cursor will get stuck on the second last character.

Resolves: #60114
Signed-off-by: Egor Ignatov 
---
 grub-core/normal/auth.c| 10 +-
 grub-core/normal/charset.c |  1 +
 grub-core/term/gfxterm.c   |  9 -
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
index 6be678c0d..cf57a1b7e 100644
--- a/grub-core/normal/auth.c
+++ b/grub-core/normal/auth.c
@@ -177,7 +177,15 @@ grub_username_get (char buf[], unsigned buf_size)
  if (cur_len)
{
  cur_len--;
- grub_printf ("\b \b");
+ /* NOTE(eg...@altlinux.org):
+grub_printf used 3 times, because for some reason
+(line wrapping I guess) if you print "\b \b" at once
+the backspace key doesn't work on the second last
+character.
+ */
+ grub_printf ("\b");
+ grub_printf (" ");
+ grub_printf ("\b");
}
  continue;
}
diff --git a/grub-core/normal/charset.c b/grub-core/normal/charset.c
index 4dfcc3107..77073c12f 100644
--- a/grub-core/normal/charset.c
+++ b/grub-core/normal/charset.c
@@ -931,6 +931,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t 
*logical,
pop_stack ();
break;
  case GRUB_BIDI_TYPE_BN:
+   visual_len++;
break;
  case GRUB_BIDI_TYPE_R:
  case GRUB_BIDI_TYPE_AL:
diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c
index af7c090a3..5b0660cd2 100644
--- a/grub-core/term/gfxterm.c
+++ b/grub-core/term/gfxterm.c
@@ -847,7 +847,14 @@ grub_gfxterm_putchar (struct grub_term_output *term,
 {
 case '\b':
   if (virtual_screen.cursor_x > 0)
-virtual_screen.cursor_x--;
+{
+  virtual_screen.cursor_x--;
+}
+  else if (virtual_screen.cursor_y > 0)
+{
+  virtual_screen.cursor_y--;
+  virtual_screen.cursor_x = virtual_screen.columns-2;
+}
   break;
 
 case '\n':
-- 
2.25.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] Fix backspace in the username login prompt

2021-04-29 Thread Egor Ignatov
This patch fixes an old bug when backspace key does not work in the
username login prompt. It allows BIDI type BN characters (control
chars like '\b') in the visual line. And when grub_gfxterm_putchar
recieves this line it successfully processes backspace.

Signed-off-by: Egor Ignatov 
---
Hi, I'd like to try to propose this patch again. I'm new to the open
source community, so any feedback and suggestions will be appreciated.

 grub/grub-core/normal/charset.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/grub/grub-core/normal/charset.c b/grub/grub-core/normal/charset.c
index b0ab47d73..30e819bdf 100644
--- a/grub/grub-core/normal/charset.c
+++ b/grub/grub-core/normal/charset.c
@@ -925,6 +925,7 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t 
*logical,
pop_stack ();
break;
  case GRUB_BIDI_TYPE_BN:
+   visual_len++;
break;
  case GRUB_BIDI_TYPE_R:
  case GRUB_BIDI_TYPE_AL:
-- 
2.25.4

___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH v2] Fix backspace in the username login prompt

2021-05-10 Thread Egor Ignatov
This patch fixes a bug when backspace key does not work in the
username login prompt. It allows backspace characters in the BIDI
visual line. Thus grub_gfxterm_putchar receives '\b' chars that
were previously ignored.

Signed-off-by: Egor Ignatov 
---
> Did you test this patch with other BIDI type BN characters [1]? I am not

You are right, I added a check to handle only backspace characters

> convinced it works with them as expected. I think earlier version of your
> patch was more promising...

Earlier versions of my patch included workaround for special case when
the password is longer than one line. This scenario is not very
realistic and I dont think it's worth complicating the codebase.

Thank you for your response.
Let me know if you have any concerns about this version.

Egor

 grub-core/normal/charset.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/grub-core/normal/charset.c b/grub-core/normal/charset.c
index 4dfcc3107..8e7add1f8 100644
--- a/grub-core/normal/charset.c
+++ b/grub-core/normal/charset.c
@@ -931,6 +931,8 @@ grub_bidi_line_logical_to_visual (const grub_uint32_t 
*logical,
pop_stack ();
break;
  case GRUB_BIDI_TYPE_BN:
+   if (visual[visual_len].base == '\b')
+ visual_len++;
break;
  case GRUB_BIDI_TYPE_R:
  case GRUB_BIDI_TYPE_AL:
-- 
2.29.3


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH v2] Fix backspace in the username login prompt

2021-05-18 Thread Egor Ignatov

On 5/17/21 7:34 PM, Daniel Kiper wrote:

Did you test your patch outside of username login prompt, e.g. CLI or
menu entry editing? I am afraid your patch breaks at least these cases.

Daniel


Indeed I tested it with both CLI and menu entry editing and it works fine.

Thank you for taking the time to answer me.

Egor
___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH 2/3] fs/xfs: Fix grub_xfs_iterate_dir return value in case of failure

2025-01-23 Thread Egor Ignatov
Commit ef7850c757 introduced multiple boundary checks in grub_xfs_iterate_dir()
but handled the error incorrectly returning error code instead of 0.

Also change the error message so that it doesn't match the message
in grub_xfs_read_inode().

Fixes: ef7850c757 (fs/xfs: Fix issues found while fuzzing the XFS filesystem)

Signed-off-by: Egor Ignatov 
---
 grub-core/fs/xfs.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
index 7c903f01a3..ba31559c5c 100644
--- a/grub-core/fs/xfs.c
+++ b/grub-core/fs/xfs.c
@@ -844,7 +844,11 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
grub_uint8_t c;
 
if ((inopos + (smallino ? 4 : 8)) > (grub_uint8_t *) dir + 
grub_xfs_fshelp_size (dir->data))
- return grub_error (GRUB_ERR_BAD_FS, "not a correct XFS inode");
+ {
+   grub_error (GRUB_ERR_BAD_FS, "invalid XFS inode");
+   return 0;
+ }
+
 
/* inopos might be unaligned.  */
if (smallino)
@@ -963,7 +967,10 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
 
filename = (char *)(direntry + 1);
if (filename + direntry->len + 1 > (char *) end)
- return grub_error (GRUB_ERR_BAD_FS, "invalid XFS directory 
entry");
+ {
+   grub_error (GRUB_ERR_BAD_FS, "invalid XFS directory entry");
+   return 0;
+ }
 
/* The byte after the filename is for the filetype, padding, or
   tag, which is not used by GRUB.  So it can be overwritten. */
-- 
2.42.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH 3/3] fs/xfs: Propagate incorrect inode error from grub_xfs_read_inode

2025-01-23 Thread Egor Ignatov
The incorrect inode error from grub_xfs_read_inode did not propagate because
grub_print_error() resetted grub_errno, and grub_xfs_iterate_dir() did not
handle it at all.

Signed-off-by: Egor Ignatov 
---
 grub-core/fs/xfs.c | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
index ba31559c5c..60aba1dd8d 100644
--- a/grub-core/fs/xfs.c
+++ b/grub-core/fs/xfs.c
@@ -780,7 +780,6 @@ static int iterate_dir_call_hook (grub_uint64_t ino, const 
char *filename,
   fdiro = grub_malloc (grub_xfs_fshelp_size(ctx->diro->data) + 1);
   if (!fdiro)
 {
-  grub_print_error ();
   return 0;
 }
 
@@ -792,7 +791,6 @@ static int iterate_dir_call_hook (grub_uint64_t ino, const 
char *filename,
   err = grub_xfs_read_inode (ctx->diro->data, ino, &fdiro->inode);
   if (err)
 {
-  grub_print_error ();
   grub_free (fdiro);
   return 0;
 }
@@ -832,9 +830,13 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
/* Synthesize the direntries for `.' and `..'.  */
if (iterate_dir_call_hook (diro->ino, ".", &ctx))
  return 1;
+   else if (grub_errno)
+ return 0;
 
if (iterate_dir_call_hook (parent, "..", &ctx))
  return 1;
+   else if (grub_errno)
+ return 0;
 
for (i = 0; i < head->count &&
 (grub_uint8_t *) de < ((grub_uint8_t *) dir + grub_xfs_fshelp_size 
(dir->data)); i++)
@@ -875,6 +877,9 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
  }
de->name[de->len] = c;
 
+   if (grub_errno)
+ return 0;
+
de = grub_xfs_inline_next_de(dir->data, head, de);
  }
break;
@@ -982,6 +987,11 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
grub_free (dirblock);
return 1;
  }
+   else if (grub_errno)
+ {
+   grub_free (dirblock);
+   return 0;
+ }
 
/*
 * The expected number of directory entries is only tracked for 
the
-- 
2.42.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH 1/3] fs/xfs: Handle root inode read failure in grub_xfs_mount

2025-01-23 Thread Egor Ignatov
Signed-off-by: Egor Ignatov 
---
 grub-core/fs/xfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c
index 8e02ab4a30..7c903f01a3 100644
--- a/grub-core/fs/xfs.c
+++ b/grub-core/fs/xfs.c
@@ -1053,6 +1053,8 @@ grub_xfs_mount (grub_disk_t disk)
   grub_cpu_to_be64(data->sblock.rootino));
 
   grub_xfs_read_inode (data, data->diropen.ino, &data->diropen.inode);
+  if (grub_errno)
+goto fail;
 
   return data;
  fail:
-- 
2.42.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH 0/3] XFS error handling fixes

2025-01-23 Thread Egor Ignatov
This patchset fixes several issues with error handling in xfs module.

Egor Ignatov (3):
  fs/xfs: Handle root inode read failure in grub_xfs_mount
  fs/xfs: Fix grub_xfs_iterate_dir return value in case of failure
  fs/xfs: Propagate incorrect inode error from grub_xfs_read_inode

 grub-core/fs/xfs.c | 27 +++
 1 file changed, 23 insertions(+), 4 deletions(-)

-- 
2.42.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] util/grub-install: Include raid5rec module for RAID 4 as well

2025-04-10 Thread Egor Ignatov
RAID 4 requires the same recovery module as RAID 5. Extend the condition to
cover both RAID levels.

Signed-off-by: Egor Ignatov 
---
 util/grub-install.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/grub-install.c b/util/grub-install.c
index 7dc5657bb..060246589 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -459,7 +459,7 @@ probe_mods (grub_disk_t disk)
   if (disk->dev->disk_raidname)
grub_install_push_module (disk->dev->disk_raidname (disk));
 }
-  if (raid_level == 5)
+  if (raid_level == 4 || raid_level == 5)
 grub_install_push_module ("raid5rec");
   if (raid_level == 6)
 grub_install_push_module ("raid6rec");
-- 
2.42.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] luks2: Add attempting to decrypt message to align with luks and geli modules

2025-05-27 Thread Egor Ignatov
Signed-off-by: Egor Ignatov 
---
 grub-core/disk/luks2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c
index 8036d76ff..b17cd2115 100644
--- a/grub-core/disk/luks2.c
+++ b/grub-core/disk/luks2.c
@@ -579,6 +579,8 @@ luks2_recover_key (grub_disk_t source,
   if (ret)
 return ret;
 
+  grub_puts_ (N_("Attempting to decrypt master key..."));
+
   if (grub_sub (grub_be_to_cpu64 (header.hdr_size), sizeof (header), &sz))
 return grub_error (GRUB_ERR_OUT_OF_RANGE, "underflow detected while 
calculating json header size");
 
-- 
2.42.4


___
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel