1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +00:00

Utilities/netstat: 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:
Liav A 2023-02-11 17:42:43 +02:00 committed by Sam Atkins
parent 4f26b35640
commit 38ce053296

View file

@ -48,7 +48,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil("/sys/kernel/processes", "r"));
TRY(Core::System::unveil("/etc/passwd", "r"));
TRY(Core::System::unveil("/etc/services", "r"));
TRY(Core::System::unveil("/tmp/portal/lookup", "rw"));
if (!flag_numeric)
TRY(Core::System::unveil("/tmp/portal/lookup", "rw"));
TRY(Core::System::unveil(nullptr, nullptr));
bool has_protocol_flag = (flag_tcp || flag_udp);