commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Goddard (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (DAEMON-85) prunsrv.exe fails if filename is less than 4 characters long
Date Wed, 21 Mar 2007 04:53:32 GMT

     [ https://issues.apache.org/jira/browse/DAEMON-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Goddard reopened DAEMON-85:
-----------------------------------


It should be noted that the origional description could be confusing.

To clarify; The minimum current length of 'prunsrv.exe' is 8 characters because of this ie.
'abcd.exe' is will work but 'abc.exe' will not. I dont see why it should be artificially limited
when removing an incorrect check resolves the problem.

Why is it irrelevant to rename 'prunsrv.exe' to be say 'abc.exe'? And why do you need to check
if the user typed '.exe' on the end of the command or not?

I dont understand how 'removing' 3 lines of code that doesn't need to be there and causes
problems, doesn't simplify command line parsing.

Please just remove the check, it is unnccessary and incorrect.

thanks,
Michael.


> prunsrv.exe fails if filename is less than 4 characters long
> ------------------------------------------------------------
>
>                 Key: DAEMON-85
>                 URL: https://issues.apache.org/jira/browse/DAEMON-85
>             Project: Commons Daemon
>          Issue Type: Bug
>    Affects Versions: 1.0.1
>         Environment: Win2k
>            Reporter: Michael Goddard
>
> In cmdline.c, function apxCmdlineParse the following three lines check if the length
if arg[0] is greater than the length of .EXE.
> However on windows, exe's can be executed without their .exe prefix. This means, if prunsrv.exe
is renamed to 3 characters or less, the check fails and command line arguments arn't parsed
returning an error. I could not figure out why the check is there, it seems to serve no purpose
and if commented out the bug goes away.
> Code at fault:
>     l = lstrlenW(_st_sys_argvw[0]);
>     if (l < EXE_SUFFIXLEN)
>         return NULL;
> To reproduce:
> 1. Rename prunsrv.exe to say abc.exe
> 2. Execute the service executable directly as 'abc' in the current folder, do not type
'abc.exe'. (useful to use when debugging the app)
> 3. See it fail to parse command line arguments
> To solve:
> Remove offending lines. Perhaps check if arg[0] length is less than or equal to 0 instead
of 4, which would be a valid case to fail in.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message