Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-13 Thread Staffan Larsen
Martin, Jaroslav: Thank you! > On 12 mar 2015, at 18:47, Martin Buchholz wrote: > > Looks good to me! > > > On Thu, Mar 12, 2015 at 12:18 AM, Staffan Larsen > wrote: > >> On 11 mar 2015, at 20:37, Martin Buchholz > > wrote: >> >>

Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-12 Thread Martin Buchholz
Looks good to me! On Thu, Mar 12, 2015 at 12:18 AM, Staffan Larsen wrote: > > On 11 mar 2015, at 20:37, Martin Buchholz wrote: > > Producing good error messages is such hard work! > > > Aye. And so often forgotten. > > > Instead of 0%3o, use 0%03o > > Since you want to print the lowest 9 bits

Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-12 Thread Jaroslav Bachorik
On 12.3.2015 08:18, Staffan Larsen wrote: On 11 mar 2015, at 20:37, Martin Buchholz mailto:marti...@google.com>> wrote: Producing good error messages is such hard work! Aye. And so often forgotten. Instead of 0%3o, use 0%03o Since you want to print the lowest 9 bits of the mode, don't you

Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-12 Thread Staffan Larsen
> On 11 mar 2015, at 20:37, Martin Buchholz wrote: > > Producing good error messages is such hard work! Aye. And so often forgotten. > > Instead of 0%3o, use 0%03o > Since you want to print the lowest 9 bits of the mode, don't you want & 0x1ff Absolutely. I opted for the octal representation

Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-11 Thread Martin Buchholz
Producing good error messages is such hard work! Instead of 0%3o, use 0%03o Since you want to print the lowest 9 bits of the mode, don't you want & 0x1ff On Wed, Mar 11, 2015 at 2:30 AM, Staffan Larsen wrote: > Thanks for the feedback. Here is a new version that prints out more > details for

Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-11 Thread Staffan Larsen
Thanks for the feedback. Here is a new version that prints out more details for each of the errors messages. Let me know if you have suggestions for better wording. It also adds an #include for jvm.h that was missing from some of the files (it is needed for jio_snprintf). webrev: http://cr.open

Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-10 Thread Martin Buchholz
On Tue, Mar 10, 2015 at 10:53 AM, Jaroslav Bachorik < jaroslav.bacho...@oracle.com> wrote: > > This just got me thinking - would including [sb.st_uid, uid] and > [sb.st_gid, gid] in the error message be of any additional benefit? > Yes. How much do you want to improve the quality of error messag

Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-10 Thread Jaroslav Bachorik
On 10.3.2015 18:45, Staffan Larsen wrote: Hi Martin, On 10 mar 2015, at 18:40, Martin Buchholz mailto:marti...@google.com>> wrote: It's traditional (at least on Unix) to put the message after a ": " not within parens. http://pubs.opengroup.org/onlinepubs/009695399/functions/perror.html Good

Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-10 Thread Staffan Larsen
Hi Martin, > On 10 mar 2015, at 18:40, Martin Buchholz wrote: > > It's traditional (at least on Unix) to put the message after a ": " not > within parens. > http://pubs.opengroup.org/onlinepubs/009695399/functions/perror.html >

Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-10 Thread Martin Buchholz
It's traditional (at least on Unix) to put the message after a ": " not within parens. http://pubs.opengroup.org/onlinepubs/009695399/functions/perror.html 374 if (sb.st_uid != uid) { 375 msg = "file is not owned by the current user"; 376 } else if (sb.st_g

Re: RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-10 Thread Jaroslav Bachorik
Hi Staffan, On 10.3.2015 11:21, Staffan Larsen wrote: During attach, if the .java_pid file is not secure we currently say "well-known file is not secure". This can be enhanced to say _why_ the file is not considered secure. bug: https://bugs.openjdk.java.net/browse/JDK-8074812 webrev: http://c

RFR: 8074812 More specific error message when the .java_pid well-known file is not secure

2015-03-10 Thread Staffan Larsen
During attach, if the .java_pid file is not secure we currently say "well-known file is not secure". This can be enhanced to say _why_ the file is not considered secure. bug: https://bugs.openjdk.java.net/browse/JDK-8074812 webrev: http://cr.openjdk.java.net/~sla/8074812/webrev.00/ Note that it