Bug 14551 - hexedit-applet desperately needs a "readonly"-option
Summary: hexedit-applet desperately needs a "readonly"-option
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.33.x
Hardware: All Linux
: P5 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-25 19:57 UTC by Guenther Brunthaler
Modified: 2022-01-25 19:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guenther Brunthaler 2022-01-25 19:57:23 UTC
The "hexedit" BB applet is extremely useful for quickly examining boot sectors, partition tables and similar on-disk structures.

However, the current applet does not have a "readonly" option, and immediately writes any keyboard input to the disk.

This makes the usage of this applet extremely dangerous in practice: Accidentally pressing any key which corresponds to a hexadecimal character immediately damages the boot sector, superblock of a filesystem etc.

I therefore strongly recommend either adding a "-r" option to the applet for opening the target in read-only mode, or adding a second applet (like "hexbrowse") which shares the same code except for the mode argument to open().

Another option would be to cache the input in a buffer and only write it back after issuing a special local subcommand, such as pressing the F2 key in the original hexedit application.