Skip to content

Instantly share code, notes, and snippets.

@alban
alban / fchdir.c
Created March 11, 2015 12:27
fchdir.c - escaping chroot with file descriptors
/* Send or receive the file descriptor of "/"
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>