author | tomas.jedlicka <tomas.jedlicka@oracle.com> |
Sat, 30 Jun 2012 03:06:16 +0100 | |
branch | s11-sru |
changeset 2300 | 11762b8a16cb |
parent 481 | 9ca5b97b5b08 |
permissions | -rw-r--r-- |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
1 |
Index: Makedefs.in |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
2 |
=================================================================== |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
3 |
--- Makedefs.in (revision 8801) |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
4 |
+++ Makedefs.in (working copy) |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
5 |
@@ -124,7 +124,7 @@ |
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
6 |
BACKLIBS = @BACKLIBS@ |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
7 |
BANNERTOPS = @BANNERTOPS@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
8 |
CFLAGS = @CPPFLAGS@ @CFLAGS@ |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
9 |
COMMONLIBS = @LIBS@ |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
10 |
-CUPSDLIBS = @CUPSDLIBS@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
11 |
+CUPSDLIBS = @CUPSDLIBS@ @LABELING_LIBS@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
12 |
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
13 |
CXXLIBS = @CXXLIBS@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
14 |
DBUS_NOTIFIER = @DBUS_NOTIFIER@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
15 |
Index: config-scripts/cups-labeling.m4 |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
16 |
=================================================================== |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
17 |
--- config-scripts/cups-labeling.m4 (revision 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
18 |
+++ config-scripts/cups-labeling.m4 (revision 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
19 |
@@ -0,0 +1,38 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
20 |
+dnl |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
21 |
+dnl Security Labeled environment support for the Common UNIX Printing System (CUPS). |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
22 |
+dnl |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
23 |
+dnl Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
24 |
+dnl |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
25 |
+dnl This program is free software; you can redistribute it and/or modify |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
26 |
+dnl it under the terms of the GNU General Public License as published by |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
27 |
+dnl the Free Software Foundation; version 2. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
28 |
+dnl |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
29 |
+dnl This program is distributed in the hope that it will be useful, but |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
30 |
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
31 |
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
32 |
+dnl General Public License for more details. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
33 |
+dnl |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
34 |
+dnl You should have received a copy of the GNU General Public License |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
35 |
+dnl along with this program; if not, write to the Free Software Foundation, |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
36 |
+dnl Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
37 |
+dnl |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
38 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
39 |
+AC_ARG_ENABLE(labeling, [ --enable-labeling enable support for labeled environments like Solaris Trusted Extensions and SELinux, default=auto]) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
40 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
41 |
+if test x"$enable_labeling" != xno; then |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
42 |
+ case "$uname" in |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
43 |
+ SunOS) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
44 |
+ AC_CHECK_LIB(tsol, str_to_label, [LABELING_LIBS="-zlazyload -lbsm -ltsol -znolazyload" AC_SUBST(LABELING_LIBS) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
45 |
+ AC_CHECK_HEADER(tsol/label.h) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
46 |
+ AC_DEFINE(HAVE_TSOL)]) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
47 |
+ ;; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
48 |
+ Linux) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
49 |
+ AC_CHECK_LIB(selinux, getpeercon, [LABELING_LIBS="-lselinux" AC_SUBST(LABELING_LIBS) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
50 |
+ AC_CHECK_HEADER(selinux/selinux.h) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
51 |
+ AC_DEFINE(HAVE_SELINUX)]) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
52 |
+ ;; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
53 |
+ *) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
54 |
+ # All others |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
55 |
+ ;; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
56 |
+ esac |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
57 |
+fi |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
58 |
Index: data/Makefile |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
59 |
=================================================================== |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
60 |
--- data/Makefile (revision 8857) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
61 |
+++ data/Makefile (working copy) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
62 |
@@ -22,6 +22,7 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
63 |
BANNERS = \ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
64 |
classified \ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
65 |
confidential \ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
66 |
+ labeled \ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
67 |
secret \ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
68 |
standard \ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
69 |
topsecret \ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
70 |
Index: data/labeled |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
71 |
=================================================================== |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
72 |
--- data/labeled (revision 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
73 |
+++ data/labeled (revision 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
74 |
@@ -0,0 +1,4 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
75 |
+#CUPS-BANNER |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
76 |
+Show job-id job-name job-originating-user-name job-originating-host-name job-billing |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
77 |
+Image images/cups.png |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
78 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
79 |
Index: configure.in |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
80 |
=================================================================== |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
81 |
--- configure.in (revision 8857) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
82 |
+++ configure.in (working copy) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
83 |
@@ -41,6 +41,7 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
84 |
sinclude(config-scripts/cups-pap.m4) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
85 |
sinclude(config-scripts/cups-pdf.m4) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
86 |
sinclude(config-scripts/cups-scripting.m4) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
87 |
+sinclude(config-scripts/cups-labeling.m4) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
88 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
89 |
INSTALL_LANGUAGES="" |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
90 |
UNINSTALL_LANGUAGES="" |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
91 |
Index: config.h.in |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
92 |
=================================================================== |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
93 |
--- config.h.in.orig Thu Aug 12 21:11:46 2010 |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
94 |
+++ config.h.in Tue Aug 16 18:03:17 2011 |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
95 |
@@ -665,7 +665,17 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
96 |
#undef HAVE_SYS_STATVFS_H |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
97 |
#undef HAVE_SYS_VFS_H |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
98 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
99 |
+/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
100 |
+ * Do we have Solaris Trusted Extensions support? |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
101 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
102 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
103 |
+#undef HAVE_TSOL |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
104 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
105 |
+/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
106 |
+ * Do we have SELinux support? |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
107 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
108 |
+#undef HAVE_SELINUX |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
109 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
110 |
#endif /* !_CUPS_CONFIG_H_ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
111 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
112 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
113 |
Index: scheduler/ipp.c |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
114 |
=================================================================== |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
115 |
--- scheduler/ipp.c.orig Thu Oct 7 01:37:44 2010 |
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
116 |
+++ scheduler/ipp.c Tue Aug 16 18:03:17 2011 |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
117 |
@@ -856,7 +856,52 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
118 |
return (0); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
119 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
120 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
121 |
+static int |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
122 |
+compare_labels(char *label1, char *label2) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
123 |
+{ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
124 |
+ int result = 0; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
125 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
126 |
+ if ((label1 != NULL) && (label2 != NULL)) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
127 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
128 |
+#if defined(HAVE_TSOL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
129 |
+ if (is_system_labeled()) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
130 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
131 |
+ result = (strcmp(label1, label2) != 0); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
132 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
133 |
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "compare_labels(%s, %s): %d", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
134 |
+ label1, label2, result); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
135 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
136 |
+#elif defined(HAVE_SELINUX) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
137 |
+#endif /* HAVE_TSOL || HAVE_SELINUX */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
138 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
139 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
140 |
+ return(result); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
141 |
+} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
142 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
143 |
+static char * |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
144 |
+label_to_page_top_bottom_string(char *label) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
145 |
+{ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
146 |
+ char *result = label; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
147 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
148 |
+#if defined(HAVE_TSOL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
149 |
+ if (is_system_labeled()) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
150 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
151 |
+ m_label_t *sl = NULL; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
152 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
153 |
+ if (str_to_label(label, &sl, USER_CLEAR, L_NO_CORRECTION, NULL) == 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
154 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
155 |
+ (void) label_to_str(sl, &result, PRINTER_TOP_BOTTOM, DEF_NAMES); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
156 |
+ if (result == NULL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
157 |
+ result = label; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
158 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
159 |
+ m_label_free(sl); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
160 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
161 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
162 |
+#endif |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
163 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
164 |
+ return (result); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
165 |
+} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
166 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
167 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
168 |
* 'accept_jobs()' - Accept print jobs to a printer. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
169 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
170 |
@@ -1361,6 +1406,17 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
171 |
filetype, filetype ? filetype->super : "none", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
172 |
filetype ? filetype->type : "none"); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
173 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
174 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
175 |
+ * Validate that the label associated with the connection is acceptable for |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
176 |
+ * printing on the printer. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
177 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
178 |
+ if (cupsdInPrinterLabelRange(con->slabel, printer) == 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
179 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
180 |
+ send_ipp_status(con, IPP_NOT_AUTHORIZED, _("label violation.")); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
181 |
+ return (NULL); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
182 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
183 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
184 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
185 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
186 |
* Check remote printing to non-shared printer... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
187 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
188 |
@@ -1620,6 +1676,19 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
189 |
return (NULL); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
190 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
191 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
192 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
193 |
+ * Add the label to the job... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
194 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
195 |
+ if (con->slabel) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
196 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
197 |
+ job->slabel = strdup(con->slabel); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
198 |
+ ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "security-label", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
199 |
+ NULL, job->slabel); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
200 |
+ /* used by filters to add header/footer labels to output */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
201 |
+ ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "page-label", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
202 |
+ NULL, label_to_page_top_bottom_string(job->slabel)); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
203 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
204 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
205 |
job->dtype = printer->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT | |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
206 |
CUPS_PRINTER_REMOTE); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
207 |
job->attrs = con->request; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
208 |
@@ -3761,6 +3830,15 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
209 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
210 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
211 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
212 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
213 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
214 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
215 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
216 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
217 |
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
218 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
219 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
220 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
221 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
222 |
* See if the job has been completed... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
223 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
224 |
@@ -4129,6 +4207,16 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
225 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
226 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
227 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
228 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
229 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
230 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
231 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
232 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
233 |
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
234 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
235 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
236 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
237 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
238 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
239 |
* See if the job is owned by the requesting user... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
240 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
241 |
@@ -6389,6 +6477,16 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
242 |
send_ipp_status(con, IPP_NOT_FOUND, _("Job %d not found!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
243 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
244 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
245 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
246 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
247 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
248 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
249 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
250 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
251 |
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
252 |
+ jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
253 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
254 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
255 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
256 |
else |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
257 |
job = NULL; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
258 |
@@ -6936,6 +7034,15 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
259 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
260 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
261 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
262 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
263 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
264 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
265 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
266 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
267 |
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
268 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
269 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
270 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
271 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
272 |
* Copy attributes... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
273 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
274 |
@@ -7156,6 +7263,14 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
275 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
276 |
cupsdLoadJob(job); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
277 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
278 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
279 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
280 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
281 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
282 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
283 |
+ continue; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
284 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
285 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
286 |
if (!job->attrs) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
287 |
{ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
288 |
cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_jobs: No attributes for job %d!", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
289 |
@@ -8212,6 +8327,15 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
290 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
291 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
292 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
293 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
294 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
295 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
296 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
297 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
298 |
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
299 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
300 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
301 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
302 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
303 |
* See if the job is owned by the requesting user... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
304 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
305 |
@@ -8466,6 +8590,14 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
306 |
_("Job #%d does not exist!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
307 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
308 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
309 |
+ else if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
310 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
311 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
312 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
313 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
314 |
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
315 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
316 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
317 |
else |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
318 |
{ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
319 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
320 |
@@ -8488,6 +8620,27 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
321 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
322 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
323 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
324 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
325 |
+ * Validate that the label associated with the connection is acceptable for |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
326 |
+ * printing on the printer. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
327 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
328 |
+ if (cupsdInPrinterLabelRange(con->slabel, dprinter) == 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
329 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
330 |
+ send_ipp_status(con, IPP_NOT_AUTHORIZED, _("label violation.")); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
331 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
332 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
333 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
334 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
335 |
+ * Validate that the label associated with the job is acceptable for |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
336 |
+ * printing on the printer. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
337 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
338 |
+ if (cupsdInPrinterLabelRange(job->slabel, dprinter) == 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
339 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
340 |
+ send_ipp_status(con, IPP_NOT_AUTHORIZED, _("label violation.")); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
341 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
342 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
343 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
344 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
345 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
346 |
* Now move the job or jobs... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
347 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
348 |
@@ -9318,6 +9471,16 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
349 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
350 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
351 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
352 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
353 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
354 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
355 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
356 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
357 |
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
358 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
359 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
360 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
361 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
362 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
363 |
* See if job is "held"... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
364 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
365 |
@@ -9544,6 +9707,15 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
366 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
367 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
368 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
369 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
370 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
371 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
372 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
373 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
374 |
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
375 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
376 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
377 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
378 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
379 |
* See if job is in any of the "completed" states... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
380 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
381 |
@@ -9899,6 +10071,15 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
382 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
383 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
384 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
385 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
386 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
387 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
388 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
389 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
390 |
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
391 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
392 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
393 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
394 |
printer = cupsdFindDest(job->dest); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
395 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
396 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
397 |
@@ -10488,6 +10669,15 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
398 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
399 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
400 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
401 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
402 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
403 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
404 |
+ * If the labels don't match, we can't tell them about it. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
405 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
406 |
+ send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
407 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
408 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
409 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
410 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
411 |
* See if the job has been completed... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
412 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
413 |
@@ -10825,7 +11015,6 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
414 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
415 |
* Return a list of attributes that can be set via Set-Printer-Attributes. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
416 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
417 |
- |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
418 |
if ((attr = ippFindAttribute(con->request, "printer-location", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
419 |
IPP_TAG_TEXT)) != NULL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
420 |
{ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
421 |
@@ -11584,6 +11773,11 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
422 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
423 |
strlcpy(username, get_username(con), userlen); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
424 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
425 |
+ if (compare_labels(con->slabel, job->slabel) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
426 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
427 |
+ return (0); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
428 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
429 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
430 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
431 |
* Check the username against the owner... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
432 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
433 |
Index: scheduler/printers.c |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
434 |
=================================================================== |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
435 |
--- scheduler/printers.c.orig Thu Sep 23 00:05:07 2010 |
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
436 |
+++ scheduler/printers.c Tue Aug 16 18:03:34 2011 |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
437 |
@@ -1011,7 +1011,93 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
438 |
p->users = NULL; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
439 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
440 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
441 |
+#if defined(HAVE_TSOL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
442 |
+static char * |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
443 |
+log_tsol_str_to_label_error(char *s, int e) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
444 |
+{ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
445 |
+ char *mesg = strerror(errno); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
446 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
447 |
+ if (errno == EINVAL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
448 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
449 |
+ switch (e) { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
450 |
+ case M_BAD_STRING: |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
451 |
+ mesg = "bad string"; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
452 |
+ break; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
453 |
+ case M_BAD_LABEL: |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
454 |
+ mesg = "bad label"; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
455 |
+ break; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
456 |
+ case M_OUTSIDE_AR: |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
457 |
+ mesg = "outside DIA Accreditation Range"; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
458 |
+ break; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
459 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
460 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
461 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
462 |
+ return (mesg); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
463 |
+} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
464 |
+#endif /* HAVE_TSOL */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
465 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
466 |
+/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
467 |
+ * 'cupsdInPrinterLabelRange()' - validate that the supplied slabel is in the |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
468 |
+ * label range of the supplied printer. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
469 |
+ * 0 - failure, 1 - success |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
470 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
471 |
+int |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
472 |
+cupsdInPrinterLabelRange(char *slabel, cupsd_printer_t *p) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
473 |
+{ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
474 |
+ /* unlabeled client objects are always in range. */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
475 |
+ if (slabel == NULL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
476 |
+ return (1); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
477 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
478 |
+ if (p == NULL) /* this should never happen */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
479 |
+ return (0); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
480 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
481 |
+#if defined(HAVE_TSOL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
482 |
+ if (is_system_labeled()) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
483 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
484 |
+ int in_range = 0; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
485 |
+ int err = 0; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
486 |
+ m_range_t *range; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
487 |
+ m_label_t *sl = NULL; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
488 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
489 |
+ if (p->device_uri == 0) /* this should never happen */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
490 |
+ return (0); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
491 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
492 |
+ if (str_to_label(slabel, &sl, USER_CLEAR, L_NO_CORRECTION, &err) < 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
493 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
494 |
+ cupsdLogMessage(CUPSD_LOG_ERROR, "str_to_label(%s): %s", slabel, |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
495 |
+ log_tsol_str_to_label_error(slabel, err)); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
496 |
+ return (0); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
497 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
498 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
499 |
+ if ((range = getdevicerange((const char *)(p->device_uri))) == NULL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
500 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
501 |
+ cupsdLogMessage(CUPSD_LOG_ERROR, |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
502 |
+ "cupsdInPrinterLabelRange(%s, %s): getdevicerange(%s): %s", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
503 |
+ slabel, p->name, p->device_uri, strerror(errno)); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
504 |
+ m_label_free(sl); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
505 |
+ return (0); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
506 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
507 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
508 |
+ /* is the client supplied object label is within the printer label range? */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
509 |
+ in_range = blinrange(sl, range); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
510 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
511 |
+ cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdInPrinterLabelRange(%s, %s): %d", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
512 |
+ slabel, p->name, in_range); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
513 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
514 |
+ m_label_free(sl); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
515 |
+ m_label_free(range->lower_bound); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
516 |
+ m_label_free(range->upper_bound); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
517 |
+ free(range); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
518 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
519 |
+ return (in_range); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
520 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
521 |
+#elif defined(HAVE_SELINUX) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
522 |
+#endif /* HAVE_TSOL || HAVE_SELINUX */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
523 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
524 |
+ /* we should probably never get here */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
525 |
+ return (0); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
526 |
+} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
527 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
528 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
529 |
* 'cupsdLoadAllPrinters()' - Load printers from the printers.conf file. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
530 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
531 |
Index: scheduler/job.c |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
532 |
=================================================================== |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
533 |
|
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
534 |
--- scheduler/job.c.orig Sun Oct 17 09:43:56 2010 |
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
535 |
+++ scheduler/job.c Tue Aug 16 18:03:43 2011 |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
536 |
@@ -911,8 +911,14 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
537 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
538 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
539 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
540 |
- if (Classification && !banner_page) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
541 |
+ if (job->slabel != NULL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
542 |
{ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
543 |
+ snprintf(classification, sizeof(classification), "CLASSIFICATION=%s", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
544 |
+ job->slabel); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
545 |
+ envp[envc ++] = classification; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
546 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
547 |
+ else if (Classification && !banner_page) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
548 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
549 |
if ((attr = ippFindAttribute(job->attrs, "job-sheets", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
550 |
IPP_TAG_NAME)) == NULL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
551 |
snprintf(classification, sizeof(classification), "CLASSIFICATION=%s", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
552 |
@@ -1276,6 +1282,12 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
553 |
job->num_files = 0; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
554 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
555 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
556 |
+ if (job->slabel) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
557 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
558 |
+ free(job->slabel); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
559 |
+ job->slabel = NULL; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
560 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
561 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
562 |
if (job->history) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
563 |
free_job_history(job); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
564 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
565 |
@@ -1562,6 +1574,10 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
566 |
goto error; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
567 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
568 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
569 |
+ if ((attr = ippFindAttribute(job->attrs, "security-label", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
570 |
+ IPP_TAG_NAME)) != NULL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
571 |
+ cupsdSetString(&job->slabel, attr->values[0].string.text); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
572 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
573 |
job->sheets = ippFindAttribute(job->attrs, "job-media-sheets-completed", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
574 |
IPP_TAG_INTEGER); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
575 |
job->job_sheets = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_NAME); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
576 |
@@ -3977,6 +3993,18 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
577 |
if (!cupsdLoadJob(job)) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
578 |
return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
579 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
580 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
581 |
+ * Verify that the job sensitivity label is in range of the printer. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
582 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
583 |
+ if (cupsdInPrinterLabelRange(job->slabel, printer) == 0) { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
584 |
+ cupsdLogMessage(CUPSD_LOG_ERROR, |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
585 |
+ "start_job(): job label outside of printer label range"); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
586 |
+ cupsdSetJobState(job, IPP_JOB_CANCELED, CUPSD_JOB_DEFAULT, |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
587 |
+ "job label is outside of printer label range"); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
588 |
+ cupsdCheckJobs(); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
589 |
+ return; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
590 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
591 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
592 |
cupsdSetJobState(job, IPP_JOB_PROCESSING, CUPSD_JOB_DEFAULT, NULL); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
593 |
cupsdSetPrinterState(printer, IPP_PRINTER_PROCESSING, 0); |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
594 |
|
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
595 |
Index: scheduler/printers.h |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
596 |
=================================================================== |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
597 |
--- scheduler/printers.h.orig Wed Mar 31 03:37:33 2010 |
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
598 |
+++ scheduler/printers.h Tue Aug 16 18:03:51 2011 |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
599 |
@@ -151,6 +151,8 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
600 |
const char *username); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
601 |
extern void cupsdFreePrinterUsers(cupsd_printer_t *p); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
602 |
extern void cupsdFreeQuotas(cupsd_printer_t *p); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
603 |
+extern int cupsdInPrinterLabelRange(char *slabel, |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
604 |
+ cupsd_printer_t *p); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
605 |
extern void cupsdLoadAllPrinters(void); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
606 |
extern void cupsdRenamePrinter(cupsd_printer_t *p, |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
607 |
const char *name); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
608 |
Index: scheduler/job.h |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
609 |
=================================================================== |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
610 |
--- scheduler/job.h (revision 8857) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
611 |
+++ scheduler/job.h (working copy) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
612 |
@@ -83,6 +83,8 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
613 |
krb5_ccache ccache; /* Kerberos credential cache */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
614 |
char *ccname; /* KRB5CCNAME environment variable */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
615 |
#endif /* HAVE_GSSAPI */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
616 |
+ char *slabel; /* security context for security |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
617 |
+ labeled environments */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
618 |
}; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
619 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
620 |
typedef struct cupsd_joblog_s /**** Job log message ****/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
621 |
Index: scheduler/client.c |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
622 |
=================================================================== |
481
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
623 |
--- scheduler/client.c.orig Sun Oct 17 09:43:56 2010 |
9ca5b97b5b08
PSARC/2011/084 LP print service EOF
sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM>
parents:
220
diff
changeset
|
624 |
+++ scheduler/client.c Tue Aug 16 18:04:07 2011 |
220
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
625 |
@@ -90,7 +90,12 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
626 |
# include <tcpd.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
627 |
#endif /* HAVE_TCPD_H */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
628 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
629 |
+#ifdef HAVE_TSOL |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
630 |
+#include <ucred.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
631 |
+#include <tsol/label.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
632 |
+#endif /* HAVE_TSOL */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
633 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
634 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
635 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
636 |
* Local functions... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
637 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
638 |
@@ -123,7 +128,40 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
639 |
struct stat *filestats); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
640 |
static void write_pipe(cupsd_client_t *con); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
641 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
642 |
+#ifdef HAVE_TSOL |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
643 |
+/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
644 |
+ * Retrieve the sensitivity label from the peer connection. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
645 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
646 |
+static int |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
647 |
+getpeerseclabel(int fd, char **label) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
648 |
+{ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
649 |
+ if ((fd < 0) || (label == NULL)) { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
650 |
+ errno = EINVAL; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
651 |
+ return (-1); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
652 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
653 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
654 |
+ *label = NULL; /* default to unlabeled */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
655 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
656 |
+ if (is_system_labeled()) { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
657 |
+ ucred_t *cred = NULL; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
658 |
+ m_label_t *slabel; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
659 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
660 |
+ if (getpeerucred(fd, &cred) == -1) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
661 |
+ return (-1); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
662 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
663 |
+ slabel = ucred_getlabel(cred); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
664 |
+ *label = NULL; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
665 |
+ if (label_to_str(slabel, label, M_INTERNAL, DEF_NAMES) != 0) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
666 |
+ cupsdLogMessage(CUPSD_LOG_ERROR, "getpeercon(%d, 0x%8.8x): %s", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
667 |
+ fd, (int)label, strerror(errno)); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
668 |
+ ucred_free(cred); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
669 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
670 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
671 |
+ return (0); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
672 |
+} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
673 |
+#endif /* HAVE_TSOL */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
674 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
675 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
676 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
677 |
* 'cupsdAcceptClient()' - Accept a new client. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
678 |
*/ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
679 |
@@ -391,6 +429,21 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
680 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
681 |
#endif /* HAVE_TCPD_H */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
682 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
683 |
+#if defined(HAVE_TSOL) || defined(HAVE_SELINUX) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
684 |
+ /* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
685 |
+ * Get the sensitivity label from the peer connection. |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
686 |
+ */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
687 |
+ if (getpeerseclabel(con->http.fd, &con->slabel)) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
688 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
689 |
+ cupsdLogMessage(CUPSD_LOG_ERROR, |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
690 |
+ "cupsdAcceptClient: failed to retrieve label from peer: %s", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
691 |
+ con->http.hostname); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
692 |
+ con->slabel = NULL; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
693 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
694 |
+ else |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
695 |
+ cupsdLogMessage(CUPSD_LOG_INFO, "cupsdAcceptClient: label=%s", con->slabel); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
696 |
+#endif /* HAVE_TSOL || HAVE_SELINUX */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
697 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
698 |
#ifdef AF_INET6 |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
699 |
if (con->http.hostaddr->addr.sa_family == AF_INET6) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
700 |
cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdAcceptClient: %d from %s:%d (IPv6)", |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
701 |
@@ -680,6 +733,12 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
702 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
703 |
} |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
704 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
705 |
+ if (con->slabel != NULL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
706 |
+ { |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
707 |
+ free(con->slabel); |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
708 |
+ con->slabel = NULL; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
709 |
+ } |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
710 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
711 |
if (!partial) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
712 |
{ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
713 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
714 |
Index: scheduler/client.h |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
715 |
=================================================================== |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
716 |
--- scheduler/client.h (revision 8857) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
717 |
+++ scheduler/client.h (working copy) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
718 |
@@ -64,6 +64,8 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
719 |
#ifdef HAVE_AUTHORIZATION_H |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
720 |
AuthorizationRef authref; /* Authorization ref */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
721 |
#endif /* HAVE_AUTHORIZATION_H */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
722 |
+ char *slabel; /* security context for security |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
723 |
+ labeled environments */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
724 |
}; |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
725 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
726 |
#define HTTP(con) &((con)->http) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
727 |
Index: scheduler/cupsd.h |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
728 |
=================================================================== |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
729 |
--- scheduler/cupsd.h (revision 8857) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
730 |
+++ scheduler/cupsd.h (working copy) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
731 |
@@ -50,7 +50,19 @@ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
732 |
# include <CoreFoundation/CoreFoundation.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
733 |
#endif /* HAVE_CDSASSL */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
734 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
735 |
+#if defined(HAVE_TSOL) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
736 |
+#include <tsol/label.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
737 |
+#endif /* HAVE_TSOL */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
738 |
|
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
739 |
+#if defined(HAVE_SELINUX) |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
740 |
+#include <selinux/selinux.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
741 |
+#include <selinux/context.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
742 |
+#include <selinux/avc.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
743 |
+#include <selinux/flask.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
744 |
+#include <selinux/av_permissions.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
745 |
+#include <selinux/get_context_list.h> |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
746 |
+#endif /* HAVE_SELINUX */ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
747 |
+ |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
748 |
/* |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
749 |
* Some OS's don't have hstrerror(), most notably Solaris... |
3ff562b51ff5
7040638 CUPS (Common Unix Printing System) should move to Userland.
Jiri Sasek <Jiri.Sasek@Sun.COM>
parents:
diff
changeset
|
750 |
*/ |