27 lines · 614 B · C
RawDownload
#include <u.h>#include <libc.h>#include <bio.h>#include <authsrv.h>#include "authcmdlib.h" /* don't allow other processes to debug us and steal keys */voidprivate(void){	int fd;	char buf[32];	static char pmsg[] = "Warning! %s can't protect itself from debugging: %r\n";	static char smsg[] = "Warning! %s can't turn off swapping: %r\n"; 	snprint(buf, sizeof(buf), "/proc/%d/ctl", getpid());	fd = open(buf, OWRITE|OCEXEC);	if(fd < 0){		fprint(2, pmsg, argv0);		return;	}	if(fprint(fd, "private") < 0)		fprint(2, pmsg, argv0);	if(fprint(fd, "noswap") < 0)		fprint(2, smsg, argv0);	close(fd);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t