diff options
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/atomicio.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/misc.c | 6 | ||||
-rw-r--r-- | usr.bin/ssh/readconf.c | 3 | ||||
-rw-r--r-- | usr.bin/ssh/scp.c | 9 | ||||
-rw-r--r-- | usr.bin/ssh/servconf.c | 5 | ||||
-rw-r--r-- | usr.bin/ssh/session.c | 6 | ||||
-rw-r--r-- | usr.bin/ssh/ssh-add.c | 6 | ||||
-rw-r--r-- | usr.bin/ssh/ssh-agent.c | 9 | ||||
-rw-r--r-- | usr.bin/ssh/ssh-keygen.c | 12 | ||||
-rw-r--r-- | usr.bin/ssh/sshkey.c | 5 | ||||
-rw-r--r-- | usr.bin/ssh/sshlogin.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/uidswap.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/xmalloc.c | 4 |
13 files changed, 41 insertions, 36 deletions
diff --git a/usr.bin/ssh/atomicio.c b/usr.bin/ssh/atomicio.c index f1269678f54..4a391958aa5 100644 --- a/usr.bin/ssh/atomicio.c +++ b/usr.bin/ssh/atomicio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atomicio.c,v 1.26 2010/09/22 22:58:51 djm Exp $ */ +/* $OpenBSD: atomicio.c,v 1.27 2015/01/16 06:40:12 deraadt Exp $ */ /* * Copyright (c) 2006 Damien Miller. All rights reserved. * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved. @@ -26,13 +26,13 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <sys/param.h> #include <sys/uio.h> #include <errno.h> #include <poll.h> #include <string.h> #include <unistd.h> +#include <limits.h> #include "atomicio.h" diff --git a/usr.bin/ssh/misc.c b/usr.bin/ssh/misc.c index 328473903f5..6110a6f8bd9 100644 --- a/usr.bin/ssh/misc.c +++ b/usr.bin/ssh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.95 2014/10/24 02:01:20 lteo Exp $ */ +/* $OpenBSD: misc.c,v 1.96 2015/01/16 06:40:12 deraadt Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. @@ -28,7 +28,6 @@ #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/un.h> -#include <sys/param.h> #include <net/if.h> #include <netinet/in.h> @@ -41,6 +40,7 @@ #include <netdb.h> #include <paths.h> #include <pwd.h> +#include <limits.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> @@ -534,7 +534,7 @@ tilde_expand_filename(const char *filename, uid_t uid) if (path != NULL) filename = path + 1; - if (xasprintf(&ret, "%s%s%s", pw->pw_dir, sep, filename) >= MAXPATHLEN) + if (xasprintf(&ret, "%s%s%s", pw->pw_dir, sep, filename) >= PATH_MAX) fatal("tilde_expand_filename: Path too long"); return (ret); diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c index 34ff37e6787..eabfa3c739e 100644 --- a/usr.bin/ssh/readconf.c +++ b/usr.bin/ssh/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.227 2015/01/15 09:40:00 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.228 2015/01/16 06:40:12 deraadt Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -31,6 +31,7 @@ #include <stdio.h> #include <string.h> #include <unistd.h> +#include <limits.h> #include <util.h> #include <vis.h> diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index 52b0a20c5e9..52d02ebc8d8 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scp.c,v 1.180 2014/06/24 02:21:01 djm Exp $ */ +/* $OpenBSD: scp.c,v 1.181 2015/01/16 06:40:12 deraadt Exp $ */ /* * scp - secure remote copy. This is basically patched BSD rcp which * uses ssh to do the data transfer (instead of using rcmd). @@ -71,7 +71,7 @@ * */ -#include <sys/param.h> +#include <sys/param.h> /* roundup MAX */ #include <sys/types.h> #include <sys/poll.h> #include <sys/wait.h> @@ -91,6 +91,7 @@ #include <string.h> #include <time.h> #include <unistd.h> +#include <limits.h> #include <vis.h> #include "xmalloc.h" @@ -728,7 +729,7 @@ source(int argc, char **argv) off_t i, statbytes; size_t amt, nr; int fd = -1, haderr, indx; - char *last, *name, buf[2048], encname[MAXPATHLEN]; + char *last, *name, buf[2048], encname[PATH_MAX]; int len; for (indx = 0; indx < argc; ++indx) { @@ -837,7 +838,7 @@ rsource(char *name, struct stat *statp) { DIR *dirp; struct dirent *dp; - char *last, *vect[1], path[MAXPATHLEN]; + char *last, *vect[1], path[PATH_MAX]; if (!(dirp = opendir(name))) { run_err("%s: %s", name, strerror(errno)); diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c index f36cc9c352e..d6304fb2a80 100644 --- a/usr.bin/ssh/servconf.c +++ b/usr.bin/ssh/servconf.c @@ -1,5 +1,5 @@ -/* $OpenBSD: servconf.c,v 1.258 2015/01/13 07:39:19 djm Exp $ */ +/* $OpenBSD: servconf.c,v 1.259 2015/01/16 06:40:12 deraadt Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * All rights reserved @@ -26,6 +26,7 @@ #include <string.h> #include <signal.h> #include <unistd.h> +#include <limits.h> #include <stdarg.h> #include <errno.h> #include <util.h> @@ -529,7 +530,7 @@ parse_token(const char *cp, const char *filename, char * derelativise_path(const char *path) { - char *expanded, *ret, cwd[MAXPATHLEN]; + char *expanded, *ret, cwd[PATH_MAX]; if (strcasecmp(path, "none") == 0) return xstrdup("none"); diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c index 4025bfc03e2..aa7ae456b65 100644 --- a/usr.bin/ssh/session.c +++ b/usr.bin/ssh/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.276 2015/01/14 20:05:27 djm Exp $ */ +/* $OpenBSD: session.c,v 1.277 2015/01/16 06:40:12 deraadt Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * All rights reserved @@ -38,7 +38,6 @@ #include <sys/un.h> #include <sys/stat.h> #include <sys/socket.h> -#include <sys/param.h> #include <sys/queue.h> #include <errno.h> @@ -53,6 +52,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <limits.h> #include "xmalloc.h" #include "ssh.h" @@ -1151,7 +1151,7 @@ static void safely_chroot(const char *path, uid_t uid) { const char *cp; - char component[MAXPATHLEN]; + char component[PATH_MAX]; struct stat st; if (*path != '/') diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c index 33b238dd582..9f1101a2c1c 100644 --- a/usr.bin/ssh/ssh-add.c +++ b/usr.bin/ssh/ssh-add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-add.c,v 1.116 2015/01/14 20:05:27 djm Exp $ */ +/* $OpenBSD: ssh-add.c,v 1.117 2015/01/16 06:40:12 deraadt Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -37,7 +37,6 @@ #include <sys/types.h> #include <sys/stat.h> -#include <sys/param.h> #include <openssl/evp.h> @@ -48,6 +47,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <limits.h> #include "xmalloc.h" #include "ssh.h" @@ -560,7 +560,7 @@ main(int argc, char **argv) goto done; } if (argc == 0) { - char buf[MAXPATHLEN]; + char buf[PATH_MAX]; struct passwd *pw; struct stat st; int count = 0; diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c index 30756c31148..e149098ad5d 100644 --- a/usr.bin/ssh/ssh-agent.c +++ b/usr.bin/ssh/ssh-agent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-agent.c,v 1.195 2015/01/14 19:33:41 djm Exp $ */ +/* $OpenBSD: ssh-agent.c,v 1.196 2015/01/16 06:40:12 deraadt Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -34,6 +34,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/param.h> /* MIN MAX */ #include <sys/types.h> #include <sys/time.h> #include <sys/queue.h> @@ -41,7 +42,6 @@ #include <sys/socket.h> #include <sys/stat.h> #include <sys/un.h> -#include <sys/param.h> #ifdef WITH_OPENSSL #include <openssl/evp.h> @@ -54,6 +54,7 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#include <limits.h> #include <time.h> #include <unistd.h> @@ -120,8 +121,8 @@ time_t parent_alive_interval = 0; pid_t cleanup_pid = 0; /* pathname and directory for AUTH_SOCKET */ -char socket_name[MAXPATHLEN]; -char socket_dir[MAXPATHLEN]; +char socket_name[PATH_MAX]; +char socket_dir[PATH_MAX]; /* locking */ int locked = 0; diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c index f90a600f876..d1337927b4b 100644 --- a/usr.bin/ssh/ssh-keygen.c +++ b/usr.bin/ssh/ssh-keygen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keygen.c,v 1.252 2015/01/15 09:40:00 djm Exp $ */ +/* $OpenBSD: ssh-keygen.c,v 1.253 2015/01/16 06:40:12 deraadt Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -15,7 +15,6 @@ #include <sys/types.h> #include <sys/socket.h> #include <sys/stat.h> -#include <sys/param.h> #include <openssl/evp.h> #include <openssl/pem.h> @@ -28,6 +27,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <limits.h> #include "xmalloc.h" #include "sshkey.h" @@ -1047,7 +1047,7 @@ do_known_hosts(struct passwd *pw, const char *name) FILE *in, *out = stdout; struct sshkey *pub; char *cp, *cp2, *kp, *kp2; - char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN]; + char line[16*1024], tmp[PATH_MAX], old[PATH_MAX]; int c, skip = 0, inplace = 0, num = 0, invalid = 0, has_unhashed = 0; int r, ca, revoked; int found_key = 0; @@ -2275,9 +2275,9 @@ usage(void) int main(int argc, char **argv) { - char dotsshdir[MAXPATHLEN], comment[1024], *passphrase1, *passphrase2; + char dotsshdir[PATH_MAX], comment[1024], *passphrase1, *passphrase2; char *checkpoint = NULL; - char out_file[MAXPATHLEN], *rr_hostname = NULL, *ep; + char out_file[PATH_MAX], *rr_hostname = NULL, *ep; struct sshkey *private, *public; struct passwd *pw; struct stat st; @@ -2490,7 +2490,7 @@ main(int argc, char **argv) fatal("Output filename too long"); break; case 'K': - if (strlen(optarg) >= MAXPATHLEN) + if (strlen(optarg) >= PATH_MAX) fatal("Checkpoint filename too long"); checkpoint = xstrdup(optarg); break; diff --git a/usr.bin/ssh/sshkey.c b/usr.bin/ssh/sshkey.c index 8359bd5aaf3..0745fde7125 100644 --- a/usr.bin/ssh/sshkey.c +++ b/usr.bin/ssh/sshkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshkey.c,v 1.12 2015/01/14 10:46:28 djm Exp $ */ +/* $OpenBSD: sshkey.c,v 1.13 2015/01/16 06:40:12 deraadt Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * Copyright (c) 2008 Alexander von Gernler. All rights reserved. @@ -25,7 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <sys/param.h> +#include <sys/param.h> /* MIN MAX */ #include <sys/types.h> #include <netinet/in.h> @@ -41,6 +41,7 @@ #include <stdio.h> #include <string.h> #include <util.h> +#include <limits.h> #include <resolv.h> #include "ssh2.h" diff --git a/usr.bin/ssh/sshlogin.c b/usr.bin/ssh/sshlogin.c index 0f646cf42e6..e39b1147599 100644 --- a/usr.bin/ssh/sshlogin.c +++ b/usr.bin/ssh/sshlogin.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshlogin.c,v 1.29 2014/07/15 15:54:14 millert Exp $ */ +/* $OpenBSD: sshlogin.c,v 1.30 2015/01/16 06:40:12 deraadt Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -40,7 +40,7 @@ */ #include <sys/types.h> -#include <sys/param.h> +#include <sys/param.h> /* MAXHOSTNAMELEN */ #include <sys/socket.h> #include <errno.h> diff --git a/usr.bin/ssh/uidswap.c b/usr.bin/ssh/uidswap.c index dc8b191b49a..e9dee64578a 100644 --- a/usr.bin/ssh/uidswap.c +++ b/usr.bin/ssh/uidswap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uidswap.c,v 1.36 2013/11/08 11:15:19 dtucker Exp $ */ +/* $OpenBSD: uidswap.c,v 1.37 2015/01/16 06:40:12 deraadt Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -12,11 +12,11 @@ * called by a name other than "ssh" or "Secure Shell". */ -#include <sys/param.h> #include <errno.h> #include <pwd.h> #include <string.h> #include <unistd.h> +#include <limits.h> #include <stdarg.h> #include <stdlib.h> diff --git a/usr.bin/ssh/xmalloc.c b/usr.bin/ssh/xmalloc.c index c6bd95973a6..a85acb7a566 100644 --- a/usr.bin/ssh/xmalloc.c +++ b/usr.bin/ssh/xmalloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xmalloc.c,v 1.29 2014/01/04 17:50:55 tedu Exp $ */ +/* $OpenBSD: xmalloc.c,v 1.30 2015/01/16 06:40:12 deraadt Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -13,11 +13,11 @@ * called by a name other than "ssh" or "Secure Shell". */ -#include <sys/param.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <limits.h> #include "xmalloc.h" #include "log.h" |