[cp-patches] FYI: Add printing security checks

Tom Tromey tromey at redhat.com
Tue Jun 20 15:44:33 UTC 2006


>>>>> "Gary" == Gary Benson <gbenson at redhat.com> writes:

Gary> This commit adds security checks to all AWT peers' getPrintJob
Gary> methods.  None of the methods actually do anything yet, but having
Gary> the checks there means the Mauve tests pass.

Gary>    public PrintJob getPrintJob(Frame frame, String title,
Gary>                                JobAttributes jobAttr, PageAttributes pageAttr)
Gary>    {
Gary> +    // FIXME: it is possible this check may be removed
Gary> +    // if this method, when written, always delegates to
Gary> +    // getPrintJob(Frame, String, Properties).
Gary> +    SecurityManager sm;
Gary> +    sm = System.getSecurityManager();
Gary> +    if (sm != null)
Gary> +      sm.checkPrintJobAccess();
Gary> +
Gary>      return null;
Gary>    }

>From the javadoc it looks as though the underlying toolkit must do
this check.

Also, seeing as this is not implemented, it should be marked as such.
Or, alternatively, written :)

Tom



More information about the Classpath-patches mailing list