Package: p3scan
Severity: minor
Usertags: clang-ftbfs
User: pkg-llvm-t...@lists.alioth.debian.org
Tag: patch


Hello,

Using the rebuild infrastructure, your package fails to build with clang
(instead of gcc).

Thanks,
Arthur
diff -Naur p3scan.orig/p3scan-2.3.2/debian/changelog p3scan/p3scan-2.3.2/debian/changelog
--- p3scan.orig/p3scan-2.3.2/debian/changelog	2014-06-06 17:27:30.591648436 -0500
+++ p3scan/p3scan-2.3.2/debian/changelog	2014-06-07 16:14:06.661664975 -0500
@@ -1,3 +1,11 @@
+p3scan (2:2.3.2-8.2) unstable; urgency=low
+
+  * Fix FTBFS with clang:
+    - Fixed "function declaration not allowed" error in
+    p3scan.c
+
+ -- Arthur Marble <art...@info9.net>  Sat, 07 Jun 2014 16:14:06 -0500
+
 p3scan (2:2.3.2-8.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -Naur p3scan.orig/p3scan-2.3.2/debian/patches/clang-ftbfs.diff p3scan/p3scan-2.3.2/debian/patches/clang-ftbfs.diff 
--- p3scan.orig/p3scan-2.3.2/debian/patches/clang-ftbfs.diff	1969-12-31 18:00:00.000000000 -0600
+++ p3scan/p3scan-2.3.2/debian/patches/clang-ftbfs.diff	2014-06-07 16:11:43.009662473 -0500
@@ -0,0 +1,709 @@
+--- a/p3scan.c
++++ b/p3scan.c
+@@ -2349,6 +2349,343 @@ void usage(char * progname){
+    "\n"
+    );
+ }
++
++void switchoption(char opt, char * arg, char * optstr, char * where, int state,
++                  int error, char **argv, long i, long ii, int pidfd,
++                  char * rest, struct servent *port){
++   char *next_tok;
++   switch (opt){
++      case 'h':
++      case 'v':
++      case 'f':
++         /* don't check in second run (is in the first) */
++         if (state==CONFIG_STATE_CMD) return;
++         /* disallow help/version/configfile in configfile */
++         if (state==CONFIG_STATE_FILE){
++            fprintf(stderr, "%s '%s' is not allowed in configfile!\n", where, optstr);
++            error=1;
++            return;
++         }
++      break;
++      default:
++      /* only check help/version/configfile for the first cmd run */
++      if (state==CONFIG_STATE_CMDPRE) return;
++   }
++
++   switch (opt){
++      case 'h': /* usage */
++         usage(argv[0]);
++         exit(0);
++         break;
++      case 'v': /* version */
++         printversion();
++         exit(0);
++         break;
++      case 'f': /* config (file) */
++         config->configfile = arg;
++         break;
++      case 'F': /* footer (file) */
++         config->footer = arg;
++         break;
++      case 'd': /* debug */
++         config->debug=1;
++         break;
++      case 'e': /* Extra notification */
++         config->extra=arg;
++         break;
++      case 'E': /* SMTP (email) port */
++         i=strtol(arg, &rest, 10);
++         if (rest && strlen(rest)>0){
++            if (i>0){ /* 123abc */
++               fprintf(stderr, "%s %s isn't a valid port\n", where, arg);
++               error=1;
++            }else{
++               if((port=getservbyname(arg, "tcp"))!=NULL) config->smtpport=ntohs(port->s_port);
++               else{
++                  fprintf(stderr, "Port lookup for '%s/tcp' failed! Check /etc/services\n", arg);
++                  error=1;
++                }
++             }
++         } else {
++             if (i>0) config->smtpport=i;
++             else {
++               fprintf(stderr, "%s Incorrect emailport portnumber\n", where);
++               error=1;
++             }
++         }
++         break;
++      case 'l': /* PID File */
++         config->pidfile=arg;
++         if ((pidfd=open(config->pidfile,O_RDONLY ))>=0){
++            do_log(LOG_EMERG, "ERR: PID file %s exists! Aborting!",config->pidfile);
++            /* Should not reach here. We are dead. */
++            pidfd=close(pidfd);
++            exit(0);
++         }
++         break;
++      case 'L': /* SSL port */
++         i=strtol(arg, &rest, 10);
++         if (rest && strlen(rest)>0){
++            if (i>0){ /* 123abc */
++               fprintf(stderr, "%s %s isn't a valid port\n", where, arg);
++               error=1;
++            }else{
++               if((port=getservbyname(arg, "tcp"))!=NULL) config->sslport=ntohs(port->s_port);
++               else{
++                  fprintf(stderr, "Port lookup for '%s/tcp' failed! Check /etc/services\n", arg);
++                  error=1;
++               }
++            }
++         } else {
++            if (i>0) config->sslport=i;
++            else {
++               fprintf(stderr, "%s Incorrect POP3S portnumber\n", where);
++               error=1;
++            }
++         }
++         break;
++      case 'a': /* rename attachments using renattach */
++         config->renattach=arg;
++         break;
++      case 'A': /* use alternate virus notification email */
++         config->altemail=1;
++         break;
++      case 'r': /* virusdir */
++         config->virusdirbase=arg;
++         config->virusdir=config->virusdirbase;
++         break;
++      case 'R': /* smtp reject */
++         config->smtprset=arg;
++         break;
++      case 'n': /* notifydir */
++         config->notifydir=arg;
++         break;
++      case 'm': /* Max Childs */
++         i=strtol(arg, &rest, 10);
++         if ((rest && strlen(rest)>0) || i<1 || i>9999){
++            fprintf(stderr, "%s --maxchilds has to be 1 < val < 10000\n", where);
++            error=1;
++         } else config->maxchilds=(int)i;
++         break;
++      case 'i': /* IP (to listen on) */
++         if (!strcmp(arg, "0.0.0.0")){
++            config->addr.sin_addr.s_addr=htonl(INADDR_ANY);
++         }else if (!inet_aton(arg, &config->addr.sin_addr)){
++            fprintf(stderr, "%s %s isn't a valid IP Adress\n", where, arg);
++            error=1;
++         }
++         break;
++      case 'I': /* IP (to connect) */
++         if (!strcmp(arg, "0.0.0.0")){
++            config->targetaddr.sin_addr.s_addr=htonl(INADDR_ANY);
++         }else if (!inet_aton(arg, &config->targetaddr.sin_addr)){
++            fprintf(stderr, "%s %s isn't a valid IP Adress\n", where, arg);
++            error=1;
++         }
++         break;
++      case 'o': /* overwrite (disable) HTML */
++         config->overwrite=arg;
++         break;
++      case 'O': /* timeOut */
++         i=strtol(arg, &rest, 10);
++         if ((rest && strlen(rest)>0) || i<1 || i>9999){
++            fprintf(stderr, "%s --timeout has to be 1 < val < 10000\n", where);
++            error=1;
++         } else config->timeout=(int)i;
++         break;
++      case 'p': /* Port */
++         i=strtol(arg, &rest, 10);
++         if (rest && strlen(rest)>0){
++            if (i>0){ /* 123abc */
++               fprintf(stderr, "%s %s isn't a valid port\n", where, arg);
++               error=1;
++            }else{
++               if((port=getservbyname(arg, "tcp"))!=NULL){
++                  config->addr.sin_port=port->s_port;
++               }else{
++                  fprintf(stderr, "Port lookup for '%s/tcp' failed! Check /etc/services\n", arg);
++                  error=1;
++               }
++            }
++         }else{
++            if (i>0)config->addr.sin_port=htons((int)i);
++            else{
++               fprintf(stderr, "%s Incorrect POP3 portnumber\n", where);
++               error=1;
++            }
++         }
++         break;
++      case 'P': /* target Port */
++         i=strtol(arg, &rest, 10);
++         if (rest && strlen(rest)>0){
++            if (i>0){ /* 123abc */
++               fprintf(stderr, "%s %s isn't a valid port\n", where, arg);
++               error=1;
++            }else{
++               if((port=getservbyname(arg, "tcp"))!=NULL){
++                  config->targetaddr.sin_port=port->s_port;
++               }else{
++                  fprintf(stderr, "Port lookup for '%s/tcp' failed! Check /etc/services\n", arg);
++                  error=1;
++               }
++            }
++         }else{
++            if (i>0)config->targetaddr.sin_port=htons((int)i);
++            else{
++               fprintf(stderr, "%s Incorrect target portnumber\n", where);
++               error=1;
++            }
++         }
++         break;
++      case 'q': /* quiet */
++         config->quiet=1;
++         break;
++      case 'u': /* Run as User */
++         config->runasuser=arg;
++         /* getpwnam will also accept UID's, so we need no converting*/
++         break;
++      case 'U': /* Parse username for destination url */
++         config->useurl=1;
++         break;
++      case 's': /* Scanner */
++         config->virusscanner=arg;
++         break;
++      case 't': /* template */
++         config->virustemplate=arg;
++         break;
++      case 'c': /* Virus (exit) code */
++         ii = 0;
++         next_tok = strtok(arg, " \t,");
++         if (next_tok){
++            do{
++               if (ii < MAX_VIRUS_CODES){
++                  i=strtol(next_tok, &rest, 10);
++                  if ( (rest && strlen(rest)>0) || i<1 || i>256){
++                     fprintf(stderr, "%s --viruscode has be a list of numbers (%s)\n", where, rest);
++                     error=1;
++                  }else config->viruscode[ii]=(int)i;
++                  ii++;
++               }
++            }while ((next_tok = strtok(NULL, " \t,")) || (ii >= MAX_VIRUS_CODES));
++         }
++         config->viruscode[ii] = -1;
++         if (ii == 0){
++            fprintf(stderr, "%s --viruscode has be a list of numbers (%s)\n", where, rest);
++            error=1;
++         }
++         break;
++      case 'G': /* Good Virus (exit) code */
++         ii = 0;
++         next_tok = strtok(arg, " \t,");
++         if (next_tok){
++            do{
++               if (ii < MAX_VIRUS_CODES){
++                  i=strtol(next_tok, &rest, 10);
++                  if ( (rest && strlen(rest)>0) || i<1 || i>256){
++                     fprintf(stderr, "%s --good viruscode has be a list of numbers (%s)\n", where, rest);
++                     error=1;
++                  }else config->gvcode[ii]=(int)i;
++                  ii++;
++               }
++            }while ((next_tok = strtok(NULL, " \t,")) || (ii >= MAX_VIRUS_CODES));
++         }
++         config->gvcode[ii] = -1;
++         if (ii == 0){
++            fprintf(stderr, "%s --good viruscode has be a list of numbers (%s)\n", where, rest);
++            error=1;
++         }
++         break;
++#ifdef DEMIME
++      case 'x': /* demime */
++         config->demime = 1;
++         break;
++#endif
++      case 'X': /* Xtra notification reciept mail program */
++         config->mail=arg;
++         break;
++      case 'T': /* scannertype */
++         i=0;
++         while (scannerlist[i]){
++            if(!strcasecmp(arg, scannerlist[i]->name)){
++               config->scanner=scannerlist[i];
++               i=-1;
++               break;
++            }
++            i++;
++         }
++         if (i!=-1){
++            fprintf(stderr, "%s scannertype '%s' is not supported", where, arg);
++            error=1;
++         }
++         break;
++      case 'g': /* virusregexp */
++         config->virusregexp = arg;
++         i=strlen(arg);
++         if (arg[i-2]=='/' && isdigit(arg[i-1])){
++            arg[i-2]='\0';
++            config->virusregexpsub=arg[i-1]-'0';
++         }
++         break;
++      case 'k': /* check for spam */
++         config->checkspam=1;
++         break;
++      case 'K': /* emergency Kontact! */
++         config->emergcon = arg;
++         break;
++      case 'z': /* path to spam checking executable */
++         config->spamcheck = arg;
++         break;
++      case 'b': /* bytes free */
++         i=strtol(arg, &rest, 10);
++         config->freespace=(int)i;
++         break;
++      case 'C': /* Check SMTP size */
++         i=strtol(arg, &rest, 10);
++         config->smtpsize=(int)i;
++         break;
++      case 'j': /* justdelete */
++         config->delit=1;
++         break;
++      case 'J': /* enabletop */
++         config->enabletop=1;
++         break;
++      case 'B': /* broken */
++         config->broken=1;
++         break;
++      case 'S': /* Subject line for virus notification */
++         config->subject = arg;
++         break;
++      case 'N': /* deleted file notification */
++         config->notify = arg;
++         break;
++      case 'M': /* ISP marked as SPAM */
++         config->ispspam = arg;
++         break;
++
++      default:
++         fprintf(stderr, "%s Option '%s' isn't known\n", where, optstr);
++         error=1;
++   }
++}/* sub function switchoption  }}} */
++void parseargs(int c, char **v, char * where, int state, int error,
++               char getoptparam[], struct option long_options[], long i,
++               long ii, int pidfd, char * rest, struct servent *port){
++   int option, option_index = 0;
++   opterr=0;
++   optind=1;
++   while (1){
++      option = getopt_long(c, v, getoptparam,
++      long_options, &option_index);
++      if (option == EOF) break;
++      switchoption(option, optarg, v[optind-1], where, state, error, v, i,
++                   ii, pidfd, rest, port);
++   }
++   if (state != CONFIG_STATE_CMDPRE && optind < c){
++      error=1;
++      while (optind < c) fprintf(stderr, "%s Unknown option '%s'\n", where, v[optind++]);
++   }
++}
++
+ void parseoptions(int argc, char **argv){
+    long i, ii;
+    char * rest;
+@@ -2415,336 +2752,6 @@ void parseoptions(int argc, char **argv)
+ #else
+    char getoptparam[] = "hvf:a:Ab:Bc:C:de:F:g:G:i:I:jJkK:l:L:m:M:n:N:o:O:p:P:qr:R:s:S:t:T:u:UX:z:";
+ #endif
+-   void switchoption(char opt, char * arg, char * optstr, char * where, int state){
+-      char *next_tok;
+-      switch (opt){
+-         case 'h':
+-         case 'v':
+-         case 'f':
+-            /* don't check in second run (is in the first) */
+-            if (state==CONFIG_STATE_CMD) return;
+-            /* disallow help/version/configfile in configfile */
+-            if (state==CONFIG_STATE_FILE){
+-               fprintf(stderr, "%s '%s' is not allowed in configfile!\n", where, optstr);
+-               error=1;
+-               return;
+-            }
+-         break;
+-         default:
+-         /* only check help/version/configfile for the first cmd run */
+-         if (state==CONFIG_STATE_CMDPRE) return;
+-      }
+-
+-      switch (opt){
+-         case 'h': /* usage */
+-            usage(argv[0]);
+-            exit(0);
+-            break;
+-         case 'v': /* version */
+-            printversion();
+-            exit(0);
+-            break;
+-         case 'f': /* config (file) */
+-            config->configfile = arg;
+-            break;
+-         case 'F': /* footer (file) */
+-            config->footer = arg;
+-            break;
+-         case 'd': /* debug */
+-            config->debug=1;
+-            break;
+-         case 'e': /* Extra notification */
+-            config->extra=arg;
+-            break;
+-         case 'E': /* SMTP (email) port */
+-            i=strtol(arg, &rest, 10);
+-            if (rest && strlen(rest)>0){
+-               if (i>0){ /* 123abc */
+-                  fprintf(stderr, "%s %s isn't a valid port\n", where, arg);
+-                  error=1;
+-               }else{
+-                  if((port=getservbyname(arg, "tcp"))!=NULL) config->smtpport=ntohs(port->s_port);
+-                  else{
+-                     fprintf(stderr, "Port lookup for '%s/tcp' failed! Check /etc/services\n", arg);
+-                     error=1;
+-                   }
+-                }
+-            } else {
+-                if (i>0) config->smtpport=i;
+-                else {
+-                  fprintf(stderr, "%s Incorrect emailport portnumber\n", where);
+-                  error=1;
+-                }
+-            }
+-            break;
+-         case 'l': /* PID File */
+-            config->pidfile=arg;
+-            if ((pidfd=open(config->pidfile,O_RDONLY ))>=0){
+-               do_log(LOG_EMERG, "ERR: PID file %s exists! Aborting!",config->pidfile);
+-               /* Should not reach here. We are dead. */
+-               pidfd=close(pidfd);
+-               exit(0);
+-            }
+-            break;
+-         case 'L': /* SSL port */
+-            i=strtol(arg, &rest, 10);
+-            if (rest && strlen(rest)>0){
+-               if (i>0){ /* 123abc */
+-                  fprintf(stderr, "%s %s isn't a valid port\n", where, arg);
+-                  error=1;
+-               }else{
+-                  if((port=getservbyname(arg, "tcp"))!=NULL) config->sslport=ntohs(port->s_port);
+-                  else{
+-                     fprintf(stderr, "Port lookup for '%s/tcp' failed! Check /etc/services\n", arg);
+-                     error=1;
+-                  }
+-               }
+-            } else {
+-               if (i>0) config->sslport=i;
+-               else {
+-                  fprintf(stderr, "%s Incorrect POP3S portnumber\n", where);
+-                  error=1;
+-               }
+-            }
+-            break;
+-         case 'a': /* rename attachments using renattach */
+-            config->renattach=arg;
+-            break;
+-         case 'A': /* use alternate virus notification email */
+-            config->altemail=1;
+-            break;
+-         case 'r': /* virusdir */
+-            config->virusdirbase=arg;
+-            config->virusdir=config->virusdirbase;
+-            break;
+-         case 'R': /* smtp reject */
+-            config->smtprset=arg;
+-            break;
+-         case 'n': /* notifydir */
+-            config->notifydir=arg;
+-            break;
+-         case 'm': /* Max Childs */
+-            i=strtol(arg, &rest, 10);
+-            if ((rest && strlen(rest)>0) || i<1 || i>9999){
+-               fprintf(stderr, "%s --maxchilds has to be 1 < val < 10000\n", where);
+-               error=1;
+-            } else config->maxchilds=(int)i;
+-            break;
+-         case 'i': /* IP (to listen on) */
+-            if (!strcmp(arg, "0.0.0.0")){
+-               config->addr.sin_addr.s_addr=htonl(INADDR_ANY);
+-            }else if (!inet_aton(arg, &config->addr.sin_addr)){
+-               fprintf(stderr, "%s %s isn't a valid IP Adress\n", where, arg);
+-               error=1;
+-            }
+-            break;
+-         case 'I': /* IP (to connect) */
+-            if (!strcmp(arg, "0.0.0.0")){
+-               config->targetaddr.sin_addr.s_addr=htonl(INADDR_ANY);
+-            }else if (!inet_aton(arg, &config->targetaddr.sin_addr)){
+-               fprintf(stderr, "%s %s isn't a valid IP Adress\n", where, arg);
+-               error=1;
+-            }
+-            break;
+-         case 'o': /* overwrite (disable) HTML */
+-            config->overwrite=arg;
+-            break;
+-         case 'O': /* timeOut */
+-            i=strtol(arg, &rest, 10);
+-            if ((rest && strlen(rest)>0) || i<1 || i>9999){
+-               fprintf(stderr, "%s --timeout has to be 1 < val < 10000\n", where);
+-               error=1;
+-            } else config->timeout=(int)i;
+-            break;
+-         case 'p': /* Port */
+-            i=strtol(arg, &rest, 10);
+-            if (rest && strlen(rest)>0){
+-               if (i>0){ /* 123abc */
+-                  fprintf(stderr, "%s %s isn't a valid port\n", where, arg);
+-                  error=1;
+-               }else{
+-                  if((port=getservbyname(arg, "tcp"))!=NULL){
+-                     config->addr.sin_port=port->s_port;
+-                  }else{
+-                     fprintf(stderr, "Port lookup for '%s/tcp' failed! Check /etc/services\n", arg);
+-                     error=1;
+-                  }
+-               }
+-            }else{
+-               if (i>0)config->addr.sin_port=htons((int)i);
+-               else{
+-                  fprintf(stderr, "%s Incorrect POP3 portnumber\n", where);
+-                  error=1;
+-               }
+-            }
+-            break;
+-         case 'P': /* target Port */
+-            i=strtol(arg, &rest, 10);
+-            if (rest && strlen(rest)>0){
+-               if (i>0){ /* 123abc */
+-                  fprintf(stderr, "%s %s isn't a valid port\n", where, arg);
+-                  error=1;
+-               }else{
+-                  if((port=getservbyname(arg, "tcp"))!=NULL){
+-                     config->targetaddr.sin_port=port->s_port;
+-                  }else{
+-                     fprintf(stderr, "Port lookup for '%s/tcp' failed! Check /etc/services\n", arg);
+-                     error=1;
+-                  }
+-               }
+-            }else{
+-               if (i>0)config->targetaddr.sin_port=htons((int)i);
+-               else{
+-                  fprintf(stderr, "%s Incorrect target portnumber\n", where);
+-                  error=1;
+-               }
+-            }
+-            break;
+-         case 'q': /* quiet */
+-            config->quiet=1;
+-            break;
+-         case 'u': /* Run as User */
+-            config->runasuser=arg;
+-            /* getpwnam will also accept UID's, so we need no converting*/
+-            break;
+-         case 'U': /* Parse username for destination url */
+-            config->useurl=1;
+-            break;
+-         case 's': /* Scanner */
+-            config->virusscanner=arg;
+-            break;
+-         case 't': /* template */
+-            config->virustemplate=arg;
+-            break;
+-         case 'c': /* Virus (exit) code */
+-            ii = 0;
+-            next_tok = strtok(arg, " \t,");
+-            if (next_tok){
+-               do{
+-                  if (ii < MAX_VIRUS_CODES){
+-                     i=strtol(next_tok, &rest, 10);
+-                     if ( (rest && strlen(rest)>0) || i<1 || i>256){
+-                        fprintf(stderr, "%s --viruscode has be a list of numbers (%s)\n", where, rest);
+-                        error=1;
+-                     }else config->viruscode[ii]=(int)i;
+-                     ii++;
+-                  }
+-               }while ((next_tok = strtok(NULL, " \t,")) || (ii >= MAX_VIRUS_CODES));
+-            }
+-            config->viruscode[ii] = -1;
+-            if (ii == 0){
+-               fprintf(stderr, "%s --viruscode has be a list of numbers (%s)\n", where, rest);
+-               error=1;
+-            }
+-            break;
+-         case 'G': /* Good Virus (exit) code */
+-            ii = 0;
+-            next_tok = strtok(arg, " \t,");
+-            if (next_tok){
+-               do{
+-                  if (ii < MAX_VIRUS_CODES){
+-                     i=strtol(next_tok, &rest, 10);
+-                     if ( (rest && strlen(rest)>0) || i<1 || i>256){
+-                        fprintf(stderr, "%s --good viruscode has be a list of numbers (%s)\n", where, rest);
+-                        error=1;
+-                     }else config->gvcode[ii]=(int)i;
+-                     ii++;
+-                  }
+-               }while ((next_tok = strtok(NULL, " \t,")) || (ii >= MAX_VIRUS_CODES));
+-            }
+-            config->gvcode[ii] = -1;
+-            if (ii == 0){
+-               fprintf(stderr, "%s --good viruscode has be a list of numbers (%s)\n", where, rest);
+-               error=1;
+-            }
+-            break;
+-#ifdef DEMIME
+-         case 'x': /* demime */
+-            config->demime = 1;
+-            break;
+-#endif
+-         case 'X': /* Xtra notification reciept mail program */
+-            config->mail=arg;
+-            break;
+-         case 'T': /* scannertype */
+-            i=0;
+-            while (scannerlist[i]){
+-               if(!strcasecmp(arg, scannerlist[i]->name)){
+-                  config->scanner=scannerlist[i];
+-                  i=-1;
+-                  break;
+-               }
+-               i++;
+-            }
+-            if (i!=-1){
+-               fprintf(stderr, "%s scannertype '%s' is not supported", where, arg);
+-               error=1;
+-            }
+-            break;
+-         case 'g': /* virusregexp */
+-            config->virusregexp = arg;
+-            i=strlen(arg);
+-            if (arg[i-2]=='/' && isdigit(arg[i-1])){
+-               arg[i-2]='\0';
+-               config->virusregexpsub=arg[i-1]-'0';
+-            }
+-            break;
+-         case 'k': /* check for spam */
+-            config->checkspam=1;
+-            break;
+-         case 'K': /* emergency Kontact! */
+-            config->emergcon = arg;
+-            break;
+-         case 'z': /* path to spam checking executable */
+-            config->spamcheck = arg;
+-            break;
+-         case 'b': /* bytes free */
+-            i=strtol(arg, &rest, 10);
+-            config->freespace=(int)i;
+-            break;
+-         case 'C': /* Check SMTP size */
+-            i=strtol(arg, &rest, 10);
+-            config->smtpsize=(int)i;
+-            break;
+-         case 'j': /* justdelete */
+-            config->delit=1;
+-            break;
+-         case 'J': /* enabletop */
+-            config->enabletop=1;
+-            break;
+-         case 'B': /* broken */
+-            config->broken=1;
+-            break;
+-         case 'S': /* Subject line for virus notification */
+-            config->subject = arg;
+-            break;
+-         case 'N': /* deleted file notification */
+-            config->notify = arg;
+-            break;
+-         case 'M': /* ISP marked as SPAM */
+-            config->ispspam = arg;
+-            break;
+-
+-         default:
+-            fprintf(stderr, "%s Option '%s' isn't known\n", where, optstr);
+-            error=1;
+-      }
+-   }/* sub function switchoption  }}} */
+-   void parseargs(int c, char **v, char * where, int state){
+-      int option, option_index = 0;
+-      opterr=0;
+-      optind=1;
+-      while (1){
+-         option = getopt_long(c, v, getoptparam,
+-         long_options, &option_index);
+-         if (option == EOF) break;
+-         switchoption(option, optarg, v[optind-1], where, state);
+-      }
+-      if (state != CONFIG_STATE_CMDPRE && optind < c){
+-         error=1;
+-         while (optind < c) fprintf(stderr, "%s Unknown option '%s'\n", where, v[optind++]);
+-      }
+-   }
+    config=w_malloc(sizeof(struct configuration_t));
+    /* set defaults for in, char* to NULL */
+    config->debug=DEBUG;
+@@ -2789,7 +2796,8 @@ void parseoptions(int argc, char **argv)
+    config->emergcon=NULL;
+    config->emergency=NULL;
+    /* parse line args, but for the first time only configfile/version/help */
+-   parseargs(argc, argv, "\t[cmdlineparm]", CONFIG_STATE_CMDPRE);
++   parseargs(argc, argv, "\t[cmdlineparm]", CONFIG_STATE_CMDPRE, error, getoptparam,
++             long_options, i, ii, pidfd, rest, port);
+    /* parse configfile */
+    if (!config->configfile){
+       config->configfile=strdup(CONFIGFILE); //TODO: 24 bytes in 1 blocks are definitely lost in loss record 2 of 2
+@@ -2829,11 +2837,13 @@ void parseoptions(int argc, char **argv)
+       close(fp);
+       linebuf_uninit(cf);
+       pargv[pargc]=NULL;
+-      parseargs(pargc, pargv, "\t[configfile]", CONFIG_STATE_FILE);
++      parseargs(pargc, pargv, "\t[configfile]", CONFIG_STATE_FILE, error, getoptparam,
++                long_options, i, ii, pidfd, rest, port);
+    }
+    if(dofree) free(config->configfile);
+    /* now check the rest of commandline args (higher precedence than configfile) */
+-   parseargs(argc, argv, "\t[cmdlineparm]", CONFIG_STATE_CMD);
++   parseargs(argc, argv, "\t[cmdlineparm]", CONFIG_STATE_CMD, error, getoptparam,
++             long_options, i, ii, pidfd, rest, port);
+    if (error){
+       printf(
+       "Commandline options/configfile are not ok\n"
diff -Naur p3scan.orig/p3scan-2.3.2/debian/patches/series p3scan/p3scan-2.3.2/debian/patches/series 
--- p3scan.orig/p3scan-2.3.2/debian/patches/series	2014-06-06 17:27:30.591648436 -0500
+++ p3scan/p3scan-2.3.2/debian/patches/series	2014-06-06 17:27:43.723648664 -0500
@@ -1,3 +1,4 @@
 quilt-transition
 mem-used-after-free
 open-flags
+clang-ftbfs.diff

Reply via email to