diff options
author | deraadt@openbsd.org <deraadt@openbsd.org> | 2015-01-16 06:40:12 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-01-16 18:24:48 +1100 |
commit | 2ae4f337b2a5fb2841b6b0053b49496fef844d1c (patch) | |
tree | 59aac6ef59be3975eb3a1251abb0be330c008cdd /scp.c | |
parent | 3c4726f4c24118e8f1bb80bf75f1456c76df072c (diff) |
upstream commit
Replace <sys/param.h> with <limits.h> and other less
dirty headers where possible. Annotate <sys/param.h> lines with their
current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1,
LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of
MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution.
These are the files confirmed through binary verification. ok guenther,
millert, doug (helped with the verification protocol)
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: scp.c,v 1.180 2014/06/24 02:21:01 djm Exp $ */ | 1 | /* $OpenBSD: scp.c,v 1.181 2015/01/16 06:40:12 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). |
@@ -95,6 +95,7 @@ | |||
95 | #include <dirent.h> | 95 | #include <dirent.h> |
96 | #include <errno.h> | 96 | #include <errno.h> |
97 | #include <fcntl.h> | 97 | #include <fcntl.h> |
98 | #include <limits.h> | ||
98 | #include <pwd.h> | 99 | #include <pwd.h> |
99 | #include <signal.h> | 100 | #include <signal.h> |
100 | #include <stdarg.h> | 101 | #include <stdarg.h> |
@@ -749,7 +750,7 @@ source(int argc, char **argv) | |||
749 | off_t i, statbytes; | 750 | off_t i, statbytes; |
750 | size_t amt, nr; | 751 | size_t amt, nr; |
751 | int fd = -1, haderr, indx; | 752 | int fd = -1, haderr, indx; |
752 | char *last, *name, buf[2048], encname[MAXPATHLEN]; | 753 | char *last, *name, buf[2048], encname[PATH_MAX]; |
753 | int len; | 754 | int len; |
754 | 755 | ||
755 | for (indx = 0; indx < argc; ++indx) { | 756 | for (indx = 0; indx < argc; ++indx) { |
@@ -858,7 +859,7 @@ rsource(char *name, struct stat *statp) | |||
858 | { | 859 | { |
859 | DIR *dirp; | 860 | DIR *dirp; |
860 | struct dirent *dp; | 861 | struct dirent *dp; |
861 | char *last, *vect[1], path[MAXPATHLEN]; | 862 | char *last, *vect[1], path[PATH_MAX]; |
862 | 863 | ||
863 | if (!(dirp = opendir(name))) { | 864 | if (!(dirp = opendir(name))) { |
864 | run_err("%s: %s", name, strerror(errno)); | 865 | run_err("%s: %s", name, strerror(errno)); |