You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Thomas De Waelheyns <th...@qaelum.com.INVALID> on 2023/01/27 09:48:23 UTC

[daemon] prunsrv not handling StartPath argument correctly for path ending in \ on windows

Hey all,

First time posting on here, so please let me know if I'm doing something
wrong.

I would like to report a bug with the daemon tool. I tried creating a JIRA
ticket but subscriptions are closed and I couldn't find information on the
project page on how to request one.

While investigating an issue we had using the prunsrv, we noticed that the
tool does not handle well StartPath arguments with a path that ends on \ if
they are encapsulated in quotes.

Apache daemon version: 1.3.3
Platform: Windows 10 Home 22H2
Binaries: AMD64/prunsrv.exe from the project native binaries download

An example to illustrate:
prunsrv.exe//IS//TestService --StartPath="C:\TestService\"
++JvmOptions9=-Dan.option="A value"

In the windows registry, the WorkingPath registry key under
TestService/Parameters/Start now reads: C:\TestService"
++JvmOptions9=-Dan.option=A
You can see that the path does not stop at the closing quote as expected.
The Jvm option is also not recognized.

If we install the same service without \ at the end of the StartPath:
prunsrv.exe//IS//TestService --StartPath="C:\TestService"
++JvmOptions9=-Dan.option="A value"

The WorkingPath registry key correctly reads C:\TestService and the jvm
option is recognized.

Someone else noticed on StackOverflow noticed the same behavior
https://stackoverflow.com/a/54118534/13618336

If someone can help me sign up for an ASF Jira account I'm happy to create
a ticket on this.

Kind regards,
Thomas

Re: [daemon] prunsrv not handling StartPath argument correctly for path ending in \ on windows

Posted by Gilles Sadowski <gi...@gmail.com>.
Hello.

Le ven. 27 janv. 2023 à 11:10, Thomas De Waelheyns
<th...@qaelum.com.invalid> a écrit :
>
> Hi Gilles,
>
> I saw that page but could not find a private@commons.apache.org listed on
> the project page

