Comparar commits
577 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 4d03c4ca90 | |||
| 715dfb366b | |||
| 0d89470f82 | |||
| ef4d439c3b | |||
| b761dd43be | |||
| 7c11d5aea4 | |||
| c674bfbe2b | |||
| 1b032cbf87 | |||
| bed16f192b | |||
| 3894a88544 | |||
| 6ac324a2e1 | |||
| aa5e4fd677 | |||
| c701f9b123 | |||
| b1f826250f | |||
| 3e391a8e76 | |||
| cb480624d3 | |||
| 9914f0fe30 | |||
| c8a5a28c0a | |||
| bf7c741159 | |||
| d29b58fc33 | |||
| aa15a57207 | |||
| e923f65f23 | |||
| d1d3862ca2 | |||
| 20c9da8184 | |||
| 9018ff94f1 | |||
| c8d7d4bf55 | |||
| bd51657148 | |||
| e1074f486d | |||
| 657748179f | |||
| 3f3b535383 | |||
| d0f469a7cd | |||
| f4f9631897 | |||
| 3408121d8c | |||
| bb73b8e008 | |||
| 0e17f4c941 | |||
| c2bcbdc519 | |||
| 98b1b6bafa | |||
| b3f0b5a94f | |||
| 16dbc94b92 | |||
| 0c178dec48 | |||
| 5da48e4614 | |||
| 69b84368d3 | |||
| 661d608a65 | |||
| 0450ddd4f0 | |||
| 07b9937a7d | |||
| 14bd3d8990 | |||
| c05a795e78 | |||
| 315afe86da | |||
| 066dd700da | |||
| 8dabd1442f | |||
| 6fcbda51bf | |||
| 45b2ced5aa | |||
| f49af670aa | |||
| b2ad86e038 | |||
| 5f145615d2 | |||
| 6dac1130b5 | |||
| d6395c6f1d | |||
| 87030afb3a | |||
| ea75e93d17 | |||
| 3f8c4f3409 | |||
| fad6d66937 | |||
| 10ce4df141 | |||
| feb13eeaf6 | |||
| f1ac9f5889 | |||
| a76950482b | |||
| 7586933c85 | |||
| c0447c4d98 | |||
| 9d8b53bb0c | |||
| 42f55cadf6 | |||
| dc84a5a4cd | |||
| e513da0cd8 | |||
| f20ce462b9 | |||
| 9a5efde597 | |||
| 58b64171af | |||
| 75c93cc2b5 | |||
| 2d6dcec181 | |||
| b13a9a9633 | |||
| 7331c1b633 | |||
| de4912b2c9 | |||
| ab8fab6154 | |||
| d86153a94f | |||
| 400e67c15f | |||
| 507c4adcc8 | |||
| 60d8f88456 | |||
| 51ddec4029 | |||
| 11da92e6b1 | |||
| 820cb58e40 | |||
| d22e887a13 | |||
| 9a51a8159f | |||
| ef6de4e15d | |||
| a9f5214b4c | |||
| 0c5991dba7 | |||
| 9c5f08f184 | |||
| 00be463e2c | |||
| 4d2df92677 | |||
| b32051c91b | |||
| b3835dde2f | |||
| 59cd12c6d2 | |||
| 4c00fa533f | |||
| 677e4ca625 | |||
| 4d0f1959a3 | |||
| 5483fd294a | |||
| cebb2dcc23 | |||
| 87854afe61 | |||
| a3390b63a6 | |||
| e19d0f3891 | |||
| bc69e04b2c | |||
| dd43b7f78d | |||
| dd2b61669e | |||
| cc108616c0 | |||
| 6640ceec8c | |||
| 9141aa0150 | |||
| 154f5392bf | |||
| 3e5092db04 | |||
| efb349bcb8 | |||
| 6641bd0d3f | |||
| 098d20d4b9 | |||
| 6d56631f9b | |||
| 89c7bc6f48 | |||
| a5ed2e3944 | |||
| 9e24f768b9 | |||
| cdb2e72460 | |||
| aa2a90cee6 | |||
| 1562b9a19d | |||
| 3c2cb8228e | |||
| f89270998d | |||
| 92dad94559 | |||
| 8a4ed632e8 | |||
| 8b4ae65338 | |||
| d46dbe1ba7 | |||
| 21609267ec | |||
| 49b3fb6354 | |||
| d2df4e48b9 | |||
| f88b8468c5 | |||
| 2c091429d1 | |||
| d88008a0e6 | |||
| ca2990c7fe | |||
| 2a06fe63e6 | |||
| 7d950e9251 | |||
| d3454c3ef6 | |||
| f05517caab | |||
| 2db15a26b8 | |||
| 9bdea94b14 | |||
| b6787b6954 | |||
| bb52530560 | |||
| 47b3bd03e4 | |||
| 45cae1bc04 | |||
| 76bb0a3b90 | |||
| 1df7a46155 | |||
| 25f2b3ee1a | |||
| 7f472a4384 | |||
| baf55a940a | |||
| 5a9647c7ac | |||
| 5ca3a7ff46 | |||
| cc6495f7a8 | |||
| 73721e3edb | |||
| aa7edf3c17 | |||
| 1ce6909d23 | |||
| 6e63114c45 | |||
| fa26ab9573 | |||
| ec7e5bddc7 | |||
| fa2851d5b5 | |||
| 0d94b8bf90 | |||
| e625fa1320 | |||
| d9f301dd14 | |||
| 2cb772b87f | |||
| bd880c0c4d | |||
| e060cfd23f | |||
| 6648f8c125 | |||
| 340e5f8ffd | |||
| 7cf665850c | |||
| 95470a9221 | |||
| fe0d6115dd | |||
| 7281649214 | |||
| 7cc71486c9 | |||
| 0913610bcd | |||
| e65cd5336c | |||
| afe1f8fbec | |||
| ed7961ff57 | |||
| aae22a2168 | |||
| ba2aac9d2e | |||
| 4eb4a2f3be | |||
| 6bf37cc8c0 | |||
| 083672b18c | |||
| ffbf1e61ff | |||
| e13e173f26 | |||
| a7c0c36cf5 | |||
| bcaeb97caa | |||
| 09cc278869 | |||
| c780bc5573 | |||
| 7ef11adeca | |||
| 888f758194 | |||
| 48cc38928a | |||
| 971a6b5d79 | |||
| 588a6c8af7 | |||
| 6f08381068 | |||
| 5107832098 | |||
| c68935d876 | |||
| 414e798b71 | |||
| 86c184ff34 | |||
| e5dfea4c04 | |||
| 5a00cf374d | |||
| bf4873cbf3 | |||
| f120cf3a5d | |||
| 4b5a6914fb | |||
| 644dca1806 | |||
| e4b275a3eb | |||
| cc44874447 | |||
| 0057f146f6 | |||
| aa09736e02 | |||
| 622207eff5 | |||
| d728c2935e | |||
| 588c22056a | |||
| 0210d14387 | |||
| 690b923151 | |||
| ef3aba66ff | |||
| d7cd12f009 | |||
| bfc73dc326 | |||
| c715f67b55 | |||
| 127c90dae1 | |||
| 96fee30386 | |||
| f294fe22fd | |||
| 1de4cd2b2e | |||
| c51c178726 | |||
| 7ca2817eee | |||
| 5ab3e072f7 | |||
| 9f409435a4 | |||
| b1e7afd596 | |||
| 3642bcbddf | |||
| 59e57148ee | |||
| a30818495d | |||
| 311bd0d91e | |||
| 9dd1bc98cd | |||
| 70bdce1628 | |||
| 8a763079f5 | |||
| 065632e209 | |||
| c13e2f44eb | |||
| b9ff93ce91 | |||
| 46637f30d7 | |||
| f1def5b85f | |||
| dc5c941a67 | |||
| 51c22b864a | |||
| 33abc3d644 | |||
| 4eeef849d6 | |||
| c4b22214d2 | |||
| 860f3d3b13 | |||
| abc300696c | |||
| 8e52928cfd | |||
| df4101bff6 | |||
| 7d730d0ce7 | |||
| c29d06f9f9 | |||
| 9fb5f30d78 | |||
| ef4e12b3f9 | |||
| c028bdf75e | |||
| 3dee5db7b9 | |||
| 8c7143551a | |||
| f337a1b74e | |||
| ba4fe5d958 | |||
| e14894bd8d | |||
| e5daa5b780 | |||
| 31b3c060f8 | |||
| f518bf7ea1 | |||
| 3043e3a533 | |||
| ffcecff2d7 | |||
| 2d9eecc44e | |||
| a8a73fd881 | |||
| cee8cdadee | |||
| c0c13a68b1 | |||
| ef2f369c0c | |||
| dbcea8da9d | |||
| ee347e17be | |||
| b167c7fcf8 | |||
| f07dbc95aa | |||
| 4ab680ad06 | |||
| 3bd3849715 | |||
| 8d32a3f933 | |||
| 9eacf61969 | |||
| 72a2134826 | |||
| 08eac601d0 | |||
| 08761c26aa | |||
| c4edc066e9 | |||
| 6276d173b6 | |||
| bafe8fce84 | |||
| 58b64dbba8 | |||
| 171c38f224 | |||
| 144351068c | |||
| 899483675b | |||
| 82428176f5 | |||
| 72ca662e7e | |||
| 171b7064c6 | |||
| e4b72d7ee1 | |||
| 78312b3c7a | |||
| fb863569eb | |||
| 941a5490cf | |||
| f4b526e71e | |||
| 0b353e63ec | |||
| 2064e071b0 | |||
| 9fd217fc95 | |||
| 739bae4ea3 | |||
| 5f07499d2b | |||
| 9a9dab7224 | |||
| ace3ea0a52 | |||
| 4bc478876d | |||
| 9a38ff69a6 | |||
| 5a855d856a | |||
| 104c528358 | |||
| 86206ccf13 | |||
| d3a97696d7 | |||
| d00c3f2678 | |||
| c8c5ec3b57 | |||
| 1a6abb3661 | |||
| f81f6d3d57 | |||
| dcd7f90ecb | |||
| c857c27e47 | |||
| dd204f7a50 | |||
| 11ea1663d5 | |||
| e35868753c | |||
| 24a06ed381 | |||
| 19dc16f764 | |||
| 772416f73a | |||
| d65e20fe7c | |||
| b37177a7a9 | |||
| b3903a94c6 | |||
| 1582479ceb | |||
| bf86060f9e | |||
| 7219e504e7 | |||
| 2c3b8f53ad | |||
| 42bb90c481 | |||
| cdeee633ce | |||
| e70450f17d | |||
| 137fa9a836 | |||
| 00dbe99f3f | |||
| 67c0a18b85 | |||
| 5737d5eba4 | |||
| 16f67389a8 | |||
| 80f5715924 | |||
| 7e3643bff1 | |||
| 296185eb1a | |||
| c0a48c3773 | |||
| 29bda83e12 | |||
| a7d80a247f | |||
| 69c0af2ec8 | |||
| ebcccc6a56 | |||
| 387ff05cd4 | |||
| 3aeb120e10 | |||
| 59a8560a52 | |||
| bac967ae56 | |||
| 604783214d | |||
| d128cfc601 | |||
| 3416fe952b | |||
| 5c463d3fe0 | |||
| a2c43163c2 | |||
| d5d6477801 | |||
| 26dbc8a6b6 | |||
| c96cc7c0e2 | |||
| fd7190c1c2 | |||
| 7d4510a090 | |||
| 06e79a5e74 | |||
| c604931d24 | |||
| 140af001d6 | |||
| 4848b9c789 | |||
| 672c812747 | |||
| bbe495b0ea | |||
| 67bd1f47a5 | |||
| 6f1c647d73 | |||
| a32af27c4c | |||
| be3b49a3f9 | |||
| 2ea1bc06b7 | |||
| c44a2ab142 | |||
| e8fb750728 | |||
| 04e7ecda24 | |||
| eadeefa22d | |||
| 9d714317d0 | |||
| a552da601d | |||
| 77094a212d | |||
| 29899df225 | |||
| bf265b3aa9 | |||
| 945c83b90e | |||
| 9dcb503fa1 | |||
| 1738460d8b | |||
| 997b67343f | |||
| 9fc5c8d42e | |||
| 443f6d0c80 | |||
| 7e041a5e55 | |||
| bd121abd35 | |||
| de72bb61c1 | |||
| 553f29c967 | |||
| 91505c0a32 | |||
| b5443ab9f2 | |||
| 9f4c8267f9 | |||
| ef97be3b01 | |||
| c3a9caacd9 | |||
| 6b2fb4354a | |||
| dc0b986f3e | |||
| 8c0b3c7b4b | |||
| d6abdf44cd | |||
| 1d677f11f1 | |||
| a46d5dfe1d | |||
| 9befde0941 | |||
| d596e3307e | |||
| addb17b18d | |||
| 39897200c1 | |||
| 22a3eea9f6 | |||
| 87cebdd235 | |||
| 464f939ece | |||
| af66a2f815 | |||
| b27f41088b | |||
| 09ca2aa580 | |||
| 0541a2c9f4 | |||
| 53f8404482 | |||
| 050d265700 | |||
| d47f6aec43 | |||
| be7581b6e3 | |||
| 8eed438719 | |||
| 4baf1b58e0 | |||
| ce480a999e | |||
| fdaf028e8b | |||
| 5c2c2ab6a3 | |||
| 06a5a4d332 | |||
| 4cadd6202f | |||
| 2de7c5f81c | |||
| 8127ebd190 | |||
| e5fee178d9 | |||
| 077bd665bd | |||
| dfe5f3b95c | |||
| 616f3f56dd | |||
| f594a3db6d | |||
| d3ab37abea | |||
| 619d6d95eb | |||
| b95156db4c | |||
| ff82ce17bf | |||
| af62b316e7 | |||
| 073b3929a1 | |||
| 17cc92f131 | |||
| bd4b5b3ee1 | |||
| c77dede2ed | |||
| 4e02be68c1 | |||
| 0873f681e4 | |||
| c1de912d13 | |||
| fbcc927ded | |||
| 4feb1fe2e5 | |||
| c944b62ba8 | |||
| 44cb0dd233 | |||
| 3581e03de5 | |||
| 56f0cbeb27 | |||
| 656c109a1c | |||
| 159e027902 | |||
| 7271db11d2 | |||
| d07cb8d5dc | |||
| 15fe2ddc7f | |||
| df59b110ad | |||
| b056061b24 | |||
| 86d93a7539 | |||
| 4b4895dfe7 | |||
| b25f3cf080 | |||
| 63f8dcbd47 | |||
| 6a76f435d8 | |||
| d0bfbc98b6 | |||
| 561e0647a8 | |||
| 0fb02fb9ce | |||
| 187b9322c8 | |||
| 5192eac3e6 | |||
| 34646e298e | |||
| 3f72eb0187 | |||
| ada35e599c | |||
| 003c1790e9 | |||
| 73c6236f2c | |||
| 8aecb2299e | |||
| 658c64bf2e | |||
| 84047a015c | |||
| 739ad3f3ea | |||
| afd96090b5 | |||
| a0fccd8044 | |||
| 95f319b9dd | |||
| 13ceaad273 | |||
| 32987439c3 | |||
| e6062e8e9c | |||
| 0dfe699052 | |||
| 367068f32a | |||
| 0c7f533afd | |||
| 0fea18126c | |||
| ca75cc1354 | |||
| c6dbbca1f5 | |||
| ea95f7fe1a | |||
| b0bb6caa3a | |||
| cff3f79fb2 | |||
| f1b7e5634d | |||
| 516dacf7d3 | |||
| a9e8acf53d | |||
| 18dfe3cbe7 | |||
| 30df0a0309 | |||
| 818bbe7af2 | |||
| 9b440f8a5c | |||
| 3cd7b5e053 | |||
| 449f30b03d | |||
| c2532688fb | |||
| 08e8f007f4 | |||
| ead626d781 | |||
| 60bb47475a | |||
| ddf2ec7348 | |||
| 706a0485c5 | |||
| c65e1c4ffd | |||
| bb54b17e78 | |||
| c64170e5f6 | |||
| 0bb02bfa09 | |||
| 66d471becb | |||
| fe1a430545 | |||
| 53f8d64f84 | |||
| eb61cb5bf0 | |||
| a7aabde8fe | |||
| 699fe02075 | |||
| 19186c8bae | |||
| 7d26bf7d6c | |||
| d6ddd199f4 | |||
| a468069a20 | |||
| ab89234de2 | |||
| afad2da22d | |||
| 191be31cf1 | |||
| f28728ee32 | |||
| c5b7774cb8 | |||
| e22f464e37 | |||
| e28345e78d | |||
| f17549fbb4 | |||
| 06e1afc39b | |||
| a166e9337a | |||
| 7f4d7b8a51 | |||
| 564cd57de8 | |||
| 7c8fb0fc01 | |||
| 22974c5f32 | |||
| 092db1e29e | |||
| f6e7a0c53a | |||
| 728fd81076 | |||
| 27551f043a | |||
| b969d5af2b | |||
| 2da2477dac | |||
| dd6a3fd2ba | |||
| aed3d896a7 | |||
| a492d345e8 | |||
| 8e2e09c1e2 | |||
| b87ec78957 | |||
| 081027767a | |||
| fd96ad89ff | |||
| efb40dcacf | |||
| ab8a07ec22 | |||
| 6f7bfae71c | |||
| 123979a9db | |||
| 342395f9d1 | |||
| 314e45c21a | |||
| c283f46deb | |||
| 7b98191acd | |||
| f61dfc0df4 | |||
| 1055deceda | |||
| 117bf0d144 | |||
| 4ef3ee3749 | |||
| 7c91db71b3 | |||
| a8b28f1844 | |||
| 43bcc47b51 | |||
| 3145b7e6a8 | |||
| 6a3d63e638 | |||
| 6bfe0be46a | |||
| 378eeedf0f | |||
| a20d0ea003 | |||
| c4faa907bc | |||
| 625bb9ded6 | |||
| f89686dd3f | |||
| ead6e4884a | |||
| e16130570f | |||
| 141c8f96be | |||
| eb1573431f | |||
| 2fc81be235 | |||
| 7917399e29 | |||
| 60da78baeb | |||
| 4a9942a2f0 | |||
| 33baffa2a9 | |||
| 9bebe8c90d | |||
| 82341b0b45 | |||
| 77401306b8 |
+1
-1
@@ -1,3 +1,3 @@
|
||||
.git* export-ignore
|
||||
.mailmap export-ignore
|
||||
tools export-ignore
|
||||
scripts export-ignore
|
||||
|
||||
+26
-22
@@ -1,13 +1,7 @@
|
||||
*.a
|
||||
*.bck
|
||||
*.cgi
|
||||
*.dylib
|
||||
*.gz
|
||||
*.o
|
||||
*.so
|
||||
*.so.*
|
||||
*.tokens
|
||||
.buildrev
|
||||
autom4te.cache
|
||||
config.h
|
||||
config.log
|
||||
@@ -16,7 +10,9 @@ cups-config
|
||||
Makedefs
|
||||
backend/dnssd
|
||||
backend/http
|
||||
backend/https
|
||||
backend/ipp
|
||||
backend/ipps
|
||||
backend/lpd
|
||||
backend/mdns
|
||||
backend/snmp
|
||||
@@ -29,7 +25,6 @@ berkeley/lpc
|
||||
berkeley/lpq
|
||||
berkeley/lpr
|
||||
berkeley/lprm
|
||||
cgi-bin/makedocset
|
||||
cgi-bin/testcgi
|
||||
cgi-bin/testhi
|
||||
cgi-bin/testhi.index
|
||||
@@ -39,11 +34,22 @@ conf/cupsd.conf
|
||||
conf/mime.convs
|
||||
conf/pam.std
|
||||
conf/snmp.conf
|
||||
cups/libcups.dylib
|
||||
cups/libcups.2.dylib
|
||||
cups/libcups.so
|
||||
cups/libcups.so.2
|
||||
cups/libcupsimage.dylib
|
||||
cups/libcupsimage.2.dylib
|
||||
cups/libcupsimage.so
|
||||
cups/libcupsimage.so.2
|
||||
cups/locale/
|
||||
cups/rasterbench
|
||||
cups/test.pwg
|
||||
cups/test.raster
|
||||
cups/testadmin
|
||||
cups/testarray
|
||||
cups/testcache
|
||||
cups/testclient
|
||||
cups/testconflicts
|
||||
cups/testcreds
|
||||
cups/testcups
|
||||
@@ -57,6 +63,7 @@ cups/testlang
|
||||
cups/testoptions
|
||||
cups/testppd
|
||||
cups/testpwg
|
||||
cups/testraster
|
||||
cups/testsnmp
|
||||
cups/tlscheck
|
||||
desktop/cups.desktop
|
||||
@@ -65,14 +72,10 @@ doc/*/index.html
|
||||
filter/commandtops
|
||||
filter/gziptoany
|
||||
filter/pstops
|
||||
filter/rasterbench
|
||||
filter/rastertoepson
|
||||
filter/rastertohp
|
||||
filter/rastertolabel
|
||||
filter/rastertopwg
|
||||
filter/test.raster
|
||||
filter/testclient
|
||||
filter/testraster
|
||||
locale/checkpo
|
||||
locale/po2strings
|
||||
locale/strings2po
|
||||
@@ -92,8 +95,6 @@ notifier/mailto
|
||||
notifier/rss
|
||||
notifier/testnotify
|
||||
packaging/cups.list
|
||||
org.cups.docset*
|
||||
patches
|
||||
ppdc/genstrings
|
||||
ppdc/ppd/
|
||||
ppdc/ppd2/
|
||||
@@ -126,7 +127,6 @@ scheduler/testlpd
|
||||
scheduler/testmime
|
||||
scheduler/testspeed
|
||||
scheduler/testsub
|
||||
systemv/accept
|
||||
systemv/cancel
|
||||
systemv/cupsaccept
|
||||
systemv/cupsaddsmb
|
||||
@@ -142,18 +142,22 @@ systemv/lpinfo
|
||||
systemv/lpmove
|
||||
systemv/lpoptions
|
||||
systemv/lpstat
|
||||
systemv/reject
|
||||
templates/header.tmpl
|
||||
templates/*/header.tmpl
|
||||
test/cups-str-*.html
|
||||
test/*_log-*
|
||||
test/ippfind
|
||||
test/ippfind-static
|
||||
test/ippserver
|
||||
test/ippserver-shared
|
||||
test/ipptool
|
||||
test/ipptool-static
|
||||
test/pwg-raster-samples-*
|
||||
tools/ippevepcl
|
||||
tools/ippeveprinter
|
||||
tools/ippeveprinter-static
|
||||
tools/ippeveps
|
||||
tools/ippfind
|
||||
tools/ippfind-static
|
||||
tools/ipptool
|
||||
tools/ipptool-static
|
||||
vcnet/.vs
|
||||
vcnet/packages
|
||||
vcnet/Win32
|
||||
vcnet/x64
|
||||
xcode/CUPS.xcodeproj/project.xcworkspace/
|
||||
xcode/CUPS.xcodeproj/xcuserdata/
|
||||
|
||||
|
||||
+250
-2
@@ -1,5 +1,253 @@
|
||||
CHANGES - 2.3b1 - 2017-12-19
|
||||
============================
|
||||
CHANGES - 2.3rc1 - 2019-05-21
|
||||
=============================
|
||||
|
||||
|
||||
Changes in CUPS v2.3rc1
|
||||
-----------------------
|
||||
|
||||
- The `cups-config` script no longer adds extra libraries when linking against
|
||||
shared libraries (Issue #5261)
|
||||
- The supplied example print documents have been optimized for size
|
||||
(Issue #5529)
|
||||
- The `cupsctl` command now prevents setting "cups-files.conf" directives
|
||||
(Issue #5530)
|
||||
- The "forbidden" message in the web interface is now explained (Issue #5547)
|
||||
- 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)
|
||||
- The `ippeveprinter` command now looks for print commands in the "command"
|
||||
subdirectory.
|
||||
- The `ipptool` command now supports `$date-current` and `$date-start` variables
|
||||
to insert the current and starting date and time values, as well as ISO-8601
|
||||
relative time values such as "PT30S" for 30 seconds in the future.
|
||||
|
||||
|
||||
Changes in CUPS v2.3b8
|
||||
----------------------
|
||||
|
||||
- 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)
|
||||
- Fixed a memory reallocation bug in HTTP header value expansion
|
||||
(rdar://problem/50000749)
|
||||
- Timed out job submission now yields an error (Issue #5570)
|
||||
- Restored minimal support for the `Emulators` keyword in PPD files to allow
|
||||
old Samsung printer drivers to continue to work (Issue #5562)
|
||||
- The scheduler did not encode octetString values like "job-password" correctly
|
||||
for the print filters (Issue #5558)
|
||||
- The `cupsCheckDestSupported` function did not check octetString values
|
||||
correctly (Issue #5557)
|
||||
- Added support for `UserAgentTokens` directive in "client.conf" (Issue #5555)
|
||||
- Updated the systemd service file for cupsd (Issue #5551)
|
||||
- The `ippValidateAttribute` function did not catch all instances of invalid
|
||||
UTF-8 strings (Issue #5509)
|
||||
- Fixed an issue with the self-signed certificates generated by GNU TLS
|
||||
(Issue #5506)
|
||||
- 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)
|
||||
- The web interface no longer provides access to the log files (Issue #5513)
|
||||
- Non-Kerberized printing to Windows via IPP was broken (Issue #5515)
|
||||
- Eliminated use of private headers and some deprecated macOS APIs (Issue #5516)
|
||||
- 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)
|
||||
- The scheduler no longer advertises the HTTP methods it supports (Issue #5540)
|
||||
- Localization updates (Issue #5461, Issues #5471, Issue #5481, Issue #5486,
|
||||
Issue #5489, Issue #5491, Issue #5492, Issue #5493, Issue #5494, Issue #5495,
|
||||
Issue #5497, Issue #5499, Issue #5500, Issue #5501, Issue #5504)
|
||||
- The scheduler did not always idle exit as quickly as it could.
|
||||
- Added a new `ippeveprinter` command based on the old ippserver sample code.
|
||||
|
||||
|
||||
Changes in CUPS v2.3b7
|
||||
----------------------
|
||||
|
||||
- Fixed some build failures (Issue #5451, Issue #5463)
|
||||
- Running ppdmerge with the same input and output filenames did not work as
|
||||
advertised (Issue #5455)
|
||||
|
||||
|
||||
Changes in CUPS v2.3b6
|
||||
----------------------
|
||||
|
||||
- Localization update (Issue #5339, Issue #5348, Issue #5362, Issue #5408,
|
||||
Issue #5410)
|
||||
- Documentation updates (Issue #5369, Issue #5402, Issue #5403, Issue #5404)
|
||||
- CVE-2018-4300: Linux session cookies used a predictable random number seed.
|
||||
- All user commands now support the `--help` option (Issue #5326)
|
||||
- The `lpoptions` command now works with IPP Everywhere printers that have not
|
||||
yet been added as local queues (Issue #5045)
|
||||
- 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)
|
||||
- The scheduler did not idle-exit on some Linux distributions (Issue #5319)
|
||||
- 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 scheduler did not report all of the supported job options and values
|
||||
(Issue #5340)
|
||||
- The IPP Everywhere "driver" now properly supports face-up printers
|
||||
(Issue #5345)
|
||||
- Fixed some typos in the label printer drivers (Issue #5350)
|
||||
- Setting the `Community` name to the empty string in `snmp.conf` now disables
|
||||
SNMP supply level monitoring by all the standard network backends
|
||||
(Issue #5354)
|
||||
- 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 USB quirk rules (Issue #5395, Issue #5420, 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)
|
||||
- Fixed a bug adding a queue with the `-E` option (Issue #5440)
|
||||
- The `cupsaddsmb` program has been removed (Issue #5449)
|
||||
- The `cupstestdsc` program has been removed (Issue #5450)
|
||||
- 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)
|
||||
- Fixed a crash bug when mapping PPD duplex options to IPP attributes
|
||||
(rdar://46183976)
|
||||
- Fixed a memory leak for some IPP (extension) syntaxes.
|
||||
- The `cupscgi`, `cupsmime`, and `cupsppdc` support libraries are no longer
|
||||
installed as shared libraries.
|
||||
- The `snmp` backend is now deprecated.
|
||||
|
||||
|
||||
Changes in CUPS v2.3b5
|
||||
----------------------
|
||||
|
||||
- The `ipptool` program no longer checks for duplicate attributes when running
|
||||
in list or CSV mode (Issue #5278)
|
||||
- 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.3b4
|
||||
----------------------
|
||||
|
||||
- NOTICE: Printer drivers are now deprecated (Issue #5270)
|
||||
- Kerberized printing to another CUPS server did not work correctly
|
||||
(Issue #5233)
|
||||
- Fixed printing to some IPP Everywhere printers (Issue #5238)
|
||||
- Fixed installation of filters (Issue #5247)
|
||||
- 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)
|
||||
- Star Micronics printers need the "unidir" USB quirk rule (Issue #5251)
|
||||
- Documentation fixes (Issue #5252)
|
||||
- Fixed a compile issue when PAM is not available (Issue #5253)
|
||||
- Label printers supported by the rastertolabel driver don't support SNMP, so
|
||||
don't delay printing to test it (Issue #5256)
|
||||
- The scheduler could crash while adding an IPP Everywhere printer (Issue #5258)
|
||||
- The Lexmark Optra E310 printer needs the "no-reattach" USB quirk rule
|
||||
(Issue #5259)
|
||||
- Systemd did not restart cupsd when configuration changes were made that
|
||||
required a restart (Issue #5263)
|
||||
- The IPP Everywhere PPD generator did not include the `cupsJobPassword`
|
||||
keyword, when supported (Issue #5265)
|
||||
- Fixed an Avahi crash bug in the scheduler (Issue #5268)
|
||||
- Raw print queues are now deprecated (Issue #5269)
|
||||
- Fixed an RPM packaging problem (Issue #5276)
|
||||
- The IPP backend did not properly detect failed PDF prints (rdar://34055474)
|
||||
- TLS connections now properly timeout (rdar://34938533)
|
||||
- Temp files could not be created in some sandboxed applications
|
||||
(rdar://37789645)
|
||||
- The ipptool `--ippserver` option did not encode out-of-band attributes
|
||||
correctly.
|
||||
- Added public `cupsEncodeOption` API for encoding a single option as an IPP
|
||||
attribute.
|
||||
- Removed support for the `-D_PPD_DEPRECATED=""` developer cheat - the PPD API
|
||||
should no longer be used.
|
||||
- Removed support for `-D_IPP_PRIVATE_STRUCTURES=1` developer cheat - the IPP
|
||||
accessor functions should be used instead.
|
||||
|
||||
|
||||
Changes in CUPS v2.3b3
|
||||
----------------------
|
||||
|
||||
- More fixes for printing to old CUPS servers (Issue #5211)
|
||||
- The IPP Everywhere PPD generator did not support deep grayscale or 8-bit per
|
||||
component AdobeRGB (Issue #5227)
|
||||
- Additional changes for the scheduler to substitute default values for invalid
|
||||
job attributes when running in "relaxed conformance" mode (Issue #5229)
|
||||
- Localization changes (Issue #5232, rdar://37068158)
|
||||
- The `cupsCopyDestInfo` function did not work with all print queues
|
||||
(Issue #5235)
|
||||
|
||||
|
||||
Changes in CUPS v2.3b2
|
||||
----------------------
|
||||
|
||||
- Localization changes (Issue #5210)
|
||||
- Build fixes (Issue #5217)
|
||||
- IPP Everywhere PPDs were not localized to English (Issue #5205)
|
||||
- The `cupsGetDests` and `cupsEnumDests` functions no longer filter out local
|
||||
print services like IPP USB devices (Issue #5206)
|
||||
- The `cupsCopyDest` function now correctly copies the `is_default` value
|
||||
(Issue #5208)
|
||||
- Printing to old CUPS servers has been fixed (Issue #5211)
|
||||
- The `ppdInstallableConflict` tested too many constraints (Issue #5213)
|
||||
- All HTTP field values can now be longer than `HTTP_MAX_VALUE` bytes
|
||||
(Issue #5216)
|
||||
- Added a USB quirk rule for Canon MP280 series printers (Issue #5221)
|
||||
- The `cupsRasterWritePixels` function did not correctly swap bytes for some
|
||||
formats (Issue #5225)
|
||||
- Fixed an issue with mapping finishing options (rdar://34250727)
|
||||
- The `ppdLocalizeIPPReason` function incorrectly returned a localized version
|
||||
of "none" (rdar://36566269)
|
||||
- The scheduler did not add ".local" to the default DNS-SD host name when
|
||||
needed.
|
||||
|
||||
|
||||
Changes in CUPS v2.3b1
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
INSTALL - CUPS v2.3b1 - 2017-12-19
|
||||
==================================
|
||||
INSTALL - CUPS v2.3rc1 - 2019-05-21
|
||||
===================================
|
||||
|
||||
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
|
||||
|
||||
+40
-40
@@ -1,10 +1,11 @@
|
||||
#
|
||||
# Common makefile definitions for CUPS.
|
||||
#
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Copyright © 2007-2019 by Apple Inc.
|
||||
# Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
#
|
||||
@@ -91,14 +92,13 @@ LOCALTARGET = @LOCALTARGET@
|
||||
#
|
||||
|
||||
LIBCUPS = @LIBCUPS@
|
||||
LIBCUPSCGI = @LIBCUPSCGI@
|
||||
LIBCUPSIMAGE = @LIBCUPSIMAGE@
|
||||
LIBCUPSMIME = @LIBCUPSMIME@
|
||||
LIBCUPSPPDC = @LIBCUPSPPDC@
|
||||
LIBCUPSOBJS = @LIBCUPSOBJS@
|
||||
LIBCUPSSTATIC = @LIBCUPSSTATIC@
|
||||
LIBGSSAPI = @LIBGSSAPI@
|
||||
LIBHEADERS = @LIBHEADERS@
|
||||
LIBHEADERSPRIV = @LIBHEADERSPRIV@
|
||||
LIBMALLOC = @LIBMALLOC@
|
||||
LIBMXML = @LIBMXML@
|
||||
LIBPAPER = @LIBPAPER@
|
||||
LIBUSB = @LIBUSB@
|
||||
LIBWRAP = @LIBWRAP@
|
||||
@@ -116,12 +116,27 @@ INSTALLSTATIC = @INSTALLSTATIC@
|
||||
|
||||
IPPALIASES = @IPPALIASES@
|
||||
|
||||
|
||||
#
|
||||
# ippeveprinter commands...
|
||||
#
|
||||
|
||||
IPPEVECOMMANDS = @IPPEVECOMMANDS@
|
||||
|
||||
|
||||
#
|
||||
# Install XPC backends?
|
||||
#
|
||||
|
||||
INSTALLXPC = @INSTALLXPC@
|
||||
|
||||
#
|
||||
# Code signing...
|
||||
#
|
||||
|
||||
CODE_SIGN = @CODE_SIGN@
|
||||
CODE_SIGN_IDENTITY = -
|
||||
|
||||
#
|
||||
# Program options...
|
||||
#
|
||||
@@ -132,10 +147,15 @@ INSTALLXPC = @INSTALLXPC@
|
||||
# for extra debug info)
|
||||
#
|
||||
|
||||
ALL_CFLAGS = -I.. -D_CUPS_SOURCE $(CFLAGS) $(SSLFLAGS) \
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(ONDEMANDFLAGS) $(OPTIONS)
|
||||
ALL_CXXFLAGS = -I.. -D_CUPS_SOURCE $(CXXFLAGS) $(SSLFLAGS) \
|
||||
@LARGEFILE@ @PTHREAD_FLAGS@ $(ONDEMANDFLAGS) $(OPTIONS)
|
||||
ALL_CFLAGS = -I.. -D_CUPS_SOURCE $(CFLAGS) \
|
||||
$(SSLFLAGS) @LARGEFILE@ @PTHREAD_FLAGS@ \
|
||||
$(ONDEMANDFLAGS) $(OPTIONS)
|
||||
ALL_CXXFLAGS = -I.. -D_CUPS_SOURCE $(CXXFLAGS) \
|
||||
$(SSLFLAGS) @LARGEFILE@ @PTHREAD_FLAGS@ \
|
||||
$(ONDEMANDFLAGS) $(OPTIONS)
|
||||
ALL_DSOFLAGS = -L../cups @ARCHFLAGS@ @RELROFLAGS@ $(DSOFLAGS) $(OPTIM)
|
||||
ALL_LDFLAGS = -L../cups @LDARCHFLAGS@ @RELROFLAGS@ $(LDFLAGS) \
|
||||
@PIEFLAGS@ $(OPTIM)
|
||||
ARCHFLAGS = @ARCHFLAGS@
|
||||
ARFLAGS = @ARFLAGS@
|
||||
BACKLIBS = @BACKLIBS@
|
||||
@@ -147,21 +167,18 @@ CXXLIBS = @CXXLIBS@
|
||||
DBUS_NOTIFIER = @DBUS_NOTIFIER@
|
||||
DBUS_NOTIFIERLIBS = @DBUS_NOTIFIERLIBS@
|
||||
DNSSD_BACKEND = @DNSSD_BACKEND@
|
||||
DSOFLAGS = -L../cups @DSOFLAGS@
|
||||
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
DSOFLAGS = @DSOFLAGS@
|
||||
DNSSDLIBS = @DNSSDLIBS@
|
||||
IPPFIND_BIN = @IPPFIND_BIN@
|
||||
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) $(SSLLIBS) $(LIBZ)
|
||||
LINKCUPSIMAGE = @LINKCUPSIMAGE@
|
||||
LIBS = $(LINKCUPS) $(COMMONLIBS)
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LINKCUPS = @LINKCUPS@
|
||||
LINKCUPSSTATIC = ../cups/$(LIBCUPSSTATIC) $(LIBS)
|
||||
LIBS = $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ) $(COMMONLIBS)
|
||||
ONDEMANDFLAGS = @ONDEMANDFLAGS@
|
||||
ONDEMANDLIBS = @ONDEMANDLIBS@
|
||||
OPTIM = @OPTIM@
|
||||
OPTIONS =
|
||||
OPTIONS = @WARNING_OPTIONS@
|
||||
PAMLIBS = @PAMLIBS@
|
||||
SERVERLIBS = @SERVERLIBS@
|
||||
SSLFLAGS = @SSLFLAGS@
|
||||
@@ -203,9 +220,8 @@ srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
BUILDROOT = $(DSTROOT)
|
||||
BUILDROOT = $(DSTROOT)$(DESTDIR)
|
||||
|
||||
AMANDIR = $(BUILDROOT)@AMANDIR@
|
||||
BINDIR = $(BUILDROOT)@bindir@
|
||||
BUNDLEDIR = @CUPS_BUNDLEDIR@
|
||||
CACHEDIR = $(BUILDROOT)@CUPS_CACHEDIR@
|
||||
@@ -218,23 +234,17 @@ LOCALEDIR = $(BUILDROOT)@CUPS_LOCALEDIR@
|
||||
LOGDIR = $(BUILDROOT)@CUPS_LOGDIR@
|
||||
MANDIR = $(BUILDROOT)@mandir@
|
||||
MENUDIR = @MENUDIR@
|
||||
PMANDIR = $(BUILDROOT)@PMANDIR@
|
||||
PRIVATEINCLUDE = $(BUILDROOT)@PRIVATEINCLUDE@
|
||||
RCLEVELS = @RCLEVELS@
|
||||
RCSTART = @RCSTART@
|
||||
RCSTOP = @RCSTOP@
|
||||
REQUESTS = $(BUILDROOT)@CUPS_REQUESTS@
|
||||
RESOURCEDIR = @CUPS_RESOURCEDIR@
|
||||
SBINDIR = $(BUILDROOT)@sbindir@
|
||||
SERVERBIN = $(BUILDROOT)@CUPS_SERVERBIN@
|
||||
SERVERROOT = $(BUILDROOT)@CUPS_SERVERROOT@
|
||||
STATEDIR = $(BUILDROOT)@CUPS_STATEDIR@
|
||||
|
||||
MAN1EXT = @MAN1EXT@
|
||||
MAN5EXT = @MAN5EXT@
|
||||
MAN7EXT = @MAN7EXT@
|
||||
MAN8EXT = @MAN8EXT@
|
||||
MAN8DIR = @MAN8DIR@
|
||||
|
||||
PAMDIR = @PAMDIR@
|
||||
PAMFILE = @PAMFILE@
|
||||
|
||||
@@ -254,7 +264,7 @@ USBQUIRKS = @USBQUIRKS@
|
||||
#
|
||||
|
||||
.SILENT:
|
||||
.SUFFIXES: .1 .1.gz .1m .1m.gz .3 .3.gz .5 .5.gz .7 .7.gz .8 .8.gz .a .c .cxx .h .man .o .gz
|
||||
.SUFFIXES: .a .c .cxx .h .o
|
||||
|
||||
.c.o:
|
||||
echo Compiling $<...
|
||||
@@ -263,13 +273,3 @@ USBQUIRKS = @USBQUIRKS@
|
||||
.cxx.o:
|
||||
echo Compiling $<...
|
||||
$(CXX) $(ARCHFLAGS) $(OPTIM) $(ALL_CXXFLAGS) -c -o $@ $<
|
||||
|
||||
.man.1 .man.1m .man.3 .man.5 .man.7 .man.8:
|
||||
echo Linking $<...
|
||||
$(RM) $@
|
||||
$(LN) $< $@
|
||||
|
||||
.man.1.gz .man.1m.gz .man.3.gz .man.5.gz .man.7.gz .man.8.gz .man.gz:
|
||||
echo -n Compressing $<...
|
||||
$(RM) $@
|
||||
gzip -v9 <$< >$@
|
||||
|
||||
+15
-54
@@ -1,10 +1,11 @@
|
||||
#
|
||||
# Top-level Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
# Copyright © 2007-2019 by Apple Inc.
|
||||
# Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
include Makedefs
|
||||
@@ -14,7 +15,14 @@ include Makedefs
|
||||
# Directories to make...
|
||||
#
|
||||
|
||||
DIRS = cups test $(BUILDDIRS)
|
||||
DIRS = cups $(BUILDDIRS)
|
||||
|
||||
|
||||
#
|
||||
# Test suite options - normally blank, override with make command...
|
||||
#
|
||||
|
||||
TESTOPTIONS =
|
||||
|
||||
|
||||
#
|
||||
@@ -94,16 +102,14 @@ distclean: clean
|
||||
$(RM) Makedefs config.h config.log config.status
|
||||
$(RM) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
|
||||
$(RM) cups-config
|
||||
$(RM) data/testprint
|
||||
$(RM) desktop/cups.desktop
|
||||
$(RM) doc/index.html
|
||||
$(RM) man/client.conf.man man/cups-files.conf.man man/cups-lpd.man man/cups-snmp.man man/cupsaddsmb.man man/cupsd.conf.man man/cupsd.man man/lpoptions.man
|
||||
$(RM) packaging/cups.list
|
||||
$(RM) scheduler/cups-lpd.xinetd scheduler/cups.sh scheduler/cups.xml scheduler/org.cups.cups-lpd.plist scheduler/org.cups.cups-lpdAT.service scheduler/org.cups.cupsd.path scheduler/org.cups.cupsd.service scheduler/org.cups.cupsd.socket
|
||||
$(RM) templates/header.tmpl
|
||||
-$(RM) doc/*/index.html
|
||||
-$(RM) templates/*/header.tmpl
|
||||
-$(RM) -r autom4te*.cache clang cups/charmaps cups/locale
|
||||
-$(RM) -r autom4te*.cache cups/charmaps cups/locale
|
||||
|
||||
|
||||
#
|
||||
@@ -117,25 +123,6 @@ depend:
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# Run the Clang static code analysis tool on the sources, available here:
|
||||
#
|
||||
# http://clang-analyzer.llvm.org
|
||||
#
|
||||
# At least checker-231 is required.
|
||||
#
|
||||
# Alternatively, use "--analyze -Xanalyzer -analyzer-output=text" for OPTIM (text
|
||||
# output instead of HTML...)
|
||||
#
|
||||
|
||||
.PHONY: clang clang-changes
|
||||
clang:
|
||||
$(RM) -r clang
|
||||
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) clean all
|
||||
clang-changes:
|
||||
scan-build -V -k -o `pwd`/clang $(MAKE) $(MFLAGS) all
|
||||
|
||||
|
||||
#
|
||||
# Run the STACK tool on the sources, available here:
|
||||
#
|
||||
@@ -245,7 +232,7 @@ uninstall:
|
||||
|
||||
test: all unittests
|
||||
echo Running CUPS test suite...
|
||||
cd test; ./run-stp-tests.sh
|
||||
cd test; ./run-stp-tests.sh $(TESTOPTIONS)
|
||||
|
||||
|
||||
check: all unittests
|
||||
@@ -258,7 +245,7 @@ debugcheck: all unittests
|
||||
|
||||
|
||||
#
|
||||
# Create HTML documentation using Mini-XML's mxmldoc (http://www.msweet.org/)...
|
||||
# Create HTML documentation using codedoc (http://www.msweet.org/codedoc)...
|
||||
#
|
||||
|
||||
apihelp:
|
||||
@@ -268,32 +255,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...
|
||||
#
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
CUPS
|
||||
|
||||
Copyright © 2007-2017 by Apple Inc.
|
||||
Copyright 1997-2007 by Easy Software Products.
|
||||
Copyright © 2007-2018 by Apple Inc.
|
||||
Copyright © 1997-2007 by Easy Software Products.
|
||||
|
||||
CUPS and the CUPS logo are trademarks of Apple Inc.
|
||||
|
||||
|
||||
+9
-3
@@ -1,5 +1,10 @@
|
||||
README - CUPS v2.3b1 - 2017-12-19
|
||||
=================================
|
||||
README - CUPS v2.3rc1 - 2019-05-21
|
||||
==================================
|
||||
|
||||
> **Note:** CUPS v2.3b8 is not production code. Do not use on production
|
||||
> systems. For a production version of CUPS, please see the CUPS 2.2.x
|
||||
> releases. **Do not use CUPS v2.3b8 on production systems.**
|
||||
|
||||
|
||||
Looking for compile instructions? Read the file `INSTALL.md` instead...
|
||||
|
||||
@@ -148,7 +153,8 @@ This will prevent the filters from misinterpreting your print file.
|
||||
LEGAL STUFF
|
||||
-----------
|
||||
|
||||
Copyright © 2007-2017 by Apple Inc.
|
||||
Copyright © 2007-2019 by Apple Inc.
|
||||
Copyright © 1997-2007 by Easy Software Products.
|
||||
|
||||
CUPS is provided under the terms of the Apache License, Version 2.0. A copy of
|
||||
this license can be found in the file `LICENSE`. Additional legal information
|
||||
|
||||
+52
-52
@@ -1,72 +1,72 @@
|
||||
ipp.o: ipp.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/versioning.h \
|
||||
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h
|
||||
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h ../cups/ppd-private.h ../cups/ppd.h \
|
||||
../cups/raster.h
|
||||
lpd.o: lpd.c ../cups/http-private.h ../config.h ../cups/language.h \
|
||||
../cups/array.h ../cups/versioning.h ../cups/http.h \
|
||||
../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
backend-private.h ../cups/cups-private.h ../cups/string-private.h \
|
||||
../cups/debug-private.h ../cups/array-private.h \
|
||||
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/pwg.h backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../cups/array-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h
|
||||
dnssd.o: dnssd.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/versioning.h \
|
||||
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h
|
||||
snmp.o: snmp.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/versioning.h \
|
||||
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h
|
||||
socket.o: socket.c ../cups/http-private.h ../config.h ../cups/language.h \
|
||||
../cups/array.h ../cups/versioning.h ../cups/http.h \
|
||||
../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \
|
||||
backend-private.h ../cups/cups-private.h ../cups/string-private.h \
|
||||
../cups/debug-private.h ../cups/array-private.h \
|
||||
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/pwg.h backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../cups/array-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
test1284.o: test1284.c ../cups/string-private.h ../config.h ieee1284.c \
|
||||
backend-private.h ../cups/cups-private.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h
|
||||
test1284.o: test1284.c ../cups/string-private.h ../config.h \
|
||||
../cups/versioning.h ieee1284.c backend-private.h \
|
||||
../cups/cups-private.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h
|
||||
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h ../cups/ppd-private.h ../cups/ppd.h \
|
||||
../cups/raster.h
|
||||
testbackend.o: testbackend.c ../cups/string-private.h ../config.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h \
|
||||
../cups/versioning.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/array.h ../cups/language.h ../cups/pwg.h \
|
||||
../cups/sidechannel.h
|
||||
testsupplies.o: testsupplies.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/versioning.h \
|
||||
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h
|
||||
usb.o: usb.c backend-private.h ../cups/cups-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/string-private.h ../config.h ../cups/versioning.h \
|
||||
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/language.h ../cups/pwg.h ../cups/http-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \
|
||||
../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \
|
||||
usb-darwin.c ../cups/file-private.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/raster.h
|
||||
../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h usb-darwin.c ../cups/debug-private.h \
|
||||
../cups/file-private.h ../cups/ppd-private.h ../cups/ppd.h \
|
||||
../cups/raster.h
|
||||
|
||||
+28
-20
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Backend makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 2007-2019 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
@@ -201,8 +201,8 @@ uninstall:
|
||||
|
||||
test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o test1284 test1284.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -211,8 +211,8 @@ test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o testbackend testbackend.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -221,9 +221,9 @@ testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
|
||||
$(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -243,7 +243,8 @@ libbackend.a: $(LIBOBJS)
|
||||
|
||||
dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o dnssd dnssd.o libbackend.a $(DNSSDLIBS) $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
if test `uname` = Darwin; then \
|
||||
$(RM) mdns; \
|
||||
$(LN) dnssd mdns; \
|
||||
@@ -256,9 +257,12 @@ dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
|
||||
$(RM) http
|
||||
$(LN) ipp http
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o ipp ipp.o libbackend.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
$(RM) http https ipps
|
||||
for file in $(IPPALIASES); do \
|
||||
$(LN) ipp $$file; \
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
@@ -267,7 +271,8 @@ ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o lpd lpd.o libbackend.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -276,7 +281,8 @@ lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o snmp snmp.o libbackend.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -285,13 +291,14 @@ snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
|
||||
|
||||
socket: socket.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o socket socket.o libbackend.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o socket-static socket.o libbackend.a \
|
||||
$(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -300,8 +307,9 @@ socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
|
||||
|
||||
usb: usb.o ../cups/$(LIBCUPS) libbackend.a
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
|
||||
$(BACKLIBS) $(LIBS)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
|
||||
$(BACKLIBS) $(COMMONLIBS) $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
/*
|
||||
* Backend support definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2014 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_BACKEND_PRIVATE_H_
|
||||
|
||||
+16
-40
@@ -1,13 +1,10 @@
|
||||
/*
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2008-2017 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
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -85,23 +82,8 @@ static int browsers = 0; /* Number of running browsers */
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DNSSD
|
||||
static void browse_callback(DNSServiceRef sdRef,
|
||||
DNSServiceFlags flags,
|
||||
uint32_t interfaceIndex,
|
||||
DNSServiceErrorType errorCode,
|
||||
const char *serviceName,
|
||||
const char *regtype,
|
||||
const char *replyDomain, void *context)
|
||||
__attribute__((nonnull(1,5,6,7,8)));
|
||||
static void browse_local_callback(DNSServiceRef sdRef,
|
||||
DNSServiceFlags flags,
|
||||
uint32_t interfaceIndex,
|
||||
DNSServiceErrorType errorCode,
|
||||
const char *serviceName,
|
||||
const char *regtype,
|
||||
const char *replyDomain,
|
||||
void *context)
|
||||
__attribute__((nonnull(1,5,6,7,8)));
|
||||
static void browse_callback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *serviceName, const char *regtype, const char *replyDomain, void *context) _CUPS_NONNULL(1,5,6,7,8);
|
||||
static void browse_local_callback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *serviceName, const char *regtype, const char *replyDomain, void *context) _CUPS_NONNULL(1,5,6,7,8);
|
||||
#endif /* HAVE_DNSSD */
|
||||
#ifdef HAVE_AVAHI
|
||||
static void browse_callback(AvahiServiceBrowser *browser,
|
||||
@@ -119,22 +101,10 @@ 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 cups_device_t *get_device(cups_array_t *devices,
|
||||
const char *serviceName,
|
||||
const char *regtype,
|
||||
const char *replyDomain)
|
||||
__attribute__((nonnull(1,2,3,4)));
|
||||
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) _CUPS_NONNULL(1,2,3,4);
|
||||
#ifdef HAVE_DNSSD
|
||||
static void query_callback(DNSServiceRef sdRef,
|
||||
DNSServiceFlags flags,
|
||||
uint32_t interfaceIndex,
|
||||
DNSServiceErrorType errorCode,
|
||||
const char *fullName, uint16_t rrtype,
|
||||
uint16_t rrclass, uint16_t rdlen,
|
||||
const void *rdata, uint32_t ttl,
|
||||
void *context)
|
||||
__attribute__((nonnull(1,5,9,11)));
|
||||
static void query_callback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *fullName, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, void *context) _CUPS_NONNULL(1,5,9,11);
|
||||
#elif defined(HAVE_AVAHI)
|
||||
static int poll_callback(struct pollfd *pollfds,
|
||||
unsigned int num_pollfds, int timeout,
|
||||
@@ -150,8 +120,7 @@ static void query_callback(AvahiRecordBrowser *browser,
|
||||
void *context);
|
||||
#endif /* HAVE_DNSSD */
|
||||
static void sigterm_handler(int sig);
|
||||
static void unquote(char *dst, const char *src, size_t dstsize)
|
||||
__attribute__((nonnull(1,2)));
|
||||
static void unquote(char *dst, const char *src, size_t dstsize) _CUPS_NONNULL(1,2);
|
||||
|
||||
|
||||
/*
|
||||
@@ -1255,6 +1224,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
|
||||
|
||||
+4
-30
@@ -1,14 +1,11 @@
|
||||
/*
|
||||
* IEEE-1284 support functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2015 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -58,19 +55,12 @@ backendGetDeviceID(
|
||||
char *ptr; /* Pointer into device ID */
|
||||
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
|
||||
"make_model=%p, make_model_size=%d, scheme=\"%s\", "
|
||||
"uri=%p, uri_size=%d)\n", fd, device_id, device_id_size,
|
||||
make_model, make_model_size, scheme ? scheme : "(null)",
|
||||
uri, uri_size));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!device_id || device_id_size < 32)
|
||||
{
|
||||
DEBUG_puts("backendGetDeviceID: Bad args!");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -214,8 +204,6 @@ backendGetDeviceID(
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_printf(("backendGetDeviceID: ioctl failed - %s\n",
|
||||
strerror(errno)));
|
||||
*device_id = '\0';
|
||||
}
|
||||
# endif /* __linux */
|
||||
@@ -237,11 +225,6 @@ backendGetDeviceID(
|
||||
else
|
||||
device_id[device_id_size - 1] = '\0';
|
||||
}
|
||||
# ifdef DEBUG
|
||||
else
|
||||
DEBUG_printf(("backendGetDeviceID: ioctl failed - %s\n",
|
||||
strerror(errno)));
|
||||
# endif /* DEBUG */
|
||||
# endif /* __sun && ECPPIOC_GETDEVID */
|
||||
}
|
||||
|
||||
@@ -255,14 +238,10 @@ backendGetDeviceID(
|
||||
*ptr = ' ';
|
||||
else if ((*ptr & 255) < ' ' || *ptr == 127)
|
||||
{
|
||||
DEBUG_printf(("backendGetDeviceID: Bad device_id character %d.",
|
||||
*ptr & 255));
|
||||
*device_id = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
|
||||
|
||||
if (scheme && uri)
|
||||
*uri = '\0';
|
||||
|
||||
@@ -368,17 +347,12 @@ backendGetMakeModel(
|
||||
*des; /* Description string */
|
||||
|
||||
|
||||
DEBUG_printf(("backendGetMakeModel(device_id=\"%s\", make_model=%p, make_model_size=" CUPS_LLFMT ")\n", device_id, make_model, CUPS_LLCAST make_model_size));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!device_id || !*device_id || !make_model || make_model_size < 32)
|
||||
{
|
||||
DEBUG_puts("backendGetMakeModel: Bad args!");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
*make_model = '\0';
|
||||
|
||||
|
||||
+194
-142
@@ -1,14 +1,11 @@
|
||||
/*
|
||||
* IPP backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -26,12 +23,8 @@
|
||||
# define kPMPrintUIToolAgent "com.apple.printuitool.agent"
|
||||
# define kPMStartJob 100
|
||||
# define kPMWaitForJob 101
|
||||
# ifdef HAVE_XPC_PRIVATE_H
|
||||
# include <xpc/private.h>
|
||||
# else
|
||||
extern void xpc_connection_set_target_uid(xpc_connection_t connection,
|
||||
uid_t uid);
|
||||
# endif /* HAVE_XPC_PRIVATE_H */
|
||||
#endif /* HAVE_GSSAPI && HAVE_XPC */
|
||||
|
||||
|
||||
@@ -45,6 +38,8 @@ extern void xpc_connection_set_target_uid(xpc_connection_t connection,
|
||||
#define _CUPS_JSR_ACCOUNT_LIMIT_REACHED 0x08
|
||||
#define _CUPS_JSR_JOB_PASSWORD_WAIT 0x10
|
||||
#define _CUPS_JSR_JOB_RELEASE_WAIT 0x20
|
||||
#define _CUPS_JSR_DOCUMENT_FORMAT_ERROR 0x40
|
||||
#define _CUPS_JSR_DOCUMENT_UNPRINTABLE 0x80
|
||||
|
||||
|
||||
/*
|
||||
@@ -67,6 +62,7 @@ typedef struct _cups_monitor_s /**** Monitoring data ****/
|
||||
http_encryption_t encryption; /* Use encryption? */
|
||||
ipp_jstate_t job_state; /* Current job state */
|
||||
ipp_pstate_t printer_state; /* Current printer state */
|
||||
int retryable; /* Is this a job that should be retried? */
|
||||
} _cups_monitor_t;
|
||||
|
||||
|
||||
@@ -355,8 +351,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* that way.
|
||||
*/
|
||||
|
||||
if (!getuid() && (value = getenv("AUTH_UID")) != NULL &&
|
||||
!getenv("AUTH_PASSWORD"))
|
||||
if (!getuid() && (value = getenv("AUTH_UID")) != NULL)
|
||||
{
|
||||
uid_t uid = (uid_t)atoi(value);
|
||||
/* User ID */
|
||||
@@ -390,7 +385,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
# else /* No XPC, just try to run as the user ID */
|
||||
if (uid > 0)
|
||||
seteuid(uid);
|
||||
setuid(uid);
|
||||
# endif /* HAVE_XPC */
|
||||
}
|
||||
#endif /* HAVE_GSSAPI */
|
||||
@@ -422,9 +417,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
port = IPP_PORT; /* Default to port 631 */
|
||||
|
||||
if (!strcmp(scheme, "https") || !strcmp(scheme, "ipps"))
|
||||
cupsSetEncryption(HTTP_ENCRYPT_ALWAYS);
|
||||
cupsSetEncryption(HTTP_ENCRYPTION_ALWAYS);
|
||||
else
|
||||
cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
|
||||
cupsSetEncryption(HTTP_ENCRYPTION_IF_REQUESTED);
|
||||
|
||||
/*
|
||||
* See if there are any options...
|
||||
@@ -511,13 +506,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
if (!_cups_strcasecmp(value, "always"))
|
||||
cupsSetEncryption(HTTP_ENCRYPT_ALWAYS);
|
||||
cupsSetEncryption(HTTP_ENCRYPTION_ALWAYS);
|
||||
else if (!_cups_strcasecmp(value, "required"))
|
||||
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
|
||||
cupsSetEncryption(HTTP_ENCRYPTION_REQUIRED);
|
||||
else if (!_cups_strcasecmp(value, "never"))
|
||||
cupsSetEncryption(HTTP_ENCRYPT_NEVER);
|
||||
cupsSetEncryption(HTTP_ENCRYPTION_NEVER);
|
||||
else if (!_cups_strcasecmp(value, "ifrequested"))
|
||||
cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
|
||||
cupsSetEncryption(HTTP_ENCRYPTION_IF_REQUESTED);
|
||||
else
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
@@ -705,11 +700,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "DEBUG: Connecting to %s:%d\n", hostname, port);
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Connecting to printer."));
|
||||
|
||||
if (httpReconnect(http))
|
||||
if (httpReconnect2(http, 30000, NULL))
|
||||
{
|
||||
int error = errno; /* Connection error */
|
||||
|
||||
if (http->status == HTTP_PKI_ERROR)
|
||||
if (http->status == HTTP_STATUS_CUPS_PKI_ERROR)
|
||||
update_reasons(NULL, "+cups-certificate-error");
|
||||
|
||||
if (job_canceled)
|
||||
@@ -912,7 +907,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Build the IPP request...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
|
||||
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, uri);
|
||||
@@ -927,7 +922,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
fputs("DEBUG: Getting supported attributes...\n", stderr);
|
||||
|
||||
if (http->version < HTTP_1_1)
|
||||
if (http->version < HTTP_VERSION_1_1)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Printer responded with HTTP version %d.%d.\n",
|
||||
http->version / 100, http->version % 100);
|
||||
@@ -941,15 +936,15 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "DEBUG: Get-Printer-Attributes: %s (%s)\n",
|
||||
ippErrorString(ipp_status), cupsLastErrorString());
|
||||
|
||||
if (ipp_status <= IPP_OK_CONFLICT)
|
||||
if (ipp_status <= IPP_STATUS_OK_CONFLICTING)
|
||||
password_tries = 0;
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Get-Printer-Attributes returned %s.\n",
|
||||
ippErrorString(ipp_status));
|
||||
|
||||
if (ipp_status == IPP_PRINTER_BUSY ||
|
||||
ipp_status == IPP_SERVICE_UNAVAILABLE)
|
||||
if (ipp_status == IPP_STATUS_ERROR_BUSY ||
|
||||
ipp_status == IPP_STATUS_ERROR_SERVICE_UNAVAILABLE)
|
||||
{
|
||||
if (contimeout && (time(NULL) - start_time) > contimeout)
|
||||
{
|
||||
@@ -966,8 +961,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
delay = _cupsNextDelay(delay, &prev_delay);
|
||||
}
|
||||
else if ((ipp_status == IPP_BAD_REQUEST ||
|
||||
ipp_status == IPP_VERSION_NOT_SUPPORTED) && version > 10)
|
||||
else if ((ipp_status == IPP_STATUS_ERROR_BAD_REQUEST ||
|
||||
ipp_status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED) && version > 10)
|
||||
{
|
||||
/*
|
||||
* Switch to IPP/1.1 or IPP/1.0...
|
||||
@@ -990,9 +985,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
version = 10;
|
||||
}
|
||||
|
||||
httpReconnect(http);
|
||||
httpReconnect2(http, 30000, NULL);
|
||||
}
|
||||
else if (ipp_status == IPP_NOT_FOUND)
|
||||
else if (ipp_status == IPP_STATUS_ERROR_NOT_FOUND)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("The printer configuration is incorrect or the "
|
||||
@@ -1002,8 +997,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
return (CUPS_BACKEND_STOP);
|
||||
}
|
||||
else if (ipp_status == IPP_FORBIDDEN ||
|
||||
ipp_status == IPP_AUTHENTICATION_CANCELED)
|
||||
else if (ipp_status == IPP_STATUS_ERROR_FORBIDDEN ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED)
|
||||
{
|
||||
const char *www_auth = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE);
|
||||
/* WWW-Authenticate field value */
|
||||
@@ -1016,13 +1011,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required);
|
||||
return (CUPS_BACKEND_AUTH_REQUIRED);
|
||||
}
|
||||
else if (ipp_status != IPP_NOT_AUTHORIZED)
|
||||
else if (ipp_status != IPP_STATUS_ERROR_NOT_AUTHORIZED)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to get printer status."));
|
||||
sleep(10);
|
||||
|
||||
httpReconnect(http);
|
||||
httpReconnect2(http, 30000, NULL);
|
||||
}
|
||||
|
||||
ippDelete(supported);
|
||||
@@ -1136,7 +1131,14 @@ main(int argc, /* I - Number of command-line args */
|
||||
copies_sup = NULL; /* No */
|
||||
}
|
||||
|
||||
cups_version = ippFindAttribute(supported, "cups-version", IPP_TAG_TEXT);
|
||||
if ((cups_version = ippFindAttribute(supported, "cups-version", IPP_TAG_TEXT)) != NULL)
|
||||
{
|
||||
const char *val = ippGetString(cups_version, 0, NULL);
|
||||
|
||||
fprintf(stderr, "DEBUG: cups-version = \"%s\"\n", val);
|
||||
if (!strcmp(val, "cups-version"))
|
||||
cups_version = NULL; /* Bogus cups-version value returned by buggy printers! */
|
||||
}
|
||||
|
||||
encryption_sup = ippFindAttribute(supported, "job-password-encryption-supported", IPP_TAG_KEYWORD);
|
||||
|
||||
@@ -1172,7 +1174,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
ippOpString(operations_sup->values[i].integer));
|
||||
|
||||
for (i = 0; i < operations_sup->num_values; i ++)
|
||||
if (operations_sup->values[i].integer == IPP_PRINT_JOB)
|
||||
if (operations_sup->values[i].integer == IPP_OP_PRINT_JOB)
|
||||
break;
|
||||
|
||||
if (i >= operations_sup->num_values)
|
||||
@@ -1180,7 +1182,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
"cups-ipp-missing-print-job");
|
||||
|
||||
for (i = 0; i < operations_sup->num_values; i ++)
|
||||
if (operations_sup->values[i].integer == IPP_CANCEL_JOB)
|
||||
if (operations_sup->values[i].integer == IPP_OP_CANCEL_JOB)
|
||||
break;
|
||||
|
||||
if (i >= operations_sup->num_values)
|
||||
@@ -1188,7 +1190,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
"cups-ipp-missing-cancel-job");
|
||||
|
||||
for (i = 0; i < operations_sup->num_values; i ++)
|
||||
if (operations_sup->values[i].integer == IPP_GET_JOB_ATTRIBUTES)
|
||||
if (operations_sup->values[i].integer == IPP_OP_GET_JOB_ATTRIBUTES)
|
||||
break;
|
||||
|
||||
if (i >= operations_sup->num_values)
|
||||
@@ -1196,7 +1198,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
"cups-ipp-missing-get-job-attributes");
|
||||
|
||||
for (i = 0; i < operations_sup->num_values; i ++)
|
||||
if (operations_sup->values[i].integer == IPP_GET_PRINTER_ATTRIBUTES)
|
||||
if (operations_sup->values[i].integer == IPP_OP_GET_PRINTER_ATTRIBUTES)
|
||||
break;
|
||||
|
||||
if (i >= operations_sup->num_values)
|
||||
@@ -1205,13 +1207,13 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
for (i = 0; i < operations_sup->num_values; i ++)
|
||||
{
|
||||
if (operations_sup->values[i].integer == IPP_VALIDATE_JOB)
|
||||
if (operations_sup->values[i].integer == IPP_OP_VALIDATE_JOB)
|
||||
validate_job = 1;
|
||||
else if (operations_sup->values[i].integer == IPP_CREATE_JOB)
|
||||
else if (operations_sup->values[i].integer == IPP_OP_CREATE_JOB)
|
||||
create_job = 1;
|
||||
else if (operations_sup->values[i].integer == IPP_SEND_DOCUMENT)
|
||||
else if (operations_sup->values[i].integer == IPP_OP_SEND_DOCUMENT)
|
||||
send_document = 1;
|
||||
else if (operations_sup->values[i].integer == IPP_GET_JOB_ATTRIBUTES)
|
||||
else if (operations_sup->values[i].integer == IPP_OP_GET_JOB_ATTRIBUTES)
|
||||
get_job_attrs = 1;
|
||||
}
|
||||
|
||||
@@ -1239,7 +1241,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
report_printer_state(supported);
|
||||
}
|
||||
while (!job_canceled && ipp_status > IPP_OK_CONFLICT);
|
||||
while (!job_canceled && ipp_status > IPP_STATUS_OK_CONFLICTING);
|
||||
|
||||
if (job_canceled)
|
||||
return (CUPS_BACKEND_OK);
|
||||
@@ -1257,7 +1259,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
IPP_TAG_BOOLEAN);
|
||||
|
||||
if (printer_state == NULL ||
|
||||
(printer_state->values[0].integer > IPP_PRINTER_PROCESSING &&
|
||||
(printer_state->values[0].integer > IPP_PSTATE_PROCESSING &&
|
||||
waitprinter) ||
|
||||
printer_accepting == NULL ||
|
||||
!printer_accepting->values[0].boolean)
|
||||
@@ -1383,7 +1385,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* (I hate compatibility hacks!)
|
||||
*/
|
||||
|
||||
if (http->version < HTTP_1_1 && num_files == 0)
|
||||
if (http->version < HTTP_VERSION_1_1 && num_files == 0)
|
||||
{
|
||||
if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
|
||||
{
|
||||
@@ -1411,7 +1413,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
files = &compatfile;
|
||||
num_files = 1;
|
||||
}
|
||||
else if (http->version < HTTP_1_1 && num_files == 1)
|
||||
else if (http->version < HTTP_VERSION_1_1 && num_files == 1)
|
||||
{
|
||||
struct stat fileinfo; /* File information */
|
||||
|
||||
@@ -1444,8 +1446,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
monitor.create_job = create_job;
|
||||
monitor.get_job_attrs = get_job_attrs;
|
||||
monitor.encryption = cupsEncryption();
|
||||
monitor.job_state = IPP_JOB_PENDING;
|
||||
monitor.printer_state = IPP_PRINTER_IDLE;
|
||||
monitor.job_state = IPP_JSTATE_PENDING;
|
||||
monitor.printer_state = IPP_PSTATE_IDLE;
|
||||
monitor.retryable = argc == 6 && document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf");
|
||||
|
||||
if (create_job)
|
||||
{
|
||||
@@ -1485,6 +1488,30 @@ main(int argc, /* I - Number of command-line args */
|
||||
ippGetString(job_auth, 0, NULL), num_options,
|
||||
&options);
|
||||
|
||||
if (ipp_status == IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED || ipp_status == IPP_STATUS_OK_CONFLICTING)
|
||||
{
|
||||
/*
|
||||
* One or more options are not supported...
|
||||
*/
|
||||
|
||||
ipp_attribute_t *attr; /* Unsupported attribute */
|
||||
|
||||
if ((attr = ippFindAttribute(response, "sides", IPP_TAG_ZERO)) != NULL)
|
||||
{
|
||||
/*
|
||||
* The sides value is not supported, revert to one-sided as needed...
|
||||
*/
|
||||
|
||||
const char *sides = cupsGetOption("sides", num_options, options);
|
||||
|
||||
if (!strncmp(sides, "two-sided-", 10))
|
||||
{
|
||||
fputs("DEBUG: Unable to do two-sided printing, setting sides to 'one-sided'.\n", stderr);
|
||||
num_options = cupsAddOption("sides", "one-sided", num_options, &options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ippDelete(response);
|
||||
|
||||
if (job_canceled)
|
||||
@@ -1527,10 +1554,10 @@ main(int argc, /* I - Number of command-line args */
|
||||
"cups-ipp-missing-validate-job");
|
||||
break;
|
||||
}
|
||||
else if (ipp_status < IPP_REDIRECTION_OTHER_SITE ||
|
||||
ipp_status == IPP_BAD_REQUEST)
|
||||
else if (ipp_status < IPP_STATUS_REDIRECTION_OTHER_SITE ||
|
||||
ipp_status == IPP_STATUS_ERROR_BAD_REQUEST)
|
||||
break;
|
||||
else if (job_auth == NULL && ipp_status > IPP_BAD_REQUEST)
|
||||
else if (job_auth == NULL && ipp_status > IPP_STATUS_ERROR_BAD_REQUEST)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -1555,8 +1582,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (job_canceled)
|
||||
break;
|
||||
|
||||
request = new_request((num_files > 1 || create_job) ? IPP_CREATE_JOB :
|
||||
IPP_PRINT_JOB,
|
||||
request = new_request((num_files > 1 || create_job) ? IPP_OP_CREATE_JOB :
|
||||
IPP_OP_PRINT_JOB,
|
||||
version, uri, argv[2], monitor.job_name, num_options,
|
||||
options, compression, copies_sup ? copies : 1,
|
||||
document_format, pc, ppd, media_col_sup,
|
||||
@@ -1581,7 +1608,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
fputs("DEBUG: Sending file using HTTP/1.1 chunking...\n", stderr);
|
||||
|
||||
http_status = cupsSendRequest(http, request, resource, length);
|
||||
if (http_status == HTTP_CONTINUE && request->state == IPP_DATA)
|
||||
if (http_status == HTTP_STATUS_CONTINUE && request->state == IPP_STATE_DATA)
|
||||
{
|
||||
if (compression && strcmp(compression, "none"))
|
||||
httpSetField(http, HTTP_FIELD_CONTENT_ENCODING, compression);
|
||||
@@ -1600,7 +1627,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
http_status = cupsWriteRequestData(http, buffer, (size_t)bytes);
|
||||
}
|
||||
|
||||
while (http_status == HTTP_CONTINUE &&
|
||||
while (http_status == HTTP_STATUS_CONTINUE &&
|
||||
(!job_canceled || compatsize > 0))
|
||||
{
|
||||
/*
|
||||
@@ -1625,7 +1652,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
fprintf(stderr, "DEBUG: Read %d bytes...\n", (int)bytes);
|
||||
|
||||
if ((http_status = cupsWriteRequestData(http, buffer, (size_t)bytes))
|
||||
!= HTTP_CONTINUE)
|
||||
!= HTTP_STATUS_CONTINUE)
|
||||
break;
|
||||
}
|
||||
else if (bytes == 0 || (errno != EINTR && errno != EAGAIN))
|
||||
@@ -1633,7 +1660,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
}
|
||||
|
||||
if (http_status == HTTP_ERROR)
|
||||
if (http_status == HTTP_STATUS_ERROR)
|
||||
fprintf(stderr, "DEBUG: Error writing document data for "
|
||||
"Print-Job: %s\n", strerror(httpError(http)));
|
||||
|
||||
@@ -1652,7 +1679,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
ippErrorString(ipp_status), cupsLastErrorString());
|
||||
debug_attributes(response);
|
||||
|
||||
if (ipp_status > IPP_OK_CONFLICT)
|
||||
if (ipp_status > IPP_STATUS_OK_CONFLICTING)
|
||||
{
|
||||
job_id = 0;
|
||||
|
||||
@@ -1704,7 +1731,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
else if (www_auth[0])
|
||||
auth_info_required = "username,password";
|
||||
}
|
||||
else if (ipp_status == IPP_REQUEST_VALUE)
|
||||
else if (ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE)
|
||||
{
|
||||
/*
|
||||
* Print file is too large, abort this job...
|
||||
@@ -1760,7 +1787,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Send the next file in the job...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_SEND_DOCUMENT);
|
||||
request = ippNewRequest(IPP_OP_SEND_DOCUMENT);
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
@@ -1789,7 +1816,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
debug_attributes(request);
|
||||
|
||||
http_status = cupsSendRequest(http, request, resource, 0);
|
||||
if (http_status == HTTP_CONTINUE && request->state == IPP_DATA)
|
||||
if (http_status == HTTP_STATUS_CONTINUE && request->state == IPP_STATE_DATA)
|
||||
{
|
||||
if (compression && strcmp(compression, "none"))
|
||||
httpSetField(http, HTTP_FIELD_CONTENT_ENCODING, compression);
|
||||
@@ -1813,11 +1840,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
while (!job_canceled && http_status == HTTP_CONTINUE &&
|
||||
while (!job_canceled && http_status == HTTP_STATUS_CONTINUE &&
|
||||
(bytes = read(fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
if ((http_status = cupsWriteRequestData(http, buffer, (size_t)bytes))
|
||||
!= HTTP_CONTINUE)
|
||||
!= HTTP_STATUS_CONTINUE)
|
||||
break;
|
||||
else
|
||||
{
|
||||
@@ -1833,7 +1860,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
close(fd);
|
||||
}
|
||||
|
||||
if (http_status == HTTP_ERROR)
|
||||
if (http_status == HTTP_STATUS_ERROR)
|
||||
fprintf(stderr, "DEBUG: Error writing document data for "
|
||||
"Send-Document: %s\n", strerror(httpError(http)));
|
||||
|
||||
@@ -1845,7 +1872,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
debug_attributes(response);
|
||||
ippDelete(response);
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT && !job_canceled)
|
||||
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING && !job_canceled)
|
||||
{
|
||||
ipp_status = cupsLastError();
|
||||
|
||||
@@ -1866,12 +1893,12 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (job_canceled)
|
||||
break;
|
||||
|
||||
if (ipp_status <= IPP_OK_CONFLICT && argc > 6)
|
||||
if (ipp_status <= IPP_STATUS_OK_CONFLICTING && argc > 6)
|
||||
{
|
||||
fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1);
|
||||
copies_remaining --;
|
||||
}
|
||||
else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
|
||||
else if ((ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
|
||||
argc == 6 &&
|
||||
document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf"))
|
||||
{
|
||||
@@ -1885,9 +1912,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_NOT_POSSIBLE ||
|
||||
ipp_status == IPP_PRINTER_BUSY)
|
||||
else if (ipp_status == IPP_STATUS_ERROR_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_STATUS_ERROR_NOT_POSSIBLE ||
|
||||
ipp_status == IPP_STATUS_ERROR_BUSY)
|
||||
{
|
||||
if (argc == 6)
|
||||
{
|
||||
@@ -1903,14 +1930,14 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if (ipp_status == IPP_REQUEST_VALUE ||
|
||||
ipp_status == IPP_ERROR_JOB_CANCELED ||
|
||||
ipp_status == IPP_NOT_AUTHORIZED ||
|
||||
else if (ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE ||
|
||||
ipp_status == IPP_STATUS_ERROR_JOB_CANCELED ||
|
||||
ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED ||
|
||||
ipp_status == IPP_INTERNAL_ERROR)
|
||||
ipp_status == IPP_STATUS_ERROR_INTERNAL)
|
||||
{
|
||||
/*
|
||||
* Print file is too large, job was canceled, we need new
|
||||
@@ -1940,7 +1967,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
else if (ipp_status == IPP_NOT_FOUND)
|
||||
else if (ipp_status == IPP_STATUS_ERROR_NOT_FOUND)
|
||||
{
|
||||
/*
|
||||
* Printer does not actually implement support for Create-Job/
|
||||
@@ -1954,7 +1981,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
update_reasons(NULL, "+cups-ipp-conformance-failure-report,"
|
||||
"cups-ipp-missing-send-document");
|
||||
|
||||
ipp_status = IPP_INTERNAL_ERROR; /* Force queue to stop */
|
||||
ipp_status = IPP_STATUS_ERROR_INTERNAL; /* Force queue to stop */
|
||||
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1986,14 +2013,14 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
check_printer_state(http, uri, resource, argv[2], version);
|
||||
|
||||
if (cupsLastError() <= IPP_OK_CONFLICT)
|
||||
if (cupsLastError() <= IPP_STATUS_OK_CONFLICTING)
|
||||
password_tries = 0;
|
||||
|
||||
/*
|
||||
* Build an IPP_GET_JOB_ATTRIBUTES request...
|
||||
* Build an IPP_OP_GET_JOB_ATTRIBUTES request...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES);
|
||||
request = ippNewRequest(IPP_OP_GET_JOB_ATTRIBUTES);
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
@@ -2017,11 +2044,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Do the request...
|
||||
*/
|
||||
|
||||
httpReconnect(http);
|
||||
httpReconnect2(http, 30000, NULL);
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
ipp_status = cupsLastError();
|
||||
|
||||
if (ipp_status == IPP_NOT_FOUND || ipp_status == IPP_NOT_POSSIBLE)
|
||||
if (ipp_status == IPP_STATUS_ERROR_NOT_FOUND || ipp_status == IPP_STATUS_ERROR_NOT_POSSIBLE)
|
||||
{
|
||||
/*
|
||||
* Job has gone away and/or the server has no job history...
|
||||
@@ -2031,7 +2058,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
"cups-ipp-missing-job-history");
|
||||
ippDelete(response);
|
||||
|
||||
ipp_status = IPP_OK;
|
||||
ipp_status = IPP_STATUS_OK;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2039,25 +2066,25 @@ main(int argc, /* I - Number of command-line args */
|
||||
ippErrorString(ipp_status), cupsLastErrorString());
|
||||
debug_attributes(response);
|
||||
|
||||
if (ipp_status <= IPP_OK_CONFLICT)
|
||||
if (ipp_status <= IPP_STATUS_OK_CONFLICTING)
|
||||
password_tries = 0;
|
||||
else
|
||||
{
|
||||
if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
|
||||
ipp_status != IPP_PRINTER_BUSY)
|
||||
if (ipp_status != IPP_STATUS_ERROR_SERVICE_UNAVAILABLE &&
|
||||
ipp_status != IPP_STATUS_ERROR_BUSY)
|
||||
{
|
||||
ippDelete(response);
|
||||
ipp_status = IPP_OK;
|
||||
ipp_status = IPP_STATUS_OK;
|
||||
break;
|
||||
}
|
||||
else if (ipp_status == IPP_INTERNAL_ERROR)
|
||||
else if (ipp_status == IPP_STATUS_ERROR_INTERNAL)
|
||||
{
|
||||
waitjob_tries ++;
|
||||
|
||||
if (waitjob_tries > 4)
|
||||
{
|
||||
ippDelete(response);
|
||||
ipp_status = IPP_OK;
|
||||
ipp_status = IPP_STATUS_OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2073,11 +2100,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
if (cups_version &&
|
||||
job_state->values[0].integer >= IPP_JOB_PENDING &&
|
||||
job_state->values[0].integer <= IPP_JOB_COMPLETED)
|
||||
job_state->values[0].integer >= IPP_JSTATE_PENDING &&
|
||||
job_state->values[0].integer <= IPP_JSTATE_COMPLETED)
|
||||
update_reasons(NULL,
|
||||
remote_job_states[job_state->values[0].integer -
|
||||
IPP_JOB_PENDING]);
|
||||
IPP_JSTATE_PENDING]);
|
||||
|
||||
if ((job_sheets = ippFindAttribute(response, "job-impressions-completed", IPP_TAG_INTEGER)) == NULL)
|
||||
job_sheets = ippFindAttribute(response, "job-media-sheets-completed", IPP_TAG_INTEGER);
|
||||
@@ -2097,9 +2124,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
|
||||
ipp_status != IPP_NOT_POSSIBLE &&
|
||||
ipp_status != IPP_PRINTER_BUSY)
|
||||
else if (ipp_status != IPP_STATUS_ERROR_SERVICE_UNAVAILABLE &&
|
||||
ipp_status != IPP_STATUS_ERROR_NOT_POSSIBLE &&
|
||||
ipp_status != IPP_STATUS_ERROR_BUSY)
|
||||
{
|
||||
/*
|
||||
* If the printer does not return a job-state attribute, it does not
|
||||
@@ -2109,7 +2136,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
update_reasons(NULL, "+cups-ipp-conformance-failure-report,"
|
||||
"cups-ipp-missing-job-state");
|
||||
ipp_status = IPP_INTERNAL_ERROR;
|
||||
ipp_status = IPP_STATUS_ERROR_INTERNAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2134,7 +2161,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
cancel_job(http, uri, job_id, resource, argv[2], version);
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING)
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
|
||||
}
|
||||
|
||||
@@ -2144,7 +2171,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
check_printer_state(http, uri, resource, argv[2], version);
|
||||
|
||||
if (cupsLastError() <= IPP_OK_CONFLICT)
|
||||
if (cupsLastError() <= IPP_STATUS_OK_CONFLICTING)
|
||||
password_tries = 0;
|
||||
|
||||
/*
|
||||
@@ -2191,9 +2218,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
* Return the queue status...
|
||||
*/
|
||||
|
||||
if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN ||
|
||||
ipp_status == IPP_AUTHENTICATION_CANCELED ||
|
||||
ipp_status <= IPP_OK_CONFLICT)
|
||||
if (ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED || ipp_status == IPP_STATUS_ERROR_FORBIDDEN ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED ||
|
||||
ipp_status <= IPP_STATUS_OK_CONFLICTING)
|
||||
fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required);
|
||||
|
||||
if (ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED)
|
||||
@@ -2205,25 +2232,26 @@ main(int argc, /* I - Number of command-line args */
|
||||
else if (ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
|
||||
fputs("JOBSTATE: account-authorization-failed\n", stderr);
|
||||
|
||||
if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN ||
|
||||
ipp_status == IPP_AUTHENTICATION_CANCELED)
|
||||
if (job_canceled)
|
||||
return (CUPS_BACKEND_OK);
|
||||
else if (ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED || ipp_status == IPP_STATUS_ERROR_FORBIDDEN || ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED)
|
||||
return (CUPS_BACKEND_AUTH_REQUIRED);
|
||||
else if (ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED ||
|
||||
ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
|
||||
return (CUPS_BACKEND_HOLD);
|
||||
else if (ipp_status == IPP_INTERNAL_ERROR)
|
||||
else if (ipp_status == IPP_STATUS_ERROR_INTERNAL)
|
||||
return (CUPS_BACKEND_STOP);
|
||||
else if (ipp_status == IPP_CONFLICT || ipp_status == IPP_STATUS_ERROR_REQUEST_ENTITY || ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE)
|
||||
else if (ipp_status == IPP_STATUS_ERROR_CONFLICTING || ipp_status == IPP_STATUS_ERROR_REQUEST_ENTITY || ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
else if (ipp_status == IPP_REQUEST_VALUE ||
|
||||
else if (ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE ||
|
||||
ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES ||
|
||||
ipp_status == IPP_DOCUMENT_FORMAT || job_canceled < 0)
|
||||
ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED || job_canceled < 0)
|
||||
{
|
||||
if (ipp_status == IPP_REQUEST_VALUE)
|
||||
if (ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE)
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Print job too large."));
|
||||
else if (ipp_status == IPP_DOCUMENT_FORMAT)
|
||||
else if (ipp_status == IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED)
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Printer cannot print supplied content."));
|
||||
else if (ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES)
|
||||
@@ -2234,7 +2262,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
return (CUPS_BACKEND_CANCEL);
|
||||
}
|
||||
else if (ipp_status > IPP_OK_CONFLICT && ipp_status != IPP_ERROR_JOB_CANCELED)
|
||||
else if (ipp_status > IPP_STATUS_OK_CONFLICTING && ipp_status != IPP_STATUS_ERROR_JOB_CANCELED)
|
||||
return (CUPS_BACKEND_RETRY_CURRENT);
|
||||
else
|
||||
return (CUPS_BACKEND_OK);
|
||||
@@ -2258,7 +2286,7 @@ cancel_job(http_t *http, /* I - HTTP connection */
|
||||
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Canceling print job."));
|
||||
|
||||
request = ippNewRequest(IPP_CANCEL_JOB);
|
||||
request = ippNewRequest(IPP_OP_CANCEL_JOB);
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
@@ -2292,7 +2320,7 @@ check_printer_state(
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* Attribute in response */
|
||||
ipp_pstate_t printer_state = IPP_PRINTER_STOPPED;
|
||||
ipp_pstate_t printer_state = IPP_PSTATE_STOPPED;
|
||||
/* Current printer-state */
|
||||
|
||||
|
||||
@@ -2300,7 +2328,7 @@ check_printer_state(
|
||||
* Send a Get-Printer-Attributes request and log the results...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);
|
||||
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
@@ -2426,14 +2454,14 @@ monitor_printer(
|
||||
|
||||
monitor->job_reasons = 0;
|
||||
|
||||
while (monitor->job_state < IPP_JOB_CANCELED && !job_canceled)
|
||||
while (monitor->job_state < IPP_JSTATE_CANCELED && !job_canceled)
|
||||
{
|
||||
/*
|
||||
* Reconnect to the printer as needed...
|
||||
*/
|
||||
|
||||
if (httpGetFd(http) < 0)
|
||||
httpReconnect(http);
|
||||
httpReconnect2(http, 30000, NULL);
|
||||
|
||||
if (httpGetFd(http) >= 0)
|
||||
{
|
||||
@@ -2445,7 +2473,7 @@ monitor_printer(
|
||||
monitor->resource,
|
||||
monitor->user,
|
||||
monitor->version);
|
||||
if (cupsLastError() <= IPP_OK_CONFLICT)
|
||||
if (cupsLastError() <= IPP_STATUS_OK_CONFLICTING)
|
||||
password_tries = 0;
|
||||
|
||||
if (monitor->job_id == 0 && monitor->create_job)
|
||||
@@ -2462,13 +2490,13 @@ monitor_printer(
|
||||
*/
|
||||
|
||||
job_op = (monitor->job_id > 0 && monitor->get_job_attrs) ?
|
||||
IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS;
|
||||
IPP_OP_GET_JOB_ATTRIBUTES : IPP_OP_GET_JOBS;
|
||||
request = ippNewRequest(job_op);
|
||||
ippSetVersion(request, monitor->version / 10, monitor->version % 10);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, monitor->uri);
|
||||
if (job_op == IPP_GET_JOB_ATTRIBUTES)
|
||||
if (job_op == IPP_OP_GET_JOB_ATTRIBUTES)
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
|
||||
monitor->job_id);
|
||||
|
||||
@@ -2489,16 +2517,16 @@ monitor_printer(
|
||||
fprintf(stderr, "DEBUG: (monitor) %s: %s (%s)\n", ippOpString(job_op),
|
||||
ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
|
||||
if (cupsLastError() <= IPP_OK_CONFLICT)
|
||||
if (cupsLastError() <= IPP_STATUS_OK_CONFLICTING)
|
||||
password_tries = 0;
|
||||
|
||||
if (job_op == IPP_GET_JOB_ATTRIBUTES)
|
||||
if (job_op == IPP_OP_GET_JOB_ATTRIBUTES)
|
||||
{
|
||||
if ((attr = ippFindAttribute(response, "job-state",
|
||||
IPP_TAG_ENUM)) != NULL)
|
||||
monitor->job_state = (ipp_jstate_t)attr->values[0].integer;
|
||||
else
|
||||
monitor->job_state = IPP_JOB_COMPLETED;
|
||||
monitor->job_state = IPP_JSTATE_COMPLETED;
|
||||
}
|
||||
else if (response)
|
||||
{
|
||||
@@ -2506,7 +2534,7 @@ monitor_printer(
|
||||
{
|
||||
job_id = 0;
|
||||
job_name = NULL;
|
||||
job_state = IPP_JOB_PENDING;
|
||||
job_state = IPP_JSTATE_PENDING;
|
||||
job_user = NULL;
|
||||
|
||||
while (attr && attr->group_tag != IPP_TAG_JOB)
|
||||
@@ -2548,12 +2576,11 @@ monitor_printer(
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n",
|
||||
ippEnumString("job-state", monitor->job_state));
|
||||
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n", ippEnumString("job-state", (int)monitor->job_state));
|
||||
|
||||
if (!job_canceled &&
|
||||
(monitor->job_state == IPP_JOB_CANCELED ||
|
||||
monitor->job_state == IPP_JOB_ABORTED))
|
||||
(monitor->job_state == IPP_JSTATE_CANCELED ||
|
||||
monitor->job_state == IPP_JSTATE_ABORTED))
|
||||
{
|
||||
job_canceled = -1;
|
||||
fprintf(stderr, "DEBUG: (monitor) job_canceled = -1\n");
|
||||
@@ -2566,22 +2593,24 @@ monitor_printer(
|
||||
|
||||
for (i = 0; i < attr->num_values; i ++)
|
||||
{
|
||||
if (!strcmp(attr->values[i].string.text,
|
||||
"account-authorization-failed"))
|
||||
if (!strcmp(attr->values[i].string.text, "account-authorization-failed"))
|
||||
new_reasons |= _CUPS_JSR_ACCOUNT_AUTHORIZATION_FAILED;
|
||||
else if (!strcmp(attr->values[i].string.text, "account-closed"))
|
||||
new_reasons |= _CUPS_JSR_ACCOUNT_CLOSED;
|
||||
else if (!strcmp(attr->values[i].string.text, "account-info-needed"))
|
||||
new_reasons |= _CUPS_JSR_ACCOUNT_INFO_NEEDED;
|
||||
else if (!strcmp(attr->values[i].string.text,
|
||||
"account-limit-reached"))
|
||||
else if (!strcmp(attr->values[i].string.text, "account-limit-reached"))
|
||||
new_reasons |= _CUPS_JSR_ACCOUNT_LIMIT_REACHED;
|
||||
else if (!strcmp(attr->values[i].string.text, "job-password-wait"))
|
||||
new_reasons |= _CUPS_JSR_JOB_PASSWORD_WAIT;
|
||||
else if (!strcmp(attr->values[i].string.text, "job-release-wait"))
|
||||
new_reasons |= _CUPS_JSR_JOB_RELEASE_WAIT;
|
||||
if (!job_canceled &&
|
||||
(!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system")))
|
||||
else if (!strcmp(attr->values[i].string.text, "document-format-error"))
|
||||
new_reasons |= _CUPS_JSR_DOCUMENT_FORMAT_ERROR;
|
||||
else if (!strcmp(attr->values[i].string.text, "document-unprintable"))
|
||||
new_reasons |= _CUPS_JSR_DOCUMENT_UNPRINTABLE;
|
||||
|
||||
if (!job_canceled && (!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system")))
|
||||
job_canceled = 1;
|
||||
}
|
||||
|
||||
@@ -2599,6 +2628,26 @@ monitor_printer(
|
||||
fputs("JOBSTATE: job-password-wait\n", stderr);
|
||||
else if (new_reasons & _CUPS_JSR_JOB_RELEASE_WAIT)
|
||||
fputs("JOBSTATE: job-release-wait\n", stderr);
|
||||
else if (new_reasons & (_CUPS_JSR_DOCUMENT_FORMAT_ERROR | _CUPS_JSR_DOCUMENT_UNPRINTABLE))
|
||||
{
|
||||
if (monitor->retryable)
|
||||
{
|
||||
/*
|
||||
* Can't print this, so retry as raster...
|
||||
*/
|
||||
|
||||
job_canceled = 1;
|
||||
fputs("JOBSTATE: cups-retry-as-raster\n", stderr);
|
||||
}
|
||||
else if (new_reasons & _CUPS_JSR_DOCUMENT_FORMAT_ERROR)
|
||||
{
|
||||
fputs("JOBSTATE: document-format-error\n", stderr);
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs("JOBSTATE: document-unprintable\n", stderr);
|
||||
}
|
||||
}
|
||||
else
|
||||
fputs("JOBSTATE: job-printing\n", stderr);
|
||||
|
||||
@@ -2608,12 +2657,11 @@ monitor_printer(
|
||||
|
||||
ippDelete(response);
|
||||
|
||||
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n",
|
||||
ippEnumString("job-state", monitor->job_state));
|
||||
fprintf(stderr, "DEBUG: (monitor) job-state = %s\n", ippEnumString("job-state", (int)monitor->job_state));
|
||||
|
||||
if (!job_canceled &&
|
||||
(monitor->job_state == IPP_JOB_CANCELED ||
|
||||
monitor->job_state == IPP_JOB_ABORTED))
|
||||
(monitor->job_state == IPP_JSTATE_CANCELED ||
|
||||
monitor->job_state == IPP_JSTATE_ABORTED))
|
||||
job_canceled = -1;
|
||||
}
|
||||
|
||||
@@ -2635,14 +2683,14 @@ monitor_printer(
|
||||
if (job_canceled > 0 && monitor->job_id > 0)
|
||||
{
|
||||
if (httpGetFd(http) < 0)
|
||||
httpReconnect(http);
|
||||
httpReconnect2(http, 30000, NULL);
|
||||
|
||||
if (httpGetFd(http) >= 0)
|
||||
{
|
||||
cancel_job(http, monitor->uri, monitor->job_id, monitor->resource,
|
||||
monitor->user, monitor->version);
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT)
|
||||
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: (monitor) cancel_job() = %s\n", cupsLastErrorString());
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job."));
|
||||
@@ -2718,7 +2766,7 @@ new_request(
|
||||
fprintf(stderr, "DEBUG: job-name=\"%s\"\n", title);
|
||||
}
|
||||
|
||||
if (format && op != IPP_CREATE_JOB)
|
||||
if (format && op != IPP_OP_CREATE_JOB)
|
||||
{
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", NULL, format);
|
||||
fprintf(stderr, "DEBUG: document-format=\"%s\"\n", format);
|
||||
@@ -2758,7 +2806,7 @@ new_request(
|
||||
char phone[1024], /* Phone number string */
|
||||
*ptr, /* Pointer into string */
|
||||
tel_uri[1024]; /* tel: URI */
|
||||
static const char * const allowed = "0123456789#*-+.()";
|
||||
static const char * const allowed = "0123456789#*-+.()pw";
|
||||
/* Allowed characters */
|
||||
|
||||
destination = ippNew();
|
||||
@@ -2771,7 +2819,9 @@ new_request(
|
||||
_httpDecodeURI(phone, keyword, sizeof(phone));
|
||||
for (ptr = phone; *ptr;)
|
||||
{
|
||||
if (!strchr(allowed, *ptr))
|
||||
if (*ptr == ',')
|
||||
*ptr = 'p';
|
||||
else if (!strchr(allowed, *ptr))
|
||||
_cups_strcpy(ptr, ptr + 1);
|
||||
else
|
||||
ptr ++;
|
||||
@@ -3557,6 +3607,8 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
}
|
||||
}
|
||||
|
||||
cupsArrayDelete(new_reasons);
|
||||
|
||||
_cupsMutexUnlock(&report_mutex);
|
||||
|
||||
/*
|
||||
|
||||
+13
-21
@@ -1,14 +1,11 @@
|
||||
/*
|
||||
* Line Printer Daemon backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -22,14 +19,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>
|
||||
@@ -75,12 +72,7 @@ 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_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,
|
||||
int copies, int banner, int format, int order,
|
||||
int reserve, int manual_copies, int timeout,
|
||||
int contimeout, const char *orighost);
|
||||
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, int copies, int banner, int format, int order, int reserve, int manual_copies, int timeout, int contimeout, const char *orighost) _CUPS_NONNULL((1,2,3,7,8,17));
|
||||
static ssize_t lpd_write(int lpd_fd, char *buffer, size_t length);
|
||||
static void sigterm_handler(int sig);
|
||||
|
||||
@@ -621,11 +613,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);
|
||||
}
|
||||
@@ -733,11 +725,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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -920,7 +912,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));
|
||||
@@ -931,7 +923,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."));
|
||||
|
||||
+4
-7
@@ -1,14 +1,11 @@
|
||||
/*
|
||||
* Common backend network APIs for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
* 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
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "LICENSE.txt"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
@@ -133,8 +140,8 @@
|
||||
# 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)
|
||||
0x0a5f unidir
|
||||
# All Zebra devices (https://bugs.launchpad.net/bugs/1001028) (Issue #5395)
|
||||
0x0a5f unidir no-reattach
|
||||
|
||||
# Canon CP-10
|
||||
0x04a9 0x304a blacklist
|
||||
@@ -265,3 +272,30 @@
|
||||
|
||||
# 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
|
||||
|
||||
+4
-7
@@ -1,14 +1,11 @@
|
||||
/*
|
||||
* Common run loop APIs for CUPS backends.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2014 by Apple Inc.
|
||||
* Copyright © 2006-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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+13
-11
@@ -1,13 +1,10 @@
|
||||
/*
|
||||
* SNMP supplies functions for CUPS.
|
||||
*
|
||||
* Copyright 2008-2015 by Apple Inc.
|
||||
* Copyright © 2008-2015 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -443,6 +440,7 @@ backend_init_supplies(
|
||||
{
|
||||
int i, /* Looping var */
|
||||
type; /* Current marker type */
|
||||
const char *community; /* SNMP community name */
|
||||
cups_file_t *cachefile; /* Cache file */
|
||||
const char *cachedir; /* CUPS_CACHEDIR value */
|
||||
char addrstr[1024], /* Address string */
|
||||
@@ -510,6 +508,10 @@ backend_init_supplies(
|
||||
* See if we should be getting supply levels via SNMP...
|
||||
*/
|
||||
|
||||
community = _cupsSNMPDefaultCommunity();
|
||||
if (!*community)
|
||||
return;
|
||||
|
||||
if ((ppd = ppdOpenFile(getenv("PPD"))) == NULL ||
|
||||
((ppdattr = ppdFindAttr(ppd, "cupsSNMPSupplies", NULL)) != NULL &&
|
||||
ppdattr->value && _cups_strcasecmp(ppdattr->value, "true")))
|
||||
@@ -531,7 +533,7 @@ backend_init_supplies(
|
||||
*/
|
||||
|
||||
if (!_cupsSNMPWrite(snmp_fd, addr, CUPS_SNMP_VERSION_1,
|
||||
_cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1,
|
||||
community, CUPS_ASN1_GET_REQUEST, 1,
|
||||
hrDeviceDescr))
|
||||
return;
|
||||
|
||||
@@ -608,7 +610,7 @@ backend_init_supplies(
|
||||
|
||||
|
||||
if (!_cupsSNMPWrite(snmp_fd, ¤t_addr, CUPS_SNMP_VERSION_1,
|
||||
_cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1,
|
||||
community, CUPS_ASN1_GET_REQUEST, 1,
|
||||
prtGeneralCurrentLocalization))
|
||||
return;
|
||||
|
||||
@@ -629,7 +631,7 @@ backend_init_supplies(
|
||||
|
||||
|
||||
if (!_cupsSNMPWrite(snmp_fd, ¤t_addr, CUPS_SNMP_VERSION_1,
|
||||
_cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1,
|
||||
community, CUPS_ASN1_GET_REQUEST, 1,
|
||||
oid))
|
||||
return;
|
||||
|
||||
@@ -654,7 +656,7 @@ backend_init_supplies(
|
||||
*/
|
||||
|
||||
_cupsSNMPWalk(snmp_fd, ¤t_addr, CUPS_SNMP_VERSION_1,
|
||||
_cupsSNMPDefaultCommunity(), prtMarkerSuppliesEntry,
|
||||
community, prtMarkerSuppliesEntry,
|
||||
CUPS_SUPPLY_TIMEOUT, backend_walk_cb, NULL);
|
||||
}
|
||||
|
||||
@@ -688,7 +690,7 @@ backend_init_supplies(
|
||||
strlcpy(supplies[i].color, "none", sizeof(supplies[i].color));
|
||||
|
||||
_cupsSNMPWalk(snmp_fd, ¤t_addr, CUPS_SNMP_VERSION_1,
|
||||
_cupsSNMPDefaultCommunity(), prtMarkerColorantValue,
|
||||
community, prtMarkerColorantValue,
|
||||
CUPS_SUPPLY_TIMEOUT, backend_walk_cb, NULL);
|
||||
|
||||
/*
|
||||
|
||||
+4
-7
@@ -1,14 +1,11 @@
|
||||
/*
|
||||
* SNMP discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2014 by Apple Inc.
|
||||
* Copyright © 2006-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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+12
-13
@@ -1,14 +1,11 @@
|
||||
/*
|
||||
* AppSocket backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -21,7 +18,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <winsock.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
@@ -30,7 +27,7 @@
|
||||
# include <netinet/in.h>
|
||||
# include <arpa/inet.h>
|
||||
# include <netdb.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -400,8 +397,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."));
|
||||
@@ -409,7 +408,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...
|
||||
@@ -446,7 +445,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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
/*
|
||||
* IEEE-1284 support functions test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2010 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -16,12 +13,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,14 +1,11 @@
|
||||
/*
|
||||
* Backend test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2014 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -36,7 +33,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);
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
/*
|
||||
* SNMP supplies test program for CUPS.
|
||||
*
|
||||
* Copyright 2008-2011 by Apple Inc.
|
||||
* 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -290,10 +290,10 @@ static void status_timer_cb(CFRunLoopTimerRef timer, void *info);
|
||||
|
||||
#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);
|
||||
@@ -2009,7 +2009,7 @@ static void parse_options(char *options,
|
||||
value);
|
||||
}
|
||||
else if (!_cups_strcasecmp(name, "serial"))
|
||||
strlcpy(serial, value, serial_size);
|
||||
strlcpy(serial, value, (size_t)serial_size);
|
||||
else if (!_cups_strcasecmp(name, "location") && location)
|
||||
*location = (UInt32)strtoul(value, NULL, 16);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* LIBUSB interface code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007-2019 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -1742,8 +1743,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, <))
|
||||
|
||||
@@ -3,14 +3,11 @@
|
||||
*
|
||||
* This file is included from "usb.c" when compiled on UNIX/Linux.
|
||||
*
|
||||
* Copyright 2007-2013 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2013 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+6
-9
@@ -1,14 +1,11 @@
|
||||
/*
|
||||
* USB printer backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2012 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -22,13 +19,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 */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+21
-22
@@ -1,25 +1,24 @@
|
||||
lpc.o: lpc.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
|
||||
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h
|
||||
lpq.o: lpq.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
|
||||
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h
|
||||
lpr.o: lpr.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/array-private.h \
|
||||
../cups/array.h ../cups/ipp-private.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/http-private.h ../cups/language.h ../cups/md5-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h
|
||||
lprm.o: lprm.c ../cups/cups-private.h ../cups/string-private.h \
|
||||
../config.h ../cups/debug-private.h ../cups/versioning.h \
|
||||
../cups/array-private.h ../cups/array.h ../cups/ipp-private.h \
|
||||
../cups/ipp.h ../cups/http.h ../cups/http-private.h ../cups/language.h \
|
||||
../cups/md5-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/pwg-private.h ../cups/cups.h ../cups/file.h ../cups/pwg.h \
|
||||
../cups/thread-private.h
|
||||
lpq.o: lpq.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/thread-private.h
|
||||
lpr.o: lpr.c ../cups/cups-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/ipp-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \
|
||||
../cups/thread-private.h
|
||||
lprm.o: lprm.c ../cups/cups-private.h ../cups/string-private.h \
|
||||
../config.h ../cups/versioning.h ../cups/array-private.h \
|
||||
../cups/array.h ../cups/ipp-private.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/pwg.h \
|
||||
../cups/http-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/pwg-private.h ../cups/thread-private.h
|
||||
|
||||
+9
-5
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Berkeley commands makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 2007-2019 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
@@ -120,7 +120,8 @@ uninstall:
|
||||
|
||||
lpc: lpc.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o lpc lpc.o $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o lpc lpc.o $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -129,7 +130,8 @@ lpc: lpc.o ../cups/$(LIBCUPS)
|
||||
|
||||
lpq: lpq.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o lpq lpq.o $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o lpq lpq.o $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -138,7 +140,8 @@ lpq: lpq.o ../cups/$(LIBCUPS)
|
||||
|
||||
lpr: lpr.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o lpr lpr.o $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o lpr lpr.o $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -147,7 +150,8 @@ lpr: lpr.o ../cups/$(LIBCUPS)
|
||||
|
||||
lprm: lprm.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o lprm lprm.o $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o lprm lprm.o $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -230,8 +230,6 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
};
|
||||
|
||||
|
||||
DEBUG_printf(("show_status(http=%p, dests=\"%s\")\n", http, dests));
|
||||
|
||||
if (http == NULL)
|
||||
return;
|
||||
|
||||
@@ -255,8 +253,6 @@ show_status(http_t *http, /* I - HTTP connection to server */
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
||||
{
|
||||
DEBUG_puts("show_status: request succeeded...");
|
||||
|
||||
/*
|
||||
* Loop through the printers returned in the list and display
|
||||
* their status...
|
||||
|
||||
+16
-10
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* "lpq" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -22,7 +23,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;
|
||||
|
||||
|
||||
/*
|
||||
@@ -67,6 +68,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
interval = atoi(argv[i] + 1);
|
||||
}
|
||||
else if (!strcmp(argv[i], "--help"))
|
||||
usage();
|
||||
else if (argv[i][0] == '-')
|
||||
{
|
||||
for (opt = argv[i] + 1; *opt; opt ++)
|
||||
@@ -348,9 +351,6 @@ show_jobs(const char *command, /* I - Command name */
|
||||
};
|
||||
|
||||
|
||||
DEBUG_printf(("show_jobs(http=%p, dest=%p, user=%p, id=%d, longstatus%d)\n",
|
||||
http, dest, user, id, longstatus));
|
||||
|
||||
if (http == NULL)
|
||||
return (0);
|
||||
|
||||
@@ -638,8 +638,14 @@ show_printer(const char *command, /* I - Command name */
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
_cupsLangPuts(stderr,
|
||||
_("Usage: lpq [-P dest] [-U username] [-h hostname[:port]] "
|
||||
"[-l] [+interval]"));
|
||||
_cupsLangPuts(stderr, _("Usage: lpq [options] [+interval]"));
|
||||
_cupsLangPuts(stdout, _("Options:"));
|
||||
_cupsLangPuts(stdout, _("-a Show jobs on all destinations"));
|
||||
_cupsLangPuts(stdout, _("-E Encrypt the connection to the server"));
|
||||
_cupsLangPuts(stdout, _("-h server[:port] Connect to the named server and port"));
|
||||
_cupsLangPuts(stdout, _("-l Show verbose (long) output"));
|
||||
_cupsLangPuts(stdout, _("-P destination Show status for the specified destination"));
|
||||
_cupsLangPuts(stdout, _("-U username Specify the username to use for authentication"));
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+56
-11
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* "lpr" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -14,6 +15,13 @@
|
||||
#include <cups/cups-private.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void usage(void) _CUPS_NORETURN;
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Parse options and send files for printing.
|
||||
*/
|
||||
@@ -51,7 +59,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
{
|
||||
if (argv[i][0] == '-')
|
||||
if (!strcmp(argv[i], "--help"))
|
||||
usage();
|
||||
else if (argv[i][0] == '-')
|
||||
{
|
||||
for (opt = argv[i] + 1; *opt; opt ++)
|
||||
{
|
||||
@@ -77,7 +87,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected username after \"-U\" option."), argv[0]);
|
||||
return (1);
|
||||
usage();
|
||||
}
|
||||
|
||||
cupsSetUser(argv[i]);
|
||||
@@ -97,7 +107,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected hostname after \"-H\" option."), argv[0]);
|
||||
return (1);
|
||||
usage();
|
||||
}
|
||||
else
|
||||
cupsSetServer(argv[i]);
|
||||
@@ -123,7 +133,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
_cupsLangPrintf(stderr,
|
||||
_("%s: Error - expected value after \"-%c\" "
|
||||
"option."), argv[0], ch);
|
||||
return (1);
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +159,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected option=value after \"-o\" option."), argv[0]);
|
||||
return (1);
|
||||
usage();
|
||||
}
|
||||
|
||||
num_options = cupsParseOptions(argv[i], num_options, &options);
|
||||
@@ -200,7 +210,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected destination after \"-P\" option."), argv[0]);
|
||||
return (1);
|
||||
usage();
|
||||
}
|
||||
|
||||
printer = argv[i];
|
||||
@@ -238,7 +248,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected copies after \"-#\" option."), argv[0]);
|
||||
return (1);
|
||||
usage();
|
||||
}
|
||||
|
||||
num_copies = atoi(argv[i]);
|
||||
@@ -268,7 +278,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected name after \"-%c\" option."), argv[0], ch);
|
||||
return (1);
|
||||
usage();
|
||||
}
|
||||
|
||||
title = argv[i];
|
||||
@@ -408,3 +418,38 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'usage()' - Show program usage and exit.
|
||||
*/
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
_cupsLangPuts(stdout, _("Usage: lpr [options] [file(s)]"));
|
||||
_cupsLangPuts(stdout, _("Options:"));
|
||||
_cupsLangPuts(stdout, _("-# num-copies Specify the number of copies to print"));
|
||||
_cupsLangPuts(stdout, _("-E Encrypt the connection to the server"));
|
||||
_cupsLangPuts(stdout, _("-H server[:port] Connect to the named server and port"));
|
||||
_cupsLangPuts(stdout, _("-m Send an email notification when the job completes"));
|
||||
_cupsLangPuts(stdout, _("-o option[=value] Specify a printer-specific option"));
|
||||
_cupsLangPuts(stdout, _("-o job-sheets=standard Print a banner page with the job"));
|
||||
_cupsLangPuts(stdout, _("-o media=size Specify the media size to use"));
|
||||
_cupsLangPuts(stdout, _("-o number-up=N Specify that input pages should be printed N-up (1, 2, 4, 6, 9, and 16 are supported)"));
|
||||
_cupsLangPuts(stdout, _("-o orientation-requested=N\n"
|
||||
" Specify portrait (3) or landscape (4) orientation"));
|
||||
_cupsLangPuts(stdout, _("-o print-quality=N Specify the print quality - draft (3), normal (4), or best (5)"));
|
||||
_cupsLangPuts(stdout, _("-o sides=one-sided Specify 1-sided printing"));
|
||||
_cupsLangPuts(stdout, _("-o sides=two-sided-long-edge\n"
|
||||
" Specify 2-sided portrait printing"));
|
||||
_cupsLangPuts(stdout, _("-o sides=two-sided-short-edge\n"
|
||||
" Specify 2-sided landscape printing"));
|
||||
_cupsLangPuts(stdout, _("-q Specify the job should be held for printing"));
|
||||
_cupsLangPuts(stdout, _("-r Remove the file(s) after submission"));
|
||||
_cupsLangPuts(stdout, _("-P destination Specify the destination"));
|
||||
_cupsLangPuts(stdout, _("-T title Specify the job title"));
|
||||
_cupsLangPuts(stdout, _("-U username Specify the username to use for authentication"));
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+37
-7
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* "lprm" command for CUPS.
|
||||
*
|
||||
* Copyright 2007-2016 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -14,6 +15,13 @@
|
||||
#include <cups/cups-private.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void usage(void) _CUPS_NORETURN;
|
||||
|
||||
|
||||
/*
|
||||
* 'main()' - Parse options and cancel jobs.
|
||||
*/
|
||||
@@ -48,7 +56,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
for (i = 1; i < argc; i ++)
|
||||
{
|
||||
if (argv[i][0] == '-' && argv[i][1] != '\0')
|
||||
if (!strcmp(argv[i], "--help"))
|
||||
usage();
|
||||
else if (argv[i][0] == '-' && argv[i][1] != '\0')
|
||||
{
|
||||
for (opt = argv[i] + 1; *opt; opt ++)
|
||||
{
|
||||
@@ -98,7 +108,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected username after \"-U\" option."), argv[0]);
|
||||
goto error;
|
||||
usage();
|
||||
}
|
||||
|
||||
cupsSetUser(argv[i]);
|
||||
@@ -118,7 +128,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (i >= argc)
|
||||
{
|
||||
_cupsLangPrintf(stderr, _("%s: Error - expected hostname after \"-h\" option."), argv[0]);
|
||||
goto error;
|
||||
usage();
|
||||
}
|
||||
else
|
||||
cupsSetServer(argv[i]);
|
||||
@@ -133,7 +143,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
default :
|
||||
_cupsLangPrintf(stderr, _("%s: Error - unknown option \"%c\"."), argv[0], *opt);
|
||||
goto error;
|
||||
usage();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,3 +218,23 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'usage()' - Show program usage and exit.
|
||||
*/
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
_cupsLangPuts(stdout, _("Usage: lprm [options] [id]\n"
|
||||
" lprm [options] -"));
|
||||
_cupsLangPuts(stdout, _("Options:"));
|
||||
_cupsLangPuts(stdout, _("- Cancel all jobs"));
|
||||
_cupsLangPuts(stdout, _("-E Encrypt the connection to the server"));
|
||||
_cupsLangPuts(stdout, _("-h server[:port] Connect to the named server and port"));
|
||||
_cupsLangPuts(stdout, _("-P destination Specify the destination"));
|
||||
_cupsLangPuts(stdout, _("-U username Specify the username to use for authentication"));
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+26
-28
@@ -1,68 +1,66 @@
|
||||
help-index.o: help-index.c cgi-private.h cgi.h ../cups/cups.h \
|
||||
../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/array.h ../cups/language.h ../cups/pwg.h help-index.h \
|
||||
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h \
|
||||
../cups/debug-private.h ../cups/language-private.h ../config.h \
|
||||
../cups/transcode.h ../cups/string-private.h ../cups/ipp-private.h \
|
||||
../cups/dir.h
|
||||
html.o: html.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
../cups/language-private.h ../config.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../cups/ipp-private.h
|
||||
ipp-var.o: ipp-var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
../cups/language-private.h ../config.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../cups/ipp-private.h
|
||||
search.o: search.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
../cups/language-private.h ../config.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../cups/ipp-private.h
|
||||
template.o: template.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
../cups/language-private.h ../config.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../cups/ipp-private.h
|
||||
var.o: var.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h \
|
||||
../cups/md5-private.h
|
||||
../cups/language-private.h ../config.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../cups/ipp-private.h
|
||||
admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h \
|
||||
../cups/http-private.h ../cups/md5-private.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h ../cups/raster.h ../cups/pwg-private.h \
|
||||
../cups/adminutil.h
|
||||
../cups/language-private.h ../config.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../cups/ipp-private.h ../cups/http-private.h \
|
||||
../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h \
|
||||
../cups/pwg-private.h ../cups/adminutil.h
|
||||
classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
../cups/language-private.h ../config.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../cups/ipp-private.h
|
||||
help.o: help.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
../cups/language-private.h ../config.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../cups/ipp-private.h
|
||||
jobs.o: jobs.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
../cups/language-private.h ../config.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../cups/ipp-private.h
|
||||
makedocset.o: makedocset.c cgi-private.h cgi.h ../cups/cups.h \
|
||||
../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/array.h ../cups/language.h ../cups/pwg.h help-index.h \
|
||||
../cups/debug-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
../cups/debug-private.h ../cups/language-private.h ../config.h \
|
||||
../cups/transcode.h ../cups/string-private.h ../cups/ipp-private.h
|
||||
printers.o: printers.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../config.h ../cups/ipp-private.h
|
||||
../cups/language-private.h ../config.h ../cups/transcode.h \
|
||||
../cups/string-private.h ../cups/ipp-private.h
|
||||
testcgi.o: testcgi.c cgi.h ../cups/cups.h ../cups/file.h \
|
||||
../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \
|
||||
../cups/language.h ../cups/pwg.h help-index.h
|
||||
|
||||
+30
-114
@@ -1,10 +1,11 @@
|
||||
#
|
||||
# CGI makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products.
|
||||
# Copyright © 2007-2019 by Apple Inc.
|
||||
# Copyright © 1997-2006 by Easy Software Products.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
@@ -34,8 +35,7 @@ CGIS = \
|
||||
jobs.cgi \
|
||||
printers.cgi
|
||||
LIBTARGETS = \
|
||||
libcupscgi.a \
|
||||
$(LIBCUPSCGI)
|
||||
libcupscgi.a
|
||||
|
||||
UNITTARGETS = \
|
||||
testcgi \
|
||||
@@ -58,7 +58,7 @@ all: $(TARGETS)
|
||||
# Make library targets...
|
||||
#
|
||||
|
||||
libs: $(LIBTARGETS) $(UNITTESTS)
|
||||
libs:
|
||||
|
||||
|
||||
#
|
||||
@@ -74,7 +74,6 @@ unittests: $(UNITTARGETS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS) makedocset
|
||||
$(RM) libcupscgi.so libcupscgi.dylib
|
||||
|
||||
|
||||
#
|
||||
@@ -122,42 +121,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:
|
||||
|
||||
|
||||
#
|
||||
@@ -169,54 +139,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 $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
|
||||
-version-info 1:0 $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -234,56 +156,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 $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ admin.o -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ admin.o libcupscgi.a $(LINKCUPS)
|
||||
$(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 $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ classes.o -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ classes.o libcupscgi.a $(LINKCUPS)
|
||||
$(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 $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ help.o -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ help.o libcupscgi.a $(LINKCUPS)
|
||||
$(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 $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ jobs.o -lcupscgi $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
# makedocset
|
||||
#
|
||||
|
||||
makedocset: makedocset.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ makedocset.o libcupscgi.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ jobs.o libcupscgi.a $(LINKCUPS)
|
||||
$(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 $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ printers.o -L. -lcupscgi $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ printers.o libcupscgi.a $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -292,9 +208,9 @@ printers.cgi: printers.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
|
||||
|
||||
testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcgi.o libcupscgi.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testcgi.o libcupscgi.a \
|
||||
$(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Testing CGI API...
|
||||
./testcgi
|
||||
|
||||
@@ -305,9 +221,9 @@ testcgi: testcgi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhi.o libcupscgi.a \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(LIBZ) $(LIBGSSAPI)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testhi.o libcupscgi.a \
|
||||
$(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Testing help index API...
|
||||
./testhi
|
||||
|
||||
@@ -318,8 +234,8 @@ testhi: testhi.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
|
||||
testtemplate: testtemplate.o ../Makedefs libcupscgi.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testtemplate.o libcupscgi.a ../cups/$(LIBCUPSSTATIC) \
|
||||
$(COMMONLIBS) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ) $(LIBGSSAPI)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testtemplate.o libcupscgi.a $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
|
||||
+20
-203
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Administration CGI for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -40,7 +41,6 @@ static void do_am_printer(http_t *http, int modify);
|
||||
static void do_config_server(http_t *http);
|
||||
static void do_delete_class(http_t *http);
|
||||
static void do_delete_printer(http_t *http);
|
||||
static void do_export(http_t *http);
|
||||
static void do_list_printers(http_t *http);
|
||||
static void do_menu(http_t *http);
|
||||
static void do_set_allowed_users(http_t *http);
|
||||
@@ -163,8 +163,6 @@ main(void)
|
||||
do_set_options(http, 0);
|
||||
else if (!strcmp(op, "config-server"))
|
||||
do_config_server(http);
|
||||
else if (!strcmp(op, "export-samba"))
|
||||
do_export(http);
|
||||
else
|
||||
{
|
||||
/*
|
||||
@@ -561,7 +559,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));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -928,6 +926,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"))
|
||||
{
|
||||
/*
|
||||
@@ -1073,9 +1073,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();
|
||||
}
|
||||
@@ -1936,141 +1935,6 @@ do_delete_printer(http_t *http) /* I - HTTP connection */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'do_export()' - Export printers to Samba.
|
||||
*/
|
||||
|
||||
static void
|
||||
do_export(http_t *http) /* I - HTTP connection */
|
||||
{
|
||||
int i, j; /* Looping vars */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
const char *username, /* Samba username */
|
||||
*password, /* Samba password */
|
||||
*export_all; /* Export all printers? */
|
||||
int export_count, /* Number of printers to export */
|
||||
printer_count; /* Number of available printers */
|
||||
const char *name, /* What name to pull */
|
||||
*dest; /* Current destination */
|
||||
char ppd[1024]; /* PPD file */
|
||||
|
||||
|
||||
/*
|
||||
* Get form data...
|
||||
*/
|
||||
|
||||
username = cgiGetVariable("USERNAME");
|
||||
password = cgiGetVariable("PASSWORD");
|
||||
export_all = cgiGetVariable("EXPORT_ALL");
|
||||
export_count = cgiGetSize("EXPORT_NAME");
|
||||
|
||||
/*
|
||||
* Get list of available printers...
|
||||
*/
|
||||
|
||||
cgiSetSize("PRINTER_NAME", 0);
|
||||
cgiSetSize("PRINTER_EXPORT", 0);
|
||||
|
||||
request = ippNewRequest(CUPS_GET_PRINTERS);
|
||||
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM,
|
||||
"printer-type", 0);
|
||||
|
||||
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM,
|
||||
"printer-type-mask", CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", NULL, "printer-name");
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
||||
{
|
||||
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
|
||||
ippDelete(response);
|
||||
|
||||
if (!export_all)
|
||||
{
|
||||
printer_count = cgiGetSize("PRINTER_NAME");
|
||||
|
||||
for (i = 0; i < printer_count; i ++)
|
||||
{
|
||||
dest = cgiGetArray("PRINTER_NAME", i);
|
||||
|
||||
for (j = 0; j < export_count; j ++)
|
||||
if (!_cups_strcasecmp(dest, cgiGetArray("EXPORT_NAME", j)))
|
||||
break;
|
||||
|
||||
cgiSetArray("PRINTER_EXPORT", i, j < export_count ? "Y" : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Export or get the printers to export...
|
||||
*/
|
||||
|
||||
if (username && *username && password && *password &&
|
||||
(export_all || export_count > 0))
|
||||
{
|
||||
/*
|
||||
* Do export...
|
||||
*/
|
||||
|
||||
fputs("DEBUG: Export printers...\n", stderr);
|
||||
|
||||
if (export_all)
|
||||
{
|
||||
name = "PRINTER_NAME";
|
||||
export_count = cgiGetSize("PRINTER_NAME");
|
||||
}
|
||||
else
|
||||
name = "EXPORT_NAME";
|
||||
|
||||
for (i = 0; i < export_count; i ++)
|
||||
{
|
||||
dest = cgiGetArray(name, i);
|
||||
|
||||
if (!cupsAdminCreateWindowsPPD(http, dest, ppd, sizeof(ppd)))
|
||||
break;
|
||||
|
||||
j = cupsAdminExportSamba(dest, ppd, "localhost", username, password,
|
||||
stderr);
|
||||
|
||||
unlink(ppd);
|
||||
|
||||
if (!j)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < export_count)
|
||||
cgiSetVariable("ERROR", cupsLastErrorString());
|
||||
else
|
||||
{
|
||||
cgiStartHTML(cgiText(_("Export Printers to Samba")));
|
||||
cgiCopyTemplateLang("samba-exported.tmpl");
|
||||
cgiEndHTML();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (username && !*username)
|
||||
cgiSetVariable("ERROR",
|
||||
cgiText(_("A Samba username is required to export "
|
||||
"printer drivers")));
|
||||
else if (username && (!password || !*password))
|
||||
cgiSetVariable("ERROR",
|
||||
cgiText(_("A Samba password is required to export "
|
||||
"printer drivers")));
|
||||
|
||||
/*
|
||||
* Show form...
|
||||
*/
|
||||
|
||||
cgiStartHTML(cgiText(_("Export Printers to Samba")));
|
||||
cgiCopyTemplateLang("samba-export.tmpl");
|
||||
cgiEndHTML();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'do_list_printers()' - List available printers.
|
||||
*/
|
||||
@@ -2121,7 +1985,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));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2259,7 +2123,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);
|
||||
}
|
||||
@@ -2285,10 +2149,6 @@ do_menu(http_t *http) /* I - HTTP connection */
|
||||
int num_settings; /* Number of server settings */
|
||||
cups_option_t *settings; /* Server settings */
|
||||
const char *val; /* Setting value */
|
||||
char filename[1024]; /* Temporary filename */
|
||||
const char *datadir; /* Location of data files */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
|
||||
|
||||
/*
|
||||
@@ -2382,55 +2242,6 @@ do_menu(http_t *http) /* I - HTTP connection */
|
||||
|
||||
cupsFreeOptions(num_settings, settings);
|
||||
|
||||
/*
|
||||
* See if Samba and the Windows drivers are installed...
|
||||
*/
|
||||
|
||||
if ((datadir = getenv("CUPS_DATADIR")) == NULL)
|
||||
datadir = CUPS_DATADIR;
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/drivers/pscript5.dll", datadir);
|
||||
if (!access(filename, R_OK))
|
||||
{
|
||||
/*
|
||||
* Found Windows 2000 driver file, see if we have smbclient and
|
||||
* rpcclient...
|
||||
*/
|
||||
|
||||
if (cupsFileFind("smbclient", getenv("PATH"), 1, filename,
|
||||
sizeof(filename)) &&
|
||||
cupsFileFind("rpcclient", getenv("PATH"), 1, filename,
|
||||
sizeof(filename)))
|
||||
cgiSetVariable("HAVE_SAMBA", "Y");
|
||||
else
|
||||
{
|
||||
if (!cupsFileFind("smbclient", getenv("PATH"), 1, filename,
|
||||
sizeof(filename)))
|
||||
fputs("ERROR: smbclient not found!\n", stderr);
|
||||
|
||||
if (!cupsFileFind("rpcclient", getenv("PATH"), 1, filename,
|
||||
sizeof(filename)))
|
||||
fputs("ERROR: rpcclient not found!\n", stderr);
|
||||
}
|
||||
}
|
||||
else
|
||||
perror(filename);
|
||||
|
||||
/*
|
||||
* Subscriptions...
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_GET_SUBSCRIPTIONS);
|
||||
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
|
||||
NULL, "ipp://localhost/");
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
||||
{
|
||||
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
|
||||
ippDelete(response);
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally, show the main menu template...
|
||||
*/
|
||||
@@ -2656,7 +2467,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...
|
||||
@@ -3465,8 +3276,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,
|
||||
@@ -3928,6 +3739,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"
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
@@ -3968,6 +3784,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
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* CGI support library definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CGI_H_
|
||||
@@ -15,12 +16,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>
|
||||
@@ -66,14 +67,14 @@ extern void cgiEndMultipart(void);
|
||||
extern char *cgiFormEncode(char *dst, const char *src,
|
||||
size_t dstsize);
|
||||
extern void cgiFreeSearch(void *search);
|
||||
extern const char *cgiGetArray(const char *name, int element);
|
||||
extern char *cgiGetArray(const char *name, int element);
|
||||
extern void cgiGetAttributes(ipp_t *request, const char *tmpl);
|
||||
extern const char *cgiGetCookie(const char *name);
|
||||
extern const cgi_file_t *cgiGetFile(void);
|
||||
extern cups_array_t *cgiGetIPPObjects(ipp_t *response, void *search);
|
||||
extern int cgiGetSize(const char *name);
|
||||
extern char *cgiGetTemplateDir(void);
|
||||
extern const char *cgiGetVariable(const char *name);
|
||||
extern char *cgiGetVariable(const char *name);
|
||||
extern int cgiInitialize(void);
|
||||
extern int cgiIsPOST(void);
|
||||
extern void cgiMoveJobs(http_t *http, const char *dest, int job_id);
|
||||
|
||||
+8
-50
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Online help index routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -134,11 +135,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);
|
||||
@@ -154,8 +151,6 @@ helpDeleteIndex(help_index_t *hi) /* I - Help index */
|
||||
help_node_t *node; /* Current node */
|
||||
|
||||
|
||||
DEBUG_printf(("helpDeleteIndex(hi=%p)", hi));
|
||||
|
||||
if (!hi)
|
||||
return;
|
||||
|
||||
@@ -186,9 +181,6 @@ helpFindNode(help_index_t *hi, /* I - Index */
|
||||
help_node_t key; /* Search key */
|
||||
|
||||
|
||||
DEBUG_printf(("helpFindNode(hi=%p, filename=\"%s\", anchor=\"%s\")",
|
||||
hi, filename, anchor));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -236,9 +228,6 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
help_word_t *word; /* Current word */
|
||||
|
||||
|
||||
DEBUG_printf(("helpLoadIndex(hifile=\"%s\", directory=\"%s\")",
|
||||
hifile, directory));
|
||||
|
||||
/*
|
||||
* Create a new, empty index.
|
||||
*/
|
||||
@@ -352,6 +341,8 @@ helpLoadIndex(const char *hifile, /* I - Index filename */
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
}
|
||||
else
|
||||
section[0] = '\0';
|
||||
|
||||
if (*ptr != '\"')
|
||||
break;
|
||||
@@ -441,8 +432,6 @@ helpSaveIndex(help_index_t *hi, /* I - Index */
|
||||
help_word_t *word; /* Current word */
|
||||
|
||||
|
||||
DEBUG_printf(("helpSaveIndex(hi=%p, hifile=\"%s\")", hi, hifile));
|
||||
|
||||
/*
|
||||
* Try creating a new index file...
|
||||
*/
|
||||
@@ -522,9 +511,6 @@ helpSearchIndex(help_index_t *hi, /* I - Index */
|
||||
int matches; /* Number of matches */
|
||||
|
||||
|
||||
DEBUG_printf(("helpSearchIndex(hi=%p, query=\"%s\", filename=\"%s\")",
|
||||
hi, query, filename));
|
||||
|
||||
/*
|
||||
* Range check...
|
||||
*/
|
||||
@@ -646,8 +632,6 @@ help_add_word(help_node_t *n, /* I - Node */
|
||||
key; /* Search key */
|
||||
|
||||
|
||||
DEBUG_printf(("2help_add_word(n=%p, text=\"%s\")", n, text));
|
||||
|
||||
/*
|
||||
* Create the words array as needed...
|
||||
*/
|
||||
@@ -699,8 +683,6 @@ help_delete_node(help_node_t *n) /* I - Node */
|
||||
help_word_t *w; /* Current word */
|
||||
|
||||
|
||||
DEBUG_printf(("2help_delete_node(n=%p)", n));
|
||||
|
||||
if (!n)
|
||||
return;
|
||||
|
||||
@@ -734,8 +716,6 @@ help_delete_node(help_node_t *n) /* I - Node */
|
||||
static void
|
||||
help_delete_word(help_word_t *w) /* I - Word */
|
||||
{
|
||||
DEBUG_printf(("2help_delete_word(w=%p)", w));
|
||||
|
||||
if (!w)
|
||||
return;
|
||||
|
||||
@@ -765,9 +745,6 @@ help_load_directory(
|
||||
help_node_t *node; /* Current node */
|
||||
|
||||
|
||||
DEBUG_printf(("2help_load_directory(hi=%p, directory=\"%s\", relative=\"%s\")",
|
||||
hi, directory, relative));
|
||||
|
||||
/*
|
||||
* Open the directory and scan it...
|
||||
*/
|
||||
@@ -877,9 +854,6 @@ help_load_file(
|
||||
int wordlen; /* Length of word */
|
||||
|
||||
|
||||
DEBUG_printf(("2help_load_file(hi=%p, filename=\"%s\", relative=\"%s\", "
|
||||
"mtime=%ld)", hi, filename, relative, (long)mtime));
|
||||
|
||||
if ((fp = cupsFileOpen(filename, "r")) == NULL)
|
||||
return (-1);
|
||||
|
||||
@@ -1211,17 +1185,13 @@ help_new_node(const char *filename, /* I - Filename */
|
||||
help_node_t *n; /* Node */
|
||||
|
||||
|
||||
DEBUG_printf(("2help_new_node(filename=\"%s\", anchor=\"%s\", text=\"%s\", "
|
||||
"mtime=%ld, offset=%ld, length=%ld)", filename, anchor, text,
|
||||
(long)mtime, (long)offset, (long)length));
|
||||
|
||||
n = (help_node_t *)calloc(1, sizeof(help_node_t));
|
||||
if (!n)
|
||||
return (NULL);
|
||||
|
||||
n->filename = strdup(filename);
|
||||
n->anchor = anchor ? strdup(anchor) : NULL;
|
||||
n->section = *section ? strdup(section) : NULL;
|
||||
n->section = (section && *section) ? strdup(section) : NULL;
|
||||
n->text = strdup(text);
|
||||
n->mtime = mtime;
|
||||
n->offset = offset;
|
||||
@@ -1242,10 +1212,6 @@ help_sort_by_name(help_node_t *n1, /* I - First node */
|
||||
int diff; /* Difference */
|
||||
|
||||
|
||||
DEBUG_printf(("2help_sort_by_name(n1=%p(%s#%s), n2=%p(%s#%s)",
|
||||
n1, n1->filename, n1->anchor,
|
||||
n2, n2->filename, n2->anchor));
|
||||
|
||||
if ((diff = strcmp(n1->filename, n2->filename)) != 0)
|
||||
return (diff);
|
||||
|
||||
@@ -1271,11 +1237,6 @@ help_sort_by_score(help_node_t *n1, /* I - First node */
|
||||
int diff; /* Difference */
|
||||
|
||||
|
||||
DEBUG_printf(("2help_sort_by_score(n1=%p(%d \"%s\" \"%s\"), "
|
||||
"n2=%p(%d \"%s\" \"%s\")",
|
||||
n1, n1->score, n1->section, n1->text,
|
||||
n2, n2->score, n2->section, n2->text));
|
||||
|
||||
if (n1->score != n2->score)
|
||||
return (n2->score - n1->score);
|
||||
|
||||
@@ -1299,8 +1260,5 @@ static int /* O - Difference */
|
||||
help_sort_words(help_word_t *w1, /* I - Second word */
|
||||
help_word_t *w2) /* I - Second word */
|
||||
{
|
||||
DEBUG_printf(("2help_sort_words(w1=%p(\"%s\"), w2=%p(\"%s\"))",
|
||||
w1, w1->text, w2, w2->text));
|
||||
|
||||
return (_cups_strcasecmp(w1->text, w2->text));
|
||||
}
|
||||
|
||||
+4
-6
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Search routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -35,8 +36,6 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
char *lword; /* Last word in query */
|
||||
|
||||
|
||||
DEBUG_printf(("cgiCompileSearch(query=\"%s\")\n", query));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
@@ -292,8 +291,6 @@ cgiCompileSearch(const char *query) /* I - Query string */
|
||||
* Compile the regular expression...
|
||||
*/
|
||||
|
||||
DEBUG_printf((" s=\"%s\"\n", s));
|
||||
|
||||
if (regcomp(re, s, REG_EXTENDED | REG_ICASE))
|
||||
{
|
||||
free(re);
|
||||
@@ -361,4 +358,5 @@ void
|
||||
cgiFreeSearch(void *search) /* I - Search context */
|
||||
{
|
||||
regfree((regex_t *)search);
|
||||
free(search);
|
||||
}
|
||||
|
||||
+47
-61
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -29,10 +30,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;
|
||||
|
||||
|
||||
@@ -113,7 +114,12 @@ cgiCheckVariables(const char *names) /* I - Variables to look for */
|
||||
return (0);
|
||||
|
||||
if (*val == '\0')
|
||||
{
|
||||
free((void *)val);
|
||||
return (0); /* Can't be blank, either! */
|
||||
}
|
||||
|
||||
free((void *)val);
|
||||
}
|
||||
|
||||
return (1);
|
||||
@@ -135,10 +141,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;
|
||||
@@ -151,7 +157,7 @@ cgiClearVariables(void)
|
||||
* 'cgiGetArray()' - Get an element from a form array.
|
||||
*/
|
||||
|
||||
const char * /* O - Element value or NULL */
|
||||
char * /* O - Element value or NULL */
|
||||
cgiGetArray(const char *name, /* I - Name of array variable */
|
||||
int element) /* I - Element number (0 to N) */
|
||||
{
|
||||
@@ -164,7 +170,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]));
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +220,7 @@ cgiGetSize(const char *name) /* I - Name of variable */
|
||||
* array of values, returns the last element.
|
||||
*/
|
||||
|
||||
const char * /* O - Value of variable */
|
||||
char * /* O - Value of variable */
|
||||
cgiGetVariable(const char *name) /* I - Name of variable */
|
||||
{
|
||||
const _cgi_var_t *var; /* Returned variable */
|
||||
@@ -222,15 +228,7 @@ cgiGetVariable(const char *name) /* I - Name of variable */
|
||||
|
||||
var = cgi_find_variable(name);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (var == NULL)
|
||||
DEBUG_printf(("cgiGetVariable(\"%s\") is returning NULL...\n", name));
|
||||
else
|
||||
DEBUG_printf(("cgiGetVariable(\"%s\") is returning \"%s\"...\n", name,
|
||||
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]));
|
||||
}
|
||||
|
||||
|
||||
@@ -320,11 +318,18 @@ cgiInitialize(void)
|
||||
else
|
||||
fputs("DEBUG: " CUPS_SID " form variable is not present.\n", stderr);
|
||||
|
||||
free((void *)cups_sid_form);
|
||||
|
||||
cgiClearVariables();
|
||||
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
free((void *)cups_sid_form);
|
||||
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
return (0);
|
||||
@@ -378,10 +383,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;
|
||||
|
||||
@@ -397,9 +401,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,10 +460,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;
|
||||
|
||||
@@ -476,7 +479,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;
|
||||
@@ -511,9 +514,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;
|
||||
}
|
||||
}
|
||||
@@ -534,9 +537,6 @@ cgi_add_variable(const char *name, /* I - Variable name */
|
||||
if (name == NULL || value == NULL || element < 0 || element > 100000)
|
||||
return;
|
||||
|
||||
DEBUG_printf(("cgi_add_variable: Adding variable \'%s\' with value "
|
||||
"\'%s\'...\n", name, value));
|
||||
|
||||
if (form_count >= form_alloc)
|
||||
{
|
||||
_cgi_var_t *temp_vars; /* Temporary form pointer */
|
||||
@@ -559,10 +559,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 ++;
|
||||
}
|
||||
@@ -594,7 +594,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));
|
||||
@@ -715,8 +715,6 @@ cgi_initialize_get(void)
|
||||
char *data; /* Pointer to form data string */
|
||||
|
||||
|
||||
DEBUG_puts("cgi_initialize_get: Initializing variables using GET method...");
|
||||
|
||||
/*
|
||||
* Check to see if there is anything for us to read...
|
||||
*/
|
||||
@@ -756,8 +754,6 @@ cgi_initialize_multipart(
|
||||
size_t blen; /* Length of boundary string */
|
||||
|
||||
|
||||
DEBUG_printf(("cgi_initialize_multipart(boundary=\"%s\")\n", boundary));
|
||||
|
||||
/*
|
||||
* Read multipart form data until we run out...
|
||||
*/
|
||||
@@ -885,12 +881,13 @@ cgi_initialize_multipart(
|
||||
if (line[0])
|
||||
cgiSetArray(name, atoi(ptr) - 1, line);
|
||||
}
|
||||
else if (cgiGetVariable(name))
|
||||
else if ((ptr = cgiGetVariable(name)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Add another element in the array...
|
||||
*/
|
||||
|
||||
free(ptr);
|
||||
cgiSetArray(name, cgiGetSize(name), line);
|
||||
}
|
||||
else
|
||||
@@ -970,8 +967,6 @@ cgi_initialize_post(void)
|
||||
int status; /* Return status */
|
||||
|
||||
|
||||
DEBUG_puts("cgi_initialize_post: Initializing variables using POST method...");
|
||||
|
||||
/*
|
||||
* Check to see if there is anything for us to read...
|
||||
*/
|
||||
@@ -1047,7 +1042,8 @@ cgi_initialize_string(const char *data) /* I - Form data string */
|
||||
char *s, /* Pointer to current form string */
|
||||
ch, /* Temporary character */
|
||||
name[255], /* Name of form variable */
|
||||
value[65536]; /* Variable value */
|
||||
value[65536], /* Variable value */
|
||||
*temp; /* Temporary pointer */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1149,8 +1145,11 @@ cgi_initialize_string(const char *data) /* I - Form data string */
|
||||
if (value[0])
|
||||
cgiSetArray(name, atoi(s) - 1, value);
|
||||
}
|
||||
else if (cgiGetVariable(name) != NULL)
|
||||
else if ((temp = cgiGetVariable(name)) != NULL)
|
||||
{
|
||||
free(temp);
|
||||
cgiSetArray(name, cgiGetSize(name), value);
|
||||
}
|
||||
else
|
||||
cgiSetVariable(name, value);
|
||||
}
|
||||
@@ -1203,6 +1202,7 @@ cgi_set_sid(void)
|
||||
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)
|
||||
@@ -1212,7 +1212,8 @@ 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,
|
||||
@@ -1234,26 +1235,11 @@ cgi_set_sid(void)
|
||||
static void
|
||||
cgi_sort_variables(void)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
int i;
|
||||
|
||||
|
||||
DEBUG_puts("cgi_sort_variables: Sorting variables...");
|
||||
#endif /* DEBUG */
|
||||
|
||||
if (form_count < 2)
|
||||
return;
|
||||
|
||||
qsort(form_vars, (size_t)form_count, sizeof(_cgi_var_t),
|
||||
(int (*)(const void *, const void *))cgi_compare_variables);
|
||||
|
||||
#ifdef DEBUG
|
||||
DEBUG_puts("cgi_sort_variables: Sorted variable list is:");
|
||||
for (i = 0; i < form_count; i ++)
|
||||
DEBUG_printf(("cgi_sort_variables: %d: %s (%d) = \"%s\" ...\n", i,
|
||||
form_vars[i].name, form_vars[i].nvalues,
|
||||
form_vars[i].values[0]));
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,14 +5,11 @@
|
||||
#
|
||||
# Base MIME conversions file for CUPS.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
# Copyright © 2007-2016 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/".
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
########################################################################
|
||||
|
||||
+4
-7
@@ -5,14 +5,11 @@
|
||||
# VERSIONS OF CUPS. Instead, create a "local.types" file that
|
||||
# reflects your local configuration changes.
|
||||
#
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2007 by Easy Software Products.
|
||||
# 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/".
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
########################################################################
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
dnl
|
||||
dnl Common configuration stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright © 2007-2019 by Apple Inc.
|
||||
dnl Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
dnl information.
|
||||
dnl
|
||||
|
||||
dnl Set the name of the config header file...
|
||||
@@ -139,16 +140,6 @@ AC_CHECK_HEADER(iconv.h,
|
||||
SAVELIBS="$SAVELIBS $LIBS")
|
||||
LIBS="$SAVELIBS")
|
||||
|
||||
dnl Checks for Mini-XML (www.minixml.org)...
|
||||
LIBMXML=""
|
||||
AC_CHECK_HEADER(mxml.h,
|
||||
SAVELIBS="$LIBS"
|
||||
AC_SEARCH_LIBS(mmxlNewElement,mxml,
|
||||
AC_DEFINE(HAVE_MXML_H)
|
||||
LIBMXML="-lmxml")
|
||||
LIBS="$SAVELIBS")
|
||||
AC_SUBST(LIBMXML)
|
||||
|
||||
dnl Checks for statfs and its many headers...
|
||||
AC_CHECK_HEADER(sys/mount.h,AC_DEFINE(HAVE_SYS_MOUNT_H))
|
||||
AC_CHECK_HEADER(sys/statfs.h,AC_DEFINE(HAVE_SYS_STATFS_H))
|
||||
@@ -348,20 +339,21 @@ 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"
|
||||
LIBS="-framework CoreFoundation -framework Security $LIBS"
|
||||
|
||||
dnl Check for framework headers...
|
||||
AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h,AC_DEFINE(HAVE_APPLICATIONSERVICES_H))
|
||||
AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
|
||||
AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
|
||||
AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
|
||||
|
||||
dnl Check for dynamic store function...
|
||||
AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName)
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS="-framework SystemConfiguration $LIBS"
|
||||
AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName,[
|
||||
AC_DEFINE(HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME)],[
|
||||
LIBS="$SAVELIBS"])
|
||||
|
||||
dnl Check for the new membership functions in MacOSX 10.4...
|
||||
AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
|
||||
AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
|
||||
AC_CHECK_FUNCS(mbr_uid_to_uuid)
|
||||
|
||||
dnl Need <dlfcn.h> header...
|
||||
@@ -395,7 +387,6 @@ case $host_os_name in
|
||||
else
|
||||
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 $host_os_version -ge 100; then
|
||||
@@ -416,8 +407,6 @@ case $host_os_name in
|
||||
AC_CHECK_HEADER(xpc/xpc.h,
|
||||
AC_DEFINE(HAVE_XPC)
|
||||
INSTALLXPC="install-xpc")
|
||||
AC_CHECK_HEADER(xpc/private.h,
|
||||
AC_DEFINE(HAVE_XPC_PRIVATE_H))
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -432,16 +421,47 @@ COMPONENTS="all"
|
||||
|
||||
AC_ARG_WITH(components, [ --with-components set components to build:
|
||||
- "all" (default) builds everything
|
||||
- "core" builds libcups and ipptool],
|
||||
- "core" builds libcups and ipptool
|
||||
- "libcups" builds just libcups
|
||||
- "libcupslite" builds just libcups without driver support],
|
||||
COMPONENTS="$withval")
|
||||
|
||||
cupsimagebase="cupsimage"
|
||||
IPPEVECOMMANDS="ippevepcl ippeveps"
|
||||
LIBCUPSOBJS="\$(COREOBJS) \$(DRIVEROBJS)"
|
||||
LIBHEADERS="\$(COREHEADERS) \$(DRIVERHEADERS)"
|
||||
LIBHEADERSPRIV="\$(COREHEADERSPRIV) \$(DRIVERHEADERSPRIV)"
|
||||
|
||||
case "$COMPONENTS" in
|
||||
all)
|
||||
BUILDDIRS="filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
|
||||
BUILDDIRS="tools filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
|
||||
;;
|
||||
|
||||
core)
|
||||
BUILDDIRS="data locale"
|
||||
BUILDDIRS="tools examples locale"
|
||||
;;
|
||||
|
||||
corelite)
|
||||
AC_DEFINE(CUPS_LITE)
|
||||
BUILDDIRS="tools examples locale"
|
||||
cupsimagebase=""
|
||||
LIBCUPSOBJS="\$(COREOBJS)"
|
||||
LIBHEADERS="\$(COREHEADERS)"
|
||||
LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
|
||||
;;
|
||||
|
||||
libcups)
|
||||
BUILDDIRS="locale"
|
||||
cupsimagebase=""
|
||||
;;
|
||||
|
||||
libcupslite)
|
||||
AC_DEFINE(CUPS_LITE)
|
||||
BUILDDIRS="locale"
|
||||
cupsimagebase=""
|
||||
LIBCUPSOBJS="\$(COREOBJS)"
|
||||
LIBHEADERS="\$(COREHEADERS)"
|
||||
LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
|
||||
;;
|
||||
|
||||
*)
|
||||
@@ -450,3 +470,7 @@ case "$COMPONENTS" in
|
||||
esac
|
||||
|
||||
AC_SUBST(BUILDDIRS)
|
||||
AC_SUBST(IPPEVECOMMANDS)
|
||||
AC_SUBST(LIBCUPSOBJS)
|
||||
AC_SUBST(LIBHEADERS)
|
||||
AC_SUBST(LIBHEADERSPRIV)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 2007-2018 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
@@ -10,18 +10,20 @@ dnl
|
||||
dnl Clear the debugging and non-shared library options unless the user asks
|
||||
dnl for them...
|
||||
INSTALL_STRIP=""
|
||||
OPTIM=""
|
||||
AC_SUBST(INSTALL_STRIP)
|
||||
|
||||
AC_ARG_WITH(optim, [ --with-optim set optimization flags ],
|
||||
OPTIM="$withval",
|
||||
OPTIM="")
|
||||
AC_SUBST(OPTIM)
|
||||
|
||||
AC_ARG_WITH(optim, [ --with-optim set optimization flags ])
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug build with debugging symbols])
|
||||
AC_ARG_ENABLE(debug_guards, [ --enable-debug-guards build with memory allocation guards])
|
||||
AC_ARG_ENABLE(debug_printfs, [ --enable-debug-printfs build with CUPS_DEBUG_LOG support])
|
||||
AC_ARG_ENABLE(unit_tests, [ --enable-unit-tests build and run unit tests])
|
||||
|
||||
dnl For debugging, keep symbols, otherwise strip them...
|
||||
if test x$enable_debug = xyes; then
|
||||
if test x$enable_debug = xyes -a "x$OPTIM" = x; then
|
||||
OPTIM="-g"
|
||||
else
|
||||
INSTALL_STRIP="-s"
|
||||
@@ -79,6 +81,9 @@ AC_SUBST(LDARCHFLAGS)
|
||||
dnl Read-only data/program support on Linux...
|
||||
AC_ARG_ENABLE(relro, [ --enable-relro build with the GCC relro option])
|
||||
|
||||
dnl Clang/GCC address sanitizer...
|
||||
AC_ARG_ENABLE(sanitizer, [ --enable-sanitizer build with AddressSanitizer])
|
||||
|
||||
dnl Update compiler options...
|
||||
CXXLIBS="${CXXLIBS:=}"
|
||||
AC_SUBST(CXXLIBS)
|
||||
@@ -89,15 +94,28 @@ AC_SUBST(PIEFLAGS)
|
||||
RELROFLAGS=""
|
||||
AC_SUBST(RELROFLAGS)
|
||||
|
||||
WARNING_OPTIONS=""
|
||||
AC_SUBST(WARNING_OPTIONS)
|
||||
|
||||
if test -n "$GCC"; then
|
||||
# Add GCC-specific compiler options...
|
||||
|
||||
# Address sanitizer is a useful tool to use when developing/debugging
|
||||
# code but adds about 2x overhead...
|
||||
if test x$enable_sanitizer = xyes; then
|
||||
# Use -fsanitize=address with debugging...
|
||||
OPTIM="$OPTIM -g -fsanitize=address"
|
||||
else
|
||||
# Otherwise use the Fortify enhancements to catch any unbounded
|
||||
# string operations...
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
|
||||
CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2"
|
||||
fi
|
||||
|
||||
# Default optimization options...
|
||||
if test -z "$OPTIM"; then
|
||||
if test "x$with_optim" = x; then
|
||||
# Default to optimize-for-size and debug
|
||||
OPTIM="-Os -g"
|
||||
else
|
||||
OPTIM="$with_optim $OPTIM"
|
||||
fi
|
||||
# Default to optimize-for-size and debug
|
||||
OPTIM="-Os -g"
|
||||
fi
|
||||
|
||||
# Generate position-independent code as needed...
|
||||
@@ -150,81 +168,29 @@ if test -n "$GCC"; then
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
fi
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
# Add useful warning options for tracking down problems...
|
||||
OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM"
|
||||
# Add useful warning options for tracking down problems...
|
||||
WARNING_OPTIONS="-Wall -Wno-format-y2k -Wunused -Wno-unused-result -Wsign-conversion"
|
||||
|
||||
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"
|
||||
|
||||
AC_MSG_CHECKING(whether compiler supports -Wno-format-truncation)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-format-truncation"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wno-format-truncation"
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
CFLAGS="$OLDCFLAGS"
|
||||
|
||||
# Additional warning options for development testing...
|
||||
if test -d .svn; then
|
||||
OPTIM="-Werror $OPTIM"
|
||||
fi
|
||||
fi
|
||||
|
||||
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
|
||||
# CUPS since we already use buffer-limited calls, but
|
||||
# this will catch any additions that are broken.
|
||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
|
||||
;;
|
||||
|
||||
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
|
||||
RELROFLAGS="-Wl,-z,relro,-z,now"
|
||||
fi
|
||||
# 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.*)
|
||||
WARNING_OPTIONS="$WARNING_OPTIONS -Wno-format-truncation -Wno-tautological-compare"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Additional warning options for development testing...
|
||||
if test -d .git; then
|
||||
WARNING_OPTIONS="-Werror -Wno-error=deprecated-declarations $WARNING_OPTIONS"
|
||||
fi
|
||||
else
|
||||
# Add vendor-specific compiler options...
|
||||
case $host_os_name in
|
||||
sunos*)
|
||||
# Solaris
|
||||
if test -z "$OPTIM"; then
|
||||
if test "x$with_optim" = x; then
|
||||
OPTIM="-xO2"
|
||||
else
|
||||
OPTIM="$with_optim $OPTIM"
|
||||
fi
|
||||
OPTIM="-xO2"
|
||||
fi
|
||||
|
||||
if test $PICFLAG = 1; then
|
||||
@@ -232,13 +198,13 @@ else
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# Running some other operating system; inform the user they
|
||||
# should contribute the necessary options to
|
||||
# cups-support@cups.org...
|
||||
echo "Building CUPS with default compiler optimizations; contact"
|
||||
echo "cups-devel@cups.org with uname and compiler options needed"
|
||||
echo "for your platform, or set the CFLAGS and LDFLAGS environment"
|
||||
echo "variables before running configure."
|
||||
# Running some other operating system; inform the user
|
||||
# they should contribute the necessary options via
|
||||
# Github...
|
||||
echo "Building CUPS with default compiler optimizations; contact the CUPS developers on Github"
|
||||
echo "(https://github.com/apple/cups/issues) with the uname and compiler options needed for"
|
||||
echo "your platform, or set the CFLAGS and LDFLAGS environment variables before running"
|
||||
echo "configure."
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@@ -249,5 +215,11 @@ case $host_os_name in
|
||||
# glibc 2.8 and higher breaks peer credentials unless you
|
||||
# define _GNU_SOURCE...
|
||||
OPTIM="$OPTIM -D_GNU_SOURCE"
|
||||
|
||||
# The -z relro option is provided by the Linux linker command to
|
||||
# make relocatable data read-only.
|
||||
if test x$enable_relro = xyes; then
|
||||
RELROFLAGS="-Wl,-z,relro,-z,now"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
dnl
|
||||
dnl Default cupsd configuration settings for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright © 2007-2018 by Apple Inc.
|
||||
dnl Copyright © 2006-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
dnl information.
|
||||
dnl
|
||||
|
||||
dnl Default languages...
|
||||
@@ -19,20 +20,35 @@ AC_ARG_WITH(languages, [ --with-languages set installed languages, defau
|
||||
AC_SUBST(LANGUAGES)
|
||||
|
||||
dnl macOS bundle-based localization support
|
||||
AC_ARG_WITH(bundledir, [ --with-bundledir set macOS localization bundle directory ],
|
||||
CUPS_BUNDLEDIR="$withval",
|
||||
AC_ARG_WITH(bundledir, [ --with-bundledir set localization bundle directory ],
|
||||
CUPS_BUNDLEDIR="$withval",[
|
||||
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
|
||||
CUPS_BUNDLEDIR=""
|
||||
fi)
|
||||
fi])
|
||||
|
||||
AC_SUBST(CUPS_BUNDLEDIR)
|
||||
if test "x$CUPS_BUNDLEDIR" != x; then
|
||||
AC_DEFINE_UNQUOTED(CUPS_BUNDLEDIR, "$CUPS_BUNDLEDIR")
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(bundlelang, [ --with-bundlelang set localization bundle base language (English or en) ],
|
||||
cups_bundlelang="$withval",[
|
||||
if test $host_os_version -ge 190; then
|
||||
cups_bundlelang="en"
|
||||
else
|
||||
cups_bundlelang="English"
|
||||
fi])
|
||||
|
||||
if test "x$cups_bundlelang" != x -a "x$CUPS_BUNDLEDIR" != x; then
|
||||
CUPS_RESOURCEDIR="$CUPS_BUNDLEDIR/Resources/$cups_bundlelang.lproj"
|
||||
else
|
||||
CUPS_RESOURCEDIR=""
|
||||
fi
|
||||
AC_SUBST(CUPS_RESOURCEDIR)
|
||||
|
||||
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",
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
dnl
|
||||
dnl DNS Service Discovery (aka Bonjour) stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright © 2007-2019 by Apple Inc.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
dnl information.
|
||||
dnl
|
||||
|
||||
AC_ARG_ENABLE(avahi, [ --disable-avahi disable DNS Service Discovery support using Avahi])
|
||||
@@ -28,7 +29,7 @@ if test "x$PKGCONFIG" != x -a x$enable_avahi != xno -a x$host_os_name != xdarwin
|
||||
DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
|
||||
DNSSD_BACKEND="dnssd"
|
||||
IPPFIND_BIN="ippfind"
|
||||
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
|
||||
IPPFIND_MAN="ippfind.1"
|
||||
AC_DEFINE(HAVE_AVAHI)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -41,10 +42,9 @@ if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
|
||||
darwin*)
|
||||
# Darwin and macOS...
|
||||
AC_DEFINE(HAVE_DNSSD)
|
||||
DNSSDLIBS="-framework CoreFoundation -framework SystemConfiguration"
|
||||
DNSSD_BACKEND="dnssd"
|
||||
IPPFIND_BIN="ippfind"
|
||||
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
|
||||
IPPFIND_MAN="ippfind.1"
|
||||
;;
|
||||
*)
|
||||
# All others...
|
||||
@@ -62,7 +62,7 @@ if test "x$DNSSD_BACKEND" = x -a x$enable_dnssd != xno; then
|
||||
DNSSDLIBS="-ldns_sd"
|
||||
DNSSD_BACKEND="dnssd",
|
||||
IPPFIND_BIN="ippfind"
|
||||
IPPFIND_MAN="ippfind.\$(MAN1EXT)"
|
||||
IPPFIND_MAN="ippfind.1"
|
||||
AC_MSG_RESULT(no))
|
||||
LIBS="$SAVELIBS"
|
||||
;;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl Libtool stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 2007-2018 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
@@ -40,7 +40,7 @@ if test x$LIBTOOL != x; then
|
||||
LIBTOOL_INSTALL="\$(LIBTOOL) --mode=install"
|
||||
|
||||
LINKCUPS="../cups/\$(LIBCUPS)"
|
||||
LINKCUPSIMAGE="../filter/\$(LIBCUPSIMAGE)"
|
||||
LINKCUPSIMAGE="../cups/\$(LIBCUPSIMAGE)"
|
||||
|
||||
else
|
||||
LD_CC="\$(CC)"
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
dnl
|
||||
dnl Manpage stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright © 2007-2019 by Apple Inc.
|
||||
dnl Copyright © 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
dnl information.
|
||||
dnl
|
||||
|
||||
dnl Fix "mandir" variable...
|
||||
@@ -19,54 +20,10 @@ if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
|
||||
darwin* | linux* | gnu* | *bsd*)
|
||||
# Darwin, macOS, Linux, GNU HURD, and *BSD
|
||||
mandir="/usr/share/man"
|
||||
AMANDIR="/usr/share/man"
|
||||
PMANDIR="/usr/share/man"
|
||||
;;
|
||||
*)
|
||||
# All others
|
||||
mandir="/usr/man"
|
||||
AMANDIR="/usr/man"
|
||||
PMANDIR="/usr/man"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
AMANDIR="$mandir"
|
||||
PMANDIR="$mandir"
|
||||
fi
|
||||
|
||||
AC_SUBST(AMANDIR)
|
||||
AC_SUBST(PMANDIR)
|
||||
|
||||
dnl Setup manpage extensions...
|
||||
case "$host_os_name" in
|
||||
sunos*)
|
||||
# Solaris
|
||||
MAN1EXT=1
|
||||
MAN5EXT=5
|
||||
MAN7EXT=7
|
||||
MAN8EXT=1m
|
||||
MAN8DIR=1m
|
||||
;;
|
||||
linux* | gnu* | darwin*)
|
||||
# Linux, GNU Hurd, and macOS
|
||||
MAN1EXT=1.gz
|
||||
MAN5EXT=5.gz
|
||||
MAN7EXT=7.gz
|
||||
MAN8EXT=8.gz
|
||||
MAN8DIR=8
|
||||
;;
|
||||
*)
|
||||
# All others
|
||||
MAN1EXT=1
|
||||
MAN5EXT=5
|
||||
MAN7EXT=7
|
||||
MAN8EXT=8
|
||||
MAN8DIR=8
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(MAN1EXT)
|
||||
AC_SUBST(MAN5EXT)
|
||||
AC_SUBST(MAN7EXT)
|
||||
AC_SUBST(MAN8EXT)
|
||||
AC_SUBST(MAN8DIR)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
dnl
|
||||
dnl Operating system stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright © 2007-2019 by Apple Inc.
|
||||
dnl Copyright © 1997-2006 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
dnl information.
|
||||
dnl
|
||||
|
||||
dnl Get the build and host platforms and split the host_os value
|
||||
@@ -18,10 +19,6 @@ if test "x$host_os_version" = x; then
|
||||
host_os_version="0"
|
||||
fi
|
||||
|
||||
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
|
||||
@@ -31,3 +28,5 @@ else
|
||||
LOCALTARGET=""
|
||||
fi
|
||||
AC_SUBST(LOCALTARGET)
|
||||
|
||||
AC_PATH_PROGS(CODE_SIGN, codesign true)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
dnl
|
||||
dnl Shared library support for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright © 2007-2018 by Apple Inc.
|
||||
dnl Copyright © 1997-2005 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
dnl information.
|
||||
dnl
|
||||
|
||||
PICFLAG=1
|
||||
@@ -14,60 +15,56 @@ AC_ARG_ENABLE(shared, [ --disable-shared do not create shared libraries]
|
||||
|
||||
cupsbase="cups"
|
||||
LIBCUPSBASE="lib$cupsbase"
|
||||
LIBCUPSIMAGE=""
|
||||
LIBCUPSSTATIC="lib$cupsbase.a"
|
||||
|
||||
if test x$enable_shared != xno; then
|
||||
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"
|
||||
if test "x$cupsimagebase" != x; then
|
||||
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
|
||||
fi
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G \$(OPTIM)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-h\`basename \$@\` -G"
|
||||
;;
|
||||
linux* | gnu* | *bsd*)
|
||||
LIBCUPS="lib$cupsbase.so.2"
|
||||
LIBCUPSCGI="libcupscgi.so.1"
|
||||
LIBCUPSIMAGE="libcupsimage.so.2"
|
||||
LIBCUPSMIME="libcupsmime.so.1"
|
||||
LIBCUPSPPDC="libcupsppdc.so.1"
|
||||
if test "x$cupsimagebase" != x; then
|
||||
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
|
||||
fi
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared"
|
||||
;;
|
||||
darwin*)
|
||||
LIBCUPS="lib$cupsbase.2.dylib"
|
||||
LIBCUPSCGI="libcupscgi.1.dylib"
|
||||
LIBCUPSIMAGE="libcupsimage.2.dylib"
|
||||
LIBCUPSMIME="libcupsmime.1.dylib"
|
||||
LIBCUPSPPDC="libcupsppdc.1.dylib"
|
||||
if test "x$cupsimagebase" != x; then
|
||||
LIBCUPSIMAGE="lib$cupsimagebase.2.dylib"
|
||||
fi
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -dynamiclib -single_module -lc"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-no_warn_inits -dynamiclib -single_module -lc"
|
||||
;;
|
||||
*)
|
||||
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"
|
||||
if test "x$cupsimagebase" != x; then
|
||||
LIBCUPSIMAGE="lib$cupsimagebase.so.2"
|
||||
fi
|
||||
DSO="\$(CC)"
|
||||
DSOXX="\$(CXX)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
PICFLAG=0
|
||||
LIBCUPS="lib$cupsbase.a"
|
||||
LIBCUPSCGI="libcupscgi.a"
|
||||
LIBCUPSIMAGE="libcupsimage.a"
|
||||
LIBCUPSMIME="libcupsmime.a"
|
||||
LIBCUPSPPDC="libcupsppdc.a"
|
||||
if test "x$cupsimagebase" != x; then
|
||||
LIBCUPSIMAGE="lib$cupsimagebase.a"
|
||||
fi
|
||||
DSO=":"
|
||||
DSOXX=":"
|
||||
fi
|
||||
@@ -77,42 +74,24 @@ 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
|
||||
LINKCUPS="../cups/lib$cupsbase.a"
|
||||
LINKCUPSIMAGE="../filter/libcupsimage.a"
|
||||
|
||||
EXTLINKCUPS="-lcups"
|
||||
EXTLINKCUPSIMAGE="-lcupsimage"
|
||||
LINKCUPS="../cups/lib$cupsbase.a \$(LIBS)"
|
||||
EXTLINKCUPS="-lcups \$LIBS"
|
||||
else
|
||||
LINKCUPS="-l${cupsbase}"
|
||||
LINKCUPSIMAGE="-lcupsimage"
|
||||
|
||||
LINKCUPS="-L../cups -l${cupsbase}"
|
||||
EXTLINKCUPS="-lcups"
|
||||
EXTLINKCUPSIMAGE="-lcupsimage"
|
||||
fi
|
||||
|
||||
AC_SUBST(EXTLINKCUPS)
|
||||
AC_SUBST(EXTLINKCUPSIMAGE)
|
||||
AC_SUBST(LINKCUPS)
|
||||
AC_SUBST(LINKCUPSIMAGE)
|
||||
|
||||
dnl Update libraries for DSOs...
|
||||
EXPORT_LDFLAGS=""
|
||||
|
||||
if test "$DSO" != ":"; then
|
||||
# When using DSOs the image libraries are linked to libcupsimage.so
|
||||
# rather than to the executables. This makes things smaller if you
|
||||
# are using any static libraries, and it also allows us to distribute
|
||||
# a single DSO rather than a bunch...
|
||||
DSOLIBS="\$(LIBZ)"
|
||||
IMGLIBS=""
|
||||
|
||||
# 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...
|
||||
@@ -142,11 +121,6 @@ if test "$DSO" != ":"; then
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
DSOLIBS=""
|
||||
IMGLIBS="\$(LIBZ)"
|
||||
fi
|
||||
|
||||
AC_SUBST(DSOLIBS)
|
||||
AC_SUBST(IMGLIBS)
|
||||
AC_SUBST(EXPORT_LDFLAGS)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl TLS stuff for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 2007-2019 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
@@ -27,30 +27,12 @@ if test x$enable_ssl != xno; then
|
||||
CUPS_SERVERKEYCHAIN="/Library/Keychains/System.keychain"
|
||||
|
||||
dnl Check for the various security headers...
|
||||
AC_CHECK_HEADER(Security/SecureTransportPriv.h,
|
||||
AC_DEFINE(HAVE_SECURETRANSPORTPRIV_H))
|
||||
AC_CHECK_HEADER(Security/SecCertificate.h,
|
||||
AC_DEFINE(HAVE_SECCERTIFICATE_H))
|
||||
AC_CHECK_HEADER(Security/SecItem.h,
|
||||
AC_DEFINE(HAVE_SECITEM_H))
|
||||
AC_CHECK_HEADER(Security/SecItemPriv.h,
|
||||
AC_DEFINE(HAVE_SECITEMPRIV_H),,
|
||||
[#include <Security/SecItem.h>])
|
||||
AC_CHECK_HEADER(Security/SecPolicy.h,
|
||||
AC_DEFINE(HAVE_SECPOLICY_H))
|
||||
AC_CHECK_HEADER(Security/SecPolicyPriv.h,
|
||||
AC_DEFINE(HAVE_SECPOLICYPRIV_H))
|
||||
AC_CHECK_HEADER(Security/SecBasePriv.h,
|
||||
AC_DEFINE(HAVE_SECBASEPRIV_H))
|
||||
AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
|
||||
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
|
||||
|
||||
AC_DEFINE(HAVE_CSSMERRORSTRING)
|
||||
AC_DEFINE(HAVE_SECKEYCHAINOPEN)])
|
||||
|
||||
if test $host_os_version -ge 150; then
|
||||
AC_DEFINE(HAVE_SSLSETENABLEDCIPHERS)
|
||||
fi
|
||||
AC_DEFINE(HAVE_SECPOLICY_H))])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
+5
-40
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Configuration file for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 2007-2019 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CONFIG_H_
|
||||
@@ -16,6 +17,7 @@
|
||||
|
||||
#define CUPS_SVERSION ""
|
||||
#define CUPS_MINIMAL ""
|
||||
#define CUPS_LITE 0
|
||||
|
||||
|
||||
/*
|
||||
@@ -318,21 +320,9 @@
|
||||
*/
|
||||
|
||||
#undef HAVE_AUTHORIZATION_H
|
||||
#undef HAVE_SECBASEPRIV_H
|
||||
#undef HAVE_SECCERTIFICATE_H
|
||||
#undef HAVE_SECIDENTITYSEARCHPRIV_H
|
||||
#undef HAVE_SECITEM_H
|
||||
#undef HAVE_SECITEMPRIV_H
|
||||
#undef HAVE_SECPOLICY_H
|
||||
#undef HAVE_SECPOLICYPRIV_H
|
||||
#undef HAVE_SECURETRANSPORTPRIV_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the cssmErrorString function?
|
||||
*/
|
||||
|
||||
#undef HAVE_CSSMERRORSTRING
|
||||
|
||||
|
||||
/*
|
||||
@@ -342,20 +332,6 @@
|
||||
#undef HAVE_SECGENERATESELFSIGNEDCERTIFICATE
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SecKeychainOpen function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SECKEYCHAINOPEN
|
||||
|
||||
|
||||
/*
|
||||
* Do we have (a working) SSLSetEnabledCiphers function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SSLSETENABLEDCIPHERS
|
||||
|
||||
|
||||
/*
|
||||
* Do we have libpaper?
|
||||
*/
|
||||
@@ -498,12 +474,10 @@
|
||||
|
||||
|
||||
/*
|
||||
* Do we have CoreFoundation public and private headers?
|
||||
* Do we have CoreFoundation public headers?
|
||||
*/
|
||||
|
||||
#undef HAVE_COREFOUNDATION_H
|
||||
#undef HAVE_CFPRIV_H
|
||||
#undef HAVE_CFBUNDLEPRIV_H
|
||||
|
||||
|
||||
/*
|
||||
@@ -532,7 +506,6 @@
|
||||
*/
|
||||
|
||||
#undef HAVE_MEMBERSHIP_H
|
||||
#undef HAVE_MEMBERSHIPPRIV_H
|
||||
#undef HAVE_MBR_UID_TO_UUID
|
||||
|
||||
|
||||
@@ -685,14 +658,6 @@
|
||||
*/
|
||||
|
||||
#undef HAVE_XPC
|
||||
#undef HAVE_XPC_PRIVATE_H
|
||||
|
||||
|
||||
/*
|
||||
* Do we have Mini-XML?
|
||||
*/
|
||||
|
||||
#undef HAVE_MXML_H
|
||||
|
||||
|
||||
/*
|
||||
|
||||
externo
+335
-559
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+5
-12
@@ -1,17 +1,18 @@
|
||||
dnl
|
||||
dnl Configuration script for CUPS.
|
||||
dnl
|
||||
dnl Copyright 2007-2017 by Apple Inc.
|
||||
dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl Copyright © 2007-2019 by Apple Inc.
|
||||
dnl Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
dnl
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
dnl Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
dnl information.
|
||||
dnl
|
||||
|
||||
dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Package name and version...
|
||||
AC_INIT([CUPS], [2.3b1], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
AC_INIT([CUPS], [2.3rc1], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
|
||||
sinclude(config-scripts/cups-opsys.m4)
|
||||
sinclude(config-scripts/cups-common.m4)
|
||||
@@ -65,14 +66,6 @@ AC_OUTPUT(Makedefs
|
||||
cups-config
|
||||
desktop/cups.desktop
|
||||
doc/index.html
|
||||
man/client.conf.man
|
||||
man/cups-files.conf.man
|
||||
man/cups-lpd.man
|
||||
man/cups-snmp.man
|
||||
man/cupsaddsmb.man
|
||||
man/cupsd.conf.man
|
||||
man/cupsd.man
|
||||
man/lpoptions.man
|
||||
scheduler/cups-lpd.xinetd
|
||||
scheduler/cups.sh
|
||||
scheduler/cups.xml
|
||||
|
||||
+11
-23
@@ -2,18 +2,15 @@
|
||||
#
|
||||
# CUPS configuration utility.
|
||||
#
|
||||
# Copyright 2007-2016 by Apple Inc.
|
||||
# Copyright 2001-2006 by Easy Software Products, all rights reserved.
|
||||
# Copyright © 2007-2019 by Apple Inc.
|
||||
# Copyright © 2001-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/".
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
VERSION="@CUPS_VERSION@"
|
||||
APIVERSION="2.2"
|
||||
APIVERSION="2.3"
|
||||
BUILD="@CUPS_BUILD@"
|
||||
|
||||
prefix=@prefix@
|
||||
@@ -21,7 +18,6 @@ exec_prefix=@exec_prefix@
|
||||
bindir=@bindir@
|
||||
includedir=@includedir@
|
||||
libdir=@libdir@
|
||||
imagelibdir=@libdir@
|
||||
datarootdir=@datadir@
|
||||
datadir=@datadir@
|
||||
sysconfdir=@sysconfdir@
|
||||
@@ -30,19 +26,18 @@ cups_serverbin=@CUPS_SERVERBIN@
|
||||
cups_serverroot=@CUPS_SERVERROOT@
|
||||
INSTALLSTATIC=@INSTALLSTATIC@
|
||||
|
||||
# flags for C++ compiler:
|
||||
# flags for compiler and linker...
|
||||
CFLAGS=""
|
||||
LDFLAGS="@EXPORT_LDFLAGS@"
|
||||
LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
|
||||
LIBS="@LIBGSSAPI@ @DNSSDLIBS@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
|
||||
|
||||
# Check for local invocation...
|
||||
selfdir=`dirname $0`
|
||||
|
||||
if test -f "$selfdir/cups/cups.h"; then
|
||||
CFLAGS="-I$selfdir"
|
||||
LDFLAGS="-L$selfdir/cups -L$selfdir/filter $LDFLAGS"
|
||||
LDFLAGS="-L$selfdir/cups $LDFLAGS"
|
||||
libdir="$selfdir/cups"
|
||||
imagelibdir="$selfdir/filter"
|
||||
else
|
||||
if test $includedir != /usr/include; then
|
||||
CFLAGS="$CFLAGS -I$includedir"
|
||||
@@ -76,7 +71,6 @@ fi
|
||||
|
||||
# Parse command line options
|
||||
static=no
|
||||
image=no
|
||||
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
@@ -96,22 +90,16 @@ while test $# -gt 0; do
|
||||
usage 0
|
||||
;;
|
||||
--image)
|
||||
image=yes
|
||||
# Do nothing
|
||||
;;
|
||||
--ldflags)
|
||||
echo $LDFLAGS
|
||||
;;
|
||||
--libs)
|
||||
if test $static = no; then
|
||||
libs="@EXTLINKCUPS@ $LIBS";
|
||||
if test $image = yes; then
|
||||
libs="@EXTLINKCUPSIMAGE@ $libs"
|
||||
fi
|
||||
libs="@EXTLINKCUPS@";
|
||||
else
|
||||
libs="$libdir/libcups.a $LIBS";
|
||||
if test $image = yes; then
|
||||
libs="$libdir/libcupsimage.a $libs"
|
||||
fi
|
||||
fi
|
||||
echo $libs
|
||||
;;
|
||||
@@ -123,7 +111,7 @@ while test $# -gt 0; do
|
||||
;;
|
||||
--static)
|
||||
if test -z "$INSTALLSTATIC"; then
|
||||
echo "WARNING: Static libraries not installed!" >&2
|
||||
echo "WARNING: Static libraries not installed." >&2
|
||||
else
|
||||
static=yes
|
||||
fi
|
||||
|
||||
+376
-284
@@ -1,316 +1,408 @@
|
||||
adminutil.o: adminutil.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 ppd.h raster.h \
|
||||
adminutil.h
|
||||
array.o: array.c ../cups/cups.h file.h versioning.h ipp.h http.h array.h \
|
||||
language.h pwg.h string-private.h ../config.h debug-private.h \
|
||||
array-private.h
|
||||
language.h pwg.h string-private.h ../config.h ../cups/versioning.h \
|
||||
debug-internal.h debug-private.h array-private.h ../cups/array.h
|
||||
auth.o: auth.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
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
debug.o: debug.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
dest.o: dest.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
dest-job.o: dest-job.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
dest-localization.o: dest-localization.c cups-private.h string-private.h \
|
||||
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
|
||||
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
dest-options.o: dest-options.c cups-private.h string-private.h \
|
||||
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
|
||||
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
dir.o: dir.c string-private.h ../config.h ../cups/versioning.h \
|
||||
debug-internal.h debug-private.h dir.h versioning.h
|
||||
encode.o: encode.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
file.o: file.c file-private.h cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
getputfile.o: getputfile.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
globals.o: globals.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
|
||||
hash.o: hash.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
|
||||
http.o: http.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
http-addr.o: http-addr.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
http-addrlist.o: http-addrlist.c cups-private.h string-private.h \
|
||||
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
|
||||
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
http-support.o: http-support.c cups-private.h string-private.h \
|
||||
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
|
||||
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
ipp.o: ipp.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
ipp-file.o: ipp-file.c ipp-private.h ../cups/cups.h file.h versioning.h \
|
||||
ipp.h http.h array.h language.h pwg.h string-private.h ../config.h \
|
||||
../cups/versioning.h debug-internal.h debug-private.h
|
||||
ipp-vars.o: ipp-vars.c ../cups/cups.h file.h versioning.h ipp.h http.h \
|
||||
array.h language.h pwg.h ipp-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h debug-internal.h debug-private.h
|
||||
ipp-support.o: ipp-support.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
langprintf.o: langprintf.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
language.o: language.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
md5.o: md5.c md5-internal.h ../cups/versioning.h string-private.h \
|
||||
../config.h
|
||||
md5passwd.o: md5passwd.c ../cups/cups.h file.h versioning.h ipp.h http.h \
|
||||
array.h language.h pwg.h http-private.h ../config.h ../cups/language.h \
|
||||
../cups/http.h ipp-private.h string-private.h ../cups/versioning.h
|
||||
notify.o: notify.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
options.o: options.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
pwg-media.o: pwg-media.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
raster-error.o: raster-error.c cups-private.h string-private.h \
|
||||
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
|
||||
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
raster-private.h raster.h cups.h ../cups/debug-private.h \
|
||||
../cups/string-private.h debug-internal.h debug-private.h
|
||||
raster-stream.o: raster-stream.c raster-private.h raster.h cups.h file.h \
|
||||
versioning.h ipp.h http.h array.h language.h pwg.h ../cups/cups.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/string-private.h \
|
||||
../config.h debug-internal.h debug-private.h
|
||||
raster-stubs.o: raster-stubs.c raster-private.h raster.h cups.h file.h \
|
||||
versioning.h ipp.h http.h array.h language.h pwg.h ../cups/cups.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/string-private.h \
|
||||
../config.h
|
||||
request.o: request.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
snprintf.o: snprintf.c string-private.h ../config.h ../cups/versioning.h
|
||||
string.o: string.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
tempfile.o: tempfile.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
thread.o: thread.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
|
||||
tls.o: tls.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h tls-darwin.c
|
||||
transcode.o: transcode.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
usersys.o: usersys.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
util.o: util.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h
|
||||
adminutil.o: adminutil.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h ppd.h cups.h raster.h adminutil.h
|
||||
backchannel.o: backchannel.c cups.h file.h versioning.h ipp.h http.h \
|
||||
array.h language.h pwg.h
|
||||
backend.o: backend.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 backend.h ppd.h raster.h
|
||||
debug.o: debug.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
|
||||
dest.o: dest.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
|
||||
dest-job.o: dest-job.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
|
||||
dest-localization.o: dest-localization.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
|
||||
dest-options.o: dest-options.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
|
||||
dir.o: dir.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h dir.h
|
||||
encode.o: encode.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
|
||||
file.o: file.c file-private.h 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
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
backend.h ppd.h cups.h raster.h
|
||||
getdevices.o: getdevices.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 adminutil.h
|
||||
getifaddrs.o: getifaddrs.c http-private.h ../config.h ../cups/language.h \
|
||||
array.h versioning.h ../cups/http.h md5-private.h ipp-private.h \
|
||||
../cups/ipp.h
|
||||
getputfile.o: getputfile.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
|
||||
globals.o: globals.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
|
||||
hash.o: hash.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
|
||||
http.o: http.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
|
||||
http-addr.o: http-addr.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
|
||||
http-addrlist.o: http-addrlist.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
|
||||
http-support.o: http-support.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
|
||||
ipp.o: ipp.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
|
||||
ipp-support.o: ipp-support.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
|
||||
langprintf.o: langprintf.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
|
||||
language.o: language.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
|
||||
md5.o: md5.c md5-private.h string-private.h ../config.h
|
||||
md5passwd.o: md5passwd.c http-private.h ../config.h ../cups/language.h \
|
||||
array.h versioning.h ../cups/http.h md5-private.h ipp-private.h \
|
||||
../cups/ipp.h string-private.h
|
||||
notify.o: notify.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
|
||||
options.o: options.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
|
||||
ppd.o: ppd.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 ppd-private.h ../cups/ppd.h raster.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h adminutil.h cups.h
|
||||
getifaddrs.o: getifaddrs.c getifaddrs-internal.h ../config.h
|
||||
ppd.o: ppd.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
|
||||
debug-private.h
|
||||
ppd-attr.o: ppd-attr.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 ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
|
||||
debug-private.h
|
||||
ppd-cache.o: ppd-cache.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 ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
|
||||
debug-private.h
|
||||
ppd-conflicts.o: ppd-conflicts.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 ppd-private.h ../cups/ppd.h raster.h
|
||||
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
|
||||
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
|
||||
debug-private.h
|
||||
ppd-custom.o: ppd-custom.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 ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
|
||||
debug-private.h
|
||||
ppd-emit.o: ppd-emit.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 ppd.h raster.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
debug-internal.h debug-private.h ppd.h cups.h raster.h
|
||||
ppd-localize.o: ppd-localize.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 ppd-private.h ../cups/ppd.h raster.h
|
||||
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
versioning.h ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h \
|
||||
language.h pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
|
||||
debug-private.h
|
||||
ppd-mark.o: ppd-mark.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 ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
ppd-page.o: ppd-page.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h ppd.h cups.h file.h ipp.h http.h array.h \
|
||||
language.h pwg.h raster.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
|
||||
debug-private.h
|
||||
ppd-page.o: ppd-page.c string-private.h ../config.h ../cups/versioning.h \
|
||||
debug-internal.h debug-private.h ppd.h cups.h file.h versioning.h \
|
||||
ipp.h http.h array.h language.h pwg.h raster.h
|
||||
ppd-util.o: ppd-util.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 ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
pwg-media.o: pwg-media.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
|
||||
request.o: request.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
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd-private.h ../cups/ppd.h cups.h raster.h debug-internal.h \
|
||||
debug-private.h
|
||||
raster-interpret.o: raster-interpret.c ../cups/raster-private.h raster.h \
|
||||
cups.h file.h versioning.h ipp.h http.h array.h language.h pwg.h \
|
||||
../cups/cups.h ../cups/debug-private.h ../cups/versioning.h \
|
||||
../cups/string-private.h ../config.h ../cups/ppd-private.h \
|
||||
../cups/ppd.h pwg-private.h debug-internal.h debug-private.h
|
||||
raster-interstub.o: raster-interstub.c ../cups/ppd-private.h \
|
||||
../cups/cups.h file.h versioning.h ipp.h http.h array.h language.h \
|
||||
pwg.h ../cups/ppd.h cups.h raster.h pwg-private.h
|
||||
sidechannel.o: sidechannel.c sidechannel.h versioning.h cups-private.h \
|
||||
string-private.h ../config.h debug-private.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
|
||||
string-private.h ../config.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
|
||||
array.h language.h pwg.h http-private.h ../cups/language.h \
|
||||
../cups/http.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.h debug-internal.h debug-private.h
|
||||
snmp.o: snmp.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 snmp-private.h
|
||||
snprintf.o: snprintf.c string-private.h ../config.h
|
||||
string.o: string.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
|
||||
tempfile.o: tempfile.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
|
||||
thread.o: thread.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
|
||||
tls.o: tls.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 tls-darwin.c
|
||||
transcode.o: transcode.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
|
||||
usersys.o: usersys.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
|
||||
util.o: util.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
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
snmp-private.h debug-internal.h debug-private.h
|
||||
raster-interstub.o: raster-interstub.c ../cups/ppd-private.h \
|
||||
../cups/cups.h file.h versioning.h ipp.h http.h array.h language.h \
|
||||
pwg.h ../cups/ppd.h cups.h raster.h pwg-private.h
|
||||
raster-stubs.o: raster-stubs.c raster-private.h raster.h cups.h file.h \
|
||||
versioning.h ipp.h http.h array.h language.h pwg.h ../cups/cups.h \
|
||||
../cups/debug-private.h ../cups/versioning.h ../cups/string-private.h \
|
||||
../config.h
|
||||
rasterbench.o: rasterbench.c ../config.h ../cups/raster.h cups.h file.h \
|
||||
versioning.h ipp.h http.h array.h language.h pwg.h
|
||||
testadmin.o: testadmin.c adminutil.h cups.h file.h versioning.h ipp.h \
|
||||
http.h array.h language.h pwg.h string-private.h ../config.h
|
||||
testarray.o: testarray.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h dir.h
|
||||
http.h array.h language.h pwg.h string-private.h ../config.h \
|
||||
../cups/versioning.h
|
||||
testarray.o: testarray.c string-private.h ../config.h \
|
||||
../cups/versioning.h debug-private.h array-private.h ../cups/array.h \
|
||||
versioning.h dir.h
|
||||
testcache.o: testcache.c ppd-private.h ../cups/cups.h file.h versioning.h \
|
||||
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h raster.h \
|
||||
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h cups.h raster.h \
|
||||
pwg-private.h file-private.h cups-private.h string-private.h \
|
||||
../config.h debug-private.h array-private.h ipp-private.h \
|
||||
http-private.h md5-private.h language-private.h ../cups/transcode.h \
|
||||
thread-private.h
|
||||
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h thread-private.h
|
||||
testclient.o: testclient.c ../config.h ../cups/cups.h file.h versioning.h \
|
||||
ipp.h http.h array.h language.h pwg.h ../cups/raster.h cups.h \
|
||||
../cups/string-private.h ../cups/versioning.h ../cups/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
|
||||
array.h language.h pwg.h ppd.h raster.h string-private.h ../config.h \
|
||||
../cups/versioning.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
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
|
||||
testcups.o: testcups.c cups-private.h string-private.h ../config.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd.h cups.h raster.h
|
||||
testdest.o: testdest.c cups.h file.h versioning.h ipp.h http.h array.h \
|
||||
language.h pwg.h
|
||||
testfile.o: testfile.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h file.h
|
||||
testfile.o: testfile.c string-private.h ../config.h ../cups/versioning.h \
|
||||
debug-private.h file.h versioning.h
|
||||
testgetdests.o: testgetdests.c cups.h file.h versioning.h ipp.h http.h \
|
||||
array.h language.h pwg.h
|
||||
testhttp.o: testhttp.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
|
||||
testi18n.o: testi18n.c string-private.h ../config.h language-private.h \
|
||||
../cups/transcode.h language.h array.h versioning.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
|
||||
testi18n.o: testi18n.c string-private.h ../config.h ../cups/versioning.h \
|
||||
language-private.h ../cups/transcode.h language.h array.h versioning.h
|
||||
testipp.o: testipp.c file.h versioning.h string-private.h ../config.h \
|
||||
ipp-private.h ../cups/ipp.h http.h array.h
|
||||
../cups/versioning.h ipp-private.h ../cups/cups.h ipp.h http.h array.h \
|
||||
language.h pwg.h
|
||||
testoptions.o: testoptions.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
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
|
||||
testlang.o: testlang.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 ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd-private.h ../cups/ppd.h cups.h raster.h
|
||||
testppd.o: testppd.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 ppd-private.h \
|
||||
../cups/ppd.h raster.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
ppd-private.h ../cups/ppd.h cups.h raster.h raster-private.h \
|
||||
../cups/debug-private.h ../cups/string-private.h
|
||||
testpwg.o: testpwg.c ppd-private.h ../cups/cups.h file.h versioning.h \
|
||||
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h raster.h \
|
||||
ipp.h http.h array.h language.h pwg.h ../cups/ppd.h cups.h raster.h \
|
||||
pwg-private.h file-private.h cups-private.h string-private.h \
|
||||
../config.h debug-private.h array-private.h ipp-private.h \
|
||||
http-private.h md5-private.h language-private.h ../cups/transcode.h \
|
||||
thread-private.h
|
||||
../config.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h thread-private.h
|
||||
testraster.o: testraster.c ../cups/raster-private.h raster.h cups.h \
|
||||
file.h versioning.h ipp.h http.h array.h language.h pwg.h \
|
||||
../cups/cups.h ../cups/debug-private.h ../cups/versioning.h \
|
||||
../cups/string-private.h ../config.h
|
||||
testsnmp.o: testsnmp.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 snmp-private.h
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h \
|
||||
snmp-private.h
|
||||
tlscheck.o: tlscheck.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
|
||||
../cups/versioning.h array-private.h ../cups/array.h versioning.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h array.h language.h \
|
||||
pwg.h http-private.h ../cups/language.h ../cups/http.h \
|
||||
language-private.h ../cups/transcode.h pwg-private.h thread-private.h
|
||||
|
||||
+245
-116
@@ -1,32 +1,23 @@
|
||||
#
|
||||
# Library Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2017 by Apple Inc.
|
||||
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
# Copyright © 2007-2019 by Apple Inc.
|
||||
# Copyright © 1997-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
|
||||
#
|
||||
# Options to build libcups without the use of deprecated APIs...
|
||||
#
|
||||
|
||||
OPTIONS = -D_CUPS_NO_DEPRECATED=1 -D_PPD_DEPRECATED=""
|
||||
|
||||
|
||||
#
|
||||
# Object files...
|
||||
#
|
||||
|
||||
LIBOBJS = \
|
||||
adminutil.o \
|
||||
COREOBJS = \
|
||||
array.o \
|
||||
auth.o \
|
||||
backchannel.o \
|
||||
backend.o \
|
||||
debug.o \
|
||||
dest.o \
|
||||
dest-job.o \
|
||||
@@ -35,8 +26,6 @@ LIBOBJS = \
|
||||
dir.o \
|
||||
encode.o \
|
||||
file.o \
|
||||
getdevices.o \
|
||||
getifaddrs.o \
|
||||
getputfile.o \
|
||||
globals.o \
|
||||
hash.o \
|
||||
@@ -45,6 +34,8 @@ LIBOBJS = \
|
||||
http-addrlist.o \
|
||||
http-support.o \
|
||||
ipp.o \
|
||||
ipp-file.o \
|
||||
ipp-vars.o \
|
||||
ipp-support.o \
|
||||
langprintf.o \
|
||||
language.o \
|
||||
@@ -52,6 +43,26 @@ LIBOBJS = \
|
||||
md5passwd.o \
|
||||
notify.o \
|
||||
options.o \
|
||||
pwg-media.o \
|
||||
raster-error.o \
|
||||
raster-stream.o \
|
||||
raster-stubs.o \
|
||||
request.o \
|
||||
snprintf.o \
|
||||
string.o \
|
||||
tempfile.o \
|
||||
thread.o \
|
||||
tls.o \
|
||||
transcode.o \
|
||||
usersys.o \
|
||||
util.o
|
||||
|
||||
DRIVEROBJS = \
|
||||
adminutil.o \
|
||||
backchannel.o \
|
||||
backend.o \
|
||||
getdevices.o \
|
||||
getifaddrs.o \
|
||||
ppd.o \
|
||||
ppd-attr.o \
|
||||
ppd-cache.o \
|
||||
@@ -62,22 +73,24 @@ LIBOBJS = \
|
||||
ppd-mark.o \
|
||||
ppd-page.o \
|
||||
ppd-util.o \
|
||||
pwg-media.o \
|
||||
request.o \
|
||||
raster-interpret.o \
|
||||
raster-interstub.o \
|
||||
sidechannel.o \
|
||||
snmp.o \
|
||||
snprintf.o \
|
||||
string.o \
|
||||
tempfile.o \
|
||||
thread.o \
|
||||
tls.o \
|
||||
transcode.o \
|
||||
usersys.o \
|
||||
util.o
|
||||
snmp.o
|
||||
|
||||
LIBOBJS = \
|
||||
$(LIBCUPSOBJS)
|
||||
|
||||
IMAGEOBJS = \
|
||||
raster-interstub.o \
|
||||
raster-stubs.o
|
||||
|
||||
TESTOBJS = \
|
||||
rasterbench.o \
|
||||
testadmin.o \
|
||||
testarray.o \
|
||||
testcache.o \
|
||||
testclient.o \
|
||||
testconflicts.o \
|
||||
testcreds.o \
|
||||
testcups.o \
|
||||
@@ -91,10 +104,12 @@ TESTOBJS = \
|
||||
testlang.o \
|
||||
testppd.o \
|
||||
testpwg.o \
|
||||
testraster.o \
|
||||
testsnmp.o \
|
||||
tlscheck.o
|
||||
OBJS = \
|
||||
$(LIBOBJS) \
|
||||
$(IMAGEOBJS) \
|
||||
$(TESTOBJS)
|
||||
|
||||
|
||||
@@ -102,24 +117,29 @@ OBJS = \
|
||||
# Header files to install...
|
||||
#
|
||||
|
||||
HEADERS = \
|
||||
adminutil.h \
|
||||
COREHEADERS = \
|
||||
array.h \
|
||||
backend.h \
|
||||
cups.h \
|
||||
dir.h \
|
||||
file.h \
|
||||
http.h \
|
||||
ipp.h \
|
||||
language.h \
|
||||
ppd.h \
|
||||
pwg.h \
|
||||
raster.h \
|
||||
sidechannel.h \
|
||||
transcode.h \
|
||||
versioning.h
|
||||
|
||||
HEADERSPRIV = \
|
||||
DRIVERHEADERS = \
|
||||
adminutil.h \
|
||||
backend.h \
|
||||
ppd.h \
|
||||
sidechannel.h
|
||||
|
||||
HEADERS = \
|
||||
$(LIBHEADERS)
|
||||
|
||||
COREHEADERSPRIV = \
|
||||
array-private.h \
|
||||
cups-private.h \
|
||||
debug-private.h \
|
||||
@@ -127,27 +147,35 @@ HEADERSPRIV = \
|
||||
http-private.h \
|
||||
ipp-private.h \
|
||||
language-private.h \
|
||||
md5-private.h \
|
||||
ppd-private.h \
|
||||
pwg-private.h \
|
||||
raster-private.h \
|
||||
snmp-private.h \
|
||||
string-private.h \
|
||||
thread-private.h
|
||||
|
||||
DRIVERHEADERSPRIV = \
|
||||
ppd-private.h \
|
||||
snmp-private.h
|
||||
|
||||
HEADERSPRIV = \
|
||||
$(LIBHEADERSPRIV)
|
||||
|
||||
|
||||
#
|
||||
# Targets in this directory...
|
||||
#
|
||||
|
||||
LIBTARGETS = \
|
||||
$(LIBCUPSIMAGE) \
|
||||
$(LIBCUPSSTATIC) \
|
||||
$(LIBCUPS)
|
||||
$(LIBCUPS) \
|
||||
libcupsimage.a
|
||||
|
||||
UNITTARGETS = \
|
||||
rasterbench \
|
||||
testadmin \
|
||||
testarray \
|
||||
testcache \
|
||||
testclient \
|
||||
testconflicts \
|
||||
testcreds \
|
||||
testcups \
|
||||
@@ -161,6 +189,7 @@ UNITTARGETS = \
|
||||
testoptions \
|
||||
testppd \
|
||||
testpwg \
|
||||
testraster \
|
||||
testsnmp \
|
||||
tlscheck
|
||||
|
||||
@@ -196,6 +225,7 @@ unittests: $(UNITTARGETS)
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
|
||||
$(RM) libcups.so libcups.dylib
|
||||
$(RM) libcupsimage.so libcupsimage.dylib
|
||||
|
||||
|
||||
#
|
||||
@@ -258,7 +288,7 @@ install-headers:
|
||||
# Install libraries...
|
||||
#
|
||||
|
||||
install-libs: $(INSTALLSTATIC)
|
||||
install-libs: $(LIBTARGETS) $(INSTALLSTATIC)
|
||||
echo Installing libraries in $(LIBDIR)...
|
||||
$(INSTALL_DIR) -m 755 $(LIBDIR)
|
||||
$(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
|
||||
@@ -270,10 +300,25 @@ install-libs: $(INSTALLSTATIC)
|
||||
$(RM) $(LIBDIR)/libcups.dylib; \
|
||||
$(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
|
||||
fi
|
||||
-if test "x$(LIBCUPSIMAGE)" != x; then \
|
||||
$(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR); \
|
||||
fi
|
||||
-if test "x$(LIBCUPSIMAGE)" = "xlibcupsimage.so.2"; then \
|
||||
$(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
|
||||
$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
|
||||
fi
|
||||
-if test "x$(LIBCUPSIMAGE)" = "xlibcupsimage.2.dylib"; then \
|
||||
$(RM) $(LIBDIR)/libcupsimage.dylib; \
|
||||
$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
|
||||
fi
|
||||
if test "x$(SYMROOT)" != "x"; then \
|
||||
$(INSTALL_DIR) $(SYMROOT); \
|
||||
cp $(LIBCUPS) $(SYMROOT); \
|
||||
dsymutil $(SYMROOT)/$(LIBCUPS); \
|
||||
if test "x$(LIBCUPSIMAGE)" != x; then \
|
||||
cp $(LIBCUPSIMAGE) $(SYMROOT); \
|
||||
dsymutil $(SYMROOT)/$(LIBCUPSIMAGE); \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
installstatic:
|
||||
@@ -281,6 +326,9 @@ installstatic:
|
||||
$(INSTALL_LIB) -m 755 $(LIBCUPSSTATIC) $(LIBDIR)
|
||||
$(RANLIB) $(LIBDIR)/$(LIBCUPSSTATIC)
|
||||
$(CHMOD) 555 $(LIBDIR)/$(LIBCUPSSTATIC)
|
||||
$(INSTALL_LIB) -m 755 libcupsimage.a $(LIBDIR)
|
||||
$(RANLIB) $(LIBDIR)/libcupsimage.a
|
||||
$(CHMOD) 555 $(LIBDIR)/libcupsimage.a
|
||||
|
||||
|
||||
#
|
||||
@@ -289,15 +337,26 @@ installstatic:
|
||||
|
||||
uninstall:
|
||||
$(RM) $(LIBDIR)/libcups.2.dylib
|
||||
$(RM) $(LIBDIR)/$(LIBCUPSSTATIC)
|
||||
$(RM) $(LIBDIR)/libcups.a
|
||||
$(RM) $(LIBDIR)/libcups.dylib
|
||||
$(RM) $(LIBDIR)/libcups.so
|
||||
$(RM) $(LIBDIR)/libcups.so.2
|
||||
$(RM) $(LIBDIR)/libcupsimage.2.dylib
|
||||
$(RM) $(LIBDIR)/libcupsimage.a
|
||||
$(RM) $(LIBDIR)/libcupsimage.dylib
|
||||
$(RM) $(LIBDIR)/libcupsimage.so
|
||||
$(RM) $(LIBDIR)/libcupsimage.so.2
|
||||
-$(RMDIR) $(LIBDIR)
|
||||
for file in $(HEADERS); do \
|
||||
$(RM) $(INCLUDEDIR)/cups/$$file; \
|
||||
done
|
||||
-$(RMDIR) $(INCLUDEDIR)/cups
|
||||
if test "x$(privateinclude)" != x; then \
|
||||
for file in $(HEADERSPRIV); do \
|
||||
$(RM) $(PRIVATEINCLUDE)/cups/$$file; \
|
||||
done
|
||||
$(RMDIR) $(PRIVATEINCLUDE)/cups; \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
@@ -306,8 +365,7 @@ uninstall:
|
||||
|
||||
libcups.so.2: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
|
||||
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
|
||||
$(RM) `basename $@ .2`
|
||||
$(LN) $@ `basename $@ .2`
|
||||
|
||||
@@ -316,21 +374,15 @@ libcups.so.2: $(LIBOBJS)
|
||||
# libcups.2.dylib
|
||||
#
|
||||
|
||||
libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
echo Creating export list for $@...
|
||||
nm -gm $(LIBOBJS) 2>/dev/null | grep "__text" | grep -v weak | \
|
||||
awk '{print $$NF}' | \
|
||||
grep -v -E -e '^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault)$$' | \
|
||||
sort >t.exp
|
||||
libcups.2.dylib: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
|
||||
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ \
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.12.0 \
|
||||
-current_version 2.14.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
-exported_symbols_list t.exp \
|
||||
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
$(RM) libcups.dylib t.exp
|
||||
$(LIBOBJS) $(LIBS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
$(RM) libcups.dylib
|
||||
$(LN) $@ libcups.dylib
|
||||
|
||||
|
||||
@@ -340,9 +392,8 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
|
||||
libcups.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
|
||||
-rpath $(LIBDIR) -version-info 2:12 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
|
||||
-rpath $(LIBDIR) -version-info 2:14 $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -360,27 +411,86 @@ libcups.a: $(LIBOBJS)
|
||||
# libcups2.def (Windows DLL exports file...)
|
||||
#
|
||||
|
||||
libcups2.def: $(LIBOBJS) Makefile
|
||||
libcups2.def: $(LIBOBJS) $(IMAGEOBJS) Makefile
|
||||
echo Generating $@...
|
||||
echo "LIBRARY libcups2" >libcups2.def
|
||||
echo "VERSION 2.12" >>libcups2.def
|
||||
echo "VERSION 2.14" >>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) | \
|
||||
(nm $(LIBOBJS) $(IMAGEOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
|
||||
echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy; \
|
||||
echo __cups_snprintf; echo __cups_vsnprintf; echo __cups_gettimeofday) | \
|
||||
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
|
||||
|
||||
|
||||
#
|
||||
# libcupsimage.so.2
|
||||
#
|
||||
|
||||
libcupsimage.so.2: $(IMAGEOBJS) libcups.so.2
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(IMAGEOBJS) $(LINKCUPS)
|
||||
$(RM) `basename $@ .2`
|
||||
$(LN) $@ `basename $@ .2`
|
||||
|
||||
|
||||
#
|
||||
# libcupsimage.2.dylib
|
||||
#
|
||||
|
||||
libcupsimage.2.dylib: $(IMAGEOBJS) libcups.2.dylib
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ \
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.3.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
$(IMAGEOBJS) $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
$(RM) libcupsimage.dylib
|
||||
$(LN) $@ libcupsimage.dylib
|
||||
|
||||
|
||||
#
|
||||
# libcupsimage.la
|
||||
#
|
||||
|
||||
libcupsimage.la: $(IMAGEOBJS) libcups.la
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) \
|
||||
$(LINKCUPS) -rpath $(LIBDIR) -version-info 2:3
|
||||
|
||||
|
||||
#
|
||||
# libcupsimage.a
|
||||
#
|
||||
|
||||
libcupsimage.a: $(IMAGEOBJS)
|
||||
echo Archiving $@...
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
|
||||
#
|
||||
# rasterbench (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
rasterbench: rasterbench.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ rasterbench.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
# testadmin (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testadmin: testadmin.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testadmin.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -389,8 +499,8 @@ testadmin: testadmin.o $(LIBCUPSSTATIC)
|
||||
|
||||
testarray: testarray.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testarray.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running array API tests...
|
||||
./testarray
|
||||
|
||||
@@ -401,8 +511,18 @@ testarray: testarray.o $(LIBCUPSSTATIC)
|
||||
|
||||
testcache: testcache.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testcache.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
# testclient (dependency on static libraries is intentional)
|
||||
#
|
||||
|
||||
testclient: testclient.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testclient.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -411,8 +531,8 @@ testcache: testcache.o $(LIBCUPSSTATIC)
|
||||
|
||||
testconflicts: testconflicts.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testconflicts.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -421,8 +541,8 @@ testconflicts: testconflicts.o $(LIBCUPSSTATIC)
|
||||
|
||||
testcreds: testcreds.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testcreds.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testcreds.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -431,8 +551,8 @@ testcreds: testcreds.o $(LIBCUPSSTATIC)
|
||||
|
||||
testcups: testcups.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testcups.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -441,8 +561,8 @@ testcups: testcups.o $(LIBCUPSSTATIC)
|
||||
|
||||
testdest: testdest.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testdest.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -451,8 +571,8 @@ testdest: testdest.o $(LIBCUPSSTATIC)
|
||||
|
||||
testfile: testfile.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testfile.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running file API tests...
|
||||
./testfile
|
||||
|
||||
@@ -463,8 +583,8 @@ testfile: testfile.o $(LIBCUPSSTATIC)
|
||||
|
||||
testgetdests: testgetdests.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testgetdests.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testgetdests.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -473,8 +593,8 @@ testgetdests: testgetdests.o $(LIBCUPSSTATIC)
|
||||
|
||||
testhttp: testhttp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testhttp.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running HTTP API tests...
|
||||
./testhttp
|
||||
|
||||
@@ -485,8 +605,8 @@ testhttp: testhttp.o $(LIBCUPSSTATIC)
|
||||
|
||||
testipp: testipp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testipp.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running IPP API tests...
|
||||
./testipp
|
||||
|
||||
@@ -497,8 +617,8 @@ testipp: testipp.o $(LIBCUPSSTATIC)
|
||||
|
||||
testi18n: testi18n.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testi18n.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running internationalization API tests...
|
||||
./testi18n
|
||||
|
||||
@@ -509,15 +629,10 @@ testi18n: testi18n.o $(LIBCUPSSTATIC)
|
||||
|
||||
testlang: testlang.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testlang.o $(LINKCUPSSTATIC)
|
||||
$(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; \
|
||||
@@ -533,8 +648,8 @@ testlang: testlang.o $(LIBCUPSSTATIC)
|
||||
|
||||
testoptions: testoptions.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testoptions.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running option API tests...
|
||||
./testoptions
|
||||
|
||||
@@ -545,8 +660,8 @@ testoptions: testoptions.o $(LIBCUPSSTATIC)
|
||||
|
||||
testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testppd.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running PPD API tests...
|
||||
./testppd
|
||||
|
||||
@@ -557,20 +672,32 @@ testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
|
||||
|
||||
testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testpwg.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running PWG API tests...
|
||||
./testpwg test.ppd
|
||||
|
||||
|
||||
#
|
||||
# testraster (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testraster: testraster.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testraster.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running raster API tests...
|
||||
./testraster
|
||||
|
||||
|
||||
#
|
||||
# testsnmp (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testsnmp: testsnmp.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testsnmp.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -579,8 +706,8 @@ testsnmp: testsnmp.o $(LIBCUPSSTATIC)
|
||||
|
||||
tlscheck: tlscheck.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ tlscheck.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -590,34 +717,34 @@ tlscheck: tlscheck.o $(LIBCUPSSTATIC)
|
||||
apihelp:
|
||||
echo Generating CUPS API help files...
|
||||
$(RM) cupspm.xml
|
||||
mxmldoc --section "Programming" --body cupspm.md \
|
||||
codedoc --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 \
|
||||
codedoc --section "Programming" --body cupspm.md \
|
||||
cupspm.xml > ../doc/help/cupspm.html
|
||||
$(RM) cupspm.xml
|
||||
mxmldoc --section "Programming" --title "Administration APIs" \
|
||||
codedoc --section "Programming" --title "Administration APIs" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-admin.header --intro api-admin.shtml \
|
||||
api-admin.xml \
|
||||
--header api-admin.header --body api-admin.shtml \
|
||||
adminutil.c adminutil.h getdevices.c >../doc/help/api-admin.html
|
||||
$(RM) api-admin.xml
|
||||
mxmldoc --section "Programming" --title "PPD API (DEPRECATED)" \
|
||||
codedoc --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
|
||||
$(RM) api-ppd.xml
|
||||
mxmldoc --section "Programming" \
|
||||
--header api-ppd.header --body api-ppd.shtml \
|
||||
ppd.h ppd-*.c raster-interstub.c >../doc/help/api-ppd.html
|
||||
codedoc --section "Programming" --title "Raster API" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-raster.header --body api-raster.shtml \
|
||||
../cups/raster.h raster-stubs.c \
|
||||
>../doc/help/api-raster.html
|
||||
codedoc --section "Programming" \
|
||||
--title "Filter and Backend Programming" \
|
||||
--css ../doc/cups-printable.css \
|
||||
--header api-filter.header --intro api-filter.shtml \
|
||||
api-filter.xml \
|
||||
--header api-filter.header --body api-filter.shtml \
|
||||
backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
|
||||
>../doc/help/api-filter.html
|
||||
$(RM) api-filter.xml
|
||||
|
||||
|
||||
#
|
||||
@@ -627,6 +754,8 @@ apihelp:
|
||||
sloc:
|
||||
echo "libcups: \c"
|
||||
sloccount $(LIBOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
|
||||
echo "libcupsimage: \c"
|
||||
sloccount $(IMAGEOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
|
||||
|
||||
|
||||
#
|
||||
|
||||
+23
-949
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+1
-1
@@ -77,7 +77,7 @@ extern ipp_status_t cupsGetDevices(http_t *http, int timeout,
|
||||
const char *include_schemes,
|
||||
const char *exclude_schemes,
|
||||
cups_device_cb_t callback,
|
||||
void *user_data) _CUPS_API_1_4;
|
||||
void *user_data) _CUPS_DEPRECATED;
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<!--
|
||||
Administrative API header for CUPS.
|
||||
|
||||
Copyright 2016 by Apple Inc.
|
||||
Copyright © 2016 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/".
|
||||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
information.
|
||||
-->
|
||||
|
||||
<h1 class='title'>Administrative APIs</h1>
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
<!--
|
||||
Administrative API documentation for CUPS.
|
||||
|
||||
Copyright 2016 by Apple Inc.
|
||||
Copyright © 2016 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/".
|
||||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
information.
|
||||
-->
|
||||
|
||||
<h2 class="title"><a name="OVERVIEW">Overview</a></h2>
|
||||
|
||||
<p>The administrative APIs provide convenience functions to perform certain administrative functions with the CUPS scheduler.</p>
|
||||
|
||||
<blockquote><b>Note:<b>
|
||||
<blockquote><b>Note:</b>
|
||||
<p>Administrative functions normally require administrative privileges to execute and must not be used in ordinary user applications!</p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
<!--
|
||||
Filter and backend programming header for CUPS.
|
||||
|
||||
Copyright 2008-2016 by Apple Inc.
|
||||
Copyright © 2008-2016 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/".
|
||||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
information.
|
||||
-->
|
||||
|
||||
<h1 class='title'>Filter and Backend Programming</h1>
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
<!--
|
||||
Filter and backend programming introduction for CUPS.
|
||||
|
||||
Copyright 2007-2016 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
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/".
|
||||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
information.
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name="OVERVIEW">Overview</a></h2>
|
||||
@@ -871,4 +868,7 @@ void *my_data;
|
||||
|
||||
</ol>
|
||||
|
||||
<blockquote><b>Note:</b> The sandbox profile used in CUPS 2.0 still allows some actions that are not listed above - these privileges will be removed over time until the profile matches the list above.</blockquote>
|
||||
<blockquote><b>Note:</b>
|
||||
|
||||
<p>The sandbox profile used in CUPS still allows some actions that are not listed above - these privileges will be removed over time until the profile matches the list above.</p>
|
||||
</blockquote>
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
<!--
|
||||
Introduction to CUPS programming header for CUPS.
|
||||
|
||||
Copyright 2008-2016 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'>Introduction to CUPS Programming</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Headers</th>
|
||||
<th>cups/cups.h<br>
|
||||
cups/adminutil.h<br>
|
||||
cups/array.h<br>
|
||||
cups/dir.h<br>
|
||||
cups/file.h<br>
|
||||
cups/http.h<br>
|
||||
cups/ipp.h<br>
|
||||
cups/language.h<br>
|
||||
cups/ppd.h<br>
|
||||
cups/pwg.h<br>
|
||||
cups/raster.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Libraries</th>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='raster-driver.html' target='_top'>Developing Raster Printer Drivers</a><br>
|
||||
Programming: <a href='postscript-driver.html' target='_top'>Developing PostScript Printer Drivers</a><br>
|
||||
Programming: <a href='api-filter.html' target='_top'>Filter and Backend Programming</a><br>
|
||||
Programming: <a href='ppd-compiler.html' target='_top'>Introduction to the PPD Compiler</a><br>
|
||||
Programming: <a href='api-admin.html' target='_top'>Administrative APIs</a><br>
|
||||
Programming: <a href='api-array.html' target='_top'>Array API</a><br>
|
||||
Programming: <a href='api-cups.html' target='_top'>CUPS API</a><br>
|
||||
Programming: <a href='api-filedir.html' target='_top'>File and Directory APIs</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 (DEPRECATED)</a><br>
|
||||
Programming: <a href='api-raster.html' target='_top'>Raster API</a><br>
|
||||
References: <a href='ref-ppdcfile.html' target='_top'>PPD Compiler Driver Information File Reference</a><br>
|
||||
Specifications: <a href='spec-ppd.html' target='_top'>CUPS PPD Extensions</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -1,92 +0,0 @@
|
||||
<!--
|
||||
Introduction to CUPS programming content 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/".
|
||||
-->
|
||||
|
||||
<h2 class="title"><a name="OVERVIEW">Overview</a></h2>
|
||||
|
||||
<p>CUPS provides two libraries that interface with the different parts of the
|
||||
printing system. The "cups" library provides all of the common application and
|
||||
filter functions while the "cupsimage" library provides all of the imaging
|
||||
functions used in raster printer drivers. The "cups" library functions are
|
||||
accessed by including the <var><cups/cups.h></var> header, while
|
||||
"cupsimage" functions are found in the <var><cups/raster.h></var>
|
||||
header.</p>
|
||||
|
||||
<h2 class="title"><a name="COMPILING">Compiling Programs</a></h2>
|
||||
|
||||
<p>The CUPS libraries can be used from any C, C++, or Objective C program.
|
||||
The method of compiling against the libraries varies depending on the
|
||||
operating system and installation of CUPS. The following sections show how
|
||||
to compile a simple program (shown below) in two common environments.</p>
|
||||
|
||||
<p>The following simple program lists the available printers on the system:</p>
|
||||
|
||||
<pre class="example">
|
||||
#include <stdio.h>
|
||||
#include <cups/cups.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int i;
|
||||
cups_dest_t *dests, *dest;
|
||||
int num_dests = cupsGetDests(&dests);
|
||||
|
||||
for (i = num_dests, dest = dests; i > 0; i --, dest ++)
|
||||
{
|
||||
if (dest->instance)
|
||||
printf("%s/%s\n", dest->name, dest->instance);
|
||||
else
|
||||
puts(dest->name);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3><a name="XCODE">Compiling with Xcode</a></h3>
|
||||
|
||||
<p>In Xcode, choose <var>New Project...</var> from the <var>File</var> menu,
|
||||
then select the <var>Standard Tool</var> project type under <var>Command Line
|
||||
Utility</var>. Click <var>Next</var> and choose a project directory. Click
|
||||
<var>Next</var> to create the project.</p>
|
||||
|
||||
<p>In the project window, double-click on the <var>Targets</var> group and
|
||||
control-click on the simple target to show the context menu. Choose
|
||||
<var>Existing Framework...</var> from the <var>Add</var> submenu. When the file
|
||||
chooser sheet appears, press the <kbd>/</kbd> key and enter "/usr/lib". Scroll
|
||||
down the file list and select the <var>libcups.dylib</var> file. Click the
|
||||
<var>Add</var> button in the file chooser and attributes sheets.</p>
|
||||
|
||||
<p>In the project window, double-click on the <var>main.c</var> source file.
|
||||
Replace the template source code with the listing above and save it. Click the
|
||||
<var>Build and Go</var> button to build the sample program and run it.</p>
|
||||
|
||||
<h3><a name="COMMANDLINE">Compiling with GCC</a></h3>
|
||||
|
||||
<p>From the command-line, create a file called <var>sample.c</var> using your
|
||||
favorite editor and then run the following command to compile it with GCC and
|
||||
run it:</p>
|
||||
|
||||
<pre class="command">
|
||||
gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`
|
||||
./simple
|
||||
</pre>
|
||||
|
||||
<p>The <code>cups-config</code> command provides the compiler flags
|
||||
("cups-config --cflags") and libraries ("cups-config --libs") needed for the
|
||||
local system.</p>
|
||||
|
||||
<h2 class="title"><a name="WHERETOGO">Where to Go Next</a></h2>
|
||||
|
||||
<p>If you are developing a print filter, driver, or backend, see the
|
||||
<a href="api-filter.html" target="_top">Filter and Backend Programming</a>
|
||||
guide. Raster printer driver developers should also read the
|
||||
<a href="api-raster.html" target="_top">Raster API</a> reference.</p>
|
||||
@@ -1,18 +1,18 @@
|
||||
<!--
|
||||
PPD API header for CUPS.
|
||||
|
||||
Copyright 2008-2012 by Apple Inc.
|
||||
Copyright © 2008-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/".
|
||||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
information.
|
||||
-->
|
||||
|
||||
<h1 class='title'>PPD API (DEPRECATED)</h1>
|
||||
|
||||
<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>
|
||||
<blockquote><b>Note:</b>
|
||||
|
||||
<p>The PPD API was deprecated in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="cupspm.html">CUPS Programming Manual</a> documentation. These functions will be removed in a future release of CUPS.</p>
|
||||
</blockquote>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
@@ -29,7 +29,7 @@
|
||||
<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><br>
|
||||
Programming: <a href='cupspm.html' target='_top'>CUPS Programming Manual</a><br>
|
||||
Specifications: <a href='spec-ppd.html' target='_top'>CUPS PPD Extensions</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
+12
-8
@@ -1,19 +1,19 @@
|
||||
<!--
|
||||
PPD API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2012 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright © 2007-2019 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/".
|
||||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
information.
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name='OVERVIEW'>Overview</a></h2>
|
||||
|
||||
<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>
|
||||
<blockquote><b>Note:</b>
|
||||
|
||||
<p>The PPD API was deprecated in CUPS 1.6/macOS 10.8. Please use the new Job Ticket APIs in the <a href="cupspm.html">CUPS Programming Manual</a> documentation. These functions will be removed in a future release of CUPS.</p>
|
||||
</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
|
||||
@@ -31,6 +31,7 @@ values as case-insensitive strings, so option "InputSlot" and choice "Upper"
|
||||
are equivalent to "inputslot" and "upper", respectively.</p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
<h3><a name="LOADING">Loading a PPD File</a></h3>
|
||||
|
||||
<p>The <a href="#ppdOpenFile"><code>ppdOpenFile</code></a> function "opens" a
|
||||
@@ -118,6 +119,7 @@ int num_options = cupsParseOptions(argv[5], 0, &options);
|
||||
cupsFreeOptions(num_options, options);
|
||||
</pre>
|
||||
|
||||
|
||||
<h3><a name="CONSTRAINTS">Constraints</a></h3>
|
||||
|
||||
<p>PPD files support specification of conflict conditions, called
|
||||
@@ -128,6 +130,7 @@ the options and choices that conflict with each other. The
|
||||
how many of the selected options are incompatible. Since constraints are
|
||||
normally specified in pairs, the returned value is typically an even number.</p>
|
||||
|
||||
|
||||
<h3><a name="PAGE_SIZES">Page Sizes</a></h3>
|
||||
|
||||
<p>Page sizes are special options which have physical dimensions and margins
|
||||
@@ -182,6 +185,7 @@ in points. Custom page size names can also be specified in inches
|
||||
<a href="#ppdPageSize"><code>ppdPageSize</code></a> function will return
|
||||
<code>NULL</code>.</p>
|
||||
|
||||
|
||||
<h3><a name="ATTRIBUTES">Attributes</a></h3>
|
||||
|
||||
<p>Every PPD file is composed of one or more attributes. Most of these
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<!--
|
||||
Raster API documentation for CUPS.
|
||||
|
||||
Copyright © 2008-2019 by Apple Inc.
|
||||
|
||||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
information.
|
||||
-->
|
||||
|
||||
<h1 class='title'>Raster API</h1>
|
||||
|
||||
<div class='summary'><table summary='General Information'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Header</th>
|
||||
<th>cups/raster.h</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='cupspm.html'>CUPS Programming Manual</a><br>
|
||||
Programming: <a href='api-ppd.html'>PPD API</a><br>
|
||||
References: <a href='spec-ppd.html'>CUPS PPD Specification</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></div>
|
||||
@@ -1,14 +1,11 @@
|
||||
<!--
|
||||
Raster API introduction for CUPS.
|
||||
|
||||
Copyright 2007-2013 by Apple Inc.
|
||||
Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
Copyright © 2007-2019 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/".
|
||||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
information.
|
||||
-->
|
||||
|
||||
<h2 class='title'><a name="OVERVIEW">Overview</a></h2>
|
||||
@@ -150,7 +147,7 @@ the memory used to read the raster file:</p>
|
||||
|
||||
<ul class="code">
|
||||
|
||||
<li><a href="#cupsRasterInterpretPPD" title="Interpret PPD commands to create a page header.">cupsRasterInterpretPPD</a></li>
|
||||
<li><a href="#cupsRasterInitPWGHeader" title="Interpret IPP attributes to create a page header.">cupsRasterInitPWGHeader</a></li>
|
||||
<li><a href="#cupsRasterWriteHeader" title="Write a raster page header from a version 1 page header structure.">cupsRasterWriteHeader</a> <span class="info">Deprecated in CUPS 1.2/macOS 10.5</span></li>
|
||||
<li><a href="#cupsRasterWriteHeader2" title="Write a raster page header from a version 2 page header structure.">cupsRasterWriteHeader2</a></li>
|
||||
<li><a href="#cupsRasterWritePixels" title="Write raster pixels.">cupsRasterWritePixels</a></li>
|
||||
@@ -30,9 +30,9 @@ extern "C" {
|
||||
*/
|
||||
|
||||
extern int _cupsArrayAddStrings(cups_array_t *a, const char *s,
|
||||
char delim) _CUPS_API_1_5;
|
||||
char delim) _CUPS_PRIVATE;
|
||||
extern cups_array_t *_cupsArrayNewStrings(const char *s, char delim)
|
||||
_CUPS_API_1_5;
|
||||
_CUPS_PRIVATE;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include "string-private.h"
|
||||
#include "debug-private.h"
|
||||
#include "debug-internal.h"
|
||||
#include "array-private.h"
|
||||
|
||||
|
||||
|
||||
+77
-159
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Authentication functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 2007-2019 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* This file contains Kerberos support code, copyright 2006 by
|
||||
@@ -15,21 +15,17 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.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>
|
||||
# ifdef HAVE_SECBASEPRIV_H
|
||||
# include <Security/SecBasePriv.h>
|
||||
# else
|
||||
extern const char *cssmErrorString(int error);
|
||||
# endif /* HAVE_SECBASEPRIV_H */
|
||||
#endif /* HAVE_AUTHORIZATION_H */
|
||||
|
||||
#if defined(SO_PEERCRED) && defined(AF_LOCAL)
|
||||
@@ -46,6 +42,9 @@ static const char *cups_auth_param(const char *scheme, const char *name, char *v
|
||||
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>
|
||||
@@ -113,9 +112,7 @@ cupsDoAuthentication(
|
||||
*www_auth, /* WWW-Authenticate header */
|
||||
*schemedata; /* Scheme-specific data */
|
||||
char scheme[256], /* Scheme name */
|
||||
prompt[1024], /* Prompt for user */
|
||||
realm[HTTP_MAX_VALUE], /* realm="xyz" string */
|
||||
nonce[HTTP_MAX_VALUE]; /* nonce="xyz" string */
|
||||
prompt[1024]; /* Prompt for user */
|
||||
int localauth; /* Local authentication result */
|
||||
_cups_globals_t *cg; /* Global data */
|
||||
|
||||
@@ -174,6 +171,8 @@ cupsDoAuthentication(
|
||||
* Check the scheme name...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("2cupsDoAuthentication: Trying scheme \"%s\"...", scheme));
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
if (!_cups_strcasecmp(scheme, "Negotiate"))
|
||||
{
|
||||
@@ -181,18 +180,36 @@ cupsDoAuthentication(
|
||||
* Kerberos authentication...
|
||||
*/
|
||||
|
||||
if (_cupsSetNegotiateAuthString(http, method, resource))
|
||||
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);
|
||||
}
|
||||
|
||||
break;
|
||||
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"))
|
||||
continue; /* Not supported (yet) */
|
||||
{
|
||||
/*
|
||||
* Other schemes not yet supported...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("2cupsDoAuthentication: Scheme \"%s\" not yet supported.", scheme));
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* See if we should retry the current username:password...
|
||||
@@ -212,7 +229,7 @@ cupsDoAuthentication(
|
||||
if (!cg->lang_default)
|
||||
cg->lang_default = cupsLangDefault();
|
||||
|
||||
if (cups_auth_param(scheme, "username", default_username, sizeof(default_username)))
|
||||
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);
|
||||
@@ -222,6 +239,7 @@ cupsDoAuthentication(
|
||||
|
||||
if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL)
|
||||
{
|
||||
DEBUG_puts("1cupsDoAuthentication: User canceled password request.");
|
||||
http->status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
|
||||
return (-1);
|
||||
}
|
||||
@@ -251,8 +269,10 @@ cupsDoAuthentication(
|
||||
|
||||
char encode[256]; /* Base64 buffer */
|
||||
|
||||
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"))
|
||||
{
|
||||
@@ -260,136 +280,30 @@ cupsDoAuthentication(
|
||||
* Digest authentication...
|
||||
*/
|
||||
|
||||
int i; /* Looping var */
|
||||
char algorithm[65], /* Hashing algorithm */
|
||||
opaque[HTTP_MAX_VALUE],
|
||||
/* Opaque data from server */
|
||||
cnonce[65], /* cnonce value */
|
||||
kd[65], /* Final MD5/SHA-256 digest */
|
||||
ha1[65], /* Hash of username:realm:password */
|
||||
ha2[65], /* Hash of method:request-uri */
|
||||
hdata[65], /* Hash of auth data */
|
||||
temp[1024], /* Temporary string */
|
||||
digest[1024]; /* Digest auth data */
|
||||
unsigned char hash[32]; /* Hash buffer */
|
||||
const char *hashalg; /* Hashing algorithm */
|
||||
size_t hashsize; /* Size of hash */
|
||||
char nonce[HTTP_MAX_VALUE]; /* nonce="xyz" string */
|
||||
|
||||
if (strcmp(nonce, http->nonce))
|
||||
{
|
||||
strlcpy(http->nonce, nonce, sizeof(http->nonce));
|
||||
http->nonce_count = 1;
|
||||
}
|
||||
else
|
||||
http->nonce_count ++;
|
||||
|
||||
cups_auth_param(schemedata, "opaque", opaque, sizeof(opaque));
|
||||
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", realm, sizeof(realm));
|
||||
cups_auth_param(schemedata, "realm", http->realm, sizeof(http->realm));
|
||||
|
||||
for (i = 0; i < 64; i ++)
|
||||
cnonce[i] = "0123456789ABCDEF"[CUPS_RAND() & 15];
|
||||
cnonce[64] = '\0';
|
||||
|
||||
if (cups_auth_param(schemedata, "algorithm", algorithm, sizeof(algorithm)))
|
||||
if (_httpSetDigestAuthString(http, nonce, method, resource))
|
||||
{
|
||||
/*
|
||||
* Follow RFC 2617/7616...
|
||||
*/
|
||||
|
||||
if (!_cups_strcasecmp(algorithm, "MD5"))
|
||||
{
|
||||
/*
|
||||
* RFC 2617 Digest with MD5
|
||||
*/
|
||||
|
||||
hashalg = "md5";
|
||||
}
|
||||
else if (!_cups_strcasecmp(algorithm, "SHA-256"))
|
||||
{
|
||||
/*
|
||||
* RFC 7616 Digest with SHA-256
|
||||
*/
|
||||
|
||||
hashalg = "sha2-256";
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Some other algorithm we don't support, skip this one...
|
||||
*/
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate digest value...
|
||||
*/
|
||||
|
||||
/* H(A1) = H(username:realm:password) */
|
||||
snprintf(temp, sizeof(temp), "%s:%s:%s", cupsUser(), realm, strchr(http->userpass, ':') + 1);
|
||||
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
|
||||
cupsHashString(hash, hashsize, ha1, sizeof(ha1));
|
||||
|
||||
/* H(A2) = H(method:uri) */
|
||||
snprintf(temp, sizeof(temp), "%s:%s", method, resource);
|
||||
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
|
||||
cupsHashString(hash, hashsize, ha2, sizeof(ha2));
|
||||
|
||||
/* H(data) = H(nonce:nc:cnonce:qop:H(A2)) */
|
||||
snprintf(temp, sizeof(temp), "%s:%08x:%s:auth:%s", nonce, http->nonce_count, cnonce, ha2);
|
||||
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
|
||||
cupsHashString(hash, hashsize, hdata, sizeof(hdata));
|
||||
|
||||
/* KD = H(H(A1):H(data)) */
|
||||
snprintf(temp, sizeof(temp), "%s:%s", ha1, hdata);
|
||||
hashsize = (size_t)cupsHashData(hashalg, (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
|
||||
cupsHashString(hash, hashsize, kd, sizeof(kd));
|
||||
|
||||
/* Pass the RFC 2617/7616 WWW-Authenticate header */
|
||||
if (opaque[0])
|
||||
snprintf(digest, sizeof(digest), "username=\"%s\", realm=\"%s\", nonce=\"%s\", algorithm=%s, qop=auth, opaque=\"%s\", cnonce=\"%s\", nc=%08x, uri=\"%s\", response=\"%s\"", cupsUser(), realm, nonce, algorithm, opaque, cnonce, http->nonce_count, resource, kd);
|
||||
else
|
||||
snprintf(digest, sizeof(digest), "username=\"%s\", realm=\"%s\", nonce=\"%s\", algorithm=%s, qop=auth, cnonce=\"%s\", nc=%08x, uri=\"%s\", response=\"%s\"", cupsUser(), realm, nonce, algorithm, cnonce, http->nonce_count, resource, kd);
|
||||
DEBUG_puts("2cupsDoAuthentication: Using Basic.");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Use old RFC 2069 Digest method...
|
||||
*/
|
||||
|
||||
/* H(A1) = H(username:realm:password) */
|
||||
snprintf(temp, sizeof(temp), "%s:%s:%s", cupsUser(), realm, strchr(http->userpass, ':') + 1);
|
||||
hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
|
||||
cupsHashString(hash, hashsize, ha1, sizeof(ha1));
|
||||
|
||||
/* H(A2) = H(method:uri) */
|
||||
snprintf(temp, sizeof(temp), "%s:%s", method, resource);
|
||||
hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
|
||||
cupsHashString(hash, hashsize, ha2, sizeof(ha2));
|
||||
|
||||
/* KD = H(H(A1):nonce:H(A2)) */
|
||||
snprintf(temp, sizeof(temp), "%s:%s:%s", ha1, nonce, ha2);
|
||||
hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
|
||||
cupsHashString(hash, hashsize, kd, sizeof(kd));
|
||||
|
||||
/* Pass the RFC 2069 WWW-Authenticate header */
|
||||
snprintf(digest, sizeof(digest), "username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\"", cupsUser(), realm, nonce, resource, kd);
|
||||
}
|
||||
|
||||
httpSetAuthString(http, "Digest", digest);
|
||||
}
|
||||
}
|
||||
|
||||
if (http->authstring)
|
||||
{
|
||||
DEBUG_printf(("1cupsDoAuthentication: authstring=\"%s\"", http->authstring));
|
||||
DEBUG_printf(("1cupsDoAuthentication: authstring=\"%s\".", http->authstring));
|
||||
|
||||
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);
|
||||
@@ -402,7 +316,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") */
|
||||
@@ -427,10 +341,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());
|
||||
@@ -475,7 +395,7 @@ _cupsSetNegotiateAuthString(
|
||||
cupsUser(), http->gsshost);
|
||||
|
||||
if ((password = cupsGetPassword2(prompt, http, method, resource)) == NULL)
|
||||
return (-1);
|
||||
return (CUPS_GSS_FAIL);
|
||||
|
||||
/*
|
||||
* Try to acquire credentials...
|
||||
@@ -529,18 +449,20 @@ _cupsSetNegotiateAuthString(
|
||||
}
|
||||
# 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
|
||||
else if (major_status == GSS_S_CONTINUE_NEEDED)
|
||||
cups_gss_printf(major_status, minor_status,
|
||||
"_cupsSetNegotiateAuthString: Continuation needed!");
|
||||
cups_gss_printf(major_status, minor_status, "_cupsSetNegotiateAuthString: Continuation needed");
|
||||
# endif /* DEBUG */
|
||||
|
||||
if (output_token.length > 0 && output_token.length <= 65536)
|
||||
@@ -551,7 +473,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);
|
||||
@@ -574,10 +496,10 @@ _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 */
|
||||
|
||||
@@ -614,7 +536,7 @@ cups_auth_find(const char *www_authenticate, /* I - Pointer into WWW-Authenticat
|
||||
* 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]))
|
||||
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...
|
||||
@@ -795,7 +717,7 @@ cups_auth_scheme(const char *www_authenticate, /* I - Pointer into WWW-Authentic
|
||||
* Parse the scheme name or param="value" string...
|
||||
*/
|
||||
|
||||
for (sptr = scheme, start = www_authenticate, param = 0; *www_authenticate && !isspace(*www_authenticate & 255); www_authenticate ++)
|
||||
for (sptr = scheme, start = www_authenticate, param = 0; *www_authenticate && *www_authenticate != ',' && !isspace(*www_authenticate & 255); www_authenticate ++)
|
||||
{
|
||||
if (*www_authenticate == '=')
|
||||
param = 1;
|
||||
@@ -1005,9 +927,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);
|
||||
@@ -1060,8 +982,8 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &http->auth_ref);
|
||||
if (status != errAuthorizationSuccess)
|
||||
{
|
||||
DEBUG_printf(("8cups_local_auth: AuthorizationCreate() returned %d (%s)",
|
||||
(int)status, cssmErrorString(status)));
|
||||
DEBUG_printf(("8cups_local_auth: AuthorizationCreate() returned %d",
|
||||
(int)status));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -1102,8 +1024,7 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
else if (status == errAuthorizationCanceled)
|
||||
return (-1);
|
||||
|
||||
DEBUG_printf(("9cups_local_auth: AuthorizationCopyRights() returned %d (%s)",
|
||||
(int)status, cssmErrorString(status)));
|
||||
DEBUG_printf(("9cups_local_auth: AuthorizationCopyRights() returned %d", (int)status));
|
||||
|
||||
/*
|
||||
* Fall through to try certificates...
|
||||
@@ -1115,10 +1036,6 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
if (cups_auth_find(www_auth, "Negotiate"))
|
||||
return (1);
|
||||
# endif /* HAVE_GSSAPI */
|
||||
# ifdef HAVE_AUTHORIZATION_H
|
||||
if (cups_auth_find(www_auth, "AuthRef"))
|
||||
return (1);
|
||||
# endif /* HAVE_AUTHORIZATION_H */
|
||||
|
||||
# if defined(SO_PEERCRED) && defined(AF_LOCAL)
|
||||
/*
|
||||
@@ -1168,7 +1085,7 @@ 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)));
|
||||
|
||||
if (!cups_auth_param(schemedata, "trc", trc, sizeof(trc)))
|
||||
{
|
||||
@@ -1180,7 +1097,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)
|
||||
@@ -1211,5 +1129,5 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
}
|
||||
|
||||
return (1);
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
#endif /* _WIN32 || __EMX__ */
|
||||
}
|
||||
|
||||
@@ -12,13 +12,14 @@
|
||||
*/
|
||||
|
||||
#include "cups.h"
|
||||
#include "sidechannel.h"
|
||||
#include <errno.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <io.h>
|
||||
# include <fcntl.h>
|
||||
#else
|
||||
# include <sys/time.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -71,11 +72,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 */
|
||||
}
|
||||
|
||||
|
||||
@@ -133,11 +134,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)
|
||||
{
|
||||
|
||||
+51
-36
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Private definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CUPS_PRIVATE_H_
|
||||
@@ -15,7 +16,6 @@
|
||||
*/
|
||||
|
||||
# include "string-private.h"
|
||||
# include "debug-private.h"
|
||||
# include "array-private.h"
|
||||
# include "ipp-private.h"
|
||||
# include "http-private.h"
|
||||
@@ -50,6 +50,24 @@ typedef struct _cups_buffer_s /**** Read/write buffer ****/
|
||||
d[1]; /* Data buffer */
|
||||
} _cups_buffer_t;
|
||||
|
||||
typedef struct _cups_raster_error_s /**** Error buffer structure ****/
|
||||
{
|
||||
char *start, /* Start of buffer */
|
||||
*current, /* Current position in buffer */
|
||||
*end; /* End of buffer */
|
||||
} _cups_raster_error_t;
|
||||
|
||||
typedef enum _cups_uatokens_e /**** UserAgentTokens values */
|
||||
{
|
||||
_CUPS_UATOKENS_NONE, /* Do not send User-Agent */
|
||||
_CUPS_UATOKENS_PRODUCT_ONLY, /* CUPS IPP */
|
||||
_CUPS_UATOKENS_MAJOR, /* CUPS/major IPP/2 */
|
||||
_CUPS_UATOKENS_MINOR, /* CUPS/major.minor IPP/2.1 */
|
||||
_CUPS_UATOKENS_MINIMAL, /* CUPS/major.minor.patch IPP/2.1 */
|
||||
_CUPS_UATOKENS_OS, /* CUPS/major.minor.patch (osname osversion) IPP/2.1 */
|
||||
_CUPS_UATOKENS_FULL /* CUPS/major.minor.patch (osname osversion; architecture) IPP/2.1 */
|
||||
} _cups_uatokens_t;
|
||||
|
||||
typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
{
|
||||
/* Multiple places... */
|
||||
@@ -121,6 +139,9 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
char pwg_name[65], /* PWG media name for custom size */
|
||||
ppd_name[41]; /* PPD media name for custom size */
|
||||
|
||||
/* raster-error.c */
|
||||
_cups_raster_error_t raster_error; /* Raster error information */
|
||||
|
||||
/* request.c */
|
||||
http_t *http; /* Current server connection */
|
||||
ipp_status_t last_error; /* Last IPP error */
|
||||
@@ -136,6 +157,7 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
char tempfile[1024]; /* cupsTempFd/File buffer */
|
||||
|
||||
/* usersys.c */
|
||||
_cups_uatokens_t uatokens; /* UserAgentTokens setting */
|
||||
http_encryption_t encryption; /* Encryption setting */
|
||||
char user[65], /* User name */
|
||||
user_agent[256],/* User-Agent string */
|
||||
@@ -218,45 +240,38 @@ struct _cups_dinfo_s /* Destination capability and status
|
||||
*/
|
||||
|
||||
# ifdef __APPLE__
|
||||
extern CFStringRef _cupsAppleCopyDefaultPaperID(void);
|
||||
extern CFStringRef _cupsAppleCopyDefaultPrinter(void);
|
||||
extern int _cupsAppleGetUseLastPrinter(void);
|
||||
extern void _cupsAppleSetDefaultPaperID(CFStringRef name);
|
||||
extern void _cupsAppleSetDefaultPrinter(CFStringRef name);
|
||||
extern void _cupsAppleSetUseLastPrinter(int uselast);
|
||||
extern CFStringRef _cupsAppleCopyDefaultPaperID(void) _CUPS_PRIVATE;
|
||||
extern CFStringRef _cupsAppleCopyDefaultPrinter(void) _CUPS_PRIVATE;
|
||||
extern int _cupsAppleGetUseLastPrinter(void) _CUPS_PRIVATE;
|
||||
extern void _cupsAppleSetDefaultPaperID(CFStringRef name) _CUPS_PRIVATE;
|
||||
extern void _cupsAppleSetDefaultPrinter(CFStringRef name) _CUPS_PRIVATE;
|
||||
extern void _cupsAppleSetUseLastPrinter(int uselast) _CUPS_PRIVATE;
|
||||
# endif /* __APPLE__ */
|
||||
|
||||
extern char *_cupsBufferGet(size_t size);
|
||||
extern void _cupsBufferRelease(char *b);
|
||||
extern char *_cupsBufferGet(size_t size) _CUPS_PRIVATE;
|
||||
extern void _cupsBufferRelease(char *b) _CUPS_PRIVATE;
|
||||
|
||||
extern http_t *_cupsConnect(void);
|
||||
extern char *_cupsCreateDest(const char *name, const char *info, const char *device_id, const char *device_uri, char *uri, size_t urisize);
|
||||
extern void _cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, _ipp_option_t *map, const char *name, const char *value);
|
||||
extern int _cupsGet1284Values(const char *device_id,
|
||||
cups_option_t **values);
|
||||
extern const char *_cupsGetDestResource(cups_dest_t *dest, char *resource,
|
||||
size_t resourcesize);
|
||||
extern int _cupsGetDests(http_t *http, ipp_op_t op,
|
||||
const char *name, cups_dest_t **dests,
|
||||
cups_ptype_t type, cups_ptype_t mask);
|
||||
extern const char *_cupsGetPassword(const char *prompt);
|
||||
extern void _cupsGlobalLock(void);
|
||||
extern _cups_globals_t *_cupsGlobals(void);
|
||||
extern void _cupsGlobalUnlock(void);
|
||||
extern http_t *_cupsConnect(void) _CUPS_PRIVATE;
|
||||
extern char *_cupsCreateDest(const char *name, const char *info, const char *device_id, const char *device_uri, char *uri, size_t urisize) _CUPS_PRIVATE;
|
||||
extern ipp_attribute_t *_cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, _ipp_option_t *map, const char *name, const char *value) _CUPS_PRIVATE;
|
||||
extern int _cupsGet1284Values(const char *device_id, cups_option_t **values) _CUPS_PRIVATE;
|
||||
extern const char *_cupsGetDestResource(cups_dest_t *dest, unsigned flags, char *resource, size_t resourcesize) _CUPS_PRIVATE;
|
||||
extern int _cupsGetDests(http_t *http, ipp_op_t op, const char *name, cups_dest_t **dests, cups_ptype_t type, cups_ptype_t mask) _CUPS_PRIVATE;
|
||||
extern const char *_cupsGetPassword(const char *prompt) _CUPS_PRIVATE;
|
||||
extern void _cupsGlobalLock(void) _CUPS_PRIVATE;
|
||||
extern _cups_globals_t *_cupsGlobals(void) _CUPS_PRIVATE;
|
||||
extern void _cupsGlobalUnlock(void) _CUPS_PRIVATE;
|
||||
# ifdef HAVE_GSSAPI
|
||||
extern const char *_cupsGSSServiceName(void);
|
||||
extern const char *_cupsGSSServiceName(void) _CUPS_PRIVATE;
|
||||
# endif /* HAVE_GSSAPI */
|
||||
extern int _cupsNextDelay(int current, int *previous);
|
||||
extern void _cupsSetDefaults(void);
|
||||
extern void _cupsSetError(ipp_status_t status, const char *message,
|
||||
int localize);
|
||||
extern void _cupsSetHTTPError(http_status_t status);
|
||||
extern int _cupsNextDelay(int current, int *previous) _CUPS_PRIVATE;
|
||||
extern void _cupsSetDefaults(void) _CUPS_INTERNAL;
|
||||
extern void _cupsSetError(ipp_status_t status, const char *message, int localize) _CUPS_PRIVATE;
|
||||
extern void _cupsSetHTTPError(http_status_t status) _CUPS_INTERNAL;
|
||||
# ifdef HAVE_GSSAPI
|
||||
extern int _cupsSetNegotiateAuthString(http_t *http,
|
||||
const char *method,
|
||||
const char *resource);
|
||||
extern int _cupsSetNegotiateAuthString(http_t *http, const char *method, const char *resource) _CUPS_PRIVATE;
|
||||
# endif /* HAVE_GSSAPI */
|
||||
extern char *_cupsUserDefault(char *name, size_t namesize);
|
||||
extern char *_cupsUserDefault(char *name, size_t namesize) _CUPS_INTERNAL;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+39
-39
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* API definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CUPS_H_
|
||||
@@ -15,12 +16,12 @@
|
||||
*/
|
||||
|
||||
# include <sys/types.h>
|
||||
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
|
||||
# if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
|
||||
# define __CUPS_SSIZE_T_DEFINED
|
||||
# include <stddef.h>
|
||||
/* Windows does not support the ssize_t type, so map it to long... */
|
||||
typedef long ssize_t; /* @private@ */
|
||||
# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
|
||||
# endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */
|
||||
|
||||
# include "file.h"
|
||||
# include "ipp.h"
|
||||
@@ -328,55 +329,55 @@ typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls,
|
||||
* Functions...
|
||||
*/
|
||||
|
||||
extern int cupsCancelJob(const char *name, int job_id);
|
||||
extern int cupsCancelJob(const char *name, int job_id) _CUPS_PUBLIC;
|
||||
extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request,
|
||||
const char *resource,
|
||||
const char *filename);
|
||||
const char *filename) _CUPS_PUBLIC;
|
||||
extern ipp_t *cupsDoRequest(http_t *http, ipp_t *request,
|
||||
const char *resource);
|
||||
const char *resource) _CUPS_PUBLIC;
|
||||
extern http_encryption_t cupsEncryption(void);
|
||||
extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs);
|
||||
extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs) _CUPS_PUBLIC;
|
||||
extern int cupsGetClasses(char ***classes) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead.");
|
||||
extern const char *cupsGetDefault(void);
|
||||
extern const char *cupsGetDefault(void) _CUPS_PUBLIC;
|
||||
extern int cupsGetJobs(cups_job_t **jobs, const char *name,
|
||||
int myjobs, int whichjobs);
|
||||
int myjobs, int whichjobs) _CUPS_PUBLIC;
|
||||
extern int cupsGetPrinters(char ***printers) _CUPS_DEPRECATED_MSG("Use cupsEnumDests instead.");
|
||||
extern ipp_status_t cupsLastError(void);
|
||||
extern ipp_status_t cupsLastError(void) _CUPS_PUBLIC;
|
||||
extern int cupsPrintFile(const char *name, const char *filename,
|
||||
const char *title, int num_options,
|
||||
cups_option_t *options);
|
||||
cups_option_t *options) _CUPS_PUBLIC;
|
||||
extern int cupsPrintFiles(const char *name, int num_files,
|
||||
const char **files, const char *title,
|
||||
int num_options, cups_option_t *options);
|
||||
int num_options, cups_option_t *options) _CUPS_PUBLIC;
|
||||
extern char *cupsTempFile(char *filename, int len) _CUPS_DEPRECATED_MSG("Use cupsTempFd or cupsTempFile2 instead.");
|
||||
extern int cupsTempFd(char *filename, int len);
|
||||
extern int cupsTempFd(char *filename, int len) _CUPS_PUBLIC;
|
||||
|
||||
extern int cupsAddDest(const char *name, const char *instance,
|
||||
int num_dests, cups_dest_t **dests);
|
||||
extern void cupsFreeDests(int num_dests, cups_dest_t *dests);
|
||||
int num_dests, cups_dest_t **dests) _CUPS_PUBLIC;
|
||||
extern void cupsFreeDests(int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
|
||||
extern cups_dest_t *cupsGetDest(const char *name, const char *instance,
|
||||
int num_dests, cups_dest_t *dests);
|
||||
extern int cupsGetDests(cups_dest_t **dests);
|
||||
extern void cupsSetDests(int num_dests, cups_dest_t *dests);
|
||||
int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
|
||||
extern int cupsGetDests(cups_dest_t **dests) _CUPS_PUBLIC;
|
||||
extern void cupsSetDests(int num_dests, cups_dest_t *dests) _CUPS_PUBLIC;
|
||||
|
||||
extern int cupsAddOption(const char *name, const char *value,
|
||||
int num_options, cups_option_t **options);
|
||||
int num_options, cups_option_t **options) _CUPS_PUBLIC;
|
||||
extern void cupsEncodeOptions(ipp_t *ipp, int num_options,
|
||||
cups_option_t *options);
|
||||
cups_option_t *options) _CUPS_PUBLIC;
|
||||
extern void cupsFreeOptions(int num_options,
|
||||
cups_option_t *options);
|
||||
cups_option_t *options) _CUPS_PUBLIC;
|
||||
extern const char *cupsGetOption(const char *name, int num_options,
|
||||
cups_option_t *options);
|
||||
cups_option_t *options) _CUPS_PUBLIC;
|
||||
extern int cupsParseOptions(const char *arg, int num_options,
|
||||
cups_option_t **options);
|
||||
cups_option_t **options) _CUPS_PUBLIC;
|
||||
|
||||
extern const char *cupsGetPassword(const char *prompt);
|
||||
extern const char *cupsServer(void);
|
||||
extern void cupsSetEncryption(http_encryption_t e);
|
||||
extern void cupsSetPasswordCB(cups_password_cb_t cb);
|
||||
extern void cupsSetServer(const char *server);
|
||||
extern void cupsSetUser(const char *user);
|
||||
extern const char *cupsUser(void);
|
||||
extern const char *cupsGetPassword(const char *prompt) _CUPS_PUBLIC;
|
||||
extern const char *cupsServer(void) _CUPS_PUBLIC;
|
||||
extern void cupsSetEncryption(http_encryption_t e) _CUPS_PUBLIC;
|
||||
extern void cupsSetPasswordCB(cups_password_cb_t cb) _CUPS_PUBLIC;
|
||||
extern void cupsSetServer(const char *server) _CUPS_PUBLIC;
|
||||
extern void cupsSetUser(const char *user) _CUPS_PUBLIC;
|
||||
extern const char *cupsUser(void) _CUPS_PUBLIC;
|
||||
|
||||
/**** New in CUPS 1.1.20 ****/
|
||||
extern int cupsDoAuthentication(http_t *http, const char *method,
|
||||
@@ -384,7 +385,7 @@ extern int cupsDoAuthentication(http_t *http, const char *method,
|
||||
_CUPS_API_1_1_20;
|
||||
extern http_status_t cupsGetFile(http_t *http, const char *resource,
|
||||
const char *filename) _CUPS_API_1_1_20;
|
||||
extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd);
|
||||
extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd) _CUPS_API_1_1_20;
|
||||
extern http_status_t cupsPutFile(http_t *http, const char *resource,
|
||||
const char *filename) _CUPS_API_1_1_20;
|
||||
extern http_status_t cupsPutFd(http_t *http, const char *resource, int fd)
|
||||
@@ -410,10 +411,6 @@ extern int cupsSetDests2(http_t *http, int num_dests,
|
||||
cups_dest_t *dests) _CUPS_API_1_1_21;
|
||||
|
||||
/**** New in CUPS 1.2/macOS 10.5 ****/
|
||||
extern ssize_t cupsBackChannelRead(char *buffer, size_t bytes,
|
||||
double timeout) _CUPS_API_1_2;
|
||||
extern ssize_t cupsBackChannelWrite(const char *buffer, size_t bytes,
|
||||
double timeout) _CUPS_API_1_2;
|
||||
extern void cupsEncodeOptions2(ipp_t *ipp, int num_options,
|
||||
cups_option_t *options,
|
||||
ipp_tag_t group_tag) _CUPS_API_1_2;
|
||||
@@ -600,9 +597,12 @@ extern ssize_t cupsHashData(const char *algorithm, const void *data, size_t dat
|
||||
extern int cupsAddIntegerOption(const char *name, int value, int num_options, cups_option_t **options) _CUPS_API_2_2_4;
|
||||
extern int cupsGetIntegerOption(const char *name, int num_options, cups_option_t *options) _CUPS_API_2_2_4;
|
||||
|
||||
/* New in CUPS 2.2.7 */
|
||||
extern const char *cupsHashString(const unsigned char *hash, size_t hashsize, char *buffer, size_t bufsize) _CUPS_API_2_2_7;
|
||||
|
||||
/* New in CUPS 2.3 */
|
||||
extern int cupsAddDestMediaOptions(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, unsigned flags, cups_size_t *size, int num_options, cups_option_t **options);
|
||||
extern const char *cupsHashString(const unsigned char *hash, size_t hashsize, char *buffer, size_t bufsize) _CUPS_API_2_3;
|
||||
extern int cupsAddDestMediaOptions(http_t *http, cups_dest_t *dest, cups_dinfo_t *dinfo, unsigned flags, cups_size_t *size, int num_options, cups_option_t **options) _CUPS_API_2_3;
|
||||
extern ipp_attribute_t *cupsEncodeOption(ipp_t *ipp, ipp_tag_t group_tag, const char *name, const char *value) _CUPS_API_2_3;
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
||||
Arquivo binário não exibido.
|
Antes Largura: | Altura: | Tamanho: 15 KiB Depois Largura: | Altura: | Tamanho: 13 KiB |
+22
-11
@@ -1,8 +1,8 @@
|
||||
---
|
||||
title: CUPS Programming Manual
|
||||
author: Michael R Sweet
|
||||
copyright: Copyright © 2007-2017 by Apple Inc. All Rights Reserved.
|
||||
version: 2.2.5
|
||||
copyright: Copyright © 2007-2019 by Apple Inc. All Rights Reserved.
|
||||
version: 2.3.0
|
||||
...
|
||||
|
||||
> Please [file issues on Github](https://github.com/apple/cups/issues) to
|
||||
@@ -25,7 +25,7 @@ the CUPS scheduler.
|
||||
|
||||
## Guidelines
|
||||
|
||||
When writing software that uses the "cups" library:
|
||||
When writing software (other than printer drivers) that uses the "cups" library:
|
||||
|
||||
- Do not use undocumented or deprecated APIs,
|
||||
- Do not rely on pre-configured printers,
|
||||
@@ -42,16 +42,23 @@ Similarly, printer and job management applications can use standard query
|
||||
operations to obtain the status information in a common, generic form and use
|
||||
standard management operations to control the state of those printers and jobs.
|
||||
|
||||
> **Note:**
|
||||
>
|
||||
> CUPS printer drivers necessarily depend on specific file formats and certain
|
||||
> implementation details of the CUPS software. Please consult the Postscript
|
||||
> and raster printer driver developer documentation on
|
||||
> [CUPS.org](https://www.cups.org/documentation.html) for more information.
|
||||
|
||||
|
||||
## Terms Used in This Document
|
||||
|
||||
A *Destination* is a printer or print queue that accepts print jobs. A
|
||||
*Print Job* is one or more documents that are processed by a destination
|
||||
using options supplied when creating the job. A *Document* is a file (JPEG
|
||||
image, PDF file, etc.) suitable for printing. An *Option* controls some aspect
|
||||
of printing, such as the media used. *Media* is the sheets or roll that is
|
||||
printed on. An *Attribute* is an option encoded for an Internet Printing
|
||||
Protocol (IPP) request.
|
||||
*Print Job* is a collection of one or more documents that are processed by a
|
||||
destination using options supplied when creating the job. A *Document* is a
|
||||
file (JPEG image, PDF file, etc.) suitable for printing. An *Option* controls
|
||||
some aspect of printing, such as the media used. *Media* is the sheets or roll
|
||||
that is printed on. An *Attribute* is an option encoded for an Internet
|
||||
Printing Protocol (IPP) request.
|
||||
|
||||
|
||||
## Compiling Programs That Use the CUPS API
|
||||
@@ -195,7 +202,9 @@ can have any of the following constant (bit) values set:
|
||||
|
||||
The callback function returns 0 to stop enumeration or 1 to continue.
|
||||
|
||||
> Note that the callback function will likely be called multiple times for the
|
||||
> **Note:**
|
||||
>
|
||||
> The callback function will likely be called multiple times for the
|
||||
> same destination, so it is up to the caller to suppress any duplicate
|
||||
> destinations.
|
||||
|
||||
@@ -817,7 +826,9 @@ which printer is being queried:
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
|
||||
"printer-uri", NULL, printer_uri);
|
||||
|
||||
> Note: If we wanted to query the scheduler instead of the device, we would look
|
||||
> **Note:**
|
||||
>
|
||||
> If we wanted to query the scheduler instead of the device, we would look
|
||||
> up the "printer-uri-supported" option instead of the "device-uri" value.
|
||||
|
||||
The `ippAddString` function adds the "printer-uri" attribute the the IPP
|
||||
|
||||
Arquivo binário não exibido.
|
Antes Largura: | Altura: | Tamanho: 166 KiB Depois Largura: | Altura: | Tamanho: 144 KiB |
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Internal debugging macros for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_DEBUG_INTERNAL_H_
|
||||
# define _CUPS_DEBUG_INTERNAL_H_
|
||||
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include "debug-private.h"
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* The debug macros are used if you compile with DEBUG defined.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* DEBUG_puts("string")
|
||||
* DEBUG_printf(("format string", arg, arg, ...));
|
||||
*
|
||||
* Note the extra parenthesis around the DEBUG_printf macro...
|
||||
*
|
||||
* Newlines are not required on the end of messages, as both add one when
|
||||
* writing the output.
|
||||
*
|
||||
* If the first character is a digit, then it represents the "log level" of the
|
||||
* message from 0 to 9. The default level is 1. The following defines the
|
||||
* current levels we use:
|
||||
*
|
||||
* 0 = public APIs, other than value accessor functions
|
||||
* 1 = return values for public APIs
|
||||
* 2 = public value accessor APIs, progress for public APIs
|
||||
* 3 = return values for value accessor APIs
|
||||
* 4 = private APIs, progress for value accessor APIs
|
||||
* 5 = return values for private APIs
|
||||
* 6 = progress for private APIs
|
||||
* 7 = static functions
|
||||
* 8 = return values for static functions
|
||||
* 9 = progress for static functions
|
||||
*/
|
||||
|
||||
# ifdef DEBUG
|
||||
# define DEBUG_puts(x) _cups_debug_puts(x)
|
||||
# define DEBUG_printf(x) _cups_debug_printf x
|
||||
# else
|
||||
# define DEBUG_puts(x)
|
||||
# define DEBUG_printf(x)
|
||||
# endif /* DEBUG */
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
# ifdef DEBUG
|
||||
extern int _cups_debug_fd _CUPS_INTERNAL;
|
||||
extern int _cups_debug_level _CUPS_INTERNAL;
|
||||
extern void _cups_debug_printf(const char *format, ...) _CUPS_FORMAT(1,2) _CUPS_INTERNAL;
|
||||
extern void _cups_debug_puts(const char *s) _CUPS_INTERNAL;
|
||||
# endif /* DEBUG */
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_DEBUG_INTERNAL_H_ */
|
||||
+12
-52
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Private debugging macros for CUPS.
|
||||
* Private debugging APIs for CUPS.
|
||||
*
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_DEBUG_PRIVATE_H_
|
||||
@@ -32,51 +33,17 @@ extern "C" {
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* DEBUG_puts("string")
|
||||
* DEBUG_printf(("format string", arg, arg, ...));
|
||||
*
|
||||
* Note the extra parenthesis around the DEBUG_printf macro...
|
||||
*
|
||||
* Newlines are not required on the end of messages, as both add one when
|
||||
* writing the output.
|
||||
*
|
||||
* If the first character is a digit, then it represents the "log level" of the
|
||||
* message from 0 to 9. The default level is 1. The following defines the
|
||||
* current levels we use:
|
||||
*
|
||||
* 0 = public APIs, other than value accessor functions
|
||||
* 1 = return values for public APIs
|
||||
* 2 = public value accessor APIs, progress for public APIs
|
||||
* 3 = return values for value accessor APIs
|
||||
* 4 = private APIs, progress for value accessor APIs
|
||||
* 5 = return values for private APIs
|
||||
* 6 = progress for private APIs
|
||||
* 7 = static functions
|
||||
* 8 = return values for static functions
|
||||
* 9 = progress for static functions
|
||||
* DEBUG_set("logfile", "level", "filter", 1)
|
||||
*
|
||||
* The DEBUG_set macro allows an application to programmatically enable (or
|
||||
* disable) debug logging. The arguments correspond to the CUPS_DEBUG_LOG,
|
||||
* CUPS_DEBUG_LEVEL, and CUPS_DEBUG_FILTER environment variables.
|
||||
* CUPS_DEBUG_LEVEL, and CUPS_DEBUG_FILTER environment variables. The 1 on the
|
||||
* end forces the values to override the environment.
|
||||
*/
|
||||
|
||||
# ifdef DEBUG
|
||||
# ifdef WIN32
|
||||
# ifdef LIBCUPS2_EXPORTS
|
||||
# define DLLExport __declspec(dllexport)
|
||||
# else
|
||||
# define DLLExport
|
||||
# endif /* LIBCUPS2_EXPORTS */
|
||||
# else
|
||||
# define DLLExport
|
||||
# endif /* WIN32 */
|
||||
# define DEBUG_puts(x) _cups_debug_puts(x)
|
||||
# define DEBUG_printf(x) _cups_debug_printf x
|
||||
# define DEBUG_set(logfile,level,filter) _cups_debug_set(logfile,level,filter,1)
|
||||
# else
|
||||
# define DLLExport
|
||||
# define DEBUG_puts(x)
|
||||
# define DEBUG_printf(x)
|
||||
# define DEBUG_set(logfile,level,filter)
|
||||
# endif /* DEBUG */
|
||||
|
||||
@@ -85,18 +52,11 @@ extern "C" {
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern int _cups_debug_fd;
|
||||
extern int _cups_debug_level;
|
||||
extern void DLLExport _cups_debug_printf(const char *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 1, 2)));
|
||||
extern void DLLExport _cups_debug_puts(const char *s);
|
||||
extern void DLLExport _cups_debug_set(const char *logfile,
|
||||
const char *level, const char *filter,
|
||||
int force);
|
||||
# ifdef WIN32
|
||||
extern int _cups_gettimeofday(struct timeval *tv, void *tz);
|
||||
extern void _cups_debug_set(const char *logfile, const char *level, const char *filter, int force) _CUPS_PRIVATE;
|
||||
# ifdef _WIN32
|
||||
extern int _cups_gettimeofday(struct timeval *tv, void *tz) _CUPS_PRIVATE;
|
||||
# define gettimeofday(a,b) _cups_gettimeofday(a, b)
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
||||
+28
-8
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* Debugging functions for CUPS.
|
||||
*
|
||||
* Copyright 2008-2015 by Apple Inc.
|
||||
* Copyright © 2008-2018 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -11,8 +12,9 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
#include "thread-private.h"
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <sys/timeb.h>
|
||||
# include <time.h>
|
||||
# include <io.h>
|
||||
@@ -30,11 +32,12 @@ _cups_gettimeofday(struct timeval *tv, /* I - Timeval struct */
|
||||
#else
|
||||
# include <sys/time.h>
|
||||
# include <unistd.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
#include <regex.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* Globals...
|
||||
*/
|
||||
@@ -45,7 +48,6 @@ int _cups_debug_level = 1;
|
||||
/* Log level (0 to 9) */
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
@@ -77,7 +79,7 @@ debug_thread_id(void)
|
||||
* '_cups_debug_printf()' - Write a formatted line to the log.
|
||||
*/
|
||||
|
||||
void DLLExport
|
||||
void
|
||||
_cups_debug_printf(const char *format, /* I - Printf-style format string */
|
||||
...) /* I - Additional arguments as needed */
|
||||
{
|
||||
@@ -162,7 +164,7 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
|
||||
* '_cups_debug_puts()' - Write a single line to the log.
|
||||
*/
|
||||
|
||||
void DLLExport
|
||||
void
|
||||
_cups_debug_puts(const char *s) /* I - String to output */
|
||||
{
|
||||
struct timeval curtime; /* Current time */
|
||||
@@ -242,7 +244,7 @@ _cups_debug_puts(const char *s) /* I - String to output */
|
||||
* '_cups_debug_set()' - Enable or disable debug logging.
|
||||
*/
|
||||
|
||||
void DLLExport
|
||||
void
|
||||
_cups_debug_set(const char *logfile, /* I - Log file or NULL */
|
||||
const char *level, /* I - Log level or NULL */
|
||||
const char *filter, /* I - Filter string or NULL */
|
||||
@@ -312,6 +314,24 @@ _cups_debug_set(const char *logfile, /* I - Log file or NULL */
|
||||
|
||||
_cupsMutexUnlock(&debug_init_mutex);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
/*
|
||||
* '_cups_debug_set()' - Enable or disable debug logging.
|
||||
*/
|
||||
|
||||
void
|
||||
_cups_debug_set(const char *logfile, /* I - Log file or NULL */
|
||||
const char *level, /* I - Log level or NULL */
|
||||
const char *filter, /* I - Filter string or NULL */
|
||||
int force) /* I - Force initialization */
|
||||
{
|
||||
(void)logfile;
|
||||
(void)level;
|
||||
(void)filter;
|
||||
(void)force;
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+68
-27
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* Destination option/media support for CUPS.
|
||||
*
|
||||
* Copyright 2012-2017 by Apple Inc.
|
||||
* Copyright © 2012-2019 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -11,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -26,7 +28,7 @@
|
||||
|
||||
static void cups_add_dconstres(cups_array_t *a, ipp_t *collection);
|
||||
static int cups_collection_contains(ipp_t *test, ipp_t *match);
|
||||
static size_t cups_collection_string(ipp_attribute_t *attr, char *buffer, size_t bufsize);
|
||||
static size_t cups_collection_string(ipp_attribute_t *attr, char *buffer, size_t bufsize) _CUPS_NONNULL((1,2));
|
||||
static int cups_compare_dconstres(_cups_dconstres_t *a,
|
||||
_cups_dconstres_t *b);
|
||||
static int cups_compare_media_db(_cups_media_db_t *a,
|
||||
@@ -177,6 +179,7 @@ cupsCheckDestSupported(
|
||||
ipp_res_t units_value; /* Resolution units */
|
||||
ipp_attribute_t *attr; /* Attribute */
|
||||
_ipp_value_t *attrval; /* Current attribute value */
|
||||
_ipp_option_t *map; /* Option mapping information */
|
||||
|
||||
|
||||
/*
|
||||
@@ -268,9 +271,14 @@ cupsCheckDestSupported(
|
||||
* Check literal values...
|
||||
*/
|
||||
|
||||
map = _ippFindOption(option);
|
||||
|
||||
switch (attr->value_tag)
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
if (map && map->value_tag == IPP_TAG_STRING)
|
||||
return (strlen(value) <= (size_t)attr->values[0].integer);
|
||||
|
||||
case IPP_TAG_ENUM :
|
||||
int_value = atoi(value);
|
||||
|
||||
@@ -283,7 +291,10 @@ cupsCheckDestSupported(
|
||||
return (attr->values[0].boolean);
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
int_value = atoi(value);
|
||||
if (map && map->value_tag == IPP_TAG_STRING)
|
||||
int_value = (int)strlen(value);
|
||||
else
|
||||
int_value = atoi(value);
|
||||
|
||||
for (i = 0; i < attr->num_values; i ++)
|
||||
if (int_value >= attr->values[i].range.lower &&
|
||||
@@ -666,6 +677,7 @@ cupsCopyDestInfo(
|
||||
cups_dest_t *dest) /* I - Destination */
|
||||
{
|
||||
cups_dinfo_t *dinfo; /* Destination information */
|
||||
unsigned dflags; /* Destination flags */
|
||||
ipp_t *request, /* Get-Printer-Attributes request */
|
||||
*response; /* Supported attributes */
|
||||
int tries, /* Number of tries so far */
|
||||
@@ -675,6 +687,7 @@ cupsCopyDestInfo(
|
||||
char resource[1024]; /* Resource path */
|
||||
int version; /* IPP version */
|
||||
ipp_status_t status; /* Status of request */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
static const char * const requested_attrs[] =
|
||||
{ /* Requested attributes */
|
||||
"job-template",
|
||||
@@ -683,14 +696,35 @@ cupsCopyDestInfo(
|
||||
};
|
||||
|
||||
|
||||
DEBUG_printf(("cupsCopyDestSupported(http=%p, dest=%p(%s))", (void *)http, (void *)dest, dest ? dest->name : ""));
|
||||
DEBUG_printf(("cupsCopyDestInfo(http=%p, dest=%p(%s))", (void *)http, (void *)dest, dest ? dest->name : ""));
|
||||
|
||||
/*
|
||||
* Get the default connection as needed...
|
||||
*/
|
||||
|
||||
if (!http)
|
||||
http = _cupsConnect();
|
||||
{
|
||||
DEBUG_puts("1cupsCopyDestInfo: Default server connection.");
|
||||
http = _cupsConnect();
|
||||
dflags = CUPS_DEST_FLAGS_NONE;
|
||||
}
|
||||
#ifdef AF_LOCAL
|
||||
else if (httpAddrFamily(http->hostaddr) == AF_LOCAL)
|
||||
{
|
||||
DEBUG_puts("1cupsCopyDestInfo: Connection to server (domain socket).");
|
||||
dflags = CUPS_DEST_FLAGS_NONE;
|
||||
}
|
||||
#endif /* AF_LOCAL */
|
||||
else if ((strcmp(http->hostname, cg->server) && cg->server[0] != '/') || cg->ipp_port != httpAddrPort(http->hostaddr))
|
||||
{
|
||||
DEBUG_printf(("1cupsCopyDestInfo: Connection to device (%s).", http->hostname));
|
||||
dflags = CUPS_DEST_FLAGS_DEVICE;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_printf(("1cupsCopyDestInfo: Connection to server (%s).", http->hostname));
|
||||
dflags = CUPS_DEST_FLAGS_NONE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
@@ -703,8 +737,11 @@ cupsCopyDestInfo(
|
||||
* Get the printer URI and resource path...
|
||||
*/
|
||||
|
||||
if ((uri = _cupsGetDestResource(dest, resource, sizeof(resource))) == NULL)
|
||||
if ((uri = _cupsGetDestResource(dest, dflags, resource, sizeof(resource))) == NULL)
|
||||
{
|
||||
DEBUG_puts("1cupsCopyDestInfo: Unable to get resource.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the supported attributes...
|
||||
@@ -722,28 +759,25 @@ cupsCopyDestInfo(
|
||||
*/
|
||||
|
||||
request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
|
||||
uri);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requesting-user-name", NULL, cupsUser());
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes",
|
||||
(int)(sizeof(requested_attrs) / sizeof(requested_attrs[0])),
|
||||
NULL, requested_attrs);
|
||||
|
||||
ippSetVersion(request, version / 10, version % 10);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", (int)(sizeof(requested_attrs) / sizeof(requested_attrs[0])), NULL, requested_attrs);
|
||||
response = cupsDoRequest(http, request, resource);
|
||||
status = cupsLastError();
|
||||
|
||||
if (status > IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED)
|
||||
{
|
||||
DEBUG_printf(("cupsCopyDestSupported: Get-Printer-Attributes for '%s' "
|
||||
"returned %s (%s)", dest->name, ippErrorString(status),
|
||||
cupsLastErrorString()));
|
||||
DEBUG_printf(("1cupsCopyDestInfo: Get-Printer-Attributes for '%s' returned %s (%s)", dest->name, ippErrorString(status), cupsLastErrorString()));
|
||||
|
||||
ippDelete(response);
|
||||
response = NULL;
|
||||
|
||||
if (status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED && version > 11)
|
||||
if ((status == IPP_STATUS_ERROR_BAD_REQUEST || status == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED) && version > 11)
|
||||
{
|
||||
version = 11;
|
||||
}
|
||||
else if (status == IPP_STATUS_ERROR_BUSY)
|
||||
{
|
||||
sleep((unsigned)delay);
|
||||
@@ -759,7 +793,10 @@ cupsCopyDestInfo(
|
||||
while (!response && tries < 10);
|
||||
|
||||
if (!response)
|
||||
{
|
||||
DEBUG_puts("1cupsCopyDestInfo: Unable to get printer attributes.");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate a cups_dinfo_t structure and return it...
|
||||
@@ -772,6 +809,8 @@ cupsCopyDestInfo(
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
DEBUG_printf(("1cupsCopyDestInfo: version=%d, uri=\"%s\", resource=\"%s\".", version, uri, resource));
|
||||
|
||||
dinfo->version = version;
|
||||
dinfo->uri = uri;
|
||||
dinfo->resource = _cupsStrAlloc(resource);
|
||||
@@ -1497,18 +1536,18 @@ cups_collection_string(
|
||||
if (!ippGetBoolean(member, 0))
|
||||
{
|
||||
if (bufptr < bufend)
|
||||
strlcpy(bufptr, "no", bufend - bufptr + 1);
|
||||
strlcpy(bufptr, "no", (size_t)(bufend - bufptr + 1));
|
||||
bufptr += 2;
|
||||
}
|
||||
|
||||
if (bufptr < bufend)
|
||||
strlcpy(bufptr, mname, bufend - bufptr + 1);
|
||||
strlcpy(bufptr, mname, (size_t)(bufend - bufptr + 1));
|
||||
bufptr += strlen(mname);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bufptr < bufend)
|
||||
strlcpy(bufptr, mname, bufend - bufptr + 1);
|
||||
strlcpy(bufptr, mname, (size_t)(bufend - bufptr + 1));
|
||||
bufptr += strlen(mname);
|
||||
|
||||
if (bufptr < bufend)
|
||||
@@ -1544,7 +1583,7 @@ cups_collection_string(
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
bufptr += snprintf(bufptr, bufptr < bufend ? (bufend - bufptr + 1) : 0, "%d", ippGetInteger(member, j));
|
||||
bufptr += snprintf(bufptr, bufptr < bufend ? (size_t)(bufend - bufptr + 1) : 0, "%d", ippGetInteger(member, j));
|
||||
break;
|
||||
|
||||
case IPP_TAG_STRING :
|
||||
@@ -1588,7 +1627,7 @@ cups_collection_string(
|
||||
else
|
||||
snprintf(temp, sizeof(temp), "%04u-%02u-%02uT%02u:%02u:%02u%c%02u%02u", year, date[2], date[3], date[4], date[5], date[6], date[8], date[9], date[10]);
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
if (bufptr < bufend)
|
||||
strlcpy(bufptr, temp, (size_t)(bufend - bufptr + 1));
|
||||
|
||||
bufptr += strlen(temp);
|
||||
@@ -1608,7 +1647,7 @@ cups_collection_string(
|
||||
else
|
||||
snprintf(temp, sizeof(temp), "%dx%d%s", xres, yres, units == IPP_RES_PER_INCH ? "dpi" : "dpcm");
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
if (bufptr < bufend)
|
||||
strlcpy(bufptr, temp, (size_t)(bufend - bufptr + 1));
|
||||
|
||||
bufptr += strlen(temp);
|
||||
@@ -1624,7 +1663,7 @@ cups_collection_string(
|
||||
|
||||
snprintf(temp, sizeof(temp), "%d-%d", lower, upper);
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
if (bufptr < bufend)
|
||||
strlcpy(bufptr, temp, (size_t)(bufend - bufptr + 1));
|
||||
|
||||
bufptr += strlen(temp);
|
||||
@@ -2483,8 +2522,10 @@ cups_get_media_db(http_t *http, /* I - Connection to destination */
|
||||
strlcpy(size->media, best->key, sizeof(size->media));
|
||||
else if (best->size_name)
|
||||
strlcpy(size->media, best->size_name, sizeof(size->media));
|
||||
else
|
||||
else if (pwg && pwg->pwg)
|
||||
strlcpy(size->media, pwg->pwg, sizeof(size->media));
|
||||
else
|
||||
strlcpy(size->media, "unknown", sizeof(size->media));
|
||||
|
||||
size->width = best->width;
|
||||
size->length = best->length;
|
||||
|
||||
+93
-173
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* User-defined destination (and option) support for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -12,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_NOTIFY_H
|
||||
@@ -42,10 +44,10 @@
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
# if !TARGET_OS_IOS
|
||||
# if HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME
|
||||
# include <SystemConfiguration/SystemConfiguration.h>
|
||||
# define _CUPS_LOCATION_DEFAULTS 1
|
||||
# endif /* !TARGET_OS_IOS */
|
||||
# endif /* HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
|
||||
# define kCUPSPrintingPrefs CFSTR("org.cups.PrintingPrefs")
|
||||
# define kDefaultPaperIDKey CFSTR("DefaultPaperID")
|
||||
# define kLastUsedPrintersKey CFSTR("LastUsedPrinters")
|
||||
@@ -73,7 +75,6 @@ typedef enum _cups_dnssd_state_e /* Enumerated device state */
|
||||
_CUPS_DNSSD_QUERY,
|
||||
_CUPS_DNSSD_PENDING,
|
||||
_CUPS_DNSSD_ACTIVE,
|
||||
_CUPS_DNSSD_LOCAL,
|
||||
_CUPS_DNSSD_INCOMPATIBLE,
|
||||
_CUPS_DNSSD_ERROR
|
||||
} _cups_dnssd_state_t;
|
||||
@@ -192,14 +193,6 @@ static _cups_dnssd_device_t *
|
||||
const char *regtype,
|
||||
const char *replyDomain);
|
||||
# ifdef HAVE_DNSSD
|
||||
static void cups_dnssd_local_cb(DNSServiceRef sdRef,
|
||||
DNSServiceFlags flags,
|
||||
uint32_t interfaceIndex,
|
||||
DNSServiceErrorType errorCode,
|
||||
const char *serviceName,
|
||||
const char *regtype,
|
||||
const char *replyDomain,
|
||||
void *context);
|
||||
static void cups_dnssd_query_cb(DNSServiceRef sdRef,
|
||||
DNSServiceFlags flags,
|
||||
uint32_t interfaceIndex,
|
||||
@@ -572,7 +565,7 @@ _cupsAppleSetUseLastPrinter(
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsConnectDest()' - Open a conection to the destination.
|
||||
* 'cupsConnectDest()' - Open a connection to the destination.
|
||||
*
|
||||
* Connect to the destination, returning a new @code http_t@ connection object
|
||||
* and optionally the resource path to use for the destination. These calls
|
||||
@@ -581,7 +574,7 @@ _cupsAppleSetUseLastPrinter(
|
||||
* returns 0. The caller is responsible for calling @link httpClose@ on the
|
||||
* returned connection.
|
||||
*
|
||||
* Starting with CUPS 2.2.4, the caller can pass @code CUPS_DEST_FLAGS_DEVICE@
|
||||
* Starting with CUPS 2.2.4, the caller can pass @code CUPS_DEST_FLAGS_DEVICE@
|
||||
* for the "flags" argument to connect directly to the device associated with
|
||||
* the destination. Otherwise, the connection is made to the CUPS scheduler
|
||||
* associated with the destination.
|
||||
@@ -849,6 +842,8 @@ cupsCopyDest(cups_dest_t *dest, /* I - Destination to copy */
|
||||
|
||||
if (new_dest)
|
||||
{
|
||||
new_dest->is_default = dest->is_default;
|
||||
|
||||
if ((new_dest->options = calloc(sizeof(cups_option_t), (size_t)dest->num_options)) == NULL)
|
||||
return (cupsRemoveDest(dest->name, dest->instance, num_dests, dests));
|
||||
|
||||
@@ -1101,20 +1096,23 @@ cupsGetDest(const char *name, /* I - Destination name or @code NULL@ for the d
|
||||
* '_cupsGetDestResource()' - Get the resource path and URI for a destination.
|
||||
*/
|
||||
|
||||
const char * /* O - Printer URI */
|
||||
const char * /* O - URI */
|
||||
_cupsGetDestResource(
|
||||
cups_dest_t *dest, /* I - Destination */
|
||||
unsigned flags, /* I - Destination flags */
|
||||
char *resource, /* I - Resource buffer */
|
||||
size_t resourcesize) /* I - Size of resource buffer */
|
||||
{
|
||||
const char *uri; /* Printer URI */
|
||||
const char *uri, /* URI */
|
||||
*device_uri, /* Device URI */
|
||||
*printer_uri; /* Printer URI */
|
||||
char scheme[32], /* URI scheme */
|
||||
userpass[256], /* Username and password (unused) */
|
||||
hostname[256]; /* Hostname */
|
||||
int port; /* Port number */
|
||||
|
||||
|
||||
DEBUG_printf(("_cupsGetDestResource(dest=%p(%s), resource=%p, resourcesize=%d)", (void *)dest, dest->name, (void *)resource, (int)resourcesize));
|
||||
DEBUG_printf(("_cupsGetDestResource(dest=%p(%s), flags=%u, resource=%p, resourcesize=%d)", (void *)dest, dest->name, flags, (void *)resource, (int)resourcesize));
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
@@ -1130,25 +1128,46 @@ _cupsGetDestResource(
|
||||
}
|
||||
|
||||
/*
|
||||
* Grab the printer URI...
|
||||
* Grab the printer and device URIs...
|
||||
*/
|
||||
|
||||
if ((uri = cupsGetOption("printer-uri-supported", dest->num_options, dest->options)) == NULL)
|
||||
{
|
||||
if ((uri = cupsGetOption("device-uri", dest->num_options, dest->options)) != NULL)
|
||||
{
|
||||
device_uri = cupsGetOption("device-uri", dest->num_options, dest->options);
|
||||
printer_uri = cupsGetOption("printer-uri-supported", dest->num_options, dest->options);
|
||||
|
||||
DEBUG_printf(("1_cupsGetDestResource: device-uri=\"%s\", printer-uri-supported=\"%s\".", device_uri, printer_uri));
|
||||
|
||||
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
if (strstr(uri, "._tcp"))
|
||||
uri = cups_dnssd_resolve(dest, uri, 5000, NULL, NULL, NULL);
|
||||
#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
}
|
||||
|
||||
if (uri)
|
||||
if (((flags & CUPS_DEST_FLAGS_DEVICE) || !printer_uri) && strstr(device_uri, "._tcp"))
|
||||
{
|
||||
if ((device_uri = cups_dnssd_resolve(dest, device_uri, 5000, NULL, NULL, NULL)) != NULL)
|
||||
{
|
||||
DEBUG_printf(("1_cupsGetDestResource: Resolved printer-uri-supported=\"%s\"", uri));
|
||||
|
||||
uri = _cupsCreateDest(dest->name, cupsGetOption("printer-info", dest->num_options, dest->options), NULL, uri, resource, resourcesize);
|
||||
DEBUG_printf(("1_cupsGetDestResource: Resolved device-uri=\"%s\".", device_uri));
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_puts("1_cupsGetDestResource: Unable to resolve device.");
|
||||
|
||||
if (resource)
|
||||
*resource = '\0';
|
||||
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
|
||||
if (flags & CUPS_DEST_FLAGS_DEVICE)
|
||||
{
|
||||
uri = device_uri;
|
||||
}
|
||||
else if (printer_uri)
|
||||
{
|
||||
uri = printer_uri;
|
||||
}
|
||||
else
|
||||
{
|
||||
uri = _cupsCreateDest(dest->name, cupsGetOption("printer-info", dest->num_options, dest->options), NULL, device_uri, resource, resourcesize);
|
||||
|
||||
if (uri)
|
||||
{
|
||||
@@ -1158,30 +1177,24 @@ _cupsGetDestResource(
|
||||
|
||||
uri = cupsGetOption("printer-uri-supported", dest->num_options, dest->options);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_puts("1_cupsGetDestResource: No printer-uri-supported found.");
|
||||
|
||||
if (resource)
|
||||
*resource = '\0';
|
||||
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (!uri)
|
||||
{
|
||||
DEBUG_printf(("1_cupsGetDestResource: printer-uri-supported=\"%s\"", uri));
|
||||
DEBUG_puts("1_cupsGetDestResource: No printer-uri-supported or device-uri found.");
|
||||
|
||||
if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme),
|
||||
userpass, sizeof(userpass), hostname, sizeof(hostname),
|
||||
&port, resource, (int)resourcesize) < HTTP_URI_STATUS_OK)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad printer-uri."), 1);
|
||||
if (resource)
|
||||
*resource = '\0';
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(ENOENT), 0);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
else if (httpSeparateURI(HTTP_URI_CODING_ALL, uri, scheme, sizeof(scheme), userpass, sizeof(userpass), hostname, sizeof(hostname), &port, resource, (int)resourcesize) < HTTP_URI_STATUS_OK)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Bad URI."), 1);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
DEBUG_printf(("1_cupsGetDestResource: resource=\"%s\"", resource));
|
||||
@@ -1269,6 +1282,12 @@ cupsGetDestWithURI(const char *name, /* I - Desired printer name or @code NULL@
|
||||
name = resource + 10;
|
||||
info = temp;
|
||||
}
|
||||
else if (!strncmp(resource, "/ipp/print/", 11))
|
||||
{
|
||||
snprintf(temp, sizeof(temp), "%s @ %s", resource + 11, hostname);
|
||||
name = resource + 11;
|
||||
info = temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
name = hostname;
|
||||
@@ -2013,9 +2032,9 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
cups_option_t *option; /* Current option */
|
||||
_ipp_option_t *match; /* Matching attribute for option */
|
||||
FILE *fp; /* File pointer */
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
const char *home; /* HOME environment variable */
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
char filename[1024]; /* lpoptions file */
|
||||
int num_temps; /* Number of temporary destinations */
|
||||
cups_dest_t *temps = NULL, /* Temporary destinations */
|
||||
@@ -2049,7 +2068,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
if (getuid())
|
||||
{
|
||||
/*
|
||||
@@ -2069,7 +2088,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
|
||||
}
|
||||
}
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
/*
|
||||
* Try to open the file...
|
||||
@@ -2081,7 +2100,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
return (-1);
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
/*
|
||||
* Set the permissions to 0644 when saving to the /etc/cups/lpoptions
|
||||
* file...
|
||||
@@ -2089,7 +2108,7 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
|
||||
if (!getuid())
|
||||
fchmod(fileno(fp), 0644);
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
/*
|
||||
* Write each printer; each line looks like:
|
||||
@@ -2626,22 +2645,7 @@ cups_dnssd_browse_cb(
|
||||
* This object is new on the network.
|
||||
*/
|
||||
|
||||
if (flags & AVAHI_LOOKUP_RESULT_LOCAL)
|
||||
{
|
||||
/*
|
||||
* This comes from the local machine so ignore it.
|
||||
*/
|
||||
|
||||
DEBUG_printf(("cups_dnssd_browse_cb: Ignoring local service \"%s\".", name));
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Create a device entry for it if it doesn't yet exist.
|
||||
*/
|
||||
|
||||
cups_dnssd_get_device(data, name, type, domain);
|
||||
}
|
||||
cups_dnssd_get_device(data, name, type, domain);
|
||||
break;
|
||||
|
||||
case AVAHI_BROWSER_REMOVE :
|
||||
@@ -2862,66 +2866,6 @@ cups_dnssd_get_device(
|
||||
}
|
||||
|
||||
|
||||
# ifdef HAVE_DNSSD
|
||||
/*
|
||||
* 'cups_dnssd_local_cb()' - Browse for local printers.
|
||||
*/
|
||||
|
||||
static void
|
||||
cups_dnssd_local_cb(
|
||||
DNSServiceRef sdRef, /* I - Service reference */
|
||||
DNSServiceFlags flags, /* I - Option flags */
|
||||
uint32_t interfaceIndex, /* I - Interface number */
|
||||
DNSServiceErrorType errorCode, /* I - Error, if any */
|
||||
const char *serviceName, /* I - Name of service/device */
|
||||
const char *regtype, /* I - Type of service */
|
||||
const char *replyDomain, /* I - Service domain */
|
||||
void *context) /* I - Devices array */
|
||||
{
|
||||
_cups_dnssd_data_t *data = (_cups_dnssd_data_t *)context;
|
||||
/* Enumeration data */
|
||||
_cups_dnssd_device_t *device; /* Device */
|
||||
|
||||
|
||||
DEBUG_printf(("5cups_dnssd_local_cb(sdRef=%p, flags=%x, interfaceIndex=%d, errorCode=%d, serviceName=\"%s\", regtype=\"%s\", replyDomain=\"%s\", context=%p)", (void *)sdRef, flags, interfaceIndex, errorCode, serviceName, regtype, replyDomain, context));
|
||||
|
||||
/*
|
||||
* Only process "add" data...
|
||||
*/
|
||||
|
||||
if (errorCode != kDNSServiceErr_NoError || !(flags & kDNSServiceFlagsAdd))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Get the device...
|
||||
*/
|
||||
|
||||
device = cups_dnssd_get_device(data, serviceName, regtype, replyDomain);
|
||||
|
||||
/*
|
||||
* Hide locally-registered devices...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("6cups_dnssd_local_cb: Hiding local printer '%s'.",
|
||||
serviceName));
|
||||
|
||||
if (device->ref)
|
||||
{
|
||||
DNSServiceRefDeallocate(device->ref);
|
||||
device->ref = 0;
|
||||
}
|
||||
|
||||
if (device->state == _CUPS_DNSSD_ACTIVE)
|
||||
{
|
||||
DEBUG_printf(("6cups_dnssd_local_cb: Remove callback for \"%s\".", device->dest.name));
|
||||
(*data->cb)(data->user_data, CUPS_DEST_FLAGS_REMOVED, &device->dest);
|
||||
}
|
||||
|
||||
device->state = _CUPS_DNSSD_LOCAL;
|
||||
}
|
||||
# endif /* HAVE_DNSSD */
|
||||
|
||||
|
||||
# ifdef HAVE_AVAHI
|
||||
/*
|
||||
* 'cups_dnssd_poll_cb()' - Wait for input on the specified file descriptors.
|
||||
@@ -2971,9 +2915,9 @@ cups_dnssd_poll_cb(
|
||||
* 'cups_dnssd_query_cb()' - Process query data.
|
||||
*/
|
||||
|
||||
# ifdef HAVE_DNSSD
|
||||
static void
|
||||
cups_dnssd_query_cb(
|
||||
# ifdef HAVE_DNSSD
|
||||
DNSServiceRef sdRef, /* I - Service reference */
|
||||
DNSServiceFlags flags, /* I - Data flags */
|
||||
uint32_t interfaceIndex, /* I - Interface */
|
||||
@@ -2984,11 +2928,7 @@ cups_dnssd_query_cb(
|
||||
uint16_t rdlen, /* I - Length of record data */
|
||||
const void *rdata, /* I - Record data */
|
||||
uint32_t ttl, /* I - Time-to-live */
|
||||
void *context) /* I - Enumeration data */
|
||||
{
|
||||
# else /* HAVE_AVAHI */
|
||||
static void
|
||||
cups_dnssd_query_cb(
|
||||
AvahiRecordBrowser *browser, /* I - Record browser */
|
||||
AvahiIfIndex interfaceIndex,
|
||||
/* I - Interface index (unused) */
|
||||
@@ -3000,13 +2940,13 @@ cups_dnssd_query_cb(
|
||||
const void *rdata, /* I - TXT record */
|
||||
size_t rdlen, /* I - Length of TXT record */
|
||||
AvahiLookupResultFlags flags, /* I - Flags */
|
||||
# endif /* HAVE_DNSSD */
|
||||
void *context) /* I - Enumeration data */
|
||||
{
|
||||
# ifdef DEBUG
|
||||
# if defined(DEBUG) && defined(HAVE_AVAHI)
|
||||
AvahiClient *client = avahi_record_browser_get_client(browser);
|
||||
/* Client information */
|
||||
# endif /* DEBUG */
|
||||
# endif /* HAVE_DNSSD */
|
||||
# endif /* DEBUG && HAVE_AVAHI */
|
||||
_cups_dnssd_data_t *data = (_cups_dnssd_data_t *)context;
|
||||
/* Enumeration data */
|
||||
char serviceName[256],/* Service name */
|
||||
@@ -3466,11 +3406,9 @@ cups_enum_dests(
|
||||
# ifdef HAVE_DNSSD
|
||||
int nfds, /* Number of files responded */
|
||||
main_fd; /* File descriptor for lookups */
|
||||
DNSServiceRef ipp_ref = NULL, /* IPP browser */
|
||||
local_ipp_ref = NULL; /* Local IPP browser */
|
||||
DNSServiceRef ipp_ref = NULL; /* IPP browser */
|
||||
# ifdef HAVE_SSL
|
||||
DNSServiceRef ipps_ref = NULL, /* IPPS browser */
|
||||
local_ipps_ref = NULL; /* Local IPPS browser */
|
||||
DNSServiceRef ipps_ref = NULL; /* IPPS browser */
|
||||
# endif /* HAVE_SSL */
|
||||
# ifdef HAVE_POLL
|
||||
struct pollfd pfd; /* Polling data */
|
||||
@@ -3532,6 +3470,8 @@ cups_enum_dests(
|
||||
*data.def_instance++ = '\0';
|
||||
}
|
||||
|
||||
DEBUG_printf(("1cups_enum_dests: def_name=\"%s\", def_instance=\"%s\"", data.def_name, data.def_instance));
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
|
||||
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
|
||||
|
||||
@@ -3569,7 +3509,10 @@ cups_enum_dests(
|
||||
*/
|
||||
|
||||
if ((dest = cupsGetDest(data.def_name, data.def_instance, num_dests, dests)) != NULL)
|
||||
{
|
||||
DEBUG_printf(("1cups_enum_dests: Setting is_default on \"%s/%s\".", dest->name, dest->instance));
|
||||
dest->is_default = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = num_dests, dest = dests;
|
||||
@@ -3671,17 +3614,6 @@ cups_enum_dests(
|
||||
return (0);
|
||||
}
|
||||
|
||||
local_ipp_ref = data.main_ref;
|
||||
if (DNSServiceBrowse(&local_ipp_ref, kDNSServiceFlagsShareConnection, kDNSServiceInterfaceIndexLocalOnly, "_ipp._tcp", NULL, (DNSServiceBrowseReply)cups_dnssd_local_cb, &data) != kDNSServiceErr_NoError)
|
||||
{
|
||||
DEBUG_puts("1cups_enum_dests: Unable to create local IPP browser, returning 0.");
|
||||
DNSServiceRefDeallocate(data.main_ref);
|
||||
|
||||
cupsFreeDests(data.num_dests, data.dests);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
# ifdef HAVE_SSL
|
||||
ipps_ref = data.main_ref;
|
||||
if (DNSServiceBrowse(&ipps_ref, kDNSServiceFlagsShareConnection, 0, "_ipps._tcp", NULL, (DNSServiceBrowseReply)cups_dnssd_browse_cb, &data) != kDNSServiceErr_NoError)
|
||||
@@ -3693,17 +3625,6 @@ cups_enum_dests(
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
local_ipps_ref = data.main_ref;
|
||||
if (DNSServiceBrowse(&local_ipps_ref, kDNSServiceFlagsShareConnection, kDNSServiceInterfaceIndexLocalOnly, "_ipps._tcp", NULL, (DNSServiceBrowseReply)cups_dnssd_local_cb, &data) != kDNSServiceErr_NoError)
|
||||
{
|
||||
DEBUG_puts("1cups_enum_dests: Unable to create local IPPS browser, returning 0.");
|
||||
DNSServiceRefDeallocate(data.main_ref);
|
||||
|
||||
cupsFreeDests(data.num_dests, data.dests);
|
||||
|
||||
return (0);
|
||||
}
|
||||
# endif /* HAVE_SSL */
|
||||
|
||||
# else /* HAVE_AVAHI */
|
||||
@@ -3881,7 +3802,10 @@ cups_enum_dests(
|
||||
}
|
||||
|
||||
if (!strcasecmp(dest->name, data.def_name) && !data.def_instance)
|
||||
{
|
||||
DEBUG_printf(("1cups_enum_dests: Setting is_default on discovered \"%s\".", dest->name));
|
||||
dest->is_default = 1;
|
||||
}
|
||||
|
||||
DEBUG_printf(("1cups_enum_dests: Add callback for \"%s\".", device->dest.name));
|
||||
if (!(*cb)(user_data, CUPS_DEST_FLAGS_NONE, dest))
|
||||
@@ -3923,14 +3847,10 @@ cups_enum_dests(
|
||||
# ifdef HAVE_DNSSD
|
||||
if (ipp_ref)
|
||||
DNSServiceRefDeallocate(ipp_ref);
|
||||
if (local_ipp_ref)
|
||||
DNSServiceRefDeallocate(local_ipp_ref);
|
||||
|
||||
# ifdef HAVE_SSL
|
||||
if (ipps_ref)
|
||||
DNSServiceRefDeallocate(ipps_ref);
|
||||
if (local_ipps_ref)
|
||||
DNSServiceRefDeallocate(local_ipps_ref);
|
||||
# endif /* HAVE_SSL */
|
||||
|
||||
if (data.main_ref)
|
||||
|
||||
+6
-6
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
#include "string-private.h"
|
||||
#include "debug-private.h"
|
||||
#include "debug-internal.h"
|
||||
#include "dir.h"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* Windows implementation...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
|
||||
/*
|
||||
@@ -141,7 +141,7 @@ cupsDirOpen(const char *directory) /* I - Directory name */
|
||||
cups_dentry_t * /* O - Directory entry or @code NULL@ if there are no more */
|
||||
cupsDirRead(cups_dir_t *dp) /* I - Directory pointer */
|
||||
{
|
||||
WIN32_FIND_DATA entry; /* Directory entry data */
|
||||
WIN32_FIND_DATAA entry; /* Directory entry data */
|
||||
|
||||
|
||||
/*
|
||||
@@ -161,11 +161,11 @@ cupsDirRead(cups_dir_t *dp) /* I - Directory pointer */
|
||||
* No, find the first file...
|
||||
*/
|
||||
|
||||
dp->dir = FindFirstFile(dp->directory, &entry);
|
||||
dp->dir = FindFirstFileA(dp->directory, &entry);
|
||||
if (dp->dir == INVALID_HANDLE_VALUE)
|
||||
return (NULL);
|
||||
}
|
||||
else if (!FindNextFile(dp->dir, &entry))
|
||||
else if (!FindNextFileA(dp->dir, &entry))
|
||||
return (NULL);
|
||||
|
||||
/*
|
||||
@@ -418,4 +418,4 @@ cupsDirRewind(cups_dir_t *dp) /* I - Directory pointer */
|
||||
|
||||
rewinddir(dp->dir);
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
+73
-11
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Option encoding routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products.
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -12,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -128,6 +130,9 @@ static const _ipp_option_t ipp_options[] =
|
||||
cups_schemes },
|
||||
{ 1, "finishings", IPP_TAG_ENUM, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 1, "finishings-col", IPP_TAG_BEGIN_COLLECTION, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 1, "finishings-col-default", IPP_TAG_BEGIN_COLLECTION, IPP_TAG_PRINTER },
|
||||
{ 1, "finishings-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 0, "fit-to-page", IPP_TAG_BOOLEAN, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
@@ -141,6 +146,7 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ 1, "include-schemes", IPP_TAG_NAME, IPP_TAG_OPERATION,
|
||||
IPP_TAG_ZERO,
|
||||
cups_schemes },
|
||||
{ 0, "ipp-attribute-fidelity", IPP_TAG_BOOLEAN, IPP_TAG_OPERATION },
|
||||
{ 0, "job-account-id", IPP_TAG_NAME, IPP_TAG_JOB },
|
||||
{ 0, "job-account-id-default",IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 0, "job-accounting-user-id", IPP_TAG_NAME, IPP_TAG_JOB },
|
||||
@@ -149,6 +155,7 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ 0, "job-cancel-after", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "job-cancel-after-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "job-hold-until", IPP_TAG_KEYWORD, IPP_TAG_JOB },
|
||||
{ 0, "job-hold-until-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "job-id", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
|
||||
{ 0, "job-impressions", IPP_TAG_INTEGER, IPP_TAG_OPERATION },
|
||||
{ 0, "job-impressions-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
|
||||
@@ -157,6 +164,8 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ 0, "job-k-octets-completed",IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
|
||||
{ 0, "job-media-sheets", IPP_TAG_INTEGER, IPP_TAG_OPERATION },
|
||||
{ 0, "job-media-sheets-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
|
||||
{ 0, "job-name", IPP_TAG_NAME, IPP_TAG_OPERATION,
|
||||
IPP_TAG_JOB },
|
||||
{ 0, "job-page-limit", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "job-pages", IPP_TAG_INTEGER, IPP_TAG_OPERATION },
|
||||
{ 0, "job-pages-completed", IPP_TAG_INTEGER, IPP_TAG_ZERO }, /* never send as option */
|
||||
@@ -167,6 +176,7 @@ static const _ipp_option_t ipp_options[] =
|
||||
IPP_TAG_ZERO,
|
||||
ipp_job_creation },
|
||||
{ 0, "job-priority", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "job-priority-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "job-quota-period", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 1, "job-sheets", IPP_TAG_NAME, IPP_TAG_JOB },
|
||||
{ 1, "job-sheets-default", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
@@ -211,6 +221,9 @@ static const _ipp_option_t ipp_options[] =
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "mirror", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ 0, "mirror-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "multiple-document-handling", IPP_TAG_KEYWORD, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "multiple-document-handling-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "natural-scaling", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "natural-scaling-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "notify-charset", IPP_TAG_CHARSET, IPP_TAG_SUBSCRIPTION },
|
||||
@@ -226,18 +239,26 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ 0, "number-up", IPP_TAG_INTEGER, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "number-up-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "number-up-layout", IPP_TAG_KEYWORD, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "number-up-layout-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "orientation-requested", IPP_TAG_ENUM, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "orientation-requested-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 0, "output-bin", IPP_TAG_KEYWORD, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "output-bin-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 1, "overrides", IPP_TAG_BEGIN_COLLECTION, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "page-bottom", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "page-bottom-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "page-delivery", IPP_TAG_KEYWORD, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "page-delivery-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "page-left", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "page-left-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 1, "page-ranges", IPP_TAG_RANGE, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 1, "page-ranges-default", IPP_TAG_RANGE, IPP_TAG_PRINTER },
|
||||
{ 0, "page-right", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
{ 0, "page-right-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "page-top", IPP_TAG_INTEGER, IPP_TAG_JOB },
|
||||
@@ -278,13 +299,32 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ 0, "ppi-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 0, "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
|
||||
{ 0, "prettyprint-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "print-color-mode", IPP_TAG_KEYWORD, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "print-color-mode-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "print-content-optimize", IPP_TAG_KEYWORD, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "print-content-optimize-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "print-quality", IPP_TAG_ENUM, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "print-quality-default", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 0, "print-rendering-intent", IPP_TAG_KEYWORD, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "print-rendering-intent-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "print-scaling", IPP_TAG_KEYWORD, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "print-scaling-default", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-alert", IPP_TAG_STRING, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-alert-description", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-commands", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-error-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-finisher", IPP_TAG_STRING, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-finisher-description", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-finisher-supplies", IPP_TAG_STRING, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-finisher-supplies-description", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-geo-location", IPP_TAG_URI, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-input-tray", IPP_TAG_STRING, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-is-shared", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-is-temporary", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER },
|
||||
@@ -292,11 +332,15 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ 0, "printer-make-and-model", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-more-info", IPP_TAG_URI, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-op-policy", IPP_TAG_NAME, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-output-tray", IPP_TAG_STRING, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB,
|
||||
IPP_TAG_DOCUMENT },
|
||||
{ 0, "printer-resolution-default", IPP_TAG_RESOLUTION, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-state", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-state-change-time", IPP_TAG_INTEGER, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-state-reasons", IPP_TAG_KEYWORD, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-supply", IPP_TAG_STRING, IPP_TAG_PRINTER },
|
||||
{ 1, "printer-supply-description", IPP_TAG_TEXT, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-type", IPP_TAG_ENUM, IPP_TAG_PRINTER },
|
||||
{ 0, "printer-uri", IPP_TAG_URI, IPP_TAG_OPERATION },
|
||||
{ 1, "printer-uri-supported", IPP_TAG_URI, IPP_TAG_PRINTER },
|
||||
@@ -337,7 +381,7 @@ static int compare_ipp_options(_ipp_option_t *a, _ipp_option_t *b);
|
||||
* '_cupsEncodeOption()' - Encode a single option as an IPP attribute.
|
||||
*/
|
||||
|
||||
void
|
||||
ipp_attribute_t * /* O - New attribute or @code NULL@ on error */
|
||||
_cupsEncodeOption(
|
||||
ipp_t *ipp, /* I - IPP request/response/collection */
|
||||
ipp_tag_t group_tag, /* I - Group tag */
|
||||
@@ -417,7 +461,7 @@ _cupsEncodeOption(
|
||||
*/
|
||||
|
||||
DEBUG_puts("1_cupsEncodeOption: Ran out of memory for attributes.");
|
||||
return;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (count > 1)
|
||||
@@ -434,7 +478,7 @@ _cupsEncodeOption(
|
||||
|
||||
DEBUG_puts("1_cupsEncodeOption: Ran out of memory for value copy.");
|
||||
ippDeleteAttribute(ipp, attr);
|
||||
return;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
val = copy;
|
||||
@@ -605,7 +649,7 @@ _cupsEncodeOption(
|
||||
free(copy);
|
||||
|
||||
ippDeleteAttribute(ipp, attr);
|
||||
return;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
ippSetCollection(ipp, &attr, i, collection);
|
||||
@@ -621,6 +665,24 @@ _cupsEncodeOption(
|
||||
|
||||
if (copy)
|
||||
free(copy);
|
||||
|
||||
return (attr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsEncodeOption()' - Encode a single option into an IPP attribute.
|
||||
*
|
||||
* @since CUPS 2.3@
|
||||
*/
|
||||
|
||||
ipp_attribute_t * /* O - New attribute or @code NULL@ on error */
|
||||
cupsEncodeOption(ipp_t *ipp, /* I - IPP request/response */
|
||||
ipp_tag_t group_tag, /* I - Attribute group */
|
||||
const char *name, /* I - Option name */
|
||||
const char *value) /* I - Option string value */
|
||||
{
|
||||
return (_cupsEncodeOption(ipp, group_tag, _ippFindOption(name), name, value));
|
||||
}
|
||||
|
||||
|
||||
@@ -633,7 +695,7 @@ _cupsEncodeOption(
|
||||
*/
|
||||
|
||||
void
|
||||
cupsEncodeOptions(ipp_t *ipp, /* I - Request to add to */
|
||||
cupsEncodeOptions(ipp_t *ipp, /* I - IPP request/response */
|
||||
int num_options, /* I - Number of options */
|
||||
cups_option_t *options) /* I - Options */
|
||||
{
|
||||
@@ -661,7 +723,7 @@ cupsEncodeOptions(ipp_t *ipp, /* I - Request to add to */
|
||||
|
||||
void
|
||||
cupsEncodeOptions2(
|
||||
ipp_t *ipp, /* I - Request to add to */
|
||||
ipp_t *ipp, /* I - IPP request/response */
|
||||
int num_options, /* I - Number of options */
|
||||
cups_option_t *options, /* I - Options */
|
||||
ipp_tag_t group_tag) /* I - Group to encode */
|
||||
@@ -688,7 +750,7 @@ cupsEncodeOptions2(
|
||||
|
||||
op = ippGetOperation(ipp);
|
||||
|
||||
if (group_tag == IPP_TAG_OPERATION && (op == IPP_OP_PRINT_JOB || op == IPP_OP_PRINT_URI || op == IPP_OP_SEND_DOCUMENT || op == IPP_OP_SEND_URI))
|
||||
if (group_tag == IPP_TAG_OPERATION && (op == IPP_OP_PRINT_JOB || op == IPP_OP_PRINT_URI || op == IPP_OP_SEND_DOCUMENT || op == IPP_OP_SEND_URI))
|
||||
{
|
||||
/*
|
||||
* Handle the document format stuff first...
|
||||
|
||||
+9
-41
@@ -6,10 +6,11 @@
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* different line endings, gzip'd print files, PPD files, etc.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_FILE_PRIVATE_H_
|
||||
@@ -25,13 +26,10 @@
|
||||
# include <stdarg.h>
|
||||
# include <fcntl.h>
|
||||
|
||||
# ifdef HAVE_LIBZ
|
||||
# include <zlib.h>
|
||||
# endif /* HAVE_LIBZ */
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
# include <io.h>
|
||||
# include <sys/locking.h>
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -82,43 +80,13 @@ typedef enum /**** _cupsFileCheck file type values ****/
|
||||
typedef void (*_cups_fc_func_t)(void *context, _cups_fc_result_t result,
|
||||
const char *message);
|
||||
|
||||
struct _cups_file_s /**** CUPS file structure... ****/
|
||||
|
||||
{
|
||||
int fd; /* File descriptor */
|
||||
char mode, /* Mode ('r' or 'w') */
|
||||
compressed, /* Compression used? */
|
||||
is_stdio, /* stdin/out/err? */
|
||||
eof, /* End of file? */
|
||||
buf[4096], /* Buffer */
|
||||
*ptr, /* Pointer into buffer */
|
||||
*end; /* End of buffer data */
|
||||
off_t pos, /* Position in file */
|
||||
bufpos; /* File position for start of buffer */
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
z_stream stream; /* (De)compression stream */
|
||||
Bytef cbuf[4096]; /* (De)compression buffer */
|
||||
uLong crc; /* (De)compression CRC */
|
||||
#endif /* HAVE_LIBZ */
|
||||
|
||||
char *printf_buffer; /* cupsFilePrintf buffer */
|
||||
size_t printf_size; /* Size of cupsFilePrintf buffer */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern _cups_fc_result_t _cupsFileCheck(const char *filename,
|
||||
_cups_fc_filetype_t filetype,
|
||||
int dorootchecks,
|
||||
_cups_fc_func_t cb,
|
||||
void *context);
|
||||
extern void _cupsFileCheckFilter(void *context,
|
||||
_cups_fc_result_t result,
|
||||
const char *message);
|
||||
extern _cups_fc_result_t _cupsFileCheck(const char *filename, _cups_fc_filetype_t filetype, int dorootchecks, _cups_fc_func_t cb, void *context) _CUPS_PRIVATE;
|
||||
extern void _cupsFileCheckFilter(void *context, _cups_fc_result_t result, const char *message) _CUPS_PRIVATE;
|
||||
extern int _cupsFilePeekAhead(cups_file_t *fp, int ch);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
|
||||
+86
-27
@@ -6,10 +6,11 @@
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* different line endings, gzip'd print files, PPD files, etc.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2019 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -17,9 +18,43 @@
|
||||
*/
|
||||
|
||||
#include "file-private.h"
|
||||
#include "debug-internal.h"
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
# ifdef HAVE_LIBZ
|
||||
# include <zlib.h>
|
||||
# endif /* HAVE_LIBZ */
|
||||
|
||||
|
||||
/*
|
||||
* Internal structures...
|
||||
*/
|
||||
|
||||
struct _cups_file_s /**** CUPS file structure... ****/
|
||||
|
||||
{
|
||||
int fd; /* File descriptor */
|
||||
char mode, /* Mode ('r' or 'w') */
|
||||
compressed, /* Compression used? */
|
||||
is_stdio, /* stdin/out/err? */
|
||||
eof, /* End of file? */
|
||||
buf[4096], /* Buffer */
|
||||
*ptr, /* Pointer into buffer */
|
||||
*end; /* End of buffer data */
|
||||
off_t pos, /* Position in file */
|
||||
bufpos; /* File position for start of buffer */
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
z_stream stream; /* (De)compression stream */
|
||||
Bytef cbuf[4096]; /* (De)compression buffer */
|
||||
uLong crc; /* (De)compression CRC */
|
||||
#endif /* HAVE_LIBZ */
|
||||
|
||||
char *printf_buffer; /* cupsFilePrintf buffer */
|
||||
size_t printf_size; /* Size of cupsFilePrintf buffer */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -34,7 +69,7 @@ static ssize_t cups_read(cups_file_t *fp, char *buf, size_t bytes);
|
||||
static ssize_t cups_write(cups_file_t *fp, const char *buf, size_t bytes);
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
/*
|
||||
* '_cupsFileCheck()' - Check the permissions of the given filename.
|
||||
*/
|
||||
@@ -300,7 +335,7 @@ _cupsFileCheckFilter(
|
||||
|
||||
fprintf(stderr, "%s: %s\n", prefix, message);
|
||||
}
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -520,22 +555,22 @@ cupsFileFind(const char *filename, /* I - File to find */
|
||||
|
||||
while (*path)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (*path == ';' || (*path == ':' && ((bufptr - buffer) > 1 || !isalpha(buffer[0] & 255))))
|
||||
#else
|
||||
if (*path == ';' || *path == ':')
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
{
|
||||
if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend)
|
||||
*bufptr++ = '/';
|
||||
|
||||
strlcpy(bufptr, filename, (size_t)(bufend - bufptr));
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (!access(buffer, 0))
|
||||
#else
|
||||
if (!access(buffer, executable ? X_OK : 0))
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
{
|
||||
DEBUG_printf(("1cupsFileFind: Returning \"%s\"", buffer));
|
||||
return (buffer);
|
||||
@@ -640,6 +675,12 @@ cupsFileGetChar(cups_file_t *fp) /* I - CUPS file */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (fp->eof)
|
||||
{
|
||||
DEBUG_puts("5cupsFileGetChar: End-of-file!");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the input buffer is empty, try to read more data...
|
||||
*/
|
||||
@@ -986,11 +1027,11 @@ cupsFileLock(cups_file_t *fp, /* I - CUPS file */
|
||||
* Try the lock...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return (_locking(fp->fd, block ? _LK_LOCK : _LK_NBLCK, 0));
|
||||
#else
|
||||
return (lockf(fp->fd, block ? F_LOCK : F_TLOCK, 0));
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -1078,11 +1119,11 @@ cupsFileOpen(const char *filename, /* I - Name of file */
|
||||
}
|
||||
|
||||
if (fd >= 0)
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
_chsize(fd, 0);
|
||||
#else
|
||||
ftruncate(fd, 0);
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
break;
|
||||
|
||||
case 's' : /* Read/write socket */
|
||||
@@ -1249,14 +1290,26 @@ cupsFileOpenFd(int fd, /* I - File descriptor */
|
||||
* Don't pass this file to child processes...
|
||||
*/
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
fcntl(fp->fd, F_SETFD, fcntl(fp->fd, F_GETFD) | FD_CLOEXEC);
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
return (fp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsFilePeekAhead()' - See if the requested character is buffered up.
|
||||
*/
|
||||
|
||||
int /* O - 1 if present, 0 otherwise */
|
||||
_cupsFilePeekAhead(cups_file_t *fp, /* I - CUPS file */
|
||||
int ch) /* I - Character */
|
||||
{
|
||||
return (fp && fp->ptr && memchr(fp->ptr, ch, (size_t)(fp->end - fp->ptr)));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsFilePeekChar()' - Peek at the next character from a file.
|
||||
*
|
||||
@@ -1600,6 +1653,12 @@ cupsFileRead(cups_file_t *fp, /* I - CUPS file */
|
||||
if (bytes == 0)
|
||||
return (0);
|
||||
|
||||
if (fp->eof)
|
||||
{
|
||||
DEBUG_puts("5cupsFileRead: End-of-file!");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Loop until all bytes are read...
|
||||
*/
|
||||
@@ -2013,11 +2072,11 @@ cupsFileUnlock(cups_file_t *fp) /* I - CUPS file */
|
||||
* Unlock...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return (_locking(fp->fd, _LK_UNLCK, 0));
|
||||
#else
|
||||
return (lockf(fp->fd, F_ULOCK, 0));
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -2547,9 +2606,9 @@ cups_open(const char *filename, /* I - Filename */
|
||||
{
|
||||
int fd; /* File descriptor */
|
||||
struct stat fileinfo; /* File information */
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
struct stat linkinfo; /* Link information */
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -2577,18 +2636,18 @@ cups_open(const char *filename, /* I - Filename */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (fileinfo.st_mode & _S_IFDIR)
|
||||
#else
|
||||
if (S_ISDIR(fileinfo.st_mode))
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
{
|
||||
close(fd);
|
||||
errno = EISDIR;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
/*
|
||||
* Then use lstat to determine whether the filename is a symlink...
|
||||
*/
|
||||
@@ -2616,7 +2675,7 @@ cups_open(const char *filename, /* I - Filename */
|
||||
errno = EPERM;
|
||||
return (-1);
|
||||
}
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
return (fd);
|
||||
}
|
||||
@@ -2642,7 +2701,7 @@ cups_read(cups_file_t *fp, /* I - CUPS file */
|
||||
|
||||
for (;;)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (fp->mode == 's')
|
||||
total = (ssize_t)recv(fp->fd, buf, (unsigned)bytes, 0);
|
||||
else
|
||||
@@ -2652,7 +2711,7 @@ cups_read(cups_file_t *fp, /* I - CUPS file */
|
||||
total = recv(fp->fd, buf, bytes, 0);
|
||||
else
|
||||
total = read(fp->fd, buf, bytes);
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
DEBUG_printf(("9cups_read: total=" CUPS_LLFMT, CUPS_LLCAST total));
|
||||
|
||||
@@ -2699,7 +2758,7 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
total = 0;
|
||||
while (bytes > 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (fp->mode == 's')
|
||||
count = (ssize_t)send(fp->fd, buf, (unsigned)bytes, 0);
|
||||
else
|
||||
@@ -2709,7 +2768,7 @@ cups_write(cups_file_t *fp, /* I - CUPS file */
|
||||
count = send(fp->fd, buf, bytes, 0);
|
||||
else
|
||||
count = write(fp->fd, buf, bytes);
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
DEBUG_printf(("9cups_write: count=" CUPS_LLFMT, CUPS_LLCAST count));
|
||||
|
||||
|
||||
+16
-28
@@ -6,10 +6,11 @@
|
||||
* our own file functions allows us to provide transparent support of
|
||||
* different line endings, gzip'd print files, PPD files, etc.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
* Copyright © 2007-2018 by Apple Inc.
|
||||
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_FILE_H_
|
||||
@@ -23,11 +24,11 @@
|
||||
# include "versioning.h"
|
||||
# include <stddef.h>
|
||||
# include <sys/types.h>
|
||||
# if defined(WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
|
||||
# if defined(_WIN32) && !defined(__CUPS_SSIZE_T_DEFINED)
|
||||
# define __CUPS_SSIZE_T_DEFINED
|
||||
/* Windows does not support the ssize_t type, so map it to off_t... */
|
||||
typedef off_t ssize_t; /* @private@ */
|
||||
# endif /* WIN32 && !__CUPS_SSIZE_T_DEFINED */
|
||||
# endif /* _WIN32 && !__CUPS_SSIZE_T_DEFINED */
|
||||
|
||||
|
||||
/*
|
||||
@@ -61,34 +62,22 @@ typedef struct _cups_file_s cups_file_t;/**** CUPS file type ****/
|
||||
extern int cupsFileClose(cups_file_t *fp) _CUPS_API_1_2;
|
||||
extern int cupsFileCompression(cups_file_t *fp) _CUPS_API_1_2;
|
||||
extern int cupsFileEOF(cups_file_t *fp) _CUPS_API_1_2;
|
||||
extern const char *cupsFileFind(const char *filename, const char *path,
|
||||
int executable, char *buffer,
|
||||
int bufsize) _CUPS_API_1_2;
|
||||
extern const char *cupsFileFind(const char *filename, const char *path, int executable, char *buffer, int bufsize) _CUPS_API_1_2;
|
||||
extern int cupsFileFlush(cups_file_t *fp) _CUPS_API_1_2;
|
||||
extern int cupsFileGetChar(cups_file_t *fp) _CUPS_API_1_2;
|
||||
extern char *cupsFileGetConf(cups_file_t *fp, char *buf,
|
||||
size_t buflen, char **value,
|
||||
int *linenum) _CUPS_API_1_2;
|
||||
extern size_t cupsFileGetLine(cups_file_t *fp, char *buf,
|
||||
size_t buflen) _CUPS_API_1_2;
|
||||
extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen)
|
||||
_CUPS_API_1_2;
|
||||
extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen, char **value, int *linenum) _CUPS_API_1_2;
|
||||
extern size_t cupsFileGetLine(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2;
|
||||
extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2;
|
||||
extern int cupsFileLock(cups_file_t *fp, int block) _CUPS_API_1_2;
|
||||
extern int cupsFileNumber(cups_file_t *fp) _CUPS_API_1_2;
|
||||
extern cups_file_t *cupsFileOpen(const char *filename, const char *mode)
|
||||
_CUPS_API_1_2;
|
||||
extern cups_file_t *cupsFileOpen(const char *filename, const char *mode) _CUPS_API_1_2;
|
||||
extern cups_file_t *cupsFileOpenFd(int fd, const char *mode) _CUPS_API_1_2;
|
||||
extern int cupsFilePeekChar(cups_file_t *fp) _CUPS_API_1_2;
|
||||
extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...)
|
||||
__attribute__((__format__ (__printf__, 2, 3)))
|
||||
_CUPS_API_1_2;
|
||||
extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...) _CUPS_FORMAT(2, 3) _CUPS_API_1_2;
|
||||
extern int cupsFilePutChar(cups_file_t *fp, int c) _CUPS_API_1_2;
|
||||
extern ssize_t cupsFilePutConf(cups_file_t *fp, const char *directive,
|
||||
const char *value) _CUPS_API_1_4;
|
||||
extern int cupsFilePuts(cups_file_t *fp, const char *s)
|
||||
_CUPS_API_1_2;
|
||||
extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes)
|
||||
_CUPS_API_1_2;
|
||||
extern ssize_t cupsFilePutConf(cups_file_t *fp, const char *directive, const char *value) _CUPS_API_1_4;
|
||||
extern int cupsFilePuts(cups_file_t *fp, const char *s) _CUPS_API_1_2;
|
||||
extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes) _CUPS_API_1_2;
|
||||
extern off_t cupsFileRewind(cups_file_t *fp) _CUPS_API_1_2;
|
||||
extern off_t cupsFileSeek(cups_file_t *fp, off_t pos) _CUPS_API_1_2;
|
||||
extern cups_file_t *cupsFileStderr(void) _CUPS_API_1_2;
|
||||
@@ -96,8 +85,7 @@ extern cups_file_t *cupsFileStdin(void) _CUPS_API_1_2;
|
||||
extern cups_file_t *cupsFileStdout(void) _CUPS_API_1_2;
|
||||
extern off_t cupsFileTell(cups_file_t *fp) _CUPS_API_1_2;
|
||||
extern int cupsFileUnlock(cups_file_t *fp) _CUPS_API_1_2;
|
||||
extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf,
|
||||
size_t bytes) _CUPS_API_1_2;
|
||||
extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes) _CUPS_API_1_2;
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
|
||||
+5
-1
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
#include "adminutil.h"
|
||||
|
||||
|
||||
@@ -23,7 +24,10 @@
|
||||
* parameters provide comma-delimited lists of backends to include or omit from
|
||||
* the request respectively.
|
||||
*
|
||||
* @since CUPS 1.4/macOS 10.6@
|
||||
* This function is deprecated with the IPP printer discovery functionality
|
||||
* being provided by the @link cupsEnumDests@ and @cupsGetDests@ functions.
|
||||
*
|
||||
* @deprecated@
|
||||
*/
|
||||
|
||||
ipp_status_t /* O - Request status - @code IPP_OK@ on success. */
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* getifaddrs definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_GETIFADDRS_INTERNAL_H_
|
||||
# define _CUPS_GETIFADDRS_INTERNAL_H_
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
# ifdef _WIN32
|
||||
# define _WINSOCK_DEPRECATED_NO_WARNINGS 1
|
||||
# include <io.h>
|
||||
# include <winsock2.h>
|
||||
# define CUPS_SOCAST (const char *)
|
||||
# else
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
# include <sys/socket.h>
|
||||
# define CUPS_SOCAST
|
||||
# endif /* _WIN32 */
|
||||
|
||||
# if defined(__APPLE__) && !defined(_SOCKLEN_T)
|
||||
/*
|
||||
* macOS 10.2.x does not define socklen_t, and in fact uses an int instead of
|
||||
* unsigned type for length values...
|
||||
*/
|
||||
|
||||
typedef int socklen_t;
|
||||
# endif /* __APPLE__ && !_SOCKLEN_T */
|
||||
|
||||
# ifndef _WIN32
|
||||
# include <net/if.h>
|
||||
# include <resolv.h>
|
||||
# ifdef HAVE_GETIFADDRS
|
||||
# include <ifaddrs.h>
|
||||
# else
|
||||
# include <sys/ioctl.h>
|
||||
# ifdef HAVE_SYS_SOCKIO_H
|
||||
# include <sys/sockio.h>
|
||||
# endif /* HAVE_SYS_SOCKIO_H */
|
||||
# endif /* HAVE_GETIFADDRS */
|
||||
# endif /* !_WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
|
||||
|
||||
/*
|
||||
* Some OS's don't have getifaddrs() and freeifaddrs()...
|
||||
*/
|
||||
|
||||
# if !defined(_WIN32) && !defined(HAVE_GETIFADDRS)
|
||||
# ifdef ifa_dstaddr
|
||||
# undef ifa_dstaddr
|
||||
# endif /* ifa_dstaddr */
|
||||
# ifndef ifr_netmask
|
||||
# define ifr_netmask ifr_addr
|
||||
# endif /* !ifr_netmask */
|
||||
|
||||
struct ifaddrs /**** Interface Structure ****/
|
||||
{
|
||||
struct ifaddrs *ifa_next; /* Next interface in list */
|
||||
char *ifa_name; /* Name of interface */
|
||||
unsigned int ifa_flags; /* Flags (up, point-to-point, etc.) */
|
||||
struct sockaddr *ifa_addr, /* Network address */
|
||||
*ifa_netmask; /* Address mask */
|
||||
union
|
||||
{
|
||||
struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
|
||||
struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
|
||||
} ifa_ifu;
|
||||
|
||||
void *ifa_data; /* Interface statistics */
|
||||
};
|
||||
|
||||
# ifndef ifa_broadaddr
|
||||
# define ifa_broadaddr ifa_ifu.ifu_broadaddr
|
||||
# endif /* !ifa_broadaddr */
|
||||
# ifndef ifa_dstaddr
|
||||
# define ifa_dstaddr ifa_ifu.ifu_dstaddr
|
||||
# endif /* !ifa_dstaddr */
|
||||
|
||||
extern int _cups_getifaddrs(struct ifaddrs **addrs) _CUPS_PRIVATE;
|
||||
# define getifaddrs _cups_getifaddrs
|
||||
extern void _cups_freeifaddrs(struct ifaddrs *addrs) _CUPS_PRIVATE;
|
||||
# define freeifaddrs _cups_freeifaddrs
|
||||
# endif /* !_WIN32 && !HAVE_GETIFADDRS */
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
*/
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
#endif /* !_CUPS_GETIFADDRS_INTERNAL_H_ */
|
||||
+5
-8
@@ -1,21 +1,18 @@
|
||||
/*
|
||||
* Network interface functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 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"
|
||||
* "LICENSE" which should have been included with this file. If this
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers.
|
||||
*/
|
||||
|
||||
#include "http-private.h"
|
||||
#include "getifaddrs-internal.h"
|
||||
|
||||
|
||||
#ifndef HAVE_GETIFADDRS
|
||||
|
||||
+68
-6
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Get/put file functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -12,13 +13,14 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.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__ */
|
||||
|
||||
|
||||
/*
|
||||
@@ -39,6 +41,8 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
http_status_t status; /* HTTP status from server */
|
||||
char if_modified_since[HTTP_MAX_VALUE];
|
||||
/* If-Modified-Since header */
|
||||
int new_auth = 0; /* Using new auth information? */
|
||||
int digest; /* Are we using Digest authentication? */
|
||||
|
||||
|
||||
/*
|
||||
@@ -79,9 +83,33 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
}
|
||||
|
||||
httpClearFields(http);
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
|
||||
httpSetField(http, HTTP_FIELD_IF_MODIFIED_SINCE, if_modified_since);
|
||||
|
||||
digest = http->authstring && !strncmp(http->authstring, "Digest ", 7);
|
||||
|
||||
if (digest && !new_auth)
|
||||
{
|
||||
/*
|
||||
* Update the Digest authentication string...
|
||||
*/
|
||||
|
||||
_httpSetDigestAuthString(http, http->nextnonce, "GET", resource);
|
||||
}
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
if (http->authstring && !strncmp(http->authstring, "Negotiate", 9) && !new_auth)
|
||||
{
|
||||
/*
|
||||
* Do not use cached Kerberos credentials since they will look like a
|
||||
* "replay" attack...
|
||||
*/
|
||||
|
||||
_cupsSetNegotiateAuthString(http, "GET", resource);
|
||||
}
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
|
||||
|
||||
if (httpGet(http, resource))
|
||||
{
|
||||
if (httpReconnect2(http, 30000, NULL))
|
||||
@@ -96,6 +124,8 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
}
|
||||
}
|
||||
|
||||
new_auth = 0;
|
||||
|
||||
while ((status = httpUpdate(http)) == HTTP_STATUS_CONTINUE);
|
||||
|
||||
if (status == HTTP_STATUS_UNAUTHORIZED)
|
||||
@@ -110,6 +140,8 @@ cupsGetFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
* See if we can do authentication...
|
||||
*/
|
||||
|
||||
new_auth = 1;
|
||||
|
||||
if (cupsDoAuthentication(http, "GET", resource))
|
||||
{
|
||||
status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
|
||||
@@ -261,6 +293,8 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
int retries; /* Number of retries */
|
||||
char buffer[8192]; /* Buffer for file */
|
||||
http_status_t status; /* HTTP status from server */
|
||||
int new_auth = 0; /* Using new auth information? */
|
||||
int digest; /* Are we using Digest authentication? */
|
||||
|
||||
|
||||
/*
|
||||
@@ -303,10 +337,34 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
http->authstring));
|
||||
|
||||
httpClearFields(http);
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
|
||||
httpSetField(http, HTTP_FIELD_TRANSFER_ENCODING, "chunked");
|
||||
httpSetExpect(http, HTTP_STATUS_CONTINUE);
|
||||
|
||||
digest = http->authstring && !strncmp(http->authstring, "Digest ", 7);
|
||||
|
||||
if (digest && !new_auth)
|
||||
{
|
||||
/*
|
||||
* Update the Digest authentication string...
|
||||
*/
|
||||
|
||||
_httpSetDigestAuthString(http, http->nextnonce, "PUT", resource);
|
||||
}
|
||||
|
||||
#ifdef HAVE_GSSAPI
|
||||
if (http->authstring && !strncmp(http->authstring, "Negotiate", 9) && !new_auth)
|
||||
{
|
||||
/*
|
||||
* Do not use cached Kerberos credentials since they will look like a
|
||||
* "replay" attack...
|
||||
*/
|
||||
|
||||
_cupsSetNegotiateAuthString(http, "PUT", resource);
|
||||
}
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
|
||||
|
||||
if (httpPut(http, resource))
|
||||
{
|
||||
if (httpReconnect2(http, 30000, NULL))
|
||||
@@ -377,6 +435,8 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
|
||||
DEBUG_printf(("2cupsPutFd: status=%d", status));
|
||||
|
||||
new_auth = 0;
|
||||
|
||||
if (status == HTTP_STATUS_UNAUTHORIZED)
|
||||
{
|
||||
/*
|
||||
@@ -389,6 +449,8 @@ cupsPutFd(http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFA
|
||||
* See if we can do authentication...
|
||||
*/
|
||||
|
||||
new_auth = 1;
|
||||
|
||||
if (cupsDoAuthentication(http, "PUT", resource))
|
||||
{
|
||||
status = HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED;
|
||||
|
||||
+21
-19
@@ -28,23 +28,23 @@ static _cups_threadkey_t cups_globals_key = _CUPS_THREADKEY_INITIALIZER;
|
||||
static pthread_once_t cups_globals_key_once = PTHREAD_ONCE_INIT;
|
||||
/* One-time initialization object */
|
||||
#endif /* HAVE_PTHREAD_H */
|
||||
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
|
||||
#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
|
||||
static _cups_mutex_t cups_global_mutex = _CUPS_MUTEX_INITIALIZER;
|
||||
/* Global critical section */
|
||||
#endif /* HAVE_PTHREAD_H || WIN32 */
|
||||
#endif /* HAVE_PTHREAD_H || _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
static void cups_fix_path(char *path);
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
static _cups_globals_t *cups_globals_alloc(void);
|
||||
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
|
||||
#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
|
||||
static void cups_globals_free(_cups_globals_t *g);
|
||||
#endif /* HAVE_PTHREAD_H || WIN32 */
|
||||
#endif /* HAVE_PTHREAD_H || _WIN32 */
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
static void cups_globals_init(void);
|
||||
#endif /* HAVE_PTHREAD_H */
|
||||
@@ -59,7 +59,7 @@ _cupsGlobalLock(void)
|
||||
{
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_lock(&cups_global_mutex);
|
||||
#elif defined(WIN32)
|
||||
#elif defined(_WIN32)
|
||||
EnterCriticalSection(&cups_global_mutex.m_criticalSection);
|
||||
#endif /* HAVE_PTHREAD_H */
|
||||
}
|
||||
@@ -114,13 +114,13 @@ _cupsGlobalUnlock(void)
|
||||
{
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_unlock(&cups_global_mutex);
|
||||
#elif defined(WIN32)
|
||||
#elif defined(_WIN32)
|
||||
LeaveCriticalSection(&cups_global_mutex.m_criticalSection);
|
||||
#endif /* HAVE_PTHREAD_H */
|
||||
}
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
* 'DllMain()' - Main entry for library.
|
||||
*/
|
||||
@@ -164,7 +164,7 @@ DllMain(HINSTANCE hinst, /* I - DLL module handle */
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -176,13 +176,13 @@ cups_globals_alloc(void)
|
||||
{
|
||||
_cups_globals_t *cg = malloc(sizeof(_cups_globals_t));
|
||||
/* Pointer to global data */
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
HKEY key; /* Registry key */
|
||||
DWORD size; /* Size of string */
|
||||
static char installdir[1024] = "", /* Install directory */
|
||||
confdir[1024] = "", /* Server root directory */
|
||||
localedir[1024] = ""; /* Locale directory */
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
if (!cg)
|
||||
@@ -213,7 +213,7 @@ cups_globals_alloc(void)
|
||||
* Then set directories as appropriate...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (!installdir[0])
|
||||
{
|
||||
/*
|
||||
@@ -222,8 +222,7 @@ cups_globals_alloc(void)
|
||||
|
||||
strlcpy(installdir, "C:/Program Files/cups.org", sizeof(installdir));
|
||||
|
||||
if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\cups.org", 0, KEY_READ,
|
||||
&key))
|
||||
if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\cups.org", 0, KEY_READ, &key))
|
||||
{
|
||||
/*
|
||||
* Grab the installation directory...
|
||||
@@ -232,7 +231,7 @@ cups_globals_alloc(void)
|
||||
char *ptr; /* Pointer into installdir */
|
||||
|
||||
size = sizeof(installdir);
|
||||
RegQueryValueEx(key, "installdir", NULL, NULL, installdir, &size);
|
||||
RegQueryValueExA(key, "installdir", NULL, NULL, installdir, &size);
|
||||
RegCloseKey(key);
|
||||
|
||||
for (ptr = installdir; *ptr;)
|
||||
@@ -309,7 +308,7 @@ cups_globals_alloc(void)
|
||||
if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
|
||||
cg->localedir = CUPS_LOCALEDIR;
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
return (cg);
|
||||
}
|
||||
@@ -319,7 +318,7 @@ cups_globals_alloc(void)
|
||||
* 'cups_globals_free()' - Free global data.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_PTHREAD_H) || defined(WIN32)
|
||||
#if defined(HAVE_PTHREAD_H) || defined(_WIN32)
|
||||
static void
|
||||
cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
|
||||
{
|
||||
@@ -352,9 +351,12 @@ cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */
|
||||
|
||||
cupsFreeOptions(cg->cupsd_num_settings, cg->cupsd_settings);
|
||||
|
||||
if (cg->raster_error.start)
|
||||
free(cg->raster_error.start);
|
||||
|
||||
free(cg);
|
||||
}
|
||||
#endif /* HAVE_PTHREAD_H || WIN32 */
|
||||
#endif /* HAVE_PTHREAD_H || _WIN32 */
|
||||
|
||||
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
|
||||
+7
-4
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
* Hashing function for CUPS.
|
||||
*
|
||||
* Copyright 2015-2017 by Apple Inc.
|
||||
* Copyright © 2015-2019 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -16,7 +17,7 @@
|
||||
#elif defined(HAVE_GNUTLS)
|
||||
# include <gnutls/crypto.h>
|
||||
#else
|
||||
# include "md5-private.h"
|
||||
# include "md5-internal.h"
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
@@ -229,7 +230,7 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
|
||||
|
||||
gnutls_hash_fast(alg, data, datalen, hash);
|
||||
|
||||
return (gnutls_hash_get_len(alg));
|
||||
return ((ssize_t)gnutls_hash_get_len(alg));
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -274,6 +275,8 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
|
||||
* 'cupsHashString()' - Format a hash value as a hexadecimal string.
|
||||
*
|
||||
* The passed buffer must be at least 2 * hashsize + 1 characters in length.
|
||||
*
|
||||
* @since CUPS 2.2.7@
|
||||
*/
|
||||
|
||||
const char * /* O - Formatted string */
|
||||
|
||||
+11
-7
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* HTTP address routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2014 by Apple Inc.
|
||||
* Copyright 2007-2019 by Apple Inc.
|
||||
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -12,13 +13,16 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_RESOLV_H
|
||||
# include <resolv.h>
|
||||
#endif /* HAVE_RESOLV_H */
|
||||
#ifdef __APPLE__
|
||||
# include <CoreFoundation/CoreFoundation.h>
|
||||
# include <SystemConfiguration/SystemConfiguration.h>
|
||||
# ifdef HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME
|
||||
# include <SystemConfiguration/SystemConfiguration.h>
|
||||
# endif /* HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME */
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
@@ -63,11 +67,11 @@ int /* O - 0 on success, -1 on failure */
|
||||
httpAddrClose(http_addr_t *addr, /* I - Listen address or @code NULL@ */
|
||||
int fd) /* I - Socket file descriptor */
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (closesocket(fd))
|
||||
#else
|
||||
if (close(fd))
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
return (-1);
|
||||
|
||||
#ifdef AF_LOCAL
|
||||
@@ -252,9 +256,9 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
|
||||
* Close on exec...
|
||||
*/
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
#ifdef SO_NOSIGPIPE
|
||||
/*
|
||||
|
||||
+29
-20
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* HTTP address list routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -12,15 +13,16 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
#ifdef HAVE_RESOLV_H
|
||||
# include <resolv.h>
|
||||
#endif /* HAVE_RESOLV_H */
|
||||
#ifdef HAVE_POLL
|
||||
# include <poll.h>
|
||||
#endif /* HAVE_POLL */
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
# include <fcntl.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -55,14 +57,14 @@ httpAddrConnect2(
|
||||
int *cancel) /* I - Pointer to "cancel" variable */
|
||||
{
|
||||
int val; /* Socket option value */
|
||||
#ifndef WIN32
|
||||
int flags; /* Socket flags */
|
||||
#endif /* !WIN32 */
|
||||
int remaining; /* Remaining timeout */
|
||||
#ifndef _WIN32
|
||||
int i, j, /* Looping vars */
|
||||
nfds, /* Number of file descriptors */
|
||||
fds[100], /* Socket file descriptors */
|
||||
flags, /* Socket flags */
|
||||
result; /* Result from select() or poll() */
|
||||
#endif /* !_WIN32 */
|
||||
int remaining; /* Remaining timeout */
|
||||
int nfds, /* Number of file descriptors */
|
||||
fds[100]; /* Socket file descriptors */
|
||||
http_addrlist_t *addrs[100]; /* Addresses */
|
||||
#ifndef HAVE_POLL
|
||||
int max_fd = -1; /* Highest file descriptor */
|
||||
@@ -78,8 +80,10 @@ httpAddrConnect2(
|
||||
# endif /* HAVE_POLL */
|
||||
#endif /* O_NONBLOCK */
|
||||
#ifdef DEBUG
|
||||
# ifndef _WIN32
|
||||
socklen_t len; /* Length of value */
|
||||
http_addr_t peer; /* Peer address */
|
||||
# endif /* !_WIN32 */
|
||||
char temp[256]; /* Temporary address string */
|
||||
#endif /* DEBUG */
|
||||
|
||||
@@ -207,11 +211,11 @@ httpAddrConnect2(
|
||||
return (addrlist);
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (WSAGetLastError() != WSAEINPROGRESS && WSAGetLastError() != WSAEWOULDBLOCK)
|
||||
#else
|
||||
if (errno != EINPROGRESS && errno != EWOULDBLOCK)
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
{
|
||||
DEBUG_printf(("1httpAddrConnect2: Unable to connect to %s:%d: %s", httpAddrString(&(addrlist->addr), temp, sizeof(temp)), httpAddrPort(&(addrlist->addr)), strerror(errno)));
|
||||
httpAddrClose(NULL, fds[nfds]);
|
||||
@@ -219,9 +223,9 @@ httpAddrConnect2(
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
fcntl(fds[nfds], F_SETFL, flags);
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
#ifndef HAVE_POLL
|
||||
if (fds[nfds] > max_fd)
|
||||
@@ -290,11 +294,11 @@ httpAddrConnect2(
|
||||
DEBUG_printf(("1httpAddrConnect2: select() returned %d (%d)", result, errno));
|
||||
# endif /* HAVE_POLL */
|
||||
}
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
while (result < 0 && (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEWOULDBLOCK));
|
||||
# else
|
||||
while (result < 0 && (errno == EINTR || errno == EAGAIN));
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
|
||||
if (result > 0)
|
||||
{
|
||||
@@ -371,11 +375,11 @@ httpAddrConnect2(
|
||||
httpAddrClose(NULL, fds[nfds]);
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
_cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, "Connection failed", 0);
|
||||
#else
|
||||
_cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, strerror(errno), 0);
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@@ -612,6 +616,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
if (!temp)
|
||||
{
|
||||
httpAddrFreeList(first);
|
||||
freeaddrinfo(results);
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
|
||||
return (NULL);
|
||||
}
|
||||
@@ -647,7 +652,11 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
if (error == EAI_FAIL)
|
||||
cg->need_res_init = 1;
|
||||
|
||||
# ifdef _WIN32 /* Really, Microsoft?!? */
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, gai_strerrorA(error), 0);
|
||||
# else
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, gai_strerror(error), 0);
|
||||
# endif /* _WIN32 */
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -842,11 +851,11 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p
|
||||
|
||||
temp->addr.ipv6.sin6_family = AF_INET6;
|
||||
temp->addr.ipv6.sin6_port = htons(portnum);
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
temp->addr.ipv6.sin6_addr.u.Byte[15] = 1;
|
||||
# else
|
||||
temp->addr.ipv6.sin6_addr.s6_addr32[3] = htonl(1);
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
|
||||
if (!first)
|
||||
first = temp;
|
||||
|
||||
+43
-148
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Private HTTP definitions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2017 by Apple Inc.
|
||||
* Copyright 2007-2018 by Apple Inc.
|
||||
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_HTTP_PRIVATE_H_
|
||||
@@ -24,7 +25,8 @@
|
||||
# endif /* __sun */
|
||||
|
||||
# include <limits.h>
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
# define _WINSOCK_DEPRECATED_NO_WARNINGS 1
|
||||
# include <io.h>
|
||||
# include <winsock2.h>
|
||||
# define CUPS_SOCAST (const char *)
|
||||
@@ -33,7 +35,7 @@
|
||||
# include <fcntl.h>
|
||||
# include <sys/socket.h>
|
||||
# define CUPS_SOCAST
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
|
||||
# ifdef HAVE_GSSAPI
|
||||
# ifdef HAVE_GSS_GSSAPI_H
|
||||
@@ -71,60 +73,13 @@ typedef int socklen_t;
|
||||
# include <CoreFoundation/CoreFoundation.h>
|
||||
# include <Security/Security.h>
|
||||
# include <Security/SecureTransport.h>
|
||||
# ifdef HAVE_SECURETRANSPORTPRIV_H
|
||||
# include <Security/SecureTransportPriv.h>
|
||||
# endif /* HAVE_SECURETRANSPORTPRIV_H */
|
||||
# ifdef HAVE_SECITEM_H
|
||||
# include <Security/SecItem.h>
|
||||
# endif /* HAVE_SECITEM_H */
|
||||
# ifdef HAVE_SECBASEPRIV_H
|
||||
# include <Security/SecBasePriv.h>
|
||||
# endif /* HAVE_SECBASEPRIV_H */
|
||||
# ifdef HAVE_SECCERTIFICATE_H
|
||||
# include <Security/SecCertificate.h>
|
||||
# include <Security/SecIdentity.h>
|
||||
# endif /* HAVE_SECCERTIFICATE_H */
|
||||
# ifdef HAVE_SECCERTIFICATEPRIV_H
|
||||
# include <Security/SecCertificatePriv.h>
|
||||
# else
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif /* __cplusplus */
|
||||
# ifndef _SECURITY_VERSION_GREATER_THAN_57610_
|
||||
typedef CF_OPTIONS(uint32_t, SecKeyUsage) {
|
||||
kSecKeyUsageAll = 0x7FFFFFFF
|
||||
};
|
||||
# endif /* !_SECURITY_VERSION_GREATER_THAN_57610_ */
|
||||
extern const void * kSecCSRChallengePassword;
|
||||
extern const void * kSecSubjectAltName;
|
||||
extern const void * kSecCertificateKeyUsage;
|
||||
extern const void * kSecCSRBasicContraintsPathLen;
|
||||
extern const void * kSecCertificateExtensions;
|
||||
extern const void * kSecCertificateExtensionsEncoded;
|
||||
extern const void * kSecOidCommonName;
|
||||
extern const void * kSecOidCountryName;
|
||||
extern const void * kSecOidStateProvinceName;
|
||||
extern const void * kSecOidLocalityName;
|
||||
extern const void * kSecOidOrganization;
|
||||
extern const void * kSecOidOrganizationalUnit;
|
||||
extern SecCertificateRef SecCertificateCreateWithBytes(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length);
|
||||
extern bool SecCertificateIsValid(SecCertificateRef certificate, CFAbsoluteTime verifyTime);
|
||||
extern CFAbsoluteTime SecCertificateNotValidAfter(SecCertificateRef certificate);
|
||||
extern SecCertificateRef SecGenerateSelfSignedCertificate(CFArrayRef subject, CFDictionaryRef parameters, SecKeyRef publicKey, SecKeyRef privateKey);
|
||||
extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificateRef certificate, SecKeyRef privateKey);
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
# endif /* HAVE_SECCERTIFICATEPRIV_H */
|
||||
# ifdef HAVE_SECITEMPRIV_H
|
||||
# include <Security/SecItemPriv.h>
|
||||
# endif /* HAVE_SECITEMPRIV_H */
|
||||
# ifdef HAVE_SECIDENTITYSEARCHPRIV_H
|
||||
# include <Security/SecIdentitySearchPriv.h>
|
||||
# endif /* HAVE_SECIDENTITYSEARCHPRIV_H */
|
||||
# ifdef HAVE_SECPOLICYPRIV_H
|
||||
# include <Security/SecPolicyPriv.h>
|
||||
# endif /* HAVE_SECPOLICYPRIV_H */
|
||||
# elif defined(HAVE_SSPISSL)
|
||||
# include <wincrypt.h>
|
||||
# include <wintrust.h>
|
||||
@@ -134,7 +89,7 @@ extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificate
|
||||
# include <sspi.h>
|
||||
# endif /* HAVE_GNUTLS */
|
||||
|
||||
# ifndef WIN32
|
||||
# ifndef _WIN32
|
||||
# include <net/if.h>
|
||||
# include <resolv.h>
|
||||
# ifdef HAVE_GETIFADDRS
|
||||
@@ -145,11 +100,7 @@ extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificate
|
||||
# include <sys/sockio.h>
|
||||
# endif /* HAVE_SYS_SOCKIO_H */
|
||||
# endif /* HAVE_GETIFADDRS */
|
||||
# endif /* !WIN32 */
|
||||
|
||||
# ifdef HAVE_LIBZ
|
||||
# include <zlib.h>
|
||||
# endif /* HAVE_LIBZ */
|
||||
# endif /* !_WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -203,21 +154,6 @@ typedef gnutls_certificate_credentials_t *http_tls_credentials_t;
|
||||
* for its IO and protocol management...
|
||||
*/
|
||||
|
||||
# if !defined(HAVE_SECBASEPRIV_H) && defined(HAVE_CSSMERRORSTRING) /* Declare prototype for function in that header... */
|
||||
extern const char *cssmErrorString(int error);
|
||||
# endif /* !HAVE_SECBASEPRIV_H && HAVE_CSSMERRORSTRING */
|
||||
# if !defined(HAVE_SECIDENTITYSEARCHPRIV_H) && defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) /* Declare prototype for function in that header... */
|
||||
extern OSStatus SecIdentitySearchCreateWithPolicy(SecPolicyRef policy,
|
||||
CFStringRef idString, CSSM_KEYUSE keyUsage,
|
||||
CFTypeRef keychainOrArray,
|
||||
Boolean returnOnlyValidIdentities,
|
||||
SecIdentitySearchRef* searchRef);
|
||||
# endif /* !HAVE_SECIDENTITYSEARCHPRIV_H && HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY */
|
||||
# if !defined(HAVE_SECPOLICYPRIV_H) && defined(HAVE_SECPOLICYSETVALUE) /* Declare prototype for function in that header... */
|
||||
extern OSStatus SecPolicySetValue(SecPolicyRef policyRef,
|
||||
const CSSM_DATA *value);
|
||||
# endif /* !HAVE_SECPOLICYPRIV_H && HAVE_SECPOLICYSETVALUE */
|
||||
|
||||
typedef SSLContextRef http_tls_t;
|
||||
typedef CFArrayRef http_tls_credentials_t;
|
||||
|
||||
@@ -285,8 +221,8 @@ struct _http_s /**** HTTP connection structure ****/
|
||||
struct sockaddr_in _hostaddr; /* Address of connected host (deprecated) */
|
||||
char hostname[HTTP_MAX_HOST],
|
||||
/* Name of connected host */
|
||||
fields[HTTP_FIELD_ACCEPT_ENCODING][HTTP_MAX_VALUE];
|
||||
/* Field values up to Accept-Encoding */
|
||||
_fields[HTTP_FIELD_ACCEPT_ENCODING][HTTP_MAX_VALUE];
|
||||
/* Field values up to Accept-Encoding (deprecated) */
|
||||
char *data; /* Pointer to data buffer */
|
||||
http_encoding_t data_encoding; /* Chunked or not */
|
||||
int _data_remaining;/* Number of bytes left (deprecated) */
|
||||
@@ -322,8 +258,6 @@ struct _http_s /**** HTTP connection structure ****/
|
||||
int wused; /* Write buffer bytes used */
|
||||
|
||||
/**** New in CUPS 1.3 ****/
|
||||
char *field_authorization;
|
||||
/* Authorization field */
|
||||
char *authstring; /* Current Authorization field */
|
||||
# ifdef HAVE_GSSAPI
|
||||
gss_OID gssmech; /* Authentication mechanism */
|
||||
@@ -348,23 +282,26 @@ struct _http_s /**** HTTP connection structure ****/
|
||||
/**** New in CUPS 1.7 ****/
|
||||
int tls_upgrade; /* Non-zero if we are doing an upgrade */
|
||||
_http_mode_t mode; /* _HTTP_MODE_CLIENT or _HTTP_MODE_SERVER */
|
||||
char *accept_encoding,
|
||||
/* Accept-Encoding field */
|
||||
*allow, /* Allow field */
|
||||
*server, /* Server field */
|
||||
*default_accept_encoding,
|
||||
*default_server,
|
||||
*default_user_agent;
|
||||
/* Default field values */
|
||||
# ifdef HAVE_LIBZ
|
||||
_http_coding_t coding; /* _HTTP_CODING_xxx */
|
||||
z_stream stream; /* (De)compression stream */
|
||||
Bytef *sbuffer; /* (De)compression buffer */
|
||||
void *stream; /* (De)compression stream */
|
||||
unsigned char *sbuffer; /* (De)compression buffer */
|
||||
# endif /* HAVE_LIBZ */
|
||||
|
||||
/**** New in CUPS 2.2.9 ****/
|
||||
char algorithm[65], /* Algorithm from WWW-Authenticate */
|
||||
nextnonce[HTTP_MAX_VALUE],
|
||||
/* Next nonce value from Authentication-Info */
|
||||
opaque[HTTP_MAX_VALUE],
|
||||
/* Opaque value from WWW-Authenticate */
|
||||
realm[HTTP_MAX_VALUE];
|
||||
/* Realm from WWW-Authenticate */
|
||||
|
||||
/**** New in CUPS 2.3 ****/
|
||||
char *www_authenticate;
|
||||
/* WWW-Authenticate value */
|
||||
char *fields[HTTP_FIELD_MAX],
|
||||
/* Allocated field values */
|
||||
*default_fields[HTTP_FIELD_MAX];
|
||||
/* Default field values, if any */
|
||||
};
|
||||
# endif /* !_HTTP_NO_PRIVATE */
|
||||
|
||||
@@ -379,76 +316,34 @@ extern const char *_cups_hstrerror(int error);
|
||||
# endif /* !HAVE_HSTRERROR */
|
||||
|
||||
|
||||
/*
|
||||
* Some OS's don't have getifaddrs() and freeifaddrs()...
|
||||
*/
|
||||
|
||||
# if !defined(WIN32) && !defined(HAVE_GETIFADDRS)
|
||||
# ifdef ifa_dstaddr
|
||||
# undef ifa_dstaddr
|
||||
# endif /* ifa_dstaddr */
|
||||
# ifndef ifr_netmask
|
||||
# define ifr_netmask ifr_addr
|
||||
# endif /* !ifr_netmask */
|
||||
|
||||
struct ifaddrs /**** Interface Structure ****/
|
||||
{
|
||||
struct ifaddrs *ifa_next; /* Next interface in list */
|
||||
char *ifa_name; /* Name of interface */
|
||||
unsigned int ifa_flags; /* Flags (up, point-to-point, etc.) */
|
||||
struct sockaddr *ifa_addr, /* Network address */
|
||||
*ifa_netmask; /* Address mask */
|
||||
union
|
||||
{
|
||||
struct sockaddr *ifu_broadaddr; /* Broadcast address of this interface. */
|
||||
struct sockaddr *ifu_dstaddr; /* Point-to-point destination address. */
|
||||
} ifa_ifu;
|
||||
|
||||
void *ifa_data; /* Interface statistics */
|
||||
};
|
||||
|
||||
# ifndef ifa_broadaddr
|
||||
# define ifa_broadaddr ifa_ifu.ifu_broadaddr
|
||||
# endif /* !ifa_broadaddr */
|
||||
# ifndef ifa_dstaddr
|
||||
# define ifa_dstaddr ifa_ifu.ifu_dstaddr
|
||||
# endif /* !ifa_dstaddr */
|
||||
|
||||
extern int _cups_getifaddrs(struct ifaddrs **addrs);
|
||||
# define getifaddrs _cups_getifaddrs
|
||||
extern void _cups_freeifaddrs(struct ifaddrs *addrs);
|
||||
# define freeifaddrs _cups_freeifaddrs
|
||||
# endif /* !WIN32 && !HAVE_GETIFADDRS */
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern void _httpAddrSetPort(http_addr_t *addr, int port);
|
||||
extern void _httpAddrSetPort(http_addr_t *addr, int port) _CUPS_PRIVATE;
|
||||
extern http_tls_credentials_t
|
||||
_httpCreateCredentials(cups_array_t *credentials);
|
||||
_httpCreateCredentials(cups_array_t *credentials) _CUPS_PRIVATE;
|
||||
extern char *_httpDecodeURI(char *dst, const char *src,
|
||||
size_t dstsize);
|
||||
extern void _httpDisconnect(http_t *http);
|
||||
size_t dstsize) _CUPS_PRIVATE;
|
||||
extern void _httpDisconnect(http_t *http) _CUPS_PRIVATE;
|
||||
extern char *_httpEncodeURI(char *dst, const char *src,
|
||||
size_t dstsize);
|
||||
extern void _httpFreeCredentials(http_tls_credentials_t credentials);
|
||||
size_t dstsize) _CUPS_PRIVATE;
|
||||
extern void _httpFreeCredentials(http_tls_credentials_t credentials) _CUPS_PRIVATE;
|
||||
extern const char *_httpResolveURI(const char *uri, char *resolved_uri,
|
||||
size_t resolved_size, int options,
|
||||
int (*cb)(void *context),
|
||||
void *context);
|
||||
extern const char *_httpStatus(cups_lang_t *lang, http_status_t status);
|
||||
extern void _httpTLSInitialize(void);
|
||||
extern size_t _httpTLSPending(http_t *http);
|
||||
extern int _httpTLSRead(http_t *http, char *buf, int len);
|
||||
extern int _httpTLSSetCredentials(http_t *http);
|
||||
extern void _httpTLSSetOptions(int options, int min_version, int max_version);
|
||||
extern int _httpTLSStart(http_t *http);
|
||||
extern void _httpTLSStop(http_t *http);
|
||||
extern int _httpTLSWrite(http_t *http, const char *buf, int len);
|
||||
extern int _httpUpdate(http_t *http, http_status_t *status);
|
||||
extern int _httpWait(http_t *http, int msec, int usessl);
|
||||
void *context) _CUPS_PRIVATE;
|
||||
extern int _httpSetDigestAuthString(http_t *http, const char *nonce, const char *method, const char *resource) _CUPS_PRIVATE;
|
||||
extern const char *_httpStatus(cups_lang_t *lang, http_status_t status) _CUPS_PRIVATE;
|
||||
extern void _httpTLSInitialize(void) _CUPS_PRIVATE;
|
||||
extern size_t _httpTLSPending(http_t *http) _CUPS_PRIVATE;
|
||||
extern int _httpTLSRead(http_t *http, char *buf, int len) _CUPS_PRIVATE;
|
||||
extern void _httpTLSSetOptions(int options, int min_version, int max_version) _CUPS_PRIVATE;
|
||||
extern int _httpTLSStart(http_t *http) _CUPS_PRIVATE;
|
||||
extern void _httpTLSStop(http_t *http) _CUPS_PRIVATE;
|
||||
extern int _httpTLSWrite(http_t *http, const char *buf, int len) _CUPS_PRIVATE;
|
||||
extern int _httpUpdate(http_t *http, http_status_t *status) _CUPS_PRIVATE;
|
||||
extern int _httpWait(http_t *http, int msec, int usessl) _CUPS_PRIVATE;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
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