I've been trying to sandbox my program with Capsicum, but I am unable to declare variables after I call
The Program Segfaults in checkLog(), At the Variable Declarartions.
So how do I declare variables under Capsicum?
cap_enter()
.
Code:
int initBlackBox()
{
/* Declare Variables */
int rtrn;
/* SandBox BlackBox with Capscium. */
rtrn = cap_enter();
if(rtrn < 0)
{
return -1;
}
/* Display Starting Banner */
startingBanner();
/* Display Copywright and wait for user to read */
displayCopywright();
/* Check If Log File Exist. */
rtrn = checkLog();
if(rtrn < 0)
{
return -1;
}
...
}
The Program Segfaults in checkLog(), At the Variable Declarartions.
Code:
int checkLog()
{
/* Declarations. */
int fd, rtrn;
char *path, *p1, *p2;
cap_rights_t rights;
...
}
So how do I declare variables under Capsicum?