Indeed; thanks for reporting it.  It is only mentioned indirectly in [1] for
requesting subscription to the "security@" ML.
[I don't know whether it is intentional.]

> so I was not sure it was active for this project. I
> reached out private@commons.apache.org for an ASF Jira account.
>

OK.
[Message has not been delivered yet, probably because that list is
moderated.]

Regards,
Gilles

[1] https://commons.apache.org/mail-lists.html


>> [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [daemon] prunsrv not handling StartPath argument correctly for path ending in \ on windows

Posted by Thomas De Waelheyns <th...@qaelum.com.INVALID>.
Hi Gilles,

I saw that page but could not find a private@commons.apache.org listed on
the project page so I was not sure it was active for this project. I
reached out private@commons.apache.org for an ASF Jira account.

Thanks for the information!
Thomas


On Fri, 27 Jan 2023 at 10:57, Gilles Sadowski <gi...@gmail.com> wrote:

> Hi.
>
> Le ven. 27 janv. 2023 à 10:48, Thomas De Waelheyns
> <th...@qaelum.com.invalid> a écrit :
> >
> > Hey all,
> >
> > First time posting on here, so please let me know if I'm doing something
> > wrong.
> >
> > I would like to report a bug with the daemon tool. I tried creating a
> JIRA
> > ticket but subscriptions are closed and I couldn't find information on
> the
> > project page on how to request one.
>
> https://infra.apache.org/jira-guidelines.html#who
>
> >
> > [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

-- 

With kind regards, met vriendelijke groeten, cordialement, mit freundlichen
Grüßen

Thomas De Waelheyns,

*Software Developer*

Qaelum NV

Arenberg Science Park

Gaston Geenslaan 9

3001 Leuven, Belgium

Phone: +32 16 50 27 37

www.qaelum.com

<https://qaelum.com/>




Legal notice:

The information contained in this message is confidential and is intended
for the addressee(s) only. This information may also be legally privileged.
If you have received this message in error or there are any problems please
notify the originator immediately.

The unauthorized use, disclosure, copying or alteration of this message is
strictly forbidden. The originator will not be liable for direct, special,
indirect or consequential damages arising from alteration of the contents
of this message by a third party or as a result of any virus being passed
on.

Re: [daemon] prunsrv not handling StartPath argument correctly for path ending in \ on windows

Posted by Gilles Sadowski <gi...@gmail.com>.
Hi.

Le ven. 27 janv. 2023 à 10:48, Thomas De Waelheyns
<th...@qaelum.com.invalid> a écrit :
>
> Hey all,
>
> First time posting on here, so please let me know if I'm doing something
> wrong.
>
> I would like to report a bug with the daemon tool. I tried creating a JIRA
> ticket but subscriptions are closed and I couldn't find information on the
> project page on how to request one.

https://infra.apache.org/jira-guidelines.html#who

>
> [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [daemon] prunsrv not handling StartPath argument correctly for path ending in \ on windows

Posted by Gary Gregory <ga...@gmail.com>.
Thomas,

This conversation is not a waste of time, especially if it can lead to the
improvement of this project. To this end, feel free to provide a PR in
GitHub to better the documentation.

Ty,
Gary

On Fri, Jan 27, 2023, 10:12 Thomas De Waelheyns
<th...@qaelum.com.invalid> wrote:

> If we program it by hand it's something we could do, yes. Since we are
> trying to program the installation of service through bat files and
> variables, with paths coming from %~dp0 or %cd% we would have to implement
> additional checks or workarounds
> On further thinking, I realized I forgot about the parsing rules for
> arguments in C. \" is a special case interpreted before it even reaches the
> procrun code. This is not a design choice by the Apache Commons team and I
> understand now why the original issue was closed.
>
>  Maybe we could put a reminder in the procrun documentation to prevent
> other lost souls from making the same mistake?
>
> Sorry for wasting everyone time on something that wasn't an issue to begin
> with.
>
> Kind regards,
> Thomas
>

Re: [daemon] prunsrv not handling StartPath argument correctly for path ending in \ on windows

Posted by Thomas De Waelheyns <th...@qaelum.com.INVALID>.
If we program it by hand it's something we could do, yes. Since we are
trying to program the installation of service through bat files and
variables, with paths coming from %~dp0 or %cd% we would have to implement
additional checks or workarounds
On further thinking, I realized I forgot about the parsing rules for
arguments in C. \" is a special case interpreted before it even reaches the
procrun code. This is not a design choice by the Apache Commons team and I
understand now why the original issue was closed.

 Maybe we could put a reminder in the procrun documentation to prevent
other lost souls from making the same mistake?

Sorry for wasting everyone time on something that wasn't an issue to begin
with.

Kind regards,
Thomas

Re: [daemon] prunsrv not handling StartPath argument correctly for path ending in \ on windows

Posted by Gary Gregory <ga...@gmail.com>.
"Could it be possible to open the discussion again?"

You just did ;-)

Does D:/ not work for you?

Gary

On Fri, Jan 27, 2023, 06:03 Thomas De Waelheyns
<th...@qaelum.com.invalid> wrote:

> I would like to amend my statement. Say that I would like my start
> directory to be the root of my d drive. In Windows, this would be d:\ This
> is the only valid path to point to the root of a volume. This would not be
> possible with the current implementation. Could it be possible to open the
> discussion again?
>
> On Fri, 27 Jan 2023 at 11:50, Thomas De Waelheyns <
> thomas.dewaelheyns@qaelum.com> wrote:
>
> > After further investigation, it looks like my issues are the same as in
> > https://issues.apache.org/jira/browse/DAEMON-198
> > Although I don't agree with the then-reached conclusion that \ at the end
> > of a path is invalid, I accept that was the choice made.
> > My issue is a duplicate and can be closed.
> >
> > Kind regards,
> > Thomas
> >
> > On Fri, 27 Jan 2023 at 10:48, Thomas De Waelheyns <
> > thomas.dewaelheyns@qaelum.com> wrote:
> >
> >> Hey all,
> >>
> >> First time posting on here, so please let me know if I'm doing something
> >> wrong.
> >>
> >> I would like to report a bug with the daemon tool. I tried creating a
> >> JIRA ticket but subscriptions are closed and I couldn't find
> information on
> >> the project page on how to request one.
> >>
> >> While investigating an issue we had using the prunsrv, we noticed that
> >> the tool does not handle well StartPath arguments with a path that ends
> on
> >> \ if they are encapsulated in quotes.
> >>
> >> Apache daemon version: 1.3.3
> >> Platform: Windows 10 Home 22H2
> >> Binaries: AMD64/prunsrv.exe from the project native binaries download
> >>
> >> An example to illustrate:
> >> prunsrv.exe//IS//TestService --StartPath="C:\TestService\"
> >> ++JvmOptions9=-Dan.option="A value"
> >>
> >> In the windows registry, the WorkingPath registry key under
> >> TestService/Parameters/Start now reads: C:\TestService"
> >> ++JvmOptions9=-Dan.option=A
> >> You can see that the path does not stop at the closing quote as
> expected.
> >> The Jvm option is also not recognized.
> >>
> >> If we install the same service without \ at the end of the StartPath:
> >> prunsrv.exe//IS//TestService --StartPath="C:\TestService"
> >> ++JvmOptions9=-Dan.option="A value"
> >>
> >> The WorkingPath registry key correctly reads C:\TestService and the jvm
> >> option is recognized.
> >>
> >> Someone else noticed on StackOverflow noticed the same behavior
> >> https://stackoverflow.com/a/54118534/13618336
> >>
> >> If someone can help me sign up for an ASF Jira account I'm happy to
> >> create a ticket on this.
> >>
> >> Kind regards,
> >> Thomas
> >>
> >
> >
> > --
> >
> > With kind regards, met vriendelijke groeten, cordialement, mit
> > freundlichen Grüßen
> >
> > Thomas De Waelheyns,
> >
> > *Software Developer*
> >
> > Qaelum NV
> >
> > Arenberg Science Park
> >
> > Gaston Geenslaan 9
> >
> > 3001 Leuven, Belgium
> >
> > Phone: +32 16 50 27 37
> >
> > www.qaelum.com
> >
> > <https://qaelum.com/>
> >
> >
> >
> >
> > Legal notice:
> >
> > The information contained in this message is confidential and is intended
> > for the addressee(s) only. This information may also be legally
> privileged.
> > If you have received this message in error or there are any problems
> please
> > notify the originator immediately.
> >
> > The unauthorized use, disclosure, copying or alteration of this message
> is
> > strictly forbidden. The originator will not be liable for direct,
> special,
> > indirect or consequential damages arising from alteration of the contents
> > of this message by a third party or as a result of any virus being passed
> > on.
> >
> >
>
> --
>
> With kind regards, met vriendelijke groeten, cordialement, mit freundlichen
> Grüßen
>
> Thomas De Waelheyns,
>
> *Software Developer*
>
> Qaelum NV
>
> Arenberg Science Park
>
> Gaston Geenslaan 9
>
> 3001 Leuven, Belgium
>
> Phone: +32 16 50 27 37
>
> www.qaelum.com
>
> <https://qaelum.com/>
>
>
>
>
> Legal notice:
>
> The information contained in this message is confidential and is intended
> for the addressee(s) only. This information may also be legally privileged.
> If you have received this message in error or there are any problems please
> notify the originator immediately.
>
> The unauthorized use, disclosure, copying or alteration of this message is
> strictly forbidden. The originator will not be liable for direct, special,
> indirect or consequential damages arising from alteration of the contents
> of this message by a third party or as a result of any virus being passed
> on.
>

Re: [daemon] prunsrv not handling StartPath argument correctly for path ending in \ on windows

Posted by Thomas De Waelheyns <th...@qaelum.com.INVALID>.
I would like to amend my statement. Say that I would like my start
directory to be the root of my d drive. In Windows, this would be d:\ This
is the only valid path to point to the root of a volume. This would not be
possible with the current implementation. Could it be possible to open the
discussion again?

On Fri, 27 Jan 2023 at 11:50, Thomas De Waelheyns <
thomas.dewaelheyns@qaelum.com> wrote:

> After further investigation, it looks like my issues are the same as in
> https://issues.apache.org/jira/browse/DAEMON-198
> Although I don't agree with the then-reached conclusion that \ at the end
> of a path is invalid, I accept that was the choice made.
> My issue is a duplicate and can be closed.
>
> Kind regards,
> Thomas
>
> On Fri, 27 Jan 2023 at 10:48, Thomas De Waelheyns <
> thomas.dewaelheyns@qaelum.com> wrote:
>
>> Hey all,
>>
>> First time posting on here, so please let me know if I'm doing something
>> wrong.
>>
>> I would like to report a bug with the daemon tool. I tried creating a
>> JIRA ticket but subscriptions are closed and I couldn't find information on
>> the project page on how to request one.
>>
>> While investigating an issue we had using the prunsrv, we noticed that
>> the tool does not handle well StartPath arguments with a path that ends on
>> \ if they are encapsulated in quotes.
>>
>> Apache daemon version: 1.3.3
>> Platform: Windows 10 Home 22H2
>> Binaries: AMD64/prunsrv.exe from the project native binaries download
>>
>> An example to illustrate:
>> prunsrv.exe//IS//TestService --StartPath="C:\TestService\"
>> ++JvmOptions9=-Dan.option="A value"
>>
>> In the windows registry, the WorkingPath registry key under
>> TestService/Parameters/Start now reads: C:\TestService"
>> ++JvmOptions9=-Dan.option=A
>> You can see that the path does not stop at the closing quote as expected.
>> The Jvm option is also not recognized.
>>
>> If we install the same service without \ at the end of the StartPath:
>> prunsrv.exe//IS//TestService --StartPath="C:\TestService"
>> ++JvmOptions9=-Dan.option="A value"
>>
>> The WorkingPath registry key correctly reads C:\TestService and the jvm
>> option is recognized.
>>
>> Someone else noticed on StackOverflow noticed the same behavior
>> https://stackoverflow.com/a/54118534/13618336
>>
>> If someone can help me sign up for an ASF Jira account I'm happy to
>> create a ticket on this.
>>
>> Kind regards,
>> Thomas
>>
>
>
> --
>
> With kind regards, met vriendelijke groeten, cordialement, mit
> freundlichen Grüßen
>
> Thomas De Waelheyns,
>
> *Software Developer*
>
> Qaelum NV
>
> Arenberg Science Park
>
> Gaston Geenslaan 9
>
> 3001 Leuven, Belgium
>
> Phone: +32 16 50 27 37
>
> www.qaelum.com
>
> <https://qaelum.com/>
>
>
>
>
> Legal notice:
>
> The information contained in this message is confidential and is intended
> for the addressee(s) only. This information may also be legally privileged.
> If you have received this message in error or there are any problems please
> notify the originator immediately.
>
> The unauthorized use, disclosure, copying or alteration of this message is
> strictly forbidden. The originator will not be liable for direct, special,
> indirect or consequential damages arising from alteration of the contents
> of this message by a third party or as a result of any virus being passed
> on.
>
>

-- 

With kind regards, met vriendelijke groeten, cordialement, mit freundlichen
Grüßen

Thomas De Waelheyns,

*Software Developer*

Qaelum NV

Arenberg Science Park

Gaston Geenslaan 9

3001 Leuven, Belgium

Phone: +32 16 50 27 37

www.qaelum.com

<https://qaelum.com/>




Legal notice:

The information contained in this message is confidential and is intended
for the addressee(s) only. This information may also be legally privileged.
If you have received this message in error or there are any problems please
notify the originator immediately.

The unauthorized use, disclosure, copying or alteration of this message is
strictly forbidden. The originator will not be liable for direct, special,
indirect or consequential damages arising from alteration of the contents
of this message by a third party or as a result of any virus being passed
on.

Re: [daemon] prunsrv not handling StartPath argument correctly for path ending in \ on windows

Posted by Thomas De Waelheyns <th...@qaelum.com.INVALID>.
After further investigation, it looks like my issues are the same as in
https://issues.apache.org/jira/browse/DAEMON-198
Although I don't agree with the then-reached conclusion that \ at the end
of a path is invalid, I accept that was the choice made.
My issue is a duplicate and can be closed.

Kind regards,
Thomas

On Fri, 27 Jan 2023 at 10:48, Thomas De Waelheyns <
thomas.dewaelheyns@qaelum.com> wrote:

> Hey all,
>
> First time posting on here, so please let me know if I'm doing something
> wrong.
>
> I would like to report a bug with the daemon tool. I tried creating a JIRA
> ticket but subscriptions are closed and I couldn't find information on the
> project page on how to request one.
>
> While investigating an issue we had using the prunsrv, we noticed that the
> tool does not handle well StartPath arguments with a path that ends on \ if
> they are encapsulated in quotes.
>
> Apache daemon version: 1.3.3
> Platform: Windows 10 Home 22H2
> Binaries: AMD64/prunsrv.exe from the project native binaries download
>
> An example to illustrate:
> prunsrv.exe//IS//TestService --StartPath="C:\TestService\"
> ++JvmOptions9=-Dan.option="A value"
>
> In the windows registry, the WorkingPath registry key under
> TestService/Parameters/Start now reads: C:\TestService"
> ++JvmOptions9=-Dan.option=A
> You can see that the path does not stop at the closing quote as expected.
> The Jvm option is also not recognized.
>
> If we install the same service without \ at the end of the StartPath:
> prunsrv.exe//IS//TestService --StartPath="C:\TestService"
> ++JvmOptions9=-Dan.option="A value"
>
> The WorkingPath registry key correctly reads C:\TestService and the jvm
> option is recognized.
>
> Someone else noticed on StackOverflow noticed the same behavior
> https://stackoverflow.com/a/54118534/13618336
>
> If someone can help me sign up for an ASF Jira account I'm happy to create
> a ticket on this.
>
> Kind regards,
> Thomas
>


-- 

With kind regards, met vriendelijke groeten, cordialement, mit freundlichen
Grüßen

Thomas De Waelheyns,

*Software Developer*

Qaelum NV

Arenberg Science Park

Gaston Geenslaan 9

3001 Leuven, Belgium

Phone: +32 16 50 27 37

www.qaelum.com

<https://qaelum.com/>




Legal notice:

The information contained in this message is confidential and is intended
for the addressee(s) only. This information may also be legally privileged.
If you have received this message in error or there are any problems please
notify the originator immediately.

The unauthorized use, disclosure, copying or alteration of this message is
strictly forbidden. The originator will not be liable for direct, special,
indirect or consequential damages arising from alteration of the contents
of this message by a third party or as a result of any virus being passed
on.