mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
rpcdump: Use pledge() and unveil()
This commit is contained in:
parent
e3e22cd42e
commit
cf151fa0e1
1 changed files with 17 additions and 0 deletions
|
@ -33,6 +33,18 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio unix cpath fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/tmp", "rwc") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
unveil(nullptr, nullptr);
|
||||
|
||||
if (argc != 2) {
|
||||
printf("usage: %s <pid>\n", argv[0]);
|
||||
return 0;
|
||||
|
@ -44,6 +56,11 @@ int main(int argc, char** argv)
|
|||
|
||||
auto socket = CLocalSocket::construct();
|
||||
|
||||
if (pledge("stdio unix", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
socket->on_connected = [&] {
|
||||
dbg() << "Connected to PID " << pid;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue