Skip to contentSkip to conversation

PXE directory listing incorrectly reported as "success"

DISCUSSION Robert Millan 3 participants 3 messages Jan 26, 2010 – Jan 27, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

It appears that directory listing isn't supported by TFTP protocol (so says our wiki).

Our pxe.c implements grub_pxefs_dir() as a dummy stub that returns GRUB_ERR_NONE. This is obviously wrong, as it prevents the user from noticing that there was a problem, and silently reports an "empty" directory. Instead, it should call grub_error ().

Unfortunately, kern/fs.c relies on grub_pxefs_dir() returning GRUB_ERR_NONE in order to consider probing to be succesful. If pxe returned an error, it wouldn't be considered a valid filesystem by the kernel.

So I'm wondering, what would be a good solution to this? We could add a proper probe() function and switch all filesystems to it, but only for the benefit of pxe it seems a bit overkill.

Does someone have a better idea?

Signature · 3 lines
Robert Millan

  "Be the change you want to see in the world" -- Gandhi
#1 lore raw

How about returning one entry named 'pxe/tftp doesn't support
directory listing' :).

--S

Quoted 32 lines · Robert Millan

Hi,

It appears that directory listing isn't supported by TFTP protocol (so says our wiki).

Our pxe.c implements grub_pxefs_dir() as a dummy stub that returns GRUB_ERR_NONE. This is obviously wrong, as it prevents the user from noticing that there was a problem, and silently reports an "empty" directory. Instead, it should call grub_error ().

Unfortunately, kern/fs.c relies on grub_pxefs_dir() returning GRUB_ERR_NONE in order to consider probing to be succesful. If pxe returned an error, it wouldn't be considered a valid filesystem by the kernel.

So I'm wondering, what would be a good solution to this? We could add a proper probe() function and switch all filesystems to it, but only for the benefit of pxe it seems a bit overkill.

Does someone have a better idea?

Signature · 9 lines
Robert Millan

 "Be the change you want to see in the world" -- Gandhi


_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
#2 lore raw
In reply to Robert Millan
Quoted 10 lines · Robert Millan

Hi,

It appears that directory listing isn't supported by TFTP protocol (so says our wiki).

Our pxe.c implements grub_pxefs_dir() as a dummy stub that returns GRUB_ERR_NONE. This is obviously wrong, as it prevents the user from noticing that there was a problem, and silently reports an "empty" directory. Instead, it should call grub_error ().

Quoted 6 lines

Unfortunately, kern/fs.c relies on grub_pxefs_dir() returning GRUB_ERR_NONE in order to consider probing to be succesful. If pxe returned an error, it wouldn't be considered a valid filesystem by the kernel.

So I'm wondering, what would be a good solution to this?

What about return GRUB_ERR_UNSUPPORTED or a separate GRUB_ERR_FS_NO_DIR which would be ignored by probing routines?

Quoted 7 lines

We could add
a proper probe() function and switch all filesystems to it, but only for the benefit of pxe it seems a bit overkill.

Does someone have a better idea?

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko