23 lines
457 B
C++
23 lines
457 B
C++
|
/**
|
||
|
* @file Security.cpp
|
||
|
* @author apio (cloudapio.eu)
|
||
|
* @brief Functions to restrict process operations.
|
||
|
*
|
||
|
* @copyright Copyright (c) 2023, the Luna authors.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#include <errno.h>
|
||
|
#include <os/Security.h>
|
||
|
#include <unistd.h>
|
||
|
|
||
|
namespace os::Security
|
||
|
{
|
||
|
Result<void> pledge(const char* promises, const char* execpromises)
|
||
|
{
|
||
|
int rc = ::pledge(promises, execpromises);
|
||
|
if (rc < 0) return err(errno);
|
||
|
return {};
|
||
|
}
|
||
|
}
|