Text   |  XML   |  ReML   |   Visible Warnings:

Uninitialized Variable  at master-settings.c:724

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

get_process_capability

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/master-settings.c)expand/collapse
Show more  
 659  static const char *
 660  get_process_capability(enum process_type ptype, struct settings *set)
 661  {
 662          /* FIXME: pretty ugly code just for getting the capability
 663             automatically */
 664          static const char *args[] = {
 665                  "uid=65534",
 666                  "gid=65534",
 667                  "home=/tmp",
 668                  NULL 
 669          };
 670          const char *pname = process_names[ptype];
 671          enum  ;
 672          struct  request;
 673          char buf[4096];
 674          int fd[2], status;
 675          ssize_t ret;
 676          unsigned int pos;
 677          uid_t uid;
 678          pid_t pid;
 679   
 680          uid = geteuid();
 681          if (uid != 0) {
 682                  /* use the current user */
 683                  args[0] = t_strdup_printf("uid=%s", dec2str(uid));
 684                  args[1] = t_strdup_printf("gid=%s", dec2str(getegid()));
 685          } else {
 686                  /* try to use some existing user. at least osx launchd
 687                     doesn't like non-existing users. */
 688                  struct passwd *pw;
 689   
 690                  pw = getpwnam("nobody");
 691                  if (pw != NULL && pw->pw_uid != (uid_t)-1 &&
 692                      pw->pw_gid != (gid_t)-1) {
 693                          args[0] = t_strdup_printf("uid=%s", dec2str(pw->pw_uid));
 694                          args[1] = t_strdup_printf("gid=%s", dec2str(pw->pw_gid));
 695                  }
 696          }
 697   
 698          if (pipe(fd) < 0) {
 699                  i_error("pipe() failed: %m");
 700                  return NULL;
 701          }
 702          fd_close_on_exec(fd[0], TRUE);
 703          fd_close_on_exec(fd[1], TRUE);
 704   
 705          memset(&request, 0, sizeof(request));
 706          request.fd = fd[1];
 707           = create_mail_process(ptype, set, &request,
 708                                             "dump-capability", args, NULL, TRUE,
 709[+]                                            &pid);
 710          if ( != ) {
 711                  (void)close(fd[0]);
 712                  (void)close(fd[1]);
 713                  return NULL;
 714          }
 715          (void)close(fd[1]);
 716   
 717          alarm(5);
 718          if (wait(&status) == -1) {
 719                  i_fatal("%s dump-capability process %d got stuck",
 720                          pname, (int)pid);
 721          }
 722          alarm(0);
 723   
 724          if (status != 0) {
Show more  




Change Warning 7831.25268 : Uninitialized Variable

Priority:
State:
Finding:
Owner:
Note: