You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Mikhail Markov (JIRA)" <ji...@apache.org> on 2006/09/14 14:39:22 UTC
[jira] Created: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
[classlib][luni] SocketPermission does not accept '*' as a port number
----------------------------------------------------------------------
Key: HARMONY-1462
URL: http://issues.apache.org/jira/browse/HARMONY-1462
Project: Harmony
Issue Type: Bug
Components: Non-bug differences from RI
Environment: Win XP
Reporter: Mikhail Markov
Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
============== Test.java =================
import java.net.SocketPermission;
public class Test {
public static void main(String[] args) throws Exception {
try {
SocketPermission sp = new SocketPermission("localhost:*", "listen");
System.out.println("'*' for port is ok.");
} catch (IllegalArgumentException iae) {
System.out.println("'*' for port is not ok: " + iae);
}
}
}
======================================
Output on RI:
'*' for port is ok.
Output on Harmony:
'*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] Commented: (HARMONY-1462) [classlib][luni] SocketPermission does not accept '*' as a port number
Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
+1
On Sep 20, 2006, at 4:46 AM, Tony Wu wrote:
> After all, wildcard port is necessary in many network environment and
> to support * does not explicitly disobey the spec. I incline to
> consider it as an intended improvement and follow RI here.
>
> On 9/20/06, Rui Hu <ro...@gmail.com> wrote:
>> On 9/19/06, Mikhail Markov (JIRA) <ji...@apache.org> wrote:
>>
>> > [
>> > http://issues.apache.org/jira/browse/HARMONY-1462?
>> page=comments#action_12435743]
>> >
>> > Mikhail Markov commented on HARMONY-1462:
>> > -----------------------------------------
>> >
>> > I absolutely agree that '*' should be supported as a port number.
>> > But API spec clearly says that: "portrange = portnumber | -
>> portnumber |
>> > portnumber-[portnumber]" (but still RI supports it!) - that's
>> why i put it
>> > to "Non-bug differences" category. Possible fix for API spec?
>>
>>
>> Great analysis! We must follow rule [1], but spec do not restrict
>> "portnumber" in rule [1].
>> And the problem is that we must choose one of following
>> considerations:
>> 1. We can take this JIRA as a "Non-bug differences" and consider
>> "portnumber" as ONLY numerical string ([0-9]*), it hints that RI
>> breaks spec
>> because RI receive "*" as a "portnumber".
>> For this case, we certainly need not to give any fix for Harmony.
>> 2. We can think that "portnumber" is not only numerical string,
>> but also can
>> be "*". If so, because "*" indicates all ports(0-65535), so "-*"
>> and "*-" is
>> meaningless in rule[1].
>>
>> If we choose 1., we should take this JIRA as a RI's bug for it
>> breaks the
>> But I think RI is innocent because the wildcard "*" is reasonable
>> and really
>> a helpful feature.
>>
>> If we choose 2., we should just notice that "-*" and "*-" is
>> meaningless, as
>> an exception of rule [1], and rule[1] can be kept.
>> Then, we can improve Harmony safely with this helpful feature and
>> keep the
>> spec.
>> In fact, following test cases will pass on RI, indicating that "-
>> *" and "*-"
>> is meaningless and "*" is OK.
>> try {
>> new SocketPermission("localhost:-*", "listen");
>> fail("-* should be considered as an illegal port range.");
>> } catch (IllegalArgumentException e) {
>> // Expected
>> }
>> try {
>> new SocketPermission("localhost:*-", "listen");
>> fail("*- should be considered as an illegal port range.");
>> } catch (IllegalArgumentException e) {
>> // Expected
>> }
>> SocketPermission sp3 = new SocketPermission("localhost:*",
>> "listen");
>>
>> So, IMO, 2 is better.
>>
>>
>> [1]: portrange = portnumber | -portnumber | portnumber-[portnumber]
>>
>>
>>
>>
>> > > [classlib][luni] SocketPermission does not accept '*' as a
>> port number
>> > >
>> ---------------------------------------------------------------------
>> -
>> > >
>> > > Key: HARMONY-1462
>> > > URL: http://issues.apache.org/jira/browse/
>> HARMONY-1462
>> > > Project: Harmony
>> > > Issue Type: Bug
>> > > Components: Classlib
>> > > Environment: Win XP
>> > > Reporter: Mikhail Markov
>> > > Assigned To: Paulex Yang
>> > > Attachments: patch.diff
>> > >
>> > >
>> > > Although API specification does not explicitly allow '*' usage
>> as a port
>> > number for SocketPermission, RI accept '*' as a port number
>> (representing
>> > the full port range from 0 to 65535).
>> > > ============== Test.java =================
>> > > import java.net.SocketPermission;
>> > > public class Test {
>> > > public static void main(String[] args) throws Exception {
>> > > try {
>> > > SocketPermission sp = new SocketPermission
>> ("localhost:*",
>> > "listen");
>> > > System.out.println("'*' for port is ok.");
>> > > } catch (IllegalArgumentException iae) {
>> > > System.out.println("'*' for port is not ok: " + iae);
>> > > }
>> > > }
>> > > }
>> > > ======================================
>> > > Output on RI:
>> > > '*' for port is ok.
>> > > Output on Harmony:
>> > > '*' for port is not ok: java.lang.IllegalArgumentException:
>> Invalid port
>> > number specified
>> >
>> > --
>> > This message is automatically generated by JIRA.
>> > -
>> > If you think it was sent incorrectly contact one of the
>> administrators:
>> > http://issues.apache.org/jira/secure/Administrators.jspa
>> > -
>> > For more information on JIRA, see: http://www.atlassian.com/
>> software/jira
>> >
>> >
>> >
>>
>>
>> --
>> Robert Hu
>> China Software Development Lab, IBM
>>
>>
>
>
>
> --
> Tony Wu
> China Software Development Lab, IBM
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [jira] Commented: (HARMONY-1462) [classlib][luni] SocketPermission does not accept '*' as a port number
Posted by Tony Wu <wu...@gmail.com>.
After all, wildcard port is necessary in many network environment and
to support * does not explicitly disobey the spec. I incline to
consider it as an intended improvement and follow RI here.
On 9/20/06, Rui Hu <ro...@gmail.com> wrote:
> On 9/19/06, Mikhail Markov (JIRA) <ji...@apache.org> wrote:
>
> > [
> > http://issues.apache.org/jira/browse/HARMONY-1462?page=comments#action_12435743]
> >
> > Mikhail Markov commented on HARMONY-1462:
> > -----------------------------------------
> >
> > I absolutely agree that '*' should be supported as a port number.
> > But API spec clearly says that: "portrange = portnumber | -portnumber |
> > portnumber-[portnumber]" (but still RI supports it!) - that's why i put it
> > to "Non-bug differences" category. Possible fix for API spec?
>
>
> Great analysis! We must follow rule [1], but spec do not restrict
> "portnumber" in rule [1].
> And the problem is that we must choose one of following considerations:
> 1. We can take this JIRA as a "Non-bug differences" and consider
> "portnumber" as ONLY numerical string ([0-9]*), it hints that RI breaks spec
> because RI receive "*" as a "portnumber".
> For this case, we certainly need not to give any fix for Harmony.
> 2. We can think that "portnumber" is not only numerical string, but also can
> be "*". If so, because "*" indicates all ports(0-65535), so "-*" and "*-" is
> meaningless in rule[1].
>
> If we choose 1., we should take this JIRA as a RI's bug for it breaks the
> But I think RI is innocent because the wildcard "*" is reasonable and really
> a helpful feature.
>
> If we choose 2., we should just notice that "-*" and "*-" is meaningless, as
> an exception of rule [1], and rule[1] can be kept.
> Then, we can improve Harmony safely with this helpful feature and keep the
> spec.
> In fact, following test cases will pass on RI, indicating that "-*" and "*-"
> is meaningless and "*" is OK.
> try {
> new SocketPermission("localhost:-*", "listen");
> fail("-* should be considered as an illegal port range.");
> } catch (IllegalArgumentException e) {
> // Expected
> }
> try {
> new SocketPermission("localhost:*-", "listen");
> fail("*- should be considered as an illegal port range.");
> } catch (IllegalArgumentException e) {
> // Expected
> }
> SocketPermission sp3 = new SocketPermission("localhost:*",
> "listen");
>
> So, IMO, 2 is better.
>
>
> [1]: portrange = portnumber | -portnumber | portnumber-[portnumber]
>
>
>
>
> > > [classlib][luni] SocketPermission does not accept '*' as a port number
> > > ----------------------------------------------------------------------
> > >
> > > Key: HARMONY-1462
> > > URL: http://issues.apache.org/jira/browse/HARMONY-1462
> > > Project: Harmony
> > > Issue Type: Bug
> > > Components: Classlib
> > > Environment: Win XP
> > > Reporter: Mikhail Markov
> > > Assigned To: Paulex Yang
> > > Attachments: patch.diff
> > >
> > >
> > > Although API specification does not explicitly allow '*' usage as a port
> > number for SocketPermission, RI accept '*' as a port number (representing
> > the full port range from 0 to 65535).
> > > ============== Test.java =================
> > > import java.net.SocketPermission;
> > > public class Test {
> > > public static void main(String[] args) throws Exception {
> > > try {
> > > SocketPermission sp = new SocketPermission("localhost:*",
> > "listen");
> > > System.out.println("'*' for port is ok.");
> > > } catch (IllegalArgumentException iae) {
> > > System.out.println("'*' for port is not ok: " + iae);
> > > }
> > > }
> > > }
> > > ======================================
> > > Output on RI:
> > > '*' for port is ok.
> > > Output on Harmony:
> > > '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port
> > number specified
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > If you think it was sent incorrectly contact one of the administrators:
> > http://issues.apache.org/jira/secure/Administrators.jspa
> > -
> > For more information on JIRA, see: http://www.atlassian.com/software/jira
> >
> >
> >
>
>
> --
> Robert Hu
> China Software Development Lab, IBM
>
>
--
Tony Wu
China Software Development Lab, IBM
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [jira] Commented: (HARMONY-1462) [classlib][luni] SocketPermission does not accept '*' as a port number
Posted by Rui Hu <ro...@gmail.com>.
On 9/19/06, Mikhail Markov (JIRA) <ji...@apache.org> wrote:
> [
> http://issues.apache.org/jira/browse/HARMONY-1462?page=comments#action_12435743]
>
> Mikhail Markov commented on HARMONY-1462:
> -----------------------------------------
>
> I absolutely agree that '*' should be supported as a port number.
> But API spec clearly says that: "portrange = portnumber | -portnumber |
> portnumber-[portnumber]" (but still RI supports it!) - that's why i put it
> to "Non-bug differences" category. Possible fix for API spec?
Great analysis! We must follow rule [1], but spec do not restrict
"portnumber" in rule [1].
And the problem is that we must choose one of following considerations:
1. We can take this JIRA as a "Non-bug differences" and consider
"portnumber" as ONLY numerical string ([0-9]*), it hints that RI breaks spec
because RI receive "*" as a "portnumber".
For this case, we certainly need not to give any fix for Harmony.
2. We can think that "portnumber" is not only numerical string, but also can
be "*". If so, because "*" indicates all ports(0-65535), so "-*" and "*-" is
meaningless in rule[1].
If we choose 1., we should take this JIRA as a RI's bug for it breaks the
But I think RI is innocent because the wildcard "*" is reasonable and really
a helpful feature.
If we choose 2., we should just notice that "-*" and "*-" is meaningless, as
an exception of rule [1], and rule[1] can be kept.
Then, we can improve Harmony safely with this helpful feature and keep the
spec.
In fact, following test cases will pass on RI, indicating that "-*" and "*-"
is meaningless and "*" is OK.
try {
new SocketPermission("localhost:-*", "listen");
fail("-* should be considered as an illegal port range.");
} catch (IllegalArgumentException e) {
// Expected
}
try {
new SocketPermission("localhost:*-", "listen");
fail("*- should be considered as an illegal port range.");
} catch (IllegalArgumentException e) {
// Expected
}
SocketPermission sp3 = new SocketPermission("localhost:*",
"listen");
So, IMO, 2 is better.
[1]: portrange = portnumber | -portnumber | portnumber-[portnumber]
> > [classlib][luni] SocketPermission does not accept '*' as a port number
> > ----------------------------------------------------------------------
> >
> > Key: HARMONY-1462
> > URL: http://issues.apache.org/jira/browse/HARMONY-1462
> > Project: Harmony
> > Issue Type: Bug
> > Components: Classlib
> > Environment: Win XP
> > Reporter: Mikhail Markov
> > Assigned To: Paulex Yang
> > Attachments: patch.diff
> >
> >
> > Although API specification does not explicitly allow '*' usage as a port
> number for SocketPermission, RI accept '*' as a port number (representing
> the full port range from 0 to 65535).
> > ============== Test.java =================
> > import java.net.SocketPermission;
> > public class Test {
> > public static void main(String[] args) throws Exception {
> > try {
> > SocketPermission sp = new SocketPermission("localhost:*",
> "listen");
> > System.out.println("'*' for port is ok.");
> > } catch (IllegalArgumentException iae) {
> > System.out.println("'*' for port is not ok: " + iae);
> > }
> > }
> > }
> > ======================================
> > Output on RI:
> > '*' for port is ok.
> > Output on Harmony:
> > '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port
> number specified
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
> http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>
--
Robert Hu
China Software Development Lab, IBM
Re: [jira] Commented: (HARMONY-1462) [classlib][luni] SocketPermission does not accept '*' as a port number
Posted by Andrew Zhang <zh...@gmail.com>.
On 9/19/06, Mikhail Markov (JIRA) <ji...@apache.org> wrote:
>
> [
> http://issues.apache.org/jira/browse/HARMONY-1462?page=comments#action_12435743]
>
> Mikhail Markov commented on HARMONY-1462:
> -----------------------------------------
>
> I absolutely agree that '*' should be supported as a port number.
> But API spec clearly says that: "portrange = portnumber | -portnumber |
> portnumber-[portnumber]" (but still RI supports it!) - that's why i put it
> to "Non-bug differences" category. Possible fix for API spec?
Ya, it seems an intended behaviour of RI. I suggest to follow RI for this
case.
> [classlib][luni] SocketPermission does not accept '*' as a port number
> > ----------------------------------------------------------------------
> >
> > Key: HARMONY-1462
> > URL: http://issues.apache.org/jira/browse/HARMONY-1462
> > Project: Harmony
> > Issue Type: Bug
> > Components: Classlib
> > Environment: Win XP
> > Reporter: Mikhail Markov
> > Assigned To: Paulex Yang
> > Attachments: patch.diff
> >
> >
> > Although API specification does not explicitly allow '*' usage as a port
> number for SocketPermission, RI accept '*' as a port number (representing
> the full port range from 0 to 65535).
> > ============== Test.java =================
> > import java.net.SocketPermission;
> > public class Test {
> > public static void main(String[] args) throws Exception {
> > try {
> > SocketPermission sp = new SocketPermission("localhost:*",
> "listen");
> > System.out.println("'*' for port is ok.");
> > } catch (IllegalArgumentException iae) {
> > System.out.println("'*' for port is not ok: " + iae);
> > }
> > }
> > }
> > ======================================
> > Output on RI:
> > '*' for port is ok.
> > Output on Harmony:
> > '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port
> number specified
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
> http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>
--
Andrew Zhang
China Software Development Lab, IBM
[jira] Commented: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
Posted by "Robert Hu (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1462?page=comments#action_12435714 ]
Robert Hu commented on HARMONY-1462:
------------------------------------
Current implementaion of Harmony do not accept "*" as a legal port number in constructor.
I think the "*" style of port range is reasonable. e.g. "localhost:*" is short for "localhost:0-65535" in its constructor.
IMHO, instead of Non-bug differences from RI, it's better for us to take this JIRA as a bug.
Harmony can support this feature by applying this patch.
> [classlib][luni] SocketPermission does not accept '*' as a port number
> ----------------------------------------------------------------------
>
> Key: HARMONY-1462
> URL: http://issues.apache.org/jira/browse/HARMONY-1462
> Project: Harmony
> Issue Type: Bug
> Components: Non-bug differences from RI
> Environment: Win XP
> Reporter: Mikhail Markov
> Attachments: patch.diff
>
>
> Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
> ============== Test.java =================
> import java.net.SocketPermission;
> public class Test {
> public static void main(String[] args) throws Exception {
> try {
> SocketPermission sp = new SocketPermission("localhost:*", "listen");
> System.out.println("'*' for port is ok.");
> } catch (IllegalArgumentException iae) {
> System.out.println("'*' for port is not ok: " + iae);
> }
> }
> }
> ======================================
> Output on RI:
> '*' for port is ok.
> Output on Harmony:
> '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
Posted by "Mikhail Markov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1462?page=comments#action_12435743 ]
Mikhail Markov commented on HARMONY-1462:
-----------------------------------------
I absolutely agree that '*' should be supported as a port number.
But API spec clearly says that: "portrange = portnumber | -portnumber | portnumber-[portnumber]" (but still RI supports it!) - that's why i put it to "Non-bug differences" category. Possible fix for API spec?
> [classlib][luni] SocketPermission does not accept '*' as a port number
> ----------------------------------------------------------------------
>
> Key: HARMONY-1462
> URL: http://issues.apache.org/jira/browse/HARMONY-1462
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Win XP
> Reporter: Mikhail Markov
> Assigned To: Paulex Yang
> Attachments: patch.diff
>
>
> Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
> ============== Test.java =================
> import java.net.SocketPermission;
> public class Test {
> public static void main(String[] args) throws Exception {
> try {
> SocketPermission sp = new SocketPermission("localhost:*", "listen");
> System.out.println("'*' for port is ok.");
> } catch (IllegalArgumentException iae) {
> System.out.println("'*' for port is not ok: " + iae);
> }
> }
> }
> ======================================
> Output on RI:
> '*' for port is ok.
> Output on Harmony:
> '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1462?page=all ]
Paulex Yang updated HARMONY-1462:
---------------------------------
Component/s: Classlib
(was: Non-bug differences from RI)
I agree that no reason not to follow RI here.
> [classlib][luni] SocketPermission does not accept '*' as a port number
> ----------------------------------------------------------------------
>
> Key: HARMONY-1462
> URL: http://issues.apache.org/jira/browse/HARMONY-1462
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Win XP
> Reporter: Mikhail Markov
> Assigned To: Paulex Yang
> Attachments: patch.diff
>
>
> Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
> ============== Test.java =================
> import java.net.SocketPermission;
> public class Test {
> public static void main(String[] args) throws Exception {
> try {
> SocketPermission sp = new SocketPermission("localhost:*", "listen");
> System.out.println("'*' for port is ok.");
> } catch (IllegalArgumentException iae) {
> System.out.println("'*' for port is not ok: " + iae);
> }
> }
> }
> ======================================
> Output on RI:
> '*' for port is ok.
> Output on Harmony:
> '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
Posted by "Mikhail Markov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1462?page=comments#action_12436854 ]
Mikhail Markov commented on HARMONY-1462:
-----------------------------------------
Yes - it works as expected. Thanks!
> [classlib][luni] SocketPermission does not accept '*' as a port number
> ----------------------------------------------------------------------
>
> Key: HARMONY-1462
> URL: http://issues.apache.org/jira/browse/HARMONY-1462
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Win XP
> Reporter: Mikhail Markov
> Assigned To: Paulex Yang
> Attachments: patch.diff
>
>
> Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
> ============== Test.java =================
> import java.net.SocketPermission;
> public class Test {
> public static void main(String[] args) throws Exception {
> try {
> SocketPermission sp = new SocketPermission("localhost:*", "listen");
> System.out.println("'*' for port is ok.");
> } catch (IllegalArgumentException iae) {
> System.out.println("'*' for port is not ok: " + iae);
> }
> }
> }
> ======================================
> Output on RI:
> '*' for port is ok.
> Output on Harmony:
> '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
Posted by "Robert Hu (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1462?page=all ]
Robert Hu updated HARMONY-1462:
-------------------------------
Attachment: patch.diff
if host name ends with ":*", such as "localhost:*", the port range should be 0-65535
> [classlib][luni] SocketPermission does not accept '*' as a port number
> ----------------------------------------------------------------------
>
> Key: HARMONY-1462
> URL: http://issues.apache.org/jira/browse/HARMONY-1462
> Project: Harmony
> Issue Type: Bug
> Components: Non-bug differences from RI
> Environment: Win XP
> Reporter: Mikhail Markov
> Attachments: patch.diff
>
>
> Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
> ============== Test.java =================
> import java.net.SocketPermission;
> public class Test {
> public static void main(String[] args) throws Exception {
> try {
> SocketPermission sp = new SocketPermission("localhost:*", "listen");
> System.out.println("'*' for port is ok.");
> } catch (IllegalArgumentException iae) {
> System.out.println("'*' for port is not ok: " + iae);
> }
> }
> }
> ======================================
> Output on RI:
> '*' for port is ok.
> Output on Harmony:
> '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
Posted by "Robert Hu (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1462?page=comments#action_12435630 ]
Robert Hu commented on HARMONY-1462:
------------------------------------
Seems that the parsePort method of SocketPermission handle the "*" as an Exception.
I'll look at it and produce a patch soon.
> [classlib][luni] SocketPermission does not accept '*' as a port number
> ----------------------------------------------------------------------
>
> Key: HARMONY-1462
> URL: http://issues.apache.org/jira/browse/HARMONY-1462
> Project: Harmony
> Issue Type: Bug
> Components: Non-bug differences from RI
> Environment: Win XP
> Reporter: Mikhail Markov
>
> Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
> ============== Test.java =================
> import java.net.SocketPermission;
> public class Test {
> public static void main(String[] args) throws Exception {
> try {
> SocketPermission sp = new SocketPermission("localhost:*", "listen");
> System.out.println("'*' for port is ok.");
> } catch (IllegalArgumentException iae) {
> System.out.println("'*' for port is not ok: " + iae);
> }
> }
> }
> ======================================
> Output on RI:
> '*' for port is ok.
> Output on Harmony:
> '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1462?page=comments#action_12436710 ]
Paulex Yang commented on HARMONY-1462:
--------------------------------------
Oops, I missed the revision number, it should be r448765.
> [classlib][luni] SocketPermission does not accept '*' as a port number
> ----------------------------------------------------------------------
>
> Key: HARMONY-1462
> URL: http://issues.apache.org/jira/browse/HARMONY-1462
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Win XP
> Reporter: Mikhail Markov
> Assigned To: Paulex Yang
> Attachments: patch.diff
>
>
> Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
> ============== Test.java =================
> import java.net.SocketPermission;
> public class Test {
> public static void main(String[] args) throws Exception {
> try {
> SocketPermission sp = new SocketPermission("localhost:*", "listen");
> System.out.println("'*' for port is ok.");
> } catch (IllegalArgumentException iae) {
> System.out.println("'*' for port is not ok: " + iae);
> }
> }
> }
> ======================================
> Output on RI:
> '*' for port is ok.
> Output on Harmony:
> '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1462?page=all ]
Paulex Yang reassigned HARMONY-1462:
------------------------------------
Assignee: Paulex Yang
> [classlib][luni] SocketPermission does not accept '*' as a port number
> ----------------------------------------------------------------------
>
> Key: HARMONY-1462
> URL: http://issues.apache.org/jira/browse/HARMONY-1462
> Project: Harmony
> Issue Type: Bug
> Components: Non-bug differences from RI
> Environment: Win XP
> Reporter: Mikhail Markov
> Assigned To: Paulex Yang
> Attachments: patch.diff
>
>
> Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
> ============== Test.java =================
> import java.net.SocketPermission;
> public class Test {
> public static void main(String[] args) throws Exception {
> try {
> SocketPermission sp = new SocketPermission("localhost:*", "listen");
> System.out.println("'*' for port is ok.");
> } catch (IllegalArgumentException iae) {
> System.out.println("'*' for port is not ok: " + iae);
> }
> }
> }
> ======================================
> Output on RI:
> '*' for port is ok.
> Output on Harmony:
> '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1462?page=all ]
Paulex Yang closed HARMONY-1462.
--------------------------------
Verified by Mikhail.
> [classlib][luni] SocketPermission does not accept '*' as a port number
> ----------------------------------------------------------------------
>
> Key: HARMONY-1462
> URL: http://issues.apache.org/jira/browse/HARMONY-1462
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Win XP
> Reporter: Mikhail Markov
> Assigned To: Paulex Yang
> Attachments: patch.diff
>
>
> Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
> ============== Test.java =================
> import java.net.SocketPermission;
> public class Test {
> public static void main(String[] args) throws Exception {
> try {
> SocketPermission sp = new SocketPermission("localhost:*", "listen");
> System.out.println("'*' for port is ok.");
> } catch (IllegalArgumentException iae) {
> System.out.println("'*' for port is not ok: " + iae);
> }
> }
> }
> ======================================
> Output on RI:
> '*' for port is ok.
> Output on Harmony:
> '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (HARMONY-1462) [classlib][luni] SocketPermission
does not accept '*' as a port number
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1462?page=all ]
Paulex Yang resolved HARMONY-1462.
----------------------------------
Resolution: Fixed
Robert, patch applied at revision r, thanks a lot for this enhancement.
Mikhail, please verify the problem is resolved as you expected, thanks a lot.
> [classlib][luni] SocketPermission does not accept '*' as a port number
> ----------------------------------------------------------------------
>
> Key: HARMONY-1462
> URL: http://issues.apache.org/jira/browse/HARMONY-1462
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Environment: Win XP
> Reporter: Mikhail Markov
> Assigned To: Paulex Yang
> Attachments: patch.diff
>
>
> Although API specification does not explicitly allow '*' usage as a port number for SocketPermission, RI accept '*' as a port number (representing the full port range from 0 to 65535).
> ============== Test.java =================
> import java.net.SocketPermission;
> public class Test {
> public static void main(String[] args) throws Exception {
> try {
> SocketPermission sp = new SocketPermission("localhost:*", "listen");
> System.out.println("'*' for port is ok.");
> } catch (IllegalArgumentException iae) {
> System.out.println("'*' for port is not ok: " + iae);
> }
> }
> }
> ======================================
> Output on RI:
> '*' for port is ok.
> Output on Harmony:
> '*' for port is not ok: java.lang.IllegalArgumentException: Invalid port number specified
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira