mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
Utilities/arp: Don't unveil /tmp/portal/lookup for numerical output
It's not needed in such case, and in the near-future when we would want to use this utility in an initramfs environment where there's no service such as LookupServer being running, it's still useful to have the option to invoke this utility with the mentioned limited output functionality.
This commit is contained in:
parent
0ce1c52577
commit
4b1e501bdf
1 changed files with 6 additions and 3 deletions
|
@ -28,9 +28,6 @@
|
||||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
TRY(Core::System::pledge("stdio rpath tty inet unix"));
|
TRY(Core::System::pledge("stdio rpath tty inet unix"));
|
||||||
TRY(Core::System::unveil("/sys/kernel/net/arp", "r"));
|
|
||||||
TRY(Core::System::unveil("/tmp/portal/lookup", "rw"));
|
|
||||||
TRY(Core::System::unveil(nullptr, nullptr));
|
|
||||||
|
|
||||||
static bool flag_set;
|
static bool flag_set;
|
||||||
static bool flag_delete;
|
static bool flag_delete;
|
||||||
|
@ -47,6 +44,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
args_parser.add_positional_argument(value_hw_address, "Hardware address", "hwaddress", Core::ArgsParser::Required::No);
|
args_parser.add_positional_argument(value_hw_address, "Hardware address", "hwaddress", Core::ArgsParser::Required::No);
|
||||||
args_parser.parse(arguments);
|
args_parser.parse(arguments);
|
||||||
|
|
||||||
|
TRY(Core::System::unveil("/sys/kernel/net/arp", "r"));
|
||||||
|
if (!flag_numeric)
|
||||||
|
TRY(Core::System::unveil("/tmp/portal/lookup", "rw"));
|
||||||
|
|
||||||
|
TRY(Core::System::unveil(nullptr, nullptr));
|
||||||
|
|
||||||
enum class Alignment {
|
enum class Alignment {
|
||||||
Left,
|
Left,
|
||||||
Right
|
Right
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue