mirror of git://anongit.mindrot.org/openssh.git
remove sys/param.h in -portable, after upstream
This commit is contained in:
parent
7a7c69d8b4
commit
715c892f0a
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
|
@ -2027,7 +2027,7 @@ channel_handle_wfd(struct ssh *ssh, Channel *c,
|
||||||
#ifdef _AIX
|
#ifdef _AIX
|
||||||
/* XXX: Later AIX versions can't push as much data to tty */
|
/* XXX: Later AIX versions can't push as much data to tty */
|
||||||
if (c->wfd_isatty)
|
if (c->wfd_isatty)
|
||||||
dlen = MIN(dlen, 8*1024);
|
dlen = MINIMUM(dlen, 8*1024);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
len = write(c->wfd, buf, dlen);
|
len = write(c->wfd, buf, dlen);
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/socket.h> /* For CMSG_* */
|
#include <sys/socket.h> /* For CMSG_* */
|
||||||
|
|
||||||
#ifdef HAVE_LIMITS_H
|
#ifdef HAVE_LIMITS_H
|
||||||
|
|
|
@ -181,6 +181,7 @@
|
||||||
#include "auth.h"
|
#include "auth.h"
|
||||||
#include "sshbuf.h"
|
#include "sshbuf.h"
|
||||||
#include "ssherr.h"
|
#include "ssherr.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
#ifdef HAVE_UTIL_H
|
#ifdef HAVE_UTIL_H
|
||||||
# include <util.h>
|
# include <util.h>
|
||||||
|
@ -801,7 +802,7 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx)
|
||||||
# endif
|
# endif
|
||||||
# ifdef HAVE_SYSLEN_IN_UTMPX
|
# ifdef HAVE_SYSLEN_IN_UTMPX
|
||||||
/* ut_syslen is the length of the utx_host string */
|
/* ut_syslen is the length of the utx_host string */
|
||||||
utx->ut_syslen = MIN(strlen(li->hostname), sizeof(utx->ut_host));
|
utx->ut_syslen = MINIMUM(strlen(li->hostname), sizeof(utx->ut_host));
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#endif /* USE_UTMPX || USE_WTMPX */
|
#endif /* USE_UTMPX || USE_WTMPX */
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
|
|
||||||
#ifndef HAVE_ARC4RANDOM
|
#ifndef HAVE_ARC4RANDOM
|
||||||
|
|
||||||
|
#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
|
||||||
|
|
||||||
#ifdef WITH_OPENSSL
|
#ifdef WITH_OPENSSL
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
@ -170,7 +172,7 @@ _rs_rekey(u_char *dat, size_t datlen)
|
||||||
if (dat) {
|
if (dat) {
|
||||||
size_t i, m;
|
size_t i, m;
|
||||||
|
|
||||||
m = MIN(datlen, KEYSZ + IVSZ);
|
m = MINIMUM(datlen, KEYSZ + IVSZ);
|
||||||
for (i = 0; i < m; i++)
|
for (i = 0; i < m; i++)
|
||||||
rs_buf[i] ^= dat[i];
|
rs_buf[i] ^= dat[i];
|
||||||
}
|
}
|
||||||
|
@ -189,7 +191,7 @@ _rs_random_buf(void *_buf, size_t n)
|
||||||
_rs_stir_if_needed(n);
|
_rs_stir_if_needed(n);
|
||||||
while (n > 0) {
|
while (n > 0) {
|
||||||
if (rs_have > 0) {
|
if (rs_have > 0) {
|
||||||
m = MIN(n, rs_have);
|
m = MINIMUM(n, rs_have);
|
||||||
memcpy(buf, rs_buf + RSBUFSZ - rs_have, m);
|
memcpy(buf, rs_buf + RSBUFSZ - rs_have, m);
|
||||||
memset(rs_buf + RSBUFSZ - rs_have, 0, m);
|
memset(rs_buf + RSBUFSZ - rs_have, 0, m);
|
||||||
buf += m;
|
buf += m;
|
||||||
|
@ -230,7 +232,7 @@ arc4random_addrandom(u_char *dat, int datlen)
|
||||||
if (!rs_initialized)
|
if (!rs_initialized)
|
||||||
_rs_stir();
|
_rs_stir();
|
||||||
while (datlen > 0) {
|
while (datlen > 0) {
|
||||||
m = MIN(datlen, KEYSZ + IVSZ);
|
m = MINIMUM(datlen, KEYSZ + IVSZ);
|
||||||
_rs_rekey(dat, m);
|
_rs_rekey(dat, m);
|
||||||
dat += m;
|
dat += m;
|
||||||
datlen -= m;
|
datlen -= m;
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
#if (!defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP)) || (!defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON))
|
#if (!defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP)) || (!defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON))
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#ifndef HAVE_BCRYPT_PBKDF
|
#ifndef HAVE_BCRYPT_PBKDF
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_STDLIB_H
|
#ifdef HAVE_STDLIB_H
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#if !defined(HAVE_CLOSEFROM) || defined(BROKEN_CLOSEFROM)
|
#if !defined(HAVE_CLOSEFROM) || defined(BROKEN_CLOSEFROM)
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
#if !defined(HAVE_STATVFS) || !defined(HAVE_FSTATVFS)
|
#if !defined(HAVE_STATVFS) || !defined(HAVE_FSTATVFS)
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#ifdef HAVE_SYS_MOUNT_H
|
#ifdef HAVE_SYS_MOUNT_H
|
||||||
# include <sys/mount.h>
|
# include <sys/mount.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/param.h>
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
dirname(const char *path)
|
dirname(const char *path)
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
|
|
||||||
#if !defined(HAVE_GETCWD)
|
#if !defined(HAVE_GETCWD)
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
#if !defined(HAVE_INET_ATON)
|
#if !defined(HAVE_INET_ATON)
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
#ifndef HAVE_INET_NTOP
|
#ifndef HAVE_INET_NTOP
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/param.h>
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
|
|
|
@ -59,6 +59,8 @@
|
||||||
# define crypt DES_crypt
|
# define crypt DES_crypt
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pick an appropriate password encryption type and salt for the running
|
* Pick an appropriate password encryption type and salt for the running
|
||||||
* system by searching through accounts until we find one that has a valid
|
* system by searching through accounts until we find one that has a valid
|
||||||
|
@ -82,7 +84,7 @@ pick_salt(void)
|
||||||
continue;
|
continue;
|
||||||
if (passwd[0] == '$' && (p = strrchr(passwd+1, '$')) != NULL) {
|
if (passwd[0] == '$' && (p = strrchr(passwd+1, '$')) != NULL) {
|
||||||
typelen = p - passwd + 1;
|
typelen = p - passwd + 1;
|
||||||
strlcpy(salt, passwd, MIN(typelen, sizeof(salt)));
|
strlcpy(salt, passwd, MINIMUM(typelen, sizeof(salt)));
|
||||||
explicit_bzero(passwd, strlen(passwd));
|
explicit_bzero(passwd, strlen(passwd));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -23,7 +23,9 @@
|
||||||
|
|
||||||
void sshbuf_tests(void);
|
void sshbuf_tests(void);
|
||||||
|
|
||||||
|
#ifndef roundup
|
||||||
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
|
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
sshbuf_tests(void)
|
sshbuf_tests(void)
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#ifdef SANDBOX_CAPSICUM
|
#ifdef SANDBOX_CAPSICUM
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <sys/capsicum.h>
|
#include <sys/capsicum.h>
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
|
||||||
#ifdef HAVE_SYS_STAT_H
|
#ifdef HAVE_SYS_STAT_H
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
1
sftp.c
1
sftp.c
|
@ -22,7 +22,6 @@
|
||||||
#ifdef HAVE_SYS_STAT_H
|
#ifdef HAVE_SYS_STAT_H
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#ifdef HAVE_SYS_STATVFS_H
|
#ifdef HAVE_SYS_STATVFS_H
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
Loading…
Reference in New Issue