Got rid of Win32 versions in pathnames.h, got rid of password io handles

This commit is contained in:
manojampalam 2016-03-24 19:10:28 -07:00
parent df9a548ef3
commit d061364c5a
5 changed files with 6 additions and 87 deletions

View File

@ -1564,7 +1564,7 @@
#define _PATH_PASSWD_PROG "/usr/bin/passwd" #define _PATH_PASSWD_PROG "/usr/bin/passwd"
/* Specify location of ssh.pid */ /* Specify location of ssh.pid */
#define _PATH_SSH_PIDDIR "/var/run" #define _PATH_SSH_PIDDIR "."
/* Define if we don't have struct __res_state in resolv.h */ /* Define if we don't have struct __res_state in resolv.h */
#define __res_state state #define __res_state state
@ -1725,3 +1725,7 @@ typedef long ssize_t;
#define HAVE_MBLEN 1 #define HAVE_MBLEN 1
#define SSHDIR "."
#define _PATH_SFTP_SERVER "./sftp-server.exe"
#define _PATH_SSH_PROGRAM "./ssh.exe"

View File

@ -35,20 +35,6 @@
* should be world-readable. * should be world-readable.
*/ */
#ifdef WIN32_FIXME
# define _PATH_SERVER_CONFIG_FILE "sshd_config"
# define _PATH_HOST_CONFIG_FILE "ssh_config"
# define _PATH_HOST_KEY_FILE "ssh_host_key"
# define _PATH_HOST_DSA_KEY_FILE "ssh_host_dsa_key"
# define _PATH_HOST_ECDSA_KEY_FILE "ssh_host_ecdsa_key"
# define _PATH_HOST_ED25519_KEY_FILE "ssh_host_ed25519_key"
# define _PATH_HOST_RSA_KEY_FILE "ssh_host_rsa_key"
# define _PATH_DH_MODULI "moduli"
# define _PATH_DH_PRIMES "primes"
# define _PATH_SSH_PROGRAM "ssh.exe"
#else
#define _PATH_SERVER_CONFIG_FILE SSHDIR "/sshd_config" #define _PATH_SERVER_CONFIG_FILE SSHDIR "/sshd_config"
#define _PATH_HOST_CONFIG_FILE SSHDIR "/ssh_config" #define _PATH_HOST_CONFIG_FILE SSHDIR "/ssh_config"
#define _PATH_HOST_KEY_FILE SSHDIR "/ssh_host_key" #define _PATH_HOST_KEY_FILE SSHDIR "/ssh_host_key"
@ -63,17 +49,12 @@
#ifndef _PATH_SSH_PROGRAM #ifndef _PATH_SSH_PROGRAM
#define _PATH_SSH_PROGRAM "/usr/bin/ssh" #define _PATH_SSH_PROGRAM "/usr/bin/ssh"
#endif #endif
#endif
/* /*
* The process id of the daemon listening for connections is saved here to * The process id of the daemon listening for connections is saved here to
* make it easier to kill the correct daemon when necessary. * make it easier to kill the correct daemon when necessary.
*/ */
#ifndef WIN32_FIXME
#define _PATH_SSH_DAEMON_PID_FILE _PATH_SSH_PIDDIR "/sshd.pid" #define _PATH_SSH_DAEMON_PID_FILE _PATH_SSH_PIDDIR "/sshd.pid"
#else
#define _PATH_SSH_DAEMON_PID_FILE "sshd.pid"
#endif
/* /*
* The directory in user's home directory in which the files reside. The * The directory in user's home directory in which the files reside. The
@ -156,12 +137,8 @@
/* xauth for X11 forwarding */ /* xauth for X11 forwarding */
#ifndef _PATH_XAUTH #ifndef _PATH_XAUTH
#ifdef WIN32_FIXME
#define _PATH_XAUTH "./auth.exe"
#else
#define _PATH_XAUTH "/usr/X11R6/bin/xauth" #define _PATH_XAUTH "/usr/X11R6/bin/xauth"
#endif #endif
#endif
@ -176,15 +153,9 @@
#endif #endif
/* for sftp */ /* for sftp */
#ifdef WIN32_FIXME
#ifndef _PATH_SFTP_SERVER
#define _PATH_SFTP_SERVER "./sftp-server.exe"
#endif
#else
#ifndef _PATH_SFTP_SERVER #ifndef _PATH_SFTP_SERVER
#define _PATH_SFTP_SERVER "/usr/libexec/sftp-server" #define _PATH_SFTP_SERVER "/usr/libexec/sftp-server"
#endif #endif
#endif /* else WIN32_FIXME */
/* chroot directory for unprivileged user when UsePrivilegeSeparation=yes */ /* chroot directory for unprivileged user when UsePrivilegeSeparation=yes */
#ifndef _PATH_PRIVSEP_CHROOT_DIR #ifndef _PATH_PRIVSEP_CHROOT_DIR

