summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorRalf Donau <ruelle@volleyballschlaeger.de>2021-07-07 18:44:55 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-07 20:27:40 +0200
commit6386c2d8805ed8634650d310937e9ea3cf3ecd2b (patch)
tree53d3fd0883b6cb9a335ee41138278534dcff8dde /Userland/Utilities
parent4ac8d9c2ac85aabf0858e507e20c280b5113e991 (diff)
downloadserenity-6386c2d8805ed8634650d310937e9ea3cf3ecd2b.zip
Userland: Add pledge to less
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/less.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Utilities/less.cpp b/Userland/Utilities/less.cpp
index f89be6c5f4..5174c64bfc 100644
--- a/Userland/Utilities/less.cpp
+++ b/Userland/Utilities/less.cpp
@@ -306,6 +306,11 @@ static void cat_file(FILE* file)
int main(int argc, char** argv)
{
+ if (pledge("stdio rpath tty", nullptr) < 0) {
+ perror("pledge");
+ return 1;
+ }
+
char const* filename = "-";
char const* prompt = "?f%f :.(line %l)?e (END):.";
bool dont_switch_buffer = false;
@@ -330,6 +335,11 @@ int main(int argc, char** argv)
file = fopen(filename, "r");
}
+ if (pledge("stdio tty", nullptr) < 0) {
+ perror("pledge");
+ return 1;
+ }
+
if (emulate_more) {
// Configure options that match more's behavior
dont_switch_buffer = true;