/[LeafOK_CVS]/lbbs/src/net_server.c
ViewVC logotype

Diff of /lbbs/src/net_server.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.58 by sysadm, Sat Jun 7 11:28:29 2025 UTC Revision 1.64 by sysadm, Mon Jun 23 08:47:56 2025 UTC
# Line 14  Line 14 
14   *                                                                         *   *                                                                         *
15   ***************************************************************************/   ***************************************************************************/
16    
 #define _XOPEN_SOURCE 500  
 #define _POSIX_C_SOURCE 200809L  
 #define _GNU_SOURCE  
   
 #include "net_server.h"  
 #include "common.h"  
 #include "bbs_main.h"  
17  #include "bbs.h"  #include "bbs.h"
18  #include "log.h"  #include "bbs_main.h"
19    #include "common.h"
20    #include "database.h"
21    #include "file_loader.h"
22  #include "io.h"  #include "io.h"
23  #include "init.h"  #include "init.h"
24  #include "menu.h"  #include "log.h"
 #include "database.h"  
25  #include "login.h"  #include "login.h"
26  #include "file_loader.h"  #include "menu.h"
27    #include "net_server.h"
28  #include "section_list_loader.h"  #include "section_list_loader.h"
29  #include <errno.h>  #include <errno.h>
30  #include <fcntl.h>  #include <fcntl.h>
 #include <string.h>  
31  #include <signal.h>  #include <signal.h>
32  #include <stdlib.h>  #include <stdlib.h>
33    #include <string.h>
34  #include <unistd.h>  #include <unistd.h>
 #include <sys/syscall.h>  
 #include <sys/socket.h>  
 #include <sys/wait.h>  
 #include <sys/epoll.h>  
35  #include <arpa/inet.h>  #include <arpa/inet.h>
36  #include <netinet/in.h>  #include <libssh/callbacks.h>
 #include <systemd/sd-daemon.h>  
37  #include <libssh/libssh.h>  #include <libssh/libssh.h>
38  #include <libssh/server.h>  #include <libssh/server.h>
39  #include <libssh/callbacks.h>  #include <netinet/in.h>
40    #include <sys/epoll.h>
41    #include <sys/socket.h>
42    #include <sys/syscall.h>
43    #include <sys/types.h>
44    #include <sys/wait.h>
45    #include <systemd/sd-daemon.h>
46    
47  struct process_sockaddr_t  struct process_sockaddr_t
48  {  {
# Line 273  int net_server(const char *hostaddr, in_ Line 270  int net_server(const char *hostaddr, in_
270          if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_BINDADDR, hostaddr) < 0 ||          if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_BINDADDR, hostaddr) < 0 ||
271                  ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_BINDPORT, &port) < 0 ||                  ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_BINDPORT, &port) < 0 ||
272                  ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY, SSH_HOST_KEYFILE) < 0 ||                  ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY, SSH_HOST_KEYFILE) < 0 ||
273                    ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY_ALGORITHMS, "ssh-rsa,rsa-sha2-512,rsa-sha2-256") < 0 ||
274                  ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_LOG_VERBOSITY, &ssh_log_level) < 0)                  ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_LOG_VERBOSITY, &ssh_log_level) < 0)
275          {          {
276                  log_error("Error setting SSH bind options: %s\n", ssh_get_error(sshbind));                  log_error("Error setting SSH bind options: %s\n", ssh_get_error(sshbind));
# Line 525  int net_server(const char *hostaddr, in_ Line 523  int net_server(const char *hostaddr, in_
523    
524                                          port_client = ntohs(sin.sin_port);                                          port_client = ntohs(sin.sin_port);
525    
526                                          log_common("Accept %sconnection from %s:%d\n", (SSH_v2 ? "" : "SSH2 "), hostaddr_client, port_client);                                          log_common("Accept %s connection from %s:%d\n", (SSH_v2 ? "SSH" : "telnet"), hostaddr_client, port_client);
527    
528                                          if (SYS_child_process_count - 1 < BBS_max_client)                                          if (SYS_child_process_count - 1 < BBS_max_client)
529                                          {                                          {


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1