RE: Jars in Tomcat lib directory

2021-01-18 Thread Jonnalagadda, Swathi (External)
The application was an age old application and was built using ant which means 
all required jars will be packaged. 

As part of testing the application after upgrading to Java 1.8 and deployed in 
tomcat 9, I realized that couple of additional jars are required during runtime.

I then added these jars to Tomcat lib directory and observed that it is not 
picking up these unless I add it to classpath

Regards
Swathi

-Original Message-
From: Mounika Reddy [mailto:spidermai...@gmail.com] 
Sent: Monday, January 18, 2021 11:49 PM
To: Tomcat Users List
Subject: Re: Jars in Tomcat lib directory

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

It means your tomcat setup is screwed up. You can actually package in your 
application as a dependency and see if it picks up. If not, then post the logs 
here to understand what's going on

On Mon, Jan 18, 2021, 1:09 PM Jonnalagadda, Swathi (External) < 
swathi.jonnalaga...@xerox.com> wrote:

> I am not sure if I am missing some configuration setting but what I 
> see is unless I add externally added jars under tomcat/lib to 
> classpath I don’t see them considerd by Tomcat irrespective of wether they 
> are needed or not.
>
> For example I added ojdbc14.jar to Tomcat lib directory assuming that 
> it will consider it in classpath but until I specified the path of the 
> jar in classpath, the server wasn’t considering the jar.
>
> Please advise.
>
> -Original Message-
> From: Mounika Reddy [mailto:spidermai...@gmail.com]
> Sent: Monday, January 18, 2021 6:32 PM
> To: Tomcat Users List
> Subject: Re: Jars in Tomcat lib directory
>
> CAUTION:   This email originated from outside the organization. Do not
> click links or open attachments unless you recognize the sender and 
> know the content is safe.
>
> It will provided if your application requires.
>
> On Mon, Jan 18, 2021, 7:54 AM Jonnalagadda, Swathi (External) < 
> swathi.jonnalaga...@xerox.com> wrote:
>
> > Hi
> >
> > Doesn’t tomcat consider jar files under lib directory in classpath. 
> > Do we have to do any additional configuration for that?
> >
> >
> > Thanks
> > Swathi
> >
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Jars in Tomcat lib directory

2021-01-18 Thread Jonnalagadda, Swathi (External)
I am not sure if I am missing some configuration setting but what I see is 
unless I add externally added jars under tomcat/lib to classpath I don’t see 
them considerd by Tomcat irrespective of wether they are needed or not. 

For example I added ojdbc14.jar to Tomcat lib directory assuming that it will 
consider it in classpath but until I specified the path of the jar in 
classpath, the server wasn’t considering the jar. 

Please advise.

-Original Message-
From: Mounika Reddy [mailto:spidermai...@gmail.com] 
Sent: Monday, January 18, 2021 6:32 PM
To: Tomcat Users List
Subject: Re: Jars in Tomcat lib directory

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

It will provided if your application requires.

On Mon, Jan 18, 2021, 7:54 AM Jonnalagadda, Swathi (External) < 
swathi.jonnalaga...@xerox.com> wrote:

> Hi
>
> Doesn’t tomcat consider jar files under lib directory in classpath. Do 
> we have to do any additional configuration for that?
>
>
> Thanks
> Swathi
>


Jars in Tomcat lib directory

2021-01-18 Thread Jonnalagadda, Swathi (External)
Hi 

Doesn’t tomcat consider jar files under lib directory in classpath. Do we have 
to do any additional configuration for that?


Thanks
Swathi


RE: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-18 Thread Jonnalagadda, Swathi (External)

Hi Schultz

Please find sample code below
Suffix is there in request so ..

