Index: printers.c =================================================================== --- printers.c (revision 7232) +++ printers.c (working copy) @@ -3,7 +3,7 @@ * * Printer status CGI for the Common UNIX Printing System (CUPS). * - * Copyright 2007 by Apple Inc. + * Copyright 2007-2008 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -280,6 +280,11 @@ snprintf(refresh, sizeof(refresh), "2;URL=%s", uri); cgiSetVariable("refresh_page", refresh); } + else if (cupsLastError() == IPP_NOT_AUTHORIZED) + { + puts("Status: 401\n"); + exit(0); + } cgiStartHTML(cgiText(_("Printer Maintenance"))); Index: ipp-var.c =================================================================== --- ipp-var.c (revision 7232) +++ ipp-var.c (working copy) @@ -595,6 +595,11 @@ snprintf(refresh, sizeof(refresh), "2;URL=%s", uri); cgiSetVariable("refresh_page", refresh); } + else if (cupsLastError() == IPP_NOT_AUTHORIZED) + { + puts("Status: 401\n"); + exit(0); + } cgiStartHTML(cgiText(_("Print Test Page"))); Index: jobs.c =================================================================== --- jobs.c (revision 7232) +++ jobs.c (working copy) @@ -3,7 +3,7 @@ * * Job status CGI for the Common UNIX Printing System (CUPS). * - * Copyright 2007 by Apple Inc. + * Copyright 2007-2008 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -185,6 +185,11 @@ cgiFormEncode(url + 6, getenv("HTTP_REFERER"), sizeof(url) - 6); cgiSetVariable("refresh_page", url); } + else if (cupsLastError() == IPP_NOT_AUTHORIZED) + { + puts("Status: 401\n"); + exit(0); + } cgiStartHTML(cgiText(_("Jobs")));