Comparar commits
581 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 82e3ee0e32 | |||
| 1f2a315c2b | |||
| 9183329049 | |||
| 2ed9e648a7 | |||
| 7a672d0bdc | |||
| d42bc1c4f9 | |||
| 9c2b03c1f7 | |||
| 40a6b95e55 | |||
| ed181c24e4 | |||
| dbdf8a2a45 | |||
| b018978c27 | |||
| bb640280b6 | |||
| 0f98a48497 | |||
| a00d9eaecf | |||
| f937322154 | |||
| 2cfb7357e2 | |||
| 71023b1700 | |||
| 5d2ac21a00 | |||
| 81d8eb3af3 | |||
| b4f9e3f7ba | |||
| 7a2be9facf | |||
| 5ea07c61ba | |||
| e8378539e0 | |||
| 9240cd70a2 | |||
| e90a53ab8d | |||
| e6330cabb8 | |||
| eb03b2d232 | |||
| 1a3915dded | |||
| d6ec252e9b | |||
| 2bae6fc518 | |||
| 6f7bd716e6 | |||
| fd8e2bdb2d | |||
| 56ba2f5122 | |||
| b1f4c1e664 | |||
| b2b97b71f1 | |||
| f4a99aeb02 | |||
| f950947148 | |||
| b31d4ca525 | |||
| 6d391f7705 | |||
| e2eb28cfcf | |||
| 3ff5a8e393 | |||
| bea505c32e | |||
| 93df3887e0 | |||
| 986daa034e | |||
| 5129a91c54 | |||
| 025b8ce8f6 | |||
| 45f72738bb | |||
| 397eefaa69 | |||
| 9e82c53ebc | |||
| 7454512be9 | |||
| 3c985bae7f | |||
| ec8beb8952 | |||
| 4c793ee9ce | |||
| e35d176c54 | |||
| 2a06655e5c | |||
| 692b157d0c | |||
| 13e6d13ea4 | |||
| fca9a9818d | |||
| 771e64526d | |||
| 5b835597f3 | |||
| 99c3e9f3f2 | |||
| 2b47f09162 | |||
| 6936a1222d | |||
| dc407006a7 | |||
| cfaaa07a19 | |||
| eff8c82f6a | |||
| 3ba95ec48d | |||
| f8688d733b | |||
| 1e01995a1c | |||
| 68dc110f52 | |||
| 998a43a0dd | |||
| bc5060a1dd | |||
| ee6be9cd7e | |||
| 8fb0d30daa | |||
| c669a17e64 | |||
| 34934be905 | |||
| 89fabc72df | |||
| 93d79201b2 | |||
| ed174a7cec | |||
| 5e0dc7e14c | |||
| 1553df019b | |||
| 873c513326 | |||
| 69e37fbf52 | |||
| 05690fddfa | |||
| 7b6d49eec9 | |||
| d46a87a45f | |||
| 60a7373f31 | |||
| 2c030c7a06 | |||
| d784ca2f83 | |||
| f4b0bfa2db | |||
| 5754bcceeb | |||
| f79dad58ab | |||
| 3cf5b72ab7 | |||
| c76c53615c | |||
| 9ec6124c37 | |||
| 8e048e4d39 | |||
| dc00a7c3ad | |||
| db1c94f3a1 | |||
| 65048b860c | |||
| 43c0e4a9d5 | |||
| eda46e3aac | |||
| 6647894889 | |||
| 614efb7a87 | |||
| c5dcd7ecff | |||
| 9c13b7d26e | |||
| 4e104fb9c8 | |||
| 242b4b9be6 | |||
| 9539c53065 | |||
| 3c27d2a6dd | |||
| e9a4e9d6ea | |||
| c0a097c92f | |||
| 9a5e6d74b9 | |||
| f93b470e22 | |||
| 90d3999e0d | |||
| c9b65dc4d9 | |||
| 8ef4f507d7 | |||
| 3001a140d6 | |||
| 2614dc6385 | |||
| b7569be6f4 | |||
| e02771e0c6 | |||
| 11c5618507 | |||
| ce3f7bf3e9 | |||
| 387ef588c9 | |||
| 2e738f0309 | |||
| 8e901a3856 | |||
| 53cac1d08b | |||
| 9c554374b5 | |||
| 03cc81b703 | |||
| 5098fdde63 | |||
| 0cf87cf506 | |||
| 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 |
+3
-1
@@ -1,3 +1,5 @@
|
||||
.git* export-ignore
|
||||
.mailmap export-ignore
|
||||
tools export-ignore
|
||||
examples/testfile.pcl -text
|
||||
exampels/testfile.txt -text
|
||||
scripts export-ignore
|
||||
|
||||
+24
-26
@@ -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,6 +34,14 @@ 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
|
||||
@@ -62,6 +65,7 @@ cups/testppd
|
||||
cups/testpwg
|
||||
cups/testraster
|
||||
cups/testsnmp
|
||||
cups/testthreads
|
||||
cups/tlscheck
|
||||
desktop/cups.desktop
|
||||
doc/index.html
|
||||
@@ -76,14 +80,6 @@ filter/rastertopwg
|
||||
locale/checkpo
|
||||
locale/po2strings
|
||||
locale/strings2po
|
||||
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
|
||||
man/mantohtml
|
||||
monitor/bcp
|
||||
monitor/tbcp
|
||||
@@ -92,8 +88,6 @@ notifier/mailto
|
||||
notifier/rss
|
||||
notifier/testnotify
|
||||
packaging/cups.list
|
||||
org.cups.docset*
|
||||
patches
|
||||
ppdc/genstrings
|
||||
ppdc/ppd/
|
||||
ppdc/ppd2/
|
||||
@@ -117,6 +111,7 @@ scheduler/cups.sh
|
||||
scheduler/cups.xml
|
||||
scheduler/cupsd
|
||||
scheduler/cupsfilter
|
||||
scheduler/org.cups.cups-lpd.plist
|
||||
scheduler/org.cups.cups-lpdAT.service
|
||||
scheduler/org.cups.cupsd.path
|
||||
scheduler/org.cups.cupsd.service
|
||||
@@ -125,7 +120,6 @@ scheduler/testlpd
|
||||
scheduler/testmime
|
||||
scheduler/testspeed
|
||||
scheduler/testsub
|
||||
systemv/accept
|
||||
systemv/cancel
|
||||
systemv/cupsaccept
|
||||
systemv/cupsaddsmb
|
||||
@@ -141,18 +135,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/
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
queries:
|
||||
- exclude: cpp/integer-multiplication-cast-to-long
|
||||
- exclude: cpp/missing-header-guard
|
||||
- exclude: cpp/short-global-name
|
||||
+272
-1
@@ -1,6 +1,277 @@
|
||||
CHANGES - 2.3b4 - 2018-03-23
|
||||
CHANGES - 2.3.3 - 2020-04-24
|
||||
============================
|
||||
|
||||
Changes in CUPS v2.3.3
|
||||
----------------------
|
||||
|
||||
- CVE-2020-3898: The `ppdOpen` function did not handle invalid UI
|
||||
constraint. `ppdcSource::get_resolution` function did not handle
|
||||
invalid resolution strings.
|
||||
- CVE-2019-8842: The `ippReadIO` function may under-read an extension
|
||||
field.
|
||||
- Fixed WARNING_OPTIONS support for GCC 9.x
|
||||
|
||||
Changes in CUPS v2.3.2
|
||||
----------------------
|
||||
|
||||
- Localization updates.
|
||||
|
||||
|
||||
Changes in CUPS v2.3.1
|
||||
----------------------
|
||||
|
||||
- Documentation updates (Issue #5661, #5674, #5682)
|
||||
- CVE-2019-2228: The `ippSetValuetag` function did not validate the default
|
||||
language value.
|
||||
- Fixed a crash bug in the web interface (Issue #5621)
|
||||
- The PPD cache code now looks up page sizes using their dimensions
|
||||
(Issue #5633)
|
||||
- PPD files containing "custom" option keywords did not work (Issue #5639)
|
||||
- Added a workaround for the scheduler's systemd support (Issue #5640)
|
||||
- On Windows, TLS certificates generated on February 29 would likely fail
|
||||
(Issue #5643)
|
||||
- Added a DigestOptions directive for the `client.conf` file to control whether
|
||||
MD5-based Digest authentication is allowed (Issue #5647)
|
||||
- Fixed a bug in the handling of printer resource files (Issue #5652)
|
||||
- The libusb-based USB backend now reports an error when the distribution
|
||||
permissions are wrong (Issue #5658)
|
||||
- Added paint can labels to Dymo driver (Issue #5662)
|
||||
- The `ippeveprinter` program now supports authentication (Issue #5665)
|
||||
- The `ippeveprinter` program now advertises DNS-SD services on the correct
|
||||
interfaces, and provides a way to turn them off (Issue #5666)
|
||||
- The `--with-dbusdir` option was ignored by the configure script (Issue #5671)
|
||||
- Sandboxed applications were not able to get the default printer (Issue #5676)
|
||||
- Log file access controls were not preserved by `cupsctl` (Issue #5677)
|
||||
- Default printers set with `lpoptions` did not work in all cases (Issue #5681,
|
||||
Issue #5683, Issue #5684)
|
||||
- Fixed an error in the jobs web interface template (Issue #5694)
|
||||
- Fixed an off-by-one error in `ippEnumString` (Issue #5695)
|
||||
- Fixed some new compiler warnings (Issue #5700)
|
||||
- Fixed a few issues with the Apple Raster support (rdar://55301114)
|
||||
- The IPP backend did not detect all cases where a job should be retried using
|
||||
a raster format (rdar://56021091)
|
||||
- Fixed spelling of "fold-accordion".
|
||||
- Fixed the default common name for TLS certificates used by `ippeveprinter`.
|
||||
- Fixed the option names used for IPP Everywhere finishing options.
|
||||
- Added support for the second roll of the DYMO Twin/DUO label printers.
|
||||
|
||||
|
||||
Changes in CUPS v2.3.0
|
||||
----------------------
|
||||
|
||||
- CVE-2019-8696 and CVE-2019-8675: Fixed SNMP buffer overflows (rdar://51685251)
|
||||
- Added a GPL2/LGPL2 exception to the new CUPS license terms.
|
||||
- Documentation updates (Issue #5604)
|
||||
- Localization updates (Issue #5637)
|
||||
- Fixed a bug in the scheduler job cleanup code (Issue #5588)
|
||||
- Fixed builds when there is no TLS library (Issue #5590)
|
||||
- Eliminated some new GCC compiler warnings (Issue #5591)
|
||||
- Removed dead code from the scheduler (Issue #5593)
|
||||
- "make" failed with GZIP options (Issue #5595)
|
||||
- Fixed potential excess logging from the scheduler when removing job files
|
||||
(Issue #5597)
|
||||
- Fixed a NULL pointer dereference bug in `httpGetSubField2` (Issue #5598)
|
||||
- Added FIPS-140 workarounds for GNU TLS (Issue #5601, Issue #5622)
|
||||
- The scheduler no longer provides a default value for the description
|
||||
(Issue #5603)
|
||||
- The scheduler now logs jobs held for authentication using the error level so
|
||||
it is clear what happened (Issue #5604)
|
||||
- The `lpadmin` command did not always update the PPD file for changes to the
|
||||
`cupsIPPSupplies` and `cupsSNMPSupplies` keywords (Issue #5610)
|
||||
- The scheduler now uses both the group's membership list as well as the
|
||||
various OS-specific membership functions to determine whether a user belongs
|
||||
to a named group (Issue #5613)
|
||||
- Added USB quirks rule for HP LaserJet 1015 (Issue #5617)
|
||||
- Fixed some PPD parser issues (Issue #5623, Issue #5624)
|
||||
- The IPP parser no longer allows invalid member attributes in collections
|
||||
(Issue #5630)
|
||||
- The configure script now treats the "wheel" group as a potential system
|
||||
group (Issue #5638)
|
||||
- Fixed a USB printing issue on macOS (rdar://31433931)
|
||||
- Fixed IPP buffer overflow (rdar://50035411)
|
||||
- Fixed memory disclosure issue in the scheduler (rdar://51373853)
|
||||
- Fixed DoS issues in the scheduler (rdar://51373929)
|
||||
- Fixed an issue with unsupported "sides" values in the IPP backend
|
||||
(rdar://51775322)
|
||||
- The scheduler would restart continuously when idle and printers were not
|
||||
shared (rdar://52561199)
|
||||
- Fixed an issue with `EXPECT !name WITH-VALUE ...` tests.
|
||||
- Fixed a command ordering issue in the Zebra ZPL driver.
|
||||
- Fixed a memory leak in `ppdOpen`.
|
||||
|
||||
|
||||
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
|
||||
----------------------
|
||||
|
||||
|
||||
+6
-5
@@ -2,13 +2,14 @@ Contributing to CUPS
|
||||
====================
|
||||
|
||||
CUPS is developed by Apple Inc. and distributed as open source software under
|
||||
the Apache License, Version 2.0. Significant contributions to CUPS must be
|
||||
licensed to Apple using the Apple Contributor Agreement:
|
||||
the Apache License, Version 2.0 with exceptions to allow linking to GPL2/LGPL2
|
||||
code. Significant contributions to CUPS must be licensed to Apple using the
|
||||
Apple Contributor Agreement:
|
||||
|
||||
https://www.cups.org/AppleContributorAgreement_2011-03-10.pdf
|
||||
|
||||
Contributions should be submitted as attachments to bug reports on the CUPS web
|
||||
site. Changes to existing source files should be submitted as unified diffs
|
||||
(both Subversion and Git produce this format by default) while new source files
|
||||
Contributions should be submitted as attachments to bug reports on the
|
||||
[CUPS Github project](https://github.com/apple/cups). Changes to existing
|
||||
source files should be submitted as unified diffs while new source files
|
||||
should be provided as-is or in an archive. Github pull requests can also be
|
||||
used to submit changes.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
CREDITS - 2017-05-01
|
||||
CREDITS - 2019-08-21
|
||||
====================
|
||||
|
||||
Few projects are completed by one person, and CUPS is no exception. We'd like
|
||||
|
||||
+15
-7
@@ -63,7 +63,9 @@ major, minor, and patch release numbers. Major release numbers indicate large
|
||||
design changes or backwards-incompatible changes to the CUPS API or CUPS
|
||||
Imaging API. Minor release numbers indicate new features and other smaller
|
||||
changes which are backwards-compatible with previous CUPS releases. Patch
|
||||
numbers indicate bug fixes to the previous feature or patch release.
|
||||
numbers indicate bug fixes to the previous feature or patch release. This
|
||||
version numbering scheme is consistent with the
|
||||
[Semantic Versioning](http://semver.org) specification.
|
||||
|
||||
> Note:
|
||||
>
|
||||
@@ -114,6 +116,10 @@ Contributed source code must follow the guidelines below. While the examples
|
||||
are for C and C++ source files, source code for other languages should conform
|
||||
to the same guidelines as allowed by the language.
|
||||
|
||||
Source code comments provide the reference portion of the CUPS Programming
|
||||
Manual, which is generated using the [codedoc](https://www.msweet.org/codedoc)
|
||||
software.
|
||||
|
||||
|
||||
### Source Files
|
||||
|
||||
@@ -270,15 +276,17 @@ Return/output values are indicated using an "O" prefix, input values are
|
||||
indicated using the "I" prefix, and values that are both input and output use
|
||||
the "IO" prefix for the corresponding in-line comment.
|
||||
|
||||
The Mini-XML documentation generator also understands the following special
|
||||
text in the function description comment:
|
||||
The [codedoc](https://www.msweet.org/codedoc) documentation generator also
|
||||
understands the following special text in the function description comment:
|
||||
|
||||
@deprecated@ - Marks the function as deprecated (not recommended
|
||||
for new development and scheduled for removal)
|
||||
@deprecated@ - Marks the function as deprecated: not recommended
|
||||
for new development and scheduled for removal.
|
||||
@link name@ - Provides a hyperlink to the corresponding function
|
||||
or type definition.
|
||||
@since CUPS version@ - Marks the function as new in the specified version
|
||||
of CUPS.
|
||||
@private@ - Marks the function as private (same as starting the
|
||||
function name with an underscore)
|
||||
@private@ - Marks the function as private so it will not be
|
||||
included in the documentation.
|
||||
|
||||
|
||||
### Variables
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v2.3b4 - 2018-03-22
|
||||
INSTALL - CUPS v2.3.3 - 2020-04-24
|
||||
==================================
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
|
||||
+41
-41
@@ -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.
|
||||
#
|
||||
|
||||
#
|
||||
@@ -25,7 +26,7 @@ CHMOD = @CHMOD@
|
||||
CXX = @LIBTOOL_CXX@ @CXX@
|
||||
DSO = @DSO@
|
||||
DSOXX = @DSOXX@
|
||||
GZIP = @GZIP@
|
||||
GZIPPROG = @GZIPPROG@
|
||||
INSTALL = @INSTALL@
|
||||
LD = @LD@
|
||||
LD_CC = @LD_CC@
|
||||
@@ -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...
|
||||
#
|
||||
|
||||
+18
-1
@@ -1,6 +1,6 @@
|
||||
CUPS
|
||||
|
||||
Copyright © 2007-2018 by Apple Inc.
|
||||
Copyright © 2007-2019 by Apple Inc.
|
||||
Copyright © 1997-2007 by Easy Software Products.
|
||||
|
||||
CUPS and the CUPS logo are trademarks of Apple Inc.
|
||||
@@ -32,3 +32,20 @@ the following restrictions:
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
-- CUPS Exceptions to the Apache 2.0 License --
|
||||
|
||||
As an exception, if, as a result of your compiling your source code, portions
|
||||
of this Software are embedded into an Object form of such source code, you
|
||||
may redistribute such embedded portions in such Object form without complying
|
||||
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
|
||||
|
||||
In addition, if you combine or link compiled forms of this Software with
|
||||
software that is licensed under the GPLv2 ("Combined Software") and if a
|
||||
court of competent jurisdiction determines that the patent provision (Section
|
||||
3), the indemnity provision (Section 9) or other Section of the License
|
||||
conflicts with the conditions of the GPLv2, you may retroactively and
|
||||
prospectively choose to deem waived or otherwise exclude such Section(s) of
|
||||
the License, but only in their entirety and only with respect to the Combined
|
||||
Software.
|
||||
|
||||
+39
-30
@@ -1,13 +1,9 @@
|
||||
README - CUPS v2.3b4 - 2018-03-22
|
||||
README - CUPS v2.3.3 - 2020-04-24
|
||||
=================================
|
||||
|
||||
Looking for compile instructions? Read the file `INSTALL.md` instead...
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
------------
|
||||
|
||||
|
||||
CUPS is a standards-based, open source printing system developed by Apple Inc.
|
||||
for macOS® and other UNIX®-like operating systems. CUPS uses the Internet
|
||||
Printing Protocol ("IPP") and provides System V and Berkeley command-line
|
||||
@@ -29,8 +25,21 @@ CUPS is licensed under the Apache License Version 2.0. See the file
|
||||
READING THE DOCUMENTATION
|
||||
-------------------------
|
||||
|
||||
Initial documentation to get you started is provided in the root directory of
|
||||
the CUPS sources:
|
||||
|
||||
- `CHANGES.md`: A list of changes in the current major release of CUPS.
|
||||
- `CONTRIBUTING.md`: Guidelines for contributing to the CUPS project.
|
||||
- `CREDITS.md`: A list of past contributors to the CUPS project.
|
||||
- `DEVELOPING.md`: Guidelines for developing code for the CUPS project.
|
||||
- `INSTALL.md`: Instructions for building and installing CUPS.
|
||||
- `LICENSE`: The CUPS license agreement (Apache 2.0).
|
||||
- `NOTICE`: Copyright notices and exceptions to the CUPS license agreement.
|
||||
- `README.md`: This file.
|
||||
|
||||
Once you have installed the software you can access the documentation (and a
|
||||
bunch of other stuff) online at <http://localhost:631/>.
|
||||
bunch of other stuff) online at <http://localhost:631/> and using the `man`
|
||||
command, for example `man cups`.
|
||||
|
||||
If you're having trouble getting that far, the documentation is located under
|
||||
the `doc/help` and `man` directories.
|
||||
@@ -56,11 +65,11 @@ in your browser to access the printer administration tools:
|
||||
|
||||
*Do not* use the hostname for your machine - it will not work with the default
|
||||
CUPS configuration. To enable administration access on other addresses, check
|
||||
the `Allow Remote Administration` box and click on the `Change Settings button.
|
||||
the `Allow Remote Administration` box and click on the `Change Settings` button.
|
||||
|
||||
You will be asked for the administration password (root or any other user in the
|
||||
sys/system/root/admin/lpadmin group on your system) when performing any
|
||||
administrative function.
|
||||
"sys", "system", "root", "admin", or "lpadmin" group on your system) when
|
||||
performing any administrative function.
|
||||
|
||||
|
||||
SETTING UP PRINTER QUEUES FROM THE COMMAND-LINE
|
||||
@@ -70,28 +79,28 @@ CUPS currently uses PPD (PostScript Printer Description) files that describe
|
||||
printer capabilities and driver programs needed for each printer. The
|
||||
`everywhere` PPD is used for nearly all modern networks printers sold since
|
||||
about 2009. For example, the following command creates a print queue for a
|
||||
printer at address 11.22.33.44:
|
||||
printer at address "11.22.33.44":
|
||||
|
||||
lpadmin -p printername -E -v ipp://11.22.33.44/ipp/print -m everywhere
|
||||
|
||||
CUPS also includes several sample PPD files you can use for "legacy" printers:
|
||||
|
||||
Driver PPD Name
|
||||
----------------------------- ------------------------------
|
||||
Dymo Label Printers drv:///sample.drv/dymo.ppd
|
||||
Intellitech Intellibar drv:///sample.drv/intelbar.ppd
|
||||
EPSON 9-pin Series drv:///sample.drv/epson9.ppd
|
||||
EPSON 24-pin Series drv:///sample.drv/epson24.ppd
|
||||
Generic PCL Laser Printer drv:///sample.drv/generpcl.ppd
|
||||
Generic PostScript Printer drv:///sample.drv/generic.ppd
|
||||
HP DeskJet Series drv:///sample.drv/deskjet.ppd
|
||||
HP LaserJet Series drv:///sample.drv/laserjet.ppd
|
||||
OKIDATA 9-Pin Series drv:///sample.drv/okidata9.ppd
|
||||
OKIDATA 24-Pin Series drv:///sample.drv/okidat24.ppd
|
||||
Zebra CPCL Label Printer drv:///sample.drv/zebracpl.ppd
|
||||
Zebra EPL1 Label Printer drv:///sample.drv/zebraep1.ppd
|
||||
Zebra EPL2 Label Printer drv:///sample.drv/zebraep2.ppd
|
||||
Zebra ZPL Label Printer drv:///sample.drv/zebra.ppd
|
||||
Driver | PPD Name
|
||||
----------------------------- | ------------------------------
|
||||
Dymo Label Printers | drv:///sample.drv/dymo.ppd
|
||||
Intellitech Intellibar | drv:///sample.drv/intelbar.ppd
|
||||
EPSON 9-pin Series | drv:///sample.drv/epson9.ppd
|
||||
EPSON 24-pin Series | drv:///sample.drv/epson24.ppd
|
||||
Generic PCL Laser Printer | drv:///sample.drv/generpcl.ppd
|
||||
Generic PostScript Printer | drv:///sample.drv/generic.ppd
|
||||
HP DeskJet Series | drv:///sample.drv/deskjet.ppd
|
||||
HP LaserJet Series | drv:///sample.drv/laserjet.ppd
|
||||
OKIDATA 9-Pin Series | drv:///sample.drv/okidata9.ppd
|
||||
OKIDATA 24-Pin Series | drv:///sample.drv/okidat24.ppd
|
||||
Zebra CPCL Label Printer | drv:///sample.drv/zebracpl.ppd
|
||||
Zebra EPL1 Label Printer | drv:///sample.drv/zebraep1.ppd
|
||||
Zebra EPL2 Label Printer | drv:///sample.drv/zebraep2.ppd
|
||||
Zebra ZPL Label Printer | drv:///sample.drv/zebra.ppd
|
||||
|
||||
You can run the `lpinfo -m` command to list all of the available drivers:
|
||||
|
||||
@@ -148,12 +157,12 @@ This will prevent the filters from misinterpreting your print file.
|
||||
LEGAL STUFF
|
||||
-----------
|
||||
|
||||
Copyright © 2007-2018 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
|
||||
is provided in the file `NOTICE`.
|
||||
CUPS is provided under the terms of the Apache License, Version 2.0 with
|
||||
exceptions for GPL2/LGPL2 software. A copy of this license can be found in the
|
||||
file `LICENSE`. Additional legal information is provided in the file `NOTICE`.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed
|
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
|
||||
+35
-34
@@ -1,8 +1,8 @@
|
||||
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/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-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 ../cups/snmp-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h ../cups/ppd-private.h ../cups/ppd.h \
|
||||
@@ -11,23 +11,23 @@ lpd.o: lpd.c ../cups/http-private.h ../config.h ../cups/language.h \
|
||||
../cups/array.h ../cups/versioning.h ../cups/http.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/debug-private.h \
|
||||
../cups/array-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/pwg-private.h ../cups/thread-private.h ../cups/snmp-private.h \
|
||||
../cups/backend.h ../cups/sidechannel.h
|
||||
../cups/string-private.h ../cups/array-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.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/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-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 ../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/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-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 ../cups/snmp-private.h ../cups/backend.h \
|
||||
../cups/sidechannel.h
|
||||
@@ -35,13 +35,13 @@ socket.o: socket.c ../cups/http-private.h ../config.h ../cups/language.h \
|
||||
../cups/array.h ../cups/versioning.h ../cups/http.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/debug-private.h \
|
||||
../cups/array-private.h ../cups/language-private.h ../cups/transcode.h \
|
||||
../cups/pwg-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 ieee1284.c \
|
||||
backend-private.h ../cups/cups-private.h ../cups/debug-private.h \
|
||||
../cups/versioning.h ../cups/array-private.h ../cups/array.h \
|
||||
../cups/string-private.h ../cups/array-private.h \
|
||||
../cups/language-private.h ../cups/transcode.h ../cups/pwg-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 \
|
||||
@@ -49,23 +49,24 @@ test1284.o: test1284.c ../cups/string-private.h ../config.h ieee1284.c \
|
||||
../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/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-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 ../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/cups.h ../cups/file.h ../cups/ipp.h \
|
||||
../cups/http.h ../cups/language.h ../cups/pwg.h ../cups/http-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 ../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/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
|
||||
|
||||
|
||||
|
||||
+14
-35
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* DNS-SD discovery backend for CUPS.
|
||||
*
|
||||
* Copyright © 2008-2017 by Apple Inc.
|
||||
* Copyright © 2008-2018 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
@@ -82,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,
|
||||
@@ -116,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,
|
||||
@@ -147,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);
|
||||
|
||||
|
||||
/*
|
||||
@@ -1252,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
|
||||
|
||||
@@ -55,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);
|
||||
}
|
||||
|
||||
@@ -211,8 +204,6 @@ backendGetDeviceID(
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_printf(("backendGetDeviceID: ioctl failed - %s\n",
|
||||
strerror(errno)));
|
||||
*device_id = '\0';
|
||||
}
|
||||
# endif /* __linux */
|
||||
@@ -234,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 */
|
||||
}
|
||||
|
||||
@@ -252,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';
|
||||
|
||||
@@ -365,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';
|
||||
|
||||
|
||||
+175
-137
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* IPP backend for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 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
|
||||
@@ -23,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 */
|
||||
|
||||
|
||||
@@ -237,7 +233,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
int waitjob, /* Wait for job complete? */
|
||||
waitjob_tries = 0, /* Number of times we've waited */
|
||||
waitprinter; /* Wait for printer ready? */
|
||||
time_t waittime; /* Wait time for held jobs */
|
||||
_cups_monitor_t monitor; /* Monitoring data */
|
||||
ipp_attribute_t *job_id_attr; /* job-id attribute */
|
||||
int job_id; /* job-id value */
|
||||
@@ -421,9 +416,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...
|
||||
@@ -510,13 +505,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",
|
||||
@@ -704,11 +699,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)
|
||||
@@ -911,7 +906,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);
|
||||
@@ -926,7 +921,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);
|
||||
@@ -940,15 +935,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)
|
||||
{
|
||||
@@ -965,8 +960,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...
|
||||
@@ -989,9 +984,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 "
|
||||
@@ -1001,8 +996,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 */
|
||||
@@ -1015,13 +1010,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);
|
||||
@@ -1135,7 +1130,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);
|
||||
|
||||
@@ -1171,7 +1173,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)
|
||||
@@ -1179,7 +1181,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)
|
||||
@@ -1187,7 +1189,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)
|
||||
@@ -1195,7 +1197,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)
|
||||
@@ -1204,13 +1206,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;
|
||||
}
|
||||
|
||||
@@ -1238,7 +1240,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);
|
||||
@@ -1256,7 +1258,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)
|
||||
@@ -1382,7 +1384,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)
|
||||
{
|
||||
@@ -1410,7 +1412,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 */
|
||||
|
||||
@@ -1443,10 +1445,12 @@ 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");
|
||||
|
||||
fprintf(stderr, "DEBUG: retryable=%d\n", monitor.retryable);
|
||||
|
||||
if (create_job)
|
||||
{
|
||||
monitor.job_name = argv[3];
|
||||
@@ -1485,6 +1489,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 (!sides || !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 +1555,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 +1583,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 +1609,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 +1628,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 +1653,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 +1661,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 +1680,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 +1732,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 +1788,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 +1817,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 +1841,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,28 +1861,36 @@ 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)));
|
||||
|
||||
response = cupsGetResponse(http, resource);
|
||||
ippDelete(request);
|
||||
|
||||
fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n",
|
||||
ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n", ippErrorString(cupsLastError()), cupsLastErrorString());
|
||||
debug_attributes(response);
|
||||
ippDelete(response);
|
||||
|
||||
if (cupsLastError() > IPP_OK_CONFLICT && !job_canceled)
|
||||
if (cupsLastError() > IPP_STATUS_OK_CONFLICTING && !job_canceled)
|
||||
{
|
||||
ipp_attribute_t *reasons = ippFindAttribute(response, "job-state-reasons", IPP_TAG_KEYWORD);
|
||||
/* job-state-reasons values */
|
||||
|
||||
ipp_status = cupsLastError();
|
||||
|
||||
_cupsLangPrintFilter(stderr, "ERROR",
|
||||
_("Unable to add document to print job."));
|
||||
if (ippContainsString(reasons, "document-format-error"))
|
||||
ipp_status = IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR;
|
||||
else if (ippContainsString(reasons, "document-unprintable"))
|
||||
ipp_status = IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE;
|
||||
|
||||
ippDelete(response);
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unable to add document to print job."));
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
ippDelete(response);
|
||||
|
||||
password_tries = 0;
|
||||
|
||||
if (num_files == 0 || fd < 0)
|
||||
@@ -1866,12 +1902,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_FORMAT_ERROR || ipp_status == IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE) &&
|
||||
argc == 6 &&
|
||||
document_format && strcmp(document_format, "image/pwg-raster") && strcmp(document_format, "image/urf"))
|
||||
{
|
||||
@@ -1885,9 +1921,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 +1939,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 +1976,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 +1990,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;
|
||||
}
|
||||
@@ -1972,7 +2008,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("Waiting for job to complete."));
|
||||
|
||||
for (delay = _cupsNextDelay(0, &prev_delay), waittime = time(NULL) + 30; !job_canceled;)
|
||||
for (delay = _cupsNextDelay(0, &prev_delay); !job_canceled;)
|
||||
{
|
||||
/*
|
||||
* Check for side-channel requests...
|
||||
@@ -1986,14 +2022,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 +2053,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 +2067,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 +2075,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 +2109,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);
|
||||
@@ -2087,19 +2123,18 @@ main(int argc, /* I - Number of command-line args */
|
||||
job_sheets->values[0].integer);
|
||||
|
||||
/*
|
||||
* Stop polling if the job is finished or pending-held for 30 seconds...
|
||||
* Stop polling if the job is finished or pending-held...
|
||||
*/
|
||||
|
||||
if (job_state->values[0].integer > IPP_JSTATE_STOPPED ||
|
||||
(job_state->values[0].integer == IPP_JSTATE_HELD && time(NULL) > waittime))
|
||||
if (job_state->values[0].integer > IPP_JSTATE_STOPPED || job_state->values[0].integer == IPP_JSTATE_HELD)
|
||||
{
|
||||
ippDelete(response);
|
||||
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 +2144,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 +2169,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 +2179,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 +2226,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 +2240,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 +2270,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 +2294,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 +2328,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 +2336,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 +2462,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 +2481,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 +2498,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 +2525,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 +2542,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 +2584,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");
|
||||
@@ -2630,12 +2665,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;
|
||||
}
|
||||
|
||||
@@ -2657,14 +2691,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."));
|
||||
@@ -2740,7 +2774,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);
|
||||
@@ -2780,7 +2814,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();
|
||||
@@ -2793,7 +2827,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 ++;
|
||||
@@ -3579,6 +3615,8 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
}
|
||||
}
|
||||
|
||||
cupsArrayDelete(new_reasons);
|
||||
|
||||
_cupsMutexUnlock(&report_mutex);
|
||||
|
||||
/*
|
||||
|
||||
+18
-19
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Line Printer Daemon backend for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2016 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
|
||||
@@ -19,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>
|
||||
@@ -71,13 +71,12 @@ 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_command(int lpd_fd, char *format, ...)
|
||||
# ifdef __GNUC__
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)))
|
||||
# endif /* __GNUC__ */
|
||||
;
|
||||
static int lpd_queue(const char *hostname, http_addrlist_t *addrlist, const char *printer, int print_fd, int snmp_fd, int mode, const char *user, const char *title, 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);
|
||||
|
||||
@@ -618,11 +617,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);
|
||||
}
|
||||
@@ -730,11 +729,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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -917,7 +916,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));
|
||||
@@ -928,7 +927,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."));
|
||||
@@ -1047,7 +1046,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send the control file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
if (lpd_command(fd, "\002%d cfA%03d%.15s\n", (int)strlen(control),
|
||||
(int)getpid() % 1000, localhost))
|
||||
{
|
||||
close(fd);
|
||||
@@ -1097,7 +1096,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send the print file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, "\003" CUPS_LLFMT " dfA%03.3d%.15s\n",
|
||||
if (lpd_command(fd, "\003" CUPS_LLFMT " dfA%03d%.15s\n",
|
||||
CUPS_LLCAST filestats.st_size, (int)getpid() % 1000,
|
||||
localhost))
|
||||
{
|
||||
@@ -1180,7 +1179,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
* Send control file...
|
||||
*/
|
||||
|
||||
if (lpd_command(fd, "\002%d cfA%03.3d%.15s\n", strlen(control),
|
||||
if (lpd_command(fd, "\002%d cfA%03d%.15s\n", (int)strlen(control),
|
||||
(int)getpid() % 1000, localhost))
|
||||
{
|
||||
close(fd);
|
||||
|
||||
@@ -140,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
|
||||
@@ -242,6 +242,9 @@
|
||||
# All Intermec devices (Issue #4553)
|
||||
0x067e no-reattach
|
||||
|
||||
# HP LaserJet 1015 (Issue #5617)
|
||||
0x03f0 0x0e17 delay-close
|
||||
|
||||
# HP LaserJet 1150 (Issue #4549)
|
||||
0x03f0 0x0f17 delay-close
|
||||
|
||||
@@ -281,3 +284,21 @@
|
||||
|
||||
# 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
|
||||
|
||||
@@ -440,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 */
|
||||
@@ -507,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")))
|
||||
@@ -528,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;
|
||||
|
||||
@@ -605,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;
|
||||
|
||||
@@ -626,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;
|
||||
|
||||
@@ -651,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);
|
||||
}
|
||||
|
||||
@@ -685,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);
|
||||
|
||||
/*
|
||||
|
||||
+9
-7
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* AppSocket backend for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2016 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
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <winsock.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
@@ -27,7 +27,7 @@
|
||||
# include <netinet/in.h>
|
||||
# include <arpa/inet.h>
|
||||
# include <netdb.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -397,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."));
|
||||
@@ -406,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...
|
||||
@@ -443,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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,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"
|
||||
|
||||
|
||||
@@ -33,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);
|
||||
|
||||
|
||||
+12
-12
@@ -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);
|
||||
@@ -1280,6 +1280,9 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
|
||||
(*printerIntf)->GetInterfaceNumber(printerIntf, &intfNumber);
|
||||
(*printerIntf)->GetLocationID(printerIntf, &intfLocation);
|
||||
|
||||
if (intfProtocol == kUSBPrintingProtocolIPP)
|
||||
return keepLooking;
|
||||
|
||||
if (g.serial != NULL && CFStringGetLength(g.serial) > 0)
|
||||
{
|
||||
if (serial != NULL && CFStringCompare(serial, g.serial, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
|
||||
@@ -1287,12 +1290,9 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
|
||||
g.interfaceProtocol = intfProtocol;
|
||||
g.location = intfLocation;
|
||||
g.alternateSetting = intfAltSetting;
|
||||
if (intfProtocol != kUSBPrintingProtocolIPP)
|
||||
{
|
||||
g.printer_obj = obj;
|
||||
IOObjectRetain(obj);
|
||||
}
|
||||
keepLooking = (intfProtocol == kUSBPrintingProtocolIPP);
|
||||
g.printer_obj = obj;
|
||||
IOObjectRetain(obj);
|
||||
keepLooking = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1300,14 +1300,14 @@ static Boolean find_device_cb(io_service_t obj, printer_interface_t printerIntf,
|
||||
if (g.printer_obj != 0)
|
||||
IOObjectRelease(g.printer_obj);
|
||||
|
||||
if (g.location == 0 || g.location == intfLocation)
|
||||
keepLooking = false;
|
||||
|
||||
g.location = intfLocation;
|
||||
g.alternateSetting = intfAltSetting;
|
||||
g.interfaceProtocol = intfProtocol;
|
||||
g.printer_obj = obj;
|
||||
IOObjectRetain(obj);
|
||||
|
||||
if (g.location == 0 || g.location == intfLocation)
|
||||
keepLooking = false;
|
||||
}
|
||||
|
||||
if (!keepLooking)
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -825,8 +826,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
err = libusb_init(NULL);
|
||||
if (err)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unable to initialize USB access via libusb, "
|
||||
"libusb error %i\n", (int)err);
|
||||
fprintf(stderr, "ERROR: Unable to initialize USB access via libusb, libusb error %i (%s)\n", (int)err, libusb_strerror((int)err));
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -878,7 +878,7 @@ find_device(usb_cb_t cb, /* I - Callback function */
|
||||
protocol = 0;
|
||||
|
||||
for (altset = 0, altptr = ifaceptr->altsetting;
|
||||
altset < ifaceptr->num_altsetting;
|
||||
altset < ifaceptr->num_altsetting; // lgtm [cpp/comparison-with-wider-type]
|
||||
altset ++, altptr ++)
|
||||
{
|
||||
/*
|
||||
@@ -1742,8 +1742,7 @@ static void *read_thread(void *reference)
|
||||
* Make sure this loop executes no more than once every 250 miliseconds...
|
||||
*/
|
||||
|
||||
if ((readstatus != LIBUSB_SUCCESS || rbytes == 0) &&
|
||||
(g.wait_eof || !g.read_thread_stop))
|
||||
if ((g.wait_eof || !g.read_thread_stop))
|
||||
{
|
||||
gettimeofday(&now, NULL);
|
||||
if (timercmp(&now, &end, <))
|
||||
|
||||
+2
-2
@@ -19,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/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
|
||||
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/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/debug-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/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/cups.h ../cups/file.h ../cups/ipp.h ../cups/http.h \
|
||||
../cups/language.h ../cups/pwg.h ../cups/http-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/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-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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -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, _("-P destination Specify the destination"));
|
||||
_cupsLangPuts(stdout, _("-q Specify the job should be held for printing"));
|
||||
_cupsLangPuts(stdout, _("-r Remove the file(s) after submission"));
|
||||
_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
-26
@@ -1,66 +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/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/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)" $@
|
||||
|
||||
|
||||
#
|
||||
|
||||
+29
-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...
|
||||
@@ -3118,6 +2929,9 @@ do_set_options(http_t *http, /* I - HTTP connection */
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_POINTS :
|
||||
if (!_cups_strncasecmp(option->defchoice, "Custom.", 7))
|
||||
{
|
||||
@@ -3465,8 +3279,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,
|
||||
@@ -3717,6 +3531,9 @@ get_option_value(
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_REAL :
|
||||
@@ -3795,6 +3612,9 @@ get_option_value(
|
||||
|
||||
switch (cparam->type)
|
||||
{
|
||||
case PPD_CUSTOM_UNKNOWN :
|
||||
break;
|
||||
|
||||
case PPD_CUSTOM_CURVE :
|
||||
case PPD_CUSTOM_INVCURVE :
|
||||
case PPD_CUSTOM_REAL :
|
||||
@@ -3928,6 +3748,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 +3793,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);
|
||||
}
|
||||
|
||||
+51
-62
@@ -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,10 @@ cgiGetArray(const char *name, /* I - Name of array variable */
|
||||
if (element < 0 || element >= var->nvalues)
|
||||
return (NULL);
|
||||
|
||||
return (_cupsStrRetain(var->values[element]));
|
||||
if (var->values[element] == NULL)
|
||||
return (NULL);
|
||||
|
||||
return (strdup(var->values[element]));
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +223,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 +231,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 +321,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 +386,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 +404,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 +463,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 +482,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 +517,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 +540,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 +562,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 +597,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 +718,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 +757,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 +884,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 +970,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...
|
||||
*/
|
||||
@@ -985,7 +983,7 @@ cgi_initialize_post(void)
|
||||
*/
|
||||
|
||||
length = (size_t)strtol(content_length, NULL, 10);
|
||||
data = malloc(length + 1);
|
||||
data = malloc(length + 1); // lgtm [cpp/uncontrolled-allocation-size]
|
||||
|
||||
if (data == NULL)
|
||||
return (0);
|
||||
@@ -1047,7 +1045,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 +1148,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 +1205,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 +1215,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 +1238,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 */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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...
|
||||
@@ -38,7 +39,11 @@ AC_PROG_CXX(clang++ c++ g++)
|
||||
AC_PROG_RANLIB
|
||||
AC_PATH_PROG(AR,ar)
|
||||
AC_PATH_PROG(CHMOD,chmod)
|
||||
AC_PATH_PROG(GZIP,gzip)
|
||||
AC_PATH_PROG(GZIPPROG,gzip)
|
||||
AC_MSG_CHECKING(for install-sh script)
|
||||
INSTALL="`pwd`/install-sh"
|
||||
AC_SUBST(INSTALL)
|
||||
AC_MSG_RESULT(using $INSTALL)
|
||||
AC_PATH_PROG(LD,ld)
|
||||
AC_PATH_PROG(LN,ln)
|
||||
AC_PATH_PROG(MKDIR,mkdir)
|
||||
@@ -47,6 +52,7 @@ AC_PATH_PROG(RM,rm)
|
||||
AC_PATH_PROG(RMDIR,rmdir)
|
||||
AC_PATH_PROG(SED,sed)
|
||||
AC_PATH_PROG(XDGOPEN,xdg-open)
|
||||
|
||||
if test "x$XDGOPEN" = x; then
|
||||
CUPS_HTMLVIEW="htmlview"
|
||||
else
|
||||
@@ -54,11 +60,6 @@ else
|
||||
fi
|
||||
AC_SUBST(CUPS_HTMLVIEW)
|
||||
|
||||
AC_MSG_CHECKING(for install-sh script)
|
||||
INSTALL="`pwd`/install-sh"
|
||||
AC_SUBST(INSTALL)
|
||||
AC_MSG_RESULT(using $INSTALL)
|
||||
|
||||
if test "x$AR" = x; then
|
||||
AC_MSG_ERROR([Unable to find required library archive command.])
|
||||
fi
|
||||
@@ -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))
|
||||
@@ -262,14 +253,14 @@ dnl ZLIB
|
||||
INSTALL_GZIP=""
|
||||
LIBZ=""
|
||||
AC_CHECK_HEADER(zlib.h,
|
||||
AC_CHECK_LIB(z, gzgets,
|
||||
AC_CHECK_LIB(z, gzgets,[
|
||||
AC_DEFINE(HAVE_LIBZ)
|
||||
LIBZ="-lz"
|
||||
LIBS="$LIBS -lz"
|
||||
AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_INFLATECOPY))
|
||||
if test "x$GZIP" != z; then
|
||||
if test "x$GZIPPROG" != x; then
|
||||
INSTALL_GZIP="-z"
|
||||
fi))
|
||||
fi]))
|
||||
AC_SUBST(INSTALL_GZIP)
|
||||
AC_SUBST(LIBZ)
|
||||
|
||||
@@ -302,14 +293,14 @@ fi
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
dnl Check for DBUS support
|
||||
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
|
||||
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
|
||||
DBUSDIR="$withval")
|
||||
|
||||
DBUSDIR=""
|
||||
DBUS_NOTIFIER=""
|
||||
DBUS_NOTIFIERLIBS=""
|
||||
|
||||
AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
|
||||
AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
|
||||
DBUSDIR="$withval")
|
||||
|
||||
if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdarwin; then
|
||||
AC_MSG_CHECKING(for DBUS)
|
||||
if $PKGCONFIG --exists dbus-1; then
|
||||
@@ -326,7 +317,7 @@ if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdar
|
||||
AC_CHECK_FUNC(dbus_threads_init,
|
||||
AC_DEFINE(HAVE_DBUS_THREADS_INIT))
|
||||
LIBS="$SAVELIBS"
|
||||
if test -d /etc/dbus-1; then
|
||||
if test -d /etc/dbus-1 -a "x$DBUSDIR" = x; then
|
||||
DBUSDIR="/etc/dbus-1"
|
||||
fi
|
||||
else
|
||||
@@ -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",
|
||||
@@ -229,7 +245,7 @@ AC_ARG_WITH(system_groups, [ --with-system-groups set default system groups
|
||||
AC_MSG_CHECKING(for default system groups)
|
||||
if test -f /etc/group; then
|
||||
CUPS_SYSTEM_GROUPS=""
|
||||
GROUP_LIST="lpadmin sys system root"
|
||||
GROUP_LIST="lpadmin sys system root wheel"
|
||||
for group in $GROUP_LIST; do
|
||||
if test "`grep \^${group}: /etc/group`" != ""; then
|
||||
if test "x$CUPS_SYSTEM_GROUPS" = x; then
|
||||
|
||||
@@ -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,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-2018 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="../cups/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
+367
-576
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+2
-10
@@ -1,7 +1,7 @@
|
||||
dnl
|
||||
dnl Configuration script for CUPS.
|
||||
dnl
|
||||
dnl Copyright © 2007-2018 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
|
||||
@@ -12,7 +12,7 @@ dnl We need at least autoconf 2.60...
|
||||
AC_PREREQ(2.60)
|
||||
|
||||
dnl Package name and version...
|
||||
AC_INIT([CUPS], [2.3b4], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
AC_INIT([CUPS], [2.3.3], [https://github.com/apple/cups/issues], [cups], [https://www.cups.org/])
|
||||
|
||||
sinclude(config-scripts/cups-opsys.m4)
|
||||
sinclude(config-scripts/cups-common.m4)
|
||||
@@ -66,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
|
||||
|
||||
+7
-16
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# CUPS configuration utility.
|
||||
#
|
||||
# Copyright © 2007-2018 by Apple Inc.
|
||||
# Copyright © 2007-2019 by Apple Inc.
|
||||
# Copyright © 2001-2006 by Easy Software Products, all rights reserved.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
@@ -18,7 +18,6 @@ exec_prefix=@exec_prefix@
|
||||
bindir=@bindir@
|
||||
includedir=@includedir@
|
||||
libdir=@libdir@
|
||||
imagelibdir=@libdir@
|
||||
datarootdir=@datadir@
|
||||
datadir=@datadir@
|
||||
sysconfdir=@sysconfdir@
|
||||
@@ -27,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"
|
||||
@@ -73,7 +71,6 @@ fi
|
||||
|
||||
# Parse command line options
|
||||
static=no
|
||||
image=no
|
||||
|
||||
while test $# -gt 0; do
|
||||
case $1 in
|
||||
@@ -93,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
|
||||
;;
|
||||
@@ -120,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
|
||||
|
||||
+361
-277
@@ -1,327 +1,411 @@
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.h backend.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h \
|
||||
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
|
||||
pwg-private.h thread-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 debug-private.h ../cups/versioning.h array-private.h \
|
||||
../cups/array.h ipp-private.h ../cups/cups.h file.h ipp.h http.h \
|
||||
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
|
||||
pwg-private.h thread-private.h
|
||||
dir.o: dir.c string-private.h ../config.h debug-private.h \
|
||||
../cups/versioning.h dir.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 \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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 ipp-private.h ../cups/cups.h \
|
||||
file.h ipp.h pwg.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 \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.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 \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.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 \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h file.h ipp.h http.h \
|
||||
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
|
||||
pwg-private.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/cups.h file.h ipp.h http.h \
|
||||
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
|
||||
pwg-private.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/cups.h file.h ipp.h http.h language.h pwg.h http-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
|
||||
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 \
|
||||
debug-private.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
|
||||
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 \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.h
|
||||
md5.o: md5.c md5-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 ipp-private.h \
|
||||
string-private.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 \
|
||||
debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \
|
||||
ipp-private.h ../cups/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h file.h ipp.h http.h language.h pwg.h http-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 raster.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.h ppd-private.h ../cups/ppd.h raster.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.h ppd-private.h ../cups/ppd.h raster.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/cups.h file.h ipp.h http.h \
|
||||
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
|
||||
pwg-private.h thread-private.h ppd-private.h ../cups/ppd.h raster.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.h ppd-private.h ../cups/ppd.h raster.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.h ppd.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/cups.h file.h ipp.h http.h \
|
||||
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
|
||||
pwg-private.h thread-private.h ppd-private.h ../cups/ppd.h raster.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.h ppd-private.h ../cups/ppd.h raster.h
|
||||
debug-internal.h debug-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-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/cups.h file.h ipp.h http.h \
|
||||
language.h pwg.h http-private.h language-private.h ../cups/transcode.h \
|
||||
pwg-private.h thread-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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.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 debug-private.h \
|
||||
../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \
|
||||
../cups/cups.h file.h ipp.h http.h language.h pwg.h http-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 \
|
||||
tls-darwin.c
|
||||
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 tls-darwin.h
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.h \
|
||||
thread-private.h
|
||||
error.o: error.c ../cups/raster-private.h raster.h cups.h file.h \
|
||||
versioning.h ipp.h http.h array.h language.h pwg.h \
|
||||
../cups/debug-private.h ../cups/string-private.h ../config.h
|
||||
interpret.o: 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/debug-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/ppd.h
|
||||
raster.o: raster.c ../cups/raster-private.h raster.h cups.h file.h \
|
||||
versioning.h ipp.h http.h array.h language.h pwg.h \
|
||||
../cups/debug-private.h ../cups/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 sidechannel.h
|
||||
backend.o: backend.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 \
|
||||
backend.h ppd.h cups.h raster.h
|
||||
getdevices.o: getdevices.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.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 \
|
||||
../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 \
|
||||
../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 ../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 \
|
||||
../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 \
|
||||
../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 ../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 \
|
||||
../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 \
|
||||
../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 ../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 \
|
||||
../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 language-private.h ../cups/transcode.h thread-private.h
|
||||
testclient.o: testclient.c ../cups/cups.h file.h versioning.h ipp.h \
|
||||
http.h array.h language.h pwg.h ../cups/raster.h \
|
||||
../cups/string-private.h ../config.h ../cups/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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
testcups.o: testcups.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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 \
|
||||
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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h ipp.h http.h array.h language.h pwg.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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 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/debug-private.h ../cups/string-private.h ../config.h \
|
||||
../cups/ppd.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
testthreads.o: testthreads.c ../cups/cups.h file.h versioning.h ipp.h \
|
||||
http.h array.h language.h pwg.h ../cups/thread-private.h ../config.h \
|
||||
../cups/versioning.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/cups.h file.h ipp.h http.h language.h pwg.h \
|
||||
http-private.h language-private.h ../cups/transcode.h pwg-private.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
|
||||
|
||||
+156
-138
@@ -1,8 +1,8 @@
|
||||
#
|
||||
# Library Makefile for CUPS.
|
||||
#
|
||||
# Copyright 2007-2018 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.
|
||||
@@ -15,12 +15,9 @@ include ../Makedefs
|
||||
# Object files...
|
||||
#
|
||||
|
||||
LIBOBJS = \
|
||||
adminutil.o \
|
||||
COREOBJS = \
|
||||
array.o \
|
||||
auth.o \
|
||||
backchannel.o \
|
||||
backend.o \
|
||||
debug.o \
|
||||
dest.o \
|
||||
dest-job.o \
|
||||
@@ -29,8 +26,6 @@ LIBOBJS = \
|
||||
dir.o \
|
||||
encode.o \
|
||||
file.o \
|
||||
getdevices.o \
|
||||
getifaddrs.o \
|
||||
getputfile.o \
|
||||
globals.o \
|
||||
hash.o \
|
||||
@@ -48,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 \
|
||||
@@ -58,22 +73,18 @@ 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 = \
|
||||
error.o \
|
||||
interpret.o \
|
||||
raster.o
|
||||
raster-interstub.o \
|
||||
raster-stubs.o
|
||||
|
||||
TESTOBJS = \
|
||||
rasterbench.o \
|
||||
testadmin.o \
|
||||
@@ -95,6 +106,7 @@ TESTOBJS = \
|
||||
testpwg.o \
|
||||
testraster.o \
|
||||
testsnmp.o \
|
||||
testthreads.o \
|
||||
tlscheck.o
|
||||
OBJS = \
|
||||
$(LIBOBJS) \
|
||||
@@ -106,24 +118,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 \
|
||||
@@ -131,14 +148,18 @@ 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...
|
||||
@@ -171,6 +192,7 @@ UNITTARGETS = \
|
||||
testpwg \
|
||||
testraster \
|
||||
testsnmp \
|
||||
testthreads \
|
||||
tlscheck
|
||||
|
||||
TARGETS = \
|
||||
@@ -268,7 +290,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)
|
||||
@@ -280,23 +302,25 @@ install-libs: $(INSTALLSTATIC)
|
||||
$(RM) $(LIBDIR)/libcups.dylib; \
|
||||
$(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
|
||||
fi
|
||||
$(INSTALL_DIR) -m 755 $(LIBDIR)
|
||||
$(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
|
||||
-if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
|
||||
-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 $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
|
||||
-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); \
|
||||
$(INSTALL_DIR) $(SYMROOT); \
|
||||
cp $(LIBCUPS) $(SYMROOT); \
|
||||
dsymutil $(SYMROOT)/$(LIBCUPS); \
|
||||
cp $(LIBCUPSIMAGE) $(SYMROOT); \
|
||||
dsymutil $(SYMROOT)/$(LIBCUPSIMAGE); \
|
||||
if test "x$(LIBCUPSIMAGE)" != x; then \
|
||||
cp $(LIBCUPSIMAGE) $(SYMROOT); \
|
||||
dsymutil $(SYMROOT)/$(LIBCUPSIMAGE); \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
installstatic:
|
||||
@@ -315,7 +339,7 @@ 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
|
||||
@@ -329,6 +353,12 @@ uninstall:
|
||||
$(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
|
||||
|
||||
|
||||
#
|
||||
@@ -337,8 +367,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`
|
||||
|
||||
@@ -347,21 +376,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.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
|
||||
|
||||
|
||||
@@ -371,9 +394,8 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
|
||||
|
||||
libcups.la: $(LIBOBJS)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
|
||||
-rpath $(LIBDIR) -version-info 2:14 $(LIBGSSAPI) $(SSLLIBS) \
|
||||
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
|
||||
-rpath $(LIBDIR) -version-info 2:14 $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
@@ -397,9 +419,10 @@ libcups2.def: $(LIBOBJS) $(IMAGEOBJS) Makefile
|
||||
echo "VERSION 2.14" >>libcups2.def
|
||||
echo "EXPORTS" >>libcups2.def
|
||||
(nm $(LIBOBJS) $(IMAGEOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
|
||||
echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy) | \
|
||||
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
|
||||
|
||||
@@ -410,8 +433,7 @@ libcups2.def: $(LIBOBJS) $(IMAGEOBJS) Makefile
|
||||
|
||||
libcupsimage.so.2: $(IMAGEOBJS) libcups.so.2
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
|
||||
-L../cups $(LINKCUPS)
|
||||
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(IMAGEOBJS) $(LINKCUPS)
|
||||
$(RM) `basename $@ .2`
|
||||
$(LN) $@ `basename $@ .2`
|
||||
|
||||
@@ -422,11 +444,12 @@ libcupsimage.so.2: $(IMAGEOBJS) libcups.so.2
|
||||
|
||||
libcupsimage.2.dylib: $(IMAGEOBJS) libcups.2.dylib
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
|
||||
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ \
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.3.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
$(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS)
|
||||
$(IMAGEOBJS) $(LINKCUPS)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
$(RM) libcupsimage.dylib
|
||||
$(LN) $@ libcupsimage.dylib
|
||||
|
||||
@@ -437,9 +460,8 @@ libcupsimage.2.dylib: $(IMAGEOBJS) libcups.2.dylib
|
||||
|
||||
libcupsimage.la: $(IMAGEOBJS) libcups.la
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
|
||||
-L../cups $(LINKCUPS) \
|
||||
-rpath $(LIBDIR) -version-info 2:3
|
||||
$(DSO) $(ARCHFLAGS) $(ALL_DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) \
|
||||
$(LINKCUPS) -rpath $(LIBDIR) -version-info 2:3
|
||||
|
||||
|
||||
#
|
||||
@@ -454,12 +476,13 @@ libcupsimage.a: $(IMAGEOBJS)
|
||||
|
||||
|
||||
#
|
||||
# rasterbench
|
||||
# rasterbench (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
rasterbench: rasterbench.o libcupsimage.a
|
||||
rasterbench: rasterbench.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ rasterbench.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -468,8 +491,8 @@ rasterbench: rasterbench.o libcupsimage.a
|
||||
|
||||
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)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -478,8 +501,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
|
||||
|
||||
@@ -490,19 +513,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) libcupsimage.a
|
||||
testclient: testclient.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(LDFLAGS) -o $@ testclient.o \
|
||||
libcupsimage.a $(LIBCUPSSTATIC) \
|
||||
$(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testclient.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -511,8 +533,8 @@ testclient: testclient.o $(LIBCUPSSTATIC) libcupsimage.a
|
||||
|
||||
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)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -521,8 +543,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)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -531,8 +553,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)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -541,8 +563,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)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -551,8 +573,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
|
||||
|
||||
@@ -563,8 +585,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)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -573,8 +595,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
|
||||
|
||||
@@ -585,8 +607,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
|
||||
|
||||
@@ -597,8 +619,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
|
||||
|
||||
@@ -609,15 +631,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; \
|
||||
@@ -633,8 +650,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
|
||||
|
||||
@@ -645,8 +662,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
|
||||
|
||||
@@ -657,21 +674,20 @@ 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
|
||||
# testraster (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testraster: testraster.o $(LIBCUPSSTATIC) libcupsimage.a
|
||||
testraster: testraster.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
|
||||
$(LIBCUPSSTATIC) $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
|
||||
$(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
|
||||
$(LD_CC) $(ARCHFLAGS) $(ALL_LDFLAGS) -o $@ testraster.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
echo Running raster API tests...
|
||||
./testraster
|
||||
|
||||
@@ -682,8 +698,18 @@ testraster: testraster.o $(LIBCUPSSTATIC) libcupsimage.a
|
||||
|
||||
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)" $@
|
||||
|
||||
|
||||
#
|
||||
# testthreads (dependency on static CUPS library is intentional)
|
||||
#
|
||||
|
||||
testthreads: testthreads.o $(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
$(LD_CC) $(ALL_LDFLAGS) -o $@ testthreads.o $(LINKCUPSSTATIC)
|
||||
$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -692,8 +718,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)" $@
|
||||
|
||||
|
||||
#
|
||||
@@ -703,42 +729,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" --title "Raster API" \
|
||||
--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 --intro api-raster.shtml \
|
||||
api-raster.xml \
|
||||
../cups/raster.h interpret.c raster.c \
|
||||
--header api-raster.header --body api-raster.shtml \
|
||||
../cups/raster.h raster-stubs.c \
|
||||
>../doc/help/api-raster.html
|
||||
mxmldoc --tokens help/api-raster.html api-raster.xml >../doc/help/api-raster.tokens
|
||||
$(RM) api-raster.xml
|
||||
mxmldoc --section "Programming" \
|
||||
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
|
||||
|
||||
|
||||
#
|
||||
|
||||
+25
-955
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
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
@@ -868,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,7 +1,7 @@
|
||||
<!--
|
||||
PPD API header for CUPS.
|
||||
|
||||
Copyright © 2008-2012 by Apple Inc.
|
||||
Copyright © 2008-2019 by Apple Inc.
|
||||
|
||||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
information.
|
||||
@@ -9,7 +9,10 @@
|
||||
|
||||
<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>
|
||||
@@ -26,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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
PPD API introduction for CUPS.
|
||||
|
||||
Copyright © 2007-2012 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
|
||||
@@ -10,7 +10,10 @@
|
||||
|
||||
<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
|
||||
@@ -28,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
|
||||
@@ -115,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
|
||||
@@ -125,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
|
||||
@@ -179,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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
Raster API documentation for CUPS.
|
||||
|
||||
Copyright © 2008-2010 by Apple Inc.
|
||||
Copyright © 2008-2019 by Apple Inc.
|
||||
|
||||
Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
information.
|
||||
@@ -19,13 +19,12 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Library</th>
|
||||
<td>-lcupsimage</td>
|
||||
<td>-lcups</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>See Also</th>
|
||||
<td>Programming: <a href='api-overview.html'>Introduction to CUPS Programming</a><br>
|
||||
Programming: <a href='api-cups.html'>CUPS API</a><br>
|
||||
Programming: <a href='api-cups.html'>PPD API</a><br>
|
||||
<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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
Raster API introduction for CUPS.
|
||||
|
||||
Copyright © 2007-2013 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
|
||||
@@ -147,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 Digest.");
|
||||
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)
|
||||
{
|
||||
|
||||
+56
-27
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Private definitions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 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
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
# include "string-private.h"
|
||||
# include "debug-private.h"
|
||||
# include "array-private.h"
|
||||
# include "ipp-private.h"
|
||||
# include "http-private.h"
|
||||
@@ -51,6 +50,30 @@ 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_digestoptions_e /**** Digest Options values */
|
||||
{
|
||||
_CUPS_DIGESTOPTIONS_NONE, /* No Digest authentication options */
|
||||
_CUPS_DIGESTOPTIONS_DENYMD5 /* Do not use MD5 hashes for digest */
|
||||
} _cups_digestoptions_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... */
|
||||
@@ -59,6 +82,7 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
*cups_serverroot,
|
||||
/* CUPS_SERVERROOT environment var */
|
||||
*cups_statedir, /* CUPS_STATEDIR environment var */
|
||||
*home, /* HOME environment var */
|
||||
*localedir; /* LOCALDIR environment var */
|
||||
|
||||
/* adminutil.c */
|
||||
@@ -122,6 +146,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 */
|
||||
@@ -137,6 +164,8 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/
|
||||
char tempfile[1024]; /* cupsTempFd/File buffer */
|
||||
|
||||
/* usersys.c */
|
||||
_cups_digestoptions_t digestoptions; /* DigestOptions setting */
|
||||
_cups_uatokens_t uatokens; /* UserAgentTokens setting */
|
||||
http_encryption_t encryption; /* Encryption setting */
|
||||
char user[65], /* User name */
|
||||
user_agent[256],/* User-Agent string */
|
||||
@@ -219,38 +248,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 ipp_attribute_t *_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, unsigned flags, 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;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+36
-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"
|
||||
@@ -41,10 +42,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 2.0300
|
||||
# define CUPS_VERSION 2.0303
|
||||
# define CUPS_VERSION_MAJOR 2
|
||||
# define CUPS_VERSION_MINOR 3
|
||||
# define CUPS_VERSION_PATCH 0
|
||||
# define CUPS_VERSION_PATCH 3
|
||||
|
||||
# define CUPS_BC_FD 3
|
||||
/* Back-channel file descriptor for
|
||||
@@ -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;
|
||||
|
||||
Arquivo binário não exibido.
|
Antes Largura: | Altura: | Tamanho: 15 KiB Depois Largura: | Altura: | Tamanho: 13 KiB |
+23
-12
@@ -1,8 +1,8 @@
|
||||
---
|
||||
title: CUPS Programming Manual
|
||||
author: Michael R Sweet
|
||||
copyright: Copyright © 2007-2018 by Apple Inc. All Rights Reserved.
|
||||
version: 2.3.0
|
||||
copyright: Copyright © 2007-2019 by Apple Inc. All Rights Reserved.
|
||||
version: 2.3.3
|
||||
...
|
||||
|
||||
> 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
|
||||
@@ -101,7 +108,7 @@ to the file. Build and run (CMD+R) to see the list of destinations.
|
||||
|
||||
### Compiling with GCC
|
||||
|
||||
From the command-line, create a file called `sample.c` using your favorite
|
||||
From the command-line, create a file called `simple.c` using your favorite
|
||||
editor, copy the example to this file, and save. Then run the following command
|
||||
to compile it with GCC and run it:
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+20
-8
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Destination option/media support for CUPS.
|
||||
*
|
||||
* Copyright © 2012-2018 by Apple Inc.
|
||||
* Copyright © 2012-2019 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -27,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,
|
||||
@@ -58,7 +59,7 @@ static void cups_update_ready(http_t *http, cups_dinfo_t *dinfo);
|
||||
/*
|
||||
* 'cupsAddDestMediaOptions()' - Add the option corresponding to the specified media size.
|
||||
*
|
||||
* @since CUPS 2.3@
|
||||
* @since CUPS 2.3/macOS 10.14@
|
||||
*/
|
||||
|
||||
int /* O - New number of options */
|
||||
@@ -178,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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -269,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);
|
||||
|
||||
@@ -284,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 &&
|
||||
@@ -1617,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);
|
||||
@@ -1637,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);
|
||||
@@ -1653,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);
|
||||
@@ -2512,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;
|
||||
|
||||
+51
-50
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* User-defined destination (and option) support for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 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
|
||||
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_NOTIFY_H
|
||||
@@ -43,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")
|
||||
@@ -1747,7 +1748,6 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
|
||||
cups_dest_t *dest; /* Destination */
|
||||
char filename[1024], /* Path to lpoptions */
|
||||
defname[256]; /* Default printer name */
|
||||
const char *home = getenv("HOME"); /* Home directory */
|
||||
int set_as_default = 0; /* Set returned destination as default */
|
||||
ipp_op_t op = IPP_OP_GET_PRINTER_ATTRIBUTES;
|
||||
/* IPP operation to get server ops */
|
||||
@@ -1779,13 +1779,13 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
|
||||
else
|
||||
instance = NULL;
|
||||
}
|
||||
else if (home)
|
||||
else if (cg->home)
|
||||
{
|
||||
/*
|
||||
* No default in the environment, try the user's lpoptions files...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
|
||||
|
||||
dest_name = cups_get_default(filename, defname, sizeof(defname), &instance);
|
||||
|
||||
@@ -1891,9 +1891,9 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT
|
||||
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
|
||||
cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);
|
||||
|
||||
if (home)
|
||||
if (cg->home)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
|
||||
|
||||
cups_get_dests(filename, dest_name, instance, 0, 1, 1, &dest);
|
||||
}
|
||||
@@ -2031,9 +2031,6 @@ 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
|
||||
const char *home; /* HOME environment variable */
|
||||
#endif /* WIN32 */
|
||||
char filename[1024]; /* lpoptions file */
|
||||
int num_temps; /* Number of temporary destinations */
|
||||
cups_dest_t *temps = NULL, /* Temporary destinations */
|
||||
@@ -2067,27 +2064,18 @@ cupsSetDests2(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot);
|
||||
|
||||
#ifndef WIN32
|
||||
if (getuid())
|
||||
if (cg->home)
|
||||
{
|
||||
/*
|
||||
* Point to user defaults...
|
||||
* Create ~/.cups subdirectory...
|
||||
*/
|
||||
|
||||
if ((home = getenv("HOME")) != NULL)
|
||||
{
|
||||
/*
|
||||
* Create ~/.cups subdirectory...
|
||||
*/
|
||||
snprintf(filename, sizeof(filename), "%s/.cups", cg->home);
|
||||
if (access(filename, 0))
|
||||
mkdir(filename, 0700);
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/.cups", home);
|
||||
if (access(filename, 0))
|
||||
mkdir(filename, 0700);
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
|
||||
}
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
|
||||
}
|
||||
#endif /* !WIN32 */
|
||||
|
||||
/*
|
||||
* Try to open the file...
|
||||
@@ -2099,7 +2087,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...
|
||||
@@ -2107,7 +2095,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:
|
||||
@@ -2268,7 +2256,7 @@ _cupsUserDefault(char *name, /* I - Name buffer */
|
||||
* system preferences...
|
||||
*/
|
||||
|
||||
if ((locprinter = _cupsAppleCopyDefaultPrinter()) != NULL)
|
||||
if (!getenv("CUPS_NO_APPLE_DEFAULT") && (locprinter = _cupsAppleCopyDefaultPrinter()) != NULL)
|
||||
{
|
||||
CFStringGetCString(locprinter, name, (CFIndex)namesize, kCFStringEncodingUTF8);
|
||||
CFRelease(locprinter);
|
||||
@@ -3391,10 +3379,9 @@ cups_enum_dests(
|
||||
int i, j, /* Looping vars */
|
||||
num_dests; /* Number of destinations */
|
||||
cups_dest_t *dests = NULL, /* Destinations */
|
||||
*dest, /* Current destination */
|
||||
*user_dest; /* User destination */
|
||||
*dest; /* Current destination */
|
||||
cups_option_t *option; /* Current option */
|
||||
char *user_default; /* User default printer */
|
||||
const char *user_default; /* Default printer from environment */
|
||||
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
int count, /* Number of queries started */
|
||||
completed, /* Number of completed queries */
|
||||
@@ -3425,7 +3412,6 @@ cups_enum_dests(
|
||||
#else
|
||||
_cups_getdata_t data; /* Data for callback */
|
||||
#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
const char *home; /* HOME environment variable */
|
||||
char filename[1024]; /* Local lpoptions file */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
|
||||
|
||||
@@ -3450,13 +3436,35 @@ cups_enum_dests(
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
||||
if ((user_default = _cupsUserDefault(data.def_name, sizeof(data.def_name))) == NULL)
|
||||
{
|
||||
const char *defprinter = cupsGetDefault2(http);
|
||||
/* Server default, if any */
|
||||
user_default = _cupsUserDefault(data.def_name, sizeof(data.def_name));
|
||||
|
||||
if (defprinter)
|
||||
strlcpy(data.def_name, defprinter, sizeof(data.def_name));
|
||||
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);
|
||||
|
||||
if (cg->home)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", cg->home);
|
||||
|
||||
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
|
||||
}
|
||||
|
||||
if (!user_default && (dest = cupsGetDest(NULL, NULL, data.num_dests, data.dests)) != NULL)
|
||||
{
|
||||
/*
|
||||
* Use an lpoptions default printer...
|
||||
*/
|
||||
|
||||
if (dest->instance)
|
||||
snprintf(data.def_name, sizeof(data.def_name), "%s/%s", dest->name, dest->instance);
|
||||
else
|
||||
strlcpy(data.def_name, dest->name, sizeof(data.def_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *default_printer; /* Server default printer */
|
||||
|
||||
if ((default_printer = cupsGetDefault2(http)) != NULL)
|
||||
strlcpy(data.def_name, default_printer, sizeof(data.def_name));
|
||||
}
|
||||
|
||||
if (data.def_name[0])
|
||||
@@ -3471,16 +3479,6 @@ cups_enum_dests(
|
||||
|
||||
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);
|
||||
|
||||
if ((home = getenv("HOME")) != NULL)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home);
|
||||
|
||||
data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get ready to enumerate...
|
||||
*/
|
||||
@@ -3518,8 +3516,9 @@ cups_enum_dests(
|
||||
i > 0 && (!cancel || !*cancel);
|
||||
i --, dest ++)
|
||||
{
|
||||
cups_dest_t *user_dest; /* Destination from lpoptions */
|
||||
#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
|
||||
const char *device_uri; /* Device URI */
|
||||
const char *device_uri; /* Device URI */
|
||||
#endif /* HAVE_DNSSD || HAVE_AVAHI */
|
||||
|
||||
if ((user_dest = cupsGetDest(dest->name, dest->instance, data.num_dests, data.dests)) != NULL)
|
||||
@@ -3788,6 +3787,8 @@ cups_enum_dests(
|
||||
|
||||
if ((device->type & mask) == type)
|
||||
{
|
||||
cups_dest_t *user_dest; /* Destination from lpoptions */
|
||||
|
||||
dest = &device->dest;
|
||||
|
||||
if ((user_dest = cupsGetDest(dest->name, dest->instance, data.num_dests, data.dests)) != NULL)
|
||||
|
||||
+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 */
|
||||
|
||||
+37
-4
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Option encoding routines for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2018 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
|
||||
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -129,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 },
|
||||
@@ -142,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 },
|
||||
@@ -150,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 */
|
||||
@@ -158,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 */
|
||||
@@ -168,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 },
|
||||
@@ -212,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 },
|
||||
@@ -227,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 },
|
||||
@@ -279,9 +299,21 @@ 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 },
|
||||
@@ -303,6 +335,7 @@ static const _ipp_option_t ipp_options[] =
|
||||
{ 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 },
|
||||
@@ -490,7 +523,7 @@ _cupsEncodeOption(
|
||||
|
||||
quote = *sep;
|
||||
}
|
||||
else if (*sep == ',' && count > 1)
|
||||
else if (*sep == ',')
|
||||
break;
|
||||
else if (*sep == '\\' && sep[1])
|
||||
{
|
||||
@@ -640,7 +673,7 @@ _cupsEncodeOption(
|
||||
/*
|
||||
* 'cupsEncodeOption()' - Encode a single option into an IPP attribute.
|
||||
*
|
||||
* @since CUPS 2.3@
|
||||
* @since CUPS 2.3/macOS 10.14@
|
||||
*/
|
||||
|
||||
ipp_attribute_t * /* O - New attribute or @code NULL@ on error */
|
||||
|
||||
-266
@@ -1,266 +0,0 @@
|
||||
/*
|
||||
* Raster error handling for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 by Apple Inc.
|
||||
* Copyright 2007 by Easy Software Products.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <cups/raster-private.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local structures...
|
||||
*/
|
||||
|
||||
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;
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static _cups_raster_error_t *get_error_buffer(void);
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsRasterAddError()' - Add an error message to the error buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
_cupsRasterAddError(const char *f, /* I - Printf-style error message */
|
||||
...) /* I - Additional arguments as needed */
|
||||
{
|
||||
_cups_raster_error_t *buf = get_error_buffer();
|
||||
/* Error buffer */
|
||||
va_list ap; /* Pointer to additional arguments */
|
||||
char s[2048]; /* Message string */
|
||||
ssize_t bytes; /* Bytes in message string */
|
||||
|
||||
|
||||
DEBUG_printf(("_cupsRasterAddError(f=\"%s\", ...)", f));
|
||||
|
||||
va_start(ap, f);
|
||||
bytes = vsnprintf(s, sizeof(s), f, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (bytes <= 0)
|
||||
return;
|
||||
|
||||
DEBUG_printf(("1_cupsRasterAddError: %s", s));
|
||||
|
||||
bytes ++;
|
||||
|
||||
if ((size_t)bytes >= sizeof(s))
|
||||
return;
|
||||
|
||||
if (bytes > (ssize_t)(buf->end - buf->current))
|
||||
{
|
||||
/*
|
||||
* Allocate more memory...
|
||||
*/
|
||||
|
||||
char *temp; /* New buffer */
|
||||
size_t size; /* Size of buffer */
|
||||
|
||||
|
||||
size = (size_t)(buf->end - buf->start + 2 * bytes + 1024);
|
||||
|
||||
if (buf->start)
|
||||
temp = realloc(buf->start, size);
|
||||
else
|
||||
temp = malloc(size);
|
||||
|
||||
if (!temp)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Update pointers...
|
||||
*/
|
||||
|
||||
buf->end = temp + size;
|
||||
buf->current = temp + (buf->current - buf->start);
|
||||
buf->start = temp;
|
||||
}
|
||||
|
||||
/*
|
||||
* Append the message to the end of the current string...
|
||||
*/
|
||||
|
||||
memcpy(buf->current, s, (size_t)bytes);
|
||||
buf->current += bytes - 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsRasterClearError()' - Clear the error buffer.
|
||||
*/
|
||||
|
||||
void
|
||||
_cupsRasterClearError(void)
|
||||
{
|
||||
_cups_raster_error_t *buf = get_error_buffer();
|
||||
/* Error buffer */
|
||||
|
||||
|
||||
buf->current = buf->start;
|
||||
|
||||
if (buf->start)
|
||||
*(buf->start) = '\0';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsRasterErrorString()' - Return the last error from a raster function.
|
||||
*
|
||||
* If there are no recent errors, NULL is returned.
|
||||
*
|
||||
* @since CUPS 1.3/macOS 10.5@
|
||||
*/
|
||||
|
||||
const char * /* O - Last error */
|
||||
cupsRasterErrorString(void)
|
||||
{
|
||||
_cups_raster_error_t *buf = get_error_buffer();
|
||||
/* Error buffer */
|
||||
|
||||
|
||||
if (buf->current == buf->start)
|
||||
return (NULL);
|
||||
else
|
||||
return (buf->start);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
/*
|
||||
* Implement per-thread globals...
|
||||
*/
|
||||
|
||||
# include <pthread.h>
|
||||
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static pthread_key_t raster_key = 0; /* Thread local storage key */
|
||||
static pthread_once_t raster_key_once = PTHREAD_ONCE_INIT;
|
||||
/* One-time initialization object */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static void raster_init(void);
|
||||
static void raster_destructor(void *value);
|
||||
|
||||
|
||||
/*
|
||||
* 'get_error_buffer()' - Return a pointer to thread local storage.
|
||||
*/
|
||||
|
||||
_cups_raster_error_t * /* O - Pointer to error buffer */
|
||||
get_error_buffer(void)
|
||||
{
|
||||
_cups_raster_error_t *buf; /* Pointer to error buffer */
|
||||
|
||||
|
||||
/*
|
||||
* Initialize the global data exactly once...
|
||||
*/
|
||||
|
||||
DEBUG_puts("3get_error_buffer()");
|
||||
|
||||
pthread_once(&raster_key_once, raster_init);
|
||||
|
||||
/*
|
||||
* See if we have allocated the data yet...
|
||||
*/
|
||||
|
||||
if ((buf = (_cups_raster_error_t *)pthread_getspecific(raster_key))
|
||||
== NULL)
|
||||
{
|
||||
DEBUG_puts("4get_error_buffer: allocating memory for thread.");
|
||||
|
||||
/*
|
||||
* No, allocate memory as set the pointer for the key...
|
||||
*/
|
||||
|
||||
buf = calloc(1, sizeof(_cups_raster_error_t));
|
||||
pthread_setspecific(raster_key, buf);
|
||||
|
||||
DEBUG_printf(("4get_error_buffer: buf=%p", (void *)buf));
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the pointer to the data...
|
||||
*/
|
||||
|
||||
return (buf);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'raster_init()' - Initialize error buffer once.
|
||||
*/
|
||||
|
||||
static void
|
||||
raster_init(void)
|
||||
{
|
||||
pthread_key_create(&raster_key, raster_destructor);
|
||||
|
||||
DEBUG_printf(("3raster_init(): raster_key=%x(%u)", (unsigned)raster_key, (unsigned)raster_key));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'raster_destructor()' - Free memory allocated by get_error_buffer().
|
||||
*/
|
||||
|
||||
static void
|
||||
raster_destructor(void *value) /* I - Data to free */
|
||||
{
|
||||
_cups_raster_error_t *buf = (_cups_raster_error_t *)value;
|
||||
/* Error buffer */
|
||||
|
||||
|
||||
DEBUG_printf(("3raster_destructor(value=%p)", value));
|
||||
|
||||
if (buf->start)
|
||||
free(buf->start);
|
||||
|
||||
free(value);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
/*
|
||||
* Implement static globals...
|
||||
*/
|
||||
|
||||
/*
|
||||
* 'get_error_buffer()' - Return a pointer to thread local storage.
|
||||
*/
|
||||
|
||||
_cups_raster_error_t * /* O - Pointer to error buffer */
|
||||
get_error_buffer(void)
|
||||
{
|
||||
static _cups_raster_error_t buf = { 0, 0, 0 };
|
||||
/* Error buffer */
|
||||
|
||||
|
||||
return (&buf);
|
||||
}
|
||||
#endif /* HAVE_PTHREAD_H */
|
||||
+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_ */
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Network interface functions for CUPS.
|
||||
*
|
||||
* Copyright © 2007-2010 by Apple Inc.
|
||||
* Copyright © 2007-2018 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
|
||||
@@ -12,7 +12,7 @@
|
||||
* 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;
|
||||
|
||||
+45
-22
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Global variable access routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2015 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -12,6 +13,9 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#ifndef _WIN32
|
||||
# include <pwd.h>
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -28,23 +32,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 +63,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 +118,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 +168,7 @@ DllMain(HINSTANCE hinst, /* I - DLL module handle */
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -176,13 +180,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 +217,7 @@ cups_globals_alloc(void)
|
||||
* Then set directories as appropriate...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (!installdir[0])
|
||||
{
|
||||
/*
|
||||
@@ -222,8 +226,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 +235,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;)
|
||||
@@ -270,6 +273,8 @@ cups_globals_alloc(void)
|
||||
if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
|
||||
cg->localedir = localedir;
|
||||
|
||||
cg->home = getenv("HOME");
|
||||
|
||||
#else
|
||||
# ifdef HAVE_GETEUID
|
||||
if ((geteuid() != getuid() && getuid()) || getegid() != getgid())
|
||||
@@ -308,8 +313,23 @@ cups_globals_alloc(void)
|
||||
|
||||
if ((cg->localedir = getenv("LOCALEDIR")) == NULL)
|
||||
cg->localedir = CUPS_LOCALEDIR;
|
||||
|
||||
cg->home = getenv("HOME");
|
||||
|
||||
# ifdef __APPLE__ /* Sandboxing now exposes the container as the home directory */
|
||||
if (cg->home && strstr(cg->home, "/Library/Containers/"))
|
||||
cg->home = NULL;
|
||||
# endif /* !__APPLE__ */
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (!cg->home)
|
||||
{
|
||||
struct passwd *pw; /* User info */
|
||||
|
||||
if ((pw = getpwuid(getuid())) != NULL)
|
||||
cg->home = _cupsStrAlloc(pw->pw_dir);
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
return (cg);
|
||||
}
|
||||
@@ -319,7 +339,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 +372,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
|
||||
|
||||
+24
-4
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Hashing function for CUPS.
|
||||
*
|
||||
* Copyright © 2015-2018 by Apple Inc.
|
||||
* Copyright © 2015-2019 by Apple Inc.
|
||||
*
|
||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
* information.
|
||||
@@ -16,8 +16,9 @@
|
||||
# include <CommonCrypto/CommonDigest.h>
|
||||
#elif defined(HAVE_GNUTLS)
|
||||
# include <gnutls/crypto.h>
|
||||
# include "md5-internal.h"
|
||||
#else
|
||||
# include "md5-private.h"
|
||||
# include "md5-internal.h"
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
@@ -185,8 +186,24 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
|
||||
unsigned char temp[64]; /* Temporary hash buffer */
|
||||
size_t tempsize = 0; /* Truncate to this size? */
|
||||
|
||||
|
||||
if (!strcmp(algorithm, "md5"))
|
||||
alg = GNUTLS_DIG_MD5;
|
||||
{
|
||||
/*
|
||||
* Some versions of GNU TLS disable MD5 without warning...
|
||||
*/
|
||||
|
||||
_cups_md5_state_t state; /* MD5 state info */
|
||||
|
||||
if (hashsize < 16)
|
||||
goto too_small;
|
||||
|
||||
_cupsMD5Init(&state);
|
||||
_cupsMD5Append(&state, data, datalen);
|
||||
_cupsMD5Finish(&state, hash);
|
||||
|
||||
return (16);
|
||||
}
|
||||
else if (!strcmp(algorithm, "sha"))
|
||||
alg = GNUTLS_DIG_SHA1;
|
||||
else if (!strcmp(algorithm, "sha2-224"))
|
||||
@@ -230,7 +247,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
|
||||
@@ -242,6 +259,9 @@ cupsHashData(const char *algorithm, /* I - Algorithm name */
|
||||
{
|
||||
_cups_md5_state_t state; /* MD5 state info */
|
||||
|
||||
if (hashsize < 16)
|
||||
goto too_small;
|
||||
|
||||
_cupsMD5Init(&state);
|
||||
_cupsMD5Append(&state, data, datalen);
|
||||
_cupsMD5Finish(&state, hash);
|
||||
|
||||
+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;
|
||||
|
||||
+34
-132
@@ -25,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 *)
|
||||
@@ -34,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
|
||||
@@ -72,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>
|
||||
@@ -135,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
|
||||
@@ -146,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 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -204,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;
|
||||
|
||||
@@ -349,10 +284,19 @@ struct _http_s /**** HTTP connection structure ****/
|
||||
_http_mode_t mode; /* _HTTP_MODE_CLIENT or _HTTP_MODE_SERVER */
|
||||
# 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 *fields[HTTP_FIELD_MAX],
|
||||
/* Allocated field values */
|
||||
@@ -372,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;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+166
-16
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* HTTP support routines 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.
|
||||
* 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_DNSSD
|
||||
# include <dns_sd.h>
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
# include <io.h>
|
||||
# elif defined(HAVE_POLL)
|
||||
# include <poll.h>
|
||||
# else
|
||||
# include <sys/select.h>
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
#elif defined(HAVE_AVAHI)
|
||||
# include <avahi-client/client.h>
|
||||
# include <avahi-client/lookup.h>
|
||||
@@ -797,14 +799,12 @@ httpGetDateString2(time_t t, /* I - Time in seconds */
|
||||
char *s, /* I - String buffer */
|
||||
int slen) /* I - Size of string buffer */
|
||||
{
|
||||
struct tm *tdate; /* UNIX date/time data */
|
||||
struct tm tdate; /* UNIX date/time data */
|
||||
|
||||
|
||||
tdate = gmtime(&t);
|
||||
if (tdate)
|
||||
snprintf(s, (size_t)slen, "%s, %02d %s %d %02d:%02d:%02d GMT", http_days[tdate->tm_wday], tdate->tm_mday, http_months[tdate->tm_mon], tdate->tm_year + 1900, tdate->tm_hour, tdate->tm_min, tdate->tm_sec);
|
||||
else
|
||||
s[0] = '\0';
|
||||
gmtime_r(&t, &tdate);
|
||||
|
||||
snprintf(s, (size_t)slen, "%s, %02d %s %d %02d:%02d:%02d GMT", http_days[tdate.tm_wday], tdate.tm_mday, http_months[tdate.tm_mon], tdate.tm_year + 1900, tdate.tm_hour, tdate.tm_min, tdate.tm_sec);
|
||||
|
||||
return (s);
|
||||
}
|
||||
@@ -1026,7 +1026,7 @@ httpSeparateURI(
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
if (*uri != ':')
|
||||
if (*uri != ':' || *scheme == '.' || !*scheme)
|
||||
{
|
||||
*scheme = '\0';
|
||||
return (HTTP_URI_STATUS_BAD_SCHEME);
|
||||
@@ -1296,6 +1296,159 @@ httpSeparateURI(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpSetDigestAuthString()' - Calculate a Digest authentication response
|
||||
* using the appropriate RFC 2068/2617/7616
|
||||
* algorithm.
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
_httpSetDigestAuthString(
|
||||
http_t *http, /* I - HTTP connection */
|
||||
const char *nonce, /* I - Nonce value */
|
||||
const char *method, /* I - HTTP method */
|
||||
const char *resource) /* I - HTTP resource path */
|
||||
{
|
||||
char kd[65], /* Final MD5/SHA-256 digest */
|
||||
ha1[65], /* Hash of username:realm:password */
|
||||
ha2[65], /* Hash of method:request-uri */
|
||||
username[HTTP_MAX_VALUE],
|
||||
/* username:password */
|
||||
*password, /* Pointer to password */
|
||||
temp[1024], /* Temporary string */
|
||||
digest[1024]; /* Digest auth data */
|
||||
unsigned char hash[32]; /* Hash buffer */
|
||||
size_t hashsize; /* Size of hash */
|
||||
_cups_globals_t *cg = _cupsGlobals(); /* Per-thread globals */
|
||||
|
||||
|
||||
DEBUG_printf(("2_httpSetDigestAuthString(http=%p, nonce=\"%s\", method=\"%s\", resource=\"%s\")", (void *)http, nonce, method, resource));
|
||||
|
||||
if (nonce && *nonce && strcmp(nonce, http->nonce))
|
||||
{
|
||||
strlcpy(http->nonce, nonce, sizeof(http->nonce));
|
||||
|
||||
if (nonce == http->nextnonce)
|
||||
http->nextnonce[0] = '\0';
|
||||
|
||||
http->nonce_count = 1;
|
||||
}
|
||||
else
|
||||
http->nonce_count ++;
|
||||
|
||||
strlcpy(username, http->userpass, sizeof(username));
|
||||
if ((password = strchr(username, ':')) != NULL)
|
||||
*password++ = '\0';
|
||||
else
|
||||
return (0);
|
||||
|
||||
if (http->algorithm[0])
|
||||
{
|
||||
/*
|
||||
* Follow RFC 2617/7616...
|
||||
*/
|
||||
|
||||
int i; /* Looping var */
|
||||
char cnonce[65]; /* cnonce value */
|
||||
const char *hashalg; /* Hashing algorithm */
|
||||
|
||||
for (i = 0; i < 64; i ++)
|
||||
cnonce[i] = "0123456789ABCDEF"[CUPS_RAND() & 15];
|
||||
cnonce[64] = '\0';
|
||||
|
||||
if (!_cups_strcasecmp(http->algorithm, "MD5"))
|
||||
{
|
||||
/*
|
||||
* RFC 2617 Digest with MD5
|
||||
*/
|
||||
|
||||
if (cg->digestoptions == _CUPS_DIGESTOPTIONS_DENYMD5)
|
||||
{
|
||||
DEBUG_puts("3_httpSetDigestAuthString: MD5 Digest is disabled.");
|
||||
return (0);
|
||||
}
|
||||
|
||||
hashalg = "md5";
|
||||
}
|
||||
else if (!_cups_strcasecmp(http->algorithm, "SHA-256"))
|
||||
{
|
||||
/*
|
||||
* RFC 7616 Digest with SHA-256
|
||||
*/
|
||||
|
||||
hashalg = "sha2-256";
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Some other algorithm we don't support, skip this one...
|
||||
*/
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate digest value...
|
||||
*/
|
||||
|
||||
/* H(A1) = H(username:realm:password) */
|
||||
snprintf(temp, sizeof(temp), "%s:%s:%s", username, http->realm, password);
|
||||
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));
|
||||
|
||||
/* KD = H(H(A1):nonce:nc:cnonce:qop:H(A2)) */
|
||||
snprintf(temp, sizeof(temp), "%s:%s:%08x:%s:%s:%s", ha1, http->nonce, http->nonce_count, cnonce, "auth", ha2);
|
||||
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 (http->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(), http->realm, http->nonce, http->algorithm, http->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\"", username, http->realm, http->nonce, http->algorithm, cnonce, http->nonce_count, resource, kd);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Use old RFC 2069 Digest method...
|
||||
*/
|
||||
|
||||
/* H(A1) = H(username:realm:password) */
|
||||
snprintf(temp, sizeof(temp), "%s:%s:%s", username, http->realm, password);
|
||||
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, http->nonce, ha2);
|
||||
hashsize = (size_t)cupsHashData("md5", (unsigned char *)temp, strlen(temp), hash, sizeof(hash));
|
||||
cupsHashString(hash, hashsize, kd, sizeof(kd));
|
||||
|
||||
/*
|
||||
* Pass the old RFC 2069 WWW-Authenticate header...
|
||||
*/
|
||||
|
||||
snprintf(digest, sizeof(digest), "username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\"", username, http->realm, http->nonce, resource, kd);
|
||||
}
|
||||
|
||||
httpSetAuthString(http, "Digest", digest);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'httpStateString()' - Return the string describing a HTTP state value.
|
||||
*
|
||||
@@ -1616,9 +1769,6 @@ _httpResolveURI(
|
||||
_http_uribuf_t uribuf; /* URI buffer */
|
||||
int offline = 0; /* offline-report state set? */
|
||||
# ifdef HAVE_DNSSD
|
||||
# ifdef WIN32
|
||||
# pragma comment(lib, "dnssd.lib")
|
||||
# endif /* WIN32 */
|
||||
DNSServiceRef ref, /* DNS-SD master service reference */
|
||||
domainref = NULL,/* DNS-SD service reference for domain */
|
||||
ippref = NULL, /* DNS-SD service reference for network IPP */
|
||||
@@ -1747,11 +1897,11 @@ _httpResolveURI(
|
||||
FD_ZERO(&input_set);
|
||||
FD_SET(DNSServiceRefSockFD(ref), &input_set);
|
||||
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
stimeout.tv_sec = (long)timeout;
|
||||
# else
|
||||
stimeout.tv_sec = timeout;
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
stimeout.tv_usec = 0;
|
||||
|
||||
fds = select(DNSServiceRefSockFD(ref)+1, &input_set, NULL, NULL,
|
||||
|
||||
+156
-102
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* HTTP routines for CUPS.
|
||||
*
|
||||
* Copyright 2007-2018 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.
|
||||
*
|
||||
* This file contains Kerberos support code, copyright 2006 by
|
||||
* Jelmer Vernooij.
|
||||
@@ -16,18 +16,22 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <tchar.h>
|
||||
#else
|
||||
# include <signal.h>
|
||||
# include <sys/time.h>
|
||||
# include <sys/resource.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
#ifdef HAVE_POLL
|
||||
# include <poll.h>
|
||||
#endif /* HAVE_POLL */
|
||||
# ifdef HAVE_LIBZ
|
||||
# include <zlib.h>
|
||||
# endif /* HAVE_LIBZ */
|
||||
|
||||
|
||||
/*
|
||||
@@ -101,7 +105,8 @@ static const char * const http_fields[] =
|
||||
"WWW-Authenticate",
|
||||
"Accept-Encoding",
|
||||
"Allow",
|
||||
"Server"
|
||||
"Server",
|
||||
"Authentication-Info"
|
||||
};
|
||||
|
||||
|
||||
@@ -1144,11 +1149,11 @@ httpGets(char *line, /* I - Line to read into */
|
||||
* Pre-load the buffer as needed...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
WSASetLastError(0);
|
||||
#else
|
||||
errno = 0;
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
while (http->used == 0)
|
||||
{
|
||||
@@ -1162,11 +1167,11 @@ httpGets(char *line, /* I - Line to read into */
|
||||
continue;
|
||||
|
||||
DEBUG_puts("3httpGets: Timed out!");
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
http->error = WSAETIMEDOUT;
|
||||
#else
|
||||
http->error = ETIMEDOUT;
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -1180,7 +1185,7 @@ httpGets(char *line, /* I - Line to read into */
|
||||
* Nope, can't get a line this time...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
DEBUG_printf(("3httpGets: recv() error %d!", WSAGetLastError()));
|
||||
|
||||
if (WSAGetLastError() == WSAEINTR)
|
||||
@@ -1217,7 +1222,7 @@ httpGets(char *line, /* I - Line to read into */
|
||||
http->error = errno;
|
||||
continue;
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
@@ -1340,8 +1345,11 @@ httpGetSubField2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
DEBUG_printf(("2httpGetSubField2(http=%p, field=%d, name=\"%s\", value=%p, valuelen=%d)", (void *)http, field, name, (void *)value, valuelen));
|
||||
|
||||
if (value)
|
||||
*value = '\0';
|
||||
|
||||
if (!http || !name || !value || valuelen < 2 ||
|
||||
field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX)
|
||||
field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX || !http->fields[field])
|
||||
return (NULL);
|
||||
|
||||
end = value + valuelen - 1;
|
||||
@@ -1484,9 +1492,9 @@ void
|
||||
httpInitialize(void)
|
||||
{
|
||||
static int initialized = 0; /* Have we been called before? */
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
WSADATA winsockdata; /* WinSock data */
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
_cupsGlobalLock();
|
||||
@@ -1496,7 +1504,7 @@ httpInitialize(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
WSAStartup(MAKEWORD(2,2), &winsockdata);
|
||||
|
||||
#elif !defined(SO_NOSIGPIPE)
|
||||
@@ -1518,7 +1526,7 @@ httpInitialize(void)
|
||||
# else
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
# endif /* !SO_NOSIGPIPE */
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
# ifdef HAVE_SSL
|
||||
_httpTLSInitialize();
|
||||
@@ -1674,7 +1682,7 @@ httpPeek(http_t *http, /* I - HTTP connection */
|
||||
#ifdef HAVE_LIBZ
|
||||
if (http->used == 0 &&
|
||||
(http->coding == _HTTP_CODING_IDENTITY ||
|
||||
(http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in == 0)))
|
||||
(http->coding >= _HTTP_CODING_GUNZIP && ((z_stream *)http->stream)->avail_in == 0)))
|
||||
#else
|
||||
if (http->used == 0)
|
||||
#endif /* HAVE_LIBZ */
|
||||
@@ -1723,16 +1731,16 @@ httpPeek(http_t *http, /* I - HTTP connection */
|
||||
int zerr; /* Decompressor error */
|
||||
z_stream stream; /* Copy of decompressor stream */
|
||||
|
||||
if (http->used > 0 && http->stream.avail_in < HTTP_MAX_BUFFER)
|
||||
if (http->used > 0 && ((z_stream *)http->stream)->avail_in < HTTP_MAX_BUFFER)
|
||||
{
|
||||
size_t buflen = buflen = HTTP_MAX_BUFFER - http->stream.avail_in;
|
||||
size_t buflen = HTTP_MAX_BUFFER - ((z_stream *)http->stream)->avail_in;
|
||||
/* Number of bytes to copy */
|
||||
|
||||
if (http->stream.avail_in > 0 &&
|
||||
http->stream.next_in > http->sbuffer)
|
||||
memmove(http->sbuffer, http->stream.next_in, http->stream.avail_in);
|
||||
if (((z_stream *)http->stream)->avail_in > 0 &&
|
||||
((z_stream *)http->stream)->next_in > http->sbuffer)
|
||||
memmove(http->sbuffer, ((z_stream *)http->stream)->next_in, ((z_stream *)http->stream)->avail_in);
|
||||
|
||||
http->stream.next_in = http->sbuffer;
|
||||
((z_stream *)http->stream)->next_in = http->sbuffer;
|
||||
|
||||
if (buflen > (size_t)http->data_remaining)
|
||||
buflen = (size_t)http->data_remaining;
|
||||
@@ -1743,8 +1751,8 @@ httpPeek(http_t *http, /* I - HTTP connection */
|
||||
DEBUG_printf(("1httpPeek: Copying %d more bytes of data into "
|
||||
"decompression buffer.", (int)buflen));
|
||||
|
||||
memcpy(http->sbuffer + http->stream.avail_in, http->buffer, buflen);
|
||||
http->stream.avail_in += buflen;
|
||||
memcpy(http->sbuffer + ((z_stream *)http->stream)->avail_in, http->buffer, buflen);
|
||||
((z_stream *)http->stream)->avail_in += buflen;
|
||||
http->used -= (int)buflen;
|
||||
http->data_remaining -= (off_t)buflen;
|
||||
|
||||
@@ -1753,9 +1761,9 @@ httpPeek(http_t *http, /* I - HTTP connection */
|
||||
}
|
||||
|
||||
DEBUG_printf(("2httpPeek: length=%d, avail_in=%d", (int)length,
|
||||
(int)http->stream.avail_in));
|
||||
(int)((z_stream *)http->stream)->avail_in));
|
||||
|
||||
if (inflateCopy(&stream, &(http->stream)) != Z_OK)
|
||||
if (inflateCopy(&stream, (z_stream *)http->stream) != Z_OK)
|
||||
{
|
||||
DEBUG_puts("2httpPeek: Unable to copy decompressor stream.");
|
||||
http->error = ENOMEM;
|
||||
@@ -1772,14 +1780,14 @@ httpPeek(http_t *http, /* I - HTTP connection */
|
||||
{
|
||||
DEBUG_printf(("2httpPeek: zerr=%d", zerr));
|
||||
#ifdef DEBUG
|
||||
http_debug_hex("2httpPeek", (char *)http->sbuffer, (int)http->stream.avail_in);
|
||||
http_debug_hex("2httpPeek", (char *)http->sbuffer, (int)((z_stream *)http->stream)->avail_in);
|
||||
#endif /* DEBUG */
|
||||
|
||||
http->error = EIO;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
bytes = (ssize_t)(length - http->stream.avail_out);
|
||||
bytes = (ssize_t)(length - ((z_stream *)http->stream)->avail_out);
|
||||
|
||||
# else
|
||||
DEBUG_puts("2httpPeek: No inflateCopy on this platform, httpPeek does not "
|
||||
@@ -1806,7 +1814,7 @@ httpPeek(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (bytes < 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEWOULDBLOCK)
|
||||
bytes = 0;
|
||||
else
|
||||
@@ -1816,7 +1824,7 @@ httpPeek(http_t *http, /* I - HTTP connection */
|
||||
bytes = 0;
|
||||
else
|
||||
http->error = errno;
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
else if (bytes == 0)
|
||||
{
|
||||
@@ -1852,7 +1860,7 @@ httpPrintf(http_t *http, /* I - HTTP connection */
|
||||
...) /* I - Additional args as needed */
|
||||
{
|
||||
ssize_t bytes; /* Number of bytes to write */
|
||||
char buf[16384]; /* Buffer for formatted string */
|
||||
char buf[65536]; /* Buffer for formatted string */
|
||||
va_list ap; /* Variable argument pointer */
|
||||
|
||||
|
||||
@@ -1864,7 +1872,12 @@ httpPrintf(http_t *http, /* I - HTTP connection */
|
||||
|
||||
DEBUG_printf(("3httpPrintf: (" CUPS_LLFMT " bytes) %s", CUPS_LLCAST bytes, buf));
|
||||
|
||||
if (http->data_encoding == HTTP_ENCODING_FIELDS)
|
||||
if (bytes > (ssize_t)(sizeof(buf) - 1))
|
||||
{
|
||||
http->error = ENOMEM;
|
||||
return (-1);
|
||||
}
|
||||
else if (http->data_encoding == HTTP_ENCODING_FIELDS)
|
||||
return ((int)httpWrite2(http, buf, (size_t)bytes));
|
||||
else
|
||||
{
|
||||
@@ -1946,31 +1959,31 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
{
|
||||
do
|
||||
{
|
||||
if (http->stream.avail_in > 0)
|
||||
if (((z_stream *)http->stream)->avail_in > 0)
|
||||
{
|
||||
int zerr; /* Decompressor error */
|
||||
|
||||
DEBUG_printf(("2httpRead2: avail_in=%d, avail_out=%d",
|
||||
(int)http->stream.avail_in, (int)length));
|
||||
(int)((z_stream *)http->stream)->avail_in, (int)length));
|
||||
|
||||
http->stream.next_out = (Bytef *)buffer;
|
||||
http->stream.avail_out = (uInt)length;
|
||||
((z_stream *)http->stream)->next_out = (Bytef *)buffer;
|
||||
((z_stream *)http->stream)->avail_out = (uInt)length;
|
||||
|
||||
if ((zerr = inflate(&(http->stream), Z_SYNC_FLUSH)) < Z_OK)
|
||||
if ((zerr = inflate((z_stream *)http->stream, Z_SYNC_FLUSH)) < Z_OK)
|
||||
{
|
||||
DEBUG_printf(("2httpRead2: zerr=%d", zerr));
|
||||
#ifdef DEBUG
|
||||
http_debug_hex("2httpRead2", (char *)http->sbuffer, (int)http->stream.avail_in);
|
||||
http_debug_hex("2httpRead2", (char *)http->sbuffer, (int)((z_stream *)http->stream)->avail_in);
|
||||
#endif /* DEBUG */
|
||||
|
||||
http->error = EIO;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
bytes = (ssize_t)(length - http->stream.avail_out);
|
||||
bytes = (ssize_t)(length - ((z_stream *)http->stream)->avail_out);
|
||||
|
||||
DEBUG_printf(("2httpRead2: avail_in=%d, avail_out=%d, bytes=%d",
|
||||
http->stream.avail_in, http->stream.avail_out,
|
||||
((z_stream *)http->stream)->avail_in, ((z_stream *)http->stream)->avail_out,
|
||||
(int)bytes));
|
||||
}
|
||||
else
|
||||
@@ -1978,16 +1991,16 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (bytes == 0)
|
||||
{
|
||||
ssize_t buflen = HTTP_MAX_BUFFER - (ssize_t)http->stream.avail_in;
|
||||
ssize_t buflen = HTTP_MAX_BUFFER - (ssize_t)((z_stream *)http->stream)->avail_in;
|
||||
/* Additional bytes for buffer */
|
||||
|
||||
if (buflen > 0)
|
||||
{
|
||||
if (http->stream.avail_in > 0 &&
|
||||
http->stream.next_in > http->sbuffer)
|
||||
memmove(http->sbuffer, http->stream.next_in, http->stream.avail_in);
|
||||
if (((z_stream *)http->stream)->avail_in > 0 &&
|
||||
((z_stream *)http->stream)->next_in > http->sbuffer)
|
||||
memmove(http->sbuffer, ((z_stream *)http->stream)->next_in, ((z_stream *)http->stream)->avail_in);
|
||||
|
||||
http->stream.next_in = http->sbuffer;
|
||||
((z_stream *)http->stream)->next_in = http->sbuffer;
|
||||
|
||||
DEBUG_printf(("1httpRead2: Reading up to %d more bytes of data into "
|
||||
"decompression buffer.", (int)buflen));
|
||||
@@ -1997,10 +2010,10 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
if (buflen > http->data_remaining)
|
||||
buflen = (ssize_t)http->data_remaining;
|
||||
|
||||
bytes = http_read_buffered(http, (char *)http->sbuffer + http->stream.avail_in, (size_t)buflen);
|
||||
bytes = http_read_buffered(http, (char *)http->sbuffer + ((z_stream *)http->stream)->avail_in, (size_t)buflen);
|
||||
}
|
||||
else if (http->data_encoding == HTTP_ENCODING_CHUNKED)
|
||||
bytes = http_read_chunk(http, (char *)http->sbuffer + http->stream.avail_in, (size_t)buflen);
|
||||
bytes = http_read_chunk(http, (char *)http->sbuffer + ((z_stream *)http->stream)->avail_in, (size_t)buflen);
|
||||
else
|
||||
bytes = 0;
|
||||
|
||||
@@ -2013,7 +2026,7 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
"decompression buffer.", CUPS_LLCAST bytes));
|
||||
|
||||
http->data_remaining -= bytes;
|
||||
http->stream.avail_in += (uInt)bytes;
|
||||
((z_stream *)http->stream)->avail_in += (uInt)bytes;
|
||||
|
||||
if (http->data_remaining <= 0 &&
|
||||
http->data_encoding == HTTP_ENCODING_CHUNKED)
|
||||
@@ -2092,7 +2105,7 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
if (
|
||||
#ifdef HAVE_LIBZ
|
||||
(http->coding == _HTTP_CODING_IDENTITY ||
|
||||
(http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in == 0)) &&
|
||||
(http->coding >= _HTTP_CODING_GUNZIP && ((z_stream *)http->stream)->avail_in == 0)) &&
|
||||
#endif /* HAVE_LIBZ */
|
||||
((http->data_remaining <= 0 &&
|
||||
http->data_encoding == HTTP_ENCODING_LENGTH) ||
|
||||
@@ -2377,11 +2390,11 @@ httpReconnect2(http_t *http, /* I - HTTP connection */
|
||||
* Unable to connect...
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
http->error = WSAGetLastError();
|
||||
#else
|
||||
http->error = errno;
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
http->status = HTTP_STATUS_ERROR;
|
||||
|
||||
DEBUG_printf(("1httpReconnect2: httpAddrConnect failed: %s",
|
||||
@@ -2694,11 +2707,11 @@ httpShutdown(http_t *http) /* I - HTTP connection */
|
||||
_httpTLSStop(http);
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
shutdown(http->fd, SD_RECEIVE); /* Microsoft-ism... */
|
||||
#else
|
||||
shutdown(http->fd, SHUT_RD);
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -2874,7 +2887,12 @@ _httpUpdate(http_t *http, /* I - HTTP connection */
|
||||
httpSetCookie(http, value);
|
||||
}
|
||||
else if ((field = httpFieldValue(line)) != HTTP_FIELD_UNKNOWN)
|
||||
{
|
||||
http_add_field(http, field, value, 1);
|
||||
|
||||
if (field == HTTP_FIELD_AUTHENTICATION_INFO)
|
||||
httpGetSubField2(http, HTTP_FIELD_AUTHENTICATION_INFO, "nextnonce", http->nextnonce, (int)sizeof(http->nextnonce));
|
||||
}
|
||||
#ifdef DEBUG
|
||||
else
|
||||
DEBUG_printf(("1_httpUpdate: unknown field %s seen!", line));
|
||||
@@ -3027,12 +3045,12 @@ _httpWait(http_t *http, /* I - HTTP connection */
|
||||
|
||||
DEBUG_printf(("6_httpWait: select() returned %d...", nfds));
|
||||
}
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
while (nfds < 0 && (WSAGetLastError() == WSAEINTR ||
|
||||
WSAGetLastError() == WSAEWOULDBLOCK));
|
||||
# else
|
||||
while (nfds < 0 && (errno == EINTR || errno == EAGAIN));
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
#endif /* HAVE_POLL */
|
||||
|
||||
DEBUG_printf(("5_httpWait: returning with nfds=%d, errno=%d...", nfds,
|
||||
@@ -3068,7 +3086,7 @@ httpWait(http_t *http, /* I - HTTP connection */
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
if (http->coding >= _HTTP_CODING_GUNZIP && http->stream.avail_in > 0)
|
||||
if (http->coding >= _HTTP_CODING_GUNZIP && ((z_stream *)http->stream)->avail_in > 0)
|
||||
{
|
||||
DEBUG_puts("3httpWait: Returning 1 since there is buffered data ready.");
|
||||
return (1);
|
||||
@@ -3164,17 +3182,17 @@ httpWrite2(http_t *http, /* I - HTTP connection */
|
||||
size_t slen; /* Bytes to write */
|
||||
ssize_t sret; /* Bytes written */
|
||||
|
||||
http->stream.next_in = (Bytef *)buffer;
|
||||
http->stream.avail_in = (uInt)length;
|
||||
((z_stream *)http->stream)->next_in = (Bytef *)buffer;
|
||||
((z_stream *)http->stream)->avail_in = (uInt)length;
|
||||
|
||||
while (deflate(&(http->stream), Z_NO_FLUSH) == Z_OK)
|
||||
while (deflate((z_stream *)http->stream, Z_NO_FLUSH) == Z_OK)
|
||||
{
|
||||
DEBUG_printf(("1httpWrite2: avail_out=%d", http->stream.avail_out));
|
||||
DEBUG_printf(("1httpWrite2: avail_out=%d", ((z_stream *)http->stream)->avail_out));
|
||||
|
||||
if (http->stream.avail_out > 0)
|
||||
if (((z_stream *)http->stream)->avail_out > 0)
|
||||
continue;
|
||||
|
||||
slen = _HTTP_MAX_SBUFFER - http->stream.avail_out;
|
||||
slen = _HTTP_MAX_SBUFFER - ((z_stream *)http->stream)->avail_out;
|
||||
|
||||
DEBUG_printf(("1httpWrite2: Writing intermediate chunk, len=%d", (int)slen));
|
||||
|
||||
@@ -3191,8 +3209,8 @@ httpWrite2(http_t *http, /* I - HTTP connection */
|
||||
return (-1);
|
||||
}
|
||||
|
||||
http->stream.next_out = (Bytef *)http->sbuffer;
|
||||
http->stream.avail_out = (uInt)_HTTP_MAX_SBUFFER;
|
||||
((z_stream *)http->stream)->next_out = (Bytef *)http->sbuffer;
|
||||
((z_stream *)http->stream)->avail_out = (uInt)_HTTP_MAX_SBUFFER;
|
||||
}
|
||||
|
||||
bytes = (ssize_t)length;
|
||||
@@ -3634,7 +3652,15 @@ http_add_field(http_t *http, /* I - HTTP connection */
|
||||
|
||||
char *combined; /* New value string */
|
||||
|
||||
if ((combined = realloc(http->fields[field], total + 1)) != NULL)
|
||||
if (http->fields[field] == http->_fields[field])
|
||||
{
|
||||
if ((combined = malloc(total + 1)) != NULL)
|
||||
{
|
||||
http->fields[field] = combined;
|
||||
snprintf(combined, total + 1, "%s, %s", http->_fields[field], value);
|
||||
}
|
||||
}
|
||||
else if ((combined = realloc(http->fields[field], total + 1)) != NULL)
|
||||
{
|
||||
http->fields[field] = combined;
|
||||
strlcat(combined, ", ", total + 1);
|
||||
@@ -3681,13 +3707,13 @@ http_content_coding_finish(
|
||||
{
|
||||
case _HTTP_CODING_DEFLATE :
|
||||
case _HTTP_CODING_GZIP :
|
||||
http->stream.next_in = dummy;
|
||||
http->stream.avail_in = 0;
|
||||
((z_stream *)http->stream)->next_in = dummy;
|
||||
((z_stream *)http->stream)->avail_in = 0;
|
||||
|
||||
do
|
||||
{
|
||||
zerr = deflate(&(http->stream), Z_FINISH);
|
||||
bytes = _HTTP_MAX_SBUFFER - http->stream.avail_out;
|
||||
zerr = deflate((z_stream *)http->stream, Z_FINISH);
|
||||
bytes = _HTTP_MAX_SBUFFER - ((z_stream *)http->stream)->avail_out;
|
||||
|
||||
if (bytes > 0)
|
||||
{
|
||||
@@ -3699,15 +3725,18 @@ http_content_coding_finish(
|
||||
http_write(http, (char *)http->sbuffer, bytes);
|
||||
}
|
||||
|
||||
http->stream.next_out = (Bytef *)http->sbuffer;
|
||||
http->stream.avail_out = (uInt)_HTTP_MAX_SBUFFER;
|
||||
((z_stream *)http->stream)->next_out = (Bytef *)http->sbuffer;
|
||||
((z_stream *)http->stream)->avail_out = (uInt)_HTTP_MAX_SBUFFER;
|
||||
}
|
||||
while (zerr == Z_OK);
|
||||
|
||||
deflateEnd(&(http->stream));
|
||||
deflateEnd((z_stream *)http->stream);
|
||||
|
||||
free(http->sbuffer);
|
||||
free(http->stream);
|
||||
|
||||
http->sbuffer = NULL;
|
||||
http->stream = NULL;
|
||||
|
||||
if (http->wused)
|
||||
httpFlushWrite(http);
|
||||
@@ -3715,9 +3744,13 @@ http_content_coding_finish(
|
||||
|
||||
case _HTTP_CODING_INFLATE :
|
||||
case _HTTP_CODING_GUNZIP :
|
||||
inflateEnd(&(http->stream));
|
||||
inflateEnd((z_stream *)http->stream);
|
||||
|
||||
free(http->sbuffer);
|
||||
free(http->stream);
|
||||
|
||||
http->sbuffer = NULL;
|
||||
http->stream = NULL;
|
||||
break;
|
||||
|
||||
default :
|
||||
@@ -3787,8 +3820,6 @@ http_content_coding_start(
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&(http->stream), 0, sizeof(http->stream));
|
||||
|
||||
switch (coding)
|
||||
{
|
||||
case _HTTP_CODING_DEFLATE :
|
||||
@@ -3809,18 +3840,30 @@ http_content_coding_start(
|
||||
* documentation.
|
||||
*/
|
||||
|
||||
if ((zerr = deflateInit2(&(http->stream), Z_DEFAULT_COMPRESSION,
|
||||
Z_DEFLATED,
|
||||
coding == _HTTP_CODING_DEFLATE ? -11 : 27, 7,
|
||||
Z_DEFAULT_STRATEGY)) < Z_OK)
|
||||
if ((http->stream = calloc(1, sizeof(z_stream))) == NULL)
|
||||
{
|
||||
free(http->sbuffer);
|
||||
|
||||
http->sbuffer = NULL;
|
||||
http->status = HTTP_STATUS_ERROR;
|
||||
http->error = errno;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((zerr = deflateInit2((z_stream *)http->stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, coding == _HTTP_CODING_DEFLATE ? -11 : 27, 7, Z_DEFAULT_STRATEGY)) < Z_OK)
|
||||
{
|
||||
http->status = HTTP_STATUS_ERROR;
|
||||
http->error = zerr == Z_MEM_ERROR ? ENOMEM : EINVAL;
|
||||
free(http->sbuffer);
|
||||
free(http->stream);
|
||||
|
||||
http->sbuffer = NULL;
|
||||
http->stream = NULL;
|
||||
http->status = HTTP_STATUS_ERROR;
|
||||
http->error = zerr == Z_MEM_ERROR ? ENOMEM : EINVAL;
|
||||
return;
|
||||
}
|
||||
|
||||
http->stream.next_out = (Bytef *)http->sbuffer;
|
||||
http->stream.avail_out = (uInt)_HTTP_MAX_SBUFFER;
|
||||
((z_stream *)http->stream)->next_out = (Bytef *)http->sbuffer;
|
||||
((z_stream *)http->stream)->avail_out = (uInt)_HTTP_MAX_SBUFFER;
|
||||
break;
|
||||
|
||||
case _HTTP_CODING_INFLATE :
|
||||
@@ -3837,19 +3880,30 @@ http_content_coding_start(
|
||||
* -15 is raw inflate, 31 is gunzip, per ZLIB documentation.
|
||||
*/
|
||||
|
||||
if ((zerr = inflateInit2(&(http->stream),
|
||||
coding == _HTTP_CODING_INFLATE ? -15 : 31))
|
||||
< Z_OK)
|
||||
if ((http->stream = calloc(1, sizeof(z_stream))) == NULL)
|
||||
{
|
||||
free(http->sbuffer);
|
||||
|
||||
http->sbuffer = NULL;
|
||||
http->status = HTTP_STATUS_ERROR;
|
||||
http->error = errno;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((zerr = inflateInit2((z_stream *)http->stream, coding == _HTTP_CODING_INFLATE ? -15 : 31)) < Z_OK)
|
||||
{
|
||||
free(http->sbuffer);
|
||||
free(http->stream);
|
||||
|
||||
http->sbuffer = NULL;
|
||||
http->stream = NULL;
|
||||
http->status = HTTP_STATUS_ERROR;
|
||||
http->error = zerr == Z_MEM_ERROR ? ENOMEM : EINVAL;
|
||||
return;
|
||||
}
|
||||
|
||||
http->stream.avail_in = 0;
|
||||
http->stream.next_in = http->sbuffer;
|
||||
((z_stream *)http->stream)->avail_in = 0;
|
||||
((z_stream *)http->stream)->next_in = http->sbuffer;
|
||||
break;
|
||||
|
||||
default :
|
||||
@@ -3915,7 +3969,7 @@ http_create(
|
||||
if ((http = calloc(sizeof(http_t), 1)) == NULL)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0);
|
||||
httpAddrFreeList(addrlist);
|
||||
httpAddrFreeList(myaddrlist);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -4052,7 +4106,7 @@ http_read(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (bytes < 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (WSAGetLastError() != WSAEINTR)
|
||||
{
|
||||
http->error = WSAGetLastError();
|
||||
@@ -4088,7 +4142,7 @@ http_read(http_t *http, /* I - HTTP connection */
|
||||
http->error = errno;
|
||||
return (-1);
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
}
|
||||
while (bytes < 0);
|
||||
@@ -4102,7 +4156,7 @@ http_read(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (bytes < 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (WSAGetLastError() == WSAEINTR)
|
||||
bytes = 0;
|
||||
else
|
||||
@@ -4112,7 +4166,7 @@ http_read(http_t *http, /* I - HTTP connection */
|
||||
bytes = 0;
|
||||
else
|
||||
http->error = errno;
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
else if (bytes == 0)
|
||||
{
|
||||
@@ -4474,7 +4528,7 @@ static void
|
||||
http_set_timeout(int fd, /* I - File descriptor */
|
||||
double timeout) /* I - Timeout in seconds */
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
DWORD tv = (DWORD)(timeout * 1000);
|
||||
/* Timeout in milliseconds */
|
||||
|
||||
@@ -4489,7 +4543,7 @@ http_set_timeout(int fd, /* I - File descriptor */
|
||||
|
||||
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, CUPS_SOCAST &tv, sizeof(tv));
|
||||
setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, CUPS_SOCAST &tv, sizeof(tv));
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -4657,12 +4711,12 @@ http_write(http_t *http, /* I - HTTP connection */
|
||||
|
||||
nfds = select(http->fd + 1, NULL, &output_set, NULL, &timeout);
|
||||
}
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
while (nfds < 0 && (WSAGetLastError() == WSAEINTR ||
|
||||
WSAGetLastError() == WSAEWOULDBLOCK));
|
||||
# else
|
||||
while (nfds < 0 && (errno == EINTR || errno == EAGAIN));
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
#endif /* HAVE_POLL */
|
||||
|
||||
if (nfds < 0)
|
||||
@@ -4672,11 +4726,11 @@ http_write(http_t *http, /* I - HTTP connection */
|
||||
}
|
||||
else if (nfds == 0 && (!http->timeout_cb || !(*http->timeout_cb)(http, http->timeout_data)))
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
http->error = WSAEWOULDBLOCK;
|
||||
#else
|
||||
http->error = EWOULDBLOCK;
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@@ -4695,7 +4749,7 @@ http_write(http_t *http, /* I - HTTP connection */
|
||||
|
||||
if (bytes < 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
if (WSAGetLastError() == WSAEINTR)
|
||||
continue;
|
||||
else if (WSAGetLastError() == WSAEWOULDBLOCK)
|
||||
@@ -4729,7 +4783,7 @@ http_write(http_t *http, /* I - HTTP connection */
|
||||
http->error = errno;
|
||||
continue;
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
DEBUG_printf(("3http_write: error writing data (%s).",
|
||||
strerror(http->error)));
|
||||
|
||||
+66
-125
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Hyper-Text Transport Protocol definitions for CUPS.
|
||||
*
|
||||
* 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_HTTP_H_
|
||||
@@ -19,7 +20,7 @@
|
||||
# include <string.h>
|
||||
# include <time.h>
|
||||
# include <sys/types.h>
|
||||
# ifdef WIN32
|
||||
# ifdef _WIN32
|
||||
# ifndef __CUPS_SSIZE_T_DEFINED
|
||||
# define __CUPS_SSIZE_T_DEFINED
|
||||
/* Windows does not support the ssize_t type, so map it to off_t... */
|
||||
@@ -48,7 +49,7 @@ typedef off_t ssize_t; /* @private@ */
|
||||
# if defined(LOCAL_PEERCRED) && !defined(SO_PEERCRED)
|
||||
# define SO_PEERCRED LOCAL_PEERCRED
|
||||
# endif /* LOCAL_PEERCRED && !SO_PEERCRED */
|
||||
# endif /* WIN32 */
|
||||
# endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -79,7 +80,7 @@ extern "C" {
|
||||
# define s6_addr32 _S6_un._S6_u32
|
||||
# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)|| defined(__DragonFly__)
|
||||
# define s6_addr32 __u6_addr.__u6_addr32
|
||||
# elif defined(WIN32)
|
||||
# elif defined(_WIN32)
|
||||
/*
|
||||
* Windows only defines byte and 16-bit word members of the union and
|
||||
* requires special casing of all raw address code...
|
||||
@@ -175,6 +176,7 @@ typedef enum http_field_e /**** HTTP field names ****/
|
||||
HTTP_FIELD_ACCEPT_ENCODING, /* Accepting-Encoding field @since CUPS 1.7/macOS 10.9@ */
|
||||
HTTP_FIELD_ALLOW, /* Allow field @since CUPS 1.7/macOS 10.9@ */
|
||||
HTTP_FIELD_SERVER, /* Server field @since CUPS 1.7/macOS 10.9@ */
|
||||
HTTP_FIELD_AUTHENTICATION_INFO, /* Authentication-Info field (@since CUPS 2.2.9) */
|
||||
HTTP_FIELD_MAX /* Maximum field index */
|
||||
} http_field_t;
|
||||
|
||||
@@ -448,53 +450,43 @@ typedef int (*http_timeout_cb_t)(http_t *http, void *user_data);
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern void httpBlocking(http_t *http, int b);
|
||||
extern int httpCheck(http_t *http);
|
||||
extern void httpClearFields(http_t *http);
|
||||
extern void httpClose(http_t *http);
|
||||
extern http_t *httpConnect(const char *host, int port)
|
||||
_CUPS_DEPRECATED_1_7_MSG("Use httpConnect2 instead.");
|
||||
extern http_t *httpConnectEncrypt(const char *host, int port,
|
||||
http_encryption_t encryption)
|
||||
_CUPS_DEPRECATED_1_7_MSG("Use httpConnect2 instead.");
|
||||
extern int httpDelete(http_t *http, const char *uri);
|
||||
extern int httpEncryption(http_t *http, http_encryption_t e);
|
||||
extern int httpError(http_t *http);
|
||||
extern void httpFlush(http_t *http);
|
||||
extern int httpGet(http_t *http, const char *uri);
|
||||
extern char *httpGets(char *line, int length, http_t *http);
|
||||
extern const char *httpGetDateString(time_t t);
|
||||
extern time_t httpGetDateTime(const char *s);
|
||||
extern const char *httpGetField(http_t *http, http_field_t field);
|
||||
extern struct hostent *httpGetHostByName(const char *name);
|
||||
extern char *httpGetSubField(http_t *http, http_field_t field,
|
||||
const char *name, char *value);
|
||||
extern int httpHead(http_t *http, const char *uri);
|
||||
extern void httpInitialize(void);
|
||||
extern int httpOptions(http_t *http, const char *uri);
|
||||
extern int httpPost(http_t *http, const char *uri);
|
||||
extern int httpPrintf(http_t *http, const char *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
extern int httpPut(http_t *http, const char *uri);
|
||||
extern void httpBlocking(http_t *http, int b) _CUPS_PUBLIC;
|
||||
extern int httpCheck(http_t *http) _CUPS_PUBLIC;
|
||||
extern void httpClearFields(http_t *http) _CUPS_PUBLIC;
|
||||
extern void httpClose(http_t *http) _CUPS_PUBLIC;
|
||||
extern http_t *httpConnect(const char *host, int port) _CUPS_DEPRECATED_1_7_MSG("Use httpConnect2 instead.");
|
||||
extern http_t *httpConnectEncrypt(const char *host, int port, http_encryption_t encryption) _CUPS_DEPRECATED_1_7_MSG("Use httpConnect2 instead.");
|
||||
extern int httpDelete(http_t *http, const char *uri) _CUPS_PUBLIC;
|
||||
extern int httpEncryption(http_t *http, http_encryption_t e) _CUPS_PUBLIC;
|
||||
extern int httpError(http_t *http) _CUPS_PUBLIC;
|
||||
extern void httpFlush(http_t *http) _CUPS_PUBLIC;
|
||||
extern int httpGet(http_t *http, const char *uri) _CUPS_PUBLIC;
|
||||
extern char *httpGets(char *line, int length, http_t *http) _CUPS_PUBLIC;
|
||||
extern const char *httpGetDateString(time_t t) _CUPS_PUBLIC;
|
||||
extern time_t httpGetDateTime(const char *s) _CUPS_PUBLIC;
|
||||
extern const char *httpGetField(http_t *http, http_field_t field) _CUPS_PUBLIC;
|
||||
extern struct hostent *httpGetHostByName(const char *name) _CUPS_PUBLIC;
|
||||
extern char *httpGetSubField(http_t *http, http_field_t field, const char *name, char *value) _CUPS_PUBLIC;
|
||||
extern int httpHead(http_t *http, const char *uri) _CUPS_PUBLIC;
|
||||
extern void httpInitialize(void) _CUPS_PUBLIC;
|
||||
extern int httpOptions(http_t *http, const char *uri) _CUPS_PUBLIC;
|
||||
extern int httpPost(http_t *http, const char *uri) _CUPS_PUBLIC;
|
||||
extern int httpPrintf(http_t *http, const char *format, ...) _CUPS_FORMAT(2, 3) _CUPS_PUBLIC;
|
||||
extern int httpPut(http_t *http, const char *uri) _CUPS_PUBLIC;
|
||||
extern int httpRead(http_t *http, char *buffer, int length) _CUPS_DEPRECATED_MSG("Use httpRead2 instead.");
|
||||
extern int httpReconnect(http_t *http) _CUPS_DEPRECATED_1_6_MSG("Use httpReconnect2 instead.");
|
||||
extern void httpSeparate(const char *uri, char *method,
|
||||
char *username, char *host, int *port,
|
||||
char *resource) _CUPS_DEPRECATED_MSG("Use httpSeparateURI instead.");
|
||||
extern void httpSetField(http_t *http, http_field_t field,
|
||||
const char *value);
|
||||
extern const char *httpStatus(http_status_t status);
|
||||
extern int httpTrace(http_t *http, const char *uri);
|
||||
extern http_status_t httpUpdate(http_t *http);
|
||||
extern void httpSeparate(const char *uri, char *method, char *username, char *host, int *port, char *resource) _CUPS_DEPRECATED_1_2_MSG("Use httpSeparateURI instead.");
|
||||
extern void httpSetField(http_t *http, http_field_t field, const char *value) _CUPS_PUBLIC;
|
||||
extern const char *httpStatus(http_status_t status) _CUPS_PUBLIC;
|
||||
extern int httpTrace(http_t *http, const char *uri) _CUPS_PUBLIC;
|
||||
extern http_status_t httpUpdate(http_t *http) _CUPS_PUBLIC;
|
||||
extern int httpWrite(http_t *http, const char *buffer, int length) _CUPS_DEPRECATED_MSG("Use httpWrite2 instead.");
|
||||
extern char *httpEncode64(char *out, const char *in) _CUPS_DEPRECATED_MSG("Use httpEncode64_2 instead.");
|
||||
extern char *httpDecode64(char *out, const char *in) _CUPS_DEPRECATED_MSG("Use httpDecode64_2 instead.");
|
||||
extern int httpGetLength(http_t *http) _CUPS_DEPRECATED_MSG("Use httpGetLength2 instead.");
|
||||
extern char *httpMD5(const char *, const char *, const char *,
|
||||
char [33]) _CUPS_DEPRECATED_MSG("Use cupsDoAuth or cupsHashData instead.");
|
||||
extern char *httpMD5Final(const char *, const char *, const char *,
|
||||
char [33]) _CUPS_DEPRECATED_MSG("Use cupsDoAuth or cupsHashData instead.");
|
||||
extern char *httpMD5String(const unsigned char *, char [33]) _CUPS_DEPRECATED_MSG("Use cupsHashString instead.");
|
||||
extern int httpGetLength(http_t *http) _CUPS_DEPRECATED_1_2_MSG("Use httpGetLength2 instead.");
|
||||
extern char *httpMD5(const char *, const char *, const char *, char [33]) _CUPS_DEPRECATED_MSG("Use cupsDoAuth or cupsHashData instead.");
|
||||
extern char *httpMD5Final(const char *, const char *, const char *, char [33]) _CUPS_DEPRECATED_2_2_MSG("Use cupsDoAuth or cupsHashData instead.");
|
||||
extern char *httpMD5String(const unsigned char *, char [33]) _CUPS_DEPRECATED_2_2_MSG("Use cupsHashString instead.");
|
||||
|
||||
/**** New in CUPS 1.1.19 ****/
|
||||
extern void httpClearCookie(http_t *http) _CUPS_API_1_1_19;
|
||||
@@ -504,40 +496,21 @@ extern int httpWait(http_t *http, int msec) _CUPS_API_1_1_19;
|
||||
|
||||
/**** New in CUPS 1.1.21 ****/
|
||||
extern char *httpDecode64_2(char *out, int *outlen, const char *in) _CUPS_API_1_1_21;
|
||||
extern char *httpEncode64_2(char *out, int outlen, const char *in,
|
||||
int inlen) _CUPS_API_1_1_21;
|
||||
extern void httpSeparate2(const char *uri,
|
||||
char *method, int methodlen,
|
||||
char *username, int usernamelen,
|
||||
char *host, int hostlen, int *port,
|
||||
char *resource, int resourcelen) _CUPS_DEPRECATED_MSG("Use httpSeparateURI instead.");
|
||||
extern char *httpEncode64_2(char *out, int outlen, const char *in, int inlen) _CUPS_API_1_1_21;
|
||||
extern void httpSeparate2(const char *uri, char *method, int methodlen, char *username, int usernamelen, char *host, int hostlen, int *port, char *resource, int resourcelen) _CUPS_DEPRECATED_1_2_MSG("Use httpSeparateURI instead.");
|
||||
|
||||
/**** New in CUPS 1.2/macOS 10.5 ****/
|
||||
extern int httpAddrAny(const http_addr_t *addr) _CUPS_API_1_2;
|
||||
extern http_addrlist_t *httpAddrConnect(http_addrlist_t *addrlist, int *sock) _CUPS_API_1_2;
|
||||
extern int httpAddrEqual(const http_addr_t *addr1,
|
||||
const http_addr_t *addr2) _CUPS_API_1_2;
|
||||
extern int httpAddrEqual(const http_addr_t *addr1, const http_addr_t *addr2) _CUPS_API_1_2;
|
||||
extern void httpAddrFreeList(http_addrlist_t *addrlist) _CUPS_API_1_2;
|
||||
extern http_addrlist_t *httpAddrGetList(const char *hostname, int family,
|
||||
const char *service) _CUPS_API_1_2;
|
||||
extern http_addrlist_t *httpAddrGetList(const char *hostname, int family, const char *service) _CUPS_API_1_2;
|
||||
extern int httpAddrLength(const http_addr_t *addr) _CUPS_API_1_2;
|
||||
extern int httpAddrLocalhost(const http_addr_t *addr) _CUPS_API_1_2;
|
||||
extern char *httpAddrLookup(const http_addr_t *addr,
|
||||
char *name, int namelen) _CUPS_API_1_2;
|
||||
extern char *httpAddrString(const http_addr_t *addr,
|
||||
char *s, int slen) _CUPS_API_1_2;
|
||||
extern http_uri_status_t httpAssembleURI(http_uri_coding_t encoding,
|
||||
char *uri, int urilen,
|
||||
const char *scheme,
|
||||
const char *username,
|
||||
const char *host, int port,
|
||||
const char *resource) _CUPS_API_1_2;
|
||||
extern http_uri_status_t httpAssembleURIf(http_uri_coding_t encoding,
|
||||
char *uri, int urilen,
|
||||
const char *scheme,
|
||||
const char *username,
|
||||
const char *host, int port,
|
||||
const char *resourcef, ...) _CUPS_API_1_2;
|
||||
extern char *httpAddrLookup(const http_addr_t *addr, char *name, int namelen) _CUPS_API_1_2;
|
||||
extern char *httpAddrString(const http_addr_t *addr, char *s, int slen) _CUPS_API_1_2;
|
||||
extern http_uri_status_t httpAssembleURI(http_uri_coding_t encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resource) _CUPS_API_1_2;
|
||||
extern http_uri_status_t httpAssembleURIf(http_uri_coding_t encoding, char *uri, int urilen, const char *scheme, const char *username, const char *host, int port, const char *resourcef, ...) _CUPS_FORMAT(8, 9) _CUPS_API_1_2;
|
||||
extern int httpFlushWrite(http_t *http) _CUPS_API_1_2;
|
||||
extern int httpGetBlocking(http_t *http) _CUPS_API_1_2;
|
||||
extern const char *httpGetDateString2(time_t t, char *s, int slen) _CUPS_API_1_2;
|
||||
@@ -545,76 +518,44 @@ extern int httpGetFd(http_t *http) _CUPS_API_1_2;
|
||||
extern const char *httpGetHostname(http_t *http, char *s, int slen) _CUPS_API_1_2;
|
||||
extern off_t httpGetLength2(http_t *http) _CUPS_API_1_2;
|
||||
extern http_status_t httpGetStatus(http_t *http) _CUPS_API_1_2;
|
||||
extern char *httpGetSubField2(http_t *http, http_field_t field,
|
||||
const char *name, char *value,
|
||||
int valuelen) _CUPS_API_1_2;
|
||||
extern char *httpGetSubField2(http_t *http, http_field_t field, const char *name, char *value, int valuelen) _CUPS_API_1_2;
|
||||
extern ssize_t httpRead2(http_t *http, char *buffer, size_t length) _CUPS_API_1_2;
|
||||
extern http_uri_status_t httpSeparateURI(http_uri_coding_t decoding,
|
||||
const char *uri,
|
||||
char *scheme, int schemelen,
|
||||
char *username, int usernamelen,
|
||||
char *host, int hostlen, int *port,
|
||||
char *resource, int resourcelen) _CUPS_API_1_2;
|
||||
extern http_uri_status_t httpSeparateURI(http_uri_coding_t decoding, const char *uri, char *scheme, int schemelen, char *username, int usernamelen, char *host, int hostlen, int *port, char *resource, int resourcelen) _CUPS_API_1_2;
|
||||
extern void httpSetExpect(http_t *http, http_status_t expect) _CUPS_API_1_2;
|
||||
extern void httpSetLength(http_t *http, size_t length) _CUPS_API_1_2;
|
||||
extern ssize_t httpWrite2(http_t *http, const char *buffer,
|
||||
size_t length) _CUPS_API_1_2;
|
||||
extern ssize_t httpWrite2(http_t *http, const char *buffer, size_t length) _CUPS_API_1_2;
|
||||
|
||||
/**** New in CUPS 1.3/macOS 10.5 ****/
|
||||
extern char *httpGetAuthString(http_t *http) _CUPS_API_1_3;
|
||||
extern void httpSetAuthString(http_t *http, const char *scheme,
|
||||
const char *data) _CUPS_API_1_3;
|
||||
extern void httpSetAuthString(http_t *http, const char *scheme, const char *data) _CUPS_API_1_3;
|
||||
|
||||
/**** New in CUPS 1.5/macOS 10.7 ****/
|
||||
extern int httpAddCredential(cups_array_t *credentials,
|
||||
const void *data, size_t datalen)
|
||||
_CUPS_API_1_5;
|
||||
extern int httpCopyCredentials(http_t *http,
|
||||
cups_array_t **credentials)
|
||||
_CUPS_API_1_5;
|
||||
extern int httpAddCredential(cups_array_t *credentials, const void *data, size_t datalen) _CUPS_API_1_5;
|
||||
extern int httpCopyCredentials(http_t *http, cups_array_t **credentials) _CUPS_API_1_5;
|
||||
extern void httpFreeCredentials(cups_array_t *certs) _CUPS_API_1_5;
|
||||
extern int httpSetCredentials(http_t *http, cups_array_t *certs)
|
||||
_CUPS_API_1_5;
|
||||
extern void httpSetTimeout(http_t *http, double timeout,
|
||||
http_timeout_cb_t cb, void *user_data)
|
||||
_CUPS_API_1_5;
|
||||
extern int httpSetCredentials(http_t *http, cups_array_t *certs) _CUPS_API_1_5;
|
||||
extern void httpSetTimeout(http_t *http, double timeout, http_timeout_cb_t cb, void *user_data) _CUPS_API_1_5;
|
||||
|
||||
/**** New in CUPS 1.6/macOS 10.8 ****/
|
||||
extern http_addrlist_t *httpAddrConnect2(http_addrlist_t *addrlist, int *sock,
|
||||
int msec, int *cancel)
|
||||
_CUPS_API_1_6;
|
||||
extern http_addrlist_t *httpAddrConnect2(http_addrlist_t *addrlist, int *sock, int msec, int *cancel) _CUPS_API_1_6;
|
||||
extern http_state_t httpGetState(http_t *http) _CUPS_API_1_6;
|
||||
extern http_version_t httpGetVersion(http_t *http) _CUPS_API_1_6;
|
||||
extern int httpReconnect2(http_t *http, int msec, int *cancel)
|
||||
_CUPS_API_1_6;
|
||||
extern int httpReconnect2(http_t *http, int msec, int *cancel) _CUPS_API_1_6;
|
||||
|
||||
|
||||
/**** New in CUPS 1.7/macOS 10.9 ****/
|
||||
extern http_t *httpAcceptConnection(int fd, int blocking)
|
||||
_CUPS_API_1_7;
|
||||
extern http_t *httpAcceptConnection(int fd, int blocking) _CUPS_API_1_7;
|
||||
extern http_addrlist_t *httpAddrCopyList(http_addrlist_t *src) _CUPS_API_1_7;
|
||||
extern int httpAddrListen(http_addr_t *addr, int port)
|
||||
_CUPS_API_1_7;
|
||||
extern int httpAddrListen(http_addr_t *addr, int port) _CUPS_API_1_7;
|
||||
extern int httpAddrPort(http_addr_t *addr) _CUPS_API_1_7;
|
||||
extern char *httpAssembleUUID(const char *server, int port,
|
||||
const char *name, int number,
|
||||
char *buffer, size_t bufsize)
|
||||
_CUPS_API_1_7;
|
||||
extern http_t *httpConnect2(const char *host, int port,
|
||||
http_addrlist_t *addrlist,
|
||||
int family, http_encryption_t encryption,
|
||||
int blocking, int msec, int *cancel)
|
||||
_CUPS_API_1_7;
|
||||
extern char *httpAssembleUUID(const char *server, int port, const char *name, int number, char *buffer, size_t bufsize) _CUPS_API_1_7;
|
||||
extern http_t *httpConnect2(const char *host, int port, http_addrlist_t *addrlist, int family, http_encryption_t encryption, int blocking, int msec, int *cancel) _CUPS_API_1_7;
|
||||
extern const char *httpGetContentEncoding(http_t *http) _CUPS_API_1_7;
|
||||
extern http_status_t httpGetExpect(http_t *http) _CUPS_API_1_7;
|
||||
extern ssize_t httpPeek(http_t *http, char *buffer, size_t length)
|
||||
_CUPS_API_1_7;
|
||||
extern http_state_t httpReadRequest(http_t *http, char *resource,
|
||||
size_t resourcelen) _CUPS_API_1_7;
|
||||
extern void httpSetDefaultField(http_t *http, http_field_t field,
|
||||
const char *value) _CUPS_API_1_7;
|
||||
extern http_state_t httpWriteResponse(http_t *http,
|
||||
http_status_t status) _CUPS_API_1_7;
|
||||
extern ssize_t httpPeek(http_t *http, char *buffer, size_t length) _CUPS_API_1_7;
|
||||
extern http_state_t httpReadRequest(http_t *http, char *resource, size_t resourcelen) _CUPS_API_1_7;
|
||||
extern void httpSetDefaultField(http_t *http, http_field_t field, const char *value) _CUPS_API_1_7;
|
||||
extern http_state_t httpWriteResponse(http_t *http, http_status_t status) _CUPS_API_1_7;
|
||||
|
||||
/* New in CUPS 2.0/macOS 10.10 */
|
||||
extern int httpAddrClose(http_addr_t *addr, int fd) _CUPS_API_2_0;
|
||||
|
||||
+166
-17
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* IPP data file parsing functions.
|
||||
*
|
||||
* Copyright © 2007-2018 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
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "ipp-private.h"
|
||||
#include "string-private.h"
|
||||
#include "debug-private.h"
|
||||
#include "debug-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
static ipp_t *parse_collection(_ipp_file_t *f, _ipp_vars_t *v, void *user_data);
|
||||
static int parse_value(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, ipp_t *ipp, ipp_attribute_t **attr, int element);
|
||||
static void report_error(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *message, ...) __attribute((__format__ (__printf__, 4, 5)));
|
||||
static void report_error(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *message, ...) _CUPS_FORMAT(4, 5);
|
||||
|
||||
|
||||
/*
|
||||
@@ -217,6 +217,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
* Skip whitespace and comments...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("1_ippFileReadToken: linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp)));
|
||||
|
||||
while ((ch = cupsFileGetChar(f->fp)) != EOF)
|
||||
{
|
||||
if (_cups_isspace(ch))
|
||||
@@ -226,7 +228,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
*/
|
||||
|
||||
if (ch == '\n')
|
||||
{
|
||||
f->linenum ++;
|
||||
DEBUG_printf(("1_ippFileReadToken: LF in leading whitespace, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp)));
|
||||
}
|
||||
}
|
||||
else if (ch == '#')
|
||||
{
|
||||
@@ -234,6 +239,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
* Comment...
|
||||
*/
|
||||
|
||||
DEBUG_puts("1_ippFileReadToken: Skipping comment in leading whitespace...");
|
||||
|
||||
while ((ch = cupsFileGetChar(f->fp)) != EOF)
|
||||
{
|
||||
if (ch == '\n')
|
||||
@@ -241,7 +248,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
}
|
||||
|
||||
if (ch == '\n')
|
||||
{
|
||||
f->linenum ++;
|
||||
DEBUG_printf(("1_ippFileReadToken: LF at end of comment, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp)));
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
@@ -262,7 +272,10 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
while (ch != EOF)
|
||||
{
|
||||
if (ch == '\n')
|
||||
{
|
||||
f->linenum ++;
|
||||
DEBUG_printf(("1_ippFileReadToken: LF in token, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp)));
|
||||
}
|
||||
|
||||
if (ch == quote)
|
||||
{
|
||||
@@ -271,7 +284,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
*/
|
||||
|
||||
*tokptr = '\0';
|
||||
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
|
||||
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" at closing quote.", token));
|
||||
return (1);
|
||||
}
|
||||
else if (!quote && _cups_isspace(ch))
|
||||
@@ -281,7 +294,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
*/
|
||||
|
||||
*tokptr = '\0';
|
||||
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
|
||||
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" before whitespace.", token));
|
||||
return (1);
|
||||
}
|
||||
else if (!quote && (ch == '\'' || ch == '\"'))
|
||||
@@ -290,7 +303,12 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
* Start of quoted text or regular expression...
|
||||
*/
|
||||
|
||||
quote = ch;
|
||||
if (ch == '<')
|
||||
quote = '>';
|
||||
else
|
||||
quote = ch;
|
||||
|
||||
DEBUG_printf(("1_ippFileReadToken: Start of quoted string, quote=%c, pos=%ld", quote, (long)cupsFileTell(f->fp)));
|
||||
}
|
||||
else if (!quote && ch == '#')
|
||||
{
|
||||
@@ -300,7 +318,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
|
||||
cupsFileSeek(f->fp, cupsFileTell(f->fp) - 1);
|
||||
*tokptr = '\0';
|
||||
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
|
||||
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" before comment.", token));
|
||||
return (1);
|
||||
}
|
||||
else if (!quote && (ch == '{' || ch == '}' || ch == ','))
|
||||
@@ -338,6 +356,8 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
* Quoted character...
|
||||
*/
|
||||
|
||||
DEBUG_printf(("1_ippFileReadToken: Quoted character at pos=%ld", (long)cupsFileTell(f->fp)));
|
||||
|
||||
if ((ch = cupsFileGetChar(f->fp)) == EOF)
|
||||
{
|
||||
*token = '\0';
|
||||
@@ -345,7 +365,24 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
return (0);
|
||||
}
|
||||
else if (ch == '\n')
|
||||
{
|
||||
f->linenum ++;
|
||||
DEBUG_printf(("1_ippFileReadToken: quoted LF, linenum=%d, pos=%ld", f->linenum, (long)cupsFileTell(f->fp)));
|
||||
}
|
||||
else if (ch == 'a')
|
||||
ch = '\a';
|
||||
else if (ch == 'b')
|
||||
ch = '\b';
|
||||
else if (ch == 'f')
|
||||
ch = '\f';
|
||||
else if (ch == 'n')
|
||||
ch = '\n';
|
||||
else if (ch == 'r')
|
||||
ch = '\r';
|
||||
else if (ch == 't')
|
||||
ch = '\t';
|
||||
else if (ch == 'v')
|
||||
ch = '\v';
|
||||
}
|
||||
|
||||
if (tokptr < tokend)
|
||||
@@ -376,7 +413,7 @@ _ippFileReadToken(_ipp_file_t *f, /* I - File to read from */
|
||||
}
|
||||
|
||||
*tokptr = '\0';
|
||||
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\".", token));
|
||||
DEBUG_printf(("1_ippFileReadToken: Returning \"%s\" at EOF.", token));
|
||||
|
||||
return (tokptr > token);
|
||||
}
|
||||
@@ -425,14 +462,14 @@ parse_collection(
|
||||
|
||||
if (!_ippFileReadToken(f, syntax, sizeof(syntax)))
|
||||
{
|
||||
report_error(f, v, user_data, "Missing ATTR syntax on line %d of \"%s\".", f->linenum, f->filename);
|
||||
report_error(f, v, user_data, "Missing MEMBER syntax on line %d of \"%s\".", f->linenum, f->filename);
|
||||
ippDelete(col);
|
||||
col = NULL;
|
||||
break;
|
||||
}
|
||||
else if ((value_tag = ippTagValue(syntax)) < IPP_TAG_UNSUPPORTED_VALUE)
|
||||
{
|
||||
report_error(f, v, user_data, "Bad ATTR syntax \"%s\" on line %d of \"%s\".", syntax, f->linenum, f->filename);
|
||||
report_error(f, v, user_data, "Bad MEMBER syntax \"%s\" on line %d of \"%s\".", syntax, f->linenum, f->filename);
|
||||
ippDelete(col);
|
||||
col = NULL;
|
||||
break;
|
||||
@@ -440,7 +477,7 @@ parse_collection(
|
||||
|
||||
if (!_ippFileReadToken(f, name, sizeof(name)) || !name[0])
|
||||
{
|
||||
report_error(f, v, user_data, "Missing ATTR name on line %d of \"%s\".", f->linenum, f->filename);
|
||||
report_error(f, v, user_data, "Missing MEMBER name on line %d of \"%s\".", f->linenum, f->filename);
|
||||
ippDelete(col);
|
||||
col = NULL;
|
||||
break;
|
||||
@@ -515,8 +552,11 @@ parse_value(_ipp_file_t *f, /* I - IPP data file */
|
||||
ipp_attribute_t **attr, /* IO - IPP attribute */
|
||||
int element) /* I - Element number */
|
||||
{
|
||||
char value[1024], /* Value string */
|
||||
temp[1024]; /* Temporary string */
|
||||
char value[2049], /* Value string */
|
||||
*valueptr, /* Pointer into value string */
|
||||
temp[2049], /* Temporary string */
|
||||
*tempptr; /* Pointer into temporary string */
|
||||
size_t valuelen; /* Length of value */
|
||||
|
||||
|
||||
if (!_ippFileReadToken(f, temp, sizeof(temp)))
|
||||
@@ -549,8 +589,80 @@ parse_value(_ipp_file_t *f, /* I - IPP data file */
|
||||
utc_offset = 0; /* Timezone offset from UTC */
|
||||
ipp_uchar_t date[11]; /* dateTime value */
|
||||
|
||||
if (sscanf(value, "%d-%d-%dT%d:%d:%d%d", &year, &month, &day, &hour, &minute, &second, &utc_offset) < 6)
|
||||
if (*value == 'P')
|
||||
{
|
||||
/*
|
||||
* Time period...
|
||||
*/
|
||||
|
||||
time_t curtime; /* Current time in seconds */
|
||||
int period = 0, /* Current period value */
|
||||
saw_T = 0; /* Saw time separator */
|
||||
|
||||
curtime = time(NULL);
|
||||
|
||||
for (valueptr = value + 1; *valueptr; valueptr ++)
|
||||
{
|
||||
if (isdigit(*valueptr & 255))
|
||||
{
|
||||
period = (int)strtol(valueptr, &valueptr, 10);
|
||||
|
||||
if (!valueptr || period < 0)
|
||||
{
|
||||
report_error(f, v, user_data, "Bad dateTime value \"%s\" on line %d of \"%s\".", value, f->linenum, f->filename);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
if (*valueptr == 'Y')
|
||||
{
|
||||
curtime += 365 * 86400 * period;
|
||||
period = 0;
|
||||
}
|
||||
else if (*valueptr == 'M')
|
||||
{
|
||||
if (saw_T)
|
||||
curtime += 60 * period;
|
||||
else
|
||||
curtime += 30 * 86400 * period;
|
||||
|
||||
period = 0;
|
||||
}
|
||||
else if (*valueptr == 'D')
|
||||
{
|
||||
curtime += 86400 * period;
|
||||
period = 0;
|
||||
}
|
||||
else if (*valueptr == 'H')
|
||||
{
|
||||
curtime += 3600 * period;
|
||||
period = 0;
|
||||
}
|
||||
else if (*valueptr == 'S')
|
||||
{
|
||||
curtime += period;
|
||||
period = 0;
|
||||
}
|
||||
else if (*valueptr == 'T')
|
||||
{
|
||||
saw_T = 1;
|
||||
period = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
report_error(f, v, user_data, "Bad dateTime value \"%s\" on line %d of \"%s\".", value, f->linenum, f->filename);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
return (ippSetDate(ipp, attr, element, ippTimeToDate(curtime)));
|
||||
}
|
||||
else if (sscanf(value, "%d-%d-%dT%d:%d:%d%d", &year, &month, &day, &hour, &minute, &second, &utc_offset) < 6)
|
||||
{
|
||||
/*
|
||||
* Date/time value did not parse...
|
||||
*/
|
||||
|
||||
report_error(f, v, user_data, "Bad dateTime value \"%s\" on line %d of \"%s\".", value, f->linenum, f->filename);
|
||||
return (0);
|
||||
}
|
||||
@@ -624,7 +736,44 @@ parse_value(_ipp_file_t *f, /* I - IPP data file */
|
||||
break;
|
||||
|
||||
case IPP_TAG_STRING :
|
||||
return (ippSetOctetString(ipp, attr, element, value, (int)strlen(value)));
|
||||
valuelen = strlen(value);
|
||||
|
||||
if (value[0] == '<' && value[strlen(value) - 1] == '>')
|
||||
{
|
||||
if (valuelen & 1)
|
||||
{
|
||||
report_error(f, v, user_data, "Bad octetString value on line %d of \"%s\".", f->linenum, f->filename);
|
||||
return (0);
|
||||
}
|
||||
|
||||
valueptr = value + 1;
|
||||
tempptr = temp;
|
||||
|
||||
while (*valueptr && *valueptr != '>')
|
||||
{
|
||||
if (!isxdigit(valueptr[0] & 255) || !isxdigit(valueptr[1] & 255))
|
||||
{
|
||||
report_error(f, v, user_data, "Bad octetString value on line %d of \"%s\".", f->linenum, f->filename);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (valueptr[0] >= '0' && valueptr[0] <= '9')
|
||||
*tempptr = (char)((valueptr[0] - '0') << 4);
|
||||
else
|
||||
*tempptr = (char)((tolower(valueptr[0]) - 'a' + 10) << 4);
|
||||
|
||||
if (valueptr[1] >= '0' && valueptr[1] <= '9')
|
||||
*tempptr |= (valueptr[1] - '0');
|
||||
else
|
||||
*tempptr |= (tolower(valueptr[1]) - 'a' + 10);
|
||||
|
||||
tempptr ++;
|
||||
}
|
||||
|
||||
return (ippSetOctetString(ipp, attr, element, temp, (int)(tempptr - temp)));
|
||||
}
|
||||
else
|
||||
return (ippSetOctetString(ipp, attr, element, value, (int)valuelen));
|
||||
break;
|
||||
|
||||
case IPP_TAG_TEXTLANG :
|
||||
@@ -647,7 +796,7 @@ parse_value(_ipp_file_t *f, /* I - IPP data file */
|
||||
|
||||
if (strcmp(value, "{"))
|
||||
{
|
||||
report_error(f, v, user_data, "Bad ATTR collection value on line %d of \"%s\".", f->linenum, f->filename);
|
||||
report_error(f, v, user_data, "Bad collection value on line %d of \"%s\".", f->linenum, f->filename);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -662,7 +811,7 @@ parse_value(_ipp_file_t *f, /* I - IPP data file */
|
||||
break;
|
||||
|
||||
default :
|
||||
report_error(f, v, user_data, "Unsupported ATTR value on line %d of \"%s\".", f->linenum, f->filename);
|
||||
report_error(f, v, user_data, "Unsupported value on line %d of \"%s\".", f->linenum, f->filename);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -192,21 +192,21 @@ struct _ipp_file_s /**** File Parser */
|
||||
|
||||
/* encode.c */
|
||||
#ifdef DEBUG
|
||||
extern const char *_ippCheckOptions(void);
|
||||
extern const char *_ippCheckOptions(void) _CUPS_PRIVATE;
|
||||
#endif /* DEBUG */
|
||||
extern _ipp_option_t *_ippFindOption(const char *name);
|
||||
extern _ipp_option_t *_ippFindOption(const char *name) _CUPS_PRIVATE;
|
||||
|
||||
/* ipp-file.c */
|
||||
extern ipp_t *_ippFileParse(_ipp_vars_t *v, const char *filename, void *user_data);
|
||||
extern int _ippFileReadToken(_ipp_file_t *f, char *token, size_t tokensize);
|
||||
extern ipp_t *_ippFileParse(_ipp_vars_t *v, const char *filename, void *user_data) _CUPS_PRIVATE;
|
||||
extern int _ippFileReadToken(_ipp_file_t *f, char *token, size_t tokensize) _CUPS_PRIVATE;
|
||||
|
||||
/* ipp-vars.c */
|
||||
extern void _ippVarsDeinit(_ipp_vars_t *v);
|
||||
extern void _ippVarsExpand(_ipp_vars_t *v, char *dst, const char *src, size_t dstsize) __attribute__((nonnull(1,2,3)));
|
||||
extern const char *_ippVarsGet(_ipp_vars_t *v, const char *name);
|
||||
extern void _ippVarsInit(_ipp_vars_t *v, _ipp_fattr_cb_t attrcb, _ipp_ferror_cb_t errorcb, _ipp_ftoken_cb_t tokencb);
|
||||
extern const char *_ippVarsPasswordCB(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data);
|
||||
extern int _ippVarsSet(_ipp_vars_t *v, const char *name, const char *value);
|
||||
extern void _ippVarsDeinit(_ipp_vars_t *v) _CUPS_PRIVATE;
|
||||
extern void _ippVarsExpand(_ipp_vars_t *v, char *dst, const char *src, size_t dstsize) _CUPS_NONNULL(1,2,3) _CUPS_PRIVATE;
|
||||
extern const char *_ippVarsGet(_ipp_vars_t *v, const char *name) _CUPS_PRIVATE;
|
||||
extern void _ippVarsInit(_ipp_vars_t *v, _ipp_fattr_cb_t attrcb, _ipp_ferror_cb_t errorcb, _ipp_ftoken_cb_t tokencb) _CUPS_PRIVATE;
|
||||
extern const char *_ippVarsPasswordCB(const char *prompt, http_t *http, const char *method, const char *resource, void *user_data) _CUPS_PRIVATE;
|
||||
extern int _ippVarsSet(_ipp_vars_t *v, const char *name, const char *value) _CUPS_PRIVATE;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+372
-226
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -138,117 +139,117 @@ static const char * const ipp_std_ops[] =
|
||||
/* 0x0000 - 0x000f */
|
||||
"0x0000",
|
||||
"0x0001",
|
||||
"Print-Job",
|
||||
"Print-URI",
|
||||
"Validate-Job",
|
||||
"Create-Job",
|
||||
"Send-Document",
|
||||
"Send-URI",
|
||||
"Cancel-Job",
|
||||
"Get-Job-Attributes",
|
||||
"Get-Jobs",
|
||||
"Get-Printer-Attributes",
|
||||
"Hold-Job",
|
||||
"Release-Job",
|
||||
"Restart-Job",
|
||||
"Print-Job", /* RFC 8011 */
|
||||
"Print-URI", /* RFC 8011 */
|
||||
"Validate-Job", /* RFC 8011 */
|
||||
"Create-Job", /* RFC 8011 */
|
||||
"Send-Document", /* RFC 8011 */
|
||||
"Send-URI", /* RFC 8011 */
|
||||
"Cancel-Job", /* RFC 8011 */
|
||||
"Get-Job-Attributes", /* RFC 8011 */
|
||||
"Get-Jobs", /* RFC 8011 */
|
||||
"Get-Printer-Attributes", /* RFC 8011 */
|
||||
"Hold-Job", /* RFC 8011 */
|
||||
"Release-Job", /* RFC 8011 */
|
||||
"Restart-Job", /* RFC 8011 */
|
||||
"0x000f",
|
||||
|
||||
/* 0x0010 - 0x001f */
|
||||
"Pause-Printer",
|
||||
"Resume-Printer",
|
||||
"Purge-Jobs",
|
||||
"Set-Printer-Attributes",
|
||||
"Set-Job-Attributes",
|
||||
"Get-Printer-Supported-Values",
|
||||
"Create-Printer-Subscriptions",
|
||||
"Create-Job-Subscriptions",
|
||||
"Get-Subscription-Attributes",
|
||||
"Get-Subscriptions",
|
||||
"Renew-Subscription",
|
||||
"Cancel-Subscription",
|
||||
"Get-Notifications",
|
||||
"Pause-Printer", /* RFC 8011 */
|
||||
"Resume-Printer", /* RFC 8011 */
|
||||
"Purge-Jobs", /* RFC 8011 */
|
||||
"Set-Printer-Attributes", /* RFC 3380 */
|
||||
"Set-Job-Attributes", /* RFC 3380 */
|
||||
"Get-Printer-Supported-Values", /* RFC 3380 */
|
||||
"Create-Printer-Subscriptions", /* RFC 3995 */
|
||||
"Create-Job-Subscriptions", /* RFC 3995 */
|
||||
"Get-Subscription-Attributes", /* RFC 3995 */
|
||||
"Get-Subscriptions", /* RFC 3995 */
|
||||
"Renew-Subscription", /* RFC 3995 */
|
||||
"Cancel-Subscription", /* RFC 3995 */
|
||||
"Get-Notifications", /* RFC 3996 */
|
||||
"(Send-Notifications)",
|
||||
"(Get-Resource-Attributes)",
|
||||
"Get-Resource-Attributes", /* IPP System */
|
||||
"(Get-Resource-Data)",
|
||||
|
||||
/* 0x0020 - 0x002f */
|
||||
"(Get-Resources)",
|
||||
"Get-Resources", /* IPP System */
|
||||
"(Get-Printer-Support-Files)",
|
||||
"Enable-Printer",
|
||||
"Disable-Printer",
|
||||
"Pause-Printer-After-Current-Job",
|
||||
"Hold-New-Jobs",
|
||||
"Release-Held-New-Jobs",
|
||||
"Deactivate-Printer",
|
||||
"Activate-Printer",
|
||||
"Restart-Printer",
|
||||
"Shutdown-Printer",
|
||||
"Startup-Printer",
|
||||
"Reprocess-Job",
|
||||
"Cancel-Current-Job",
|
||||
"Suspend-Current-Job",
|
||||
"Resume-Job",
|
||||
"Enable-Printer", /* RFC 3998 */
|
||||
"Disable-Printer", /* RFC 3998 */
|
||||
"Pause-Printer-After-Current-Job", /* RFC 3998 */
|
||||
"Hold-New-Jobs", /* RFC 3998 */
|
||||
"Release-Held-New-Jobs", /* RFC 3998 */
|
||||
"Deactivate-Printer", /* RFC 3998 */
|
||||
"Activate-Printer", /* RFC 3998 */
|
||||
"Restart-Printer", /* RFC 3998 */
|
||||
"Shutdown-Printer", /* RFC 3998 */
|
||||
"Startup-Printer", /* RFC 3998 */
|
||||
"Reprocess-Job", /* RFC 3998 */
|
||||
"Cancel-Current-Job", /* RFC 3998 */
|
||||
"Suspend-Current-Job", /* RFC 3998 */
|
||||
"Resume-Job", /* RFC 3998 */
|
||||
|
||||
/* 0x0030 - 0x003f */
|
||||
"Promote-Job",
|
||||
"Schedule-Job-After",
|
||||
"Promote-Job", /* RFC 3998 */
|
||||
"Schedule-Job-After", /* RFC 3998 */
|
||||
"0x0032",
|
||||
"Cancel-Document",
|
||||
"Get-Document-Attributes",
|
||||
"Get-Documents",
|
||||
"Delete-Document",
|
||||
"Set-Document-Attributes",
|
||||
"Cancel-Jobs",
|
||||
"Cancel-My-Jobs",
|
||||
"Resubmit-Job",
|
||||
"Close-Job",
|
||||
"Identify-Printer",
|
||||
"Validate-Document",
|
||||
"Add-Document-Images",
|
||||
"Acknowledge-Document",
|
||||
"Cancel-Document", /* IPP DocObject */
|
||||
"Get-Document-Attributes", /* IPP DocObject */
|
||||
"Get-Documents", /* IPP DocObject */
|
||||
"Delete-Document", /* IPP DocObject */
|
||||
"Set-Document-Attributes", /* IPP DocObject */
|
||||
"Cancel-Jobs", /* IPP JPS2 */
|
||||
"Cancel-My-Jobs", /* IPP JPS2 */
|
||||
"Resubmit-Job", /* IPP JPS2 */
|
||||
"Close-Job", /* IPP JPS2 */
|
||||
"Identify-Printer", /* IPP JPS3 */
|
||||
"Validate-Document", /* IPP JPS3 */
|
||||
"Add-Document-Images", /* IPP Scan */
|
||||
"Acknowledge-Document", /* IPP INFRA */
|
||||
|
||||
/* 0x0040 - 0x004f */
|
||||
"Acknowledge-Identify-Printer",
|
||||
"Acknowledge-Job",
|
||||
"Fetch-Document",
|
||||
"Fetch-Job",
|
||||
"Get-Output-Device-Attributes",
|
||||
"Update-Active-Jobs",
|
||||
"Deregister-Output-Device",
|
||||
"Update-Document-Status",
|
||||
"Update-Job-Status",
|
||||
"Update-Output-Device-Attributes",
|
||||
"Get-Next-Document-Data",
|
||||
"Allocate-Printer-Resources",
|
||||
"Create-Printer",
|
||||
"Deallocate-Printer-Resources",
|
||||
"Delete-Printer",
|
||||
"Get-Printers",
|
||||
"Acknowledge-Identify-Printer", /* IPP INFRA */
|
||||
"Acknowledge-Job", /* IPP INFRA */
|
||||
"Fetch-Document", /* IPP INFRA */
|
||||
"Fetch-Job", /* IPP INFRA */
|
||||
"Get-Output-Device-Attributes", /* IPP INFRA */
|
||||
"Update-Active-Jobs", /* IPP INFRA */
|
||||
"Deregister-Output-Device", /* IPP INFRA */
|
||||
"Update-Document-Status", /* IPP INFRA */
|
||||
"Update-Job-Status", /* IPP INFRA */
|
||||
"Update-Output-Device-Attributes", /* IPP INFRA */
|
||||
"Get-Next-Document-Data", /* IPP Scan */
|
||||
"Allocate-Printer-Resources", /* IPP System */
|
||||
"Create-Printer", /* IPP System */
|
||||
"Deallocate-Printer-Resources", /* IPP System */
|
||||
"Delete-Printer", /* IPP System */
|
||||
"Get-Printers", /* IPP System */
|
||||
|
||||
/* 0x0050 - 0x005f */
|
||||
"Shutdown-One-Printer",
|
||||
"Startup-One-Printer",
|
||||
"Cancel-Resource",
|
||||
"Create-Resource",
|
||||
"Install-Resource",
|
||||
"Send-Resource-Data",
|
||||
"Set-Resource-Attributes",
|
||||
"Create-Resource-Subscriptions",
|
||||
"Create-System-Subscriptions",
|
||||
"Disable-All-Printers",
|
||||
"Enable-All-Printers",
|
||||
"Get-System-Attributes",
|
||||
"Get-System-Supported-Values",
|
||||
"Pause-All-Printers",
|
||||
"Pause-All-Printers-After-Current-Job",
|
||||
"Register-Output-Device",
|
||||
"Shutdown-One-Printer", /* IPP System */
|
||||
"Startup-One-Printer", /* IPP System */
|
||||
"Cancel-Resource", /* IPP System */
|
||||
"Create-Resource", /* IPP System */
|
||||
"Install-Resource", /* IPP System */
|
||||
"Send-Resource-Data", /* IPP System */
|
||||
"Set-Resource-Attributes", /* IPP System */
|
||||
"Create-Resource-Subscriptions", /* IPP System */
|
||||
"Create-System-Subscriptions", /* IPP System */
|
||||
"Disable-All-Printers", /* IPP System */
|
||||
"Enable-All-Printers", /* IPP System */
|
||||
"Get-System-Attributes", /* IPP System */
|
||||
"Get-System-Supported-Values", /* IPP System */
|
||||
"Pause-All-Printers", /* IPP System */
|
||||
"Pause-All-Printers-After-Current-Job", /* IPP System */
|
||||
"Register-Output-Device", /* IPP System */
|
||||
|
||||
/* 0x0060 - 0x0064 */
|
||||
"Restart-System",
|
||||
"Resume-All-Printers",
|
||||
"Set-System-Attributes",
|
||||
"Shutdown-All-Printers",
|
||||
"Startup-All-Printers"
|
||||
"Restart-System", /* IPP System */
|
||||
"Resume-All-Printers", /* IPP System */
|
||||
"Set-System-Attributes", /* IPP System */
|
||||
"Shutdown-All-Printers", /* IPP System */
|
||||
"Startup-All-Printers" /* IPP System */
|
||||
},
|
||||
* const ipp_cups_ops[] =
|
||||
{
|
||||
@@ -286,14 +287,15 @@ static const char * const ipp_std_ops[] =
|
||||
"unsupported-attributes-tag",
|
||||
/* 0x05 */
|
||||
"subscription-attributes-tag",
|
||||
/* 0x06 */
|
||||
/* 0x06 - RFC 3995 */
|
||||
"event-notification-attributes-tag",
|
||||
/* 0x07 */
|
||||
"(resource-attributes-tag)",
|
||||
/* 0x08 */
|
||||
/* 0x07 - RFC 3995 */
|
||||
"resource-attributes-tag",
|
||||
/* 0x08 - IPP System */
|
||||
"document-attributes-tag",
|
||||
/* 0x09 */
|
||||
"0x0a", /* 0x0a */
|
||||
/* 0x09 - IPP DocObject */
|
||||
"system-attributes-tag",
|
||||
/* 0x0a - IPP System */
|
||||
"0x0b", /* 0x0b */
|
||||
"0x0c", /* 0x0c */
|
||||
"0x0d", /* 0x0d */
|
||||
@@ -304,9 +306,9 @@ static const char * const ipp_std_ops[] =
|
||||
"unknown", /* 0x12 */
|
||||
"no-value", /* 0x13 */
|
||||
"0x14", /* 0x14 */
|
||||
"not-settable", /* 0x15 */
|
||||
"delete-attribute", /* 0x16 */
|
||||
"admin-define", /* 0x17 */
|
||||
"not-settable", /* 0x15 - RFC 3380 */
|
||||
"delete-attribute", /* 0x16 - RFC 3380 */
|
||||
"admin-define", /* 0x17 - RFC 3380 */
|
||||
"0x18", /* 0x18 */
|
||||
"0x19", /* 0x19 */
|
||||
"0x1a", /* 0x1a */
|
||||
@@ -364,7 +366,7 @@ static const char * const ipp_document_states[] =
|
||||
"pending",
|
||||
"4",
|
||||
"processing",
|
||||
"processing-stopped", /* IPPSIX */
|
||||
"processing-stopped", /* IPP INFRA */
|
||||
"canceled",
|
||||
"aborted",
|
||||
"completed"
|
||||
@@ -383,8 +385,8 @@ static const char * const ipp_document_states[] =
|
||||
"bale",
|
||||
"booklet-maker",
|
||||
"jog-offset",
|
||||
"coat", /* Finishings 2.0 */
|
||||
"laminate", /* Finishings 2.0 */
|
||||
"coat", /* IPP Finishings 2.0 */
|
||||
"laminate", /* IPP Finishings 2.0 */
|
||||
"17",
|
||||
"18",
|
||||
"19",
|
||||
@@ -400,10 +402,10 @@ static const char * const ipp_document_states[] =
|
||||
"staple-dual-top",
|
||||
"staple-dual-right",
|
||||
"staple-dual-bottom",
|
||||
"staple-triple-left", /* Finishings 2.0 */
|
||||
"staple-triple-top", /* Finishings 2.0 */
|
||||
"staple-triple-right",/* Finishings 2.0 */
|
||||
"staple-triple-bottom",/* Finishings 2.0 */
|
||||
"staple-triple-left", /* IPP Finishings 2.0 */
|
||||
"staple-triple-top", /* IPP Finishings 2.0 */
|
||||
"staple-triple-right",/* IPP Finishings 2.0 */
|
||||
"staple-triple-bottom",/* IPP Finishings 2.0 */
|
||||
"36",
|
||||
"37",
|
||||
"38",
|
||||
@@ -438,38 +440,38 @@ static const char * const ipp_document_states[] =
|
||||
"67",
|
||||
"68",
|
||||
"69",
|
||||
"punch-top-left", /* Finishings 2.0 */
|
||||
"punch-bottom-left", /* Finishings 2.0 */
|
||||
"punch-top-right", /* Finishings 2.0 */
|
||||
"punch-bottom-right", /* Finishings 2.0 */
|
||||
"punch-dual-left", /* Finishings 2.0 */
|
||||
"punch-dual-top", /* Finishings 2.0 */
|
||||
"punch-dual-right", /* Finishings 2.0 */
|
||||
"punch-dual-bottom", /* Finishings 2.0 */
|
||||
"punch-triple-left", /* Finishings 2.0 */
|
||||
"punch-triple-top", /* Finishings 2.0 */
|
||||
"punch-triple-right", /* Finishings 2.0 */
|
||||
"punch-triple-bottom",/* Finishings 2.0 */
|
||||
"punch-quad-left", /* Finishings 2.0 */
|
||||
"punch-quad-top", /* Finishings 2.0 */
|
||||
"punch-quad-right", /* Finishings 2.0 */
|
||||
"punch-quad-bottom", /* Finishings 2.0 */
|
||||
"punch-multiple-left",/* Finishings 2.1/Canon */
|
||||
"punch-multiple-top", /* Finishings 2.1/Canon */
|
||||
"punch-multiple-right",/* Finishings 2.1/Canon */
|
||||
"punch-multiple-bottom",/* Finishings 2.1/Canon */
|
||||
"fold-accordian", /* Finishings 2.0 */
|
||||
"fold-double-gate", /* Finishings 2.0 */
|
||||
"fold-gate", /* Finishings 2.0 */
|
||||
"fold-half", /* Finishings 2.0 */
|
||||
"fold-half-z", /* Finishings 2.0 */
|
||||
"fold-left-gate", /* Finishings 2.0 */
|
||||
"fold-letter", /* Finishings 2.0 */
|
||||
"fold-parallel", /* Finishings 2.0 */
|
||||
"fold-poster", /* Finishings 2.0 */
|
||||
"fold-right-gate", /* Finishings 2.0 */
|
||||
"fold-z", /* Finishings 2.0 */
|
||||
"fold-engineering-z" /* Finishings 2.1 */
|
||||
"punch-top-left", /* IPP Finishings 2.0 */
|
||||
"punch-bottom-left", /* IPP Finishings 2.0 */
|
||||
"punch-top-right", /* IPP Finishings 2.0 */
|
||||
"punch-bottom-right", /* IPP Finishings 2.0 */
|
||||
"punch-dual-left", /* IPP Finishings 2.0 */
|
||||
"punch-dual-top", /* IPP Finishings 2.0 */
|
||||
"punch-dual-right", /* IPP Finishings 2.0 */
|
||||
"punch-dual-bottom", /* IPP Finishings 2.0 */
|
||||
"punch-triple-left", /* IPP Finishings 2.0 */
|
||||
"punch-triple-top", /* IPP Finishings 2.0 */
|
||||
"punch-triple-right", /* IPP Finishings 2.0 */
|
||||
"punch-triple-bottom",/* IPP Finishings 2.0 */
|
||||
"punch-quad-left", /* IPP Finishings 2.0 */
|
||||
"punch-quad-top", /* IPP Finishings 2.0 */
|
||||
"punch-quad-right", /* IPP Finishings 2.0 */
|
||||
"punch-quad-bottom", /* IPP Finishings 2.0 */
|
||||
"punch-multiple-left",/* IPP Finishings 2.1/Canon */
|
||||
"punch-multiple-top", /* IPP Finishings 2.1/Canon */
|
||||
"punch-multiple-right",/* IPP Finishings 2.1/Canon */
|
||||
"punch-multiple-bottom",/* IPP Finishings 2.1/Canon */
|
||||
"fold-accordion", /* IPP Finishings 2.0 */
|
||||
"fold-double-gate", /* IPP Finishings 2.0 */
|
||||
"fold-gate", /* IPP Finishings 2.0 */
|
||||
"fold-half", /* IPP Finishings 2.0 */
|
||||
"fold-half-z", /* IPP Finishings 2.0 */
|
||||
"fold-left-gate", /* IPP Finishings 2.0 */
|
||||
"fold-letter", /* IPP Finishings 2.0 */
|
||||
"fold-parallel", /* IPP Finishings 2.0 */
|
||||
"fold-poster", /* IPP Finishings 2.0 */
|
||||
"fold-right-gate", /* IPP Finishings 2.0 */
|
||||
"fold-z", /* IPP Finishings 2.0 */
|
||||
"fold-engineering-z" /* IPP Finishings 2.1 */
|
||||
},
|
||||
* const ipp_finishings_vendor[] =
|
||||
{
|
||||
@@ -569,7 +571,7 @@ static const char * const ipp_document_states[] =
|
||||
"0x40000057",
|
||||
"0x40000058",
|
||||
"0x40000059",
|
||||
"cups-fold-accordian",
|
||||
"cups-fold-accordion",
|
||||
"cups-fold-double-gate",
|
||||
"cups-fold-gate",
|
||||
"cups-fold-half",
|
||||
@@ -616,7 +618,21 @@ static const char * const ipp_document_states[] =
|
||||
{ /* printer-state enums */
|
||||
"idle",
|
||||
"processing",
|
||||
"stopped",
|
||||
"stopped"
|
||||
},
|
||||
* const ipp_resource_states[] =
|
||||
{ /* resource-state enums */
|
||||
"pending",
|
||||
"available",
|
||||
"installed",
|
||||
"canceled",
|
||||
"aborted"
|
||||
},
|
||||
* const ipp_system_states[] =
|
||||
{ /* system-state enums */
|
||||
"idle",
|
||||
"processing",
|
||||
"stopped"
|
||||
};
|
||||
|
||||
|
||||
@@ -874,6 +890,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
int i, j, /* Looping vars */
|
||||
count, /* Number of values */
|
||||
added; /* Was name added? */
|
||||
ipp_op_t op; /* IPP operation code */
|
||||
ipp_attribute_t *requested; /* requested-attributes attribute */
|
||||
cups_array_t *ra; /* Requested attributes array */
|
||||
const char *value; /* Current value */
|
||||
@@ -909,7 +926,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"document-state-message",
|
||||
"document-state-reasons",
|
||||
"document-uri",
|
||||
"document-uuid",
|
||||
"document-uuid", /* IPP JPS3 */
|
||||
"errors-count",
|
||||
"finishings-actual",
|
||||
"finishings-col-actual",
|
||||
@@ -977,6 +994,12 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
};
|
||||
static const char * const document_template[] =
|
||||
{ /* document-template group */
|
||||
"chamber-humidity", /* IPP 3D */
|
||||
"chamber-humidity-default", /* IPP 3D */
|
||||
"chamber-humidity-supported", /* IPP 3D */
|
||||
"chamber-temperature", /* IPP 3D */
|
||||
"chamber-temperature-default", /* IPP 3D */
|
||||
"chamber-temperature-supported", /* IPP 3D */
|
||||
"copies",
|
||||
"copies-default",
|
||||
"copies-supported",
|
||||
@@ -1168,6 +1191,8 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
};
|
||||
static const char * const job_description[] =
|
||||
{ /* job-description group */
|
||||
"chamber-humidity-actual", /* IPP 3D */
|
||||
"chamber-temperature-actual", /* IPP 3D */
|
||||
"compression-supplied",
|
||||
"copies-actual",
|
||||
"cover-back-actual",
|
||||
@@ -1227,7 +1252,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"job-name",
|
||||
"job-originating-host-name", /* CUPS extension */
|
||||
"job-originating-user-name",
|
||||
"job-originating-user-uri",
|
||||
"job-originating-user-uri", /* IPP JPS3 */
|
||||
"job-pages",
|
||||
"job-pages-col",
|
||||
"job-pages-completed",
|
||||
@@ -1238,6 +1263,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"job-printer-up-time",
|
||||
"job-printer-uri",
|
||||
"job-priority-actual",
|
||||
"job-resource-ids", /* IPP System */
|
||||
"job-save-printer-make-and-model",
|
||||
"job-sheet-message-actual",
|
||||
"job-sheets-actual",
|
||||
@@ -1246,7 +1272,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"job-state-message",
|
||||
"job-state-reasons",
|
||||
"job-uri",
|
||||
"job-uuid",
|
||||
"job-uuid", /* IPP JPS3 */
|
||||
"materials-col-actual", /* IPP 3D */
|
||||
"media-actual",
|
||||
"media-col-actual",
|
||||
@@ -1260,6 +1286,10 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"original-requesting-user-name",
|
||||
"output-bin-actual",
|
||||
"output-device-assigned",
|
||||
"output-device-job-state", /* IPP INFRA */
|
||||
"output-device-job-state-message", /* IPP INFRA */
|
||||
"output-device-job-state-reasons", /* IPP INFRA */
|
||||
"output-device-uuid-assigned", /* IPP INFRA */
|
||||
"overrides-actual",
|
||||
"page-delivery-actual",
|
||||
"page-order-received-actual",
|
||||
@@ -1297,6 +1327,12 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
static const char * const job_template[] =
|
||||
{ /* job-template group */
|
||||
"accuracy-units-supported", /* IPP 3D */
|
||||
"chamber-humidity", /* IPP 3D */
|
||||
"chamber-humidity-default", /* IPP 3D */
|
||||
"chamber-humidity-supported", /* IPP 3D */
|
||||
"chamber-temperature", /* IPP 3D */
|
||||
"chamber-temperature-default", /* IPP 3D */
|
||||
"chamber-temperature-supported", /* IPP 3D */
|
||||
"confirmation-sheet-print", /* IPP FaxOut */
|
||||
"confirmation-sheet-print-default",
|
||||
"copies",
|
||||
@@ -1472,8 +1508,8 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"output-bin-default",
|
||||
"output-bin-supported",
|
||||
"output-device",
|
||||
"output-device-default",
|
||||
"output-device-supported",
|
||||
"output-device-uuid-supported", /* IPP INFRA */
|
||||
"output-mode", /* CUPS extension */
|
||||
"output-mode-default", /* CUPS extension */
|
||||
"output-mode-supported", /* CUPS extension */
|
||||
@@ -1587,6 +1623,8 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
static const char * const printer_description[] =
|
||||
{ /* printer-description group */
|
||||
"auth-info-required", /* CUPS extension */
|
||||
"chamber-humidity-current", /* IPP 3D */
|
||||
"chamber-temperature-current", /* IPP 3D */
|
||||
"charset-configured",
|
||||
"charset-supported",
|
||||
"color-supported",
|
||||
@@ -1666,16 +1704,20 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"pdf-features-supported", /* IPP 3D */
|
||||
"pdf-versions-supported", /* CUPS extension */
|
||||
"pdl-override-supported",
|
||||
"platform-shape", /* IPP 3D */
|
||||
"port-monitor", /* CUPS extension */
|
||||
"port-monitor-supported", /* CUPS extension */
|
||||
"preferred-attributes-supported",
|
||||
"printer-alert",
|
||||
"printer-alert-description",
|
||||
"printer-camera-image-uri", /* IPP 3D */
|
||||
"printer-charge-info",
|
||||
"printer-charge-info-uri",
|
||||
"printer-commands", /* CUPS extension */
|
||||
"printer-config-change-date-time",
|
||||
"printer-config-change-time",
|
||||
"printer-config-changes", /* IPP System */
|
||||
"printer-contact-col", /* IPP System */
|
||||
"printer-current-time",
|
||||
"printer-detailed-status-messages",
|
||||
"printer-device-id",
|
||||
@@ -1693,7 +1735,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"printer-get-attributes-supported",
|
||||
"printer-icc-profiles",
|
||||
"printer-icons",
|
||||
"printer-id", /* CUPS extension */
|
||||
"printer-id", /* IPP System */
|
||||
"printer-info",
|
||||
"printer-input-tray", /* IPP JPS3 */
|
||||
"printer-is-accepting-jobs",
|
||||
@@ -1713,7 +1755,7 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"printer-organization",
|
||||
"printer-organizational-unit",
|
||||
"printer-output-tray", /* IPP JPS3 */
|
||||
"printer-queue-id", /* CUPS extension */
|
||||
"printer-service-type", /* IPP System */
|
||||
"printer-settable-attributes-supported",
|
||||
"printer-state",
|
||||
"printer-state-change-date-time",
|
||||
@@ -1737,6 +1779,12 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"requesting-user-name-allowed", /* CUPS extension */
|
||||
"requesting-user-name-denied", /* CUPS extension */
|
||||
"requesting-user-uri-supported",
|
||||
"smi2699-auth-print-group", /* PWG ippserver extension */
|
||||
"smi2699-auth-proxy-group", /* PWG ippserver extension */
|
||||
"smi2699-device-command", /* PWG ippserver extension */
|
||||
"smi2699-device-format", /* PWG ippserver extension */
|
||||
"smi2699-device-name", /* PWG ippserver extension */
|
||||
"smi2699-device-uri", /* PWG ippserver extension */
|
||||
"subordinate-printers-supported",
|
||||
"subscription-privacy-attributes", /* IPP Privacy Attributes */
|
||||
"subscription-privacy-scope", /* IPP Privacy Attributes */
|
||||
@@ -1749,17 +1797,54 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"xri-security-supported",
|
||||
"xri-uri-scheme-supported"
|
||||
};
|
||||
static const char * const resource_description[] =
|
||||
{ /* resource-description group - IPP System */
|
||||
"resource-info",
|
||||
"resource-name"
|
||||
};
|
||||
static const char * const resource_status[] =
|
||||
{ /* resource-status group - IPP System */
|
||||
"date-time-at-canceled",
|
||||
"date-time-at-creation",
|
||||
"date-time-at-installed",
|
||||
"resource-data-uri",
|
||||
"resource-format",
|
||||
"resource-id",
|
||||
"resource-k-octets",
|
||||
"resource-state",
|
||||
"resource-state-message",
|
||||
"resource-state-reasons",
|
||||
"resource-string-version",
|
||||
"resource-type",
|
||||
"resource-use-count",
|
||||
"resource-uuid",
|
||||
"resource-version",
|
||||
"time-at-canceled",
|
||||
"time-at-creation",
|
||||
"time-at-installed"
|
||||
};
|
||||
static const char * const resource_template[] =
|
||||
{ /* resource-template group - IPP System */
|
||||
"resource-format",
|
||||
"resource-format-supported",
|
||||
"resource-info",
|
||||
"resource-name",
|
||||
"resource-type",
|
||||
"resource-type-supported"
|
||||
};
|
||||
static const char * const subscription_description[] =
|
||||
{ /* subscription-description group */
|
||||
"notify-job-id",
|
||||
"notify-lease-expiration-time",
|
||||
"notify-printer-up-time",
|
||||
"notify-printer-uri",
|
||||
"notify-resource-id", /* IPP System */
|
||||
"notify-system-uri", /* IPP System */
|
||||
"notify-sequence-number",
|
||||
"notify-subscriber-user-name",
|
||||
"notify-subscriber-user-uri",
|
||||
"notify-subscription-id",
|
||||
"notify-subscription-uuid"
|
||||
"notify-subscription-uuid" /* IPP JPS3 */
|
||||
};
|
||||
static const char * const subscription_template[] =
|
||||
{ /* subscription-template group */
|
||||
@@ -1781,21 +1866,78 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
"notify-time-interval",
|
||||
"notify-user-data"
|
||||
};
|
||||
static const char * const system_description[] =
|
||||
{ /* system-description group - IPP System */
|
||||
"charset-configured",
|
||||
"charset-supported",
|
||||
"generated-natural-language-supported",
|
||||
"ipp-features-supported",
|
||||
"ipp-versions-supported",
|
||||
"natural-language-configured",
|
||||
"operations-supported",
|
||||
"power-calendar-policy-col",
|
||||
"power-event-policy-col",
|
||||
"power-timeout-policy-col",
|
||||
"printer-creation-attributes-supported",
|
||||
"resource-settable-attributes-supported",
|
||||
"smi2699-auth-group-supported", /* PWG ippserver extension */
|
||||
"smi2699-device-command-supported", /* PWG ippserver extension */
|
||||
"smi2699-device-format-format", /* PWG ippserver extension */
|
||||
"smi2699-device-uri-schemes-supported",
|
||||
/* PWG ippserver extension */
|
||||
"system-contact-col",
|
||||
"system-current-time",
|
||||
"system-default-printer-id",
|
||||
"system-device-id",
|
||||
"system-geo-location",
|
||||
"system-info",
|
||||
"system-location",
|
||||
"system-mandatory-printer-attributes",
|
||||
"system-make-and-model",
|
||||
"system-message-from-operator",
|
||||
"system-name",
|
||||
"system-settable-attributes-supported",
|
||||
"system-strings-languages-supported",
|
||||
"system-strings-uri",
|
||||
"system-xri-supported"
|
||||
};
|
||||
static const char * const system_status[] =
|
||||
{ /* system-status group - IPP System */
|
||||
"power-log-col",
|
||||
"power-state-capabilities-col",
|
||||
"power-state-counters-col",
|
||||
"power-state-monitor-col",
|
||||
"power-state-transitions-col",
|
||||
"system-config-change-date-time",
|
||||
"system-config-change-time",
|
||||
"system-config-changes",
|
||||
"system-configured-printers",
|
||||
"system-configured-resources",
|
||||
"system-serial-number",
|
||||
"system-state",
|
||||
"system-state-change-date-time",
|
||||
"system-state-change-time",
|
||||
"system-state-message",
|
||||
"system-state-reasons",
|
||||
"system-up-time",
|
||||
"system-uuid"
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Get the requested-attributes attribute...
|
||||
*/
|
||||
|
||||
if ((requested = ippFindAttribute(request, "requested-attributes",
|
||||
IPP_TAG_KEYWORD)) == NULL)
|
||||
op = ippGetOperation(request);
|
||||
|
||||
if ((requested = ippFindAttribute(request, "requested-attributes", IPP_TAG_KEYWORD)) == NULL)
|
||||
{
|
||||
/*
|
||||
* The Get-Jobs operation defaults to "job-id" and "job-uri", all others
|
||||
* default to "all"...
|
||||
*/
|
||||
|
||||
if (ippGetOperation(request) == IPP_OP_GET_JOBS)
|
||||
if (op == IPP_OP_GET_JOBS)
|
||||
{
|
||||
ra = cupsArrayNew((cups_array_func_t)strcmp, NULL);
|
||||
cupsArrayAdd(ra, "job-id");
|
||||
@@ -1826,12 +1968,9 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
added = 0;
|
||||
value = ippGetString(requested, i, NULL);
|
||||
|
||||
if (!strcmp(value, "document-description") || !strcmp(value, "all"))
|
||||
if (!strcmp(value, "document-description") || (!strcmp(value, "all") && (op == IPP_OP_GET_JOB_ATTRIBUTES || op == IPP_OP_GET_JOBS || op == IPP_OP_GET_DOCUMENT_ATTRIBUTES || op == IPP_OP_GET_DOCUMENTS)))
|
||||
{
|
||||
for (j = 0;
|
||||
j < (int)(sizeof(document_description) /
|
||||
sizeof(document_description[0]));
|
||||
j ++)
|
||||
for (j = 0; j < (int)(sizeof(document_description) / sizeof(document_description[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)document_description[j]);
|
||||
|
||||
added = 1;
|
||||
@@ -1839,67 +1978,92 @@ ippCreateRequestedArray(ipp_t *request) /* I - IPP request */
|
||||
|
||||
if (!strcmp(value, "document-template") || !strcmp(value, "all"))
|
||||
{
|
||||
for (j = 0;
|
||||
j < (int)(sizeof(document_template) / sizeof(document_template[0]));
|
||||
j ++)
|
||||
for (j = 0; j < (int)(sizeof(document_template) / sizeof(document_template[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)document_template[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(value, "job-description") || !strcmp(value, "all"))
|
||||
if (!strcmp(value, "job-description") || (!strcmp(value, "all") && (op == IPP_OP_GET_JOB_ATTRIBUTES || op == IPP_OP_GET_JOBS)))
|
||||
{
|
||||
for (j = 0;
|
||||
j < (int)(sizeof(job_description) / sizeof(job_description[0]));
|
||||
j ++)
|
||||
for (j = 0; j < (int)(sizeof(job_description) / sizeof(job_description[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)job_description[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(value, "job-template") || !strcmp(value, "all"))
|
||||
if (!strcmp(value, "job-template") || (!strcmp(value, "all") && (op == IPP_OP_GET_JOB_ATTRIBUTES || op == IPP_OP_GET_JOBS || op == IPP_OP_GET_PRINTER_ATTRIBUTES)))
|
||||
{
|
||||
for (j = 0;
|
||||
j < (int)(sizeof(job_template) / sizeof(job_template[0]));
|
||||
j ++)
|
||||
for (j = 0; j < (int)(sizeof(job_template) / sizeof(job_template[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)job_template[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(value, "printer-description") || !strcmp(value, "all"))
|
||||
if (!strcmp(value, "printer-description") || (!strcmp(value, "all") && (op == IPP_OP_GET_PRINTER_ATTRIBUTES || op == IPP_OP_GET_PRINTERS || op == IPP_OP_CUPS_GET_DEFAULT || op == IPP_OP_CUPS_GET_PRINTERS || op == IPP_OP_CUPS_GET_CLASSES)))
|
||||
{
|
||||
for (j = 0;
|
||||
j < (int)(sizeof(printer_description) /
|
||||
sizeof(printer_description[0]));
|
||||
j ++)
|
||||
for (j = 0; j < (int)(sizeof(printer_description) / sizeof(printer_description[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)printer_description[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(value, "subscription-description") || !strcmp(value, "all"))
|
||||
if (!strcmp(value, "resource-description") || (!strcmp(value, "all") && (op == IPP_OP_GET_RESOURCE_ATTRIBUTES || op == IPP_OP_GET_RESOURCES)))
|
||||
{
|
||||
for (j = 0;
|
||||
j < (int)(sizeof(subscription_description) /
|
||||
sizeof(subscription_description[0]));
|
||||
j ++)
|
||||
for (j = 0; j < (int)(sizeof(resource_description) / sizeof(resource_description[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)resource_description[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(value, "resource-status") || (!strcmp(value, "all") && (op == IPP_OP_GET_RESOURCE_ATTRIBUTES || op == IPP_OP_GET_RESOURCES)))
|
||||
{
|
||||
for (j = 0; j < (int)(sizeof(resource_status) / sizeof(resource_status[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)resource_status[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(value, "resource-template") || (!strcmp(value, "all") && (op == IPP_OP_GET_RESOURCE_ATTRIBUTES || op == IPP_OP_GET_RESOURCES || op == IPP_OP_GET_SYSTEM_ATTRIBUTES)))
|
||||
{
|
||||
for (j = 0; j < (int)(sizeof(resource_template) / sizeof(resource_template[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)resource_template[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(value, "subscription-description") || (!strcmp(value, "all") && (op == IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES || op == IPP_OP_GET_SUBSCRIPTIONS)))
|
||||
{
|
||||
for (j = 0; j < (int)(sizeof(subscription_description) / sizeof(subscription_description[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)subscription_description[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(value, "subscription-template") || !strcmp(value, "all"))
|
||||
if (!strcmp(value, "subscription-template") || (!strcmp(value, "all") && (op == IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES || op == IPP_OP_GET_SUBSCRIPTIONS)))
|
||||
{
|
||||
for (j = 0;
|
||||
j < (int)(sizeof(subscription_template) /
|
||||
sizeof(subscription_template[0]));
|
||||
j ++)
|
||||
for (j = 0; j < (int)(sizeof(subscription_template) / sizeof(subscription_template[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)subscription_template[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(value, "system-description") || (!strcmp(value, "all") && op == IPP_OP_GET_SYSTEM_ATTRIBUTES))
|
||||
{
|
||||
for (j = 0; j < (int)(sizeof(system_description) / sizeof(system_description[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)system_description[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(value, "system-status") || (!strcmp(value, "all") && op == IPP_OP_GET_SYSTEM_ATTRIBUTES))
|
||||
{
|
||||
for (j = 0; j < (int)(sizeof(system_status) / sizeof(system_status[0])); j ++)
|
||||
cupsArrayAdd(ra, (void *)system_status[j]);
|
||||
|
||||
added = 1;
|
||||
}
|
||||
|
||||
if (!added)
|
||||
cupsArrayAdd(ra, (void *)value);
|
||||
}
|
||||
@@ -1923,59 +2087,31 @@ ippEnumString(const char *attrname, /* I - Attribute name */
|
||||
* Check for standard enum values...
|
||||
*/
|
||||
|
||||
if (!strcmp(attrname, "document-state") &&
|
||||
enumvalue >= 3 &&
|
||||
enumvalue < (3 + (int)(sizeof(ipp_document_states) /
|
||||
sizeof(ipp_document_states[0]))))
|
||||
if (!strcmp(attrname, "document-state") && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_document_states) / sizeof(ipp_document_states[0]))))
|
||||
return (ipp_document_states[enumvalue - 3]);
|
||||
else if (!strcmp(attrname, "finishings") ||
|
||||
!strcmp(attrname, "finishings-actual") ||
|
||||
!strcmp(attrname, "finishings-default") ||
|
||||
!strcmp(attrname, "finishings-ready") ||
|
||||
!strcmp(attrname, "finishings-supported") ||
|
||||
!strcmp(attrname, "job-finishings") ||
|
||||
!strcmp(attrname, "job-finishings-default") ||
|
||||
!strcmp(attrname, "job-finishings-supported"))
|
||||
else if (!strcmp(attrname, "finishings") || !strcmp(attrname, "finishings-actual") || !strcmp(attrname, "finishings-default") || !strcmp(attrname, "finishings-ready") || !strcmp(attrname, "finishings-supported") || !strcmp(attrname, "job-finishings") || !strcmp(attrname, "job-finishings-default") || !strcmp(attrname, "job-finishings-supported"))
|
||||
{
|
||||
if (enumvalue >= 3 &&
|
||||
enumvalue < (3 + (int)(sizeof(ipp_finishings) /
|
||||
sizeof(ipp_finishings[0]))))
|
||||
if (enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_finishings) / sizeof(ipp_finishings[0]))))
|
||||
return (ipp_finishings[enumvalue - 3]);
|
||||
else if (enumvalue >= 0x40000000 &&
|
||||
enumvalue <= (0x40000000 + (int)(sizeof(ipp_finishings_vendor) /
|
||||
sizeof(ipp_finishings_vendor[0]))))
|
||||
else if (enumvalue >= 0x40000000 && enumvalue < (0x40000000 + (int)(sizeof(ipp_finishings_vendor) / sizeof(ipp_finishings_vendor[0]))))
|
||||
return (ipp_finishings_vendor[enumvalue - 0x40000000]);
|
||||
}
|
||||
else if ((!strcmp(attrname, "job-collation-type") ||
|
||||
!strcmp(attrname, "job-collation-type-actual")) &&
|
||||
enumvalue >= 3 &&
|
||||
enumvalue < (3 + (int)(sizeof(ipp_job_collation_types) /
|
||||
sizeof(ipp_job_collation_types[0]))))
|
||||
else if ((!strcmp(attrname, "job-collation-type") || !strcmp(attrname, "job-collation-type-actual")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_job_collation_types) / sizeof(ipp_job_collation_types[0]))))
|
||||
return (ipp_job_collation_types[enumvalue - 3]);
|
||||
else if (!strcmp(attrname, "job-state") &&
|
||||
enumvalue >= IPP_JSTATE_PENDING && enumvalue <= IPP_JSTATE_COMPLETED)
|
||||
else if (!strcmp(attrname, "job-state") && enumvalue >= IPP_JSTATE_PENDING && enumvalue <= IPP_JSTATE_COMPLETED)
|
||||
return (ipp_job_states[enumvalue - IPP_JSTATE_PENDING]);
|
||||
else if (!strcmp(attrname, "operations-supported"))
|
||||
return (ippOpString((ipp_op_t)enumvalue));
|
||||
else if ((!strcmp(attrname, "orientation-requested") ||
|
||||
!strcmp(attrname, "orientation-requested-actual") ||
|
||||
!strcmp(attrname, "orientation-requested-default") ||
|
||||
!strcmp(attrname, "orientation-requested-supported")) &&
|
||||
enumvalue >= 3 &&
|
||||
enumvalue < (3 + (int)(sizeof(ipp_orientation_requesteds) /
|
||||
sizeof(ipp_orientation_requesteds[0]))))
|
||||
else if ((!strcmp(attrname, "orientation-requested") || !strcmp(attrname, "orientation-requested-actual") || !strcmp(attrname, "orientation-requested-default") || !strcmp(attrname, "orientation-requested-supported")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_orientation_requesteds) / sizeof(ipp_orientation_requesteds[0]))))
|
||||
return (ipp_orientation_requesteds[enumvalue - 3]);
|
||||
else if ((!strcmp(attrname, "print-quality") ||
|
||||
!strcmp(attrname, "print-quality-actual") ||
|
||||
!strcmp(attrname, "print-quality-default") ||
|
||||
!strcmp(attrname, "print-quality-supported")) &&
|
||||
enumvalue >= 3 &&
|
||||
enumvalue < (3 + (int)(sizeof(ipp_print_qualities) /
|
||||
sizeof(ipp_print_qualities[0]))))
|
||||
else if ((!strcmp(attrname, "print-quality") || !strcmp(attrname, "print-quality-actual") || !strcmp(attrname, "print-quality-default") || !strcmp(attrname, "print-quality-supported")) && enumvalue >= 3 && enumvalue < (3 + (int)(sizeof(ipp_print_qualities) / sizeof(ipp_print_qualities[0]))))
|
||||
return (ipp_print_qualities[enumvalue - 3]);
|
||||
else if (!strcmp(attrname, "printer-state") &&
|
||||
enumvalue >= IPP_PSTATE_IDLE && enumvalue <= IPP_PSTATE_STOPPED)
|
||||
else if (!strcmp(attrname, "printer-state") && enumvalue >= IPP_PSTATE_IDLE && enumvalue <= IPP_PSTATE_STOPPED)
|
||||
return (ipp_printer_states[enumvalue - IPP_PSTATE_IDLE]);
|
||||
else if (!strcmp(attrname, "resource-state") && enumvalue >= IPP_RSTATE_PENDING && enumvalue <= IPP_RSTATE_ABORTED)
|
||||
return (ipp_resource_states[enumvalue - IPP_RSTATE_PENDING]);
|
||||
else if (!strcmp(attrname, "system-state") && enumvalue >= IPP_SSTATE_IDLE && enumvalue <= IPP_SSTATE_STOPPED)
|
||||
return (ipp_system_states[enumvalue - IPP_SSTATE_IDLE]);
|
||||
|
||||
/*
|
||||
* Not a standard enum value, just return the decimal equivalent...
|
||||
@@ -2067,6 +2203,16 @@ ippEnumValue(const char *attrname, /* I - Attribute name */
|
||||
num_strings = (int)(sizeof(ipp_printer_states) / sizeof(ipp_printer_states[0]));
|
||||
strings = ipp_printer_states;
|
||||
}
|
||||
else if (!strcmp(attrname, "resource-state"))
|
||||
{
|
||||
num_strings = (int)(sizeof(ipp_resource_states) / sizeof(ipp_resource_states[0]));
|
||||
strings = ipp_resource_states;
|
||||
}
|
||||
else if (!strcmp(attrname, "system-state"))
|
||||
{
|
||||
num_strings = (int)(sizeof(ipp_system_states) / sizeof(ipp_system_states[0]));
|
||||
strings = ipp_system_states;
|
||||
}
|
||||
else
|
||||
return (-1);
|
||||
|
||||
|
||||
+5
-2
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* IPP data file parsing functions.
|
||||
*
|
||||
* Copyright © 2007-2018 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
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <cups/cups.h>
|
||||
#include "ipp-private.h"
|
||||
#include "string-private.h"
|
||||
#include "debug-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -133,7 +134,9 @@ const char * /* O - Value or @code NULL@ if not set */
|
||||
_ippVarsGet(_ipp_vars_t *v, /* I - IPP variables */
|
||||
const char *name) /* I - Variable name */
|
||||
{
|
||||
if (!strcmp(name, "uri"))
|
||||
if (!v)
|
||||
return (NULL);
|
||||
else if (!strcmp(name, "uri"))
|
||||
return (v->uri);
|
||||
else if (!strcmp(name, "uriuser") || !strcmp(name, "username"))
|
||||
return (v->username[0] ? v->username : NULL);
|
||||
|
||||
+156
-226
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Internet Printing Protocol functions 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -12,10 +13,11 @@
|
||||
*/
|
||||
|
||||
#include "cups-private.h"
|
||||
#include "debug-internal.h"
|
||||
#include <regex.h>
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
# include <io.h>
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
@@ -27,12 +29,8 @@ static ipp_attribute_t *ipp_add_attr(ipp_t *ipp, const char *name,
|
||||
int num_values);
|
||||
static void ipp_free_values(ipp_attribute_t *attr, int element,
|
||||
int count);
|
||||
static char *ipp_get_code(const char *locale, char *buffer,
|
||||
size_t bufsize)
|
||||
__attribute__((nonnull(1,2)));
|
||||
static char *ipp_lang_code(const char *locale, char *buffer,
|
||||
size_t bufsize)
|
||||
__attribute__((nonnull(1,2)));
|
||||
static char *ipp_get_code(const char *locale, char *buffer, size_t bufsize) _CUPS_NONNULL(1,2);
|
||||
static char *ipp_lang_code(const char *locale, char *buffer, size_t bufsize) _CUPS_NONNULL(1,2);
|
||||
static size_t ipp_length(ipp_t *ipp, int collection);
|
||||
static ssize_t ipp_read_http(http_t *http, ipp_uchar_t *buffer,
|
||||
size_t length);
|
||||
@@ -1477,6 +1475,7 @@ ippCopyAttribute(
|
||||
int quickcopy) /* I - 1 for a referenced copy, 0 for normal */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
ipp_tag_t srctag; /* Source value tag */
|
||||
ipp_attribute_t *dstattr; /* Destination attribute */
|
||||
_ipp_value_t *srcval, /* Source value */
|
||||
*dstval; /* Destination value */
|
||||
@@ -1495,9 +1494,10 @@ ippCopyAttribute(
|
||||
* Copy it...
|
||||
*/
|
||||
|
||||
quickcopy = quickcopy ? IPP_TAG_CUPS_CONST : 0;
|
||||
quickcopy = (quickcopy && (srcattr->value_tag & IPP_TAG_CUPS_CONST)) ? IPP_TAG_CUPS_CONST : 0;
|
||||
srctag = srcattr->value_tag & IPP_TAG_CUPS_MASK;
|
||||
|
||||
switch (srcattr->value_tag & ~IPP_TAG_CUPS_CONST)
|
||||
switch (srctag)
|
||||
{
|
||||
case IPP_TAG_ZERO :
|
||||
dstattr = ippAddSeparator(dst);
|
||||
@@ -1510,139 +1510,70 @@ ippCopyAttribute(
|
||||
case IPP_TAG_NOTSETTABLE :
|
||||
case IPP_TAG_DELETEATTR :
|
||||
case IPP_TAG_ADMINDEFINE :
|
||||
dstattr = ippAddOutOfBand(dst, srcattr->group_tag, srcattr->value_tag & ~IPP_TAG_CUPS_CONST, srcattr->name);
|
||||
dstattr = ippAddOutOfBand(dst, srcattr->group_tag, srctag, srcattr->name);
|
||||
break;
|
||||
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
dstattr = ippAddIntegers(dst, srcattr->group_tag, srcattr->value_tag,
|
||||
srcattr->name, srcattr->num_values, NULL);
|
||||
if (!dstattr)
|
||||
break;
|
||||
|
||||
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
dstval->integer = srcval->integer;
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
dstattr = ippAddBooleans(dst, srcattr->group_tag, srcattr->name,
|
||||
srcattr->num_values, NULL);
|
||||
if (!dstattr)
|
||||
break;
|
||||
|
||||
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
dstval->boolean = srcval->boolean;
|
||||
case IPP_TAG_DATE :
|
||||
case IPP_TAG_RESOLUTION :
|
||||
case IPP_TAG_RANGE :
|
||||
if ((dstattr = ipp_add_attr(dst, srcattr->name, srcattr->group_tag, srctag, srcattr->num_values)) != NULL)
|
||||
memcpy(dstattr->values, srcattr->values, (size_t)srcattr->num_values * sizeof(_ipp_value_t));
|
||||
break;
|
||||
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_RESERVED_STRING :
|
||||
case IPP_TAG_KEYWORD :
|
||||
case IPP_TAG_URI :
|
||||
case IPP_TAG_URISCHEME :
|
||||
case IPP_TAG_CHARSET :
|
||||
case IPP_TAG_LANGUAGE :
|
||||
case IPP_TAG_MIMETYPE :
|
||||
dstattr = ippAddStrings(dst, srcattr->group_tag,
|
||||
(ipp_tag_t)(srcattr->value_tag | quickcopy),
|
||||
srcattr->name, srcattr->num_values, NULL, NULL);
|
||||
if (!dstattr)
|
||||
if ((dstattr = ippAddStrings(dst, srcattr->group_tag, (ipp_tag_t)(srctag | quickcopy), srcattr->name, srcattr->num_values, NULL, NULL)) == NULL)
|
||||
break;
|
||||
|
||||
if (quickcopy)
|
||||
{
|
||||
for (i = srcattr->num_values, srcval = srcattr->values,
|
||||
dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
dstval->string.text = srcval->string.text;
|
||||
/*
|
||||
* Can safely quick-copy these string values...
|
||||
*/
|
||||
|
||||
memcpy(dstattr->values, srcattr->values, (size_t)srcattr->num_values * sizeof(_ipp_value_t));
|
||||
}
|
||||
else if (srcattr->value_tag & IPP_TAG_CUPS_CONST)
|
||||
{
|
||||
for (i = srcattr->num_values, srcval = srcattr->values,
|
||||
dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
dstval->string.text = _cupsStrAlloc(srcval->string.text);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = srcattr->num_values, srcval = srcattr->values,
|
||||
dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
dstval->string.text = _cupsStrRetain(srcval->string.text);
|
||||
}
|
||||
break;
|
||||
/*
|
||||
* Otherwise do a normal reference counted copy...
|
||||
*/
|
||||
|
||||
case IPP_TAG_DATE :
|
||||
if (srcattr->num_values != 1)
|
||||
return (NULL);
|
||||
|
||||
dstattr = ippAddDate(dst, srcattr->group_tag, srcattr->name,
|
||||
srcattr->values[0].date);
|
||||
break;
|
||||
|
||||
case IPP_TAG_RESOLUTION :
|
||||
dstattr = ippAddResolutions(dst, srcattr->group_tag, srcattr->name,
|
||||
srcattr->num_values, IPP_RES_PER_INCH,
|
||||
NULL, NULL);
|
||||
if (!dstattr)
|
||||
break;
|
||||
|
||||
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
{
|
||||
dstval->resolution.xres = srcval->resolution.xres;
|
||||
dstval->resolution.yres = srcval->resolution.yres;
|
||||
dstval->resolution.units = srcval->resolution.units;
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_RANGE :
|
||||
dstattr = ippAddRanges(dst, srcattr->group_tag, srcattr->name,
|
||||
srcattr->num_values, NULL, NULL);
|
||||
if (!dstattr)
|
||||
break;
|
||||
|
||||
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
{
|
||||
dstval->range.lower = srcval->range.lower;
|
||||
dstval->range.upper = srcval->range.upper;
|
||||
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values; i > 0; i --, srcval ++, dstval ++)
|
||||
dstval->string.text = _cupsStrAlloc(srcval->string.text);
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_TEXTLANG :
|
||||
case IPP_TAG_NAMELANG :
|
||||
dstattr = ippAddStrings(dst, srcattr->group_tag,
|
||||
(ipp_tag_t)(srcattr->value_tag | quickcopy),
|
||||
srcattr->name, srcattr->num_values, NULL, NULL);
|
||||
if (!dstattr)
|
||||
if ((dstattr = ippAddStrings(dst, srcattr->group_tag, (ipp_tag_t)(srctag | quickcopy), srcattr->name, srcattr->num_values, NULL, NULL)) == NULL)
|
||||
break;
|
||||
|
||||
if (quickcopy)
|
||||
{
|
||||
for (i = srcattr->num_values, srcval = srcattr->values,
|
||||
dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
{
|
||||
dstval->string.language = srcval->string.language;
|
||||
dstval->string.text = srcval->string.text;
|
||||
}
|
||||
/*
|
||||
* Can safely quick-copy these string values...
|
||||
*/
|
||||
|
||||
memcpy(dstattr->values, srcattr->values, (size_t)srcattr->num_values * sizeof(_ipp_value_t));
|
||||
}
|
||||
else if (srcattr->value_tag & IPP_TAG_CUPS_CONST)
|
||||
{
|
||||
for (i = srcattr->num_values, srcval = srcattr->values,
|
||||
dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
/*
|
||||
* Otherwise do a normal reference counted copy...
|
||||
*/
|
||||
|
||||
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values; i > 0; i --, srcval ++, dstval ++)
|
||||
{
|
||||
if (srcval == srcattr->values)
|
||||
dstval->string.language = _cupsStrAlloc(srcval->string.language);
|
||||
@@ -1652,32 +1583,13 @@ ippCopyAttribute(
|
||||
dstval->string.text = _cupsStrAlloc(srcval->string.text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = srcattr->num_values, srcval = srcattr->values,
|
||||
dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
{
|
||||
if (srcval == srcattr->values)
|
||||
dstval->string.language = _cupsStrRetain(srcval->string.language);
|
||||
else
|
||||
dstval->string.language = dstattr->values[0].string.language;
|
||||
|
||||
dstval->string.text = _cupsStrRetain(srcval->string.text);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_BEGIN_COLLECTION :
|
||||
dstattr = ippAddCollections(dst, srcattr->group_tag, srcattr->name,
|
||||
srcattr->num_values, NULL);
|
||||
if (!dstattr)
|
||||
if ((dstattr = ippAddCollections(dst, srcattr->group_tag, srcattr->name, srcattr->num_values, NULL)) == NULL)
|
||||
break;
|
||||
|
||||
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values; i > 0; i --, srcval ++, dstval ++)
|
||||
{
|
||||
dstval->collection = srcval->collection;
|
||||
srcval->collection->use ++;
|
||||
@@ -1686,15 +1598,10 @@ ippCopyAttribute(
|
||||
|
||||
case IPP_TAG_STRING :
|
||||
default :
|
||||
/* TODO: Implement quick copy for unknown/octetString values */
|
||||
dstattr = ippAddIntegers(dst, srcattr->group_tag, srcattr->value_tag,
|
||||
srcattr->name, srcattr->num_values, NULL);
|
||||
if (!dstattr)
|
||||
if ((dstattr = ipp_add_attr(dst, srcattr->name, srcattr->group_tag, srctag, srcattr->num_values)) == NULL)
|
||||
break;
|
||||
|
||||
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values;
|
||||
i > 0;
|
||||
i --, srcval ++, dstval ++)
|
||||
for (i = srcattr->num_values, srcval = srcattr->values, dstval = dstattr->values; i > 0; i --, srcval ++, dstval ++)
|
||||
{
|
||||
dstval->unknown.length = srcval->unknown.length;
|
||||
|
||||
@@ -3049,7 +2956,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
* Read 32-bit "extension" tag...
|
||||
*/
|
||||
|
||||
if ((*cb)(src, buffer, 4) < 1)
|
||||
if ((*cb)(src, buffer, 4) < 4)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Callback returned EOF/error");
|
||||
_cupsBufferRelease((char *)buffer);
|
||||
@@ -3083,6 +2990,13 @@ ippReadIO(void *src, /* I - Data source */
|
||||
ipp->state = IPP_STATE_DATA;
|
||||
break;
|
||||
}
|
||||
else if (tag == IPP_TAG_ZERO || (tag == IPP_TAG_OPERATION && ipp->curtag != IPP_TAG_ZERO))
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Invalid group tag."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad tag 0x%02x.", tag));
|
||||
_cupsBufferRelease((char *)buffer);
|
||||
return (IPP_STATE_ERROR);
|
||||
}
|
||||
else if (tag < IPP_TAG_UNSUPPORTED_VALUE)
|
||||
{
|
||||
/*
|
||||
@@ -3126,8 +3040,13 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
DEBUG_printf(("2ippReadIO: name length=%d", n));
|
||||
|
||||
if (n == 0 && tag != IPP_TAG_MEMBERNAME &&
|
||||
tag != IPP_TAG_END_COLLECTION)
|
||||
if (n && parent)
|
||||
{
|
||||
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Invalid named IPP attribute in collection."), 1);
|
||||
DEBUG_puts("1ippReadIO: bad attribute name in collection.");
|
||||
return (IPP_STATE_ERROR);
|
||||
}
|
||||
else if (n == 0 && tag != IPP_TAG_MEMBERNAME && tag != IPP_TAG_END_COLLECTION)
|
||||
{
|
||||
/*
|
||||
* More values for current attribute...
|
||||
@@ -3380,7 +3299,10 @@ ippReadIO(void *src, /* I - Data source */
|
||||
value->boolean = (char)buffer[0];
|
||||
break;
|
||||
|
||||
case IPP_TAG_NOVALUE :
|
||||
case IPP_TAG_UNSUPPORTED_VALUE :
|
||||
case IPP_TAG_DEFAULT :
|
||||
case IPP_TAG_UNKNOWN :
|
||||
case IPP_TAG_NOVALUE :
|
||||
case IPP_TAG_NOTSETTABLE :
|
||||
case IPP_TAG_DELETEATTR :
|
||||
case IPP_TAG_ADMINDEFINE :
|
||||
@@ -3400,6 +3322,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
case IPP_TAG_TEXT :
|
||||
case IPP_TAG_NAME :
|
||||
case IPP_TAG_RESERVED_STRING :
|
||||
case IPP_TAG_KEYWORD :
|
||||
case IPP_TAG_URI :
|
||||
case IPP_TAG_URISCHEME :
|
||||
@@ -3654,6 +3577,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
DEBUG_printf(("2ippReadIO: member name=\"%s\"", attr->name));
|
||||
break;
|
||||
|
||||
case IPP_TAG_STRING :
|
||||
default : /* Other unsupported values */
|
||||
if (tag == IPP_TAG_STRING && n > IPP_MAX_LENGTH)
|
||||
{
|
||||
@@ -3830,8 +3754,7 @@ ippSetDate(ipp_t *ipp, /* I - IPP message */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_DATE ||
|
||||
element < 0 || element > (*attr)->num_values || !datevalue)
|
||||
if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_DATE && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values || !datevalue)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
@@ -3914,9 +3837,7 @@ ippSetInteger(ipp_t *ipp, /* I - IPP message */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!ipp || !attr || !*attr ||
|
||||
((*attr)->value_tag != IPP_TAG_INTEGER && (*attr)->value_tag != IPP_TAG_ENUM) ||
|
||||
element < 0 || element > (*attr)->num_values)
|
||||
if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_INTEGER && (*attr)->value_tag != IPP_TAG_ENUM && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
@@ -3924,7 +3845,12 @@ ippSetInteger(ipp_t *ipp, /* I - IPP message */
|
||||
*/
|
||||
|
||||
if ((value = ipp_set_value(ipp, attr, element)) != NULL)
|
||||
{
|
||||
if ((*attr)->value_tag != IPP_TAG_ENUM)
|
||||
(*attr)->value_tag = IPP_TAG_INTEGER;
|
||||
|
||||
value->integer = intvalue;
|
||||
}
|
||||
|
||||
return (value != NULL);
|
||||
}
|
||||
@@ -4001,9 +3927,7 @@ ippSetOctetString(
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_STRING ||
|
||||
element < 0 || element > (*attr)->num_values ||
|
||||
datalen < 0 || datalen > IPP_MAX_LENGTH)
|
||||
if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_STRING && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values || datalen < 0 || datalen > IPP_MAX_LENGTH)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
@@ -4027,6 +3951,8 @@ ippSetOctetString(
|
||||
* Copy the data...
|
||||
*/
|
||||
|
||||
(*attr)->value_tag = IPP_TAG_STRING;
|
||||
|
||||
if (value->unknown.data)
|
||||
{
|
||||
/*
|
||||
@@ -4118,8 +4044,7 @@ ippSetRange(ipp_t *ipp, /* I - IPP message */
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_RANGE ||
|
||||
element < 0 || element > (*attr)->num_values || lowervalue > uppervalue)
|
||||
if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_RANGE && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values || lowervalue > uppervalue)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
@@ -4128,6 +4053,7 @@ ippSetRange(ipp_t *ipp, /* I - IPP message */
|
||||
|
||||
if ((value = ipp_set_value(ipp, attr, element)) != NULL)
|
||||
{
|
||||
(*attr)->value_tag = IPP_TAG_RANGE;
|
||||
value->range.lower = lowervalue;
|
||||
value->range.upper = uppervalue;
|
||||
}
|
||||
@@ -4200,9 +4126,7 @@ ippSetResolution(
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!ipp || !attr || !*attr || (*attr)->value_tag != IPP_TAG_RESOLUTION ||
|
||||
element < 0 || element > (*attr)->num_values || xresvalue <= 0 || yresvalue <= 0 ||
|
||||
unitsvalue < IPP_RES_PER_INCH || unitsvalue > IPP_RES_PER_CM)
|
||||
if (!ipp || !attr || !*attr || ((*attr)->value_tag != IPP_TAG_RESOLUTION && (*attr)->value_tag != IPP_TAG_NOVALUE && (*attr)->value_tag != IPP_TAG_UNKNOWN) || element < 0 || element > (*attr)->num_values || xresvalue <= 0 || yresvalue <= 0 || unitsvalue < IPP_RES_PER_INCH || unitsvalue > IPP_RES_PER_CM)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
@@ -4211,6 +4135,7 @@ ippSetResolution(
|
||||
|
||||
if ((value = ipp_set_value(ipp, attr, element)) != NULL)
|
||||
{
|
||||
(*attr)->value_tag = IPP_TAG_RESOLUTION;
|
||||
value->resolution.units = unitsvalue;
|
||||
value->resolution.xres = xresvalue;
|
||||
value->resolution.yres = yresvalue;
|
||||
@@ -4312,10 +4237,7 @@ ippSetString(ipp_t *ipp, /* I - IPP message */
|
||||
else
|
||||
value_tag = IPP_TAG_ZERO;
|
||||
|
||||
if (!ipp || !attr || !*attr ||
|
||||
(value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG &&
|
||||
value_tag != IPP_TAG_NAMELANG) || value_tag > IPP_TAG_MIMETYPE ||
|
||||
!strvalue)
|
||||
if (!ipp || !attr || !*attr || (value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG && value_tag != IPP_TAG_NAMELANG && value_tag != IPP_TAG_NOVALUE && value_tag != IPP_TAG_UNKNOWN) || value_tag > IPP_TAG_MIMETYPE || element < 0 || element > (*attr)->num_values || !strvalue)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
@@ -4324,6 +4246,9 @@ ippSetString(ipp_t *ipp, /* I - IPP message */
|
||||
|
||||
if ((value = ipp_set_value(ipp, attr, element)) != NULL)
|
||||
{
|
||||
if (value_tag == IPP_TAG_NOVALUE || value_tag == IPP_TAG_UNKNOWN)
|
||||
(*attr)->value_tag = IPP_TAG_KEYWORD;
|
||||
|
||||
if (element > 0)
|
||||
value->string.language = (*attr)->values[0].string.language;
|
||||
|
||||
@@ -4424,10 +4349,7 @@ ippSetStringfv(ipp_t *ipp, /* I - IPP message */
|
||||
else
|
||||
value_tag = IPP_TAG_ZERO;
|
||||
|
||||
if (!ipp || !attr || !*attr ||
|
||||
(value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG &&
|
||||
value_tag != IPP_TAG_NAMELANG) || value_tag > IPP_TAG_MIMETYPE ||
|
||||
!format)
|
||||
if (!ipp || !attr || !*attr || (value_tag < IPP_TAG_TEXT && value_tag != IPP_TAG_TEXTLANG && value_tag != IPP_TAG_NAMELANG && value_tag != IPP_TAG_NOVALUE && value_tag != IPP_TAG_UNKNOWN) || value_tag > IPP_TAG_MIMETYPE || !format)
|
||||
return (0);
|
||||
|
||||
/*
|
||||
@@ -4479,6 +4401,8 @@ ippSetStringfv(ipp_t *ipp, /* I - IPP message */
|
||||
max_bytes = IPP_MAX_CHARSET;
|
||||
break;
|
||||
|
||||
case IPP_TAG_NOVALUE :
|
||||
case IPP_TAG_UNKNOWN :
|
||||
case IPP_TAG_KEYWORD :
|
||||
max_bytes = IPP_MAX_KEYWORD;
|
||||
break;
|
||||
@@ -4626,9 +4550,7 @@ ippSetValueTag(
|
||||
break;
|
||||
|
||||
case IPP_TAG_NAME :
|
||||
if (temp_tag != IPP_TAG_KEYWORD && temp_tag != IPP_TAG_URI &&
|
||||
temp_tag != IPP_TAG_URISCHEME && temp_tag != IPP_TAG_LANGUAGE &&
|
||||
temp_tag != IPP_TAG_MIMETYPE)
|
||||
if (temp_tag != IPP_TAG_KEYWORD)
|
||||
return (0);
|
||||
|
||||
(*attr)->value_tag = (ipp_tag_t)(IPP_TAG_NAME | ((*attr)->value_tag & IPP_TAG_CUPS_CONST));
|
||||
@@ -4636,17 +4558,14 @@ ippSetValueTag(
|
||||
|
||||
case IPP_TAG_NAMELANG :
|
||||
case IPP_TAG_TEXTLANG :
|
||||
if (value_tag == IPP_TAG_NAMELANG &&
|
||||
(temp_tag != IPP_TAG_NAME && temp_tag != IPP_TAG_KEYWORD &&
|
||||
temp_tag != IPP_TAG_URI && temp_tag != IPP_TAG_URISCHEME &&
|
||||
temp_tag != IPP_TAG_LANGUAGE && temp_tag != IPP_TAG_MIMETYPE))
|
||||
if (value_tag == IPP_TAG_NAMELANG && (temp_tag != IPP_TAG_NAME && temp_tag != IPP_TAG_KEYWORD))
|
||||
return (0);
|
||||
|
||||
if (value_tag == IPP_TAG_TEXTLANG && temp_tag != IPP_TAG_TEXT)
|
||||
return (0);
|
||||
|
||||
if (ipp->attrs && ipp->attrs->next && ipp->attrs->next->name &&
|
||||
!strcmp(ipp->attrs->next->name, "attributes-natural-language"))
|
||||
!strcmp(ipp->attrs->next->name, "attributes-natural-language") && (ipp->attrs->next->value_tag & IPP_TAG_CUPS_MASK) == IPP_TAG_LANGUAGE)
|
||||
{
|
||||
/*
|
||||
* Use the language code from the IPP message...
|
||||
@@ -4740,7 +4659,7 @@ ippSetVersion(ipp_t *ipp, /* I - IPP message */
|
||||
const ipp_uchar_t * /* O - RFC-2579 date/time data */
|
||||
ippTimeToDate(time_t t) /* I - Time in seconds */
|
||||
{
|
||||
struct tm *unixdate; /* UNIX unixdate/time info */
|
||||
struct tm unixdate; /* UNIX unixdate/time info */
|
||||
ipp_uchar_t *date = _cupsGlobals()->ipp_date;
|
||||
/* RFC-2579 date/time data */
|
||||
|
||||
@@ -4762,16 +4681,16 @@ ippTimeToDate(time_t t) /* I - Time in seconds */
|
||||
* 10 UTC minutes (0 to 59)
|
||||
*/
|
||||
|
||||
unixdate = gmtime(&t);
|
||||
unixdate->tm_year += 1900;
|
||||
gmtime_r(&t, &unixdate);
|
||||
unixdate.tm_year += 1900;
|
||||
|
||||
date[0] = (ipp_uchar_t)(unixdate->tm_year >> 8);
|
||||
date[1] = (ipp_uchar_t)(unixdate->tm_year);
|
||||
date[2] = (ipp_uchar_t)(unixdate->tm_mon + 1);
|
||||
date[3] = (ipp_uchar_t)unixdate->tm_mday;
|
||||
date[4] = (ipp_uchar_t)unixdate->tm_hour;
|
||||
date[5] = (ipp_uchar_t)unixdate->tm_min;
|
||||
date[6] = (ipp_uchar_t)unixdate->tm_sec;
|
||||
date[0] = (ipp_uchar_t)(unixdate.tm_year >> 8);
|
||||
date[1] = (ipp_uchar_t)(unixdate.tm_year);
|
||||
date[2] = (ipp_uchar_t)(unixdate.tm_mon + 1);
|
||||
date[3] = (ipp_uchar_t)unixdate.tm_mday;
|
||||
date[4] = (ipp_uchar_t)unixdate.tm_hour;
|
||||
date[5] = (ipp_uchar_t)unixdate.tm_min;
|
||||
date[6] = (ipp_uchar_t)unixdate.tm_sec;
|
||||
date[7] = 0;
|
||||
date[8] = '+';
|
||||
date[9] = 0;
|
||||
@@ -4990,40 +4909,44 @@ ippValidateAttribute(
|
||||
{
|
||||
if ((*ptr & 0xe0) == 0xc0)
|
||||
{
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
if ((ptr[1] & 0xc0) != 0x80)
|
||||
break;
|
||||
|
||||
ptr ++;
|
||||
}
|
||||
else if ((*ptr & 0xf0) == 0xe0)
|
||||
{
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
break;
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
if ((ptr[1] & 0xc0) != 0x80 || (ptr[2] & 0xc0) != 0x80)
|
||||
break;
|
||||
|
||||
ptr += 2;
|
||||
}
|
||||
else if ((*ptr & 0xf8) == 0xf0)
|
||||
{
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
break;
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
break;
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
if ((ptr[1] & 0xc0) != 0x80 || (ptr[2] & 0xc0) != 0x80 || (ptr[3] & 0xc0) != 0x80)
|
||||
break;
|
||||
|
||||
ptr += 3;
|
||||
}
|
||||
else if (*ptr & 0x80)
|
||||
break;
|
||||
else if ((*ptr < ' ' && *ptr != '\n' && *ptr != '\r' && *ptr != '\t') || *ptr == 0x7f)
|
||||
break;
|
||||
}
|
||||
|
||||
if (*ptr)
|
||||
{
|
||||
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
|
||||
return (0);
|
||||
}
|
||||
if (*ptr)
|
||||
{
|
||||
if (*ptr < ' ' || *ptr == 0x7f)
|
||||
{
|
||||
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
if ((ptr - attr->values[i].string.text) > (IPP_MAX_TEXT - 1))
|
||||
{
|
||||
@@ -5041,40 +4964,44 @@ ippValidateAttribute(
|
||||
{
|
||||
if ((*ptr & 0xe0) == 0xc0)
|
||||
{
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
if ((ptr[1] & 0xc0) != 0x80)
|
||||
break;
|
||||
|
||||
ptr ++;
|
||||
}
|
||||
else if ((*ptr & 0xf0) == 0xe0)
|
||||
{
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
break;
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
if ((ptr[1] & 0xc0) != 0x80 || (ptr[2] & 0xc0) != 0x80)
|
||||
break;
|
||||
|
||||
ptr += 2;
|
||||
}
|
||||
else if ((*ptr & 0xf8) == 0xf0)
|
||||
{
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
break;
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
break;
|
||||
ptr ++;
|
||||
if ((*ptr & 0xc0) != 0x80)
|
||||
if ((ptr[1] & 0xc0) != 0x80 || (ptr[2] & 0xc0) != 0x80 || (ptr[3] & 0xc0) != 0x80)
|
||||
break;
|
||||
|
||||
ptr += 3;
|
||||
}
|
||||
else if (*ptr & 0x80)
|
||||
break;
|
||||
else if (*ptr < ' ' || *ptr == 0x7f)
|
||||
break;
|
||||
}
|
||||
|
||||
if (*ptr)
|
||||
{
|
||||
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
|
||||
return (0);
|
||||
}
|
||||
if (*ptr < ' ' || *ptr == 0x7f)
|
||||
{
|
||||
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
|
||||
return (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
if ((ptr - attr->values[i].string.text) > (IPP_MAX_NAME - 1))
|
||||
{
|
||||
@@ -6361,6 +6288,7 @@ ipp_free_values(ipp_attribute_t *attr, /* I - Attribute to free values from */
|
||||
}
|
||||
break;
|
||||
|
||||
case IPP_TAG_UNSUPPORTED_VALUE :
|
||||
case IPP_TAG_DEFAULT :
|
||||
case IPP_TAG_UNKNOWN :
|
||||
case IPP_TAG_NOVALUE :
|
||||
@@ -6702,14 +6630,14 @@ ipp_read_http(http_t *http, /* I - Client connection */
|
||||
|
||||
if ((bytes = httpRead2(http, (char *)buffer, length - (size_t)tbytes)) < 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
break;
|
||||
#else
|
||||
if (errno != EAGAIN && errno != EINTR)
|
||||
break;
|
||||
|
||||
bytes = 0;
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
else if (bytes == 0)
|
||||
break;
|
||||
@@ -6737,11 +6665,11 @@ ipp_read_file(int *fd, /* I - File descriptor */
|
||||
ipp_uchar_t *buffer, /* O - Read buffer */
|
||||
size_t length) /* I - Number of bytes to read */
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return ((ssize_t)read(*fd, buffer, (unsigned)length));
|
||||
#else
|
||||
return (read(*fd, buffer, length));
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -6840,7 +6768,9 @@ ipp_set_value(ipp_t *ipp, /* IO - IPP message */
|
||||
* Reset pointers in the list...
|
||||
*/
|
||||
|
||||
#ifndef __clang_analyzer__
|
||||
DEBUG_printf(("4debug_free: %p %s", (void *)*attr, temp->name));
|
||||
#endif /* !__clang_analyzer__ */
|
||||
DEBUG_printf(("4debug_alloc: %p %s %s%s (%d)", (void *)temp, temp->name, temp->num_values > 1 ? "1setOf " : "", ippTagString(temp->value_tag), temp->num_values));
|
||||
|
||||
if (ipp->current == *attr && ipp->prev)
|
||||
@@ -6909,9 +6839,9 @@ ipp_write_file(int *fd, /* I - File descriptor */
|
||||
ipp_uchar_t *buffer, /* I - Data to write */
|
||||
size_t length) /* I - Number of bytes to write */
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
return ((ssize_t)write(*fd, buffer, (unsigned)length));
|
||||
#else
|
||||
return (write(*fd, buffer, length));
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
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