Bug 37429 - jsvc does not set procname correctly. Incorrect argument parsing
Summary: jsvc does not set procname correctly. Incorrect argument parsing
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Native:Packaging (show other bugs)
Version: 5.5.12
Hardware: PC Linux
: P2 minor (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-09 23:34 UTC by Mike Polek
Modified: 2008-07-28 05:55 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Polek 2005-11-09 23:34:45 UTC
Support for -procname was added to jsvc, which is great.
However, the order in which the arguments are processed
is incorrect. The argument processor complains that 
-procname is not recognized. Reorganizing the check for
-procname so that it is before the "Invalid option"
check solves the issue:

(This patch also gets rid of a compiler warning for unnecessary
 char *temp variable)

--- arguments.c 2005-05-17 06:13:39.000000000 -0700
+++ /tmp/arguments.c    2005-11-08 14:18:04.000000000 -0800
@@ -186,16 +186,17 @@
         } else if (strstr(argv[x],"-ea")==argv[x]) {
             args->opts[args->onum++]=strdup(argv[x]);

-        } else if (strstr(argv[x],"-")==argv[x]) {
-            log_error("Invalid option %s",argv[x]);
-            return(NULL);
-
         } else if (strcmp(argv[x],"-procname") == 0) {
             args->procname = optional(argc, argv, x++);
             if(args->procname == NULL) {
               log_error("Invalid process name specified");
               return (NULL);
             }
+
+        } else if (strstr(argv[x],"-")==argv[x]) {
+            log_error("Invalid option %s",argv[x]);
+            return(NULL);
+
         } else {
             args->clas=strdup(argv[x]);
             break;
@@ -248,7 +249,6 @@
     }

     if (log_debug_flag==true) {
-        char *temp;

         log_debug("+-- DUMPING PARSED COMMAND LINE ARGUMENTS --------------");
Comment 1 Robert Longson 2005-11-10 11:50:07 UTC

*** This bug has been marked as a duplicate of 36051 ***
Comment 2 Mark Thomas 2008-07-28 05:55:56 UTC
Changed resolution to INVALID since duplicate bug has been deleted from Bugzilla and leaving as DUPLICATE creates referential integrity issues for the underlying database.