summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-10-04 20:56:28 +0000
committerderaadt <deraadt@openbsd.org>1999-10-04 20:56:28 +0000
commit1e11c2e64a61222ca767901621cfde614077a9d5 (patch)
treec90e5126775fbb43ad26feb273130ecd4c25e589
parentnuked minfd. sigh. hope this is the last one. (diff)
downloadwireguard-openbsd-1e11c2e64a61222ca767901621cfde614077a9d5.tar.xz
wireguard-openbsd-1e11c2e64a61222ca767901621cfde614077a9d5.zip
more shrinking
-rw-r--r--usr.bin/ssh/gen_minfd.c123
-rw-r--r--usr.bin/ssh/ssh-add/Makefile5
-rw-r--r--usr.bin/ssh/ssh-agent/Makefile5
-rw-r--r--usr.bin/ssh/ssh-keygen/Makefile5
-rw-r--r--usr.bin/ssh/ssh/Makefile7
-rw-r--r--usr.bin/ssh/sshd/Makefile9
6 files changed, 13 insertions, 141 deletions
diff --git a/usr.bin/ssh/gen_minfd.c b/usr.bin/ssh/gen_minfd.c
deleted file mode 100644
index 6d1bbcd2317..00000000000
--- a/usr.bin/ssh/gen_minfd.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-
-gen_minfd.c
-
-Author: David Mazieres <dm@lcs.mit.edu>
- Contributed to be part of ssh.
-
-Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
- All rights reserved
-
-Created: Tue Aug 22 17:22:57 1995 ylo
-Last modified: Tue Aug 22 17:44:32 1995 ylo
-
-*/
-
-#include "includes.h"
-#include <sys/resource.h>
-#include "fdlim.h"
-
-static char *self;
-
-static void
-child_test (char *fdstr)
-{
- int fd = atoi (fdstr);
- if (fcntl (fd, F_GETFL, NULL) < 0) {
- exit (1);
- }
- exit (0);
-}
-
-static int
-run_child (char *shell, int fd)
-{
- char cmd[128];
- int pid;
- int status;
-
- if (dup2 (0, fd) < 0) {
- perror ("dup2");
- return (-1);
- }
-
- sprintf (cmd, "%s -fd %d", self, fd);
-
- fflush (stdout);
- pid = fork ();
- if (! pid) {
- close (1); /* prevent any garbage from entering the output */
- dup (2);
- execlp (shell, shell, "-c", cmd, NULL);
- exit (1);
- }
- close (fd);
- if (wait (&status) != pid) {
- fprintf (stderr, "wrong/no child??\n");
- exit (1);
- }
- return (status ? -1 : 0);
-}
-
-static int
-do_shell (char *shell)
-{
- int fd, min, max;
-
- min = 3;
- max = fdlim_get (0) - 1;
- if (max < 0) {
- printf ("fdlim_get: bad value\n");
- exit (1);
- }
-
- if (run_child (shell, max)
- && run_child (shell, --max)) /* bizarre ultrix weirdness */
- return (-1);
-
- while (min + 1 < max) {
- fd = (min + max) / 2;
- if (run_child (shell, fd))
- min = fd;
- else
- max = fd;
- }
- return (max);
-}
-
-int
-main (int argc, char **argv)
-{
- int fd;
- int i;
- char *p;
-
- if (argc == 3 && !strcmp (argv[1], "-fd"))
- child_test (argv[2]);
- self = argv[0];
-
- fd = fdlim_get (1);
- if (fd < 0) {
- fprintf (stderr, "fdlim_get: bad value\n");
- exit (1);
- }
- fdlim_set (fd);
- printf ("/* maximum file descriptors = %d */\n\n", fd);
- printf ("struct Min_Auth_Fd {\n"
- " int fd;\n"
- " char shell[32];\n"
- "};\n\n"
- "static struct Min_Auth_Fd mafd[] = {\n");
- for (i = 1; i < argc; i++) {
- fd = do_shell (argv[i]);
- if ((p = strrchr (argv[i], '/')))
- p++;
- else
- p = argv[i];
- if (fd > 0)
- printf (" { %d, \"%s\" },\n", fd, p);
- }
- printf (" { 0, \"\" },\n};\n\n"
- "#define MAFD_MAX (sizeof (mafd) / sizeof (mafd[0]) - 1)\n");
- return (0);
-}
diff --git a/usr.bin/ssh/ssh-add/Makefile b/usr.bin/ssh/ssh-add/Makefile
index f05438c90ad..996d2075f73 100644
--- a/usr.bin/ssh/ssh-add/Makefile
+++ b/usr.bin/ssh/ssh-add/Makefile
@@ -8,8 +8,7 @@ LDADD= -lcrypto -lutil -lz
DPADD= ${LIBCRYPTO} ${LIBDES} ${LIBUTIL} ${LIBZ}
MAN= ssh-add.1
-SRCS= ssh-add.c log-client.c readpass.c rsa.c buffer.c \
- xmalloc.c bufaux.c authfd.c authfile.c crc32.c match.c \
- mpaux.c cipher.c compress.c
+SRCS= ssh-add.c log-client.c readpass.c rsa.c buffer.c xmalloc.c \
+ bufaux.c authfd.c authfile.c mpaux.c cipher.c
.include <bsd.prog.mk>
diff --git a/usr.bin/ssh/ssh-agent/Makefile b/usr.bin/ssh/ssh-agent/Makefile
index cc813ec15e8..2dedb18cbcf 100644
--- a/usr.bin/ssh/ssh-agent/Makefile
+++ b/usr.bin/ssh/ssh-agent/Makefile
@@ -8,8 +8,7 @@ LDADD= -lcrypto -lutil -lz
DPADD= ${LIBCRYPTO} ${LIBDES} ${LIBUTIL} ${LIBZ}
MAN= ssh-agent.1
-SRCS= ssh-agent.c log-client.c rsa.c buffer.c \
- xmalloc.c bufaux.c authfd.c authfile.c \
- mpaux.c crc32.c match.c cipher.c compress.c
+SRCS= ssh-agent.c log-client.c rsa.c buffer.c xmalloc.c bufaux.c \
+ authfd.c authfile.c mpaux.c cipher.c
.include <bsd.prog.mk>
diff --git a/usr.bin/ssh/ssh-keygen/Makefile b/usr.bin/ssh/ssh-keygen/Makefile
index 810f49f3ae5..5d07bf1edef 100644
--- a/usr.bin/ssh/ssh-keygen/Makefile
+++ b/usr.bin/ssh/ssh-keygen/Makefile
@@ -8,8 +8,7 @@ LDADD= -lcrypto -lutil -lz
DPADD= ${LIBCRYPTO} ${LIBDES} ${LIBUTIL} ${LIBZ}
MAN= ssh-keygen.1
-SRCS= ssh-keygen.c log-client.c readpass.c rsa.c \
- buffer.c xmalloc.c authfile.c mpaux.c bufaux.c \
- crc32.c match.c cipher.c compress.c
+SRCS= ssh-keygen.c log-client.c readpass.c rsa.c buffer.c \
+ xmalloc.c authfile.c mpaux.c bufaux.c cipher.c
.include <bsd.prog.mk>
diff --git a/usr.bin/ssh/ssh/Makefile b/usr.bin/ssh/ssh/Makefile
index ff7e27f4278..0f4fc17bf7e 100644
--- a/usr.bin/ssh/ssh/Makefile
+++ b/usr.bin/ssh/ssh/Makefile
@@ -9,10 +9,9 @@ LINKS= ${BINDIR}/ssh ${BINDIR}/slogin
MLINKS= ssh.1 slogin.1
SRCS= ssh.c sshconnect.c log-client.c readconf.c hostfile.c readpass.c \
- tildexpand.c uidswap.c clientloop.c canohost.c rsa.c \
- buffer.c packet.c xmalloc.c ttymodes.c channels.c bufaux.c \
- authfd.c authfile.c crc32.c match.c mpaux.c cipher.c \
- compress.c
+ tildexpand.c uidswap.c clientloop.c canohost.c rsa.c buffer.c \
+ packet.c xmalloc.c ttymodes.c channels.c bufaux.c authfd.c \
+ authfile.c crc32.c match.c mpaux.c cipher.c compress.c
.include <bsd.own.mk> # for AFS
diff --git a/usr.bin/ssh/sshd/Makefile b/usr.bin/ssh/sshd/Makefile
index b1e0cc7ee95..7327b13d6b0 100644
--- a/usr.bin/ssh/sshd/Makefile
+++ b/usr.bin/ssh/sshd/Makefile
@@ -7,11 +7,10 @@ BINDIR= /usr/sbin
MAN= sshd.8
SRCS= sshd.c auth-rhosts.c auth-passwd.c auth-rsa.c auth-rh-rsa.c \
- pty.c log-server.c login.c hostfile.c canohost.c \
- servconf.c tildexpand.c uidswap.c serverloop.c rsa.c \
- buffer.c packet.c xmalloc.c ttymodes.c channels.c bufaux.c \
- authfd.c authfile.c crc32.c match.c mpaux.c cipher.c \
- compress.c
+ pty.c log-server.c login.c hostfile.c canohost.c servconf.c \
+ tildexpand.c uidswap.c serverloop.c rsa.c buffer.c packet.c \
+ xmalloc.c ttymodes.c channels.c bufaux.c authfd.c authfile.c \
+ crc32.c match.c mpaux.c cipher.c compress.c
.include <bsd.own.mk> # for KERBEROS and AFS