/[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.98 by sysadm, Mon Dec 1 08:17:28 2025 UTC Revision 1.100 by sysadm, Tue Dec 2 08:04:29 2025 UTC
# Line 40  Line 40 
40  #include <netinet/in.h>  #include <netinet/in.h>
41  #include <sys/ioctl.h>  #include <sys/ioctl.h>
42  #include <sys/socket.h>  #include <sys/socket.h>
43    #include <sys/stat.h>
44  #include <sys/types.h>  #include <sys/types.h>
45  #include <sys/wait.h>  #include <sys/wait.h>
46    
# Line 509  cleanup: Line 510  cleanup:
510    
511  int net_server(const char *hostaddr, in_port_t port[])  int net_server(const char *hostaddr, in_port_t port[])
512  {  {
513            struct stat file_stat;
514          unsigned int addrlen;          unsigned int addrlen;
515          int ret;          int ret;
516          int flags_server[2];          int flags_server[2];
# Line 538  int net_server(const char *hostaddr, in_ Line 540  int net_server(const char *hostaddr, in_
540    
541          if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY, SSH_HOST_RSA_KEY_FILE) < 0)          if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY, SSH_HOST_RSA_KEY_FILE) < 0)
542          {          {
543                  log_error("Error setting SSH RSA key: %s\n", SSH_HOST_RSA_KEY_FILE);                  log_error("Error loading SSH RSA key: %s\n", SSH_HOST_RSA_KEY_FILE);
544          }          }
545          else          else
546          {          {
# Line 546  int net_server(const char *hostaddr, in_ Line 548  int net_server(const char *hostaddr, in_
548          }          }
549          if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY, SSH_HOST_ED25519_KEY_FILE) < 0)          if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY, SSH_HOST_ED25519_KEY_FILE) < 0)
550          {          {
551                  log_error("Error setting SSH ED25519 key: %s\n", SSH_HOST_ED25519_KEY_FILE);                  log_error("Error loading SSH ED25519 key: %s\n", SSH_HOST_ED25519_KEY_FILE);
552            }
553            else
554            {
555                    ssh_key_valid = 1;
556            }
557            if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY, SSH_HOST_ECDSA_KEY_FILE) < 0)
558            {
559                    log_error("Error loading SSH ECDSA key: %s\n", SSH_HOST_ECDSA_KEY_FILE);
560          }          }
561          else          else
562          {          {
# Line 562  int net_server(const char *hostaddr, in_ Line 572  int net_server(const char *hostaddr, in_
572    
573          if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_BINDADDR, hostaddr) < 0 ||          if (ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_BINDADDR, hostaddr) < 0 ||
574                  ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_BINDPORT, &port) < 0 ||                  ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_BINDPORT, &port) < 0 ||
575                  ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY_ALGORITHMS, "ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-ed25519") < 0 ||                  ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_HOSTKEY_ALGORITHMS, "+ssh-rsa") < 0 ||
576                  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)
577          {          {
578                  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 795  int net_server(const char *hostaddr, in_ Line 805  int net_server(const char *hostaddr, in_
805                                  log_error("Reload BWF conf failed\n");                                  log_error("Reload BWF conf failed\n");
806                          }                          }
807    
808                            // Get EULA modification tm
809                            if (stat(DATA_EULA, &file_stat) == -1)
810                            {
811                                    log_error("stat(%s) error\n", DATA_EULA, errno);
812                            }
813                            else
814                            {
815                                    BBS_eula_tm = file_stat.st_mtim.tv_sec;
816                            }
817    
818                          if (detach_menu_shm(&bbs_menu) < 0)                          if (detach_menu_shm(&bbs_menu) < 0)
819                          {                          {
820                                  log_error("detach_menu_shm(bbs_menu) error\n");                                  log_error("detach_menu_shm(bbs_menu) error\n");


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

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