more probably not going to work fixes

This commit is contained in:
Andrew Pamment 2016-08-07 10:06:21 +10:00
parent 04e352eae6
commit 3525de4075

26
main.c
View File

@ -11,7 +11,17 @@
#include <errno.h> #include <errno.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <libssh/libssh.h> #include <libssh/libssh.h>
#include <libssh/server.h>
#include <libssh/callbacks.h>
#include <string.h> #include <string.h>
#include <poll.h>
#if defined(linux)
# include <pty.h>
#elif defined(__OpenBSD__) || defined(__NetBSD__)
# include <util.h>
#else
# include <libutil.h>
#endif
#include "bbs.h" #include "bbs.h"
#include "inih/ini.h" #include "inih/ini.h"
@ -345,7 +355,7 @@ int ssh_authenticate(ssh_session p_ssh_session) {
char *password; char *password;
do { do {
msg = ssh_message_get(p_ssh_session); message = ssh_message_get(p_ssh_session);
switch(ssh_message_type(message)) { switch(ssh_message_type(message)) {
case SSH_REQUEST_AUTH: case SSH_REQUEST_AUTH:
switch(ssh_message_subtype(message)) { switch(ssh_message_subtype(message)) {
@ -460,7 +470,7 @@ void serverssh(int port) {
char *ip; char *ip;
ssh_event event; ssh_event event;
short events; short events;
ssh_message message;
err = ssh_init(); err = ssh_init();
if (err == -1) { if (err == -1) {
fprintf(stderr, "Error starting SSH server.\n"); fprintf(stderr, "Error starting SSH server.\n");
@ -475,12 +485,12 @@ void serverssh(int port) {
p_ssh_bind = ssh_bind_new(); p_ssh_bind = ssh_bind_new();
if (p_ssh_bind == NULL) { if (p_ssh_bind == NULL) {
fprintf(stderr, "Error starting SSH server.\n"); fprintf(stderr, "Error starting SSH server.\n");
exit(-1) exit(-1);
} }
ssh_bind_options_set(pSshBind, SSH_BIND_OPTIONS_BINDPORT, &port); ssh_bind_options_set(p_ssh_bind, SSH_BIND_OPTIONS_BINDPORT, &port);
ssh_bind_options_set(pSshBind, SSH_BIND_OPTIONS_DSAKEY, conf.ssh_dsa_key); ssh_bind_options_set(p_ssh_bind, SSH_BIND_OPTIONS_DSAKEY, conf.ssh_dsa_key);
ssh_bind_options_set(pSshBind, SSH_BIND_OPTIONS_RSAKEY, conf.ssh_rsa_key); ssh_bind_options_set(p_ssh_bind, SSH_BIND_OPTIONS_RSAKEY, conf.ssh_rsa_key);
ssh_bind_listen(p_ssh_bind); ssh_bind_listen(p_ssh_bind);
@ -743,9 +753,9 @@ int main(int argc, char **argv) {
fclose(fptr); fclose(fptr);
} }
} else { } else {
server(conf.port); server(conf.telnet_port);
} }
} else { } else {
server(conf.port); server(conf.telnet_port);
} }
} }