components/cups/patches/19-14850597.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 11 Mar 2013 10:38:09 -0700
branchs11-update
changeset 2520 ceec631e74d1
parent 2490 ee4391c71c07
permissions -rw-r--r--
Close of build 10.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2490
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
     1
--- scheduler/ipp.c	Fri Jan  4 02:15:27 2013
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
     2
+++ scheduler/ipp.c	Fri Jan  4 02:14:58 2013
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
     3
@@ -1510,6 +1510,52 @@
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
     4
   }
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
     5
 #endif /* HAVE_SSL */
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
     6
 
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
     7
+#if defined(HAVE_TSOL)
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
     8
+  if (is_system_labeled() != 0) {
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
     9
+    ipp_attribute_t *uattr;
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    10
+    uattr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME);
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    11
+    if (uattr) {
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    12
+      /* check for 'nolabels' in request */
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    13
+      if (ippFindAttribute(con->request, "labels", IPP_TAG_ZERO) != NULL) {
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    14
+        /* check if user is authorized */
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    15
+        if (chkauthattr("solaris.print.unlabeled", uattr->values[0].string.text) == 0) {
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    16
+          /*
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    17
+           * print request will fail since user
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    18
+           * does not have the required authorization.
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    19
+           */
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    20
+	  cups_audit_print_request_denial(con, NULL, printer, -1, EACCES);
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    21
+	  send_http_error(con, HTTP_UNAUTHORIZED, printer);
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    22
+	  return (NULL);
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    23
+        }
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    24
+      }
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    25
+
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    26
+      /*
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    27
+       * check for nobanner.
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    28
+       * '-o job-sheets=none,none' means
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    29
+       *  user does not want to print banner and trailer page.
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    30
+       */
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    31
+      if ((attr = ippFindAttribute(con->request, "job-sheets",
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    32
+          IPP_TAG_ZERO)) != NULL) {
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    33
+        if (strcmp(attr->values[0].string.text, "none") == 0) {
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    34
+          /*
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    35
+           * User wants no banner.
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    36
+           * Check if user is authorized.
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    37
+           */
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    38
+          if (chkauthattr("solaris.print.nobanner", uattr->values[0].string.text) == 0) {
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    39
+            /*
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    40
+             * print request will fail since user
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    41
+             * does not have the required authorization.
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    42
+             */
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    43
+            cups_audit_print_request_denial(con, NULL, printer, -1, EACCES);
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    44
+            send_http_error(con, HTTP_UNAUTHORIZED, printer);
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    45
+            return (NULL);
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    46
+          }
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    47
+        }
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    48
+      } 
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    49
+    }
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    50
+  }
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    51
+#endif /* HAVE_TSOL */
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    52
+
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    53
  /*
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    54
   * See if the printer is accepting jobs...
ee4391c71c07 15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff changeset
    55
   */