View File

@ -1533,29 +1533,7 @@ parse_keytypes:
case oPubkeyAcceptedKeyTypes: case oPubkeyAcceptedKeyTypes:
charptr = &options->pubkey_key_types; charptr = &options->pubkey_key_types;
goto parse_keytypes; goto parse_keytypes;
#ifdef WIN32_FIXME
case oPassInputHandle:
{
arg = strdelim(&s);
options -> passInputHandle_ = atoi(arg);
break;
}
case oPassOutputHandle:
{
arg = strdelim(&s);
options -> passOutputHandle_ = atoi(arg);
break;
}
#endif
case oDeprecated: case oDeprecated:
debug("%s line %d: Deprecated option \"%s\"", debug("%s line %d: Deprecated option \"%s\"",
@ -1740,13 +1718,6 @@ initialize_options(Options * options)
options->update_hostkeys = -1; options->update_hostkeys = -1;
options->hostbased_key_types = NULL; options->hostbased_key_types = NULL;
options->pubkey_key_types = NULL; options->pubkey_key_types = NULL;
#ifdef WIN32_FIXME
options -> passInputHandle_ = NULL;
options -> passOutputHandle_ = NULL;
#endif
} }
/* /*

View File

@ -157,12 +157,6 @@ typedef struct {
char *pubkey_key_types; char *pubkey_key_types;
char *ignored_unknown; /* Pattern list of unknown tokens to ignore */ char *ignored_unknown; /* Pattern list of unknown tokens to ignore */
#ifdef WIN32_FIXME
HANDLE passInputHandle_;
HANDLE passOutputHandle_;
#endif
} Options; } Options;
#define SSH_CANONICALISE_NO 0 #define SSH_CANONICALISE_NO 0

21
ssh.c
View File

@ -1072,27 +1072,6 @@ main(int ac, char **av)
ac--, av++; ac--, av++;
} }
#ifdef WIN32_FIXME #ifdef WIN32_FIXME
/*
* Redirect stdin/stdout for password read. This trick allow
* use of all auth procedures from ssh client in sftp without
* additional code in parent.
*/
if (options.passInputHandle_)
{
debug3("Redirecting pass input to %d...\n", options.passInputHandle_);
abort();
//PassInputFd = _open_osfhandle(options.passInputHandle_, O_RDONLY);
}
if (options.passOutputHandle_)
{
debug3("Redirecting pass prompt output to %d...\n", options.passOutputHandle_);
abort();
//PassOutputFd = _open_osfhandle(options.passOutputHandle_, O_WRONLY);
}
// create various Windows user home directory based file names // create various Windows user home directory based file names
sprintf(dotsshdir,"%s\\%s", pw->pw_dir, _PATH_SSH_USER_DIR ); sprintf(dotsshdir,"%s\\%s", pw->pw_dir, _PATH_SSH_USER_DIR );
_mkdir(dotsshdir); //this base directory for the user is needed _mkdir(dotsshdir); //this base directory for the user is needed