]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
remove sys/param.h in -portable, after upstream
authorDamien Miller <djm@mindrot.org>
Tue, 21 Dec 2021 22:02:50 +0000 (09:02 +1100)
committerDamien Miller <djm@mindrot.org>
Tue, 21 Dec 2021 22:02:50 +0000 (09:02 +1100)
22 files changed:
atomicio.c
channels.c
includes.h
loginrec.c
openbsd-compat/arc4random.c
openbsd-compat/base64.c
openbsd-compat/bcrypt_pbkdf.c
openbsd-compat/bsd-closefrom.c
openbsd-compat/bsd-statvfs.c
openbsd-compat/dirname.c
openbsd-compat/getcwd.c
openbsd-compat/inet_aton.c
openbsd-compat/inet_ntop.c
openbsd-compat/port-solaris.c
openbsd-compat/xcrypt.c
regress/misc/fuzz-harness/kex_fuzz.cc
regress/unittests/sshbuf/test_sshbuf.c
regress/unittests/test_helper/test_helper.c
sandbox-capsicum.c
session.c
sftp.c
ssh-agent.c

index e00c9f0d4e22ccda334c74bf5e712b223fbf0f1e..765073357f67342f8b5f21ac869629c0c9260c7a 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "includes.h"
 
-#include <sys/param.h>
 #include <sys/uio.h>
 
 #include <errno.h>
index 1c714c845e187b9a4c645d1eb6e804e1d0177768..3368098e1376ca67871a29ecd28bf6d03793871f 100644 (file)
@@ -2027,7 +2027,7 @@ channel_handle_wfd(struct ssh *ssh, Channel *c,
 #ifdef _AIX
        /* XXX: Later AIX versions can't push as much data to tty */
        if (c->wfd_isatty)
-               dlen = MIN(dlen, 8*1024);
+               dlen = MINIMUM(dlen, 8*1024);
 #endif
 
        len = write(c->wfd, buf, dlen);
index 0fd71792e1ac2362c86b1316d91f141be9aaad5d..6d17ef6da9338cfd0de8c044f2a1483991c166e4 100644 (file)
@@ -23,7 +23,6 @@
 #endif
 
 #include <sys/types.h>
-#include <sys/param.h>
 #include <sys/socket.h> /* For CMSG_* */
 
 #ifdef HAVE_LIMITS_H
index ea058fd6fa759b2640e2fbbabb9bedd13584d06e..4f21499586afc5d87f2d28f639cb725e366cd25e 100644 (file)
 #include "auth.h"
 #include "sshbuf.h"
 #include "ssherr.h"
+#include "misc.h"
 
 #ifdef HAVE_UTIL_H
 # include <util.h>
@@ -801,7 +802,7 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx)
 # endif
 # ifdef HAVE_SYSLEN_IN_UTMPX
        /* 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 /* USE_UTMPX || USE_WTMPX */
index 14853aba43d19a2f049f1464f2949541ce9e0a0e..80ff3c1801a121d3fb66776fec214bd33cab715f 100644 (file)
@@ -39,6 +39,8 @@
 
 #ifndef HAVE_ARC4RANDOM
 
+#define MINIMUM(a, b)    (((a) < (b)) ? (a) : (b))
+
 #ifdef WITH_OPENSSL
 #include <openssl/rand.h>
 #include <openssl/err.h>
@@ -170,7 +172,7 @@ _rs_rekey(u_char *dat, size_t datlen)
        if (dat) {
                size_t i, m;
 
-               m = MIN(datlen, KEYSZ + IVSZ);
+               m = MINIMUM(datlen, KEYSZ + IVSZ);
                for (i = 0; i < m; i++)
                        rs_buf[i] ^= dat[i];
        }
