|
1 --- scheduler/ipp.c Fri Jan 4 02:15:27 2013 |
|
2 +++ scheduler/ipp.c Fri Jan 4 02:14:58 2013 |
|
3 @@ -1510,6 +1510,52 @@ |
|
4 } |
|
5 #endif /* HAVE_SSL */ |
|
6 |
|
7 +#if defined(HAVE_TSOL) |
|
8 + if (is_system_labeled() != 0) { |
|
9 + ipp_attribute_t *uattr; |
|
10 + uattr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME); |
|
11 + if (uattr) { |
|
12 + /* check for 'nolabels' in request */ |
|
13 + if (ippFindAttribute(con->request, "labels", IPP_TAG_ZERO) != NULL) { |
|
14 + /* check if user is authorized */ |
|
15 + if (chkauthattr("solaris.print.unlabeled", uattr->values[0].string.text) == 0) { |
|
16 + /* |
|
17 + * print request will fail since user |
|
18 + * does not have the required authorization. |
|
19 + */ |
|
20 + cups_audit_print_request_denial(con, NULL, printer, -1, EACCES); |
|
21 + send_http_error(con, HTTP_UNAUTHORIZED, printer); |
|
22 + return (NULL); |
|
23 + } |
|
24 + } |
|
25 + |
|
26 + /* |
|
27 + * check for nobanner. |
|
28 + * '-o job-sheets=none,none' means |
|
29 + * user does not want to print banner and trailer page. |
|
30 + */ |
|
31 + if ((attr = ippFindAttribute(con->request, "job-sheets", |
|
32 + IPP_TAG_ZERO)) != NULL) { |
|
33 + if (strcmp(attr->values[0].string.text, "none") == 0) { |
|
34 + /* |
|
35 + * User wants no banner. |
|
36 + * Check if user is authorized. |
|
37 + */ |
|
38 + if (chkauthattr("solaris.print.nobanner", uattr->values[0].string.text) == 0) { |
|
39 + /* |
|
40 + * print request will fail since user |
|
41 + * does not have the required authorization. |
|
42 + */ |
|
43 + cups_audit_print_request_denial(con, NULL, printer, -1, EACCES); |
|
44 + send_http_error(con, HTTP_UNAUTHORIZED, printer); |
|
45 + return (NULL); |
|
46 + } |
|
47 + } |
|
48 + } |
|
49 + } |
|
50 + } |
|
51 +#endif /* HAVE_TSOL */ |
|
52 + |
|
53 /* |
|
54 * See if the printer is accepting jobs... |
|
55 */ |