summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/ssh/channels.c16
-rw-r--r--usr.bin/ssh/clientloop.c10
-rw-r--r--usr.bin/ssh/config.h19
-rw-r--r--usr.bin/ssh/log-server.c7
-rw-r--r--usr.bin/ssh/packet.c12
-rw-r--r--usr.bin/ssh/scp.c38
-rw-r--r--usr.bin/ssh/servconf.c6
-rw-r--r--usr.bin/ssh/ssh-agent.c7
-rw-r--r--usr.bin/ssh/ssh.c4
9 files changed, 10 insertions, 109 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index e3c1ca782cd..2d935a31f17 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -16,7 +16,7 @@ arbitrary tcp/ip connections, and the authentication agent connection.
*/
#include "includes.h"
-RCSID("$Id: channels.c,v 1.6 1999/09/29 21:14:16 deraadt Exp $");
+RCSID("$Id: channels.c,v 1.7 1999/09/30 05:11:29 deraadt Exp $");
#include "ssh.h"
#include "packet.h"
@@ -974,11 +974,7 @@ void channel_input_port_open(int payload_len)
}
memset(&sin, 0, sizeof(sin));
-#ifdef BROKEN_INET_ADDR
- sin.sin_addr.s_addr = inet_network(host);
-#else /* BROKEN_INET_ADDR */
sin.sin_addr.s_addr = inet_addr(host);
-#endif /* BROKEN_INET_ADDR */
if ((sin.sin_addr.s_addr & 0xffffffff) != 0xffffffff)
{
/* It was a valid numeric host address. */
@@ -1226,11 +1222,7 @@ void x11_input_open(int payload_len)
/* Try to parse the host name as a numeric IP address. */
memset(&sin, 0, sizeof(sin));
-#ifdef BROKEN_INET_ADDR
- sin.sin_addr.s_addr = inet_network(buf);
-#else /* BROKEN_INET_ADDR */
sin.sin_addr.s_addr = inet_addr(buf);
-#endif /* BROKEN_INET_ADDR */
if ((sin.sin_addr.s_addr & 0xffffffff) != 0xffffffff)
{
/* It was a valid numeric host address. */
@@ -1389,9 +1381,7 @@ char *auth_get_socket_name()
void auth_input_request_forwarding(struct passwd *pw)
{
int pfd = get_permanent_fd(pw->pw_shell);
-#ifdef HAVE_UMASK
mode_t savedumask;
-#endif /* HAVE_UMASK */
if (pfd < 0)
{
@@ -1417,9 +1407,7 @@ void auth_input_request_forwarding(struct passwd *pw)
strncpy(sunaddr.sun_path, channel_forwarded_auth_socket_name,
sizeof(sunaddr.sun_path));
-#ifdef HAVE_UMASK
savedumask = umask(0077);
-#endif /* HAVE_UMASK */
/* Temporarily use a privileged uid. */
temporarily_use_uid(pw->pw_uid);
@@ -1430,9 +1418,7 @@ void auth_input_request_forwarding(struct passwd *pw)
/* Restore the privileged uid. */
restore_uid();
-#ifdef HAVE_UMASK
umask(savedumask);
-#endif /* HAVE_UMASK */
/* Start listening on the socket. */
if (listen(sock, 5) < 0)
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c
index a82a0fb4ac6..f8973e7615c 100644
--- a/usr.bin/ssh/clientloop.c
+++ b/usr.bin/ssh/clientloop.c
@@ -15,7 +15,7 @@ The main loop for the interactive session (client side).
*/
#include "includes.h"
-RCSID("$Id: clientloop.c,v 1.3 1999/09/30 05:03:04 deraadt Exp $");
+RCSID("$Id: clientloop.c,v 1.4 1999/09/30 05:11:29 deraadt Exp $");
#include "xmalloc.h"
#include "ssh.h"
@@ -124,11 +124,7 @@ void leave_non_blocking()
void enter_non_blocking()
{
in_non_blocking_mode = 1;
-#if defined(O_NONBLOCK) && !defined(O_NONBLOCK_BROKEN)
(void)fcntl(fileno(stdin), F_SETFL, O_NONBLOCK);
-#else /* O_NONBLOCK && !O_NONBLOCK_BROKEN */
- (void)fcntl(fileno(stdin), F_SETFL, O_NDELAY);
-#endif /* O_NONBLOCK && !O_NONBLOCK_BROKEN */
fatal_add_cleanup((void (*)(void *))leave_non_blocking, NULL);
}
@@ -162,13 +158,9 @@ RETSIGTYPE signal_handler(int sig)
double get_current_time()
{
-#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
gettimeofday(&tv, NULL);
return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
-#else /* HAVE_GETTIMEOFDAY */
- return (double)time(NULL);
-#endif /* HAVE_GETTIMEOFDAY */
}
/* This is called when the interactive is entered. This checks if there
diff --git a/usr.bin/ssh/config.h b/usr.bin/ssh/config.h
index cd525b9cef5..2eb228af6d9 100644
--- a/usr.bin/ssh/config.h
+++ b/usr.bin/ssh/config.h
@@ -53,9 +53,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-/* #undef STAT_MACROS_BROKEN */
-
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
@@ -135,9 +132,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
/* Location of system mail spool directory. */
#define MAIL_SPOOL_DIRECTORY "/var/mail"
-/* Define this if O_NONBLOCK does not work on your system (e.g., Ultrix). */
-/* #undef O_NONBLOCK_BROKEN */
-
/* Define this to include libwrap (tcp_wrappers) support. */
/* #undef LIBWRAP */
@@ -161,10 +155,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
address instead of the host name in DISPLAY. */
/* #undef HPSUX_NONSTANDARD_X11_KLUDGE */
-/* Define this if inet_network should be used instead of inet_addr. This is
- the case on DGUX 5.4. */
-/* #undef BROKEN_INET_ADDR */
-
/* Define this if your system does not like sizeof(struct sockaddr_un) as the
size argument in bind and connect calls for unix domain sockets. */
/* #undef USE_STRLEN_FOR_AF_UNIX */
@@ -224,9 +214,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
/* Define if you have the getrusage function. */
#define HAVE_GETRUSAGE 1
-/* Define if you have the gettimeofday function. */
-#define HAVE_GETTIMEOFDAY 1
-
/* Define if you have the initgroups function. */
#define HAVE_INITGROUPS 1
@@ -278,15 +265,9 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
/* Define if you have the ulimit function. */
/* #undef HAVE_ULIMIT */
-/* Define if you have the umask function. */
-#define HAVE_UMASK 1
-
/* Define if you have the vhangup function. */
/* #undef HAVE_VHANGUP */
-/* Define if you have the vsnprintf function. */
-#define HAVE_VSNPRINTF 1
-
/* Define if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
diff --git a/usr.bin/ssh/log-server.c b/usr.bin/ssh/log-server.c
index c906e0976c7..f19f288dabb 100644
--- a/usr.bin/ssh/log-server.c
+++ b/usr.bin/ssh/log-server.c
@@ -15,7 +15,7 @@ to the system log.
*/
#include "includes.h"
-RCSID("$Id: log-server.c,v 1.3 1999/09/30 05:03:04 deraadt Exp $");
+RCSID("$Id: log-server.c,v 1.4 1999/09/30 05:11:29 deraadt Exp $");
#include <syslog.h>
#include <sys/syslog.h>
@@ -89,12 +89,7 @@ void log_init(char *av0, int on_stderr, int debug, int quiet,
#define MSGBUFSIZE 1024
-#ifdef HAVE_VSNPRINTF
#define DECL_MSGBUF char msgbuf[MSGBUFSIZE]
-#else
-static char msgbuf[MSGBUFSIZE];
-#define DECL_MSGBUF
-#endif
/* Log this message (information that usually should go to the log). */
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c
index e07a0bdf48d..2623291faf7 100644
--- a/usr.bin/ssh/packet.c
+++ b/usr.bin/ssh/packet.c
@@ -15,7 +15,7 @@ with the other side. This same code is used both on client and server side.
*/
#include "includes.h"
-RCSID("$Id: packet.c,v 1.4 1999/09/30 05:03:04 deraadt Exp $");
+RCSID("$Id: packet.c,v 1.5 1999/09/30 05:11:29 deraadt Exp $");
#include "xmalloc.h"
#include "buffer.h"
@@ -101,23 +101,13 @@ void
packet_set_nonblocking()
{
/* Set the socket into non-blocking mode. */
-#if defined(O_NONBLOCK) && !defined(O_NONBLOCK_BROKEN)
if (fcntl(connection_in, F_SETFL, O_NONBLOCK) < 0)
error("fcntl O_NONBLOCK: %.100s", strerror(errno));
-#else /* O_NONBLOCK && !O_NONBLOCK_BROKEN */
- if (fcntl(connection_in, F_SETFL, O_NDELAY) < 0)
- error("fcntl O_NDELAY: %.100s", strerror(errno));
-#endif /* O_NONBLOCK && !O_NONBLOCK_BROKEN */
if (connection_out != connection_in)
{
-#if defined(O_NONBLOCK) && !defined(O_NONBLOCK_BROKEN)
if (fcntl(connection_out, F_SETFL, O_NONBLOCK) < 0)
error("fcntl O_NONBLOCK: %.100s", strerror(errno));
-#else /* O_NONBLOCK && !O_NONBLOCK_BROKEN */
- if (fcntl(connection_out, F_SETFL, O_NDELAY) < 0)
- error("fcntl O_NDELAY: %.100s", strerror(errno));
-#endif /* O_NONBLOCK && !O_NONBLOCK_BROKEN */
}
}
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c
index ea1864b06b1..13995309e61 100644
--- a/usr.bin/ssh/scp.c
+++ b/usr.bin/ssh/scp.c
@@ -42,42 +42,18 @@ and ssh has the necessary privileges.)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scp.c,v 1.4 1999/09/30 01:21:41 aaron Exp $
+ * $Id: scp.c,v 1.5 1999/09/30 05:11:29 deraadt Exp $
*/
#include "includes.h"
-RCSID("$Id: scp.c,v 1.4 1999/09/30 01:21:41 aaron Exp $");
+RCSID("$Id: scp.c,v 1.5 1999/09/30 05:11:29 deraadt Exp $");
#include "ssh.h"
#include "xmalloc.h"
-#ifdef HAVE_UTIME_H
#include <utime.h>
-#ifdef _NEXT_SOURCE
-struct utimbuf {
- time_t actime;
- time_t modtime;
-};
-#endif /* _NEXT_SOURCE */
-#else
-struct utimbuf
-{
- long actime;
- long modtime;
-};
-#endif
#define _PATH_CP "cp"
-#ifndef STDIN_FILENO
-#define STDIN_FILENO 0
-#endif
-#ifndef STDOUT_FILENO
-#define STDOUT_FILENO 1
-#endif
-#ifndef STDERR_FILENO
-#define STDERR_FILENO 2
-#endif
-
/* For progressmeter() function. */
#define STALLTIME 5
@@ -830,20 +806,12 @@ bad: run_err("%s: %s", np, strerror(errno));
#endif
if (pflag) {
if (exists || omode != mode)
-#ifdef HAVE_FCHMOD
if (fchmod(ofd, omode))
-#else /* HAVE_FCHMOD */
- if (chmod(np, omode))
-#endif /* HAVE_FCHMOD */
run_err("%s: set mode: %s",
np, strerror(errno));
} else {
if (!exists && omode != mode)
-#ifdef HAVE_FCHMOD
if (fchmod(ofd, omode & ~mask))
-#else /* HAVE_FCHMOD */
- if (chmod(np, omode & ~mask))
-#endif /* HAVE_FCHMOD */
run_err("%s: set mode: %s",
np, strerror(errno));
}
@@ -973,7 +941,7 @@ run_err(const char *fmt, ...)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scp.c,v 1.4 1999/09/30 01:21:41 aaron Exp $
+ * $Id: scp.c,v 1.5 1999/09/30 05:11:29 deraadt Exp $
*/
char *
diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c
index a1c74991f07..4e002a9a869 100644
--- a/usr.bin/ssh/servconf.c
+++ b/usr.bin/ssh/servconf.c
@@ -12,7 +12,7 @@ Created: Mon Aug 21 15:48:58 1995 ylo
*/
#include "includes.h"
-RCSID("$Id: servconf.c,v 1.5 1999/09/29 22:08:13 dugsong Exp $");
+RCSID("$Id: servconf.c,v 1.6 1999/09/30 05:11:29 deraadt Exp $");
#include "ssh.h"
#include "servconf.h"
@@ -296,11 +296,7 @@ void read_server_config(ServerOptions *options, const char *filename)
filename, linenum);
exit(1);
}
-#ifdef BROKEN_INET_ADDR
- options->listen_addr.s_addr = inet_network(cp);
-#else /* BROKEN_INET_ADDR */
options->listen_addr.s_addr = inet_addr(cp);
-#endif /* BROKEN_INET_ADDR */
break;
case sHostKeyFile:
diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c
index 3c949eeb127..5ad08bbb75b 100644
--- a/usr.bin/ssh/ssh-agent.c
+++ b/usr.bin/ssh/ssh-agent.c
@@ -14,7 +14,7 @@ The authentication agent program.
*/
#include "includes.h"
-RCSID("$Id: ssh-agent.c,v 1.4 1999/09/29 21:14:16 deraadt Exp $");
+RCSID("$Id: ssh-agent.c,v 1.5 1999/09/30 05:11:29 deraadt Exp $");
#include "ssh.h"
#include "rsa.h"
@@ -347,13 +347,8 @@ void
new_socket(int type, int fd)
{
unsigned int i, old_alloc;
-#if defined(O_NONBLOCK) && !defined(O_NONBLOCK_BROKEN)
if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
error("fcntl O_NONBLOCK: %s", strerror(errno));
-#else /* O_NONBLOCK && !O_NONBLOCK_BROKEN */
- if (fcntl(fd, F_SETFL, O_NDELAY) < 0)
- error("fcntl O_NDELAY: %s", strerror(errno));
-#endif /* O_NONBLOCK && !O_NONBLOCK_BROKEN */
if (fd > max_fd)
max_fd = fd;
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 0f0c7ce6d93..88c46757947 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -18,7 +18,7 @@ Modified to work with SSL by Niels Provos <provos@citi.umich.edu> in Canada.
*/
#include "includes.h"
-RCSID("$Id: ssh.c,v 1.15 1999/09/30 05:03:05 deraadt Exp $");
+RCSID("$Id: ssh.c,v 1.16 1999/09/30 05:11:29 deraadt Exp $");
#include "xmalloc.h"
#include "ssh.h"
@@ -205,13 +205,11 @@ main(int ac, char **av)
we may need to create the port several times). */
temporarily_use_uid(original_real_uid);
-#ifdef HAVE_UMASK
/* Set our umask to something reasonable, as some files are created with
the default umask. This will make them world-readable but writable
only by the owner, which is ok for all files for which we don't set
the modes explicitly. */
umask(022);
-#endif /* HAVE_UMASK */
/* Save our own name. */
av0 = av[0];