diff --git a/Userland/Utilities/ntpquery.cpp b/Userland/Utilities/ntpquery.cpp index d3aff6049a..1cc94ac374 100644 --- a/Userland/Utilities/ntpquery.cpp +++ b/Userland/Utilities/ntpquery.cpp @@ -93,9 +93,6 @@ static String format_ntp_timestamp(NtpTimestamp ntp_timestamp) ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio inet unix settime wpath rpath")); - TRY(Core::System::unveil("/tmp/portal/lookup", "rw")); - TRY(Core::System::unveil("/etc/timezone", "r")); - TRY(Core::System::unveil(nullptr, nullptr)); bool adjust_time = false; bool set_time = false; @@ -118,6 +115,10 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(host, "NTP server", "host", Core::ArgsParser::Required::No); args_parser.parse(arguments); + TRY(Core::System::unveil("/tmp/portal/lookup", "rw")); + TRY(Core::System::unveil("/etc/timezone", "r")); + TRY(Core::System::unveil(nullptr, nullptr)); + if (adjust_time && set_time) { warnln("-a and -s are mutually exclusive"); return 1;