RequestDispatcher rd = context.getRequestDispatcher(sample.xls);
String contentType =((request.getParameter(SUFFIX) 
!=null) && ((request.getParameter(SUFFIX).equalsIgnoreCase("xls" 
?"application/vnd.ms-excel":null; <--- setting explicitly
if (contentType != null)
{
response.setContentType(contentType);
}
rd.forward(request, response);

Thanks
Swathi

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Friday, January 15, 2021 7:41 PM
To: users@tomcat.apache.org
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Swathi,

On 1/15/21 08:41, Jonnalagadda, Swathi (External) wrote:
> My web application is trying to open the xls file by passing the file 
> to request.getDispatcher method. It is supposed open up download 
> dialogue box but it is not doing.
After you get a request dispatcher, what are you doing with it?

> If I set the content-type explicitly to response it is showing up the box.

Please post actual code.

> With Tomcat 7 it was never an issue and it used to consider mimetype 
> that is defined in web.xml but in Tomcat 9 not sure why it is not 
> considering mime-type.

Something seems odd, here. Post your sample code.

-chris

> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Friday, January 15, 2021 3:25 AM
> To: users@tomcat.apache.org
> Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!
> 
> CAUTION:   This email originated from outside the organization. Do not click 
> links or open attachments unless you recognize the sender and know the 
> content is safe.
> 
> Swathi,
> 
> On 1/13/21 03:27, Jonnalagadda, Swathi (External) wrote:
>> We could see that when we try to open the xls file separately the 
>> browser shows dialogue box to save it so it is nothing to do with 
>> browser settings
> What is the difference between "open[ing] the XLS file separately" and ... 
> whatever your application is doing instead?
> 
> If you want to force a download, you need to add some response headers 
> otherwise a normal browser will usually try to render the file in the browser 
> window instead of initiating a download.
> 
> The response header you need is "Content-Disposition" and its value can be 
> complex. Here is what I usually do:
> 
> Content-Disposition: attachment; filename="[filename]"; 
> filename*=utf-8''[filename in UTF-8 encoding]
> 
> Note that the above is all on one line and the two single-quotes are not a 
> typo. You will also need to escape any double-quotes in the "filename"
> and escape any semicolons in the utf8-filename.
> 
> You can find more information here as well as other places online:
> https://www.geeksforgeeks.org/http-headers-content-disposition/
> 
> The above reference happens to be particularly thorough, even moreso than 
> Mozilla's (typically very good and complete) documentation for 
> Content-Disposition.
> 
> If your application is not being hosted within a web browser (e.g. it's a 
> mobile application, or an Electron (etc.) application, etc.) then it's 
> entirely up to you to trigger the display of a download dialog when this kind 
> of thing needs to happen.
> 
> -chris
> 
>> -Original Message-
>> From: Mounika Reddy [mailto:spidermai...@gmail.com]
>> Sent: Wednesday, January 13, 2021 3:48 AM
>> To: Tomcat Users List
>> Cc: Mark Thomas
>> Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!
>>
>> CAUTION:   This email originated from outside the organization. Do not click 
>> links or open attachments unless you recognize the sender and know the 
>> content is safe.
>>
>> Pls check http response headers for the request to confirm if it's returning 
>> proper headers.
>>
>> Once they are in place then it may be to do with browser settings not 
>> processing headers.
>>
>>
>>
>> On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
>> swathi.jonnalaga...@xerox.com> wrote:
>>
>>> Hi Team
>>>
>>> We have an application deployed in tomcat9.0.38 server which 
>>> generates an xls file dynamically and saves at server end. When we 
>>> try to access th

RE: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-15 Thread Jonnalagadda, Swathi (External)
Hi Chris

My web application is trying to open the xls file by passing the file to 
request.getDispatcher method. It is supposed open up download dialogue box but 
it is not doing.

If I set the content-type explicitly to response it is showing up the box.

With Tomcat 7 it was never an issue and it used to consider mimetype that is 
defined in web.xml but in Tomcat 9 not sure why it is not considering mime-type.

Thanks
Swathi 

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Friday, January 15, 2021 3:25 AM
To: users@tomcat.apache.org
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Swathi,

On 1/13/21 03:27, Jonnalagadda, Swathi (External) wrote:
> We could see that when we try to open the xls file separately the 
> browser shows dialogue box to save it so it is nothing to do with 
> browser settings
What is the difference between "open[ing] the XLS file separately" and ... 
whatever your application is doing instead?

If you want to force a download, you need to add some response headers 
otherwise a normal browser will usually try to render the file in the browser 
window instead of initiating a download.

The response header you need is "Content-Disposition" and its value can be 
complex. Here is what I usually do:

Content-Disposition: attachment; filename="[filename]"; 
filename*=utf-8''[filename in UTF-8 encoding]

Note that the above is all on one line and the two single-quotes are not a 
typo. You will also need to escape any double-quotes in the "filename" 
and escape any semicolons in the utf8-filename.

You can find more information here as well as other places online:
https://www.geeksforgeeks.org/http-headers-content-disposition/

The above reference happens to be particularly thorough, even moreso than 
Mozilla's (typically very good and complete) documentation for 
Content-Disposition.

If your application is not being hosted within a web browser (e.g. it's a 
mobile application, or an Electron (etc.) application, etc.) then it's entirely 
up to you to trigger the display of a download dialog when this kind of thing 
needs to happen.

-chris

> -Original Message-
> From: Mounika Reddy [mailto:spidermai...@gmail.com]
> Sent: Wednesday, January 13, 2021 3:48 AM
> To: Tomcat Users List
> Cc: Mark Thomas
> Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!
> 
> CAUTION:   This email originated from outside the organization. Do not click 
> links or open attachments unless you recognize the sender and know the 
> content is safe.
> 
> Pls check http response headers for the request to confirm if it's returning 
> proper headers.
> 
> Once they are in place then it may be to do with browser settings not 
> processing headers.
> 
> 
> 
> On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
> swathi.jonnalaga...@xerox.com> wrote:
> 
>> Hi Team
>>
>> We have an application deployed in tomcat9.0.38 server which 
>> generates an xls file dynamically and saves at server end. When we 
>> try to access the file using application frontend, it is neither 
>> showing up in excel format nor showing up pop up to save the file 
>> instead it is showing the content of xls file in xml format directly on the 
>> browser.
>>
>> Below mime type is set both at web.xml of webapplicatio end and as 
>> well as Tomcat9038/conf/web.xml
>>
>> 
>>  xls
>>  application/vnd.ms-excel
>>  
>>
>> Could you please help in resolving the issue ASAP
>>
>>
>> Thanks
>> Swathi
>>
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-14 Thread Jonnalagadda, Swathi (External)
Could you please elaborate more on this as to where I need to check

From: Mounika Reddy 
Sent: Thursday, January 14, 2021 2:41 AM
To: Tomcat Users List 
Cc: Mark Thomas 
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

If you are via AJP connector, then check if Apache proxy is changing
headers. We have a similar environment and when we set content-type,
clients see the same but possible it must be overriding

On Wed, Jan 13, 2021, 3:14 PM Jonnalagadda, Swathi (External) <
swathi.jonnalaga...@xerox.com> wrote:

> This issue is not resolved yet.  The extension of file is clearly .xls but
> I see content-type in response header is set to text/html.
>
> Please note that the request initially hits apache2.4 server which is
> redirected to tomcat9 server after successful authentication at siteminder.
>
> The connection is configured via ajp connector.
>
> Is there a possibility that the apache server is overwriting the
> content-type header in response ?
>
> Please advise.
>
> Thanks
> Swathi
>
> -Original Message-
> From: Jonnalagadda, Swathi (External) [mailto:
> swathi.jonnalaga...@xerox.com]
> Sent: Wednesday, January 13, 2021 1:57 PM
> To: Tomcat Users List
> Cc: Mark Thomas
> Subject: RE: Tomcat server not considering Mime Type - Request urgent
> help!!
>
> CAUTION:   This email originated from outside the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
>
> Thank you for the email
>
> We could see that when we try to open the xls file separately the browser
> shows dialogue box to save it so it is nothing to do with browser settings
>
> Could you please advise if I am missing out any setting here.
>
> Thanks
> Swathi
> -Original Message-
> From: Mounika Reddy [mailto:spidermai...@gmail.com]
> Sent: Wednesday, January 13, 2021 3:48 AM
> To: Tomcat Users List
> Cc: Mark Thomas
> Subject: Re: Tomcat server not considering Mime Type - Request urgent
> help!!
>
> CAUTION:   This email originated from outside the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
>
> Pls check http response headers for the request to confirm if it's
> returning proper headers.
>
> Once they are in place then it may be to do with browser settings not
> processing headers.
>
>
>
> On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) <
> swathi.jonnalaga...@xerox.com> wrote:
>
> > Hi Team
> >
> > We have an application deployed in tomcat9.0.38 server which generates
> > an xls file dynamically and saves at server end. When we try to access
> > the file using application frontend, it is neither showing up in excel
> > format nor showing up pop up to save the file instead it is showing
> > the content of xls file in xml format directly on the browser.
> >
> > Below mime type is set both at web.xml of webapplicatio end and as
> > well as Tomcat9038/conf/web.xml
> >
> > 
> > xls
> > application/vnd.ms-excel
> > 
> >
> > Could you please help in resolving the issue ASAP
> >
> >
> > Thanks
> > Swathi
> >
>


RE: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-13 Thread Jonnalagadda, Swathi (External)
This issue is not resolved yet.  The extension of file is clearly .xls but I 
see content-type in response header is set to text/html. 

Please note that the request initially hits apache2.4 server which is 
redirected to tomcat9 server after successful authentication at siteminder. 

The connection is configured via ajp connector.

Is there a possibility that the apache server is overwriting the content-type 
header in response ?

Please advise.

Thanks
Swathi 

-Original Message-
From: Jonnalagadda, Swathi (External) [mailto:swathi.jonnalaga...@xerox.com] 
Sent: Wednesday, January 13, 2021 1:57 PM
To: Tomcat Users List
Cc: Mark Thomas
Subject: RE: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Thank you for the email

We could see that when we try to open the xls file separately the browser shows 
dialogue box to save it so it is nothing to do with browser settings

Could you please advise if I am missing out any setting here.

Thanks
Swathi
-Original Message-
From: Mounika Reddy [mailto:spidermai...@gmail.com]
Sent: Wednesday, January 13, 2021 3:48 AM
To: Tomcat Users List
Cc: Mark Thomas
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Pls check http response headers for the request to confirm if it's returning 
proper headers.

Once they are in place then it may be to do with browser settings not 
processing headers.



On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
swathi.jonnalaga...@xerox.com> wrote:

> Hi Team
>
> We have an application deployed in tomcat9.0.38 server which generates 
> an xls file dynamically and saves at server end. When we try to access 
> the file using application frontend, it is neither showing up in excel 
> format nor showing up pop up to save the file instead it is showing 
> the content of xls file in xml format directly on the browser.
>
> Below mime type is set both at web.xml of webapplicatio end and as 
> well as Tomcat9038/conf/web.xml
>
> 
> xls
> application/vnd.ms-excel
> 
>
> Could you please help in resolving the issue ASAP
>
>
> Thanks
> Swathi
>


RE: Tomcat server not considering Mime Type - Request urgent help!!

2021-01-13 Thread Jonnalagadda, Swathi (External)
Thank you for the email

We could see that when we try to open the xls file separately the browser shows 
dialogue box to save it so it is nothing to do with browser settings

Could you please advise if I am missing out any setting here.

Thanks
Swathi
-Original Message-
From: Mounika Reddy [mailto:spidermai...@gmail.com] 
Sent: Wednesday, January 13, 2021 3:48 AM
To: Tomcat Users List
Cc: Mark Thomas
Subject: Re: Tomcat server not considering Mime Type - Request urgent help!!

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Pls check http response headers for the request to confirm if it's returning 
proper headers.

Once they are in place then it may be to do with browser settings not 
processing headers.



On Tue, Jan 12, 2021, 2:48 PM Jonnalagadda, Swathi (External) < 
swathi.jonnalaga...@xerox.com> wrote:

> Hi Team
>
> We have an application deployed in tomcat9.0.38 server which generates 
> an xls file dynamically and saves at server end. When we try to access 
> the file using application frontend, it is neither showing up in excel 
> format nor showing up pop up to save the file instead it is showing 
> the content of xls file in xml format directly on the browser.
>
> Below mime type is set both at web.xml of webapplicatio end and as 
> well as Tomcat9038/conf/web.xml
>
> 
> xls
> application/vnd.ms-excel
> 
>
> Could you please help in resolving the issue ASAP
>
>
> Thanks
> Swathi
>


Tomcat server not considering Mime Type - Request urgent help!!

2021-01-12 Thread Jonnalagadda, Swathi (External)
Hi Team

We have an application deployed in tomcat9.0.38 server which generates an xls 
file dynamically and saves at server end. When we try to access the file using 
application frontend, it is neither showing up in excel format  nor showing up 
pop up to save the file instead it is showing the content of xls file in xml 
format directly on the browser.

Below mime type is set both at web.xml of webapplicatio end and as well as 
Tomcat9038/conf/web.xml


xls
application/vnd.ms-excel


Could you please help in resolving the issue ASAP


Thanks
Swathi


Request body is empty in Tomcat 9.0.38

2021-01-06 Thread Jonnalagadda, Swathi (External)
Hi

We have a web application deployed in tomcat9.0.38 which is invoking a web 
service which is again deployed in another tomcat instance of 9.0.38

We are using httpclient to post request to webservice from the webapplication  
and we could see that the request is reaching the webservice instance but the 
request body is all empty due to which the webservice is not able to read the 
request from client.

Could you please suggest if there is any configuration missing out here.

Thanks
Swathi


RE: getopts of Perl is not working Tomcat 9

2020-11-16 Thread Jonnalagadda, Swathi (External)
Thank you for checking on this Chris

The application is used by internal users only and is not available for all. So 
I believe it is fine to use it here. 

Regards
Swathi

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Monday, November 16, 2020 7:30 PM
To: users@tomcat.apache.org
Subject: Re: getopts of Perl is not working Tomcat 9

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Swathi,

On 11/16/20 06:47, Jonnalagadda, Swathi (External) wrote:
> I didn’t realize that it could have its own web.xml. Enabling 
> enableCmdLineArguments helped. getOpts is working fine now
Please note that it can be very easy to open security hole by allowing remote 
clients to specify command-line parameters on your server.

Think very carefully about whether or not you want and/or need this feature.

-chris

> -Original Message-
> From: Mark Thomas [mailto:ma...@apache.org]
> Sent: Monday, November 16, 2020 3:29 PM
> To: Tomcat Users List
> Subject: Re: getopts of Perl is not working Tomcat 9
> 
> CAUTION:   This email originated from outside the organization. Do not click 
> links or open attachments unless you recognize the sender and know the 
> content is safe.
> 
> On 16/11/2020 06:21, Jonnalagadda, Swathi (External) wrote:
>> Hi Mark,
>>
>> Thank you for replying on this.
>>
>> Please find below servlet configuration
>>
>> 
>>  cgi
>>  
>> org.apache.catalina.servlets.CGIServlet
>>  
>>cgiPathPrefix
>>cgi-bin
>>executable
>>/usr/bin/perl
>>  
>>  5
>>  
> 
> That configuration is not valid. I'm surprised Tomcat even starts with a 
> configuration like that. Enabling validation would catch that but I'll look 
> to see if there is more we can do.
> 
>> 
>>  cgi
>>  /cgi-bin/*
>>  
>>
>> The url we access is
>> http://maskedforsecurity:port/maskedapp/cgi-bin/register.cgi?-p
> 
> Given a fixed version of the configuration above, getopts isn't going to work 
> because you haven't enabled command line arguments.
> 
> See http://tomcat.apache.org/tomcat-9.0-doc/cgi-howto.html
> Look for enableCmdLineArguments
> 
> See also CVE-2019-0232 if you are running on Windows.
> 
>> Please note that the cgi files are all under maskedapp/cgi-bin of webapps 
>> folder.
>>
>> Also I have observed that even if I don’t configure cgi servlet in web.xml, 
>> the server is executing the cgi file but it is not able to execute getops 
>> method.
> 
> Then you have the CGI servlet (or the CGI filter) enabled in another 
> location. Check both the global and per web application web.xml file.
> You'd normally only enable GCI in one location.
> 
> Mark
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Recall: getopts of Perl is not working Tomcat 9

2020-11-16 Thread Jonnalagadda, Swathi (External)
Jonnalagadda, Swathi (External) would like to recall the message, "getopts of 
Perl is not working Tomcat 9".
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: getopts of Perl is not working Tomcat 9

2020-11-16 Thread Jonnalagadda, Swathi (External)

Thanks in tons Mark. 

I didn’t realize that it could have its own web.xml. Enabling 
enableCmdLineArguments helped. getOpts is working fine now

Regards
Swathi

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Monday, November 16, 2020 3:29 PM
To: Tomcat Users List
Subject: Re: getopts of Perl is not working Tomcat 9

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

On 16/11/2020 06:21, Jonnalagadda, Swathi (External) wrote:
> Hi Mark,
> 
> Thank you for replying on this.
> 
> Please find below servlet configuration
> 
> 
> cgi
> org.apache.catalina.servlets.CGIServlet
> 
>   cgiPathPrefix
>   cgi-bin
>   executable
>   /usr/bin/perl
> 
> 5
> 

That configuration is not valid. I'm surprised Tomcat even starts with a 
configuration like that. Enabling validation would catch that but I'll look to 
see if there is more we can do.

> 
> cgi
> /cgi-bin/*
> 
> 
> The url we access is
> http://maskedforsecurity:port/maskedapp/cgi-bin/register.cgi?-p

Given a fixed version of the configuration above, getopts isn't going to work 
because you haven't enabled command line arguments.

See http://tomcat.apache.org/tomcat-9.0-doc/cgi-howto.html
Look for enableCmdLineArguments

See also CVE-2019-0232 if you are running on Windows.

> Please note that the cgi files are all under maskedapp/cgi-bin of webapps 
> folder.
> 
> Also I have observed that even if I don’t configure cgi servlet in web.xml, 
> the server is executing the cgi file but it is not able to execute getops 
> method.

Then you have the CGI servlet (or the CGI filter) enabled in another location. 
Check both the global and per web application web.xml file.
You'd normally only enable GCI in one location.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: getopts of Perl is not working Tomcat 9

2020-11-16 Thread Jonnalagadda, Swathi (External)
Thanks in tons Thomas. 

I didn’t realize that it could have its own web.xml. Enabling 
enableCmdLineArguments helped. getOpts is working fine now

Regards
Swathi

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Monday, November 16, 2020 3:29 PM
To: Tomcat Users List
Subject: Re: getopts of Perl is not working Tomcat 9

CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

On 16/11/2020 06:21, Jonnalagadda, Swathi (External) wrote:
> Hi Mark,
> 
> Thank you for replying on this.
> 
> Please find below servlet configuration
> 
> 
> cgi
> org.apache.catalina.servlets.CGIServlet
> 
>   cgiPathPrefix
>   cgi-bin
>   executable
>   /usr/bin/perl
> 
> 5
> 

That configuration is not valid. I'm surprised Tomcat even starts with a 
configuration like that. Enabling validation would catch that but I'll look to 
see if there is more we can do.

> 
> cgi
> /cgi-bin/*
> 
> 
> The url we access is
> http://maskedforsecurity:port/maskedapp/cgi-bin/register.cgi?-p

Given a fixed version of the configuration above, getopts isn't going to work 
because you haven't enabled command line arguments.

See http://tomcat.apache.org/tomcat-9.0-doc/cgi-howto.html
Look for enableCmdLineArguments

See also CVE-2019-0232 if you are running on Windows.

> Please note that the cgi files are all under maskedapp/cgi-bin of webapps 
> folder.
> 
> Also I have observed that even if I don’t configure cgi servlet in web.xml, 
> the server is executing the cgi file but it is not able to execute getops 
> method.

Then you have the CGI servlet (or the CGI filter) enabled in another location. 
Check both the global and per web application web.xml file.
You'd normally only enable GCI in one location.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: getopts of Perl is not working Tomcat 9

2020-11-15 Thread Jonnalagadda, Swathi (External)
Hi Mark,



Thank you for replying on this.



Please find below servlet configuration





cgi

org.apache.catalina.servlets.CGIServlet



  cgiPathPrefix

  cgi-bin

  executable

  /usr/bin/perl



5







cgi

/cgi-bin/*







The url we access is



http://maskedforsecurity:port/maskedapp/cgi-bin/register.cgi?-p





Please note that the cgi files are all under maskedapp/cgi-bin of webapps 
folder.



Also I have observed that even if I don’t configure cgi servlet in web.xml, the 
server is executing the cgi file but it is not able to execute getops method.



Thanks

Swathi



-Original Message-
From: Mark Thomas [mailto:ma...@apache.org]
Sent: Friday, November 13, 2020 6:51 PM
To: users@tomcat.apache.org
Subject: Re: getopts of Perl is not working Tomcat 9



CAUTION:   This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.



On 13/11/2020 13:14, Jonnalagadda, Swathi (External) wrote:

> Hi

>

> We have our web application implemented in Perl cgi which is using below 
> function of perl. we are upgrading from Tomcat 8.0.21 to Tomcat 9.0.38.

>

> The below function (getopts) is working fine Tomcat 8.0.21 but is not working 
> in Tomcat 9.0.38. We even tried Tomcat 9.0.39 as well and it is not working 
> even in 9.0.39.

>

> use Getopt::Std;

>

> getopts('ei:npXP');

>

> Could you please suggest a solution here.



How is the CGI servlet configured?



What URL are you using to call the CGI servlet?



Mark



-

To unsubscribe, e-mail: 
users-unsubscr...@tomcat.apache.org<mailto:users-unsubscr...@tomcat.apache.org>

For additional commands, e-mail: 
users-h...@tomcat.apache.org<mailto:users-h...@tomcat.apache.org>




getopts of Perl is not working Tomcat 9

2020-11-13 Thread Jonnalagadda, Swathi (External)
Hi 

We have our web application implemented in Perl cgi which is using below 
function of perl. we are upgrading from Tomcat 8.0.21 to Tomcat 9.0.38. 

The below function (getopts) is working fine Tomcat 8.0.21 but is not working 
in Tomcat 9.0.38. We even tried Tomcat 9.0.39 as well and it is not working 
even in 9.0.39.

use Getopt::Std;

getopts('ei:npXP');

Could you please suggest a solution here.

Thanks
Swathi