diff options
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: scp.c,v 1.183 2015/10/16 17:07:24 mmcc Exp $ */ | 1 | /* $OpenBSD: scp.c,v 1.184 2015/11/27 00:49:31 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * scp - secure remote copy. This is basically patched BSD rcp which | 3 | * scp - secure remote copy. This is basically patched BSD rcp which |
4 | * uses ssh to do the data transfer (instead of using rcmd). | 4 | * uses ssh to do the data transfer (instead of using rcmd). |
@@ -484,6 +484,16 @@ main(int argc, char **argv) | |||
484 | if (!isatty(STDOUT_FILENO)) | 484 | if (!isatty(STDOUT_FILENO)) |
485 | showprogress = 0; | 485 | showprogress = 0; |
486 | 486 | ||
487 | if (pflag) { | ||
488 | /* Cannot pledge: -p allows setuid/setgid files... */ | ||
489 | } else { | ||
490 | if (pledge("stdio rpath wpath cpath fattr tty proc exec", | ||
491 | NULL) == -1) { | ||
492 | perror("pledge"); | ||
493 | exit(1); | ||
494 | } | ||
495 | } | ||
496 | |||
487 | remin = STDIN_FILENO; | 497 | remin = STDIN_FILENO; |
488 | remout = STDOUT_FILENO; | 498 | remout = STDOUT_FILENO; |
489 | 499 | ||