Comparar commits
655 Commits
v2.2b1
...
branch-2.2
| Autor | SHA1 | Data | |
|---|---|---|---|
| 0ad6ac55da | |||
| 339d33b8e6 | |||
| e93ab4a004 | |||
| 8c9b3606cc | |||
| 25a9f95813 | |||
| 197bfe6ab4 | |||
| 619af39389 | |||
| 457d534a9c | |||
| b796104425 | |||
| 9645531eeb | |||
| b1bc79753d | |||
| 72288f3069 | |||
| 891e14ed26 | |||
| f5e07479b2 | |||
| 6946292516 | |||
| 40a54a37ae | |||
| 81d39a9fd3 | |||
| 250c2783c0 | |||
| affc6e3ba6 | |||
| c8cb6400e3 | |||
| f24e6cf6a3 | |||
| ad312a0c66 | |||
| e1eb4a8495 | |||
| 04fef0e213 | |||
| 86cf8118f7 | |||
| 2f26c6b713 | |||
| d11af547d1 | |||
| b4909ef014 | |||
| 2062d366ea | |||
| c507739347 | |||
| 666d07699b | |||
| c1a310ffdc | |||
| 3676fc318a | |||
| 669659ca88 | |||
| 9b48d16c1d | |||
| c5b991fdaa | |||
| fd8245cd01 | |||
| 35e927f835 | |||
| a0096a2f73 | |||
| 6235f36a95 | |||
| 971bdfe043 | |||
| 9d6f1bb6c6 | |||
| d76e57f8c6 | |||
| a2eba04317 | |||
| c1b133728b | |||
| 8829edfef0 | |||
| 0ad7895cff | |||
| aaebca5660 | |||
| ee5419f6df | |||
| 803b6de89a | |||
| 35064a2596 | |||
| e4a0aa86c9 | |||
| ba9d68cc74 | |||
| 488ec102c1 | |||
| c7b37f21eb | |||
| 88c131a16f | |||
| 74dece9c5a | |||
| 17675b0d73 | |||
| 816b3bfd42 | |||
| 1178267306 | |||
| 469b6abcd8 | |||
| 606cfe8cb9 | |||
| 4c94126876 | |||
| 3a66aedf8a | |||
| 534af3a30b | |||
| f7d8c89ecc | |||
| 9f6cee7e3f | |||
| bafbb263f8 | |||
| 019198b76b | |||
| 324a11611a | |||
| 949c21788d | |||
| b1648391cb | |||
| ddcb034a2b | |||
| 6844678902 | |||
| 558bba72fe | |||
| 6cf21c3b87 | |||
| 328d863971 | |||
| 907afa29b7 | |||
| f3693bb315 | |||
| bad9fef486 | |||
| 21cbc2f292 | |||
| 18518f3b94 | |||
| ddaef0f518 | |||
| b7724e9966 | |||
| f7d4caccaf | |||
| 25b2338346 | |||
| feb4c62b21 | |||
| 4fb44b2706 | |||
| d3cfe06529 | |||
| 3e4dd41459 | |||
| ca1f57fc58 | |||
| 944861cf8d | |||
| 6b9ee66fb8 | |||
| 450310bd95 | |||
| 130c5f657c | |||
| 56865cac81 | |||
| aac72ea4ea | |||
| 6d9935446a | |||
| fe35d60e69 | |||
| 54499f6e1c | |||
| e3bf09e5ab | |||
| 2bc91b0fde | |||
| 9dd00ac572 | |||
| 2c48abc6c8 | |||
| e7e33bf642 | |||
| 37665f15b9 | |||
| 3cc99f971d | |||
| bd93b0f997 | |||
| abfac4cc2c | |||
| 69d30da202 | |||
| 0313a59eaa | |||
| ceaf5639b6 | |||
| bef1d6257e | |||
| 3451d5e03c | |||
| 1c37b4f842 | |||
| b5283eea53 | |||
| 3c8cc0956c | |||
| fe1fac1444 | |||
| b485551a77 | |||
| 1110512341 | |||
| 598bfaad43 | |||
| 49639d132d | |||
| f02e6549b7 | |||
| 0ae115b3c8 | |||
| 0945b205af | |||
| 7f68222311 | |||
| 56ee8bc2c7 | |||
| 7882a850af | |||
| 215b547e0f | |||
| 655237ebfa | |||
| 1a3ff20f73 | |||
| ace9aea063 | |||
| b42427212d | |||
| 9e7efee57b | |||
| b7297655b6 | |||
| 918d2b0748 | |||
| aca718a423 | |||
| d21d96219e | |||
| 436a2c7363 | |||
| 7b94c45550 | |||
| a83658fac5 | |||
| 4aa44fb14d | |||
| 7927b44a2e | |||
| ae9f0b239f | |||
| dfe5192691 | |||
| 2b4e4ed7d8 | |||
| 0dd6c36be9 | |||
| db837b4742 | |||
| b74abe7ec1 | |||
| 24a5ffa61b | |||
| 05bb584270 | |||
| 91f20f1695 | |||
| 18545a5e7a | |||
| c7dee40123 | |||
| b0dcb3094c | |||
| 8268b593b0 | |||
| ca0eb73820 | |||
| 4ebeb20c50 | |||
| 26e33331ce | |||
| 2e913c4b4e | |||
| b764f49b0c | |||
| 6ff5bbedb9 | |||
| ff52b652cf | |||
| fc19457093 | |||
| 2dbebbaa23 | |||
| 97cb566568 | |||
| 7c7f431a26 | |||
| 22716a21f7 | |||
| 3f8d6023ed | |||
| 4c975abbc7 | |||
| d66aa76457 | |||
| 4c37eb9f77 | |||
| 66021bfa90 | |||
| d3cc15d4b2 | |||
| f58657f987 | |||
| 8c2150d186 | |||
| 5c7df4f0e0 | |||
| 9135aedbb4 | |||
| 90a97dd7b6 | |||
| 417d0e1635 | |||
| 4440da10e5 | |||
| 4b55f9f3c1 | |||
| bb10adda6f | |||
| 2390f1d9eb | |||
| b643d6ba92 | |||
| 1f679daf00 | |||
| 0612a04d5d | |||
| f6d93318e0 | |||
| 821b3cc956 | |||
| b757529b6f | |||
| 566d5c707e | |||
| a922c92cd0 | |||
| aefefc3539 | |||
| 0e41e1ca5d | |||
| d2e90eb7c7 | |||
| 570933a6a3 | |||
| 84c97c051d | |||
| 5f67be43fa | |||
| b59756883a | |||
| 6daeebb5ac | |||
| 2bad6aac2f | |||
| 9d72065fa9 | |||
| 75d3f11945 | |||
| 6bebebe247 | |||
| 1d598e87db | |||
| 3645e5efa7 | |||
| e8953be355 | |||
| 782bcf6974 | |||
| 3d7ece43ea | |||
| 290404655f | |||
| c59948f6fb | |||
| b237ae81d2 | |||
| 82c4785a4c | |||
| 9113651bca | |||
| 3034dcc946 | |||
| 2aee052bf5 | |||
| 8e47ac0199 | |||
| 30c8d1abb2 | |||
| 5e18690298 | |||
| bec850697a | |||
| 4ffdbc48d8 | |||
| accd26d222 | |||
| 08b48df256 | |||
| bb4172dade | |||
| afe94dff9d | |||
| 1f71721001 | |||
| 18a1649286 | |||
| 58c3683023 | |||
| 303be29243 | |||
| 275af5ac7b | |||
| d821d89415 | |||
| 6579c998c4 | |||
| 1377fb858c | |||
| f9ee3b81e1 | |||
| 7e50a735a8 | |||
| 56b62a3b54 | |||
| 02773ede84 | |||
| ec9996719f | |||
| affaf0737f | |||
| 49fa4983f2 | |||
| 34be0e8038 | |||
| ce0d9679a4 | |||
| fad821594f | |||
| f8913c6d2c | |||
| a75c0e5961 | |||
| 5ee613bbc6 | |||
| 02c88e673e | |||
| 46a7b416ee | |||
| c61b78bd84 | |||
| 0ae5b012b2 | |||
| 15bba96c30 | |||
| bea3713442 | |||
| 5639a7b41c | |||
| 360e815a88 | |||
| c00282bb43 | |||
| 3a16bd9c9d | |||
| a7cdcd19b8 | |||
| 79424d8b9a | |||
| 5889fea75a | |||
| 16389be3ba | |||
| f97678f279 | |||
| 979804902c | |||
| b889560c05 | |||
| c9e9d0e810 | |||
| a5dd746bd0 | |||
| 6b33281c3e | |||
| 9554d4e748 | |||
| c0a47c1101 | |||
| 4cf66fef48 | |||
| b17b635a37 | |||
| 5d8b7d2665 | |||
| e4e371946b | |||
| 46d22fe908 | |||
| 9d4ae311cb | |||
| 2cf3a36a4e | |||
| fd2f0a7af7 | |||
| aa2a77dec8 | |||
| f0f4e0366c | |||
| 4279822fe4 | |||
| c6990c1ed5 | |||
| c31737b031 | |||
| 2d947886ad | |||
| 116c301f23 | |||
| b908d72cac | |||
| 2cb1fda9fe | |||
| 0728c89bcf | |||
| 123cfe0202 | |||
| d2123aee55 | |||
| ea4dcf9ff4 | |||
| b39dd420c6 | |||
| 5614f45d77 | |||
| 5229ea1a41 | |||
| b72c5bf2ed | |||
| befbadcef6 | |||
| 7b0a28e38f | |||
| e78c14f7ea | |||
| e146105294 | |||
| e37405ea8e | |||
| 5535551fd9 | |||
| 7f14a29798 | |||
| 4b16c717e5 | |||
| 240a27f93b | |||
| 75e1a17cad | |||
| 40cc612af4 | |||
| 9449dd948a | |||
| 2793a478d0 | |||
| 5b6caf71b8 | |||
| b10aebb1d3 | |||
| 9964a31a77 | |||
| 7c7347a346 | |||
| b337f966e8 | |||
| e9b2d701da | |||
| 91d748b919 | |||
| fa76bc3dc0 | |||
| 4f272af7bb | |||
| b770b18d0f | |||
| b0a1b229b3 | |||
| 997db40489 | |||
| 07911378c0 | |||
| 345e10ca71 | |||
| 41c0a57318 | |||
| 10f9350b7e | |||
| 03bc3ef4c2 | |||
| 7e7a13a32e | |||
| 60716f946c | |||
| e34d348250 | |||
| ada3421240 | |||
| a2a13afb48 | |||
| 259b03bc46 | |||
| a375587b8c | |||
| 0bc1a539f4 | |||
| 86390cbf57 | |||
| ced9dda826 | |||
| e9faaeef18 | |||
| c9dbe83d17 | |||
| e3b9d1f520 | |||
| 9f573d7be9 | |||
| 5cc8588e8c | |||
| f198f7e1e7 | |||
| 5e59cd062f | |||
| bee711586d | |||
| e7729c5a14 | |||
| 9eb416ee89 | |||
| b74b285e47 | |||
| 48dfd9a9a2 | |||
| 4174429905 | |||
| 13be9452da | |||
| a9357c9da4 | |||
| 44b3f16133 | |||
| c536b6c583 | |||
| 03d3907a33 | |||
| 76ae98d657 | |||
| 6d086e08e4 | |||
| 49f495c32e | |||
| f8a5ad9bde | |||
| 07cb72471a | |||
| b94f7488e8 | |||
| d2d605ff77 | |||
| 6eda776e8a | |||
| a621d151e7 | |||
| 3a1e6b10c5 | |||
| 7a0e5acde2 | |||
| c5755caf42 | |||
| e44bdfe7e3 | |||
| b2f85109da | |||
| fb963b8dd1 | |||
| fdc80a913f | |||
| 1a9743f9d7 | |||
| 534dfe8e94 | |||
| f1175a5a9d | |||
| db5424ea51 | |||
| cac6b6562c | |||
| b67c2dd202 | |||
| b3f6f8d202 | |||
| 4fac83763d | |||
| 2650d637dc | |||
| 070e33a4c9 | |||
| 1da024d1a7 | |||
| 6ad44eebc7 | |||
| 89c924d590 | |||
| e38ab40b22 | |||
| f2e8714723 | |||
| 8d7d268f61 | |||
| ca9e55c9b5 | |||
| b0fb2d75d3 | |||
| c9a0ff6208 | |||
| 296cd66b68 | |||
| 90c67342b6 | |||
| 956bb1274c | |||
| ae7225e576 | |||
| c838ec5a3b | |||
| 6df8f83339 | |||
| 76b7b95c9e | |||
| 058582b4b5 | |||
| 5c476bf970 | |||
| ef338d0c83 | |||
| 12b798a070 | |||
| 49b6c6af76 | |||
| de4966cb9b | |||
| 7f500d8988 | |||
| f34c1c99cd | |||
| 64447b5696 | |||
| 4466c8ca87 | |||
| 134d057955 | |||
| 827bf9ce2d | |||
| 3a6962171c | |||
| d4a895f856 | |||
| 75105fbdfb | |||
| d2f1a784c4 | |||
| 62825d3445 | |||
| a537431a13 | |||
| 35fc224370 | |||
| 2a75f21b6a | |||
| ac032efa3e | |||
| 08566de251 | |||
| f1dd3a3976 | |||
| 96a5df6235 | |||
| 65bebeac76 | |||
| 5cb94b289a | |||
| 98d88c8d47 | |||
| 0668b48c10 | |||
| 718ee2fff3 | |||
| 500fca270a | |||
| e1ba078bdc | |||
| 78ac829c63 | |||
| ceea93e3d8 | |||
| c907de064d | |||
| 30afb232cd | |||
| 0ebee56929 | |||
| 9a4e273486 | |||
| 163a773e5b | |||
| 7c4b136b4f | |||
| bb719eb39a | |||
| 53af7f2160 | |||
| f50db552c5 | |||
| 4cfbd5f897 | |||
| fe4e5d67c5 | |||
| 82c719981b | |||
| 4a36625117 | |||
| 9022d60bbd | |||
| f8d0ab6d14 | |||
| 4b17d76f2a | |||
| e1bb4a6e98 | |||
| 167e0655b7 | |||
| 42deee7eaf | |||
| b497414286 | |||
| 7536de1a4a | |||
| d2817c9f02 | |||
| 143286bced | |||
| 95633d6282 | |||
| 2a20b51245 | |||
| 0d7cb94a77 | |||
| 9c44e2cb72 | |||
| e1c797efc7 | |||
| 869c206051 | |||
| 798d6e2934 | |||
| ac3015ba1a | |||
| 105922ec6d | |||
| 442e03eff1 | |||
| efa72f6100 | |||
| 3fae3b337d | |||
| 657c5b5f91 | |||
| a2187a6342 | |||
| 57543d87b6 | |||
| abacc52be4 | |||
| 17acb46909 | |||
| cceb9291b0 | |||
| 1f3f503a2b | |||
| 875ef65a9e | |||
| 845913bd5d | |||
| 87f340512c | |||
| dc8364753b | |||
| 0b1399a2c1 | |||
| afd25c346a | |||
| 1636510491 | |||
| 5423798c61 | |||
| a740a8491b | |||
| 16b0b41131 | |||
| 4886d6747e | |||
| 42dc144c44 | |||
| a946858f0c | |||
| 3ae6282d0e | |||
| 3b6c3c8e9d | |||
| 40c808603a | |||
| 84e3828d7d | |||
| 30be6424f0 | |||
| 1fbd0cabfb | |||
| 9c0c89124b | |||
| 4888dff95c | |||
| b393bc25e2 | |||
| 45eb1e5efc | |||
| 8a984948f3 | |||
| 87e9bb5508 | |||
| 68d5f6b8a4 | |||
| 83bf1f7b59 | |||
| 887fbb5445 | |||
| c245abfeb8 | |||
| e8a1fa03d0 | |||
| 14fdcd7a14 | |||
| 454708a4b9 | |||
| 905010801a | |||
| fc1fb7e4eb | |||
| 2b7e87a33c | |||
| feb7c00ab5 | |||
| f02c7d66b6 | |||
| 37a8aac243 | |||
| 3f7aa00618 | |||
| f9b1f57c71 | |||
| 316c332fa0 | |||
| ed6f435e1c | |||
| 1cd31069e2 | |||
| a401c2733a | |||
| 2e69b2483e | |||
| bd5a2f28fc | |||
| 2fb75ad2a7 | |||
| 57b7b66b58 | |||
| da18a4b093 | |||
| de19d5ceeb | |||
| 3c39fd6db8 | |||
| a2f30a72f7 | |||
| 3942a9c815 | |||
| 884b7ed153 | |||
| 149eecf6ef | |||
| b9121a022d | |||
| 97374a7259 | |||
| 1999164de0 | |||
| afa80cb2b4 | |||
| 7852449fe2 | |||
| 3980a9c100 | |||
| 10887d272a | |||
| 07428f6a64 | |||
| 1add233756 | |||
| 7fad1ee92c | |||
| 073e58a9fb | |||
| 49c5929363 | |||
| 61b7ebde7c | |||
| 5dcbe84df8 | |||
| 27a5af3ec8 | |||
| 98f204f442 | |||
| 3be8e02692 | |||
| bd31658d04 | |||
| 5048d3ba8d | |||
| cd3a03682f | |||
| f5cffc18d1 | |||
| 0fa88e19c4 | |||
| d4259b45a4 | |||
| 22ae2896dd | |||
| a268a6c985 | |||
| fa857b2058 | |||
| 29500e14c7 | |||
| 47eb8d30ac | |||
| 23862bc625 | |||
| 670172eae1 | |||
| 64683d9769 | |||
| 05fa7028da | |||
| dffb0ea882 | |||
| 2a8afc201c | |||
| 437b31cabe | |||
| ba361bcd36 | |||
| 8b3724f85f | |||
| 26fc28a21a | |||
| c7505715ca | |||
| 3af27fc59e | |||
| 250bb8a9d6 | |||
| c6a9dc36b7 | |||
| b0a1368dc2 | |||
| ed7af823cb | |||
| 95e00ac365 | |||
| f261df73b5 | |||
| a7b8e4cab4 | |||
| a6580b70a3 | |||
| 9e754f4bad | |||
| a624133944 | |||
| 5babee86cb | |||
| 880facb6d7 | |||
| a3ed22ee48 | |||
| 7a1e526688 | |||
| 2c56466851 | |||
| cd3cce09ff | |||
| b7c2fb9237 | |||
| d5badecd7f | |||
| 83afb9612c | |||
| b2e0131860 | |||
| 08ddb22c64 | |||
| 29723fffa5 | |||
| adffc54541 | |||
| 79c4c4add6 | |||
| 21d8d62bdb | |||
| d9b21b6336 | |||
| 1515fed2bf | |||
| 012c38428b | |||
| fdc3c81a67 | |||
| f093225bc4 | |||
| 04964cdd4d | |||
| 7b98e44eef | |||
| 22867df4e7 | |||
| 0ca77b3e89 | |||
| 523f6bd9ad | |||
| 4454992303 | |||
| 7a455fccaa | |||
| 6ccb19f35d | |||
| bb6ea21b41 | |||
| 0ebe8e7c41 | |||
| efed05629f | |||
| a54ac5353d | |||
| 7de5b8df7c | |||
| e8916f41d8 | |||
| f8e196812c | |||
| 4daf7e97e6 | |||
| 59e9781df8 | |||
| fe33927d75 | |||
| 6720d4f40f | |||
| 4c3f8a9b89 | |||
| a34680b295 | |||
| 7aeb36153a | |||
| e5aa186c43 | |||
| c1bd5ac440 | |||
| e06e4eb5f3 | |||
| 3ebcafd1ec | |||
| 6e1bb6ef2e | |||
| 26598dbacc | |||
| aa747d186f | |||
| 21aa3f379f | |||
| 488449f04c | |||
| d84348da11 | |||
| 3db0754003 | |||
| 4a971b9142 | |||
| 5c7cfc77cd | |||
| 0de71d3615 | |||
| 5ff02b0da2 | |||
| 26b2bef2a8 | |||
| f0b589f768 | |||
| 837dc15e51 | |||
| bfbcda7ec1 | |||
| 5004c05666 | |||
| c3355394bf | |||
| 0cb0ff0535 | |||
| 9880f818cf | |||
| 0f2f21af96 | |||
| 45b043725a | |||
| 8e03cb2b01 | |||
| 08d027c3b6 | |||
| f689a8a955 | |||
| 34e36d9102 | |||
| 0b64fc4599 | |||
| 1166bf5866 | |||
| 6ee5217845 | |||
| d48749331d | |||
| b2e6c32580 | |||
| 8072030b3c | |||
| 9e5e2ceff5 | |||
| c4412c12a7 | |||
| 441de8b2e0 | |||
| 26c14fa6e1 | |||
| c187d9abe7 |
+25
-7
@@ -1,12 +1,7 @@
|
||||
*.a
|
||||
*.bck
|
||||
*.cgi
|
||||
*.dylib
|
||||
*.gz
|
||||
*.o
|
||||
*.so
|
||||
*.so.*
|
||||
*.tokens
|
||||
.buildrev
|
||||
autom4te.cache
|
||||
config.h
|
||||
@@ -29,6 +24,11 @@ berkeley/lpc
|
||||
berkeley/lpq
|
||||
berkeley/lpr
|
||||
berkeley/lprm
|
||||
cgi-bin/admin.cgi
|
||||
cgi-bin/classes.cgi
|
||||
cgi-bin/help.cgi
|
||||
cgi-bin/jobs.cgi
|
||||
cgi-bin/printers.cgi
|
||||
cgi-bin/testcgi
|
||||
cgi-bin/testhi
|
||||
cgi-bin/testhi.index
|
||||
@@ -38,15 +38,21 @@ conf/cupsd.conf
|
||||
conf/mime.convs
|
||||
conf/pam.std
|
||||
conf/snmp.conf
|
||||
cups/libcups.2.dylib
|
||||
cups/libcups.dylib
|
||||
cups/libcups.so
|
||||
cups/libcups.so.2
|
||||
cups/locale/
|
||||
cups/test.pwg
|
||||
cups/testadmin
|
||||
cups/testarray
|
||||
cups/testcache
|
||||
cups/testconflicts
|
||||
cups/testcreds
|
||||
cups/testcups
|
||||
cups/testdest
|
||||
cups/testfile
|
||||
cups/testgetdests
|
||||
cups/testhttp
|
||||
cups/testi18n
|
||||
cups/testipp
|
||||
@@ -58,8 +64,13 @@ cups/testsnmp
|
||||
cups/tlscheck
|
||||
desktop/cups.desktop
|
||||
doc/index.html
|
||||
doc/*/index.html
|
||||
filter/commandtops
|
||||
filter/gziptoany
|
||||
filter/libcupsimage.2.dylib
|
||||
filter/libcupsimage.dylib
|
||||
filter/libcupsimage.so
|
||||
filter/libcupsimage.so.2
|
||||
filter/pstops
|
||||
filter/rasterbench
|
||||
filter/rastertoepson
|
||||
@@ -67,6 +78,7 @@ filter/rastertohp
|
||||
filter/rastertolabel
|
||||
filter/rastertopwg
|
||||
filter/test.raster
|
||||
filter/testclient
|
||||
filter/testraster
|
||||
locale/checkpo
|
||||
locale/po2strings
|
||||
@@ -82,10 +94,12 @@ man/lpoptions.man
|
||||
man/mantohtml
|
||||
monitor/bcp
|
||||
monitor/tbcp
|
||||
notifier/dbus
|
||||
notifier/mailto
|
||||
notifier/rss
|
||||
notifier/testnotify
|
||||
packaging/cups.list
|
||||
org.cups.docset*
|
||||
patches
|
||||
ppdc/genstrings
|
||||
ppdc/ppd/
|
||||
@@ -137,13 +151,17 @@ systemv/lpoptions
|
||||
systemv/lpstat
|
||||
systemv/reject
|
||||
templates/header.tmpl
|
||||
templates/*/header.tmpl
|
||||
test/cups-str-*.html
|
||||
test/error_log-*
|
||||
test/*_log-*
|
||||
test/ippfind
|
||||
test/ippfind-static
|
||||
test/ippserver
|
||||
test/ippserver-shared
|
||||
test/ipptool
|
||||
test/ipptool-static
|
||||
vcnet/.vs
|
||||
vcnet/packages
|
||||
vcnet/x64
|
||||
xcode/CUPS.xcodeproj/project.xcworkspace/
|
||||
xcode/CUPS.xcodeproj/xcuserdata/
|
||||
|
||||
|
||||
+517
@@ -0,0 +1,517 @@
|
||||
CHANGES - 2.2.13 - 2019-12-13
|
||||
=============================
|
||||
|
||||
|
||||
Changes in CUPS v2.2.13
|
||||
-----------------------
|
||||
|
||||
- CVE-2019-2228: The `ippSetValuetag` function did not validate the default
|
||||
language value.
|
||||
- Added a workaround for the scheduler's systemd support (Issue #5640)
|
||||
- Fixed spelling of "fold-accordion".
|
||||
- Fixed the default common name for TLS certificates used by `ippserver`.
|
||||
- The libusb-based USB backend now reports an error when the distribution
|
||||
permissions are wrong (Issue #5658)
|
||||
- Default printers set with `lpoptions` did not work in all cases (Issue #5681,
|
||||
Issue #5683, Issue #5684)
|
||||
- Fixed an off-by-one error in `ippEnumString` (Issue #5695)
|
||||
- Fixed some new compiler warnings (Issue #5700)
|
||||
- Fixed a few issues with the Apple Raster support (rdar://55301114)
|
||||
- The IPP backend did not detect all cases where a job should be retried using
|
||||
a raster format (rdar://56021091)
|
||||
|
||||
|
||||
Changes in CUPS v2.2.12
|
||||
-----------------------
|
||||
|
||||
- CVE-2019-8696 and CVE-2019-8675: Fixed SNMP buffer overflows (rdar://51685251)
|
||||
- The `cupsctl` command now prevents setting "cups-files.conf" directives
|
||||
(Issue #5530)
|
||||
- Updated the systemd service file for cupsd (Issue #5551)
|
||||
- The `cupsCheckDestSupported` function did not check octetString values
|
||||
correctly (Issue #5557)
|
||||
- The scheduler did not encode octetString values like "job-password" correctly
|
||||
for the print filters (Issue #5558)
|
||||
- Restored minimal support for the `Emulators` keyword in PPD files to allow
|
||||
old Samsung printer drivers to continue to work (Issue #5562)
|
||||
- Timed out job submission now yields an error (Issue #5570)
|
||||
- The footer in the web interface covered some content on small displays
|
||||
(Issue #5574)
|
||||
- The libusb-based USB backend now enforces read limits, improving print speed
|
||||
in many cases (Issue #5583)
|
||||
- Fixed some compatibility issues with old releases of CUPS (Issue #5587)
|
||||
- Fixed a bug in the scheduler job cleanup code (Issue #5588)
|
||||
- "make" failed with GZIP options (Issue #5595)
|
||||
- Added FIPS-140 workarounds for GNU TLS (Issue #5601, Issue #5622)
|
||||
- The scheduler no longer provides a default value for the description
|
||||
(Issue #5603)
|
||||
- The `lpadmin` command did not always update the PPD file for changes to the
|
||||
`cupsIPPSupplies` and `cupsSNMPSupplies` keywords (Issue #5610)
|
||||
- The scheduler now uses both the group's membership list as well as the
|
||||
various OS-specific membership functions to determine whether a user belongs
|
||||
to a named group (Issue #5613)
|
||||
- Added USB quirks rule for HP LaserJet 1015 (Issue #5617)
|
||||
- Fixed some PPD parser issues (Issue #5623, Issue #5624)
|
||||
- The IPP parser no longer allows invalid member attributes in collections
|
||||
(Issue #5630)
|
||||
- Fixed IPP buffer overflow (rdar://50035411)
|
||||
- Fixed memory disclosure issue in the scheduler (rdar://51373853)
|
||||
- Fixed DoS issues in the scheduler (rdar://51373929)
|
||||
- The scheduler would restart continuously when idle and printers were not
|
||||
shared (rdar://52561199)
|
||||
- Fixed a command ordering issue in the Zebra ZPL driver.
|
||||
- Fixed a memory leak in `ppdOpen`.
|
||||
|
||||
|
||||
Changes in CUPS v2.2.11
|
||||
-----------------------
|
||||
|
||||
- Running ppdmerge with the same input and output filenames did not work as
|
||||
advertised (Issue #5455)
|
||||
- Fixed a potential memory leak when reading at the end of a file (Issue #5473)
|
||||
- Fixed potential unaligned accesses in the string pool (Issue #5474)
|
||||
- Fixed a potential memory leak when loading a PPD file (Issue #5475)
|
||||
- Added a USB quirks rule for the Lexmark E120n (Issue #5478)
|
||||
- Updated the USB quirks rule for Zebra label printers (Issue #5395)
|
||||
- Fixed a compile error on Linux (Issue #5483)
|
||||
- The lpadmin command, web interface, and scheduler all queried an IPP
|
||||
Everywhere printer differently, resulting in different PPDs for the same
|
||||
printer (Issue #5484)
|
||||
- Fixed an issue with the self-signed certificates generated by GNU TLS
|
||||
(Issue #5506)
|
||||
- The `ippValidateAttribute` function did not catch all instances of invalid
|
||||
UTF-8 strings (Issue #5509)
|
||||
- Non-Kerberized printing to Windows via IPP was broken (Issue #5515)
|
||||
- The scheduler no longer stops a printer if an error occurs when a job is
|
||||
canceled or aborted (Issue #5517)
|
||||
- Added a USB quirks rule for the DYMO 450 Turbo (Issue #5521)
|
||||
- Added a USB quirks rule for Xerox printers (Issue #5523)
|
||||
- The scheduler's self-signed certificate did not include all of the alternate
|
||||
names for the server when using GNU TLS (Issue #5525)
|
||||
- Fixed compiler warnings with newer versions of GCC (Issue #5532, Issue #5533)
|
||||
- Fixed some PPD caching and IPP Everywhere PPD accounting/password bugs
|
||||
(Issue #5535)
|
||||
- Fixed `PreserveJobHistory` bug with time values (Issue #5538)
|
||||
- Media size matching now uses a tolerance of 0.5mm (rdar://33822024)
|
||||
- The lpadmin command would hang with a bad PPD file (rdar://41495016)
|
||||
- Fixed a potential crash bug in cups-driverd (rdar://46625579)
|
||||
- Fixed a performance regression with large PPDs (rdar://47040759)
|
||||
- The scheduler did not always idle exit as quickly as it could.
|
||||
|
||||
|
||||
Changes in CUPS v2.2.10
|
||||
-----------------------
|
||||
|
||||
- CVE-2018-4300: Linux session cookies used a predictable random number seed.
|
||||
- The `lpoptions` command now works with IPP Everywhere printers that have not
|
||||
yet been added as local queues (Issue #5045)
|
||||
- Added USB quirk rules (Issue #5395, Issue #5443)
|
||||
- The generated PPD files for IPP Everywhere printers did not contain the
|
||||
cupsManualCopies keyword (Issue #5433)
|
||||
- Kerberos credentials might be truncated (Issue #5435)
|
||||
- The handling of `MaxJobTime 0` did not match the documentation (Issue #5438)
|
||||
- Incorporated the page accounting changes from CUPS 2.3 (Issue #5439)
|
||||
- Fixed a bug adding a queue with the `-E` option (Issue #5440)
|
||||
- Fixed a crash bug when mapping PPD duplex options to IPP attributes
|
||||
(rdar://46183976)
|
||||
|
||||
|
||||
Changes in CUPS v2.2.9
|
||||
----------------------
|
||||
|
||||
- Localization changes (Issue #5348, Issue #5362, Issue #5408)
|
||||
- Documentation updates (Issue #5369)
|
||||
- The lpadmin command would create a non-working printer in some error cases
|
||||
(Issue #5305)
|
||||
- The scheduler would crash if an empty `AccessLog` directive was specified
|
||||
(Issue #5309)
|
||||
- Fixed a regression in the changes to ippValidateAttribute (Issue #5322,
|
||||
Issue #5330)
|
||||
- Fixed a crash bug in the Epson dot matrix driver (Issue #5323)
|
||||
- Automatic debug logging of job errors did not work with systemd (Issue #5337)
|
||||
- The web interface did not list the IPP Everywhere "driver" (Issue #5338)
|
||||
- The IPP Everywhere "driver" now properly supports face-up printers
|
||||
(Issue #5345)
|
||||
- Fixed some typos in the label printer drivers (Issue #5350)
|
||||
- Multi-file jobs could get stuck if the backend failed (Issue #5359,
|
||||
Issue #5413)
|
||||
- The IPP Everywhere "driver" no longer does local filtering when printing to
|
||||
a shared CUPS printer (Issue #5361)
|
||||
- The lpadmin command now correctly reports IPP errors when configuring an
|
||||
IPP Everywhere printer (Issue #5370)
|
||||
- Fixed some memory leaks discovered by Coverity (Issue #5375)
|
||||
- The PPD compiler incorrectly terminated JCL options (Issue #5379)
|
||||
- The cupstestppd utility did not generate errors for missing/mismatched
|
||||
CloseUI/JCLCloseUI keywords (Issue #5381)
|
||||
- The scheduler now reports the actual location of the log file (Issue #5398)
|
||||
- Added a USB quirk rule (Issue #5420)
|
||||
- The scheduler was being backgrounded on macOS, causing applications to spin
|
||||
(rdar://40436080)
|
||||
- The scheduler did not validate that required initial request attributes were
|
||||
in the operation group (rdar://41098178)
|
||||
- Authentication in the web interface did not work on macOS (rdar://41444473)
|
||||
- Fixed an issue with HTTP Digest authentication (rdar://41709086)
|
||||
- The scheduler could crash when job history was purged (rdar://42198057)
|
||||
- Dropped non-working RSS subscriptions UI from web interface templates.
|
||||
- Fixed a memory leak for some IPP (extension) syntaxes.
|
||||
|
||||
|
||||
Changes in CUPS v2.2.8
|
||||
----------------------
|
||||
|
||||
- Additional changes for the scheduler to substitute default values for invalid
|
||||
job attributes when running in "relaxed conformance" mode (Issue #5229)
|
||||
- The `ipptool` program no longer checks for duplicate attributes when running
|
||||
in list or CSV mode (Issue #5278)
|
||||
- Fixed builds without PAM (Issue #5283)
|
||||
- Fixed `lpoptions` man page (Issue #5286)
|
||||
- The `cupsCreateJob`, `cupsPrintFile2`, and `cupsPrintFiles2` APIs did not use
|
||||
the supplied HTTP connection (Issue #5288)
|
||||
- Fixed another crash in the scheduler when adding an IPP Everywhere printer
|
||||
(Issue #5290)
|
||||
- Added a workaround for certain web browsers that do not support multiple
|
||||
authentication schemes in a single response header (Issue #5289)
|
||||
- Fixed policy limits containing the `All` operation (Issue #5296)
|
||||
- The scheduler was always restarted after idle-exit with systemd (Issue #5297)
|
||||
- Added a USB quirks rule for the HP LaserJet P1102 (Issue #5310)
|
||||
- The mailto notifier did not wait for the welcome message (Issue #5312)
|
||||
- Fixed a parsing bug in the pstops filter (Issue #5321)
|
||||
- Documentation updates (Issue #5299, Issue #5301, Issue #5306)
|
||||
- Localization updates (Issue #5317)
|
||||
- The scheduler allowed environment variables to be specified in the
|
||||
`cupsd.conf` file (rdar://37836779, rdar://37836995, rdar://37837252,
|
||||
rdar://37837581)
|
||||
- Fax queues did not support pause (p) or wait-for-dialtone (w) characters
|
||||
(rdar://39212256)
|
||||
- The scheduler did not validate notify-recipient-uri values properly
|
||||
(rdar://40068936)
|
||||
- The IPP parser allowed invalid group tags (rdar://40442124)
|
||||
- Fixed a parsing bug in the new authentication code.
|
||||
|
||||
|
||||
Changes in CUPS v2.2.7
|
||||
----------------------
|
||||
|
||||
- NOTICE: Raw print queues are now deprecated (Issue #5269)
|
||||
- Fixed an Avahi crash bug in the scheduler (Issue #5268)
|
||||
- The IPP Everywhere PPD generator did not include the `cupsJobPassword`
|
||||
keyword, when supported (Issue #5265)
|
||||
- Systemd did not restart cupsd when configuration changes were made that
|
||||
required a restart (Issue #5263)
|
||||
- The Lexmark Optra E310 printer needs the "no-reattach" USB quirk rule
|
||||
(Issue #5259)
|
||||
- The scheduler could crash while adding an IPP Everywhere printer (Issue #5258)
|
||||
- Label printers supported by the rastertolabel driver don't support SNMP, so
|
||||
don't delay printing to test it (Issue #5256)
|
||||
- Fixed a compile issue when PAM is not available (Issue #5253)
|
||||
- Documentation fixes (Issue #5252)
|
||||
- Star Micronics printers need the "unidir" USB quirk rule (Issue #5251)
|
||||
- The scheduler now supports using temporary print queues for older IPP/1.1
|
||||
print queues like those shared by CUPS 1.3 and earlier (Issue #5241)
|
||||
- Fixed printing to some IPP Everywhere printers (Issue #5238)
|
||||
- Kerberized printing to another CUPS server did not work correctly
|
||||
(Issue #5233)
|
||||
- The `cupsRasterWritePixels` function did not correctly swap bytes for some
|
||||
formats (Issue #5225)
|
||||
- Added a USB quirk rule for Canon MP280 series printers (Issue #5221)
|
||||
- The `ppdInstallableConflict` tested too many constraints (Issue #5213)
|
||||
- More fixes for printing to old CUPS servers (Issue #5211)
|
||||
- The `cupsCopyDest` function now correctly copies the `is_default` value
|
||||
(Issue #5208)
|
||||
- The scheduler did not work with older versions of uClibc (Issue #5188)
|
||||
- The scheduler now substitutes default values for invalid job attributes when
|
||||
running in "relaxed conformance" mode (Issue #5186)
|
||||
- Fixed PAM module detection and added support for the common PAM definitions
|
||||
(Issue #5185)
|
||||
- Fixed a journald support bug in the scheduler (Issue #5181)
|
||||
- The cups-driverd program incorrectly stopped scanning PPDs as soon as a loop
|
||||
was seen (Issue #5170)
|
||||
- Fixed group validation on OpenBSD (Issue #5166)
|
||||
- Fixed the `ippserver` sample code when threading is disabled or unavailable
|
||||
(Issue #5154)
|
||||
- The `cupsEnumDests` function did not include options from the lpoptions files
|
||||
(Issue #5144)
|
||||
- The `SSLOptions` directive now supports `MinTLS` and `MaxTLS` options to
|
||||
control the minimum and maximum TLS versions that will be allowed,
|
||||
respectively (Issue #5119)
|
||||
- The scheduler did not write out dirty configuration and state files if there
|
||||
were open client connections (Issue #5118)
|
||||
- The `lpadmin` command now provides a better error message when an unsupported
|
||||
System V interface script is used (Issue #5111)
|
||||
- The `lp` and `lpr` commands now provide better error messages when the default
|
||||
printer cannot be found (Issue #5096)
|
||||
- No longer support backslash, question mark, or quotes in printer names
|
||||
(Issue #4966)
|
||||
- The CUPS library now supports the latest HTTP Digest authentication
|
||||
specification including support for SHA-256 (Issue #4862)
|
||||
- The `lpstat` command now reports when new jobs are being held (Issue #4761)
|
||||
- The `lpoptions` command incorrectly saved default options (Issue #4717)
|
||||
- The `ppdLocalizeIPPReason` function incorrectly returned a localized version
|
||||
of "none" (rdar://36566269)
|
||||
- TLS connections now properly timeout (rdar://34938533)
|
||||
- The IPP backend did not properly detect failed PDF prints (rdar://34055474)
|
||||
- Temporary files are now placed in the correct directory for sandboxed
|
||||
applications on macOS (rdar://problem/37789645)
|
||||
|
||||
|
||||
Changes in CUPS v2.2.6
|
||||
----------------------
|
||||
|
||||
- DBUS notifications could crash the scheduler (Issue #5143)
|
||||
- Added USB quirks rules for Canon MP540 and Samsung ML-2160 (Issue #5148)
|
||||
- Fixed TLS cipher suite selection with GNU TLS (Issue #5145, Issue #5150)
|
||||
- Localization updates (Issue #5152)
|
||||
|
||||
|
||||
Changes in CUPS v2.2.5
|
||||
----------------------
|
||||
|
||||
- The scheduler's `-t` option did not force all errors to the standard error
|
||||
file, making debugging of configuration problems hard (Issue #5041)
|
||||
- Fixed a typo in the CUPS Programming Manual (Issue #5042)
|
||||
- Fixed RPM packaging issue (Issue #5043, Issue #5044)
|
||||
- The `cupsGetDests` function incorrectly returned an empty list of printers if
|
||||
there was no default printer (Issue #5046)
|
||||
- The `cupsGetDests` function waited too long for network printers (Issue #5049)
|
||||
- Libtool support was completely broken with current libtool versions that use
|
||||
an incompatible command-line syntax (Issue #5050)
|
||||
- Fixed a build issue with `--enable-mallinfo` (Issue #5051)
|
||||
- The ippserver test program contained a deadlock issue (Issue #5054)
|
||||
- The `cupsLocalizeDest*` functions did not provide base localizations for
|
||||
all registered IPP attributes and values (Issue #5056)
|
||||
- The --enable-libtool configure option requires a path to the libtool program,
|
||||
but doesn't document or check for it (Issue #5062)
|
||||
- Fixed the `SSLOptions DenyCBC` option when using GNU TLS (Issue #5065)
|
||||
- Fixed the `ServerTokens None` option (Issue #5065)
|
||||
- Fixed the default `ServerAlias` value from `ServerName` (Issue #5072)
|
||||
- Fixed the adminurl field in the TXT record for fully-qualified `ServerName`
|
||||
values (Issue #5074)
|
||||
- The scheduler now creates a PID file when not running on demand with a modern
|
||||
service launcher (Issue #5080)
|
||||
- The web interface did not support newer language identifiers used by Microsoft
|
||||
web browsers (Issue #5803)
|
||||
- Updated the cups-files.conf and cupsd.conf file documentation for missing
|
||||
directives (Issue #5084)
|
||||
- Fixed an Avahi-related crash bug in the scheduler (Issue #5085, Issue #5086)
|
||||
- Fixed the interactions between the "print-quality" and "cupsPrintQuality"
|
||||
options (Issue #5090)
|
||||
- The IPP Everywhere PPD generator now sorts the supported resolutions before
|
||||
choosing them for draft, normal, and best quality modes (Issue #5091)
|
||||
- Fixed the localization unit test on Linux (Issue #5097)
|
||||
- The CUPS library did not reuse domain sockets (Issue #5098)
|
||||
- Fixed the "make check" target for some environments (Issue #5099)
|
||||
- The scheduler woke up once per second to remove old temporary queues
|
||||
(Issue #5100)
|
||||
- Added USB quirk rule for Kyocera printer (Issue #5102, Issue #5103)
|
||||
- Re-documented the limits of `file:///...` device URIs and moved the FileDevice
|
||||
directive in `cups-files.conf` to the list of deprecated configuration
|
||||
directives (Issue #5117)
|
||||
- Added USB quirk rule for HP LaserJet 1160 printer (Issue #5121)
|
||||
- Fixed the script interpreter detection in the configure script (Issue #5122)
|
||||
- The network backends now retry on more error conditions (Issue #5123)
|
||||
- Added a French translation of the web interface (Issue #5134)
|
||||
- `cupsGetDests2` was not using the supplied HTTP connection (Issue #5135)
|
||||
- `httpAddrConnect` leaked sockets in certain circumstances, causing some
|
||||
printers to hang (rdar://31965686)
|
||||
- Fixed an issue with Chinese localizations on macOS (rdar://32419311)
|
||||
- The IPP backend now always sends the "finishings" attribute for printers that
|
||||
support it because otherwise the client cannot override printer defaults
|
||||
(rdar://33169732)
|
||||
- The `cupsGetNamedDest` function did not use the local default printer
|
||||
(rdar://33228500)
|
||||
- The IPP backend incorrectly sent the "job-pages-per-set" attribute to PDF
|
||||
printers (rdar://33250434)
|
||||
- Fixed the `cups.strings` file that is used on macOS (rdar://33287650)
|
||||
- CUPS now sends the `Date` HTTP header in IPP requests (rdar://33302034)
|
||||
- The `ippCopyAttribute` function did not copy out-of-band values correctly
|
||||
(rdar://33688003)
|
||||
- Fixed the localization fallback code on macOS (rdar://33583699)
|
||||
- The scheduler did not run with a high enough priority, causing problems on
|
||||
busy systems (rdar://33789342)
|
||||
- Added support for Japanese Kaku 1 envelope size (rdar://34774110)
|
||||
- The `ipptool` program's `-P` option did not work correctly.
|
||||
- The `ipptool` program did not compare URI scheme or hostname components
|
||||
correctly for the WITH-ALL-HOSTNAMES, WITH-ALL-SCHEMES, WITH-HOSTNAME, or
|
||||
WITH-SCHEME predicates.
|
||||
|
||||
|
||||
Changes in CUPS v2.2.4
|
||||
----------------------
|
||||
|
||||
- The scheduler did not remove old job files (Issue #4987)
|
||||
- cupsEnumDests did not return early when all printers had been discovered
|
||||
(Issue #4989)
|
||||
- The CUPS build system now supports cross-compilation (Issue #4897)
|
||||
- Added a new CUPS Programming Manual to replace the aging API documentation.
|
||||
- Added the `cupsAddIntegerOption` and `cupsGetIntegerOption` functions
|
||||
(Issue #4992)
|
||||
- The `cupsGetDests` and `cupsCreateJob` functions now support Bonjour printers
|
||||
(Issue #4993)
|
||||
- Added a USB quirk rule for Lexmark E260dn printers (Issue #4994)
|
||||
- Fixed a potential buffer overflow in the `cupstestppd` utility (Issue #4996)
|
||||
- IPP Everywhere improvements (Issue #4998)
|
||||
- Fixed the "cancel all jobs" function in the web interface for several
|
||||
languages (Issue #4999)
|
||||
- Fixed issues with local queues (Issue #5003, Issue #5008, Issue #5009)
|
||||
- The `lpstat` command now supports a `-e` option to enumerate local printers
|
||||
(either previously added or on the network) that can be accessed
|
||||
(Issue #5005)
|
||||
- The `lp` and `lpr` commands now support printing to network printers that
|
||||
haven't yet been added (Issue #5006)
|
||||
- Fixed a typo in the mime.types file.
|
||||
- Fixed a bug in the Spanish web interface template (Issue #5016)
|
||||
- The `cupsEnumDests*` and `cupsGetDest*` functions now report the value of the
|
||||
"printer-is-temporary" Printer Status attribute (Issue #5028)
|
||||
- Added Chinese localization (Issue #5029)
|
||||
- The `cupsCheckDestSupported` function did not support `NULL` values
|
||||
(Issue #5031)
|
||||
- Fixed some issues in the RPM spec file (Issue #5032)
|
||||
- The `cupsConnectDest` function now supports the `CUPS_DEST_FLAGS_DEVICE` flag
|
||||
for explicitly connecting to the device (printer) associated with the
|
||||
destination.
|
||||
- The `SSLOptions` directive in "client.conf" and "cupsd.conf" now supports
|
||||
`DenyCBC` and `DenyTLS1.0` options (Issue #5037)
|
||||
|
||||
|
||||
Changes in CUPS v2.2.3
|
||||
----------------------
|
||||
|
||||
- The IPP backend could get into an infinite loop for certain errors, causing a
|
||||
hung queue (<rdar://problem/28008717>)
|
||||
- The scheduler could pause responding to client requests in order to save state
|
||||
changes to disk (<rdar://problem/28690656>)
|
||||
- Added support for PPD finishing keywords (Issue #4960, Issue #4961,
|
||||
Issue #4962)
|
||||
- The IPP backend did not send a media-col attribute for just the source or type
|
||||
(Issue #4963)
|
||||
- IPP Everywhere print queues did not always support all print qualities
|
||||
supported by the printer (Issue #4953)
|
||||
- IPP Everywhere print queues did not always support all media types supported
|
||||
by the printer (Issue #4953)
|
||||
- The IPP Everywhere PPD generator did not return useful error messages
|
||||
(Issue #4954)
|
||||
- The IPP Everywhere finishings support did not work correctly with common UI or
|
||||
command-line options (Issue #4976)
|
||||
- Fixed an error handling issue for the network backends (Issue #4979)
|
||||
- The default cupsd.conf file did not work on systems compiled without Kerberos
|
||||
support (Issue #4947)
|
||||
- The "reprint job" option was not available for some canceled jobs
|
||||
(Issue #4915)
|
||||
- Updated the job listing in the web interface (Issue #4978)
|
||||
- Fixed some localization issues on macOS (<rdar://problem/27245567>)
|
||||
|
||||
|
||||
Changes in CUPS v2.2.2
|
||||
----------------------
|
||||
|
||||
- Fixed some issues with the Zebra ZPL printer driver (Issue #4898)
|
||||
- Fixed some issues with IPP Everywhere printer support (Issue #4893,
|
||||
Issue #4909, Issue #4916, Issue #4921, Issue #4923, Issue #4932, Issue #4933,
|
||||
Issue #4938)
|
||||
- The rastertopwg filter could crash with certain input (Issue #4942)
|
||||
- Optimized connection usage in the IPP backend (<rdar://problem/29547323>)
|
||||
- The scheduler did not detect when an encrypted connection was closed by the
|
||||
client on Linux (Issue #4901)
|
||||
- The cups-lpd program did not catch all legacy usage of ISO-8859-1
|
||||
(Issue #4899)
|
||||
- Fixed builds on systems without a working poll() implementation (Issue #4905)
|
||||
- Added a USB quirk rule for the Kyocera Ecosys P6026cdn (Issue #4900)
|
||||
- The scheduler no longer creates log files on startup
|
||||
(<rdar://problem/28332470>)
|
||||
- The ippContainsString function now uses case-insensitive comparisons for
|
||||
mimeMediaType, name, and text values in conformance with RFC 2911.
|
||||
- The network backends now log the addresses that were found for a printer
|
||||
(<rdar://problem/29268474>)
|
||||
- Let's Encrypt certificates did not work when the hostname contained uppercase
|
||||
letters (Issue #4919)
|
||||
- Fixed reporting of printed pages in the web interface (Issue #4924)
|
||||
- Updated systemd config files (Issue #4935)
|
||||
- Updated documentation (PR #4896)
|
||||
- Updated localizations (PR #4894, PR #4895, PR #4904, PR #4908, Issue #4946)
|
||||
- Updated packaging files (Issue #4940)
|
||||
|
||||
|
||||
Changes in CUPS v2.2.1
|
||||
----------------------
|
||||
|
||||
- Added "CreateSelfSignedCerts" directive for cups-files.conf to control whether
|
||||
the scheduler automatically creates its own self-signed X.509 certificates for
|
||||
TLS connections (Issue #4876)
|
||||
- http*Connect did not handle partial failures (Issue #4870)
|
||||
- Addressed some build warnings on Linux (Issue #4881)
|
||||
- cupsHashData did not use the correct hashing algorithm
|
||||
(<rdar://problem/28209220>)
|
||||
- Updated man pages (PR #4885)
|
||||
- Updated localizations (PR #4877, PR #4886)
|
||||
|
||||
|
||||
Changes in CUPS v2.2.0
|
||||
----------------------
|
||||
|
||||
- Normalized the TLS certificate validation code and added additional error
|
||||
messages to aid troubleshooting.
|
||||
- The httpConnect functions did not work on Linux when cupsd was not running
|
||||
(Issue #4870)
|
||||
- The --no-remote-any option of cupsctl had no effect (Issue #4866)
|
||||
- http*Connect did not return early when all addresses failed (Issue #4870)
|
||||
|
||||
|
||||
Changes in CUPS v2.2rc1
|
||||
-----------------------
|
||||
|
||||
- Updated the list of supported IPP Everywhere media types.
|
||||
- The IPP backend did not validate TLS credentials properly.
|
||||
- The printer-state-message attribute was not cleared after a print job with no
|
||||
errors (Issue #4851)
|
||||
- The CUPS-Add-Modify-Class and CUPS-Add-Modify-Printer operations did not
|
||||
always return an error for failed adds (Issue #4854)
|
||||
- PPD files with names longer than 127 bytes did not work (Issue #4860)
|
||||
- Updated localizations (Issue #4846, PR #4858)
|
||||
|
||||
|
||||
Changes in CUPS v2.2b2
|
||||
----------------------
|
||||
|
||||
- Added Upstart support (PR #4825)
|
||||
- CUPS now supports Let's Encrypt certificates on Linux.
|
||||
|
||||
|
||||
Changes in CUPS v2.2b1
|
||||
----------------------
|
||||
|
||||
- All CUPS commands now support POSIX options (Issue #4813)
|
||||
- The scheduler now restarts faster (Issue #4760)
|
||||
- Improved performance of web interface with large numbers of jobs (Issue #3819)
|
||||
- Encrypted printing can now be limited to only trusted printers and servers
|
||||
(<rdar://problem/25711658>)
|
||||
- The scheduler now advertises PWG Raster attributes for IPP Everywhere clients
|
||||
(Issue #4428)
|
||||
- The scheduler now logs informational messages for jobs at LogLevel "info"
|
||||
(Issue #4815)
|
||||
- The scheduler now uses the getgrouplist function when available (Issue #4611)
|
||||
- The IPP backend no longer enables compression by default except for certain
|
||||
raster formats that generally benefit from it (<rdar://problem/25166952>)
|
||||
- The scheduler did not handle out-of-disk situations gracefully (Issue #4742)
|
||||
- The LPD mini-daemon now detects invalid UTF-8 sequences in job, document, and
|
||||
user names (Issue #4748)
|
||||
- The IPP backend now continues on to the next job when the remote server/
|
||||
printer puts the job on hold (<rdar://problem/24858548>)
|
||||
- The scheduler did not cancel multi-document jobs immediately
|
||||
(<rdar://problem/24854834>)
|
||||
- The scheduler did not return non-shared printers to local clients unless they
|
||||
connected to the domain socket (<rdar://problem/24566996>)
|
||||
- The scheduler now reads the spool directory if one or more job cache entries
|
||||
point to deleted jobs (<rdar://problem/24048846>)
|
||||
- Added support for disc media sizes (<rdar://problem/20219536>)
|
||||
- The httpAddrConnect and httpConnect* APIs now try connecting to multiple
|
||||
addresses in parallel (<rdar://problem/20643153>)
|
||||
- The cupsd domain socket is no longer world-accessible on macOS
|
||||
(<rdar://problem/7542560>)
|
||||
- Interface scripts are no longer supported for security reasons
|
||||
(<rdar://problem/23135640>)
|
||||
- Added a new cupsHashData API and support for hashed job passwords
|
||||
(<rdar://problem/20221502>)
|
||||
- Localization fixes (<rdar://problem/25292403>, <rdar://problem/25461517>,
|
||||
Issue #4041, Issue #4796)
|
||||
- Documentation changes (Issue #4624, Issue #4781)
|
||||
- Packaging fixes (PR #4832)
|
||||
@@ -1,45 +0,0 @@
|
||||
CHANGES.txt - 2.2b1 - 2016-06-02
|
||||
--------------------------------
|
||||
|
||||
CHANGES IN CUPS V2.2b1
|
||||
|
||||
- All CUPS commands now support POSIX options (Issue #4813)
|
||||
- The scheduler now restarts faster (Issue #4760)
|
||||
- Improved performance of web interface with large numbers of jobs
|
||||
(Issue #3819)
|
||||
- Encrypted printing can now be limited to only trusted printers and
|
||||
servers (<rdar://problem/25711658>)
|
||||
- The scheduler now advertises PWG Raster attributes for IPP Everywhere
|
||||
clients (Issue #4428)
|
||||
- The scheduler now logs informational messages for jobs at LogLevel
|
||||
"info" (Issue #4815)
|
||||
- The scheduler now uses the getgrouplist function when available
|
||||
(Issue #4611)
|
||||
- The IPP backend no longer enables compression by default except for
|
||||
certain raster formats that generally benefit from it
|
||||
(<rdar://problem/25166952>)
|
||||
- The scheduler did not handle out-of-disk situations gracefully
|
||||
(Issue #4742)
|
||||
- The LPD mini-daemon now detects invalid UTF-8 sequences in job,
|
||||
document, and user names (Issue #4748)
|
||||
- The IPP backend now continues on to the next job when the remote
|
||||
server/printer puts the job on hold (<rdar://problem/24858548>)
|
||||
- The scheduler did not cancel multi-document jobs immediately
|
||||
(<rdar://problem/24854834>)
|
||||
- The scheduler did not return non-shared printers to local clients
|
||||
unless they connected to the domain socket (<rdar://problem/24566996>)
|
||||
- The scheduler now reads the spool directory if one or more job cache
|
||||
entries point to deleted jobs (<rdar://problem/24048846>)
|
||||
- Added support for disc media sizes (<rdar://problem/20219536>)
|
||||
- The httpAddrConnect and httpConnect* APIs now try connecting to
|
||||
multiple addresses in parallel (<rdar://problem/20643153>)
|
||||
- The cupsd domain socket is no longer world-accessible on OS X
|
||||
(<rdar://problem/7542560>)
|
||||
- Interface scripts are no longer supported for security reasons
|
||||
(<rdar://problem/23135640>)
|
||||
- Added a new cupsHashData API and support for hashed job passwords
|
||||
(<rdar://problem/20221502>)
|
||||
- Localization fixes (<rdar://problem/25292403>,
|
||||
<rdar://problem/25461517>, Issue #4041, Issue #4796)
|
||||
- Documentation changes (Issue #4624, Issue #4781)
|
||||
- Packaging fixes (PR #4832)
|
||||
+3
-3
@@ -131,7 +131,7 @@ columns.
|
||||
> Note:
|
||||
>
|
||||
> The ".cxx" extension is used because it is the only common C++ extension
|
||||
> between Linux, OS X, UNIX, and Windows.
|
||||
> between Linux, macOS, UNIX, and Windows.
|
||||
|
||||
The top of each source file contains a header giving the purpose or nature of
|
||||
the source file and the copyright and licensing notice:
|
||||
@@ -613,8 +613,8 @@ target rule is used to create the automatic dependencies:
|
||||
depend:
|
||||
TAB $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
|
||||
|
||||
We regenerate the automatic dependencies on an OS X system and express any
|
||||
non-OS X dependencies statically in the makefile.
|
||||
We regenerate the automatic dependencies on an macOS system and express any
|
||||
non-macOS dependencies statically in the makefile.
|
||||
|
||||
|
||||
### INSTALL/UNINSTALL SUPPORT
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
CREDITS.txt - 2013-07-23
|
||||
------------------------
|
||||
CREDITS - 2017-05-01
|
||||
====================
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd
|
||||
like to thank the following individuals for their contributions:
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd like
|
||||
to thank the following individuals for their contributions:
|
||||
|
||||
Niklas 'Nille' Åkerström - Swedish localization.
|
||||
Nathaniel Barbour - Lots of testing and feedback.
|
||||
N. Becker - setsid().
|
||||
Philippe Combes - French localization and buttons script.
|
||||
@@ -17,20 +18,20 @@ like to thank the following individuals for their contributions:
|
||||
Wang Jian - CUPS RPM corrections.
|
||||
Roderick Johnstone - Beta tester of the millenium.
|
||||
Till Kamppeter - Bug fixes, beta testing, evangelism.
|
||||
Iñaki Larrañaga - Basque localization.
|
||||
Kenshi Muto - Japanese localization, patches, and
|
||||
testing.
|
||||
Tomohiro Kato - Japanese localization.
|
||||
Kiko - Bug fixes.
|
||||
Sergey V. Kovalyov - ESP Print Pro and CUPS beta tester.
|
||||
Marek Laane - Estonian translation.
|
||||
Iñaki Larrañaga - Basque localization.
|
||||
Mark Lawrence - Microsoft interoperability testing.
|
||||
Jeff Licquia - Bug fixes, beta testing, evangelism.
|
||||
Jason McMullan - Original CUPS RPM distributions.
|
||||
Àngel Mompó - Catalan localization.
|
||||
Wes Morgan - *BSD fixes.
|
||||
Kenshi Muto - Japanese localization, patches, and
|
||||
testing.
|
||||
Brian Norris - Upstart support.
|
||||
Daniel Nylander - Swedish localization.
|
||||
Niklas 'Nille' Åkerström - Swedish localization.
|
||||
Naruiko Ogasawara - Japanese localization.
|
||||
Giulio Orsero - Bug fixes and testing.
|
||||
Michal Osowiecki - Polish localization.
|
||||
@@ -40,6 +41,7 @@ like to thank the following individuals for their contributions:
|
||||
Petter Reinholdtsen - HP-UX compiler stuff.
|
||||
Juan Pablo González Riopedre - Spanish localization.
|
||||
Giovanni Scafora - Italian localization.
|
||||
Joachim Schwender - German localization.
|
||||
Opher Shachar - Hebrew localization.
|
||||
Stuart Stevens - HP JetDirect IPP information.
|
||||
Andrea Suatoni - IRIX desktop integration and testing.
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
INSTALL - CUPS v2.2.13 - 2019-12-13
|
||||
===================================
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
information on CUPS see the file called "README.md". A complete change log can
|
||||
be found in "CHANGES.md".
|
||||
|
||||
Using CUPS requires additional third-party support software and printer drivers.
|
||||
These are typically included with your operating system distribution. Apple
|
||||
does not endorse or support third-party support software for CUPS.
|
||||
|
||||
> Note: Current versions of macOS DO NOT allow installation to /usr with the
|
||||
> default System Integrity Protection (SIP) settings. In addition, we do not
|
||||
> recommend replacing the CUPS supplied with macOS because:
|
||||
>
|
||||
> a. not all versions of CUPS are compatible with every macOS release,
|
||||
>
|
||||
> b. code signing prevents replacement of system libraries and access to the
|
||||
> system keychain (needed for encrypted printer sharing), and
|
||||
>
|
||||
> c. software updates will often replace parts of your local installation,
|
||||
> potentially rendering your system unusable.
|
||||
>
|
||||
> Apple only supports using the compiler supplied with Xcode to build CUPS on
|
||||
> macOS.
|
||||
|
||||
|
||||
BEFORE YOU BEGIN
|
||||
----------------
|
||||
|
||||
You'll need ANSI-compliant C and C++ compilers, plus a make program and POSIX-
|
||||
compliant shell (/bin/sh). The GNU compiler tools and Bash work well and we
|
||||
have tested the current CUPS code against several versions of GCC with excellent
|
||||
results.
|
||||
|
||||
The makefiles used by the project should work with most versions of make. We've
|
||||
tested them with GNU make as well as the make programs shipped by Compaq, HP,
|
||||
SGI, and Sun. BSD users should use GNU make (gmake) since BSD make does not
|
||||
support "include".
|
||||
|
||||
Besides these tools you'll want ZLIB library for compression support, the GNU
|
||||
TLS library for encryption support on platforms other than iOS, macOS, or
|
||||
Windows, and either MIT (1.6.3 or higher) or Heimdal Kerberos for Kerberos
|
||||
support. CUPS will compile and run without these, however you'll miss out on
|
||||
many of the features provided by CUPS.
|
||||
|
||||
On a stock Ubuntu install, the following command will install the required
|
||||
prerequisites:
|
||||
|
||||
sudo apt-get install autoconf build-essential libavahi-client-dev \
|
||||
libgnutls28-dev libkrb5-dev libnss-mdns libpam-dev \
|
||||
libsystemd-dev libusb-1.0-0-dev zlib1g-dev
|
||||
|
||||
Also, please note that CUPS does not include print filters to support PDF or
|
||||
raster printing. You *must* download GPL Ghostscript and/or the Open Printing
|
||||
CUPS filters package separately to print on operating systems other than macOS.
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
|
||||
CUPS uses GNU autoconf, so you should find the usual "configure" script in the
|
||||
main CUPS source directory. To configure CUPS for your system, type:
|
||||
|
||||
./configure
|
||||
|
||||
The default installation will put the CUPS software in the "/etc", "/usr", and
|
||||
"/var" directories on your system, which will overwrite any existing printing
|
||||
commands on your system. Use the `--prefix` option to install the CUPS software
|
||||
in another location:
|
||||
|
||||
./configure --prefix=/some/directory
|
||||
|
||||
> Note: Current versions of macOS DO NOT allow installation to /usr with the
|
||||
> default System Integrity Protection (SIP) settings.
|
||||
|
||||
To see a complete list of configuration options, use the `--help` option:
|
||||
|
||||
./configure --help
|
||||
|
||||
If any of the dependent libraries are not installed in a system default location
|
||||
(typically "/usr/include" and "/usr/lib") you'll need to set the CFLAGS,
|
||||
CPPFLAGS, CXXFLAGS, DSOFLAGS, and LDFLAGS environment variables prior to running
|
||||
configure:
|
||||
|
||||
setenv CFLAGS "-I/some/directory"
|
||||
setenv CPPFLAGS "-I/some/directory"
|
||||
setenv CXXFLAGS "-I/some/directory"
|
||||
setenv DSOFLAGS "-L/some/directory"
|
||||
setenv LDFLAGS "-L/some/directory"
|
||||
./configure ...
|
||||
|
||||
or:
|
||||
|
||||
CFLAGS="-I/some/directory" \
|
||||
CPPFLAGS="-I/some/directory" \
|
||||
CXXFLAGS="-I/some/directory" \
|
||||
DSOFLAGS="-L/some/directory" \
|
||||
LDFLAGS="-L/some/directory" \
|
||||
./configure ...
|
||||
|
||||
The `--enable-debug` option compiles CUPS with debugging information enabled.
|
||||
Additional debug logging support can be enabled using the
|
||||
`--enable-debug-printfs` option - these debug messages are enabled using the
|
||||
`CUPS_DEBUG_xxx` environment variables at run-time.
|
||||
|
||||
CUPS also includes an extensive set of unit tests that can be used to find and
|
||||
diagnose a variety of common problems - use the "--enable-unit-tests" configure
|
||||
option to run them at build time.
|
||||
|
||||
On macOS, use the `--with-archflags` option to build with the correct set of
|
||||
architectures:
|
||||
|
||||
./configure --with-archflags="-arch i386 -arch x86_64" ...
|
||||
|
||||
Once you have configured things, just type:
|
||||
|
||||
make ENTER
|
||||
|
||||
or if you have FreeBSD, NetBSD, or OpenBSD type:
|
||||
|
||||
gmake ENTER
|
||||
|
||||
to build the software.
|
||||
|
||||
|
||||
TESTING THE SOFTWARE
|
||||
--------------------
|
||||
|
||||
Aside from the built-in unit tests, CUPS includes an automated test framework
|
||||
for testing the entire printing system. To run the tests, just type:
|
||||
|
||||
make check ENTER
|
||||
|
||||
or if you have FreeBSD, NetBSD, or OpenBSD type:
|
||||
|
||||
gmake check ENTER
|
||||
|
||||
The test framework runs a copy of the CUPS scheduler (cupsd) on port 8631 in
|
||||
/tmp/cups-$USER and produces a nice HTML report of the results.
|
||||
|
||||
|
||||
INSTALLING THE SOFTWARE
|
||||
-----------------------
|
||||
|
||||
Once you have built the software you need to install it. The "install" target
|
||||
provides a quick way to install the software on your local system:
|
||||
|
||||
make install ENTER
|
||||
|
||||
or for FreeBSD, NetBSD, or OpenBSD:
|
||||
|
||||
gmake install ENTER
|
||||
|
||||
Use the BUILDROOT variable to install to an alternate root directory:
|
||||
|
||||
make BUILDROOT=/some/other/root/directory install ENTER
|
||||
|
||||
You can also build binary packages that can be installed on other machines using
|
||||
the RPM spec file ("packaging/cups.spec") or EPM list file
|
||||
("packaging/cups.list"). The latter also supports building of binary RPMs, so
|
||||
it may be more convenient to use.
|
||||
|
||||
You can find the RPM software at:
|
||||
|
||||
http://www.rpm.org/
|
||||
|
||||
The EPM software is available at:
|
||||
|
||||
https://michaelrsweet.github.io/epm
|
||||
|
||||
|
||||
CREATING BINARY DISTRIBUTIONS WITH EPM
|
||||
--------------------------------------
|
||||
|
||||
The top level makefile supports generation of many types of binary distributions
|
||||
using EPM. To build a binary distribution type:
|
||||
|
||||
make <format> ENTER
|
||||
|
||||
or
|
||||
|
||||
gmake <format> ENTER
|
||||
|
||||
for FreeBSD, NetBSD, and OpenBSD. The <format> target is one of the following:
|
||||
|
||||
- "epm": Builds a script + tarfile package
|
||||
- "bsd": Builds a *BSD package
|
||||
- "deb": Builds a Debian package
|
||||
- "pkg": Builds a Solaris package
|
||||
- "rpm": Builds a RPM package
|
||||
- "slackware": Build a Slackware package
|
||||
|
||||
|
||||
GETTING DEBUG LOGGING FROM CUPS
|
||||
-------------------------------
|
||||
|
||||
When configured with the `--enable-debug-printfs` option, CUPS compiles in
|
||||
additional debug logging support in the scheduler, CUPS API, and CUPS Imaging
|
||||
API. The following environment variables are used to enable and control debug
|
||||
logging:
|
||||
|
||||
- `CUPS_DEBUG_FILTER`: Specifies a POSIX regular expression to control which
|
||||
messages are logged.
|
||||
- `CUPS_DEBUG_LEVEL`: Specifies a number from 0 to 9 to control the verbosity of
|
||||
the logging. The default level is 1.
|
||||
- `CUPS_DEBUG_LOG`: Specifies a log file to use. Specify the name "-" to send
|
||||
the messages to stderr. Prefix a filename with "+" to append to an existing
|
||||
file. You can include a single "%d" in the filename to embed the current
|
||||
process ID.
|
||||
|
||||
|
||||
REPORTING PROBLEMS
|
||||
------------------
|
||||
|
||||
If you have problems, *read the documentation first*! If the documentation does
|
||||
not solve your problems, please post a message on the users forum at:
|
||||
|
||||
https://www.cups.org/
|
||||
|
||||
Include your operating system and version, compiler and version, and any errors
|
||||
or problems you've run into. The "config.log" file and the output from the
|
||||
configure script and make should also be sent, as it often helps to determine
|
||||
the cause of your problem.
|
||||
|
||||
If you are running a version of Linux, be sure to provide the Linux distribution
|
||||
you have, too.
|
||||
-213
@@ -1,213 +0,0 @@
|
||||
INSTALL - CUPS v2.2b1 - 2016-05-31
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
information on CUPS see the file called "README.txt". A complete change log can
|
||||
be found in "CHANGES.txt".
|
||||
|
||||
*******************************************************************************
|
||||
*******************************************************************************
|
||||
**** ****
|
||||
**** USING CUPS REQUIRES ADDITIONAL THIRD-PARTY SUPPORT SOFTWARE AND ****
|
||||
**** PRINTER DRIVERS. THESE ARE TYPICALLY INCLUDED WITH YOUR OPERATING ****
|
||||
**** SYSTEM DISTRIBUTION. APPLE DOES NOT ENDORSE OR SUPPORT THIRD-PARTY ****
|
||||
**** SUPPORT SOFTWARE FOR CUPS. ****
|
||||
**** ****
|
||||
*******************************************************************************
|
||||
*******************************************************************************
|
||||
|
||||
|
||||
BEFORE YOU BEGIN
|
||||
|
||||
You'll need ANSI-compliant C and C++ compilers, plus a make program and
|
||||
POSIX-compliant shell (/bin/sh). The GNU compiler tools and Bash work well
|
||||
and we have tested the current CUPS code against several versions of GCC
|
||||
with excellent results.
|
||||
|
||||
The makefiles used by the project should work with most versions of make.
|
||||
We've tested them with GNU make as well as the make programs shipped by
|
||||
Compaq, HP, SGI, and Sun. BSD users should use GNU make (gmake) since BSD
|
||||
make does not support "include".
|
||||
|
||||
Besides these tools you'll want ZLIB library for compression support, the
|
||||
CDSA, GNU TLS, or OpenSSL libraries for encryption support, and either MIT
|
||||
(1.6.3 or higher) or Heimdal Kerberos for Kerberos support. CUPS will
|
||||
compile and run without these, however you'll miss out on many of the
|
||||
features provided by CUPS.
|
||||
|
||||
Also, please note that CUPS does not include print filters to support PDF
|
||||
or raster printing. You *must* download GPL Ghostscript and/or the Open
|
||||
Printing CUPS filters package separately to print on operating systems
|
||||
other than OS X.
|
||||
|
||||
|
||||
COMPILING THE SUBVERSION REPOSITORY CODE
|
||||
|
||||
The CUPS Subversion repository doesn't hold a copy of the pre-built
|
||||
configure script. You'll need to run the GNU autoconf software (2.60 or
|
||||
higher) to create it:
|
||||
|
||||
autoconf
|
||||
|
||||
|
||||
CONFIGURATION
|
||||
|
||||
CUPS uses GNU autoconf, so you should find the usual "configure" script in
|
||||
the main CUPS source directory. To configure CUPS for your system, type:
|
||||
|
||||
./configure
|
||||
|
||||
The default installation will put the CUPS software in the "/etc", "/usr",
|
||||
and "/var" directories on your system, which will overwrite any existing
|
||||
printing commands on your system. Use the "--prefix" option to install the
|
||||
CUPS software in another location:
|
||||
|
||||
./configure --prefix=/some/directory
|
||||
|
||||
To see a complete list of configuration options, use the --help option:
|
||||
|
||||
./configure --help
|
||||
|
||||
If any of the dependent libraries are not installed in a system default
|
||||
location (typically "/usr/include" and "/usr/lib") you'll need to set the
|
||||
CFLAGS, CPPFLAGS, CXXFLAGS, DSOFLAGS, and LDFLAGS environment variables
|
||||
prior to running configure:
|
||||
|
||||
setenv CFLAGS "-I/some/directory"
|
||||
setenv CPPFLAGS "-I/some/directory"
|
||||
setenv CXXFLAGS "-I/some/directory"
|
||||
setenv DSOFLAGS "-L/some/directory"
|
||||
setenv LDFLAGS "-L/some/directory"
|
||||
./configure ...
|
||||
|
||||
or:
|
||||
|
||||
CFLAGS="-I/some/directory" \
|
||||
CPPFLAGS="-I/some/directory" \
|
||||
CXXFLAGS="-I/some/directory" \
|
||||
DSOFLAGS="-L/some/directory" \
|
||||
LDFLAGS="-L/some/directory" \
|
||||
./configure ...
|
||||
|
||||
The "--enable-debug" option compiles CUPS with debugging information
|
||||
enabled. Additional debug logging support can be enabled using the
|
||||
"--enable-debug-printfs" option - these debug messages are enabled using the
|
||||
CUPS_DEBUG_LOG environment variable at run-time.
|
||||
|
||||
CUPS also includes an extensive set of unit tests that can be used to find
|
||||
and diagnose a variety of common problems - use the "--enable-unit-tests"
|
||||
configure option to run them at build time.
|
||||
|
||||
On OS X, use the "--with-archflags" option to build with the correct set of
|
||||
architectures:
|
||||
|
||||
./configure --with-archflags="-arch i386 -arch x86_64" ...
|
||||
|
||||
Once you have configured things, just type:
|
||||
|
||||
make ENTER
|
||||
|
||||
or if you have FreeBSD, NetBSD, or OpenBSD type:
|
||||
|
||||
gmake ENTER
|
||||
|
||||
to build the software.
|
||||
|
||||
|
||||
TESTING THE SOFTWARE
|
||||
|
||||
Aside from the built-in unit tests, CUPS includes an automated test
|
||||
framework for testing the entire printing system. To run the tests, just
|
||||
type:
|
||||
|
||||
make check ENTER
|
||||
|
||||
or if you have FreeBSD, NetBSD, or OpenBSD type:
|
||||
|
||||
gmake check ENTER
|
||||
|
||||
The test framework runs a copy of the CUPS scheduler (cupsd) on port 8631
|
||||
in /tmp/cups-$USER and produces a nice HTML report of the results.
|
||||
|
||||
|
||||
INSTALLING THE SOFTWARE
|
||||
|
||||
Once you have built the software you need to install it. The "install"
|
||||
target provides a quick way to install the software on your local system:
|
||||
|
||||
make install ENTER
|
||||
|
||||
or for FreeBSD, NetBSD, or OpenBSD:
|
||||
|
||||
gmake install ENTER
|
||||
|
||||
Use the BUILDROOT variable to install to an alternate root directory:
|
||||
|
||||
make BUILDROOT=/some/other/root/directory install ENTER
|
||||
|
||||
You can also build binary packages that can be installed on other machines
|
||||
using the RPM spec file ("packaging/cups.spec") or EPM list file
|
||||
("packaging/cups.list"). The latter also supports building of binary RPMs,
|
||||
so it may be more convenient to use.
|
||||
|
||||
You can find the RPM software at:
|
||||
|
||||
http://www.rpm.org/
|
||||
|
||||
The EPM software is available at:
|
||||
|
||||
http://www.msweet.org/
|
||||
|
||||
|
||||
CREATING BINARY DISTRIBUTIONS WITH EPM
|
||||
|
||||
The top level makefile supports generation of many types of binary
|
||||
distributions using EPM. To build a binary distribution type:
|
||||
|
||||
make <format> ENTER
|
||||
|
||||
or
|
||||
|
||||
gmake <format> ENTER
|
||||
|
||||
for FreeBSD, NetBSD, and OpenBSD. The <format> target is one of the
|
||||
following:
|
||||
|
||||
epm - Builds a script + tarfile package
|
||||
bsd - Builds a *BSD package
|
||||
deb - Builds a Debian package
|
||||
pkg - Builds a Solaris package
|
||||
rpm - Builds a RPM package
|
||||
slackware - Build a Slackware package
|
||||
|
||||
|
||||
GETTING DEBUG LOGGING FROM CUPS
|
||||
|
||||
When configured with the "--enable-debug-printfs" option, CUPS compiles in
|
||||
additional debug logging support in the scheduler, CUPS API, and CUPS
|
||||
Imaging API. The following environment variables are used to enable and
|
||||
control debug logging:
|
||||
|
||||
CUPS_DEBUG_FILTER Specifies a POSIX regular expression to control
|
||||
which messages are logged.
|
||||
CUPS_DEBUG_LEVEL Specifies a number from 0 to 9 to control the
|
||||
verbosity of the logging. The default level is 1.
|
||||
CUPS_DEBUG_LOG Specifies a log file to use. Specify the name "-"
|
||||
to send the messages to stderr. Prefix a filename
|
||||
with "+" to append to an existing file.
|
||||
|
||||
|
||||
REPORTING PROBLEMS
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! If the documentation
|
||||
does not solve your problems, please post a message on the users forum at:
|
||||
|
||||
http://www.cups.org/
|
||||
|
||||
Include your operating system and version, compiler and version, and any
|
||||
errors or problems you've run into. The "config.log" file and the output
|
||||
from the configure script and make should also be sent, as it often helps to
|
||||
determine the cause of your problem.
|
||||
|
||||
If you are running a version of Linux, be sure to provide the Linux
|
||||
distribution you have, too.
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
CUPS License Agreement
|
||||
|
||||
Copyright 2007-2013 by Apple Inc.
|
||||
Copyright 2007-2016 by Apple Inc.
|
||||
1 Infinite Loop
|
||||
Cupertino, CA 95014 USA
|
||||
|
||||
@@ -70,8 +70,8 @@ the following special exception:
|
||||
b. An Apple Operating System means any operating system
|
||||
software developed and/or marketed by Apple Inc.,
|
||||
including but not limited to all existing releases and
|
||||
versions of Apple's Darwin, OS X, and OS X Server
|
||||
products and all follow-on releases and future
|
||||
versions of Apple's Darwin, iOS, macOS, macOS Server, and
|
||||
tvOS products and all follow-on releases and future
|
||||
versions thereof.
|
||||
|
||||
c. This exception is only available for Apple
|
||||
|
||||
+34
-12
@@ -1,32 +1,42 @@
|
||||
#
|
||||
# Common makefile definitions for CUPS.
|
||||
#
|
||||
# Copyright 2007-2014 by Apple Inc.
|
||||
# Copyright 2007-2019 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
#
|
||||
# CUPS version...
|
||||
#
|
||||
|
||||
CUPS_VERSION = @CUPS_VERSION@
|
||||
|
||||
|
||||
#
|
||||
# Programs...
|
||||
#
|
||||
|
||||
AR = @AR@
|
||||
AWK = @AWK@
|
||||
CC = @LIBTOOL@ @CC@
|
||||
CC = @LIBTOOL_CC@ @CC@
|
||||
CHMOD = @CHMOD@
|
||||
CXX = @LIBTOOL@ @CXX@
|
||||
CXX = @LIBTOOL_CXX@ @CXX@
|
||||
DSO = @DSO@
|
||||
DSOXX = @DSOXX@
|
||||
GZIP = @GZIP@
|
||||
GZIPPROG = @GZIPPROG@
|
||||
INSTALL = @INSTALL@
|
||||
LD = @LD@
|
||||
LD_CC = @LD_CC@
|
||||
LD_CXX = @LD_CXX@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN = @LN@ -sf
|
||||
MKDIR = @MKDIR@ -p
|
||||
MV = @MV@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@ -f
|
||||
@@ -38,14 +48,14 @@ SHELL = /bin/sh
|
||||
# Installation programs...
|
||||
#
|
||||
|
||||
INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
|
||||
INSTALL_BIN = @LIBTOOL_INSTALL@ $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
|
||||
INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
|
||||
INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
|
||||
INSTALL_DATA = $(INSTALL) -c -m 444
|
||||
INSTALL_DIR = $(INSTALL) -d
|
||||
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
|
||||
INSTALL_LIB = @LIBTOOL_INSTALL@ $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@
|
||||
INSTALL_MAN = $(INSTALL) -c -m 444
|
||||
INSTALL_SCRIPT = $(INSTALL) -c -m 555
|
||||
INSTALL_SCRIPT = $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@
|
||||
|
||||
#
|
||||
# Default user, group, and system groups for the scheduler...
|
||||
@@ -72,15 +82,20 @@ LANGUAGES = @LANGUAGES@
|
||||
INSTALL_LANGUAGES = @INSTALL_LANGUAGES@
|
||||
UNINSTALL_LANGUAGES = @UNINSTALL_LANGUAGES@
|
||||
|
||||
#
|
||||
# Cross-compilation support: "local" target is used for any tools that are
|
||||
# built and run locally.
|
||||
#
|
||||
|
||||
LOCALTARGET = @LOCALTARGET@
|
||||
|
||||
|
||||
#
|
||||
# Libraries...
|
||||
#
|
||||
|
||||
LIBCUPS = @LIBCUPS@
|
||||
LIBCUPSCGI = @LIBCUPSCGI@
|
||||
LIBCUPSIMAGE = @LIBCUPSIMAGE@
|
||||
LIBCUPSMIME = @LIBCUPSMIME@
|
||||
LIBCUPSPPDC = @LIBCUPSPPDC@
|
||||
LIBCUPSSTATIC = @LIBCUPSSTATIC@
|
||||
LIBGSSAPI = @LIBGSSAPI@
|
||||
LIBMALLOC = @LIBMALLOC@
|
||||
@@ -108,6 +123,13 @@ IPPALIASES = @IPPALIASES@
|
||||
|
||||
INSTALLXPC = @INSTALLXPC@
|
||||
|
||||
#
|
||||
# Code signing...
|
||||
#
|
||||
|
||||
CODE_SIGN = @CODE_SIGN@
|
||||
CODE_SIGN_IDENTITY = -
|
||||
|
||||
#
|
||||
# Program options...
|
||||
#
|
||||
@@ -141,7 +163,7 @@ IPPFIND_MAN = @IPPFIND_MAN@
|
||||
LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
|
||||
-L../scheduler @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(LIBZ)
|
||||
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ)
|
||||
LINKCUPSIMAGE = @LINKCUPSIMAGE@
|
||||
LIBS = $(LINKCUPS) $(COMMONLIBS)
|
||||
ONDEMANDFLAGS = @ONDEMANDFLAGS@
|
||||
|
||||
+4
-37
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# Top-level Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2018 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include Makedefs
|
||||
@@ -272,32 +272,6 @@ apihelp:
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Create an Xcode docset using Mini-XML's mxmldoc (http://www.msweet.org/)...
|
||||
#
|
||||
|
||||
docset: apihelp
|
||||
echo Generating docset directory tree...
|
||||
$(RM) -r org.cups.docset
|
||||
mkdir -p org.cups.docset/Contents/Resources/Documentation/help
|
||||
mkdir -p org.cups.docset/Contents/Resources/Documentation/images
|
||||
cd man; $(MAKE) $(MFLAGS) html
|
||||
cd doc; $(MAKE) $(MFLAGS) docset
|
||||
cd cgi-bin; $(MAKE) $(MFLAGS) makedocset
|
||||
cgi-bin/makedocset org.cups.docset \
|
||||
`svnversion . | sed -e '1,$$s/[a-zA-Z]//g'` \
|
||||
doc/help/api-*.tokens
|
||||
$(RM) doc/help/api-*.tokens
|
||||
echo Indexing docset...
|
||||
/Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index org.cups.docset
|
||||
echo Generating docset archive and feed...
|
||||
$(RM) org.cups.docset.atom
|
||||
/Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil package --output org.cups.docset.xar \
|
||||
--atom org.cups.docset.atom \
|
||||
--download-url http://www.cups.org/org.cups.docset.xar \
|
||||
org.cups.docset
|
||||
|
||||
|
||||
#
|
||||
# Lines of code computation...
|
||||
#
|
||||
@@ -314,22 +288,15 @@ sloc:
|
||||
|
||||
EPMFLAGS = -v --output-dir dist $(EPMARCH)
|
||||
|
||||
bsd deb pkg slackware:
|
||||
bsd deb epm pkg rpm slackware:
|
||||
epm $(EPMFLAGS) -f $@ cups packaging/cups.list
|
||||
|
||||
epm:
|
||||
epm $(EPMFLAGS) -s packaging/installer.gif cups packaging/cups.list
|
||||
|
||||
rpm:
|
||||
epm $(EPMFLAGS) -f rpm -s packaging/installer.gif cups packaging/cups.list
|
||||
|
||||
.PHONEY: dist
|
||||
.PHONY: dist
|
||||
dist: all
|
||||
$(RM) -r dist
|
||||
$(MAKE) $(MFLAGS) epm
|
||||
case `uname` in \
|
||||
*BSD*) $(MAKE) $(MFLAGS) bsd;; \
|
||||
Darwin*) $(MAKE) $(MFLAGS) osx;; \
|
||||
Linux*) test ! -x /usr/bin/rpm || $(MAKE) $(MFLAGS) rpm;; \
|
||||
SunOS*) $(MAKE) $(MFLAGS) pkg;; \
|
||||
esac
|
||||
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
README - CUPS v2.2.13 - 2019-12-13
|
||||
==================================
|
||||
|
||||
Looking for compile instructions? Read the file `INSTALL.md` instead...
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
|
||||
CUPS is a standards-based, open source printing system developed by Apple Inc.
|
||||
for macOS® and other UNIX®-like operating systems. CUPS uses the Internet
|
||||
Printing Protocol ("IPP") and provides System V and Berkeley command-line
|
||||
interfaces, a web interface, and a C API to manage printers and print jobs. It
|
||||
supports printing to both local (parallel, serial, USB) and networked printers,
|
||||
and printers can be shared from one computer to another, even over the Internet!
|
||||
|
||||
Internally, CUPS uses PostScript Printer Description ("PPD") files to describe
|
||||
printer capabilities and features and a wide variety of generic and device-
|
||||
specific programs to convert and print many types of files. Sample drivers are
|
||||
included with CUPS to support many Dymo, EPSON, HP, Intellitech, OKIDATA, and
|
||||
Zebra printers. Many more drivers are available online and (in some cases) on
|
||||
the driver CD-ROM that came with your printer.
|
||||
|
||||
CUPS 2.2.x is licensed under the GNU General Public License and GNU Library
|
||||
General Public License versions 2. See the file "LICENSE.txt" for more
|
||||
information.
|
||||
|
||||
|
||||
READING THE DOCUMENTATION
|
||||
-------------------------
|
||||
|
||||
Once you have installed the software you can access the documentation (and a
|
||||
bunch of other stuff) online at <http://localhost:631/>.
|
||||
|
||||
If you're having trouble getting that far, the documentation is located under
|
||||
the `doc/help` and `man` directories.
|
||||
|
||||
Please read the documentation before asking questions.
|
||||
|
||||
|
||||
GETTING SUPPORT AND OTHER RESOURCES
|
||||
-----------------------------------
|
||||
|
||||
If you have problems, *read the documentation first!* We also provide two
|
||||
mailing lists which are available at <https://lists.cups.org/mailman/listinfo>.
|
||||
|
||||
See the CUPS web site at <https://www.cups.org/> for other resources.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES USING YOUR WEB BROWSER
|
||||
------------------------------------------------
|
||||
|
||||
CUPS includes a web-based administration tool that allows you to manage
|
||||
printers, classes, and jobs on your server. Open <http://localhost:631/admin/>
|
||||
in your browser to access the printer administration tools:
|
||||
|
||||
*Do not* use the hostname for your machine - it will not work with the default
|
||||
CUPS configuration. To enable administration access on other addresses, check
|
||||
the `Allow Remote Administration` box and click on the `Change Settings button.
|
||||
|
||||
You will be asked for the administration password (root or any other user in the
|
||||
sys/system/root/admin/lpadmin group on your system) when performing any
|
||||
administrative function.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
-----------------------------------------------
|
||||
|
||||
CUPS currently uses PPD (PostScript Printer Description) files that describe
|
||||
printer capabilities and driver programs needed for each printer. The
|
||||
`everywhere` PPD is used for nearly all modern networks printers sold since
|
||||
about 2009. For example, the following command creates a print queue for a
|
||||
printer at address 11.22.33.44:
|
||||
|
||||
lpadmin -p printername -E -v ipp://11.22.33.44/ipp/print -m everywhere
|
||||
|
||||
CUPS also includes several sample PPD files you can use for "legacy" printers:
|
||||
|
||||
Driver PPD Name
|
||||
----------------------------- ------------------------------
|
||||
Dymo Label Printers drv:///sample.drv/dymo.ppd
|
||||
Intellitech Intellibar drv:///sample.drv/intelbar.ppd
|
||||
EPSON 9-pin Series drv:///sample.drv/epson9.ppd
|
||||
EPSON 24-pin Series drv:///sample.drv/epson24.ppd
|
||||
Generic PCL Laser Printer drv:///sample.drv/generpcl.ppd
|
||||
Generic PostScript Printer drv:///sample.drv/generic.ppd
|
||||
HP DeskJet Series drv:///sample.drv/deskjet.ppd
|
||||
HP LaserJet Series drv:///sample.drv/laserjet.ppd
|
||||
OKIDATA 9-Pin Series drv:///sample.drv/okidata9.ppd
|
||||
OKIDATA 24-Pin Series drv:///sample.drv/okidat24.ppd
|
||||
Zebra CPCL Label Printer drv:///sample.drv/zebracpl.ppd
|
||||
Zebra EPL1 Label Printer drv:///sample.drv/zebraep1.ppd
|
||||
Zebra EPL2 Label Printer drv:///sample.drv/zebraep2.ppd
|
||||
Zebra ZPL Label Printer drv:///sample.drv/zebra.ppd
|
||||
|
||||
You can run the `lpinfo -m` command to list all of the available drivers:
|
||||
|
||||
lpinfo -m
|
||||
|
||||
Run the `lpinfo -v` command to list the available printers:
|
||||
|
||||
lpinfo -v
|
||||
|
||||
Then use the correct URI to add the printer using the `lpadmin` command:
|
||||
|
||||
lpadmin -p printername -E -v device-uri -m ppd-name
|
||||
|
||||
Current network printers typically use `ipp` or `ipps` URIS:
|
||||
|
||||
lpadmin -p printername -E -v ipp://11.22.33.44/ipp/print -m everywhere
|
||||
lpadmin -p printername -E -v ipps://11.22.33.44/ipp/print -m everywhere
|
||||
|
||||
Older network printers typically use `socket` or `lpd` URIs:
|
||||
|
||||
lpadmin -p printername -E -v socket://11.22.33.44 -m ppd-name
|
||||
lpadmin -p printername -E -v lpd://11.22.33.44/ -m ppd-name
|
||||
|
||||
The sample drivers provide basic printing capabilities, but generally do not
|
||||
exercise the full potential of the printers or CUPS. Other drivers provide
|
||||
greater printing capabilities.
|
||||
|
||||
|
||||
PRINTING FILES
|
||||
--------------
|
||||
|
||||
CUPS provides both the System V `lp` and Berkeley `lpr` commands for printing:
|
||||
|
||||
lp filename
|
||||
lpr filename
|
||||
|
||||
Both the `lp` and `lpr` commands support printing options for the driver:
|
||||
|
||||
lp -o media=A4 -o resolution=600dpi filename
|
||||
lpr -o media=A4 -o resolution=600dpi filename
|
||||
|
||||
CUPS recognizes many types of images files as well as PDF, PostScript, and text
|
||||
files, so you can print those files directly rather than through an application.
|
||||
|
||||
If you have an application that generates output specifically for your printer
|
||||
then you need to use the `-oraw` or `-l` options:
|
||||
|
||||
lp -o raw filename
|
||||
lpr -l filename
|
||||
|
||||
This will prevent the filters from misinterpreting your print file.
|
||||
|
||||
|
||||
LEGAL STUFF
|
||||
-----------
|
||||
|
||||
CUPS is copyright © 2007-2019 by Apple Inc. CUPS and the CUPS logo are
|
||||
trademarks of Apple Inc.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
CUPS is provided under the terms of version 2 of the GNU General Public License
|
||||
and GNU Library General Public License. This program is distributed in the hope
|
||||
that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
`doc/help/license.html` or `LICENSE.txt` files for more information.
|
||||
-152
@@ -1,152 +0,0 @@
|
||||
README - CUPS v2.2b1 - 2016-05-31
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt" instead...
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
CUPS is a standards-based, open source printing system developed by Apple
|
||||
Inc. for OS® X and other UNIX®-like operating systems. CUPS uses the
|
||||
Internet Printing Protocol ("IPP") and provides System V and Berkeley
|
||||
command-line interfaces, a web interface, and a C API to manage printers and
|
||||
print jobs. It supports printing to both local (parallel, serial, USB) and
|
||||
networked printers, and printers can be shared from one computer to another,
|
||||
even over the Internet!
|
||||
|
||||
Internally, CUPS uses PostScript Printer Description ("PPD") files to
|
||||
describe printer capabilities and features and a wide variety of generic
|
||||
and device-specific programs to convert and print many types of files.
|
||||
Sample drivers are included with CUPS to support many Dymo, EPSON, HP,
|
||||
Intellitech, OKIDATA, and Zebra printers. Many more drivers are available
|
||||
online and (in some cases) on the driver CD-ROM that came with your printer.
|
||||
|
||||
CUPS is licensed under the GNU General Public License and GNU Library
|
||||
General Public License versions 2. See the file "LICENSE.txt" for more
|
||||
information.
|
||||
|
||||
|
||||
READING THE DOCUMENTATION
|
||||
|
||||
Once you have installed the software you can access the documentation (and
|
||||
a bunch of other stuff) online at:
|
||||
|
||||
http://localhost:631/
|
||||
|
||||
If you're having trouble getting that far, the documentation is located
|
||||
under the "doc/help" directory.
|
||||
|
||||
Please read the documentation before asking questions.
|
||||
|
||||
|
||||
GETTING SUPPORT AND OTHER RESOURCES
|
||||
|
||||
If you have problems, READ THE DOCUMENTATION FIRST! We also provide two
|
||||
mailing lists which are available at:
|
||||
|
||||
http://www.cups.org/lists.php
|
||||
|
||||
See the CUPS web site at "http://www.cups.org/" for other resources.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES USING YOUR WEB BROWSER
|
||||
|
||||
CUPS includes a web-based administration tool that allows you to manage
|
||||
printers, classes, and jobs on your server. Open the following URL in your
|
||||
browser to access the printer administration tools:
|
||||
|
||||
http://localhost:631/admin/
|
||||
|
||||
DO NOT use the hostname for your machine - it will not work with the default
|
||||
CUPS configuration. To enable administration access on other addresses,
|
||||
check the "Allow Remote Administration" box and click on the "Change
|
||||
Settings" button.
|
||||
|
||||
You will be asked for the administration password (root or any other user in
|
||||
the sys/system/root/admin/lpadmin group on your system) when performing any
|
||||
administrative function.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
|
||||
CUPS works best with PPD (PostScript Printer Description) files. In a pinch
|
||||
you can also use System V style printer interface scripts.
|
||||
|
||||
CUPS includes several sample PPD files you can use:
|
||||
|
||||
Driver PPD Name
|
||||
----------------------------- ------------------------------
|
||||
Dymo Label Printers drv:///sample.drv/dymo.ppd
|
||||
Intellitech Intellibar drv:///sample.drv/intelbar.ppd
|
||||
EPSON 9-pin Series drv:///sample.drv/epson9.ppd
|
||||
EPSON 24-pin Series drv:///sample.drv/epson24.ppd
|
||||
Generic PCL Laser Printer drv:///sample.drv/generpcl.ppd
|
||||
Generic PostScript Printer drv:///sample.drv/generic.ppd
|
||||
HP DeskJet Series drv:///sample.drv/deskjet.ppd
|
||||
HP LaserJet Series drv:///sample.drv/laserjet.ppd
|
||||
OKIDATA 9-Pin Series drv:///sample.drv/okidata9.ppd
|
||||
OKIDATA 24-Pin Series drv:///sample.drv/okidat24.ppd
|
||||
Zebra CPCL Label Printer drv:///sample.drv/zebracpl.ppd
|
||||
Zebra EPL1 Label Printer drv:///sample.drv/zebraep1.ppd
|
||||
Zebra EPL2 Label Printer drv:///sample.drv/zebraep2.ppd
|
||||
Zebra ZPL Label Printer drv:///sample.drv/zebra.ppd
|
||||
|
||||
Run the "lpinfo -m" command to list the available drivers:
|
||||
|
||||
lpinfo -m
|
||||
|
||||
Run the "lpinfo -v" command to list the available printers:
|
||||
|
||||
lpinfo -v
|
||||
|
||||
Then use the correct URI to add the printer using the "lpadmin" command:
|
||||
|
||||
lpadmin -p printername -E -v device-uri -m ppd-name
|
||||
|
||||
Network printers typically use "socket" or "lpd" URIs:
|
||||
|
||||
lpadmin -p printername -E -v socket://11.22.33.44 -m ppd-name
|
||||
lpadmin -p printername -E -v lpd://11.22.33.44/ -m ppd-name
|
||||
|
||||
The sample drivers provide basic printing capabilities, but generally do not
|
||||
exercise the full potential of the printers or CUPS.
|
||||
|
||||
|
||||
PRINTING FILES
|
||||
|
||||
CUPS provides both the System V "lp" and Berkeley "lpr" commands for
|
||||
printing:
|
||||
|
||||
lp filename
|
||||
lpr filename
|
||||
|
||||
Both the "lp" and "lpr" commands support printing options for the driver:
|
||||
|
||||
lp -o media=A4 -o resolution=600dpi filename
|
||||
lpr -o media=A4 -o resolution=600dpi filename
|
||||
|
||||
CUPS recognizes many types of images files as well as PDF, PostScript,
|
||||
and text files, so you can print those files directly rather than through
|
||||
an application.
|
||||
|
||||
If you have an application that generates output specifically for your
|
||||
printer then you need to use the "-oraw" or "-l" options:
|
||||
|
||||
lp -o raw filename
|
||||
lpr -l filename
|
||||
|
||||
This will prevent the filters from misinterpreting your print file.
|
||||
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007-2016 by Apple Inc. CUPS and the CUPS logo are
|
||||
trademarks of Apple Inc.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
CUPS is provided under the terms of version 2 of the GNU General Public
|
||||
License and GNU Library General Public License. This program is distributed
|
||||
in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the "doc/help/license.html" or "LICENSE.txt" files for more information.
|
||||
+20
-13
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# Backend makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
@@ -24,7 +24,7 @@ include ../Makedefs
|
||||
# UBACKENDS and ULBACKENDS are installed mode 0755 so cupsd will run them as
|
||||
# an unprivileged user...
|
||||
#
|
||||
# See http://www.cups.org/documentation.php/api-filter.html for more info...
|
||||
# See http://www.cups.org/doc/api-filter.html for more info...
|
||||
RBACKENDS = \
|
||||
ipp \
|
||||
lpd \
|
||||
@@ -207,7 +207,7 @@ uninstall:
|
||||
|
||||
test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
|
||||
$(LD_CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
|
||||
@@ -249,7 +249,8 @@ libbackend.a: $(LIBOBJS)
|
||||
|
||||
dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
if test `uname` = Darwin; then \
|
||||
$(RM) mdns; \
|
||||
$(LN) dnssd mdns; \
|
||||
@@ -262,7 +263,8 @@ dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
$(RM) http
|
||||
$(LN) ipp http
|
||||
|
||||
@@ -273,7 +275,8 @@ ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -282,7 +285,8 @@ lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -291,13 +295,15 @@ snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
socket: socket.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \
|
||||
$(LD_CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -306,8 +312,9 @@ socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
|
||||
|
||||
usb: usb.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
|
||||
$(BACKLIBS) $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
|
||||
|
||||
|
||||
|
||||
@@ -312,6 +312,7 @@ extern int backendGetDeviceID(int fd, char *device_id,
|
||||
extern int backendGetMakeModel(const char *device_id,
|
||||
char *make_model,
|
||||
size_t make_model_size);
|
||||
extern http_addrlist_t *backendLookup(const char *hostname, int port, int *cancel);
|
||||
extern int backendNetworkSideCB(int print_fd, int device_fd,
|
||||
int snmp_fd, http_addr_t *addr,
|
||||
int use_bc);
|
||||
|
||||
+15
-8
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2008-2015 by Apple Inc.
|
||||
* Copyright 2008-2018 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -94,7 +94,7 @@ static void browse_callback(DNSServiceRef sdRef,
|
||||
const char *serviceName,
|
||||
const char *regtype,
|
||||
const char *replyDomain, void *context)
|
||||
__attribute__((nonnull(1,5,6,7,8)));
|
||||
_CUPS_NONNULL((1,5,6,7,8));
|
||||
static void browse_local_callback(DNSServiceRef sdRef,
|
||||
DNSServiceFlags flags,
|
||||
uint32_t interfaceIndex,
|
||||
@@ -103,7 +103,7 @@ static void browse_local_callback(DNSServiceRef sdRef,
|
||||
const char *regtype,
|
||||
const char *replyDomain,
|
||||
void *context)
|
||||
__attribute__((nonnull(1,5,6,7,8)));
|
||||
_CUPS_NONNULL((1,5,6,7,8));
|
||||
#endif /* HAVE_DNSSD */
|
||||
#ifdef HAVE_AVAHI
|
||||
static void browse_callback(AvahiServiceBrowser *browser,
|
||||
@@ -121,12 +121,12 @@ static void client_callback(AvahiClient *client,
|
||||
#endif /* HAVE_AVAHI */
|
||||
|
||||
static int compare_devices(cups_device_t *a, cups_device_t *b);
|
||||
static void exec_backend(char **argv) __attribute__((noreturn));
|
||||
static void exec_backend(char **argv) _CUPS_NORETURN;
|
||||
static cups_device_t *get_device(cups_array_t *devices,
|
||||
const char *serviceName,
|
||||
const char *regtype,
|
||||
const char *replyDomain)
|
||||
__attribute__((nonnull(1,2,3,4)));
|
||||
_CUPS_NONNULL((1,2,3,4));
|
||||
#ifdef HAVE_DNSSD
|
||||
static void query_callback(DNSServiceRef sdRef,
|
||||
DNSServiceFlags flags,
|
||||
@@ -136,7 +136,7 @@ static void query_callback(DNSServiceRef sdRef,
|
||||
uint16_t rrclass, uint16_t rdlen,
|
||||
const void *rdata, uint32_t ttl,
|
||||
void *context)
|
||||
__attribute__((nonnull(1,5,9,11)));
|
||||
_CUPS_NONNULL((1,5,9,11));
|
||||
#elif defined(HAVE_AVAHI)
|
||||
static int poll_callback(struct pollfd *pollfds,
|
||||
unsigned int num_pollfds, int timeout,
|
||||
@@ -153,7 +153,7 @@ static void query_callback(AvahiRecordBrowser *browser,
|
||||
#endif /* HAVE_DNSSD */
|
||||
static void sigterm_handler(int sig);
|
||||
static void unquote(char *dst, const char *src, size_t dstsize)
|
||||
__attribute__((nonnull(1,2)));
|
||||
_CUPS_NONNULL((1,2));
|
||||
|
||||
|
||||
/*
|
||||
@@ -949,7 +949,7 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
*
|
||||
* Note: This function is needed because avahi_simple_poll_iterate is broken
|
||||
* and always uses a timeout of 0 (!) milliseconds.
|
||||
* (Avahi Ticket #364)
|
||||
* (https://github.com/lathiat/avahi/issues/127)
|
||||
*/
|
||||
|
||||
static int /* O - Number of file descriptors matching */
|
||||
@@ -1257,6 +1257,13 @@ query_callback(
|
||||
strlcat(make_and_model, " ", sizeof(make_and_model));
|
||||
strlcat(make_and_model, model, sizeof(make_and_model));
|
||||
|
||||
if (!_cups_strncasecmp(make_and_model, "EPSON EPSON ", 12))
|
||||
_cups_strcpy(make_and_model, make_and_model + 6);
|
||||
else if (!_cups_strncasecmp(make_and_model, "HP HP ", 6))
|
||||
_cups_strcpy(make_and_model, make_and_model + 3);
|
||||
else if (!_cups_strncasecmp(make_and_model, "Lexmark International Lexmark ", 30))
|
||||
_cups_strcpy(make_and_model, make_and_model + 22);
|
||||
|
||||
device->make_and_model = strdup(make_and_model);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -88,7 +88,7 @@ backendGetDeviceID(
|
||||
*device_id = '\0';
|
||||
|
||||
# ifdef __linux
|
||||
if (ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
|
||||
if (ioctl(fd, LPIOC_GET_DEVICE_ID((unsigned)device_id_size), device_id))
|
||||
{
|
||||
/*
|
||||
* Linux has to implement things differently for every device it seems.
|
||||
|
||||
+332
-240
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+22
-32
@@ -24,14 +24,14 @@
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <winsock.h>
|
||||
#else
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
# include <arpa/inet.h>
|
||||
# include <netdb.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
#ifdef __APPLE__
|
||||
# include <CoreFoundation/CFNumber.h>
|
||||
# include <CoreFoundation/CFPreferences.h>
|
||||
@@ -76,7 +76,11 @@ static int abort_job = 0; /* Non-zero if we get SIGTERM */
|
||||
*/
|
||||
|
||||
static int cups_rresvport(int *port, int family);
|
||||
static int lpd_command(int lpd_fd, char *format, ...);
|
||||
static int lpd_command(int lpd_fd, char *format, ...)
|
||||
# ifdef __GNUC__
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)))
|
||||
# endif /* __GNUC__ */
|
||||
;
|
||||
static int lpd_queue(const char *hostname, http_addrlist_t *addrlist,
|
||||
const char *printer, int print_fd, int snmp_fd,
|
||||
int mode, const char *user, const char *title,
|
||||
@@ -111,7 +115,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
*filename, /* File to print */
|
||||
title[256]; /* Title string */
|
||||
int port; /* Port number */
|
||||
char portname[256]; /* Port name (string) */
|
||||
http_addrlist_t *addrlist; /* List of addresses for printer */
|
||||
int snmp_enabled = 1; /* Is SNMP enabled? */
|
||||
int snmp_fd; /* SNMP socket */
|
||||
@@ -411,23 +414,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* Find the printer...
|
||||
*/
|
||||
|
||||
snprintf(portname, sizeof(portname), "%d", port);
|
||||
addrlist = backendLookup(hostname, port, NULL);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to locate printer \"%s\"."), hostname);
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
exit(CUPS_BACKEND_FAILED);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* See if the printer supports SNMP...
|
||||
*/
|
||||
|
||||
if (snmp_enabled)
|
||||
snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
|
||||
@@ -636,11 +627,11 @@ cups_rresvport(int *port, /* IO - Port number to bind to */
|
||||
* -1...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
closesocket(fd);
|
||||
#else
|
||||
close(fd);
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
return (-1);
|
||||
}
|
||||
@@ -748,11 +739,11 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
ssize_t nbytes; /* Number of bytes written */
|
||||
off_t tbytes; /* Total bytes written */
|
||||
char buffer[32768]; /* Output buffer */
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
DWORD tv; /* Timeout in milliseconds */
|
||||
#else
|
||||
struct timeval tv; /* Timeout in secs and usecs */
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -880,8 +871,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(error));
|
||||
|
||||
if (error == ECONNREFUSED || error == EHOSTDOWN ||
|
||||
error == EHOSTUNREACH)
|
||||
if (errno == ECONNREFUSED || errno == EHOSTDOWN || errno == EHOSTUNREACH || errno == ETIMEDOUT || errno == ENOTCONN)
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
@@ -899,13 +889,13 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
break;
|
||||
|
||||
case EHOSTUNREACH :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is unreachable at "
|
||||
"this time."));
|
||||
break;
|
||||
|
||||
case ECONNREFUSED :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is in use."));
|
||||
break;
|
||||
@@ -936,7 +926,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Set the timeout...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
tv = (DWORD)(timeout * 1000);
|
||||
|
||||
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv));
|
||||
@@ -947,7 +937,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
|
||||
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
||||
setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Connected to printer."));
|
||||
@@ -1066,7 +1056,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send the control file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
if (lpd_command(fd, "\002%d cfA%03d%.15s\n", (int)strlen(control),
|
||||
(int)getpid() % 1000, localhost))
|
||||
{
|
||||
close(fd);
|
||||
@@ -1116,7 +1106,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send the print file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, "\003" CUPS_LLFMT " dfA%03.3d%.15s\n",
|
||||
if (lpd_command(fd, "\003" CUPS_LLFMT " dfA%03d%.15s\n",
|
||||
CUPS_LLCAST filestats.st_size, (int)getpid() % 1000,
|
||||
localhost))
|
||||
{
|
||||
@@ -1199,7 +1189,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send control file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
if (lpd_command(fd, "\002%d cfA%03d%.15s\n", (int)strlen(control),
|
||||
(int)getpid() % 1000, localhost))
|
||||
{
|
||||
close(fd);
|
||||
|
||||
+60
-2
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Common backend network APIs for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -26,7 +26,6 @@
|
||||
* 'backendCheckSideChannel()' - Check the side-channel for pending requests.
|
||||
*/
|
||||
|
||||
|
||||
void
|
||||
backendCheckSideChannel(
|
||||
int snmp_fd, /* I - SNMP socket */
|
||||
@@ -46,6 +45,65 @@ backendCheckSideChannel(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'backendLookup()' - Lookup the given host and log addresses.
|
||||
*/
|
||||
|
||||
http_addrlist_t * /* O - List of addresses or NULL */
|
||||
backendLookup(const char *hostname, /* I - Hostname */
|
||||
int port, /* I - Port number */
|
||||
int *cancel) /* I - Variable to watch for job cancel */
|
||||
{
|
||||
char portname[32], /* Port number as string */
|
||||
addrname[256]; /* Address as string */
|
||||
http_addrlist_t *addrlist, /* List of addresses */
|
||||
*current; /* Current address */
|
||||
|
||||
|
||||
/*
|
||||
* Lookup the address for the named host...
|
||||
*/
|
||||
|
||||
snprintf(portname, sizeof(portname), "%d", port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Unable to locate printer \"%s\"."), hostname);
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
exit(CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
if (cancel && *cancel)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
exit(CUPS_BACKEND_OK);
|
||||
}
|
||||
}
|
||||
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
|
||||
/*
|
||||
* Log the addresses we got...
|
||||
*/
|
||||
|
||||
for (current = addrlist; current; current = current->next)
|
||||
fprintf(stderr, "DEBUG: %s=%s\n", hostname, httpAddrString(¤t->addr, addrname, sizeof(addrname)));
|
||||
|
||||
/*
|
||||
* Return...
|
||||
*/
|
||||
|
||||
return (addrlist);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'backendNetworkSideCB()' - Handle common network side-channel commands.
|
||||
*/
|
||||
|
||||
@@ -8,10 +8,17 @@
|
||||
# delay-close Delay close/reset of selected interface
|
||||
# no-reattach Do no re-attach usblp kernel module after printing.
|
||||
# soft-reset Do a soft reset after printing for cleanup.
|
||||
# unidir Only supported unidirectional I/O
|
||||
# unidir Only supports unidirectional I/O
|
||||
# usb-init Needs vendor USB initialization string.
|
||||
# vendor-class Uses vendor-specific class or subclass.
|
||||
# whitelist The printer is functional with the USB backend.
|
||||
#
|
||||
# To get the USB vendor and product IDs for a given printer, run the "lsusb"
|
||||
# command, which will show something like the following:
|
||||
#
|
||||
# Bus 002 Device 003: ID ab21:34dc Acme Example Printer
|
||||
#
|
||||
# The "ab21:34dc" is the vendor and product ID, separated by a colon.
|
||||
|
||||
# HP DeskJet 895C
|
||||
0x03f0 0x0004 unidir
|
||||
@@ -76,6 +83,9 @@
|
||||
# Canon, Inc. MP510 Printer (https://bugs.launchpad.net/bugs/1050009)
|
||||
0x04a9 0x1717 unidir
|
||||
|
||||
# Canon, Inc. MP540 Printer, https://bugzilla.redhat.com/967873
|
||||
0x04a9 0x1730 unidir
|
||||
|
||||
# Canon, Inc. MP550 Printer (Issue #4155)
|
||||
0x04a9 0x173d unidir
|
||||
|
||||
@@ -127,8 +137,11 @@
|
||||
# All Samsung devices (https://bugs.launchpad.net/bugs/1032456)
|
||||
0x04e8 soft-reset
|
||||
|
||||
# All Zebra devices (https://bugs.launchpad.net/bugs/1001028)
|
||||
0x0a5f unidir
|
||||
# Samsung ML-2160 Series (https://bugzilla.redhat.com/show_bug.cgi?id=873123)
|
||||
0x04e8 0x330f unidir
|
||||
|
||||
# All Zebra devices (https://bugs.launchpad.net/bugs/1001028) (Issue #5395)
|
||||
0x0a5f unidir no-reattach
|
||||
|
||||
# Canon CP-10
|
||||
0x04a9 0x304a blacklist
|
||||
@@ -229,6 +242,9 @@
|
||||
# All Intermec devices (Issue #4553)
|
||||
0x067e no-reattach
|
||||
|
||||
# HP LaserJet 1015 (Issue #5617)
|
||||
0x03f0 0x0e17 delay-close
|
||||
|
||||
# HP LaserJet 1150 (Issue #4549)
|
||||
0x03f0 0x0f17 delay-close
|
||||
|
||||
@@ -247,3 +263,42 @@
|
||||
|
||||
# Lexmark C540n (Issue #4778)
|
||||
0x043d 0x0139 no-reattach
|
||||
|
||||
# Kyocera Ecosys P6026cdn (Issue #4900)
|
||||
0x0482 0x063f no-reattach
|
||||
|
||||
# Kyocera Ecosys P6130cdn (Issue #5102)
|
||||
0x0482 0x0677 no-reattach
|
||||
|
||||
# Lexmark E260dn (Issue #4994)
|
||||
0x043d 0x0123 no-reattach
|
||||
|
||||
# HP LaserJet 1160 (Issue #5121)
|
||||
0x03f0 0x1e17 delay-close
|
||||
|
||||
# Canon, Inc. MP280 series (Issue #5221)
|
||||
0x04a9 0x1746 unidir
|
||||
|
||||
# Star Micronics printers (Issue #5251)
|
||||
0x0519 unidir
|
||||
|
||||
# Lexmark Optra E310 (Issue #5259)
|
||||
0x043d 0x000c no-reattach
|
||||
|
||||
# HP LaserJet P1102 (Issue #5310)
|
||||
0x03F0 0x002A no-reattach
|
||||
|
||||
# Lexmark MS317dn
|
||||
0x043d 0x0226 no-reattach
|
||||
|
||||
# Star TSP743 (Issue #5443)
|
||||
0x0519 0x0001 delay-close
|
||||
|
||||
# Lexmark E120n (Issue #5478)
|
||||
0x043d 0x00cc no-reattach
|
||||
|
||||
# All Xerox printers (Issue #5523)
|
||||
0x0924 no-reattach
|
||||
|
||||
# Dymo 450 Turbo (Issue #5521)
|
||||
0x0922 0x0021 unidir
|
||||
|
||||
+2
-2
@@ -77,7 +77,7 @@ backendDrainOutput(int print_fd, /* I - Print file descriptor */
|
||||
* Read error - bail if we don't see EAGAIN or EINTR...
|
||||
*/
|
||||
|
||||
if (errno != EAGAIN || errno != EINTR)
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Read failed: %s\n", strerror(errno));
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to read print data."));
|
||||
@@ -305,7 +305,7 @@ backendRunLoop(
|
||||
* Read error - bail if we don't see EAGAIN or EINTR...
|
||||
*/
|
||||
|
||||
if (errno != EAGAIN || errno != EINTR)
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Read failed: %s\n", strerror(errno));
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
|
||||
+12
-28
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AppSocket backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <winsock.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
@@ -32,7 +32,7 @@
|
||||
# include <netinet/in.h>
|
||||
# include <arpa/inet.h>
|
||||
# include <netdb.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -69,7 +69,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
int contimeout; /* Connection timeout */
|
||||
int waiteof; /* Wait for end-of-file? */
|
||||
int port; /* Port number */
|
||||
char portname[255]; /* Port name */
|
||||
int delay; /* Delay for retries... */
|
||||
int device_fd; /* AppSocket */
|
||||
int error; /* Error code (if any) */
|
||||
@@ -264,23 +263,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
start_time = time(NULL);
|
||||
|
||||
sprintf(portname, "%d", port);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
|
||||
|
||||
while ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, portname)) == NULL)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO",
|
||||
_("Unable to locate printer \"%s\"."), hostname);
|
||||
sleep(10);
|
||||
|
||||
if (getenv("CLASS") != NULL)
|
||||
{
|
||||
fputs("STATE: -connecting-to-device\n", stderr);
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
}
|
||||
addrlist = backendLookup(hostname, port, NULL);
|
||||
|
||||
/*
|
||||
* See if the printer supports SNMP...
|
||||
@@ -347,8 +330,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
fprintf(stderr, "DEBUG: Connection error: %s\n", strerror(error));
|
||||
|
||||
if (error == ECONNREFUSED || error == EHOSTDOWN ||
|
||||
error == EHOSTUNREACH)
|
||||
if (errno == ECONNREFUSED || errno == EHOSTDOWN || errno == EHOSTUNREACH || errno == ETIMEDOUT || errno == ENOTCONN)
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
@@ -366,13 +348,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
break;
|
||||
|
||||
case EHOSTUNREACH :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is unreachable at this "
|
||||
"time."));
|
||||
break;
|
||||
|
||||
case ECONNREFUSED :
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "WARNING",
|
||||
_("The printer is in use."));
|
||||
break;
|
||||
@@ -420,8 +402,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
lseek(print_fd, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
tbytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addrlist->addr), 1,
|
||||
0, backendNetworkSideCB);
|
||||
if ((bytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addrlist->addr), 1, 0, backendNetworkSideCB)) < 0)
|
||||
tbytes = -1;
|
||||
else
|
||||
tbytes = bytes;
|
||||
|
||||
if (print_fd != 0 && tbytes >= 0)
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Print file sent."));
|
||||
@@ -429,7 +413,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
fputs("STATE: +cups-waiting-for-job-completed\n", stderr);
|
||||
|
||||
if (waiteof)
|
||||
if (waiteof && tbytes >= 0)
|
||||
{
|
||||
/*
|
||||
* Shutdown the socket and wait for the other end to finish...
|
||||
@@ -466,7 +450,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
if (print_fd != 0)
|
||||
close(print_fd);
|
||||
|
||||
return (CUPS_BACKEND_OK);
|
||||
return (tbytes >= 0 ? CUPS_BACKEND_OK : CUPS_BACKEND_FAILED);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
*/
|
||||
|
||||
#include <cups/string-private.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#include "ieee1284.c"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Backend test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -38,7 +38,7 @@ static int job_canceled = 0;
|
||||
*/
|
||||
|
||||
static void sigterm_handler(int sig);
|
||||
static void usage(void) __attribute__((noreturn));
|
||||
static void usage(void) _CUPS_NORETURN;
|
||||
static void walk_cb(const char *oid, const char *data, int datalen,
|
||||
void *context);
|
||||
|
||||
|
||||
+2
-36
@@ -285,16 +285,15 @@ static void parse_options(char *options, char *serial, int serial_size, UInt32 *
|
||||
static void setup_cfLanguage(void);
|
||||
static void soft_reset(void);
|
||||
static void status_timer_cb(CFRunLoopTimerRef timer, void *info);
|
||||
static void log_usb_class_driver(int is_64bit);
|
||||
#define IS_64BIT 1
|
||||
#define IS_NOT_64BIT 0
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
static pid_t child_pid; /* Child PID */
|
||||
static void run_legacy_backend(int argc, char *argv[], int fd) __attribute__((noreturn)); /* Starts child backend process running as a ppc executable */
|
||||
static void run_legacy_backend(int argc, char *argv[], int fd) _CUPS_NORETURN; /* Starts child backend process running as a ppc executable */
|
||||
#endif /* __i386__ || __x86_64__ */
|
||||
static void sigterm_handler(int sig); /* SIGTERM handler */
|
||||
static void sigquit_handler(int sig, siginfo_t *si, void *unused) __attribute__((noreturn));
|
||||
static void sigquit_handler(int sig, siginfo_t *si, void *unused) _CUPS_NORETURN;
|
||||
|
||||
#ifdef PARSE_PS_ERRORS
|
||||
static const char *next_line (const char *buffer);
|
||||
@@ -471,11 +470,6 @@ print_device(const char *uri, /* I - Device URI */
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
if (status == noErr && driverBundlePath != NULL && CFStringCompare(driverBundlePath, kUSBGenericTOPrinterClassDriver, 0) != kCFCompareEqualTo)
|
||||
log_usb_class_driver(IS_64BIT);
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
if (driverBundlePath)
|
||||
CFRelease(driverBundlePath);
|
||||
|
||||
@@ -2097,8 +2091,6 @@ static void run_legacy_backend(int argc,
|
||||
|
||||
if (!usb_legacy_status)
|
||||
{
|
||||
log_usb_class_driver(IS_NOT_64BIT);
|
||||
|
||||
/*
|
||||
* Setup a SIGTERM handler then block it before forking...
|
||||
*/
|
||||
@@ -2475,29 +2467,3 @@ static void get_device_id(cups_sc_status_t *status,
|
||||
|
||||
*status = CUPS_SC_STATUS_OK;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
log_usb_class_driver(int is_64bit) /* I - Is the USB class driver 64-bit? */
|
||||
{
|
||||
/*
|
||||
* Report the usage of legacy USB class drivers to Apple if the user opts into providing
|
||||
* feedback to Apple...
|
||||
*/
|
||||
|
||||
aslmsg aslm = asl_new(ASL_TYPE_MSG);
|
||||
if (aslm)
|
||||
{
|
||||
ppd_file_t *ppd = ppdOpenFile(getenv("PPD"));
|
||||
const char *make_model = ppd ? ppd->nickname : NULL;
|
||||
ppd_attr_t *version = ppdFindAttr(ppd, "FileVersion", "");
|
||||
|
||||
asl_set(aslm, "com.apple.message.domain", "com.apple.printing.usb.64bit");
|
||||
asl_set(aslm, "com.apple.message.result", is_64bit ? "yes" : "no");
|
||||
asl_set(aslm, "com.apple.message.signature", make_model ? make_model : "Unknown");
|
||||
asl_set(aslm, "com.apple.message.signature2", version ? version->value : "?.?");
|
||||
asl_set(aslm, "com.apple.message.summarize", "YES");
|
||||
asl_log(NULL, aslm, ASL_LEVEL_NOTICE, "");
|
||||
asl_free(aslm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* LIBUSB interface code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2019 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -829,8 +829,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
err = libusb_init(NULL);
|
||||
if (err)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
|
||||
"libusb error %i\n", (int)err);
|
||||
fprintf(stderr, "ERROR: Unable to initialize USB access via libusb, libusb error %i (%s)\n", (int)err, libusb_strerror((int)err));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -882,7 +881,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
protocol = 0;
|
||||
|
||||
for (altset = 0, altptr = ifaceptr->altsetting;
|
||||
altset < ifaceptr->num_altsetting;
|
||||
altset < (uint8_t)ifaceptr->num_altsetting;
|
||||
altset ++, altptr ++)
|
||||
{
|
||||
/*
|
||||
@@ -1746,8 +1745,7 @@ static void *read_thread(void *reference)
|
||||
* Make sure this loop executes no more than once every 250 miliseconds...
|
||||
*/
|
||||
|
||||
if ((readstatus != LIBUSB_SUCCESS || rbytes == 0) &&
|
||||
(g.wait_eof || !g.read_thread_stop))
|
||||
if ((g.wait_eof || !g.read_thread_stop))
|
||||
{
|
||||
gettimeofday(&now, NULL);
|
||||
if (timercmp(&now, &end, <))
|
||||
|
||||
+2
-2
@@ -24,13 +24,13 @@
|
||||
|
||||
#include "backend-private.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
# include <termios.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+10
-6
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# Berkeley commands makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2012 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -124,7 +124,8 @@ uninstall:
|
||||
|
||||
lpc: lpc.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpc lpc.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o lpc lpc.o $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -133,7 +134,8 @@ lpc: lpc.o ../cups/$(LIBCUPS)
|
||||
|
||||
lpq: lpq.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpq lpq.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o lpq lpq.o $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -142,7 +144,8 @@ lpq: lpq.o ../cups/$(LIBCUPS)
|
||||
|
||||
lpr: lpr.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lpr lpr.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o lpr lpr.o $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -151,7 +154,8 @@ lpr: lpr.o ../cups/$(LIBCUPS)
|
||||
|
||||
lprm: lprm.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o lprm lprm.o $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o lprm lprm.o $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* "lpq" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -26,7 +26,7 @@ static http_t *connect_server(const char *, http_t *);
|
||||
static int show_jobs(const char *, http_t *, const char *,
|
||||
const char *, const int, const int);
|
||||
static void show_printer(const char *, http_t *, const char *);
|
||||
static void usage(void) __attribute__((noreturn));
|
||||
static void usage(void) _CUPS_NORETURN;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+5
-29
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -32,8 +32,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
char *printer, /* Destination printer or class */
|
||||
*instance, /* Instance */
|
||||
*opt; /* Option pointer */
|
||||
const char *title, /* Job title */
|
||||
*val; /* Environment variable name */
|
||||
const char *title; /* Job title */
|
||||
int num_copies; /* Number of copies per file */
|
||||
int num_files; /* Number of files to print */
|
||||
const char *files[1000]; /* Files to print */
|
||||
@@ -345,33 +344,10 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if (printer == NULL)
|
||||
{
|
||||
val = NULL;
|
||||
|
||||
if ((printer = getenv("LPDEST")) == NULL)
|
||||
{
|
||||
if ((printer = getenv("PRINTER")) != NULL)
|
||||
{
|
||||
if (!strcmp(printer, "lp"))
|
||||
printer = NULL;
|
||||
else
|
||||
val = "PRINTER";
|
||||
}
|
||||
}
|
||||
if (!cupsGetNamedDest(NULL, NULL, NULL) && cupsLastError() == IPP_STATUS_ERROR_NOT_FOUND)
|
||||
_cupsLangPrintf(stderr, _("%s: Error - %s"), argv[0], cupsLastErrorString());
|
||||
else
|
||||
val = "LPDEST";
|
||||
|
||||
if (printer && !cupsGetNamedDest(NULL, printer, NULL))
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - %s environment variable names "
|
||||
"non-existent destination \"%s\"."), argv[0], val,
|
||||
printer);
|
||||
else if (cupsLastError() == IPP_NOT_FOUND)
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - no default destination available."),
|
||||
argv[0]);
|
||||
else
|
||||
_cupsLangPrintf(stderr, _("%s: Error - scheduler not responding."),
|
||||
argv[0]);
|
||||
_cupsLangPrintf(stderr, _("%s: Error - scheduler not responding."), argv[0]);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+26
-109
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# CGI makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2007-2018 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -26,7 +26,6 @@ OBJS = \
|
||||
classes.o \
|
||||
help.o \
|
||||
jobs.o \
|
||||
makedocset.o \
|
||||
printers.o \
|
||||
testcgi.o \
|
||||
testhi.o \
|
||||
@@ -38,8 +37,7 @@ CGIS = \
|
||||
jobs.cgi \
|
||||
printers.cgi
|
||||
LIBTARGETS = \
|
||||
libcupscgi.a \
|
||||
$(LIBCUPSCGI)
|
||||
libcupscgi.a
|
||||
|
||||
UNITTARGETS = \
|
||||
testcgi \
|
||||
@@ -77,8 +75,7 @@ unittests: $(UNITTARGETS)
|
||||
#
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS) makedocset
|
||||
$(RM) libcupscgi.so libcupscgi.dylib
|
||||
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
|
||||
|
||||
|
||||
#
|
||||
@@ -126,42 +123,13 @@ install-exec:
|
||||
#
|
||||
|
||||
install-headers:
|
||||
if test "x$(privateinclude)" != x; then \
|
||||
echo Installing private header files into $(PRIVATEINCLUDE)...; \
|
||||
$(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
|
||||
for file in cgi.h help-index.h; do \
|
||||
$(INSTALL_DATA) $$file $(PRIVATEINCLUDE); \
|
||||
done; \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Install libraries...
|
||||
#
|
||||
|
||||
install-libs: $(INSTALLSTATIC)
|
||||
echo Installing libraries in $(LIBDIR)...
|
||||
$(INSTALL_DIR) -m 755 $(LIBDIR)
|
||||
$(INSTALL_LIB) $(LIBCUPSCGI) $(LIBDIR)
|
||||
if test $(LIBCUPSCGI) = "libcupscgi.so.1"; then \
|
||||
$(RM) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
|
||||
$(LN) $(LIBCUPSCGI) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
|
||||
fi
|
||||
if test $(LIBCUPSCGI) = "libcupscgi.1.dylib"; then \
|
||||
$(RM) $(LIBDIR)/libcupscgi.dylib; \
|
||||
$(LN) $(LIBCUPSCGI) $(LIBDIR)/libcupscgi.dylib; \
|
||||
fi
|
||||
if test "x$(SYMROOT)" != "x"; then \
|
||||
$(INSTALL_DIR) $(SYMROOT); \
|
||||
cp $(LIBCUPSCGI) $(SYMROOT); \
|
||||
dsymutil $(SYMROOT)/$(LIBCUPSCGI); \
|
||||
fi
|
||||
|
||||
installstatic:
|
||||
$(INSTALL_DIR) -m 755 $(LIBDIR)
|
||||
$(INSTALL_LIB) -m 755 libcupscgi.a $(LIBDIR)
|
||||
$(RANLIB) $(LIBDIR)/libcupscgi.a
|
||||
$(CHMOD) 555 $(LIBDIR)/libcupscgi.a
|
||||
install-libs:
|
||||
|
||||
|
||||
#
|
||||
@@ -173,54 +141,6 @@ uninstall:
|
||||
$(RM) $(SERVERBIN)/cgi-bin/$$file; \
|
||||
done
|
||||
-$(RMDIR) $(SERVERBIN)/cgi-bin
|
||||
$(RM) $(LIBDIR)/libcupscgi.1.dylib
|
||||
$(RM) $(LIBDIR)/libcupscgi.a
|
||||
$(RM) $(LIBDIR)/libcupscgi.dylib
|
||||
$(RM) $(LIBDIR)/libcupscgi.so
|
||||
$(RM) $(LIBDIR)/libcupscgi.so.1
|
||||
-$(RMDIR) $(LIBDIR)
|
||||
-if test "x$(privateinclude)" != x; then \
|
||||
$(RM) $(PRIVATEINCLUDE)/cgi.h; \
|
||||
$(RM) $(PRIVATEINCLUDE)/help-index.h; \
|
||||
$(RMDIR) $(PRIVATEINCLUDE); \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# libcupscgi.so.1
|
||||
#
|
||||
|
||||
libcupscgi.so.1: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
|
||||
$(RM) `basename $@ .1`
|
||||
$(LN) $@ `basename $@ .1`
|
||||
|
||||
|
||||
#
|
||||
# libcupscgi.1.dylib
|
||||
#
|
||||
|
||||
libcupscgi.1.dylib: $(LIBOBJS) libcupscgi.exp
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 1.0.0 \
|
||||
-compatibility_version 1.0.0 \
|
||||
-exported_symbols_list libcupscgi.exp \
|
||||
$(LIBOBJS) $(LIBS)
|
||||
$(RM) libcupscgi.dylib
|
||||
$(LN) $@ libcupscgi.dylib
|
||||
|
||||
|
||||
#
|
||||
# libcupscgi.la
|
||||
#
|
||||
|
||||
libcupscgi.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
|
||||
-version-info 1:0 $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -238,56 +158,50 @@ libcupscgi.a: $(LIBOBJS)
|
||||
# admin.cgi
|
||||
#
|
||||
|
||||
admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ admin.o -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ admin.o libcupscgi.a $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
# classes.cgi
|
||||
#
|
||||
|
||||
classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ classes.o -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ classes.o libcupscgi.a $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
# help.cgi
|
||||
#
|
||||
|
||||
help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ help.o -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ help.o libcupscgi.a $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
# jobs.cgi
|
||||
#
|
||||
|
||||
jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ jobs.o -lcupscgi $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
# makedocset
|
||||
#
|
||||
|
||||
makedocset: makedocset.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ makedocset.o libcupscgi.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ jobs.o libcupscgi.a $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
# printers.cgi
|
||||
#
|
||||
|
||||
printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) libcupscgi.a
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ printers.o -L. -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(LDFLAGS) -o $@ printers.o -L. libcupscgi.a $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -296,9 +210,10 @@ printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
|
||||
testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Testing CGI API...
|
||||
./testcgi
|
||||
|
||||
@@ -309,9 +224,10 @@ testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Testing help index API...
|
||||
./testhi
|
||||
|
||||
@@ -322,8 +238,9 @@ testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/$(LIBCUPSSTATIC) \
|
||||
$(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) $(LIBGSSAPI)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
|
||||
+28
-12
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* Administration CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -767,7 +767,7 @@ do_am_class(http_t *http, /* I - HTTP connection */
|
||||
attr = ippAddStrings(request, IPP_TAG_PRINTER, IPP_TAG_URI, "member-uris",
|
||||
num_printers, NULL, NULL);
|
||||
for (i = 0; i < num_printers; i ++)
|
||||
attr->values[i].string.text = _cupsStrAlloc(cgiGetArray("MEMBER_URIS", i));
|
||||
ippSetString(request, &attr, i, cgiGetArray("MEMBER_URIS", i));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1137,6 +1137,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
else if (!file &&
|
||||
(!cgiGetVariable("PPD_NAME") || cgiGetVariable("SELECT_MAKE")))
|
||||
{
|
||||
int ipp_everywhere = !strncmp(var, "ipp://", 6) || !strncmp(var, "ipps://", 7) || (!strncmp(var, "dnssd://", 8) && (strstr(var, "_ipp._tcp") || strstr(var, "_ipps._tcp")));
|
||||
|
||||
if (modify && !cgiGetVariable("SELECT_MAKE"))
|
||||
{
|
||||
/*
|
||||
@@ -1282,9 +1284,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */
|
||||
cgiStartHTML(title);
|
||||
if (!cgiGetVariable("PPD_MAKE"))
|
||||
cgiSetVariable("PPD_MAKE", cgiGetVariable("CURRENT_MAKE"));
|
||||
if (!modify)
|
||||
cgiSetVariable("CURRENT_MAKE_AND_MODEL",
|
||||
cgiGetArray("PPD_MAKE_AND_MODEL", 0));
|
||||
if (ipp_everywhere)
|
||||
cgiSetVariable("SHOW_IPP_EVERYWHERE", "1");
|
||||
cgiCopyTemplateLang("choose-model.tmpl");
|
||||
cgiEndHTML();
|
||||
}
|
||||
@@ -2412,7 +2413,7 @@ do_list_printers(http_t *http) /* I - HTTP connection */
|
||||
attr;
|
||||
attr = ippFindNextAttribute(response, "device-uri", IPP_TAG_URI))
|
||||
{
|
||||
cupsArrayAdd(printer_devices, _cupsStrAlloc(attr->values[0].string.text));
|
||||
cupsArrayAdd(printer_devices, strdup(attr->values[0].string.text));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2550,7 +2551,7 @@ do_list_printers(http_t *http) /* I - HTTP connection */
|
||||
for (printer_device = (char *)cupsArrayFirst(printer_devices);
|
||||
printer_device;
|
||||
printer_device = (char *)cupsArrayNext(printer_devices))
|
||||
_cupsStrFree(printer_device);
|
||||
free(printer_device);
|
||||
|
||||
cupsArrayDelete(printer_devices);
|
||||
}
|
||||
@@ -2947,7 +2948,7 @@ do_set_allowed_users(http_t *http) /* I - HTTP connection */
|
||||
* Add the name...
|
||||
*/
|
||||
|
||||
attr->values[i].string.text = _cupsStrAlloc(ptr);
|
||||
ippSetString(request, &attr, i, ptr);
|
||||
|
||||
/*
|
||||
* Advance to the next name...
|
||||
@@ -3409,6 +3410,9 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_POINTS :
|
||||
if (!_cups_strncasecmp(option->defchoice, "Custom.", 7))
|
||||
{
|
||||
@@ -3756,8 +3760,8 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
|
||||
attr = ippAddStrings(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
|
||||
"job-sheets-default", 2, NULL, NULL);
|
||||
attr->values[0].string.text = _cupsStrAlloc(cgiGetVariable("job_sheets_start"));
|
||||
attr->values[1].string.text = _cupsStrAlloc(cgiGetVariable("job_sheets_end"));
|
||||
ippSetString(request, &attr, 0, cgiGetVariable("job_sheets_start"));
|
||||
ippSetString(request, &attr, 1, cgiGetVariable("job_sheets_end"));
|
||||
|
||||
if ((var = cgiGetVariable("printer_error_policy")) != NULL)
|
||||
ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_NAME,
|
||||
@@ -4008,6 +4012,9 @@ get_option_value(
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_REAL :
|
||||
@@ -4086,6 +4093,9 @@ get_option_value(
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_REAL :
|
||||
@@ -4219,6 +4229,11 @@ get_printer_ppd(const char *uri, /* I - Printer URI */
|
||||
host[256], /* Hostname */
|
||||
resource[256]; /* Resource path */
|
||||
int port; /* Port number */
|
||||
static const char * const pattrs[] = /* Printer attributes we need */
|
||||
{
|
||||
"all",
|
||||
"media-col-database"
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
@@ -4259,6 +4274,7 @@ get_printer_ppd(const char *uri, /* I - Printer URI */
|
||||
|
||||
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
|
||||
if (!_ppdCreateFromIPP(buffer, bufsize, response))
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CGI_H_
|
||||
@@ -19,12 +19,12 @@
|
||||
# include <time.h>
|
||||
# include <sys/stat.h>
|
||||
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
# include <direct.h>
|
||||
# include <io.h>
|
||||
# else
|
||||
# include <unistd.h>
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
|
||||
# include <cups/cups.h>
|
||||
# include <cups/array.h>
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* Online help index routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -138,11 +138,7 @@ static int help_load_file(help_index_t *hi,
|
||||
const char *filename,
|
||||
const char *relative,
|
||||
time_t mtime);
|
||||
static help_node_t *help_new_node(const char *filename, const char *anchor,
|
||||
const char *section, const char *text,
|
||||
time_t mtime, off_t offset,
|
||||
size_t length)
|
||||
__attribute__((nonnull(1,3,4)));
|
||||
static help_node_t *help_new_node(const char *filename, const char *anchor, const char *section, const char *text, time_t mtime, off_t offset, size_t length) _CUPS_NONNULL((1, 3, 4));
|
||||
static int help_sort_by_name(help_node_t *p1, help_node_t *p2);
|
||||
static int help_sort_by_score(help_node_t *p1, help_node_t *p2);
|
||||
static int help_sort_words(help_word_t *w1, help_word_t *w2);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_HELP_INDEX_H_
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -271,7 +271,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
section = n->section;
|
||||
}
|
||||
|
||||
if (!topic || strcmp(n->section, topic))
|
||||
if (!topic || !n->section || strcmp(n->section, topic))
|
||||
continue;
|
||||
|
||||
/*
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -91,7 +91,7 @@ cgiFormEncode(char *dst, /* I - Destination string */
|
||||
for (dstptr = dst; *src && dstptr < dstend;)
|
||||
{
|
||||
switch (*src)
|
||||
{
|
||||
{
|
||||
case ' ' :
|
||||
/*
|
||||
* Encode spaces with a "+"...
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,469 +0,0 @@
|
||||
/*
|
||||
* Xcode documentation set generator.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* makedocset directory *.tokens
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "cgi-private.h"
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local structures...
|
||||
*/
|
||||
|
||||
typedef struct _cups_html_s /**** Help file ****/
|
||||
{
|
||||
char *path; /* Path to help file */
|
||||
char *title; /* Title of help file */
|
||||
} _cups_html_t;
|
||||
|
||||
typedef struct _cups_section_s /**** Help section ****/
|
||||
{
|
||||
char *name; /* Section name */
|
||||
cups_array_t *files; /* Files in this section */
|
||||
} _cups_section_t;
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int compare_html(_cups_html_t *a, _cups_html_t *b);
|
||||
static int compare_sections(_cups_section_t *a, _cups_section_t *b);
|
||||
static int compare_sections_files(_cups_section_t *a, _cups_section_t *b);
|
||||
static void write_index(const char *path, help_index_t *hi);
|
||||
static void write_info(const char *path, const char *revision);
|
||||
static void write_nodes(const char *path, help_index_t *hi);
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Test the help index code.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line args */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char path[1024], /* Path to documentation */
|
||||
line[1024]; /* Line from file */
|
||||
help_index_t *hi; /* Help index */
|
||||
cups_file_t *tokens, /* Tokens.xml file */
|
||||
*fp; /* Current file */
|
||||
|
||||
|
||||
if (argc < 4)
|
||||
{
|
||||
puts("Usage: makedocset directory revision *.tokens");
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Index the help documents...
|
||||
*/
|
||||
|
||||
snprintf(path, sizeof(path), "%s/Contents/Resources/Documentation", argv[1]);
|
||||
if ((hi = helpLoadIndex(NULL, path)) == NULL)
|
||||
{
|
||||
fputs("makedocset: Unable to index help files!\n", stderr);
|
||||
return (1);
|
||||
}
|
||||
|
||||
snprintf(path, sizeof(path), "%s/Contents/Resources/Documentation/index.html",
|
||||
argv[1]);
|
||||
write_index(path, hi);
|
||||
|
||||
snprintf(path, sizeof(path), "%s/Contents/Resources/Nodes.xml", argv[1]);
|
||||
write_nodes(path, hi);
|
||||
|
||||
/*
|
||||
* Write the Info.plist file...
|
||||
*/
|
||||
|
||||
snprintf(path, sizeof(path), "%s/Contents/Info.plist", argv[1]);
|
||||
write_info(path, argv[2]);
|
||||
|
||||
/*
|
||||
* Merge the Tokens.xml files...
|
||||
*/
|
||||
|
||||
snprintf(path, sizeof(path), "%s/Contents/Resources/Tokens.xml", argv[1]);
|
||||
if ((tokens = cupsFileOpen(path, "w")) == NULL)
|
||||
{
|
||||
fprintf(stderr, "makedocset: Unable to create \"%s\": %s\n", path,
|
||||
strerror(errno));
|
||||
return (1);
|
||||
}
|
||||
|
||||
cupsFilePuts(tokens, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
|
||||
cupsFilePuts(tokens, "<Tokens version=\"1.0\">\n");
|
||||
|
||||
for (i = 3; i < argc; i ++)
|
||||
{
|
||||
if ((fp = cupsFileOpen(argv[i], "r")) == NULL)
|
||||
{
|
||||
fprintf(stderr, "makedocset: Unable to open \"%s\": %s\n", argv[i],
|
||||
strerror(errno));
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (!cupsFileGets(fp, line, sizeof(line)) || strncmp(line, "<?xml ", 6) ||
|
||||
!cupsFileGets(fp, line, sizeof(line)) || strncmp(line, "<Tokens ", 8))
|
||||
{
|
||||
fprintf(stderr, "makedocset: Bad Tokens.xml file \"%s\"!\n", argv[i]);
|
||||
return (1);
|
||||
}
|
||||
|
||||
while (cupsFileGets(fp, line, sizeof(line)))
|
||||
{
|
||||
if (strcmp(line, "</Tokens>"))
|
||||
cupsFilePrintf(tokens, "%s\n", line);
|
||||
}
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
|
||||
cupsFilePuts(tokens, "</Tokens>\n");
|
||||
|
||||
cupsFileClose(tokens);
|
||||
|
||||
/*
|
||||
* Return with no errors...
|
||||
*/
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'compare_html()' - Compare the titles of two HTML files.
|
||||
*/
|
||||
|
||||
static int /* O - Result of comparison */
|
||||
compare_html(_cups_html_t *a, /* I - First file */
|
||||
_cups_html_t *b) /* I - Second file */
|
||||
{
|
||||
return (_cups_strcasecmp(a->title, b->title));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'compare_sections()' - Compare the names of two help sections.
|
||||
*/
|
||||
|
||||
static int /* O - Result of comparison */
|
||||
compare_sections(_cups_section_t *a, /* I - First section */
|
||||
_cups_section_t *b) /* I - Second section */
|
||||
{
|
||||
return (_cups_strcasecmp(a->name, b->name));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'compare_sections_files()' - Compare the number of files and section names.
|
||||
*/
|
||||
|
||||
static int /* O - Result of comparison */
|
||||
compare_sections_files(
|
||||
_cups_section_t *a, /* I - First section */
|
||||
_cups_section_t *b) /* I - Second section */
|
||||
{
|
||||
int ret = cupsArrayCount(b->files) - cupsArrayCount(a->files);
|
||||
|
||||
if (ret)
|
||||
return (ret);
|
||||
else
|
||||
return (_cups_strcasecmp(a->name, b->name));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'write_index()' - Write an index file for the CUPS help.
|
||||
*/
|
||||
|
||||
static void
|
||||
write_index(const char *path, /* I - File to write */
|
||||
help_index_t *hi) /* I - Index of files */
|
||||
{
|
||||
cups_file_t *fp; /* Output file */
|
||||
help_node_t *node; /* Current help node */
|
||||
_cups_section_t *section, /* Current section */
|
||||
key; /* Section search key */
|
||||
_cups_html_t *html; /* Current HTML file */
|
||||
cups_array_t *sections, /* Sections in index */
|
||||
*sections_files,/* Sections sorted by size */
|
||||
*columns[3]; /* Columns in final HTML file */
|
||||
int column, /* Current column */
|
||||
lines[3], /* Number of lines in each column */
|
||||
min_column, /* Smallest column */
|
||||
min_lines; /* Smallest number of lines */
|
||||
|
||||
|
||||
/*
|
||||
* Build an array of sections and their files.
|
||||
*/
|
||||
|
||||
sections = cupsArrayNew((cups_array_func_t)compare_sections, NULL);
|
||||
|
||||
for (node = (help_node_t *)cupsArrayFirst(hi->nodes);
|
||||
node;
|
||||
node = (help_node_t *)cupsArrayNext(hi->nodes))
|
||||
{
|
||||
if (node->anchor)
|
||||
continue;
|
||||
|
||||
key.name = node->section ? node->section : "Miscellaneous";
|
||||
if ((section = (_cups_section_t *)cupsArrayFind(sections, &key)) == NULL)
|
||||
{
|
||||
section = (_cups_section_t *)calloc(1, sizeof(_cups_section_t));
|
||||
section->name = key.name;
|
||||
section->files = cupsArrayNew((cups_array_func_t)compare_html, NULL);
|
||||
|
||||
cupsArrayAdd(sections, section);
|
||||
}
|
||||
|
||||
html = (_cups_html_t *)calloc(1, sizeof(_cups_html_t));
|
||||
html->path = node->filename;
|
||||
html->title = node->text;
|
||||
|
||||
cupsArrayAdd(section->files, html);
|
||||
}
|
||||
|
||||
/*
|
||||
* Build a sorted list of sections based on the number of files in each section
|
||||
* and the section name...
|
||||
*/
|
||||
|
||||
sections_files = cupsArrayNew((cups_array_func_t)compare_sections_files,
|
||||
NULL);
|
||||
for (section = (_cups_section_t *)cupsArrayFirst(sections);
|
||||
section;
|
||||
section = (_cups_section_t *)cupsArrayNext(sections))
|
||||
cupsArrayAdd(sections_files, section);
|
||||
|
||||
/*
|
||||
* Then build three columns to hold everything, trying to balance the number of
|
||||
* lines in each column...
|
||||
*/
|
||||
|
||||
for (column = 0; column < 3; column ++)
|
||||
{
|
||||
columns[column] = cupsArrayNew((cups_array_func_t)compare_sections, NULL);
|
||||
lines[column] = 0;
|
||||
}
|
||||
|
||||
for (section = (_cups_section_t *)cupsArrayFirst(sections_files);
|
||||
section;
|
||||
section = (_cups_section_t *)cupsArrayNext(sections_files))
|
||||
{
|
||||
for (min_column = 0, min_lines = lines[0], column = 1;
|
||||
column < 3;
|
||||
column ++)
|
||||
{
|
||||
if (lines[column] < min_lines)
|
||||
{
|
||||
min_column = column;
|
||||
min_lines = lines[column];
|
||||
}
|
||||
}
|
||||
|
||||
cupsArrayAdd(columns[min_column], section);
|
||||
lines[min_column] += cupsArrayCount(section->files) + 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write the HTML file...
|
||||
*/
|
||||
|
||||
if ((fp = cupsFileOpen(path, "w")) == NULL)
|
||||
{
|
||||
fprintf(stderr, "makedocset: Unable to create %s: %s\n", path,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 "
|
||||
"Transitional//EN\" "
|
||||
"\"http://www.w3.org/TR/html4/loose.dtd\">\n"
|
||||
"<html>\n"
|
||||
"<head>\n"
|
||||
"<title>CUPS Documentation</title>\n"
|
||||
"<link rel='stylesheet' type='text/css' "
|
||||
"href='cups-printable.css'>\n"
|
||||
"</head>\n"
|
||||
"<body>\n"
|
||||
"<h1 class='title'>CUPS Documentation</h1>\n"
|
||||
"<table width='100%' summary=''>\n"
|
||||
"<tr>\n");
|
||||
|
||||
for (column = 0; column < 3; column ++)
|
||||
{
|
||||
if (column)
|
||||
cupsFilePuts(fp, "<td> </td>\n");
|
||||
|
||||
cupsFilePuts(fp, "<td valign='top' width='33%'>");
|
||||
for (section = (_cups_section_t *)cupsArrayFirst(columns[column]);
|
||||
section;
|
||||
section = (_cups_section_t *)cupsArrayNext(columns[column]))
|
||||
{
|
||||
cupsFilePrintf(fp, "<h2 class='title'>%s</h2>\n", section->name);
|
||||
for (html = (_cups_html_t *)cupsArrayFirst(section->files);
|
||||
html;
|
||||
html = (_cups_html_t *)cupsArrayNext(section->files))
|
||||
cupsFilePrintf(fp, "<p class='compact'><a href='%s'>%s</a></p>\n",
|
||||
html->path, html->title);
|
||||
}
|
||||
cupsFilePuts(fp, "</td>\n");
|
||||
}
|
||||
cupsFilePuts(fp, "</tr>\n"
|
||||
"</table>\n"
|
||||
"</body>\n"
|
||||
"</html>\n");
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'write_info()' - Write the Info.plist file.
|
||||
*/
|
||||
|
||||
static void
|
||||
write_info(const char *path, /* I - File to write */
|
||||
const char *revision) /* I - Subversion revision number */
|
||||
{
|
||||
cups_file_t *fp; /* File */
|
||||
|
||||
|
||||
if ((fp = cupsFileOpen(path, "w")) == NULL)
|
||||
{
|
||||
fprintf(stderr, "makedocset: Unable to create %s: %s\n", path,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
cupsFilePrintf(fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" "
|
||||
"\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
|
||||
"<plist version=\"1.0\">\n"
|
||||
"<dict>\n"
|
||||
"\t<key>CFBundleIdentifier</key>\n"
|
||||
"\t<string>org.cups.docset</string>\n"
|
||||
"\t<key>CFBundleName</key>\n"
|
||||
"\t<string>CUPS Documentation</string>\n"
|
||||
"\t<key>CFBundleVersion</key>\n"
|
||||
"\t<string>%d.%d.%s</string>\n"
|
||||
"\t<key>CFBundleShortVersionString</key>\n"
|
||||
"\t<string>%d.%d.%d</string>\n"
|
||||
"\t<key>DocSetFeedName</key>\n"
|
||||
"\t<string>cups.org</string>\n"
|
||||
"\t<key>DocSetFeedURL</key>\n"
|
||||
"\t<string>http://www.cups.org/org.cups.docset.atom"
|
||||
"</string>\n"
|
||||
"\t<key>DocSetPublisherIdentifier</key>\n"
|
||||
"\t<string>org.cups</string>\n"
|
||||
"\t<key>DocSetPublisherName</key>\n"
|
||||
"\t<string>CUPS</string>\n"
|
||||
"</dict>\n"
|
||||
"</plist>\n",
|
||||
CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR, revision,
|
||||
CUPS_VERSION_MAJOR, CUPS_VERSION_MINOR, CUPS_VERSION_PATCH);
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'write_nodes()' - Write the Nodes.xml file.
|
||||
*/
|
||||
|
||||
static void
|
||||
write_nodes(const char *path, /* I - File to write */
|
||||
help_index_t *hi) /* I - Index of files */
|
||||
{
|
||||
cups_file_t *fp; /* Output file */
|
||||
int id; /* Current node ID */
|
||||
help_node_t *node; /* Current help node */
|
||||
int subnodes; /* Currently in Subnodes for file? */
|
||||
int needclose; /* Need to close the current node? */
|
||||
|
||||
|
||||
if ((fp = cupsFileOpen(path, "w")) == NULL)
|
||||
{
|
||||
fprintf(stderr, "makedocset: Unable to create %s: %s\n", path,
|
||||
strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
cupsFilePuts(fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
"<DocSetNodes version=\"1.0\">\n"
|
||||
"<TOC>\n"
|
||||
"<Node id=\"0\">\n"
|
||||
"<Name>CUPS Documentation</Name>\n"
|
||||
"<Path>Documentation/index.html</Path>\n"
|
||||
"</Node>\n");
|
||||
|
||||
for (node = (help_node_t *)cupsArrayFirst(hi->nodes), id = 1, subnodes = 0,
|
||||
needclose = 0;
|
||||
node;
|
||||
node = (help_node_t *)cupsArrayNext(hi->nodes), id ++)
|
||||
{
|
||||
if (node->anchor)
|
||||
{
|
||||
if (!subnodes)
|
||||
{
|
||||
cupsFilePuts(fp, "<Subnodes>\n");
|
||||
subnodes = 1;
|
||||
}
|
||||
|
||||
cupsFilePrintf(fp, "<Node id=\"%d\">\n"
|
||||
"<Path>Documentation/%s</Path>\n"
|
||||
"<Anchor>%s</Anchor>\n"
|
||||
"<Name>%s</Name>\n"
|
||||
"</Node>\n", id, node->filename, node->anchor,
|
||||
node->text);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (subnodes)
|
||||
{
|
||||
cupsFilePuts(fp, "</Subnodes>\n");
|
||||
subnodes = 0;
|
||||
}
|
||||
|
||||
if (needclose)
|
||||
cupsFilePuts(fp, "</Node>\n");
|
||||
|
||||
cupsFilePrintf(fp, "<Node id=\"%d\">\n"
|
||||
"<Path>Documentation/%s</Path>\n"
|
||||
"<Name>%s</Name>\n", id, node->filename, node->text);
|
||||
needclose = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (subnodes)
|
||||
cupsFilePuts(fp, "</Subnodes>\n");
|
||||
|
||||
if (needclose)
|
||||
cupsFilePuts(fp, "</Node>\n");
|
||||
|
||||
cupsFilePuts(fp, "</TOC>\n"
|
||||
"</DocSetNodes>\n");
|
||||
|
||||
cupsFileClose(fp);
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+3
-2
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* Search routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -365,4 +365,5 @@ void
|
||||
cgiFreeSearch(void *search) /* I - Search context */
|
||||
{
|
||||
regfree((regex_t *)search);
|
||||
free(search);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#include "cgi-private.h"
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+27
-31
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* CGI form variable and array functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -18,7 +18,6 @@
|
||||
/*#define DEBUG*/
|
||||
#include "cgi-private.h"
|
||||
#include <cups/http.h>
|
||||
#include <cups/md5-private.h>
|
||||
|
||||
|
||||
/*
|
||||
@@ -34,10 +33,10 @@
|
||||
|
||||
typedef struct /**** Form variable structure ****/
|
||||
{
|
||||
const char *name; /* Name of variable */
|
||||
char *name; /* Name of variable */
|
||||
int nvalues, /* Number of values */
|
||||
avalues; /* Number of values allocated */
|
||||
const char **values; /* Value(s) of variable */
|
||||
char **values; /* Value(s) of variable */
|
||||
} _cgi_var_t;
|
||||
|
||||
|
||||
@@ -140,10 +139,10 @@ cgiClearVariables(void)
|
||||
|
||||
for (v = form_vars, i = form_count; i > 0; v ++, i --)
|
||||
{
|
||||
_cupsStrFree(v->name);
|
||||
free(v->name);
|
||||
for (j = 0; j < v->nvalues; j ++)
|
||||
if (v->values[j])
|
||||
_cupsStrFree(v->values[j]);
|
||||
free(v->values[j]);
|
||||
}
|
||||
|
||||
form_count = 0;
|
||||
@@ -169,7 +168,7 @@ cgiGetArray(const char *name, /* I - Name of array variable */
|
||||
if (element < 0 || element >= var->nvalues)
|
||||
return (NULL);
|
||||
|
||||
return (_cupsStrRetain(var->values[element]));
|
||||
return (strdup(var->values[element]));
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +234,7 @@ cgiGetVariable(const char *name) /* I - Name of variable */
|
||||
var->values[var->nvalues - 1]));
|
||||
#endif /* DEBUG */
|
||||
|
||||
return ((var == NULL) ? NULL : _cupsStrRetain(var->values[var->nvalues - 1]));
|
||||
return ((var == NULL) ? NULL : strdup(var->values[var->nvalues - 1]));
|
||||
}
|
||||
|
||||
|
||||
@@ -383,10 +382,9 @@ cgiSetArray(const char *name, /* I - Name of variable */
|
||||
{
|
||||
if (element >= var->avalues)
|
||||
{
|
||||
const char **temp; /* Temporary pointer */
|
||||
char **temp; /* Temporary pointer */
|
||||
|
||||
temp = (const char **)realloc((void *)(var->values),
|
||||
sizeof(char *) * (size_t)(element + 16));
|
||||
temp = (char **)realloc((void *)(var->values), sizeof(char *) * (size_t)(element + 16));
|
||||
if (!temp)
|
||||
return;
|
||||
|
||||
@@ -402,9 +400,9 @@ cgiSetArray(const char *name, /* I - Name of variable */
|
||||
var->nvalues = element + 1;
|
||||
}
|
||||
else if (var->values[element])
|
||||
_cupsStrFree((char *)var->values[element]);
|
||||
free((char *)var->values[element]);
|
||||
|
||||
var->values[element] = _cupsStrAlloc(value);
|
||||
var->values[element] = strdup(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,10 +459,9 @@ cgiSetSize(const char *name, /* I - Name of variable */
|
||||
|
||||
if (size >= var->avalues)
|
||||
{
|
||||
const char **temp; /* Temporary pointer */
|
||||
char **temp; /* Temporary pointer */
|
||||
|
||||
temp = (const char **)realloc((void *)(var->values),
|
||||
sizeof(char *) * (size_t)(size + 16));
|
||||
temp = (char **)realloc((void *)(var->values), sizeof(char *) * (size_t)(size + 16));
|
||||
if (!temp)
|
||||
return;
|
||||
|
||||
@@ -481,7 +478,7 @@ cgiSetSize(const char *name, /* I - Name of variable */
|
||||
{
|
||||
for (i = size; i < var->nvalues; i ++)
|
||||
if (var->values[i])
|
||||
_cupsStrFree((void *)(var->values[i]));
|
||||
free((void *)(var->values[i]));
|
||||
}
|
||||
|
||||
var->nvalues = size;
|
||||
@@ -516,9 +513,9 @@ cgiSetVariable(const char *name, /* I - Name of variable */
|
||||
{
|
||||
for (i = 0; i < var->nvalues; i ++)
|
||||
if (var->values[i])
|
||||
_cupsStrFree((char *)var->values[i]);
|
||||
free((char *)var->values[i]);
|
||||
|
||||
var->values[0] = _cupsStrAlloc(value);
|
||||
var->values[0] = strdup(value);
|
||||
var->nvalues = 1;
|
||||
}
|
||||
}
|
||||
@@ -564,10 +561,10 @@ cgi_add_variable(const char *name, /* I - Variable name */
|
||||
if ((var->values = calloc((size_t)element + 1, sizeof(char *))) == NULL)
|
||||
return;
|
||||
|
||||
var->name = _cupsStrAlloc(name);
|
||||
var->name = strdup(name);
|
||||
var->nvalues = element + 1;
|
||||
var->avalues = element + 1;
|
||||
var->values[element] = _cupsStrAlloc(value);
|
||||
var->values[element] = strdup(value);
|
||||
|
||||
form_count ++;
|
||||
}
|
||||
@@ -599,7 +596,7 @@ cgi_find_variable(const char *name) /* I - Name of variable */
|
||||
if (form_count < 1 || name == NULL)
|
||||
return (NULL);
|
||||
|
||||
key.name = name;
|
||||
key.name = (char *)name;
|
||||
|
||||
return ((_cgi_var_t *)bsearch(&key, form_vars, (size_t)form_count, sizeof(_cgi_var_t),
|
||||
(int (*)(const void *, const void *))cgi_compare_variables));
|
||||
@@ -990,7 +987,7 @@ cgi_initialize_post(void)
|
||||
*/
|
||||
|
||||
length = (size_t)strtol(content_length, NULL, 10);
|
||||
data = malloc(length + 1);
|
||||
data = malloc(length + 1); /* lgtm [cpp/uncontrolled-allocation-size] */
|
||||
|
||||
if (data == NULL)
|
||||
return (0);
|
||||
@@ -1204,11 +1201,11 @@ cgi_set_sid(void)
|
||||
{
|
||||
char buffer[512], /* SID data */
|
||||
sid[33]; /* SID string */
|
||||
_cups_md5_state_t md5; /* MD5 state */
|
||||
unsigned char sum[16]; /* MD5 sum */
|
||||
const char *remote_addr, /* REMOTE_ADDR */
|
||||
*server_name, /* SERVER_NAME */
|
||||
*server_port; /* SERVER_PORT */
|
||||
struct timeval curtime; /* Current time */
|
||||
|
||||
|
||||
if ((remote_addr = getenv("REMOTE_ADDR")) == NULL)
|
||||
@@ -1218,18 +1215,17 @@ cgi_set_sid(void)
|
||||
if ((server_port = getenv("SERVER_PORT")) == NULL)
|
||||
server_port = "SERVER_PORT";
|
||||
|
||||
CUPS_SRAND(time(NULL));
|
||||
gettimeofday(&curtime, NULL);
|
||||
CUPS_SRAND(curtime.tv_sec + curtime.tv_usec);
|
||||
snprintf(buffer, sizeof(buffer), "%s:%s:%s:%02X%02X%02X%02X%02X%02X%02X%02X",
|
||||
remote_addr, server_name, server_port,
|
||||
(unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255,
|
||||
(unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255,
|
||||
(unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255,
|
||||
(unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255);
|
||||
_cupsMD5Init(&md5);
|
||||
_cupsMD5Append(&md5, (unsigned char *)buffer, (int)strlen(buffer));
|
||||
_cupsMD5Finish(&md5, sum);
|
||||
cupsHashData("md5", (unsigned char *)buffer, strlen(buffer), sum, sizeof(sum));
|
||||
|
||||
cgiSetCookie(CUPS_SID, httpMD5String(sum, sid), "/", NULL, 0, 0);
|
||||
cgiSetCookie(CUPS_SID, cupsHashString(sum, sizeof(sum), sid, sizeof(sid)), "/", NULL, 0, 0);
|
||||
|
||||
return (cupsGetOption(CUPS_SID, num_cookies, cookies));
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
@@ -134,3 +134,49 @@ WebInterface @CUPS_WEBIF@
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
</Policy>
|
||||
|
||||
# Set the kerberized printer/job policies...
|
||||
<Policy kerberos>
|
||||
# Job/subscription privacy...
|
||||
JobPrivateAccess default
|
||||
JobPrivateValues default
|
||||
SubscriptionPrivateAccess default
|
||||
SubscriptionPrivateValues default
|
||||
|
||||
# Job-related operations must be done by the owner or an administrator...
|
||||
<Limit Create-Job Print-Job Print-URI Validate-Job>
|
||||
AuthType Negotiate
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
|
||||
AuthType Negotiate
|
||||
Require user @OWNER @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All administration operations require an administrator to authenticate...
|
||||
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# All printer operations require a printer operator to authenticate...
|
||||
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
|
||||
AuthType Default
|
||||
Require user @CUPS_DEFAULT_PRINTOPERATOR_AUTH@
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
# Only the owner or an administrator can cancel or authenticate a job...
|
||||
<Limit Cancel-Job CUPS-Authenticate-Job>
|
||||
AuthType Negotiate
|
||||
Require user @OWNER @CUPS_DEFAULT_PRINTOPERATOR_AUTH@
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
|
||||
<Limit All>
|
||||
Order deny,allow
|
||||
</Limit>
|
||||
</Policy>
|
||||
|
||||
+12
-17
@@ -1,20 +1,18 @@
|
||||
#
|
||||
# "$Id$"
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.convs" file that
|
||||
# reflects your local configuration changes.
|
||||
# Base MIME conversions file for CUPS.
|
||||
#
|
||||
# Base MIME conversions file for CUPS.
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# Copyright 2007-2011 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
|
||||
########################################################################
|
||||
@@ -47,6 +45,7 @@ application/postscript application/vnd.cups-postscript 66 pstops
|
||||
|
||||
# PWG Raster filter for IPP Everywhere...
|
||||
application/vnd.cups-raster image/pwg-raster 100 rastertopwg
|
||||
application/vnd.cups-raster image/urf 100 rastertopwg
|
||||
|
||||
########################################################################
|
||||
#
|
||||
@@ -57,7 +56,3 @@ application/vnd.cups-raster image/pwg-raster 100 rastertopwg
|
||||
#
|
||||
|
||||
@DEFAULT_RAW_PRINTING@application/octet-stream application/vnd.cups-raw 0 -
|
||||
|
||||
#
|
||||
# End of "$Id$".
|
||||
#
|
||||
|
||||
+3
-14
@@ -1,13 +1,11 @@
|
||||
#
|
||||
# "$Id: mime.types 7670 2008-06-17 22:42:08Z mike $"
|
||||
#
|
||||
# Base MIME types file for CUPS.
|
||||
#
|
||||
# DO NOT EDIT THIS FILE, AS IT IS OVERWRITTEN WHEN YOU INSTALL NEW
|
||||
# VERSIONS OF CUPS. Instead, create a "local.types" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# Copyright 2007-2015 by Apple Inc.
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
@@ -81,12 +79,6 @@ application/postscript ai eps ps string(0,%!) string(0,<04>%!) \
|
||||
(contains(0,4096,<0a>%!) + \
|
||||
!contains(0,4096,"ENTER LANGUAGE")))
|
||||
|
||||
application/g-code gcode
|
||||
application/sla stl string(0,"solid ") + contains(0,4096,"facet") + contains(0,4096,"vertex")
|
||||
application/vnd.makerbot-s3g x3g
|
||||
model/amf amf
|
||||
model/vnd.collada+xml dae
|
||||
|
||||
|
||||
########################################################################
|
||||
#
|
||||
@@ -114,6 +106,7 @@ image/x-xpixmap xpm ascii(0,1024) + string(3,"XPM")
|
||||
image/x-sun-raster ras string(0,<59a66a95>)
|
||||
|
||||
#image/fpx fpx
|
||||
image/urf urf string(0,UNIRAST<00>)
|
||||
image/x-alias pix short(8,8) short(8,24)
|
||||
image/x-bitmap bmp string(0,BM) + !printable(2,14)
|
||||
image/x-icon ico
|
||||
@@ -132,7 +125,7 @@ application/x-shell sh printable(0,1024) + string(0,#!) +\
|
||||
contains(2,80,/sh) contains(2,80,/zsh))
|
||||
application/x-csource c cxx cpp cc C h hpp \
|
||||
printable(0,1024) + ! css + \
|
||||
(string(0,/*) string(0,//)
|
||||
(string(0,/*) string(0,//) \
|
||||
string(0,#include) contains(0,1024,<0a>#include) \
|
||||
string(0,#define) contains(0,1024,<0a>#define))
|
||||
text/html html htm printable(0,1024) +\
|
||||
@@ -176,7 +169,3 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
#
|
||||
|
||||
application/octet-stream
|
||||
|
||||
#
|
||||
# End of "$Id: mime.types 7670 2008-06-17 22:42:08Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Common configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 2007-2019 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Set the name of the config header file...
|
||||
@@ -42,14 +42,20 @@ AC_PROG_CXX(clang++ c++ g++)
|
||||
AC_PROG_RANLIB
|
||||
AC_PATH_PROG(AR,ar)
|
||||
AC_PATH_PROG(CHMOD,chmod)
|
||||
AC_PATH_PROG(GZIP,gzip)
|
||||
AC_PATH_PROG(GZIPPROG,gzip)
|
||||
AC_MSG_CHECKING(for install-sh script)
|
||||
INSTALL="`pwd`/install-sh"
|
||||
AC_SUBST(INSTALL)
|
||||
AC_MSG_RESULT(using $INSTALL)
|
||||
AC_PATH_PROG(LD,ld)
|
||||
AC_PATH_PROG(LN,ln)
|
||||
AC_PATH_PROG(MKDIR,mkdir)
|
||||
AC_PATH_PROG(MV,mv)
|
||||
AC_PATH_PROG(RM,rm)
|
||||
AC_PATH_PROG(RMDIR,rmdir)
|
||||
AC_PATH_PROG(SED,sed)
|
||||
AC_PATH_PROG(XDGOPEN,xdg-open)
|
||||
|
||||
if test "x$XDGOPEN" = x; then
|
||||
CUPS_HTMLVIEW="htmlview"
|
||||
else
|
||||
@@ -57,11 +63,6 @@ else
|
||||
fi
|
||||
AC_SUBST(CUPS_HTMLVIEW)
|
||||
|
||||
AC_MSG_CHECKING(for install-sh script)
|
||||
INSTALL="`pwd`/install-sh"
|
||||
AC_SUBST(INSTALL)
|
||||
AC_MSG_RESULT(using $INSTALL)
|
||||
|
||||
if test "x$AR" = x; then
|
||||
AC_MSG_ERROR([Unable to find required library archive command.])
|
||||
fi
|
||||
@@ -129,7 +130,6 @@ AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
|
||||
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
|
||||
AC_CHECK_HEADER(sys/param.h,AC_DEFINE(HAVE_SYS_PARAM_H))
|
||||
AC_CHECK_HEADER(sys/ucred.h,AC_DEFINE(HAVE_SYS_UCRED_H))
|
||||
AC_CHECK_HEADER(asl.h,AC_DEFINE(HAVE_ASL_H))
|
||||
|
||||
dnl Checks for iconv.h and iconv_open
|
||||
AC_CHECK_HEADER(iconv.h,
|
||||
@@ -162,7 +162,7 @@ AC_CHECK_FUNCS(statfs statvfs)
|
||||
|
||||
dnl Checks for string functions.
|
||||
AC_CHECK_FUNCS(strdup strlcat strlcpy)
|
||||
if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
|
||||
if test "$host_os_name" = "hp-ux" -a "$host_os_version" = "1020"; then
|
||||
echo Forcing snprintf emulation for HP-UX.
|
||||
else
|
||||
AC_CHECK_FUNCS(snprintf vsnprintf)
|
||||
@@ -181,8 +181,8 @@ dnl Check for vsyslog function.
|
||||
AC_CHECK_FUNCS(vsyslog)
|
||||
|
||||
dnl Checks for signal functions.
|
||||
case "$uname" in
|
||||
Linux | GNU)
|
||||
case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
# Do not use sigset on Linux or GNU HURD
|
||||
;;
|
||||
*)
|
||||
@@ -230,7 +230,7 @@ AC_SUBST(LIBUSB)
|
||||
AC_SUBST(USBQUIRKS)
|
||||
|
||||
if test "x$PKGCONFIG" != x; then
|
||||
if test x$enable_libusb != xno -a $uname != Darwin; then
|
||||
if test x$enable_libusb != xno -a $host_os_name != darwin; then
|
||||
AC_MSG_CHECKING(for libusb-1.0)
|
||||
if $PKGCONFIG --exists libusb-1.0; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -266,20 +266,20 @@ dnl ZLIB
|
||||
INSTALL_GZIP=""
|
||||
LIBZ=""
|
||||
AC_CHECK_HEADER(zlib.h,
|
||||
AC_CHECK_LIB(z, gzgets,
|
||||
AC_CHECK_LIB(z, gzgets,[
|
||||
AC_DEFINE(HAVE_LIBZ)
|
||||
LIBZ="-lz"
|
||||
LIBS="$LIBS -lz"
|
||||
AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_INFLATECOPY))
|
||||
if test "x$GZIP" != z; then
|
||||
if test "x$GZIPPROG" != x; then
|
||||
INSTALL_GZIP="-z"
|
||||
fi))
|
||||
fi]))
|
||||
AC_SUBST(INSTALL_GZIP)
|
||||
AC_SUBST(LIBZ)
|
||||
|
||||
dnl Flags for "ar" command...
|
||||
case $uname in
|
||||
Darwin* | *BSD*)
|
||||
case $host_os_name in
|
||||
darwin* | *bsd*)
|
||||
ARFLAGS="-rcv"
|
||||
;;
|
||||
*)
|
||||
@@ -306,7 +306,7 @@ fi
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
dnl Check for DBUS support
|
||||
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
|
||||
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
|
||||
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
|
||||
DBUSDIR="$withval")
|
||||
|
||||
@@ -314,7 +314,7 @@ DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$uname" != xDarwin; then
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdarwin; then
|
||||
AC_MSG_CHECKING(for DBUS)
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -348,8 +348,8 @@ CUPS_DEFAULT_SYSTEM_AUTHKEY=""
|
||||
CUPS_SYSTEM_AUTHKEY=""
|
||||
INSTALLXPC=""
|
||||
|
||||
case $uname in
|
||||
Darwin*)
|
||||
case $host_os_name in
|
||||
darwin*)
|
||||
BACKLIBS="$BACKLIBS -framework IOKit"
|
||||
SERVERLIBS="$SERVERLIBS -framework IOKit -weak_framework ApplicationServices"
|
||||
LIBS="-framework SystemConfiguration -framework CoreFoundation -framework Security $LIBS"
|
||||
@@ -389,28 +389,23 @@ case $uname in
|
||||
if test "x$default_adminkey" != xdefault; then
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey $default_adminkey"
|
||||
CUPS_DEFAULT_SYSTEM_AUTHKEY="$default_adminkey"
|
||||
elif grep -q system.print.operator /etc/authorization; then
|
||||
else
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
|
||||
CUPS_DEFAULT_SYSTEM_AUTHKEY="system.print.admin"
|
||||
else
|
||||
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
|
||||
CUPS_DEFAULT_SYSTEM_AUTHKEY="system.preferences"
|
||||
fi
|
||||
|
||||
if test "x$default_operkey" != xdefault; then
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY($default_operkey) @admin @lpadmin"
|
||||
elif grep -q system.print.operator /etc/authorization; then
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
|
||||
else
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
|
||||
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
|
||||
fi])
|
||||
AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
|
||||
|
||||
dnl Check for sandbox/Seatbelt support
|
||||
if test $uversion -ge 100; then
|
||||
if test $host_os_version -ge 100; then
|
||||
AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
|
||||
fi
|
||||
if test $uversion -ge 110 -a $uversion -lt 120; then
|
||||
if test $host_os_version -ge 110 -a $host_os_version -lt 120; then
|
||||
# Broken public headers in 10.7.x...
|
||||
AC_MSG_CHECKING(for sandbox/private.h presence)
|
||||
if test -f /usr/local/include/sandbox/private.h; then
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 2007-2018 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Clear the debugging and non-shared library options unless the user asks
|
||||
@@ -46,6 +46,10 @@ fi
|
||||
|
||||
dnl Unit tests take up time during a compile...
|
||||
if test x$enable_unit_tests = xyes; then
|
||||
if test "$build" != "$host"; then
|
||||
AC_MSG_ERROR([Sorry, cannot build unit tests when cross-compiling.])
|
||||
fi
|
||||
|
||||
UNITTESTS="unittests"
|
||||
else
|
||||
UNITTESTS=""
|
||||
@@ -63,7 +67,7 @@ else
|
||||
fi
|
||||
|
||||
if test -z "$with_ldarchflags"; then
|
||||
if test "$uname" = Darwin; then
|
||||
if test "$host_os_name" = darwin; then
|
||||
# Only create Intel programs by default
|
||||
LDARCHFLAGS="`echo $ARCHFLAGS | sed -e '1,$s/-arch ppc64//'`"
|
||||
else
|
||||
@@ -130,8 +134,8 @@ if test -n "$GCC"; then
|
||||
# Not available to LSB binaries...
|
||||
AC_MSG_CHECKING(whether compiler supports -fPIE)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
CFLAGS="$CFLAGS -fPIE -Wl,-pie"
|
||||
AC_TRY_COMPILE(,,[
|
||||
PIEFLAGS="-fPIE -Wl,-pie"
|
||||
@@ -152,43 +156,25 @@ if test -n "$GCC"; then
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
# Add useful warning options for tracking down problems...
|
||||
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
|
||||
OPTIM="-Wall -Wno-format-y2k -Wunused -Wno-unused-result -Wsign-conversion $OPTIM"
|
||||
|
||||
AC_MSG_CHECKING(whether compiler supports -Wno-unused-result)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-unused-result"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wno-unused-result"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
AC_MSG_CHECKING(whether compiler supports -Wsign-conversion)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wsign-conversion"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wsign-conversion"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
AC_MSG_CHECKING(whether compiler supports -Wno-tautological-compare)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wno-tautological-compare"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
# Test GCC version for certain warning flags since -Werror
|
||||
# doesn't trigger...
|
||||
gccversion=`$CC --version | head -1 | awk '{print $NF}'`
|
||||
case "$gccversion" in
|
||||
7.* | 8.*)
|
||||
OPTIM="$OPTIM -Wno-format-truncation -Wno-tautological-compare"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Additional warning options for development testing...
|
||||
if test -d .svn; then
|
||||
if test -d .git; then
|
||||
OPTIM="-Werror $OPTIM"
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
# -D_FORTIFY_SOURCE=2 adds additional object size
|
||||
# checking, basically wrapping all string functions
|
||||
# with buffer-limited ones. Not strictly needed for
|
||||
@@ -197,7 +183,7 @@ if test -n "$GCC"; then
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
|
||||
;;
|
||||
|
||||
Linux*)
|
||||
linux*)
|
||||
# The -z relro option is provided by the Linux linker command to
|
||||
# make relocatable data read-only.
|
||||
if test x$enable_relro = xyes; then
|
||||
@@ -207,8 +193,8 @@ if test -n "$GCC"; then
|
||||
esac
|
||||
else
|
||||
# Add vendor-specific compiler options...
|
||||
case $uname in
|
||||
SunOS*)
|
||||
case $host_os_name in
|
||||
sunos*)
|
||||
# Solaris
|
||||
if test -z "$OPTIM"; then
|
||||
if test "x$with_optim" = x; then
|
||||
@@ -235,8 +221,8 @@ else
|
||||
fi
|
||||
|
||||
# Add general compiler options per platform...
|
||||
case $uname in
|
||||
Linux*)
|
||||
case $host_os_name in
|
||||
linux*)
|
||||
# glibc 2.8 and higher breaks peer credentials unless you
|
||||
# define _GNU_SOURCE...
|
||||
OPTIM="$OPTIM -D_GNU_SOURCE"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Default languages...
|
||||
@@ -22,10 +22,10 @@ AC_ARG_WITH(languages, [ --with-languages set installed languages, defau
|
||||
esac])
|
||||
AC_SUBST(LANGUAGES)
|
||||
|
||||
dnl OS X bundle-based localization support
|
||||
AC_ARG_WITH(bundledir, [ --with-bundledir set OS X localization bundle directory ],
|
||||
dnl macOS bundle-based localization support
|
||||
AC_ARG_WITH(bundledir, [ --with-bundledir set macOS localization bundle directory ],
|
||||
CUPS_BUNDLEDIR="$withval",
|
||||
if test "x$uname" = xDarwin -a $uversion -ge 100; then
|
||||
if test "x$host_os_name" = xdarwin -a $host_os_version -ge 100; then
|
||||
CUPS_BUNDLEDIR="/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A"
|
||||
LANGUAGES=""
|
||||
else
|
||||
@@ -37,21 +37,41 @@ if test "x$CUPS_BUNDLEDIR" != x; then
|
||||
AC_DEFINE_UNQUOTED(CUPS_BUNDLEDIR, "$CUPS_BUNDLEDIR")
|
||||
fi
|
||||
|
||||
dnl Default executable file permissions
|
||||
AC_ARG_WITH(exe_file_perm, [ --with-exe-file-perm set default executable permissions value, default=0555],
|
||||
CUPS_EXE_FILE_PERM="$withval",
|
||||
[case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
CUPS_EXE_FILE_PERM="755"
|
||||
;;
|
||||
*)
|
||||
CUPS_EXE_FILE_PERM="555"
|
||||
;;
|
||||
esac])
|
||||
AC_SUBST(CUPS_EXE_FILE_PERM)
|
||||
|
||||
dnl Default ConfigFilePerm
|
||||
AC_ARG_WITH(config_file_perm, [ --with-config-file-perm set default ConfigFilePerm value, default=0640],
|
||||
CUPS_CONFIG_FILE_PERM="$withval",
|
||||
if test "x$uname" = xDarwin; then
|
||||
[if test "x$host_os_name" = xdarwin; then
|
||||
CUPS_CONFIG_FILE_PERM="644"
|
||||
else
|
||||
CUPS_CONFIG_FILE_PERM="640"
|
||||
fi)
|
||||
fi])
|
||||
AC_SUBST(CUPS_CONFIG_FILE_PERM)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_CONFIG_FILE_PERM, 0$CUPS_CONFIG_FILE_PERM)
|
||||
|
||||
dnl Default permissions for cupsd
|
||||
AC_ARG_WITH(cupsd_file_perm, [ --with-cupsd-file-perm set default cupsd permissions, default=0500],
|
||||
CUPS_CUPSD_FILE_PERM="$withval",
|
||||
CUPS_CUPSD_FILE_PERM="500")
|
||||
[case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
CUPS_CUPSD_FILE_PERM="700"
|
||||
;;
|
||||
*)
|
||||
CUPS_CUPSD_FILE_PERM="500"
|
||||
;;
|
||||
esac])
|
||||
AC_SUBST(CUPS_CUPSD_FILE_PERM)
|
||||
|
||||
dnl Default LogFilePerm
|
||||
@@ -141,7 +161,7 @@ dnl Determine the correct username and group for this OS...
|
||||
AC_ARG_WITH(cups_user, [ --with-cups-user set default user for CUPS],
|
||||
CUPS_USER="$withval",
|
||||
AC_MSG_CHECKING(for default print user)
|
||||
if test x$uname = xDarwin; then
|
||||
if test x$host_os_name = xdarwin; then
|
||||
if test x`id -u _lp 2>/dev/null` = x; then
|
||||
CUPS_USER="lp";
|
||||
else
|
||||
@@ -174,7 +194,7 @@ fi
|
||||
AC_ARG_WITH(cups_group, [ --with-cups-group set default group for CUPS],
|
||||
CUPS_GROUP="$withval",
|
||||
AC_MSG_CHECKING(for default print group)
|
||||
if test x$uname = xDarwin; then
|
||||
if test x$host_os_name = xdarwin; then
|
||||
if test x`id -g _lp 2>/dev/null` = x; then
|
||||
CUPS_GROUP="lp";
|
||||
else
|
||||
@@ -207,7 +227,7 @@ fi
|
||||
|
||||
AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups for CUPS],
|
||||
CUPS_SYSTEM_GROUPS="$withval",
|
||||
if test x$uname = xDarwin; then
|
||||
if test x$host_os_name = xdarwin; then
|
||||
CUPS_SYSTEM_GROUPS="admin"
|
||||
else
|
||||
AC_MSG_CHECKING(for default system groups)
|
||||
@@ -260,15 +280,15 @@ AC_ARG_WITH(printcap, [ --with-printcap set default printcap file],
|
||||
|
||||
if test x$default_printcap != xno; then
|
||||
if test "x$default_printcap" = "xdefault"; then
|
||||
case $uname in
|
||||
Darwin*)
|
||||
if test $uversion -ge 90; then
|
||||
case $host_os_name in
|
||||
darwin*)
|
||||
if test $host_os_version -ge 90; then
|
||||
CUPS_DEFAULT_PRINTCAP="/Library/Preferences/org.cups.printers.plist"
|
||||
else
|
||||
CUPS_DEFAULT_PRINTCAP="/etc/printcap"
|
||||
fi
|
||||
;;
|
||||
SunOS*)
|
||||
sunos*)
|
||||
CUPS_DEFAULT_PRINTCAP="/etc/printers.conf"
|
||||
;;
|
||||
*)
|
||||
@@ -292,8 +312,8 @@ AC_ARG_WITH(lpdconfigfile, [ --with-lpdconfigfile set default LPDConfigFile
|
||||
|
||||
if test x$default_lpdconfigfile != xno; then
|
||||
if test "x$default_lpdconfigfile" = "xdefault"; then
|
||||
case $uname in
|
||||
Darwin*)
|
||||
case $host_os_name in
|
||||
darwin*)
|
||||
CUPS_DEFAULT_LPD_CONFIG_FILE="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist"
|
||||
;;
|
||||
*)
|
||||
@@ -360,7 +380,7 @@ AC_ARG_WITH(snmp-address, [ --with-snmp-address set SNMP query address, def
|
||||
else
|
||||
CUPS_SNMP_ADDRESS="Address $withval"
|
||||
fi,
|
||||
if test "x$uname" = xDarwin; then
|
||||
if test "x$host_os_name" = xdarwin; then
|
||||
CUPS_SNMP_ADDRESS=""
|
||||
else
|
||||
CUPS_SNMP_ADDRESS="Address @LOCAL"
|
||||
@@ -382,7 +402,7 @@ AC_SUBST(DEFAULT_IPP_PORT)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
|
||||
|
||||
dnl Web interface...
|
||||
AC_ARG_ENABLE(webif, [ --enable-webif enable the web interface by default, default=no for OS X])
|
||||
AC_ARG_ENABLE(webif, [ --enable-webif enable the web interface by default, default=no for macOS])
|
||||
case "x$enable_webif" in
|
||||
xno)
|
||||
CUPS_WEBIF=No
|
||||
@@ -393,7 +413,7 @@ case "x$enable_webif" in
|
||||
CUPS_DEFAULT_WEBIF=1
|
||||
;;
|
||||
*)
|
||||
if test $uname = Darwin; then
|
||||
if test $host_os_name = darwin; then
|
||||
CUPS_WEBIF=No
|
||||
CUPS_DEFAULT_WEBIF=0
|
||||
else
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Directory stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_PREFIX_DEFAULT(/)
|
||||
@@ -74,7 +74,7 @@ fi
|
||||
dnl Fix "localstatedir" variable if it hasn't been specified...
|
||||
if test "$localstatedir" = "\${prefix}/var"; then
|
||||
if test "$prefix" = "/"; then
|
||||
if test "$uname" = Darwin; then
|
||||
if test "$host_os_name" = darwin; then
|
||||
localstatedir="/private/var"
|
||||
else
|
||||
localstatedir="/var"
|
||||
@@ -87,7 +87,7 @@ fi
|
||||
dnl Fix "sysconfdir" variable if it hasn't been specified...
|
||||
if test "$sysconfdir" = "\${prefix}/etc"; then
|
||||
if test "$prefix" = "/"; then
|
||||
if test "$uname" = Darwin; then
|
||||
if test "$host_os_name" = darwin; then
|
||||
sysconfdir="/private/etc"
|
||||
else
|
||||
sysconfdir="/etc"
|
||||
@@ -99,8 +99,8 @@ fi
|
||||
|
||||
dnl Fix "libdir" variable...
|
||||
if test "$libdir" = "\${exec_prefix}/lib"; then
|
||||
case "$uname" in
|
||||
Linux*)
|
||||
case "$host_os_name" in
|
||||
linux*)
|
||||
if test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot; then
|
||||
libdir="$exec_prefix/lib64"
|
||||
fi
|
||||
@@ -165,7 +165,7 @@ dnl Setup default locations...
|
||||
AC_ARG_WITH(cachedir, [ --with-cachedir set path for cache files],cachedir="$withval",cachedir="")
|
||||
|
||||
if test x$cachedir = x; then
|
||||
if test "x$uname" = xDarwin; then
|
||||
if test "x$host_os_name" = xdarwin; then
|
||||
CUPS_CACHEDIR="$localstatedir/spool/cups/cache"
|
||||
else
|
||||
CUPS_CACHEDIR="$localstatedir/cache/cups"
|
||||
@@ -230,8 +230,8 @@ AC_DEFINE_UNQUOTED(CUPS_FONTPATH, "$CUPS_FONTPATH")
|
||||
|
||||
# Locale data
|
||||
if test "$localedir" = "\${datarootdir}/locale"; then
|
||||
case "$uname" in
|
||||
Linux | GNU | *BSD* | Darwin*)
|
||||
case "$host_os_name" in
|
||||
linux* | gnu* | *bsd* | darwin*)
|
||||
CUPS_LOCALEDIR="$datarootdir/locale"
|
||||
;;
|
||||
|
||||
@@ -265,9 +265,9 @@ AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
|
||||
AC_SUBST(CUPS_REQUESTS)
|
||||
|
||||
# Server executables...
|
||||
case "$uname" in
|
||||
*BSD* | Darwin*)
|
||||
# *BSD and Darwin (MacOS X)
|
||||
case "$host_os_name" in
|
||||
*bsd* | darwin*)
|
||||
# *BSD and Darwin (macOS)
|
||||
INSTALL_SYSV=""
|
||||
CUPS_SERVERBIN="$exec_prefix/libexec/cups"
|
||||
;;
|
||||
@@ -289,9 +289,9 @@ AC_SUBST(CUPS_SERVERROOT)
|
||||
|
||||
# Transient run-time state
|
||||
AC_ARG_WITH(rundir, [ --with-rundir set transient run-time state directory],CUPS_STATEDIR="$withval",[
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin (OS X)
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
# Darwin (macOS)
|
||||
CUPS_STATEDIR="$CUPS_SERVERROOT"
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
dnl
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi])
|
||||
@@ -24,7 +24,7 @@ DNSSD_BACKEND=""
|
||||
IPPFIND_BIN=""
|
||||
IPPFIND_MAN=""
|
||||
|
||||
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$uname != xDarwin; then
|
||||
if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$host_os_name != xdarwin; then
|
||||
AC_MSG_CHECKING(for Avahi)
|
||||
if $PKGCONFIG --exists avahi-client; then
|
||||
AC_MSG_RESULT(yes)
|
||||
@@ -41,9 +41,9 @@ fi
|
||||
|
||||
if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
|
||||
AC_CHECK_HEADER(dns_sd.h, [
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin and MacOS X...
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
# Darwin and macOS...
|
||||
AC_DEFINE(HAVE_DNSSD)
|
||||
DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
|
||||
DNSSD_BACKEND="dnssd"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl GSSAPI/Kerberos library detection for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products.
|
||||
dnl
|
||||
dnl This file contains Kerberos support code, copyright 2006 by
|
||||
@@ -11,7 +11,7 @@ dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(gssapi, [ --disable-gssapi disable GSSAPI support])
|
||||
@@ -22,9 +22,9 @@ AC_SUBST(LIBGSSAPI)
|
||||
if test x$enable_gssapi != xno; then
|
||||
AC_PATH_TOOL(KRB5CONFIG, krb5-config)
|
||||
if test "x$KRB5CONFIG" != x; then
|
||||
case "$uname" in
|
||||
Darwin)
|
||||
# OS X weak-links to the Kerberos framework...
|
||||
case "$host_os_name" in
|
||||
darwin)
|
||||
# macOS weak-links to the Kerberos framework...
|
||||
LIBGSSAPI="-weak_framework Kerberos"
|
||||
AC_MSG_CHECKING(for GSS framework)
|
||||
if test -d /System/Library/Frameworks/GSS.framework; then
|
||||
@@ -34,7 +34,7 @@ if test x$enable_gssapi != xno; then
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
;;
|
||||
SunOS*)
|
||||
sunos*)
|
||||
# Solaris has a non-standard krb5-config, don't use it!
|
||||
AC_CHECK_LIB(gss, gss_display_status,
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
@@ -52,13 +52,13 @@ if test x$enable_gssapi != xno; then
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
else
|
||||
# Check for vendor-specific implementations...
|
||||
case "$uname" in
|
||||
HP-UX*)
|
||||
case "$host_os_name" in
|
||||
hp-ux*)
|
||||
AC_CHECK_LIB(gss, gss_display_status,
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
LIBGSSAPI="-lgss -lgssapi_krb5")
|
||||
;;
|
||||
SunOS*)
|
||||
sunos*)
|
||||
AC_CHECK_LIB(gss, gss_display_status,
|
||||
AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available])
|
||||
LIBGSSAPI="-lgss")
|
||||
|
||||
@@ -8,7 +8,7 @@ dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Check for largefile support...
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
dnl
|
||||
dnl Libtool stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported
|
||||
AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported=/path/to/libtool
|
||||
build with libtool (UNSUPPORTED!)],
|
||||
[if test x$enable_libtool_unsupported != xno; then
|
||||
if test x$enable_libtool_unsupported == xyes; then
|
||||
AC_MSG_ERROR([Use --enable-libtool-unsupported=/path/to/libtool.])
|
||||
fi
|
||||
LIBTOOL="$enable_libtool_unsupported"
|
||||
enable_shared=no
|
||||
echo "WARNING: libtool is not supported or endorsed by Apple Inc."
|
||||
@@ -22,12 +25,40 @@ AC_ARG_ENABLE(libtool_unsupported, [ --enable-libtool-unsupported
|
||||
LIBTOOL=""
|
||||
fi])
|
||||
|
||||
AC_SUBST(LIBTOOL)
|
||||
|
||||
if test x$LIBTOOL != x; then
|
||||
DSO="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
|
||||
DSOXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
|
||||
|
||||
LD_CC="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
|
||||
LD_CXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
|
||||
|
||||
LIBCUPS="libcups.la"
|
||||
LIBCUPSSTATIC="libcups.la"
|
||||
LIBCUPSCGI="libcupscgi.la"
|
||||
LIBCUPSIMAGE="libcupsimage.la"
|
||||
LIBCUPSMIME="libcupsmime.la"
|
||||
LIBCUPSPPDC="libcupsppdc.la"
|
||||
|
||||
LIBTOOL_CC="\$(LIBTOOL) --mode=compile --tag=CC"
|
||||
LIBTOOL_CXX="\$(LIBTOOL) --mode=compile --tag=CXX"
|
||||
LIBTOOL_INSTALL="\$(LIBTOOL) --mode=install"
|
||||
|
||||
LINKCUPS="../cups/\$(LIBCUPS)"
|
||||
LINKCUPSIMAGE="../filter/\$(LIBCUPSIMAGE)"
|
||||
DSO="\$(CC)"
|
||||
|
||||
else
|
||||
LD_CC="\$(CC)"
|
||||
LD_CXX="\$(CXX)"
|
||||
|
||||
LIBTOOL_CC=""
|
||||
LIBTOOL_CXX=""
|
||||
LIBTOOL_INSTALL=""
|
||||
fi
|
||||
|
||||
AC_SUBST(LD_CC)
|
||||
AC_SUBST(LD_CXX)
|
||||
|
||||
AC_SUBST(LIBTOOL)
|
||||
AC_SUBST(LIBTOOL_CC)
|
||||
AC_SUBST(LIBTOOL_CXX)
|
||||
AC_SUBST(LIBTOOL_INSTALL)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Manpage stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Fix "mandir" variable...
|
||||
@@ -19,9 +19,9 @@ if test "$mandir" = "\${datarootdir}/man" -a "$prefix" = "/"; then
|
||||
fi
|
||||
|
||||
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
|
||||
case "$uname" in
|
||||
Darwin* | Linux | GNU | *BSD*)
|
||||
# Darwin, MacOS X, Linux, GNU HURD, and *BSD
|
||||
case "$host_os_name" in
|
||||
darwin* | linux* | gnu* | *bsd*)
|
||||
# Darwin, macOS, Linux, GNU HURD, and *BSD
|
||||
mandir="/usr/share/man"
|
||||
AMANDIR="/usr/share/man"
|
||||
PMANDIR="/usr/share/man"
|
||||
@@ -42,8 +42,8 @@ AC_SUBST(AMANDIR)
|
||||
AC_SUBST(PMANDIR)
|
||||
|
||||
dnl Setup manpage extensions...
|
||||
case "$uname" in
|
||||
SunOS*)
|
||||
case "$host_os_name" in
|
||||
sunos*)
|
||||
# Solaris
|
||||
MAN1EXT=1
|
||||
MAN5EXT=5
|
||||
@@ -51,8 +51,8 @@ case "$uname" in
|
||||
MAN8EXT=1m
|
||||
MAN8DIR=1m
|
||||
;;
|
||||
Linux* | GNU* | Darwin*)
|
||||
# Linux, GNU Hurd, and OS X
|
||||
linux* | gnu* | darwin*)
|
||||
# Linux, GNU Hurd, and macOS
|
||||
MAN1EXT=1.gz
|
||||
MAN5EXT=5.gz
|
||||
MAN7EXT=7.gz
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Networking stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2014 by Apple Inc.
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H),,[
|
||||
@@ -28,7 +28,7 @@ AC_SEARCH_LIBS(__res_init, resolv bind, AC_DEFINE(HAVE_RES_INIT),
|
||||
|
||||
# Tru64 5.1b leaks file descriptors with these functions; disable until
|
||||
# we can come up with a test for this...
|
||||
if test "$uname" != "OSF1"; then
|
||||
if test "$host_os_name" != "osf1"; then
|
||||
AC_SEARCH_LIBS(getaddrinfo, nsl, AC_DEFINE(HAVE_GETADDRINFO))
|
||||
AC_SEARCH_LIBS(getnameinfo, nsl, AC_DEFINE(HAVE_GETNAMEINFO))
|
||||
fi
|
||||
@@ -45,9 +45,9 @@ AC_ARG_WITH(domainsocket, [ --with-domainsocket set unix domain socket name
|
||||
|
||||
if test x$enable_domainsocket != xno -a x$default_domainsocket != xno; then
|
||||
if test "x$default_domainsocket" = x; then
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin and MaxOS X do their own thing...
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
# Darwin and macOS do their own thing...
|
||||
CUPS_DEFAULT_DOMAINSOCKET="$localstatedir/run/cupsd"
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -1,33 +1,39 @@
|
||||
dnl
|
||||
dnl Operating system stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2012 by Apple Inc.
|
||||
dnl Copyright 2007-2018 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Get the operating system, version number, and architecture...
|
||||
uname=`uname`
|
||||
uversion=`uname -r | sed -e '1,$s/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\1\2/'`
|
||||
uarch=`uname -m`
|
||||
dnl Get the build and host platforms and split the host_os value
|
||||
AC_CANONICAL_BUILD
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
uname="Darwin"
|
||||
if test $uversion -lt 120; then
|
||||
AC_MSG_ERROR([Sorry, this version of CUPS requires OS X 10.8 or higher.])
|
||||
fi
|
||||
;;
|
||||
[host_os_name=`echo $host_os | sed -e '1,$s/[0-9.]*$//g'`]
|
||||
[host_os_version=`echo $host_os | sed -e '1,$s/^[^0-9.]*//g' | awk -F. '{print $1 $2}'`]
|
||||
# Linux often does not yield an OS version we can use...
|
||||
if test "x$host_os_version" = x; then
|
||||
host_os_version="0"
|
||||
fi
|
||||
|
||||
GNU* | GNU/*)
|
||||
uname="GNU"
|
||||
;;
|
||||
Linux*)
|
||||
uname="Linux"
|
||||
;;
|
||||
esac
|
||||
if test "$host_os_name" = darwin -a $host_os_version -lt 120; then
|
||||
AC_MSG_ERROR([Sorry, this version of CUPS requires macOS 10.8 or higher.])
|
||||
fi
|
||||
|
||||
dnl Determine whether we are cross-compiling...
|
||||
if test "$build" = "$host"; then
|
||||
# No, build local targets
|
||||
LOCALTARGET="local"
|
||||
else
|
||||
# Yes, don't build local targets
|
||||
LOCALTARGET=""
|
||||
fi
|
||||
AC_SUBST(LOCALTARGET)
|
||||
|
||||
AC_PATH_PROGS(CODE_SIGN, codesign true)
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
dnl
|
||||
dnl PAM stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(pam, [ --disable-pam disable PAM support])
|
||||
AC_ARG_WITH(pam_module, [ --with-pam-module specify the PAM module to use])
|
||||
AC_ARG_WITH(pam_module, [ --with-pam-module set the PAM module to use])
|
||||
|
||||
PAMDIR=""
|
||||
PAMFILE="pam.std"
|
||||
@@ -52,9 +52,9 @@ if test x$enable_pam != xno; then
|
||||
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin/OS X
|
||||
case "$host_os_name" in
|
||||
darwin*)
|
||||
# Darwin/macOS
|
||||
if test "x$with_pam_module" != x; then
|
||||
PAMFILE="pam.$with_pam_module"
|
||||
elif test -f /usr/lib/pam/pam_opendirectory.so.2; then
|
||||
|
||||
@@ -8,7 +8,7 @@ dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_CHECK_FUNC(poll, AC_DEFINE(HAVE_POLL))
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
dnl
|
||||
dnl Scripting configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2010 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl Do we have Java?
|
||||
AC_ARG_WITH(java, [ --with-java set Java interpreter for web interfaces ],
|
||||
CUPS_JAVA="$withval",
|
||||
CUPS_JAVA="")
|
||||
CUPS_JAVA="auto")
|
||||
|
||||
if test "x$CUPS_JAVA" = x; then
|
||||
if test "x$CUPS_JAVA" = xauto; then
|
||||
AC_PATH_PROG(JAVA,java)
|
||||
CUPS_JAVA="$JAVA"
|
||||
elif test "x$CUPS_JAVA" = xno; then
|
||||
CUPS_JAVA=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_JAVA, "$CUPS_JAVA")
|
||||
@@ -30,11 +32,13 @@ fi
|
||||
dnl Do we have Perl?
|
||||
AC_ARG_WITH(perl, [ --with-perl set Perl interpreter for web interfaces ],
|
||||
CUPS_PERL="$withval",
|
||||
CUPS_PERL="")
|
||||
CUPS_PERL="auto")
|
||||
|
||||
if test "x$CUPS_PERL" = x; then
|
||||
if test "x$CUPS_PERL" = xauto; then
|
||||
AC_PATH_PROG(PERL,perl)
|
||||
CUPS_PERL="$PERL"
|
||||
elif test "x$CUPS_PERL" = xno; then
|
||||
CUPS_PERL=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_PERL, "$CUPS_PERL")
|
||||
@@ -46,9 +50,9 @@ fi
|
||||
dnl Do we have PHP?
|
||||
AC_ARG_WITH(php, [ --with-php set PHP interpreter for web interfaces ],
|
||||
CUPS_PHP="$withval",
|
||||
CUPS_PHP="")
|
||||
CUPS_PHP="auto")
|
||||
|
||||
if test "x$CUPS_PHP" = x; then
|
||||
if test "x$CUPS_PHP" = xauto; then
|
||||
AC_PATH_PROG(PHPCGI,php-cgi)
|
||||
if test "x$PHPCGI" = x; then
|
||||
AC_PATH_PROG(PHP,php)
|
||||
@@ -56,6 +60,8 @@ if test "x$CUPS_PHP" = x; then
|
||||
else
|
||||
CUPS_PHP="$PHPCGI"
|
||||
fi
|
||||
elif test "x$CUPS_PHP" = xno; then
|
||||
CUPS_PHP=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_PHP, "$CUPS_PHP")
|
||||
@@ -69,11 +75,13 @@ fi
|
||||
dnl Do we have Python?
|
||||
AC_ARG_WITH(python, [ --with-python set Python interpreter for web interfaces ],
|
||||
CUPS_PYTHON="$withval",
|
||||
CUPS_PYTHON="")
|
||||
CUPS_PYTHON="auto")
|
||||
|
||||
if test "x$CUPS_PYTHON" = x; then
|
||||
if test "x$CUPS_PYTHON" = xauto; then
|
||||
AC_PATH_PROG(PYTHON,python)
|
||||
CUPS_PYTHON="$PYTHON"
|
||||
elif test "x$CUPS_PYTHON" = xno; then
|
||||
CUPS_PYTHON=""
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_PYTHON, "$CUPS_PYTHON")
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Shared library support for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2013 by Apple Inc.
|
||||
dnl Copyright 2007-2018 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
PICFLAG=1
|
||||
@@ -21,33 +21,24 @@ LIBCUPSBASE="lib$cupsbase"
|
||||
LIBCUPSSTATIC="lib$cupsbase.a"
|
||||
|
||||
if test x$enable_shared != xno; then
|
||||
case "$uname" in
|
||||
SunOS*)
|
||||
case "$host_os_name" in
|
||||
sunos*)
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
LIBCUPSMIME="libcupsmime.so.1"
|
||||
LIBCUPSPPDC="libcupsppdc.so.1"
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)"
|
||||
;;
|
||||
Linux | GNU | *BSD*)
|
||||
linux* | gnu* | *bsd*)
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
LIBCUPSMIME="libcupsmime.so.1"
|
||||
LIBCUPSPPDC="libcupsppdc.so.1"
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
;;
|
||||
Darwin*)
|
||||
darwin*)
|
||||
LIBCUPS="lib$cupsbase.2.dylib"
|
||||
LIBCUPSCGI="libcupscgi.1.dylib"
|
||||
LIBCUPSIMAGE="libcupsimage.2.dylib"
|
||||
LIBCUPSMIME="libcupsmime.1.dylib"
|
||||
LIBCUPSPPDC="libcupsppdc.1.dylib"
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
|
||||
@@ -56,10 +47,7 @@ if test x$enable_shared != xno; then
|
||||
echo "Warning: shared libraries may not be supported. Trying -shared"
|
||||
echo " option with compiler."
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
LIBCUPSMIME="libcupsmime.so.1"
|
||||
LIBCUPSPPDC="libcupsppdc.so.1"
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
@@ -68,10 +56,7 @@ if test x$enable_shared != xno; then
|
||||
else
|
||||
PICFLAG=0
|
||||
LIBCUPS="lib$cupsbase.a"
|
||||
LIBCUPSCGI="libcupscgi.a"
|
||||
LIBCUPSIMAGE="libcupsimage.a"
|
||||
LIBCUPSMIME="libcupsmime.a"
|
||||
LIBCUPSPPDC="libcupsppdc.a"
|
||||
DSO=":"
|
||||
DSOXX=":"
|
||||
fi
|
||||
@@ -81,10 +66,7 @@ AC_SUBST(DSOXX)
|
||||
AC_SUBST(DSOFLAGS)
|
||||
AC_SUBST(LIBCUPS)
|
||||
AC_SUBST(LIBCUPSBASE)
|
||||
AC_SUBST(LIBCUPSCGI)
|
||||
AC_SUBST(LIBCUPSIMAGE)
|
||||
AC_SUBST(LIBCUPSMIME)
|
||||
AC_SUBST(LIBCUPSPPDC)
|
||||
AC_SUBST(LIBCUPSSTATIC)
|
||||
|
||||
if test x$enable_shared = xno; then
|
||||
@@ -120,8 +102,8 @@ if test "$DSO" != ":"; then
|
||||
# Tell the run-time linkers where to find a DSO. Some platforms
|
||||
# need this option, even when the library is installed in a
|
||||
# standard location...
|
||||
case $uname in
|
||||
SunOS*)
|
||||
case $host_os_name in
|
||||
sunos*)
|
||||
# Solaris...
|
||||
if test $exec_prefix != /usr; then
|
||||
DSOFLAGS="-R$libdir $DSOFLAGS"
|
||||
@@ -129,7 +111,7 @@ if test "$DSO" != ":"; then
|
||||
EXPORT_LDFLAGS="-R$libdir"
|
||||
fi
|
||||
;;
|
||||
*BSD*)
|
||||
*bsd*)
|
||||
# *BSD...
|
||||
if test $exec_prefix != /usr; then
|
||||
DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
|
||||
@@ -137,7 +119,7 @@ if test "$DSO" != ":"; then
|
||||
EXPORT_LDFLAGS="-Wl,-R$libdir"
|
||||
fi
|
||||
;;
|
||||
Linux | GNU)
|
||||
linux* | gnu*)
|
||||
# Linux, and HURD...
|
||||
if test $exec_prefix != /usr; then
|
||||
DSOFLAGS="-Wl,-rpath,$libdir $DSOFLAGS"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl TLS stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(ssl, [ --disable-ssl disable SSL/TLS support])
|
||||
@@ -23,7 +23,7 @@ CUPS_SERVERKEYCHAIN=""
|
||||
if test x$enable_ssl != xno; then
|
||||
dnl Look for CDSA...
|
||||
if test $have_ssl = 0 -a "x$enable_cdsassl" != "xno"; then
|
||||
if test $uname = Darwin; then
|
||||
if test $host_os_name = darwin; then
|
||||
AC_CHECK_HEADER(Security/SecureTransport.h, [
|
||||
have_ssl=1
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
@@ -52,7 +52,7 @@ if test x$enable_ssl != xno; then
|
||||
AC_DEFINE(HAVE_CSSMERRORSTRING)
|
||||
AC_DEFINE(HAVE_SECKEYCHAINOPEN)])
|
||||
|
||||
if test $uversion -ge 150; then
|
||||
if test $host_os_version -ge 150; then
|
||||
AC_DEFINE(HAVE_SSLSETENABLEDCIPHERS)
|
||||
fi
|
||||
fi
|
||||
@@ -61,7 +61,6 @@ if test x$enable_ssl != xno; then
|
||||
dnl Then look for GNU TLS...
|
||||
if test $have_ssl = 0 -a "x$enable_gnutls" != "xno" -a "x$PKGCONFIG" != x; then
|
||||
AC_PATH_TOOL(LIBGNUTLSCONFIG,libgnutls-config)
|
||||
AC_PATH_TOOL(LIBGCRYPTCONFIG,libgcrypt-config)
|
||||
if $PKGCONFIG --exists gnutls; then
|
||||
have_ssl=1
|
||||
SSLLIBS=`$PKGCONFIG --libs gnutls`
|
||||
@@ -81,6 +80,7 @@ if test x$enable_ssl != xno; then
|
||||
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS="$LIBS $SSLLIBS"
|
||||
AC_CHECK_FUNC(gnutls_fips140_set_mode, AC_DEFINE(HAVE_GNUTLS_FIPS140_SET_MODE))
|
||||
AC_CHECK_FUNC(gnutls_transport_set_pull_timeout_function, AC_DEFINE(HAVE_GNUTLS_TRANSPORT_SET_PULL_TIMEOUT_FUNCTION))
|
||||
AC_CHECK_FUNC(gnutls_priority_set_direct, AC_DEFINE(HAVE_GNUTLS_PRIORITY_SET_DIRECT))
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Launch-on-demand/startup stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2015 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
ONDEMANDFLAGS=""
|
||||
@@ -16,30 +16,21 @@ ONDEMANDLIBS=""
|
||||
AC_SUBST(ONDEMANDFLAGS)
|
||||
AC_SUBST(ONDEMANDLIBS)
|
||||
|
||||
dnl Launchd is used on OS X/Darwin...
|
||||
dnl Launchd is used on macOS/Darwin...
|
||||
AC_ARG_ENABLE(launchd, [ --disable-launchd disable launchd support])
|
||||
LAUNCHD_DIR=""
|
||||
AC_SUBST(LAUNCHD_DIR)
|
||||
|
||||
if test x$enable_launchd != xno; then
|
||||
AC_CHECK_FUNC(launch_msg, AC_DEFINE(HAVE_LAUNCHD))
|
||||
if test $uversion -ge 140; then
|
||||
AC_CHECK_FUNC(launch_activate_socket, [
|
||||
AC_DEFINE(HAVE_LAUNCHD)
|
||||
AC_DEFINE(HAVE_LAUNCH_ACTIVATE_SOCKET)])
|
||||
fi
|
||||
AC_CHECK_FUNC(launch_activate_socket, [
|
||||
AC_DEFINE(HAVE_LAUNCHD)
|
||||
AC_DEFINE(HAVE_ONDEMAND)])
|
||||
AC_CHECK_HEADER(launch.h, AC_DEFINE(HAVE_LAUNCH_H))
|
||||
|
||||
case "$uname" in
|
||||
Darwin*)
|
||||
# Darwin, MacOS X
|
||||
LAUNCHD_DIR="/System/Library/LaunchDaemons"
|
||||
# liblaunch is already part of libSystem
|
||||
;;
|
||||
*)
|
||||
# All others; this test will need to be updated
|
||||
;;
|
||||
esac
|
||||
if test "$host_os_name" = darwin; then
|
||||
LAUNCHD_DIR="/System/Library/LaunchDaemons"
|
||||
# liblaunch is already part of libSystem
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Systemd is used on Linux...
|
||||
@@ -77,6 +68,7 @@ if test x$enable_systemd != xno; then
|
||||
|
||||
if test $have_systemd = yes; then
|
||||
AC_DEFINE(HAVE_SYSTEMD)
|
||||
AC_DEFINE(HAVE_ONDEMAND)
|
||||
AC_CHECK_HEADER(systemd/sd-journal.h,AC_DEFINE(HAVE_SYSTEMD_SD_JOURNAL_H))
|
||||
if test "x$SYSTEMD_DIR" = x; then
|
||||
SYSTEMD_DIR="`$PKGCONFIG --variable=systemdsystemunitdir systemd`"
|
||||
@@ -85,6 +77,16 @@ if test x$enable_systemd != xno; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Upstart is also used on Linux (e.g., Chrome OS)
|
||||
AC_ARG_ENABLE(upstart, [ --enable-upstart enable upstart support])
|
||||
if test "x$enable_upstart" = "xyes"; then
|
||||
if test "x$have_systemd" = "xyes"; then
|
||||
AC_MSG_ERROR(Cannot support both systemd and upstart.)
|
||||
fi
|
||||
AC_DEFINE(HAVE_UPSTART)
|
||||
AC_DEFINE(HAVE_ONDEMAND)
|
||||
fi
|
||||
|
||||
dnl Solaris uses smf
|
||||
SMFMANIFESTDIR=""
|
||||
AC_SUBST(SMFMANIFESTDIR)
|
||||
@@ -115,13 +117,13 @@ if test x$rcdir = x; then
|
||||
fi
|
||||
|
||||
if test "x$rcstart" = x; then
|
||||
case "$uname" in
|
||||
Linux | GNU | GNU/k*BSD*)
|
||||
case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
# Linux
|
||||
rcstart="81"
|
||||
;;
|
||||
|
||||
SunOS*)
|
||||
sunos*)
|
||||
# Solaris
|
||||
rcstart="81"
|
||||
;;
|
||||
@@ -134,8 +136,8 @@ if test "x$rcstart" = x; then
|
||||
fi
|
||||
|
||||
if test "x$rcstop" = x; then
|
||||
case "$uname" in
|
||||
Linux | GNU | GNU/k*BSD*)
|
||||
case "$host_os_name" in
|
||||
linux* | gnu*)
|
||||
# Linux
|
||||
rcstop="36"
|
||||
;;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
dnl
|
||||
dnl Threading stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2011 by Apple Inc.
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(threads, [ --disable-threads disable multi-threading support])
|
||||
@@ -36,7 +36,7 @@ if test "x$enable_threads" != xno; then
|
||||
|
||||
# Solaris requires -D_POSIX_PTHREAD_SEMANTICS to
|
||||
# be POSIX-compliant... :(
|
||||
if test $uname = SunOS; then
|
||||
if test $host_os_name = sunos; then
|
||||
PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
|
||||
fi
|
||||
break
|
||||
|
||||
+1568
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+26
-13
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* Configuration file for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CONFIG_H_
|
||||
@@ -240,13 +240,6 @@
|
||||
#undef HAVE_VSYSLOG
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the ASL functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_ASL_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the systemd journal functions?
|
||||
*/
|
||||
@@ -310,6 +303,13 @@
|
||||
#undef HAVE_SSL
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the gnutls_fips140_set_mode function?
|
||||
*/
|
||||
|
||||
#undef HAVE_GNUTLS_FIPS140_SET_MODE
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the gnutls_transport_set_pull_timeout_function function?
|
||||
*/
|
||||
@@ -479,13 +479,19 @@
|
||||
#undef HAVE_PTHREAD_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have on-demand support (launchd/systemd/upstart)?
|
||||
*/
|
||||
|
||||
#undef HAVE_ONDEMAND
|
||||
|
||||
|
||||
/*
|
||||
* Do we have launchd support?
|
||||
*/
|
||||
|
||||
#undef HAVE_LAUNCH_H
|
||||
#undef HAVE_LAUNCHD
|
||||
#undef HAVE_LAUNCH_ACTIVATE_SOCKET
|
||||
|
||||
|
||||
/*
|
||||
@@ -495,6 +501,13 @@
|
||||
#undef HAVE_SYSTEMD
|
||||
|
||||
|
||||
/*
|
||||
* Do we have upstart support?
|
||||
*/
|
||||
|
||||
#undef HAVE_UPSTART
|
||||
|
||||
|
||||
/*
|
||||
* Various scripting languages...
|
||||
*/
|
||||
@@ -537,10 +550,10 @@
|
||||
*/
|
||||
|
||||
#undef HAVE_GETGROUPLIST
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Do we have OS X 10.4's mbr_XXX functions?
|
||||
* Do we have macOS 10.4's mbr_XXX functions?
|
||||
*/
|
||||
|
||||
#undef HAVE_MEMBERSHIP_H
|
||||
@@ -686,7 +699,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Location of OS X localization bundle, if any.
|
||||
* Location of macOS localization bundle, if any.
|
||||
*/
|
||||
|
||||
#undef CUPS_BUNDLEDIR
|
||||
|
||||
+1793
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
externo
+472
-384
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3
-3
@@ -1,21 +1,21 @@
|
||||
dnl
|
||||
dnl Configuration script for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2016 by Apple Inc.
|
||||
dnl Copyright 2007-2019 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl These coded instructions, statements, and computer programs are the
|
||||
dnl property of Apple Inc. and are protected by Federal copyright
|
||||
dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
dnl which should have been included with this file. If this file is
|
||||
dnl file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl missing or damaged, see the license at "http://www.cups.org/".
|
||||
dnl
|
||||
|
||||
dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Package name and version...
|
||||
AC_INIT([CUPS], [2.2b1], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
AC_INIT([CUPS], [2.2.13], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
|
||||
sinclude(config-scripts/cups-opsys.m4)
|
||||
sinclude(config-scripts/cups-common.m4)
|
||||
|
||||
@@ -261,6 +261,11 @@ testcache.o: testcache.c ppd-private.h ../cups/cups.h file.h versioning.h \
|
||||
thread-private.h
|
||||
testconflicts.o: testconflicts.c cups.h file.h versioning.h ipp.h http.h \
|
||||
array.h language.h pwg.h ppd.h raster.h string-private.h ../config.h
|
||||
testcreds.o: testcreds.c cups-private.h string-private.h ../config.h \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \
|
||||
md5-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
../cups/cups.h file.h pwg.h thread-private.h
|
||||
testcups.o: testcups.c string-private.h ../config.h cups.h file.h \
|
||||
versioning.h ipp.h http.h array.h language.h pwg.h ppd.h raster.h
|
||||
testdest.o: testdest.c cups.h file.h versioning.h ipp.h http.h array.h \
|
||||
|
||||
+94
-70
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# API library Makefile for CUPS.
|
||||
# Library Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
# Copyright © 2007-2018 by Apple Inc.
|
||||
# Copyright © 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# These coded instructions, statements, and computer programs are the
|
||||
# property of Apple Inc. and are protected by Federal copyright
|
||||
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
# which should have been included with this file. If this file is
|
||||
# file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
# missing or damaged, see the license at "http://www.cups.org/".
|
||||
#
|
||||
# This file is subject to the Apple OS-Developed Software exception.
|
||||
#
|
||||
@@ -85,9 +85,11 @@ TESTOBJS = \
|
||||
testarray.o \
|
||||
testcache.o \
|
||||
testconflicts.o \
|
||||
testcreds.o \
|
||||
testcups.o \
|
||||
testdest.o \
|
||||
testfile.o \
|
||||
testgetdests.o \
|
||||
testhttp.o \
|
||||
testi18n.o \
|
||||
testipp.o \
|
||||
@@ -153,9 +155,11 @@ UNITTARGETS = \
|
||||
testarray \
|
||||
testcache \
|
||||
testconflicts \
|
||||
testcreds \
|
||||
testcups \
|
||||
testdest \
|
||||
testfile \
|
||||
testgetdests \
|
||||
testhttp \
|
||||
testi18n \
|
||||
testipp \
|
||||
@@ -308,8 +312,9 @@ uninstall:
|
||||
|
||||
libcups.so.2: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
|
||||
$(DSO) $(ARCHFLAGS) $(LDFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
|
||||
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
$(RM) `basename $@ .2`
|
||||
$(LN) $@ `basename $@ .2`
|
||||
|
||||
@@ -325,13 +330,14 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
grep -v -E -e '^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault)$$' | \
|
||||
sort >t.exp
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
|
||||
$(DSO) $(ARCHFLAGS) $(LDFLAGS) $(DSOFLAGS) -o $@ \
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.12.0 \
|
||||
-current_version 2.13.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
-exported_symbols_list t.exp \
|
||||
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
$(RM) libcups.dylib t.exp
|
||||
$(LN) $@ libcups.dylib
|
||||
|
||||
@@ -342,8 +348,8 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
|
||||
libcups.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
|
||||
-rpath $(LIBDIR) -version-info 2:12 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
|
||||
-rpath $(LIBDIR) -version-info 2:13 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
|
||||
|
||||
@@ -365,12 +371,12 @@ libcups.a: $(LIBOBJS)
|
||||
libcups2.def: $(LIBOBJS) Makefile
|
||||
echo Generating $@...
|
||||
echo "LIBRARY libcups2" >libcups2.def
|
||||
echo "VERSION 2.11" >>libcups2.def
|
||||
echo "VERSION 2.13" >>libcups2.def
|
||||
echo "EXPORTS" >>libcups2.def
|
||||
(nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
|
||||
echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy) | \
|
||||
grep -v -E \
|
||||
-e 'cups_debug|Apple|BackChannel|Backend|FileCheck|Filter|GSSService|SetNegotiate|SideChannel' \
|
||||
-e 'cups_debug|Apple|BackChannel|Backend|FileCheck|Filter|GSSService|SetNegotiate|SideChannel|SNMP' \
|
||||
-e 'Block$$' | \
|
||||
sed -e '1,$$s/^_//' | sort >>libcups2.def
|
||||
|
||||
@@ -381,8 +387,9 @@ libcups2.def: $(LIBOBJS) Makefile
|
||||
|
||||
testadmin: testadmin.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -391,8 +398,9 @@ testadmin: testadmin.o $(LIBCUPSSTATIC)
|
||||
|
||||
testarray: testarray.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running array API tests...
|
||||
./testarray
|
||||
|
||||
@@ -403,8 +411,9 @@ testarray: testarray.o $(LIBCUPSSTATIC)
|
||||
|
||||
testcache: testcache.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -413,8 +422,20 @@ testcache: testcache.o $(LIBCUPSSTATIC)
|
||||
|
||||
testconflicts: testconflicts.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
# testcreds (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testcreds: testcreds.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcreds.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -423,8 +444,9 @@ testconflicts: testconflicts.o $(LIBCUPSSTATIC)
|
||||
|
||||
testcups: testcups.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -433,8 +455,9 @@ testcups: testcups.o $(LIBCUPSSTATIC)
|
||||
|
||||
testdest: testdest.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -443,20 +466,33 @@ testdest: testdest.o $(LIBCUPSSTATIC)
|
||||
|
||||
testfile: testfile.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running file API tests...
|
||||
./testfile
|
||||
|
||||
|
||||
#
|
||||
# testgetdests (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testgetdests: testgetdests.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testgetdests.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
# testhttp (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testhttp: testhttp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running HTTP API tests...
|
||||
./testhttp
|
||||
|
||||
@@ -467,8 +503,9 @@ testhttp: testhttp.o $(LIBCUPSSTATIC)
|
||||
|
||||
testipp: testipp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running IPP API tests...
|
||||
./testipp
|
||||
|
||||
@@ -479,8 +516,9 @@ testipp: testipp.o $(LIBCUPSSTATIC)
|
||||
|
||||
testi18n: testi18n.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running internationalization API tests...
|
||||
./testi18n
|
||||
|
||||
@@ -491,10 +529,23 @@ testi18n: testi18n.o $(LIBCUPSSTATIC)
|
||||
|
||||
testlang: testlang.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Creating locale directory structure...
|
||||
$(RM) -r locale
|
||||
$(MKDIR) locale/en
|
||||
echo 'msgid "No"' > locale/en/cups_en.po
|
||||
echo 'msgstr "No"' >> locale/en/cups_en.po
|
||||
echo 'msgid "Yes"' >> locale/en/cups_en.po
|
||||
echo 'msgstr "Yes"' >> locale/en/cups_en.po
|
||||
for po in ../locale/cups_*.po; do \
|
||||
lang=`basename $$po .po | sed -e '1,$$s/^cups_//'`; \
|
||||
$(MKDIR) locale/$$lang; \
|
||||
$(LN) ../../$$po locale/$$lang; \
|
||||
done
|
||||
echo Running language API tests...
|
||||
./testlang
|
||||
LOCALEDIR=locale ./testlang
|
||||
|
||||
|
||||
#
|
||||
@@ -503,8 +554,9 @@ testlang: testlang.o $(LIBCUPSSTATIC)
|
||||
|
||||
testoptions: testoptions.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running option API tests...
|
||||
./testoptions
|
||||
|
||||
@@ -515,8 +567,9 @@ testoptions: testoptions.o $(LIBCUPSSTATIC)
|
||||
|
||||
testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running PPD API tests...
|
||||
./testppd
|
||||
|
||||
@@ -527,8 +580,9 @@ testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
|
||||
|
||||
testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running PWG API tests...
|
||||
./testpwg test.ppd
|
||||
|
||||
@@ -539,8 +593,9 @@ testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
|
||||
|
||||
testsnmp: testsnmp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -549,8 +604,9 @@ testsnmp: testsnmp.o $(LIBCUPSSTATIC)
|
||||
|
||||
tlscheck: tlscheck.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -559,56 +615,27 @@ tlscheck: tlscheck.o $(LIBCUPSSTATIC)
|
||||
|
||||
apihelp:
|
||||
echo Generating CUPS API help files...
|
||||
mxmldoc --section "Programming" \
|
||||
--title "Introduction to CUPS Programming" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-overview.header --intro api-overview.shtml \
|
||||
>../doc/help/api-overview.html
|
||||
$(RM) cupspm.xml
|
||||
mxmldoc --section "Programming" --body cupspm.md \
|
||||
cupspm.xml \
|
||||
auth.c cups.h dest*.c encode.c http.h http*.c ipp.h ipp*.c \
|
||||
options.c tls-darwin.c usersys.c util.c \
|
||||
--coverimage cupspm.png \
|
||||
--epub ../doc/help/cupspm.epub
|
||||
mxmldoc --section "Programming" --body cupspm.md \
|
||||
cupspm.xml > ../doc/help/cupspm.html
|
||||
$(RM) cupspm.xml
|
||||
mxmldoc --section "Programming" --title "Administration APIs" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-admin.header --intro api-admin.shtml \
|
||||
api-admin.xml \
|
||||
adminutil.c adminutil.h getdevices.c >../doc/help/api-admin.html
|
||||
mxmldoc --tokens help/api-admin.html api-admin.xml >../doc/help/api-admin.tokens
|
||||
$(RM) api-admin.xml
|
||||
mxmldoc --section "Programming" --title "Array API" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-array.header --intro api-array.shtml \
|
||||
api-array.xml \
|
||||
array.h array.c >../doc/help/api-array.html
|
||||
mxmldoc --tokens help/api-array.html api-array.xml >../doc/help/api-array.tokens
|
||||
$(RM) api-array.xml
|
||||
mxmldoc --section "Programming" --title "CUPS API" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-cups.header --intro api-cups.shtml \
|
||||
api-cups.xml \
|
||||
cups.h pwg.h adminutil.c dest*.c language.c notify.c \
|
||||
options.c pwg-media.c tempfile.c usersys.c \
|
||||
util.c >../doc/help/api-cups.html
|
||||
mxmldoc --tokens help/api-cups.html api-cups.xml >../doc/help/api-cups.tokens
|
||||
$(RM) api-cups.xml
|
||||
mxmldoc --section "Programming" --title "File and Directory APIs" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-filedir.header --intro api-filedir.shtml \
|
||||
api-filedir.xml \
|
||||
file.h file.c dir.h dir.c >../doc/help/api-filedir.html
|
||||
mxmldoc --tokens api-filedir.xml >../doc/help/api-filedir.tokens
|
||||
$(RM) api-filedir.xml
|
||||
mxmldoc --section "Programming" --title "PPD API (DEPRECATED)" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-ppd.header --intro api-ppd.shtml \
|
||||
api-ppd.xml ppd.h ppd-*.c >../doc/help/api-ppd.html
|
||||
mxmldoc --tokens help/api-ppd.html api-ppd.xml >../doc/help/api-ppd.tokens
|
||||
$(RM) api-ppd.xml
|
||||
mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-httpipp.header --intro api-httpipp.shtml \
|
||||
api-httpipp.xml \
|
||||
http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
|
||||
http.c http-addr.c http-support.c ipp.c ipp-support.c \
|
||||
md5passwd.c request.c >../doc/help/api-httpipp.html
|
||||
mxmldoc --tokens help/api-httpipp.html api-httpipp.xml >../doc/help/api-httpipp.tokens
|
||||
$(RM) api-httpipp.xml
|
||||
mxmldoc --section "Programming" \
|
||||
--title "Filter and Backend Programming" \
|
||||
--css ../doc/cups-printable.css \
|
||||
@@ -616,7 +643,6 @@ apihelp:
|
||||
api-filter.xml \
|
||||
backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
|
||||
>../doc/help/api-filter.html
|
||||
mxmldoc --tokens help/api-filter.html api-filter.xml >../doc/help/api-filter.tokens
|
||||
$(RM) api-filter.xml
|
||||
|
||||
|
||||
@@ -625,8 +651,6 @@ apihelp:
|
||||
#
|
||||
|
||||
sloc:
|
||||
echo "libcupslite: \c"
|
||||
sloccount $(LITEOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
|
||||
echo "libcups: \c"
|
||||
sloccount $(LIBOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
|
||||
|
||||
|
||||
+44
-27
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* Administration utility API definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2001-2007 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -22,11 +22,11 @@
|
||||
#include "adminutil.h"
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <sys/wait.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -831,7 +831,7 @@ cupsAdminExportSamba(
|
||||
* The returned settings should be freed with cupsFreeOptions() when
|
||||
* you are done with them.
|
||||
*
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -1147,7 +1147,7 @@ cupsAdminGetServerSettings(
|
||||
/*
|
||||
* 'cupsAdminSetServerSettings()' - Set settings on the server.
|
||||
*
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -1194,6 +1194,7 @@ cupsAdminSetServerSettings(
|
||||
int cupsd_num_settings; /* New number of settings */
|
||||
int old_share_printers, /* Share local printers */
|
||||
old_remote_admin, /* Remote administration allowed? */
|
||||
old_remote_any, /* Remote access from anywhere? */
|
||||
old_user_cancel_any, /* Cancel-job policy set? */
|
||||
old_debug_logging; /* LogLevel debug set? */
|
||||
cups_option_t *cupsd_settings, /* New settings */
|
||||
@@ -1259,12 +1260,12 @@ cupsAdminSetServerSettings(
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
remote_any = atoi(val);
|
||||
old_remote_any = atoi(val);
|
||||
else
|
||||
remote_any = 0;
|
||||
old_remote_any = 0;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: old remote_any=%d",
|
||||
remote_any));
|
||||
old_remote_any));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, cupsd_num_settings,
|
||||
cupsd_settings)) != NULL)
|
||||
@@ -1310,12 +1311,23 @@ cupsAdminSetServerSettings(
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: debug_logging=%d",
|
||||
debug_logging));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, num_settings,
|
||||
settings)) != NULL)
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, num_settings, settings)) != NULL)
|
||||
{
|
||||
remote_any = atoi(val);
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: remote_any=%d",
|
||||
remote_any));
|
||||
if (remote_any == old_remote_any)
|
||||
{
|
||||
/*
|
||||
* No change to this setting...
|
||||
*/
|
||||
|
||||
remote_any = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
remote_any = -1;
|
||||
|
||||
DEBUG_printf(("1cupsAdminSetServerSettings: remote_any=%d", remote_any));
|
||||
|
||||
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings,
|
||||
settings)) != NULL)
|
||||
@@ -1430,7 +1442,7 @@ cupsAdminSetServerSettings(
|
||||
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
|
||||
{
|
||||
if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")) &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
{
|
||||
if (!wrote_port_listen)
|
||||
{
|
||||
@@ -1616,7 +1628,7 @@ cupsAdminSetServerSettings(
|
||||
remote_any > 0 ? "all" : "@LOCAL");
|
||||
}
|
||||
else if (in_root_location &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
{
|
||||
wrote_root_location = 1;
|
||||
|
||||
@@ -1719,7 +1731,7 @@ cupsAdminSetServerSettings(
|
||||
in_cancel_job = 0;
|
||||
}
|
||||
else if ((((in_admin_location || in_conf_location || in_root_location) &&
|
||||
(remote_admin >= 0 || remote_any > 0)) ||
|
||||
(remote_admin >= 0 || remote_any >= 0)) ||
|
||||
(in_root_location && share_printers >= 0)) &&
|
||||
(!_cups_strcasecmp(line, "Allow") || !_cups_strcasecmp(line, "Deny") ||
|
||||
!_cups_strcasecmp(line, "Order")))
|
||||
@@ -1811,7 +1823,7 @@ cupsAdminSetServerSettings(
|
||||
}
|
||||
|
||||
if (!wrote_port_listen &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
{
|
||||
if (remote_admin > 0 || remote_any > 0 || share_printers > 0)
|
||||
{
|
||||
@@ -1832,7 +1844,7 @@ cupsAdminSetServerSettings(
|
||||
}
|
||||
|
||||
if (!wrote_root_location &&
|
||||
(remote_admin >= 0 || remote_any > 0 || share_printers >= 0))
|
||||
(remote_admin >= 0 || remote_any >= 0 || share_printers >= 0))
|
||||
{
|
||||
if (remote_admin > 0 && share_printers > 0)
|
||||
cupsFilePuts(temp,
|
||||
@@ -2009,9 +2021,14 @@ cupsAdminSetServerSettings(
|
||||
old_remote_admin ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY,
|
||||
remote_any ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
if (remote_any >= 0)
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY,
|
||||
remote_any ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
else
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY,
|
||||
old_remote_any ? "1" : "0",
|
||||
cupsd_num_settings, &cupsd_settings);
|
||||
|
||||
if (share_printers >= 0)
|
||||
cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS,
|
||||
@@ -2070,7 +2087,7 @@ do_samba_command(const char *command, /* I - Command to run */
|
||||
const char *authfile, /* I - Samba authentication file */
|
||||
FILE *logfile) /* I - Optional log file */
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return (1); /* Always fail on Windows... */
|
||||
|
||||
#else
|
||||
@@ -2137,7 +2154,7 @@ do_samba_command(const char *command, /* I - Command to run */
|
||||
return (WEXITSTATUS(status));
|
||||
else
|
||||
return (-WTERMSIG(status));
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -2155,9 +2172,9 @@ get_cupsd_conf(
|
||||
int *remote) /* O - Remote file? */
|
||||
{
|
||||
int fd; /* Temporary file descriptor */
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
struct stat info; /* cupsd.conf file information */
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
http_status_t status; /* Status of getting cupsd.conf */
|
||||
char host[HTTP_MAX_HOST]; /* Hostname for connection */
|
||||
|
||||
@@ -2174,7 +2191,7 @@ get_cupsd_conf(
|
||||
snprintf(name, namesize, "%s/cupsd.conf", cg->cups_serverroot);
|
||||
*remote = 0;
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
if (!_cups_strcasecmp(host, "localhost") && !access(name, R_OK))
|
||||
{
|
||||
/*
|
||||
@@ -2201,7 +2218,7 @@ get_cupsd_conf(
|
||||
status = HTTP_STATUS_OK;
|
||||
}
|
||||
else
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !_WIN32 */
|
||||
{
|
||||
/*
|
||||
* Read cupsd.conf via a HTTP GET request...
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -54,7 +54,7 @@ typedef void (*cups_device_cb_t)(const char *device_class,
|
||||
const char *device_uri,
|
||||
const char *device_location, void *user_data);
|
||||
/* Device callback
|
||||
* @since CUPS 1.4/OS X 10.6@ */
|
||||
* @since CUPS 1.4/macOS 10.6@ */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<!--
|
||||
Array API header for CUPS.
|
||||
|
||||
Copyright 2008-2011 by Apple Inc.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h1 class='title'>Array API</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Header</th>
|
||||
<th>cups/array.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -1,194 +0,0 @@
|
||||
<!--
|
||||
Array API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2011 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||||
|
||||
<p>The CUPS array API provides a high-performance generic array container.
|
||||
The contents of the array container can be sorted and the container itself is
|
||||
designed for optimal speed and memory usage under a wide variety of conditions.
|
||||
Sorted arrays use a binary search algorithm from the last found or inserted
|
||||
element to quickly find matching elements in the array. Arrays created with the
|
||||
optional hash function can often find elements with a single lookup. The
|
||||
<a href='#cups_array_t'><code>cups_array_t</code></a> type is used when
|
||||
referring to a CUPS array.</p>
|
||||
|
||||
<p>The CUPS scheduler (<tt>cupsd</tt>) and many of the CUPS API
|
||||
functions use the array API to efficiently manage large lists of
|
||||
data.</p>
|
||||
|
||||
<h3><a name='MANAGING_ARRAYS'>Managing Arrays</a></h3>
|
||||
|
||||
<p>Arrays are created using either the
|
||||
<a href='#cupsArrayNew'><code>cupsArrayNew</code></a>,
|
||||
<a href='#cupsArrayNew2'><code>cupsArrayNew2</code></a>, or
|
||||
<a href='#cupsArrayNew2'><code>cupsArrayNew3</code></a> functions. The
|
||||
first function creates a new array with the specified callback function
|
||||
and user data pointer:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
static int compare_func(void *first, void *second, void *user_data);
|
||||
|
||||
void *user_data;
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew'>cupsArrayNew</a>(compare_func, user_data);
|
||||
</pre>
|
||||
|
||||
<p>The comparison function (type
|
||||
<a href="#cups_arrayfunc_t"><code>cups_arrayfunc_t</code></a>) is called
|
||||
whenever an element is added to the array and can be <code>NULL</code> to
|
||||
create an unsorted array. The function returns -1 if the first element should
|
||||
come before the second, 0 if the first and second elements should have the same
|
||||
ordering, and 1 if the first element should come after the second.</p>
|
||||
|
||||
<p>The "user_data" pointer is passed to your comparison function. Pass
|
||||
<code>NULL</code> if you do not need to associate the elements in your array
|
||||
with additional information.</p>
|
||||
|
||||
<p>The <a href='#cupsArrayNew2'><code>cupsArrayNew2</code></a> function adds
|
||||
two more arguments to support hashed lookups, which can potentially provide
|
||||
instantaneous ("O(1)") lookups in your array:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
#define HASH_SIZE 512 /* Size of hash table */
|
||||
|
||||
static int compare_func(void *first, void *second, void *user_data);
|
||||
static int hash_func(void *element, void *user_data);
|
||||
|
||||
void *user_data;
|
||||
<a href='#cups_array_t'>cups_array_t</a> *hash_array = <a href='#cupsArrayNew2'>cupsArrayNew2</a>(compare_func, user_data, hash_func, HASH_SIZE);
|
||||
</pre>
|
||||
|
||||
<p>The hash function (type
|
||||
<a href="#cups_ahash_func_t"><code>cups_ahash_func_t</code></a>) should return a
|
||||
number from 0 to (hash_size-1) that (hopefully) uniquely identifies the
|
||||
element and is called whenever you look up an element in the array with
|
||||
<a href='#cupsArrayFind'><code>cupsArrayFind</code></a>. The hash size is
|
||||
only limited by available memory, but generally should not be larger than
|
||||
16384 to realize any performance improvement.</p>
|
||||
|
||||
<p>The <a href='#cupsArrayNew3'><code>cupsArrayNew3</code></a> function adds
|
||||
copy and free callbacks to support basic memory management of elements:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
#define HASH_SIZE 512 /* Size of hash table */
|
||||
|
||||
static int compare_func(void *first, void *second, void *user_data);
|
||||
static void *copy_func(void *element, void *user_data);
|
||||
static void free_func(void *element, void *user_data);
|
||||
static int hash_func(void *element, void *user_data);
|
||||
|
||||
void *user_data;
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew3'>cupsArrayNew3</a>(compare_func, user_data, NULL, 0, copy_func, free_func);
|
||||
|
||||
<a href='#cups_array_t'>cups_array_t</a> *hash_array = <a href='#cupsArrayNew3'>cupsArrayNew3</a>(compare_func, user_data, hash_func, HASH_SIZE, copy_func, free_func);
|
||||
</pre>
|
||||
|
||||
<p>Once you have created the array, you add elements using the
|
||||
<a href='#cupsArrayAdd'><code>cupsArrayAdd</code></a>
|
||||
<a href='#cupsArrayInsert'><code>cupsArrayInsert</code></a> functions.
|
||||
The first function adds an element to the array, adding the new element
|
||||
after any elements that have the same order, while the second inserts the
|
||||
element before others with the same order. For unsorted arrays,
|
||||
<a href='#cupsArrayAdd'><code>cupsArrayAdd</code></a> appends the element to
|
||||
the end of the array while
|
||||
<a href='#cupsArrayInsert'><code>cupsArrayInsert</code></a> inserts the
|
||||
element at the beginning of the array. For example, the following code
|
||||
creates a sorted array of character strings:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
/* Use strcmp() to compare strings - it will ignore the user_data pointer */
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew'>cupsArrayNew</a>((<a href='#cups_array_func_t'>cups_array_func_t</a>)strcmp, NULL);
|
||||
|
||||
/* Add four strings to the array */
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "One Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Two Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Red Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Blue Fish");
|
||||
</pre>
|
||||
|
||||
<p>Elements are removed using the
|
||||
<a href='#cupsArrayRemove'><code>cupsArrayRemove</code></a> function, for
|
||||
example:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
/* Use strcmp() to compare strings - it will ignore the user_data pointer */
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew'>cupsArrayNew</a>((<a href='#cups_array_func_t'>cups_array_func_t</a>)strcmp, NULL);
|
||||
|
||||
/* Add four strings to the array */
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "One Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Two Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Red Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Blue Fish");
|
||||
|
||||
/* Remove "Red Fish" */
|
||||
<a href='#cupsArrayRemove'>cupsArrayRemove</a>(array, "Red Fish");
|
||||
</pre>
|
||||
|
||||
<p>Finally, you free the memory used by the array using the
|
||||
<a href='#cupsArrayDelete'><code>cupsArrayDelete</code></a> function. All
|
||||
of the memory for the array and hash table (if any) is freed, however <em>CUPS
|
||||
does not free the elements unless you provide copy and free functions</em>.</p>
|
||||
|
||||
<h3><a name='FINDING_AND_ENUMERATING'>Finding and Enumerating Elements</a></h3>
|
||||
|
||||
<p>CUPS provides several functions to find and enumerate elements in an
|
||||
array. Each one sets or updates a "current index" into the array, such that
|
||||
future lookups will start where the last one left off:</p>
|
||||
|
||||
<dl>
|
||||
<dt><a href='#cupsArrayFind'><code>cupsArrayFind</code></a></dt>
|
||||
<dd>Returns the first matching element.</dd>
|
||||
<dt><a href='#cupsArrayFirst'><code>cupsArrayFirst</code></a></dt>
|
||||
<dd>Returns the first element in the array.</dd>
|
||||
<dt><a href='#cupsArrayIndex'><code>cupsArrayIndex</code></a></dt>
|
||||
<dd>Returns the Nth element in the array, starting at 0.</dd>
|
||||
<dt><a href='#cupsArrayLast'><code>cupsArrayLast</code></a></dt>
|
||||
<dd>Returns the last element in the array.</dd>
|
||||
<dt><a href='#cupsArrayNext'><code>cupsArrayNext</code></a></dt>
|
||||
<dd>Returns the next element in the array.</dd>
|
||||
<dt><a href='#cupsArrayPrev'><code>cupsArrayPrev</code></a></dt>
|
||||
<dd>Returns the previous element in the array.</dd>
|
||||
</dl>
|
||||
|
||||
<p>Each of these functions returns <code>NULL</code> when there is no
|
||||
corresponding element. For example, a simple <code>for</code> loop using the
|
||||
<a href='#cupsArrayFirst'><code>cupsArrayFirst</code></a> and
|
||||
<a href='#cupsArrayNext'><code>cupsArrayNext</code></a> functions will
|
||||
enumerate all of the strings in our previous example:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/array.h>
|
||||
|
||||
/* Use strcmp() to compare strings - it will ignore the user_data pointer */
|
||||
<a href='#cups_array_t'>cups_array_t</a> *array = <a href='#cupsArrayNew'>cupsArrayNew</a>((<a href='#cups_array_func_t'>cups_array_func_t</a>)strcmp, NULL);
|
||||
|
||||
/* Add four strings to the array */
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "One Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Two Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Red Fish");
|
||||
<a href='#cupsArrayAdd'>cupsArrayAdd</a>(array, "Blue Fish");
|
||||
|
||||
/* Show all of the strings in the array */
|
||||
char *s;
|
||||
for (s = (char *)<a href='#cupsArrayFirst'>cupsArrayFirst</a>(array); s != NULL; s = (char *)<a href='#cupsArrayNext'>cupsArrayNext</a>(array))
|
||||
puts(s);
|
||||
</pre>
|
||||
@@ -1,38 +0,0 @@
|
||||
<!--
|
||||
CUPS API header for CUPS.
|
||||
|
||||
Copyright 2008-2011 by Apple Inc.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h1 class='title'>CUPS API</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Header</th>
|
||||
<th>cups/cups.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a><br>
|
||||
Programming: <a href='api-array.html' target='_top'>Array API</a><br>
|
||||
Programming: <a href='api-filedir.html' target='_top'>File and Directory APIs</a><br>
|
||||
Programming: <a href='api-filter.html' target='_top'>Filter and Backend Programming</a><br>
|
||||
Programming: <a href='api-httpipp.html' target='_top'>HTTP and IPP APIs</a><br>
|
||||
Programming: <a href='api-ppd.html' target='_top'>PPD API</a><br>
|
||||
Programming: <a href='api-raster.html' target='_top'>Raster API</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -1,441 +0,0 @@
|
||||
<!--
|
||||
API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2013 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||||
|
||||
<p>The CUPS API provides the convenience functions needed to support
|
||||
applications, filters, printer drivers, and backends that need to interface
|
||||
with the CUPS scheduler.</p>
|
||||
|
||||
<h3><a name='CLIENTS_AND_SERVERS'>Clients and Servers</a></h3>
|
||||
|
||||
<p>CUPS is based on the Internet Printing Protocol ("IPP"), which allows
|
||||
clients (applications) to communicate with a server (the scheduler) to get a
|
||||
list of printers, send print jobs, and so forth. You identify which server
|
||||
you want to communicate with using a pointer to the opaque structure
|
||||
<code>http_t</code>. All of the examples in this document use the
|
||||
<code>CUPS_HTTP_DEFAULT</code> constant, referring to the default connection
|
||||
to the scheduler. The <a href='api-httpipp.html' target='_top'>HTTP and IPP
|
||||
APIs</a> document provides more information on server connections.</p>
|
||||
|
||||
<h3><a name='PRINTERS_AND_CLASSES'>Printers and Classes</a></h3>
|
||||
|
||||
<p>Printers and classes (collections of printers) are accessed through
|
||||
the <a href="#cups_dest_t"><code>cups_dest_t</code></a> structure which
|
||||
includes the name (<code>name</code>), instance (<code>instance</code> -
|
||||
a way of selecting certain saved options/settings), and the options and
|
||||
attributes associated with that destination (<code>num_options</code> and
|
||||
<code>options</code>). Destinations are created using the
|
||||
<a href="#cupsGetDests"><code>cupsGetDests</code></a> function and freed
|
||||
using the <a href='#cupsFreeDests'><code>cupsFreeDests</code></a> function.
|
||||
The <a href='#cupsGetDest'><code>cupsGetDest</code></a> function finds a
|
||||
specific destination for printing:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dests;
|
||||
int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&dests);
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest = <a href='#cupsGetDest'>cupsGetDest</a>("name", NULL, num_dests, dests);
|
||||
|
||||
/* do something with dest */
|
||||
|
||||
<a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests);
|
||||
</pre>
|
||||
|
||||
<p>Passing <code>NULL</code> to
|
||||
<a href='#cupsGetDest'><code>cupsGetDest</code></a> for the destination name
|
||||
will return the default destination. Similarly, passing a <code>NULL</code>
|
||||
instance will return the default instance for that destination.</p>
|
||||
|
||||
<div class='table'><table summary='Table 1: Printer Attributes' width='80%'>
|
||||
<caption>Table 1: <a name='TABLE1'>Printer Attributes</a></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Attribute Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>"auth-info-required"</td>
|
||||
<td>The type of authentication required for printing to this
|
||||
destination: "none", "username,password", "domain,username,password",
|
||||
or "negotiate" (Kerberos)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-info"</td>
|
||||
<td>The human-readable description of the destination such as "My
|
||||
Laser Printer".</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-is-accepting-jobs"</td>
|
||||
<td>"true" if the destination is accepting new jobs, "false" if
|
||||
not.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-is-shared"</td>
|
||||
<td>"true" if the destination is being shared with other computers,
|
||||
"false" if not.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-location"</td>
|
||||
<td>The human-readable location of the destination such as "Lab 4".</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-make-and-model"</td>
|
||||
<td>The human-readable make and model of the destination such as "HP
|
||||
LaserJet 4000 Series".</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-state"</td>
|
||||
<td>"3" if the destination is idle, "4" if the destination is printing
|
||||
a job, and "5" if the destination is stopped.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-state-change-time"</td>
|
||||
<td>The UNIX time when the destination entered the current state.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-state-reasons"</td>
|
||||
<td>Additional comma-delimited state keywords for the destination
|
||||
such as "media-tray-empty-error" and "toner-low-warning".</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>"printer-type"</td>
|
||||
<td>The <a href='#cups_printer_t'><code>cups_printer_t</code></a>
|
||||
value associated with the destination.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
|
||||
<h3><a name='OPTIONS'>Options</a></h3>
|
||||
|
||||
<p>Options are stored in arrays of
|
||||
<a href='#cups_option_t'><code>cups_option_t</code></a> structures. Each
|
||||
option has a name (<code>name</code>) and value (<code>value</code>)
|
||||
associated with it. The <a href='#cups_dest_t'><code>cups_dest_t</code></a>
|
||||
<code>num_options</code> and <code>options</code> members contain the
|
||||
default options for a particular destination, along with several informational
|
||||
attributes about the destination as shown in <a href='#TABLE1'>Table 1</a>.
|
||||
The <a href='#cupsGetOption'><code>cupsGetOption</code></a> function gets
|
||||
the value for the named option. For example, the following code lists the
|
||||
available destinations and their human-readable descriptions:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dests;
|
||||
int num_dests = <a href='#cupsGetDests'>cupsGetDests</a>(&dests);
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int i;
|
||||
const char *value;
|
||||
|
||||
for (i = num_dests, dest = dests; i > 0; i --, dest ++)
|
||||
if (dest->instance == NULL)
|
||||
{
|
||||
value = <a href='#cupsGetOption'>cupsGetOption</a>("printer-info", dest->num_options, dest->options);
|
||||
printf("%s (%s)\n", dest->name, value ? value : "no description");
|
||||
}
|
||||
|
||||
<a href='#cupsFreeDests'>cupsFreeDests</a>(num_dests, dests);
|
||||
</pre>
|
||||
|
||||
<p>You can create your own option arrays using the
|
||||
<a href='#cupsAddOption'><code>cupsAddOption</code></a> function, which
|
||||
adds a single named option to an array:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
int num_options = 0;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options = NULL;
|
||||
|
||||
/* The returned num_options value is updated as needed */
|
||||
num_options = <a href='#cupsAddOption'>cupsAddOption</a>("first", "value", num_options, &options);
|
||||
|
||||
/* This adds a second option value */
|
||||
num_options = <a href='#cupsAddOption'>cupsAddOption</a>("second", "value", num_options, &options);
|
||||
|
||||
/* This replaces the first option we added */
|
||||
num_options = <a href='#cupsAddOption'>cupsAddOption</a>("first", "new value", num_options, &options);
|
||||
</pre>
|
||||
|
||||
<p>Use a <code>for</code> loop to copy the options from a destination:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
int i;
|
||||
int num_options = 0;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options = NULL;
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
|
||||
for (i = 0; i < dest->num_options; i ++)
|
||||
num_options = <a href='#cupsAddOption'>cupsAddOption</a>(dest->options[i].name, dest->options[i].value,
|
||||
num_options, &options);
|
||||
</pre>
|
||||
|
||||
<p>Use the <a href='#cupsFreeOptions'><code>cupsFreeOptions</code></a>
|
||||
function to free the options array when you are done using it:</p>
|
||||
|
||||
<pre class='example'>
|
||||
<a href='#cupsFreeOptions'>cupsFreeOptions</a>(num_options, options);
|
||||
</pre>
|
||||
|
||||
<h3><a name='PRINT_JOBS'>Print Jobs</a></h3>
|
||||
|
||||
<p>Print jobs are identified by a locally-unique job ID number from 1 to
|
||||
2<sup>31</sup>-1 and have options and one or more files for printing to a
|
||||
single destination. The <a href='#cupsPrintFile'><code>cupsPrintFile</code></a>
|
||||
function creates a new job with one file. The following code prints the CUPS
|
||||
test page file:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int num_options;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options;
|
||||
int job_id;
|
||||
|
||||
/* Print a single file */
|
||||
job_id = <a href='#cupsPrintFile'>cupsPrintFile</a>(dest->name, "/usr/share/cups/data/testprint.ps",
|
||||
"Test Print", num_options, options);
|
||||
</pre>
|
||||
|
||||
<p>The <a href='#cupsPrintFiles'><code>cupsPrintFiles</code></a> function
|
||||
creates a job with multiple files. The files are provided in a
|
||||
<code>char *</code> array:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int num_options;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options;
|
||||
int job_id;
|
||||
char *files[3] = { "file1.pdf", "file2.pdf", "file3.pdf" };
|
||||
|
||||
/* Print three files */
|
||||
job_id = <a href='#cupsPrintFiles'>cupsPrintFiles</a>(dest->name, 3, files, "Test Print", num_options, options);
|
||||
</pre>
|
||||
|
||||
<p>Finally, the <a href='#cupsCreateJob'><code>cupsCreateJob</code></a>
|
||||
function creates a new job with no files in it. Files are added using the
|
||||
<a href='#cupsStartDocument'><code>cupsStartDocument</code></a>,
|
||||
<a href='api-httpipp.html#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>,
|
||||
and <a href='#cupsFinishDocument'><code>cupsFinishDocument</code></a> functions.
|
||||
The following example creates a job with 10 text files for printing:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int num_options;
|
||||
<a href='#cups_option_t'>cups_option_t</a> *options;
|
||||
int job_id;
|
||||
int i;
|
||||
char buffer[1024];
|
||||
|
||||
/* Create the job */
|
||||
job_id = <a href='#cupsCreateJob'>cupsCreateJob</a>(CUPS_HTTP_DEFAULT, dest->name, "10 Text Files",
|
||||
num_options, options);
|
||||
|
||||
/* If the job is created, add 10 files */
|
||||
if (job_id > 0)
|
||||
{
|
||||
for (i = 1; i <= 10; i ++)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "file%d.txt", i);
|
||||
|
||||
<a href='#cupsStartDocument'>cupsStartDocument</a>(CUPS_HTTP_DEFAULT, dest->name, job_id, buffer,
|
||||
CUPS_FORMAT_TEXT, i == 10);
|
||||
|
||||
snprintf(buffer, sizeof(buffer),
|
||||
"File %d\n"
|
||||
"\n"
|
||||
"One fish,\n"
|
||||
"Two fish,\n
|
||||
"Red fish,\n
|
||||
"Blue fish\n", i);
|
||||
|
||||
/* cupsWriteRequestData can be called as many times as needed */
|
||||
<a href='#cupsWriteRequestData'>cupsWriteRequestData</a>(CUPS_HTTP_DEFAULT, buffer, strlen(buffer));
|
||||
|
||||
<a href='#cupsFinishDocument'>cupsFinishDocument</a>(CUPS_HTTP_DEFAULT, dest->name);
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>Once you have created a job, you can monitor its status using the
|
||||
<a href='#cupsGetJobs'><code>cupsGetJobs</code></a> function, which returns
|
||||
an array of <a href='#cups_job_t'><code>cups_job_t</code></a> structures.
|
||||
Each contains the job ID (<code>id</code>), destination name
|
||||
(<code>dest</code>), title (<code>title</code>), and other information
|
||||
associated with the job. The job array is freed using the
|
||||
<a href='#cupsFreeJobs'><code>cupsFreeJobs</code></a> function. The following
|
||||
example monitors a specific job ID, showing the current job state once every
|
||||
5 seconds until the job is completed:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int job_id;
|
||||
int num_jobs;
|
||||
<a href='#cups_job_t'>cups_job_t</a> *jobs;
|
||||
int i;
|
||||
ipp_jstate_t job_state = IPP_JOB_PENDING;
|
||||
|
||||
while (job_state < IPP_JOB_STOPPED)
|
||||
{
|
||||
/* Get my jobs (1) with any state (-1) */
|
||||
num_jobs = <a href='#cupsGetJobs'>cupsGetJobs</a>(&jobs, dest->name, 1, -1);
|
||||
|
||||
/* Loop to find my job */
|
||||
job_state = IPP_JOB_COMPLETED;
|
||||
|
||||
for (i = 0; i < num_jobs; i ++)
|
||||
if (jobs[i].id == job_id)
|
||||
{
|
||||
job_state = jobs[i].state;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Free the job array */
|
||||
<a href='#cupsFreeJobs'>cupsFreeJobs</a>(num_jobs, jobs);
|
||||
|
||||
/* Show the current state */
|
||||
switch (job_state)
|
||||
{
|
||||
case IPP_JOB_PENDING :
|
||||
printf("Job %d is pending.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_HELD :
|
||||
printf("Job %d is held.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_PROCESSING :
|
||||
printf("Job %d is processing.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_STOPPED :
|
||||
printf("Job %d is stopped.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_CANCELED :
|
||||
printf("Job %d is canceled.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_ABORTED :
|
||||
printf("Job %d is aborted.\n", job_id);
|
||||
break;
|
||||
case IPP_JOB_COMPLETED :
|
||||
printf("Job %d is completed.\n", job_id);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Sleep if the job is not finished */
|
||||
if (job_state < IPP_JOB_STOPPED)
|
||||
sleep(5);
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>To cancel a job, use the
|
||||
<a href='#cupsCancelJob'><code>cupsCancelJob</code></a> function with the
|
||||
job ID:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
<a href='#cups_dest_t'>cups_dest_t</a> *dest;
|
||||
int job_id;
|
||||
|
||||
<a href='#cupsCancelJob'>cupsCancelJob</a>(dest->name, job_id);
|
||||
</pre>
|
||||
|
||||
<h3><a name='ERROR_HANDLING'>Error Handling</a></h3>
|
||||
|
||||
<p>If any of the CUPS API printing functions returns an error, the reason for
|
||||
that error can be found by calling the
|
||||
<a href='#cupsLastError'><code>cupsLastError</code></a> and
|
||||
<a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> functions.
|
||||
<a href='#cupsLastError'><code>cupsLastError</code></a> returns the last IPP
|
||||
error code
|
||||
(<a href='api-httpipp.html#ipp_status_t'><code>ipp_status_t</code></a>)
|
||||
that was encountered, while
|
||||
<a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> returns
|
||||
a (localized) human-readable string that can be shown to the user. For example,
|
||||
if any of the job creation functions returns a job ID of 0, you can use
|
||||
<a href='#cupsLastErrorString'><code>cupsLastErrorString</code></a> to show
|
||||
the reason why the job could not be created:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
int job_id;
|
||||
|
||||
if (job_id == 0)
|
||||
puts(cupsLastErrorString());
|
||||
</pre>
|
||||
|
||||
<h3><a name='PASSWORDS_AND_AUTHENTICATION'>Passwords and Authentication</a></h3>
|
||||
|
||||
<p>CUPS supports authentication of any request, including submission of print
|
||||
jobs. The default mechanism for getting the username and password is to use the
|
||||
login user and a password from the console.</p>
|
||||
|
||||
<p>To support other types of applications, in particular Graphical User
|
||||
Interfaces ("GUIs"), the CUPS API provides functions to set the default
|
||||
username and to register a callback function that returns a password string.</p>
|
||||
|
||||
<p>The <a href="#cupsSetPasswordCB"><code>cupsSetPasswordCB</code></a>
|
||||
function is used to set a password callback in your program. Only one
|
||||
function can be used at any time.</p>
|
||||
|
||||
<p>The <a href="#cupsSetUser"><code>cupsSetUser</code></a> function sets the
|
||||
current username for authentication. This function can be called by your
|
||||
password callback function to change the current username as needed.</p>
|
||||
|
||||
<p>The following example shows a simple password callback that gets a
|
||||
username and password from the user:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
const char *
|
||||
my_password_cb(const char *prompt)
|
||||
{
|
||||
char user[65];
|
||||
|
||||
|
||||
puts(prompt);
|
||||
|
||||
/* Get a username from the user */
|
||||
printf("Username: ");
|
||||
if (fgets(user, sizeof(user), stdin) == NULL)
|
||||
return (NULL);
|
||||
|
||||
/* Strip the newline from the string and set the user */
|
||||
user[strlen(user) - 1] = '\0';
|
||||
|
||||
<a href='#cupsSetUser'>cupsSetUser</a>(user);
|
||||
|
||||
/* Use getpass() to ask for the password... */
|
||||
return (getpass("Password: "));
|
||||
}
|
||||
|
||||
<a href='#cupsSetPasswordCB'>cupsSetPasswordCB</a>(my_password_cb);
|
||||
</pre>
|
||||
|
||||
<p>Similarly, a GUI could display the prompt string in a window with input
|
||||
fields for the username and password. The username should default to the
|
||||
string returned by the <a href="#cupsUser"><code>cupsUser</code></a>
|
||||
function.</p>
|
||||
@@ -1,34 +0,0 @@
|
||||
<!--
|
||||
File and Directory API header for CUPS.
|
||||
|
||||
Copyright 2008-2011 by Apple Inc.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h1 class='title'>File and Directory APIs</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Headers</th>
|
||||
<th>cups/file.h<br>
|
||||
cups/dir.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='api-overview.html' target='_top'>Introduction to CUPS Programming</a><br>
|
||||
Programming: <a href='api-cups.html' target='_top'>CUPS API</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -1,29 +0,0 @@
|
||||
<!--
|
||||
File and directory API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2011 by Apple Inc.
|
||||
Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name="OVERVIEW">Overview</a></h2>
|
||||
|
||||
<p>The CUPS file and directory APIs provide portable interfaces
|
||||
for manipulating files and listing files and directories. Unlike
|
||||
stdio <code>FILE</code> streams, the <code>cupsFile</code> functions
|
||||
allow you to open more than 256 files at any given time. They
|
||||
also manage the platform-specific details of locking, large file
|
||||
support, line endings (CR, LF, or CR LF), and reading and writing
|
||||
files using Flate ("gzip") compression. Finally, you can also
|
||||
connect, read from, and write to network connections using the
|
||||
<code>cupsFile</code> functions.</p>
|
||||
|
||||
<p>The <code>cupsDir</code> functions manage the platform-specific
|
||||
details of directory access/listing and provide a convenient way
|
||||
to get both a list of files and the information (permissions,
|
||||
size, timestamp, etc.) for each of those files.</p>
|
||||
@@ -79,7 +79,7 @@ directory to write to.</p>
|
||||
|
||||
<p>In addition, some operating systems provide additional security mechanisms
|
||||
that further limit file system access, even for backends running as root. On
|
||||
OS X, for example, no backend may write to a user's home directory. See the <a href="#SANDBOXING">Sandboxing on OS X</a> section for more information.</p>
|
||||
macOS, for example, no backend may write to a user's home directory. See the <a href="#SANDBOXING">Sandboxing on macOS</a> section for more information.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3><a name="SIGNALS">Canceled Jobs and Signal Handling</a></h3>
|
||||
@@ -94,7 +94,7 @@ being printed.</p>
|
||||
<p>Filters and backends may also receive <code>SIGPIPE</code> when an upstream or downstream filter/backend exits with a non-zero status. Developers should generally ignore <code>SIGPIPE</code> at the beginning of <code>main()</code> with the following function call:</p>
|
||||
|
||||
<pre class="example">
|
||||
#include <signal.h>>
|
||||
#include <signal.h>
|
||||
|
||||
...
|
||||
|
||||
@@ -151,7 +151,7 @@ when running print filters and backends:</p>
|
||||
|
||||
<dt>APPLE_LANGUAGE</dt>
|
||||
<dd>The Apple language identifier associated with the job
|
||||
(OS X only).</dd>
|
||||
(macOS only).</dd>
|
||||
|
||||
<dt>CHARSET</dt>
|
||||
<dd>The job character set, typically "utf-8".</dd>
|
||||
@@ -561,7 +561,7 @@ sub-state and not an issue that applies when a job is not printing.</p>
|
||||
<blockquote><b>Note:</b>
|
||||
|
||||
<p>"STATE:" messages often provide visible alerts to the user. For example,
|
||||
on OS X setting a printer-state-reason value with an "-error" or
|
||||
on macOS setting a printer-state-reason value with an "-error" or
|
||||
"-warning" suffix will cause the printer's dock item to bounce if the
|
||||
corresponding reason is localized with a cupsIPPReason keyword in the
|
||||
printer's PPD file.</p>
|
||||
@@ -851,9 +851,9 @@ void *my_data;
|
||||
<a href="#cupsSideChannelSNMPWalk">cupsSNMPSideChannelWalk</a>(".1.3.6.1.2.1.43", 5.0, my_callback, my_data);
|
||||
</pre>
|
||||
|
||||
<h2><a name="SANDBOXING">Sandboxing on OS X</a></h2>
|
||||
<h2><a name="SANDBOXING">Sandboxing on macOS</a></h2>
|
||||
|
||||
<p>Starting with OS X 10.6, filters and backends are run inside a security "sandbox" which further limits (beyond the normal UNIX user/group permissions) what a filter or backend can do. This helps to both secure the printing system from malicious software and enforce the functional separation of components in the CUPS filter chain. What follows is a list of actions that are explicitly allowed for all filters and backends:</p>
|
||||
<p>Starting with macOS 10.6, filters and backends are run inside a security "sandbox" which further limits (beyond the normal UNIX user/group permissions) what a filter or backend can do. This helps to both secure the printing system from malicious software and enforce the functional separation of components in the CUPS filter chain. What follows is a list of actions that are explicitly allowed for all filters and backends:</p>
|
||||
|
||||
<ol>
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<!--
|
||||
HTTP and IPP API header for CUPS.
|
||||
|
||||
Copyright 2007-2016 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h1 class='title'>HTTP and IPP APIs</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Headers</th>
|
||||
<th>cups/cups.h<br>
|
||||
cups/http.h<br>
|
||||
cups/ipp.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='api-overview.html'>Introduction to CUPS Programming</a><br>
|
||||
Programming: <a href='api-cups.html'>CUPS API</a><br>
|
||||
References: <a href='spec-ipp.html'>CUPS Implementation of IPP</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -1,315 +0,0 @@
|
||||
<!--
|
||||
HTTP and IPP API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2012 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
property of Apple Inc. and are protected by Federal copyright
|
||||
law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
which should have been included with this file. If this file is
|
||||
file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||||
|
||||
<p>The CUPS HTTP and IPP APIs provide low-level access to the HTTP and IPP
|
||||
protocols and CUPS scheduler. They are typically used by monitoring and
|
||||
administration programs to perform specific functions not supported by the
|
||||
high-level CUPS API functions.</p>
|
||||
|
||||
<p>The HTTP APIs use an opaque structure called
|
||||
<a href='#http_t'><code>http_t</code></a> to manage connections to
|
||||
a particular HTTP or IPP server. The
|
||||
<a href='#httpConnectEncrypt'><code>httpConnectEncrypt</code></a> function is
|
||||
used to create an instance of this structure for a particular server.
|
||||
The constant <code>CUPS_HTTP_DEFAULT</code> can be used with all of the
|
||||
<code>cups</code> functions to refer to the default CUPS server - the functions
|
||||
create a per-thread <a href='#http_t'><code>http_t</code></a> as needed.</p>
|
||||
|
||||
<p>The IPP APIs use two opaque structures for requests (messages sent to the CUPS scheduler) and responses (messages sent back to your application from the scheduler). The <a href='#ipp_t'><code>ipp_t</code></a> type holds a complete request or response and is allocated using the <a href='#ippNew'><code>ippNew</code></a> or <a href='#ippNewRequest'><code>ippNewRequest</code></a> functions and freed using the <a href='#ippDelete'><code>ippDelete</code></a> function.</p>
|
||||
|
||||
<p>The second opaque structure is called <a href='#ipp_attribute_t'><code>ipp_attribute_t</code></a> and holds a single IPP attribute which consists of a group tag (<a href='#ippGetGroupTag'><code>ippGetGroupTag</code></a>), a value type tag (<a href='#ippGetValueTag'><code>ippGetValueTag</code></a>), the attribute name (<a href='#ippGetName'><code>ippGetName</code></a>), and 1 or more values (<a href='#ippGetCount'><code>ippGetCount</code></a>, <a href='#ippGetBoolean'><code>ippGetBoolean</code></a>, <a href='#ippGetCollection'><code>ippGetCollection</code></a>, <a href='#ippGetDate'><code>ippGetDate</code></a>, <a href='#ippGetInteger'><code>ippGetInteger</code></a>, <a href='#ippGetRange'><code>ippGetRange</code></a>, <a href='#ippGetResolution'><code>ippGetResolution</code></a>, and <a href='#ippGetString'><code>ippGetString</code></a>). Attributes are added to an <a href='#ipp_t'><code>ipp_t</code></a> pointer using one of the <code>ippAdd</code> functions. For example, use <a href='#ippAddString'><code>ippAddString</code></a> to add the "printer-uri" and "requesting-user-name" string attributes to a request:</p>
|
||||
|
||||
<pre class='example'>
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_GET_JOBS);
|
||||
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, "ipp://localhost/printers/");
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, cupsUser());
|
||||
</pre>
|
||||
|
||||
<p>Once you have created an IPP request, use the <code>cups</code> functions to send the request to and read the response from the server. For example, the <a href='#cupsDoRequest'><code>cupsDoRequest</code></a> function can be used for simple query operations that do not involve files:</p>
|
||||
|
||||
<pre class='example'>
|
||||
#include <cups/cups.h>
|
||||
|
||||
|
||||
<a href='#ipp_t'>ipp_t</a> *<a name='get_jobs'>get_jobs</a>(void)
|
||||
{
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_GET_JOBS);
|
||||
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, "ipp://localhost/printers/");
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, cupsUser());
|
||||
|
||||
return (<a href='#cupsDoRequest'>cupsDoRequest</a>(CUPS_HTTP_DEFAULT, request, "/"));
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>The <a href='#cupsDoRequest'><code>cupsDoRequest</code></a> function frees the request and returns an IPP response or <code>NULL</code> pointer if the request could not be sent to the server. Once you have a response from the server, you can either use the <a href='#ippFindAttribute'><code>ippFindAttribute</code></a> and <a href='#ippFindNextAttribute'><code>ippFindNextAttribute</code></a> functions to find specific attributes, for example:</p>
|
||||
|
||||
<pre class='example'>
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
<a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
|
||||
|
||||
attr = <a href='#ippFindAttribute'>ippFindAttribute</a>(response, "printer-state", IPP_TAG_ENUM);
|
||||
</pre>
|
||||
|
||||
<p>You can also walk the list of attributes with a simple <code>for</code> loop like this:</p>
|
||||
|
||||
<pre class='example'>
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
<a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
|
||||
|
||||
for (attr = <a href='#ippFirstAttribute'>ippFirstAttribute</a>(response); attr != NULL; attr = <a href='#ippNextAttribute'>ippNextAttribute</a>(response))
|
||||
if (ippGetName(attr) == NULL)
|
||||
puts("--SEPARATOR--");
|
||||
else
|
||||
puts(ippGetName(attr));
|
||||
</pre>
|
||||
|
||||
<p>The <code>for</code> loop approach is normally used when collecting attributes for multiple objects (jobs, printers, etc.) in a response. Attributes with <code>NULL</code> names indicate a separator between the attributes of each object. For example, the following code will list the jobs returned from our previous <a href='#get_jobs'><code>get_jobs</code></a> example code:</p>
|
||||
|
||||
<pre class='example'>
|
||||
<a href='#ipp_t'>ipp_t</a> *response = <a href='#get_jobs'>get_jobs</a>();
|
||||
|
||||
if (response != NULL)
|
||||
{
|
||||
<a href='#ipp_attribute_t'>ipp_attribute_t</a> *attr;
|
||||
const char *attrname;
|
||||
int job_id = 0;
|
||||
const char *job_name = NULL;
|
||||
const char *job_originating_user_name = NULL;
|
||||
|
||||
puts("Job ID Owner Title");
|
||||
puts("------ ---------------- ---------------------------------");
|
||||
|
||||
for (attr = <a href='#ippFirstAttribute'>ippFirstAttribute</a>(response); attr != NULL; attr = <a href='#ippNextAttribute'>ippNextAttribute</a>(response))
|
||||
{
|
||||
/* Attributes without names are separators between jobs */
|
||||
attrname = ippGetName(attr);
|
||||
if (attrname == NULL)
|
||||
{
|
||||
if (job_id > 0)
|
||||
{
|
||||
if (job_name == NULL)
|
||||
job_name = "(withheld)";
|
||||
|
||||
if (job_originating_user_name == NULL)
|
||||
job_originating_user_name = "(withheld)";
|
||||
|
||||
printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
|
||||
}
|
||||
|
||||
job_id = 0;
|
||||
job_name = NULL;
|
||||
job_originating_user_name = NULL;
|
||||
continue;
|
||||
}
|
||||
else if (!strcmp(attrname, "job-id") && ippGetValueTag(attr) == IPP_TAG_INTEGER)
|
||||
job_id = ippGetInteger(attr, 0);
|
||||
else if (!strcmp(attrname, "job-name") && ippGetValueTag(attr) == IPP_TAG_NAME)
|
||||
job_name = ippGetString(attr, 0, NULL);
|
||||
else if (!strcmp(attrname, "job-originating-user-name") &&
|
||||
ippGetValueTag(attr) == IPP_TAG_NAME)
|
||||
job_originating_user_name = ippGetString(attr, 0, NULL);
|
||||
}
|
||||
|
||||
if (job_id > 0)
|
||||
{
|
||||
if (job_name == NULL)
|
||||
job_name = "(withheld)";
|
||||
|
||||
if (job_originating_user_name == NULL)
|
||||
job_originating_user_name = "(withheld)";
|
||||
|
||||
printf("%5d %-16s %s\n", job_id, job_originating_user_name, job_name);
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3><a name='CREATING_URI_STRINGS'>Creating URI Strings</a></h3>
|
||||
|
||||
<p>To ensure proper encoding, the
|
||||
<a href='#httpAssembleURIf'><code>httpAssembleURIf</code></a> function must be
|
||||
used to format a "printer-uri" string for all printer-based requests:</p>
|
||||
|
||||
<pre class='example'>
|
||||
const char *name = "Foo";
|
||||
char uri[1024];
|
||||
<a href='#ipp_t'>ipp_t</a> *request;
|
||||
|
||||
<a href='#httpAssembleURIf'>httpAssembleURIf</a>(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, cupsServer(),
|
||||
ippPort(), "/printers/%s", name);
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
</pre>
|
||||
|
||||
<h3><a name='SENDING_REQUESTS_WITH_FILES'>Sending Requests with Files</a></h3>
|
||||
|
||||
<p>The <a href='#cupsDoFileRequest'><code>cupsDoFileRequest</code></a> and
|
||||
<a href='#cupsDoIORequest'><code>cupsDoIORequest</code></a> functions are
|
||||
used for requests involving files. The
|
||||
<a href='#cupsDoFileRequest'><code>cupsDoFileRequest</code></a> function
|
||||
attaches the named file to a request and is typically used when sending a print
|
||||
file or changing a printer's PPD file:</p>
|
||||
|
||||
<pre class='example'>
|
||||
const char *filename = "/usr/share/cups/data/testprint.ps";
|
||||
const char *name = "Foo";
|
||||
char uri[1024];
|
||||
char resource[1024];
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(IPP_PRINT_JOB);
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
|
||||
/* Use httpAssembleURIf for the printer-uri string */
|
||||
<a href='#httpAssembleURIf'>httpAssembleURIf</a>(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, cupsServer(),
|
||||
ippPort(), "/printers/%s", name);
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
|
||||
NULL, cupsUser());
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
|
||||
NULL, "testprint.ps");
|
||||
|
||||
/* Use snprintf for the resource path */
|
||||
snprintf(resource, sizeof(resource), "/printers/%s", name);
|
||||
|
||||
response = <a href='#cupsDoFileRequest'>cupsDoFileRequest</a>(CUPS_HTTP_DEFAULT, request, resource, filename);
|
||||
</pre>
|
||||
|
||||
<p>The <a href='#cupsDoIORequest'><code>cupsDoIORequest</code></a> function
|
||||
optionally attaches a file to the request and optionally saves a file in the
|
||||
response from the server. It is used when using a pipe for the request
|
||||
attachment or when using a request that returns a file, currently only
|
||||
<code>CUPS_GET_DOCUMENT</code> and <code>CUPS_GET_PPD</code>. For example,
|
||||
the following code will download the PPD file for the sample HP LaserJet
|
||||
printer driver:</p>
|
||||
|
||||
<pre class='example'>
|
||||
char tempfile[1024];
|
||||
int tempfd;
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
|
||||
NULL, "laserjet.ppd");
|
||||
|
||||
tempfd = cupsTempFd(tempfile, sizeof(tempfile));
|
||||
|
||||
response = <a href='#cupsDoIORequest'>cupsDoIORequest</a>(CUPS_HTTP_DEFAULT, request, "/", -1, tempfd);
|
||||
</pre>
|
||||
|
||||
<p>The example passes <code>-1</code> for the input file descriptor to specify
|
||||
that no file is to be attached to the request. The PPD file attached to the
|
||||
response is written to the temporary file descriptor we created using the
|
||||
<code>cupsTempFd</code> function.</p>
|
||||
|
||||
<h3><a name='ASYNCHRONOUS_REQUEST_PROCESSING'>Asynchronous Request Processing</a></h3>
|
||||
|
||||
<p>The <a href='#cupsSendRequest'><code>cupsSendRequest</code></a> and
|
||||
<a href='#cupsGetResponse'><code>cupsGetResponse</code></a> support
|
||||
asynchronous communications with the server. Unlike the other request
|
||||
functions, the IPP request is not automatically freed, so remember to
|
||||
free your request with the <a href='#ippDelete'><code>ippDelete</code></a>
|
||||
function.</p>
|
||||
|
||||
<p>File data is attached to the request using the
|
||||
<a href='#cupsWriteRequestData'><code>cupsWriteRequestData</code></a>
|
||||
function, while file data returned from the server is read using the
|
||||
<a href='#cupsReadResponseData'><code>cupsReadResponseData</code></a>
|
||||
function. We can rewrite the previous <code>CUPS_GET_PPD</code> example
|
||||
to use the asynchronous functions quite easily:</p>
|
||||
|
||||
<pre class='example'>
|
||||
char tempfile[1024];
|
||||
int tempfd;
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
|
||||
NULL, "laserjet.ppd");
|
||||
|
||||
tempfd = cupsTempFd(tempfile, sizeof(tempfile));
|
||||
|
||||
if (<a href='#cupsSendRequest'>cupsSendRequest</a>(CUPS_HTTP_DEFAULT, request, "/") == HTTP_CONTINUE)
|
||||
{
|
||||
response = <a href='#cupsGetResponse'>cupsGetResponse</a>(CUPS_HTTP_DEFAULT, "/");
|
||||
|
||||
if (response != NULL)
|
||||
{
|
||||
ssize_t bytes;
|
||||
char buffer[8192];
|
||||
|
||||
while ((bytes = <a href='#cupsReadResponseData'>cupsReadResponseData</a>(CUPS_HTTP_DEFAULT, buffer, sizeof(buffer))) > 0)
|
||||
write(tempfd, buffer, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
/* Free the request! */
|
||||
<a href='#ippDelete'>ippDelete</a>(request);
|
||||
</pre>
|
||||
|
||||
<p>The <a href='#cupsSendRequest'><code>cupsSendRequest</code></a> function
|
||||
returns the initial HTTP request status, typically either
|
||||
<code>HTTP_CONTINUE</code> or <code>HTTP_UNAUTHORIZED</code>. The latter status
|
||||
is returned when the request requires authentication of some sort. The
|
||||
<a href='#cupsDoAuthentication'><code>cupsDoAuthentication</code></a> function
|
||||
must be called when your see <code>HTTP_UNAUTHORIZED</code> and the request
|
||||
re-sent. We can add authentication support to our example code by using a
|
||||
<code>do ... while</code> loop:</p>
|
||||
|
||||
<pre class='example'>
|
||||
char tempfile[1024];
|
||||
int tempfd;
|
||||
<a href='#ipp_t'>ipp_t</a> *request = <a href='#ippNewRequest'>ippNewRequest</a>(CUPS_GET_PPD);
|
||||
<a href='#ipp_t'>ipp_t</a> *response;
|
||||
http_status_t status;
|
||||
|
||||
<a href='#ippAddString'>ippAddString</a>(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name",
|
||||
NULL, "laserjet.ppd");
|
||||
|
||||
tempfd = cupsTempFd(tempfile, sizeof(tempfile));
|
||||
|
||||
/* Loop for authentication */
|
||||
do
|
||||
{
|
||||
status = <a href='#cupsSendRequest'>cupsSendRequest</a>(CUPS_HTTP_DEFAULT, request, "/");
|
||||
|
||||
if (status == HTTP_UNAUTHORIZED)
|
||||
{
|
||||
/* Try to authenticate, break out of the loop if that fails */
|
||||
if (<a href='#cupsDoAuthentication'>cupsDoAuthentication</a>(CUPS_HTTP_DEFAULT, "POST", "/"))
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (status != HTTP_CONTINUE && status != HTTP_UNAUTHORIZED);
|
||||
|
||||
if (status == HTTP_CONTINUE)
|
||||
{
|
||||
response = <a href='#cupsGetResponse'>cupsGetResponse</a>(CUPS_HTTP_DEFAULT, "/");
|
||||
|
||||
if (response != NULL)
|
||||
{
|
||||
ssize_t bytes;
|
||||
char buffer[8192];
|
||||
|
||||
while ((bytes = <a href='#cupsReadResponseData'>cupsReadResponseData</a>(CUPS_HTTP_DEFAULT, buffer, sizeof(buffer))) > 0)
|
||||
write(tempfd, buffer, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
/* Free the request! */
|
||||
<a href='#ippDelete'>ippDelete</a>(request);
|
||||
</pre>
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<h1 class='title'>PPD API (DEPRECATED)</h1>
|
||||
|
||||
<blockquote>The PPD API is deprecated starting in CUPS 1.6/OS X 10.8. Please use the new Job Ticket APIs in the <a href="api-cups.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
|
||||
<blockquote>The PPD API is deprecated starting in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="api-cups.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
PPD API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2012 by Apple Inc.
|
||||
Copyright 2007-2018 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
|
||||
These coded instructions, statements, and computer programs are the
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||||
|
||||
<blockquote>The PPD API is deprecated starting in CUPS 1.6/OS X 10.8. Please use the new Job Ticket APIs in the <a href="api-cups.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
|
||||
<blockquote>The PPD API is deprecated starting in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="cupspm.html">CUPS API</a> documentation. These functions will be removed in a future release of CUPS.</blockquote>
|
||||
|
||||
<p>The CUPS PPD API provides read-only access the data in PostScript Printer
|
||||
Description ("PPD") files which are used for all printers with a driver. With
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
+24
-24
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -77,7 +77,7 @@ static int cups_array_find(cups_array_t *a, void *e, int prev, int *rdiff);
|
||||
* appended at the end of the run of identical elements. For unsorted arrays,
|
||||
* the element is appended to the end of the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -207,7 +207,7 @@ _cupsArrayAddStrings(cups_array_t *a, /* I - Array */
|
||||
* The caller is responsible for freeing the memory used by the
|
||||
* elements themselves.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -249,7 +249,7 @@ cupsArrayClear(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayCount()' - Get the number of elements in the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - Number of elements */
|
||||
@@ -276,7 +276,7 @@ cupsArrayCount(cups_array_t *a) /* I - Array */
|
||||
* The current element is undefined until you call @link cupsArrayFind@,
|
||||
* @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - Element */
|
||||
@@ -306,7 +306,7 @@ cupsArrayCurrent(cups_array_t *a) /* I - Array */
|
||||
* The caller is responsible for freeing the memory used by the
|
||||
* elements themselves.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void
|
||||
@@ -350,7 +350,7 @@ cupsArrayDelete(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayDup()' - Duplicate the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
cups_array_t * /* O - Duplicate array */
|
||||
@@ -435,7 +435,7 @@ cupsArrayDup(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayFind()' - Find an element in the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - Element found or @code NULL@ */
|
||||
@@ -530,7 +530,7 @@ cupsArrayFind(cups_array_t *a, /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayFirst()' - Get the first element in the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - First element or @code NULL@ if the array is empty */
|
||||
@@ -559,7 +559,7 @@ cupsArrayFirst(cups_array_t *a) /* I - Array */
|
||||
* The current element is undefined until you call @link cupsArrayFind@,
|
||||
* @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@.
|
||||
*
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - Index of the current element, starting at 0 */
|
||||
@@ -575,7 +575,7 @@ cupsArrayGetIndex(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayGetInsert()' - Get the index of the last inserted element.
|
||||
*
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - Index of the last inserted element, starting at 0 */
|
||||
@@ -591,7 +591,7 @@ cupsArrayGetInsert(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayIndex()' - Get the N-th element in the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - N-th element or @code NULL@ */
|
||||
@@ -614,7 +614,7 @@ cupsArrayIndex(cups_array_t *a, /* I - Array */
|
||||
* inserted at the beginning of the run of identical elements. For unsorted
|
||||
* arrays, the element is inserted at the beginning of the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 0 on failure, 1 on success */
|
||||
@@ -644,7 +644,7 @@ cupsArrayInsert(cups_array_t *a, /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayLast()' - Get the last element in the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - Last element or @code NULL@ if the array is empty */
|
||||
@@ -675,7 +675,7 @@ cupsArrayLast(cups_array_t *a) /* I - Array */
|
||||
* data pointer argument can safely be omitted when not required so functions
|
||||
* like @code strcmp@ can be used for sorted string arrays.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
cups_array_t * /* O - Array */
|
||||
@@ -697,7 +697,7 @@ cupsArrayNew(cups_array_func_t f, /* I - Comparison function or @code NULL@ for
|
||||
* The hash function ("h") is used to implement cached lookups with the
|
||||
* specified hash size ("hsize").
|
||||
*
|
||||
* @since CUPS 1.3/OS X 10.5@
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
cups_array_t * /* O - Array */
|
||||
@@ -727,7 +727,7 @@ cupsArrayNew2(cups_array_func_t f, /* I - Comparison function or @code NULL@ fo
|
||||
* The free function ("cf") is used to automatically free/release elements when
|
||||
* removed or the array is deleted.
|
||||
*
|
||||
* @since CUPS 1.5/OS X 10.7@
|
||||
* @since CUPS 1.5/macOS 10.7@
|
||||
*/
|
||||
|
||||
cups_array_t * /* O - Array */
|
||||
@@ -811,7 +811,7 @@ _cupsArrayNewStrings(const char *s, /* I - Delimited strings or NULL */
|
||||
* @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@
|
||||
* to set the current element.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - Next element or @code NULL@ */
|
||||
@@ -844,7 +844,7 @@ cupsArrayNext(cups_array_t *a) /* I - Array */
|
||||
* @link cupsArrayFirst@, or @link cupsArrayIndex@, or @link cupsArrayLast@
|
||||
* to set the current element.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - Previous element or @code NULL@ */
|
||||
@@ -877,7 +877,7 @@ cupsArrayPrev(cups_array_t *a) /* I - Array */
|
||||
* The caller is responsible for freeing the memory used by the
|
||||
* removed element.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -942,7 +942,7 @@ cupsArrayRemove(cups_array_t *a, /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayRestore()' - Reset the current element to the last @link cupsArraySave@.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - New current element */
|
||||
@@ -973,7 +973,7 @@ cupsArrayRestore(cups_array_t *a) /* I - Array */
|
||||
*
|
||||
* The save/restore stack is guaranteed to be at least 32 elements deep.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
@@ -995,7 +995,7 @@ cupsArraySave(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cupsArrayUserData()' - Return the user data for an array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
void * /* O - User data */
|
||||
@@ -1011,7 +1011,7 @@ cupsArrayUserData(cups_array_t *a) /* I - Array */
|
||||
/*
|
||||
* 'cups_array_add()' - Insert or append an element to the array.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
static int /* O - 1 on success, 0 on failure */
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
+438
-165
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Authentication functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* This file contains Kerberos support code, copyright 2006 by
|
||||
* Jelmer Vernooij.
|
||||
@@ -11,7 +11,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -23,11 +23,11 @@
|
||||
#include "cups-private.h"
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
#if defined(_WIN32) || defined(__EMX__)
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
#endif /* _WIN32 || __EMX__ */
|
||||
|
||||
#if HAVE_AUTHORIZATION_H
|
||||
# include <Security/Authorization.h>
|
||||
@@ -47,14 +47,21 @@ extern const char *cssmErrorString(int error);
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static const char *cups_auth_find(const char *www_authenticate, const char *scheme);
|
||||
static const char *cups_auth_param(const char *scheme, const char *name, char *value, size_t valsize);
|
||||
static const char *cups_auth_scheme(const char *www_authenticate, char *scheme, size_t schemesize);
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
# define CUPS_GSS_OK 0 /* Successfully set credentials */
|
||||
# define CUPS_GSS_NONE -1 /* No credentials */
|
||||
# define CUPS_GSS_FAIL -2 /* Failed credentials/authentication */
|
||||
# ifdef HAVE_GSS_ACQUIRE_CRED_EX_F
|
||||
# ifdef HAVE_GSS_GSSAPI_SPI_H
|
||||
# include <GSS/gssapi_spi.h>
|
||||
# else
|
||||
# define GSS_AUTH_IDENTITY_TYPE_1 1
|
||||
# define gss_acquire_cred_ex_f __ApplePrivate_gss_acquire_cred_ex_f
|
||||
typedef struct gss_auth_identity
|
||||
typedef struct gss_auth_identity /* @private@ */
|
||||
{
|
||||
uint32_t type;
|
||||
uint32_t flags;
|
||||
@@ -102,7 +109,7 @@ static int cups_local_auth(http_t *http);
|
||||
* This function should be called in response to a @code HTTP_STATUS_UNAUTHORIZED@
|
||||
* status, prior to resubmitting your request.
|
||||
*
|
||||
* @since CUPS 1.1.20/OS X 10.4@
|
||||
* @since CUPS 1.1.20/macOS 10.4@
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on error */
|
||||
@@ -112,10 +119,10 @@ cupsDoAuthentication(
|
||||
const char *resource) /* I - Resource path */
|
||||
{
|
||||
const char *password, /* Password string */
|
||||
*www_auth; /* WWW-Authenticate header */
|
||||
char prompt[1024], /* Prompt for user */
|
||||
realm[HTTP_MAX_VALUE], /* realm="xyz" string */
|
||||
nonce[HTTP_MAX_VALUE]; /* nonce="xyz" string */
|
||||
*www_auth, /* WWW-Authenticate header */
|
||||
*schemedata; /* Scheme-specific data */
|
||||
char scheme[256], /* Scheme name */
|
||||
prompt[1024]; /* Prompt for user */
|
||||
int localauth; /* Local authentication result */
|
||||
_cups_globals_t *cg; /* Global data */
|
||||
|
||||
@@ -163,122 +170,154 @@ cupsDoAuthentication(
|
||||
}
|
||||
|
||||
/*
|
||||
* Nope, see if we should retry the current username:password...
|
||||
* Nope, loop through the authentication schemes to find the first we support.
|
||||
*/
|
||||
|
||||
www_auth = http->fields[HTTP_FIELD_WWW_AUTHENTICATE];
|
||||
www_auth = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
|
||||
|
||||
if ((http->digest_tries > 1 || !http->userpass[0]) &&
|
||||
(!_cups_strncasecmp(www_auth, "Basic", 5) ||
|
||||
!_cups_strncasecmp(www_auth, "Digest", 6)))
|
||||
for (schemedata = cups_auth_scheme(www_auth, scheme, sizeof(scheme)); schemedata; schemedata = cups_auth_scheme(schemedata + strlen(scheme), scheme, sizeof(scheme)))
|
||||
{
|
||||
/*
|
||||
* Nope - get a new password from the user...
|
||||
* Check the scheme name...
|
||||
*/
|
||||
|
||||
char default_username[HTTP_MAX_VALUE];
|
||||
/* Default username */
|
||||
|
||||
cg = _cupsGlobals();
|
||||
|
||||
if (!cg->lang_default)
|
||||
cg->lang_default = cupsLangDefault();
|
||||
|
||||
if (httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "username",
|
||||
default_username))
|
||||
cupsSetUser(default_username);
|
||||
|
||||
snprintf(prompt, sizeof(prompt),
|
||||
_cupsLangString(cg->lang_default, _("Password for %s on %s? ")),
|
||||
cupsUser(),
|
||||
http->hostname[0] == '/' ? "localhost" : http->hostname);
|
||||
|
||||
http->digest_tries = _cups_strncasecmp(www_auth, "Digest", 6) != 0;
|
||||
http->userpass[0] = '\0';
|
||||
|
||||
if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL)
|
||||
{
|
||||
http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
snprintf(http->userpass, sizeof(http->userpass), "%s:%s", cupsUser(),
|
||||
password);
|
||||
}
|
||||
else if (http->status == HTTP_STATUS_UNAUTHORIZED)
|
||||
http->digest_tries ++;
|
||||
|
||||
if (http->status == HTTP_STATUS_UNAUTHORIZED && http->digest_tries >= 3)
|
||||
{
|
||||
DEBUG_printf(("1cupsDoAuthentication: Too many authentication tries (%d)",
|
||||
http->digest_tries));
|
||||
|
||||
http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Got a password; encode it for the server...
|
||||
*/
|
||||
DEBUG_printf(("2cupsDoAuthentication: Trying scheme \"%s\"...", scheme));
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
if (!_cups_strncasecmp(www_auth, "Negotiate", 9))
|
||||
{
|
||||
if (!_cups_strcasecmp(scheme, "Negotiate"))
|
||||
{
|
||||
/*
|
||||
* Kerberos authentication...
|
||||
*/
|
||||
|
||||
int gss_status; /* Auth status */
|
||||
|
||||
if ((gss_status = _cupsSetNegotiateAuthString(http, method, resource)) == CUPS_GSS_FAIL)
|
||||
{
|
||||
DEBUG_puts("1cupsDoAuthentication: Negotiate failed.");
|
||||
http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
|
||||
return (-1);
|
||||
}
|
||||
else if (gss_status == CUPS_GSS_NONE)
|
||||
{
|
||||
DEBUG_puts("2cupsDoAuthentication: No credentials for Negotiate.");
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_puts("2cupsDoAuthentication: Using Negotiate.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_GSSAPI */
|
||||
if (_cups_strcasecmp(scheme, "Basic") && _cups_strcasecmp(scheme, "Digest"))
|
||||
{
|
||||
/*
|
||||
* Other schemes not yet supported...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("2cupsDoAuthentication: Scheme \"%s\" not yet supported.", scheme));
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Kerberos authentication...
|
||||
* See if we should retry the current username:password...
|
||||
*/
|
||||
|
||||
if (_cupsSetNegotiateAuthString(http, method, resource))
|
||||
if ((http->digest_tries > 1 || !http->userpass[0]) && (!_cups_strcasecmp(scheme, "Basic") || (!_cups_strcasecmp(scheme, "Digest"))))
|
||||
{
|
||||
/*
|
||||
* Nope - get a new password from the user...
|
||||
*/
|
||||
|
||||
char default_username[HTTP_MAX_VALUE];
|
||||
/* Default username */
|
||||
|
||||
cg = _cupsGlobals();
|
||||
|
||||
if (!cg->lang_default)
|
||||
cg->lang_default = cupsLangDefault();
|
||||
|
||||
if (cups_auth_param(schemedata, "username", default_username, sizeof(default_username)))
|
||||
cupsSetUser(default_username);
|
||||
|
||||
snprintf(prompt, sizeof(prompt), _cupsLangString(cg->lang_default, _("Password for %s on %s? ")), cupsUser(), http->hostname[0] == '/' ? "localhost" : http->hostname);
|
||||
|
||||
http->digest_tries = _cups_strncasecmp(scheme, "Digest", 6) != 0;
|
||||
http->userpass[0] = '\0';
|
||||
|
||||
if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL)
|
||||
{
|
||||
DEBUG_puts("1cupsDoAuthentication: User canceled password request.");
|
||||
http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
snprintf(http->userpass, sizeof(http->userpass), "%s:%s", cupsUser(), password);
|
||||
}
|
||||
else if (http->status == HTTP_STATUS_UNAUTHORIZED)
|
||||
http->digest_tries ++;
|
||||
|
||||
if (http->status == HTTP_STATUS_UNAUTHORIZED && http->digest_tries >= 3)
|
||||
{
|
||||
DEBUG_printf(("1cupsDoAuthentication: Too many authentication tries (%d)", http->digest_tries));
|
||||
|
||||
http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_GSSAPI */
|
||||
if (!_cups_strncasecmp(www_auth, "Basic", 5))
|
||||
{
|
||||
|
||||
/*
|
||||
* Basic authentication...
|
||||
* Got a password; encode it for the server...
|
||||
*/
|
||||
|
||||
char encode[256]; /* Base64 buffer */
|
||||
if (!_cups_strcasecmp(scheme, "Basic"))
|
||||
{
|
||||
/*
|
||||
* Basic authentication...
|
||||
*/
|
||||
|
||||
char encode[256]; /* Base64 buffer */
|
||||
|
||||
httpEncode64_2(encode, sizeof(encode), http->userpass,
|
||||
(int)strlen(http->userpass));
|
||||
httpSetAuthString(http, "Basic", encode);
|
||||
DEBUG_puts("2cupsDoAuthentication: Using Basic.");
|
||||
httpEncode64_2(encode, sizeof(encode), http->userpass, (int)strlen(http->userpass));
|
||||
httpSetAuthString(http, "Basic", encode);
|
||||
break;
|
||||
}
|
||||
else if (!_cups_strcasecmp(scheme, "Digest"))
|
||||
{
|
||||
/*
|
||||
* Digest authentication...
|
||||
*/
|
||||
|
||||
char nonce[HTTP_MAX_VALUE]; /* nonce="xyz" string */
|
||||
|
||||
cups_auth_param(schemedata, "algorithm", http->algorithm, sizeof(http->algorithm));
|
||||
cups_auth_param(schemedata, "opaque", http->opaque, sizeof(http->opaque));
|
||||
cups_auth_param(schemedata, "nonce", nonce, sizeof(nonce));
|
||||
cups_auth_param(schemedata, "realm", http->realm, sizeof(http->realm));
|
||||
|
||||
if (_httpSetDigestAuthString(http, nonce, method, resource))
|
||||
{
|
||||
DEBUG_puts("2cupsDoAuthentication: Using Basic.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!_cups_strncasecmp(www_auth, "Digest", 6))
|
||||
|
||||
if (http->authstring)
|
||||
{
|
||||
/*
|
||||
* Digest authentication...
|
||||
*/
|
||||
DEBUG_printf(("1cupsDoAuthentication: authstring=\"%s\".", http->authstring));
|
||||
|
||||
char encode[33], /* MD5 buffer */
|
||||
digest[1024]; /* Digest auth data */
|
||||
|
||||
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "realm", realm);
|
||||
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "nonce", nonce);
|
||||
|
||||
httpMD5(cupsUser(), realm, strchr(http->userpass, ':') + 1, encode);
|
||||
httpMD5Final(nonce, method, resource, encode);
|
||||
snprintf(digest, sizeof(digest),
|
||||
"username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", "
|
||||
"response=\"%s\"", cupsUser(), realm, nonce, resource, encode);
|
||||
httpSetAuthString(http, "Digest", digest);
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_printf(("1cupsDoAuthentication: Unknown auth type: \"%s\"",
|
||||
www_auth));
|
||||
DEBUG_puts("1cupsDoAuthentication: No supported schemes.");
|
||||
http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
DEBUG_printf(("1cupsDoAuthentication: authstring=\"%s\"", http->authstring));
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -287,7 +326,7 @@ cupsDoAuthentication(
|
||||
* '_cupsSetNegotiateAuthString()' - Set the Kerberos authentication string.
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on error */
|
||||
int /* O - 0 on success, negative on error */
|
||||
_cupsSetNegotiateAuthString(
|
||||
http_t *http, /* I - Connection to server */
|
||||
const char *method, /* I - Request method ("GET", "POST", "PUT") */
|
||||
@@ -312,10 +351,16 @@ _cupsSetNegotiateAuthString(
|
||||
{
|
||||
DEBUG_puts("1_cupsSetNegotiateAuthString: Weak-linked GSSAPI/Kerberos "
|
||||
"framework is not present");
|
||||
return (-1);
|
||||
return (CUPS_GSS_NONE);
|
||||
}
|
||||
# endif /* __APPLE__ */
|
||||
|
||||
if (!strcmp(http->hostname, "localhost") || http->hostname[0] == '/' || isdigit(http->hostname[0] & 255) || !strchr(http->hostname, '.'))
|
||||
{
|
||||
DEBUG_printf(("1_cupsSetNegotiateAuthString: Kerberos not available for host \"%s\".", http->hostname));
|
||||
return (CUPS_GSS_NONE);
|
||||
}
|
||||
|
||||
if (http->gssname == GSS_C_NO_NAME)
|
||||
{
|
||||
http->gssname = cups_gss_getname(http, _cupsGSSServiceName());
|
||||
@@ -336,7 +381,7 @@ _cupsSetNegotiateAuthString(
|
||||
GSS_C_NO_BUFFER, &http->gssmech,
|
||||
&output_token, NULL, NULL);
|
||||
|
||||
#ifdef HAVE_GSS_ACQUIRE_CRED_EX_F
|
||||
# ifdef HAVE_GSS_ACQUIRE_CRED_EX_F
|
||||
if (major_status == GSS_S_NO_CRED)
|
||||
{
|
||||
/*
|
||||
@@ -360,7 +405,7 @@ _cupsSetNegotiateAuthString(
|
||||
cupsUser(), http->gsshost);
|
||||
|
||||
if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL)
|
||||
return (-1);
|
||||
return (CUPS_GSS_FAIL);
|
||||
|
||||
/*
|
||||
* Try to acquire credentials...
|
||||
@@ -386,10 +431,7 @@ _cupsSetNegotiateAuthString(
|
||||
|
||||
if (data.sem)
|
||||
{
|
||||
major_status = gss_acquire_cred_ex_f(NULL, GSS_C_NO_NAME, 0,
|
||||
GSS_C_INDEFINITE, GSS_KRB5_MECHANISM,
|
||||
GSS_C_INITIATE, &identity, &data,
|
||||
cups_gss_acquire);
|
||||
major_status = gss_acquire_cred_ex_f(NULL, GSS_C_NO_NAME, 0, GSS_C_INDEFINITE, GSS_KRB5_MECHANISM, GSS_C_INITIATE, (gss_auth_identity_t)&identity, &data, cups_gss_acquire);
|
||||
|
||||
if (major_status == GSS_S_COMPLETE)
|
||||
{
|
||||
@@ -415,21 +457,23 @@ _cupsSetNegotiateAuthString(
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_GSS_ACQUIRED_CRED_EX_F */
|
||||
# endif /* HAVE_GSS_ACQUIRED_CRED_EX_F */
|
||||
|
||||
if (GSS_ERROR(major_status))
|
||||
if (major_status == GSS_S_NO_CRED)
|
||||
{
|
||||
cups_gss_printf(major_status, minor_status,
|
||||
"_cupsSetNegotiateAuthString: Unable to initialize "
|
||||
"security context");
|
||||
return (-1);
|
||||
cups_gss_printf(major_status, minor_status, "_cupsSetNegotiateAuthString: No credentials");
|
||||
return (CUPS_GSS_NONE);
|
||||
}
|
||||
else if (GSS_ERROR(major_status))
|
||||
{
|
||||
cups_gss_printf(major_status, minor_status, "_cupsSetNegotiateAuthString: Unable to initialize security context");
|
||||
return (CUPS_GSS_FAIL);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
# ifdef DEBUG
|
||||
else if (major_status == GSS_S_CONTINUE_NEEDED)
|
||||
cups_gss_printf(major_status, minor_status,
|
||||
"_cupsSetNegotiateAuthString: Continuation needed!");
|
||||
#endif /* DEBUG */
|
||||
cups_gss_printf(major_status, minor_status, "_cupsSetNegotiateAuthString: Continuation needed");
|
||||
# endif /* DEBUG */
|
||||
|
||||
if (output_token.length > 0 && output_token.length <= 65536)
|
||||
{
|
||||
@@ -439,7 +483,7 @@ _cupsSetNegotiateAuthString(
|
||||
*/
|
||||
|
||||
int authsize = 10 + /* "Negotiate " */
|
||||
(int)output_token.length * 4 / 3 + 1 + 1;
|
||||
(((int)output_token.length * 4 / 3 + 3) & ~3) + 1;
|
||||
/* Base64 + nul */
|
||||
|
||||
httpSetAuthString(http, NULL, NULL);
|
||||
@@ -462,13 +506,264 @@ _cupsSetNegotiateAuthString(
|
||||
"large - %d bytes!", (int)output_token.length));
|
||||
gss_release_buffer(&minor_status, &output_token);
|
||||
|
||||
return (-1);
|
||||
return (CUPS_GSS_FAIL);
|
||||
}
|
||||
|
||||
return (0);
|
||||
return (CUPS_GSS_OK);
|
||||
}
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_auth_find()' - Find the named WWW-Authenticate scheme.
|
||||
*
|
||||
* The "www_authenticate" parameter points to the current position in the header.
|
||||
*
|
||||
* Returns @code NULL@ if the auth scheme is not present.
|
||||
*/
|
||||
|
||||
static const char * /* O - Start of matching scheme or @code NULL@ if not found */
|
||||
cups_auth_find(const char *www_authenticate, /* I - Pointer into WWW-Authenticate header */
|
||||
const char *scheme) /* I - Authentication scheme */
|
||||
{
|
||||
size_t schemelen = strlen(scheme); /* Length of scheme */
|
||||
|
||||
|
||||
DEBUG_printf(("8cups_auth_find(www_authenticate=\"%s\", scheme=\"%s\"(%d))", www_authenticate, scheme, (int)schemelen));
|
||||
|
||||
while (*www_authenticate)
|
||||
{
|
||||
/*
|
||||
* Skip leading whitespace and commas...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("9cups_auth_find: Before whitespace: \"%s\"", www_authenticate));
|
||||
while (isspace(*www_authenticate & 255) || *www_authenticate == ',')
|
||||
www_authenticate ++;
|
||||
DEBUG_printf(("9cups_auth_find: After whitespace: \"%s\"", www_authenticate));
|
||||
|
||||
/*
|
||||
* See if this is "Scheme" followed by whitespace or the end of the string.
|
||||
*/
|
||||
|
||||
if (!strncmp(www_authenticate, scheme, schemelen) && (isspace(www_authenticate[schemelen] & 255) || www_authenticate[schemelen] == ',' || !www_authenticate[schemelen]))
|
||||
{
|
||||
/*
|
||||
* Yes, this is the start of the scheme-specific information...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("9cups_auth_find: Returning \"%s\".", www_authenticate));
|
||||
|
||||
return (www_authenticate);
|
||||
}
|
||||
|
||||
/*
|
||||
* Skip the scheme name or param="value" string...
|
||||
*/
|
||||
|
||||
while (!isspace(*www_authenticate & 255) && *www_authenticate)
|
||||
{
|
||||
if (*www_authenticate == '\"')
|
||||
{
|
||||
/*
|
||||
* Skip quoted value...
|
||||
*/
|
||||
|
||||
www_authenticate ++;
|
||||
while (*www_authenticate && *www_authenticate != '\"')
|
||||
www_authenticate ++;
|
||||
|
||||
DEBUG_printf(("9cups_auth_find: After quoted: \"%s\"", www_authenticate));
|
||||
}
|
||||
|
||||
www_authenticate ++;
|
||||
}
|
||||
|
||||
DEBUG_printf(("9cups_auth_find: After skip: \"%s\"", www_authenticate));
|
||||
}
|
||||
|
||||
DEBUG_puts("9cups_auth_find: Returning NULL.");
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_auth_param()' - Copy the value for the named authentication parameter,
|
||||
* if present.
|
||||
*/
|
||||
|
||||
static const char * /* O - Parameter value or @code NULL@ if not present */
|
||||
cups_auth_param(const char *scheme, /* I - Pointer to auth data */
|
||||
const char *name, /* I - Name of parameter */
|
||||
char *value, /* I - Value buffer */
|
||||
size_t valsize) /* I - Size of value buffer */
|
||||
{
|
||||
char *valptr = value, /* Pointer into value buffer */
|
||||
*valend = value + valsize - 1; /* Pointer to end of buffer */
|
||||
size_t namelen = strlen(name); /* Name length */
|
||||
int param; /* Is this a parameter? */
|
||||
|
||||
|
||||
DEBUG_printf(("8cups_auth_param(scheme=\"%s\", name=\"%s\", value=%p, valsize=%d)", scheme, name, (void *)value, (int)valsize));
|
||||
|
||||
while (!isspace(*scheme & 255) && *scheme)
|
||||
scheme ++;
|
||||
|
||||
while (*scheme)
|
||||
{
|
||||
while (isspace(*scheme & 255) || *scheme == ',')
|
||||
scheme ++;
|
||||
|
||||
if (!strncmp(scheme, name, namelen) && scheme[namelen] == '=')
|
||||
{
|
||||
/*
|
||||
* Found the parameter, copy the value...
|
||||
*/
|
||||
|
||||
scheme += namelen + 1;
|
||||
if (*scheme == '\"')
|
||||
{
|
||||
scheme ++;
|
||||
|
||||
while (*scheme && *scheme != '\"')
|
||||
{
|
||||
if (valptr < valend)
|
||||
*valptr++ = *scheme;
|
||||
|
||||
scheme ++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (*scheme && strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~+/=", *scheme))
|
||||
{
|
||||
if (valptr < valend)
|
||||
*valptr++ = *scheme;
|
||||
|
||||
scheme ++;
|
||||
}
|
||||
}
|
||||
|
||||
*valptr = '\0';
|
||||
|
||||
DEBUG_printf(("9cups_auth_param: Returning \"%s\".", value));
|
||||
|
||||
return (value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Skip the param=value string...
|
||||
*/
|
||||
|
||||
param = 0;
|
||||
|
||||
while (!isspace(*scheme & 255) && *scheme)
|
||||
{
|
||||
if (*scheme == '=')
|
||||
param = 1;
|
||||
else if (*scheme == '\"')
|
||||
{
|
||||
/*
|
||||
* Skip quoted value...
|
||||
*/
|
||||
|
||||
scheme ++;
|
||||
while (*scheme && *scheme != '\"')
|
||||
scheme ++;
|
||||
}
|
||||
|
||||
scheme ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* If this wasn't a parameter, we are at the end of this scheme's
|
||||
* parameters...
|
||||
*/
|
||||
|
||||
if (!param)
|
||||
break;
|
||||
}
|
||||
|
||||
*value = '\0';
|
||||
|
||||
DEBUG_puts("9cups_auth_param: Returning NULL.");
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_auth_scheme()' - Get the (next) WWW-Authenticate scheme.
|
||||
*
|
||||
* The "www_authenticate" parameter points to the current position in the header.
|
||||
*
|
||||
* Returns @code NULL@ if there are no (more) auth schemes present.
|
||||
*/
|
||||
|
||||
static const char * /* O - Start of scheme or @code NULL@ if not found */
|
||||
cups_auth_scheme(const char *www_authenticate, /* I - Pointer into WWW-Authenticate header */
|
||||
char *scheme, /* I - Scheme name buffer */
|
||||
size_t schemesize) /* I - Size of buffer */
|
||||
{
|
||||
const char *start; /* Start of scheme data */
|
||||
char *sptr = scheme, /* Pointer into scheme buffer */
|
||||
*send = scheme + schemesize - 1;/* End of scheme buffer */
|
||||
int param; /* Is this a parameter? */
|
||||
|
||||
|
||||
DEBUG_printf(("8cups_auth_scheme(www_authenticate=\"%s\", scheme=%p, schemesize=%d)", www_authenticate, (void *)scheme, (int)schemesize));
|
||||
|
||||
while (*www_authenticate)
|
||||
{
|
||||
/*
|
||||
* Skip leading whitespace and commas...
|
||||
*/
|
||||
|
||||
while (isspace(*www_authenticate & 255) || *www_authenticate == ',')
|
||||
www_authenticate ++;
|
||||
|
||||
/*
|
||||
* Parse the scheme name or param="value" string...
|
||||
*/
|
||||
|
||||
for (sptr = scheme, start = www_authenticate, param = 0; *www_authenticate && *www_authenticate != ',' && !isspace(*www_authenticate & 255); www_authenticate ++)
|
||||
{
|
||||
if (*www_authenticate == '=')
|
||||
param = 1;
|
||||
else if (!param && sptr < send)
|
||||
*sptr++ = *www_authenticate;
|
||||
else if (*www_authenticate == '\"')
|
||||
{
|
||||
/*
|
||||
* Skip quoted value...
|
||||
*/
|
||||
|
||||
www_authenticate ++;
|
||||
while (*www_authenticate && *www_authenticate != '\"')
|
||||
www_authenticate ++;
|
||||
}
|
||||
}
|
||||
|
||||
if (sptr > scheme && !param)
|
||||
{
|
||||
*sptr = '\0';
|
||||
|
||||
DEBUG_printf(("9cups_auth_scheme: Returning \"%s\".", start));
|
||||
|
||||
return (start);
|
||||
}
|
||||
}
|
||||
|
||||
*scheme = '\0';
|
||||
|
||||
DEBUG_puts("9cups_auth_scheme: Returning NULL.");
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
# ifdef HAVE_GSS_ACQUIRE_CRED_EX_F
|
||||
/*
|
||||
* 'cups_gss_acquire()' - Kerberos credentials callback.
|
||||
@@ -642,9 +937,9 @@ static int /* O - 0 if available */
|
||||
/* -1 error */
|
||||
cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
{
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
#if defined(_WIN32) || defined(__EMX__)
|
||||
/*
|
||||
* Currently WIN32 and OS-2 do not support the CUPS server...
|
||||
* Currently _WIN32 and OS-2 do not support the CUPS server...
|
||||
*/
|
||||
|
||||
return (1);
|
||||
@@ -653,6 +948,8 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
FILE *fp; /* Certificate file */
|
||||
char trc[16], /* Try Root Certificate parameter */
|
||||
filename[1024]; /* Certificate filename */
|
||||
const char *www_auth, /* WWW-Authenticate header */
|
||||
*schemedata; /* Data for the named auth scheme */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
|
||||
# if defined(HAVE_AUTHORIZATION_H)
|
||||
OSStatus status; /* Status */
|
||||
@@ -671,13 +968,14 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
* See if we are accessing localhost...
|
||||
*/
|
||||
|
||||
if (!httpAddrLocalhost(http->hostaddr) &&
|
||||
_cups_strcasecmp(http->hostname, "localhost") != 0)
|
||||
if (!httpAddrLocalhost(http->hostaddr) && _cups_strcasecmp(http->hostname, "localhost") != 0)
|
||||
{
|
||||
DEBUG_puts("8cups_local_auth: Not a local connection!");
|
||||
return (1);
|
||||
}
|
||||
|
||||
www_auth = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
|
||||
|
||||
# if defined(HAVE_AUTHORIZATION_H)
|
||||
/*
|
||||
* Delete any previous authorization reference...
|
||||
@@ -689,12 +987,9 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
http->auth_ref = NULL;
|
||||
}
|
||||
|
||||
if (!getenv("GATEWAY_INTERFACE") &&
|
||||
httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey",
|
||||
auth_key, sizeof(auth_key)))
|
||||
if (!getenv("GATEWAY_INTERFACE") && (schemedata = cups_auth_find(www_auth, "AuthRef")) != NULL && cups_auth_param(schemedata, "key", auth_key, sizeof(auth_key)))
|
||||
{
|
||||
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
|
||||
kAuthorizationFlagDefaults, &http->auth_ref);
|
||||
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &http->auth_ref);
|
||||
if (status != errAuthorizationSuccess)
|
||||
{
|
||||
DEBUG_printf(("8cups_local_auth: AuthorizationCreate() returned %d (%s)",
|
||||
@@ -748,6 +1043,11 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
}
|
||||
# endif /* HAVE_AUTHORIZATION_H */
|
||||
|
||||
# ifdef HAVE_GSSAPI
|
||||
if (cups_auth_find(www_auth, "Negotiate"))
|
||||
return (1);
|
||||
# endif /* HAVE_GSSAPI */
|
||||
|
||||
# if defined(SO_PEERCRED) && defined(AF_LOCAL)
|
||||
/*
|
||||
* See if we can authenticate using the peer credentials provided over a
|
||||
@@ -755,16 +1055,9 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
* information...
|
||||
*/
|
||||
|
||||
if (
|
||||
# ifdef HAVE_GSSAPI
|
||||
_cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9) &&
|
||||
# endif /* HAVE_GSSAPI */
|
||||
# ifdef HAVE_AUTHORIZATION_H
|
||||
!httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey",
|
||||
auth_key, sizeof(auth_key)) &&
|
||||
# endif /* HAVE_AUTHORIZATION_H */
|
||||
http->hostaddr->addr.sa_family == AF_LOCAL &&
|
||||
!getenv("GATEWAY_INTERFACE")) /* Not via CGI programs... */
|
||||
if (http->hostaddr->addr.sa_family == AF_LOCAL &&
|
||||
!getenv("GATEWAY_INTERFACE") && /* Not via CGI programs... */
|
||||
cups_auth_find(www_auth, "PeerCred"))
|
||||
{
|
||||
/*
|
||||
* Verify that the current cupsUser() matches the current UID...
|
||||
@@ -787,6 +1080,9 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
}
|
||||
# endif /* SO_PEERCRED && AF_LOCAL */
|
||||
|
||||
if ((schemedata = cups_auth_find(www_auth, "Local")) == NULL)
|
||||
return (1);
|
||||
|
||||
/*
|
||||
* Try opening a certificate file for this PID. If that fails,
|
||||
* try the root certificate...
|
||||
@@ -800,33 +1096,9 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
* No certificate for this PID; see if we can get the root certificate...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("9cups_local_auth: Unable to open file %s: %s",
|
||||
filename, strerror(errno)));
|
||||
DEBUG_printf(("9cups_local_auth: Unable to open file \"%s\": %s", filename, strerror(errno)));
|
||||
|
||||
# ifdef HAVE_GSSAPI
|
||||
if (!_cups_strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Negotiate", 9))
|
||||
{
|
||||
/*
|
||||
* Kerberos required, don't try the root certificate...
|
||||
*/
|
||||
|
||||
return (1);
|
||||
}
|
||||
# endif /* HAVE_GSSAPI */
|
||||
|
||||
# ifdef HAVE_AUTHORIZATION_H
|
||||
if (httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey",
|
||||
auth_key, sizeof(auth_key)))
|
||||
{
|
||||
/*
|
||||
* Don't use the root certificate as a replacement for an authkey...
|
||||
*/
|
||||
|
||||
return (1);
|
||||
}
|
||||
# endif /* HAVE_AUTHORIZATION_H */
|
||||
if (!httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "trc", trc,
|
||||
sizeof(trc)))
|
||||
if (!cups_auth_param(schemedata, "trc", trc, sizeof(trc)))
|
||||
{
|
||||
/*
|
||||
* Scheduler doesn't want us to use the root certificate...
|
||||
@@ -836,7 +1108,8 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
}
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/certs/0", cg->cups_statedir);
|
||||
fp = fopen(filename, "r");
|
||||
if ((fp = fopen(filename, "r")) == NULL)
|
||||
DEBUG_printf(("9cups_local_auth: Unable to open file \"%s\": %s", filename, strerror(errno)));
|
||||
}
|
||||
|
||||
if (fp)
|
||||
@@ -867,5 +1140,5 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
}
|
||||
|
||||
return (1);
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
#endif /* _WIN32 || __EMX__ */
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -19,12 +19,12 @@
|
||||
|
||||
#include "cups.h"
|
||||
#include <errno.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <io.h>
|
||||
# include <fcntl.h>
|
||||
#else
|
||||
# include <sys/time.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -42,7 +42,7 @@ static void cups_setup(fd_set *set, struct timeval *tval,
|
||||
* parameter controls how many seconds to wait for the data - use 0.0 to
|
||||
* return immediately if there is no data, -1.0 to wait for data indefinitely.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
ssize_t /* O - Bytes read or -1 on error */
|
||||
@@ -77,11 +77,11 @@ cupsBackChannelRead(char *buffer, /* I - Buffer to read into */
|
||||
* Read bytes from the pipe...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return ((ssize_t)_read(3, buffer, (unsigned)bytes));
|
||||
#else
|
||||
return (read(3, buffer, bytes));
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ cupsBackChannelRead(char *buffer, /* I - Buffer to read into */
|
||||
* 0.0 to return immediately if the data cannot be written, -1.0 to wait
|
||||
* indefinitely.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
ssize_t /* O - Bytes written or -1 on error */
|
||||
@@ -139,11 +139,11 @@ cupsBackChannelWrite(
|
||||
* Write bytes to the pipe...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
count = (ssize_t)_write(3, buffer, (unsigned)(bytes - total));
|
||||
#else
|
||||
count = write(3, buffer, bytes - total);
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
if (count < 0)
|
||||
{
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ static void quote_string(const char *s);
|
||||
* variable or the device URI passed in argv[0], whichever is found
|
||||
* first.
|
||||
*
|
||||
* @since CUPS 1.2/OS X 10.5@
|
||||
* @since CUPS 1.2/macOS 10.5@
|
||||
*/
|
||||
|
||||
const char * /* O - Device URI or @code NULL@ */
|
||||
@@ -85,7 +85,7 @@ cupsBackendDeviceURI(char **argv) /* I - Command-line arguments */
|
||||
* It handles quoting of special characters in the device-make-and-model,
|
||||
* device-info, device-id, and device-location strings.
|
||||
*
|
||||
* @since CUPS 1.4/OS X 10.6@
|
||||
* @since CUPS 1.4/macOS 10.6@
|
||||
*/
|
||||
|
||||
void
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* which should have been included with this file. If this file is
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* missing or damaged, see the license at "http://www.cups.org/".
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*/
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário