author | Sonam Gupta <sonam.x.gupta@oracle.com> |
Sun, 17 Feb 2013 21:51:48 -0800 | |
branch | s11u1-sru |
changeset 2495 | eb04a6ca141d |
permissions | -rw-r--r-- |
2495
eb04a6ca141d
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 |
eb04a6ca141d
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 |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
3 |
@@ -1510,6 +1510,52 @@ |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
4 |
} |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
5 |
#endif /* HAVE_SSL */ |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
6 |
|
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
7 |
+#if defined(HAVE_TSOL) |
eb04a6ca141d
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) { |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
9 |
+ ipp_attribute_t *uattr; |
eb04a6ca141d
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); |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
11 |
+ if (uattr) { |
eb04a6ca141d
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 */ |
eb04a6ca141d
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) { |
eb04a6ca141d
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 */ |
eb04a6ca141d
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) { |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
16 |
+ /* |
eb04a6ca141d
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 |
eb04a6ca141d
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. |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
19 |
+ */ |
eb04a6ca141d
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); |
eb04a6ca141d
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); |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
22 |
+ return (NULL); |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
23 |
+ } |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
24 |
+ } |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
25 |
+ |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
26 |
+ /* |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
27 |
+ * check for nobanner. |
eb04a6ca141d
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 |
eb04a6ca141d
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. |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
30 |
+ */ |
eb04a6ca141d
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", |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
32 |
+ IPP_TAG_ZERO)) != NULL) { |
eb04a6ca141d
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) { |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
34 |
+ /* |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
35 |
+ * User wants no banner. |
eb04a6ca141d
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. |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
37 |
+ */ |
eb04a6ca141d
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) { |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
39 |
+ /* |
eb04a6ca141d
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 |
eb04a6ca141d
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. |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
42 |
+ */ |
eb04a6ca141d
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); |
eb04a6ca141d
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); |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
45 |
+ return (NULL); |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
46 |
+ } |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
47 |
+ } |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
48 |
+ } |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
49 |
+ } |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
50 |
+ } |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
51 |
+#endif /* HAVE_TSOL */ |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
52 |
+ |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
53 |
/* |
eb04a6ca141d
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... |
eb04a6ca141d
15698471 cups should audit printing information in TX environments
Sonam Gupta <sonam.x.gupta@oracle.com>
parents:
diff
changeset
|
55 |
*/ |