All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Schmitt via Grub-devel <grub-devel@gnu.org>
To: grub-devel@gnu.org
Cc: Thomas Schmitt <scdbackup@gmx.net>
Subject: Re: How to test grub_iso9660_uuid from userland ?
Date: Mon, 01 Jul 2024 17:39:11 +0200	[thread overview]
Message-ID: <334304604835303244@scdbackup.webframe.org> (raw)
In-Reply-To: <CAEaD8JOfVEtXB4nzp9yC7e=wqqFgYjY9kDjGCieXy2vvjAUmUg@mail.gmail.com>

Hi,

the question is now:

Is it worth to correct an error text which i cannot get to show up ?


Vladimir 'phcoder' Serbinenko wrote:
> grub-fstest IMAGE ls -- -l

  $ gunzip <tests/iso9660_early_ce.iso.gz >/tmp/iso9660_early_ce.iso
  $ ./grub-fstest /tmp/iso9660_early_ce.iso ls -- -l
  ...
  Device loop0: Filesystem type iso9660 - Label `ISOIMAGE' -
  Last modification time 2023-03-04 16:28:35 Saturday,
  UUID 2023-03-04-16-28-35-00 - Sector size 512B - Total size 68KiB
  ...

Now zeroizing the modification date (offset 830 in PVD at offset 32768):

  $ dd if=/dev/zero of=/tmp/iso9660_early_ce.iso conv=notrunc bs=1 count=17 seek=33598

  $ ./grub-fstest /tmp/iso9660_early_ce.iso ls -- -l
  ...
  Device loop0: Filesystem type iso9660 - Label `ISOIMAGE' -
  Sector size 512B - Total size 68KiB
  ...
  $

Well, it did not crash and there is no UUID. But i don't see the error
message either.

Switching to the branch with my proposed error text improvements of
grub-fstest ...
Still nothing to see. Obviously grub_errno is not set after function
execute_command of grub-fstest.c.

I checked that a bad ISO still causes a visible error message

  $ /grub-fstest /tmp/iso9660_ce_loop2.iso ls / -- -l
  ls : GRUB error 9 with message 'suspecting endless CE loop'
  ./grub-fstest: error: encountered 1 error during command execution.
  $

I also zeroized creation date at offset 32768+813 of the original ISO and
verified that grub-fstest still shows an UUID.
So the only thing i could prove by my test run is that indeed GRUB depends
on ISO 9660 modification time for its UUID production.

I failed to hack the function grub_error in grub-core/kern/err.c so that
it shows grub_errmsg to me. Neither fprintf(3) nor write(2) seem in reach.
The attempt to #include /usr/include/stdio.h or /usr/include/unistd.h
fails with not found sub-header files.


Have a nice day :)

Thomas


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

      reply	other threads:[~2024-07-01 15:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 14:08 How to test grub_iso9660_uuid from userland ? Thomas Schmitt via Grub-devel
2024-07-01 14:30 ` Vladimir 'phcoder' Serbinenko
2024-07-01 15:39   ` Thomas Schmitt via Grub-devel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=334304604835303244@scdbackup.webframe.org \
    --to=grub-devel@gnu.org \
    --cc=scdbackup@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.