diff --git a/Userland/tail.cpp b/Userland/tail.cpp index ac623f46ed5..e7d66fd0329 100644 --- a/Userland/tail.cpp +++ b/Userland/tail.cpp @@ -70,6 +70,11 @@ off_t find_seek_pos(CFile& file, int wanted_lines) int main(int argc, char* argv[]) { + if (pledge("stdio rpath", nullptr) < 0) { + perror("pledge"); + return 1; + } + CArgsParser args_parser("tail"); args_parser.add_arg("f", "follow -- appended data is output as it is written to the file"); @@ -101,6 +106,11 @@ int main(int argc, char* argv[]) exit(1); } + if (pledge("stdio", nullptr) < 0) { + perror("pledge"); + return 1; + } + bool flag_follow = args.is_present("f"); auto pos = find_seek_pos(*f, line_count); return tail_from_pos(*f, pos, flag_follow);