]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - backend/ipp.c
Merge changes from CUPS 1.5svn-r8950.
[thirdparty/cups.git] / backend / ipp.c
index f5cfbd000cde32bad3c34f62d98de76d53f64649..1e58d71f5efc6f52f3a69940d6a52256aeb44f50 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   IPP backend for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 2007-2009 by Apple Inc.
+ *   Copyright 2007-2010 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -728,6 +728,15 @@ main(int  argc,                            /* I - Number of command-line args */
 
        return (CUPS_BACKEND_STOP);
       }
+      else if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN)
+      {
+       if (!strncmp(httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE),
+                    "Negotiate", 9))
+         auth_info_required = "negotiate";
+
+       fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required);
+       return (CUPS_BACKEND_AUTH_REQUIRED);
+      }
       else
       {
        _cupsLangPrintf(stderr,
@@ -1331,7 +1340,10 @@ main(int  argc,                          /* I - Number of command-line args */
   else if (ipp_status > IPP_OK_CONFLICT)
     return (CUPS_BACKEND_FAILED);
   else
+  {
+    _cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
     return (CUPS_BACKEND_OK);
+  }
 }
 
 
@@ -1794,8 +1806,11 @@ run_pictwps_filter(char       **argv,    /* I - Command-line arguments */
       * Change to an unpriviledged user...
       */
 
-      setgid(fileinfo.st_gid);
-      setuid(fileinfo.st_uid);
+      if (setgid(fileinfo.st_gid))
+        return (errno);
+
+      if (setuid(fileinfo.st_uid))
+        return (errno);
     }
 
     execlp("pictwpstops", printer, argv[1], argv[2], argv[3], argv[4], argv[5],