Text   |  XML   |  ReML   |   Visible Warnings:

Unreachable Computation  at login-process.c:734

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

create_login_process

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/login-process.c)expand/collapse
Show more  
 630  static pid_t (struct  *group)
 631  {
 632          struct log_io *log;
 633          const struct listener *listens;
 634          unsigned int max_log_lines_per_sec;
 635          const char *prefix;
 636          pid_t pid;
 637          ARRAY_TYPE(dup2) dups;
 638          unsigned int i, listen_count = 0, ssl_listen_count = 0;
 639          int fd[2], log_fd, cur_fd, tmp_fd;
 640   
 641          if (group->set-> == 0)
 642                  i_fatal(" process must not run as root");
 643   
 644          /* create communication to process with a socket pair */
 645          if (socketpair(AF_UNIX, SOCK_STREAM, 0, fd) < 0) {
 646                  i_error("socketpair() failed: %m");
 647                  return -1;
 648          }
 649   
 650          max_log_lines_per_sec =
 651                  group->set-> ? 10 : 0;
 652          log_fd = log_create_pipe(&log, max_log_lines_per_sec);
 653          if (log_fd < 0)
 654                  pid = -1;
 655          else {
 656                  pid = fork();
 657                  if (pid < 0)
 658                          i_error("fork() failed: %m");
 659          }
 660   
 661          if (pid < 0) {
 662                  (void)close(fd[0]);
 663                  (void)close(fd[1]);
 664                  (void)close(log_fd);
 665                  return -1;
 666          }
 667   
 668          if (pid != 0) {
 669                  /* master */
 670                  prefix = t_strdup_printf("%s-: ",
 671                                  process_names[group->mail_process_type]);
 672                  log_set_prefix(log, prefix);
 673                  log_set_pid(log, pid);
 674   
 675                  net_set_nonblock(fd[0], TRUE);
 676                  fd_close_on_exec(fd[0], TRUE);
 677                  (void)(group, pid, fd[0], FALSE);
 678                  (void)close(fd[1]);
 679                  (void)close(log_fd);
 680                  return pid;
 681          }
 682   
 683          prefix = t_strdup_printf("master-%s-: ",
 684                                   process_names[group->mail_process_type]);
 685          log_set_prefix(log, prefix);
 686   
 687          t_array_init(&dups, 16);
 688          dup2_append(&dups, null_fd, STDIN_FILENO);
 689          /* redirect writes to stdout also to error log. For example OpenSSL 
 690             can be made to log its debug messages to stdout. */
 691          dup2_append(&dups, log_fd, STDOUT_FILENO);
 692          dup2_append(&dups, log_fd, STDERR_FILENO);
 693          dup2_append(&dups, fd[1], );
 694   
 695          /* redirect listener fds */
 696          cur_fd =  + 1;
 697          if (array_is_created(&group->set->listens)) {
 698                  listens = array_get(&group->set->listens, &listen_count);
 699                  for (i = 0; i < listen_count; i++, cur_fd++)
 700                          dup2_append(&dups, listens[i].fd, cur_fd);
 701          }
 702   
 703          if (array_is_created(&group->set->ssl_listens)) {
 704                  listens = array_get(&group->set->ssl_listens,
 705                                      &ssl_listen_count);
 706                  for (i = 0; i < ssl_listen_count; i++, cur_fd++)
 707                          dup2_append(&dups, listens[i].fd, cur_fd);
 708          }
 709   
 710          /* make sure we don't leak syslog fd. try to do it as late as possible,
 711             but also before dup2()s in case syslog fd is one of them. */
 712          closelog();
 713   
 714          if (dup2_array(&dups) < 0)
 715                  i_fatal("Failed to dup2() fds");
 716   
 717          /* don't close any of these */
 718          for (tmp_fd = 0; tmp_fd < cur_fd; tmp_fd++)
 719                  fd_close_on_exec(tmp_fd, FALSE);
 720   
 721          (void)close(fd[0]);
 722          (void)close(fd[1]);
 723   
 724          (group, getpid());
 725   
 726          env_put(t_strdup_printf("LISTEN_FDS=%u", listen_count));
 727          env_put(t_strdup_printf("SSL_LISTEN_FDS=%u", ssl_listen_count));
 728   
 729          restrict_process_size(group->set->, (unsigned int)-1);
 730   
 731          client_process_exec(group->set->, "");
 732          i_fatal_status(FATAL_EXEC, "execv(%s) failed: %m",
 733                         group->set->);
 734          return -1;
 735  }
Show more  




Change Warning 7756.25471 : Unreachable Computation

Priority:
State:
Finding:
Owner:
Note: