|
@ -28,10 +28,6 @@ |
|
|
#include <libutil.h> |
|
|
#include <libutil.h> |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef __OpenBSD__ |
|
|
|
|
|
#define pledge(a,b) 0 |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/* Arbitrary sizes */ |
|
|
/* Arbitrary sizes */ |
|
|
#define UTF_INVALID 0xFFFD |
|
|
#define UTF_INVALID 0xFFFD |
|
|
#define UTF_SIZ 4 |
|
|
#define UTF_SIZ 4 |
|
@ -810,13 +806,17 @@ ttynew(char *line, char *cmd, char *out, char **args) |
|
|
die("ioctl TIOCSCTTY failed: %s\n", strerror(errno)); |
|
|
die("ioctl TIOCSCTTY failed: %s\n", strerror(errno)); |
|
|
close(s); |
|
|
close(s); |
|
|
close(m); |
|
|
close(m); |
|
|
|
|
|
#ifdef __OpenBSD__ |
|
|
if (pledge("stdio getpw proc exec", NULL) == -1) |
|
|
if (pledge("stdio getpw proc exec", NULL) == -1) |
|
|
die("pledge\n"); |
|
|
die("pledge\n"); |
|
|
|
|
|
#endif |
|
|
execsh(cmd, args); |
|
|
execsh(cmd, args); |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
|
|
|
#ifdef __OpenBSD__ |
|
|
if (pledge("stdio rpath tty proc", NULL) == -1) |
|
|
if (pledge("stdio rpath tty proc", NULL) == -1) |
|
|
die("pledge\n"); |
|
|
die("pledge\n"); |
|
|
|
|
|
#endif |
|
|
close(s); |
|
|
close(s); |
|
|
cmdfd = m; |
|
|
cmdfd = m; |
|
|
signal(SIGCHLD, sigchld); |
|
|
signal(SIGCHLD, sigchld); |
|
|