@@ -189,7 +191,7 @@ _rs_random_buf(void *_buf, size_t n)
        _rs_stir_if_needed(n);
        while (n > 0) {
                if (rs_have > 0) {
-                       m = MIN(n, rs_have);
+                       m = MINIMUM(n, rs_have);
                        memcpy(buf, rs_buf + RSBUFSZ - rs_have, m);
                        memset(rs_buf + RSBUFSZ - rs_have, 0, m);
                        buf += m;
@@ -230,7 +232,7 @@ arc4random_addrandom(u_char *dat, int datlen)
        if (!rs_initialized)
                _rs_stir();
        while (datlen > 0) {
-               m = MIN(datlen, KEYSZ + IVSZ);
+               m = MINIMUM(datlen, KEYSZ + IVSZ);
                _rs_rekey(dat, m);
                dat += m;
                datlen -= m;
index b7dce095e4c3a297c5cfba408e37e1dbddb63905..e5faba3c52b956967456235f8daed06918c2f146 100644 (file)
@@ -49,7 +49,6 @@
 #if (!defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP)) || (!defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON))
 
 #include <sys/types.h>
-#include <sys/param.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
index 95b150f81ca97865697c829a97a51b57a55bb6f1..5a22ba3b4258d61b236840719f046e5ed2df6c3a 100644 (file)
@@ -24,7 +24,6 @@
 #ifndef HAVE_BCRYPT_PBKDF
 
 #include <sys/types.h>
-#include <sys/param.h>
 
 #ifdef HAVE_STDLIB_H
 # include <stdlib.h>
index 08b7da6983cd81587f84de53fea6c3df33abc61f..704da531fef949c4e8cb28d12b445c37ffbd4d4e 100644 (file)
@@ -19,7 +19,6 @@
 #if !defined(HAVE_CLOSEFROM) || defined(BROKEN_CLOSEFROM)
 
 #include <sys/types.h>
-#include <sys/param.h>
 #include <unistd.h>
 #include <stdio.h>
 #ifdef HAVE_FCNTL_H
index 10d8764392c247b28977e02c982f717c73641208..18ca726cfc7325908a59cc3148fa509b8511d86e 100644 (file)
@@ -18,7 +18,6 @@
 
 #if !defined(HAVE_STATVFS) || !defined(HAVE_FSTATVFS)
 
-#include <sys/param.h>
 #ifdef HAVE_SYS_MOUNT_H
 # include <sys/mount.h>
 #endif
index 30fcb496856d44e324e75e7cb9b148c27351b915..127bc2ae16f1b0ed2615c3d83912f0e20ced002a 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <errno.h>
 #include <string.h>
-#include <sys/param.h>
 
 char *
 dirname(const char *path)
index e4f7f5a3d0aeef9c84a537029543ac0f0864c63d..2d56bae19dd6a755a866af3fd91bbfde0279d2bb 100644 (file)
@@ -34,7 +34,6 @@
 
 #if !defined(HAVE_GETCWD)
 
-#include <sys/param.h>
 #include <sys/stat.h>
 #include <errno.h>
 #include <dirent.h>
index 093a17203fb633d406661718fb25172dba91968f..5efcc5f0374a02821415af7d9e98ae6388bbb158 100644 (file)
@@ -56,7 +56,6 @@
 #if !defined(HAVE_INET_ATON)
 
 #include <sys/types.h>
-#include <sys/param.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <ctype.h>
index 3259037baadd8df3738171f950f25dfbd7ab8b36..c037f0805a6f70eb417a2d100e02a17894c668b6 100644 (file)
@@ -22,7 +22,6 @@
 
 #ifndef HAVE_INET_NTOP
 
-#include <sys/param.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
index b84fbff5e7f51ddda7a7b872c7fcce8063d789dd..10c2d6b7fa5aeb228788164f5f3dc5f551860b37 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/param.h>
 
 #include <errno.h>
 #ifdef HAVE_FCNTL_H
index e493dd31f221f5b31db1f6cd8b84d9ac5825414d..9cded66845cc239a9c763c57adfa7eb45ba29710 100644 (file)
@@ -59,6 +59,8 @@
 #  define crypt DES_crypt
 # endif
 
+#define MINIMUM(a, b)  (((a) < (b)) ? (a) : (b))
+
 /*
  * Pick an appropriate password encryption type and salt for the running
  * system by searching through accounts until we find one that has a valid
@@ -82,7 +84,7 @@ pick_salt(void)
                        continue;
                if (passwd[0] == '$' && (p = strrchr(passwd+1, '$')) != NULL) {
                        typelen = p - passwd + 1;
-                       strlcpy(salt, passwd, MIN(typelen, sizeof(salt)));
+                       strlcpy(salt, passwd, MINIMUM(typelen, sizeof(salt)));
                        explicit_bzero(passwd, strlen(passwd));
                        goto out;
                }
index 4740a7cb04c1f903ae7716a5c0025625dc71b8af..fc145d48d3325f7b48a30e466cc9b1c59a581f24 100644 (file)
@@ -2,7 +2,6 @@
 
 
 #include <sys/types.h>
-#include <sys/param.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
index 052d4f2ba470ad2b9357b591a9410947baf01aba..e22b390fe33d795cca65cae1697881367e9e4b80 100644 (file)
@@ -23,7 +23,9 @@
 
 void sshbuf_tests(void);
 
+#ifndef roundup
 #define roundup(x, y)   ((((x)+((y)-1))/(y))*(y))
+#endif
 
 void
 sshbuf_tests(void)
index de125fcd4b294cba32dfbd5dcd2717fb550eb96a..6461d7ffc642f4b0ffd67a5de87724494c931df6 100644 (file)
@@ -20,7 +20,6 @@
 #include "includes.h"
 
 #include <sys/types.h>
-#include <sys/param.h>
 #include <sys/uio.h>
 
 #include <stdarg.h>
index e10bad7e83df5bdb3dbab3073adb7a1e2105839a..883be185815a4d77afed570fc87e3f7f724404ed 100644 (file)
@@ -19,7 +19,6 @@
 #ifdef SANDBOX_CAPSICUM
 
 #include <sys/types.h>
-#include <sys/param.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/capsicum.h>
index 5f423f9f6c50d9c5dfe86221c9d361adb5f640f0..fb2d700999500f9246b85d3605385425634ec075 100644 (file)
--- a/session.c
+++ b/session.c
@@ -36,7 +36,6 @@
 #include "includes.h"
 
 #include <sys/types.h>
-#include <sys/param.h>
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
diff --git a/sftp.c b/sftp.c
index 418f312f7bc62ddc770adbbf012a62e7bab73dae..8cb5917a91f12cb84857f63377fdcf01965ab1e5 100644 (file)
--- a/sftp.c
+++ b/sftp.c
@@ -22,7 +22,6 @@
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
 #ifdef HAVE_SYS_STATVFS_H
index 390d8aa1c8d5b5a63b27010f67ea6c84ad08a73a..f7d3390daffb63c68b72d89e55c7a99ba51da195 100644 (file)
@@ -37,7 +37,6 @@
 #include "includes.h"
 
 #include <sys/types.h>
-#include <sys/param.h>
 #include <sys/resource.h>
 #include <sys/stat.h>
 #include <sys/socket.h>