mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
Utilities: Add pledge and unveil protections in arp
This commit is contained in:
parent
d9d2287a11
commit
3bd6905ea8
1 changed files with 16 additions and 0 deletions
|
@ -16,9 +16,25 @@
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
if (pledge("stdio rpath tty", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unveil("/proc/net/arp", "r") < 0) {
|
||||||
|
perror("unveil");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unveil(nullptr, nullptr) < 0) {
|
||||||
|
perror("unveil");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static bool flag_set;
|
static bool flag_set;
|
||||||
static bool flag_delete;
|
static bool flag_delete;
|
||||||
const char* value_ipv4_address = nullptr;
|
const char* value_ipv4_address = nullptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue