mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-25 11:07:38 +00:00 
			
		
		
		
	Compare commits
	
		
			517 Commits
		
	
	
		
			rel-20
			...
			rel-24-rc1
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 479d7d99c1 | ||
|   | 181da30997 | ||
|   | bfebdaece8 | ||
|   | d2a134b79c | ||
|   | 74f021fb44 | ||
|   | 8e09180295 | ||
|   | f0532c98cd | ||
|   | 9e0e955daf | ||
|   | 3e44738416 | ||
|   | 02c8887543 | ||
|   | 77861f6fe2 | ||
|   | e9e3df27b7 | ||
|   | 0dc3c13469 | ||
|   | d0d4de4980 | ||
|   | 85df414907 | ||
|   | f5ff22d98f | ||
|   | 995bbfd627 | ||
|   | dd6d75d37d | ||
|   | daa88b7651 | ||
|   | 2924b3d52a | ||
|   | a335e480c5 | ||
|   | dde89b1267 | ||
|   | 455f073687 | ||
|   | 804c240320 | ||
|   | fb99d7c92e | ||
|   | 1d06ed02ce | ||
|   | c283b52a78 | ||
|   | b708c95173 | ||
|   | 722afc1b81 | ||
|   | 86a64ce6aa | ||
|   | e84000f7b8 | ||
|   | a93247d32f | ||
|   | a673a6e3af | ||
|   | 0ab4e7bffd | ||
|   | 8f0d24c831 | ||
|   | 0a6e284582 | ||
|   | 2254e92e60 | ||
|   | 7cda2f13f4 | ||
|   | 7dba1a0766 | ||
|   | 055d6e8056 | ||
|   | 432a9297f8 | ||
|   | 4dcd5f1225 | ||
|   | 6a5569c27d | ||
|   | 49ab79d0e6 | ||
|   | cedba36965 | ||
|   | 40bea95c08 | ||
|   | 7c7d03b730 | ||
|   | 4693226d69 | ||
|   | afb59ab8e5 | ||
|   | d90f0323e5 | ||
|   | 01e590b007 | ||
|   | 7b7ee6a3ca | ||
|   | 46838510ab | ||
|   | 0903343f85 | ||
|   | 182bfac855 | ||
|   | 1e386fb7ac | ||
|   | 52ccba5d1e | ||
|   | 98e9467c85 | ||
|   | e8dacb68dc | ||
|   | 398022631a | ||
|   | f2cef85fde | ||
|   | 6ed59a8548 | ||
|   | 49acb68584 | ||
|   | d8aba40f07 | ||
|   | 87887bc632 | ||
|   | cb3a4321a2 | ||
|   | 1e84b2640e | ||
|   | 86d27eaf89 | ||
|   | 4acf95ab61 | ||
|   | 57cd41d289 | ||
|   | eb9929e82c | ||
|   | c2e4c304e3 | ||
|   | c56138c280 | ||
|   | a1ce3fc779 | ||
|   | ccc899c7f4 | ||
|   | 2a52befa56 | ||
|   | 2c18e9a7f8 | ||
|   | 9811223fb8 | ||
|   | 0083fe177f | ||
|   | 34578b8b30 | ||
|   | 85dc4d8777 | ||
|   | 64c265cf33 | ||
|   | b72a7a4b96 | ||
|   | b8482fd3cf | ||
|   | 90ea23ab4f | ||
|   | 6e7e744cc6 | ||
|   | 24cec978ee | ||
|   | a02524465e | ||
|   | 813ea874f8 | ||
|   | 813897023e | ||
|   | a5ca8be658 | ||
|   | c364d67f80 | ||
|   | 5545e1bebf | ||
|   | d118cd74b6 | ||
|   | 599626d570 | ||
|   | 571b1a8b83 | ||
|   | b71a0ddbd5 | ||
|   | 7ff16e8116 | ||
|   | f6b7764eb5 | ||
|   | adfe5affed | ||
|   | 27934afd7e | ||
|   | f64cb901ef | ||
|   | d28d838cb9 | ||
|   | 2fc61ce8a6 | ||
|   | 5c48d7e9c7 | ||
|   | 0f490b5cae | ||
|   | a43d79aeff | ||
|   | 93a872a36b | ||
|   | c4245220de | ||
|   | f8f7f83f5a | ||
|   | 03c8997af3 | ||
|   | 4396936f38 | ||
|   | 4da04640e6 | ||
|   | 10c7ba99e7 | ||
|   | 1136b97690 | ||
|   | d9a97f2857 | ||
|   | a4af9024fd | ||
|   | 6fc53558ed | ||
|   | 21767c968d | ||
|   | c5da483685 | ||
|   | 4330f5d1c9 | ||
|   | 81b81c818c | ||
|   | 52825cde29 | ||
|   | 03e6568079 | ||
|   | 7dacc314f9 | ||
|   | 24adfb88b4 | ||
|   | 6ed440a030 | ||
|   | c7bbc9a390 | ||
|   | 6171beb7ab | ||
|   | 2196e945e4 | ||
|   | f16eb1b686 | ||
|   | c41f18e3f9 | ||
|   | dbfe1beca8 | ||
|   | 6bdae55177 | ||
|   | fb5ae9e844 | ||
|   | bd8d4e710c | ||
|   | 9a931a549b | ||
|   | 3c30490d54 | ||
|   | 6250335352 | ||
|   | 7e14bd3b58 | ||
|   | 31b3c83c1f | ||
|   | 6e4235443e | ||
|   | cdcf474f15 | ||
|   | f33a4067a1 | ||
|   | 100de3e4cc | ||
|   | 7b58538074 | ||
|   | 3f436e1810 | ||
|   | 967deebacd | ||
|   | 74262a4093 | ||
|   | be88707027 | ||
|   | 7d7eb735f0 | ||
|   | fa7fac88d2 | ||
|   | 84ff5a6eb9 | ||
|   | bf2eae3249 | ||
|   | ffad2da835 | ||
|   | 3f1547ecde | ||
|   | 7893dc5241 | ||
|   | 896d45471a | ||
|   | 01c3552140 | ||
|   | ce3c4074ba | ||
|   | 40ed94a1f2 | ||
|   | c1f180b87b | ||
|   | f5944a17e4 | ||
|   | 06920df4bb | ||
|   | e864b1f33e | ||
|   | 3f807e1045 | ||
|   | 39b8fc65b6 | ||
|   | 3de972e0bd | ||
|   | ec2bf5c5a2 | ||
|   | 70160b3a5b | ||
|   | a90004b913 | ||
|   | 9e79ed8605 | ||
|   | cdd6b961af | ||
|   | bfc727ce49 | ||
|   | dee824a3f0 | ||
|   | f5ae1dd36c | ||
|   | 794cb51e4b | ||
|   | dd4b74e29b | ||
|   | daed2467dd | ||
|   | d314c75a37 | ||
|   | 5009ab3e8c | ||
|   | 5713c49c84 | ||
|   | 35f1db5f28 | ||
|   | 4c2acd55c6 | ||
|   | f547981188 | ||
|   | b35f8916a5 | ||
|   | 3d7aa9f906 | ||
|   | a534e71e8d | ||
|   | a13bb78b1e | ||
|   | b130b35f48 | ||
|   | 37090a28e8 | ||
|   | 67256f9da1 | ||
|   | 7b10a0e4ee | ||
|   | 259c314d14 | ||
|   | 51396f8f1c | ||
|   | 6238196dac | ||
|   | 43fb18f2f5 | ||
|   | a4ed90ba9a | ||
|   | af9161a9bc | ||
|   | 485d0aec81 | ||
|   | abf280d5bd | ||
|   | ccc9e1baa4 | ||
|   | 755562d147 | ||
|   | 384b27cee0 | ||
|   | 6496fa4655 | ||
|   | 20b52fe33d | ||
|   | 0fc822d8c4 | ||
|   | 2e168c7809 | ||
|   | 14a84dfca5 | ||
|   | 4cb36e370e | ||
|   | e273bd226a | ||
|   | 3b24ebf122 | ||
|   | 599cfd0944 | ||
|   | 90062111f7 | ||
|   | e747fe9277 | ||
|   | 0f85c4c6a7 | ||
|   | e73d70ce6f | ||
|   | 2560e5f156 | ||
|   | 1f5508d049 | ||
|   | 97b4fd8a08 | ||
|   | fe73835666 | ||
|   | 5b4b7e2f55 | ||
|   | 8ae2cdfce9 | ||
|   | 6685ae063f | ||
|   | e2b85ccde3 | ||
|   | 7b358a57ac | ||
|   | 5d88030bd1 | ||
|   | 8872653ef6 | ||
|   | 4d4512cd72 | ||
|   | bc098794ee | ||
|   | 788da901ee | ||
|   | 2a40112f09 | ||
|   | 61b7932e82 | ||
|   | f024a4992a | ||
|   | d38747d951 | ||
|   | 18070e5381 | ||
|   | d913323ca9 | ||
|   | 9230f2fff1 | ||
|   | 86bdf6e1d4 | ||
|   | 1a628fff51 | ||
|   | bd33bd770d | ||
|   | b8433e9261 | ||
|   | 5a424f60da | ||
|   | 444308ccde | ||
|   | 1ad536eeed | ||
|   | c68ae1a9f5 | ||
|   | df7ea9e7b4 | ||
|   | 34824abe0d | ||
|   | ae00c100ac | ||
|   | 61d1c864c5 | ||
|   | 8d25044ce5 | ||
|   | c3c719b978 | ||
|   | 9ee3760493 | ||
|   | 344185b1bd | ||
|   | fcf61e9e02 | ||
|   | 9f236c4b91 | ||
|   | 00249f3c80 | ||
|   | 925b4de298 | ||
|   | 48ea69d778 | ||
|   | 80d0613bf2 | ||
|   | 4ab688c5e8 | ||
|   | 2e93129877 | ||
|   | 94148c37f5 | ||
|   | f25be28ab8 | ||
|   | fae7bd1bb7 | ||
|   | 0556aa1901 | ||
|   | 48698f14a2 | ||
|   | 8e6db769ac | ||
|   | 8a041373bb | ||
|   | 37c8699f34 | ||
|   | 788b3002d8 | ||
|   | beb9f65dc8 | ||
|   | 62865f7e19 | ||
|   | a7dda1b28c | ||
|   | cba5a2579f | ||
|   | a2479bb906 | ||
|   | 17589534d0 | ||
|   | ea26fd2840 | ||
|   | 45d3e6aa91 | ||
|   | 0bd3fb88b2 | ||
|   | c34b91d8dd | ||
|   | 56da86b4f4 | ||
|   | ea8a2bf1fc | ||
|   | 1b349b05d5 | ||
|   | 4c5b439992 | ||
|   | 86cd2da8d5 | ||
|   | 9b1fee8995 | ||
|   | 2798a12444 | ||
|   | 02182143c3 | ||
|   | b5faf3055b | ||
|   | cccd8fc957 | ||
|   | eccbd97e1f | ||
|   | ec5ab4fcd1 | ||
|   | 13a5358a3d | ||
|   | 99db111bca | ||
|   | 27b9d32bf2 | ||
|   | 0985d69cc6 | ||
|   | d0977258ee | ||
|   | 2cebfc54f5 | ||
|   | de3e5fa77c | ||
|   | b9006acee3 | ||
|   | 51231ac8d4 | ||
|   | 84ed46d4c1 | ||
|   | 849f85a05c | ||
|   | e8e0351985 | ||
|   | 131364def1 | ||
|   | bcb45da1b4 | ||
|   | 08f9d31d60 | ||
|   | 37609d6a4f | ||
|   | 33c2d5e4e2 | ||
|   | a98bbc8e0b | ||
|   | 9f74c0ff07 | ||
|   | e5cdd61fe3 | ||
|   | e3a2a6c44d | ||
|   | aad92ceafe | ||
|   | 4102e8fdfe | ||
|   | f8f8a9a041 | ||
|   | 04b947cdc3 | ||
|   | be2e611680 | ||
|   | 41f75b6974 | ||
|   | e009ccbe66 | ||
|   | 46d43dc09c | ||
|   | 44698e44e8 | ||
|   | 0ff33777fe | ||
|   | 1dc93286a0 | ||
|   | 2bacb8210b | ||
|   | 3b65f4e38d | ||
|   | 6ac5a82eec | ||
|   | 086cf3a272 | ||
|   | 8d01be7bbd | ||
|   | eb86d234f8 | ||
|   | 3af0ece2bc | ||
|   | a9ffbdea3f | ||
|   | 6dc5471a75 | ||
|   | 309122017e | ||
|   | 8f530eb315 | ||
|   | d56341c77b | ||
|   | 212d99146d | ||
|   | e2f09213bc | ||
|   | c8b12af1d2 | ||
|   | a919e02ba1 | ||
|   | b081cfb628 | ||
|   | dd4c60cf39 | ||
|   | 4828bae8d3 | ||
|   | cd38e9580e | ||
|   | aeebde4642 | ||
|   | 298158501d | ||
|   | 904c8a4375 | ||
|   | b86e33ef49 | ||
|   | 0a3d8d60d3 | ||
|   | 08d49a8fa0 | ||
|   | 8f5cbe51a7 | ||
|   | bd0de15d31 | ||
|   | fcdb5cf8dd | ||
|   | 7db8481500 | ||
|   | 74514b8c23 | ||
|   | c74115f25c | ||
|   | 672a167963 | ||
|   | 139f5961a0 | ||
|   | 5258fb7f7c | ||
|   | 15dfdaac82 | ||
|   | bb8d207efa | ||
|   | e03d8eb728 | ||
|   | a95d3e05e7 | ||
|   | 646a97de5f | ||
|   | 8e60fac73b | ||
|   | 5e775a3fae | ||
|   | 69ce65bacb | ||
|   | bf8e03c466 | ||
|   | 1254d315b9 | ||
|   | 4ec19c0332 | ||
|   | 61a6691b36 | ||
|   | 78c8212280 | ||
|   | adc8d4f6c8 | ||
|   | 24183b1a91 | ||
|   | 888c524683 | ||
|   | ae0af66d50 | ||
|   | a8ecde2553 | ||
|   | fef10f590b | ||
|   | 771e539c18 | ||
|   | 313881d0c1 | ||
|   | 3bd973037a | ||
|   | f494023b0d | ||
|   | 659d126460 | ||
|   | 76dcb08266 | ||
|   | 4cb2edf020 | ||
|   | 720eb874a9 | ||
|   | fa15eb1698 | ||
|   | b54e664a63 | ||
|   | 7adc4b8e99 | ||
|   | 5021977bb1 | ||
|   | 5115756b79 | ||
|   | f6ac0d89ae | ||
|   | 11240376a5 | ||
|   | e377f4ea47 | ||
|   | 9d3800fd15 | ||
|   | 4f525d39d4 | ||
|   | 7ea3864a93 | ||
|   | 891dbd2acc | ||
|   | f206fda8ae | ||
|   | 6beb0fad3f | ||
|   | 27fd92d580 | ||
|   | 51e5ba94b3 | ||
|   | b4d0a40383 | ||
|   | 3ab00e3a11 | ||
|   | cde2e8a277 | ||
|   | 528c8fc244 | ||
|   | 7f9bce705c | ||
|   | ce3e41cf4c | ||
|   | dd6a058992 | ||
|   | 7ed06b2189 | ||
|   | a14eb495b7 | ||
|   | 0131e1e00b | ||
|   | 8618e942e6 | ||
|   | 2fea782efc | ||
|   | a2e26aad1e | ||
|   | b4393277ea | ||
|   | b33da9b8f3 | ||
|   | 3e35857080 | ||
|   | b25fd8a98c | ||
|   | be08349dcb | ||
|   | 3228f1b267 | ||
|   | a53de63ba7 | ||
|   | e8f512bfe7 | ||
|   | bb31d7b88c | ||
|   | 7f99f7c14f | ||
|   | 883a8fa6f1 | ||
|   | a7b04ce6cf | ||
|   | bd1b727187 | ||
|   | 19d6f4740e | ||
|   | 0f0f4f41b8 | ||
|   | 221365d8ef | ||
|   | 2c96966431 | ||
|   | 65359ff8f7 | ||
|   | d0c9f4a692 | ||
|   | d5763937ad | ||
|   | 25b19e08e2 | ||
|   | 0e63fb3fa7 | ||
|   | 3e72331896 | ||
|   | 1438771124 | ||
|   | b95dfb3ffd | ||
|   | 4b15f10fbb | ||
|   | 628c14d656 | ||
|   | 2cb7023e28 | ||
|   | 69c3f96998 | ||
|   | 5c6875d768 | ||
|   | a78c7b3898 | ||
|   | ac32d07aaf | ||
|   | 7fce719142 | ||
|   | cb7e4e8679 | ||
|   | 35452b3157 | ||
|   | e90d30a2cc | ||
|   | 45ab73ac81 | ||
|   | 78978994df | ||
|   | 19cb29da51 | ||
|   | 6ed3b6f85c | ||
|   | 5b8f13a4a9 | ||
|   | b6e6e2e1da | ||
|   | 7c7fc8b5c4 | ||
|   | 1a5e08f3f6 | ||
|   | e051ea06fc | ||
|   | a7023113e7 | ||
|   | 02e24f5d1e | ||
|   | 13740c1bf4 | ||
|   | 8212b730c7 | ||
|   | a4daa613ae | ||
|   | 5dce3301bd | ||
|   | a917514546 | ||
|   | 4dc940f59e | ||
|   | 5facf5c15e | ||
|   | 1e8b775a7a | ||
|   | 0ad0fe207a | ||
|   | f295117fba | ||
|   | 8ab097afb7 | ||
|   | 84e24afd2f | ||
|   | f16d230530 | ||
|   | 3a3b3225d4 | ||
|   | 84a599ece4 | ||
|   | b7690a0add | ||
|   | 18ecc2fd81 | ||
|   | 999c11ad49 | ||
|   | c891b5f250 | ||
|   | 419ff38a07 | ||
|   | 8d8201502f | ||
|   | d38d153f51 | ||
|   | fd260404ca | ||
|   | a551942635 | ||
|   | b60d5a0a11 | ||
|   | fae0054d31 | ||
|   | 73fded7515 | ||
|   | 7630e8ffc6 | ||
|   | 4552ad5269 | ||
|   | 3d49e8ac84 | ||
|   | 508ca3044d | ||
|   | d8f2964710 | ||
|   | ab00997698 | ||
|   | b4966aa1bd | ||
|   | 0703fcd719 | ||
|   | 4594583f52 | ||
|   | 68cb1a8c2e | ||
|   | 21493731df | ||
|   | 950aeec3ff | ||
|   | 1f59821270 | ||
|   | 60a9a7f118 | ||
|   | 8ec09e3ca4 | ||
|   | 289a26e9e4 | ||
|   | 3e47bc9af5 | ||
|   | d2a1f6aa4b | ||
|   | f68aa02272 | ||
|   | 588af510a3 | ||
|   | 9e1c25a889 | ||
|   | 5d92198487 | ||
|   | 20ddffca0d | ||
|   | 25e56a5e83 | ||
|   | 1e5a7aac87 | ||
|   | b5b3dd9cfd | ||
|   | 92fba63ad8 | 
							
								
								
									
										4
									
								
								.clang_complete
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								.clang_complete
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| -I./src | ||||
| -I./src/ipaddr | ||||
| -I./src/portab | ||||
| -I./src/tool | ||||
							
								
								
									
										20
									
								
								.editorconfig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								.editorconfig
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| # ngIRCd -- The Next Generation IRC Daemon | ||||
| # Copyright (c)2001-2016 Alexander Barton (alex@barton.de) and Contributors. | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| # the Free Software Foundation; either version 2 of the License, or | ||||
| # (at your option) any later version. | ||||
| # Please read the file COPYING, README and AUTHORS for more information. | ||||
|  | ||||
| # .editorconfig: Editor settings, see <http://editorconfig.org>. | ||||
|  | ||||
| root = true | ||||
|  | ||||
| [*] | ||||
| indent_style = tab | ||||
| indent_size = 8 | ||||
| end_of_line = lf | ||||
| charset = utf-8 | ||||
| trim_trailing_whitespace = true | ||||
| insert_final_newline = true | ||||
							
								
								
									
										44
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										44
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +1,5 @@ | ||||
| Makefile | ||||
| Makefile.am | ||||
| Makefile.in | ||||
| aclocal.m4 | ||||
| ansi2knr.1 | ||||
| @@ -7,11 +8,15 @@ ansi2knr.h | ||||
| ar-lib | ||||
| autom4te.cache | ||||
| build-stamp-ngircd* | ||||
| build+* | ||||
| compile | ||||
| config.cache | ||||
| config.log | ||||
| config.status | ||||
| configure | ||||
| configure.ac | ||||
| configure.lineno | ||||
| cov-int | ||||
| cscope.out | ||||
| debian | ||||
| depcomp | ||||
| @@ -21,3 +26,42 @@ ngircd.dest | ||||
| .deps | ||||
| *.a | ||||
| *.o | ||||
| doc/sample-ngircd.conf | ||||
| doc/src/html | ||||
| man/ngircd.8 | ||||
| man/ngircd.conf.5 | ||||
| src/config.h | ||||
| src/config.h.in | ||||
| src/config.h.in~ | ||||
| src/stamp-h1 | ||||
| src/ngircd/check-help | ||||
| src/ngircd/check-version | ||||
| src/ngircd/ngircd | ||||
| src/ngircd/ngircd.exe | ||||
| src/portab/portabtest | ||||
| src/portab/portabtest.exe | ||||
| src/testsuite/*.e_ | ||||
| src/testsuite/channel-test | ||||
| src/testsuite/connect-test | ||||
| src/testsuite/invite-test | ||||
| src/testsuite/join-test | ||||
| src/testsuite/kick-test | ||||
| src/testsuite/logs | ||||
| src/testsuite/message-test | ||||
| src/testsuite/misc-test | ||||
| src/testsuite/mode-test | ||||
| src/testsuite/ngircd-test1.log | ||||
| src/testsuite/ngircd-test1.motd | ||||
| src/testsuite/ngircd-test2.log | ||||
| src/testsuite/ngircd-test2.motd | ||||
| src/testsuite/opless-channel-test | ||||
| src/testsuite/server-link-test | ||||
| src/testsuite/server-login-test | ||||
| src/testsuite/T-ngircd1 | ||||
| src/testsuite/T-ngircd1.exe | ||||
| src/testsuite/T-ngircd2 | ||||
| src/testsuite/T-ngircd2.exe | ||||
| src/testsuite/tests | ||||
| src/testsuite/tests-skipped.lst | ||||
| src/testsuite/who-test | ||||
| src/testsuite/whois-test | ||||
|   | ||||
							
								
								
									
										12
									
								
								.mailmap
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								.mailmap
									
									
									
									
									
								
							| @@ -1,4 +1,14 @@ | ||||
| # mailmap file for git-[short]log and git-blame | ||||
| # use "git shortlog -se" to see the list of all authors. | ||||
|  | ||||
| Alexander Barton <alex@barton.de> <anonymous> | ||||
| Alexander Barton <alex@barton.de> <alex@kfreebsd.barton.de> | ||||
|  | ||||
| Alexander Barton <anonymous> | ||||
| Ali Shemiran <ashemira@ucsd.edu> | ||||
|  | ||||
| Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu> <dana@cs.ucsd.edu> | ||||
| Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu> <dana+70@cs.ucsd.edu> | ||||
|  | ||||
| DNS <dns@rbose.org> | ||||
|  | ||||
| LucentW <lucent@zebes.info> <LucentW@users.noreply.github.com> | ||||
|   | ||||
							
								
								
									
										16
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| language: c | ||||
| sudo: false | ||||
| addons: | ||||
|   apt: | ||||
|     packages: | ||||
|     - libident-dev | ||||
|     - libpam0g-dev | ||||
|     - libssl-dev | ||||
|     - libwrap0-dev | ||||
|     - zlib1g-dev | ||||
|     - expect | ||||
|     - telnet | ||||
| compiler: | ||||
|   - gcc | ||||
|   - clang | ||||
| script: ./autogen.sh && ./configure --enable-ipv6 --with-iconv --with-ident --with-openssl --with-pam --with-tcp-wrappers --with-zlib && make check | ||||
							
								
								
									
										65
									
								
								AUTHORS
									
									
									
									
									
								
							
							
						
						
									
										65
									
								
								AUTHORS
									
									
									
									
									
								
							| @@ -2,45 +2,68 @@ | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2012 Alexander Barton and Contributors. | ||||
|                (c)2001-2016 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
|                        -- AUTHORS and CONTRIBUTORS -- | ||||
|  | ||||
|  | ||||
| Note: If you have critics, patches or something else, please feel free to | ||||
| post a mail to the ngIRCd mailing list: <ngircd-ml@arthur.barton.de> (please | ||||
| see <http://ngircd.barton.de/#ml> for details). | ||||
| Note: | ||||
| If you have comments, patches or something else, please feel free to post | ||||
| a mail to the ngIRCd mailing list: <ngircd-ml@ngircd.barton.de> (please see | ||||
| <http://ngircd.barton.de/support.php> for details) or join the ngIRCd IRC | ||||
| channel: <irc://irc.barton.de/ngircd>. | ||||
|  | ||||
| Don't mail the people listed here directly, if possible! | ||||
|  | ||||
|  | ||||
| Main Authors | ||||
| ~~~~~~~~~~~~ | ||||
| Alexander Barton, <alex@barton.de> (alex) | ||||
| Florian Westphal, <fw@strlen.de> | ||||
| Alexander Barton <alex@barton.de> | ||||
| Florian Westphal <fw@strlen.de> | ||||
|  | ||||
|  | ||||
| Contributors | ||||
| ~~~~~~~~~~~~ | ||||
| Ali Shemiran, <ashemira@ucsd.edu> | ||||
| Ask Bjørn Hansen, <ask@develooper.com> | ||||
| Benjamin Pineau, <ben@zouh.org> | ||||
| Brandon Beresini, <beresini@google.com> | ||||
| Bryan Caldwell, <bcaldwel@ucsd.edu> | ||||
| Dana Dahlstrom, <dana+ngIRCd@cs.ucsd.edu> | ||||
| Eric Grunow, <egrunow@ucsd.edu> | ||||
| Goetz Hoffart, <goetz@hoffart.de> | ||||
| Ilja Osthoff, <i.osthoff@gmx.net> | ||||
| Jari Aalto, <jari.aalto@cante.net> | ||||
| Rolf Eike Beer, <eike@sf-mail.de> | ||||
| Scott Perry, <scperry@ucsd.edu> | ||||
| Sean Reifschneider, <jafo-rpms@tummy.com> | ||||
| Ali Shemiran <ashemira@ucsd.edu> | ||||
| Ask Bjørn Hansen <ask@develooper.com> | ||||
| Benjamin Pineau <ben@zouh.org> | ||||
| Brandon Beresini <beresini@google.com> | ||||
| Brett Smith <brett@w3.org> | ||||
| Brian Collins <bricollins@gmail.com> | ||||
| Bryan Caldwell <bcaldwel@ucsd.edu> | ||||
| Christian Aistleitner <christian@quelltextlich.at> | ||||
| Christoph Biedl <ngircd.anoy@manchmal.in-ulm.de> | ||||
| Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu> | ||||
| David Kingston <deathking1337@aim.com> | ||||
| DNS <dns@rbose.org> | ||||
| Eric Grunow <egrunow@ucsd.edu> | ||||
| Federico G. Schwindt <fgsch@lodoss.net> | ||||
| Gabor Adam Toth <tg@tgbit.net> | ||||
| Goetz Hoffart <goetz@hoffart.de> | ||||
| Ian Chard <ian@chard.org> | ||||
| Ilja Osthoff <i.osthoff@gmx.net> | ||||
| Jari Aalto <jari.aalto@cante.net> | ||||
| LucentW <lucent@zebes.info> | ||||
| Mantas Mikulėnas <grawity@gmail.com> | ||||
| Neale Pickett <neale@woozle.org> | ||||
| Peter Powell <petpow@saberuk.com> | ||||
| Rolf Eike Beer <eike@sf-mail.de> | ||||
| Roy Sindre Norangshol <roy.sindre@norangshol.no> | ||||
| Scott Perry <scperry@ucsd.edu> | ||||
| Sean Reifschneider <jafo-rpms@tummy.com> | ||||
| Sebastian Köhler <sebkoehler@whoami.org.uk> | ||||
| Tassilo Schweyer <dev@welterde.de> | ||||
| Tom Ryder <tom@sanctum.geek.nz> | ||||
| Unit 193 <unit193@ubuntu.com> | ||||
| William Pitcock <nenolod@dereferenced.org> | ||||
| Yecheng Fu <cofyc.jackson@gmail.com> | ||||
| xor <xorboy@gmail.com> | ||||
|  | ||||
|  | ||||
| Code snippets | ||||
| ~~~~~~~~~~~~~ | ||||
| J. Kercheval: pattern matching functions | ||||
| Patrick Powell, <papowell@astart.com>: snprintf()-function | ||||
| Andrew Tridgell & Martin Pool: strl{cpy|cat}()-functions | ||||
| John Kercheval: pattern matching functions | ||||
| Patrick Powell <papowell@astart.com>: snprintf()-function | ||||
|   | ||||
							
								
								
									
										574
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										574
									
								
								ChangeLog
									
									
									
									
									
								
							| @@ -2,18 +2,526 @@ | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2012 Alexander Barton and Contributors. | ||||
|                (c)2001-2016 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
|                                -- ChangeLog -- | ||||
|  | ||||
|  | ||||
| ngIRCd 24 | ||||
|  | ||||
|   ngIRCd 24~rc1 (2017-01-07) | ||||
|   - Enhance systemd service file, and install it in Debian package. | ||||
|   - Update configuration of Debian package. | ||||
|   - Log privilege violations and failed OPER request with log level "error" | ||||
|     and send it to the "&SERVER" channel, too. | ||||
|   - Immediately shut down connection when receiving an "ERROR" command, | ||||
|     don't wait for the peer to close the connection. This allows the daemon | ||||
|     to forward the received "ERROR" message in the network, instead of the | ||||
|     very generic "client closed connection" message. | ||||
|   - Fix sending of entry duration (no negative values!) when synchronizing | ||||
|     "x-lines" (G-LINES). | ||||
|   - List expiration (G-LINES): use same log level as when setting, and log | ||||
|     this event to the &SERVER channel, too. | ||||
|   - Explicitly forbid remote servers to modify "x-lines" (G-LINES) when the | ||||
|     "AllowRemoteOper" configuration option isn't set, even when the command | ||||
|     seems to originate from the remote server itself: this prevents GLINE's | ||||
|     to become set during server handshake in this case (what wouldn't be | ||||
|     possible during regular runtime when a remote IRC Op sends the command) | ||||
|     and what can't be undone by IRC Ops later on (because of the missing | ||||
|     "AllowRemoteOper" option) ... | ||||
|   - Make scripts and init-files in ./contrib executable. | ||||
|   - Fix building ngIRCd with OpenSSL 1.1. Thanks to Christoph Biedl | ||||
|     <ngircd.anoy@manchmal.in-ulm.de> for the patch! | ||||
|   - Fix code indentation warnings of gcc 6.2. | ||||
|   - Update config.guess (2016-04-02) and config.sub (2016-03-30) files. | ||||
|   - Fix warnings of the "shellcheck" linter in autogen.sh, contrib/ngindent | ||||
|     and contrib/platformtest.sh. | ||||
|   - Update Xcode project for latest Xcode version (8.0), and fix "duplicate | ||||
|     symbols" error messages when building (linking) the binary. | ||||
|   - Add "Documentation" variables to systemd configuration files. | ||||
|   - Make sure that SYSCONFDIR is always set, which can be handy when | ||||
|     using source code linters when ./configure hasn't been run already. | ||||
|   - Add the new "PAMServiceName" configuration option to specify the name | ||||
|     used as PAM service name. This setting allows to run multiple ngIRCd | ||||
|     instances with different PAM configurations for each instance. | ||||
|     Thanks to Christian Aistleitner <christian@quelltextlich.at> for the | ||||
|     patch, closes #226. | ||||
|   - Add an ".editorconfig" file to the project. | ||||
|   - Travis-CI: use "container-based infrastructure". | ||||
|   - Limit the number of message targets, and suppress duplicates: This | ||||
|     prevents an user from flooding the server using commands like this: | ||||
|     "PRIVMSG nick1,nick1,nick1,...". | ||||
|     Duplicate targets are suppressed silently (channels and clients). | ||||
|     In addition, the maximum number of targets per PRIVMSG, NOTICE, ... | ||||
|     command are limited to MAX_HNDL_TARGETS (25). If there are more, the | ||||
|     daemon sends the new 407 (ERR_TOOMANYTARGETS_MSG) numeric, containing | ||||
|     the first target that hasn't been handled any more. Closes #187. | ||||
|   - Test suite: Add new test for server-server logins. | ||||
|   - contrib/ngindent: Fix shebang line. | ||||
|   - Make contrib/platformtest.sh script more portable, and only show | ||||
|     "runs=Y" when the test suite really has been passed successfully. | ||||
|   - Code cleanup in the NJON handler and the function killing clients as | ||||
|     well as the function sending messages to a "mask" (cleaner code, more | ||||
|     fault tolerant, better code comments). | ||||
|   - Update and enhance documentation: README file, doc/Platforms.txt, | ||||
|     doc/Modes.txt, doc/Commands.txt, doc/PAM.txt. | ||||
|   - Fix NJOIN not propagating "half ops" status: ngIRCd tested for the wrong | ||||
|     prefix of "half ops" when processing NJOIN commands and therefore never | ||||
|     classified a remote user as "half op". | ||||
|     Thanks to wowaname for pointing this out on #ngircd! | ||||
|  | ||||
| ngIRCd 23 (2015-11-16) | ||||
|  | ||||
|   - Explicitly cast time_t to long when printing it out: this prevents | ||||
|     wrong sized data types on platforms where time_t doesn't equal a | ||||
|     long any more, for example on OpenBSD (which would result in garbled | ||||
|     output on those platforms). | ||||
|   - contrib/Debian/changelog: Fix email address. | ||||
|   - Documentation: Spelling fixes; update doc/Platforms.txt. | ||||
|  | ||||
|   ngIRCd 23~rc1 (2015-09-06) | ||||
|   - Add ".clang_complete" file, which is used by the "linter-clang" package | ||||
|     of the Atom editor, for example. | ||||
|   - Make server-to-server protocol more robust: ngIRCd now catches more | ||||
|     errors on the server-to-server (S2S) protocol that could crash the | ||||
|     daemon before. This hasn't been a real problem because the IRC S2S | ||||
|     protocol is "trusted" by design, but the behavior is much better now. | ||||
|     Thanks to wowaname on #ngircd for pointing this out! | ||||
|   - Make platformtest.sh, autogen.sh, and ngircd.init more portable. | ||||
|   - Enables "reproducible builds" for ngIRCd: Use the optional BIRTHTIME | ||||
|     constant while building ngIRCd, which contains a time stamp for the | ||||
|     "Birth Date" information, in seconds since the epoch. | ||||
|     See <https://wiki.debian.org/ReproducibleBuilds>. | ||||
|   - Update "contrib/ngircd.service" file for systemd. | ||||
|   - INSTALL: Add deprecation notice for "PredefChannelsOnly" variable. | ||||
|   - Use "NOTICE *" before registration instead of "NOTICE AUTH". "AUTH" is | ||||
|     a valid nickname so sending notices to it is probably not a good idea. | ||||
|     Use "*" as the target instead as done with numerics when the nick is not | ||||
|     available. This mimics the behavior in Charybdis, IRCD-Hybrid, InspIRCd | ||||
|     2.2, Plexus 4, etc. Closes #217. | ||||
|     The "NoticeAuth" configuration variable (ngircd.conf) has been renamed | ||||
|     to "NoticeBeforeRegistration" accordingly, but the old name is still | ||||
|     supported for compatibility reasons. | ||||
|   - Implement new channel mode "N" (regular users can't change their nick | ||||
|     name while on this channel). Closes #214. | ||||
|   - README, AUTHORS: Update mailing list and issue tracker URLs. | ||||
|   - Remove doc/GIT.txt (it is outdated), update doc/Contributing.txt: | ||||
|     ngIRCd uses GitHub, and Git itself is quite common today. So don't | ||||
|     include an own Git "mini HowTo" any longer. | ||||
|   - Specify session context for OpenSSL clients. This enables some OpenSSL | ||||
|     clients, including Pidgin and stunnel 5.06, to reuse a session. | ||||
|     Patch by Tom Ryder <tom@sanctum.geek.nz>, thanks! Closes #182. | ||||
|   - Keep track of who placed bans, invites, and excepts. | ||||
|     Idea and implementation by LucentW, Thanks! Closes #203. | ||||
|   - Make setgroups(3) function optional: For example, Interix is missing | ||||
|     this function, which prevented ngIRCd to build on this platform. When | ||||
|     setgroups(3) isn't available, a warning message is issued on startup. | ||||
|   - Implement numeric RPL_LISTSTART(321). lightIRC and other clients | ||||
|     expecting RPL_LISTSTART should now behave correctly. | ||||
|     Idea and implementation by LucentW, Thanks! Closes #207. | ||||
|   - Update ngircd.conf.5: "CloakUserToNick" hides user _and_ real name. | ||||
|     This closes #208. | ||||
|   - Fix case insensitive pattern matching: Up to now, only the the input | ||||
|     string became lowercased and was then compared to the pattern -- which | ||||
|     failed when the pattern itself wasn't all lowercase! | ||||
|   - Streamline the effect of "MorePrivacy" option: Update documentation | ||||
|     in ngircd.conf(5); don't hide channels for IRC Ops on LIST and don't | ||||
|     hide IP addresses/hostnames on WHOIS when "MorePrivacy" is in effect. | ||||
|     This closes #198. | ||||
|   - IRC operators now can kick anyone when "OperCanMode" is set. | ||||
|     Idea and implementation by LucentW, Thanks! Closes #202. | ||||
|   - Implement user mode "I": Hide channels on WHOIS: this mode prevents | ||||
|     ngIRCd from showing channels on WHOIS (IRC Operators can always see | ||||
|     the channel list). | ||||
|     Idea and implementation by LucentW, Thanks! Closes #197. | ||||
|   - INVITE command: Implement ERR_USERNOTONSERV(504) numeric and make sure | ||||
|     that the target user is on the same server when inviting other users | ||||
|     to local ("&") channels. | ||||
|     Idea by Cahata, thanks! Closes #183. | ||||
|   - INVITE command: Enforce 1 second penalty time, which prevents flooding | ||||
|     of the target client. | ||||
|     This closes #186. Reported by Cahata, thanks! | ||||
|   - MODE command: Always report channel creation time. Up to now when | ||||
|     receiving a MODE command, ngIRCd only reported the channel creation | ||||
|     time to clients that were members of the channel. This patch reports | ||||
|     the channel creation time to all clients, regardless if they are joined | ||||
|     to that channel or not. At least ircd-seven behaves like this. | ||||
|     This closes #188. Reported by Cahata, thanks! | ||||
|   - Update Xcode project for latest Xcode version (6.3). | ||||
|  | ||||
| ngIRCd 22.1 (2015-04-06) | ||||
|  | ||||
|   - Update doc/Platforms.txt and doc/FAQ.txt. | ||||
|   - Fix spelling of RPL_WHOISBOT message text. | ||||
|   - Don't send nick name as default PART reason: No other IRC daemon seems | ||||
|     to do this (today?). Closes #185. | ||||
|     Reported by Cahata in #ngircd, thanks! | ||||
|   - Fix "WHO #<chan>" showing invisible users and hiding all visible, the | ||||
|     logic was reversed! This bug has been introduced by commit c74115f2, | ||||
|     "Simplify mode checking on channels and users within a channel", ngIRCd | ||||
|     releases 21, 21.1, and 22 are affected :-( Problem reported by Cahata | ||||
|     in #ngircd, Thanks! | ||||
|   - Fix typo in src/testsuite/README | ||||
|   - Auth PING: Fix our information text for manual sending of "PONG". Up to | ||||
|     now, ngIRCd doesn't send a valid IRC command at all, oops! | ||||
|   - Auth PING: Fix internal time stamp conversion and don't send a prefix in | ||||
|     our PING command. The prefix confuses WeeChat, at least, which doesn't | ||||
|     send an appropriate PONG in the case ... | ||||
|     Debugging and patch by "wowaname" on #ngircd, thanks! | ||||
|   - Fix syntax of ERR_LISTFULL_MSG(478) numeric. Pointed out by "wowaname" | ||||
|     in #ngircd, thanks! | ||||
|   - Enhance debug messages while sending CHANINFO commands. | ||||
|   - Reset "last try" timer when enabling a passive server. This results in | ||||
|     a new connection attempt as soon as possible. | ||||
|   - Change log message for "Can't resolve address" and for IP address | ||||
|     forgeries. | ||||
|   - doc/HowToRelease.txt: Add note about the bug tracker. | ||||
|   - Update "CipherList" to not enable SSLv3 by default. Idea, initial patch, | ||||
|     and testing by Christoph Biedl <ngircd.anoy@manchmal.in-ulm.de>. | ||||
|   - Change ngIRCd test suite not to use DNS lookups: Different operating | ||||
|     systems do behave quite differently when doing DNS lookups, for example | ||||
|     "127.0.0.1" sometimes resolves to "localhost" and sometimes to | ||||
|     "localhost.localdomain" (for example OpenBSD). And other OS resolve | ||||
|     "localhost" to the real host name (for example Cygwin). So not using | ||||
|     DNS at all makes the test site much more portable. | ||||
|  | ||||
| ngIRCd 22 (2014-10-11) | ||||
|  | ||||
|   - Match all list patterns case-insensitive: this affects the invite-, | ||||
|     ban-, and except lists, as well as G-Lines an K-Lines. | ||||
|     Problem pointed out by "wowaname" on #ngircd, thanks! | ||||
|  | ||||
|   ngIRCd 22~rc1 (2014-09-29) | ||||
|   - Sync "except lists" between servers: Up to now, ban, invite, and G-Line | ||||
|     lists have been synced between servers while linking -- but obviously | ||||
|     nobody noticed that except list have been missing ever since. Until now. | ||||
|     Thanks to "j4jackj", who reported this issue in #ngircd. | ||||
|   - Allow longer user names (up to 63 characters) for authentication. | ||||
|   - Correctly check that a server has a valid hostname and port, thanks to | ||||
|     David Binderman <dcb314@hotmail.com> who reported this bug. | ||||
|   - Fix the function which generates complete "IRC masks" from user input, | ||||
|     don't destroy the source buffer and use all provided parts (nick, user, | ||||
|     host name). This fixes GLINEs/KLINEs from not working in some situations. | ||||
|   - Increase MAX_SERVERS from 16 to 64: There are installations out there | ||||
|     that would like to configure more than 16 links per server, so increase | ||||
|     this limit. Best would be to get rid of MAX_SERVERS altogether and make | ||||
|     if fully dynamic, but start with this quick and dirty hack ... | ||||
|   - Debian: Don't adjust path names that are correct by default and correctly | ||||
|     set and use "docdir". | ||||
|   - Update config.guess and config.sub to recent versions. | ||||
|   - Test suite/platformtest.sh: Detect when tests have been skipped. | ||||
|   - doc/Bopm.txt: Update "connregex" and "kline" for current ngIRCd. | ||||
|   - Allow "DefaultUserModes" to set all possible modes, including modes only | ||||
|     settable by IRC Operators. | ||||
|   - Spoofed prefixes: Really kill connection on non-server links. | ||||
|   - Implement user mode "F": "relaxed flood protection". Clients with mode | ||||
|     "F" set are allowed to rapidly send data to the daemon. This mode is only | ||||
|     settable by IRC Operators and can cause problems in the network -- so be | ||||
|     careful and only set it on "trusted" clients! | ||||
|     User mode "F" is used by Bahamut for this purpose, for example. | ||||
|   - Handle "throttling" in a single function: ngIRCd implements "command | ||||
|     throttling" and "bps throttling" (bytes per second). The states are | ||||
|     detected in different functions, Conn_Handler() and Read_Request(), but | ||||
|     handle the actual "throttling" in a common function: this enables us to | ||||
|     guarantee consistent behavior and to disable throttling for special | ||||
|     connections in only one place | ||||
|   - Use server password when PAM is compiled in but disabled. | ||||
|   - Streamline punctuation of log messages. | ||||
|   - Return ISUPPORT(005) numerics on "VERSION". This is how ircd-seven, | ||||
|     Charybdis, Hybrid, and InspIRCd behave, for example. | ||||
|   - configure: Only link "contrib/Debian" if it exists, which isn't the case | ||||
|     on "VPATH builds", for example. | ||||
|   - Show the account name in WHOIS. This uses the same numeric as Charybdis | ||||
|     and ircu families: WHOISLOGGEDIN(330). | ||||
|   - Pattern matching: Remove "range matching" in our pattern matching code | ||||
|     using the "[...]" syntax, because [ and ] are valid characters in nick | ||||
|     names and one has to quote them currently using the "\" character, which | ||||
|     is quite unexpected for users. | ||||
|   - platformtest.sh: New option "-x", don't regenerate build system and | ||||
|     allow using separate source and build trees. | ||||
|   - Test suite: explicitly enable glibc memory checking. | ||||
|   - Make "MODE -k" handling more robust and compatible, send "fake '*' key" | ||||
|     in all replies. | ||||
|   - Update configure.ng: ngIRCd requires GNU autoconf 2.61 for generating its | ||||
|     build system, so update the build system accordingly and implement all | ||||
|     changes that autoupdate(1) suggests: Update AC_PREREQ and AC_INIT, use | ||||
|     AC_LINK_IFELSE, AC_RUN_IFELSE, and AC_COMPILE_IFELSE, and remove | ||||
|     AC_TYPE_SIGNAL (we don't use RETSIGTYPE). | ||||
|   - portabtest: Actually test the functions snprintf(), strlcpy(), strlcat(), | ||||
|     and vsnprintf() for correctness, not only existence (which was quite | ||||
|     useless, because if they weren't available, the program could not have | ||||
|     been linked at all ...). | ||||
|   - Implement new configuration option "Network": it is used to set the | ||||
|     (completely optional) "network name", to which this instance of the | ||||
|     daemon belongs. When set, this name is used in the ISUPPORT(005) numeric | ||||
|     which is sent to all clients connecting to the server after logging in. | ||||
|   - Update doc/Platforms.txt. | ||||
|   - Various code cleanups, remove unused code, streamline error handling. | ||||
|     Remove all imp.h and exp.h header files, support non-standard vsnprintf() | ||||
|     return codes, and fix some K&R C portability issues. Streamline | ||||
|     DEBUG_ARRAY, DEBUG_BUFFER, DEBUG_IO, DEBUG_ZIP definitions. | ||||
|   - Increase penalty time to 10 seconds when handling OPER commands with an | ||||
|     invalid password. | ||||
|  | ||||
| ngIRCd 21.1 (2014-03-25) | ||||
|  | ||||
|   - Don't ignore but use the server password when PAM is compiled in but | ||||
|     disabled. Thanks to Roy Sindre Norangshol <roy.sindre@norangshol.no>! | ||||
|   - doc/Platforms.txt: Update from master branch. | ||||
|   - Really kill connections that send "spoofed prefixes" on non-server links. | ||||
|     This fixes commit 6cbe1308 which only killed the connection when the | ||||
|     spoofed prefix itself belonged to a non-server client. | ||||
|   - CHARCONV command: Fix handling conversion errors, don't overwrite already | ||||
|     converted text! | ||||
|   - doc/Services.txt: Update information for Anope 2.x. | ||||
|   - Correctly use cloaked IRC masks on "INVITE nickname": The cloaked IRC mask | ||||
|     of a user is his visible mask, so the daemon has to use it for generating | ||||
|     the "one time" entries for the invite list of the given channel, and not | ||||
|     the "real" mask which will never match while the target client is "+x", and | ||||
|     even worse, will disclose the real mask on "MODE #channel +I" commands :-/ | ||||
|     Bug reported by Cahata on #ngircd, thanks! | ||||
|   - configure: Only link "contrib/Debian" if it exists. This isn't the case on | ||||
|     "VPATH builds", for example. | ||||
|   - Use $(MKDIR_P) instead of $(mkinstalldirs) in Makefile's and test for | ||||
|     "mkdir -p" using AC_PROG_MKDIR_P in "configure". | ||||
|   - Fix configure script and "make check" for TCP Wrappers (problems spotted on | ||||
|     OpenBSD): add missing #include's and static variables, and add libwrap at | ||||
|     the end of the configure run because if libwrap becomes added earlier, | ||||
|     other tests may fail. | ||||
|   - configure: add support for the LDFLAGS_END and LIBS_END variables to add | ||||
|     linker flags and libraries at the end of the configure run (CFLAGS_END has | ||||
|     been implemented already). | ||||
|   - platformtest.sh and Makefile.am: Don't use "test -e", it isn't portable. | ||||
|   - Update Copyright notices for 2014 :-) | ||||
|   - Fix permanent {G|K}LINES (with a timeout of 0 seconds). | ||||
|   - WEBIRC: Don't set the hostname received by the WEBIRC command when DNS | ||||
|     lookups are disabled, but use the IP address instead. | ||||
|     Reported by Toni Spets <toni.spets@iki.fi>, thanks! | ||||
|   - Check for working getaddrinfo() function: At least AIX 4.3.3 and 5.1 have a | ||||
|     broken implementation of getaddrinfo() which doesn't handle "0" as numeric | ||||
|     service correctly. This patch adds a configure check for this case and | ||||
|     changes all calling functions to only use getaddrinfo() if it "works". | ||||
|     See <http://www.stacken.kth.se/lists/heimdal-discuss/2004-05/msg00059.html> | ||||
|   - Only use the unsetenv() function when it is available (AIX 4.3 doesn't | ||||
|     support it, for example). | ||||
|   - Make sure that the source code is still compatible with the "ansi2knr" tool | ||||
|     and builds using non-ANSI K&R C compilers. Tested with Apple C on A/UX. | ||||
|   - Fix building ngIRCd without support for ZLIB compression.  Reported by | ||||
|     "der_baer" on #ngircd, thanks! | ||||
|  | ||||
| ngIRCd 21 (2013-10-30) | ||||
|  | ||||
|   - ./contrib/Debian/ngircd.init: Make sure no stale PID file is left over | ||||
|     when (re-)starting ngIRCd. | ||||
|   - Change ./contrib/platformtest.sh and update ./doc/Platforms.txt to | ||||
|     allow user names up to 8 characters. | ||||
|   - Call arc4random_stir() in forked subprocesses, when available. This | ||||
|     is required by FreeBSD <10 and current NetBSD at least to correctly | ||||
|     initialize the "arc4" random number generator on these platforms. | ||||
|   - Update our own Debian package configuration and fix the default path | ||||
|     of the "HelpFile" of the "full" package variants. | ||||
|  | ||||
|   ngIRCd 21~rc2 (2013-10-20) | ||||
|   - Report the correct configuration file name on configuration errors, | ||||
|     support longer configuration lines, and warn when lines are truncated. | ||||
|   - Use arc4random() function to generate "random" numbers, when available. | ||||
|   - platformtest.sh: Detect clang compiler, and clean up GIT source tree | ||||
|     before building (when possible). | ||||
|   - Update (date of) manual pages. | ||||
|   - Update "Upgrade Information" in INSTALL file, add more systems to | ||||
|     doc/Platforms.txt, and fix spelling in NEWS and ChangeLog files =:) | ||||
|   - Fix remaining compiler warnings on OpenBSD. | ||||
|  | ||||
|   ngIRCd 21~rc1 (2013-10-05) | ||||
|   - Actually KILL clients on GLINE/KLINE. (Closes bug #156) | ||||
|   - Adjust log messages for invalid and spoofed prefixes, which cleans up | ||||
|     logging of commands related to already KILL'ed clients. And don't | ||||
|     forward KILL commands for (already) unknown clients any more to prevent | ||||
|     unnecessary duplicates. | ||||
|   - Add support to show all user links using the "STATS L" (uppercase) | ||||
|     command (restricted to IRC Operators). | ||||
|   - Fixed blocking of server reconnects in some error configurations. | ||||
|   - Don't ignore SSL-related errors during startup any more: abort startup | ||||
|     when SSL is requested by the configuration but can't be initialized and | ||||
|     don't continue only listening on plain text communication ports. | ||||
|     (Closes bug #163) | ||||
|   - Implement configurable SSL cipher list selection for GnuTLS and OpenSSL | ||||
|     using the new configuration option "CipherList". In addition, this | ||||
|     changes the defaults to more secure values: "HIGH:!aNULL:@STRENGTH" for | ||||
|     OpenSSL, and "SECURE128" for GnuTLS. | ||||
|   - Fix "TRACE": Correctly return ERR_NEEDMOREPARAMS(461) (which basically | ||||
|     is "syntax error") when there are too many parameters. | ||||
|   - Clean up lots of permission and parameter checks in functions handling | ||||
|     IRC commands; and more consistently add penalty times on errors. | ||||
|   - Fix error numeric of WHOIS when no nick name has been provided: | ||||
|     as per RFC it should be ERR_NONICKNAMEGIVEN(431). | ||||
|   - Only log "IDENT ... no result" messages when an IDENT looked took place | ||||
|     and didn't return any data, not when IDENT has been disabled. | ||||
|   - Show connection flag "s" (SSL) in RPL_TRACE{LINK|SERVER} messages: now | ||||
|     you can check if a server-to-server link is SSL-encrypted or not using | ||||
|     the IRC "TRACE" command. | ||||
|   - Correctly discard supplementary groups on server startup. | ||||
|   - Save client IP address text for "WebIRC" users and correctly display | ||||
|     it on WHOIS, for example. (Closes bug #159) | ||||
|   - Implement the new configuration option "DefaultUserModes" which lists | ||||
|     user modes that become automatically set on new local clients right | ||||
|     after login. Please note that only modes can be set that the client | ||||
|     could set on itself, so you can't set "a" (away) or "o" (IRC Op), | ||||
|     for example! User modes "i" (invisible) or "x" (cloaked) etc. are | ||||
|     "interesting", though. (Closes bug #160) | ||||
|   - Add support for the new METADATA "account" property, which allows | ||||
|     services to automatically identify users after netsplits and across | ||||
|     service restarts. | ||||
|   - Enforce "penalty times" on error conditions more consistently and in | ||||
|     more places. Now most error codes sent back from the IRC server to the | ||||
|     client should result in a 2 second "penalty". | ||||
|   - Implement a new configuration option "AllowedChannelTypes" that lists | ||||
|     all allowed channel types (channel prefixes) for newly created channels | ||||
|     on the local server. By default, all supported channel types are allowed. | ||||
|     If set to the empty string, local clients can't create new channels at | ||||
|     all, which equals the old "PredefChannelsOnly = yes" setting. | ||||
|     This change deprecates the "PredefChannelsOnly" variable, too, but it is | ||||
|     still supported and translated to the appropriate "AllowedChannelTypes" | ||||
|     setting. When the old "PredefChannelsOnly" variable is processed, a | ||||
|     warning message is logged. (Closes bug #152) | ||||
|   - Add support for "client certificate fingerprinting". When a client | ||||
|     passes an SSL certificate to the server, the "fingerprint" will be | ||||
|     forwarded in the network which enables IRC services to identify the | ||||
|     user using this certificate and not using passwords. | ||||
|   - IRC Operator names, as defined in ngircd.conf, are logged now when | ||||
|     handling successful OPER commands. | ||||
|   - Some error conditions while handling IRC commands, like "permission | ||||
|     denied" or "need more parameters", result in more penalty times. | ||||
|   - The numeric replies of some commands became split too early which | ||||
|     resulted in more numeric reply lines than necessary. | ||||
|   - Implement a new configuration option "IncludeDir" in the "[Options]" | ||||
|     section that can be used to specify a directory which can contain | ||||
|     further configuration files and configuration file snippets matching | ||||
|     the pattern "*.conf". These files are read in after the main server | ||||
|     configuration file ("ngircd.conf" by default) has been read in and | ||||
|     parsed.  The default is "$SYSCONFDIR/ngircd.conf.d", so that it is | ||||
|     possible to adjust the configuration only by placing additional files | ||||
|     into this directory. (Closes bug #157) | ||||
|   - Fix use-after-free in the Lists_CheckReason() function, which is used | ||||
|     to check if a client is a member of a particular ban/invite/... list. | ||||
|   - Xcode: fix detection of host OS, vendor, and CPU type, and update | ||||
|     project settings for Xcode 5. | ||||
|   - OS X PackageMaker: use relative path names in project files and package | ||||
|     with correct file permissions (requires root privileges on "make"). | ||||
|   - Add Travis-CI configuration file (".travis.yml") to project. | ||||
|   - Look for possible cloaked Masks in Lists. Users with +x user mode can | ||||
|     be banned with their cloaked hostname now. | ||||
|   - Don't read SSL client data before DNS resolver is finished which could | ||||
|     have resulted in discarding the resolved client hostname and IDENT | ||||
|     reply afterwards, because in some situations (timing dependent) the | ||||
|     NICK and USER commands could have already been read in from the client, | ||||
|     stored in the buffer, and been processed. | ||||
|     Thanks to Julian Brost for reporting the issue and testing, and to | ||||
|     Federico G. Schwindt <fgsch@lodoss.net> for helping to debug it! | ||||
|   - Increase password length limit to 64 characters. (Closes bug #154) | ||||
|   - doc/Services.txt: Update Anope status and URL. | ||||
|   - Clean up Xcode project file, remove outdated files, add missing ones. | ||||
|   - Update Doxygen configuration file. | ||||
|   - configure: search for iconv_open as well as libiconv_open, because | ||||
|     on some installations iconv_open() is actually libiconv_open(). | ||||
|     iconv_open() is the glibc version while libiconv_open() is the | ||||
|     libiconv version, now both variants are supported. (Closes bug #151) | ||||
|   - ngIRCd now accepts user names including "@" characters, saves the | ||||
|     unmodified name for authentication but stores only the part in front | ||||
|     of the "@" character as "IRC user name". And the latter is how | ||||
|     ircd2.11, Bahamut, and irc-seven behave as well. (Closes bug #155) | ||||
|   - Lots of IRC "information functions" like ADMIN, INFO, ... now accept | ||||
|     server masks and names of connected users (in addition to server names) | ||||
|     for specifying the target server of the command. (Closes bug #153) | ||||
|   - Implement a new configuration option "IdleTimeout" in the "[Limits]" | ||||
|     section of the configuration file which can be used to set a timeout | ||||
|     in seconds after which the whole daemon will shutdown when no more | ||||
|     connections are left active after handling at least one client. | ||||
|     The default is 0, "never". | ||||
|     This can be useful for testing or when ngIRCd is started using "socket | ||||
|     activation" with systemd(8), for example. | ||||
|   - Implement support for systemd(8) "socket activation". | ||||
|   - contrib/README: add description for more files. | ||||
|   - Enable WHOIS to display information about IRC Services using the new | ||||
|     numeric 310(RPL_WHOISSERVICE) This numeric is used for this purpose by | ||||
|     InspIRCd, for example -- but as usual, other numerics are in use, too, | ||||
|     like 613 in UltimateIRCd ... | ||||
|     Please note that neither the Operator (+o) not the "bot status" (+B) | ||||
|     of an IRC service is displayed in the output. | ||||
|   - Exit message: use singular & plural :-) | ||||
|   - autogen.sh: Check for autoconf/automake wrapper scripts | ||||
|   - Add missing punctuation marks in log messages, adjust some severity | ||||
|     levels, and make SSL-related messages more readable. | ||||
|   - AUTHORS file: Update list of contributors. | ||||
|   - Update systemd(8) example configuration files in ./contrib/ directory: | ||||
|     the "ngircd.service" file now uses the "forking" service type which | ||||
|     enhances the log messages shown by "systemctl status ngircd.service", | ||||
|     and the new "ngircd.socket" file configures a systemd socket that | ||||
|     configures a socket for ngIRCd and launches the daemon on demand. | ||||
|   - Enhance help system and the HELP command: now a "help text file" can be | ||||
|     set using the new configuration option "HelpFile" ("global" section), | ||||
|     which is read in and parsed on server startup and configuration reload, | ||||
|     and then is used to output individual help texts to specific topics. | ||||
|     Please see the file ./doc/Commands.txt for details. | ||||
|  | ||||
| ngIRCd 20.3 (2013-08-23) | ||||
|  | ||||
|   - Security: Fix a denial of service bug (server crash) which could happen | ||||
|     when the configuration option "NoticeAuth" is enabled (which is NOT the | ||||
|     default) and ngIRCd failed to send the "notice auth" messages to new | ||||
|     clients connecting to the server (CVE-2013-5580). | ||||
|  | ||||
| ngIRCd 20.2 (2013-02-15) | ||||
|  | ||||
|   - Security: Fix a denial of service bug in the function handling KICK | ||||
|     commands that could be used by arbitrary users to to crash the daemon | ||||
|     (CVE-2013-1747). | ||||
|   - WHO command: Use the currently "displayed hostname" (which can be cloaked!) | ||||
|     for hostname matching, not the real one. In other words: don't display all | ||||
|     the cloaked users on a specific real hostname! | ||||
|   - configure: The header file "netinet/in_systm.h" already is optional in | ||||
|     ngIRCd, so don't require it in the configure script. Now ngIRCd can be | ||||
|     built on Minix 3 again :-) | ||||
|   - Return better "Connection not registered as server link" errors: Now ngIRCd | ||||
|     returns a more specific error message for numeric ERR_NOTREGISTERED(451) | ||||
|     when a regular user tries to use a command that isn't allowed for users but | ||||
|     for servers. | ||||
|   - Don't report ERR_NEEDMOREPARAMS(461) when a MDOE command with more modes | ||||
|     than nicknames is handled, as well as for channel limit and key changes | ||||
|     without specifying the limit or key parameters. | ||||
|     This is how a lot (all?) other IRC servers behave, including ircd2.11, | ||||
|     InspIRCd, and ircd-seven. And because of clients (tested with Textual and | ||||
|     mIRC) sending bogus MODE commands like "MODE -ooo nick", end-users got the | ||||
|     expected result as well as correct but misleading error messages ... | ||||
|   - Correctly detect when SSL subsystem must be initialized and take | ||||
|     outgoing connections (server links!) into account, too. | ||||
|   - autogen.sh: Enforce serial test harness on GNU automake >=1.13. The | ||||
|     new parallel test harness which is enabled by default starting with | ||||
|     automake 1.13 isn't compatible with our test suite. | ||||
|     And don't use "egrep -o", instead use "sed", because it isn't portable | ||||
|     and not available on OpenBSD, for example. | ||||
|  | ||||
| ngIRCd 20.1 (2013-01-02) | ||||
|  | ||||
|   - Allow ERROR command on server and service links only, ignore them and | ||||
|     add a penalty time on all other link types. | ||||
|   - Enforced mode setting by IRC Operators: Only check the channel user | ||||
|     modes of the initiator if he is joined to the channel and not an IRC | ||||
|     operator enforcing modes (which requires the configuration option | ||||
|     "OperCanUseMode" to be enabled), because trying to check channel user | ||||
|     modes of a non-member results in an assertion when running with debug | ||||
|     code or could crash the daemon otherwise. This closes bug #147, thanks | ||||
|     to James Kirwill <james.kirwill@bk.ru> for tracking this down! | ||||
|   - Fix build system to cope with spaces in path names. | ||||
|   - Code cleanups, mostly to fix build warnings on Cygwin. | ||||
|  | ||||
| ngIRCd 20 (2012-12-17) | ||||
|  | ||||
|   - Allow user names ("INDENT") up to 20 characters when ngIRCd has not | ||||
|     been configured for "strict RFC mode". This is useful if you are using | ||||
|     external (PAM) authenticaion mechanisms that require longer user names. | ||||
|     external (PAM) authentication mechanisms that require longer user names. | ||||
|     Patch suggested by Brett Smith <brett@w3.org>, see | ||||
|     <http://arthur.barton.de/pipermail/ngircd-ml/2012-October/000579.html>. | ||||
|  | ||||
| @@ -168,7 +676,7 @@ ngIRCd 20 (2012-12-17) | ||||
|     the hash function. When "CloakHostSalt" is not set (the default), a | ||||
|     random salt will be generated after each server restart. (Closes #133) | ||||
|  | ||||
| ngIRCd Release 19.2 (2012-06-19) | ||||
| ngIRCd 19.2 (2012-06-19) | ||||
|  | ||||
|   - doc/Capabilities.txt: document "multi-prefix" capability | ||||
|  | ||||
| @@ -192,13 +700,13 @@ ngIRCd Release 19.2 (2012-06-19) | ||||
|     "CC=xxx MAKE=yyy ./platformtest.sh" calling convention. | ||||
|   - Add instructions for setting up Atheme IRC services. | ||||
|   - Implement support for IRC capability handling, the new "CAP" command, | ||||
|     and capablity "multi-prefix" which allows both the NAME and	WHO command | ||||
|     and capability "multi-prefix" which allows both the NAME and WHO command | ||||
|     handlers to return more than one "class prefix" to the client. | ||||
|   - Update Xcode project files: reference missing documentation files. | ||||
|   - Fix: Don't ignore "permission denied" errors when enabling chroot. | ||||
|   - FAQ: enhance description of chroot setup. | ||||
|  | ||||
| ngIRCd Release 19.1 (2012-03-19) | ||||
| ngIRCd 19.1 (2012-03-19) | ||||
|  | ||||
|   - Fix gcc warning (v4.6.3), initialize "list" variable to NULL. | ||||
|   - Fix typos: "recieved" -> "received", "Please not" -> "Please note", | ||||
| @@ -208,7 +716,7 @@ ngIRCd Release 19.1 (2012-03-19) | ||||
|   - getpid.sh: Fix test case error for Debian using sbuild(1). | ||||
|   - Don't log "ngIRCd hello message" two times when starting up. | ||||
|  | ||||
| ngIRCd Release 19 (2012-02-29) | ||||
| ngIRCd 19 (2012-02-29) | ||||
|  | ||||
|   - Update build system: bump config.guess and config.sub files used by | ||||
|     GNU autoconf/automake to recent versions. | ||||
| @@ -358,7 +866,7 @@ ngIRCd Release 19 (2012-02-29) | ||||
|     asynchronous nature of the IRC protocol. So don't break server- | ||||
|     links, only log a message and ignore the command. (Closes #113) | ||||
|  | ||||
| ngIRCd Release 18 (2011-07-10) | ||||
| ngIRCd 18 (2011-07-10) | ||||
|  | ||||
|   - Update timestamp of ngircd(8) manual page. | ||||
|   - Add preliminary ngIRCd protocol module for Anope 1.9 to contrib/Anope/. | ||||
| @@ -468,7 +976,7 @@ ngIRCd Release 18 (2011-07-10) | ||||
|     only relevant when a trusted server on a server-server link sends invalid | ||||
|     commands). | ||||
|  | ||||
| ngIRCd Release 17.1 (2010-12-19) | ||||
| ngIRCd 17.1 (2010-12-19) | ||||
|  | ||||
|   - --configtest: remember if MOTD is configured by file or phrase | ||||
|   - Enhance log messages when establishing server links a little bit | ||||
| @@ -484,7 +992,7 @@ ngIRCd Release 17.1 (2010-12-19) | ||||
|   - New numeric 329: get channel creation time on "MODE #chan" commands | ||||
|   - Save channel creation time; new function Channel_CreationTime() | ||||
|  | ||||
| ngIRCd Release 17 (2010-11-07) | ||||
| ngIRCd 17 (2010-11-07) | ||||
|  | ||||
|   - doc: change path names in sample-ngircd.conf depending on sysconfdir | ||||
|   - Fix up generation and distribution of sample-ngircd.conf | ||||
| @@ -492,7 +1000,7 @@ ngIRCd Release 17 (2010-11-07) | ||||
|   - contrib/platformtest.sh: make command name quoting consistent | ||||
|  | ||||
|   ngIRCd 17~rc3 (2010-10-27) | ||||
|   - Xcode builds: detect version number correctly, updateed project file | ||||
|   - Xcode builds: detect version number correctly, updated project file | ||||
|     to use the Mac OS X 10.5.x SDK, disable pam_fail_delay() because it | ||||
|     is only available starting with Mac OS X 10.6, and generate a default | ||||
|     PAM configuration for the Mac OS X Installer.app package of ngIRCd. | ||||
| @@ -504,7 +1012,7 @@ ngIRCd Release 17 (2010-11-07) | ||||
|   ngIRCd 17~rc2 (2010-10-25) | ||||
|   - ZeroConf: include header files missing since commit a988bbc86a. | ||||
|   - Generate ngIRCd version number from GIT tag. | ||||
|   - Make sourcecode compatible with ansi2knr again. This allows to compile | ||||
|   - Make source code compatible with ansi2knr again. This allows to compile | ||||
|     ngIRCd using a pre-ANSI K&R C compiler again. | ||||
|   - ./configure: check if C compiler can compile ISO Standard C. | ||||
|   - ./configure: check support for C prototypes again. | ||||
| @@ -520,7 +1028,7 @@ ngIRCd Release 17 (2010-11-07) | ||||
|     Howl, Avahi or on Mac OS X). | ||||
|   - New configuration option "SyslogFacility" to define the syslog "facility" | ||||
|     (the "target"), to which ngIRCd should send its log messages. | ||||
|     Possible values are system dependant, but most probably "auth", "daemon", | ||||
|     Possible values are system dependent, but most probably "auth", "daemon", | ||||
|     "user" and "local1" through "local7" are possible values; see syslog(3). | ||||
|     Default is "local5" for historical reasons. | ||||
|   - Dump the "internal server state" (configured servers, established | ||||
| @@ -541,7 +1049,7 @@ ngIRCd Release 17 (2010-11-07) | ||||
|   - Make configure switch "--docdir" work (closes: #108). | ||||
|   - Reformat and update FAQ.txt a little bit. | ||||
|   - INSTALL: mention SSL, IPv6, and changed handling of MotdFile. | ||||
|   - Change MOTD file handling: ngIRCd now caches the contens of the MOTD | ||||
|   - Change MOTD file handling: ngIRCd now caches the contents of the MOTD | ||||
|     file, so the daemon now requires a HUP signal or REHASH command to | ||||
|     re-read the MOTD file when its content changed. | ||||
|   - Startup: open /dev/null before chroot'ing the daemon. | ||||
| @@ -565,7 +1073,7 @@ ngIRCd Release 17 (2010-11-07) | ||||
|   - Fix "beeing" typo ... | ||||
|   - SSL/TLS: fix bogus "socket closed" error message. | ||||
|  | ||||
| ngIRCd Release 16 (2010-05-02) | ||||
| ngIRCd 16 (2010-05-02) | ||||
|  | ||||
|   - doc/SSL: remove line continuation marker | ||||
|  | ||||
| @@ -577,14 +1085,14 @@ ngIRCd Release 16 (2010-05-02) | ||||
|   - Include netinet/{in.h, in_systm.h} when checking for netinet/ip.h | ||||
|   - Only include <netinet/in_systm.h> if it exists | ||||
|   - Updated doc/Platforms.txt | ||||
|   - Enhace connection statistics counters: display total number of served | ||||
|   - Enhance connection statistics counters: display total number of served | ||||
|     connections on daemon shutdown and when a new client connects using | ||||
|     the new numeric RPL_STATSCONN (250). | ||||
|  | ||||
|   ngIRCd 16~rc1 (2010-03-25) | ||||
|   - Various fixes to the build system and code cleanups. | ||||
|   - contrib/platformtest.sh: Only show latest commit. | ||||
|   - Updatet doc/Platforms.txt, added new README-Interix.txt documenting | ||||
|   - Updated doc/Platforms.txt, added new README-Interix.txt documenting | ||||
|     how to tun ngIRCd on Microsoft Services for UNIX (MS SFU, MS SUA). | ||||
|   - Updated links to the ngIRCd homepage (bug tracker, mailing list). | ||||
|   - Added missing modes to USERMODES #define | ||||
| @@ -605,14 +1113,14 @@ ngIRCd Release 16 (2010-05-02) | ||||
|     every channel, and c) remote clients using a server not supporting this | ||||
|     mode are not checked either and therefore always allowed to join. | ||||
|  | ||||
| ngIRCd Release 15 (2009-11-07) | ||||
| ngIRCd 15 (2009-11-07) | ||||
|  | ||||
|   - "ngircd --configtest": print SSL configuration options even when unset. | ||||
|  | ||||
|   ngIRCd 15~rc1 (2009-10-15) | ||||
|   - Do not add default listening port (6667) if SSL ports were specified, so | ||||
|     ngIRCd can be configured to only accept SSL-encrypted connections now. | ||||
|   - Enable IRC operators to use the IRC command SQUIT (insted of the already | ||||
|   - Enable IRC operators to use the IRC command SQUIT (instead of the already | ||||
|     implemented but non-standard DISCONNECT command). | ||||
|   - New configuration option "AllowRemoteOper" (disabled by default) that | ||||
|     enables remote IRC operators to use the IRC commands SQUIT and CONNECT | ||||
| @@ -631,7 +1139,7 @@ ngIRCd Release 15 (2009-11-07) | ||||
|   - Fix a few error handling glitches for SSL/TLS connections. | ||||
|   - Minor fixes to manual pages and documentation. | ||||
|  | ||||
| ngIRCd Release 14.1 (2009-05-05) | ||||
| ngIRCd 14.1 (2009-05-05) | ||||
|  | ||||
|   - Security: fix remotely triggerable crash in SSL/TLS code. | ||||
|   - BSD start script contrib/ngircd.sh has been renamed to ngircd-bsd.sh. | ||||
| @@ -644,7 +1152,7 @@ ngIRCd Release 14.1 (2009-05-05) | ||||
|   - Fix server list announcement. | ||||
|   - Do not remove host names from info text. | ||||
|  | ||||
| ngIRCd Release 14 (2009-04-20) | ||||
| ngIRCd 14 (2009-04-20) | ||||
|  | ||||
|   - Display IPv6 addresses as "[<addr>]" when accepting connections. | ||||
|  | ||||
| @@ -666,9 +1174,9 @@ ngIRCd Release 14 (2009-04-20) | ||||
|   - Fix memory leak when a encrypted and compressed server link goes down. | ||||
|     (closes bug #95, reported by Christoph, fiesh@fiesh.homeip.net) | ||||
|   - Fix handling of channels containing dots. | ||||
|     (closes ug #93, reported by Gonosz Csiga) | ||||
|     (closes bug #93, reported by Gonosz Csiga) | ||||
|  | ||||
| ngIRCd Release 13 (2008-12-25) | ||||
| ngIRCd 13 (2008-12-25) | ||||
|  | ||||
|   - Updated documentation, especially doc/Services.txt and doc/SSL.txt. | ||||
|   - Make the test suite work on OpenSolaris. | ||||
| @@ -759,7 +1267,7 @@ ngIRCd 0.11.0 (2008-01-15) | ||||
|   ngIRCd 0.11.0-pre2 (2008-01-07) | ||||
|   - SECURITY: IRC_PART could reference invalid memory, causing | ||||
|     ngircd to crash [from HEAD]. (CVE-2008-0285) | ||||
|    | ||||
|  | ||||
|   ngIRCd 0.11.0-pre1 (2008-01-02) | ||||
|   - Use dotted-decimal IP address if host name is >= 64. | ||||
|   - Add support for /STAT u (server uptime) command. | ||||
| @@ -793,7 +1301,7 @@ ngIRCd 0.10.4 (2008-01-07) | ||||
|  | ||||
|   - SECURITY: IRC_PART could reference invalid memory, causing | ||||
|     ngircd to crash [from HEAD]. (CVE-2008-0285) | ||||
|    | ||||
|  | ||||
| ngIRCd 0.10.3 (2007-08-01) | ||||
|  | ||||
|   - SECURITY: Fixed a severe bug in handling JOIN commands, which could | ||||
| @@ -896,7 +1404,7 @@ ngIRCd 0.9.0 (2005-07-24) | ||||
|   - Fixed ./configure test for TCP Wrappers: now it runs on Mac OS X as well. | ||||
|   - Enhanced configure script: now you can pass an (optional) search path | ||||
|     to all --with-XXX parameters, e. g. "--with-ident=/opt/ident". | ||||
|   - Removed typedefs for the native C datatypes. | ||||
|   - Removed typedefs for the native C data types. | ||||
|     Use stdbool.h / inttypes.h if available. | ||||
|   - New configuration option "OperServerMode" to enable a workaround needed | ||||
|     when running an network with ircd2 servers and "OperCanUseMode" enabled | ||||
| @@ -1077,7 +1585,7 @@ ngIRCd 0.7.0 (2003-05-01) | ||||
|     to add a new server (ngIRCd tries to connect new servers only once!). | ||||
|   - Added DISCONNECT command ("DISCONNECT <name>") to disable servers. | ||||
|   - Restructured the documentation: Now the main language is English. The | ||||
|     german documentation has been removed (until there is a maintainer). | ||||
|     German documentation has been removed (until there is a maintainer). | ||||
|   - Enhanced killing of users caused by a nickname collision. | ||||
|   - Better error detection for status code ("numerics") forwarding. | ||||
|   - Moved tool functions to own library: "libngtool". | ||||
| @@ -1099,7 +1607,7 @@ ngIRCd 0.7.0 (2003-05-01) | ||||
|   - Documentation is now installed in $(datadir)/doc/ngircd. | ||||
|   - Enhanced handling of NJOIN in case of nick collisions. | ||||
|  | ||||
| ngIRCd 0.6.1, 2003-01-21 | ||||
| ngIRCd 0.6.1 (2003-01-21) | ||||
|  | ||||
|   - Fixed KILL: you can't crash the server by killing yourself any more, | ||||
|     ngIRCd no longer sends a QUIT to other servers after the KILL, and you | ||||
| @@ -1118,17 +1626,17 @@ ngIRCd 0.6.1, 2003-01-21 | ||||
|     member when changing his channel user modes which could crash ngIRCd. | ||||
|  | ||||
|  | ||||
| Older changes (sorry, only available in german language): | ||||
| Older changes (sorry, only available in German language): | ||||
|  | ||||
| ngIRCd 0.6.0, 2002-12-24 | ||||
| ngIRCd 0.6.0, 24.12.2002 | ||||
|  | ||||
|   ngIRCd 0.6.0-pre2, 2002-12-23 | ||||
|   ngIRCd 0.6.0-pre2, 23.12.2002 | ||||
|   - neuer Numeric 005 ("Features") beim Connect. | ||||
|   - LUSERS erweitert: nun wird die maximale Anzahl der lokalen und globalen | ||||
|     Clients, die dem Server bzw. im Netzwerk seit dem letzten (Re-)Start | ||||
|     dem Server gleichzeitig bekannt waren, angezeigt. | ||||
|  | ||||
|   ngIRCd 0.6.0-pre1, 2002-12-18 | ||||
|   ngIRCd 0.6.0-pre1, 18.12.2002 | ||||
|   - beim Schliessen einer Verbindung zeigt der Server nun vor dem ERROR | ||||
|     noch eine Statistik ueber die empfangene und gesendete Datenmenge an. | ||||
|   - der Server wartet bei einer eingehenden Verbindung nun laenger auf den | ||||
| @@ -1179,7 +1687,7 @@ ngIRCd 0.6.0, 2002-12-24 | ||||
|  | ||||
| ngIRCd 0.5.4, 24.11.2002 | ||||
|  | ||||
|   - Fehler-Handling von connect() gefixed: der Server kann sich nun auch    | ||||
|   - Fehler-Handling von connect() gefixed: der Server kann sich nun auch | ||||
|     unter A/UX wieder zu anderen verbinden. | ||||
|   - in den Konfigurationsvariablen ServerUID und ServerGID kann nun nicht | ||||
|     nur die numerische ID, sondern auch der Name des Users bzw. der Gruppe | ||||
| @@ -1291,7 +1799,7 @@ ngIRCd 0.5.0, 20.09.2002 | ||||
|   - ADMIN-Befehl implementiert. Die Daten hierzu werden in der Konfig-Datei | ||||
|     im [Global]-Abschnitt mit den Variablen "AdminInfo1", "AdminInfo2" und | ||||
|     "AdminEMail" konfiguriert. | ||||
|    | ||||
|  | ||||
| ngIRCd 0.4.3, 11.06.2002 | ||||
|  | ||||
|   - Bei PRIVMSG und NOTICE hat der ngIRCd nicht ueberpruft, ob das Ziel | ||||
|   | ||||
							
								
								
									
										52
									
								
								INSTALL
									
									
									
									
									
								
							
							
						
						
									
										52
									
								
								INSTALL
									
									
									
									
									
								
							| @@ -2,7 +2,7 @@ | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2012 Alexander Barton and Contributors. | ||||
|                (c)2001-2016 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
| @@ -12,15 +12,43 @@ | ||||
| I. Upgrade Information | ||||
| ~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| Differences to version 22.x | ||||
|  | ||||
| - The "NoticeAuth" ngircd.conf configuration variable has been renamed to | ||||
|   "NoticeBeforeRegistration". The old "NoticeAuth" variable still works but | ||||
|   is deprecated now. | ||||
|  | ||||
| - The default value of the SSL "CipherList" variable has been changed to | ||||
|   "HIGH:!aNULL:@STRENGTH:!SSLv3" (OpenSSL) and "SECURE128:-VERS-SSL3.0" | ||||
|   (GnuTLS) to disable the old SSLv3 protocol by default. | ||||
|   To enable connections of clients still requiring the weak SSLv3 protocol, | ||||
|   the "CipherList" must be set to its old value (not recommended!), which | ||||
|   was "HIGH:!aNULL:@STRENGTH" (OpenSSL) and "SECURE128" (GnuTLS), see below. | ||||
|  | ||||
| Differences to version 20.x | ||||
|  | ||||
| - Starting with ngIRCd 21, the ciphers used by SSL are configurable and | ||||
|   default to "HIGH:!aNULL:@STRENGTH" (OpenSSL) or "SECURE128" (GnuTLS). | ||||
|   Previous version were using the OpenSSL or GnuTLS defaults, "DEFAULT" | ||||
|   and "NORMAL" respectively. | ||||
|  | ||||
| - When adding GLINE's or KLINE's to ngIRCd 21 (or newer), all clients matching | ||||
|   the new mask will be KILL'ed. This was not the case with earlier versions | ||||
|   that only added the mask but didn't kill already connected users. | ||||
|  | ||||
| - The "PredefChannelsOnly" configuration variable has been superseded by the | ||||
|   new "AllowedChannelTypes" variable. It is still supported and translated to | ||||
|   the appropriate "AllowedChannelTypes" setting but is deprecated now. | ||||
|  | ||||
| Differences to version 19.x | ||||
|  | ||||
| - Starting with ngIRCd 20, users can "cloak" their hostname only when the | ||||
|   configuration variable "CloakHostModeX" (introduced in 19.2) is set. | ||||
|   Otherwise, only IRC opertators, other servers, and services are allowed to | ||||
|   Otherwise, only IRC operators, other servers, and services are allowed to | ||||
|   set mode +x. This prevents regular users from changing their hostmask to | ||||
|   the name of the IRC server itself, which confused quite a few people ;-) | ||||
|  | ||||
| Differences to version 17 | ||||
| Differences to version 17.x | ||||
|  | ||||
| - Support for ZeroConf/Bonjour/Rendezvous service registration has been | ||||
|   removed. The configuration option "NoZeroconf" is no longer available. | ||||
| @@ -57,7 +85,7 @@ Differences to version 17 | ||||
|   You should adjust your ngircd.conf and run "ngircd --configtest" to make | ||||
|   sure that your settings are correct and up to date! | ||||
|  | ||||
| Differences to version 16 | ||||
| Differences to version 16.x | ||||
|  | ||||
| - Changes to the "MotdFile" specified in ngircd.conf now require a ngircd | ||||
|   configuration reload to take effect (HUP signal, REHASH command). | ||||
| @@ -134,7 +162,7 @@ If you are using one of the "big" operating systems or Linux distributions, | ||||
| you can use the following commands to install all the required packages to | ||||
| build the sources including all optional features and to run the test suite: | ||||
|  | ||||
| * RedHat / Fedora based distributions: | ||||
| * Red Hat / Fedora based distributions: | ||||
|  | ||||
|   yum install \ | ||||
|     autoconf automake expect gcc glibc-devel gnutls-devel \ | ||||
| @@ -158,8 +186,8 @@ This step is therefore only interesting for developers. | ||||
| autogen.sh produces the Makefile.in's, which are necessary for the configure | ||||
| script itself, and some more files for make. To run autogen.sh you'll need | ||||
| GNU autoconf and GNU automake: at least autoconf 2.61 and automake 1.10 are | ||||
| requird, newer is better. But don't use automake 1.12 or newer for creating | ||||
| distribution archives: it will work but lack "de-ANSI-fucation" support in the | ||||
| required, newer is better. But don't use automake 1.12 or newer for creating | ||||
| distribution archives: it will work but lack "de-ANSI-fication" support in the | ||||
| generated Makefile's! Stick with automake 1.11.x for this purpose ... | ||||
| So automake 1.11.x and autoconf 2.67+ is recommended. | ||||
|  | ||||
| @@ -215,7 +243,7 @@ which will be used to search for the required libraries and header files in | ||||
| the given paths ("<path>/lib/...", "<path>/include/...") in addition to the | ||||
| standard locations. | ||||
|  | ||||
| * Syslog Logging (autodetected by default):  | ||||
| * Syslog Logging (autodetected by default): | ||||
|   --with-syslog[=<path>] / --without-syslog | ||||
|  | ||||
|   Enable (disable) support for logging to "syslog", which should be | ||||
| @@ -226,13 +254,13 @@ standard locations. | ||||
|  | ||||
|   Enable (disable) support for compressed server-server links. | ||||
|   The Z compression library ("libz") is required for this option. | ||||
|    | ||||
|  | ||||
| * IO Backend (autodetected by default): | ||||
|   --with-select[=<path>] / --without-select | ||||
|   --with-poll[=<path>] / --without-poll | ||||
|   --with-devpoll[=<path>] / --without-devpoll | ||||
|   --with-epoll[=<path>] / --without-epoll | ||||
|   --with-kqueue[=<path>] / --without-kqueue   | ||||
|   --with-kqueue[=<path>] / --without-kqueue | ||||
|  | ||||
|   ngIRCd can use different IO "backends": the "old school" select() and poll() | ||||
|   API which should be supported by most UNIX-like operating systems, or the | ||||
| @@ -250,7 +278,7 @@ standard locations. | ||||
|   required for this option. | ||||
|  | ||||
| * TCP-Wrappers: | ||||
|   --with-tcp-wrappers[=<path>]  | ||||
|   --with-tcp-wrappers[=<path>] | ||||
|  | ||||
|   Include support for Wietse Venemas "TCP Wrappers" to limit client access | ||||
|   to the daemon, for example by using "/etc/hosts.{allow|deny}". | ||||
| @@ -307,7 +335,7 @@ IRC operators of this server are defined in [Operator] blocks, remote | ||||
| servers are configured in [Server] sections, and [Channel] blocks are | ||||
| used to configure pre-defined ("persistent") IRC channels. | ||||
|  | ||||
| The meaning of the variables in the configuration file is explained in the  | ||||
| The meaning of the variables in the configuration file is explained in the | ||||
| "doc/sample-ngircd.conf", which is used as sample configuration file in | ||||
| /usr/local/etc after running "make install" (if you don't already have one) | ||||
| and in the ngircd.conf(5) manual page. | ||||
|   | ||||
							
								
								
									
										20
									
								
								Makefile.am
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								Makefile.am
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| # | ||||
| # ngIRCd -- The Next Generation IRC Daemon | ||||
| # Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors | ||||
| # Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| @@ -13,11 +13,10 @@ AUTOMAKE_OPTIONS = gnu | ||||
|  | ||||
| SUBDIRS = doc src man contrib | ||||
|  | ||||
| EXTRA_DIST = autogen.sh configure.ng .mailmap | ||||
| EXTRA_DIST = autogen.sh configure.ng .clang_complete .mailmap | ||||
|  | ||||
| clean-local: | ||||
| clean-local: osxpkg-clean | ||||
| 	rm -f build-stamp* | ||||
| 	rm -rf ngircd.dest | ||||
|  | ||||
| maintainer-clean-local: | ||||
| 	rm -rf autom4te.cache | ||||
| @@ -62,14 +61,18 @@ deb: | ||||
| 	dpkg-buildpackage -rfakeroot -i | ||||
|  | ||||
| osxpkg: have-packagemaker osxpkg-dest | ||||
| 	cd contrib/MacOSX && packagemaker \ | ||||
| 	cd contrib/MacOSX && packagemaker --no-recommend \ | ||||
| 	 --doc ngIRCd.pmdoc \ | ||||
| 	 --out ../../$(distdir).mpkg | ||||
| 	rm -f $(distdir).mpkg.zip | ||||
| 	zip -ro9 $(distdir).mpkg.zip $(distdir).mpkg | ||||
| 	make osxpkg-clean | ||||
|  | ||||
| osxpkg-clean: | ||||
| 	[ ! -r ngircd.dest ] || sudo -n rm -rf ngircd.dest | ||||
| 	rm -rf ngircd.dest $(distdir).mpkg | ||||
|  | ||||
| osxpkg-dest: have-xcodebuild clean | ||||
| osxpkg-dest: have-xcodebuild osxpkg-clean clean | ||||
| 	./configure --prefix=/opt/ngircd | ||||
| 	make xcode | ||||
| 	make -C contrib/MacOSX de.barton.ngircd.plist | ||||
| @@ -82,8 +85,9 @@ osxpkg-dest: have-xcodebuild clean | ||||
| 	rm ngircd.dest/opt/ngircd/etc/ngircd.conf | ||||
| 	echo "Have a nice day IRCing!" >ngircd.dest/opt/ngircd/etc/ngircd.motd | ||||
| 	chmod -R a-s,og-w,a+rX ngircd.dest | ||||
| 	sudo chown -R root:wheel ngircd.dest | ||||
|  | ||||
| .PHONY: deb have-packagemaker have-xcodebuild lint osxpkg osxpkg-dest rpm \ | ||||
| 	srcdoc testsuite xcode xcode-clean | ||||
| .PHONY: deb have-packagemaker have-xcodebuild lint osxpkg osxpkg-clean \ | ||||
| 	osxpkg-dest rpm srcdoc testsuite xcode xcode-clean | ||||
|  | ||||
| # -eof- | ||||
|   | ||||
							
								
								
									
										303
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										303
									
								
								NEWS
									
									
									
									
									
								
							| @@ -2,18 +2,277 @@ | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2012 Alexander Barton and Contributors. | ||||
|                (c)2001-2016 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
|                                   -- NEWS -- | ||||
|  | ||||
|  | ||||
| ngIRCd 24 | ||||
|  | ||||
|   ngIRCd 24~rc1 (2017-01-07) | ||||
|   - Log privilege violations and failed OPER request with log level "error" | ||||
|     and send it to the "&SERVER" channel, too. | ||||
|   - Immediately shut down connection when receiving an "ERROR" command, | ||||
|     don't wait for the peer to close the connection. This allows the daemon | ||||
|     to forward the received "ERROR" message in the network, instead of the | ||||
|     very generic "client closed connection" message. | ||||
|   - Explicitly forbid remote servers to modify "x-lines" (G-LINES) when the | ||||
|     "AllowRemoteOper" configuration option isn't set, even when the command | ||||
|     seems to originate from the remote server itself: this prevents GLINE's | ||||
|     to become set during server handshake in this case (what wouldn't be | ||||
|     possible during regular runtime when a remote IRC Op sends the command) | ||||
|     and what can't be undone by IRC Ops later on (because of the missing | ||||
|     "AllowRemoteOper" option) ... | ||||
|   - Update Xcode project for latest Xcode version (8.0), and fix "duplicate | ||||
|     symbols" error messages when building (linking) the binary. | ||||
|   - Add "Documentation" variables to systemd configuration files. | ||||
|   - Make sure that SYSCONFDIR is always set, which can be handy when | ||||
|     using source code linters when ./configure hasn't been run already. | ||||
|   - Add the new "PAMServiceName" configuration option to specify the name | ||||
|     used as PAM service name. This setting allows to run multiple ngIRCd | ||||
|     instances with different PAM configurations for each instance. | ||||
|     Thanks to Christian Aistleitner <christian@quelltextlich.at> for the | ||||
|     patch, closes #226. | ||||
|   - Add an ".editorconfig" file to the project. | ||||
|   - Limit the number of message target, and suppress duplicates: This | ||||
|     prevents an user from flooding the server using commands like this: | ||||
|     "PRIVMSG nick1,nick1,nick1,...". | ||||
|     Duplicate targets are suppressed silently (channels and clients). | ||||
|     In addition, the maximum number of targets per PRIVMSG, NOTICE, ... | ||||
|     command are limited to MAX_HNDL_TARGETS (25). If there are more, the | ||||
|     daemon sends the new 407 (ERR_TOOMANYTARGETS_MSG) numeric, containing | ||||
|     the first target that hasn't been handled any more. Closes #187. | ||||
|   - Make contrib/platformtest.sh script more portable, and only show | ||||
|     "runs=Y" when the test suite really has been passed successfully. | ||||
|  | ||||
| ngIRCd 23 (2015-11-16) | ||||
|  | ||||
|   ngIRCd 23~rc1 (2015-09-06) | ||||
|   - Use "NOTICE *" before registration instead of "NOTICE AUTH". "AUTH" is | ||||
|     a valid nickname so sending notices to it is probably not a good idea. | ||||
|     Use "*" as the target instead as done with numerics when the nick is not | ||||
|     available. This mimics the behavior in Charybdis, IRCD-Hybrid, InspIRCd | ||||
|     2.2, Plexus 4, etc. Closes #217. | ||||
|     The "NoticeAuth" configuration variable (ngircd.conf) has been renamed | ||||
|     to "NoticeBeforeRegistration" accordingly, but the old name is still | ||||
|     supported for compatibility reasons. | ||||
|   - Implement new channel mode "N" (regular users can't change their nick | ||||
|     name while on this channel). Closes #214. | ||||
|   - Keep track of who placed bans, invites, and excepts. | ||||
|     Idea and implementation by LucentW, Thanks! Closes #203. | ||||
|   - Implement numeric RPL_LISTSTART(321). lightIRC and other clients | ||||
|     expecting RPL_LISTSTART should now behave correctly. | ||||
|     Idea and implementation by LucentW, Thanks! Closes #207. | ||||
|   - Streamline the effect of "MorePrivacy" option: Update documentation | ||||
|     in ngircd.conf(5); don't hide channels for IRC Ops on LIST and don't | ||||
|     hide IP addresses/hostnames on WHOIS when "MorePrivacy" is in effect. | ||||
|     This closes #198. | ||||
|   - IRC operators now can kick anyone when "OperCanMode" is set. | ||||
|     Idea and implementation by LucentW, Thanks! Closes #202. | ||||
|   - Implement user mode "I": Hide channels on WHOIS: this mode prevents | ||||
|     ngIRCd from showing channels on WHOIS (IRC Operators can always see | ||||
|     the channel list). | ||||
|     Idea and implementation by LucentW, Thanks! Closes #197. | ||||
|   - INVITE command: Implement ERR_USERNOTONSERV(504) numeric and make sure | ||||
|     that the target user is on the same server when inviting other users | ||||
|     to local ("&") channels. | ||||
|     Idea by Cahata, thanks! Closes #183. | ||||
|   - MODE command: Always report channel creation time. Up to now when | ||||
|     receiving a MODE command, ngIRCd only reported the channel creation | ||||
|     time to clients that were members of the channel. This patch reports | ||||
|     the channel creation time to all clients, regardless if they are joined | ||||
|     to that channel or not. At least ircd-seven behaves like this. | ||||
|     This closes #188. Reported by Cahata, thanks! | ||||
|  | ||||
| ngIRCd 22.1 (2015-04-06) | ||||
|  | ||||
|   - Update "CipherList" to not enable SSLv3 by default. Idea, initial patch, | ||||
|     and testing by Christoph Biedl <ngircd.anoy@manchmal.in-ulm.de>. | ||||
|   - Change ngIRCd test suite not to use DNS lookups: Different operating | ||||
|     systems do behave quite differently when doing DNS lookups, for example | ||||
|     "127.0.0.1" sometimes resolves to "localhost" and sometimes to | ||||
|     "localhost.localdomain" (for example OpenBSD). And other OS resolve | ||||
|     "localhost" to the real host name (for example Cygwin). So not using | ||||
|     DNS at all makes the test site much more portable. | ||||
|  | ||||
| ngIRCd 22 (2014-10-11) | ||||
|  | ||||
|   - Match all list patterns case-insensitive: this affects the invite-, | ||||
|     ban-, and except lists, as well as G-Lines an K-Lines. | ||||
|     Problem pointed out by "wowaname" on #ngircd, thanks! | ||||
|  | ||||
|   ngIRCd 22~rc1 (2014-09-29) | ||||
|   - Sync "except lists" between servers: Up to now, ban, invite, and G-Line | ||||
|     lists have been synced between servers while linking -- but obviously | ||||
|     nobody noticed that except list have been missing ever since. Until now. | ||||
|     Thanks to "j4jackj", who reported this issue in #ngircd. | ||||
|   - Allow longer user names (up to 63 characters) for authentication. | ||||
|   - Increase MAX_SERVERS from 16 to 64: There are installations out there | ||||
|     that would like to configure more than 16 links per server, so increase | ||||
|     this limit. Best would be to get rid of MAX_SERVERS altogether and make | ||||
|     if fully dynamic, but start with this quick and dirty hack ... | ||||
|   - Test suite/platformtest.sh: Detect when tests have been skipped. | ||||
|   - Allow "DefaultUserModes" to set all possible modes, including modes only | ||||
|     settable by IRC Operators. | ||||
|   - Implement user mode "F": "relaxed flood protection". Clients with mode | ||||
|     "F" set are allowed to rapidly send data to the daemon. This mode is only | ||||
|     settable by IRC Operators and can cause problems in the network -- so be | ||||
|     careful and only set it on "trusted" clients! | ||||
|     User mode "F" is used by Bahamut for this purpose, for example. | ||||
|   - Use server password when PAM is compiled in but disabled. | ||||
|   - Streamline punctuation of log messages. | ||||
|   - Return ISUPPORT(005) numerics on "VERSION". This is how ircd-seven, | ||||
|     Charybdis, Hybrid, and InspIRCd behave, for example. | ||||
|   - configure: Only link "contrib/Debian" if it exists, which isn't the case | ||||
|     on "VPATH builds", for example. | ||||
|   - Show the account name in WHOIS. This uses the same numeric as Charybdis | ||||
|     and ircu families: WHOISLOGGEDIN(330). | ||||
|   - Pattern matching: Remove "range matching" in our pattern matching code | ||||
|     using the "[...]" syntax, because [ and ] are valid characters in nick | ||||
|     names and one has to quote them currently using the "\" character, which | ||||
|     is quite unexpected for users. | ||||
|   - platformtest.sh: New option "-x", don't regenerate build system and | ||||
|     allow using separate source and build trees. | ||||
|   - Test suite: explicitly enable glibc memory checking. | ||||
|   - Make "MODE -k" handling more robust and compatible, send "fake '*' key" | ||||
|     in all replies. | ||||
|   - portabtest: Actually test the functions snprintf(), strlcpy(), strlcat(), | ||||
|     and vsnprintf() for correctness, not only existence (which was quite | ||||
|     useless, because if they weren't available, the program could not have | ||||
|     been linked at all ...). | ||||
|   - Implement new configuration option "Network": it is used to set the | ||||
|     (completely optional) "network name", to which this instance of the | ||||
|     daemon belongs. When set, this name is used in the ISUPPORT(005) numeric | ||||
|     which is sent to all clients connecting to the server after logging in. | ||||
|   - Update doc/Platforms.txt. | ||||
|   - Various code cleanups, remove unused code, streamline error handling. | ||||
|     Remove all imp.h and exp.h header files, support non-standard vsnprintf() | ||||
|     return codes, and fix some K&R C portability issues. Streamline | ||||
|     DEBUG_ARRAY, DEBUG_BUFFER, DEBUG_IO, DEBUG_ZIP definitions. | ||||
|   - Increase penalty time to 10 seconds when handling OPER commands with an | ||||
|     invalid password. | ||||
|  | ||||
| ngIRCd 21.1 (2014-03-25) | ||||
|  | ||||
|   - Don't ignore but use the server password when PAM is compiled in but | ||||
|     disabled. Thanks to Roy Sindre Norangshol <roy.sindre@norangshol.no>! | ||||
|   - doc/Platforms.txt: Update from master branch. | ||||
|   - doc/Services.txt: Update information for Anope 2.x. | ||||
|   - configure: add support for the LDFLAGS_END and LIBS_END variables to add | ||||
|     linker flags and libraries at the end of the configure run (CFLAGS_END has | ||||
|     been implemented already). | ||||
|   - Update Copyright notices for 2014 :-) | ||||
|  | ||||
| ngIRCd 21 (2013-10-30) | ||||
|  | ||||
|   - Call arc4random_stir() in forked subprocesses, when available. This | ||||
|     is required by FreeBSD <10 and current NetBSD at least to correctly | ||||
|     initialize the "arc4" random number generator on these platforms. | ||||
|  | ||||
|   ngIRCd 21~rc2 (2013-10-20) | ||||
|   - Report the correct configuration file name on configuration errors, | ||||
|     support longer configuration lines, and warn when lines are truncated. | ||||
|  | ||||
|   ngIRCd 21~rc1 (2013-10-05) | ||||
|   - Actually KILL clients on GLINE/KLINE. (Closes bug #156) | ||||
|   - Add support to show all user links using the "STATS L" (uppercase) | ||||
|     command (restricted to IRC Operators). | ||||
|   - Implement configurable SSL cipher list selection for GnuTLS and OpenSSL | ||||
|     using the new configuration option "CipherList". In addition, this | ||||
|     changes the defaults to more secure values: "HIGH:!aNULL:@STRENGTH" for | ||||
|     OpenSSL, and "SECURE128" for GnuTLS. | ||||
|   - Show connection flag "s" (SSL) in RPL_TRACE{LINK|SERVER} messages: now | ||||
|     you can check if a server-to-server link is SSL-encrypted or not using | ||||
|     the IRC "TRACE" command. | ||||
|   - Implement the new configuration option "DefaultUserModes" which lists | ||||
|     user modes that become automatically set on new local clients right | ||||
|     after login. Please note that only modes can be set that the client | ||||
|     could set on itself, so you can't set "a" (away) or "o" (IRC Op), | ||||
|     for example! User modes "i" (invisible) or "x" (cloaked) etc. are | ||||
|     "interesting", though. (Closes bug #160) | ||||
|   - Add support for the new METADATA "account" property, which allows | ||||
|     services to automatically identify users after netsplits and across | ||||
|     service restarts. | ||||
|   - Implement a new configuration option "AllowedChannelTypes" that lists | ||||
|     all allowed channel types (channel prefixes) for newly created channels | ||||
|     on the local server. By default, all supported channel types are allowed. | ||||
|     If set to the empty string, local clients can't create new channels at | ||||
|     all, which equals the old "PredefChannelsOnly = yes" setting. | ||||
|     This change deprecates the "PredefChannelsOnly" variable, too, but it is | ||||
|     still supported and translated to the appropriate "AllowedChannelTypes" | ||||
|     setting. When the old "PredefChannelsOnly" variable is processed, a | ||||
|     warning message is logged. (Closes bug #152) | ||||
|   - Add support for "client certificate fingerprinting". When a client | ||||
|     passes an SSL certificate to the server, the "fingerprint" will be | ||||
|     forwarded in the network which enables IRC services to identify the | ||||
|     user using this certificate and not using passwords. | ||||
|   - Implement a new configuration option "IncludeDir" in the "[Options]" | ||||
|     section that can be used to specify a directory which can contain | ||||
|     further configuration files and configuration file snippets matching | ||||
|     the pattern "*.conf". These files are read in after the main server | ||||
|     configuration file ("ngircd.conf" by default) has been read in and | ||||
|     parsed.  The default is "$SYSCONFDIR/ngircd.conf.d", so that it is | ||||
|     possible to adjust the configuration only by placing additional files | ||||
|     into this directory. (Closes bug #157) | ||||
|   - Add Travis-CI configuration file (".travis.yml") to project. | ||||
|   - ngIRCd now accepts user names including "@" characters, saves the | ||||
|     unmodified name for authentication but stores only the part in front | ||||
|     of the "@" character as "IRC user name". And the latter is how | ||||
|     ircd2.11, Bahamut, and irc-seven behave as well. (Closes bug #155) | ||||
|   - Lots of IRC "information functions" like ADMIN, INFO, ... now accept | ||||
|     server masks and names of connected users (in addition to server names) | ||||
|     for specifying the target server of the command. (Closes bug #153) | ||||
|   - Implement a new configuration option "IdleTimeout" in the "[Limits]" | ||||
|     section of the configuration file which can be used to set a timeout | ||||
|     in seconds after which the whole daemon will shutdown when no more | ||||
|     connections are left active after handling at least one client. | ||||
|     The default is 0, "never". | ||||
|     This can be useful for testing or when ngIRCd is started using "socket | ||||
|     activation" with systemd(8), for example. | ||||
|   - Implement support for systemd(8) "socket activation". | ||||
|   - Enable WHOIS to display information about IRC Services using the new | ||||
|     numeric 310(RPL_WHOISSERVICE) This numeric is used for this purpose by | ||||
|     InspIRCd, for example -- but as usual, other numerics are in use, too, | ||||
|     like 613 in UltimateIRCd ... | ||||
|     Please note that neither the Operator (+o) not the "bot status" (+B) | ||||
|     of an IRC service is displayed in the output. | ||||
|   - Update systemd(8) example configuration files in ./contrib/ directory: | ||||
|     the "ngircd.service" file now uses the "forking" service type which | ||||
|     enhances the log messages shown by "systemctl status ngircd.service", | ||||
|     and the new "ngircd.socket" file configures a systemd socket that | ||||
|     configures a socket for ngIRCd and launches the daemon on demand. | ||||
|   - Enhance help system and the HELP command: now a "help text file" can be | ||||
|     set using the new configuration option "HelpFile" ("global" section), | ||||
|     which is read in and parsed on server startup and configuration reload, | ||||
|     and then is used to output individual help texts to specific topics. | ||||
|     Please see the file ./doc/Commands.txt for details. | ||||
|  | ||||
| ngIRCd 20.3 (2013-08-23) | ||||
|  | ||||
|   - This release is a bugfix release only, without new features. | ||||
|   - Security: Fix a denial of service bug (server crash) which could happen | ||||
|     when the configuration option "NoticeAuth" is enabled (which is NOT the | ||||
|     default) and ngIRCd failed to send the "notice auth" messages to new | ||||
|     clients connecting to the server (CVE-2013-5580). | ||||
|  | ||||
| ngIRCd 20.2 (2013-02-15) | ||||
|  | ||||
|   - This release is a bugfix release only, without new features. | ||||
|   - Security: Fix a denial of service bug in the function handling KICK | ||||
|     commands that could be used by arbitrary users to to crash the daemon | ||||
|     (CVE-2013-1747). | ||||
|  | ||||
| ngIRCd 20.1 (2013-01-02) | ||||
|  | ||||
|   - This release is a bugfix release only, without new features. | ||||
|  | ||||
| ngIRCd 20 (2012-12-17) | ||||
|  | ||||
|   - Allow user names ("INDENT") up to 20 characters when ngIRCd has not | ||||
|     been configured for "strict RFC mode". This is useful if you are using | ||||
|     external (PAM) authenticaion mechanisms that require longer user names. | ||||
|     external (PAM) authentication mechanisms that require longer user names. | ||||
|     Patch suggested by Brett Smith <brett@w3.org>, see | ||||
|     <http://arthur.barton.de/pipermail/ngircd-ml/2012-October/000579.html>. | ||||
|  | ||||
| @@ -94,7 +353,7 @@ ngIRCd 20 (2012-12-17) | ||||
|     the hash function. When "CloakHostSalt" is not set (the default), a | ||||
|     random salt will be generated after each server restart. | ||||
|  | ||||
| ngIRCd Release 19.2 (2012-06-19) | ||||
| ngIRCd 19.2 (2012-06-19) | ||||
|  | ||||
|   ngIRCd 19.2~rc1 (2012-06-13) | ||||
|   - New configuration option "CloakHostModeX" to configure the hostname | ||||
| @@ -103,15 +362,15 @@ ngIRCd Release 19.2 (2012-06-19) | ||||
|     which still is the default when "CloakHostModeX" isn't set. | ||||
|   - Add instructions for setting up Atheme IRC services. | ||||
|   - Implement support for IRC capability handling, the new "CAP" command, | ||||
|     and capablity "multi-prefix" which allows both the NAME and	WHO command | ||||
|     and capability "multi-prefix" which allows both the NAME and WHO command | ||||
|     handlers to return more than one "class prefix" to the client. | ||||
|  | ||||
| ngIRCd Release 19.1 (2012-03-19) | ||||
| ngIRCd 19.1 (2012-03-19) | ||||
|  | ||||
|   - Really include _all_ patches to build the Anope module into the | ||||
|     distribution archive ... ooops! | ||||
|  | ||||
| ngIRCd Release 19 (2012-02-29) | ||||
| ngIRCd 19 (2012-02-29) | ||||
|  | ||||
|   ngIRCd 19~rc1 (2012-02-12) | ||||
|   - Update preliminary ngIRCd protocol module for Anope 1.9.6, which now | ||||
| @@ -179,7 +438,7 @@ ngIRCd Release 19 (2012-02-29) | ||||
|     argument. Like unknown user and channel modes, these modes are saved | ||||
|     and forwarded to other servers, but ignored otherwise. | ||||
|  | ||||
| ngIRCd Release 18 (2011-07-10) | ||||
| ngIRCd 18 (2011-07-10) | ||||
|  | ||||
|   - Add preliminary ngIRCd protocol module for Anope 1.9 to contrib/Anope/. | ||||
|  | ||||
| @@ -254,19 +513,19 @@ ngIRCd Release 18 (2011-07-10) | ||||
|     vice-versa). The defaults are adjusted accordingly and the old variables | ||||
|     in [Global] are still accepted, so there is no functional change. | ||||
|  | ||||
| ngIRCd Release 17.1 (2010-12-19) | ||||
| ngIRCd 17.1 (2010-12-19) | ||||
|  | ||||
|   - Don't log critical (or worse) messages to stderr | ||||
|   - Remove "error file" when compiled with debug code enabled | ||||
|   - New numeric 329: get channel creation time on "MODE #chan" commands | ||||
|  | ||||
| ngIRCd Release 17 (2010-11-07) | ||||
| ngIRCd 17 (2010-11-07) | ||||
|  | ||||
|   - doc: change path names in sample-ngircd.conf depending on sysconfdir | ||||
|  | ||||
|   ngIRCd 17~rc2 (2010-10-25) | ||||
|   - Generate ngIRCd version number from GIT tag. | ||||
|   - Make sourcecode compatible with ansi2knr again. This allows to compile | ||||
|   - Make source code compatible with ansi2knr again. This allows to compile | ||||
|     ngIRCd using a pre-ANSI K&R C compiler again. | ||||
|  | ||||
|   ngIRCd 17~rc1 (2010-10-11) | ||||
| @@ -275,7 +534,7 @@ ngIRCd Release 17 (2010-11-07) | ||||
|     Howl, Avahi or on Mac OS X). | ||||
|   - New configuration option "SyslogFacility" to define the syslog "facility" | ||||
|     (the "target"), to which ngIRCd should send its log messages. | ||||
|     Possible values are system dependant, but most probably "auth", "daemon", | ||||
|     Possible values are system dependent, but most probably "auth", "daemon", | ||||
|     "user" and "local1" through "local7" are possible values; see syslog(3). | ||||
|     Default is "local5" for historical reasons. | ||||
|   - Dump the "internal server state" (configured servers, established | ||||
| @@ -285,7 +544,7 @@ ngIRCd Release 17 (2010-11-07) | ||||
|     signal SIGUSR1, when debug code is compiled in, not only on startup | ||||
|     using the command line parameters. | ||||
|   - Implement user mode "x": host name cloaking (closes: #102). | ||||
|   - Change MOTD file handling: ngIRCd now caches the contens of the MOTD | ||||
|   - Change MOTD file handling: ngIRCd now caches the contents of the MOTD | ||||
|     file, so the daemon now requires a HUP signal or REHASH command to | ||||
|     re-read the MOTD file when its content changed. | ||||
|   - Allow IRC ops to change channel modes even without OperServerMode set. | ||||
| @@ -298,10 +557,10 @@ ngIRCd Release 17 (2010-11-07) | ||||
|     this new mode requires the user to be an IRC operator. | ||||
|   - Show SSL status in WHOIS output, numeric 275. | ||||
|  | ||||
| ngIRCd Release 16 (2010-05-02) | ||||
| ngIRCd 16 (2010-05-02) | ||||
|  | ||||
|   ngIRCd 16~rc2 (2010-04-25) | ||||
|   - Enhace connection statistics counters: display total number of served | ||||
|   - Enhance connection statistics counters: display total number of served | ||||
|     connections on daemon shutdown and when a new client connects using | ||||
|     the new numeric RPL_STATSCONN (250). | ||||
|  | ||||
| @@ -318,12 +577,12 @@ ngIRCd Release 16 (2010-05-02) | ||||
|     every channel, and c) remote clients using a server not supporting this | ||||
|     mode are not checked either and therefore always allowed to join. | ||||
|  | ||||
| ngIRCd Release 15 (2009-11-07) | ||||
| ngIRCd 15 (2009-11-07) | ||||
|  | ||||
|   ngIRCd 15~rc1 (2009-10-15) | ||||
|   - Do not add default listening port (6667) if SSL ports were specified, so | ||||
|     ngIRCd can be configured to only accept SSL-encrypted connections now. | ||||
|   - Enable IRC operators to use the IRC command SQUIT (insted of the already | ||||
|   - Enable IRC operators to use the IRC command SQUIT (instead of the already | ||||
|     implemented but non-standard DISCONNECT command). | ||||
|   - New configuration option "AllowRemoteOper" (disabled by default) that | ||||
|     enables remote IRC operators to use the IRC commands SQUIT and CONNECT | ||||
| @@ -332,13 +591,13 @@ ngIRCd Release 15 (2009-11-07) | ||||
|     a throttling scheme: an IRC client can send up to 3 commands or 256 bytes | ||||
|     per second before a one second pause is enforced. | ||||
|  | ||||
| ngIRCd Release 14.1 (2009-05-05) | ||||
| ngIRCd 14.1 (2009-05-05) | ||||
|  | ||||
|   - Security: fix remotely triggerable crash in SSL/TLS code. | ||||
|   - Debian: build ngircd-full-dbg package. | ||||
|   - Allow ping timeout quit messages to show the timeout value. | ||||
|  | ||||
| ngIRCd Release 14 (2009-04-20) | ||||
| ngIRCd 14 (2009-04-20) | ||||
|  | ||||
|   ngIRCd 14~rc1 (2009-03-29) | ||||
|   - Allow creation of persistent modeless channels. | ||||
| @@ -349,7 +608,7 @@ ngIRCd Release 14 (2009-04-20) | ||||
|     individual channel keys for different users. | ||||
|   - Remove limit on maximum number of predefined channels in ngircd.conf. | ||||
|  | ||||
| ngIRCd Release 13 (2008-12-25) | ||||
| ngIRCd 13 (2008-12-25) | ||||
|  | ||||
|   ngIRCd 13~rc1 (2008-11-21): | ||||
|   - New version number scheme :-) | ||||
| @@ -481,7 +740,7 @@ ngIRCd 0.7.5 (2003-07-11) | ||||
|     (DoS), the default is 5 connections per client IP. | ||||
|   - Added new configuration variable "Listen" to bind all listening | ||||
|     sockets of the server to a single IP address. | ||||
|         | ||||
|  | ||||
| ngIRCd 0.7.1 (2003-07-18) | ||||
|  | ||||
|   - Added support for GNU/Hurd. | ||||
| @@ -506,9 +765,9 @@ ngIRCd 0.7.0 (2003-05-01) | ||||
|   - Documentation is now installed in $(datadir)/doc/ngircd. | ||||
|  | ||||
|  | ||||
| Older news (sorry, only available in german language): | ||||
| Older news (sorry, only available in German language): | ||||
|  | ||||
| ngIRCd 0.6.0, 2002-12-24 | ||||
| ngIRCd 0.6.0, 24.12.2002 | ||||
|  | ||||
|   - beim Schliessen einer Verbindung zeigt der Server nun vor dem ERROR | ||||
|     noch eine Statistik ueber die empfangene und gesendete Datenmenge an. | ||||
|   | ||||
							
								
								
									
										68
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										68
									
								
								README
									
									
									
									
									
								
							| @@ -2,7 +2,7 @@ | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2012 Alexander Barton and Contributors. | ||||
|                (c)2001-2016 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
| @@ -28,31 +28,26 @@ Please see the INSTALL document for installation and upgrade information! | ||||
| II. Status | ||||
| ~~~~~~~~~~~ | ||||
|  | ||||
| It is not the goal of ngIRCd to implement all the nasty behaviours of the | ||||
| ngIRCd should be quite feature complete and stable to be used as daemon in | ||||
| real world IRC networks. | ||||
|  | ||||
| It is not the goal of ngIRCd to implement all the nasty behaviors of the | ||||
| original ircd, but to implement most of the useful commands and semantics | ||||
| specified by the RFCs. | ||||
| specified by the RFCs that are used by existing clients. | ||||
|  | ||||
| In the meantime ngIRCd should be quite feature complete and stable to be | ||||
| used in real IRC networks. | ||||
|  | ||||
| Implemented IRC-commands are: | ||||
|  | ||||
| ADMIN, AWAY, CHANINFO, CONNECT, DIE, DISCONNECT, ERROR, GLINE, HELP, INFO, | ||||
| INVITE, ISON, JOIN, KICK, KILL, KLINE, LINKS, LIST, LUSERS, MODE, MOTD, | ||||
| NAMES, NICK, NJOIN, NOTICE, OPER, PART, PASS, PING, PONG, PRIVMSG, QUIT, | ||||
| REHASH, RESTART, SERVER, SERVICE, SERVLIST, SQUERY, SQUIT, STATS, SUMMON, | ||||
| TIME, TOPIC, TRACE, USER, USERHOST, USERS, VERSION, WALLOPS, WEBIRC, WHO, | ||||
| WHOIS, WHOWAS. | ||||
|  | ||||
| III. Features (or: why use ngIRCd?) | ||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| - well arranged (lean) configuration file | ||||
| - simple to build/install, configure and maintain | ||||
| - supports IPv6 and SSL | ||||
| - no problems with servers that have dynamic IP addresses | ||||
| - freely available, modern, portable and tidy C-source | ||||
| - wide field of supported platforms, including AIX, A/UX, FreeBSD, HP-UX, | ||||
| - Well arranged (lean) configuration file. | ||||
| - Simple to build, install, configure, and maintain. | ||||
| - Supports IPv6 and SSL. | ||||
| - Can use PAM for user authentication. | ||||
| - Lots of popular user and channel modes are implemented. | ||||
| - Supports "cloaking" of users. | ||||
| - No problems with servers that have dynamic IP addresses. | ||||
| - Freely available, modern, portable and tidy C source. | ||||
| - Wide field of supported platforms, including AIX, A/UX, FreeBSD, HP-UX, | ||||
|   IRIX, Linux, Mac OS X, NetBSD, OpenBSD, Solaris, and Windows with Cygwin. | ||||
| - ngIRCd is being actively developed since 2001. | ||||
|  | ||||
| @@ -61,33 +56,34 @@ IV. Documentation | ||||
| ~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| More documentation can be found in the "doc/" directory and the homepage of | ||||
| the ngIRCd: <http://ngircd.barton.de/>. | ||||
| ngIRCd: <http://ngircd.barton.de/>. | ||||
|  | ||||
|  | ||||
| V. Download | ||||
| ~~~~~~~~~~~ | ||||
|  | ||||
| The homepage of the ngIRCd is: <http://ngircd.barton.de/>; you will find | ||||
| The homepage of the ngIRCd is <http://ngircd.barton.de/>; you will find | ||||
| the newest information about the ngIRCd and the most recent ("stable") | ||||
| releases there. | ||||
|  | ||||
| If you are interested in the latest development versions (which are not | ||||
| always stable), then please read the section about "GIT" on the homepage and | ||||
| the file "doc/GIT.txt" which describes the use of GIT, the version control | ||||
| system used by ngIRCd (homepage: http://git-scm.com/). | ||||
| Visit our source code repository at GitHub if you are interested in the | ||||
| latest development version: <https://github.com/ngircd/ngircd>. | ||||
|  | ||||
|  | ||||
| VI. Bugs | ||||
| ~~~~~~~~ | ||||
| VI. Problems, Bugs, Patches | ||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| If you find bugs in the ngIRCd (which might be there :-), please report | ||||
| them at the following URL: | ||||
| Please don't hesitate to contact us if you encounter problems: | ||||
|  | ||||
| <http://ngircd.barton.de/bugtracker.php> | ||||
| - On IRC: <irc://irc.barton.de/ngircd> | ||||
| - Via the mailing list: <ngircd-ml@ngircd.barton.de> | ||||
|  | ||||
| See <http://ngircd.barton.de/support.php> for details. | ||||
|  | ||||
| If you find bugs in ngIRCd (which will be there most probably ...), please | ||||
| report them to our issue tracker at GitHub: | ||||
|  | ||||
| - Bug tracker: <https://github.com/ngircd/ngircd/issues> | ||||
| - Patches, "pull requests": <https://github.com/ngircd/ngircd/pulls> | ||||
|  | ||||
| There you can read about known bugs and limitations, too. | ||||
|  | ||||
| If you have critics, patches or something else, please feel free to post a | ||||
| mail to the ngIRCd mailing list: <ngircd-ml@arthur.barton.de> (please see | ||||
| <http://ngircd.barton.de/support.php#ml> for details) or join the ngIRCd | ||||
| IRC channel: <irc://irc.barton.de/ngircd>. | ||||
|   | ||||
							
								
								
									
										74
									
								
								autogen.sh
									
									
									
									
									
								
							
							
						
						
									
										74
									
								
								autogen.sh
									
									
									
									
									
								
							| @@ -1,7 +1,7 @@ | ||||
| #!/bin/sh | ||||
| # | ||||
| # ngIRCd -- The Next Generation IRC Daemon | ||||
| # Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors | ||||
| # Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| @@ -73,8 +73,12 @@ Search() | ||||
| 	for name in $searchlist; do | ||||
| 		$EXIST "${name}" >/dev/null 2>&1 | ||||
| 		if [ $? -eq 0 ]; then | ||||
| 			echo "${name}" | ||||
| 			return 0 | ||||
| 			"${name}" --version 2>&1 \ | ||||
| 			 | grep -v "environment variable" >/dev/null 2>&1 | ||||
| 			if [ $? -eq 0 ]; then | ||||
| 				echo "${name}" | ||||
| 				return 0 | ||||
| 			fi | ||||
| 		fi | ||||
| 	done | ||||
|  | ||||
| @@ -91,7 +95,7 @@ Search() | ||||
| 				return 0 | ||||
| 			fi | ||||
| 		done | ||||
| 		minor=`expr $minor - 1` | ||||
| 		minor=$(expr $minor - 1) | ||||
| 	done | ||||
| 	return 1 | ||||
| } | ||||
| @@ -105,8 +109,8 @@ Notfound() | ||||
|  | ||||
| Run() | ||||
| { | ||||
| 	[ "$VERBOSE" = "1" ] && echo " - running \"$@\" ..." | ||||
| 	$@ | ||||
| 	[ "$VERBOSE" = "1" ] && echo " - running \"$*\" ..." | ||||
| 	"$@" | ||||
| } | ||||
|  | ||||
| # Reset locale settings to suppress warning messages of Perl | ||||
| @@ -135,17 +139,26 @@ fi | ||||
| # Try to detect the needed tools when no environment variable already | ||||
| # specifies one: | ||||
| echo "Searching for required tools ..." | ||||
| [ -z "$ACLOCAL" ] && ACLOCAL=`Search aclocal 1` | ||||
| [ -z "$ACLOCAL" ] && ACLOCAL=$(Search aclocal 1) | ||||
| [ "$VERBOSE" = "1" ] && echo " - ACLOCAL=$ACLOCAL" | ||||
| [ -z "$AUTOHEADER" ] && AUTOHEADER=`Search autoheader 2` | ||||
| [ -z "$AUTOHEADER" ] && AUTOHEADER=$(Search autoheader 2) | ||||
| [ "$VERBOSE" = "1" ] && echo " - AUTOHEADER=$AUTOHEADER" | ||||
| [ -z "$AUTOMAKE" ] && AUTOMAKE=`Search automake 1` | ||||
| [ -z "$AUTOMAKE" ] && AUTOMAKE=$(Search automake 1) | ||||
| [ "$VERBOSE" = "1" ] && echo " - AUTOMAKE=$AUTOMAKE" | ||||
| [ -z "$AUTOCONF" ] && AUTOCONF=`Search autoconf 2` | ||||
| [ -z "$AUTOCONF" ] && AUTOCONF=$(Search autoconf 2) | ||||
| [ "$VERBOSE" = "1" ] && echo " - AUTOCONF=$AUTOCONF" | ||||
|  | ||||
| [ $# -gt 0 ] && CONFIGURE_ARGS=" $@" || CONFIGURE_ARGS="" | ||||
| [ -z "$GO" -a -n "$CONFIGURE_ARGS" ] && GO=1 | ||||
| AUTOCONF_VERSION=$(echo "$AUTOCONF" | cut -d'-' -f2-) | ||||
| [ -n "$AUTOCONF_VERSION" ] && [ "$AUTOCONF_VERSION" != "autoconf" ] \ | ||||
| 	&& export AUTOCONF_VERSION || unset AUTOCONF_VERSION | ||||
| [ "$VERBOSE" = "1" ] && echo " - AUTOCONF_VERSION=$AUTOCONF_VERSION" | ||||
| AUTOMAKE_VERSION=$(echo $AUTOMAKE | cut -d'-' -f2-) | ||||
| [ -n "$AUTOMAKE_VERSION" ] && [ "$AUTOMAKE_VERSION" != "automake" ] \ | ||||
| 	&& export AUTOMAKE_VERSION || unset AUTOMAKE_VERSION | ||||
| [ "$VERBOSE" = "1" ] && echo " - AUTOMAKE_VERSION=$AUTOMAKE_VERSION" | ||||
|  | ||||
| [ $# -gt 0 ] && CONFIGURE_ARGS=" $*" || CONFIGURE_ARGS="" | ||||
| [ -z "$GO" ] && [ -n "$CONFIGURE_ARGS" ] && GO=1 | ||||
|  | ||||
| # Verify that all tools have been found | ||||
| [ -z "$ACLOCAL" ] && Notfound aclocal | ||||
| @@ -153,46 +166,59 @@ echo "Searching for required tools ..." | ||||
| [ -z "$AUTOMAKE" ] && Notfound automake | ||||
| [ -z "$AUTOCONF" ] && Notfound autoconf | ||||
|  | ||||
| AM_VERSION=`$AUTOMAKE --version|head -n 1|egrep -o "([1-9]\.[0-9]+(\.[0-9]+)*)"` | ||||
| AM_VERSION=$($AUTOMAKE --version | head -n 1 | sed -e 's/.* //g') | ||||
| ifs=$IFS; IFS="."; set $AM_VERSION; IFS=$ifs | ||||
| AM_MAJOR="$1"; AM_MINOR="$2"; AM_PATCHLEVEL="$3" | ||||
| AM_MAJOR="$1"; AM_MINOR="$2" | ||||
| echo "Detected automake $AM_VERSION ..." | ||||
|  | ||||
| AM_MAKEFILES="src/ipaddr/Makefile.ng src/ngircd/Makefile.ng src/testsuite/Makefile.ng src/tool/Makefile.ng" | ||||
|  | ||||
| if [ "$AM_MAJOR" -eq "1" -a "$AM_MINOR" -lt "12" ]; then | ||||
| # De-ANSI-fication? | ||||
| if [ "$AM_MAJOR" -eq "1" ] && [ "$AM_MINOR" -lt "12" ]; then | ||||
| 	# automake < 1.12 => automatic de-ANSI-fication support available | ||||
| 	echo "Enabling de-ANSI-fication support (automake $AM_VERSION) ..." | ||||
| 	echo " - Enabling de-ANSI-fication support." | ||||
| 	sed -e "s|^__ng_PROTOTYPES__|AM_C_PROTOTYPES|g" configure.ng >configure.ac | ||||
| 	DEANSI_START="" | ||||
| 	DEANSI_END="" | ||||
| else | ||||
| 	# automake >= 1.12 => no de-ANSI-fication support available | ||||
| 	echo "Disabling de-ANSI-fication support (automake $AM_VERSION) ..." | ||||
| 	echo " - Disabling de-ANSI-fication support." | ||||
| 	sed -e "s|^__ng_PROTOTYPES__|AC_C_PROTOTYPES|g" configure.ng >configure.ac | ||||
| 	DEANSI_START="#" | ||||
| 	DEANSI_END="	# disabled by ./autogen.sh script" | ||||
| 	DEANSI_END=" (disabled by ./autogen.sh script)" | ||||
| fi | ||||
| sed -e "s|^__ng_Makefile_am_template__|${DEANSI_START}AUTOMAKE_OPTIONS = ansi2knr${DEANSI_END}|g" \ | ||||
| # Serial test harness? | ||||
| if [ "$AM_MAJOR" -eq "1" ] && [ "$AM_MINOR" -ge "13" ]; then | ||||
| 	# automake >= 1.13 => enforce "serial test harness" | ||||
| 	echo " - Enforcing serial test harness." | ||||
| 	SERIAL_TESTS="serial-tests" | ||||
| else | ||||
| 	# automake < 1.13 => no new test harness, nothing to do | ||||
| 	# shellcheck disable=SC2034 | ||||
| 	SERIAL_TEST="" | ||||
| fi | ||||
|  | ||||
| sed -e "s|^__ng_Makefile_am_template__|AUTOMAKE_OPTIONS = ${SERIAL_TESTS} ${DEANSI_START}ansi2knr${DEANSI_END}|g" \ | ||||
| 	src/portab/Makefile.ng >src/portab/Makefile.am | ||||
| for makefile_ng in $AM_MAKEFILES; do | ||||
| 	makefile_am=`echo "$makefile_ng" | sed -e "s|\.ng\$|\.am|g"` | ||||
| 	sed -e "s|^__ng_Makefile_am_template__|${DEANSI_START}AUTOMAKE_OPTIONS = ../portab/ansi2knr${DEANSI_END}|g" \ | ||||
| 	makefile_am=$(echo "$makefile_ng" | sed -e "s|\.ng\$|\.am|g") | ||||
| 	sed -e "s|^__ng_Makefile_am_template__|AUTOMAKE_OPTIONS = ${SERIAL_TESTS} ${DEANSI_START}../portab/ansi2knr${DEANSI_END}|g" \ | ||||
| 		$makefile_ng >$makefile_am | ||||
| done | ||||
|  | ||||
| export ACLOCAL AUTOHEADER AUTOMAKE AUTOCONF | ||||
|  | ||||
| # Generate files | ||||
| echo "Generating files using GNU $AUTOCONF and $AUTOMAKE ..." | ||||
| echo "Generating files using \"$AUTOCONF\" and \"$AUTOMAKE\" ..." | ||||
| Run $ACLOCAL && \ | ||||
| 	Run $AUTOCONF && \ | ||||
| 	Run $AUTOHEADER && \ | ||||
| 	Run $AUTOMAKE --add-missing --no-force | ||||
|  | ||||
| if [ $? -eq 0 -a -x ./configure ]; then | ||||
| if [ $? -eq 0 ] && [ -x ./configure ]; then | ||||
| 	# Success: if we got some parameters we call ./configure and pass | ||||
| 	# all of them to it. | ||||
| 	NAME=`grep PACKAGE_STRING= configure | cut -d"'" -f2` | ||||
| 	NAME=$(grep PACKAGE_STRING= configure | cut -d"'" -f2) | ||||
| 	if [ "$GO" = "1" ]; then | ||||
| 		[ -n "$PREFIX" ] && p=" --prefix=$PREFIX" || p="" | ||||
| 		c="./configure${p}${CONFIGURE_ARGS}" | ||||
|   | ||||
							
								
								
									
										463
									
								
								config.guess
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										463
									
								
								config.guess
									
									
									
									
										vendored
									
									
								
							| @@ -1,14 +1,12 @@ | ||||
| #! /bin/sh | ||||
| # Attempt to guess a canonical system name. | ||||
| #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | ||||
| #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, | ||||
| #   2011, 2012 Free Software Foundation, Inc. | ||||
| #   Copyright 1992-2016 Free Software Foundation, Inc. | ||||
|  | ||||
| timestamp='2012-08-14' | ||||
| timestamp='2016-04-02' | ||||
|  | ||||
| # This file is free software; you can redistribute it and/or modify it | ||||
| # under the terms of the GNU General Public License as published by | ||||
| # the Free Software Foundation; either version 2 of the License, or | ||||
| # the Free Software Foundation; either version 3 of the License, or | ||||
| # (at your option) any later version. | ||||
| # | ||||
| # This program is distributed in the hope that it will be useful, but | ||||
| @@ -22,19 +20,17 @@ timestamp='2012-08-14' | ||||
| # As a special exception to the GNU General Public License, if you | ||||
| # distribute this file as part of a program that contains a | ||||
| # configuration script generated by Autoconf, you may include it under | ||||
| # the same distribution terms that you use for the rest of that program. | ||||
|  | ||||
|  | ||||
| # Originally written by Per Bothner.  Please send patches (context | ||||
| # diff format) to <config-patches@gnu.org> and include a ChangeLog | ||||
| # entry. | ||||
| # the same distribution terms that you use for the rest of that | ||||
| # program.  This Exception is an additional permission under section 7 | ||||
| # of the GNU General Public License, version 3 ("GPLv3"). | ||||
| # | ||||
| # This script attempts to guess a canonical system name similar to | ||||
| # config.sub.  If it succeeds, it prints the system name on stdout, and | ||||
| # exits with 0.  Otherwise, it exits with 1. | ||||
| # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. | ||||
| # | ||||
| # You can get the latest version of this script from: | ||||
| # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD | ||||
| # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | ||||
| # | ||||
| # Please send patches to <config-patches@gnu.org>. | ||||
|  | ||||
|  | ||||
| me=`echo "$0" | sed -e 's,.*/,,'` | ||||
|  | ||||
| @@ -54,9 +50,7 @@ version="\ | ||||
| GNU config.guess ($timestamp) | ||||
|  | ||||
| Originally written by Per Bothner. | ||||
| Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, | ||||
| 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 | ||||
| Free Software Foundation, Inc. | ||||
| Copyright 1992-2016 Free Software Foundation, Inc. | ||||
|  | ||||
| This is free software; see the source for copying conditions.  There is NO | ||||
| warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | ||||
| @@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown | ||||
| UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown | ||||
| UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown | ||||
|  | ||||
| case "${UNAME_SYSTEM}" in | ||||
| Linux|GNU|GNU/*) | ||||
| 	# If the system lacks a compiler, then just pick glibc. | ||||
| 	# We could probably try harder. | ||||
| 	LIBC=gnu | ||||
|  | ||||
| 	eval $set_cc_for_build | ||||
| 	cat <<-EOF > $dummy.c | ||||
| 	#include <features.h> | ||||
| 	#if defined(__UCLIBC__) | ||||
| 	LIBC=uclibc | ||||
| 	#elif defined(__dietlibc__) | ||||
| 	LIBC=dietlibc | ||||
| 	#else | ||||
| 	LIBC=gnu | ||||
| 	#endif | ||||
| 	EOF | ||||
| 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` | ||||
| 	;; | ||||
| esac | ||||
|  | ||||
| # Note: order is significant - the case branches are not exclusive. | ||||
|  | ||||
| case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||||
| @@ -153,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||||
| 	# Note: NetBSD doesn't particularly care about the vendor | ||||
| 	# portion of the name.  We always set it to "unknown". | ||||
| 	sysctl="sysctl -n hw.machine_arch" | ||||
| 	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ | ||||
| 	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)` | ||||
| 	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ | ||||
| 	    /sbin/$sysctl 2>/dev/null || \ | ||||
| 	    /usr/sbin/$sysctl 2>/dev/null || \ | ||||
| 	    echo unknown)` | ||||
| 	case "${UNAME_MACHINE_ARCH}" in | ||||
| 	    armeb) machine=armeb-unknown ;; | ||||
| 	    arm*) machine=arm-unknown ;; | ||||
| 	    sh3el) machine=shl-unknown ;; | ||||
| 	    sh3eb) machine=sh-unknown ;; | ||||
| 	    sh5el) machine=sh5le-unknown ;; | ||||
| 	    earmv*) | ||||
| 		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` | ||||
| 		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` | ||||
| 		machine=${arch}${endian}-unknown | ||||
| 		;; | ||||
| 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;; | ||||
| 	esac | ||||
| 	# The Operating System including object format, if it has switched | ||||
| 	# to ELF recently, or will in the future. | ||||
| 	case "${UNAME_MACHINE_ARCH}" in | ||||
| 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax) | ||||
| 	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) | ||||
| 		eval $set_cc_for_build | ||||
| 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | ||||
| 			| grep -q __ELF__ | ||||
| @@ -182,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||||
| 		os=netbsd | ||||
| 		;; | ||||
| 	esac | ||||
| 	# Determine ABI tags. | ||||
| 	case "${UNAME_MACHINE_ARCH}" in | ||||
| 	    earm*) | ||||
| 		expr='s/^earmv[0-9]/-eabi/;s/eb$//' | ||||
| 		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` | ||||
| 		;; | ||||
| 	esac | ||||
| 	# The OS release | ||||
| 	# Debian GNU/NetBSD machines have a different userland, and | ||||
| 	# thus, need a distinct triplet. However, they do not need | ||||
| @@ -192,13 +221,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||||
| 		release='-gnu' | ||||
| 		;; | ||||
| 	    *) | ||||
| 		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` | ||||
| 		release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` | ||||
| 		;; | ||||
| 	esac | ||||
| 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: | ||||
| 	# contains redundant information, the shorter form: | ||||
| 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. | ||||
| 	echo "${machine}-${os}${release}" | ||||
| 	echo "${machine}-${os}${release}${abi}" | ||||
| 	exit ;; | ||||
|     *:Bitrig:*:*) | ||||
| 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` | ||||
| @@ -208,6 +237,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||||
| 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` | ||||
| 	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} | ||||
| 	exit ;; | ||||
|     *:LibertyBSD:*:*) | ||||
| 	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` | ||||
| 	echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} | ||||
| 	exit ;; | ||||
|     *:ekkoBSD:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} | ||||
| 	exit ;; | ||||
| @@ -220,6 +253,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||||
|     *:MirBSD:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} | ||||
| 	exit ;; | ||||
|     *:Sortix:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-sortix | ||||
| 	exit ;; | ||||
|     alpha:OSF1:*:*) | ||||
| 	case $UNAME_RELEASE in | ||||
| 	*4.0) | ||||
| @@ -236,42 +272,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||||
| 	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1` | ||||
| 	case "$ALPHA_CPU_TYPE" in | ||||
| 	    "EV4 (21064)") | ||||
| 		UNAME_MACHINE="alpha" ;; | ||||
| 		UNAME_MACHINE=alpha ;; | ||||
| 	    "EV4.5 (21064)") | ||||
| 		UNAME_MACHINE="alpha" ;; | ||||
| 		UNAME_MACHINE=alpha ;; | ||||
| 	    "LCA4 (21066/21068)") | ||||
| 		UNAME_MACHINE="alpha" ;; | ||||
| 		UNAME_MACHINE=alpha ;; | ||||
| 	    "EV5 (21164)") | ||||
| 		UNAME_MACHINE="alphaev5" ;; | ||||
| 		UNAME_MACHINE=alphaev5 ;; | ||||
| 	    "EV5.6 (21164A)") | ||||
| 		UNAME_MACHINE="alphaev56" ;; | ||||
| 		UNAME_MACHINE=alphaev56 ;; | ||||
| 	    "EV5.6 (21164PC)") | ||||
| 		UNAME_MACHINE="alphapca56" ;; | ||||
| 		UNAME_MACHINE=alphapca56 ;; | ||||
| 	    "EV5.7 (21164PC)") | ||||
| 		UNAME_MACHINE="alphapca57" ;; | ||||
| 		UNAME_MACHINE=alphapca57 ;; | ||||
| 	    "EV6 (21264)") | ||||
| 		UNAME_MACHINE="alphaev6" ;; | ||||
| 		UNAME_MACHINE=alphaev6 ;; | ||||
| 	    "EV6.7 (21264A)") | ||||
| 		UNAME_MACHINE="alphaev67" ;; | ||||
| 		UNAME_MACHINE=alphaev67 ;; | ||||
| 	    "EV6.8CB (21264C)") | ||||
| 		UNAME_MACHINE="alphaev68" ;; | ||||
| 		UNAME_MACHINE=alphaev68 ;; | ||||
| 	    "EV6.8AL (21264B)") | ||||
| 		UNAME_MACHINE="alphaev68" ;; | ||||
| 		UNAME_MACHINE=alphaev68 ;; | ||||
| 	    "EV6.8CX (21264D)") | ||||
| 		UNAME_MACHINE="alphaev68" ;; | ||||
| 		UNAME_MACHINE=alphaev68 ;; | ||||
| 	    "EV6.9A (21264/EV69A)") | ||||
| 		UNAME_MACHINE="alphaev69" ;; | ||||
| 		UNAME_MACHINE=alphaev69 ;; | ||||
| 	    "EV7 (21364)") | ||||
| 		UNAME_MACHINE="alphaev7" ;; | ||||
| 		UNAME_MACHINE=alphaev7 ;; | ||||
| 	    "EV7.9 (21364A)") | ||||
| 		UNAME_MACHINE="alphaev79" ;; | ||||
| 		UNAME_MACHINE=alphaev79 ;; | ||||
| 	esac | ||||
| 	# A Pn.n version is a patched version. | ||||
| 	# A Vn.n version is a released version. | ||||
| 	# A Tn.n version is a released field test version. | ||||
| 	# A Xn.n version is an unreleased experimental baselevel. | ||||
| 	# 1.2 uses "1.2" for uname -r. | ||||
| 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | ||||
| 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` | ||||
| 	# Reset EXIT trap before exiting to avoid spurious non-zero exit code. | ||||
| 	exitcode=$? | ||||
| 	trap '' 0 | ||||
| @@ -306,7 +342,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||||
|     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) | ||||
| 	echo arm-acorn-riscix${UNAME_RELEASE} | ||||
| 	exit ;; | ||||
|     arm:riscos:*:*|arm:RISCOS:*:*) | ||||
|     arm*:riscos:*:*|arm*:RISCOS:*:*) | ||||
| 	echo arm-unknown-riscos | ||||
| 	exit ;; | ||||
|     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) | ||||
| @@ -344,16 +380,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||||
| 	exit ;; | ||||
|     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) | ||||
| 	eval $set_cc_for_build | ||||
| 	SUN_ARCH="i386" | ||||
| 	SUN_ARCH=i386 | ||||
| 	# If there is a compiler, see if it is configured for 64-bit objects. | ||||
| 	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does. | ||||
| 	# This test works for both compilers. | ||||
| 	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | ||||
| 	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | ||||
| 	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ | ||||
| 		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | ||||
| 		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | ||||
| 		grep IS_64BIT_ARCH >/dev/null | ||||
| 	    then | ||||
| 		SUN_ARCH="x86_64" | ||||
| 		SUN_ARCH=x86_64 | ||||
| 	    fi | ||||
| 	fi | ||||
| 	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||||
| @@ -378,7 +414,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||||
| 	exit ;; | ||||
|     sun*:*:4.2BSD:*) | ||||
| 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` | ||||
| 	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 | ||||
| 	test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 | ||||
| 	case "`/bin/arch`" in | ||||
| 	    sun3) | ||||
| 		echo m68k-sun-sunos${UNAME_RELEASE} | ||||
| @@ -564,8 +600,9 @@ EOF | ||||
| 	else | ||||
| 		IBM_ARCH=powerpc | ||||
| 	fi | ||||
| 	if [ -x /usr/bin/oslevel ] ; then | ||||
| 		IBM_REV=`/usr/bin/oslevel` | ||||
| 	if [ -x /usr/bin/lslpp ] ; then | ||||
| 		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | | ||||
| 			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` | ||||
| 	else | ||||
| 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} | ||||
| 	fi | ||||
| @@ -602,13 +639,13 @@ EOF | ||||
| 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` | ||||
| 		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` | ||||
| 		    case "${sc_cpu_version}" in | ||||
| 		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 | ||||
| 		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 | ||||
| 		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 | ||||
| 		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 | ||||
| 		      532)                      # CPU_PA_RISC2_0 | ||||
| 			case "${sc_kernel_bits}" in | ||||
| 			  32) HP_ARCH="hppa2.0n" ;; | ||||
| 			  64) HP_ARCH="hppa2.0w" ;; | ||||
| 			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20 | ||||
| 			  32) HP_ARCH=hppa2.0n ;; | ||||
| 			  64) HP_ARCH=hppa2.0w ;; | ||||
| 			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20 | ||||
| 			esac ;; | ||||
| 		    esac | ||||
| 		fi | ||||
| @@ -647,11 +684,11 @@ EOF | ||||
| 		    exit (0); | ||||
| 		} | ||||
| EOF | ||||
| 		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` | ||||
| 		    (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` | ||||
| 		    test -z "$HP_ARCH" && HP_ARCH=hppa | ||||
| 		fi ;; | ||||
| 	esac | ||||
| 	if [ ${HP_ARCH} = "hppa2.0w" ] | ||||
| 	if [ ${HP_ARCH} = hppa2.0w ] | ||||
| 	then | ||||
| 	    eval $set_cc_for_build | ||||
|  | ||||
| @@ -664,12 +701,12 @@ EOF | ||||
| 	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess | ||||
| 	    # => hppa64-hp-hpux11.23 | ||||
|  | ||||
| 	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | | ||||
| 	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | | ||||
| 		grep -q __LP64__ | ||||
| 	    then | ||||
| 		HP_ARCH="hppa2.0w" | ||||
| 		HP_ARCH=hppa2.0w | ||||
| 	    else | ||||
| 		HP_ARCH="hppa64" | ||||
| 		HP_ARCH=hppa64 | ||||
| 	    fi | ||||
| 	fi | ||||
| 	echo ${HP_ARCH}-hp-hpux${HPUX_REV} | ||||
| @@ -774,14 +811,14 @@ EOF | ||||
| 	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||||
| 	exit ;; | ||||
|     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) | ||||
| 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | ||||
| 	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | ||||
| 	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` | ||||
| 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` | ||||
| 	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` | ||||
| 	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | ||||
| 	exit ;; | ||||
|     5000:UNIX_System_V:4.*:*) | ||||
| 	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | ||||
| 	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` | ||||
| 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` | ||||
| 	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` | ||||
| 	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | ||||
| 	exit ;; | ||||
|     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) | ||||
| @@ -811,7 +848,7 @@ EOF | ||||
|     *:MINGW*:*) | ||||
| 	echo ${UNAME_MACHINE}-pc-mingw32 | ||||
| 	exit ;; | ||||
|     i*:MSYS*:*) | ||||
|     *:MSYS*:*) | ||||
| 	echo ${UNAME_MACHINE}-pc-msys | ||||
| 	exit ;; | ||||
|     i*:windows32*:*) | ||||
| @@ -859,21 +896,21 @@ EOF | ||||
| 	exit ;; | ||||
|     *:GNU:*:*) | ||||
| 	# the GNU system | ||||
| 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` | ||||
| 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` | ||||
| 	exit ;; | ||||
|     *:GNU/*:*:*) | ||||
| 	# other systems with GNU libc and userland | ||||
| 	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} | ||||
| 	exit ;; | ||||
|     i*86:Minix:*:*) | ||||
| 	echo ${UNAME_MACHINE}-pc-minix | ||||
| 	exit ;; | ||||
|     aarch64:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     aarch64_be:Linux:*:*) | ||||
| 	UNAME_MACHINE=aarch64_be | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     alpha:Linux:*:*) | ||||
| 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in | ||||
| @@ -886,59 +923,60 @@ EOF | ||||
| 	  EV68*) UNAME_MACHINE=alphaev68 ;; | ||||
| 	esac | ||||
| 	objdump --private-headers /bin/sh | grep -q ld.so.1 | ||||
| 	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} | ||||
| 	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     arc:Linux:*:* | arceb:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     arm*:Linux:*:*) | ||||
| 	eval $set_cc_for_build | ||||
| 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | ||||
| 	    | grep -q __ARM_EABI__ | ||||
| 	then | ||||
| 	    echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	else | ||||
| 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | ||||
| 		| grep -q __ARM_PCS_VFP | ||||
| 	    then | ||||
| 		echo ${UNAME_MACHINE}-unknown-linux-gnueabi | ||||
| 		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi | ||||
| 	    else | ||||
| 		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf | ||||
| 		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf | ||||
| 	    fi | ||||
| 	fi | ||||
| 	exit ;; | ||||
|     avr32*:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     cris:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-axis-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-axis-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     crisv32:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-axis-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-axis-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     e2k:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     frv:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     hexagon:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     i*86:Linux:*:*) | ||||
| 	LIBC=gnu | ||||
| 	eval $set_cc_for_build | ||||
| 	sed 's/^	//' << EOF >$dummy.c | ||||
| 	#ifdef __dietlibc__ | ||||
| 	LIBC=dietlibc | ||||
| 	#endif | ||||
| EOF | ||||
| 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` | ||||
| 	echo "${UNAME_MACHINE}-pc-linux-${LIBC}" | ||||
| 	echo ${UNAME_MACHINE}-pc-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     ia64:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     k1om:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     m32r*:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     m68*:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     mips:Linux:*:* | mips64:Linux:*:*) | ||||
| 	eval $set_cc_for_build | ||||
| @@ -957,54 +995,63 @@ EOF | ||||
| 	#endif | ||||
| EOF | ||||
| 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` | ||||
| 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } | ||||
| 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } | ||||
| 	;; | ||||
|     or32:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
|     openrisc*:Linux:*:*) | ||||
| 	echo or1k-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     or32:Linux:*:* | or1k*:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     padre:Linux:*:*) | ||||
| 	echo sparc-unknown-linux-gnu | ||||
| 	echo sparc-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     parisc64:Linux:*:* | hppa64:Linux:*:*) | ||||
| 	echo hppa64-unknown-linux-gnu | ||||
| 	echo hppa64-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     parisc:Linux:*:* | hppa:Linux:*:*) | ||||
| 	# Look for CPU level | ||||
| 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in | ||||
| 	  PA7*) echo hppa1.1-unknown-linux-gnu ;; | ||||
| 	  PA8*) echo hppa2.0-unknown-linux-gnu ;; | ||||
| 	  *)    echo hppa-unknown-linux-gnu ;; | ||||
| 	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; | ||||
| 	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; | ||||
| 	  *)    echo hppa-unknown-linux-${LIBC} ;; | ||||
| 	esac | ||||
| 	exit ;; | ||||
|     ppc64:Linux:*:*) | ||||
| 	echo powerpc64-unknown-linux-gnu | ||||
| 	echo powerpc64-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     ppc:Linux:*:*) | ||||
| 	echo powerpc-unknown-linux-gnu | ||||
| 	echo powerpc-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     ppc64le:Linux:*:*) | ||||
| 	echo powerpc64le-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     ppcle:Linux:*:*) | ||||
| 	echo powerpcle-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     s390:Linux:*:* | s390x:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-ibm-linux | ||||
| 	echo ${UNAME_MACHINE}-ibm-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     sh64*:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     sh*:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     sparc:Linux:*:* | sparc64:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     tile*:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     vax:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-dec-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-dec-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     x86_64:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-pc-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     xtensa*:Linux:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-gnu | ||||
| 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||||
| 	exit ;; | ||||
|     i*86:DYNIX/ptx:4*:*) | ||||
| 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. | ||||
| @@ -1080,7 +1127,7 @@ EOF | ||||
| 	# uname -m prints for DJGPP always 'pc', but it prints nothing about | ||||
| 	# the processor, so we play safe by assuming i586. | ||||
| 	# Note: whatever this is, it MUST be the same as what config.sub | ||||
| 	# prints for the "djgpp" host, or else GDB configury will decide that | ||||
| 	# prints for the "djgpp" host, or else GDB configure will decide that | ||||
| 	# this is a cross-build. | ||||
| 	echo i586-pc-msdosdjgpp | ||||
| 	exit ;; | ||||
| @@ -1229,6 +1276,9 @@ EOF | ||||
|     SX-8R:SUPER-UX:*:*) | ||||
| 	echo sx8r-nec-superux${UNAME_RELEASE} | ||||
| 	exit ;; | ||||
|     SX-ACE:SUPER-UX:*:*) | ||||
| 	echo sxace-nec-superux${UNAME_RELEASE} | ||||
| 	exit ;; | ||||
|     Power*:Rhapsody:*:*) | ||||
| 	echo powerpc-apple-rhapsody${UNAME_RELEASE} | ||||
| 	exit ;; | ||||
| @@ -1237,24 +1287,36 @@ EOF | ||||
| 	exit ;; | ||||
|     *:Darwin:*:*) | ||||
| 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown | ||||
| 	case $UNAME_PROCESSOR in | ||||
| 	    i386) | ||||
| 		eval $set_cc_for_build | ||||
| 		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | ||||
| 		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ | ||||
| 		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | ||||
| 		      grep IS_64BIT_ARCH >/dev/null | ||||
| 		  then | ||||
| 		      UNAME_PROCESSOR="x86_64" | ||||
| 		  fi | ||||
| 		fi ;; | ||||
| 	    unknown) UNAME_PROCESSOR=powerpc ;; | ||||
| 	esac | ||||
| 	eval $set_cc_for_build | ||||
| 	if test "$UNAME_PROCESSOR" = unknown ; then | ||||
| 	    UNAME_PROCESSOR=powerpc | ||||
| 	fi | ||||
| 	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then | ||||
| 	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then | ||||
| 		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ | ||||
| 		    (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ | ||||
| 		    grep IS_64BIT_ARCH >/dev/null | ||||
| 		then | ||||
| 		    case $UNAME_PROCESSOR in | ||||
| 			i386) UNAME_PROCESSOR=x86_64 ;; | ||||
| 			powerpc) UNAME_PROCESSOR=powerpc64 ;; | ||||
| 		    esac | ||||
| 		fi | ||||
| 	    fi | ||||
| 	elif test "$UNAME_PROCESSOR" = i386 ; then | ||||
| 	    # Avoid executing cc on OS X 10.9, as it ships with a stub | ||||
| 	    # that puts up a graphical alert prompting to install | ||||
| 	    # developer tools.  Any system running Mac OS X 10.7 or | ||||
| 	    # later (Darwin 11 and later) is required to have a 64-bit | ||||
| 	    # processor. This is not true of the ARM version of Darwin | ||||
| 	    # that Apple uses in portable devices. | ||||
| 	    UNAME_PROCESSOR=x86_64 | ||||
| 	fi | ||||
| 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} | ||||
| 	exit ;; | ||||
|     *:procnto*:*:* | *:QNX:[0123456789]*:*) | ||||
| 	UNAME_PROCESSOR=`uname -p` | ||||
| 	if test "$UNAME_PROCESSOR" = "x86"; then | ||||
| 	if test "$UNAME_PROCESSOR" = x86; then | ||||
| 		UNAME_PROCESSOR=i386 | ||||
| 		UNAME_MACHINE=pc | ||||
| 	fi | ||||
| @@ -1285,7 +1347,7 @@ EOF | ||||
| 	# "uname -m" is not consistent, so use $cputype instead. 386 | ||||
| 	# is converted to i386 for consistency with other x86 | ||||
| 	# operating systems. | ||||
| 	if test "$cputype" = "386"; then | ||||
| 	if test "$cputype" = 386; then | ||||
| 	    UNAME_MACHINE=i386 | ||||
| 	else | ||||
| 	    UNAME_MACHINE="$cputype" | ||||
| @@ -1327,7 +1389,7 @@ EOF | ||||
| 	echo i386-pc-xenix | ||||
| 	exit ;; | ||||
|     i*86:skyos:*:*) | ||||
| 	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' | ||||
| 	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` | ||||
| 	exit ;; | ||||
|     i*86:rdos:*:*) | ||||
| 	echo ${UNAME_MACHINE}-pc-rdos | ||||
| @@ -1338,156 +1400,11 @@ EOF | ||||
|     x86_64:VMkernel:*:*) | ||||
| 	echo ${UNAME_MACHINE}-unknown-esx | ||||
| 	exit ;; | ||||
|     amd64:Isilon\ OneFS:*:*) | ||||
| 	echo x86_64-unknown-onefs | ||||
| 	exit ;; | ||||
| esac | ||||
|  | ||||
| eval $set_cc_for_build | ||||
| cat >$dummy.c <<EOF | ||||
| #ifdef _SEQUENT_ | ||||
| # include <sys/types.h> | ||||
| # include <sys/utsname.h> | ||||
| #endif | ||||
| main () | ||||
| { | ||||
| #if defined (sony) | ||||
| #if defined (MIPSEB) | ||||
|   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed, | ||||
|      I don't know....  */ | ||||
|   printf ("mips-sony-bsd\n"); exit (0); | ||||
| #else | ||||
| #include <sys/param.h> | ||||
|   printf ("m68k-sony-newsos%s\n", | ||||
| #ifdef NEWSOS4 | ||||
| 	"4" | ||||
| #else | ||||
| 	"" | ||||
| #endif | ||||
| 	); exit (0); | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
| #if defined (__arm) && defined (__acorn) && defined (__unix) | ||||
|   printf ("arm-acorn-riscix\n"); exit (0); | ||||
| #endif | ||||
|  | ||||
| #if defined (hp300) && !defined (hpux) | ||||
|   printf ("m68k-hp-bsd\n"); exit (0); | ||||
| #endif | ||||
|  | ||||
| #if defined (NeXT) | ||||
| #if !defined (__ARCHITECTURE__) | ||||
| #define __ARCHITECTURE__ "m68k" | ||||
| #endif | ||||
|   int version; | ||||
|   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; | ||||
|   if (version < 4) | ||||
|     printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); | ||||
|   else | ||||
|     printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); | ||||
|   exit (0); | ||||
| #endif | ||||
|  | ||||
| #if defined (MULTIMAX) || defined (n16) | ||||
| #if defined (UMAXV) | ||||
|   printf ("ns32k-encore-sysv\n"); exit (0); | ||||
| #else | ||||
| #if defined (CMU) | ||||
|   printf ("ns32k-encore-mach\n"); exit (0); | ||||
| #else | ||||
|   printf ("ns32k-encore-bsd\n"); exit (0); | ||||
| #endif | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
| #if defined (__386BSD__) | ||||
|   printf ("i386-pc-bsd\n"); exit (0); | ||||
| #endif | ||||
|  | ||||
| #if defined (sequent) | ||||
| #if defined (i386) | ||||
|   printf ("i386-sequent-dynix\n"); exit (0); | ||||
| #endif | ||||
| #if defined (ns32000) | ||||
|   printf ("ns32k-sequent-dynix\n"); exit (0); | ||||
| #endif | ||||
| #endif | ||||
|  | ||||
| #if defined (_SEQUENT_) | ||||
|     struct utsname un; | ||||
|  | ||||
|     uname(&un); | ||||
|  | ||||
|     if (strncmp(un.version, "V2", 2) == 0) { | ||||
| 	printf ("i386-sequent-ptx2\n"); exit (0); | ||||
|     } | ||||
|     if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ | ||||
| 	printf ("i386-sequent-ptx1\n"); exit (0); | ||||
|     } | ||||
|     printf ("i386-sequent-ptx\n"); exit (0); | ||||
|  | ||||
| #endif | ||||
|  | ||||
| #if defined (vax) | ||||
| # if !defined (ultrix) | ||||
| #  include <sys/param.h> | ||||
| #  if defined (BSD) | ||||
| #   if BSD == 43 | ||||
|       printf ("vax-dec-bsd4.3\n"); exit (0); | ||||
| #   else | ||||
| #    if BSD == 199006 | ||||
|       printf ("vax-dec-bsd4.3reno\n"); exit (0); | ||||
| #    else | ||||
|       printf ("vax-dec-bsd\n"); exit (0); | ||||
| #    endif | ||||
| #   endif | ||||
| #  else | ||||
|     printf ("vax-dec-bsd\n"); exit (0); | ||||
| #  endif | ||||
| # else | ||||
|     printf ("vax-dec-ultrix\n"); exit (0); | ||||
| # endif | ||||
| #endif | ||||
|  | ||||
| #if defined (alliant) && defined (i860) | ||||
|   printf ("i860-alliant-bsd\n"); exit (0); | ||||
| #endif | ||||
|  | ||||
|   exit (1); | ||||
| } | ||||
| EOF | ||||
|  | ||||
| $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && | ||||
| 	{ echo "$SYSTEM_NAME"; exit; } | ||||
|  | ||||
| # Apollos put the system type in the environment. | ||||
|  | ||||
| test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } | ||||
|  | ||||
| # Convex versions that predate uname can use getsysinfo(1) | ||||
|  | ||||
| if [ -x /usr/convex/getsysinfo ] | ||||
| then | ||||
|     case `getsysinfo -f cpu_type` in | ||||
|     c1*) | ||||
| 	echo c1-convex-bsd | ||||
| 	exit ;; | ||||
|     c2*) | ||||
| 	if getsysinfo -f scalar_acc | ||||
| 	then echo c32-convex-bsd | ||||
| 	else echo c2-convex-bsd | ||||
| 	fi | ||||
| 	exit ;; | ||||
|     c34*) | ||||
| 	echo c34-convex-bsd | ||||
| 	exit ;; | ||||
|     c38*) | ||||
| 	echo c38-convex-bsd | ||||
| 	exit ;; | ||||
|     c4*) | ||||
| 	echo c4-convex-bsd | ||||
| 	exit ;; | ||||
|     esac | ||||
| fi | ||||
|  | ||||
| cat >&2 <<EOF | ||||
| $0: unable to guess system type | ||||
|  | ||||
| @@ -1495,9 +1412,9 @@ This script, last modified $timestamp, has failed to recognize | ||||
| the operating system you are using. It is advised that you | ||||
| download the most up to date version of the config scripts from | ||||
|  | ||||
|   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD | ||||
|   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess | ||||
| and | ||||
|   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD | ||||
|   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub | ||||
|  | ||||
| If the version you run ($0) is already up to date, please | ||||
| send the following data and any information you think might be | ||||
|   | ||||
							
								
								
									
										139
									
								
								config.sub
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										139
									
								
								config.sub
									
									
									
									
										vendored
									
									
								
							| @@ -1,24 +1,18 @@ | ||||
| #! /bin/sh | ||||
| # Configuration validation subroutine script. | ||||
| #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | ||||
| #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, | ||||
| #   2011, 2012 Free Software Foundation, Inc. | ||||
| #   Copyright 1992-2016 Free Software Foundation, Inc. | ||||
|  | ||||
| timestamp='2012-08-18' | ||||
| timestamp='2016-03-30' | ||||
|  | ||||
| # This file is (in principle) common to ALL GNU software. | ||||
| # The presence of a machine in this file suggests that SOME GNU software | ||||
| # can handle that machine.  It does not imply ALL GNU software can. | ||||
| # | ||||
| # This file is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| # the Free Software Foundation; either version 2 of the License, or | ||||
| # This file is free software; you can redistribute it and/or modify it | ||||
| # under the terms of the GNU General Public License as published by | ||||
| # the Free Software Foundation; either version 3 of the License, or | ||||
| # (at your option) any later version. | ||||
| # | ||||
| # This program is distributed in the hope that it will be useful, | ||||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | ||||
| # GNU General Public License for more details. | ||||
| # This program is distributed in the hope that it will be useful, but | ||||
| # WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | ||||
| # General Public License for more details. | ||||
| # | ||||
| # You should have received a copy of the GNU General Public License | ||||
| # along with this program; if not, see <http://www.gnu.org/licenses/>. | ||||
| @@ -26,11 +20,12 @@ timestamp='2012-08-18' | ||||
| # As a special exception to the GNU General Public License, if you | ||||
| # distribute this file as part of a program that contains a | ||||
| # configuration script generated by Autoconf, you may include it under | ||||
| # the same distribution terms that you use for the rest of that program. | ||||
| # the same distribution terms that you use for the rest of that | ||||
| # program.  This Exception is an additional permission under section 7 | ||||
| # of the GNU General Public License, version 3 ("GPLv3"). | ||||
|  | ||||
|  | ||||
| # Please send patches to <config-patches@gnu.org>.  Submit a context | ||||
| # diff and a properly formatted GNU ChangeLog entry. | ||||
| # Please send patches to <config-patches@gnu.org>. | ||||
| # | ||||
| # Configuration subroutine to validate and canonicalize a configuration type. | ||||
| # Supply the specified configuration type as an argument. | ||||
| @@ -38,7 +33,7 @@ timestamp='2012-08-18' | ||||
| # Otherwise, we print the canonical config type on stdout and succeed. | ||||
|  | ||||
| # You can get the latest version of this script from: | ||||
| # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD | ||||
| # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub | ||||
|  | ||||
| # This file is supposed to be the same for all GNU packages | ||||
| # and recognize all the CPU types, system types and aliases | ||||
| @@ -58,8 +53,7 @@ timestamp='2012-08-18' | ||||
| me=`echo "$0" | sed -e 's,.*/,,'` | ||||
|  | ||||
| usage="\ | ||||
| Usage: $0 [OPTION] CPU-MFR-OPSYS | ||||
|        $0 [OPTION] ALIAS | ||||
| Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS | ||||
|  | ||||
| Canonicalize a configuration name. | ||||
|  | ||||
| @@ -73,9 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>." | ||||
| version="\ | ||||
| GNU config.sub ($timestamp) | ||||
|  | ||||
| Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, | ||||
| 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 | ||||
| Free Software Foundation, Inc. | ||||
| Copyright 1992-2016 Free Software Foundation, Inc. | ||||
|  | ||||
| This is free software; see the source for copying conditions.  There is NO | ||||
| warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | ||||
| @@ -124,7 +116,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` | ||||
| case $maybe_os in | ||||
|   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ | ||||
|   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ | ||||
|   knetbsd*-gnu* | netbsd*-gnu* | \ | ||||
|   knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ | ||||
|   kopensolaris*-gnu* | \ | ||||
|   storm-chaos* | os2-emx* | rtmk-nova*) | ||||
|     os=-$maybe_os | ||||
| @@ -156,7 +148,7 @@ case $os in | ||||
| 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ | ||||
| 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ | ||||
| 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ | ||||
| 	-apple | -axis | -knuth | -cray | -microblaze) | ||||
| 	-apple | -axis | -knuth | -cray | -microblaze*) | ||||
| 		os= | ||||
| 		basic_machine=$1 | ||||
| 		;; | ||||
| @@ -259,21 +251,25 @@ case $basic_machine in | ||||
| 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | ||||
| 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | ||||
| 	| am33_2.0 \ | ||||
| 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | ||||
|         | be32 | be64 \ | ||||
| 	| arc | arceb \ | ||||
| 	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | ||||
| 	| avr | avr32 \ | ||||
| 	| ba \ | ||||
| 	| be32 | be64 \ | ||||
| 	| bfin \ | ||||
| 	| c4x | clipper \ | ||||
| 	| c4x | c8051 | clipper \ | ||||
| 	| d10v | d30v | dlx | dsp16xx \ | ||||
| 	| epiphany \ | ||||
| 	| fido | fr30 | frv \ | ||||
| 	| e2k | epiphany \ | ||||
| 	| fido | fr30 | frv | ft32 \ | ||||
| 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | ||||
| 	| hexagon \ | ||||
| 	| i370 | i860 | i960 | ia64 \ | ||||
| 	| ip2k | iq2000 \ | ||||
| 	| k1om \ | ||||
| 	| le32 | le64 \ | ||||
| 	| lm32 \ | ||||
| 	| m32c | m32r | m32rle | m68000 | m68k | m88k \ | ||||
| 	| maxq | mb | microblaze | mcore | mep | metag \ | ||||
| 	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | ||||
| 	| mips | mipsbe | mipseb | mipsel | mipsle \ | ||||
| 	| mips16 \ | ||||
| 	| mips64 | mips64el \ | ||||
| @@ -287,26 +283,29 @@ case $basic_machine in | ||||
| 	| mips64vr5900 | mips64vr5900el \ | ||||
| 	| mipsisa32 | mipsisa32el \ | ||||
| 	| mipsisa32r2 | mipsisa32r2el \ | ||||
| 	| mipsisa32r6 | mipsisa32r6el \ | ||||
| 	| mipsisa64 | mipsisa64el \ | ||||
| 	| mipsisa64r2 | mipsisa64r2el \ | ||||
| 	| mipsisa64r6 | mipsisa64r6el \ | ||||
| 	| mipsisa64sb1 | mipsisa64sb1el \ | ||||
| 	| mipsisa64sr71k | mipsisa64sr71kel \ | ||||
| 	| mipsr5900 | mipsr5900el \ | ||||
| 	| mipstx39 | mipstx39el \ | ||||
| 	| mn10200 | mn10300 \ | ||||
| 	| moxie \ | ||||
| 	| mt \ | ||||
| 	| msp430 \ | ||||
| 	| nds32 | nds32le | nds32be \ | ||||
| 	| nios | nios2 \ | ||||
| 	| nios | nios2 | nios2eb | nios2el \ | ||||
| 	| ns16k | ns32k \ | ||||
| 	| open8 \ | ||||
| 	| or32 \ | ||||
| 	| open8 | or1k | or1knd | or32 \ | ||||
| 	| pdp10 | pdp11 | pj | pjl \ | ||||
| 	| powerpc | powerpc64 | powerpc64le | powerpcle \ | ||||
| 	| pyramid \ | ||||
| 	| riscv32 | riscv64 \ | ||||
| 	| rl78 | rx \ | ||||
| 	| score \ | ||||
| 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | ||||
| 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | ||||
| 	| sh64 | sh64le \ | ||||
| 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | ||||
| 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | ||||
| @@ -314,6 +313,7 @@ case $basic_machine in | ||||
| 	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ||||
| 	| ubicom32 \ | ||||
| 	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | ||||
| 	| visium \ | ||||
| 	| we32k \ | ||||
| 	| x86 | xc16x | xstormy16 | xtensa \ | ||||
| 	| z8k | z80) | ||||
| @@ -328,7 +328,10 @@ case $basic_machine in | ||||
| 	c6x) | ||||
| 		basic_machine=tic6x-unknown | ||||
| 		;; | ||||
| 	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) | ||||
| 	leon|leon[3-9]) | ||||
| 		basic_machine=sparc-$basic_machine | ||||
| 		;; | ||||
| 	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) | ||||
| 		basic_machine=$basic_machine-unknown | ||||
| 		os=-none | ||||
| 		;; | ||||
| @@ -370,26 +373,29 @@ case $basic_machine in | ||||
| 	| aarch64-* | aarch64_be-* \ | ||||
| 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | ||||
| 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | ||||
| 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | ||||
| 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | ||||
| 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \ | ||||
| 	| avr-* | avr32-* \ | ||||
| 	| ba-* \ | ||||
| 	| be32-* | be64-* \ | ||||
| 	| bfin-* | bs2000-* \ | ||||
| 	| c[123]* | c30-* | [cjt]90-* | c4x-* \ | ||||
| 	| clipper-* | craynv-* | cydra-* \ | ||||
| 	| c8051-* | clipper-* | craynv-* | cydra-* \ | ||||
| 	| d10v-* | d30v-* | dlx-* \ | ||||
| 	| elxsi-* \ | ||||
| 	| e2k-* | elxsi-* \ | ||||
| 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | ||||
| 	| h8300-* | h8500-* \ | ||||
| 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | ||||
| 	| hexagon-* \ | ||||
| 	| i*86-* | i860-* | i960-* | ia64-* \ | ||||
| 	| ip2k-* | iq2000-* \ | ||||
| 	| k1om-* \ | ||||
| 	| le32-* | le64-* \ | ||||
| 	| lm32-* \ | ||||
| 	| m32c-* | m32r-* | m32rle-* \ | ||||
| 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | ||||
| 	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | ||||
| 	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | ||||
| 	| microblaze-* | microblazeel-* \ | ||||
| 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | ||||
| 	| mips16-* \ | ||||
| 	| mips64-* | mips64el-* \ | ||||
| @@ -403,28 +409,33 @@ case $basic_machine in | ||||
| 	| mips64vr5900-* | mips64vr5900el-* \ | ||||
| 	| mipsisa32-* | mipsisa32el-* \ | ||||
| 	| mipsisa32r2-* | mipsisa32r2el-* \ | ||||
| 	| mipsisa32r6-* | mipsisa32r6el-* \ | ||||
| 	| mipsisa64-* | mipsisa64el-* \ | ||||
| 	| mipsisa64r2-* | mipsisa64r2el-* \ | ||||
| 	| mipsisa64r6-* | mipsisa64r6el-* \ | ||||
| 	| mipsisa64sb1-* | mipsisa64sb1el-* \ | ||||
| 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \ | ||||
| 	| mipsr5900-* | mipsr5900el-* \ | ||||
| 	| mipstx39-* | mipstx39el-* \ | ||||
| 	| mmix-* \ | ||||
| 	| mt-* \ | ||||
| 	| msp430-* \ | ||||
| 	| nds32-* | nds32le-* | nds32be-* \ | ||||
| 	| nios-* | nios2-* \ | ||||
| 	| nios-* | nios2-* | nios2eb-* | nios2el-* \ | ||||
| 	| none-* | np1-* | ns16k-* | ns32k-* \ | ||||
| 	| open8-* \ | ||||
| 	| or1k*-* \ | ||||
| 	| orion-* \ | ||||
| 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | ||||
| 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | ||||
| 	| pyramid-* \ | ||||
| 	| riscv32-* | riscv64-* \ | ||||
| 	| rl78-* | romp-* | rs6000-* | rx-* \ | ||||
| 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | ||||
| 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | ||||
| 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | ||||
| 	| sparclite-* \ | ||||
| 	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | ||||
| 	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | ||||
| 	| tahoe-* \ | ||||
| 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | ||||
| 	| tile*-* \ | ||||
| @@ -432,6 +443,7 @@ case $basic_machine in | ||||
| 	| ubicom32-* \ | ||||
| 	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | ||||
| 	| vax-* \ | ||||
| 	| visium-* \ | ||||
| 	| we32k-* \ | ||||
| 	| x86-* | x86_64-* | xc16x-* | xps100-* \ | ||||
| 	| xstormy16-* | xtensa*-* \ | ||||
| @@ -508,6 +520,9 @@ case $basic_machine in | ||||
| 		basic_machine=i386-pc | ||||
| 		os=-aros | ||||
| 		;; | ||||
| 	asmjs) | ||||
| 		basic_machine=asmjs-unknown | ||||
| 		;; | ||||
| 	aux) | ||||
| 		basic_machine=m68k-apple | ||||
| 		os=-aux | ||||
| @@ -769,6 +784,9 @@ case $basic_machine in | ||||
| 		basic_machine=m68k-isi | ||||
| 		os=-sysv | ||||
| 		;; | ||||
| 	leon-*|leon[3-9]-*) | ||||
| 		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` | ||||
| 		;; | ||||
| 	m68knommu) | ||||
| 		basic_machine=m68k-unknown | ||||
| 		os=-linux | ||||
| @@ -788,7 +806,7 @@ case $basic_machine in | ||||
| 		basic_machine=ns32k-utek | ||||
| 		os=-sysv | ||||
| 		;; | ||||
| 	microblaze) | ||||
| 	microblaze*) | ||||
| 		basic_machine=microblaze-xilinx | ||||
| 		;; | ||||
| 	mingw64) | ||||
| @@ -796,7 +814,7 @@ case $basic_machine in | ||||
| 		os=-mingw64 | ||||
| 		;; | ||||
| 	mingw32) | ||||
| 		basic_machine=i386-pc | ||||
| 		basic_machine=i686-pc | ||||
| 		os=-mingw32 | ||||
| 		;; | ||||
| 	mingw32ce) | ||||
| @@ -824,6 +842,10 @@ case $basic_machine in | ||||
| 		basic_machine=powerpc-unknown | ||||
| 		os=-morphos | ||||
| 		;; | ||||
| 	moxiebox) | ||||
| 		basic_machine=moxie-unknown | ||||
| 		os=-moxiebox | ||||
| 		;; | ||||
| 	msdos) | ||||
| 		basic_machine=i386-pc | ||||
| 		os=-msdos | ||||
| @@ -832,7 +854,7 @@ case $basic_machine in | ||||
| 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` | ||||
| 		;; | ||||
| 	msys) | ||||
| 		basic_machine=i386-pc | ||||
| 		basic_machine=i686-pc | ||||
| 		os=-msys | ||||
| 		;; | ||||
| 	mvs) | ||||
| @@ -1023,7 +1045,11 @@ case $basic_machine in | ||||
| 		basic_machine=i586-unknown | ||||
| 		os=-pw32 | ||||
| 		;; | ||||
| 	rdos) | ||||
| 	rdos | rdos64) | ||||
| 		basic_machine=x86_64-pc | ||||
| 		os=-rdos | ||||
| 		;; | ||||
| 	rdos32) | ||||
| 		basic_machine=i386-pc | ||||
| 		os=-rdos | ||||
| 		;; | ||||
| @@ -1350,13 +1376,13 @@ case $os in | ||||
| 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | ||||
| 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | ||||
| 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | ||||
| 	      | -sym* | -kopensolaris* \ | ||||
| 	      | -sym* | -kopensolaris* | -plan9* \ | ||||
| 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | ||||
| 	      | -aos* | -aros* \ | ||||
| 	      | -aos* | -aros* | -cloudabi* | -sortix* \ | ||||
| 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | ||||
| 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | ||||
| 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | ||||
| 	      | -bitrig* | -openbsd* | -solidbsd* \ | ||||
| 	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | ||||
| 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | ||||
| 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | ||||
| 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | ||||
| @@ -1365,14 +1391,15 @@ case $os in | ||||
| 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | ||||
| 	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | ||||
| 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | ||||
| 	      | -uxpv* | -beos* | -mpeix* | -udk* \ | ||||
| 	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | ||||
| 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | ||||
| 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | ||||
| 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | ||||
| 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | ||||
| 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | ||||
| 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | ||||
| 	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) | ||||
| 	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | ||||
| 	      | -onefs* | -tirtos*) | ||||
| 	# Remember, each alternative MUST END IN *, to match a version number. | ||||
| 		;; | ||||
| 	-qnx*) | ||||
| @@ -1496,9 +1523,6 @@ case $os in | ||||
| 	-aros*) | ||||
| 		os=-aros | ||||
| 		;; | ||||
| 	-kaos*) | ||||
| 		os=-kaos | ||||
| 		;; | ||||
| 	-zvmoe) | ||||
| 		os=-zvmoe | ||||
| 		;; | ||||
| @@ -1507,6 +1531,8 @@ case $os in | ||||
| 		;; | ||||
| 	-nacl*) | ||||
| 		;; | ||||
| 	-ios) | ||||
| 		;; | ||||
| 	-none) | ||||
| 		;; | ||||
| 	*) | ||||
| @@ -1547,6 +1573,9 @@ case $basic_machine in | ||||
| 	c4x-* | tic4x-*) | ||||
| 		os=-coff | ||||
| 		;; | ||||
| 	c8051-*) | ||||
| 		os=-elf | ||||
| 		;; | ||||
| 	hexagon-*) | ||||
| 		os=-elf | ||||
| 		;; | ||||
|   | ||||
							
								
								
									
										138
									
								
								configure.ng
									
									
									
									
									
								
							
							
						
						
									
										138
									
								
								configure.ng
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| # | ||||
| # ngIRCd -- The Next Generation IRC Daemon | ||||
| # Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors | ||||
| # Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| @@ -23,8 +23,7 @@ m4_ifdef([AM_SILENT_RULES], | ||||
| # -- Initialisation -- | ||||
|  | ||||
| AC_PREREQ([2.61]) | ||||
| AC_INIT([ngIRCd], VERSION_ID, | ||||
| 	[ngircd-ml@ngircd.barton.de], [ngircd], [http://ngircd.barton.de/]) | ||||
| AC_INIT([ngIRCd],[VERSION_ID],[ngircd-ml@ngircd.barton.de],[ngircd],[http://ngircd.barton.de/]) | ||||
|  | ||||
| AC_CONFIG_SRCDIR([src/ngircd/ngircd.c]) | ||||
| AC_CONFIG_HEADER([src/config.h]) | ||||
| @@ -67,6 +66,7 @@ AC_PROG_AWK | ||||
| AC_PROG_INSTALL | ||||
| AC_PROG_LN_S | ||||
| AC_PROG_MAKE_SET | ||||
| AC_PROG_MKDIR_P | ||||
| AC_PROG_RANLIB | ||||
|  | ||||
| # -- Compiler Features -- | ||||
| @@ -75,23 +75,57 @@ AC_C_CONST | ||||
| AC_C_INLINE | ||||
| __ng_PROTOTYPES__ | ||||
|  | ||||
| # -- Hard coded system and compiler dependencies/features/options ... -- | ||||
| # -- Function Definitions -- | ||||
|  | ||||
| AC_DEFUN([GCC_STACK_PROTECT_CC],[ | ||||
|   ssp_cc=yes | ||||
|   # we use -fstack-protector-all for the test to enfoce the use of the guard variable  | ||||
|   AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector]) | ||||
|   ssp_old_cflags="$CFLAGS" | ||||
|   CFLAGS="$CFLAGS -fstack-protector-all" | ||||
|   AC_TRY_LINK(,,, ssp_cc=no) | ||||
|   echo $ssp_cc | ||||
|   CFLAGS="$ssp_old_cflags" | ||||
|   if test "X$ssp_cc" = "Xyes"; then | ||||
|       CFLAGS="$CFLAGS -fstack-protector" | ||||
|       AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.]) | ||||
|   fi | ||||
| 	ssp_cc=yes | ||||
| 	# Use -fstack-protector-all for the test to enfoce the use of the | ||||
| 	# guard variable | ||||
| 	AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector]) | ||||
| 	ssp_old_cflags="$CFLAGS" | ||||
| 	CFLAGS="$CFLAGS -fstack-protector-all" | ||||
| 	AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],[],[ssp_cc=no]) | ||||
| 	echo $ssp_cc | ||||
| 	CFLAGS="$ssp_old_cflags" | ||||
| 	if test "X$ssp_cc" = "Xyes"; then | ||||
| 		CFLAGS="$CFLAGS -fstack-protector" | ||||
| 		AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.]) | ||||
| 	fi | ||||
| ]) | ||||
|  | ||||
| AC_DEFUN([WORKING_GETADDRINFO],[ | ||||
| 	AC_CHECK_FUNCS([getaddrinfo],[ | ||||
| 		AC_MSG_CHECKING([whether getaddrinfo() works]) | ||||
| 		AC_RUN_IFELSE([AC_LANG_SOURCE([[ | ||||
| #include <stdio.h> | ||||
| #include <sys/types.h> | ||||
| #include <sys/socket.h> | ||||
| #include <netdb.h> | ||||
| int | ||||
| main(int argc, char **argv) | ||||
| { | ||||
| 	struct addrinfo hints, *ai; | ||||
| 	memset(&hints, 0, sizeof(hints)); | ||||
| 	hints.ai_flags = AI_PASSIVE; | ||||
| 	hints.ai_socktype = SOCK_STREAM; | ||||
| 	hints.ai_family = PF_UNSPEC; | ||||
| 	if(getaddrinfo(NULL, "0", &hints, &ai) != 0) | ||||
| 		return 1; | ||||
| 	return 0; | ||||
| } | ||||
| 		]])],[ | ||||
| 		AC_DEFINE([HAVE_WORKING_GETADDRINFO], 1, [getaddrinfo(0)]) | ||||
| 		AC_MSG_RESULT(yes) | ||||
| 		],[ | ||||
| 		AC_MSG_RESULT(no) | ||||
| 		],[ | ||||
| 		AC_MSG_RESULT(no) | ||||
| 		]) | ||||
| 	]) | ||||
| ]) | ||||
|  | ||||
| # -- Hard coded system and compiler dependencies/features/options ... -- | ||||
|  | ||||
| if test "$GCC" = "yes"; then | ||||
| 	# We are using the GNU C compiler. Good! | ||||
| 	CFLAGS="$CFLAGS -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes" | ||||
| @@ -110,7 +144,7 @@ esac | ||||
| # Add additional CFLAGS, eventually specified on the command line: | ||||
| test -n "$CFLAGS_ADD" && CFLAGS="$CFLAGS $CFLAGS_ADD" | ||||
|  | ||||
| CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"'" | ||||
| CFLAGS="$CFLAGS -DSYSCONFDIR='\"\$(sysconfdir)\"' -DDOCDIR='\"\$(docdir)\"'" | ||||
|  | ||||
| # -- Headers -- | ||||
|  | ||||
| @@ -120,33 +154,32 @@ AC_HEADER_TIME | ||||
|  | ||||
| # Required header files | ||||
| AC_CHECK_HEADERS([ \ | ||||
| 	fcntl.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h string.h \ | ||||
| 	strings.h sys/socket.h sys/time.h unistd.h \ | ||||
| 	fcntl.h netdb.h netinet/in.h stdlib.h string.h \ | ||||
| 	strings.h sys/socket.h sys/time.h sys/types.h unistd.h \ | ||||
| 	],,AC_MSG_ERROR([required C header missing!])) | ||||
|  | ||||
| # Optional header files | ||||
| AC_CHECK_HEADERS_ONCE([ \ | ||||
| 	arpa/inet.h inttypes.h malloc.h netinet/ip.h stdbool.h stddef.h \ | ||||
| 	stdint.h varargs.h \ | ||||
| 	arpa/inet.h inttypes.h malloc.h netinet/in_systm.h netinet/ip.h \ | ||||
| 	stdbool.h stddef.h stdint.h varargs.h \ | ||||
| 	]) | ||||
|  | ||||
| # -- Datatypes -- | ||||
|  | ||||
| AC_MSG_CHECKING(whether socklen_t exists) | ||||
| AC_TRY_COMPILE([ | ||||
| AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||||
| #include <sys/types.h> | ||||
| #include <sys/socket.h> | ||||
| 	],[ | ||||
| 	]],[[ | ||||
| 	socklen_t a, b; | ||||
| 	a = 2; b = 4; a += b; | ||||
| 	],[ | ||||
| 	]])],[ | ||||
| 	AC_DEFINE(HAVE_socklen_t) AC_MSG_RESULT(yes) | ||||
| 	],[ | ||||
| 	AC_MSG_RESULT(no) | ||||
| ]) | ||||
|  | ||||
| AC_TYPE_PID_T | ||||
| AC_TYPE_SIGNAL | ||||
| AC_TYPE_SIZE_T | ||||
| AC_TYPE_SSIZE_T | ||||
| AC_TYPE_UID_T | ||||
| @@ -186,9 +219,12 @@ AC_CHECK_FUNCS([ \ | ||||
| 	AC_MSG_ERROR([required function missing!])) | ||||
|  | ||||
| # Optional functions | ||||
| AC_CHECK_FUNCS_ONCE([ \ | ||||
| 	gai_strerror getaddrinfo getnameinfo inet_aton sigaction sigprocmask \ | ||||
| 	snprintf vsnprintf strdup strlcpy strlcat strtok_r waitpid]) | ||||
| AC_CHECK_FUNCS_ONCE([ | ||||
| 	arc4random arc4random_stir gai_strerror getnameinfo inet_aton \ | ||||
| 	setgroups sigaction sigprocmask snprintf strdup strlcat strlcpy \ | ||||
| 	strndup strtok_r unsetenv vsnprintf waitpid]) | ||||
|  | ||||
| WORKING_GETADDRINFO | ||||
|  | ||||
| # -- Configuration options -- | ||||
|  | ||||
| @@ -382,8 +418,8 @@ AC_ARG_WITH(openssl, | ||||
| 				LDFLAGS="-L$withval/lib $LDFLAGS" | ||||
| 			fi | ||||
| 			AC_CHECK_LIB(crypto, BIO_s_mem) | ||||
| 			AC_CHECK_LIB(ssl, SSL_library_init) | ||||
| 			AC_CHECK_FUNCS(SSL_library_init, x_ssl_openssl=yes, | ||||
| 			AC_CHECK_LIB(ssl, SSL_new) | ||||
| 			AC_CHECK_FUNCS(SSL_new, x_ssl_openssl=yes, | ||||
| 				AC_MSG_ERROR([Can't enable openssl]) | ||||
| 			) | ||||
| 		fi | ||||
| @@ -431,14 +467,18 @@ AC_ARG_WITH(tcp-wrappers, | ||||
| 				LDFLAGS="-L$withval/lib $LDFLAGS" | ||||
| 			fi | ||||
| 			AC_MSG_CHECKING(for hosts_access) | ||||
| 			saved_LIBS="$LIBS" | ||||
| 			LIBS="-lwrap $LIBS" | ||||
| 			AC_TRY_LINK([ | ||||
| 			LIBS_END="-lwrap $LIBS_END" | ||||
| 			AC_LINK_IFELSE([AC_LANG_PROGRAM([[ | ||||
| #include <sys/types.h> | ||||
| #include <sys/socket.h> | ||||
| #include <tcpd.h> | ||||
| int allow_severity = 0; | ||||
| int deny_severity = 0; | ||||
| 				],[ | ||||
| 				]],[[ | ||||
| 				tcpd_warn("link test"); | ||||
| 				],[ | ||||
| 				]])],[ | ||||
| 				AC_MSG_RESULT(yes) | ||||
| 				AC_DEFINE(TCPWRAP, 1) | ||||
| 				x_tcpwrap_on=yes | ||||
| @@ -446,6 +486,7 @@ int deny_severity = 0; | ||||
| 				AC_MSG_RESULT(no) | ||||
| 				AC_MSG_ERROR([Can't enable TCP wrappers!]) | ||||
| 			]) | ||||
| 			LIBS="$saved_LIBS" | ||||
| 		fi | ||||
| 	] | ||||
| ) | ||||
| @@ -518,7 +559,8 @@ if test "$x_ircplus_on" = "yes"; then | ||||
| 	# CHARCONV is the only function depending on it. | ||||
| 	x_iconv_on=no | ||||
| 	AC_ARG_WITH(iconv, | ||||
| 		[  --with-iconv            enable character conversation using libiconv], | ||||
| 		AS_HELP_STRING([--with-iconv], | ||||
| 			       [enable character conversion using libiconv]), | ||||
| 		[ if test "$withval" != "no"; then | ||||
| 			if test "$withval" != "yes"; then | ||||
| 				CFLAGS="-I$withval/include $CFLAGS" | ||||
| @@ -526,11 +568,15 @@ if test "$x_ircplus_on" = "yes"; then | ||||
| 				LDFLAGS="-L$withval/lib $LDFLAGS" | ||||
| 			fi | ||||
| 			AC_CHECK_LIB(iconv, iconv_open) | ||||
| 			AC_CHECK_FUNCS(iconv_open, x_iconv_on=yes, | ||||
| 			AC_CHECK_FUNCS(iconv_open, x_iconv_on=yes) | ||||
| 			if test "$x_iconv_on" != "yes"; then | ||||
| 				AC_CHECK_LIB(iconv, libiconv_open) | ||||
| 				AC_CHECK_FUNCS(libiconv_open, x_iconv_on=yes) | ||||
| 			fi | ||||
| 			if test "$x_iconv_on" != "yes"; then | ||||
| 				AC_MSG_ERROR([Can't enable libiconv support!]) | ||||
| 			) | ||||
| 		  fi | ||||
| 		] | ||||
| 			fi | ||||
| 		fi ] | ||||
| 	) | ||||
| 	if test "$x_iconv_on" = "yes"; then | ||||
| 		AC_DEFINE(ICONV, 1) | ||||
| @@ -596,9 +642,12 @@ AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu" ) | ||||
| AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor" ) | ||||
| AC_DEFINE_UNQUOTED(HOST_OS, "$host_os" ) | ||||
|  | ||||
| # Add additional CFLAGS, eventually specified on the command line, but after | ||||
| # running this configure script. Useful for "-Werror" for example. | ||||
| # Add additional CFLAGS, LDFLAGS and LIBS which were specified on the command | ||||
| # line or by some tests from above, but after running this script. Useful for | ||||
| # adding "-Werror", for example: | ||||
| test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END" | ||||
| test -n "$LDFLAGS_END" && LDFLAGS="$LDFLAGS $LDFLAGS_END" | ||||
| test -n "$LIBS_END" && LIBS="$LIBS $LIBS_END" | ||||
|  | ||||
| # -- Generate files -- | ||||
|  | ||||
| @@ -627,7 +676,9 @@ if test $? -eq 0; then | ||||
| 	# Generate debian/ link if the dpkg command exists | ||||
| 	# (read: if we are running on a debian compatible system) | ||||
| 	echo "creating Debian-specific links ..." | ||||
| 	test -f debian/rules || ln -s contrib/Debian debian | ||||
| 	if test ! -f debian/rules -a -f contrib/Debian/rules; then | ||||
| 		ln -s contrib/Debian debian | ||||
| 	fi | ||||
| fi | ||||
|  | ||||
| # -- Result -- | ||||
| @@ -697,7 +748,7 @@ test "$x_ipv6_on" = "yes" \ | ||||
| 	&& echo $ECHO_N "yes   $ECHO_C" \ | ||||
| 	|| echo $ECHO_N "no    $ECHO_C" | ||||
| echo $ECHO_N "        I/O backend: $ECHO_C" | ||||
| 	echo "\"$x_io_backend\"" | ||||
| 	echo "$x_io_backend" | ||||
|  | ||||
| echo $ECHO_N "        PAM support: $ECHO_C" | ||||
| test "$x_pam_on" = "yes" \ | ||||
| @@ -711,7 +762,8 @@ echo $ECHO_N "   libiconv support: $ECHO_C" | ||||
|  | ||||
| echo | ||||
|  | ||||
| if ! grep "^AUTOMAKE_OPTIONS = ../portab/ansi2knr" src/ngircd/Makefile.am >/dev/null 2>&1; then | ||||
| define(_automake_regex_,[[^AUTOMAKE_OPTIONS = [a-z .\-]*/portab/ansi2knr]]) | ||||
| if ! grep "_automake_regex_" src/ngircd/Makefile.am >/dev/null 2>&1; then | ||||
| 	echo "WARNING:" | ||||
| 	echo "This GNU automake generated build system does not support \"de-ANSI-fication\"," | ||||
| 	echo "therefore don't use it to generate \"official\" distribution archives!" | ||||
|   | ||||
							
								
								
									
										3
									
								
								contrib/Debian/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								contrib/Debian/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -4,10 +4,13 @@ | ||||
| files | ||||
| ngircd/ | ||||
| ngircd-full/ | ||||
| ngircd.service | ||||
| ngircd-full.default | ||||
| ngircd-full.init | ||||
| ngircd-full.postinst | ||||
| ngircd-full.service | ||||
| ngircd-full-dbg/ | ||||
| ngircd-full-dbg.default | ||||
| ngircd-full-dbg.init | ||||
| ngircd-full-dbg.postinst | ||||
| ngircd-full-dbg.service | ||||
|   | ||||
| @@ -1,3 +1,102 @@ | ||||
| ngircd (24~rc1-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release candidate 1 for ngIRCd Release 24. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Sat, 07 Jan 2017 18:58:02 +0100 | ||||
|  | ||||
| ngircd (23-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release: ngIRCd 23. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Mon, 16 Nov 2015 21:27:03 +0100 | ||||
|  | ||||
| ngircd (23~rc1-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release candidate 1 for ngIRCd Release 23. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Sun, 06 Sep 2015 16:55:23 +0200 | ||||
|  | ||||
| ngircd (22.1-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release: ngIRCd 22.1. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Mon, 06 Apr 2015 14:34:50 +0200 | ||||
|  | ||||
| ngircd (22-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release: ngIRCd 22. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Sat, 11 Oct 2014 20:29:03 +0200 | ||||
|  | ||||
| ngircd (22~rc1-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release candidate 1 for ngIRCd Release 22. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Mon, 29 Sep 2014 17:07:55 +0200 | ||||
|  | ||||
| ngircd (21.1-0ab2) unstable; urgency=low | ||||
|  | ||||
|   * Use correct package name in pathname to "HelpFile" (Command.txt) | ||||
|     in "ngircd-full" and "ngircd-full-dbg" packages. | ||||
|   * Don't adjust path names that are correct by default. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Mon, 14 Jul 2014 11:20:17 +0200 | ||||
|  | ||||
| ngircd (21.1-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release: ngIRCd 21.1. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Tue, 25 Mar 2014 14:44:59 +0100 | ||||
|  | ||||
| ngircd (21-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release: ngIRCd 21. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Wed, 30 Oct 2013 22:13:55 +0100 | ||||
|  | ||||
| ngircd (21~rc2-0ab3) unstable; urgency=low | ||||
|  | ||||
|   * Fix sed(1) rules adjusting "ngircd-full" package, error introduced | ||||
|     by last commit :-/ | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Sun, 20 Oct 2013 18:31:16 +0200 | ||||
|  | ||||
| ngircd (21~rc2-0ab2) unstable; urgency=low | ||||
|  | ||||
|   * Fix default "HelpFile" file name in ngircd.conf for "full" packages. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Sun, 20 Oct 2013 17:18:28 +0200 | ||||
|  | ||||
| ngircd (21~rc2-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release candidate 2 for ngIRCd Release 21. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Sun, 20 Oct 2013 15:50:03 +0200 | ||||
|  | ||||
| ngircd (21~rc1-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release candidate 1 for ngIRCd Release 21. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Sat, 05 Oct 2013 23:24:09 +0200 | ||||
|  | ||||
| ngircd (20.3-0ab1) unstable; urgency=high | ||||
|  | ||||
|   * New "upstream" release, fixing a security related bug: ngIRCd 20.3. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Fri, 23 Aug 2013 21:53:21 +0200 | ||||
|  | ||||
| ngircd (20.2-0ab1) unstable; urgency=high | ||||
|  | ||||
|   * New "upstream" release, fixing a security related bug: ngIRCd 20.2. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Fri, 15 Feb 2013 12:17:00 +0100 | ||||
|  | ||||
| ngircd (20.1-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release: ngIRCd 20.1. | ||||
|  | ||||
|  -- Alexander Barton <alex@barton.de>  Wed, 02 Jan 2013 22:37:26 +0100 | ||||
|  | ||||
| ngircd (20-0ab1) unstable; urgency=low | ||||
|  | ||||
|   * New "upstream" release: ngIRCd 20. | ||||
|   | ||||
| @@ -1 +1 @@ | ||||
| 4 | ||||
| 9 | ||||
|   | ||||
| @@ -2,13 +2,14 @@ Source: ngircd | ||||
| Section: net | ||||
| Priority: optional | ||||
| Maintainer: Alexander Barton <alex@barton.de> | ||||
| Build-Depends: debhelper (>> 4.0.0), | ||||
| Build-Depends: debhelper (>> 9.0.0), | ||||
|     autotools-dev, | ||||
|     dh-systemd (>= 1.5), | ||||
|     expect, | ||||
|     libz-dev, | ||||
|     libwrap0-dev, | ||||
|     libident-dev, | ||||
|     libgnutls-dev, | ||||
|     libgnutls28-dev, | ||||
|     libpam0g-dev, | ||||
|     telnet | telnet-ssl, | ||||
| Standards-Version: 3.9.1 | ||||
|   | ||||
| @@ -1,8 +1,6 @@ | ||||
| # | ||||
| # Defaults for ngIRCd start and stop script | ||||
| # | ||||
| # $Id: ngircd.default,v 1.1 2003/12/31 17:20:11 alex Exp $ | ||||
| # | ||||
|  | ||||
| # Parameters to pass to the ngircd daemon on startup, see ngircd(8) for | ||||
| # possible options (default: empty). | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| #!/bin/sh | ||||
| # | ||||
| # ngIRCd start and stop script for Debian-based systems | ||||
| # Copyright 2008-2010 Alexander Barton <alex@barton.de> | ||||
| # Copyright 2008-2015 Alexander Barton <alex@barton.de> | ||||
| # | ||||
|  | ||||
| ### BEGIN INIT INFO | ||||
| @@ -24,20 +24,20 @@ PARAMS="" | ||||
| STARTTIME=1 | ||||
| DIETIME=10 | ||||
|  | ||||
| test -x $DAEMON || exit 5 | ||||
|  | ||||
| test -h "$0" && me=`readlink $0` || me="$0" | ||||
| BASENAME=`basename $me` | ||||
|  | ||||
| test -r /etc/default/$BASENAME && . /etc/default/$BASENAME | ||||
|  | ||||
| test -x $DAEMON || exit 5 | ||||
|  | ||||
| # LSB compatibility functions that become used if there is no local | ||||
| # include file available. | ||||
| log_daemon_msg() { | ||||
| 	echo -n "$*" | ||||
| } | ||||
| log_end_msg() { | ||||
| 	[ "$1" == "0" ] && echo "." || echo " failed!" | ||||
| 	[ "$1" = "0" ] && echo "." || echo " failed!" | ||||
| } | ||||
| log_failure_msg() { | ||||
| 	echo "$*" | ||||
| @@ -84,6 +84,7 @@ Do_Start() { | ||||
| 		log_warning_msg "$NAME seems to be already running, nothing to do." | ||||
| 		exit 0 | ||||
| 	fi | ||||
| 	rm -f "$PIDFILE" | ||||
| 	start-stop-daemon --start \ | ||||
| 		--quiet --exec $DAEMON -- $PARAMS | ||||
| 	sleep $STARTTIME | ||||
|   | ||||
| @@ -1,7 +1,6 @@ | ||||
| #!/bin/sh | ||||
| # | ||||
| # Debian post-installation script | ||||
| # $Id: ngircd.postinst,v 1.2 2006/12/26 14:44:40 alex Exp $ | ||||
| # | ||||
|  | ||||
| set -e | ||||
| @@ -12,6 +11,7 @@ case "$1" in | ||||
| 			# make sure that the configuration file is not | ||||
| 			# world-readable, it contains passwords! | ||||
| 			chmod o= /etc/ngircd/ngircd.conf | ||||
| 			chgrp irc /etc/ngircd/ngircd.conf | ||||
| 		fi | ||||
| 		;; | ||||
| esac | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| #!/usr/bin/make -f | ||||
| # | ||||
| # ngIRCd -- The Next Generation IRC Daemon | ||||
| # Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors | ||||
| # Copyright (c)2001-2016 Alexander Barton (alex@barton.de) and Contributors | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| @@ -42,6 +42,7 @@ configure-ngircd: configure | ||||
| 	  --prefix=/usr \ | ||||
| 	  --sysconfdir=/etc/ngircd \ | ||||
| 	  --mandir=\$${prefix}/share/man \ | ||||
| 	  --docdir=\$${prefix}/share/doc/ngircd \ | ||||
| 	  --with-syslog --with-zlib | ||||
|  | ||||
| configure-ngircd-full: configure | ||||
| @@ -52,6 +53,7 @@ configure-ngircd-full: configure | ||||
| 	  --prefix=/usr \ | ||||
| 	  --sysconfdir=/etc/ngircd \ | ||||
| 	  --mandir=\$${prefix}/share/man \ | ||||
| 	  --docdir=\$${prefix}/share/doc/ngircd-full \ | ||||
| 	  --with-syslog --with-zlib \ | ||||
| 	  --with-gnutls --with-iconv --with-ident --with-tcp-wrappers \ | ||||
| 	  --with-pam \ | ||||
| @@ -65,6 +67,7 @@ configure-ngircd-full-dbg: configure | ||||
| 	  --prefix=/usr \ | ||||
| 	  --sysconfdir=/etc/ngircd \ | ||||
| 	  --mandir=\$${prefix}/share/man \ | ||||
| 	  --docdir=\$${prefix}/share/doc/ngircd-full-dbg \ | ||||
| 	  --enable-debug --enable-sniffer \ | ||||
| 	  --with-syslog --with-zlib \ | ||||
| 	  --with-gnutls --with-iconv --with-ident --with-tcp-wrappers \ | ||||
| @@ -72,7 +75,7 @@ configure-ngircd-full-dbg: configure | ||||
| 	  --enable-ipv6 | ||||
|  | ||||
| build: | ||||
| 	dh_clean -k | ||||
| 	dh_prep | ||||
|  | ||||
| build-ngircd: build-stamp-ngircd | ||||
| build-stamp-ngircd: configure-ngircd | ||||
| @@ -108,12 +111,15 @@ clean: | ||||
| 	dh_testdir | ||||
| 	dh_testroot | ||||
| 	rm -f build-stamp* | ||||
| 	rm -f $(CURDIR)/debian/ngircd.service | ||||
| 	rm -f $(CURDIR)/debian/ngircd-full.default | ||||
| 	rm -f $(CURDIR)/debian/ngircd-full.init | ||||
| 	rm -f $(CURDIR)/debian/ngircd-full.postinst | ||||
| 	rm -f $(CURDIR)/debian/ngircd-full.service | ||||
| 	rm -f $(CURDIR)/debian/ngircd-full-dbg.default | ||||
| 	rm -f $(CURDIR)/debian/ngircd-full-dbg.postinst | ||||
| 	rm -f $(CURDIR)/debian/ngircd-full-dbg.init | ||||
| 	rm -f $(CURDIR)/debian/ngircd-full-dbg.service | ||||
|  | ||||
| 	# Add here commands to clean up after the build process: | ||||
| 	[ ! -f Makefile ] || $(MAKE) distclean | ||||
| @@ -137,12 +143,10 @@ install-ngircd: build-ngircd | ||||
| 	$(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd | ||||
| 	rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/INSTALL* | ||||
| 	rm $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/COPYING* | ||||
| 	mkdir -p $(CURDIR)/debian/ngircd/var/run/ircd | ||||
| 	cat $(CURDIR)/debian/ngircd/usr/share/doc/ngircd/sample-ngircd.conf | \ | ||||
| 	 sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \ | ||||
| 	 sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \ | ||||
| 	 sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \ | ||||
| 	 sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \ | ||||
| 	 sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \ | ||||
| 	 sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \ | ||||
| 	 sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \ | ||||
| 	 >$(CURDIR)/debian/ngircd/etc/ngircd/ngircd.conf | ||||
| 	touch $(CURDIR)/debian/ngircd/etc/ngircd/ngircd.motd | ||||
|  | ||||
| @@ -153,16 +157,12 @@ install-ngircd-full: build-ngircd-full | ||||
|  | ||||
| 	# Add here commands to install the "full" package into debian/ngircd-full: | ||||
| 	$(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full | ||||
| 	rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/INSTALL* | ||||
| 	rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd/COPYING* | ||||
| 	mv $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd \ | ||||
| 	 $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full | ||||
| 	mkdir -p $(CURDIR)/debian/ngircd-full/var/run/ircd | ||||
| 	rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/INSTALL* | ||||
| 	rm $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/COPYING* | ||||
| 	cat $(CURDIR)/debian/ngircd-full/usr/share/doc/ngircd-full/sample-ngircd.conf | \ | ||||
| 	 sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \ | ||||
| 	 sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \ | ||||
| 	 sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \ | ||||
| 	 sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \ | ||||
| 	 sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \ | ||||
| 	 sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \ | ||||
| 	 sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \ | ||||
| 	 >$(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.conf | ||||
| 	touch $(CURDIR)/debian/ngircd-full/etc/ngircd/ngircd.motd | ||||
| 	mkdir -p $(CURDIR)/debian/ngircd-full/etc/pam.d | ||||
| @@ -175,16 +175,12 @@ install-ngircd-full-dbg: build-ngircd-full-dbg | ||||
|  | ||||
| 	# Add here commands to install the "full" package into debian/ngircd-full: | ||||
| 	$(MAKE) install DESTDIR=$(CURDIR)/debian/ngircd-full-dbg | ||||
| 	rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/INSTALL* | ||||
| 	rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd/COPYING* | ||||
| 	mv $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd \ | ||||
| 	 $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg | ||||
| 	mkdir -p $(CURDIR)/debian/ngircd-full-dbg/var/run/ircd | ||||
| 	rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/INSTALL* | ||||
| 	rm $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/COPYING* | ||||
| 	cat $(CURDIR)/debian/ngircd-full-dbg/usr/share/doc/ngircd-full-dbg/sample-ngircd.conf | \ | ||||
| 	 sed -e "s/;ServerUID = 65534/ServerUID = irc/g" | \ | ||||
| 	 sed -e "s/;ServerGID = 65534/ServerGID = irc/g" | \ | ||||
| 	 sed -e "s/;MotdFile = \/usr\/local\/etc\/ngircd.motd/MotdFile = \/etc\/ngircd\/ngircd.motd/g" | \ | ||||
| 	 sed -e "s/;PidFile = \/var\/run\/ngircd\/ngircd.pid/PidFile = \/var\/run\/ircd\/ngircd.pid/g" \ | ||||
| 	 sed -e "s|;ServerUID = 65534|ServerUID = irc|g" | \ | ||||
| 	 sed -e "s|;ServerGID = 65534|ServerGID = irc|g" | \ | ||||
| 	 sed -e "s|;PidFile = /var/run/ngircd/ngircd.pid|PidFile = /var/run/ircd/ngircd.pid|g" \ | ||||
| 	 >$(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.conf | ||||
| 	touch $(CURDIR)/debian/ngircd-full-dbg/etc/ngircd/ngircd.motd | ||||
| 	mkdir -p $(CURDIR)/debian/ngircd-full-dbg/etc/pam.d | ||||
| @@ -196,12 +192,18 @@ binary-indep: | ||||
|  | ||||
| # Build architecture-dependent files here. | ||||
| binary-arch: build install | ||||
| 	ln -s $(CURDIR)/contrib/ngircd.service \ | ||||
| 	 $(CURDIR)/debian/ngircd.service | ||||
|  | ||||
| 	ln -s $(CURDIR)/debian/ngircd.default \ | ||||
| 	 $(CURDIR)/debian/ngircd-full.default | ||||
| 	ln -s $(CURDIR)/debian/ngircd.init \ | ||||
| 	 $(CURDIR)/debian/ngircd-full.init | ||||
| 	ln -s $(CURDIR)/debian/ngircd.postinst \ | ||||
| 	 $(CURDIR)/debian/ngircd-full.postinst | ||||
| 	cp $(CURDIR)/contrib/ngircd.service \ | ||||
| 	 $(CURDIR)/debian/ngircd-full.service | ||||
| 	echo "Alias=ngircd.service" >>$(CURDIR)/debian/ngircd-full.service | ||||
|  | ||||
| 	ln -s $(CURDIR)/debian/ngircd.default \ | ||||
| 	 $(CURDIR)/debian/ngircd-full-dbg.default | ||||
| @@ -209,14 +211,19 @@ binary-arch: build install | ||||
| 	 $(CURDIR)/debian/ngircd-full-dbg.init | ||||
| 	ln -s $(CURDIR)/debian/ngircd.postinst \ | ||||
| 	 $(CURDIR)/debian/ngircd-full-dbg.postinst | ||||
| 	cp $(CURDIR)/contrib/ngircd.service \ | ||||
| 	 $(CURDIR)/debian/ngircd-full-dbg.service | ||||
| 	echo "Alias=ngircd.service" >>$(CURDIR)/debian/ngircd-full-dbg.service | ||||
|  | ||||
| 	dh_testdir | ||||
| 	dh_testroot | ||||
| 	dh_installchangelogs -a -A ChangeLog | ||||
| 	dh_installdocs -a | ||||
| 	dh_systemd_enable -a | ||||
| 	dh_installinit -a | ||||
| 	dh_systemd_start -a | ||||
| 	dh_strip -a --no-package=ngircd-full-dbg | ||||
| 	dh_compress -a | ||||
| 	dh_compress -a -XCommands.txt | ||||
| 	dh_fixperms -a | ||||
| 	dh_installdeb -a | ||||
| 	dh_shlibdeps -a | ||||
| @@ -226,6 +233,6 @@ binary-arch: build install | ||||
|  | ||||
| binary: binary-indep binary-arch | ||||
|  | ||||
| .PHONY: build clean binary-indep binary-arch binary install  | ||||
| .PHONY: build clean binary-indep binary-arch binary install | ||||
|  | ||||
| # -eof- | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -12,17 +12,22 @@ | ||||
|  */ | ||||
|  | ||||
| #define PACKAGE_NAME "ngIRCd" | ||||
| #define PACKAGE "ngircd" | ||||
| # define PACKAGE "ngircd" | ||||
| #ifndef VERSION | ||||
| #define VERSION "??("__DATE__")" | ||||
| # define VERSION "??("__DATE__")" | ||||
| #endif | ||||
| #define SYSCONFDIR "/etc/ngircd" | ||||
|  | ||||
| #ifndef TARGET_VENDOR | ||||
| #define TARGET_VENDOR "apple" | ||||
| #define TARGET_OS "darwin" | ||||
| #ifndef HOST_VENDOR | ||||
| # define HOST_VENDOR "apple" | ||||
| # define HOST_OS "darwin" | ||||
| # ifdef __x86_64 | ||||
| #  define HOST_CPU "x86_64" | ||||
| # endif | ||||
| #endif | ||||
|  | ||||
| #define SYSCONFDIR "/etc/ngircd" | ||||
| #define DOCDIR "/usr/share/doc/ngircd" | ||||
|  | ||||
| /* -- Build options -- */ | ||||
|  | ||||
| /* Define if debug-mode should be enabled */ | ||||
| @@ -100,6 +105,8 @@ | ||||
| #define HAVE_INET_ATON 1 | ||||
| /* Define to 1 if you have the `getaddrinfo' function. */ | ||||
| #define HAVE_GETADDRINFO 1 | ||||
| /* getaddrinfo(0) */ | ||||
| #define HAVE_WORKING_GETADDRINFO 1 | ||||
| /* Define to 1 if you have the `getnameinfo' function. */ | ||||
| #define HAVE_GETNAMEINFO 1 | ||||
| /* Define to 1 if you have the `sigaction' function. */ | ||||
|   | ||||
| @@ -1 +1 @@ | ||||
| <pkg-contents spec="1.12"><f n="ngircd.dest" o="root" g="admin" p="16877" pt="/Users/alex/Develop/ngircd/alex.git/ngircd.dest" m="false" t="file"><f n="opt" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="16877"><f n="etc" o="root" g="admin" p="16877"><f n="ngircd.motd" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="sbin" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="33261"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="share" o="root" g="admin" p="16877"><f n="doc" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="16877"><f n="AUTHORS" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Bopm.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="ChangeLog" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="COPYING" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="FAQ.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="GIT.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="HowToRelease.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="INSTALL" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="NEWS" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="PAM.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Platforms.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Protocol.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-AUX.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-BeOS.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-Interix.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="RFC.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="sample-ngircd.conf" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Services.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="SSL.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="man" o="root" g="admin" p="16877"><f n="man5" o="root" g="admin" p="16877"><f n="ngircd.conf.5" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="man8" o="root" g="admin" p="16877"><f n="ngircd.8" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f></pkg-contents> | ||||
| <pkg-contents spec="1.12"><f n="ngircd.dest" o="root" g="admin" p="16877" pt="../../ngircd.dest" m="false" t="file"><f n="opt" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="16877"><f n="etc" o="root" g="admin" p="16877"><f n="ngircd.motd" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="sbin" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="33261"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="share" o="root" g="admin" p="16877"><f n="doc" o="root" g="admin" p="16877"><f n="ngircd" o="root" g="admin" p="16877"><f n="AUTHORS" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Bopm.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="ChangeLog" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="COPYING" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="FAQ.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="GIT.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="HowToRelease.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="INSTALL" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="NEWS" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="PAM.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Platforms.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Protocol.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-AUX.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-BeOS.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="README-Interix.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="RFC.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="sample-ngircd.conf" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="Services.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><f n="SSL.txt" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="man" o="root" g="admin" p="16877"><f n="man5" o="root" g="admin" p="16877"><f n="ngircd.conf.5" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><f n="man8" o="root" g="admin" p="16877"><f n="ngircd.8" o="root" g="admin" p="33188"><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f><mod>group</mod><mod>owner</mod></f></pkg-contents> | ||||
| @@ -1 +1 @@ | ||||
| <pkgref spec="1.12" uuid="46208410-4A1B-48C6-97BD-DE284F13F864"><config><identifier>de.barton.ngircd.daemon.pkg</identifier><version>17.1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom>/Users/alex/Develop/ngircd/alex.git/ngircd.dest</installFrom><installTo mod="true">/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>extraFiles</mod><mod>installTo</mod><mod>installTo.isAbsoluteType</mod><mod>scripts.preinstall.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>installTo.path</mod><mod>scripts.preupgrade.path</mod><mod>requireAuthorization</mod></config><contents><file-list>02ngircd-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents><extra-files/></pkgref> | ||||
| <pkgref spec="1.12" uuid="46208410-4A1B-48C6-97BD-DE284F13F864"><config><identifier>de.barton.ngircd.daemon.pkg</identifier><version>17.1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom>../../ngircd.dest</installFrom><installTo mod="true">/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>extraFiles</mod><mod>installTo</mod><mod>installTo.isAbsoluteType</mod><mod>scripts.preinstall.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>installTo.path</mod><mod>scripts.preupgrade.path</mod><mod>requireAuthorization</mod></config><contents><file-list>02ngircd-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents><extra-files/></pkgref> | ||||
| @@ -1,11 +1,11 @@ | ||||
| <pkmkdoc spec="1.12"><properties><title>ngIRCd</title><build>/Users/alex/Desktop/ngIRCd.mpkg</build><organization>de.barton.ngircd</organization><userSees ui="both"/><min-target os="2"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>ngIRCd – next generation Internet Relay Chat (IRC) server | ||||
|   daemon</description><contents><choice title="ngIRCd daemon" id="choicengircd" tooltip="ngIRCd daemon, documentation and manual pages" description="Binaries, documentation and manual pages of the ngIRCd, the next generation IRC (Internet Relay Chat) daemon. This package will be installed into /opt/ngircd." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="de.barton.ngircd.daemon.pkg"/></choice><choice title="Start and stop script" id="choicelaunchscript" tooltip="LaunchDaemon start and stop script" description="Installs the ngIRCd start and stop script for the "launch daemon". If this is an update/upgrade, and ngIRCd is already running, it will be automatically restarted." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="de.barton.ngircd.launchscript.pkg"/></choice></contents><resources bg-scale="none" bg-align="bottomleft"><locale lang="en"><resource type="background">/Users/alex/Develop/ngircd/alex.git/contrib/ngIRCd-Logo.gif</resource><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 | ||||
| <pkmkdoc spec="1.12"><properties><title>ngIRCd</title><build>../../ngIRCd.mpkg</build><organization>de.barton.ngircd</organization><userSees ui="both"/><min-target os="2"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>ngIRCd – next generation Internet Relay Chat (IRC) server | ||||
|   daemon</description><contents><choice title="ngIRCd daemon" id="choicengircd" tooltip="ngIRCd daemon, documentation and manual pages" description="Binaries, documentation and manual pages of the ngIRCd, the next generation IRC (Internet Relay Chat) daemon. This package will be installed into /opt/ngircd." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="de.barton.ngircd.daemon.pkg"/></choice><choice title="Start and stop script" id="choicelaunchscript" tooltip="LaunchDaemon start and stop script" description="Installs the ngIRCd start and stop script for the "launch daemon". If this is an update/upgrade, and ngIRCd is already running, it will be automatically restarted." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="de.barton.ngircd.launchscript.pkg"/></choice></contents><resources bg-scale="none" bg-align="bottomleft"><locale lang="en"><resource type="background">../ngIRCd-Logo.gif</resource><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 | ||||
| {\fonttbl\f0\fswiss\fcharset0 Helvetica;} | ||||
| {\colortbl;\red255\green255\blue255;} | ||||
| \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\qc\pardirnatural | ||||
|  | ||||
| \f0\i\fs24 \cf0 ngIRCd -- The Next Generation IRC Daemon\ | ||||
| Copyright (c)2001-2011 Alexander Barton and Contributors.\ | ||||
| Copyright (c)2001-2014 Alexander Barton and Contributors.\ | ||||
| \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural | ||||
|  | ||||
| \i0 \cf0 \ | ||||
|   | ||||
| @@ -64,12 +64,27 @@ | ||||
| /* End PBXCopyFilesBuildPhase section */ | ||||
|  | ||||
| /* Begin PBXFileReference section */ | ||||
| 		FA1A6BBC0D6857BB00AA8F71 /* misc-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "misc-test.e"; sourceTree = "<group>"; }; | ||||
| 		FA18A63E16CEDDCE00132F66 /* configure.ng */ = {isa = PBXFileReference; lastKnownFileType = text; name = configure.ng; path = ../../configure.ng; sourceTree = "<group>"; }; | ||||
| 		FA18A63F16CEDE2300132F66 /* ngircd.service */ = {isa = PBXFileReference; lastKnownFileType = text; path = ngircd.service; sourceTree = "<group>"; }; | ||||
| 		FA18A64016CEDE2300132F66 /* ngircd.socket */ = {isa = PBXFileReference; lastKnownFileType = text; path = ngircd.socket; sourceTree = "<group>"; }; | ||||
| 		FA18A64116CEDE3500132F66 /* ngircd.pam */ = {isa = PBXFileReference; lastKnownFileType = text; path = ngircd.pam; sourceTree = "<group>"; }; | ||||
| 		FA18A64216CEDE5700132F66 /* de.barton.ngircd.plist.tmpl */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = de.barton.ngircd.plist.tmpl; sourceTree = "<group>"; }; | ||||
| 		FA18A64316CEDE8100132F66 /* Makefile.am */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA18A64416CEDFCE00132F66 /* Commands.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Commands.txt; sourceTree = "<group>"; }; | ||||
| 		FA18A64516CEE0C700132F66 /* Makefile.ng */ = {isa = PBXFileReference; lastKnownFileType = text; name = Makefile.ng; path = ipaddr/Makefile.ng; sourceTree = "<group>"; }; | ||||
| 		FA18A64616CEE0DD00132F66 /* Makefile.ng */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.ng; sourceTree = "<group>"; }; | ||||
| 		FA18A64716CEE14900132F66 /* Makefile.ng */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.ng; sourceTree = "<group>"; }; | ||||
| 		FA18A64A16CEE18100132F66 /* Makefile.ng */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.ng; sourceTree = "<group>"; }; | ||||
| 		FA18A64C16CEE1AC00132F66 /* mode-test.e */ = {isa = PBXFileReference; lastKnownFileType = text; path = "mode-test.e"; sourceTree = "<group>"; }; | ||||
| 		FA18A64D16CEE1D900132F66 /* whois-test.e */ = {isa = PBXFileReference; lastKnownFileType = text; path = "whois-test.e"; sourceTree = "<group>"; }; | ||||
| 		FA18A64E16CEE24B00132F66 /* misc-test.e */ = {isa = PBXFileReference; lastKnownFileType = text; path = "misc-test.e"; sourceTree = "<group>"; }; | ||||
| 		FA18A64F16CEE27700132F66 /* Makefile.ng */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.ng; sourceTree = "<group>"; }; | ||||
| 		FA1A6BBD0D6857D900AA8F71 /* who-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "who-test.e"; sourceTree = "<group>"; }; | ||||
| 		FA1DBB6716C707D200D4F838 /* irc-macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "irc-macros.h"; sourceTree = "<group>"; }; | ||||
| 		FA2D564811EA158B00D37A35 /* pam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pam.h; sourceTree = "<group>"; }; | ||||
| 		FA2D564911EA158B00D37A35 /* pam.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pam.c; sourceTree = "<group>"; }; | ||||
| 		FA2D567A11EA1AB300D37A35 /* libpam.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpam.dylib; path = usr/lib/libpam.dylib; sourceTree = SDKROOT; }; | ||||
| 		FA322BBA0CEF72E4001761B3 /* ngIRCd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ngIRCd; sourceTree = BUILT_PRODUCTS_DIR; }; | ||||
| 		FA322BBA0CEF72E4001761B3 /* ngircd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ngircd; sourceTree = BUILT_PRODUCTS_DIR; }; | ||||
| 		FA322CD60CEF74B1001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA322CD90CEF74B1001761B3 /* array.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = array.c; sourceTree = "<group>"; }; | ||||
| 		FA322CDA0CEF74B1001761B3 /* array.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = array.h; sourceTree = "<group>"; }; | ||||
| @@ -112,7 +127,6 @@ | ||||
| 		FA322CFF0CEF74B1001761B3 /* lists.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = lists.h; sourceTree = "<group>"; }; | ||||
| 		FA322D000CEF74B1001761B3 /* log.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = log.c; sourceTree = "<group>"; }; | ||||
| 		FA322D010CEF74B1001761B3 /* log.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = log.h; sourceTree = "<group>"; }; | ||||
| 		FA322D020CEF74B1001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA322D030CEF74B1001761B3 /* match.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = match.c; sourceTree = "<group>"; }; | ||||
| 		FA322D040CEF74B1001761B3 /* match.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = match.h; sourceTree = "<group>"; }; | ||||
| 		FA322D050CEF74B1001761B3 /* messages.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = messages.h; sourceTree = "<group>"; }; | ||||
| @@ -124,9 +138,6 @@ | ||||
| 		FA322D0D0CEF74B1001761B3 /* resolve.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = resolve.h; sourceTree = "<group>"; }; | ||||
| 		FA322D100CEF74B1001761B3 /* ansi2knr.1 */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.man; path = ansi2knr.1; sourceTree = "<group>"; }; | ||||
| 		FA322D110CEF74B1001761B3 /* ansi2knr.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = ansi2knr.c; sourceTree = "<group>"; }; | ||||
| 		FA322D120CEF74B1001761B3 /* exp.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = exp.h; sourceTree = "<group>"; }; | ||||
| 		FA322D130CEF74B1001761B3 /* imp.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = imp.h; sourceTree = "<group>"; }; | ||||
| 		FA322D140CEF74B1001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA322D150CEF74B1001761B3 /* portab.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = portab.h; sourceTree = "<group>"; }; | ||||
| 		FA322D160CEF74B1001761B3 /* portabtest.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = portabtest.c; sourceTree = "<group>"; }; | ||||
| 		FA322D170CEF74B1001761B3 /* splint.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = splint.h; sourceTree = "<group>"; }; | ||||
| @@ -138,8 +149,6 @@ | ||||
| 		FA322D1F0CEF74B1001761B3 /* connect-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "connect-test.e"; sourceTree = "<group>"; }; | ||||
| 		FA322D200CEF74B1001761B3 /* functions.inc */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.pascal; path = functions.inc; sourceTree = "<group>"; }; | ||||
| 		FA322D210CEF74B1001761B3 /* getpid.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = getpid.sh; sourceTree = "<group>"; }; | ||||
| 		FA322D220CEF74B1001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA322D230CEF74B1001761B3 /* mode-test.e */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = "mode-test.e"; sourceTree = "<group>"; }; | ||||
| 		FA322D250CEF74B1001761B3 /* README */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = README; sourceTree = "<group>"; }; | ||||
| 		FA322D260CEF74B1001761B3 /* start-server.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = "start-server.sh"; sourceTree = "<group>"; }; | ||||
| 		FA322D270CEF74B1001761B3 /* stop-server.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = "stop-server.sh"; sourceTree = "<group>"; }; | ||||
| @@ -149,9 +158,6 @@ | ||||
| 		FA322D2B0CEF74B1001761B3 /* test-loop.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = "test-loop.sh"; sourceTree = "<group>"; }; | ||||
| 		FA322D2C0CEF74B1001761B3 /* tests.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = tests.sh; sourceTree = "<group>"; }; | ||||
| 		FA322D2D0CEF74B1001761B3 /* wait-tests.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = "wait-tests.sh"; sourceTree = "<group>"; }; | ||||
| 		FA322D300CEF74B1001761B3 /* ansi2knr.1 */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.man; path = ansi2knr.1; sourceTree = "<group>"; }; | ||||
| 		FA322D310CEF74B1001761B3 /* ansi2knr.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = ansi2knr.c; sourceTree = "<group>"; }; | ||||
| 		FA322D320CEF74B1001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA322D330CEF74B1001761B3 /* tool.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = tool.c; sourceTree = "<group>"; }; | ||||
| 		FA322D340CEF74B1001761B3 /* tool.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = tool.h; sourceTree = "<group>"; }; | ||||
| 		FA322D5A0CEF750F001761B3 /* AUTHORS */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = AUTHORS; path = ../../AUTHORS; sourceTree = SOURCE_ROOT; }; | ||||
| @@ -159,7 +165,6 @@ | ||||
| 		FA322D5C0CEF750F001761B3 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = ChangeLog; path = ../../ChangeLog; sourceTree = SOURCE_ROOT; }; | ||||
| 		FA322D5E0CEF750F001761B3 /* config.guess */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; name = config.guess; path = ../../config.guess; sourceTree = SOURCE_ROOT; }; | ||||
| 		FA322D5F0CEF750F001761B3 /* config.sub */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; name = config.sub; path = ../../config.sub; sourceTree = SOURCE_ROOT; }; | ||||
| 		FA322D600CEF750F001761B3 /* configure.in */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = configure.in; path = ../../configure.in; sourceTree = SOURCE_ROOT; }; | ||||
| 		FA322D610CEF750F001761B3 /* COPYING */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = COPYING; path = ../../COPYING; sourceTree = SOURCE_ROOT; }; | ||||
| 		FA322D620CEF750F001761B3 /* INSTALL */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = INSTALL; path = ../../INSTALL; sourceTree = SOURCE_ROOT; }; | ||||
| 		FA322D630CEF750F001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = Makefile.am; path = ../../Makefile.am; sourceTree = SOURCE_ROOT; }; | ||||
| @@ -174,9 +179,8 @@ | ||||
| 		FA322D700CEF7523001761B3 /* ngircd.init */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = ngircd.init; sourceTree = "<group>"; }; | ||||
| 		FA322D710CEF7523001761B3 /* ngircd.postinst */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = ngircd.postinst; sourceTree = "<group>"; }; | ||||
| 		FA322D720CEF7523001761B3 /* rules */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = rules; sourceTree = "<group>"; }; | ||||
| 		FA322D8D0CEF7523001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA322D8D0CEF7523001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = Makefile.am; path = MacOSX/Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA322D8E0CEF7523001761B3 /* ngIRCd.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = ngIRCd.xcodeproj; sourceTree = "<group>"; }; | ||||
| 		FA322D910CEF7523001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA322D920CEF7523001761B3 /* ngindent */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = ngindent; sourceTree = "<group>"; }; | ||||
| 		FA322D940CEF7523001761B3 /* ngircd.spec */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = ngircd.spec; sourceTree = "<group>"; }; | ||||
| 		FA322D950CEF7523001761B3 /* README */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = README; sourceTree = "<group>"; }; | ||||
| @@ -190,16 +194,13 @@ | ||||
| 		FA322DA00CEF752C001761B3 /* RFC.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = RFC.txt; sourceTree = "<group>"; }; | ||||
| 		FA322DA40CEF752C001761B3 /* Doxyfile */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Doxyfile; sourceTree = "<group>"; }; | ||||
| 		FA322DA50CEF752C001761B3 /* footer.inc.html */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.html; path = footer.inc.html; sourceTree = "<group>"; }; | ||||
| 		FA322DA60CEF752C001761B3 /* header.inc.html */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.html; path = header.inc.html; sourceTree = "<group>"; }; | ||||
| 		FA322DA70CEF752C001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA322DA80CEF752C001761B3 /* ngircd-doc.css */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.css; path = "ngircd-doc.css"; sourceTree = "<group>"; }; | ||||
| 		FA322DA90CEF752C001761B3 /* SSL.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = SSL.txt; sourceTree = "<group>"; }; | ||||
| 		FA322DAD0CEF7538001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA322DAE0CEF7538001761B3 /* ngircd.8.tmpl */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = ngircd.8.tmpl; sourceTree = "<group>"; }; | ||||
| 		FA322DAF0CEF7538001761B3 /* ngircd.conf.5.tmpl */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = ngircd.conf.5.tmpl; sourceTree = "<group>"; }; | ||||
| 		FA322DB10CEF7565001761B3 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; }; | ||||
| 		FA322DC00CEF77CB001761B3 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; }; | ||||
| 		FA407F2B0DB159F400271AF1 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; name = Makefile.am; path = ipaddr/Makefile.am; sourceTree = "<group>"; }; | ||||
| 		FA407F2C0DB159F400271AF1 /* ng_ipaddr.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = ng_ipaddr.c; path = ipaddr/ng_ipaddr.c; sourceTree = "<group>"; }; | ||||
| 		FA407F2D0DB159F400271AF1 /* ng_ipaddr.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = ng_ipaddr.h; path = ipaddr/ng_ipaddr.h; sourceTree = "<group>"; }; | ||||
| 		FA407F380DB15AC700271AF1 /* GIT.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = GIT.txt; sourceTree = "<group>"; }; | ||||
| @@ -279,33 +280,37 @@ | ||||
| 		08FB7794FE84155DC02AAC07 /* ngIRCd */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D970CEF752C001761B3 /* doc */, | ||||
| 				FA322D630CEF750F001761B3 /* Makefile.am */, | ||||
| 				FA322D660CEF7523001761B3 /* contrib */, | ||||
| 				FA322D970CEF752C001761B3 /* doc */, | ||||
| 				FA322DAB0CEF7538001761B3 /* man */, | ||||
| 				FA322CD40CEF74B0001761B3 /* src */, | ||||
| 				FA322D5A0CEF750F001761B3 /* AUTHORS */, | ||||
| 				FA322D5C0CEF750F001761B3 /* ChangeLog */, | ||||
| 				FA322D610CEF750F001761B3 /* COPYING */, | ||||
| 				FA322D620CEF750F001761B3 /* INSTALL */, | ||||
| 				FA322D640CEF750F001761B3 /* NEWS */, | ||||
| 				FA322D650CEF750F001761B3 /* README */, | ||||
| 				FA322D5B0CEF750F001761B3 /* autogen.sh */, | ||||
| 				FA322D5C0CEF750F001761B3 /* ChangeLog */, | ||||
| 				FA322D5E0CEF750F001761B3 /* config.guess */, | ||||
| 				FA322D5F0CEF750F001761B3 /* config.sub */, | ||||
| 				FA322D600CEF750F001761B3 /* configure.in */, | ||||
| 				FA322D630CEF750F001761B3 /* Makefile.am */, | ||||
| 				FA18A63E16CEDDCE00132F66 /* configure.ng */, | ||||
| 				1AB674ADFE9D54B511CA2CBB /* Products */, | ||||
| 				FA6BBC651605F6D60004247A /* libiconv.dylib */, | ||||
| 				FA2D567A11EA1AB300D37A35 /* libpam.dylib */, | ||||
| 				FA322DC00CEF77CB001761B3 /* libz.dylib */, | ||||
| 			); | ||||
| 			indentWidth = 8; | ||||
| 			name = ngIRCd; | ||||
| 			sourceTree = "<group>"; | ||||
| 			tabWidth = 8; | ||||
| 			usesTabs = 1; | ||||
| 			wrapsLines = 0; | ||||
| 		}; | ||||
| 		1AB674ADFE9D54B511CA2CBB /* Products */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322BBA0CEF72E4001761B3 /* ngIRCd */, | ||||
| 				FA322BBA0CEF72E4001761B3 /* ngircd */, | ||||
| 			); | ||||
| 			name = Products; | ||||
| 			sourceTree = "<group>"; | ||||
| @@ -313,12 +318,12 @@ | ||||
| 		FA322CD40CEF74B0001761B3 /* src */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322CD70CEF74B1001761B3 /* ngircd */, | ||||
| 				FA322CD60CEF74B1001761B3 /* Makefile.am */, | ||||
| 				FA407F270DB1598D00271AF1 /* ipaddr */, | ||||
| 				FA322CD70CEF74B1001761B3 /* ngircd */, | ||||
| 				FA322D0E0CEF74B1001761B3 /* portab */, | ||||
| 				FA322D1B0CEF74B1001761B3 /* testsuite */, | ||||
| 				FA322D2E0CEF74B1001761B3 /* tool */, | ||||
| 				FA322CD60CEF74B1001761B3 /* Makefile.am */, | ||||
| 			); | ||||
| 			name = src; | ||||
| 			path = ../../src; | ||||
| @@ -327,7 +332,7 @@ | ||||
| 		FA322CD70CEF74B1001761B3 /* ngircd */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D020CEF74B1001761B3 /* Makefile.am */, | ||||
| 				FA18A64616CEE0DD00132F66 /* Makefile.ng */, | ||||
| 				FA322CD90CEF74B1001761B3 /* array.c */, | ||||
| 				FA322CDA0CEF74B1001761B3 /* array.h */, | ||||
| 				FA322CDB0CEF74B1001761B3 /* channel.c */, | ||||
| @@ -347,10 +352,10 @@ | ||||
| 				FA6BBC601605F0AC0004247A /* conn-encoding.h */, | ||||
| 				FA322CE10CEF74B1001761B3 /* conn-func.c */, | ||||
| 				FA322CE20CEF74B1001761B3 /* conn-func.h */, | ||||
| 				FA322CE30CEF74B1001761B3 /* conn-zip.c */, | ||||
| 				FA322CE40CEF74B1001761B3 /* conn-zip.h */, | ||||
| 				FAA3D2790F139CDC00B2447E /* conn-ssl.c */, | ||||
| 				FAA3D27A0F139CDC00B2447E /* conn-ssl.h */, | ||||
| 				FA322CE30CEF74B1001761B3 /* conn-zip.c */, | ||||
| 				FA322CE40CEF74B1001761B3 /* conn-zip.h */, | ||||
| 				FA322CE70CEF74B1001761B3 /* defines.h */, | ||||
| 				FA322CE80CEF74B1001761B3 /* hash.c */, | ||||
| 				FA322CE90CEF74B1001761B3 /* hash.h */, | ||||
| @@ -368,6 +373,7 @@ | ||||
| 				FA322CEF0CEF74B1001761B3 /* irc-info.h */, | ||||
| 				FA322CF00CEF74B1001761B3 /* irc-login.c */, | ||||
| 				FA322CF10CEF74B1001761B3 /* irc-login.h */, | ||||
| 				FA1DBB6716C707D200D4F838 /* irc-macros.h */, | ||||
| 				FA4F1659164836B100DBD011 /* irc-metadata.c */, | ||||
| 				FA4F165C164836BF00DBD011 /* irc-metadata.h */, | ||||
| 				FA322CF20CEF74B1001761B3 /* irc-mode.c */, | ||||
| @@ -412,19 +418,17 @@ | ||||
| 		FA322D0E0CEF74B1001761B3 /* portab */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FAA3D27C0F139CF800B2447E /* strtok_r.c */, | ||||
| 				FAA3D27D0F139CF800B2447E /* waitpid.c */, | ||||
| 				FA18A64716CEE14900132F66 /* Makefile.ng */, | ||||
| 				FA322D100CEF74B1001761B3 /* ansi2knr.1 */, | ||||
| 				FA322D110CEF74B1001761B3 /* ansi2knr.c */, | ||||
| 				FA322D120CEF74B1001761B3 /* exp.h */, | ||||
| 				FA322D130CEF74B1001761B3 /* imp.h */, | ||||
| 				FA322D140CEF74B1001761B3 /* Makefile.am */, | ||||
| 				FA322D150CEF74B1001761B3 /* portab.h */, | ||||
| 				FA322D160CEF74B1001761B3 /* portabtest.c */, | ||||
| 				FA322D170CEF74B1001761B3 /* splint.h */, | ||||
| 				FA322D180CEF74B1001761B3 /* strdup.c */, | ||||
| 				FA322D190CEF74B1001761B3 /* strlcpy.c */, | ||||
| 				FAA3D27C0F139CF800B2447E /* strtok_r.c */, | ||||
| 				FA322D1A0CEF74B1001761B3 /* vsnprintf.c */, | ||||
| 				FAA3D27D0F139CF800B2447E /* waitpid.c */, | ||||
| 			); | ||||
| 			path = portab; | ||||
| 			sourceTree = "<group>"; | ||||
| @@ -432,32 +436,33 @@ | ||||
| 		FA322D1B0CEF74B1001761B3 /* testsuite */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA18A64A16CEE18100132F66 /* Makefile.ng */, | ||||
| 				FA322D250CEF74B1001761B3 /* README */, | ||||
| 				FA322D1D0CEF74B1001761B3 /* channel-test.e */, | ||||
| 				FA322D1E0CEF74B1001761B3 /* check-idle.e */, | ||||
| 				FA322D1F0CEF74B1001761B3 /* connect-test.e */, | ||||
| 				FAA3D2700F139CB300B2447E /* invite-test.e */, | ||||
| 				FAA3D2710F139CB300B2447E /* join-test.e */, | ||||
| 				FAA3D2720F139CB300B2447E /* kick-test.e */, | ||||
| 				FAA3D2730F139CB300B2447E /* message-test.e */, | ||||
| 				FAA3D2740F139CB300B2447E /* ngircd-test1.conf */, | ||||
| 				FAA3D2750F139CB300B2447E /* ngircd-test2.conf */, | ||||
| 				FA18A64E16CEE24B00132F66 /* misc-test.e */, | ||||
| 				FA18A64C16CEE1AC00132F66 /* mode-test.e */, | ||||
| 				FAA3D2760F139CB300B2447E /* opless-channel-test.e */, | ||||
| 				FAA3D2770F139CB300B2447E /* server-link-test.e */, | ||||
| 				FA322D1D0CEF74B1001761B3 /* channel-test.e */, | ||||
| 				FA322D1E0CEF74B1001761B3 /* check-idle.e */, | ||||
| 				FA322D1F0CEF74B1001761B3 /* connect-test.e */, | ||||
| 				FA322D200CEF74B1001761B3 /* functions.inc */, | ||||
| 				FA322D210CEF74B1001761B3 /* getpid.sh */, | ||||
| 				FA322D220CEF74B1001761B3 /* Makefile.am */, | ||||
| 				FA1A6BBC0D6857BB00AA8F71 /* misc-test.e */, | ||||
| 				FA322D230CEF74B1001761B3 /* mode-test.e */, | ||||
| 				FA322D250CEF74B1001761B3 /* README */, | ||||
| 				FA322D260CEF74B1001761B3 /* start-server.sh */, | ||||
| 				FA322D270CEF74B1001761B3 /* stop-server.sh */, | ||||
| 				FA322D280CEF74B1001761B3 /* stress-A.e */, | ||||
| 				FA322D290CEF74B1001761B3 /* stress-B.e */, | ||||
| 				FA1A6BBD0D6857D900AA8F71 /* who-test.e */, | ||||
| 				FA18A64D16CEE1D900132F66 /* whois-test.e */, | ||||
| 				FA322D200CEF74B1001761B3 /* functions.inc */, | ||||
| 				FAA3D2740F139CB300B2447E /* ngircd-test1.conf */, | ||||
| 				FAA3D2750F139CB300B2447E /* ngircd-test2.conf */, | ||||
| 				FA322D210CEF74B1001761B3 /* getpid.sh */, | ||||
| 				FA322D260CEF74B1001761B3 /* start-server.sh */, | ||||
| 				FA322D270CEF74B1001761B3 /* stop-server.sh */, | ||||
| 				FA322D2A0CEF74B1001761B3 /* stress-server.sh */, | ||||
| 				FA322D2B0CEF74B1001761B3 /* test-loop.sh */, | ||||
| 				FA322D2C0CEF74B1001761B3 /* tests.sh */, | ||||
| 				FA322D2D0CEF74B1001761B3 /* wait-tests.sh */, | ||||
| 				FA1A6BBD0D6857D900AA8F71 /* who-test.e */, | ||||
| 			); | ||||
| 			path = testsuite; | ||||
| 			sourceTree = "<group>"; | ||||
| @@ -465,9 +470,7 @@ | ||||
| 		FA322D2E0CEF74B1001761B3 /* tool */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D300CEF74B1001761B3 /* ansi2knr.1 */, | ||||
| 				FA322D310CEF74B1001761B3 /* ansi2knr.c */, | ||||
| 				FA322D320CEF74B1001761B3 /* Makefile.am */, | ||||
| 				FA18A64F16CEE27700132F66 /* Makefile.ng */, | ||||
| 				FA322D330CEF74B1001761B3 /* tool.c */, | ||||
| 				FA322D340CEF74B1001761B3 /* tool.h */, | ||||
| 			); | ||||
| @@ -477,16 +480,18 @@ | ||||
| 		FA322D660CEF7523001761B3 /* contrib */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D8D0CEF7523001761B3 /* Makefile.am */, | ||||
| 				FA322D680CEF7523001761B3 /* Debian */, | ||||
| 				FA322D730CEF7523001761B3 /* MacOSX */, | ||||
| 				FA322D910CEF7523001761B3 /* Makefile.am */, | ||||
| 				FA322D950CEF7523001761B3 /* README */, | ||||
| 				FA322D920CEF7523001761B3 /* ngindent */, | ||||
| 				FA4B08E513E7F8FB00765BA3 /* ngircd-bsd.sh */, | ||||
| 				FA4B08E613E7F91700765BA3 /* ngIRCd-Logo.gif */, | ||||
| 				FA4B08E713E7F91700765BA3 /* ngircd-redhat.init */, | ||||
| 				FA18A63F16CEDE2300132F66 /* ngircd.service */, | ||||
| 				FA18A64016CEDE2300132F66 /* ngircd.socket */, | ||||
| 				FA322D940CEF7523001761B3 /* ngircd.spec */, | ||||
| 				FA4B08E813E7F91C00765BA3 /* platformtest.sh */, | ||||
| 				FA322D950CEF7523001761B3 /* README */, | ||||
| 				FA322D960CEF7523001761B3 /* systrace.policy */, | ||||
| 			); | ||||
| 			name = contrib; | ||||
| @@ -496,13 +501,14 @@ | ||||
| 		FA322D680CEF7523001761B3 /* Debian */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D6E0CEF7523001761B3 /* Makefile.am */, | ||||
| 				FA322D6A0CEF7523001761B3 /* changelog */, | ||||
| 				FA322D6B0CEF7523001761B3 /* compat */, | ||||
| 				FA322D6C0CEF7523001761B3 /* control */, | ||||
| 				FA322D6D0CEF7523001761B3 /* copyright */, | ||||
| 				FA322D6E0CEF7523001761B3 /* Makefile.am */, | ||||
| 				FA322D6F0CEF7523001761B3 /* ngircd.default */, | ||||
| 				FA322D700CEF7523001761B3 /* ngircd.init */, | ||||
| 				FA18A64116CEDE3500132F66 /* ngircd.pam */, | ||||
| 				FA322D710CEF7523001761B3 /* ngircd.postinst */, | ||||
| 				FA322D720CEF7523001761B3 /* rules */, | ||||
| 			); | ||||
| @@ -512,88 +518,17 @@ | ||||
| 		FA322D730CEF7523001761B3 /* MacOSX */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA18A64316CEDE8100132F66 /* Makefile.am */, | ||||
| 				FAA3D2810F139D2E00B2447E /* ngIRCd.pmdoc */, | ||||
| 				FA322DB10CEF7565001761B3 /* config.h */, | ||||
| 				FA18A64216CEDE5700132F66 /* de.barton.ngircd.plist.tmpl */, | ||||
| 				FA322D8E0CEF7523001761B3 /* ngIRCd.xcodeproj */, | ||||
| 				FAA3D28A0F139D2E00B2447E /* postinstall.sh */, | ||||
| 				FAA3D28B0F139D2E00B2447E /* preinstall.sh */, | ||||
| 				FA322D750CEF7523001761B3 /* build */, | ||||
| 				FA322D8D0CEF7523001761B3 /* Makefile.am */, | ||||
| 				FA322D8E0CEF7523001761B3 /* ngIRCd.xcodeproj */, | ||||
| 				FA322DB10CEF7565001761B3 /* config.h */, | ||||
| 			); | ||||
| 			path = MacOSX; | ||||
| 			sourceTree = "<group>"; | ||||
| 		}; | ||||
| 		FA322D750CEF7523001761B3 /* build */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D760CEF7523001761B3 /* ngIRCd.build */, | ||||
| 			); | ||||
| 			path = build; | ||||
| 			sourceTree = "<group>"; | ||||
| 		}; | ||||
| 		FA322D760CEF7523001761B3 /* ngIRCd.build */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D770CEF7523001761B3 /* Default */, | ||||
| 				FA322D7F0CEF7523001761B3 /* ngIRCd.pbxindex */, | ||||
| 			); | ||||
| 			path = ngIRCd.build; | ||||
| 			sourceTree = "<group>"; | ||||
| 		}; | ||||
| 		FA322D770CEF7523001761B3 /* Default */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D780CEF7523001761B3 /* ngIRCd.build */, | ||||
| 			); | ||||
| 			path = Default; | ||||
| 			sourceTree = "<group>"; | ||||
| 		}; | ||||
| 		FA322D780CEF7523001761B3 /* ngIRCd.build */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D7A0CEF7523001761B3 /* Objects-normal */, | ||||
| 			); | ||||
| 			path = ngIRCd.build; | ||||
| 			sourceTree = "<group>"; | ||||
| 		}; | ||||
| 		FA322D7A0CEF7523001761B3 /* Objects-normal */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D7B0CEF7523001761B3 /* i386 */, | ||||
| 				FA322D7D0CEF7523001761B3 /* ppc */, | ||||
| 			); | ||||
| 			path = "Objects-normal"; | ||||
| 			sourceTree = "<group>"; | ||||
| 		}; | ||||
| 		FA322D7B0CEF7523001761B3 /* i386 */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 			); | ||||
| 			path = i386; | ||||
| 			sourceTree = "<group>"; | ||||
| 		}; | ||||
| 		FA322D7D0CEF7523001761B3 /* ppc */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 			); | ||||
| 			path = ppc; | ||||
| 			sourceTree = "<group>"; | ||||
| 		}; | ||||
| 		FA322D7F0CEF7523001761B3 /* ngIRCd.pbxindex */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D880CEF7523001761B3 /* strings.pbxstrings */, | ||||
| 			); | ||||
| 			path = ngIRCd.pbxindex; | ||||
| 			sourceTree = "<group>"; | ||||
| 		}; | ||||
| 		FA322D880CEF7523001761B3 /* strings.pbxstrings */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 			); | ||||
| 			path = strings.pbxstrings; | ||||
| 			sourceTree = "<group>"; | ||||
| 		}; | ||||
| 		FA322D8F0CEF7523001761B3 /* Products */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| @@ -605,8 +540,10 @@ | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322D9B0CEF752C001761B3 /* Makefile.am */, | ||||
| 				FA322DA20CEF752C001761B3 /* src */, | ||||
| 				FAE22BD215270EA300F1A5AB /* Bopm.txt */, | ||||
| 				FAD5852F15271A7800328741 /* Capabilities.txt */, | ||||
| 				FA18A64416CEDFCE00132F66 /* Commands.txt */, | ||||
| 				FAE22BD415270EA300F1A5AB /* Contributing.txt */, | ||||
| 				FA322D9A0CEF752C001761B3 /* FAQ.txt */, | ||||
| 				FA407F380DB15AC700271AF1 /* GIT.txt */, | ||||
| @@ -622,7 +559,6 @@ | ||||
| 				FAA3D2800F139D1500B2447E /* Services.txt */, | ||||
| 				FA322DA90CEF752C001761B3 /* SSL.txt */, | ||||
| 				FA77849A133FB9FF00740057 /* sample-ngircd.conf.tmpl */, | ||||
| 				FA322DA20CEF752C001761B3 /* src */, | ||||
| 			); | ||||
| 			name = doc; | ||||
| 			path = ../../doc; | ||||
| @@ -631,11 +567,9 @@ | ||||
| 		FA322DA20CEF752C001761B3 /* src */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA322DA70CEF752C001761B3 /* Makefile.am */, | ||||
| 				FA322DA40CEF752C001761B3 /* Doxyfile */, | ||||
| 				FA322DA50CEF752C001761B3 /* footer.inc.html */, | ||||
| 				FA322DA60CEF752C001761B3 /* header.inc.html */, | ||||
| 				FA322DA70CEF752C001761B3 /* Makefile.am */, | ||||
| 				FA322DA80CEF752C001761B3 /* ngircd-doc.css */, | ||||
| 			); | ||||
| 			path = src; | ||||
| 			sourceTree = "<group>"; | ||||
| @@ -654,7 +588,7 @@ | ||||
| 		FA407F270DB1598D00271AF1 /* ipaddr */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FA407F2B0DB159F400271AF1 /* Makefile.am */, | ||||
| 				FA18A64516CEE0C700132F66 /* Makefile.ng */, | ||||
| 				FA407F2C0DB159F400271AF1 /* ng_ipaddr.c */, | ||||
| 				FA407F2D0DB159F400271AF1 /* ng_ipaddr.h */, | ||||
| 			); | ||||
| @@ -664,12 +598,12 @@ | ||||
| 		FAA3D2810F139D2E00B2447E /* ngIRCd.pmdoc */ = { | ||||
| 			isa = PBXGroup; | ||||
| 			children = ( | ||||
| 				FAA3D2820F139D2E00B2447E /* 01ngircd-contents.xml */, | ||||
| 				FAA3D2830F139D2E00B2447E /* 01ngircd.xml */, | ||||
| 				FAA3D2840F139D2E00B2447E /* 02de-contents.xml */, | ||||
| 				FAA3D2850F139D2E00B2447E /* 02de.xml */, | ||||
| 				FAA3D2860F139D2E00B2447E /* index.xml */, | ||||
| 				FAA3D2880F139D2E00B2447E /* Makefile.am */, | ||||
| 				FAA3D2860F139D2E00B2447E /* index.xml */, | ||||
| 				FAA3D2830F139D2E00B2447E /* 01ngircd.xml */, | ||||
| 				FAA3D2820F139D2E00B2447E /* 01ngircd-contents.xml */, | ||||
| 				FAA3D2850F139D2E00B2447E /* 02de.xml */, | ||||
| 				FAA3D2840F139D2E00B2447E /* 02de-contents.xml */, | ||||
| 			); | ||||
| 			path = ngIRCd.pmdoc; | ||||
| 			sourceTree = "<group>"; | ||||
| @@ -692,7 +626,7 @@ | ||||
| 			name = ngIRCd; | ||||
| 			productInstallPath = "$(HOME)/bin"; | ||||
| 			productName = ngIRCd; | ||||
| 			productReference = FA322BBA0CEF72E4001761B3 /* ngIRCd */; | ||||
| 			productReference = FA322BBA0CEF72E4001761B3 /* ngircd */; | ||||
| 			productType = "com.apple.product-type.tool"; | ||||
| 		}; | ||||
| /* End PBXNativeTarget section */ | ||||
| @@ -701,7 +635,7 @@ | ||||
| 		08FB7793FE84155DC02AAC07 /* Project object */ = { | ||||
| 			isa = PBXProject; | ||||
| 			attributes = { | ||||
| 				LastUpgradeCheck = 0430; | ||||
| 				LastUpgradeCheck = 0800; | ||||
| 			}; | ||||
| 			buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "ngIRCd" */; | ||||
| 			compatibilityVersion = "Xcode 3.2"; | ||||
| @@ -808,10 +742,25 @@ | ||||
| 		1DEB928B08733DD80010E9CD /* Default */ = { | ||||
| 			isa = XCBuildConfiguration; | ||||
| 			buildSettings = { | ||||
| 				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; | ||||
| 				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; | ||||
| 				CLANG_WARN_BOOL_CONVERSION = YES; | ||||
| 				CLANG_WARN_CONSTANT_CONVERSION = YES; | ||||
| 				CLANG_WARN_EMPTY_BODY = YES; | ||||
| 				CLANG_WARN_ENUM_CONVERSION = YES; | ||||
| 				CLANG_WARN_INFINITE_RECURSION = YES; | ||||
| 				CLANG_WARN_INT_CONVERSION = YES; | ||||
| 				CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||||
| 				CLANG_WARN_UNREACHABLE_CODE = YES; | ||||
| 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||||
| 				CODE_SIGN_IDENTITY = ""; | ||||
| 				ENABLE_STRICT_OBJC_MSGSEND = YES; | ||||
| 				GCC_NO_COMMON_BLOCKS = NO; | ||||
| 				GCC_VERSION = ""; | ||||
| 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||||
| 				GCC_WARN_ABOUT_RETURN_TYPE = YES; | ||||
| 				GCC_WARN_UNDECLARED_SELECTOR = YES; | ||||
| 				GCC_WARN_UNINITIALIZED_AUTOS = YES; | ||||
| 				GCC_WARN_UNUSED_FUNCTION = YES; | ||||
| 				GCC_WARN_UNUSED_VARIABLE = YES; | ||||
| 				MACOSX_DEPLOYMENT_TARGET = 10.6; | ||||
| 				SDKROOT = ""; | ||||
| @@ -821,11 +770,27 @@ | ||||
| 		FAB0570C105D917F006AF9E2 /* Debug */ = { | ||||
| 			isa = XCBuildConfiguration; | ||||
| 			buildSettings = { | ||||
| 				ARCHS = "$(NATIVE_ARCH_ACTUAL)"; | ||||
| 				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; | ||||
| 				CLANG_WARN_BOOL_CONVERSION = YES; | ||||
| 				CLANG_WARN_CONSTANT_CONVERSION = YES; | ||||
| 				CLANG_WARN_EMPTY_BODY = YES; | ||||
| 				CLANG_WARN_ENUM_CONVERSION = YES; | ||||
| 				CLANG_WARN_INFINITE_RECURSION = YES; | ||||
| 				CLANG_WARN_INT_CONVERSION = YES; | ||||
| 				CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||||
| 				CLANG_WARN_UNREACHABLE_CODE = YES; | ||||
| 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||||
| 				ENABLE_STRICT_OBJC_MSGSEND = YES; | ||||
| 				ENABLE_TESTABILITY = YES; | ||||
| 				GCC_DEBUGGING_SYMBOLS = full; | ||||
| 				GCC_NO_COMMON_BLOCKS = NO; | ||||
| 				GCC_OPTIMIZATION_LEVEL = 0; | ||||
| 				GCC_VERSION = ""; | ||||
| 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||||
| 				GCC_WARN_ABOUT_RETURN_TYPE = YES; | ||||
| 				GCC_WARN_UNDECLARED_SELECTOR = YES; | ||||
| 				GCC_WARN_UNINITIALIZED_AUTOS = YES; | ||||
| 				GCC_WARN_UNUSED_FUNCTION = YES; | ||||
| 				GCC_WARN_UNUSED_VARIABLE = YES; | ||||
| 				MACOSX_DEPLOYMENT_TARGET = 10.6; | ||||
| 				ONLY_ACTIVE_ARCH = YES; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| # | ||||
| # ngIRCd -- The Next Generation IRC Daemon | ||||
| # Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors | ||||
| # Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| @@ -17,6 +17,7 @@ EXTRA_DIST = README \ | ||||
| 	ngIRCd-Logo.gif \ | ||||
| 	ngircd-redhat.init \ | ||||
| 	ngircd.service \ | ||||
| 	ngircd.socket \ | ||||
| 	ngircd.spec \ | ||||
| 	platformtest.sh \ | ||||
| 	systrace.policy | ||||
|   | ||||
| @@ -2,18 +2,21 @@ | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2011 Alexander Barton and Contributors. | ||||
|                (c)2001-2013 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
|                             -- Contributions -- | ||||
|                              -- Contributions -- | ||||
|  | ||||
|  | ||||
| Debian/ | ||||
|  - Various files for building Debian GNU/Linux packages (".deb's"). | ||||
| 	- ngircd.init; ngircd.default: init script for Debian-based systems. | ||||
| 	- ngircd.pam: example PAM configuration. | ||||
|  | ||||
| MacOSX/ | ||||
|  - Project files for XCode, the "project builder" of Apple Mac OS X. | ||||
| 	- de.barton.ngircd.plist[.tmpl]: launchd(8) property list. | ||||
|  | ||||
| ngindent | ||||
|  - Script to indent the code of ngIRCd in the "standard way". | ||||
| @@ -24,6 +27,12 @@ ngircd-bsd.sh | ||||
| ngircd-redhat.init | ||||
|  - Start/stop script for RedHat-based distributions (like CentOS). | ||||
|  | ||||
| ngircd.service | ||||
|  - systemd(8) service unit configuration file. | ||||
|  | ||||
| ngircd.socket | ||||
|  - systemd(8) socket unit configuration file for "socket activation". | ||||
|  | ||||
| ngircd.spec | ||||
|  - RPM "spec" file. | ||||
|  | ||||
|   | ||||
| @@ -1,17 +1,17 @@ | ||||
| #/bin/sh | ||||
| #!/bin/sh | ||||
|  | ||||
| INDENTARGS="-kr -i8 -ts8 -l80 -c3 -cd41 -ss -ncs -psl" | ||||
|  | ||||
| # check if indent(1) is available | ||||
| type indent >/dev/null 2>&1 && INDENT="indent" | ||||
| type gindent >/dev/null 2>&1 && INDENT="gindent" | ||||
| type gnuindent >/dev/null 2>&1 && INDENT="gnuindent" | ||||
| command -v indent >/dev/null 2>&1 && INDENT="indent" | ||||
| command -v gindent >/dev/null 2>&1 && INDENT="gindent" | ||||
| command -v gnuindent >/dev/null 2>&1 && INDENT="gnuindent" | ||||
|  | ||||
| if [ -z "$INDENT" ]; then | ||||
| 	echo "Error: GNU \"indent\" not found!" | ||||
| 	exit 1 | ||||
| fi | ||||
|  | ||||
| $INDENT -v $INDENTARGS $* | ||||
| $INDENT -v $INDENTARGS "$@" | ||||
|  | ||||
| # -eof- | ||||
|   | ||||
							
								
								
									
										0
									
								
								contrib/ngircd-bsd.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								contrib/ngircd-bsd.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
								
								
									
										0
									
								
								contrib/ngircd-redhat.init
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										0
									
								
								contrib/ngircd-redhat.init
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							| @@ -1,11 +1,43 @@ | ||||
| # ngIRCd systemd service unit. | ||||
| # See systemd(1), systemd.unit(5), systemd.service(5), systemd.exec(5). | ||||
|  | ||||
| [Unit] | ||||
| Description=Next Generation IRC Daemon | ||||
| Documentation=man:ngircd(8) man:ngircd.conf(5) https://ngircd.barton.de | ||||
| After=network.target | ||||
| Wants=anope.service atheme.service irc-services.service | ||||
| Wants=bopm.service | ||||
| Before=anope.service atheme.service irc-services.service | ||||
| Before=bopm.service | ||||
|  | ||||
| [Service] | ||||
| # don't daemonize to simplify stuff | ||||
| ExecStart=/usr/sbin/ngircd -n | ||||
| Type=forking | ||||
| User=irc | ||||
| Group=irc | ||||
| # Settings & limits: | ||||
| CapabilityBoundingSet=CAP_SYS_CHROOT CAP_NET_BIND_SERVICE | ||||
| MemoryDenyWriteExecute=yes | ||||
| NoNewPrivileges=yes | ||||
| PrivateDevices=yes | ||||
| PrivateTmp=yes | ||||
| ProtectControlGroups=yes | ||||
| ProtectHome=yes | ||||
| ProtectKernelModules=yes | ||||
| ProtectKernelTunables=yes | ||||
| ProtectSystem=full | ||||
| RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX | ||||
| RestrictRealtime=yes | ||||
| RuntimeDirectory=ircd | ||||
| RuntimeDirectoryMode=750 | ||||
| # Try to load "default files" from any Debian package variant to keep this | ||||
| # unit generic. | ||||
| EnvironmentFile=-/etc/default/ngircd | ||||
| EnvironmentFile=-/etc/default/ngircd-full | ||||
| EnvironmentFile=-/etc/default/ngircd-full-dbg | ||||
| # Start ngIRCd. Note: systemd doesn't allow to use $DAEMON here! | ||||
| ExecStart=/usr/sbin/ngircd $PARAMS | ||||
| ExecReload=/bin/kill -HUP $MAINPID | ||||
| Restart=on-failure | ||||
|  | ||||
| [Install] | ||||
| WantedBy=multi-user.target | ||||
|   | ||||
							
								
								
									
										12
									
								
								contrib/ngircd.socket
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								contrib/ngircd.socket
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| [Unit] | ||||
| Description=Next Generation IRC Daemon (Socket) | ||||
| Documentation=man:ngircd(8) man:ngircd.conf(5) | ||||
|  | ||||
| [Socket] | ||||
| BindIPv6Only=ipv6-only | ||||
| ListenStream=0.0.0.0:6667 | ||||
| #ListenStream=[::]:6667 | ||||
| IPTOS=low-delay | ||||
|  | ||||
| [Install] | ||||
| WantedBy=sockets.target | ||||
| @@ -1,5 +1,5 @@ | ||||
| %define name    ngircd | ||||
| %define version 20 | ||||
| %define version 24~rc1 | ||||
| %define release 1 | ||||
| %define prefix  %{_prefix} | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| #!/bin/sh | ||||
| # | ||||
| # ngIRCd -- The Next Generation IRC Daemon | ||||
| # Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors | ||||
| # Copyright (c)2001-2016 Alexander Barton (alex@barton.de) and Contributors | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| @@ -14,20 +14,25 @@ | ||||
| # suitable for inclusion in doc/Platforms.txt -- please send reports | ||||
| # to the ngIRCd mailing list: <ngircd-ml@ngircd.barton.de>. | ||||
|  | ||||
| NAME=`basename "$0"` | ||||
| NAME=$(basename "$0") | ||||
| VERBOSE= | ||||
| CLEAN=1 | ||||
|  | ||||
| PLATFORM= | ||||
| COMPILER="unknown" | ||||
| VERSION="unknown" | ||||
| DATE=`date "+%y-%m-%d"` | ||||
| DATE=$(date "+%y-%m-%d") | ||||
| COMMENT= | ||||
|  | ||||
| R_CONFIGURE= | ||||
| R_MAKE= | ||||
| R_CHECK= | ||||
| R_CHECK_Y="?" | ||||
| R_RUN= | ||||
|  | ||||
| SRC_D=$(dirname "$0") | ||||
| MY_D="$PWD" | ||||
|  | ||||
| [ -n "$MAKE" ] || MAKE="make" | ||||
| export MAKE CC | ||||
|  | ||||
| @@ -36,44 +41,95 @@ while [ $# -gt 0 ]; do | ||||
| 		"-v") | ||||
| 			VERBOSE=1 | ||||
| 			;; | ||||
| 		"-x") | ||||
| 			CLEAN= | ||||
| 			;; | ||||
| 		*) | ||||
| 			echo "Usage: $NAME [-v]" | ||||
| 			echo "Usage: $NAME [-v] [-x]" | ||||
| 			echo | ||||
| 			echo "  -v   Verbose output" | ||||
| 			echo "  -x   Don't regenerate build system, even when possible" | ||||
| 			echo | ||||
| 			exit 2 | ||||
| 	esac | ||||
| 	shift | ||||
| done | ||||
|  | ||||
| for cmd in telnet expect; do | ||||
| 	command -v "$cmd" >/dev/null 2>&1 \ | ||||
| 		|| echo "$NAME: WARNING: $cmd(1) not found, \"make check\" won't run all tests!" | ||||
| done | ||||
|  | ||||
| echo "$NAME: Checking ngIRCd base source directory ..." | ||||
| grep "ngIRCd" ./ChangeLog >/dev/null 2>&1 | ||||
| grep "ngIRCd" "$SRC_D/ChangeLog" >/dev/null 2>&1 | ||||
| if [ $? -ne 0 ]; then | ||||
| 	grep "ngIRCd" ../ChangeLog >/dev/null 2>&1 | ||||
| 	grep "ngIRCd" "$SRC_D/../ChangeLog" >/dev/null 2>&1 | ||||
| 	if [ $? -ne 0 ]; then | ||||
| 		echo "$NAME: ngIRCd base source directory not found!?" | ||||
| 		exit 1 | ||||
| 	fi | ||||
| 	cd .. | ||||
| 	SRC_D="$SRC_D/.." | ||||
| fi | ||||
| echo "$NAME:  - source directory: $SRC_D" | ||||
| echo "$NAME:  - working directory: $MY_D" | ||||
|  | ||||
| echo "$NAME: Checking for GIT tree ..." | ||||
| if [ -d "$SRC_D/.git" ]; then | ||||
| 	echo "$NAME: Checking for \"git\" command ..." | ||||
| 	git version >/dev/null 2>&1 | ||||
| 	if [ $? -eq 0 ] && [ -n "$CLEAN" ]; then | ||||
| 		echo "$NAME: Running \"git clean\" ..." | ||||
| 		cd "$SRC_D" || exit 1 | ||||
| 		if [ -n "$VERBOSE" ]; then | ||||
| 			git clean -dxf | ||||
| 		else | ||||
| 			git clean -dxf >/dev/null | ||||
| 		fi | ||||
| 		cd "$MY_D" || exit 1 | ||||
| 	fi | ||||
| fi | ||||
|  | ||||
| echo "$NAME: Checking for \"./configure\" script ..." | ||||
| if [ ! -e ./configure ]; then | ||||
| 	echo "$NAME: Running \"./autogen.sh\" ..." | ||||
| 	[ -n "$VERBOSE" ] && ./autogen.sh || ./autogen.sh >/dev/null | ||||
| echo "$NAME: Checking for \"$SRC_D/configure\" script ..." | ||||
| if [ ! -r "$SRC_D/configure" ]; then | ||||
| 	echo "$NAME: Running \"$SRC_D/autogen.sh\" ..." | ||||
| 	cd "$SRC_D" || exit 1 | ||||
| 	if [ -n "$VERBOSE" ]; then | ||||
| 		./autogen.sh | ||||
| 	else | ||||
| 		./autogen.sh >/dev/null | ||||
| 	fi | ||||
| 	cd "$MY_D" || exit 1 | ||||
| fi | ||||
|  | ||||
| if [ -r ./configure ]; then | ||||
| 	echo "$NAME: Running \"./configure\" script ..." | ||||
| 	[ -n "$VERBOSE" ] && ./configure || ./configure >/dev/null | ||||
| 	if [ $? -eq 0 -a -r ./Makefile ]; then | ||||
| if [ -r "$SRC_D/configure" ]; then | ||||
| 	echo "$NAME: Running \"$SRC_D/configure\" script ..." | ||||
| 	if [ -n "$VERBOSE" ]; then | ||||
| 		"$SRC_D/configure" -C | ||||
| 	else | ||||
| 		"$SRC_D/configure" -C >/dev/null | ||||
| 	fi | ||||
| 	if [ $? -eq 0 ] && [ -r ./Makefile ]; then | ||||
| 		R_CONFIGURE=1 | ||||
| 		rm -f "src/ngircd/ngircd" | ||||
| 		echo "$NAME: Running \"$MAKE\" ..." | ||||
| 		[ -n "$VERBOSE" ] && "$MAKE" || "$MAKE" >/dev/null | ||||
| 		if [ $? -eq 0 -a -x src/ngircd/ngircd ]; then | ||||
| 		if [ -n "$VERBOSE" ]; then | ||||
| 			"$MAKE" | ||||
| 		else | ||||
| 			"$MAKE" >/dev/null | ||||
| 		fi | ||||
| 		if [ $? -eq 0 ] && [ -x src/ngircd/ngircd ]; then | ||||
| 			R_MAKE=1 | ||||
| 			echo "$NAME: Running \"$MAKE check\" ..." | ||||
| 			[ -n "$VERBOSE" ] && "$MAKE" check || "$MAKE" check >/dev/null | ||||
| 			if [ -n "$VERBOSE" ]; then | ||||
| 				"$MAKE" check | ||||
| 			else | ||||
| 				"$MAKE" check >/dev/null | ||||
| 			fi | ||||
| 			if [ $? -eq 0 ]; then | ||||
| 				R_CHECK=1 | ||||
| 				R_RUN=$R_CHECK | ||||
| 				[ -r ./src/testsuite/tests-skipped.lst ] \ | ||||
| 					&& R_CHECK_Y="y" || R_CHECK_Y="Y" | ||||
| 			else | ||||
| 				./src/ngircd/ngircd --help 2>/dev/null \ | ||||
| 				 | grep "^ngIRCd" >/dev/null | ||||
| @@ -85,13 +141,13 @@ fi | ||||
|  | ||||
| # Get target platform information | ||||
| if [ -r "src/config.h" ]; then | ||||
| 	CPU=`grep "HOST_CPU" "src/config.h" | cut -d'"' -f2` | ||||
| 	OS=`grep "HOST_OS" "src/config.h" | cut -d'"' -f2` | ||||
| 	VENDOR=`grep "HOST_VENDOR" "src/config.h" | cut -d'"' -f2` | ||||
| 	CPU=$(grep "HOST_CPU" "src/config.h" | cut -d'"' -f2) | ||||
| 	OS=$(grep "HOST_OS" "src/config.h" | cut -d'"' -f2) | ||||
| 	VENDOR=$(grep "HOST_VENDOR" "src/config.h" | cut -d'"' -f2) | ||||
| 	PLATFORM="$CPU/$VENDOR/$OS" | ||||
| fi | ||||
| if [ -z "$PLATFORM" ]; then | ||||
| 	PLATFORM="`uname 2>/dev/null` `uname -r 2>/dev/null`, `uname -m 2>/dev/null`" | ||||
| 	PLATFORM="$(uname 2>/dev/null) $(uname -r 2>/dev/null), $(uname -m 2>/dev/null)" | ||||
| fi | ||||
|  | ||||
| # Get compiler information | ||||
| @@ -99,6 +155,7 @@ if [ -r "Makefile" ]; then | ||||
| 	CC=$(grep "^CC = " Makefile | cut -d' ' -f3) | ||||
| 	$CC --version 2>&1 | grep -i "GCC" >/dev/null | ||||
| 	if [ $? -eq 0 ]; then | ||||
| 		# GCC, or compiler that mimics GCC | ||||
| 		$CC --version 2>&1 | grep -i "Open64" >/dev/null | ||||
| 		if [ $? -eq 0 ]; then | ||||
| 			COMPILER="Open64" | ||||
| @@ -108,57 +165,90 @@ if [ -r "Makefile" ]; then | ||||
| 			COMPILER="gcc $COMPILER" | ||||
| 		fi | ||||
| 	else | ||||
| 		case "$CC" in | ||||
| 		  gcc*) | ||||
| 			v="`$CC --version 2>/dev/null | head -1`" | ||||
| 			[ -n "$v" ] && COMPILER="gcc $v" | ||||
| 			;; | ||||
| 		esac | ||||
| 		# Non-GCC compiler | ||||
| 		$CC --version 2>&1 | grep -i "clang" >/dev/null | ||||
| 		if [ $? -eq 0 ]; then | ||||
| 			COMPILER=$($CC --version 2>/dev/null | head -1 \ | ||||
| 			  | cut -d'(' -f1 | cut -d'-' -f1 \ | ||||
| 			  | sed -e 's/version //g' | sed -e 's/Apple /A-/g' \ | ||||
| 			  | sed -e 's/Debian //g' | sed -e 's/LLVM /clang /g') | ||||
| 		fi | ||||
| 		$CC -version 2>&1 | grep -i "tcc" >/dev/null | ||||
| 		if [ $? -eq 0 ]; then | ||||
| 			COMPILER=$($CC -version 2>/dev/null | head -1 \ | ||||
| 			  | cut -d'(' -f1 | sed -e 's/version //g') | ||||
| 		fi | ||||
| 		if [ "$COMPILER" = "unknown" ]; then | ||||
| 			v="$($CC --version 2>/dev/null | head -1)" | ||||
| 			[ -z "$v" ] && v="$($CC -version 2>/dev/null | head -1)" | ||||
| 			[ -n "$v" ] && COMPILER="$v" | ||||
| 		fi | ||||
| 	fi | ||||
| fi | ||||
|  | ||||
| # Get ngIRCd version information | ||||
| eval $(grep "^VERSION = " Makefile | sed -e 's/ //g') | ||||
| eval "$(grep "^VERSION = " Makefile | sed -e 's/ //g')" | ||||
| case "$VERSION" in | ||||
| 	*-*-*) | ||||
| 		VERSION=`echo "$VERSION" | cut -d'-' -f3 | cut -b2-` | ||||
| 	*~*-*) | ||||
| 		VERSION=$(echo "$VERSION" | cut -b1-10) | ||||
| 		;; | ||||
| esac | ||||
| [ -n "$VERSION" ] || VERSION="unknown" | ||||
|  | ||||
| # Get IO interface information | ||||
| if [ "$OS" = "linux-gnu" ]; then | ||||
| 	COMMENT="(1)" | ||||
| 	COMMENT="1" | ||||
| else | ||||
| 	grep "^#define HAVE_SYS_DEVPOLL_H 1" src/config.h >/dev/null 2>&1 | ||||
| 	[ $? -eq 0 ] && COMMENT="(4)" | ||||
| 	[ $? -eq 0 ] && COMMENT="4" | ||||
| 	grep "^#define HAVE_EPOLL_CREATE 1" src/config.h >/dev/null 2>&1 | ||||
| 	[ $? -eq 0 ] && COMMENT="(5)" | ||||
| 	[ $? -eq 0 ] && COMMENT="5" | ||||
| 	grep "^#define HAVE_KQUEUE 1" src/config.h >/dev/null 2>&1 | ||||
| 	[ $? -eq 0 ] && COMMENT="(3)" | ||||
| 	[ $? -eq 0 ] && COMMENT="3" | ||||
| fi | ||||
|  | ||||
| [ -n "$R_CONFIGURE" ] && C="Y" || C="N" | ||||
| [ -n "$R_MAKE" ] && M="Y" || M="N" | ||||
| [ -n "$R_CHECK" ] && T="Y" || T="N" | ||||
| [ -n "$R_RUN" ] && R="Y" || R="N" | ||||
| [ -n "$R_CHECK" ] && T="$R_CHECK_Y" || T="N" | ||||
| if [ -n "$R_RUN" ]; then | ||||
| 	# Mark "runs" with "Y" only when the test suite succeeded: | ||||
| 	[ "$T" = "N" ] && R="?" || R="Y" | ||||
| else | ||||
| 	R="N" | ||||
| fi | ||||
| [ -n "$COMMENT" ] && COMMENT=" $COMMENT" | ||||
|  | ||||
| echo | ||||
| echo "                              the executable works (\"runs\") as expected --+" | ||||
| echo "                                tests run successfully (\"make check\") --+ |" | ||||
| echo "                                           ngIRCd compiles (\"make\") --+ | |" | ||||
| echo "                                                ./configure works --+ | | |" | ||||
| echo "                                                                    | | | |" | ||||
| echo "Platform                    Compiler     ngIRCd     Date     Tester C M T R See" | ||||
| echo "--------------------------- ------------ ---------- -------- ------ - - - - ---" | ||||
| type printf >/dev/null 2>&1 | ||||
| echo "                                the executable works (\"runs\") as expected --+" | ||||
| echo "                                  tests run successfully (\"make check\") --+ |" | ||||
| echo "                                             ngIRCd compiles (\"make\") --+ | |" | ||||
| echo "                                                  ./configure works --+ | | |" | ||||
| echo "                                                                      | | | |" | ||||
| echo "Platform                    Compiler     ngIRCd     Date     Tester   C M T R *" | ||||
| echo "--------------------------- ------------ ---------- -------- -------- - - - - -" | ||||
| command -v printf >/dev/null 2>&1 | ||||
| if [ $? -eq 0 ]; then | ||||
| 	printf "%-27s %-12s %-10s %s %-6s %s %s %s %s%s" \ | ||||
| 	 "$PLATFORM" "$COMPILER" "$VERSION" "$DATE" "$USER" \ | ||||
| 	printf "%-27s %-12s %-10s %s %-8s %s %s %s %s%s\n" \ | ||||
| 	 "$PLATFORM" "$COMPILER" "$VERSION" "$DATE" "$LOGNAME" \ | ||||
| 	 "$C" "$M" "$T" "$R" "$COMMENT" | ||||
| else | ||||
| 	echo "$PLATFORM $COMPILER $VERSION $DATE $USER" \ | ||||
| 	echo "$PLATFORM $COMPILER $VERSION $DATE $LOGNAME" \ | ||||
| 	 "$C" "$M" "$T" "$R" "$COMMENT" | ||||
| fi | ||||
| echo; echo | ||||
| echo | ||||
|  | ||||
| double_check() { | ||||
| 	echo "Please double check that the ngIRCd daemon starts up, runs and handles IRC" | ||||
| 	echo "connections successfully!" | ||||
| } | ||||
|  | ||||
| if [ "$R_CHECK_Y" = "y" ]; then | ||||
| 	echo "WARNING: Some tests have been skipped!" | ||||
| 	double_check | ||||
| 	echo | ||||
| fi | ||||
| if [ "$R" = "?" ]; then | ||||
| 	echo "WARNING: The resulting binary passed simple tests, but the test suite failed!" | ||||
| 	double_check | ||||
| 	echo | ||||
| fi | ||||
|   | ||||
							
								
								
									
										1
									
								
								doc/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								doc/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1 +0,0 @@ | ||||
| sample-ngircd.conf | ||||
							
								
								
									
										16
									
								
								doc/Bopm.txt
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								doc/Bopm.txt
									
									
									
									
									
								
							| @@ -1,9 +1,8 @@ | ||||
|  | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                         (c)2001-2010 Alexander Barton, | ||||
|                     alex@barton.de, http://www.barton.de/ | ||||
|  | ||||
|                (c)2001-2014 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
| @@ -18,7 +17,7 @@ monitor, designed for use with hybrid-based ircds, although it can be used | ||||
| with slight modification on any server which has the ability to show connects | ||||
| to opers and that supports KLINEs." | ||||
|  | ||||
| And starting with Release 17, ngIRCd supports all required log messages that | ||||
| Starting with Release 17, ngIRCd supports all required log messages that | ||||
| BOPM requires to be useful. | ||||
|  | ||||
| II. Installation | ||||
| @@ -37,11 +36,12 @@ a) BOPM "IRC" section: | ||||
|   3) change "mode" to "+ci" or "+c". | ||||
|  | ||||
|   4) Set "connregex" to the following string, everything in one line(!): | ||||
|      "\\*\\*\\* Notice -- Client connecting: ([^ ]+) \\(([^@]+)@([^\\)]+)\\) \\[([0-9\\.]+)\\].*"; | ||||
|      and comment all the other "connregex" examples (prepend a "#" character). | ||||
|      "Client connecting: ([^ ]+) \\(([^@]+)@([^\\)]+)\\) \\[([0-9\\.]+)\\].*"; | ||||
|      and comment out all the other "connregex" examples (that is, prepend a | ||||
|      "#" character). | ||||
|  | ||||
|   5) Set "kline" to "KILL %n :Open proxy found on your host!"; for example, | ||||
|      and comment all the other "kline" examples. | ||||
|   5) Set "kline" to "GLINE *@%h :Open proxy found on your host!"; | ||||
|      and comment out all the other "kline" examples. | ||||
|  | ||||
| b) BOPM "scanner" section: | ||||
|  | ||||
|   | ||||
| @@ -13,7 +13,7 @@ This document lists and describes the "IRC capabilities" that ngIRCd supports | ||||
| and can be requested by a IRC/IRCv3 client that supports the "CAP" command. | ||||
|  | ||||
| ngIRCd implements the "IRC Client Capabilities Extension" as described here: | ||||
| <http://www.leeh.co.uk/draft-mitchell-irc-capabilities-02.html> | ||||
| <http://ircv3.net/specs/core/capability-negotiation-3.1.html> | ||||
|  | ||||
|  | ||||
| I. Supported Capabilities | ||||
| @@ -25,4 +25,4 @@ I. Supported Capabilities | ||||
|    server to send all possible prefixes which apply to a user in NAMES and | ||||
|    WHO output. | ||||
|  | ||||
|    See <http://ircv3.atheme.org/extensions/multi-prefix-3.1>. | ||||
|    See <http://ircv3.net/specs/extensions/multi-prefix-3.1.html>. | ||||
|   | ||||
							
								
								
									
										991
									
								
								doc/Commands.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										991
									
								
								doc/Commands.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,991 @@ | ||||
|  | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2013 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
|                               -- Commands.txt -- | ||||
|  | ||||
|  | ||||
| This file lists all commands available on ngIRCd. It is written in a format | ||||
| that is human readable as well as machine parseable and therefore can be used | ||||
| as "help text file" of the daemon. | ||||
|  | ||||
| In short, the daemon reads this file on startup and parses it as following | ||||
| when an user issues a "HELP <cmd>" command: | ||||
|  | ||||
|  1. Search the file for a line "- <cmd>", | ||||
|  2. Output all subsequent lines that start with a TAB (ASCII 9) character | ||||
|     to the client using NOTICE commands, treat lines containing a single "." | ||||
|     after the TAB as empty lines. | ||||
|  3. Break at the first line not starting with a TAB character. | ||||
|  | ||||
| This format allows to have information to each command stored in this file | ||||
| which will not be sent to an IRC user requesting help which enables us to | ||||
| have additional annotations stored here which further describe the origin, | ||||
| implementation details, or limits of the specific command which are not | ||||
| relevant to an end-user but administrators and developers. | ||||
|  | ||||
| A special "Intro" block is returned to the user when the HELP command is | ||||
| used without a command name: | ||||
|  | ||||
|  | ||||
| - Intro | ||||
| 	This is ngIRCd, a server software for Internet Relay Chat (IRC) | ||||
| 	networks. You can find more information about ngIRCd on its homepage: | ||||
| 		<http://ngircd.barton.de> | ||||
| 	. | ||||
| 	Use "HELP COMMANDS" to get a list of all available commands and | ||||
| 	"HELP <command-name>" to get help for a specific IRC command, for | ||||
| 	example "HELP quit" or "HELP privmsg". | ||||
|  | ||||
|  | ||||
| Connection Handling Commands | ||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| - CAP | ||||
| 	CAP LS | ||||
| 	CAP LIST | ||||
| 	CAP REQ <capabilities> | ||||
| 	CAP ACK <capabilities> | ||||
| 	CAP NAK <capabilities> | ||||
| 	CAP CLEAR | ||||
| 	CAP END | ||||
| 	. | ||||
| 	List, request, and clear "IRC Capabilities". | ||||
| 	. | ||||
| 	Using this command, an IRC client can request additional "IRC | ||||
| 	capabilities" during login or later on, which influences the | ||||
| 	communication between server and client. Normally, these commands | ||||
| 	aren't directly used by humans, but automatically by their client | ||||
| 	software. And please note that issuing such commands manually can | ||||
| 	irritate the client software used, because of the "non-standard" | ||||
| 	behavior of the server! | ||||
| 	. | ||||
| 	- CAP LS: list all available capabilities. | ||||
| 	- CAP LIST: list active capabilities of this connection. | ||||
| 	- CAP REQ: Request particular capabilities. | ||||
| 	- CAP ACK: Acknowledge a set of capabilities to be enabled/disabled. | ||||
| 	- CAP NAK: Reject a set of capabilities. | ||||
| 	- CAP CLEAR: Clear all set capabilities. | ||||
| 	- CAP END: Indicate end of capability negotiation during login, | ||||
| 	  ignored in an fully registered session. | ||||
|  | ||||
| 	Please note that the <capabilities> must be given in a single | ||||
| 	parameter but whitespace separated, therefore a command could look | ||||
| 	like this: "CAP REQ :capability1 capability2 capability3" for example. | ||||
|  | ||||
| 	References: | ||||
| 	 - <http://ircv3.net/specs/core/capability-negotiation-3.1.html> | ||||
| 	 - <http://ngircd.barton.de/doc/Capabilities.txt> | ||||
| 	 - doc/Capabilities.txt | ||||
|  | ||||
| - CHARCONV | ||||
| 	CHARCONV <client-charset> | ||||
| 	. | ||||
| 	Set client character set encoding to <client-charset>. | ||||
| 	. | ||||
| 	After receiving such a command, the server translates all message | ||||
| 	data received from the client using the set <client-charset> to the | ||||
| 	server encoding (UTF-8), and all message data which is to be sent to | ||||
| 	the client from the server encoding (UTF-8) to <client-charset>. | ||||
| 	. | ||||
| 	This enables older clients and clients using "strange" character sets | ||||
| 	to transparently participate in channels and direct messages to | ||||
| 	clients using UTF-8, which should be the default today. | ||||
|  | ||||
| 	References: | ||||
| 	 - IRC+, <http://ngircd.barton.de/doc/Protocol.txt> | ||||
| 	 - IRC+, doc/Protocol.txt | ||||
|  | ||||
| - NICK | ||||
| 	NICK <nickname> | ||||
| 	NICK <nickname> [<hops>] | ||||
| 	NICK <nickname> <hops> <username> <host> <servertoken> <usermodes> <realname> | ||||
| 	. | ||||
| 	Set or change the <nickname> of a client (first form) and register | ||||
| 	remote clients (second and third form; servers only). | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 1459, 4.1.2 "Nick message" (old client and server protocol) | ||||
| 	 - RFC 2812, 3.1.2 "Nick message" (client protocol) | ||||
| 	 - RFC 2813, 4.1.3 "Nick" (server protocol) | ||||
|  | ||||
| - PASS | ||||
| 	PASS <password> | ||||
| 	PASS <password> <version> <flags> [<options>] | ||||
| 	. | ||||
| 	Set a connection <password>. This command must be the first command | ||||
| 	sent to the server, even before the NICK/USER or SERVER commands. | ||||
| 	. | ||||
| 	The first form is used by user sessions or (old) RFC 1459 servers, | ||||
| 	the second form is used by RFC 2812 or IRC+ compliant servers and | ||||
| 	enables the server to indicate its version and supported protocol | ||||
| 	features. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 1459, 4.1.1 "Password message" (old client and server protocol) | ||||
| 	 - RFC 2812, 3.1.1 "Password message" (client protocol) | ||||
| 	 - RFC 2813, 4.1.1 "Password message" (server protocol) | ||||
| 	 - IRC+, <http://ngircd.barton.de/doc/Protocol.txt> | ||||
| 	 - IRC+, doc/Protocol.txt | ||||
|  | ||||
| - PING | ||||
| 	PING <token> [<target>] | ||||
| 	. | ||||
| 	Tests the presence of a connection to a client or server. | ||||
| 	. | ||||
| 	If no <target> has been given, the local server is used. User clients | ||||
| 	can only use other servers as <target>, no user clients. | ||||
| 	. | ||||
| 	A PING message results in a PONG reply containing the <token>, which | ||||
| 	can be arbitrary text. | ||||
|  | ||||
| 	Please note: | ||||
| 	The RFCs state that the <token> parameter is used to specify the | ||||
| 	origin of the PING command when forwarded in the network, but this | ||||
| 	is not the case: the sender is specified using the prefix as usual, | ||||
| 	and the parameter is used to identify the PONG reply in practice. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.7.2 "Ping message" | ||||
|  | ||||
| - PONG | ||||
| 	PONG <target> [<token>] | ||||
| 	. | ||||
| 	Reply to a "PING" command, indicate that the connection is alive. | ||||
| 	. | ||||
| 	The <token> is the arbitrary text received in the "PING" command and | ||||
| 	can be used to identify the correct PONG sent as answer. | ||||
| 	. | ||||
| 	When the "PONG" command is received from a user session, the <target> | ||||
| 	parameter is ignored; otherwise the PONG is forwarded to this client. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.7.3 "Pong message" | ||||
|  | ||||
| - QUIT | ||||
| 	QUIT [<quit-message>] | ||||
| 	. | ||||
| 	Terminate a user session. | ||||
| 	. | ||||
| 	When received from a user, the server acknowledges this by sending | ||||
| 	an "ERROR" message back to the client and terminates the connection. | ||||
| 	. | ||||
| 	When a <quit-message> has been given, it is sent to all the channels | ||||
| 	that the client is a member of when leaving. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.1.7 "Quit" | ||||
| 	 - RFC 2813, 4.1.5 "Quit" | ||||
|  | ||||
| - USER | ||||
| 	USER <username> <hostname> <unused> <realname> | ||||
| 	. | ||||
| 	Register (and authenticate) a new user session with a short <username> | ||||
| 	and a human-readable <realname>. | ||||
| 	. | ||||
| 	The parameter <hostname> is only used when received by an other server | ||||
| 	and ignored otherwise; and the parameter <unused> is always ignored. | ||||
| 	But both parameters are required on each invocation by the protocol | ||||
| 	and can be set to arbitrary characters/text when not used. | ||||
| 	. | ||||
| 	If <username> contains an "@" character, the full <username> is used | ||||
| 	for authentication, but only the first part up to this character is | ||||
| 	set as "user name" for this session. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.1.3 "User message" | ||||
|  | ||||
| - WEBIRC | ||||
| 	WEBIRC <password> <username> <hostname> <ip-address> | ||||
| 	. | ||||
| 	Allow Web-to-IRC gateway software (for example) to set the correct | ||||
| 	user name and host name of users instead of their own. | ||||
| 	. | ||||
| 	It must be the very first command sent to the server, even before | ||||
| 	USER and NICK commands! | ||||
| 	. | ||||
| 	The <password> must be set in the server configuration file to prevent | ||||
| 	unauthorized clients to fake their identity; it is an arbitrary string. | ||||
|  | ||||
| 	References: | ||||
| 	 - IRC+, <http://ngircd.barton.de/doc/Protocol.txt> | ||||
| 	 - IRC+, doc/Protocol.txt | ||||
|  | ||||
|  | ||||
| General Commands | ||||
| ~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| - AWAY | ||||
| 	AWAY [<message>] | ||||
| 	. | ||||
| 	Provides the server with a message to automatically send in reply to a | ||||
| 	PRIVMSG directed at the user, but not to a channel they are on. | ||||
| 	. | ||||
| 	If <message> is omitted, the away status is removed. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 4.1 "Away" | ||||
|  | ||||
| - HELP | ||||
| 	HELP [<command>] | ||||
| 	. | ||||
| 	Show help information for a specific IRC <command>. The <command> name | ||||
| 	is case-insensitive. | ||||
| 	. | ||||
| 	Use the command "HELP Commands" to get a list of all available commands. | ||||
|  | ||||
| 	The HELP command isn't specified by any RFC but implemented by most | ||||
| 	daemons. If no help text could be read in, ngIRCd outputs a list of all | ||||
| 	implemented commands when receiving a plain "HELP" command as well as | ||||
| 	on "HELP Commands". | ||||
|  | ||||
| 	ngIRCd replies using "NOTICE" commands like ircd 2.10/2.11; other | ||||
| 	implementations are using numerics 704, 705, and 706. | ||||
|  | ||||
| - MODE | ||||
| 	MODE <nickname> [{+|-}<mode>[<mode>] [{+|-}<mode>[<mode>] [...]]] | ||||
| 	MODE <channel> [{+|-}<mode>[<mode>] [<arg> [<arg> [...]]] [{+|-}<mode>[<mode>] [<arg> [<arg> [...]]] [...]]] | ||||
| 	. | ||||
| 	Set and get user and channel modes. | ||||
| 	. | ||||
| 	When no mode parameters are given, the currently set user or channel | ||||
| 	modes are returned. Otherwise the modes are adjusted accordingly | ||||
| 	and the changes will be reported back to the client. | ||||
| 	. | ||||
| 	All user and channel "modes" are indicated by single case-sensitive | ||||
| 	characters. | ||||
| 	. | ||||
| 	Please note that a user can only get and set his own modes, and not | ||||
| 	all user "levels" are allowed to change all channel modes ... | ||||
| 	. | ||||
| 	The mode parameters can become quite complex, especially when dealing | ||||
| 	with channel modes that require additional arguments: | ||||
| 	. | ||||
| 	  {+|-}<mode(s}>  -- set or unset one or more modes. | ||||
| 	  +<mode(s)> -<mode(s)>  -- set some modes and unset others. | ||||
| 	  +<modes> <arg1> <arg2>  -- set (at least) two modes with arguments. | ||||
| 	. | ||||
| 	Some examples: | ||||
| 	. | ||||
| 	  MODE nick +i  -- set user to "invisible". | ||||
| 	  MODE #chan +tn  -- set "topic lock" and "no external messages". | ||||
| 	  MODE #chan -t +l 50  -- remove "topic lock", set "user limit" to 50. | ||||
| 	  MODE #chan +ov nick1 nick2  -- set "channel op" and "voice" mode | ||||
| 	                                 to nick1 and nick2 in channel #chan. | ||||
| 	. | ||||
| 	A complete list of all modes supported by ngIRCd can be found online | ||||
| 	here: <http://ngircd.barton.de/doc/Modes.txt>. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2811, 4. "Channel Modes" | ||||
| 	 - RFC 2812, 3.1.5 "User mode message" | ||||
| 	 - RFC 2812, 3.2.3 "Channel mode message" | ||||
| 	 - <http://ngircd.barton.de/doc/Modes.txt> | ||||
| 	 - doc/Modes.txt | ||||
|  | ||||
| - NOTICE | ||||
| 	NOTICE <target>[,<target>[,...]] <message> | ||||
| 	. | ||||
| 	Send a <message> to a given <target>, which can be a user or a | ||||
| 	channel, but DON'T report any error. | ||||
| 	. | ||||
| 	The "NOTICE" command exactly behaves like the "PRIVMSG" command, but | ||||
| 	doesn't report any errors it encounters (like an unknown <target>). | ||||
| 	Please see the help text of the "PRIVMSG" command for a detailed | ||||
| 	description of the parameters! | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 2.3.1 "Message format in Augmented BNF" | ||||
| 	 - RFC 2812, 3.3 "Sending messages" | ||||
| 	 - RFC 2812, 3.3.2 "Notice" | ||||
|  | ||||
| - PRIVMSG | ||||
| 	PRIVMSG <target>[,<target>[,...]] <message> | ||||
| 	. | ||||
| 	Send a <message> to a given <target>, which can be a user or a | ||||
| 	channel, and report all errors. | ||||
| 	. | ||||
| 	The <target> must follow one of these syntax variants: | ||||
| 	. | ||||
| 	 - <nickname> | ||||
| 	 - <channel> | ||||
| 	 - <user>[%<host>]@<server> | ||||
| 	 - <user>%<host> | ||||
| 	 - <nickname>!<user>@<host> | ||||
| 	. | ||||
| 	If the <target> is a user, a private message is sent directly to this | ||||
| 	user; if it resolves to a channel name, a public message is sent | ||||
| 	to all the members of that channel. | ||||
| 	. | ||||
| 	In addition, IRC Ops can use these two forms to specify the <target>: | ||||
| 	. | ||||
| 	 - #<hostmask> | ||||
| 	 - $<servermask> | ||||
| 	. | ||||
| 	The <mask> can contain the wildcard characters "*" and "?", but must | ||||
| 	contain at least one dot (".") and no wildcard after the last one. | ||||
| 	Then, the <message> is sent to all users matching this <mask>. | ||||
| 	. | ||||
| 	All warnings and errors are reported back to the initiator using | ||||
| 	numeric status codes, which is the only difference to the "NOTICE" | ||||
| 	command, which doesn't report back any errors or warnings at all. | ||||
| 	. | ||||
| 	Please note that clients often use "MSG" as an alias to PRIVMSG, and | ||||
| 	a command "QUERY <nick> [<message>]" to initiate private chats. Both | ||||
| 	are command extensions of the client and never sent to the server. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 2.3.1 "Message format in Augmented BNF" | ||||
| 	 - RFC 2812, 3.3 "Sending messages" | ||||
| 	 - RFC 2812, 3.3.1 "Private messages" | ||||
|  | ||||
| Status and Informational Commands | ||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| - ADMIN | ||||
| 	ADMIN [<target>] | ||||
| 	. | ||||
| 	Show administrative information about an IRC server in the network. | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to | ||||
| 	a specific server, or a mask matching a server name in the network. | ||||
| 	The server of the current connection is used when <target> is omitted. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.4.9 "Admin command" | ||||
|  | ||||
| - INFO | ||||
| 	INFO [<target>] | ||||
| 	. | ||||
| 	Show the version, birth & online time of an IRC server in the network. | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to | ||||
| 	a specific server, or a mask matching a server name in the network. | ||||
| 	The server of the current connection is used when <target> is omitted. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.4.10 "Info command" | ||||
|  | ||||
| - ISON | ||||
| 	ISON <nickname> [<nickname> [...]] | ||||
| 	. | ||||
| 	Query online status of a list of nicknames. The server replies with | ||||
| 	a list only containing nicknames actually connected to a server in | ||||
| 	the network. If no nicknames of the given list are online, an empty | ||||
| 	list is returned to the client requesting the information. | ||||
|  | ||||
| 	Please note that "all" IRC daemons even parse separate nicknames in | ||||
| 	a single parameter (like ":nick1 nick2"), and therefore ngIRCd | ||||
| 	implements this behavior, too. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 4.9 "Ison message" | ||||
|  | ||||
| - LINKS | ||||
| 	LINKS [[<target>] [<mask>] | ||||
| 	. | ||||
| 	List all servers currently registered in the network matching <mask>, | ||||
| 	or all servers if <mask> has been omitted, as seen by the server | ||||
| 	specified by <target> or the local server when <target> is omitted. | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to | ||||
| 	a specific server, or a mask matching a server name in the network. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.4.5 "Links message" | ||||
|  | ||||
| - LUSERS | ||||
| 	LUSERS [<mask> [<target>]] | ||||
| 	. | ||||
| 	Return statistics about the number of clients (users, servers, | ||||
| 	services, ...) in the network as seen by the server <target>. | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to | ||||
| 	a specific server, or a mask matching a server name in the network. | ||||
| 	The server of the current connection is used when <target> is omitted. | ||||
|  | ||||
| 	Please note that ngIRCd ignores the <mask> parameter entirely: it | ||||
| 	is not possible to get information for a part of the network only. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.4.2 "Lusers message" | ||||
|  | ||||
| - MOTD | ||||
| 	MOTD [<target>] | ||||
| 	. | ||||
| 	Show the "Message of the Day" (MOTD) of an IRC server in the network. | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to | ||||
| 	a specific server, or a mask matching a server name in the network. | ||||
| 	The server of the current connection is used when <target> is omitted. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.4.1 "Motd message" | ||||
|  | ||||
| - NAMES | ||||
| 	NAMES [<channel>[,<channel>[,...]] [<target>]] | ||||
| 	. | ||||
| 	Show the list of users that are members of a particular <channel> | ||||
| 	(and that are visible for the client requesting this information) as | ||||
| 	seen by the server <target>. More than one <channel> can be given | ||||
| 	separated by "," (but not whitespaces!). | ||||
| 	. | ||||
| 	If <channel> has been omitted, all visible users are shown, grouped | ||||
| 	by channel name, and all visible users not being members of at least | ||||
| 	one channel are shown as members of the pseudo channel "*". | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to | ||||
| 	a specific server, or a mask matching a server name in the network. | ||||
| 	The server of the current connection is used when <target> is omitted. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.2.5 "Names message" | ||||
|  | ||||
| - STATS | ||||
| 	STATS [<query> [<target>]] | ||||
| 	. | ||||
| 	Show statistics and other information of type <query> of a particular | ||||
| 	IRC server in the network. | ||||
| 	. | ||||
| 	The following <query> types are supported (case-insensitive where | ||||
| 	applicable): | ||||
| 	. | ||||
| 	 - g  Network-wide bans ("G-Lines"). | ||||
| 	 - k  Server-local bans ("K-Lines"). | ||||
| 	 - L  Link status (servers and user links). | ||||
| 	 - l  Link status (servers and own link). | ||||
| 	 - m  Command usage count. | ||||
| 	 - u  Server uptime. | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to | ||||
| 	a specific server, or a mask matching a server name in the network. | ||||
| 	The server of the current connection is used when <target> is omitted. | ||||
| 	. | ||||
| 	To use "STATS L" the user must be an IRC Operator. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.4.4 "Stats message" | ||||
|  | ||||
| - TIME | ||||
| 	TIME [<target>] | ||||
| 	. | ||||
| 	Show the local time of an IRC server in the network. | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to | ||||
| 	a specific server, or a mask matching a server name in the network. | ||||
| 	The server of the current connection is used when <target> is omitted. | ||||
|  | ||||
| 	References | ||||
| 	 - RFC 2812, 3.4.6 "Time message" | ||||
|  | ||||
| - TRACE | ||||
| 	TRACE [<target>] | ||||
| 	. | ||||
| 	Find the route to a specific server and send information about its | ||||
| 	peers. Each server that processes this command reports back to the | ||||
| 	sender about it: the replies from pass-through servers form a chain | ||||
| 	which shows the route to the destination. | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to | ||||
| 	a specific server, or a mask matching a server name in the network. | ||||
| 	The server of the current connection is used when <target> is omitted. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.4.8 "Trace message" | ||||
|  | ||||
| - USERHOST | ||||
| 	USERHOST <nickname> [<nickname> [...]] | ||||
| 	. | ||||
| 	Show flags and the hostmasks (<user>@<host>) of the <nickname>s, | ||||
| 	separated by spaces. The following flags are used: | ||||
| 	. | ||||
| 	 - "-"  The client is "away" (the mode "+a" is set on this client). | ||||
| 	 - "+"  Client seems to be available, at least it isn't marked "away". | ||||
| 	 - "*"  The client is an IRC operator (the mode "+o" is set). | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 4.8 "Userhost message" | ||||
|  | ||||
| - VERSION | ||||
| 	VERSION [<target>] | ||||
| 	. | ||||
| 	Show version information about a particular IRC server in the network. | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to | ||||
| 	a specific server, or a mask matching a server name in the network. | ||||
| 	The server of the current connection is used when <target> is omitted. | ||||
| 	. | ||||
| 	Please note: in normal operation, the version number ends in a dot | ||||
| 	(".", for example "ngIRCd-20.1."). If it ends in ".1" (for example | ||||
| 	"ngIRCd-20.1.1", same version than before!), the server is running in | ||||
| 	debug-mode; and if it ends in ".2", the "network sniffer" is active! | ||||
| 	Keep your privacy in mind ... | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.4.3 "Version message" | ||||
|  | ||||
| - WHO | ||||
| 	WHO [<mask> ["o"]] | ||||
| 	. | ||||
| 	Show a list of users who match the <mask>, or all visible users when | ||||
| 	the <mask> has been omitted. (Special case: the <mask> "0" is | ||||
| 	equivalent to "*") | ||||
| 	. | ||||
| 	If the flag "o" is given, the server will only return information about | ||||
| 	IRC Operators. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.6.1 "Who query" | ||||
|  | ||||
| - WHOIS | ||||
| 	WHOIS [<target>] <mask>[,<mask>[,...]] | ||||
| 	. | ||||
| 	Query information about users matching the <mask> parameter(s) as seen | ||||
| 	by the server <target>; up to 3 <masks> are supported. | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to a | ||||
| 	specific server, or a mask matching a server name in the network. The | ||||
| 	server of the current connection is used when <target> is omitted. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.6.2 "Whois query" | ||||
|  | ||||
| - WHOWAS | ||||
| 	WHOWAS <nickname>[,<nickname>[,...]] [<count> [<target>]] | ||||
| 	. | ||||
| 	Query information about nicknames no longer in use in the network, | ||||
| 	either because of nickname changes or disconnects. The history is | ||||
| 	searched backwards, returning the most recent entry first. If there | ||||
| 	are multiple entries, up to <count> entries will be shown (or all of | ||||
| 	them, if no <count> has been given). | ||||
| 	. | ||||
| 	<target> can be a server name, the nickname of a client connected to a | ||||
| 	specific server, or a mask matching a server name in the network. The | ||||
| 	server of the current connection is used when <target> is omitted. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.6.3 "Whowas" | ||||
|  | ||||
|  | ||||
| Channel Commands | ||||
| ~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| - INVITE | ||||
| 	INVITE <nickname> <channel> | ||||
| 	. | ||||
| 	Invite <nickname> to join channel <channel>. | ||||
| 	. | ||||
| 	<channel> does not have to exist, but if it does, only members of the | ||||
| 	channel are allowed to invite other users. If the channel mode "+i" | ||||
| 	is set, only channel "half-ops" (and above) may invite other clients, | ||||
| 	and if channel mode "+V" is set, nobody can invite other users. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.2.7 "Invite message" | ||||
|  | ||||
| - JOIN | ||||
| 	JOIN {<channel>[,<channel>[,...]] [<key>[,<key>[,...]]] | 0} | ||||
| 	. | ||||
| 	Makes the client join the <channel> (comma-separated list), specifying | ||||
| 	the channel keys ("passwords"). A <channel-key> is only needed if the | ||||
| 	<channel> has the mode "+k" set. | ||||
| 	. | ||||
| 	If the channel(s) do not exist, then they will be created. | ||||
| 	. | ||||
| 	Using "JOIN 0" parts all channels at once. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.2.1 "Join message" (client protocol) | ||||
| 	 - RFC 2813, 4.2.1 "Join message" (server protocol) | ||||
|  | ||||
| - KICK | ||||
| 	KICK <channel>[,<channel>[,...]] <nickname>[,<nickname>[,...]] [<reason>] | ||||
| 	. | ||||
| 	Remove users(s) with <nickname>(s) from <channel>(s). | ||||
| 	. | ||||
| 	There must be either exactly one <channel> parameter and multiple | ||||
| 	<nickname> parameters, or as many <channel> parameters as there are | ||||
| 	<nickname> parameters. The <reason> is shown to the users being | ||||
| 	kicked, and the nickname of the current user is used when <reason> | ||||
| 	is omitted. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.2.8 "Kick command" | ||||
|  | ||||
| - LIST | ||||
| 	LIST [<channel>[,<channel>[,...]] [<server>]] | ||||
| 	. | ||||
| 	List all visible <channels> (comma-separated list). | ||||
| 	. | ||||
| 	If <server> is given, the command will be forwarded to <server> for | ||||
| 	evaluation. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.2.6 "List message" | ||||
|  | ||||
| - PART | ||||
| 	PART <channel>[,<channel>[,...]] [<part-message>] | ||||
| 	. | ||||
| 	Leave <channel> (comma-separated list), optionally with sending a | ||||
| 	<part-message> to all the other channel members. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.2.2 "Part message" | ||||
|  | ||||
| - TOPIC | ||||
| 	TOPIC <channel> [<topic>] | ||||
| 	. | ||||
| 	Change or view the topic of a channel. | ||||
| 	. | ||||
| 	The topic for channel <channel> is returned if there is no <topic> | ||||
| 	given. If the <topic> parameter is present, the topic for that | ||||
| 	channel will be changed, if this action is allowed for the user | ||||
| 	requesting it. If the <topic> parameter is an empty string, the | ||||
| 	topic for that channel will be removed. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.2.4 "Topic message" | ||||
|  | ||||
|  | ||||
| Administrative Commands | ||||
| ~~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| - CONNECT | ||||
| 	CONNECT <server> [<port> [<remote-server> [<my-pwd> <peer-pwd>]]] | ||||
| 	. | ||||
| 	Instructs the current server, or <remote-server> if specified, | ||||
| 	to connect to the server named <server>, which must be configured | ||||
| 	in the server configuration file. | ||||
| 	. | ||||
| 	To use this command, the user must be an IRC Operator. To establish | ||||
| 	a connection on a <remote-server>, you must have remote IRC operator | ||||
| 	privileges. | ||||
| 	. | ||||
| 	If <port>, <my-pwd> and <peer-pwd> are given, these values override | ||||
| 	the ones specified in the server configuration file. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.4.7 "Connect message" | ||||
|  | ||||
| - DIE | ||||
| 	DIE [<message>] | ||||
| 	. | ||||
| 	Instructs the server to shut down. | ||||
| 	. | ||||
| 	The optional (and non-standard) <message> text is sent to each client | ||||
| 	connected to this server before all connections are closed. | ||||
| 	. | ||||
| 	To use this command, the user must be an IRC Operator. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 4.3 "Die message" | ||||
|  | ||||
| - DISCONNECT | ||||
| 	DISCONNECT <server> | ||||
| 	. | ||||
| 	Disconnect and disable a locally linked server. | ||||
| 	. | ||||
| 	To use this command, the user must be an IRC Operator. | ||||
|  | ||||
| 	References: | ||||
| 	 - This command is not specified in the IRC RFCs, it is an extension | ||||
| 	   of ngIRCd. | ||||
|  | ||||
| - GLINE | ||||
| 	GLINE <nick!user@hostmask> [<timeout> :<reason>] | ||||
| 	. | ||||
| 	This command provides timed G-Lines (network-wide bans). | ||||
| 	. | ||||
| 	If a client matches a G-Line, it cannot connect to any server on | ||||
| 	the IRC network for <timeout> seconds. When <timeout> is 0, it make | ||||
| 	the G-Line permanent. | ||||
| 	. | ||||
| 	If no <timeout> and no <reason> is given, the G-Line is removed. | ||||
| 	. | ||||
| 	To use this command, the user must be an IRC Operator. | ||||
| 	. | ||||
| 	"STATS g" can be used to list all currently active G-Lines. | ||||
|  | ||||
| 	References: | ||||
| 	 - This command is not specified in the IRC RFCs, it is an extension | ||||
| 	   of ngIRCd. | ||||
|  | ||||
| - KILL | ||||
| 	KILL <nickname> <reason> | ||||
| 	. | ||||
| 	Forcibly remove all users with a given <nickname> from the IRC | ||||
| 	network and display the given <reason> to them. | ||||
| 	. | ||||
| 	This command is used internally between servers, too, for example | ||||
| 	to disconnect duplicate <nickname>'s after a "net split". | ||||
| 	. | ||||
| 	To use this command, the user must be an IRC Operator. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.7.1 "Kill message" | ||||
|  | ||||
| - KLINE | ||||
| 	KLINE <nick!user@hostmask> [<timeout> :<reason>] | ||||
| 	. | ||||
| 	This command provides timed K-Lines (server-local bans). | ||||
| 	. | ||||
| 	If a client matches a K-Line, it cannot connect to this server for | ||||
| 	<timeout> seconds. When <timeout> is 0, it makes the K-Line permanent. | ||||
| 	. | ||||
| 	If no <timeout> and no <reason> is given, the K-Line is removed. | ||||
| 	. | ||||
| 	To use this command, the user must be an IRC Operator. | ||||
| 	. | ||||
| 	"STATS k" can be used to list all currently active K-Lines. | ||||
|  | ||||
| 	References: | ||||
| 	 - This command is not specified in the IRC RFCs, it is an extension | ||||
| 	   of ngIRCd. | ||||
|  | ||||
| - OPER | ||||
| 	OPER <name> <password> | ||||
| 	. | ||||
| 	Authenticates a user named <name> as an IRC operator on the current | ||||
| 	server/network. | ||||
| 	. | ||||
| 	This operator <name> must be configured in the server configuration. | ||||
| 	. | ||||
| 	Please note that <name> is NOT related to a nickname at all! | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.1.4 "Oper message" | ||||
|  | ||||
| - REHASH | ||||
| 	REHASH | ||||
| 	. | ||||
| 	Causes the server to re-read and re-process its configuration file(s). | ||||
| 	. | ||||
| 	While rehashing, no new connections are accepted, but all already | ||||
| 	established connections stay connected. | ||||
| 	. | ||||
| 	To use this command, the user must be an IRC Operator. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 4.2 "Rehash message" | ||||
|  | ||||
| - RESTART | ||||
| 	RESTART | ||||
| 	. | ||||
| 	Restart the server. | ||||
| 	. | ||||
| 	While restarting, all connections are reset and no new connections | ||||
| 	are accepted. | ||||
| 	. | ||||
| 	To use this command, the user must be an IRC Operator. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 4.4 "Restart message" | ||||
|  | ||||
| - WALLOPS | ||||
| 	WALLOPS <message> | ||||
| 	. | ||||
| 	Sends <message> to all users with user mode "+w". | ||||
| 	. | ||||
| 	To use this command, the user must be an IRC Operator. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 4.7 "Operwall message" | ||||
|  | ||||
| IRC Service Commands | ||||
| ~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| - SERVICE | ||||
| 	SERVICE <name> <reserved1> <distribution> <type> <reserved2> <info> | ||||
| 	SERVICE <name> <servertoken> <distribution> {<type>|+<modes>} <hops> <info> | ||||
| 	. | ||||
| 	Register a new service in the network. | ||||
| 	. | ||||
| 	The first form is used by directly linked services and isn't supported | ||||
| 	by ngIRCd at the moment. The second form announces services connected | ||||
| 	to remote "pseudo-servers" ("services hubs"). | ||||
| 	. | ||||
| 	The <distribution> and <type> parameters are ignored by ngIRCd. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.1.6 "Service message" | ||||
| 	 - RFC 2813, 4.1.4 "Service message" | ||||
|  | ||||
| - SERVLIST | ||||
| 	SERVLIST [<mask> [<type>]] | ||||
| 	. | ||||
| 	List all IRC services currently registered in the network. | ||||
| 	. | ||||
| 	The optional <mask> and <type> parameters can be used to limit the | ||||
| 	listing to services matching the <mask> and that are of type <type>. | ||||
| 	. | ||||
| 	Please note that ngIRCd doesn't use any service types at the moment | ||||
| 	and therefore all services are of type "0". | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.5.1 "Servlist message" | ||||
|  | ||||
| - SQUERY | ||||
| 	SQUERY <target>[,<target>[,...]] <message> | ||||
| 	. | ||||
| 	Send a <message> to a given <target> IRC service, and report all | ||||
| 	errors. | ||||
| 	. | ||||
| 	The "SQUERY" command exactly behaves like the "PRIVMSG" command, but | ||||
| 	enforces that the <target> of the <message> is an IRC service. | ||||
| 	Please see the help text of the "PRIVMSG" command for a detailed | ||||
| 	description of the parameters! | ||||
| 	. | ||||
| 	If a user wants to interact with IRC services, he should use "SQUERY" | ||||
| 	instead of "PRIVMSG" or "NOTICE": only "SQUERY makes sure that no | ||||
| 	regular user, which uses the nickname of an IRC service, receives | ||||
| 	the command in error, for example during a "net split"! | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 2.3.1 "Message format in Augmented BNF" | ||||
| 	 - RFC 2812, 3.3 "Sending messages" | ||||
| 	 - RFC 2812, 3.3.2 "Notice" | ||||
|  | ||||
| - SVSNICK | ||||
| 	SVSNICK <oldnick> <newnick> | ||||
| 	. | ||||
| 	Forcefully change foreign user nicknames. This command is allowed | ||||
| 	for servers only. | ||||
| 	. | ||||
| 	The "SVSNICK" command is forwarded to the server to which the user | ||||
| 	with nickname <oldnick> is connected to, which in turn generates a | ||||
| 	regular "NICK" command that then is sent to the client, so no special | ||||
| 	support in the client software is required. | ||||
|  | ||||
| 	References: | ||||
| 	 - ngIRCd GIT commit e3f300d3231f | ||||
|  | ||||
|  | ||||
| Server Protocol Commands | ||||
| ~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| - CHANINFO | ||||
| 	CHANINFO <channel> +<modes> [[<key> <limit>] <topic>] | ||||
| 	. | ||||
| 	CHANINFO is used by servers to inform each other about a channel: | ||||
| 	its modes, channel key, user limits and its topic. | ||||
| 	. | ||||
| 	The CHANINFO command is allowed on server-links only. | ||||
|  | ||||
| 	References: | ||||
| 	 - IRC+, <http://ngircd.barton.de/doc/Protocol.txt> | ||||
| 	 - IRC+, doc/Protocol.txt | ||||
|  | ||||
| - ERROR | ||||
| 	ERROR [<message> [<> [...]]] | ||||
| 	. | ||||
| 	Inform a client or a server about an error condition. The first  | ||||
| 	parameter, if given, is logged by the server receiving the message, | ||||
| 	all other parameters are silently ignored. | ||||
| 	. | ||||
| 	This command is silently ignored on non-server and non-service links | ||||
| 	and shouldn't be used by regular IRC clients. | ||||
| 	. | ||||
| 	The ERROR message is also sent before terminating a regular client | ||||
| 	connection. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.7.4 "Error message" | ||||
|  | ||||
| - METADATA | ||||
| 	METADATA <target> <key> <value> | ||||
| 	. | ||||
| 	The METADATA command is used on server-links to update "metadata" | ||||
| 	information of clients, like the hostname, the info text ("real name"), | ||||
| 	or the user name. | ||||
| 	. | ||||
| 	The METADATA command is allowed on server-links only. | ||||
|  | ||||
| 	References: | ||||
| 	 - IRC+, <http://ngircd.barton.de/doc/Protocol.txt> | ||||
| 	 - IRC+, doc/Protocol.txt | ||||
|  | ||||
| - NJOIN | ||||
| 	NJOIN <channel> [<mode>]<nick>[,[<mode>]<nick>[,...]] | ||||
| 	. | ||||
| 	The NJOIN command is used on server-links to add users with <nick> | ||||
| 	and <mode> to a <channel> while peering. | ||||
| 	. | ||||
| 	The NJOIN command is allowed on server-links only. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2813, 4.2.2 "Njoin message" | ||||
|  | ||||
| - SERVER | ||||
| 	SERVER <servername> <info> | ||||
| 	SERVER <servername> <hopcount> <info> | ||||
| 	SERVER <servername> <hopcount> <token> <info> | ||||
| 	. | ||||
| 	The first form registers the local connection as a new server in the | ||||
| 	network, the second (RFC 1459) and third (RFC 2812) form announce a | ||||
| 	new remote server in the network. | ||||
| 	. | ||||
| 	The SERVER command is allowed on unregistered or server-links only. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 1459, 4.1.4 "Server message" | ||||
| 	 - RFC 2813, 4.1.2 "Server message" | ||||
|  | ||||
| - SQUIT | ||||
| 	SQUIT <server> <comment> | ||||
| 	. | ||||
| 	Disconnects an IRC Server from the network. | ||||
| 	. | ||||
| 	This command is used on server-links, but can be used by IRC Operators | ||||
| 	to forcefully disconnect servers from the network, too. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 3.1.8 "Squit" | ||||
| 	 - RFC 2813, 4.1.6 "Server quit message" | ||||
|  | ||||
| Dummy Commands | ||||
| ~~~~~~~~~~~~~~ | ||||
|  | ||||
| - SUMMON | ||||
| 	SUMMON <user> [<target> [<channel>]] | ||||
| 	. | ||||
| 	This command was intended to call people into IRC who are directly | ||||
| 	connected to the terminal console of the IRC server -- but is | ||||
| 	deprecated today. Therefore ngIRCd doesn't really implement this | ||||
| 	command and always returns an error message, regardless of the | ||||
| 	parameters given. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 4.5 "Summon message" | ||||
|  | ||||
| - USERS | ||||
| 	USERS [<target>] | ||||
| 	. | ||||
| 	This command was intended to list users directly logged in into the | ||||
| 	console of the IRC server -- but is deprecated today. Therefore ngIRCd | ||||
| 	doesn't really implement this command and always returns an error | ||||
| 	message, regardless of the parameters given. | ||||
|  | ||||
| 	References: | ||||
| 	 - RFC 2812, 4.6 "Users" | ||||
|  | ||||
| - GET | ||||
| 	GET [...] | ||||
| 	. | ||||
| 	Fake HTTP GET command. When received, the connection is shut down | ||||
| 	immediately again to protect against crazy web browsers ... | ||||
|  | ||||
| 	References: | ||||
| 	 - ngIRCd GIT commit 33e8c2480649 | ||||
|  | ||||
| - POST | ||||
| 	POST [...] | ||||
| 	. | ||||
| 	Fake HTTP POST command. When received, the connection is shut down | ||||
| 	immediately again to protect against crazy web browsers ... | ||||
|  | ||||
| 	References: | ||||
| 	 - ngIRCd GIT commit 33e8c2480649 | ||||
| @@ -2,7 +2,7 @@ | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2011 Alexander Barton and Contributors. | ||||
|                (c)2001-2015 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
| @@ -15,7 +15,7 @@ get an idea of how to do it the best :-) | ||||
|  - Use GIT | ||||
|  | ||||
|    The source code of ngIRCd is maintained using GIT, see doc/GIT.txt. So if | ||||
|    remotely possible, use GIT for your work, too. It makes your and our lifes | ||||
|    remotely possible, use GIT for your work, too. It makes your and our lives | ||||
|    much easier ;-) | ||||
|  | ||||
|  - Don't forget to include documentation | ||||
| @@ -52,3 +52,9 @@ get an idea of how to do it the best :-) | ||||
|  | ||||
|    And this is open source, your work must not be 100% finished and perfect, | ||||
|    work in progress is interesting, too: "release early, release often"! | ||||
|  | ||||
| - Use GitHub to create "Pull Requests" | ||||
|  | ||||
|   ngIRCd is hosted on GitHub (<https://github.com/ngircd>), so please use the | ||||
|   tools available there and open issues (comment!) and create pull requests! | ||||
|   See <https://help.github.com/articles/using-pull-requests/> for details. | ||||
|   | ||||
							
								
								
									
										13
									
								
								doc/FAQ.txt
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								doc/FAQ.txt
									
									
									
									
									
								
							| @@ -89,16 +89,21 @@ A: You need to set 'OperCanUseMode = yes' in ngircd.conf, then IRC operators | ||||
|    can use the MODE command for changing modes even when they are not joined | ||||
|    to the specific channel. | ||||
|  | ||||
| Q: How can I "auto-op" users in channels? | ||||
| A: ngIRCd can't do this: you would have to use some "IRC Services", like | ||||
|    Atheme (<http://atheme.net/atheme.html>) or Anope (<http://www.anope.org>). | ||||
|    See "doc/Services.txt" for setup instructions. | ||||
|  | ||||
|  | ||||
| IV. Bugs!? | ||||
| ~~~~~~~~~~ | ||||
|  | ||||
| Q: Is there a list of known bugs and desired feature enhancements? | ||||
| A: Yes. Have a look at the bug tracking system (Bugzilla) for ngIRCd located | ||||
|    at <http://ngircd.barton.de/bugzilla/index.cgi>. There you can file bug | ||||
| A: Yes. Have a look at the bug tracking system (GitHub issues) for ngIRCd located | ||||
|    at <https://github.com/ngircd/ngircd/issues>. There you can file bug | ||||
|    reports and feature requests as well as search the bug database. | ||||
|  | ||||
| Q: What should I do if I found a bug? | ||||
| A: Please file a bug report at <http://ngircd.barton.de/bugzilla/index.cgi>! | ||||
|    The author of the particular component will be notified automagically :-) | ||||
| A: Please file a bug report at <https://github.com/ngircd/ngircd/issues/new>! | ||||
|    The author will be notified automagically :-) | ||||
|  | ||||
|   | ||||
							
								
								
									
										65
									
								
								doc/GIT.txt
									
									
									
									
									
								
							
							
						
						
									
										65
									
								
								doc/GIT.txt
									
									
									
									
									
								
							| @@ -1,65 +0,0 @@ | ||||
|  | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2011 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
|                                  -- GIT.txt -- | ||||
|  | ||||
|  | ||||
| The source code of ngIRCd is maintained using GIT, an distributed version | ||||
| control system. Homepage including documentation: <http://git-scm.com/>. | ||||
|  | ||||
|  | ||||
| I. Viewing the source code online | ||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| The ngIRCd "GITweb" interface allows you to browse the GIT repository and | ||||
| to see all individual files, tags, branches, commits etc.: | ||||
|  | ||||
|  <http://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git> | ||||
|  | ||||
|  | ||||
| II. Getting the source code | ||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| To access (copy, clone) the source tree repository anonymously, run: | ||||
|  | ||||
|  $ git clone git://ngircd.barton.de/ngircd.git | ||||
|  | ||||
| Thereby a new folder "ngircd" will be created containing all the individual | ||||
| source files. | ||||
|  | ||||
| The newly created directory ("ngircd") is the "working directory", all | ||||
| GIT commands will be executed from within this directory in the future. | ||||
|  | ||||
| Please note: When checking out a fresh copy of ngIRCd using GIT, the | ||||
| configure script doesn't exist; you have to run the autogen.sh shell script | ||||
| (which is included in the source tree) to generate it. This requires you to | ||||
| have GNU automake and GNU autoconf installed on your system. Please see the | ||||
| file INSTALL for details! | ||||
|  | ||||
| To update the local GIT repository: | ||||
|  | ||||
|  $ git pull | ||||
|  | ||||
| This retrieves all changes and merges them into the current branch. | ||||
|  | ||||
|  | ||||
| III. Contributing | ||||
| ~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| Patches should be sent to the ngircd mailing list. List homepage: | ||||
| http://arthur.barton.de/mailman/listinfo/ngircd-ml | ||||
|  | ||||
| If you do not want to send them to the list, you can also mail them | ||||
| to Alex Barton, <alex@barton.de>. | ||||
|  | ||||
|  | ||||
| IV. Write Access | ||||
| ~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| If you want to contribute a couple of patches and write access to the GIT | ||||
| repository would be handy, please contact Alex Barton, <alex@barton.de>. | ||||
| @@ -37,6 +37,7 @@ II. How to prepare a new ngIRCd release? | ||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| a) Make sure the source tree is in a releasable state ;-) | ||||
|     - is the AUTHORS file up to date? | ||||
|  | ||||
| b) Make sure you have working versions of GNU autoconf and GNU automake | ||||
|    installed on the system you use for generating the release: | ||||
| @@ -74,4 +75,6 @@ l) Upload and distribute the newly generated ngIRCd release archive(s) | ||||
|  | ||||
| m) Write an announcement to the mailing list, freshmeat, Twitter, ... | ||||
|  | ||||
| n) Relax :-) | ||||
| n) Update the list of releases in our bug tracker. | ||||
|  | ||||
| o) Relax :-) | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| # | ||||
| # ngIRCd -- The Next Generation IRC Daemon | ||||
| # Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors | ||||
| # Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors | ||||
| # | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| @@ -11,7 +11,8 @@ | ||||
|  | ||||
| .tmpl: | ||||
| 	$(AM_V_GEN)sed \ | ||||
| 	    -e s@:ETCDIR:@${sysconfdir}@ \ | ||||
| 	    -e "s@:ETCDIR:@${sysconfdir}@" \ | ||||
| 	    -e "s@:DOCDIR:@${docdir}@" \ | ||||
| 	    <$< >$@ | ||||
|  | ||||
| SUFFIXES = .tmpl | ||||
| @@ -19,9 +20,9 @@ SUFFIXES = .tmpl | ||||
| static_docs = \ | ||||
| 	Bopm.txt \ | ||||
| 	Capabilities.txt \ | ||||
| 	Commands.txt \ | ||||
| 	Contributing.txt \ | ||||
| 	FAQ.txt \ | ||||
| 	GIT.txt \ | ||||
| 	HowToRelease.txt \ | ||||
| 	Modes.txt \ | ||||
| 	PAM.txt \ | ||||
| @@ -52,11 +53,11 @@ maintainer-clean-local: | ||||
| all: $(generated_docs) | ||||
|  | ||||
| install-data-hook: $(static_docs) $(toplevel_docs) $(generated_docs) | ||||
| 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir) | ||||
| 	$(MKDIR_P) -m 755 $(DESTDIR)$(sysconfdir) | ||||
| 	@if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then \ | ||||
| 	  make install-config; \ | ||||
| 	 fi | ||||
| 	$(mkinstalldirs) $(DESTDIR)$(docdir) | ||||
| 	$(MKDIR_P) -m 755 $(DESTDIR)$(docdir) | ||||
| 	for f in $(static_docs) $(toplevel_docs); do \ | ||||
| 	  $(INSTALL) -m 644 -c $(srcdir)/$$f $(DESTDIR)$(docdir)/; \ | ||||
| 	 done | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2012 Alexander Barton and Contributors. | ||||
|                (c)2001-2015 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
| @@ -26,7 +26,9 @@ channels he is using at the moment. | ||||
|   B	20	User is flagged as a "bot". | ||||
|   c	17	IRC operator wants to receive connect/disconnect NOTICEs. | ||||
|   C	19	Only users that share a channel are allowed to send messages. | ||||
|   F	22	Relaxed flood protection (only settable by IRC Operators). | ||||
|   i	0.0.1	User is "invisible". | ||||
|   I	23	No channels are shown on WHOIS (IRC Ops can always see those). | ||||
|   o	0.0.1	User is IRC operator. | ||||
|   q	20	User is protected, can not be kicked from a channel. | ||||
|   r	0.0.1	User is restricted. | ||||
| @@ -54,6 +56,7 @@ users to lists (e.g. "invite list", "ban list"), others have parameters | ||||
|   m	0.3.0	Channel is moderated, only "voiced" users can send messages. | ||||
|   M	20	Only registered users (and IRC Ops) can send messages. | ||||
|   n	0.3.0	Channel doesn't allow messages of users not being members. | ||||
|   N     23      Users can't change their nickname while on this channel. | ||||
|   O	18	Only IRC operators are allowed to join this channel. | ||||
|   P	0.5.0	Channel is "persistent". | ||||
|   Q	20	Nobody can be kicked from the channel. | ||||
| @@ -72,17 +75,21 @@ channel of which he is a member. | ||||
|  | ||||
|   mode	since	description | ||||
|  | ||||
|   q	20	User is channel owner can only be set by a service, other | ||||
| 		owner and irc op. Can promote other users to q, a, o, h, v. | ||||
|   a	20	User is channel admin and can promote other users to v, h, o | ||||
|   q	20	User is channel owner. This mode can only be set by an IRC | ||||
| 		service, other owner or IRC operator. Channel owners can | ||||
| 		promote other users to all levels: q, a, o, h, v. Prefix: "~". | ||||
|   a	20	User is channel admin and can promote other users to v, h, o. | ||||
| 		Prefix: "&". | ||||
|   o	0.2.0	User is channel operator and can op/kick/... other members. | ||||
| 		Prefix: "@". | ||||
|   h	20	User is half op and can set channel modes imntvIbek and kick | ||||
| 		voiced and normal users. | ||||
| 		voiced and normal users. Prefix: "%". | ||||
|   v	0.2.0	User is "voiced" and can speak even if channel is moderated. | ||||
| 		Prefix: "+". | ||||
|  | ||||
|  | ||||
| Notes | ||||
| ~~~~~ | ||||
|  | ||||
| (1) This mode is not set by ngIRCd itself but by services. ngIRCd handles | ||||
|     the mode transparently and possibly adjusts its behaviour. | ||||
|     the mode transparently and possibly adjusts its behavior. | ||||
|   | ||||
							
								
								
									
										19
									
								
								doc/PAM.txt
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								doc/PAM.txt
									
									
									
									
									
								
							| @@ -1,9 +1,8 @@ | ||||
|  | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                         (c)2001-2010 Alexander Barton, | ||||
|                     alex@barton.de, http://www.barton.de/ | ||||
|  | ||||
|                (c)2001-2013 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
| @@ -27,6 +26,10 @@ A very simple -- and quite useless ;-) -- example would be: | ||||
| Here the "pam_debug" module will be called each time a client connects to | ||||
| the ngIRCd and has sent its PASS, NICK, and USER commands. | ||||
|  | ||||
| The PAM library used by the ngIRCd daemon must be able to access its | ||||
| configuration file, so don't forget to check permissions and run something | ||||
| like this: "chmod 644 /etc/pam.d/ngircd". | ||||
|  | ||||
| Please note ONE VERY IMPORTANT THING: | ||||
|  | ||||
| All the PAM modules are executed with the privileges of the user ngIRCd | ||||
| @@ -34,3 +37,13 @@ is running as. Therefore a lot of PAM modules aren't working as expected, | ||||
| because they need root privileges ("pam_unix", for example)! | ||||
| Only PAM modules not(!) requiring root privileges (such as "pam_pgsql", | ||||
| "pam_mysql", "pam_opendirectory" ...) can be used in conjunction with ngIRCd. | ||||
|  | ||||
| More Examples: | ||||
|  | ||||
|  * Use an own "password file" for ngIRCd: | ||||
|  | ||||
|    Note: you can use the htpasswd(1) utility of Apache to manage password | ||||
|    files used by pam_pwdfile, see "man htpasswd"! | ||||
|  | ||||
| 	/etc/pam.d/ngircd: | ||||
| 	  auth  required  pam_pwdfile.so pwdfile=/etc/ngircd/ngircd.passwd | ||||
|   | ||||
| @@ -2,87 +2,125 @@ | ||||
|                      ngIRCd - Next Generation IRC Server | ||||
|                            http://ngircd.barton.de/ | ||||
|  | ||||
|                (c)2001-2012 Alexander Barton and Contributors. | ||||
|                (c)2001-2016 Alexander Barton and Contributors. | ||||
|                ngIRCd is free software and published under the | ||||
|                    terms of the GNU General Public License. | ||||
|  | ||||
|                               -- Platforms.txt -- | ||||
|  | ||||
|  | ||||
| This file lists the status of all platforms on which the ngIRCd has been | ||||
| tested. Included is the date and version of the last "official" test and | ||||
| the name of the tester/maintainer. | ||||
| This file lists the status of all platforms on which ngIRCd has been tested. | ||||
| Included is the date and version of the last test and the name of the tester | ||||
| or maintainer. | ||||
|  | ||||
| If you successfully compiled and tested ngIRCd on a platform that isn't | ||||
| listed here, please contact Alexander Barton, <alex@barton.de>, so that this | ||||
| list can be updated. Thanks for your help! | ||||
| If you successfully compiled and tested ngIRCd on a platform that isn't listed | ||||
| here, please write to the mailing list so that this list can be updated.  The | ||||
| script "./contrib/platformtest.sh" should output a summary that is suitable | ||||
| for inclusion here. Thanks for your help! | ||||
|  | ||||
|  | ||||
|                               the executable works ("runs") as expected --+ | ||||
|                                 tests run successfully ("make check") --+ | | ||||
|                                            ngIRCd compiles ("make") --+ | | | ||||
|                                                 ./configure works --+ | | | | ||||
|                                                                     | | | | | ||||
| Platform                    Compiler     ngIRCd     Date     Tester C M T R See | ||||
| --------------------------- ------------ ---------- -------- ------ - - - - --- | ||||
| alpha/unknown/netbsd3.0     gcc 3.3.3    CVSHEAD    06-05-07 fw     Y Y Y Y (3) | ||||
| armv6l/unkn./linux-gnueabi  gcc 4.4.5    19.1       12-06-04 goetz  Y Y Y Y (5) | ||||
| armv7l/unkn./linux-gnueabi  gcc 4.4.3    19.1       12-04-29 goetz  Y Y Y Y (5) | ||||
| hppa/unknown/openbsd3.5     gcc 2.95.3   CVSHEAD    04-05-25 alex   Y Y Y Y | ||||
| hppa1.1/unknown/linux-gnu   gcc 3.3.3    0.8.0      04-05-30 alex   Y Y Y Y | ||||
| hppa2.0/unknown/linux-gnu   gcc 3.3.5    13~rc1     08-12-02 alex   Y Y Y Y | ||||
| hppa2.0w-hp-hpux11.11       gcc 4.2.3    14.1       09-07-22 goetz  Y Y Y Y | ||||
| i386/apple/darwin9.7.0      gcc 4.0.1    14.1       09-08-04 alex   Y Y Y Y (3) | ||||
| i386/apple/darwin10.8.0     gcc 4.2.1    19         12-02-26 alex   Y Y Y Y (3) | ||||
| i386/apple/darwin11.3.0     gcc 4.2.1    19         12-02-26 alex   Y Y Y Y (3) | ||||
| i386/pc/solaris2.9          gcc 3.2.2    CVSHEAD    04-02-24 alex   Y Y Y Y | ||||
| i386/pc/solaris2.11         gcc 3.4.3    19         12-02-26 alex   Y Y N Y (4) | ||||
| i386/pc/solaris2.11         gcc 4.2.3    19.1       12-05-29 goetz  Y Y Y Y (4) | ||||
| i386/unknown/freebsd5.2.1   gcc 3.3.3    0.8.0      04-05-30 alex   Y Y Y Y | ||||
| i386/unknown/freebsd6.2     gcc 3.4.6    20~rc1     12-11-13 alex   Y Y Y Y (3) | ||||
| i386/unknown/freebsd7.3     gcc 4.2.1    20~rc1     12-11-13 alex   Y Y Y Y (3) | ||||
| i686/unknown/gnu0.3         gcc 4.4.5    19         12-02-29 alex   Y Y Y Y | ||||
| i686/unkn./kfreebsd7.2-gnu  gcc 4.3.4    15         09-12-02 alex   Y Y Y Y (3) | ||||
| i386/unknown/netbsdelf1.6.2 gcc 2.95.3   18         11-07-10 goetz  Y Y Y Y | ||||
| i386/unknown/netbsdelf3.0.1 gcc 3.3.3    0.10.0-p1  06-08-30 alex   Y Y Y Y (3) | ||||
| i386/unknown/netbsdelf4.0   gcc 4.1.2    19         12-02-29 alex   Y Y Y Y (3) | ||||
| i386/unknown/netbsdelf5.0.2 gcc 4.1.3    19         12-02-26 alex   Y Y Y Y (3) | ||||
| i386/unknown/openbsd3.9     gcc 3.3.5    0.10.0-p1  06-08-30 alex   Y Y Y Y (3) | ||||
| i386/unknown/openbsd4.1     gcc 3.3.5    16         10-04-11 alex   Y Y Y Y (3) | ||||
| i586/pc/haiku               gcc 2.95.3   19.2~138   12-10-11 user   Y Y N N | ||||
| i586/pc/interix3.5          gcc 3.3      19         12-02-29 alex   Y Y N Y | ||||
| i686/pc/cygwin              gcc 3.3.1    0.8.0      04-05-30 alex   Y Y N Y | ||||
| i686/pc/linux-gnu           gcc 2.7.2    19.1       12-05-30 goetz  Y Y Y Y (1) | ||||
| i686/pc/linux-gnu           gcc 2.95.4   0.8.0      04-05-30 alex   Y Y Y Y (1) | ||||
| i686/pc/linux-gnu           gcc 3.3.5    14.1       09-08-04 alex   Y Y Y Y (1) | ||||
| i386/pc/linux-gnu           gcc 4.1.2    13~rc1     08-12-05 alex   Y Y Y Y (1) | ||||
| i686/pc/linux-gnu           gcc 4.3.2    14.1       09-08-04 alex   Y Y Y Y (1) | ||||
| m68k/apple/aux3.0.1         gcc 2.7.2    17         10-11-07 alex   Y Y N Y | ||||
| m68k/apple/aux3.0.1         Orig. A/UX   17         10-11-07 alex   Y Y N Y (2) | ||||
| m68k/apple/aux3.1.1         gcc 2.7.2    19         12-02-26 alex   Y Y N Y | ||||
| m68k/apple/aux3.1.1         Orig. A/UX   19         12-02-26 alex   Y Y N Y (2) | ||||
| m68k/hp/hp-ux9.10           Orig. HPUX   0.7.x-CVS  03-04-30 goetz  Y Y Y Y | ||||
| m88k/dg/dgux5.4R3.10        gcc 2.5.8    CVSHEAD    04-03-15 alex   Y Y ? ? | ||||
| mipsel/unknown/linux-gnu    gcc 4.1.2    18         11-07-05 goetz  Y Y N Y (1) | ||||
| mipsel/unknown/linux-gnu    gcc 4.4.5    18         11-07-30 goetz  Y Y Y Y (1) | ||||
| powerpc/apple/darwin6.5     gcc 3.1      0.7.x-CVS  03-04-23 alex   Y Y Y Y | ||||
| powerpc/apple/darwin7.9.0   gcc 3.3      19.1       12-05-22 goetz  Y Y Y Y (3) | ||||
| powerpc/apple/darwin8.11.0  gcc 4.0.1    18         11-07-02 goetz  Y Y Y Y (3) | ||||
| powerpc/unknown/linux-gnu   gcc 3.3.3    0.8.0      04-05-30 alex   Y Y Y Y | ||||
| powerpc/unknown/openbsd3.6  gcc 2.95.3   0.10.0     06-10-08 alex   Y Y N Y | ||||
| sparc/sun/solaris2.6        gcc 2.95.3   0.7.x-CVS  03-04-22 alex   Y Y Y Y | ||||
| sparc/sun/solaris2.7        gcc 3.3      0.8.0      04-05-30 alex   Y Y Y Y | ||||
| sparc/unkn./netbsdelf1.6.1  gcc 2.95.3   0.8.0      04-05-30 alex   Y Y Y Y | ||||
| x86_64/apple/darwin12.2.0   gcc 4.2.1    20~rc1     12-11-13 alex   Y Y Y Y (3) | ||||
| x86_64/unknown/freebsd8.1   gcc 4.2.1    20~rc1     12-11-13 alex   Y Y Y Y (3) | ||||
| x86_64/unkn./freebsd8.1-gnu gcc 4.4.5    19         12-02-26 alex   Y Y Y Y (3) | ||||
| x86_64/unknown/linux-gnu    gcc 4.4.5    20~rc1     12-02-26 alex   Y Y Y Y (1) | ||||
| x86_64/unknown/openbsd4.7   gcc 3.3.5    20~rc1     12-02-26 alex   Y Y Y Y (3) | ||||
| x86_64/unknown/openbsd4.8   gcc 4.2.1    20~rc1     12-11-13 alex   Y Y Y Y (3) | ||||
|                                 the executable works ("runs") as expected --+ | ||||
|                                   tests run successfully ("make check") --+ | | ||||
|                                              ngIRCd compiles ("make") --+ | | | ||||
|                                                   ./configure works --+ | | | | ||||
|                                                                       | | | | | ||||
| Platform                    Compiler     ngIRCd     Date     Tester   C M T R * | ||||
| --------------------------- ------------ ---------- -------- -------- - - - - - | ||||
| alpha/unknown/netbsd3.0     gcc 3.3.3    CVSHEAD    06-05-07 fw       Y Y Y Y 3 | ||||
| armv6l/unk./linux-gnueabi   gcc 4.7.2    20.2       13-03-08 goetz    Y Y Y Y 5 | ||||
| armv6l/unk./linux-gnueabihf gcc 4.6.3    21~rc2     13-10-26 pi       Y Y Y Y 5 | ||||
| armv7l/unk./linux-gnueabi   gcc 4.4.3    19.1       12-04-29 goetz    Y Y Y Y 5 | ||||
| armv7l/unk./linux-gnueabihf gcc 4.6.3    22~rc1-3   14-10-10 alex     Y Y Y Y 5 | ||||
| armv7l/unk./linux-gnueabihf gcc 4.8.2    21.1       14-07-15 goetz    Y Y Y Y 5 | ||||
| armv7l/unk./linux-gnueabihf gcc 4.9.2    23         16-01-10 alex     Y Y Y Y 5 | ||||
| hppa/unknown/openbsd3.5     gcc 2.95.3   CVSHEAD    04-05-25 alex     Y Y Y Y | ||||
| hppa/unknown/openbsd5.4     gcc 4.2.1    22~rc1-3   14-10-10 alex     Y Y y Y 3 | ||||
| hppa1.1/unknown/linux-gnu   gcc 3.3.3    0.8.0      04-05-30 alex     Y Y Y Y | ||||
| hppa2.0/unknown/linux-gnu   gcc 3.3.5    13~rc1     08-12-02 alex     Y Y Y Y | ||||
| hppa2.0w-hp-hpux11.11       gcc 4.2.3    14.1       09-07-22 goetz    Y Y Y Y | ||||
| i386/apple/darwin9.7.0      gcc 4.0.1    14.1       09-08-04 alex     Y Y Y Y 3 | ||||
| i386/apple/darwin10.8.0     gcc 4.2.1    19         12-02-26 alex     Y Y Y Y 3 | ||||
| i386/apple/darwin11.3.0     gcc 4.2.1    19         12-02-26 alex     Y Y Y Y 3 | ||||
| i386/pc/linux-gnu           gcc 4.1.2    13~rc1     08-12-05 alex     Y Y Y Y 1 | ||||
| i386/pc/linux-gnu           gcc 4.4.5    22~rc1-3   14-10-10 alex     Y Y Y Y 1 | ||||
| i386/pc/minix               clang 3.4    23         16-01-06 goetz    Y Y N Y | ||||
| i386/pc/solaris2.9          gcc 3.2.2    CVSHEAD    04-02-24 alex     Y Y Y Y | ||||
| i386/pc/solaris2.11         gcc 4.8.2    23         16-02-07 goetz    Y Y Y Y 4 | ||||
| i386/unknown/freebsd5.2.1   gcc 3.3.3    0.8.0      04-05-30 alex     Y Y Y Y | ||||
| i386/unknown/freebsd6.2     gcc 3.4.6    20~rc1     12-11-13 alex     Y Y Y Y 3 | ||||
| i386/unknown/freebsd7.3     gcc 4.2.1    20~rc1     12-11-13 alex     Y Y Y Y 3 | ||||
| i386/unknown/netbsdelf1.5.2 egcs-1.1.2   21         13-11-25 goetz    Y Y N Y | ||||
| i386/unknown/netbsdelf1.6.2 gcc 2.95.3   18         11-07-10 goetz    Y Y Y Y | ||||
| i386/unknown/netbsdelf3.0.1 gcc 3.3.3    0.10.0-p1  06-08-30 alex     Y Y Y Y 3 | ||||
| i386/unknown/netbsdelf4.0   gcc 4.1.2    19         12-02-29 alex     Y Y Y Y 3 | ||||
| i386/unknown/netbsdelf5.0.2 gcc 4.1.3    19         12-02-26 alex     Y Y Y Y 3 | ||||
| i386/unknown/openbsd3.5     gcc 2.95.3   23         15-11-27 goetz    Y Y y Y 3 | ||||
| i386/unknown/openbsd3.9     gcc 3.3.5    0.10.0-p1  06-08-30 alex     Y Y Y Y 3 | ||||
| i386/unknown/openbsd4.1     gcc 3.3.5    16         10-04-11 alex     Y Y Y Y 3 | ||||
| i386/unknown/openbsd5.3     gcc 4.2.1    21         13-11-28 goetz    Y Y Y Y 3 | ||||
| i386/unknown/openbsd5.4     gcc 4.2.1    21         13-11-28 goetz    Y Y Y Y 3 | ||||
| i586/pc/haiku               gcc 2.95.3   19.2~138   12-10-11 user     Y Y N N | ||||
| i586/pc/interix3.5          gcc 3.3      23         16-01-29 alex     Y Y N Y | ||||
| i686/pc/cygwin              gcc 4.9.3    23         16-01-06 alex     Y Y Y Y | ||||
| i686/pc/linux-gnu           gcc 2.6.3    23         16-01-06 goetz    Y Y y Y 1 | ||||
| i686/pc/linux-gnu           gcc 2.7.2.1  23         15-11-30 goetz    Y Y N Y 1 | ||||
| i686/pc/linux-gnu           gcc 2.95.2   23         15-12-23 goetz    Y Y Y Y 1 | ||||
| i686/pc/linux-gnu           gcc 2.95.4   0.8.0      04-05-30 alex     Y Y Y Y 1 | ||||
| i686/pc/linux-gnu           gcc 3.3.5    14.1       09-08-04 alex     Y Y Y Y 1 | ||||
| i686/pc/linux-gnu           gcc 4.3.2    14.1       09-08-04 alex     Y Y Y Y 1 | ||||
| i686/pc/minix               gcc 4.4.6    21~rc2     13-10-27 alex     Y Y N N | ||||
| i686/unknown/gnu0.3         gcc 4.4.5    19         12-02-29 alex     Y Y Y Y | ||||
| i686/unknown/gnu0.5         gcc 4.9.1    22~rc1-3   14-10-11 alex     Y Y Y Y | ||||
| i686/unkn./kfreebsd7.2-gnu  gcc 4.3.4    15         09-12-02 alex     Y Y Y Y 3 | ||||
| m68k/apple/aux3.0.1         gcc 2.7.2    17         10-11-07 alex     Y Y N Y | ||||
| m68k/apple/aux3.0.1         Orig. A/UX   17         10-11-07 alex     Y Y N Y 2 | ||||
| m68k/apple/aux3.1.1         gcc 2.7.2    19         12-02-26 alex     Y Y N Y | ||||
| m68k/apple/aux3.1.1         Orig. A/UX   19         12-02-26 alex     Y Y N Y 2 | ||||
| m68k/hp/hp-ux9.10           Orig. HPUX   0.7.x-CVS  03-04-30 goetz    Y Y Y Y | ||||
| m88k/dg/dgux5.4R3.10        gcc 2.5.8    CVSHEAD    04-03-15 alex     Y Y ? ? | ||||
| mipsel/unknown/linux-gnu    gcc 4.1.2    18         11-07-05 goetz    Y Y N Y 1 | ||||
| mipsel/unknown/linux-gnu    gcc 4.4.5    21         13-11-24 goetz    Y Y Y Y 1 | ||||
| powerpc/apple/darwin6.8     gcc 3.1      21         14-01-03 goetz    Y Y Y Y | ||||
| powerpc/apple/darwin7.9.0   gcc 3.3      22         15-03-22 goetz    Y Y Y Y 3 | ||||
| powerpc/apple/darwin8.11.0  gcc 4.0.1    18         11-07-02 goetz    Y Y Y Y 3 | ||||
| powerpc/apple/darwin9.8.0   gcc 4.0.1    21         14-01-04 goetz    Y Y Y Y 3 | ||||
| powerpc/unknown/linux-gnu   gcc 3.3.3    0.8.0      04-05-30 alex     Y Y Y Y | ||||
| powerpc/unknown/openbsd3.6  gcc 2.95.3   0.10.0     06-10-08 alex     Y Y N Y | ||||
| sparc/sun/solaris2.6        gcc 2.95.3   0.7.x-CVS  03-04-22 alex     Y Y Y Y | ||||
| sparc/sun/solaris2.7        gcc 3.3      0.8.0      04-05-30 alex     Y Y Y Y | ||||
| sparc/unkn./netbsdelf1.6.1  gcc 2.95.3   0.8.0      04-05-30 alex     Y Y Y Y | ||||
| sparc/unknown/openbsd5.5    gcc 4.2.1    21.1       14-05-03 goetz    Y Y Y Y 3 | ||||
| x86_64/apple/darwin10.8.0   gcc 4.2.1    21~rc2     13-10-30 alex     Y Y Y Y 3 | ||||
| x86_64/apple/darwin12.3.0   gcc 4.2.1    20.2       13-04-01 alex     Y Y Y Y 3 | ||||
| x86_64/apple/darwin13.0.0   A-clang 5.0  21         14-01-02 alex     Y Y Y Y 3 | ||||
| x86_64/apple/darwin14.5.0   A-clang 6.1  23~rc1     15-09-06 alex     Y Y Y Y 3 | ||||
| x86_64/apple/darwin15.6.0   A-clang 8.0  23~38-g455 16-11-04 alex     Y Y Y Y 3 | ||||
| x86_64/apple/darwin16.3.0   A-clang 8.0  23~55-g8e0 17-01-06 alex     Y Y Y Y 3 | ||||
| x86_64/unknown/dragonfly3.4 gcc 4.7.2    21         13-11-12 goetz    Y Y N Y 3 | ||||
| x86_64/unkn./freebsd8.1-gnu gcc 4.4.5    19         12-02-26 alex     Y Y Y Y 3 | ||||
| x86_64/unknown/freebsd8.4   gcc 4.2.1    22~rc1-3   14-10-10 alex     Y Y y Y 3 | ||||
| x86_64/unknown/freebsd9.2   gcc 4.2.1    22~rc1-3   14-10-10 alex     Y Y Y Y 3 | ||||
| x86_64/unknown/freebsd10.0  F-clang 3.3  22~rc1-3   14-10-10 alex     Y Y Y Y 3 | ||||
| x86_64/unknown/linux-gnu    clang 3.3    21         14-01-07 alex     Y Y Y Y 1 | ||||
| x86_64/unknown/linux-gnu    clang 3.4    22~rc1-3   14-10-11 alex     Y Y Y Y 1 | ||||
| x86_64/unknown/linux-gnu    gcc 4.4.5    23~rc1-3   15-11-15 alex     Y Y Y Y 1 | ||||
| x86_64/unknown/linux-gnu    gcc 4.7.2    23~rc1-3   15-11-15 alex     Y Y Y Y 1 | ||||
| x86_64/unknown/linux-gnu    gcc 4.8.2    21         13-12-29 alex     Y Y Y Y 1 | ||||
| x86_64/pc/linux-gnu         gcc 4.9.2    23~55-g8e0 17-01-06 alex     Y Y Y Y 1 | ||||
| x86_64/unknown/linux-gnu    gcc 5.3.0    23         15-12-14 goetz    Y Y Y Y 1 | ||||
| x86_64/pc/linux-gnu         gcc 6.2.1    23~44-g995 16-12-06 alex     Y Y Y Y 1 | ||||
| x86_64/unknown/linux-gnu    icc 16       23         16-01-13 goetz    Y Y Y Y 1 | ||||
| x86_64/unknown/linux-gnu    nwcc 0.8.2   21         13-12-01 goetz    Y Y Y Y 1 | ||||
| x86_64/unknown/linux-gnu    Open64       21.1       14-03-27 goetz    Y Y Y Y 1 | ||||
| x86_64/unknown/linux-gnu    Sun C 5.12   21.1       14-03-27 goetz    Y Y Y Y 1 | ||||
| x86_64/unknown/openbsd4.7   gcc 3.3.5    20~rc1     12-02-26 alex     Y Y Y Y 3 | ||||
| x86_64/unknown/openbsd4.8   gcc 4.2.1    22~rc1-3   14-10-10 alex     Y Y y Y 3 | ||||
| x86_64/unknown/openbsd5.1   gcc 4.2.1    21         13-12-28 alex     Y Y Y Y 3 | ||||
| x86_64/unknown/openbsd5.5   gcc 4.2.1    22~rc1-3   14-10-10 alex     Y Y Y Y 3 | ||||
|  | ||||
|  | ||||
| Notes | ||||
| ~~~~~ | ||||
| * Notes | ||||
| ~~~~~~~ | ||||
|  | ||||
| (1) */*/linux-gnu (Linux platforms): | ||||
|     ngIRCd has been tested with various Linux distributions, such as SuSE, | ||||
|   | ||||
| @@ -224,8 +224,10 @@ new server link", <serverflag> "M"), even if it doesn't support the given | ||||
|  | ||||
| The following <key> names are defined: | ||||
|  | ||||
|  - "host": the hostname of a client (can't be empty) | ||||
|  - "accountname": the account name of a client (can't be empty) | ||||
|  - "certfp": the certificate fingerprint of a client (can't be empty) | ||||
|  - "cloakhost": the cloaked hostname of a client | ||||
|  - "host": the hostname of a client (can't be empty) | ||||
|  - "info": info text ("real name") of a client | ||||
|  - "user": the user name of a client (can't be empty) | ||||
|  | ||||
|   | ||||
| @@ -22,7 +22,7 @@ The following software packages are needed: | ||||
|  - GNU sed | ||||
|    Source: | ||||
|    http://www.rezepte-im-web.de/appleux/sed-3.02.tar.gz | ||||
|    ftp://arthur.barton.de/pub/unix/aux/tools/sed-3.02.tar.gz | ||||
|    http://arthur.barton.de/pub/unix/aux/tools/sed-3.02.tar.gz | ||||
|  | ||||
|    A/UX comes with /bin/sed which isn't supporting all functions needed | ||||
|    by GNU automake/autoconf. | ||||
| @@ -34,7 +34,7 @@ The following software packages are needed: | ||||
|  - libUTIL.a | ||||
|    Source: | ||||
|    ftp://ftp.mayn.de/pub/really_old_stuff/apple/apple_unix/Sys_stuff/libUTIL-2.1.tar.gz> | ||||
|    ftp://arthur.barton.de/pub/unix/aux/libraries/libUTIL-2.1.tar.gz | ||||
|    http://arthur.barton.de/pub/unix/aux/libraries/libUTIL-2.1.tar.gz | ||||
|  | ||||
|    This library contains functions that are common on other UNIX | ||||
|    systems but not on A/UX e.g. memmove(), strerror() and strdup(). | ||||
| @@ -50,7 +50,7 @@ A few hints in case of errors: | ||||
|    (so 'configure' uses its own shell script) or use a fully functionable one. | ||||
|    There's at least one binary "out there" causing problems. The one | ||||
|    of the GNU fileutils works fine: | ||||
|    ftp://arthur.barton.de/pub/unix/aux/tools/fileutils-4.0.tar.gz | ||||
|    http://arthur.barton.de/pub/unix/aux/tools/fileutils-4.0.tar.gz | ||||
|  | ||||
|  - The precompiled binary of the old 'bash' shouldn't be installed within | ||||
|    /bin (better do this in /usr/local/bin) because 'configure' would | ||||
|   | ||||
| @@ -14,7 +14,7 @@ acting as a "regular servers" ("pseudo servers") are supported, either | ||||
| using the IRC protocol as defined in RFC 1459 or RFC 2812. | ||||
|  | ||||
| Support for Services has been tested using | ||||
|  - Anope 1.9.8 or later (<http://www.anope.org/>; unreleased!) | ||||
|  - Anope 1.9.8 or later (<http://www.anope.org/>) | ||||
|  - Atheme 7.0.2 or later (<http://www.atheme.net>) | ||||
|  - "IRC Services" 5.1.x by Andrew Church (<http://achurch.org/services/>) | ||||
|  | ||||
| @@ -41,13 +41,11 @@ Example: | ||||
|      ServiceMask = *Serv | ||||
|  | ||||
|  | ||||
| Setting up Anope 1.9.x | ||||
| ~~~~~~~~~~~~~~~~~~~~~~ | ||||
| Setting up Anope 1.9.x & 2.x | ||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||
|  | ||||
| Anope 1.9.8 or later (<http://www.anope.org/>; unreleased as of 2012-11-10) | ||||
| may be used with ngIRCd using the "ngircd" protocol module. | ||||
| Until Anope 1.9.8 is released, you have to use the sources from the Anope | ||||
| development GIT tree, see <http://sourceforge.net/projects/anope/develop/>! | ||||
| Anope 1.9.8 or later (<http://www.anope.org/>) can be used with ngIRCd using | ||||
| the "ngircd" protocol module. | ||||
|  | ||||
| At least the following settings have to be tweaked, in addition to all the | ||||
| settings marked as required by Anope: | ||||
| @@ -68,20 +66,28 @@ In conf/services.conf: | ||||
|   } | ||||
|  | ||||
|   # Load ngIRCd protocol module | ||||
|   module { name = "ngircd" } | ||||
|   module | ||||
|   { | ||||
| 	name = "ngircd" | ||||
|   } | ||||
|  | ||||
|   networkinfo | ||||
|   { | ||||
| 	# Must be set to the "MaxNickLength" setting of ngIRCd! | ||||
| 	nicklen = 9 | ||||
|  | ||||
| 	# When not using "strict mode", which is the default: | ||||
| 	userlen = 20 | ||||
|  | ||||
| 	chanlen = 50 | ||||
|   } | ||||
|  | ||||
| In conf/nickserv.conf: | ||||
|  | ||||
|   nickserv | ||||
|   module | ||||
|   { | ||||
| 	name = "nickserv" | ||||
|  | ||||
| 	# not required if you are running ngIRCd with a higher nickname limit | ||||
| 	# ("MaxNickLength") than 11 characters, but REQUIRED by default! | ||||
| 	guestnickprefix = "G-" | ||||
| @@ -117,7 +123,7 @@ Please note that versions up to and including 5.1.3 contain a bug that | ||||
| sometimes causes IRC Services to hang on startup. There are two workarounds: | ||||
|  a) send the services process a HUP signal ("killall -HUP ircservices") | ||||
|  b) apply this patch to the IRC Services source tree: | ||||
|     <ftp://ngircd.barton.de/ngircd/contrib/IRCServices513-FlushBuffer.patch> | ||||
|     <http://arthur.barton.de/pub/ngircd/contrib/IRCServices513-FlushBuffer.patch> | ||||
|  | ||||
| At least the following settings have to be tweaked, in addition to all the | ||||
| settings marked as required by IRC Services: | ||||
|   | ||||
| @@ -33,6 +33,10 @@ | ||||
| 	;AdminInfo2 = Location | ||||
| 	;AdminEMail = admin@irc.server | ||||
|  | ||||
| 	# Text file which contains the ngIRCd help text. This file is required | ||||
| 	# to display help texts when using the "HELP <cmd>" command. | ||||
| 	;HelpFile = :DOCDIR:/Commands.txt | ||||
|  | ||||
| 	# Info text of the server. This will be shown by WHOIS and | ||||
| 	# LINKS requests for example. | ||||
| 	Info = Server Info Text | ||||
| @@ -50,6 +54,12 @@ | ||||
| 	# A simple Phrase (<256 chars) if you don't want to use a motd file. | ||||
| 	;MotdPhrase = "Hello world!" | ||||
|  | ||||
| 	# The name of the IRC network to which this server belongs. This name | ||||
| 	# is optional, should only contain ASCII characters, and can't contain | ||||
| 	# spaces. It is only used to inform clients. The default is empty, | ||||
| 	# so no network name is announced to clients. | ||||
| 	;Network = aIRCnetwork | ||||
|  | ||||
| 	# Global password for all users needed to connect to the server. | ||||
| 	# (Default: not set) | ||||
| 	;Password = abc | ||||
| @@ -84,6 +94,13 @@ | ||||
| 	# to not yet (or no longer) connected servers. | ||||
| 	;ConnectRetry = 60 | ||||
|  | ||||
| 	# Number of seconds after which the whole daemon should shutdown when | ||||
| 	# no connections are left active after handling at least one client | ||||
| 	# (0: never, which is the default). | ||||
| 	# This can be useful for testing or when ngIRCd is started using | ||||
| 	# "socket activation" with systemd(8), for example. | ||||
| 	;IdleTimeout = 0 | ||||
|  | ||||
| 	# Maximum number of simultaneous in- and outbound connections the | ||||
| 	# server is allowed to accept (0: unlimited): | ||||
| 	;MaxConnections = 0 | ||||
| @@ -117,6 +134,12 @@ | ||||
| 	# behavior of ngIRCd. If you want to get started quickly, you most | ||||
| 	# probably don't have to make changes here -- they are all optional. | ||||
|  | ||||
| 	# List of allowed channel types (channel prefixes) for newly created | ||||
| 	# channels on the local server. By default, all supported channel | ||||
| 	# types are allowed. Set this variable to the empty string to disallow | ||||
| 	# creation of new channels by local clients at all. | ||||
| 	;AllowedChannelTypes = #&+ | ||||
|  | ||||
| 	# Are remote IRC operators allowed to control this server, e.g. | ||||
| 	# use commands like CONNECT, SQUIT, DIE, ...? | ||||
| 	;AllowRemoteOper = no | ||||
| @@ -148,7 +171,12 @@ | ||||
| 	;ConnectIPv6 = yes | ||||
| 	;ConnectIPv4 = yes | ||||
|  | ||||
| 	# Do any DNS lookups when a client connects to the server. | ||||
| 	# Default user mode(s) to set on new local clients. Please note that | ||||
| 	# only modes can be set that the client could set using regular MODE | ||||
| 	# commands, you can't set "a" (away) for example! Default: none. | ||||
| 	;DefaultUserModes = i | ||||
|  | ||||
| 	# Do DNS lookups when a client connects to the server. | ||||
| 	;DNS = yes | ||||
|  | ||||
| 	# Do IDENT lookups if ngIRCd has been compiled with support for it. | ||||
| @@ -156,14 +184,18 @@ | ||||
| 	# prepended to their user name. | ||||
| 	;Ident = yes | ||||
|  | ||||
| 	# Directory containing configuration snippets (*.conf), that should | ||||
| 	# be read in after parsing this configuration file. | ||||
| 	;IncludeDir = :ETCDIR:/conf.d | ||||
|  | ||||
| 	# Enhance user privacy slightly (useful for IRC server on TOR or I2P) | ||||
| 	# by censoring some information like idle time, logon time, etc. | ||||
| 	;MorePrivacy = no | ||||
|  | ||||
| 	# Normally ngIRCd doesn't send any messages to a client until it is | ||||
| 	# registered. Enable this option to let the daemon send "NOTICE AUTH" | ||||
| 	# registered. Enable this option to let the daemon send "NOTICE *" | ||||
| 	# messages to clients while connecting. | ||||
| 	;NoticeAuth = no | ||||
| 	;NoticeBeforeRegistration = no | ||||
|  | ||||
| 	# Should IRC Operators be allowed to use the MODE command even if | ||||
| 	# they are not(!) channel-operators? | ||||
| @@ -194,8 +226,14 @@ | ||||
| 	# character prepended to their respective user names! | ||||
| 	;PAMIsOptional = no | ||||
|  | ||||
| 	# Allow Pre-Defined Channels only (see Section [Channels]) | ||||
| 	;PredefChannelsOnly = no | ||||
| 	# When PAM is enabled, this value determines the used PAM | ||||
| 	# configuration. | ||||
| 	# This setting allows to run multiple ngIRCd instances with | ||||
| 	# different PAM configurations on each instance. | ||||
| 	# If you set it to "ngircd-foo", PAM will use | ||||
| 	# /etc/pam.d/ngircd-foo instead of the default | ||||
| 	# /etc/pam.d/ngircd. | ||||
| 	;PAMServiceName = ngircd | ||||
|  | ||||
| 	# Let ngIRCd send an "authentication PING" when a new client connects, | ||||
| 	# and register this client only after receiving the corresponding | ||||
| @@ -225,6 +263,15 @@ | ||||
| 	# SSL Server Key Certificate | ||||
| 	;CertFile = :ETCDIR:/ssl/server-cert.pem | ||||
|  | ||||
| 	# Select cipher suites allowed for SSL/TLS connections. This defaults | ||||
| 	# to HIGH:!aNULL:@STRENGTH (OpenSSL) or SECURE128 (GnuTLS). | ||||
| 	# See 'man 1ssl ciphers' (OpenSSL) or 'man 3 gnutls_priority_init' | ||||
| 	# (GnuTLS) for details. | ||||
| 	# For OpenSSL: | ||||
| 	;CipherList = HIGH:!aNULL:@STRENGTH:!SSLv3 | ||||
| 	# For GnuTLS: | ||||
| 	;CipherList = SECURE128:-VERS-SSL3.0 | ||||
|  | ||||
| 	# Diffie-Hellman parameters | ||||
| 	;DHFile = :ETCDIR:/ssl/dhparams.pem | ||||
|  | ||||
|   | ||||
							
								
								
									
										1
									
								
								doc/src/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								doc/src/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1 +0,0 @@ | ||||
| html | ||||
							
								
								
									
										105
									
								
								doc/src/Doxyfile
									
									
									
									
									
								
							
							
						
						
									
										105
									
								
								doc/src/Doxyfile
									
									
									
									
									
								
							| @@ -16,106 +16,55 @@ | ||||
| # Project related configuration options | ||||
| #--------------------------------------------------------------------------- | ||||
|  | ||||
| # The PROJECT_NAME tag is a single word (or a sequence of words surrounded  | ||||
| # by quotes) that should identify the project. | ||||
| DOXYFILE_ENCODING      = UTF-8 | ||||
|  | ||||
| PROJECT_NAME           = ngIRCd | ||||
|  | ||||
| # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)  | ||||
| # base path where the generated documentation will be put.  | ||||
| # If a relative path is entered, it will be relative to the location  | ||||
| # where doxygen was started. If left blank the current directory will be used. | ||||
| PROJECT_BRIEF          = "Lightweight Internet Relay Chat server" | ||||
| PROJECT_LOGO           = "../../contrib/ngIRCd-Logo.gif" | ||||
|  | ||||
| OUTPUT_DIRECTORY       = . | ||||
|  | ||||
| # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag  | ||||
| # can be used to strip a user-defined part of the path. Stripping is  | ||||
| # only done if one of the specified strings matches the left-hand part of  | ||||
| # the path. The tag can be used to show relative paths in the file list.  | ||||
| # If left blank the directory from which doxygen is run is used as the  | ||||
| # path to strip. | ||||
|  | ||||
| STRIP_FROM_PATH        = ../.. | ||||
|  | ||||
| # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen  | ||||
| # will interpret the first line (until the first dot) of a JavaDoc-style  | ||||
| # comment as the brief description. If set to NO, the JavaDoc  | ||||
| # comments will behave just like the Qt-style comments (thus requiring an  | ||||
| # explicit @brief command for a brief description. | ||||
|  | ||||
| JAVADOC_AUTOBRIEF      = YES | ||||
|  | ||||
| # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C  | ||||
| # sources only. Doxygen will then generate output that is more tailored for C.  | ||||
| # For instance, some of the names that are used will be different. The list  | ||||
| # of all members will be omitted, etc. | ||||
|  | ||||
| OPTIMIZE_OUTPUT_FOR_C  = YES | ||||
| TYPEDEF_HIDES_STRUCT   = YES | ||||
|  | ||||
| TAB_SIZE               = 8 | ||||
|  | ||||
| #--------------------------------------------------------------------------- | ||||
| # Build related configuration options | ||||
| #--------------------------------------------------------------------------- | ||||
|  | ||||
| # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in  | ||||
| # documentation are documented, even if no documentation was available.  | ||||
| # Private class members and static file members will be hidden unless  | ||||
| # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES | ||||
|  | ||||
| EXTRACT_ALL            = YES | ||||
|  | ||||
| # If the EXTRACT_STATIC tag is set to YES all static members of a file  | ||||
| # will be included in the documentation. | ||||
|  | ||||
| EXTRACT_STATIC         = YES | ||||
|  | ||||
| # If the sources in your project are distributed over multiple directories | ||||
| # then setting the SHOW_DIRECTORIES tag to YES will show the directory | ||||
| # hierarchy in the documentation. The default is NO. | ||||
|  | ||||
| SHOW_DIRECTORIES       = YES | ||||
|  | ||||
| #--------------------------------------------------------------------------- | ||||
| # configuration options related to warning and progress messages | ||||
| #--------------------------------------------------------------------------- | ||||
|  | ||||
| QUIET                  = NO | ||||
| WARNINGS               = YES | ||||
| WARN_IF_UNDOCUMENTED   = YES | ||||
| WARN_IF_DOC_ERROR      = YES | ||||
| WARN_NO_PARAMDOC       = YES | ||||
|  | ||||
| #--------------------------------------------------------------------------- | ||||
| # configuration options related to the input files | ||||
| #--------------------------------------------------------------------------- | ||||
|  | ||||
| # The INPUT tag can be used to specify the files and/or directories that | ||||
| # contain documented source files. You may enter file names like "myfile.cpp" | ||||
| # or directories like "/usr/src/myproject". Separate the files or directories  | ||||
| # with spaces. | ||||
|  | ||||
| INPUT                  = ../../src | ||||
|  | ||||
| # The RECURSIVE tag can be used to turn specify whether or not subdirectories  | ||||
| # should be searched for input files as well. Possible values are YES and NO.  | ||||
| # If left blank NO is used. | ||||
|  | ||||
| INPUT_ENCODING         = UTF-8 | ||||
| RECURSIVE              = YES | ||||
|  | ||||
| #--------------------------------------------------------------------------- | ||||
| # configuration options related to source browsing | ||||
| #--------------------------------------------------------------------------- | ||||
|  | ||||
| # If the SOURCE_BROWSER tag is set to YES then a list of source files will  | ||||
| # be generated. Documented entities will be cross-referenced with these sources.  | ||||
| # Note: To get rid of all source code in the generated output, make sure also  | ||||
| # VERBATIM_HEADERS is set to NO. | ||||
|  | ||||
| SOURCE_BROWSER         = YES | ||||
|  | ||||
| # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct | ||||
| # doxygen to hide any special comment blocks from generated source code | ||||
| # fragments. Normal C and C++ comments will always remain visible. | ||||
|  | ||||
| STRIP_CODE_COMMENTS    = NO | ||||
|  | ||||
| # If the REFERENCED_BY_RELATION tag is set to YES then for each documented | ||||
| # function all documented functions referencing it will be listed. | ||||
|  | ||||
| REFERENCED_BY_RELATION = YES | ||||
|  | ||||
| # If the REFERENCES_RELATION tag is set to YES then for each documented | ||||
| # function all documented entities called/used by that function will be listed. | ||||
|  | ||||
| REFERENCES_RELATION    = YES | ||||
|  | ||||
| #--------------------------------------------------------------------------- | ||||
| @@ -123,19 +72,7 @@ REFERENCES_RELATION    = YES | ||||
| #--------------------------------------------------------------------------- | ||||
|  | ||||
| GENERATE_HTML          = YES | ||||
|  | ||||
| # The HTML_FOOTER tag can be used to specify a personal HTML footer for each | ||||
| # generated HTML page. If it is left blank doxygen will generate a standard | ||||
| # footer. | ||||
|  | ||||
| HTML_FOOTER            = footer.inc.html | ||||
|  | ||||
| # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML | ||||
| # documentation will contain sections that can be hidden and shown after the | ||||
| # page has loaded. For this to work a browser that supports JavaScript and | ||||
| # DHTML is required (for instance Mozilla 1.0+, Firefox Netscape 6.0+, | ||||
| # Internet explorer 5.0+, Konqueror, or Safari). | ||||
|  | ||||
| HTML_DYNAMIC_SECTIONS  = YES | ||||
|  | ||||
| GENERATE_DOCSET        = NO | ||||
| @@ -151,14 +88,6 @@ GENERATE_PERLMOD       = NO | ||||
| # Configuration options related to the preprocessor    | ||||
| #--------------------------------------------------------------------------- | ||||
|  | ||||
| # The PREDEFINED tag can be used to specify one or more macro names that  | ||||
| # are defined before the preprocessor is started (similar to the -D option of  | ||||
| # gcc). The argument of the tag is a list of macros of the form: name  | ||||
| # or name=definition (no spaces). If the definition and the = are  | ||||
| # omitted =1 is assumed. To prevent a macro definition from being  | ||||
| # undefined via #undef or recursively expanded use the := operator  | ||||
| # instead of the = operator. | ||||
|  | ||||
| PREDEFINED             = DEBUG ZLIB PAM ZEROCONF CONN_MODULE __client_c__ | ||||
|  | ||||
| # -eof- | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
|  | ||||
| <hr class="footer"> | ||||
| <p> | ||||
| <p style="text-align: center"> | ||||
|   ngIRCd | ||||
|   <a href="http://ngircd.barton.de/">Homepage</a>, | ||||
|   <a href="http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git">GIT-Repository</a>, | ||||
|   | ||||
							
								
								
									
										2
									
								
								man/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								man/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,2 +0,0 @@ | ||||
| ngircd.8 | ||||
| ngircd.conf.5 | ||||
| @@ -1,15 +1,12 @@ | ||||
| # | ||||
| # ngIRCd -- The Next Generation IRC Daemon | ||||
| # Copyright (c)2001,2002 by Alexander Barton (alex@barton.de) | ||||
| # Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors | ||||
| # | ||||
| # Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen | ||||
| # der GNU General Public License (GPL), wie von der Free Software Foundation | ||||
| # herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2 | ||||
| # der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version. | ||||
| # Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste | ||||
| # der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. | ||||
| # | ||||
| # $Id: Makefile.am,v 1.6 2006/12/25 16:13:26 alex Exp $ | ||||
| # This program is free software; you can redistribute it and/or modify | ||||
| # it under the terms of the GNU General Public License as published by | ||||
| # the Free Software Foundation; either version 2 of the License, or | ||||
| # (at your option) any later version. | ||||
| # Please read the file COPYING, README and AUTHORS for more information. | ||||
| # | ||||
|  | ||||
| TEMPLATE_MANS = ngircd.conf.5.tmpl ngircd.8.tmpl | ||||
| @@ -18,9 +15,9 @@ SUFFIXES = .tmpl . | ||||
|  | ||||
| .tmpl: | ||||
| 	$(AM_V_GEN)sed \ | ||||
| 	    -e s@:SBINDIR:@${sbindir}@ \ | ||||
| 	    -e s@:BINDIR:@${bindir}@ \ | ||||
| 	    -e s@:ETCDIR:@${sysconfdir}@ \ | ||||
| 	    -e "s@:SBINDIR:@${sbindir}@" \ | ||||
| 	    -e "s@:BINDIR:@${bindir}@" \ | ||||
| 	    -e "s@:ETCDIR:@${sysconfdir}@" \ | ||||
| 	    <$< >$@ | ||||
|  | ||||
| man_MANS = ngircd.conf.5 ngircd.8 | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| .\" | ||||
| .\" ngircd(8) manual page template | ||||
| .\" | ||||
| .TH ngircd 8 "Oct 2012" ngIRCd "ngIRCd Manual" | ||||
| .TH ngircd 8 "Jan 2016" ngIRCd "ngIRCd Manual" | ||||
| .SH NAME | ||||
| ngIRCd \- the "next generation" IRC daemon | ||||
| .SH SYNOPSIS | ||||
| @@ -23,13 +23,15 @@ which is a little bit exaggerated: | ||||
| .IR "lightweight Internet Relay Chat server" | ||||
| most probably would have been a better name :-) | ||||
| .PP | ||||
| Currently supported platforms include AIX, A/UX, FreeBSD, HP-UX, IRIX, | ||||
| Linux, Mac OS X, NetBSD, OpenBSD, Solaris, and Windows with Cygwin. | ||||
| .PP | ||||
| Currently supported platforms include AIX, A/UX, FreeBSD, HP-UX, Hurd, IRIX, | ||||
| Linux, Mac OS X, Minix, NetBSD, OpenBSD, Solaris, and Windows with Cygwin. | ||||
| As ngIRCd relies on UNIX standards and uses GNU automake and GNU autoconf | ||||
| there are good chances that it also supports other UNIX-based operating | ||||
| systems as well. By default, ngIRCd writes diagnostic and informational | ||||
| messages using the syslog mechanism. | ||||
| systems as well. | ||||
| .PP | ||||
| By default ngIRCd logs diagnostic and informational messages using the syslog | ||||
| mechanism, or writes directly to the console when running in the foreground | ||||
| (see below). | ||||
| .SH OPTIONS | ||||
| The default behavior of | ||||
| .BR ngircd | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| .\" | ||||
| .\" ngircd.conf(5) manual page template | ||||
| .\" | ||||
| .TH ngircd.conf 5 "Nov 2012" ngIRCd "ngIRCd Manual" | ||||
| .TH ngircd.conf 5 "Jan 2016" ngIRCd "ngIRCd Manual" | ||||
| .SH NAME | ||||
| ngircd.conf \- configuration file of ngIRCd | ||||
| .SH SYNOPSIS | ||||
| @@ -60,7 +60,7 @@ The main configuration of the server is stored in the | ||||
| section, like the server name, administrative information and the ports on | ||||
| which the server should be listening. The variables in this section have to be | ||||
| adjusted to the local requirements most of the time, whereas all the variables | ||||
| in the other sections can be left on there defaults very often. | ||||
| in the other sections can be left on their defaults very often. | ||||
| .PP | ||||
| Options in the | ||||
| .I [Limits] | ||||
| @@ -82,12 +82,13 @@ sections. And | ||||
| blocks are used to configure pre-defined ("persistent") IRC channels. | ||||
| .PP | ||||
| There can be more than one [Operator], [Server] and [Channel] section per | ||||
| configuration file (one for each operator, server, and channel), but only | ||||
| exactly one [Global], one [Limits], one [Options], and one [SSL] section. | ||||
| configuration file, one for each operator, server, and channel. [Global], | ||||
| [Limits], [Options], and [SSL] sections can occur multiple times, too, but | ||||
| each variable overwrites itself, only the last assignment is relevant. | ||||
| .SH [GLOBAL] | ||||
| The | ||||
| .I [Global] | ||||
| section of this file is used to define the main configuration of the server, | ||||
| section is used to define the main configuration of the server, | ||||
| like the server name and the ports on which the server should be listening. | ||||
| These settings depend on your personal preferences, so you should make sure | ||||
| that they correspond to your installation and setup! | ||||
| @@ -101,6 +102,12 @@ IRC network and must contain at least one dot (".") character. | ||||
| Information about the server and the administrator, used by the ADMIN | ||||
| command. This information is not required by the server but by RFC! | ||||
| .TP | ||||
| \fBHelpFile\fR (string) | ||||
| Text file which contains the ngIRCd help text. This file is required | ||||
| to display help texts when using the "HELP <cmd>" command. | ||||
| Please note: Changes made to this file take effect when ngircd starts up | ||||
| or is instructed to re-read its configuration file. | ||||
| .TP | ||||
| \fBInfo\fR (string) | ||||
| Info text of the server. This will be shown by WHOIS and LINKS requests for | ||||
| example. | ||||
| @@ -120,6 +127,12 @@ configuration file. | ||||
| \fBMotdPhrase\fR (string) | ||||
| A simple Phrase (<256 chars) if you don't want to use a MOTD file. | ||||
| .TP | ||||
| \fBNetwork\fR (string) | ||||
| The name of the IRC network to which this server belongs. This name is | ||||
| optional, should only contain ASCII characters, and can't contain spaces. | ||||
| It is only used to inform clients. The default is empty, so no network | ||||
| name is announced to clients. | ||||
| .TP | ||||
| \fBPassword\fR (string) | ||||
| Global password for all users needed to connect to the server. The default is | ||||
| empty, so no password is required. Please note: This feature is not available | ||||
| @@ -127,16 +140,16 @@ if ngIRCd is using PAM! | ||||
| .TP | ||||
| \fBPidFile\fR (string) | ||||
| This tells ngIRCd to write its current process ID to a file. Note that the | ||||
| pidfile is written AFTER chroot and switching the user ID, e.g. the directory | ||||
| the pidfile resides in must be writable by the ngIRCd user and exist in the | ||||
| chroot directory (if configured, see above). | ||||
| "PID file" is written AFTER chroot and switching the user ID, therefore the | ||||
| directory the file resides in must be writable by the ngIRCd user and exist | ||||
| in the chroot directory (if configured, see above). | ||||
| .TP | ||||
| \fBPorts\fR (list of numbers) | ||||
| Ports on which the server should listen for unencrypted connections. There | ||||
| may be more than one port, separated with commas (","). Default: 6667. | ||||
| Port number(s) on which the server should listen for unencrypted connections. | ||||
| There may be more than one port, separated with commas (","). Default: 6667. | ||||
| .TP | ||||
| \fBServerGID\fR (string or number) | ||||
| Group ID under which the ngIRCd should run; you can use the name of the | ||||
| Group ID under which the ngIRCd daemon should run; you can use the name of the | ||||
| group or the numerical ID. | ||||
| .PP | ||||
| .RS | ||||
| @@ -146,8 +159,8 @@ For this to work the server must have been started with root privileges! | ||||
| .RE | ||||
| .TP | ||||
| \fBServerUID\fR (string or number) | ||||
| User ID under which the server should run; you can use the name of the user | ||||
| or the numerical ID. | ||||
| User ID under which the ngIRCd daemon should run; you can use the name of the | ||||
| user or the numerical ID. | ||||
| .PP | ||||
| .RS | ||||
| .B Attention: | ||||
| @@ -157,13 +170,19 @@ addition, the configuration and MOTD files must be readable by this user, | ||||
| otherwise RESTART and REHASH won't work! | ||||
| .RE | ||||
| .SH [LIMITS] | ||||
| Define some limits and timeouts for this ngIRCd instance. Default values | ||||
| should be safe, but it is wise to double-check :-) | ||||
| This section is used to define some limits and timeouts for this ngIRCd | ||||
| instance. Default values should be safe, but it is wise to double-check :-) | ||||
| .TP | ||||
| \fBConnectRetry\fR (number) | ||||
| The server tries every <ConnectRetry> seconds to establish a link to not yet | ||||
| (or no longer) connected servers. Default: 60. | ||||
| .TP | ||||
| \fBIdleTimeout\fR (number) | ||||
| Number of seconds after which the whole daemon should shutdown when no | ||||
| connections are left active after handling at least one client (0: never). This | ||||
| can be useful for testing or when ngIRCd is started using "socket activation" | ||||
| with systemd(8), for example. Default: 0. | ||||
| .TP | ||||
| \fBMaxConnections\fR (number) | ||||
| Maximum number of simultaneous in- and outbound connections the server is | ||||
| allowed to accept (0: unlimited). Default: 0. | ||||
| @@ -194,13 +213,19 @@ If a client fails to answer a PING with a PONG within <PongTimeout> | ||||
| seconds, it will be disconnected by the server. Default: 20. | ||||
| .SH [OPTIONS] | ||||
| Optional features and configuration options to further tweak the behavior of | ||||
| ngIRCd. If you want to get started quickly, you most probably don't have to | ||||
| make changes here -- they are all optional. | ||||
| ngIRCd are configured in this section. If you want to get started quickly, you | ||||
| most probably don't have to make changes here -- they are all optional. | ||||
| .TP | ||||
| \fBAllowedChannelTypes\fR (string) | ||||
| List of allowed channel types (channel prefixes) for newly created channels | ||||
| on the local server. By default, all supported channel types are allowed. | ||||
| Set this variable to the empty string to disallow creation of new channels | ||||
| by local clients at all. Default: #&+ | ||||
| .TP | ||||
| \fBAllowRemoteOper\fR (boolean) | ||||
| Are IRC operators connected to remote servers allowed to control this server, | ||||
| e.g. are they allowed to use administrative commands like CONNECT, DIE, | ||||
| SQUIT, ... that affect this server? Default: no. | ||||
| If this option is active, IRC operators connected to remote servers are allowed | ||||
| to control this local server using administrative commands, for example like | ||||
| CONNECT, DIE, SQUIT etc. Default: no. | ||||
| .TP | ||||
| \fBChrootDir\fR (string) | ||||
| A directory to chroot in when everything is initialized. It doesn't need | ||||
| @@ -227,8 +252,8 @@ The Salt for cloaked hostname hashing. When undefined a random hash is | ||||
| generated after each server start. | ||||
| .TP | ||||
| \fBCloakUserToNick\fR (boolean) | ||||
| Set every clients' user name to their nickname and hide the one supplied | ||||
| by the IRC client. Default: no. | ||||
| Set every clients' user name and real name to their nickname and hide the one | ||||
| supplied by the IRC client. Default: no. | ||||
| .TP | ||||
| \fBConnectIPv4\fR (boolean) | ||||
| Set this to no if you do not want ngIRCd to connect to other IRC servers using | ||||
| @@ -240,6 +265,12 @@ Set this to no if you do not want ngIRCd to connect to other IRC servers using | ||||
| the IPv6 protocol. | ||||
| Default: yes. | ||||
| .TP | ||||
| \fBDefaultUserModes\fR (string) | ||||
| Default user mode(s) to set on new local clients. Please note that only modes | ||||
| can be set that the client could set using regular MODE commands, you can't | ||||
| set "a" (away) for example! | ||||
| Default: none. | ||||
| .TP | ||||
| \fBDNS\fR (boolean) | ||||
| If set to false, ngIRCd will not make any DNS lookups when clients connect. | ||||
| If you configure the daemon to connect to other servers, ngIRCd may still | ||||
| @@ -253,18 +284,24 @@ Users identified using IDENT are registered without the "~" character | ||||
| prepended to their user name. | ||||
| Default: yes. | ||||
| .TP | ||||
| \fBIncludeDir\fR (string) | ||||
| Directory containing configuration snippets (*.conf), that should be read in | ||||
| after parsing the current configuration file. | ||||
| Default: none. | ||||
| .TP | ||||
| \fBMorePrivacy\fR (boolean) | ||||
| This will cause ngIRCd to censor user idle time, logon time as well as the | ||||
| part/quit messages (that are sometimes used to inform everyone about which | ||||
| client software is being used). WHOWAS requests are also silently ignored. | ||||
| PART/QUIT messages (that are sometimes used to inform everyone about which | ||||
| client software is being used). WHOWAS requests are also silently ignored, | ||||
| and NAMES output doesn't list any clients for non-members. | ||||
| This option is most useful when ngIRCd is being used together with | ||||
| anonymizing software such as TOR or I2P and one does not wish to make it | ||||
| too easy to collect statistics on the users. | ||||
| Default: no. | ||||
| .TP | ||||
| \fBNoticeAuth\fR (boolean) | ||||
| \fBNoticeBeforeRegistration\fR (boolean) | ||||
| Normally ngIRCd doesn't send any messages to a client until it is registered. | ||||
| Enable this option to let the daemon send "NOTICE AUTH" messages to clients | ||||
| Enable this option to let the daemon send "NOTICE *" messages to clients | ||||
| while connecting. Default: no. | ||||
| .TP | ||||
| \fBOperCanUseMode\fR (boolean) | ||||
| @@ -302,11 +339,13 @@ able to distinguish between Ident'ified and PAM-authenticated users: both | ||||
| don't have a "~" character prepended to their respective user names! | ||||
| Default: no. | ||||
| .TP | ||||
| \fBPredefChannelsOnly\fR (boolean) | ||||
| If enabled, no new channels can be created. Useful if you do not want to have | ||||
| other channels than those defined in [Channel] sections in the configuration | ||||
| file on this server. | ||||
| Default: no. | ||||
| \fBPAMServiceName\fR (string) | ||||
| When PAM is enabled, this value determines the used PAM configuration. | ||||
| This setting allows to run multiple ngIRCd instances with different | ||||
| PAM configurations on each instance. If you set it to "ngircd-foo", | ||||
| PAM will use /etc/pam.d/ngircd-foo instead of the default | ||||
| /etc/pam.d/ngircd. | ||||
| Default: ngircd. | ||||
| .TP | ||||
| \fBRequireAuthPing\fR (boolean) | ||||
| Let ngIRCd send an "authentication PING" when a new client connects, and | ||||
| @@ -343,6 +382,12 @@ when it is compiled with support for SSL using OpenSSL or GnuTLS! | ||||
| \fBCertFile\fR (string) | ||||
| SSL Certificate file of the private server key. | ||||
| .TP | ||||
| \fBCipherList\fR (string) | ||||
| Select cipher suites allowed for SSL/TLS connections.  This defaults to | ||||
| "HIGH:!aNULL:@STRENGTH:!SSLv3" (OpenSSL) or "SECURE128:-VERS-SSL3.0" (GnuTLS). | ||||
| Please see 'man 1ssl ciphers' (OpenSSL) and 'man 3 gnutls_priority_init' | ||||
| (GnuTLS) for details. | ||||
| .TP | ||||
| \fBDHFile\fR (string) | ||||
| Name of the Diffie-Hellman Parameter file. Can be created with GnuTLS | ||||
| "certtool \-\-generate-dh-params" or "openssl dhparam". If this file is not | ||||
|   | ||||
							
								
								
									
										4
									
								
								src/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								src/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +0,0 @@ | ||||
| config.h | ||||
| config.h.in | ||||
| config.h.in~ | ||||
| stamp-h1 | ||||
							
								
								
									
										1
									
								
								src/ipaddr/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								src/ipaddr/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1 +0,0 @@ | ||||
| Makefile.am | ||||
| @@ -23,7 +23,7 @@ | ||||
| GLOBAL bool | ||||
| ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port) | ||||
| { | ||||
| #ifdef HAVE_GETADDRINFO | ||||
| #ifdef HAVE_WORKING_GETADDRINFO | ||||
| 	int ret; | ||||
| 	char portstr[64]; | ||||
| 	struct addrinfo *res0; | ||||
| @@ -49,8 +49,8 @@ ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port) | ||||
| 	if (ret != 0) | ||||
| 		return false; | ||||
|  | ||||
| 	assert(sizeof(*addr) >= res0->ai_addrlen); | ||||
| 	if (sizeof(*addr) >= res0->ai_addrlen) | ||||
| 	assert(sizeof(*addr) >= (size_t)res0->ai_addrlen); | ||||
| 	if (sizeof(*addr) >= (size_t)res0->ai_addrlen) | ||||
| 		memcpy(addr, res0->ai_addr, res0->ai_addrlen); | ||||
| 	else | ||||
| 		ret = -1; | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #ifndef NG_IPADDR_HDR | ||||
| #define NG_IPADDR_HDR | ||||
|  | ||||
| #include "portab.h" | ||||
|  | ||||
| /** | ||||
| @@ -12,6 +13,7 @@ | ||||
|  */ | ||||
|  | ||||
| #include <assert.h> | ||||
| #include <string.h> | ||||
| #include <sys/socket.h> | ||||
| #include <netinet/in.h> | ||||
|  | ||||
| @@ -47,6 +49,7 @@ typedef struct NG_IP_ADDR_DONTUSE ng_ipaddr_t; | ||||
| static inline int | ||||
| ng_ipaddr_af(const ng_ipaddr_t *a) | ||||
| { | ||||
| 	assert(a != NULL); | ||||
| #ifdef WANT_IPV6 | ||||
| 	return a->sa.sa_family; | ||||
| #else | ||||
| @@ -59,6 +62,7 @@ ng_ipaddr_af(const ng_ipaddr_t *a) | ||||
| static inline socklen_t | ||||
| ng_ipaddr_salen(const ng_ipaddr_t *a) | ||||
| { | ||||
| 	assert(a != NULL); | ||||
| #ifdef WANT_IPV6 | ||||
| 	assert(a->sa.sa_family == AF_INET || a->sa.sa_family == AF_INET6); | ||||
| 	if (a->sa.sa_family == AF_INET6) | ||||
| @@ -75,11 +79,14 @@ ng_ipaddr_getport(const ng_ipaddr_t *a) | ||||
| #ifdef WANT_IPV6 | ||||
| 	int af = a->sa.sa_family; | ||||
|  | ||||
| 	assert(a != NULL); | ||||
| 	assert(af == AF_INET || af == AF_INET6); | ||||
|  | ||||
| 	if (af == AF_INET6) | ||||
| 		return ntohs(a->sin6.sin6_port); | ||||
| #endif /* WANT_IPV6 */ | ||||
|  | ||||
| 	assert(a != NULL); | ||||
| 	assert(a->sin4.sin_family == AF_INET); | ||||
| 	return ntohs(a->sin4.sin_port); | ||||
| } | ||||
| @@ -109,12 +116,15 @@ GLOBAL bool ng_ipaddr_tostr_r PARAMS((const ng_ipaddr_t *addr, char *dest)); | ||||
| static inline const char* | ||||
| ng_ipaddr_tostr(const ng_ipaddr_t *addr) | ||||
| { | ||||
| 	assert(addr != NULL); | ||||
| 	return inet_ntoa(addr->sin4.sin_addr); | ||||
| } | ||||
|  | ||||
| static inline bool | ||||
| ng_ipaddr_tostr_r(const ng_ipaddr_t *addr, char *d) | ||||
| { | ||||
| 	assert(addr != NULL); | ||||
| 	assert(d != NULL); | ||||
| 	strlcpy(d, inet_ntoa(addr->sin4.sin_addr), NG_INET_ADDRSTRLEN); | ||||
| 	return true; | ||||
| } | ||||
|   | ||||
							
								
								
									
										4
									
								
								src/ngircd/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								src/ngircd/.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +0,0 @@ | ||||
| Makefile.am | ||||
| check-help | ||||
| check-version | ||||
| ngircd | ||||
| @@ -86,6 +86,7 @@ noinst_HEADERS = \ | ||||
| 	irc-encoding.h \ | ||||
| 	irc-info.h \ | ||||
| 	irc-login.h \ | ||||
| 	irc-macros.h \ | ||||
| 	irc-metadata.h \ | ||||
| 	irc-mode.h \ | ||||
| 	irc-op.h \ | ||||
|   | ||||
| @@ -14,16 +14,19 @@ | ||||
|  * Functions to dynamically allocate arrays. | ||||
|  */ | ||||
|  | ||||
| /* Additionan debug messages related to array handling: 0=off / 1=on */ | ||||
| #define DEBUG_ARRAY 0 | ||||
|  | ||||
| #include "array.h" | ||||
|  | ||||
| #include <assert.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
| #include <unistd.h> | ||||
|  | ||||
| #include "log.h" | ||||
|  | ||||
| /* Enable more Debug messages in alloc / append / memmove code. */ | ||||
| /* #define DEBUG_ARRAY */ | ||||
| #if DEBUG_ARRAY | ||||
| # include "log.h" | ||||
| #endif | ||||
|  | ||||
| #define array_UNUSABLE(x)	( !(x)->mem ) | ||||
|  | ||||
| @@ -64,7 +67,7 @@ array_alloc(array * a, size_t size, size_t pos) | ||||
| 		return NULL; | ||||
|  | ||||
| 	if (a->allocated < alloc) { | ||||
| #ifdef DEBUG_ARRAY | ||||
| #if DEBUG_ARRAY | ||||
| 		Log(LOG_DEBUG, "array_alloc(): changing size from %u to %u bytes.", | ||||
| 		    a->allocated, alloc); | ||||
| #endif | ||||
| @@ -165,7 +168,7 @@ array_catb(array * dest, const char *src, size_t len) | ||||
|  | ||||
| 	assert(ptr != NULL); | ||||
|  | ||||
| #ifdef DEBUG_ARRAY | ||||
| #if DEBUG_ARRAY | ||||
| 	Log(LOG_DEBUG, | ||||
| 	    "array_catb(): appending %u bytes to array (now %u bytes in array).", | ||||
| 	    len, tmp); | ||||
| @@ -245,7 +248,7 @@ void | ||||
| array_free(array * a) | ||||
| { | ||||
| 	assert(a != NULL); | ||||
| #ifdef DEBUG_ARRAY | ||||
| #if DEBUG_ARRAY | ||||
| 	Log(LOG_DEBUG, | ||||
| 	    "array_free(): %u bytes free'd (%u bytes still used at time of free()).", | ||||
| 	    a->allocated, a->used); | ||||
| @@ -311,7 +314,7 @@ array_moveleft(array * a, size_t membersize, size_t pos) | ||||
| 	if (!bytepos) | ||||
| 		return;	/* nothing to do */ | ||||
|  | ||||
| #ifdef DEBUG_ARRAY | ||||
| #if DEBUG_ARRAY | ||||
| 	Log(LOG_DEBUG, | ||||
| 	    "array_moveleft(): %u bytes used in array, starting at position %u.", | ||||
| 	    a->used, bytepos); | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -18,41 +18,32 @@ | ||||
|  * Channel management | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
| #include <errno.h> | ||||
| #include <stdio.h> | ||||
| #include <strings.h> | ||||
| #include <time.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "conn-func.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "channel.h" | ||||
|  | ||||
| #include "imp.h" | ||||
| #include "irc-write.h" | ||||
| #include "conf.h" | ||||
| #include "hash.h" | ||||
| #include "lists.h" | ||||
| #include "log.h" | ||||
| #include "messages.h" | ||||
| #include "match.h" | ||||
|  | ||||
| #include "exp.h" | ||||
|  | ||||
|  | ||||
| #define REMOVE_PART 0 | ||||
| #define REMOVE_QUIT 1 | ||||
| #define REMOVE_KICK 2 | ||||
|  | ||||
|  | ||||
| static CHANNEL *My_Channels; | ||||
| static CL2CHAN *My_Cl2Chan; | ||||
|  | ||||
|  | ||||
| static CL2CHAN *Get_Cl2Chan PARAMS(( CHANNEL *Chan, CLIENT *Client )); | ||||
| static CL2CHAN *Add_Client PARAMS(( CHANNEL *Chan, CLIENT *Client )); | ||||
| static bool Remove_Client PARAMS(( int Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, const char *Reason, bool InformServer )); | ||||
| @@ -131,11 +122,11 @@ Channel_InitPredefined( void ) | ||||
|  | ||||
| 		new_chan = Channel_Create(conf_chan->name); | ||||
| 		if (!new_chan) { | ||||
| 			Log(LOG_ERR, "Can't create pre-defined channel \"%s\"", | ||||
| 			Log(LOG_ERR, "Can't create pre-defined channel \"%s\"!", | ||||
| 							conf_chan->name); | ||||
| 			continue; | ||||
| 		} | ||||
| 		Log(LOG_INFO, "Created pre-defined channel \"%s\"", | ||||
| 		Log(LOG_INFO, "Created pre-defined channel \"%s\".", | ||||
| 						conf_chan->name); | ||||
|  | ||||
| 		Channel_ModeAdd(new_chan, 'P'); | ||||
| @@ -223,7 +214,7 @@ Channel_Join( CLIENT *Client, const char *Name ) | ||||
|  | ||||
| 	/* Check that the channel name is valid */ | ||||
| 	if (! Channel_IsValidName(Name)) { | ||||
| 		IRC_WriteStrClient(Client, ERR_NOSUCHCHANNEL_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_NOSUCHCHANNEL_MSG, | ||||
| 				   Client_ID(Client), Name); | ||||
| 		return false; | ||||
| 	} | ||||
| @@ -268,14 +259,14 @@ Channel_Part(CLIENT * Client, CLIENT * Origin, const char *Name, const char *Rea | ||||
| 	/* Check that specified channel exists */ | ||||
| 	chan = Channel_Search(Name); | ||||
| 	if (!chan) { | ||||
| 		IRC_WriteStrClient(Client, ERR_NOSUCHCHANNEL_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_NOSUCHCHANNEL_MSG, | ||||
| 				   Client_ID(Client), Name); | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	/* Check that the client is in the channel */ | ||||
| 	if (!Get_Cl2Chan(chan, Client)) { | ||||
| 		IRC_WriteStrClient(Client, ERR_NOTONCHANNEL_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_NOTONCHANNEL_MSG, | ||||
| 				   Client_ID(Client), Name); | ||||
| 		return false; | ||||
| 	} | ||||
| @@ -299,7 +290,6 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name, | ||||
| 	     const char *Reason ) | ||||
| { | ||||
| 	CHANNEL *chan; | ||||
| 	char *ptr, *target_modes; | ||||
| 	bool can_kick = false; | ||||
|  | ||||
| 	assert(Peer != NULL); | ||||
| @@ -310,9 +300,9 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name, | ||||
|  | ||||
| 	/* Check that channel exists */ | ||||
| 	chan = Channel_Search( Name ); | ||||
| 	if( ! chan ) | ||||
| 	{ | ||||
| 		IRC_WriteStrClient( Origin, ERR_NOSUCHCHANNEL_MSG, Client_ID( Origin ), Name ); | ||||
| 	if (!chan) { | ||||
| 		IRC_WriteErrClient(Origin, ERR_NOSUCHCHANNEL_MSG, | ||||
| 				   Client_ID(Origin), Name); | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| @@ -320,75 +310,68 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name, | ||||
| 	    Client_Type(Origin) != CLIENT_SERVICE) { | ||||
| 		/* Check that user is on the specified channel */ | ||||
| 		if (!Channel_IsMemberOf(chan, Origin)) { | ||||
| 			IRC_WriteStrClient( Origin, ERR_NOTONCHANNEL_MSG, | ||||
| 					    Client_ID(Origin), Name); | ||||
| 			return; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	if(Client_Type(Peer) == CLIENT_USER) { | ||||
| 		/* Channel mode 'Q' and user mode 'q' on target: nobody but | ||||
| 		 * IRC Operators and servers can kick the target user */ | ||||
| 		if ((strchr(Channel_Modes(chan), 'Q') | ||||
| 		     || Client_HasMode(Target, 'q') | ||||
| 		     || Client_Type(Target) == CLIENT_SERVICE) | ||||
| 		    && !Client_HasMode(Origin, 'o')) { | ||||
| 			IRC_WriteStrClient(Origin, ERR_KICKDENY_MSG, | ||||
| 					   Client_ID(Origin), Name, | ||||
| 					   Client_ID(Target)); | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		/* Check if client has the rights to kick target */ | ||||
| 		ptr = Channel_UserModes(chan, Peer); | ||||
| 		target_modes = Channel_UserModes(chan, Target); | ||||
| 		while(*ptr) { | ||||
| 			/* Owner can kick everyone */ | ||||
| 			if ( *ptr == 'q') { | ||||
| 				can_kick = true; | ||||
| 				break; | ||||
| 			} | ||||
| 			/* Admin can't kick owner */ | ||||
| 			if ( *ptr == 'a' ) { | ||||
| 				if (!strchr(target_modes, 'q')) { | ||||
| 					can_kick = true; | ||||
| 					break; | ||||
| 				} | ||||
| 			} | ||||
| 			/* Op can't kick owner | admin */ | ||||
| 			if ( *ptr == 'o' ) { | ||||
| 				if (!strchr(target_modes, 'q') && | ||||
| 				    !strchr(target_modes, 'a')) { | ||||
| 					can_kick = true; | ||||
| 					break; | ||||
| 				} | ||||
| 			} | ||||
| 			/* Half Op can't kick owner | admin | op */  | ||||
| 			if ( *ptr == 'h' ) { | ||||
| 				if (!strchr(target_modes, 'q') && | ||||
| 				    !strchr(target_modes, 'a') && | ||||
| 				    !strchr(target_modes, 'o')) { | ||||
| 					can_kick = true; | ||||
| 					break; | ||||
| 				} | ||||
| 			} | ||||
| 			ptr++; | ||||
| 		} | ||||
|  | ||||
| 		if(!can_kick) { | ||||
| 			IRC_WriteStrClient(Origin, ERR_CHANOPPRIVTOOLOW_MSG, | ||||
| 				Client_ID(Origin), Name); | ||||
| 			IRC_WriteErrClient(Origin, ERR_NOTONCHANNEL_MSG, | ||||
| 					   Client_ID(Origin), Name); | ||||
| 			return; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/* Check that the client to be kicked is on the specified channel */ | ||||
| 	if (!Channel_IsMemberOf(chan, Target)) { | ||||
| 		IRC_WriteStrClient(Origin, ERR_USERNOTINCHANNEL_MSG, | ||||
| 		IRC_WriteErrClient(Origin, ERR_USERNOTINCHANNEL_MSG, | ||||
| 				   Client_ID(Origin), Client_ID(Target), Name ); | ||||
| 		return; | ||||
| 	} | ||||
|  | ||||
| 	if(Client_Type(Peer) == CLIENT_USER) { | ||||
| 		/* Channel mode 'Q' and user mode 'q' on target: nobody but | ||||
| 		 * IRC Operators and servers can kick the target user */ | ||||
| 		if ((Channel_HasMode(chan, 'Q') | ||||
| 		     || Client_HasMode(Target, 'q') | ||||
| 		     || Client_Type(Target) == CLIENT_SERVICE) | ||||
| 		    && !Client_HasMode(Origin, 'o')) { | ||||
| 			IRC_WriteErrClient(Origin, ERR_KICKDENY_MSG, | ||||
| 					   Client_ID(Origin), Name, | ||||
| 					   Client_ID(Target)); | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		/* Check if client has the rights to kick target */ | ||||
|  | ||||
| 		/* Owner can kick everyone */ | ||||
| 		if (Channel_UserHasMode(chan, Peer, 'q')) | ||||
| 			can_kick = true; | ||||
|  | ||||
| 		/* Admin can't kick owner */ | ||||
| 		else if (Channel_UserHasMode(chan, Peer, 'a') && | ||||
| 		    !Channel_UserHasMode(chan, Target, 'q')) | ||||
| 			can_kick = true; | ||||
|  | ||||
| 		/* Op can't kick owner | admin */ | ||||
| 		else if (Channel_UserHasMode(chan, Peer, 'o') && | ||||
| 		    !Channel_UserHasMode(chan, Target, 'q') && | ||||
| 		    !Channel_UserHasMode(chan, Target, 'a')) | ||||
| 			can_kick = true; | ||||
|  | ||||
| 		/* Half Op can't kick owner | admin | op */ | ||||
| 		else if (Channel_UserHasMode(chan, Peer, 'h') && | ||||
| 		    !Channel_UserHasMode(chan, Target, 'q') && | ||||
| 		    !Channel_UserHasMode(chan, Target, 'a') && | ||||
| 		    !Channel_UserHasMode(chan, Target, 'o')) | ||||
| 			can_kick = true; | ||||
|  | ||||
| 		/* IRC operators & IRCd with OperCanMode enabled | ||||
| 		 * can kick anyways regardless of privilege */ | ||||
| 		else if(Client_HasMode(Origin, 'o') && Conf_OperCanMode) | ||||
| 		    can_kick = true; | ||||
|  | ||||
| 		if(!can_kick) { | ||||
| 			IRC_WriteErrClient(Origin, ERR_CHANOPPRIVTOOLOW_MSG, | ||||
| 					   Client_ID(Origin), Name); | ||||
| 			return; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/* Kick Client from channel */ | ||||
| 	Remove_Client( REMOVE_KICK, chan, Target, Origin, Reason, true); | ||||
| } /* Channel_Kick */ | ||||
| @@ -433,7 +416,7 @@ Channel_CountVisible (CLIENT *Client) | ||||
| 	c = My_Channels; | ||||
| 	while(c) { | ||||
| 		if (Client) { | ||||
| 			if (!strchr(Channel_Modes(c), 's') | ||||
| 			if (!Channel_HasMode(c, 's') | ||||
| 			    || Channel_IsMemberOf(c, Client)) | ||||
| 				count++; | ||||
| 		} else | ||||
| @@ -499,6 +482,14 @@ Channel_Modes( CHANNEL *Chan ) | ||||
| } /* Channel_Modes */ | ||||
|  | ||||
|  | ||||
| GLOBAL bool | ||||
| Channel_HasMode( CHANNEL *Chan, char Mode ) | ||||
| { | ||||
| 	assert( Chan != NULL ); | ||||
| 	return strchr( Chan->modes, Mode ) != NULL; | ||||
| } /* Channel_HasMode */ | ||||
|  | ||||
|  | ||||
| GLOBAL char * | ||||
| Channel_Key( CHANNEL *Chan ) | ||||
| { | ||||
| @@ -636,7 +627,7 @@ Channel_ModeAdd( CHANNEL *Chan, char Mode ) | ||||
| 	assert( Chan != NULL ); | ||||
|  | ||||
| 	x[0] = Mode; x[1] = '\0'; | ||||
| 	if( ! strchr( Chan->modes, x[0] )) | ||||
| 	if( ! Channel_HasMode( Chan, x[0] )) | ||||
| 	{ | ||||
| 		/* Channel does not have this mode yet, set it */ | ||||
| 		strlcat( Chan->modes, x, sizeof( Chan->modes )); | ||||
| @@ -745,6 +736,13 @@ Channel_UserModes( CHANNEL *Chan, CLIENT *Client ) | ||||
| } /* Channel_UserModes */ | ||||
|  | ||||
|  | ||||
| GLOBAL bool | ||||
| Channel_UserHasMode( CHANNEL *Chan, CLIENT *Client, char Mode ) | ||||
| { | ||||
| 	return strchr(Channel_UserModes(Chan, Client), Mode) != NULL; | ||||
| } /* Channel_UserHasMode */ | ||||
|  | ||||
|  | ||||
| GLOBAL bool | ||||
| Channel_IsMemberOf( CHANNEL *Chan, CLIENT *Client ) | ||||
| { | ||||
| @@ -873,15 +871,15 @@ Can_Send_To_Channel(CHANNEL *Chan, CLIENT *From) | ||||
|  | ||||
| 	if (Channel_IsMemberOf(Chan, From)) { | ||||
| 		is_member = true; | ||||
| 		if (strchr(Channel_UserModes(Chan, From), 'v')) | ||||
| 		if (Channel_UserHasMode(Chan, From, 'v')) | ||||
| 			has_voice = true; | ||||
| 		if (strchr(Channel_UserModes(Chan, From), 'h')) | ||||
| 		if (Channel_UserHasMode(Chan, From, 'h')) | ||||
| 			is_halfop = true; | ||||
| 		if (strchr(Channel_UserModes(Chan, From), 'o')) | ||||
| 		if (Channel_UserHasMode(Chan, From, 'o')) | ||||
| 			is_op = true; | ||||
| 		if (strchr(Channel_UserModes(Chan, From), 'a')) | ||||
| 		if (Channel_UserHasMode(Chan, From, 'a')) | ||||
| 			is_chanadmin = true; | ||||
| 		if (strchr(Channel_UserModes(Chan, From), 'q')) | ||||
| 		if (Channel_UserHasMode(Chan, From, 'q')) | ||||
| 			is_owner = true; | ||||
| 	} | ||||
|  | ||||
| @@ -891,17 +889,17 @@ Can_Send_To_Channel(CHANNEL *Chan, CLIENT *From) | ||||
| 	 * If channel mode n set: non-members cannot send to channel. | ||||
| 	 * If channel mode m set: need voice. | ||||
| 	 */ | ||||
| 	if (strchr(Channel_Modes(Chan), 'n') && !is_member) | ||||
| 	if (Channel_HasMode(Chan, 'n') && !is_member) | ||||
| 		return false; | ||||
|  | ||||
| 	if (strchr(Channel_Modes(Chan), 'M') && !Client_HasMode(From, 'R') | ||||
| 	if (Channel_HasMode(Chan, 'M') && !Client_HasMode(From, 'R') | ||||
| 	    && !Client_HasMode(From, 'o')) | ||||
| 		return false; | ||||
|  | ||||
| 	if (has_voice || is_halfop || is_op || is_chanadmin || is_owner) | ||||
| 		return true; | ||||
|  | ||||
| 	if (strchr(Channel_Modes(Chan), 'm')) | ||||
| 	if (Channel_HasMode(Chan, 'm')) | ||||
| 		return false; | ||||
|  | ||||
| 	if (Lists_Check(&Chan->list_excepts, From)) | ||||
| @@ -918,19 +916,20 @@ Channel_Write(CHANNEL *Chan, CLIENT *From, CLIENT *Client, const char *Command, | ||||
| 	if (!Can_Send_To_Channel(Chan, From)) { | ||||
| 		if (! SendErrors) | ||||
| 			return CONNECTED;	/* no error, see RFC 2812 */ | ||||
| 		if (strchr(Channel_Modes(Chan), 'M')) | ||||
| 			return IRC_WriteStrClient(From, ERR_NEEDREGGEDNICK_MSG, | ||||
| 		if (Channel_HasMode(Chan, 'M')) | ||||
| 			return IRC_WriteErrClient(From, ERR_NEEDREGGEDNICK_MSG, | ||||
| 						  Client_ID(From), Channel_Name(Chan)); | ||||
| 		else | ||||
| 			return IRC_WriteStrClient(From, ERR_CANNOTSENDTOCHAN_MSG, | ||||
| 			return IRC_WriteErrClient(From, ERR_CANNOTSENDTOCHAN_MSG, | ||||
| 					  Client_ID(From), Channel_Name(Chan)); | ||||
| 	} | ||||
|  | ||||
| 	if (Client_Conn(From) > NONE) | ||||
| 		Conn_UpdateIdle(Client_Conn(From)); | ||||
|  | ||||
| 	return IRC_WriteStrChannelPrefix(Client, Chan, From, true, | ||||
| 			"%s %s :%s", Command, Channel_Name(Chan), Text); | ||||
| 	IRC_WriteStrChannelPrefix(Client, Chan, From, true, "%s %s :%s", | ||||
| 				  Command, Channel_Name(Chan), Text); | ||||
| 	return CONNECTED; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -1045,7 +1044,7 @@ Remove_Client( int Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, const ch | ||||
| 	switch( Type ) | ||||
| 	{ | ||||
| 		case REMOVE_QUIT: | ||||
| 			/* QUIT: other servers have already been notified,  | ||||
| 			/* QUIT: other servers have already been notified, | ||||
| 			 * see Client_Destroy(); so only inform other clients | ||||
| 			 * in same channel. */ | ||||
| 			assert( InformServer == false ); | ||||
| @@ -1089,7 +1088,7 @@ Remove_Client( int Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, const ch | ||||
| 	} | ||||
|  | ||||
| 	/* When channel is empty and is not pre-defined, delete */ | ||||
| 	if( ! strchr( Channel_Modes( Chan ), 'P' )) | ||||
| 	if( ! Channel_HasMode( Chan, 'P' )) | ||||
| 	{ | ||||
| 		if( ! Get_First_Cl2Chan( NULL, Chan )) Delete_Channel( Chan ); | ||||
| 	} | ||||
| @@ -1099,29 +1098,29 @@ Remove_Client( int Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, const ch | ||||
|  | ||||
|  | ||||
| GLOBAL bool | ||||
| Channel_AddBan(CHANNEL *c, const char *mask ) | ||||
| Channel_AddBan(CHANNEL *c, const char *mask, const char *who ) | ||||
| { | ||||
| 	struct list_head *h = Channel_GetListBans(c); | ||||
| 	LogDebug("Adding \"%s\" to \"%s\" ban list", mask, Channel_Name(c)); | ||||
| 	return Lists_Add(h, mask, false, NULL); | ||||
| 	return Lists_Add(h, mask, time(NULL), who, false); | ||||
| } | ||||
|  | ||||
|  | ||||
| GLOBAL bool | ||||
| Channel_AddExcept(CHANNEL *c, const char *mask ) | ||||
| Channel_AddExcept(CHANNEL *c, const char *mask, const char *who ) | ||||
| { | ||||
| 	struct list_head *h = Channel_GetListExcepts(c); | ||||
| 	LogDebug("Adding \"%s\" to \"%s\" exception list", mask, Channel_Name(c)); | ||||
| 	return Lists_Add(h, mask, false, NULL); | ||||
| 	return Lists_Add(h, mask, time(NULL), who, false); | ||||
| } | ||||
|  | ||||
|  | ||||
| GLOBAL bool | ||||
| Channel_AddInvite(CHANNEL *c, const char *mask, bool onlyonce) | ||||
| Channel_AddInvite(CHANNEL *c, const char *mask, bool onlyonce, const char *who ) | ||||
| { | ||||
| 	struct list_head *h = Channel_GetListInvites(c); | ||||
| 	LogDebug("Adding \"%s\" to \"%s\" invite list", mask, Channel_Name(c)); | ||||
| 	return Lists_Add(h, mask, onlyonce, NULL); | ||||
| 	return Lists_Add(h, mask, time(NULL), who, onlyonce); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -1138,7 +1137,9 @@ ShowChannelList(struct list_head *head, CLIENT *Client, CHANNEL *Channel, | ||||
| 	while (e) { | ||||
| 		if (!IRC_WriteStrClient(Client, msg, Client_ID(Client), | ||||
| 					Channel_Name(Channel), | ||||
| 					Lists_GetMask(e))) | ||||
| 					Lists_GetMask(e), | ||||
| 					Lists_GetReason(e), | ||||
| 					Lists_GetValidity(e))) | ||||
| 			return DISCONNECTED; | ||||
| 		e = Lists_GetNext(e); | ||||
| 	} | ||||
| @@ -1217,7 +1218,7 @@ Channel_CheckKey(CHANNEL *Chan, CLIENT *Client, const char *Key) | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Key != NULL); | ||||
|  | ||||
| 	if (!strchr(Chan->modes, 'k')) | ||||
| 	if (!Channel_HasMode(Chan, 'k')) | ||||
| 		return true; | ||||
| 	if (*Key == '\0') | ||||
| 		return false; | ||||
|   | ||||
| @@ -79,7 +79,6 @@ GLOBAL unsigned long Channel_MemberCount PARAMS(( CHANNEL *Chan )); | ||||
| GLOBAL int Channel_CountForUser PARAMS(( CLIENT *Client )); | ||||
|  | ||||
| GLOBAL const char *Channel_Name PARAMS(( const CHANNEL *Chan )); | ||||
| GLOBAL char *Channel_Modes PARAMS(( CHANNEL *Chan )); | ||||
| GLOBAL char *Channel_Topic PARAMS(( CHANNEL *Chan )); | ||||
| GLOBAL char *Channel_Key PARAMS(( CHANNEL *Chan )); | ||||
| GLOBAL unsigned long Channel_MaxUsers PARAMS(( CHANNEL *Chan )); | ||||
| @@ -106,9 +105,12 @@ GLOBAL bool Channel_IsValidName PARAMS(( const char *Name )); | ||||
|  | ||||
| GLOBAL bool Channel_ModeAdd PARAMS(( CHANNEL *Chan, char Mode )); | ||||
| GLOBAL bool Channel_ModeDel PARAMS(( CHANNEL *Chan, char Mode )); | ||||
| GLOBAL bool Channel_HasMode PARAMS(( CHANNEL *Chan, char Mode )); | ||||
| GLOBAL char *Channel_Modes PARAMS(( CHANNEL *Chan )); | ||||
|  | ||||
| GLOBAL bool Channel_UserModeAdd PARAMS(( CHANNEL *Chan, CLIENT *Client, char Mode )); | ||||
| GLOBAL bool Channel_UserModeDel PARAMS(( CHANNEL *Chan, CLIENT *Client, char Mode )); | ||||
| GLOBAL bool Channel_UserHasMode PARAMS(( CHANNEL *Chan, CLIENT *Client, char Mode )); | ||||
| GLOBAL char *Channel_UserModes PARAMS(( CHANNEL *Chan, CLIENT *Client )); | ||||
|  | ||||
| GLOBAL bool Channel_IsMemberOf PARAMS(( CHANNEL *Chan, CLIENT *Client )); | ||||
| @@ -125,10 +127,10 @@ GLOBAL char *Channel_TopicWho PARAMS(( CHANNEL *Chan )); | ||||
| GLOBAL unsigned int Channel_CreationTime PARAMS(( CHANNEL *Chan )); | ||||
| #endif | ||||
|  | ||||
| GLOBAL bool Channel_AddBan PARAMS((CHANNEL *c, const char *Mask)); | ||||
| GLOBAL bool Channel_AddExcept PARAMS((CHANNEL *c, const char *Mask)); | ||||
| GLOBAL bool Channel_AddBan PARAMS((CHANNEL *c, const char *Mask, const char *who)); | ||||
| GLOBAL bool Channel_AddExcept PARAMS((CHANNEL *c, const char *Mask, const char *who)); | ||||
| GLOBAL bool Channel_AddInvite PARAMS((CHANNEL *c, const char *Mask, | ||||
| 				      bool OnlyOnce)); | ||||
| 				      bool OnlyOnce, const char *who)); | ||||
|  | ||||
| GLOBAL bool Channel_ShowBans PARAMS((CLIENT *client, CHANNEL *c)); | ||||
| GLOBAL bool Channel_ShowExcepts PARAMS((CLIENT *client, CHANNEL *c)); | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,25 +16,17 @@ | ||||
|  * User class management. | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "array.h" | ||||
| #include "conn.h" | ||||
| #include "client.h" | ||||
| #include "lists.h" | ||||
| #include "match.h" | ||||
| #include "stdio.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "class.h" | ||||
|  | ||||
| struct list_head My_Classes[CLASS_COUNT]; | ||||
|  | ||||
| char Reject_Reason[COMMAND_LEN]; | ||||
|  | ||||
| GLOBAL void | ||||
| Class_Init(void) | ||||
| { | ||||
| @@ -49,32 +41,31 @@ Class_Exit(void) | ||||
| 	for (i = 0; i < CLASS_COUNT; Lists_Free(&My_Classes[i++])); | ||||
| } | ||||
|  | ||||
| GLOBAL char * | ||||
| Class_GetMemberReason(const int Class, CLIENT *Client) | ||||
| GLOBAL bool | ||||
| Class_GetMemberReason(const int Class, CLIENT *Client, char *reason, size_t len) | ||||
| { | ||||
| 	char *reason; | ||||
| 	char str[COMMAND_LEN]; | ||||
|  | ||||
| 	assert(Class < CLASS_COUNT); | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	reason = Lists_CheckReason(&My_Classes[Class], Client); | ||||
| 	if (!reason) | ||||
| 		return NULL; | ||||
| 	strlcpy(str, "listed", sizeof(str)); | ||||
|  | ||||
| 	if (!*reason) | ||||
| 		reason = "listed"; | ||||
| 	if (!Lists_CheckReason(&My_Classes[Class], Client, str, sizeof(str))) | ||||
| 		return false; | ||||
|  | ||||
| 	switch(Class) { | ||||
| 		case CLASS_GLINE: | ||||
| 			snprintf(Reject_Reason, sizeof(Reject_Reason), | ||||
| 				 "\"%s\" (G-Line)", reason); | ||||
| 			return Reject_Reason; | ||||
| 			snprintf(reason, len, "\"%s\" (G-Line)", str); | ||||
| 			break; | ||||
| 		case CLASS_KLINE: | ||||
| 			snprintf(Reject_Reason, sizeof(Reject_Reason), | ||||
| 				 "\"%s\" (K-Line)", reason); | ||||
| 			return Reject_Reason; | ||||
| 			snprintf(reason, len, "\"%s\" (K-Line)", str); | ||||
| 			break; | ||||
| 		default: | ||||
| 			snprintf(reason, len, "%s", str); | ||||
| 			break; | ||||
| 	} | ||||
| 	return reason; | ||||
| 	return true; | ||||
| } | ||||
|  | ||||
| /** | ||||
| @@ -88,15 +79,13 @@ Class_GetMemberReason(const int Class, CLIENT *Client) | ||||
| GLOBAL bool | ||||
| Class_HandleServerBans(CLIENT *Client) | ||||
| { | ||||
| 	char *rejectptr; | ||||
| 	char reject[COMMAND_LEN]; | ||||
|  | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	rejectptr = Class_GetMemberReason(CLASS_GLINE, Client); | ||||
| 	if (!rejectptr) | ||||
| 		rejectptr = Class_GetMemberReason(CLASS_KLINE, Client); | ||||
| 	if (rejectptr) { | ||||
| 		Client_Reject(Client, rejectptr, true); | ||||
| 	if (Class_GetMemberReason(CLASS_GLINE, Client, reject, sizeof(reject)) || | ||||
| 	    Class_GetMemberReason(CLASS_KLINE, Client, reject, sizeof(reject))) { | ||||
| 		Client_Reject(Client, reject, true); | ||||
| 		return DISCONNECTED; | ||||
| 	} | ||||
|  | ||||
| @@ -105,24 +94,30 @@ Class_HandleServerBans(CLIENT *Client) | ||||
|  | ||||
|  | ||||
| GLOBAL bool | ||||
| Class_AddMask(const int Class, const char *Mask, time_t ValidUntil, | ||||
| Class_AddMask(const int Class, const char *Pattern, time_t ValidUntil, | ||||
| 	      const char *Reason) | ||||
| { | ||||
| 	char mask[MASK_LEN]; | ||||
|  | ||||
| 	assert(Class < CLASS_COUNT); | ||||
| 	assert(Mask != NULL); | ||||
| 	assert(Pattern != NULL); | ||||
| 	assert(Reason != NULL); | ||||
|  | ||||
| 	return Lists_Add(&My_Classes[Class], Lists_MakeMask(Mask), | ||||
| 			 ValidUntil, Reason); | ||||
| 	Lists_MakeMask(Pattern, mask, sizeof(mask)); | ||||
| 	return Lists_Add(&My_Classes[Class], mask, | ||||
| 			 ValidUntil, Reason, false); | ||||
| } | ||||
|  | ||||
| GLOBAL void | ||||
| Class_DeleteMask(const int Class, const char *Mask) | ||||
| Class_DeleteMask(const int Class, const char *Pattern) | ||||
| { | ||||
| 	assert(Class < CLASS_COUNT); | ||||
| 	assert(Mask != NULL); | ||||
| 	char mask[MASK_LEN]; | ||||
|  | ||||
| 	Lists_Del(&My_Classes[Class], Lists_MakeMask(Mask)); | ||||
| 	assert(Class < CLASS_COUNT); | ||||
| 	assert(Pattern != NULL); | ||||
|  | ||||
| 	Lists_MakeMask(Pattern, mask, sizeof(mask)); | ||||
| 	Lists_Del(&My_Classes[Class], mask); | ||||
| } | ||||
|  | ||||
| GLOBAL struct list_head * | ||||
|   | ||||
| @@ -25,11 +25,12 @@ | ||||
| GLOBAL void Class_Init PARAMS((void)); | ||||
| GLOBAL void Class_Exit PARAMS((void)); | ||||
|  | ||||
| GLOBAL bool Class_AddMask PARAMS((const int Class, const char *Mask, | ||||
| GLOBAL bool Class_AddMask PARAMS((const int Class, const char *Pattern, | ||||
| 				  const time_t ValidUntil, const char *Reason)); | ||||
| GLOBAL void Class_DeleteMask PARAMS((const int Class, const char *Mask)); | ||||
| GLOBAL void Class_DeleteMask PARAMS((const int Class, const char *Pattern)); | ||||
|  | ||||
| GLOBAL char *Class_GetMemberReason PARAMS((const int Class, CLIENT *Client)); | ||||
| GLOBAL bool Class_GetMemberReason PARAMS((const int Class, CLIENT *Client, | ||||
| 					  char *reason, size_t len)); | ||||
| GLOBAL bool Class_HandleServerBans PARAMS((CLIENT *Client)); | ||||
|  | ||||
| GLOBAL struct list_head *Class_GetList PARAMS((const int Class)); | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -18,15 +18,11 @@ | ||||
|  * Functions to deal with IRC Capabilities | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "conn.h" | ||||
| #include "client.h" | ||||
| #include "log.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "client-cap.h" | ||||
|  | ||||
| GLOBAL int | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -18,22 +18,16 @@ | ||||
|  * Client management. | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <unistd.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
| #include <strings.h> | ||||
| #include <time.h> | ||||
| #include <netdb.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "conn.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "client.h" | ||||
|  | ||||
| #include <imp.h> | ||||
| #include "ngircd.h" | ||||
| #include "channel.h" | ||||
| #include "conf.h" | ||||
| @@ -41,10 +35,9 @@ | ||||
| #include "hash.h" | ||||
| #include "irc-write.h" | ||||
| #include "log.h" | ||||
| #include "match.h" | ||||
| #include "messages.h" | ||||
|  | ||||
| #include <exp.h> | ||||
|  | ||||
| #define GETID_LEN (CLIENT_NICK_LEN-1) + 1 + (CLIENT_USER_LEN-1) + 1 + (CLIENT_HOST_LEN-1) + 1 | ||||
|  | ||||
| static CLIENT *This_Server, *My_Clients; | ||||
| @@ -61,6 +54,8 @@ static CLIENT *New_Client_Struct PARAMS(( void )); | ||||
| static void Generate_MyToken PARAMS(( CLIENT *Client )); | ||||
| static void Adjust_Counters PARAMS(( CLIENT *Client )); | ||||
|  | ||||
| static void Free_Client PARAMS(( CLIENT **Client )); | ||||
|  | ||||
| static CLIENT *Init_New_Client PARAMS((CONN_ID Idx, CLIENT *Introducer, | ||||
| 				       CLIENT *TopServer, int Type, const char *ID, | ||||
| 				       const char *User, const char *Hostname, const char *Info, | ||||
| @@ -77,7 +72,7 @@ GLOBAL void | ||||
| Client_Init( void ) | ||||
| { | ||||
| 	struct hostent *h; | ||||
| 	 | ||||
|  | ||||
| 	This_Server = New_Client_Struct( ); | ||||
| 	if( ! This_Server ) | ||||
| 	{ | ||||
| @@ -86,7 +81,7 @@ Client_Init( void ) | ||||
| 		exit( 1 ); | ||||
| 	} | ||||
|  | ||||
| 	/* Client-Struktur dieses Servers */ | ||||
| 	/* Client structure for this server */ | ||||
| 	This_Server->next = NULL; | ||||
| 	This_Server->type = CLIENT_SERVER; | ||||
| 	This_Server->conn_id = NONE; | ||||
| @@ -103,7 +98,7 @@ Client_Init( void ) | ||||
| 	Client_SetInfo( This_Server, Conf_ServerInfo ); | ||||
|  | ||||
| 	My_Clients = This_Server; | ||||
| 	 | ||||
|  | ||||
| 	memset( &My_Whowas, 0, sizeof( My_Whowas )); | ||||
| } /* Client_Init */ | ||||
|  | ||||
| @@ -116,17 +111,18 @@ Client_Exit( void ) | ||||
|  | ||||
| 	if( NGIRCd_SignalRestart ) Client_Destroy( This_Server, "Server going down (restarting).", NULL, false ); | ||||
| 	else Client_Destroy( This_Server, "Server going down.", NULL, false ); | ||||
| 	 | ||||
|  | ||||
| 	cnt = 0; | ||||
| 	c = My_Clients; | ||||
| 	while( c ) | ||||
| 	{ | ||||
| 	while(c) { | ||||
| 		cnt++; | ||||
| 		next = (CLIENT *)c->next; | ||||
| 		free( c ); | ||||
| 		Free_Client(&c); | ||||
| 		c = next; | ||||
| 	} | ||||
| 	if( cnt ) Log( LOG_INFO, "Freed %d client structure%s.", cnt, cnt == 1 ? "" : "s" ); | ||||
| 	if (cnt) | ||||
| 		Log(LOG_INFO, "Freed %d client structure%s.", | ||||
| 		    cnt, cnt == 1 ? "" : "s"); | ||||
| } /* Client_Exit */ | ||||
|  | ||||
|  | ||||
| @@ -216,8 +212,8 @@ Init_New_Client(CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, | ||||
| 	if (Type == CLIENT_SERVER) | ||||
| 		Generate_MyToken(client); | ||||
|  | ||||
| 	if (strchr(client->modes, 'a')) | ||||
| 		strlcpy(client->away, DEFAULT_AWAY_MSG, sizeof(client->away)); | ||||
| 	if (Client_HasMode(client, 'a')) | ||||
| 		client->away = strndup(DEFAULT_AWAY_MSG, CLIENT_AWAY_LEN - 1); | ||||
|  | ||||
| 	client->next = (POINTER *)My_Clients; | ||||
| 	My_Clients = client; | ||||
| @@ -232,16 +228,16 @@ GLOBAL void | ||||
| Client_Destroy( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool SendQuit ) | ||||
| { | ||||
| 	/* remove a client */ | ||||
| 	 | ||||
|  | ||||
| 	CLIENT *last, *c; | ||||
| 	char msg[LINE_LEN]; | ||||
| 	char msg[COMMAND_LEN]; | ||||
| 	const char *txt; | ||||
|  | ||||
| 	assert( Client != NULL ); | ||||
|  | ||||
| 	if( LogMsg ) txt = LogMsg; | ||||
| 	else txt = FwdMsg; | ||||
| 	if( ! txt ) txt = "Reason unknown."; | ||||
| 	txt = LogMsg ? LogMsg : FwdMsg; | ||||
| 	if (!txt) | ||||
| 		txt = "Reason unknown"; | ||||
|  | ||||
| 	/* netsplit message */ | ||||
| 	if( Client->type == CLIENT_SERVER ) { | ||||
| @@ -281,10 +277,15 @@ Client_Destroy( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool Sen | ||||
| 				Destroy_UserOrService(c, txt, FwdMsg, SendQuit); | ||||
| 			else if( c->type == CLIENT_SERVER ) | ||||
| 			{ | ||||
| 				if( c != This_Server ) | ||||
| 				{ | ||||
| 					if( c->conn_id != NONE ) Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt ); | ||||
| 					else Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" unregistered: %s", c->id, txt ); | ||||
| 				if (c != This_Server) { | ||||
| 					if (c->conn_id != NONE) | ||||
| 						Log(LOG_NOTICE|LOG_snotice, | ||||
| 						    "Server \"%s\" unregistered (connection %d): %s.", | ||||
| 						c->id, c->conn_id, txt); | ||||
| 					else | ||||
| 						Log(LOG_NOTICE|LOG_snotice, | ||||
| 						    "Server \"%s\" unregistered: %s.", | ||||
| 						    c->id, txt); | ||||
| 				} | ||||
|  | ||||
| 				/* inform other servers */ | ||||
| @@ -296,17 +297,23 @@ Client_Destroy( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool Sen | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
| 				if( c->conn_id != NONE ) | ||||
| 				{ | ||||
| 					if( c->id[0] ) Log( LOG_NOTICE, "Client \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt ); | ||||
| 					else Log( LOG_NOTICE, "Client unregistered (connection %d): %s", c->conn_id, txt ); | ||||
| 				if (c->conn_id != NONE) { | ||||
| 					if (c->id[0]) | ||||
| 						Log(LOG_NOTICE, | ||||
| 						    "Client \"%s\" unregistered (connection %d): %s.", | ||||
| 						    c->id, c->conn_id, txt); | ||||
| 					else | ||||
| 						Log(LOG_NOTICE, | ||||
| 						    "Client unregistered (connection %d): %s.", | ||||
| 						    c->conn_id, txt); | ||||
| 				} else { | ||||
| 					Log(LOG_WARNING, "Unregistered unknown client \"%s\": %s", | ||||
| 								c->id[0] ? c->id : "(No Nick)", txt ); | ||||
| 					Log(LOG_WARNING, | ||||
| 					    "Unregistered unknown client \"%s\": %s", | ||||
| 					    c->id[0] ? c->id : "(No Nick)", txt); | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 			free( c ); | ||||
| 			Free_Client(&c); | ||||
| 			break; | ||||
| 		} | ||||
| 		last = c; | ||||
| @@ -330,7 +337,7 @@ Client_SetHostname( CLIENT *Client, const char *Hostname ) | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Hostname != NULL); | ||||
|  | ||||
| 	if (strlen(Conf_CloakHost)) { | ||||
| 	if (Conf_CloakHost[0]) { | ||||
| 		char cloak[GETID_LEN]; | ||||
|  | ||||
| 		strlcpy(cloak, Hostname, GETID_LEN); | ||||
| @@ -348,12 +355,33 @@ Client_SetHostname( CLIENT *Client, const char *Hostname ) | ||||
| } /* Client_SetHostname */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Set IP address to display for a client. | ||||
|  * | ||||
|  * @param Client The client. | ||||
|  * @param IPAText Textual representation of the IP address or NULL to unset. | ||||
|  */ | ||||
| GLOBAL void | ||||
| Client_SetIPAText(CLIENT *Client, const char *IPAText) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	if (Client->ipa_text) | ||||
| 		free(Client->ipa_text); | ||||
|  | ||||
| 	if (*IPAText) | ||||
| 		Client->ipa_text = strndup(IPAText, CLIENT_HOST_LEN - 1); | ||||
| 	else | ||||
| 		Client->ipa_text = NULL; | ||||
| } | ||||
|  | ||||
|  | ||||
| GLOBAL void | ||||
| Client_SetID( CLIENT *Client, const char *ID ) | ||||
| { | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( ID != NULL ); | ||||
| 	 | ||||
|  | ||||
| 	strlcpy( Client->id, ID, sizeof( Client->id )); | ||||
|  | ||||
| 	if (Conf_CloakUserToNick) { | ||||
| @@ -399,7 +427,7 @@ Client_SetOrigUser(CLIENT UNUSED *Client, const char UNUSED *User) | ||||
| 	assert(Client != NULL); | ||||
| 	assert(User != NULL); | ||||
|  | ||||
| #if defined(PAM) && defined(IDENTAUTH) | ||||
| #if defined(PAM) | ||||
| 	strlcpy(Client->orig_user, User, sizeof(Client->orig_user)); | ||||
| #endif | ||||
| } /* Client_SetOrigUser */ | ||||
| @@ -440,6 +468,22 @@ Client_SetFlags( CLIENT *Client, const char *Flags ) | ||||
| } /* Client_SetFlags */ | ||||
|  | ||||
|  | ||||
| GLOBAL void | ||||
| Client_SetAccountName(CLIENT *Client, const char *AccountName) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	if (Client->account_name) | ||||
| 		free(Client->account_name); | ||||
|  | ||||
| 	if (*AccountName) | ||||
| 		Client->account_name = strndup(AccountName, | ||||
| 					       CLIENT_NICK_LEN - 1); | ||||
| 	else | ||||
| 		Client->account_name = NULL; | ||||
| } | ||||
|  | ||||
|  | ||||
| GLOBAL void | ||||
| Client_SetAway( CLIENT *Client, const char *Txt ) | ||||
| { | ||||
| @@ -448,7 +492,11 @@ Client_SetAway( CLIENT *Client, const char *Txt ) | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( Txt != NULL ); | ||||
|  | ||||
| 	strlcpy( Client->away, Txt, sizeof( Client->away )); | ||||
| 	if (Client->away) | ||||
| 		free(Client->away); | ||||
|  | ||||
| 	Client->away = strndup(Txt, CLIENT_AWAY_LEN - 1); | ||||
|  | ||||
| 	LogDebug("%s \"%s\" is away: %s", Client_TypeText(Client), | ||||
| 		 Client_Mask(Client), Txt); | ||||
| } /* Client_SetAway */ | ||||
| @@ -489,19 +537,11 @@ Client_SetIntroducer( CLIENT *Client, CLIENT *Introducer ) | ||||
| } /* Client_SetIntroducer */ | ||||
|  | ||||
|  | ||||
| GLOBAL void | ||||
| Client_SetOperByMe( CLIENT *Client, bool OperByMe ) | ||||
| { | ||||
| 	assert( Client != NULL ); | ||||
| 	Client->oper_by_me = OperByMe; | ||||
| } /* Client_SetOperByMe */ | ||||
|  | ||||
|  | ||||
| GLOBAL bool | ||||
| Client_ModeAdd( CLIENT *Client, char Mode ) | ||||
| { | ||||
| 	/* Set Mode. | ||||
| 	 * If Client already alread had Mode, return false. | ||||
| 	 * If Client already had Mode, return false. | ||||
| 	 * If the Mode was newly set, return true. | ||||
| 	 */ | ||||
|  | ||||
| @@ -510,7 +550,7 @@ Client_ModeAdd( CLIENT *Client, char Mode ) | ||||
| 	assert( Client != NULL ); | ||||
|  | ||||
| 	x[0] = Mode; x[1] = '\0'; | ||||
| 	if (!strchr( Client->modes, x[0])) { | ||||
| 	if (!Client_HasMode(Client, x[0])) { | ||||
| 		strlcat( Client->modes, x, sizeof( Client->modes )); | ||||
| 		return true; | ||||
| 	} | ||||
| @@ -545,13 +585,14 @@ Client_ModeDel( CLIENT *Client, char Mode ) | ||||
| } /* Client_ModeDel */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Search CLIENT structure of a given nick name. | ||||
|  * | ||||
|  * @return Pointer to CLIENT structure or NULL if not found. | ||||
|  */ | ||||
| GLOBAL CLIENT * | ||||
| Client_Search( const char *Nick ) | ||||
| { | ||||
| 	/* return Client-Structure that has the corresponding Nick. | ||||
| 	 * If none is found, return NULL. | ||||
| 	 */ | ||||
|  | ||||
| 	char search_id[CLIENT_ID_LEN], *ptr; | ||||
| 	CLIENT *c = NULL; | ||||
| 	UINT32 search_hash; | ||||
| @@ -572,7 +613,39 @@ Client_Search( const char *Nick ) | ||||
| 		c = (CLIENT *)c->next; | ||||
| 	} | ||||
| 	return NULL; | ||||
| } /* Client_Search */ | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Search first CLIENT structure matching a given mask of a server. | ||||
|  * | ||||
|  * The order of servers is arbitrary, but this function makes sure that the | ||||
|  * local server is always returned if the mask matches it. | ||||
|  * | ||||
|  * @return Pointer to CLIENT structure or NULL if no server could be found. | ||||
|  */ | ||||
| GLOBAL CLIENT * | ||||
| Client_SearchServer(const char *Mask) | ||||
| { | ||||
| 	CLIENT *c; | ||||
|  | ||||
| 	assert(Mask != NULL); | ||||
|  | ||||
| 	/* First check if mask matches the local server */ | ||||
| 	if (MatchCaseInsensitive(Mask, Client_ID(Client_ThisServer()))) | ||||
| 		return Client_ThisServer(); | ||||
|  | ||||
| 	c = My_Clients; | ||||
| 	while (c) { | ||||
| 		if (Client_Type(c) == CLIENT_SERVER) { | ||||
| 			/* This is a server: check if Mask matches */ | ||||
| 			if (MatchCaseInsensitive(Mask, c->id)) | ||||
| 				return c; | ||||
| 		} | ||||
| 		c = (CLIENT *)c->next; | ||||
| 	} | ||||
| 	return NULL; | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
| @@ -625,7 +698,7 @@ Client_ID( CLIENT *Client ) | ||||
| 	if(Client->type == CLIENT_USER) | ||||
| 		assert(strlen(Client->id) < Conf_MaxNickLength); | ||||
| #endif | ||||
| 						    | ||||
|  | ||||
| 	if( Client->id[0] ) return Client->id; | ||||
| 	else return "*"; | ||||
| } /* Client_ID */ | ||||
| @@ -658,15 +731,7 @@ Client_User( CLIENT *Client ) | ||||
|  */ | ||||
| GLOBAL char * | ||||
| Client_OrigUser(CLIENT *Client) { | ||||
| #ifndef IDENTAUTH | ||||
| 	char *user = Client->user; | ||||
|  | ||||
| 	if (user[0] == '~') | ||||
| 		user++; | ||||
| 	return user; | ||||
| #else | ||||
| 	return Client->orig_user; | ||||
| #endif | ||||
| } /* Client_OrigUser */ | ||||
|  | ||||
| #endif | ||||
| @@ -699,8 +764,6 @@ Client_HostnameCloaked(CLIENT *Client) | ||||
|  * Get (potentially cloaked) hostname of a client to display it to other users. | ||||
|  * | ||||
|  * If the client has not enabled cloaking, the real hostname is used. | ||||
|  * Please note that this function uses a global static buffer, so you can't | ||||
|  * nest invocations without overwriting earlier results! | ||||
|  * | ||||
|  * @param Client Pointer to client structure | ||||
|  * @return Pointer to client hostname | ||||
| @@ -715,13 +778,28 @@ Client_HostnameDisplayed(CLIENT *Client) | ||||
| 		return Client_Hostname(Client); | ||||
|  | ||||
| 	/* Use an already saved cloaked hostname, if there is one */ | ||||
| 	if (Client->cloaked[0]) | ||||
| 	if (Client->cloaked) | ||||
| 		return Client->cloaked; | ||||
|  | ||||
| 	Client_UpdateCloakedHostname(Client, NULL, NULL); | ||||
| 	return Client->cloaked; | ||||
| } | ||||
|  | ||||
| GLOBAL const char * | ||||
| Client_IPAText(CLIENT *Client) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	/* Not a local client? */ | ||||
| 	if (Client_Conn(Client) <= NONE) | ||||
| 		return "0.0.0.0"; | ||||
|  | ||||
| 	if (!Client->ipa_text) | ||||
| 		return Conn_GetIPAInfo(Client_Conn(Client)); | ||||
| 	else | ||||
| 		return Client->ipa_text; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Update (and generate, if necessary) the cloaked hostname of a client. | ||||
|  * | ||||
| @@ -736,25 +814,32 @@ GLOBAL void | ||||
| Client_UpdateCloakedHostname(CLIENT *Client, CLIENT *Origin, | ||||
| 			     const char *Hostname) | ||||
| { | ||||
| 	static char Cloak_Buffer[CLIENT_HOST_LEN]; | ||||
| 	char Cloak_Buffer[CLIENT_HOST_LEN]; | ||||
|  | ||||
| 	assert(Client != NULL); | ||||
| 	if (!Origin) | ||||
| 		Origin = Client_ThisServer(); | ||||
|  | ||||
| 	if (!Client->cloaked) { | ||||
| 		Client->cloaked = malloc(CLIENT_HOST_LEN); | ||||
| 		if (!Client->cloaked) | ||||
| 			return; | ||||
| 	} | ||||
|  | ||||
| 	if (!Hostname) { | ||||
| 		/* Generate new cloaked hostname */ | ||||
| 		if (*Conf_CloakHostModeX) { | ||||
| 			strlcpy(Cloak_Buffer, Client->host, CLIENT_HOST_LEN); | ||||
| 			strlcpy(Cloak_Buffer, Client->host, | ||||
| 				sizeof(Cloak_Buffer)); | ||||
| 			strlcat(Cloak_Buffer, Conf_CloakHostSalt, | ||||
| 				CLIENT_HOST_LEN); | ||||
| 			snprintf(Client->cloaked, sizeof(Client->cloaked), | ||||
| 				sizeof(Cloak_Buffer)); | ||||
| 			snprintf(Client->cloaked, CLIENT_HOST_LEN, | ||||
| 				 Conf_CloakHostModeX, Hash(Cloak_Buffer)); | ||||
| 		} else | ||||
| 			strlcpy(Client->cloaked, Client_ID(Client->introducer), | ||||
| 				sizeof(Client->cloaked)); | ||||
| 				CLIENT_HOST_LEN); | ||||
| 	} else | ||||
| 		strlcpy(Client->cloaked, Hostname, sizeof(Client->cloaked)); | ||||
| 		strlcpy(Client->cloaked, Hostname, CLIENT_HOST_LEN); | ||||
| 	LogDebug("Cloaked hostname of \"%s\" updated to \"%s\"", | ||||
| 		 Client_ID(Client), Client->cloaked); | ||||
|  | ||||
| @@ -780,14 +865,6 @@ Client_Flags( CLIENT *Client ) | ||||
| } /* Client_Flags */ | ||||
|  | ||||
|  | ||||
| GLOBAL bool | ||||
| Client_OperByMe( CLIENT *Client ) | ||||
| { | ||||
| 	assert( Client != NULL ); | ||||
| 	return Client->oper_by_me; | ||||
| } /* Client_OperByMe */ | ||||
|  | ||||
|  | ||||
| GLOBAL int | ||||
| Client_Hops( CLIENT *Client ) | ||||
| { | ||||
| @@ -905,6 +982,14 @@ Client_HasMode( CLIENT *Client, char Mode ) | ||||
| } /* Client_HasMode */ | ||||
|  | ||||
|  | ||||
| GLOBAL bool | ||||
| Client_HasFlag( CLIENT *Client, char Flag ) | ||||
| { | ||||
| 	assert( Client != NULL ); | ||||
| 	return strchr( Client->flags, Flag ) != NULL; | ||||
| } /* Client_HasFlag */ | ||||
|  | ||||
|  | ||||
| GLOBAL char * | ||||
| Client_Away( CLIENT *Client ) | ||||
| { | ||||
| @@ -913,6 +998,14 @@ Client_Away( CLIENT *Client ) | ||||
| } /* Client_Away */ | ||||
|  | ||||
|  | ||||
| GLOBAL char * | ||||
| Client_AccountName(CLIENT *Client) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
| 	return Client->account_name; | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Make sure that a given nickname is valid. | ||||
|  * | ||||
| @@ -931,11 +1024,11 @@ Client_CheckNick(CLIENT *Client, char *Nick) | ||||
|  | ||||
| 	if (!Client_IsValidNick(Nick)) { | ||||
| 		if (strlen(Nick ) >= Conf_MaxNickLength) | ||||
| 			IRC_WriteStrClient(Client, ERR_NICKNAMETOOLONG_MSG, | ||||
| 			IRC_WriteErrClient(Client, ERR_NICKNAMETOOLONG_MSG, | ||||
| 					   Client_ID(Client), Nick, | ||||
| 					   Conf_MaxNickLength - 1); | ||||
| 		else | ||||
| 			IRC_WriteStrClient(Client, ERR_ERRONEUSNICKNAME_MSG, | ||||
| 			IRC_WriteErrClient(Client, ERR_ERRONEUSNICKNAME_MSG, | ||||
| 					   Client_ID(Client), Nick); | ||||
| 		return false; | ||||
| 	} | ||||
| @@ -944,7 +1037,7 @@ Client_CheckNick(CLIENT *Client, char *Nick) | ||||
| 	    && Client_Type(Client) != CLIENT_SERVICE) { | ||||
| 		/* Make sure that this isn't a restricted/forbidden nickname */ | ||||
| 		if (Conf_NickIsBlocked(Nick)) { | ||||
| 			IRC_WriteStrClient(Client, ERR_FORBIDDENNICKNAME_MSG, | ||||
| 			IRC_WriteErrClient(Client, ERR_FORBIDDENNICKNAME_MSG, | ||||
| 					   Client_ID(Client), Nick); | ||||
| 			return false; | ||||
| 		} | ||||
| @@ -952,7 +1045,7 @@ Client_CheckNick(CLIENT *Client, char *Nick) | ||||
|  | ||||
| 	/* Nickname already registered? */ | ||||
| 	if (Client_Search(Nick)) { | ||||
| 		IRC_WriteStrClient(Client, ERR_NICKNAMEINUSE_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_NICKNAMEINUSE_MSG, | ||||
| 			Client_ID(Client), Nick); | ||||
| 		return false; | ||||
| 	} | ||||
| @@ -973,7 +1066,8 @@ Client_CheckID( CLIENT *Client, char *ID ) | ||||
|  | ||||
| 	/* ID too long? */ | ||||
| 	if (strlen(ID) > CLIENT_ID_LEN) { | ||||
| 		IRC_WriteStrClient(Client, ERR_ERRONEUSNICKNAME_MSG, Client_ID(Client), ID); | ||||
| 		IRC_WriteErrClient(Client, ERR_ERRONEUSNICKNAME_MSG, | ||||
| 				   Client_ID(Client), ID); | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| @@ -1071,7 +1165,8 @@ Client_OperCount( void ) | ||||
| 	c = My_Clients; | ||||
| 	while( c ) | ||||
| 	{ | ||||
| 		if( c && ( c->type == CLIENT_USER ) && ( strchr( c->modes, 'o' ))) cnt++; | ||||
| 		if (c && c->type == CLIENT_USER && Client_HasMode(c, 'o' )) | ||||
| 			cnt++; | ||||
| 		c = (CLIENT *)c->next; | ||||
| 	} | ||||
| 	return cnt; | ||||
| @@ -1278,11 +1373,14 @@ MyCount( CLIENT_TYPE Type ) | ||||
| } /* MyCount */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Allocate and initialize new CLIENT strcuture. | ||||
|  * | ||||
|  * @return Pointer to CLIENT structure or NULL on error. | ||||
|  */ | ||||
| static CLIENT * | ||||
| New_Client_Struct( void ) | ||||
| { | ||||
| 	/* Neue CLIENT-Struktur pre-initialisieren */ | ||||
|  | ||||
| 	CLIENT *c; | ||||
|  | ||||
| 	c = (CLIENT *)malloc( sizeof( CLIENT )); | ||||
| @@ -1296,14 +1394,34 @@ New_Client_Struct( void ) | ||||
|  | ||||
| 	c->type = CLIENT_UNKNOWN; | ||||
| 	c->conn_id = NONE; | ||||
| 	c->oper_by_me = false; | ||||
| 	c->hops = -1; | ||||
| 	c->token = -1; | ||||
| 	c->mytoken = -1; | ||||
|  | ||||
| 	return c; | ||||
| } /* New_Client */ | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Free a CLIENT structure and its member variables. | ||||
|  */ | ||||
| static void | ||||
| Free_Client(CLIENT **Client) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
| 	assert(*Client != NULL); | ||||
|  | ||||
| 	if ((*Client)->account_name) | ||||
| 		free((*Client)->account_name); | ||||
| 	if ((*Client)->away) | ||||
| 		free((*Client)->away); | ||||
| 	if ((*Client)->cloaked) | ||||
| 		free((*Client)->cloaked); | ||||
| 	if ((*Client)->ipa_text) | ||||
| 		free((*Client)->ipa_text); | ||||
|  | ||||
| 	free(*Client); | ||||
| 	*Client = NULL; | ||||
| } | ||||
|  | ||||
| static void | ||||
| Generate_MyToken( CLIENT *Client ) | ||||
| @@ -1317,7 +1435,7 @@ Generate_MyToken( CLIENT *Client ) | ||||
| 	{ | ||||
| 		if( c->mytoken == token ) | ||||
| 		{ | ||||
| 			/* Das Token wurde bereits vergeben */ | ||||
| 			/* The token is already in use */ | ||||
| 			token++; | ||||
| 			c = My_Clients; | ||||
| 			continue; | ||||
| @@ -1424,7 +1542,7 @@ Destroy_UserOrService(CLIENT *Client, const char *Txt, const char *FwdMsg, bool | ||||
| 	if(Client->conn_id != NONE) { | ||||
| 		/* Local (directly connected) client */ | ||||
| 		Log(LOG_NOTICE, | ||||
| 		    "%s \"%s\" unregistered (connection %d): %s", | ||||
| 		    "%s \"%s\" unregistered (connection %d): %s.", | ||||
| 		    Client_TypeText(Client), Client_Mask(Client), | ||||
| 		    Client->conn_id, Txt); | ||||
| 		Log_ServerNotice('c', "Client exiting: %s (%s@%s) [%s]", | ||||
| @@ -1442,7 +1560,7 @@ Destroy_UserOrService(CLIENT *Client, const char *Txt, const char *FwdMsg, bool | ||||
| 		} | ||||
| 	} else { | ||||
| 		/* Remote client */ | ||||
| 		LogDebug("%s \"%s\" unregistered: %s", | ||||
| 		LogDebug("%s \"%s\" unregistered: %s.", | ||||
| 			 Client_TypeText(Client), Client_Mask(Client), Txt); | ||||
|  | ||||
| 		if(SendQuit) { | ||||
| @@ -1468,9 +1586,6 @@ Destroy_UserOrService(CLIENT *Client, const char *Txt, const char *FwdMsg, bool | ||||
| /** | ||||
|  * Introduce a new user or service client to a remote server. | ||||
|  * | ||||
|  * This function differentiates between RFC1459 and RFC2813 server links and | ||||
|  * generates the appropriate commands to register the new user or service. | ||||
|  * | ||||
|  * @param To		The remote server to inform. | ||||
|  * @param Prefix	Prefix for the generated commands. | ||||
|  * @param data		CLIENT structure of the new client. | ||||
| @@ -1479,43 +1594,100 @@ static void | ||||
| cb_introduceClient(CLIENT *To, CLIENT *Prefix, void *data) | ||||
| { | ||||
| 	CLIENT *c = (CLIENT *)data; | ||||
|  | ||||
| 	(void)Client_Announce(To, Prefix, c); | ||||
|  | ||||
| } /* cb_introduceClient */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Announce an user or service to a server. | ||||
|  * | ||||
|  * This function differentiates between RFC1459 and RFC2813 server links and | ||||
|  * generates the appropriate commands to register the user or service. | ||||
|  * | ||||
|  * @param Client	Server | ||||
|  * @param Prefix	Prefix for the generated commands | ||||
|  * @param User		User to announce | ||||
|  */ | ||||
| GLOBAL bool | ||||
| Client_Announce(CLIENT * Client, CLIENT * Prefix, CLIENT * User) | ||||
| { | ||||
| 	CONN_ID conn; | ||||
| 	char *modes, *user, *host; | ||||
|  | ||||
| 	modes = Client_Modes(c); | ||||
| 	user = Client_User(c) ? Client_User(c) : "-"; | ||||
| 	host = Client_Hostname(c) ? Client_Hostname(c) : "-"; | ||||
| 	modes = Client_Modes(User); | ||||
| 	user = Client_User(User) ? Client_User(User) : "-"; | ||||
| 	host = Client_Hostname(User) ? Client_Hostname(User) : "-"; | ||||
|  | ||||
| 	conn = Client_Conn(To); | ||||
| 	conn = Client_Conn(Client); | ||||
| 	if (Conn_Options(conn) & CONN_RFC1459) { | ||||
| 		/* RFC 1459 mode: separate NICK and USER commands */ | ||||
| 		Conn_WriteStr(conn, "NICK %s :%d", Client_ID(c), | ||||
| 			      Client_Hops(c) + 1); | ||||
| 		Conn_WriteStr(conn, ":%s USER %s %s %s :%s", | ||||
| 			      Client_ID(c), user, host, | ||||
| 			      Client_ID(Client_Introducer(c)), Client_Info(c)); | ||||
| 		if (modes[0]) | ||||
| 			Conn_WriteStr(conn, ":%s MODE %s +%s", | ||||
| 				      Client_ID(c), Client_ID(c), modes); | ||||
| 		if (! Conn_WriteStr(conn, "NICK %s :%d", | ||||
| 				    Client_ID(User), Client_Hops(User) + 1)) | ||||
| 			return DISCONNECTED; | ||||
| 		if (! Conn_WriteStr(conn, ":%s USER %s %s %s :%s", | ||||
| 				     Client_ID(User), user, host, | ||||
| 				     Client_ID(Client_Introducer(User)), | ||||
| 				     Client_Info(User))) | ||||
| 			return DISCONNECTED; | ||||
| 		if (modes[0]) { | ||||
| 			if (! Conn_WriteStr(conn, ":%s MODE %s +%s", | ||||
| 				     Client_ID(User), Client_ID(User), | ||||
| 				     modes)) | ||||
| 				return DISCONNECTED; | ||||
| 		} | ||||
| 	} else { | ||||
| 		/* RFC 2813 mode: one combined NICK or SERVICE command */ | ||||
| 		if (Client_Type(c) == CLIENT_SERVICE | ||||
| 		    && strchr(Client_Flags(To), 'S')) | ||||
| 			IRC_WriteStrClientPrefix(To, Prefix, | ||||
| 						 "SERVICE %s %d * +%s %d :%s", | ||||
| 						 Client_Mask(c), | ||||
| 						 Client_MyToken(Client_Introducer(c)), | ||||
| 						 Client_Modes(c), Client_Hops(c) + 1, | ||||
| 						 Client_Info(c)); | ||||
| 		else | ||||
| 			IRC_WriteStrClientPrefix(To, Prefix, | ||||
| 						 "NICK %s %d %s %s %d +%s :%s", | ||||
| 						 Client_ID(c), Client_Hops(c) + 1, | ||||
| 						 user, host, | ||||
| 						 Client_MyToken(Client_Introducer(c)), | ||||
| 						 modes, Client_Info(c)); | ||||
| 		if (Client_Type(User) == CLIENT_SERVICE | ||||
| 		    && Client_HasFlag(Client, 'S')) { | ||||
| 			if (!IRC_WriteStrClientPrefix(Client, Prefix, | ||||
| 					"SERVICE %s %d * +%s %d :%s", | ||||
| 					Client_Mask(User), | ||||
| 					Client_MyToken(Client_Introducer(User)), | ||||
| 					modes, Client_Hops(User) + 1, | ||||
| 					Client_Info(User))) | ||||
| 				return DISCONNECTED; | ||||
| 		} else { | ||||
| 			if (!IRC_WriteStrClientPrefix(Client, Prefix, | ||||
| 					"NICK %s %d %s %s %d +%s :%s", | ||||
| 					Client_ID(User), Client_Hops(User) + 1, | ||||
| 					user, host, | ||||
| 					Client_MyToken(Client_Introducer(User)), | ||||
| 					modes, Client_Info(User))) | ||||
| 				return DISCONNECTED; | ||||
| 		} | ||||
| 	} | ||||
| } /* cb_introduceClient */ | ||||
|  | ||||
| 	if (Client_HasFlag(Client, 'M')) { | ||||
| 		/* Synchronize metadata */ | ||||
| 		if (Client_HostnameCloaked(User)) { | ||||
| 			if (!IRC_WriteStrClientPrefix(Client, Prefix, | ||||
| 					"METADATA %s cloakhost :%s", | ||||
| 					Client_ID(User), | ||||
| 					Client_HostnameCloaked(User))) | ||||
| 				return DISCONNECTED; | ||||
| 		} | ||||
|  | ||||
| 		if (Client_AccountName(User)) { | ||||
| 			if (!IRC_WriteStrClientPrefix(Client, Prefix, | ||||
| 					"METADATA %s accountname :%s", | ||||
| 					Client_ID(User), | ||||
| 					Client_AccountName(User))) | ||||
| 				return DISCONNECTED; | ||||
| 		} | ||||
|  | ||||
| 		if (Conn_GetCertFp(Client_Conn(User))) { | ||||
| 			if (!IRC_WriteStrClientPrefix(Client, Prefix, | ||||
| 					"METADATA %s certfp :%s", | ||||
| 					Client_ID(User), | ||||
| 					Conn_GetCertFp(Client_Conn(User)))) | ||||
| 				return DISCONNECTED; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return CONNECTED; | ||||
| } /* Client_Announce */ | ||||
|  | ||||
|  | ||||
| #ifdef DEBUG | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) | ||||
|  * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -17,19 +17,20 @@ | ||||
|  * Client management (header) | ||||
|  */ | ||||
|  | ||||
| #define CLIENT_UNKNOWN 1		/* connection of unknown type */ | ||||
| #define CLIENT_GOTPASS 2		/* client did send PASS */ | ||||
| #define CLIENT_GOTNICK 4		/* client did send NICK */ | ||||
| #define CLIENT_GOTUSER 8		/* client did send USER */ | ||||
| #define CLIENT_USER 16			/* client is an IRC user */ | ||||
| #define CLIENT_SERVER 32		/* client is a server */ | ||||
| #define CLIENT_SERVICE 64		/* client is a service */ | ||||
| #define CLIENT_UNKNOWNSERVER 128	/* unregistered server connection */ | ||||
| #define CLIENT_GOTPASS_2813 256		/* client did send PASS, RFC 2813 style */ | ||||
| #define CLIENT_UNKNOWN		0x0001	/* connection of unknown type */ | ||||
| #define CLIENT_GOTPASS		0x0002	/* client did send PASS */ | ||||
| #define CLIENT_GOTNICK		0x0004	/* client did send NICK */ | ||||
| #define CLIENT_GOTUSER		0x0008	/* client did send USER */ | ||||
| #define CLIENT_USER		0x0010	/* client is an IRC user */ | ||||
| #define CLIENT_SERVER		0x0020	/* client is a server */ | ||||
| #define CLIENT_SERVICE		0x0040	/* client is a service */ | ||||
| #define CLIENT_UNKNOWNSERVER	0x0080	/* unregistered server connection */ | ||||
| #define CLIENT_GOTPASS_2813	0x0100	/* client did send PASS, RFC 2813 style */ | ||||
| #ifndef STRICT_RFC | ||||
| # define CLIENT_WAITAUTHPING 512	/* waiting for AUTH PONG from client */ | ||||
| # define CLIENT_WAITAUTHPING	0x0200	/* waiting for AUTH PONG from client */ | ||||
| #endif | ||||
| #define CLIENT_WAITCAPEND 1024		/* waiting for "CAP END" command */ | ||||
| #define CLIENT_WAITCAPEND	0x0400	/* waiting for "CAP END" command */ | ||||
| #define CLIENT_ANY		0xFFFF | ||||
|  | ||||
| #define CLIENT_TYPE int | ||||
|  | ||||
| @@ -48,17 +49,19 @@ typedef struct _CLIENT | ||||
| 	struct _CLIENT *introducer;	/* ID of the servers which the client is connected to */ | ||||
| 	struct _CLIENT *topserver;	/* toplevel servers (only valid if client is a server) */ | ||||
| 	char host[CLIENT_HOST_LEN];	/* hostname of the client */ | ||||
| 	char cloaked[CLIENT_HOST_LEN];	/* cloaked hostname of the client */ | ||||
| 	char *cloaked;			/* cloaked hostname of the client */ | ||||
| 	char *ipa_text;			/* textual representaton of IP address */ | ||||
| 	char user[CLIENT_USER_LEN];	/* user name ("login") */ | ||||
| #if defined(PAM) && defined(IDENTAUTH) | ||||
| 	char orig_user[CLIENT_USER_LEN];/* user name supplied by USER command */ | ||||
| #if defined(PAM) | ||||
| 	char orig_user[CLIENT_AUTHUSER_LEN]; | ||||
| 					/* original user name supplied by USER command */ | ||||
| #endif | ||||
| 	char info[CLIENT_INFO_LEN];	/* long user name (user) / info text (server) */ | ||||
| 	char modes[CLIENT_MODE_LEN];	/* client modes */ | ||||
| 	int hops, token, mytoken;	/* "hops" and "Token" (see SERVER command) */ | ||||
| 	bool oper_by_me;		/* client is local IRC operator on this server? */ | ||||
| 	char away[CLIENT_AWAY_LEN];	/* AWAY text (valid if mode 'a' is set) */ | ||||
| 	char *away;			/* AWAY text (valid if mode 'a' is set) */ | ||||
| 	char flags[CLIENT_FLAGS_LEN];	/* flags of the client */ | ||||
| 	char *account_name;		/* login account (for services) */ | ||||
| 	int capabilities;		/* enabled IRC capabilities */ | ||||
| } CLIENT; | ||||
|  | ||||
| @@ -93,7 +96,10 @@ GLOBAL CLIENT *Client_ThisServer PARAMS(( void )); | ||||
|  | ||||
| GLOBAL CLIENT *Client_GetFromToken PARAMS(( CLIENT *Client, int Token )); | ||||
|  | ||||
| GLOBAL bool Client_Announce PARAMS(( CLIENT *Client, CLIENT *Prefix, CLIENT *User )); | ||||
|  | ||||
| GLOBAL CLIENT *Client_Search PARAMS(( const char *ID )); | ||||
| GLOBAL CLIENT *Client_SearchServer PARAMS(( const char *ID )); | ||||
| GLOBAL CLIENT *Client_First PARAMS(( void )); | ||||
| GLOBAL CLIENT *Client_Next PARAMS(( CLIENT *c )); | ||||
|  | ||||
| @@ -110,21 +116,24 @@ GLOBAL char *Client_OrigUser PARAMS(( CLIENT *Client )); | ||||
| GLOBAL char *Client_Hostname PARAMS(( CLIENT *Client )); | ||||
| GLOBAL char *Client_HostnameCloaked PARAMS((CLIENT *Client)); | ||||
| GLOBAL char *Client_HostnameDisplayed PARAMS(( CLIENT *Client )); | ||||
| GLOBAL const char *Client_IPAText PARAMS(( CLIENT *Client )); | ||||
| GLOBAL char *Client_Modes PARAMS(( CLIENT *Client )); | ||||
| GLOBAL char *Client_Flags PARAMS(( CLIENT *Client )); | ||||
| GLOBAL CLIENT *Client_Introducer PARAMS(( CLIENT *Client )); | ||||
| GLOBAL bool Client_OperByMe PARAMS(( CLIENT *Client )); | ||||
| GLOBAL int Client_Hops PARAMS(( CLIENT *Client )); | ||||
| GLOBAL int Client_Token PARAMS(( CLIENT *Client )); | ||||
| GLOBAL int Client_MyToken PARAMS(( CLIENT *Client )); | ||||
| GLOBAL CLIENT *Client_TopServer PARAMS(( CLIENT *Client )); | ||||
| GLOBAL CLIENT *Client_NextHop PARAMS(( CLIENT *Client )); | ||||
| GLOBAL char *Client_Away PARAMS(( CLIENT *Client )); | ||||
| GLOBAL char *Client_AccountName PARAMS((CLIENT *Client)); | ||||
| GLOBAL time_t Client_StartTime PARAMS(( CLIENT *Client )); | ||||
|  | ||||
| GLOBAL bool Client_HasMode PARAMS(( CLIENT *Client, char Mode )); | ||||
| GLOBAL bool Client_HasFlag PARAMS(( CLIENT *Client, char Flag )); | ||||
|  | ||||
| GLOBAL void Client_SetHostname PARAMS(( CLIENT *Client, const char *Hostname )); | ||||
| GLOBAL void Client_SetIPAText PARAMS(( CLIENT *Client, const char *IPAText )); | ||||
| GLOBAL void Client_SetID PARAMS(( CLIENT *Client, const char *Nick )); | ||||
| GLOBAL void Client_SetUser PARAMS(( CLIENT *Client, const char *User, bool Idented )); | ||||
| GLOBAL void Client_SetOrigUser PARAMS(( CLIENT *Client, const char *User )); | ||||
| @@ -132,11 +141,11 @@ GLOBAL void Client_SetInfo PARAMS(( CLIENT *Client, const char *Info )); | ||||
| GLOBAL void Client_SetType PARAMS(( CLIENT *Client, int Type )); | ||||
| GLOBAL void Client_SetHops PARAMS(( CLIENT *Client, int Hops )); | ||||
| GLOBAL void Client_SetToken PARAMS(( CLIENT *Client, int Token )); | ||||
| GLOBAL void Client_SetOperByMe PARAMS(( CLIENT *Client, bool OperByMe )); | ||||
| GLOBAL void Client_SetModes PARAMS(( CLIENT *Client, const char *Modes )); | ||||
| GLOBAL void Client_SetFlags PARAMS(( CLIENT *Client, const char *Flags )); | ||||
| GLOBAL void Client_SetIntroducer PARAMS(( CLIENT *Client, CLIENT *Introducer )); | ||||
| GLOBAL void Client_SetAway PARAMS(( CLIENT *Client, const char *Txt )); | ||||
| GLOBAL void Client_SetAccountName PARAMS((CLIENT *Client, const char *AccountName)); | ||||
|  | ||||
| GLOBAL bool Client_ModeAdd PARAMS(( CLIENT *Client, char Mode )); | ||||
| GLOBAL bool Client_ModeDel PARAMS(( CLIENT *Client, char Mode )); | ||||
|   | ||||
| @@ -37,11 +37,12 @@ struct ConnSSL_State { | ||||
| 	void *cookie;		/* pointer to server configuration structure | ||||
| 				   (for outgoing connections), or NULL. */ | ||||
| #endif | ||||
| 	char *fingerprint; | ||||
| }; | ||||
|  | ||||
| #endif | ||||
|  | ||||
| bool	ConnSSL_InitLibrary(void); | ||||
| GLOBAL bool ConnSSL_InitLibrary PARAMS((void)); | ||||
|  | ||||
| #endif /* conf_ssl_h */ | ||||
|  | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -75,6 +75,7 @@ struct SSLOptions { | ||||
| 	char *DHFile;			/**< File containing DH parameters */ | ||||
| 	array ListenPorts;		/**< Array of listening SSL ports */ | ||||
| 	array KeyFilePassword;		/**< Key file password */ | ||||
| 	char *CipherList;		/**< Set SSL cipher list to use */ | ||||
| }; | ||||
| #endif | ||||
|  | ||||
| @@ -108,9 +109,15 @@ GLOBAL char Conf_ServerAdmin1[CLIENT_INFO_LEN]; | ||||
| GLOBAL char Conf_ServerAdmin2[CLIENT_INFO_LEN]; | ||||
| GLOBAL char Conf_ServerAdminMail[CLIENT_INFO_LEN]; | ||||
|  | ||||
| /** Network name (optional, no spaces allowed) */ | ||||
| GLOBAL char Conf_Network[CLIENT_INFO_LEN]; | ||||
|  | ||||
| /** Message of the day (MOTD) of this server */ | ||||
| GLOBAL array Conf_Motd; | ||||
|  | ||||
| /** Help text of this server */ | ||||
| GLOBAL array Conf_Helptext; | ||||
|  | ||||
| /** Array of ports this server should listen on */ | ||||
| GLOBAL array Conf_ListenPorts; | ||||
|  | ||||
| @@ -145,8 +152,8 @@ GLOBAL CONF_SERVER Conf_Server[MAX_SERVERS]; | ||||
| /** Array of pre-defined channels */ | ||||
| GLOBAL array Conf_Channels; | ||||
|  | ||||
| /** Flag indicating if only pre-defined channels are allowed (true) or not */ | ||||
| GLOBAL bool Conf_PredefChannelsOnly; | ||||
| /** String containing all locally allowed channel prefixes for new channels */ | ||||
| GLOBAL char Conf_AllowedChannelTypes[8]; | ||||
|  | ||||
| /** Flag indicating if IRC operators are allowed to always use MODE (true) */ | ||||
| GLOBAL bool Conf_OperCanMode; | ||||
| @@ -187,8 +194,8 @@ GLOBAL bool Conf_Ident; | ||||
| /** Enable "more privacy" mode and "censor" some user-related information */ | ||||
| GLOBAL bool Conf_MorePrivacy; | ||||
|  | ||||
| /** Enable NOTICE AUTH messages on connect */ | ||||
| GLOBAL bool Conf_NoticeAuth; | ||||
| /** Enable "NOTICE *" messages on connect */ | ||||
| GLOBAL bool Conf_NoticeBeforeRegistration; | ||||
|  | ||||
| /** Enable all usage of PAM, even when compiled with support for it */ | ||||
| GLOBAL bool Conf_PAM; | ||||
| @@ -196,9 +203,15 @@ GLOBAL bool Conf_PAM; | ||||
| /** Don't require all clients to send a password an to be PAM authenticated */ | ||||
| GLOBAL bool Conf_PAMIsOptional; | ||||
|  | ||||
| /** The service name to use for PAM */ | ||||
| GLOBAL char Conf_PAMServiceName[MAX_PAM_SERVICE_NAME_LEN]; | ||||
|  | ||||
| /** Disable all CTCP commands except for /me ? */ | ||||
| GLOBAL bool Conf_ScrubCTCP; | ||||
|  | ||||
| /** Default user modes for new local clients */ | ||||
| GLOBAL char Conf_DefaultUserModes[CLIENT_MODE_LEN]; | ||||
|  | ||||
| /* | ||||
|  * try to connect to remote systems using the ipv6 protocol, | ||||
|  * if they have an ipv6 address? (default yes) | ||||
| @@ -208,6 +221,9 @@ GLOBAL bool Conf_ConnectIPv6; | ||||
| /** Try to connect to remote systems using the IPv4 protocol (true) */ | ||||
| GLOBAL bool Conf_ConnectIPv4; | ||||
|  | ||||
| /** Idle timout (seconds), after which the daemon should exit */ | ||||
| GLOBAL int Conf_IdleTimeout; | ||||
|  | ||||
| /** Maximum number of simultaneous connections to this server */ | ||||
| GLOBAL int Conf_MaxConnections; | ||||
|  | ||||
| @@ -253,6 +269,10 @@ GLOBAL bool Conf_AddServer PARAMS(( const char *Name, UINT16 Port, const char *H | ||||
| GLOBAL bool Conf_NickIsService PARAMS((int ConfServer, const char *Nick)); | ||||
| GLOBAL bool Conf_NickIsBlocked PARAMS((const char *Nick)); | ||||
|  | ||||
| #ifdef SSL_SUPPORT | ||||
| GLOBAL bool Conf_SSLInUse PARAMS((void)); | ||||
| #endif | ||||
|  | ||||
| /* Password required by WEBIRC command */ | ||||
| GLOBAL char Conf_WebircPwd[CLIENT_PASS_LEN]; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -20,25 +20,21 @@ | ||||
|  * Functions to deal with character encodings and conversions | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
| #include <strings.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "conn.h" | ||||
| #include "log.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "conn-encoding.h" | ||||
|  | ||||
| #ifdef ICONV | ||||
|  | ||||
| #include "log.h" | ||||
| #include "conn-encoding.h" | ||||
|  | ||||
| char Encoding_Buffer[COMMAND_LEN]; | ||||
|  | ||||
| char *Convert_Message PARAMS((iconv_t Handle, char *Message)); | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Set client character encoding on a connection. | ||||
|  * | ||||
| @@ -123,9 +119,9 @@ Convert_Message(iconv_t Handle, char *Message) | ||||
| 	out_left = sizeof(Encoding_Buffer) - 1; | ||||
|  | ||||
| 	if (iconv(Handle, &Message, &in_left, &out, &out_left) == (size_t)(-1)) { | ||||
| 		/* An error occured! */ | ||||
| 		/* An error occurred! */ | ||||
| 		LogDebug("Error converting message encoding!"); | ||||
| 		strlcpy(Encoding_Buffer, Message, sizeof(Encoding_Buffer)); | ||||
| 		strlcpy(out, Message, sizeof(Encoding_Buffer)); | ||||
| 		iconv(Handle, NULL, NULL, NULL, NULL); | ||||
| 	} else | ||||
| 		*out = '\0'; | ||||
| @@ -133,7 +129,7 @@ Convert_Message(iconv_t Handle, char *Message) | ||||
| 	return Encoding_Buffer; | ||||
| } | ||||
|  | ||||
| #endif | ||||
| #endif /* ICONV */ | ||||
|  | ||||
| /** | ||||
|  * Convert encoding of a message received from a connection. | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2008 Alexander Barton (alex@barton.de) | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -18,18 +18,16 @@ | ||||
|  * Connection management: Global functions | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <string.h> | ||||
| #include "log.h" | ||||
| #include <time.h> | ||||
|  | ||||
| #ifdef DEBUG | ||||
| # include "log.h" | ||||
| #endif | ||||
| #include "conn.h" | ||||
| #include "client.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "conn-func.h" | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Update "idle timestamp", the time of the last visible user action | ||||
|  * (e. g. like sending messages, joining or leaving channels). | ||||
| @@ -73,7 +71,6 @@ Conn_GetIdle( CONN_ID Idx ) | ||||
| 	return time( NULL ) - My_Connections[Idx].lastprivmsg; | ||||
| } /* Conn_GetIdle */ | ||||
|  | ||||
|  | ||||
| GLOBAL time_t | ||||
| Conn_LastPing( CONN_ID Idx ) | ||||
| { | ||||
| @@ -81,7 +78,6 @@ Conn_LastPing( CONN_ID Idx ) | ||||
| 	return My_Connections[Idx].lastping; | ||||
| } /* Conn_LastPing */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Add "penalty time" for a connection. | ||||
|  * | ||||
| @@ -116,25 +112,6 @@ Conn_SetPenalty(CONN_ID Idx, time_t Seconds) | ||||
| #endif | ||||
| } /* Conn_SetPenalty */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Reset the "penalty time" for one connection. | ||||
|  * | ||||
|  * @param Idx Connection index. | ||||
|  * @see Conn_SetPenalty | ||||
|  */ | ||||
| GLOBAL void | ||||
| Conn_ResetPenalty(CONN_ID Idx) | ||||
| { | ||||
| 	assert(Idx > NONE); | ||||
|  | ||||
| 	My_Connections[Idx].delaytime = 0; | ||||
| #ifdef DEBUG | ||||
| 	Log(LOG_DEBUG, "Penalty time on connection %d has been reset."); | ||||
| #endif | ||||
| } /* Conn_ResetPenalty */ | ||||
|  | ||||
|  | ||||
| GLOBAL void | ||||
| Conn_ClearFlags( void ) | ||||
| { | ||||
| @@ -143,7 +120,6 @@ Conn_ClearFlags( void ) | ||||
| 	for( i = 0; i < Pool_Size; i++ ) My_Connections[i].flag = 0; | ||||
| } /* Conn_ClearFlags */ | ||||
|  | ||||
|  | ||||
| GLOBAL int | ||||
| Conn_Flag( CONN_ID Idx ) | ||||
| { | ||||
| @@ -151,25 +127,18 @@ Conn_Flag( CONN_ID Idx ) | ||||
| 	return My_Connections[Idx].flag; | ||||
| } /* Conn_Flag */ | ||||
|  | ||||
|  | ||||
| GLOBAL void | ||||
| Conn_SetFlag( CONN_ID Idx, int Flag ) | ||||
| { | ||||
| 	/* Connection markieren */ | ||||
|  | ||||
| 	assert( Idx > NONE ); | ||||
| 	My_Connections[Idx].flag = Flag; | ||||
| } /* Conn_SetFlag */ | ||||
|  | ||||
|  | ||||
| GLOBAL CONN_ID | ||||
| Conn_First( void ) | ||||
| { | ||||
| 	/* Connection-Struktur der ersten Verbindung liefern; | ||||
| 	 * Ist keine Verbindung vorhanden, wird NONE geliefert. */ | ||||
|  | ||||
| 	CONN_ID i; | ||||
| 	 | ||||
|  | ||||
| 	for( i = 0; i < Pool_Size; i++ ) | ||||
| 	{ | ||||
| 		if( My_Connections[i].sock != NONE ) return i; | ||||
| @@ -177,17 +146,13 @@ Conn_First( void ) | ||||
| 	return NONE; | ||||
| } /* Conn_First */ | ||||
|  | ||||
|  | ||||
| GLOBAL CONN_ID | ||||
| Conn_Next( CONN_ID Idx ) | ||||
| { | ||||
| 	/* Naechste Verbindungs-Struktur liefern; existiert keine | ||||
| 	 * weitere, so wird NONE geliefert. */ | ||||
|  | ||||
| 	CONN_ID i = NONE; | ||||
|  | ||||
| 	assert( Idx > NONE ); | ||||
| 	 | ||||
|  | ||||
| 	for( i = Idx + 1; i < Pool_Size; i++ ) | ||||
| 	{ | ||||
| 		if( My_Connections[i].sock != NONE ) return i; | ||||
| @@ -195,7 +160,6 @@ Conn_Next( CONN_ID Idx ) | ||||
| 	return NONE; | ||||
| } /* Conn_Next */ | ||||
|  | ||||
|  | ||||
| GLOBAL UINT16 | ||||
| Conn_Options( CONN_ID Idx ) | ||||
| { | ||||
| @@ -203,7 +167,6 @@ Conn_Options( CONN_ID Idx ) | ||||
| 	return My_Connections[Idx].options; | ||||
| } /* Conn_Options */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Set connection option. | ||||
|  */ | ||||
| @@ -214,7 +177,6 @@ Conn_SetOption(CONN_ID Idx, int Option) | ||||
| 	Conn_OPTION_ADD(&My_Connections[Idx], Option); | ||||
| } /* Conn_SetOption */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Get the start time of the connection. | ||||
|  * The result is the start time in seconds since 1970-01-01, as reported | ||||
| @@ -250,7 +212,6 @@ Conn_SendQ( CONN_ID Idx ) | ||||
| 	return array_bytes(&My_Connections[Idx].wbuf); | ||||
| } /* Conn_SendQ */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * return number of messages sent on this connection so far | ||||
|  */ | ||||
| @@ -262,7 +223,6 @@ Conn_SendMsg( CONN_ID Idx ) | ||||
| 	return My_Connections[Idx].msg_out; | ||||
| } /* Conn_SendMsg */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * return number of (uncompressed) bytes sent | ||||
|  * on this connection so far | ||||
| @@ -274,7 +234,6 @@ Conn_SendBytes( CONN_ID Idx ) | ||||
| 	return My_Connections[Idx].bytes_out; | ||||
| } /* Conn_SendBytes */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * return number of bytes pending in read buffer | ||||
|  */ | ||||
| @@ -290,7 +249,6 @@ Conn_RecvQ( CONN_ID Idx ) | ||||
| 	return array_bytes(&My_Connections[Idx].rbuf); | ||||
| } /* Conn_RecvQ */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * return number of messages received on this connection so far | ||||
|  */ | ||||
| @@ -301,7 +259,6 @@ Conn_RecvMsg( CONN_ID Idx ) | ||||
| 	return My_Connections[Idx].msg_in; | ||||
| } /* Conn_RecvMsg */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * return number of (uncompressed) bytes received on this | ||||
|  * connection so far | ||||
| @@ -323,19 +280,16 @@ Conn_IPA(CONN_ID Idx) | ||||
| 	return ng_ipaddr_tostr(&My_Connections[Idx].addr); | ||||
| } | ||||
|  | ||||
|  | ||||
| GLOBAL void | ||||
| Conn_ResetWCounter( void ) | ||||
| { | ||||
| 	WCounter = 0; | ||||
| } /* Conn_ResetWCounter */ | ||||
|  | ||||
|  | ||||
| GLOBAL long | ||||
| Conn_WCounter( void ) | ||||
| { | ||||
| 	return WCounter; | ||||
| } /* Conn_WCounter */ | ||||
|  | ||||
|  | ||||
| /* -eof- */ | ||||
|   | ||||
| @@ -45,7 +45,6 @@ GLOBAL long Conn_RecvBytes PARAMS(( CONN_ID Idx )); | ||||
| GLOBAL const char *Conn_IPA PARAMS(( CONN_ID Idx )); | ||||
|  | ||||
| GLOBAL void Conn_SetPenalty PARAMS(( CONN_ID Idx, time_t Seconds )); | ||||
| GLOBAL void Conn_ResetPenalty PARAMS(( CONN_ID Idx )); | ||||
|  | ||||
| GLOBAL void Conn_ClearFlags PARAMS(( void )); | ||||
| GLOBAL int Conn_Flag PARAMS(( CONN_ID Idx )); | ||||
|   | ||||
| @@ -1,6 +1,13 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c) 2005-2008 Florian Westphal <fw@strlen.de> | ||||
|  * Copyright (c)2005-2008 Florian Westphal (fw@strlen.de). | ||||
|  * Copyright (c)2008-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
|  * the Free Software Foundation; either version 2 of the License, or | ||||
|  * (at your option) any later version. | ||||
|  * Please read the file COPYING, README and AUTHORS for more information. | ||||
|  */ | ||||
|  | ||||
| #include "portab.h" | ||||
| @@ -10,7 +17,6 @@ | ||||
|  * SSL wrapper functions | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include "conf-ssl.h" | ||||
|  | ||||
| #ifdef SSL_SUPPORT | ||||
| @@ -29,7 +35,6 @@ | ||||
| #include "conn-ssl.h" | ||||
| #include "log.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "defines.h" | ||||
|  | ||||
| extern struct SSLOptions Conf_SSLOptions; | ||||
| @@ -54,11 +59,16 @@ static bool ConnSSL_LoadServerKey_openssl PARAMS(( SSL_CTX *c )); | ||||
| #define DH_BITS 2048 | ||||
| #define DH_BITS_MIN 1024 | ||||
|  | ||||
| #define MAX_HASH_SIZE	64	/* from gnutls-int.h */ | ||||
|  | ||||
| static gnutls_certificate_credentials_t x509_cred; | ||||
| static gnutls_dh_params_t dh_params; | ||||
| static gnutls_priority_t priorities_cache; | ||||
| static bool ConnSSL_LoadServerKey_gnutls PARAMS(( void )); | ||||
| #endif | ||||
|  | ||||
| #define SHA256_STRING_LEN	(32 * 2 + 1) | ||||
|  | ||||
| static bool ConnSSL_Init_SSL PARAMS(( CONNECTION *c )); | ||||
| static int ConnectAccept PARAMS(( CONNECTION *c, bool connect )); | ||||
| static int ConnSSL_HandleError PARAMS(( CONNECTION *c, const int code, const char *fname )); | ||||
| @@ -109,17 +119,26 @@ out: | ||||
|  | ||||
|  | ||||
| #ifdef HAVE_LIBSSL | ||||
| /** | ||||
|  * Log OpenSSL error message. | ||||
|  * | ||||
|  * @param msg The error message. | ||||
|  * @param info Additional information text or NULL. | ||||
|  */ | ||||
| static void | ||||
| LogOpenSSLError( const char *msg, const char *msg2 ) | ||||
| LogOpenSSLError(const char *error, const char *info) | ||||
| { | ||||
| 	unsigned long err = ERR_get_error(); | ||||
| 	char * errmsg = err ? ERR_error_string(err, NULL) : "Unable to determine error"; | ||||
| 	char * errmsg = err | ||||
| 		? ERR_error_string(err, NULL) | ||||
| 		: "Unable to determine error"; | ||||
|  | ||||
| 	if (!msg) msg = "SSL Error"; | ||||
| 	if (msg2) | ||||
| 		Log( LOG_ERR, "%s: %s: %s", msg, msg2, errmsg); | ||||
| 	assert(error != NULL); | ||||
|  | ||||
| 	if (info) | ||||
| 		Log(LOG_ERR, "%s: %s (%s)", error, info, errmsg); | ||||
| 	else | ||||
| 		Log( LOG_ERR, "%s: %s", msg, errmsg); | ||||
| 		Log(LOG_ERR, "%s: %s", error, errmsg); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -138,13 +157,20 @@ pem_passwd_cb(char *buf, int size, int rwflag, void *password) | ||||
| 	LogDebug("pem_passwd_cb buf size %d, array size %d", size, passlen); | ||||
| 	assert(passlen >= 0); | ||||
| 	if (passlen <= 0) { | ||||
| 		Log(LOG_ERR, "pem_passwd_cb: password required, but not set"); | ||||
| 		Log(LOG_ERR, "PEM password required but not set [in pem_passwd_cb()]!"); | ||||
| 		return 0; | ||||
| 	} | ||||
| 	size = passlen > size ? size : passlen; | ||||
| 	memcpy(buf, (char *)(array_start(pass)), size); | ||||
| 	return size; | ||||
| } | ||||
|  | ||||
|  | ||||
| static int | ||||
| Verify_openssl(UNUSED int preverify_ok, UNUSED X509_STORE_CTX *x509_ctx) | ||||
| { | ||||
| 	return 1; | ||||
| } | ||||
| #endif | ||||
|  | ||||
|  | ||||
| @@ -166,7 +192,7 @@ Load_DH_params(void) | ||||
| 	} | ||||
| 	dh_params = PEM_read_DHparams(fp, NULL, NULL, NULL); | ||||
| 	if (!dh_params) { | ||||
| 		Log(LOG_ERR, "%s: PEM_read_DHparams failed!", | ||||
| 		Log(LOG_ERR, "%s: Failed to read SSL DH parameters!", | ||||
| 		    Conf_SSLOptions.DHFile); | ||||
| 		ret = false; | ||||
| 	} | ||||
| @@ -180,7 +206,8 @@ Load_DH_params(void) | ||||
|  | ||||
| 	err = gnutls_dh_params_init(&tmp_dh_params); | ||||
| 	if (err < 0) { | ||||
| 		Log(LOG_ERR, "gnutls_dh_params_init: %s", gnutls_strerror(err)); | ||||
| 		Log(LOG_ERR, "Failed to initialize SSL DH parameters: %s", | ||||
| 		    gnutls_strerror(err)); | ||||
| 		return false; | ||||
| 	} | ||||
| 	if (Conf_SSLOptions.DHFile) { | ||||
| @@ -193,7 +220,9 @@ Load_DH_params(void) | ||||
| 			if (err == 0) | ||||
| 				need_dhgenerate = false; | ||||
| 			else | ||||
| 				Log(LOG_ERR, "gnutls_dh_params_init: %s", gnutls_strerror(err)); | ||||
| 				Log(LOG_ERR, | ||||
| 				    "Failed to initialize SSL DH parameters: %s", | ||||
| 				    gnutls_strerror(err)); | ||||
|  | ||||
| 			memset(dhparms.data, 0, size); | ||||
| 			free(dhparms.data); | ||||
| @@ -205,7 +234,8 @@ Load_DH_params(void) | ||||
| 		    DH_BITS); | ||||
| 		err = gnutls_dh_params_generate2(tmp_dh_params, DH_BITS); | ||||
| 		if (err < 0) { | ||||
| 			Log(LOG_ERR, "gnutls_dh_params_generate2: %s", gnutls_strerror(err)); | ||||
| 			Log(LOG_ERR, "Failed to generate SSL DH parameters: %s", | ||||
| 			    gnutls_strerror(err)); | ||||
| 			return false; | ||||
| 		} | ||||
|         } | ||||
| @@ -223,6 +253,10 @@ void ConnSSL_Free(CONNECTION *c) | ||||
| 		SSL_shutdown(ssl); | ||||
| 		SSL_free(ssl); | ||||
| 		c->ssl_state.ssl = NULL; | ||||
| 		if (c->ssl_state.fingerprint) { | ||||
| 			free(c->ssl_state.fingerprint); | ||||
| 			c->ssl_state.fingerprint = NULL; | ||||
| 		} | ||||
| 	} | ||||
| #endif | ||||
| #ifdef HAVE_LIBGNUTLS | ||||
| @@ -241,22 +275,28 @@ void ConnSSL_Free(CONNECTION *c) | ||||
| bool | ||||
| ConnSSL_InitLibrary( void ) | ||||
| { | ||||
| 	if (!array_bytes(&Conf_SSLOptions.ListenPorts)) | ||||
| 	if (!Conf_SSLInUse()) { | ||||
| 		LogDebug("SSL not in use, skipping initialization."); | ||||
| 		return true; | ||||
| 	} | ||||
|  | ||||
| #ifdef HAVE_LIBSSL | ||||
| 	SSL_CTX *newctx; | ||||
|  | ||||
| #if OPENSSL_API_COMPAT < 0x10100000L | ||||
| 	if (!ssl_ctx) { | ||||
| 		SSL_library_init(); | ||||
| 		SSL_load_error_strings(); | ||||
| 	} | ||||
| #endif | ||||
|  | ||||
| 	if (!RAND_status()) { | ||||
| 		Log(LOG_ERR, "OpenSSL PRNG not seeded: /dev/urandom missing?"); | ||||
| 		/* | ||||
| 		 * it is probably best to fail and let the user install EGD or a similar program if no kernel random device is available. | ||||
| 		 * According to OpenSSL RAND_egd(3): "The automatic query of /var/run/egd-pool et al was added in OpenSSL 0.9.7"; | ||||
| 		 * it is probably best to fail and let the user install EGD or | ||||
| 		 * a similar program if no kernel random device is available. | ||||
| 		 * According to OpenSSL RAND_egd(3): "The automatic query of | ||||
| 		 * /var/run/egd-pool et al was added in OpenSSL 0.9.7"; | ||||
| 		 * so it makes little sense to deal with PRNGD seeding ourselves. | ||||
| 		 */ | ||||
| 		array_free(&Conf_SSLOptions.ListenPorts); | ||||
| @@ -265,7 +305,7 @@ ConnSSL_InitLibrary( void ) | ||||
|  | ||||
| 	newctx = SSL_CTX_new(SSLv23_method()); | ||||
| 	if (!newctx) { | ||||
| 		LogOpenSSLError("SSL_CTX_new()", NULL); | ||||
| 		LogOpenSSLError("Failed to create SSL context", NULL); | ||||
| 		array_free(&Conf_SSLOptions.ListenPorts); | ||||
| 		return false; | ||||
| 	} | ||||
| @@ -273,8 +313,17 @@ ConnSSL_InitLibrary( void ) | ||||
| 	if (!ConnSSL_LoadServerKey_openssl(newctx)) | ||||
| 		goto out; | ||||
|  | ||||
| 	if (SSL_CTX_set_cipher_list(newctx, Conf_SSLOptions.CipherList) == 0) { | ||||
| 		Log(LOG_ERR, "Failed to apply OpenSSL cipher list \"%s\"!", | ||||
| 		    Conf_SSLOptions.CipherList); | ||||
| 		goto out; | ||||
| 	} | ||||
|  | ||||
| 	SSL_CTX_set_session_id_context(newctx, (unsigned char *)"ngircd", 6); | ||||
| 	SSL_CTX_set_options(newctx, SSL_OP_SINGLE_DH_USE|SSL_OP_NO_SSLv2); | ||||
| 	SSL_CTX_set_mode(newctx, SSL_MODE_ENABLE_PARTIAL_WRITE); | ||||
| 	SSL_CTX_set_verify(newctx, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE, | ||||
| 			   Verify_openssl); | ||||
| 	SSL_CTX_free(ssl_ctx); | ||||
| 	ssl_ctx = newctx; | ||||
| 	Log(LOG_INFO, "%s initialized.", SSLeay_version(SSLEAY_VERSION)); | ||||
| @@ -287,22 +336,37 @@ out: | ||||
| #ifdef HAVE_LIBGNUTLS | ||||
| 	int err; | ||||
| 	static bool initialized; | ||||
| 	if (initialized) /* TODO: cannot reload gnutls keys: can't simply free x509 context -- it may still be in use */ | ||||
|  | ||||
| 	if (initialized) { | ||||
| 		/* TODO: cannot reload gnutls keys: can't simply free x509 | ||||
| 		 * context -- it may still be in use */ | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	err = gnutls_global_init(); | ||||
| 	if (err) { | ||||
| 		Log(LOG_ERR, "gnutls_global_init(): %s", gnutls_strerror(err)); | ||||
| 		array_free(&Conf_SSLOptions.ListenPorts); | ||||
| 		return false; | ||||
| 		Log(LOG_ERR, "Failed to initialize GnuTLS: %s", | ||||
| 		    gnutls_strerror(err)); | ||||
| 		goto out; | ||||
| 	} | ||||
| 	if (!ConnSSL_LoadServerKey_gnutls()) { | ||||
| 		array_free(&Conf_SSLOptions.ListenPorts); | ||||
| 		return false; | ||||
|  | ||||
| 	if (!ConnSSL_LoadServerKey_gnutls()) | ||||
| 		goto out; | ||||
|  | ||||
| 	if (gnutls_priority_init(&priorities_cache, Conf_SSLOptions.CipherList, | ||||
| 				 NULL) != GNUTLS_E_SUCCESS) { | ||||
| 		Log(LOG_ERR, | ||||
| 		    "Failed to apply GnuTLS cipher list \"%s\"!", | ||||
| 		    Conf_SSLOptions.CipherList); | ||||
| 		goto out; | ||||
| 	} | ||||
| 	Log(LOG_INFO, "gnutls %s initialized.", gnutls_check_version(NULL)); | ||||
|  | ||||
| 	Log(LOG_INFO, "GnuTLS %s initialized.", gnutls_check_version(NULL)); | ||||
| 	initialized = true; | ||||
| 	return true; | ||||
| out: | ||||
| 	array_free(&Conf_SSLOptions.ListenPorts); | ||||
| 	return false; | ||||
| #endif | ||||
| } | ||||
|  | ||||
| @@ -316,7 +380,8 @@ ConnSSL_LoadServerKey_gnutls(void) | ||||
|  | ||||
| 	err = gnutls_certificate_allocate_credentials(&x509_cred); | ||||
| 	if (err < 0) { | ||||
| 		Log(LOG_ERR, "gnutls_certificate_allocate_credentials: %s", gnutls_strerror(err)); | ||||
| 		Log(LOG_ERR, "Failed to allocate certificate credentials: %s", | ||||
| 		    gnutls_strerror(err)); | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| @@ -328,7 +393,7 @@ ConnSSL_LoadServerKey_gnutls(void) | ||||
|  | ||||
| 	if (array_bytes(&Conf_SSLOptions.KeyFilePassword)) | ||||
| 		Log(LOG_WARNING, | ||||
| 		    "Ignoring KeyFilePassword: Not supported by GNUTLS."); | ||||
| 		    "Ignoring SSL \"KeyFilePassword\": Not supported by GnuTLS."); | ||||
|  | ||||
| 	if (!Load_DH_params()) | ||||
| 		return false; | ||||
| @@ -336,8 +401,11 @@ ConnSSL_LoadServerKey_gnutls(void) | ||||
| 	gnutls_certificate_set_dh_params(x509_cred, dh_params); | ||||
| 	err = gnutls_certificate_set_x509_key_file(x509_cred, cert_file, Conf_SSLOptions.KeyFile, GNUTLS_X509_FMT_PEM); | ||||
| 	if (err < 0) { | ||||
| 		Log(LOG_ERR, "gnutls_certificate_set_x509_key_file (cert %s, key %s): %s", | ||||
| 				cert_file, Conf_SSLOptions.KeyFile ? Conf_SSLOptions.KeyFile : "(NULL)", gnutls_strerror(err)); | ||||
| 		Log(LOG_ERR, | ||||
| 		    "Failed to set certificate key file (cert %s, key %s): %s", | ||||
| 		    cert_file, | ||||
| 		    Conf_SSLOptions.KeyFile ? Conf_SSLOptions.KeyFile : "(NULL)", | ||||
| 		    gnutls_strerror(err)); | ||||
| 		return false; | ||||
| 	} | ||||
| 	return true; | ||||
| @@ -362,26 +430,26 @@ ConnSSL_LoadServerKey_openssl(SSL_CTX *ctx) | ||||
|  | ||||
| 	if (SSL_CTX_use_PrivateKey_file(ctx, Conf_SSLOptions.KeyFile, SSL_FILETYPE_PEM) != 1) { | ||||
| 		array_free_wipe(&Conf_SSLOptions.KeyFilePassword); | ||||
| 		LogOpenSSLError("SSL_CTX_use_PrivateKey_file",  Conf_SSLOptions.KeyFile); | ||||
| 		LogOpenSSLError("Failed to add private key", Conf_SSLOptions.KeyFile); | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	cert_key = Conf_SSLOptions.CertFile ? Conf_SSLOptions.CertFile:Conf_SSLOptions.KeyFile; | ||||
| 	if (SSL_CTX_use_certificate_chain_file(ctx, cert_key) != 1) { | ||||
| 		array_free_wipe(&Conf_SSLOptions.KeyFilePassword); | ||||
| 		LogOpenSSLError("SSL_CTX_use_certificate_file", cert_key); | ||||
| 		LogOpenSSLError("Failed to load certificate chain", cert_key); | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	array_free_wipe(&Conf_SSLOptions.KeyFilePassword); | ||||
|  | ||||
| 	if (!SSL_CTX_check_private_key(ctx)) { | ||||
| 		LogOpenSSLError("Server Private Key does not match certificate", NULL); | ||||
| 		LogOpenSSLError("Server private key does not match certificate", NULL); | ||||
| 		return false; | ||||
| 	} | ||||
| 	if (Load_DH_params()) { | ||||
| 		if (SSL_CTX_set_tmp_dh(ctx, dh_params) != 1) | ||||
| 			LogOpenSSLError("Error setting DH Parameters", Conf_SSLOptions.DHFile); | ||||
| 			LogOpenSSLError("Error setting DH parameters", Conf_SSLOptions.DHFile); | ||||
| 		/* don't return false here: the non-DH modes will still work */ | ||||
| 		DH_free(dh_params); | ||||
| 		dh_params = NULL; | ||||
| @@ -395,31 +463,39 @@ static bool | ||||
| ConnSSL_Init_SSL(CONNECTION *c) | ||||
| { | ||||
| 	int ret; | ||||
|  | ||||
| 	LogDebug("Initializing SSL ..."); | ||||
| 	assert(c != NULL); | ||||
|  | ||||
| #ifdef HAVE_LIBSSL | ||||
| 	if (!ssl_ctx) { | ||||
| 		Log(LOG_ERR, "Cannot init ssl_ctx: OpenSSL initialization failed at startup"); | ||||
| 		Log(LOG_ERR, | ||||
| 		    "Can't initialize SSL context, OpenSSL initialization failed at startup!"); | ||||
| 		return false; | ||||
| 	} | ||||
| 	assert(c->ssl_state.ssl == NULL); | ||||
| 	assert(c->ssl_state.fingerprint == NULL); | ||||
|  | ||||
| 	c->ssl_state.ssl = SSL_new(ssl_ctx); | ||||
| 	if (!c->ssl_state.ssl) { | ||||
| 		LogOpenSSLError("SSL_new()", NULL); | ||||
| 		LogOpenSSLError("Failed to create SSL structure", NULL); | ||||
| 		return false; | ||||
| 	} | ||||
| 	Conn_OPTION_ADD(c, CONN_SSL); | ||||
|  | ||||
| 	ret = SSL_set_fd(c->ssl_state.ssl, c->sock); | ||||
| 	if (ret != 1) { | ||||
| 		LogOpenSSLError("SSL_set_fd()", NULL); | ||||
| 		LogOpenSSLError("Failed to set SSL file descriptor", NULL); | ||||
| 		ConnSSL_Free(c); | ||||
| 		return false; | ||||
| 	} | ||||
| #endif | ||||
| #ifdef HAVE_LIBGNUTLS | ||||
| 	ret = gnutls_set_default_priority(c->ssl_state.gnutls_session); | ||||
| 	if (ret < 0) { | ||||
| 		Log(LOG_ERR, "gnutls_set_default_priority: %s", gnutls_strerror(ret)); | ||||
| 	Conn_OPTION_ADD(c, CONN_SSL); | ||||
| 	ret = gnutls_priority_set(c->ssl_state.gnutls_session, priorities_cache); | ||||
| 	if (ret != GNUTLS_E_SUCCESS) { | ||||
| 		Log(LOG_ERR, "Failed to set GnuTLS session priorities: %s", | ||||
| 		    gnutls_strerror(ret)); | ||||
| 		ConnSSL_Free(c); | ||||
| 		return false; | ||||
| 	} | ||||
| @@ -429,16 +505,20 @@ ConnSSL_Init_SSL(CONNECTION *c) | ||||
| 	 * There doesn't seem to be an alternate GNUTLS API we could use instead, see e.g. | ||||
| 	 * http://www.mail-archive.com/help-gnutls@gnu.org/msg00286.html | ||||
| 	 */ | ||||
| 	gnutls_transport_set_ptr(c->ssl_state.gnutls_session, (gnutls_transport_ptr_t) (long) c->sock); | ||||
| 	ret = gnutls_credentials_set(c->ssl_state.gnutls_session, GNUTLS_CRD_CERTIFICATE, x509_cred); | ||||
| 	if (ret < 0) { | ||||
| 		Log(LOG_ERR, "gnutls_credentials_set: %s", gnutls_strerror(ret)); | ||||
| 	gnutls_transport_set_ptr(c->ssl_state.gnutls_session, | ||||
| 				 (gnutls_transport_ptr_t) (long) c->sock); | ||||
| 	gnutls_certificate_server_set_request(c->ssl_state.gnutls_session, | ||||
| 					      GNUTLS_CERT_REQUEST); | ||||
| 	ret = gnutls_credentials_set(c->ssl_state.gnutls_session, | ||||
| 				     GNUTLS_CRD_CERTIFICATE, x509_cred); | ||||
| 	if (ret != 0) { | ||||
| 		Log(LOG_ERR, "Failed to set SSL credentials: %s", | ||||
| 		    gnutls_strerror(ret)); | ||||
| 		ConnSSL_Free(c); | ||||
| 		return false; | ||||
| 	} | ||||
| 	gnutls_dh_set_prime_bits(c->ssl_state.gnutls_session, DH_BITS_MIN); | ||||
| #endif | ||||
| 	Conn_OPTION_ADD(c, CONN_SSL); | ||||
| 	return true; | ||||
| } | ||||
|  | ||||
| @@ -452,7 +532,8 @@ ConnSSL_PrepareConnect(CONNECTION *c, UNUSED CONF_SERVER *s) | ||||
|  | ||||
| 	err = gnutls_init(&c->ssl_state.gnutls_session, GNUTLS_CLIENT); | ||||
| 	if (err) { | ||||
| 		Log(LOG_ERR, "gnutls_init: %s", gnutls_strerror(err)); | ||||
| 		Log(LOG_ERR, "Failed to initialize new SSL session: %s", | ||||
| 		    gnutls_strerror(err)); | ||||
| 		return false; | ||||
|         } | ||||
| #endif | ||||
| @@ -468,16 +549,23 @@ ConnSSL_PrepareConnect(CONNECTION *c, UNUSED CONF_SERVER *s) | ||||
| } | ||||
|  | ||||
|  | ||||
| /* | ||||
|   Check an Handle Error return code after failed calls to ssl/tls functions. | ||||
|   OpenSSL: | ||||
|   SSL_connect(), SSL_accept(), SSL_do_handshake(), SSL_read(), SSL_peek(), or SSL_write() on ssl. | ||||
|   GNUTLS: | ||||
|   gnutlsssl_read(), gnutls_write() or gnutls_handshake(). | ||||
|   Return: -1 on fatal error, 0 if we can try again later. | ||||
| /** | ||||
|  * Check and handle error return codes after failed calls to SSL functions. | ||||
|  * | ||||
|  * OpenSSL: | ||||
|  * SSL_connect(), SSL_accept(), SSL_do_handshake(), SSL_read(), SSL_peek(), or | ||||
|  * SSL_write() on ssl. | ||||
|  * | ||||
|  * GnuTLS: | ||||
|  * gnutlsssl_read(), gnutls_write() or gnutls_handshake(). | ||||
|  * | ||||
|  * @param c The connection handle. | ||||
|  * @prarm code The return code. | ||||
|  * @param fname The name of the function in which the error occurred. | ||||
|  * @return -1 on fatal errors, 0 if we can try again later. | ||||
|  */ | ||||
| static int | ||||
| ConnSSL_HandleError( CONNECTION *c, const int code, const char *fname ) | ||||
| ConnSSL_HandleError(CONNECTION * c, const int code, const char *fname) | ||||
| { | ||||
| #ifdef HAVE_LIBSSL | ||||
| 	int ret = SSL_ERROR_SYSCALL; | ||||
| @@ -485,6 +573,7 @@ ConnSSL_HandleError( CONNECTION *c, const int code, const char *fname ) | ||||
| 	int real_errno = errno; | ||||
|  | ||||
| 	ret = SSL_get_error(c->ssl_state.ssl, code); | ||||
|  | ||||
| 	switch (ret) { | ||||
| 	case SSL_ERROR_WANT_READ: | ||||
| 		io_event_del(c->sock, IO_WANTWRITE); | ||||
| @@ -496,31 +585,33 @@ ConnSSL_HandleError( CONNECTION *c, const int code, const char *fname ) | ||||
| 	case SSL_ERROR_NONE: | ||||
| 		return 0;	/* try again later */ | ||||
| 	case SSL_ERROR_ZERO_RETURN: | ||||
| 		LogDebug("TLS/SSL connection shut down normally"); | ||||
| 		LogDebug("SSL connection shut down normally."); | ||||
| 		break; | ||||
| 	/* | ||||
| 	SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT, SSL_ERROR_WANT_X509_LOOKUP | ||||
| 	*/ | ||||
| 	case SSL_ERROR_SYSCALL: | ||||
| 		/* SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT, | ||||
| 		 * and SSL_ERROR_WANT_X509_LOOKUP */ | ||||
| 		sslerr = ERR_get_error(); | ||||
| 		if (sslerr) { | ||||
| 			Log( LOG_ERR, "%s: %s", fname, ERR_error_string(sslerr, NULL )); | ||||
| 			Log(LOG_ERR, "SSL error: %s [in %s()]!", | ||||
| 			    ERR_error_string(sslerr, NULL), fname); | ||||
| 		} else { | ||||
|  | ||||
| 			switch (code) {	/* EOF that violated protocol */ | ||||
| 			case 0: | ||||
| 				Log(LOG_ERR, "%s: Client Disconnected", fname ); | ||||
| 				Log(LOG_ERR, | ||||
| 				    "SSL error, client disconnected [in %s()]!", | ||||
| 				    fname); | ||||
| 				break; | ||||
| 			case -1: /* low level socket I/O error, check errno */ | ||||
| 				Log(LOG_ERR, "%s: %s", fname, strerror(real_errno)); | ||||
| 			case -1:	/* low level socket I/O error, check errno */ | ||||
| 				Log(LOG_ERR, "SSL error: %s [in %s()]!", | ||||
| 				    strerror(real_errno), fname); | ||||
| 			} | ||||
| 		} | ||||
| 		break; | ||||
| 	case SSL_ERROR_SSL: | ||||
| 		LogOpenSSLError("TLS/SSL Protocol Error", fname); | ||||
| 		LogOpenSSLError("SSL protocol error", fname); | ||||
| 		break; | ||||
| 	default: | ||||
| 		Log( LOG_ERR, "%s: Unknown error %d!", fname, ret); | ||||
| 		Log(LOG_ERR, "Unknown SSL error %d [in %s()]!", ret, fname); | ||||
| 	} | ||||
| 	ConnSSL_Free(c); | ||||
| 	return -1; | ||||
| @@ -540,7 +631,8 @@ ConnSSL_HandleError( CONNECTION *c, const int code, const char *fname ) | ||||
| 	default: | ||||
| 		assert(code < 0); | ||||
| 		if (gnutls_error_is_fatal(code)) { | ||||
| 			Log(LOG_ERR, "%s: %s", fname, gnutls_strerror(code)); | ||||
| 			Log(LOG_ERR, "SSL error: %s [%s].", | ||||
| 			    gnutls_strerror(code), fname); | ||||
| 			ConnSSL_Free(c); | ||||
| 			return -1; | ||||
| 		} | ||||
| @@ -589,11 +681,11 @@ ConnSSL_Accept( CONNECTION *c ) | ||||
| #ifdef HAVE_LIBGNUTLS | ||||
| 		int err = gnutls_init(&c->ssl_state.gnutls_session, GNUTLS_SERVER); | ||||
| 		if (err) { | ||||
| 			Log(LOG_ERR, "gnutls_init: %s", gnutls_strerror(err)); | ||||
| 			Log(LOG_ERR, "Failed to initialize new SSL session: %s", | ||||
| 			    gnutls_strerror(err)); | ||||
| 			return false; | ||||
| 		} | ||||
| #endif | ||||
| 		LogDebug("ConnSSL_Accept: Initializing SSL data"); | ||||
| 		if (!ConnSSL_Init_SSL(c)) | ||||
| 			return -1; | ||||
| 	} | ||||
| @@ -612,6 +704,80 @@ ConnSSL_Connect( CONNECTION *c ) | ||||
| 	return ConnectAccept(c, true); | ||||
| } | ||||
|  | ||||
| static int | ||||
| ConnSSL_InitCertFp( CONNECTION *c ) | ||||
| { | ||||
| 	const char hex[] = "0123456789abcdef"; | ||||
| 	int i; | ||||
|  | ||||
| #ifdef HAVE_LIBSSL | ||||
| 	unsigned char digest[EVP_MAX_MD_SIZE]; | ||||
| 	unsigned int digest_size; | ||||
| 	X509 *cert; | ||||
|  | ||||
| 	cert = SSL_get_peer_certificate(c->ssl_state.ssl); | ||||
| 	if (!cert) | ||||
| 		return 0; | ||||
|  | ||||
| 	if (!X509_digest(cert, EVP_sha256(), digest, &digest_size)) { | ||||
| 		X509_free(cert); | ||||
| 		return 0; | ||||
| 	} | ||||
|  | ||||
| 	X509_free(cert); | ||||
| #endif /* HAVE_LIBSSL */ | ||||
| #ifdef HAVE_LIBGNUTLS | ||||
| 	gnutls_x509_crt_t cert; | ||||
| 	unsigned int cert_list_size; | ||||
| 	const gnutls_datum_t *cert_list; | ||||
| 	unsigned char digest[MAX_HASH_SIZE]; | ||||
| 	size_t digest_size; | ||||
|  | ||||
| 	if (gnutls_certificate_type_get(c->ssl_state.gnutls_session) != | ||||
| 					GNUTLS_CRT_X509) | ||||
| 		return 0; | ||||
|  | ||||
| 	if (gnutls_x509_crt_init(&cert) != GNUTLS_E_SUCCESS) | ||||
| 		return 0; | ||||
|  | ||||
| 	cert_list_size = 0; | ||||
| 	cert_list = gnutls_certificate_get_peers(c->ssl_state.gnutls_session, | ||||
| 						 &cert_list_size); | ||||
| 	if (!cert_list) { | ||||
| 		gnutls_x509_crt_deinit(cert); | ||||
| 		return 0; | ||||
| 	} | ||||
|  | ||||
| 	if (gnutls_x509_crt_import(cert, &cert_list[0], | ||||
| 				   GNUTLS_X509_FMT_DER) != GNUTLS_E_SUCCESS) { | ||||
| 		gnutls_x509_crt_deinit(cert); | ||||
| 		return 0; | ||||
| 	} | ||||
|  | ||||
| 	digest_size = sizeof(digest); | ||||
| 	if (gnutls_x509_crt_get_fingerprint(cert, GNUTLS_DIG_SHA256, digest, | ||||
| 					    &digest_size)) { | ||||
| 		gnutls_x509_crt_deinit(cert); | ||||
| 		return 0; | ||||
| 	} | ||||
|  | ||||
| 	gnutls_x509_crt_deinit(cert); | ||||
| #endif /* HAVE_LIBGNUTLS */ | ||||
|  | ||||
| 	assert(c->ssl_state.fingerprint == NULL); | ||||
|  | ||||
| 	c->ssl_state.fingerprint = malloc(SHA256_STRING_LEN); | ||||
| 	if (!c->ssl_state.fingerprint) | ||||
| 		return 0; | ||||
|  | ||||
| 	for (i = 0; i < (int)digest_size; i++) { | ||||
| 		c->ssl_state.fingerprint[i * 2] = hex[digest[i] / 16]; | ||||
| 		c->ssl_state.fingerprint[i * 2 + 1] = hex[digest[i] % 16]; | ||||
| 	} | ||||
| 	c->ssl_state.fingerprint[i * 2] = '\0'; | ||||
|  | ||||
| 	return 1; | ||||
| } | ||||
|  | ||||
| /* accept/connect wrapper. if connect is true, connect to peer, otherwise wait for incoming connection */ | ||||
| static int | ||||
| @@ -632,6 +798,8 @@ ConnectAccept( CONNECTION *c, bool connect) | ||||
| 	if (ret) | ||||
| 		return ConnSSL_HandleError(c, ret, "gnutls_handshake"); | ||||
| #endif /* _GNUTLS */ | ||||
| 	(void)ConnSSL_InitCertFp(c); | ||||
|  | ||||
| 	Conn_OPTION_DEL(c, (CONN_SSL_WANT_WRITE|CONN_SSL_WANT_READ|CONN_SSL_CONNECT)); | ||||
| 	ConnSSL_LogCertInfo(c); | ||||
|  | ||||
| @@ -723,6 +891,19 @@ ConnSSL_GetCipherInfo(CONNECTION *c, char *buf, size_t len) | ||||
| #endif | ||||
| } | ||||
|  | ||||
| char * | ||||
| ConnSSL_GetCertFp(CONNECTION *c) | ||||
| { | ||||
| 	return c->ssl_state.fingerprint; | ||||
| } | ||||
|  | ||||
| bool | ||||
| ConnSSL_SetCertFp(CONNECTION *c, const char *fingerprint) | ||||
| { | ||||
| 	assert (c != NULL); | ||||
| 	c->ssl_state.fingerprint = strndup(fingerprint, SHA256_STRING_LEN - 1); | ||||
| 	return c->ssl_state.fingerprint != NULL; | ||||
| } | ||||
| #else | ||||
|  | ||||
| bool | ||||
| @@ -733,5 +914,3 @@ ConnSSL_InitLibrary(void) | ||||
|  | ||||
| #endif /* SSL_SUPPORT */ | ||||
| /* -eof- */ | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -26,6 +26,9 @@ GLOBAL ssize_t ConnSSL_Write PARAMS(( CONNECTION *c, const void *buf, size_t cou | ||||
| GLOBAL ssize_t ConnSSL_Read PARAMS(( CONNECTION *c, void *buf, size_t count)); | ||||
|  | ||||
| GLOBAL bool ConnSSL_GetCipherInfo PARAMS(( CONNECTION *c, char *buf, size_t len )); | ||||
| GLOBAL char *ConnSSL_GetCertFp PARAMS(( CONNECTION *c )); | ||||
| GLOBAL bool ConnSSL_SetCertFp PARAMS(( CONNECTION *c, const char *fingerprint )); | ||||
|  | ||||
| #endif /* SSL_SUPPORT */ | ||||
| #endif /* conn_ssl_h */ | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2007 Alexander Barton (alex@barton.de) | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -9,6 +9,8 @@ | ||||
|  * Please read the file COPYING, README and AUTHORS for more information. | ||||
|  */ | ||||
|  | ||||
| #define CONN_MODULE | ||||
|  | ||||
| #include "portab.h" | ||||
|  | ||||
| /** | ||||
| @@ -16,14 +18,11 @@ | ||||
|  * Connection compression using ZLIB | ||||
|  */ | ||||
|  | ||||
| #define CONN_MODULE | ||||
| /* Additionan debug messages related to ZIP compression: 0=off / 1=on */ | ||||
| #define DEBUG_ZIP 0 | ||||
|  | ||||
| #ifdef ZLIB | ||||
|  | ||||
| /* enable more zlib related debug messages: */ | ||||
| /* #define DEBUG_ZLIB */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <string.h> | ||||
| #include <zlib.h> | ||||
| @@ -31,9 +30,8 @@ | ||||
| #include "conn.h" | ||||
| #include "conn-func.h" | ||||
| #include "log.h" | ||||
|  | ||||
| #include "array.h" | ||||
| #include "exp.h" | ||||
|  | ||||
| #include "conn-zip.h" | ||||
|  | ||||
|  | ||||
| @@ -143,7 +141,7 @@ Zip_Flush( CONN_ID Idx ) | ||||
| 	out->next_out = zipbuf; | ||||
| 	out->avail_out = (uInt)sizeof zipbuf; | ||||
|  | ||||
| #ifdef DEBUG_ZIP | ||||
| #if DEBUG_ZIP | ||||
| 	Log(LOG_DEBUG, "out->avail_in %d, out->avail_out %d", | ||||
| 		out->avail_in, out->avail_out); | ||||
| #endif | ||||
| @@ -166,7 +164,7 @@ Zip_Flush( CONN_ID Idx ) | ||||
| 	assert(out->avail_out <= WRITEBUFFER_SLINK_LEN); | ||||
|  | ||||
| 	zipbuf_used = WRITEBUFFER_SLINK_LEN - out->avail_out; | ||||
| #ifdef DEBUG_ZIP | ||||
| #if DEBUG_ZIP | ||||
| 	Log(LOG_DEBUG, "zipbuf_used: %d", zipbuf_used); | ||||
| #endif | ||||
| 	if (!array_catb(&My_Connections[Idx].wbuf, | ||||
| @@ -177,7 +175,7 @@ Zip_Flush( CONN_ID Idx ) | ||||
| 	} | ||||
|  | ||||
| 	My_Connections[Idx].bytes_out += zipbuf_used; | ||||
| 	My_Connections[Idx].zip.bytes_out += array_bytes(&My_Connections[Idx].zip.wbuf);  | ||||
| 	My_Connections[Idx].zip.bytes_out += array_bytes(&My_Connections[Idx].zip.wbuf); | ||||
| 	array_trunc(&My_Connections[Idx].zip.wbuf); | ||||
|  | ||||
| 	return true; | ||||
| @@ -200,7 +198,7 @@ Unzip_Buffer( CONN_ID Idx ) | ||||
| 	int unzipbuf_used = 0; | ||||
| 	unsigned int z_rdatalen; | ||||
| 	unsigned int in_len; | ||||
| 	 | ||||
|  | ||||
| 	z_stream *in; | ||||
|  | ||||
| 	assert( Idx > NONE ); | ||||
| @@ -218,7 +216,7 @@ Unzip_Buffer( CONN_ID Idx ) | ||||
| 	in->next_out = unzipbuf; | ||||
| 	in->avail_out = (uInt)sizeof unzipbuf; | ||||
|  | ||||
| #ifdef DEBUG_ZIP | ||||
| #if DEBUG_ZIP | ||||
| 	Log(LOG_DEBUG, "in->avail_in %d, in->avail_out %d", | ||||
| 		in->avail_in, in->avail_out); | ||||
| #endif | ||||
| @@ -233,7 +231,7 @@ Unzip_Buffer( CONN_ID Idx ) | ||||
| 	assert(z_rdatalen >= in->avail_in); | ||||
| 	in_len = z_rdatalen - in->avail_in; | ||||
| 	unzipbuf_used = READBUFFER_LEN - in->avail_out; | ||||
| #ifdef DEBUG_ZIP | ||||
| #if DEBUG_ZIP | ||||
| 	Log(LOG_DEBUG, "unzipbuf_used: %d - %d = %d", READBUFFER_LEN, | ||||
| 		in->avail_out, unzipbuf_used); | ||||
| #endif | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -139,13 +139,12 @@ GLOBAL CONN_ID Conn_GetFromProc PARAMS((int fd)); | ||||
| GLOBAL CLIENT* Conn_GetClient PARAMS((CONN_ID i)); | ||||
| GLOBAL PROC_STAT* Conn_GetProcStat PARAMS((CONN_ID i)); | ||||
|  | ||||
| GLOBAL char *Conn_GetCertFp PARAMS((CONN_ID Idx)); | ||||
| GLOBAL bool Conn_SetCertFp PARAMS((CONN_ID Idx, const char *fingerprint)); | ||||
| GLOBAL bool Conn_UsesSSL PARAMS((CONN_ID Idx)); | ||||
|  | ||||
| #ifdef SSL_SUPPORT | ||||
| GLOBAL bool Conn_GetCipherInfo PARAMS((CONN_ID Idx, char *buf, size_t len)); | ||||
| GLOBAL bool Conn_UsesSSL PARAMS((CONN_ID Idx)); | ||||
| #else | ||||
| static inline bool | ||||
| Conn_UsesSSL(UNUSED CONN_ID Idx) | ||||
| { return false; } | ||||
| #endif | ||||
|  | ||||
| GLOBAL const char *Conn_GetIPAInfo PARAMS((CONN_ID Idx)); | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -36,7 +36,7 @@ | ||||
| /* Generic buffer sizes */ | ||||
|  | ||||
| /** Max. length of a line in the configuration file. */ | ||||
| #define LINE_LEN 256 | ||||
| #define LINE_LEN 1024 | ||||
|  | ||||
| /** Max. length of a log message. */ | ||||
| #define MAX_LOG_MSG_LEN 256 | ||||
| @@ -50,11 +50,10 @@ | ||||
| /** Max. length of random salt */ | ||||
| #define RANDOM_SALT_LEN 32 | ||||
|  | ||||
|  | ||||
| /* Size of structures */ | ||||
|  | ||||
| /** Max. count of configurable servers. */ | ||||
| #define MAX_SERVERS 16 | ||||
| #define MAX_SERVERS 64 | ||||
|  | ||||
| /** Max. number of WHOWAS list items that can be stored. */ | ||||
| #define MAX_WHOWAS 64 | ||||
| @@ -62,6 +61,9 @@ | ||||
| /** Size of default connection pool. */ | ||||
| #define CONNECTION_POOL 100 | ||||
|  | ||||
| /** Size of buffer for PAM service name. */ | ||||
| #define MAX_PAM_SERVICE_NAME_LEN 64 | ||||
|  | ||||
|  | ||||
| /* Hard-coded (default) options */ | ||||
|  | ||||
| @@ -74,9 +76,15 @@ | ||||
| /** Configuration file name. */ | ||||
| #define CONFIG_FILE "/ngircd.conf" | ||||
|  | ||||
| /** Directory containing optional configuration snippets. */ | ||||
| #define CONFIG_DIR "/ngircd.conf.d" | ||||
|  | ||||
| /** Name of the MOTD file. */ | ||||
| #define MOTD_FILE "/ngircd.motd" | ||||
|  | ||||
| /** Name of the help file. */ | ||||
| #define HELP_FILE "/Commands.txt" | ||||
|  | ||||
| /** Default chroot() directory. */ | ||||
| #define CHROOT_DIR "" | ||||
|  | ||||
| @@ -96,7 +104,7 @@ | ||||
| #define CLIENT_NICK_LEN 32 | ||||
|  | ||||
| /** Max. password length (including NULL). */ | ||||
| #define CLIENT_PASS_LEN 21 | ||||
| #define CLIENT_PASS_LEN 65 | ||||
|  | ||||
| /** Max. length of user name ("login"; incl. NULL), RFC 2812, section 1.2.1. */ | ||||
| #ifndef STRICT_RFC | ||||
| @@ -104,6 +112,10 @@ | ||||
| #else | ||||
| # define CLIENT_USER_LEN 10 | ||||
| #endif | ||||
| /** Max. length of user names saved for authentication (used by PAM) */ | ||||
| #ifdef PAM | ||||
| # define CLIENT_AUTHUSER_LEN 64 | ||||
| #endif | ||||
|  | ||||
| /** Max. length of "real names" (including NULL). */ | ||||
| #define CLIENT_NAME_LEN 32 | ||||
| @@ -111,6 +123,9 @@ | ||||
| /** Max. host name length (including NULL). */ | ||||
| #define CLIENT_HOST_LEN 64 | ||||
|  | ||||
| /** Max. mask lenght (including NULL). */ | ||||
| #define MASK_LEN (2 * CLIENT_HOST_LEN) | ||||
|  | ||||
| /** Max. length of all client modes (including NULL). */ | ||||
| #define CLIENT_MODE_LEN 21 | ||||
|  | ||||
| @@ -165,11 +180,14 @@ | ||||
| #endif | ||||
|  | ||||
| /** Supported user modes. */ | ||||
| #define USERMODES "abBcCioqrRswx" | ||||
| #define USERMODES "abBcCFiIoqrRswx" | ||||
|  | ||||
| /** Supported channel modes. */ | ||||
| #define CHANMODES "abehiIklmMnoOPqQrRstvVz" | ||||
|  | ||||
| /** Supported channel types. */ | ||||
| #define CHANTYPES "#&+" | ||||
|  | ||||
| /** Away message for users connected to linked servers. */ | ||||
| #define DEFAULT_AWAY_MSG "Away" | ||||
|  | ||||
| @@ -191,6 +209,9 @@ | ||||
| /** Max. number of channel modes with arguments per MODE command. */ | ||||
| #define MAX_HNDL_MODES_ARG 5 | ||||
|  | ||||
| /** Max. number of targets per PRIVMSG/NOTICE/... command. */ | ||||
| #define MAX_HNDL_TARGETS 25 | ||||
|  | ||||
| /** Max. number of WHO replies. */ | ||||
| #define MAX_RPL_WHO 25 | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2010 Alexander Barton (alex@barton.de) | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,14 +16,12 @@ | ||||
|  * Hash calculation | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <string.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "tool.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "hash.h" | ||||
|  | ||||
| static UINT32 jenkins_hash PARAMS((UINT8 *k, UINT32 length, UINT32 initval)); | ||||
| @@ -37,7 +35,7 @@ static UINT32 jenkins_hash PARAMS((UINT8 *k, UINT32 length, UINT32 initval)); | ||||
| GLOBAL UINT32 | ||||
| Hash( const char *String ) | ||||
| { | ||||
| 	char buffer[LINE_LEN]; | ||||
| 	char buffer[COMMAND_LEN]; | ||||
|  | ||||
| 	strlcpy(buffer, String, sizeof(buffer)); | ||||
| 	return jenkins_hash((UINT8 *)ngt_LowerStr(buffer), | ||||
|   | ||||
| @@ -1,11 +1,13 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2005-2006 Florian Westphal (westphal@foo.fh-furtwangen.de) | ||||
|  * Copyright (c)2006-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
|  * the Free Software Foundation; either version 2 of the License, or | ||||
|  * (at your option) any later version. | ||||
|  * Please read the file COPYING, README and AUTHORS for more information. | ||||
|  * | ||||
|  * Copyright (c) 2005 Florian Westphal (westphal@foo.fh-furtwangen.de) | ||||
|  */ | ||||
|  | ||||
| #include "portab.h" | ||||
| @@ -15,21 +17,20 @@ | ||||
|  * I/O abstraction interface. | ||||
|  */ | ||||
|  | ||||
| /* Extra debug messages in event add/delete/callback code: 0=off / 1=on */ | ||||
| #define DEBUG_IO 0 | ||||
|  | ||||
| #include <assert.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
| #include <sys/time.h> | ||||
| #include <sys/types.h> | ||||
| #include <unistd.h> | ||||
| #include <sys/stat.h> | ||||
| #include <fcntl.h> | ||||
|  | ||||
| #include "array.h" | ||||
| #include "io.h" | ||||
| #include "log.h" | ||||
|  | ||||
| /* Enables extra debug messages in event add/delete/callback code. */ | ||||
| /* #define DEBUG_IO */ | ||||
|  | ||||
| typedef struct { | ||||
| #ifdef PROTOTYPES | ||||
|  void (*callback)(int, short); | ||||
| @@ -119,6 +120,7 @@ static bool io_event_change_devpoll(int fd, short what); | ||||
| #endif | ||||
|  | ||||
| #ifdef IO_USE_SELECT | ||||
| #include <sys/time.h> | ||||
| #include "defines.h"	/* for conn.h */ | ||||
| #include "proc.h"	/* for PROC_STAT (needed by conf.h) */ | ||||
| #include "conn.h"	/* for CONN_ID (needed by conf.h) */ | ||||
| @@ -142,7 +144,7 @@ static array io_events; | ||||
|  | ||||
| static void io_docallback PARAMS((int fd, short what)); | ||||
|  | ||||
| #ifdef DEBUG_IO | ||||
| #if DEBUG_IO | ||||
| static void | ||||
| io_debug(const char *s, int fd, int what) | ||||
| { | ||||
| @@ -631,7 +633,7 @@ io_library_init_kqueue(unsigned int eventsize) | ||||
| 	io_masterfd = kqueue(); | ||||
|  | ||||
| 	Log(LOG_INFO, | ||||
| 	    "IO subsystem: kqueue (initial maxfd %u, masterfd %d)", | ||||
| 	    "IO subsystem: kqueue (initial maxfd %u, masterfd %d).", | ||||
| 	    eventsize, io_masterfd); | ||||
| 	if (io_masterfd >= 0) | ||||
| 		library_initialized = true; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,11 +16,10 @@ | ||||
|  * Handler for IRC capability ("CAP") commands | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <string.h> | ||||
| #include <strings.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "conn.h" | ||||
| #include "channel.h" | ||||
| #include "client-cap.h" | ||||
| @@ -30,195 +29,16 @@ | ||||
| #include "messages.h" | ||||
| #include "parse.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "irc-cap.h" | ||||
|  | ||||
| bool Handle_CAP_LS PARAMS((CLIENT *Client, char *Arg)); | ||||
| bool Handle_CAP_LIST PARAMS((CLIENT *Client, char *Arg)); | ||||
| bool Handle_CAP_REQ PARAMS((CLIENT *Client, char *Arg)); | ||||
| bool Handle_CAP_ACK PARAMS((CLIENT *Client, char *Arg)); | ||||
| bool Handle_CAP_CLEAR PARAMS((CLIENT *Client)); | ||||
| bool Handle_CAP_END PARAMS((CLIENT *Client)); | ||||
|  | ||||
| void Set_CAP_Negotiation PARAMS((CLIENT *Client)); | ||||
|  | ||||
| int Parse_CAP PARAMS((int Capabilities, char *Args)); | ||||
| char *Get_CAP_String PARAMS((int Capabilities)); | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRCv3 "CAP" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @returns CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_CAP(CLIENT *Client, REQUEST *Req) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	/* Bad number of prameters? */ | ||||
| 	if (Req->argc < 1 || Req->argc > 2) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	LogDebug("Got \"%s %s\" command from \"%s\" ...", | ||||
| 		 Req->command, Req->argv[0], Client_ID(Client)); | ||||
|  | ||||
| 	if (Req->argc == 1) { | ||||
| 		if (strcasecmp(Req->argv[0], "CLEAR") == 0) | ||||
| 			return Handle_CAP_CLEAR(Client); | ||||
| 		if (strcasecmp(Req->argv[0], "END") == 0) | ||||
| 			return Handle_CAP_END(Client); | ||||
| 	} | ||||
| 	if (Req->argc >= 1 && Req->argc <= 2) { | ||||
| 		if (strcasecmp(Req->argv[0], "LS") == 0) | ||||
| 			return Handle_CAP_LS(Client, Req->argv[1]); | ||||
| 		if (strcasecmp(Req->argv[0], "LIST") == 0) | ||||
| 			return Handle_CAP_LIST(Client, Req->argv[1]); | ||||
| 	} | ||||
| 	if (Req->argc == 2) { | ||||
| 		if (strcasecmp(Req->argv[0], "REQ") == 0) | ||||
| 			return Handle_CAP_REQ(Client, Req->argv[1]); | ||||
| 		if (strcasecmp(Req->argv[0], "ACK") == 0) | ||||
| 			return Handle_CAP_ACK(Client, Req->argv[1]); | ||||
| 	} | ||||
|  | ||||
| 	return IRC_WriteStrClient(Client, ERR_INVALIDCAP_MSG, | ||||
| 				  Client_ID(Client), Req->argv[0]); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the "CAP LS" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Arg Command argument or NULL. | ||||
|  * @returns CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| bool | ||||
| Handle_CAP_LS(CLIENT *Client, UNUSED char *Arg) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	Set_CAP_Negotiation(Client); | ||||
|  | ||||
| 	return IRC_WriteStrClient(Client, | ||||
| 				  "CAP %s LS :multi-prefix", | ||||
| 				  Client_ID(Client)); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the "CAP LIST" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Arg Command argument or NULL. | ||||
|  * @returns CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| bool | ||||
| Handle_CAP_LIST(CLIENT *Client, UNUSED char *Arg) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	return IRC_WriteStrClient(Client, "CAP %s LIST :%s", Client_ID(Client), | ||||
| 				  Get_CAP_String(Client_Cap(Client))); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the "CAP REQ" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Arg Command argument. | ||||
|  * @returns CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| bool | ||||
| Handle_CAP_REQ(CLIENT *Client, char *Arg) | ||||
| { | ||||
| 	int new_cap; | ||||
|  | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Arg != NULL); | ||||
|  | ||||
| 	Set_CAP_Negotiation(Client); | ||||
|  | ||||
| 	new_cap = Parse_CAP(Client_Cap(Client), Arg); | ||||
|  | ||||
| 	if (new_cap < 0) | ||||
| 		return IRC_WriteStrClient(Client, "CAP %s NAK :%s", | ||||
| 					  Client_ID(Client), Arg); | ||||
|  | ||||
| 	Client_CapSet(Client, new_cap); | ||||
| 	return IRC_WriteStrClient(Client, "CAP %s ACK :%s", | ||||
| 				  Client_ID(Client), Arg); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the "CAP ACK" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Arg Command argument. | ||||
|  * @returns CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| bool | ||||
| Handle_CAP_ACK(UNUSED CLIENT *Client, UNUSED char *Arg) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Arg != NULL); | ||||
|  | ||||
| 	return CONNECTED; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the "CAP CLEAR" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @returns CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| bool | ||||
| Handle_CAP_CLEAR(CLIENT *Client) | ||||
| { | ||||
| 	int cap_old; | ||||
|  | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	cap_old = Client_Cap(Client); | ||||
| 	if (cap_old & CLIENT_CAP_MULTI_PREFIX) | ||||
| 		Client_CapDel(Client, CLIENT_CAP_MULTI_PREFIX); | ||||
|  | ||||
| 	return IRC_WriteStrClient(Client, "CAP %s ACK :%s", Client_ID(Client), | ||||
| 				  Get_CAP_String(cap_old)); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the "CAP END" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @returns CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| bool | ||||
| Handle_CAP_END(CLIENT *Client) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	if (Client_Type(Client) != CLIENT_USER) { | ||||
| 		/* User is still logging in ... */ | ||||
| 		Client_CapDel(Client, CLIENT_CAP_PENDING); | ||||
|  | ||||
| 		if (Client_Type(Client) == CLIENT_WAITCAPEND) { | ||||
| 			/* Only "CAP END" was missing: log in! */ | ||||
| 			return Login_User(Client); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return CONNECTED; | ||||
| } | ||||
| /* Local functions */ | ||||
|  | ||||
| /** | ||||
|  * Set CAP negotiation status and mark client as "supports capabilities". | ||||
|  * | ||||
|  * @param Client The client to handle. | ||||
|  */ | ||||
| void | ||||
| static void | ||||
| Set_CAP_Negotiation(CLIENT *Client) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
| @@ -234,7 +54,7 @@ Set_CAP_Negotiation(CLIENT *Client) | ||||
|  * @param Args The string containing space-separated capability names. | ||||
|  * @return Changed capability flags or 0 on error. | ||||
|  */ | ||||
| int | ||||
| static int | ||||
| Parse_CAP(int Capabilities, char *Args) | ||||
| { | ||||
| 	static char tmp[COMMAND_LEN]; | ||||
| @@ -275,7 +95,7 @@ Parse_CAP(int Capabilities, char *Args) | ||||
|  * @param Capabilities Capability flags (bitmask). | ||||
|  * @return Pointer to textual representation. | ||||
|  */ | ||||
| char * | ||||
| static char * | ||||
| Get_CAP_String(int Capabilities) | ||||
| { | ||||
| 	static char txt[COMMAND_LEN]; | ||||
| @@ -288,4 +108,169 @@ Get_CAP_String(int Capabilities) | ||||
| 	return txt; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRCv3 sub-command "CAP LS". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Arg Command argument or NULL. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| static bool | ||||
| Handle_CAP_LS(CLIENT *Client, UNUSED char *Arg) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	Set_CAP_Negotiation(Client); | ||||
|  | ||||
| 	return IRC_WriteStrClient(Client, | ||||
| 				  "CAP %s LS :multi-prefix", | ||||
| 				  Client_ID(Client)); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRCv3 sub-command "CAP LIST". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Arg Command argument or NULL. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| static bool | ||||
| Handle_CAP_LIST(CLIENT *Client, UNUSED char *Arg) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	return IRC_WriteStrClient(Client, "CAP %s LIST :%s", Client_ID(Client), | ||||
| 				  Get_CAP_String(Client_Cap(Client))); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRCv3 sub-command "CAP REQ". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Arg Command argument. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| static bool | ||||
| Handle_CAP_REQ(CLIENT *Client, char *Arg) | ||||
| { | ||||
| 	int new_cap; | ||||
|  | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Arg != NULL); | ||||
|  | ||||
| 	Set_CAP_Negotiation(Client); | ||||
|  | ||||
| 	new_cap = Parse_CAP(Client_Cap(Client), Arg); | ||||
|  | ||||
| 	if (new_cap < 0) | ||||
| 		return IRC_WriteStrClient(Client, "CAP %s NAK :%s", | ||||
| 					  Client_ID(Client), Arg); | ||||
|  | ||||
| 	Client_CapSet(Client, new_cap); | ||||
| 	return IRC_WriteStrClient(Client, "CAP %s ACK :%s", | ||||
| 				  Client_ID(Client), Arg); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRCv3 sub-command "CAP ACK". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Arg Command argument. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| static bool | ||||
| Handle_CAP_ACK(UNUSED CLIENT *Client, UNUSED char *Arg) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Arg != NULL); | ||||
|  | ||||
| 	return CONNECTED; | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRCv3 sub-command "CAP CLEAR". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| static bool | ||||
| Handle_CAP_CLEAR(CLIENT *Client) | ||||
| { | ||||
| 	int cap_old; | ||||
|  | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	cap_old = Client_Cap(Client); | ||||
| 	if (cap_old & CLIENT_CAP_MULTI_PREFIX) | ||||
| 		Client_CapDel(Client, CLIENT_CAP_MULTI_PREFIX); | ||||
|  | ||||
| 	return IRC_WriteStrClient(Client, "CAP %s ACK :%s", Client_ID(Client), | ||||
| 				  Get_CAP_String(cap_old)); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRCv3 sub-command "CAP END". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| static bool | ||||
| Handle_CAP_END(CLIENT *Client) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
|  | ||||
| 	if (Client_Type(Client) != CLIENT_USER) { | ||||
| 		/* User is still logging in ... */ | ||||
| 		Client_CapDel(Client, CLIENT_CAP_PENDING); | ||||
|  | ||||
| 		if (Client_Type(Client) == CLIENT_WAITCAPEND) { | ||||
| 			/* Only "CAP END" was missing: log in! */ | ||||
| 			return Login_User(Client); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return CONNECTED; | ||||
| } | ||||
|  | ||||
| /* Global functions */ | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRCv3 command "CAP". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_CAP(CLIENT *Client, REQUEST *Req) | ||||
| { | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	LogDebug("Got \"%s %s\" command from \"%s\" ...", | ||||
| 		 Req->command, Req->argv[0], Client_ID(Client)); | ||||
|  | ||||
| 	if (Req->argc == 1) { | ||||
| 		if (strcasecmp(Req->argv[0], "CLEAR") == 0) | ||||
| 			return Handle_CAP_CLEAR(Client); | ||||
| 		if (strcasecmp(Req->argv[0], "END") == 0) | ||||
| 			return Handle_CAP_END(Client); | ||||
| 	} | ||||
| 	if (Req->argc >= 1 && Req->argc <= 2) { | ||||
| 		if (strcasecmp(Req->argv[0], "LS") == 0) | ||||
| 			return Handle_CAP_LS(Client, Req->argv[1]); | ||||
| 		if (strcasecmp(Req->argv[0], "LIST") == 0) | ||||
| 			return Handle_CAP_LIST(Client, Req->argv[1]); | ||||
| 	} | ||||
| 	if (Req->argc == 2) { | ||||
| 		if (strcasecmp(Req->argv[0], "REQ") == 0) | ||||
| 			return Handle_CAP_REQ(Client, Req->argv[1]); | ||||
| 		if (strcasecmp(Req->argv[0], "ACK") == 0) | ||||
| 			return Handle_CAP_ACK(Client, Req->argv[1]); | ||||
| 	} | ||||
|  | ||||
| 	return IRC_WriteErrClient(Client, ERR_INVALIDCAP_MSG, | ||||
| 				  Client_ID(Client), Req->argv[0]); | ||||
| } | ||||
|  | ||||
| /* -eof- */ | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2010 Alexander Barton (alex@barton.de) | ||||
|  * Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,13 +16,11 @@ | ||||
|  * IRC channel commands | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <stdlib.h> | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "conn.h" | ||||
| #include "channel.h" | ||||
| #include "conn-func.h" | ||||
| @@ -33,13 +31,12 @@ | ||||
| #include "parse.h" | ||||
| #include "irc.h" | ||||
| #include "irc-info.h" | ||||
| #include "irc-macros.h" | ||||
| #include "irc-write.h" | ||||
| #include "conf.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "irc-channel.h" | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Part from all channels. | ||||
|  * | ||||
| @@ -67,7 +64,6 @@ part_from_all_channels(CLIENT* client, CLIENT *target) | ||||
| 	return CONNECTED; | ||||
| } /* part_from_all_channels */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Check weather a local client is allowed to join an already existing | ||||
|  * channel or not. | ||||
| @@ -83,10 +79,9 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame, | ||||
| 	     const char *key) | ||||
| { | ||||
| 	bool is_invited, is_banned, is_exception; | ||||
| 	const char *channel_modes; | ||||
|  | ||||
| 	/* Allow IRC operators to overwrite channel limits */ | ||||
| 	if (strchr(Client_Modes(Client), 'o')) | ||||
| 	if (Client_HasMode(Client, 'o')) | ||||
| 		return true; | ||||
|  | ||||
| 	is_banned = Lists_Check(Channel_GetListBans(chan), Client); | ||||
| @@ -95,15 +90,14 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame, | ||||
|  | ||||
| 	if (is_banned && !is_invited && !is_exception) { | ||||
| 		/* Client is banned from channel (and not on invite list) */ | ||||
| 		IRC_WriteStrClient(Client, ERR_BANNEDFROMCHAN_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_BANNEDFROMCHAN_MSG, | ||||
| 				   Client_ID(Client), channame); | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	channel_modes = Channel_Modes(chan); | ||||
| 	if (strchr(channel_modes, 'i') && !is_invited) { | ||||
| 	if (Channel_HasMode(chan, 'i') && !is_invited) { | ||||
| 		/* Channel is "invite-only" and client is not on invite list */ | ||||
| 		IRC_WriteStrClient(Client, ERR_INVITEONLYCHAN_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_INVITEONLYCHAN_MSG, | ||||
| 				   Client_ID(Client), channame); | ||||
| 		return false; | ||||
| 	} | ||||
| @@ -111,37 +105,37 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame, | ||||
| 	if (!Channel_CheckKey(chan, Client, key ? key : "")) { | ||||
| 		/* Channel is protected by a channel key and the client | ||||
| 		 * didn't specify the correct one */ | ||||
| 		IRC_WriteStrClient(Client, ERR_BADCHANNELKEY_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_BADCHANNELKEY_MSG, | ||||
| 				   Client_ID(Client), channame); | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	if (strchr(channel_modes, 'l') && | ||||
| 	if (Channel_HasMode(chan, 'l') && | ||||
| 	    (Channel_MaxUsers(chan) <= Channel_MemberCount(chan))) { | ||||
| 		/* There are more clints joined to this channel than allowed */ | ||||
| 		IRC_WriteStrClient(Client, ERR_CHANNELISFULL_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_CHANNELISFULL_MSG, | ||||
| 				   Client_ID(Client), channame); | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	if (strchr(channel_modes, 'z') && !Conn_UsesSSL(Client_Conn(Client))) { | ||||
| 	if (Channel_HasMode(chan, 'z') && !Conn_UsesSSL(Client_Conn(Client))) { | ||||
| 		/* Only "secure" clients are allowed, but clients doesn't | ||||
| 		 * use SSL encryption */ | ||||
| 		IRC_WriteStrClient(Client, ERR_SECURECHANNEL_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_SECURECHANNEL_MSG, | ||||
| 				   Client_ID(Client), channame); | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	if (strchr(channel_modes, 'O') && !Client_OperByMe(Client)) { | ||||
| 	if (Channel_HasMode(chan, 'O') && !Client_HasMode(Client, 'o')) { | ||||
| 		/* Only IRC operators are allowed! */ | ||||
| 		IRC_WriteStrClient(Client, ERR_OPONLYCHANNEL_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_OPONLYCHANNEL_MSG, | ||||
| 				   Client_ID(Client), channame); | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	if (strchr(channel_modes, 'R') && !strchr(Client_Modes(Client), 'R')) { | ||||
| 	if (Channel_HasMode(chan, 'R') && !Client_HasMode(Client, 'R')) { | ||||
| 		/* Only registered users are allowed! */ | ||||
| 		IRC_WriteStrClient(Client, ERR_REGONLYCHANNEL_MSG, | ||||
| 		IRC_WriteErrClient(Client, ERR_REGONLYCHANNEL_MSG, | ||||
| 				   Client_ID(Client), channame); | ||||
| 		return false; | ||||
| 	} | ||||
| @@ -149,7 +143,6 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame, | ||||
| 	return true; | ||||
| } /* join_allowed */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Set user channel modes. | ||||
|  * | ||||
| @@ -169,16 +162,15 @@ join_set_channelmodes(CHANNEL *chan, CLIENT *target, const char *flags) | ||||
|  | ||||
| 	/* If the channel is persistent (+P) and client is an IRC op: | ||||
| 	 * make client chanop, if not disabled in configuration. */ | ||||
| 	if (strchr(Channel_Modes(chan), 'P') && Conf_OperChanPAutoOp | ||||
| 	    && strchr(Client_Modes(target), 'o')) | ||||
| 	if (Channel_HasMode(chan, 'P') && Conf_OperChanPAutoOp | ||||
| 	    && Client_HasMode(target, 'o')) | ||||
| 		Channel_UserModeAdd(chan, target, 'o'); | ||||
| } /* join_set_channelmodes */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Forward JOIN command to a specific server | ||||
|  * | ||||
|  * This function diffentiates between servers using RFC 2813 mode that | ||||
|  * This function differentiates between servers using RFC 2813 mode that | ||||
|  * support the JOIN command with appended ASCII 7 character and channel | ||||
|  * modes, and servers using RFC 1459 protocol which require separate JOIN | ||||
|  * and MODE commands. | ||||
| @@ -211,7 +203,6 @@ cb_join_forward(CLIENT *To, CLIENT *Prefix, void *Data) | ||||
| 					 Client_ID(Prefix)); | ||||
| } /* cb_join_forward */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Forward JOIN command to all servers | ||||
|  * | ||||
| @@ -256,9 +247,8 @@ join_forward(CLIENT *Client, CLIENT *target, CHANNEL *chan, | ||||
| 	} | ||||
| } /* join_forward */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Aknowledge user JOIN request and send "channel info" numerics. | ||||
|  * Acknowledge user JOIN request and send "channel info" numerics. | ||||
|  * | ||||
|  * @param Client	Client used to prefix the genrated commands | ||||
|  * @param target	Forward commands/numerics to this user | ||||
| @@ -299,15 +289,12 @@ join_send_topic(CLIENT *Client, CLIENT *target, CHANNEL *chan, | ||||
| 				  Channel_Name(chan)); | ||||
| } /* join_send_topic */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "JOIN" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.2.1 "Join message"; RFC 2813, 4.2.1 "Join message". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received | ||||
|  * @param Req Request structure with prefix and all parameters | ||||
|  * @returns CONNECTED or DISCONNECTED | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_JOIN( CLIENT *Client, REQUEST *Req ) | ||||
| @@ -319,20 +306,7 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) | ||||
| 	assert (Client != NULL); | ||||
| 	assert (Req != NULL); | ||||
|  | ||||
| 	/* Bad number of arguments? */ | ||||
| 	if (Req->argc < 1 || Req->argc > 2) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	/* Who is the sender? */ | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER) | ||||
| 		target = Client_Search(Req->prefix); | ||||
| 	else | ||||
| 		target = Client; | ||||
|  | ||||
| 	if (!target) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					  Client_ID(Client), Req->prefix); | ||||
| 	_IRC_GET_SENDER_OR_RETURN_(target, Req, Client) | ||||
|  | ||||
| 	/* Is argument "0"? */ | ||||
| 	if (Req->argc == 1 && !strncmp("0", Req->argv[0], 2)) | ||||
| @@ -346,8 +320,8 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) | ||||
| 	channame = strtok_r(channame, ",", &lastchan); | ||||
|  | ||||
| 	/* Make sure that "channame" is not the empty string ("JOIN :") */ | ||||
| 	if (! channame) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 	if (!channame) | ||||
| 		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	while (channame) { | ||||
| @@ -363,12 +337,6 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) | ||||
| 		} | ||||
|  | ||||
| 		chan = Channel_Search(channame); | ||||
| 		if (!chan && Conf_PredefChannelsOnly) { | ||||
| 			 /* channel must be created, but forbidden by config */ | ||||
| 			IRC_WriteStrClient(Client, ERR_NOSUCHCHANNEL_MSG, | ||||
| 					   Client_ID(Client), channame); | ||||
| 			goto join_next; | ||||
| 		} | ||||
|  | ||||
| 		/* Local client? */ | ||||
| 		if (Client_Type(Client) == CLIENT_USER) { | ||||
| @@ -376,12 +344,21 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) | ||||
| 				/* Already existing channel: already member? */ | ||||
| 				if (Channel_IsMemberOf(chan, Client)) | ||||
| 				    goto join_next; | ||||
| 			} else { | ||||
| 				/* Channel must be created */ | ||||
| 				if (!strchr(Conf_AllowedChannelTypes, channame[0])) { | ||||
| 					/* ... but channel type is not allowed! */ | ||||
| 					IRC_WriteErrClient(Client, | ||||
| 						ERR_NOSUCHCHANNEL_MSG, | ||||
| 						Client_ID(Client), channame); | ||||
| 					goto join_next; | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 			/* Test if the user has reached the channel limit */ | ||||
| 			if ((Conf_MaxJoins > 0) && | ||||
| 			    (Channel_CountForUser(Client) >= Conf_MaxJoins)) { | ||||
| 				if (!IRC_WriteStrClient(Client, | ||||
| 				if (!IRC_WriteErrClient(Client, | ||||
| 						ERR_TOOMANYCHANNELS_MSG, | ||||
| 						Client_ID(Client), channame)) | ||||
| 					return DISCONNECTED; | ||||
| @@ -443,15 +420,12 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) | ||||
| 	return CONNECTED; | ||||
| } /* IRC_JOIN */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "PART" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.2.2: "Part message". | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received | ||||
|  * @param Req		Request structure with prefix and all parameters | ||||
|  * @returns		CONNECTED or DISCONNECTED | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_PART(CLIENT * Client, REQUEST * Req) | ||||
| @@ -462,30 +436,19 @@ IRC_PART(CLIENT * Client, REQUEST * Req) | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	if (Req->argc < 1 || Req->argc > 2) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	/* Get the sender */ | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER) | ||||
| 		target = Client_Search(Req->prefix); | ||||
| 	else | ||||
| 		target = Client; | ||||
| 	if (!target) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					  Client_ID(Client), Req->prefix); | ||||
| 	_IRC_GET_SENDER_OR_RETURN_(target, Req, Client) | ||||
|  | ||||
| 	/* Loop over all the given channel names */ | ||||
| 	chan = strtok(Req->argv[0], ","); | ||||
|  | ||||
| 	/* Make sure that "chan" is not the empty string ("PART :") */ | ||||
| 	if (! chan) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 	if (!chan) | ||||
| 		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	while (chan) { | ||||
| 		Channel_Part(target, Client, chan, | ||||
| 			     Req->argc > 1 ? Req->argv[1] : Client_ID(target)); | ||||
| 			     Req->argc > 1 ? Req->argv[1] : ""); | ||||
| 		chan = strtok(NULL, ","); | ||||
| 	} | ||||
|  | ||||
| @@ -496,15 +459,12 @@ IRC_PART(CLIENT * Client, REQUEST * Req) | ||||
| 	return CONNECTED; | ||||
| } /* IRC_PART */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "TOPIC" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.2.4 "Topic message". | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received | ||||
|  * @param Req		Request structure with prefix and all parameters | ||||
|  * @returns		CONNECTED or DISCONNECTED | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_TOPIC( CLIENT *Client, REQUEST *Req ) | ||||
| @@ -517,32 +477,21 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req ) | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( Req != NULL ); | ||||
|  | ||||
| 	if (Req->argc < 1 || Req->argc > 2) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER) | ||||
| 		from = Client_Search(Req->prefix); | ||||
| 	else | ||||
| 		from = Client; | ||||
|  | ||||
| 	if (!from) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					  Client_ID(Client), Req->prefix); | ||||
| 	_IRC_GET_SENDER_OR_RETURN_(from, Req, Client) | ||||
|  | ||||
| 	chan = Channel_Search(Req->argv[0]); | ||||
| 	if (!chan) | ||||
| 		return IRC_WriteStrClient(from, ERR_NOSUCHCHANNEL_MSG, | ||||
| 		return IRC_WriteErrClient(from, ERR_NOSUCHCHANNEL_MSG, | ||||
| 					  Client_ID(from), Req->argv[0]); | ||||
|  | ||||
| 	/* Only remote servers and channel members are allowed to change the | ||||
| 	 * channel topic, and IRC opreators when the Conf_OperCanMode option | ||||
| 	 * channel topic, and IRC operators when the Conf_OperCanMode option | ||||
| 	 * is set in the server configuration. */ | ||||
| 	if (Client_Type(Client) != CLIENT_SERVER) { | ||||
| 		topic_power = Client_HasMode(from, 'o'); | ||||
| 		if (!Channel_IsMemberOf(chan, from) | ||||
| 		    && !(Conf_OperCanMode && topic_power)) | ||||
| 			return IRC_WriteStrClient(from, ERR_NOTONCHANNEL_MSG, | ||||
| 			return IRC_WriteErrClient(from, ERR_NOTONCHANNEL_MSG, | ||||
| 						  Client_ID(from), Req->argv[0]); | ||||
| 	} else | ||||
| 		topic_power = true; | ||||
| @@ -571,14 +520,14 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req ) | ||||
| 						  Channel_Name(chan)); | ||||
| 	} | ||||
|  | ||||
| 	if (strchr(Channel_Modes(chan), 't')) { | ||||
| 	if (Channel_HasMode(chan, 't')) { | ||||
| 		/* Topic Lock. Is the user a channel op or IRC operator? */ | ||||
| 		if(!topic_power && | ||||
| 		   !strchr(Channel_UserModes(chan, from), 'h') && | ||||
| 		   !strchr(Channel_UserModes(chan, from), 'o') && | ||||
| 		   !strchr(Channel_UserModes(chan, from), 'a') && | ||||
| 		   !strchr(Channel_UserModes(chan, from), 'q')) | ||||
| 			return IRC_WriteStrClient(from, ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 		   !Channel_UserHasMode(chan, from, 'h') && | ||||
| 		   !Channel_UserHasMode(chan, from, 'o') && | ||||
| 		   !Channel_UserHasMode(chan, from, 'a') && | ||||
| 		   !Channel_UserHasMode(chan, from, 'q')) | ||||
| 			return IRC_WriteErrClient(from, ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 						  Client_ID(from), | ||||
| 						  Channel_Name(chan)); | ||||
| 	} | ||||
| @@ -606,15 +555,9 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req ) | ||||
| 		return CONNECTED; | ||||
| } /* IRC_TOPIC */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "LIST" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.2.6 "List message". | ||||
|  * | ||||
|  * This implementation handles the local case as well as the forwarding of the | ||||
|  * LIST command to other servers in the IRC network. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
| @@ -630,31 +573,18 @@ IRC_LIST( CLIENT *Client, REQUEST *Req ) | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	/* Bad number of prameters? */ | ||||
| 	if (Req->argc > 2) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
| 	_IRC_GET_SENDER_OR_RETURN_(from, Req, Client) | ||||
|  | ||||
| 	if (Req->argc > 0) | ||||
| 		pattern = strtok(Req->argv[0], ","); | ||||
| 	else | ||||
| 		pattern = "*"; | ||||
|  | ||||
| 	/* Get sender from prefix, if any */ | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER) | ||||
| 		from = Client_Search(Req->prefix); | ||||
| 	else | ||||
| 		from = Client; | ||||
|  | ||||
| 	if (!from) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG, | ||||
| 					  Client_ID(Client), Req->prefix); | ||||
|  | ||||
| 	if (Req->argc == 2) { | ||||
| 		/* Forward to other server? */ | ||||
| 		target = Client_Search(Req->argv[1]); | ||||
| 		if (! target || Client_Type(target) != CLIENT_SERVER) | ||||
| 			return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG, | ||||
| 			return IRC_WriteErrClient(from, ERR_NOSUCHSERVER_MSG, | ||||
| 						  Client_ID(Client), | ||||
| 						  Req->argv[1]); | ||||
|  | ||||
| @@ -667,6 +597,10 @@ IRC_LIST( CLIENT *Client, REQUEST *Req ) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/* Send list head */ | ||||
| 	if (!IRC_WriteStrClient(from, RPL_LISTSTART_MSG, Client_ID(from))) | ||||
| 		return DISCONNECTED; | ||||
|  | ||||
| 	while (pattern) { | ||||
| 		/* Loop through all the channels */ | ||||
| 		if (Req->argc > 0) | ||||
| @@ -676,9 +610,10 @@ IRC_LIST( CLIENT *Client, REQUEST *Req ) | ||||
| 			/* Check search pattern */ | ||||
| 			if (MatchCaseInsensitive(pattern, Channel_Name(chan))) { | ||||
| 				/* Gotcha! */ | ||||
| 				if (!strchr(Channel_Modes(chan), 's') | ||||
| 				if (!Channel_HasMode(chan, 's') | ||||
| 				    || Channel_IsMemberOf(chan, from) | ||||
| 				    || (!Conf_MorePrivacy && Client_OperByMe(Client))) { | ||||
| 				    || Client_HasMode(from, 'o')) | ||||
| 				{ | ||||
| 					if ((Conf_MaxListSize > 0) | ||||
| 					    && IRC_CheckListTooBig(from, count, | ||||
| 								   Conf_MaxListSize, | ||||
| @@ -703,25 +638,20 @@ IRC_LIST( CLIENT *Client, REQUEST *Req ) | ||||
| 			pattern = NULL; | ||||
| 	} | ||||
|  | ||||
| 	IRC_SetPenalty(from, 2); | ||||
| 	return IRC_WriteStrClient(from, RPL_LISTEND_MSG, Client_ID(from)); | ||||
| } /* IRC_LIST */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC+ command "CHANINFO". | ||||
|  * Handler for the IRC+ "CHANINFO" command. | ||||
|  * | ||||
|  * See doc/Protocol.txt, section II.3: | ||||
|  * "Exchange channel-modes, topics, and persistent channels". | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received | ||||
|  * @param Req		Request structure with prefix and all parameters | ||||
|  * @returns		CONNECTED or DISCONNECTED | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_CHANINFO( CLIENT *Client, REQUEST *Req ) | ||||
| { | ||||
| 	char modes_add[COMMAND_LEN], l[16], *ptr; | ||||
| 	char modes_add[COMMAND_LEN], l[16]; | ||||
| 	CLIENT *from; | ||||
| 	CHANNEL *chan; | ||||
| 	int arg_topic; | ||||
| @@ -731,72 +661,67 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req ) | ||||
|  | ||||
| 	/* Bad number of parameters? */ | ||||
| 	if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	/* Compatibility kludge */ | ||||
| 	if( Req->argc == 5 ) arg_topic = 4; | ||||
| 	else if( Req->argc == 3 ) arg_topic = 2; | ||||
| 	else arg_topic = -1; | ||||
| 	if (Req->argc == 5) | ||||
| 		arg_topic = 4; | ||||
| 	else if(Req->argc == 3) | ||||
| 		arg_topic = 2; | ||||
| 	else | ||||
| 		arg_topic = -1; | ||||
|  | ||||
| 	/* Search origin */ | ||||
| 	from = Client_Search( Req->prefix ); | ||||
| 	if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix ); | ||||
| 	_IRC_GET_SENDER_OR_RETURN_(from, Req, Client) | ||||
|  | ||||
| 	/* Search or create channel */ | ||||
| 	chan = Channel_Search( Req->argv[0] ); | ||||
| 	if( ! chan ) chan = Channel_Create( Req->argv[0] ); | ||||
| 	if( ! chan ) return CONNECTED; | ||||
| 	if (!chan) | ||||
| 		chan = Channel_Create( Req->argv[0] ); | ||||
| 	if (!chan) | ||||
| 		return CONNECTED; | ||||
|  | ||||
| 	if( Req->argv[1][0] == '+' ) | ||||
| 	{ | ||||
| 		ptr = Channel_Modes( chan ); | ||||
| 		if( ! *ptr ) | ||||
| 		{ | ||||
| 			/* OK, this channel doesn't have modes jet, set the received ones: */ | ||||
| 			Channel_SetModes( chan, &Req->argv[1][1] ); | ||||
| 	if (Req->argv[1][0] == '+') { | ||||
| 		if (!*Channel_Modes(chan)) { | ||||
| 			/* OK, this channel doesn't have modes yet, | ||||
| 			 * set the received ones: */ | ||||
| 			Channel_SetModes(chan, &Req->argv[1][1]); | ||||
|  | ||||
| 			if( Req->argc == 5 ) | ||||
| 			{ | ||||
| 				if( strchr( Channel_Modes( chan ), 'k' )) Channel_SetKey( chan, Req->argv[2] ); | ||||
| 				if( strchr( Channel_Modes( chan ), 'l' )) Channel_SetMaxUsers( chan, atol( Req->argv[3] )); | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
| 			if(Req->argc == 5) { | ||||
| 				if(Channel_HasMode(chan, 'k')) | ||||
| 					Channel_SetKey(chan, Req->argv[2]); | ||||
| 				if(Channel_HasMode(chan, 'l')) | ||||
| 					Channel_SetMaxUsers(chan, atol(Req->argv[3])); | ||||
| 			} else { | ||||
| 				/* Delete modes which we never want to inherit */ | ||||
| 				Channel_ModeDel( chan, 'l' ); | ||||
| 				Channel_ModeDel( chan, 'k' ); | ||||
| 				Channel_ModeDel(chan, 'l'); | ||||
| 				Channel_ModeDel(chan, 'k'); | ||||
| 			} | ||||
|  | ||||
| 			strcpy( modes_add, "" ); | ||||
| 			ptr = Channel_Modes( chan ); | ||||
| 			while( *ptr ) | ||||
| 			{ | ||||
| 				if( *ptr == 'l' ) | ||||
| 				{ | ||||
| 					snprintf( l, sizeof( l ), " %lu", Channel_MaxUsers( chan )); | ||||
| 					strlcat( modes_add, l, sizeof( modes_add )); | ||||
| 				} | ||||
| 				if( *ptr == 'k' ) | ||||
| 				{ | ||||
| 					strlcat( modes_add, " ", sizeof( modes_add )); | ||||
| 					strlcat( modes_add, Channel_Key( chan ), sizeof( modes_add )); | ||||
| 				} | ||||
| 	     			ptr++; | ||||
| 			strcpy(modes_add, ""); | ||||
| 			if (Channel_HasMode(chan, 'l'))  { | ||||
| 				snprintf(l, sizeof(l), " %lu", | ||||
| 					 Channel_MaxUsers(chan)); | ||||
| 				strlcat(modes_add, l, sizeof(modes_add)); | ||||
| 			} | ||||
| 			if (Channel_HasMode(chan, 'k'))  { | ||||
| 				strlcat(modes_add, " ", sizeof(modes_add)); | ||||
| 				strlcat(modes_add, Channel_Key(chan), | ||||
| 					sizeof(modes_add)); | ||||
| 			} | ||||
|  | ||||
| 			/* Inform members of this channel */ | ||||
| 			IRC_WriteStrChannelPrefix( Client, chan, from, false, "MODE %s +%s%s", Req->argv[0], Channel_Modes( chan ), modes_add ); | ||||
| 			IRC_WriteStrChannelPrefix(Client, chan, from, false, | ||||
| 						  "MODE %s +%s%s", Req->argv[0], | ||||
| 						  Channel_Modes(chan), modes_add); | ||||
| 		} | ||||
| 	} | ||||
| 	else Log( LOG_WARNING, "CHANINFO: invalid MODE format ignored!" ); | ||||
| 	else | ||||
| 		Log(LOG_WARNING, "CHANINFO: invalid MODE format ignored!"); | ||||
|  | ||||
| 	if( arg_topic > 0 ) | ||||
| 	{ | ||||
| 	if (arg_topic > 0) { | ||||
| 		/* We got a topic */ | ||||
| 		ptr = Channel_Topic( chan ); | ||||
| 		if(( ! *ptr ) && ( Req->argv[arg_topic][0] )) | ||||
| 		{ | ||||
| 		if (!*Channel_Topic(chan) && Req->argv[arg_topic][0]) { | ||||
| 			/* OK, there is no topic jet */ | ||||
| 			Channel_SetTopic(chan, Client, Req->argv[arg_topic]); | ||||
| 			IRC_WriteStrChannelPrefix(Client, chan, from, false, | ||||
| @@ -804,13 +729,24 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req ) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/* Forward CHANINFO to other serevrs */ | ||||
| 	if( Req->argc == 5 ) IRC_WriteStrServersPrefixFlag( Client, from, 'C', "CHANINFO %s %s %s %s :%s", Req->argv[0], Req->argv[1], Req->argv[2], Req->argv[3], Req->argv[4] ); | ||||
| 	else if( Req->argc == 3 ) IRC_WriteStrServersPrefixFlag( Client, from, 'C', "CHANINFO %s %s :%s", Req->argv[0], Req->argv[1], Req->argv[2] ); | ||||
| 	else IRC_WriteStrServersPrefixFlag( Client, from, 'C', "CHANINFO %s %s", Req->argv[0], Req->argv[1] ); | ||||
| 	/* Forward CHANINFO to other servers */ | ||||
| 	if (Req->argc == 5) | ||||
| 		IRC_WriteStrServersPrefixFlag(Client, from, 'C', | ||||
| 					      "CHANINFO %s %s %s %s :%s", | ||||
| 					      Req->argv[0], Req->argv[1], | ||||
| 					      Req->argv[2], Req->argv[3], | ||||
| 					      Req->argv[4]); | ||||
| 	else if (Req->argc == 3) | ||||
| 		IRC_WriteStrServersPrefixFlag(Client, from, 'C', | ||||
| 					      "CHANINFO %s %s :%s", | ||||
| 					      Req->argv[0], Req->argv[1], | ||||
| 					      Req->argv[2]); | ||||
| 	else | ||||
| 		IRC_WriteStrServersPrefixFlag(Client, from, 'C', | ||||
| 					      "CHANINFO %s %s", | ||||
| 					      Req->argv[0], Req->argv[1]); | ||||
|  | ||||
| 	return CONNECTED; | ||||
| } /* IRC_CHANINFO */ | ||||
|  | ||||
|  | ||||
| /* -eof- */ | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,7 +16,8 @@ | ||||
|  * IRC encoding commands | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #ifdef ICONV | ||||
|  | ||||
| #include <assert.h> | ||||
| #include <string.h> | ||||
|  | ||||
| @@ -28,11 +29,8 @@ | ||||
| #include "parse.h" | ||||
| #include "tool.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "irc-encoding.h" | ||||
|  | ||||
| #ifdef ICONV | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC+ "CHARCONV" command. | ||||
|  * | ||||
| @@ -48,15 +46,11 @@ IRC_CHARCONV(CLIENT *Client, REQUEST *Req) | ||||
| 	assert (Client != NULL); | ||||
| 	assert (Req != NULL); | ||||
|  | ||||
| 	if (Req->argc != 1) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	strlcpy(encoding, Req->argv[0], sizeof(encoding)); | ||||
| 	ngt_UpperStr(encoding); | ||||
|  | ||||
| 	if (!Conn_SetEncoding(Client_Conn(Client), encoding)) | ||||
| 		return IRC_WriteStrClient(Client, ERR_IP_CHARCONV_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_IP_CHARCONV_MSG, | ||||
| 					  Client_ID(Client), encoding); | ||||
|  | ||||
| 	return IRC_WriteStrClient(Client, RPL_IP_CHARCONV_MSG, | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,15 +16,14 @@ | ||||
|  * Login and logout | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <ctype.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
| #include <strings.h> | ||||
| #include <time.h> | ||||
|  | ||||
| #include "conn-func.h" | ||||
| #include "class.h" | ||||
| #include "conf.h" | ||||
| #include "channel.h" | ||||
| #include "log.h" | ||||
| @@ -32,25 +31,20 @@ | ||||
| #include "messages.h" | ||||
| #include "parse.h" | ||||
| #include "irc.h" | ||||
| #include "irc-info.h" | ||||
| #include "irc-macros.h" | ||||
| #include "irc-write.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "irc-login.h" | ||||
|  | ||||
| static void Kill_Nick PARAMS((char *Nick, char *Reason)); | ||||
| static void Change_Nick PARAMS((CLIENT * Origin, CLIENT * Target, char *NewNick, | ||||
| 				bool InformClient)); | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "PASS" command. | ||||
|  * | ||||
|  * See RFC 2813 section 4.1.1, and RFC 2812 section 3.1.1. | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @returns		CONNECTED or DISCONNECTED. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_PASS( CLIENT *Client, REQUEST *Req ) | ||||
| @@ -63,7 +57,7 @@ IRC_PASS( CLIENT *Client, REQUEST *Req ) | ||||
|  | ||||
| 	/* Return an error if this is not a local client */ | ||||
| 	if (Client_Conn(Client) <= NONE) | ||||
| 		return IRC_WriteStrClient(Client, ERR_UNKNOWNCOMMAND_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_UNKNOWNCOMMAND_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	if (Client_Type(Client) == CLIENT_UNKNOWN && Req->argc == 1) { | ||||
| @@ -83,11 +77,11 @@ IRC_PASS( CLIENT *Client, REQUEST *Req ) | ||||
| 	} else if (Client_Type(Client) == CLIENT_UNKNOWN || | ||||
| 		   Client_Type(Client) == CLIENT_UNKNOWNSERVER) { | ||||
| 		/* Unregistered connection, but wrong number of arguments: */ | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
| 	} else { | ||||
| 		/* Registered connection, PASS command is not allowed! */ | ||||
| 		return IRC_WriteStrClient(Client, ERR_ALREADYREGISTRED_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_ALREADYREGISTRED_MSG, | ||||
| 					  Client_ID(Client)); | ||||
| 	} | ||||
|  | ||||
| @@ -146,7 +140,7 @@ IRC_PASS( CLIENT *Client, REQUEST *Req ) | ||||
| 			} else | ||||
| 				flags = ""; | ||||
| 			Log(LOG_INFO, | ||||
| 			    "Peer on conenction %d announces itself as %s-%s using protocol %d.%d/IRC+ (flags: \"%s\").", | ||||
| 			    "Peer on connection %d announces itself as %s-%s using protocol %d.%d/IRC+ (flags: \"%s\").", | ||||
| 			    Client_Conn(Client), impl, serverver, | ||||
| 			    protohigh, protolow, flags); | ||||
| 		} else { | ||||
| @@ -167,24 +161,18 @@ IRC_PASS( CLIENT *Client, REQUEST *Req ) | ||||
| 	return CONNECTED; | ||||
| } /* IRC_PASS */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "NICK" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.1.2 "Nick message", and RFC 2813, 4.1.3 "Nick". | ||||
|  * | ||||
|  * This function implements the IRC command "NICK" which is used to register | ||||
|  * with the server, to change already registered nicknames and to introduce | ||||
|  * new users which are connected to other servers. | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @returns		CONNECTED or DISCONNECTED. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_NICK( CLIENT *Client, REQUEST *Req ) | ||||
| { | ||||
| 	CLIENT *intr_c, *target, *c; | ||||
| 	CHANNEL *chan; | ||||
| 	char *nick, *user, *hostname, *modes, *info; | ||||
| 	int token, hops; | ||||
|  | ||||
| @@ -204,31 +192,23 @@ IRC_NICK( CLIENT *Client, REQUEST *Req ) | ||||
| 	    || (Client_Type(Client) == CLIENT_SERVER && Req->argc == 1)) | ||||
| 	{ | ||||
| 		/* User registration or change of nickname */ | ||||
|  | ||||
| 		/* Wrong number of arguments? */ | ||||
| 		if( Req->argc != 1 ) | ||||
| 			return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 						   Client_ID( Client ), | ||||
| 						   Req->command ); | ||||
| 		_IRC_ARGC_EQ_OR_RETURN_(Client, Req, 1) | ||||
|  | ||||
| 		/* Search "target" client */ | ||||
| 		if( Client_Type( Client ) == CLIENT_SERVER ) | ||||
| 		{ | ||||
| 			target = Client_Search( Req->prefix ); | ||||
| 			if( ! target ) | ||||
| 				return IRC_WriteStrClient( Client, | ||||
| 							   ERR_NOSUCHNICK_MSG, | ||||
| 							   Client_ID( Client ), | ||||
| 							   Req->argv[0] ); | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 		if (Client_Type(Client) == CLIENT_SERVER) { | ||||
| 			_IRC_REQUIRE_PREFIX_OR_RETURN_(Client, Req) | ||||
| 			target = Client_Search(Req->prefix); | ||||
| 			if (!target) | ||||
| 				return IRC_WriteErrClient(Client, | ||||
| 							  ERR_NOSUCHNICK_MSG, | ||||
| 							  Client_ID(Client), | ||||
| 							  Req->argv[0]); | ||||
| 		} else { | ||||
| 			/* Is this a restricted client? */ | ||||
| 			if( Client_HasMode( Client, 'r' )) | ||||
| 				return IRC_WriteStrClient( Client, | ||||
| 							   ERR_RESTRICTED_MSG, | ||||
| 							   Client_ID( Client )); | ||||
|  | ||||
| 			if (Client_HasMode(Client, 'r')) | ||||
| 				return IRC_WriteErrClient(Client, | ||||
| 							  ERR_RESTRICTED_MSG, | ||||
| 							  Client_ID(Client)); | ||||
| 			target = Client; | ||||
| 		} | ||||
|  | ||||
| @@ -237,15 +217,14 @@ IRC_NICK( CLIENT *Client, REQUEST *Req ) | ||||
| 		 * do anything. This is how the original ircd behaves and some | ||||
| 		 * clients (for example Snak) expect it to be like this. | ||||
| 		 * But I doubt that this is "really the right thing" ... */ | ||||
| 		if( strcmp( Client_ID( target ), Req->argv[0] ) == 0 ) | ||||
| 		if (strcmp(Client_ID(target), Req->argv[0]) == 0) | ||||
| 			return CONNECTED; | ||||
| #endif | ||||
|  | ||||
| 		/* Check that the new nickname is available. Special case: | ||||
| 		 * the client only changes from/to upper to lower case. */ | ||||
| 		if( strcasecmp( Client_ID( target ), Req->argv[0] ) != 0 ) | ||||
| 		{ | ||||
| 			if( ! Client_CheckNick( target, Req->argv[0] )) | ||||
| 		if (strcasecmp(Client_ID(target), Req->argv[0]) != 0) { | ||||
| 			if (!Client_CheckNick(target, Req->argv[0])) | ||||
| 				return CONNECTED; | ||||
| 		} | ||||
|  | ||||
| @@ -261,8 +240,12 @@ IRC_NICK( CLIENT *Client, REQUEST *Req ) | ||||
|  | ||||
| #ifndef STRICT_RFC | ||||
| 			if (Conf_AuthPing) { | ||||
| #ifdef HAVE_ARC4RANDOM | ||||
| 				Conn_SetAuthPing(Client_Conn(Client), arc4random()); | ||||
| #else | ||||
| 				Conn_SetAuthPing(Client_Conn(Client), rand()); | ||||
| 				IRC_WriteStrClient(Client, "PING :%ld", | ||||
| #endif | ||||
| 				Conn_WriteStr(Client_Conn(Client), "PING :%ld", | ||||
| 					Conn_GetAuthPing(Client_Conn(Client))); | ||||
| 				LogDebug("Connection %d: sent AUTH PING %ld ...", | ||||
| 					Client_Conn(Client), | ||||
| @@ -278,6 +261,22 @@ IRC_NICK( CLIENT *Client, REQUEST *Req ) | ||||
| 				Client_SetType( Client, CLIENT_GOTNICK ); | ||||
| 		} else { | ||||
| 			/* Nickname change */ | ||||
|  | ||||
| 			/* Check that the user isn't on any channels set +N */ | ||||
| 			if(Client_Type(Client) == CLIENT_USER && | ||||
| 			   !Client_HasMode(Client, 'o')) { | ||||
| 				chan = Channel_First(); | ||||
| 				while (chan) { | ||||
| 					if(Channel_HasMode(chan, 'N') && | ||||
| 					   Channel_IsMemberOf(chan, Client)) | ||||
| 						return IRC_WriteErrClient(Client, | ||||
| 									  ERR_NONICKCHANGE_MSG, | ||||
| 									  Client_ID(Client), | ||||
| 									  Channel_Name(chan)); | ||||
| 					chan = Channel_Next(chan); | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 			Change_Nick(Client, target, Req->argv[0], | ||||
| 				    Client_Type(Client) == CLIENT_USER ? true : false); | ||||
| 			IRC_SetPenalty(target, 2); | ||||
| @@ -290,7 +289,7 @@ IRC_NICK( CLIENT *Client, REQUEST *Req ) | ||||
|  | ||||
| 		/* Bad number of parameters? */ | ||||
| 		if (Req->argc != 2 && Req->argc != 7) | ||||
| 			return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 			return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 						  Client_ID(Client), Req->command); | ||||
|  | ||||
| 		if (Req->argc >= 7) { | ||||
| @@ -319,28 +318,33 @@ IRC_NICK( CLIENT *Client, REQUEST *Req ) | ||||
| 			 * the new nick is already present on this server: | ||||
| 			 * the new and the old one have to be disconnected now. | ||||
| 			 */ | ||||
| 			Log( LOG_ERR, "Server %s introduces already registered nick \"%s\"!", Client_ID( Client ), Req->argv[0] ); | ||||
| 			Kill_Nick( Req->argv[0], "Nick collision" ); | ||||
| 			return CONNECTED; | ||||
| 			Log(LOG_ERR, | ||||
| 			    "Server %s introduces already registered nick \"%s\"!", | ||||
| 			    Client_ID(Client), Req->argv[0]); | ||||
| 			return IRC_KillClient(Client, NULL, Req->argv[0], | ||||
| 					      "Nick collision"); | ||||
| 		} | ||||
|  | ||||
| 		/* Find the Server this client is connected to */ | ||||
| 		intr_c = Client_GetFromToken(Client, token); | ||||
| 		if( ! intr_c ) | ||||
| 		{ | ||||
| 			Log( LOG_ERR, "Server %s introduces nick \"%s\" on unknown server!?", Client_ID( Client ), Req->argv[0] ); | ||||
| 			Kill_Nick( Req->argv[0], "Unknown server" ); | ||||
| 			return CONNECTED; | ||||
| 		if (!intr_c) { | ||||
| 			Log(LOG_ERR, | ||||
| 			    "Server %s introduces nick \"%s\" on unknown server!?", | ||||
| 			    Client_ID(Client), Req->argv[0]); | ||||
| 			return IRC_KillClient(Client, NULL, Req->argv[0], | ||||
| 					      "Unknown server"); | ||||
| 		} | ||||
|  | ||||
| 		c = Client_NewRemoteUser(intr_c, nick, hops, user, hostname, | ||||
| 					 token, modes, info, true); | ||||
| 		if( ! c ) | ||||
| 		{ | ||||
| 			/* out of memory, need to disconnect client to keep network state consistent */ | ||||
| 			Log( LOG_ALERT, "Can't create client structure! (on connection %d)", Client_Conn( Client )); | ||||
| 			Kill_Nick( Req->argv[0], "Server error" ); | ||||
| 			return CONNECTED; | ||||
| 		if (!c) { | ||||
| 			/* Out of memory, we need to disconnect client to keep | ||||
| 			 * network state consistent! */ | ||||
| 			Log(LOG_ALERT, | ||||
| 			    "Can't create client structure! (on connection %d)", | ||||
| 			    Client_Conn(Client)); | ||||
| 			return IRC_KillClient(Client, NULL, Req->argv[0], | ||||
| 					      "Server error"); | ||||
| 		} | ||||
|  | ||||
| 		/* RFC 2813: client is now fully registered, inform all the | ||||
| @@ -356,10 +360,11 @@ IRC_NICK( CLIENT *Client, REQUEST *Req ) | ||||
|  | ||||
| 		return CONNECTED; | ||||
| 	} | ||||
| 	else return IRC_WriteStrClient( Client, ERR_ALREADYREGISTRED_MSG, Client_ID( Client )); | ||||
| 	else | ||||
| 		return IRC_WriteErrClient(Client, ERR_ALREADYREGISTRED_MSG, | ||||
| 					  Client_ID(Client)); | ||||
| } /* IRC_NICK */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "SVSNICK" command. | ||||
|  * | ||||
| @@ -375,9 +380,7 @@ IRC_SVSNICK(CLIENT *Client, REQUEST *Req) | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	if (Req->argc != 2) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
| 	_IRC_REQUIRE_PREFIX_OR_RETURN_(Client, Req) | ||||
|  | ||||
| 	/* Search the originator */ | ||||
| 	from = Client_Search(Req->prefix); | ||||
| @@ -386,10 +389,9 @@ IRC_SVSNICK(CLIENT *Client, REQUEST *Req) | ||||
|  | ||||
| 	/* Search the target */ | ||||
| 	target = Client_Search(Req->argv[0]); | ||||
| 	if (!target || Client_Type(target) != CLIENT_USER) { | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 	if (!target || Client_Type(target) != CLIENT_USER) | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					  Client_ID(Client), Req->argv[0]); | ||||
| 	} | ||||
|  | ||||
| 	if (Client_Conn(target) <= NONE) { | ||||
| 		/* We have to forward the message to the server handling | ||||
| @@ -411,11 +413,9 @@ IRC_SVSNICK(CLIENT *Client, REQUEST *Req) | ||||
| /** | ||||
|  * Handler for the IRC "USER" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.1.3 "User message". | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @returns		CONNECTED or DISCONNECTED. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_USER(CLIENT * Client, REQUEST * Req) | ||||
| @@ -433,18 +433,14 @@ IRC_USER(CLIENT * Client, REQUEST * Req) | ||||
| 	    Client_Type(Client) == CLIENT_GOTPASS) | ||||
| 	{ | ||||
| 		/* New connection */ | ||||
| 		if (Req->argc != 4) | ||||
| 			return IRC_WriteStrClient(Client, | ||||
| 						  ERR_NEEDMOREPARAMS_MSG, | ||||
| 						  Client_ID(Client), | ||||
| 						  Req->command); | ||||
| 		_IRC_ARGC_EQ_OR_RETURN_(Client, Req, 4) | ||||
|  | ||||
| 		/* User name: only alphanumeric characters and limited | ||||
| 		   punctuation is allowed.*/ | ||||
| 		ptr = Req->argv[0]; | ||||
| 		while (*ptr) { | ||||
| 			if (!isalnum((int)*ptr) && | ||||
| 			    *ptr != '+' && *ptr != '-' && | ||||
| 			    *ptr != '+' && *ptr != '-' && *ptr != '@' && | ||||
| 			    *ptr != '.' && *ptr != '_') { | ||||
| 				Conn_Close(Client_Conn(Client), NULL, | ||||
| 					   "Invalid user name", true); | ||||
| @@ -453,6 +449,13 @@ IRC_USER(CLIENT * Client, REQUEST * Req) | ||||
| 			ptr++; | ||||
| 		} | ||||
|  | ||||
| 		/* Save the received username for authentication, and use | ||||
| 		 * it up to the first '@' as default user name (like ircd2.11, | ||||
| 		 * bahamut, ircd-seven, ...), prefixed with '~', if needed: */ | ||||
| 		Client_SetOrigUser(Client, Req->argv[0]); | ||||
| 		ptr = strchr(Req->argv[0], '@'); | ||||
| 		if (ptr) | ||||
| 			*ptr = '\0'; | ||||
| #ifdef IDENTAUTH | ||||
| 		ptr = Client_User(Client); | ||||
| 		if (!ptr || !*ptr || *ptr == '~') | ||||
| @@ -460,7 +463,6 @@ IRC_USER(CLIENT * Client, REQUEST * Req) | ||||
| #else | ||||
| 		Client_SetUser(Client, Req->argv[0], false); | ||||
| #endif | ||||
| 		Client_SetOrigUser(Client, Req->argv[0]); | ||||
|  | ||||
| 		/* "Real name" or user info text: Don't set it to the empty | ||||
| 		 * string, the original ircd can't deal with such "real names" | ||||
| @@ -481,14 +483,12 @@ IRC_USER(CLIENT * Client, REQUEST * Req) | ||||
| 	} else if (Client_Type(Client) == CLIENT_SERVER || | ||||
| 		   Client_Type(Client) == CLIENT_SERVICE) { | ||||
| 		/* Server/service updating an user */ | ||||
| 		if (Req->argc != 4) | ||||
| 			return IRC_WriteStrClient(Client, | ||||
| 						  ERR_NEEDMOREPARAMS_MSG, | ||||
| 						  Client_ID(Client), | ||||
| 						  Req->command); | ||||
| 		_IRC_ARGC_EQ_OR_RETURN_(Client, Req, 4) | ||||
| 		_IRC_REQUIRE_PREFIX_OR_RETURN_(Client, Req) | ||||
|  | ||||
| 		c = Client_Search(Req->prefix); | ||||
| 		if (!c) | ||||
| 			return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 			return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 						  Client_ID(Client), | ||||
| 						  Req->prefix); | ||||
|  | ||||
| @@ -508,29 +508,25 @@ IRC_USER(CLIENT * Client, REQUEST * Req) | ||||
| 		return CONNECTED; | ||||
| 	} else if (Client_Type(Client) == CLIENT_USER) { | ||||
| 		/* Already registered connection */ | ||||
| 		return IRC_WriteStrClient(Client, ERR_ALREADYREGISTRED_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_ALREADYREGISTRED_MSG, | ||||
| 					  Client_ID(Client)); | ||||
| 	} else { | ||||
| 		/* Unexpected/invalid connection state? */ | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOTREGISTERED_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOTREGISTERED_MSG, | ||||
| 					  Client_ID(Client)); | ||||
| 	} | ||||
| } /* IRC_USER */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "SERVICE" command. | ||||
|  * | ||||
|  * This function implements IRC Services registration using the SERVICE command | ||||
|  * defined in RFC 2812 3.1.6 and RFC 2813 4.1.4. | ||||
|  * | ||||
|  * At the moment ngIRCd doesn't support directly linked services, so this | ||||
|  * function returns ERR_ERRONEUSNICKNAME when the SERVICE command has not been | ||||
|  * received from a peer server. | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @returns		CONNECTED or DISCONNECTED.. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_SERVICE(CLIENT *Client, REQUEST *Req) | ||||
| @@ -544,22 +540,13 @@ IRC_SERVICE(CLIENT *Client, REQUEST *Req) | ||||
|  | ||||
| 	if (Client_Type(Client) != CLIENT_GOTPASS && | ||||
| 	    Client_Type(Client) != CLIENT_SERVER) | ||||
| 		return IRC_WriteStrClient(Client, ERR_ALREADYREGISTRED_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_ALREADYREGISTRED_MSG, | ||||
| 					  Client_ID(Client)); | ||||
|  | ||||
| 	if (Req->argc != 6) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	if (Client_Type(Client) != CLIENT_SERVER) | ||||
| 		return IRC_WriteStrClient(Client, ERR_ERRONEUSNICKNAME_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_ERRONEUSNICKNAME_MSG, | ||||
| 				  Client_ID(Client), Req->argv[0]); | ||||
|  | ||||
| 	/* Bad number of parameters? */ | ||||
| 	if (Req->argc != 6) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	nick = Req->argv[0]; | ||||
| 	user = NULL; host = NULL; | ||||
| 	token = atoi(Req->argv[1]); | ||||
| @@ -569,20 +556,20 @@ IRC_SERVICE(CLIENT *Client, REQUEST *Req) | ||||
| 	/* Validate service name ("nickname") */ | ||||
| 	c = Client_Search(nick); | ||||
| 	if(c) { | ||||
| 		/* Nickname collission: disconnect (KILL) both clients! */ | ||||
| 		Log(LOG_ERR, "Server %s introduces already registered service \"%s\"!", | ||||
| 		/* Nickname collision: disconnect (KILL) both clients! */ | ||||
| 		Log(LOG_ERR, | ||||
| 		    "Server %s introduces already registered service \"%s\"!", | ||||
| 		    Client_ID(Client), nick); | ||||
| 		Kill_Nick(nick, "Nick collision"); | ||||
| 		return CONNECTED; | ||||
| 		return IRC_KillClient(Client, NULL, nick, "Nick collision"); | ||||
| 	} | ||||
|  | ||||
| 	/* Get the server to which the service is connected */ | ||||
| 	intr_c = Client_GetFromToken(Client, token); | ||||
| 	if (! intr_c) { | ||||
| 		Log(LOG_ERR, "Server %s introduces service \"%s\" on unknown server!?", | ||||
| 		Log(LOG_ERR, | ||||
| 		    "Server %s introduces service \"%s\" on unknown server!?", | ||||
| 		    Client_ID(Client), nick); | ||||
| 		Kill_Nick(nick, "Unknown server"); | ||||
| 		return CONNECTED; | ||||
| 		return IRC_KillClient(Client, NULL, nick, "Unknown server"); | ||||
| 	} | ||||
|  | ||||
| 	/* Get user and host name */ | ||||
| @@ -611,37 +598,28 @@ IRC_SERVICE(CLIENT *Client, REQUEST *Req) | ||||
| 	if (! c) { | ||||
| 		/* Couldn't create client structure, so KILL the service to | ||||
| 		 * keep network status consistent ... */ | ||||
| 		Log(LOG_ALERT, "Can't create client structure! (on connection %d)", | ||||
| 		Log(LOG_ALERT, | ||||
| 		    "Can't create client structure! (on connection %d)", | ||||
| 		    Client_Conn(Client)); | ||||
| 		Kill_Nick(nick, "Server error"); | ||||
| 		return CONNECTED; | ||||
| 		return IRC_KillClient(Client, NULL, nick, "Server error"); | ||||
| 	} | ||||
|  | ||||
| 	Client_Introduce(Client, c, CLIENT_SERVICE); | ||||
| 	return CONNECTED; | ||||
| } /* IRC_SERVICE */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "WEBIRC" command. | ||||
|  * | ||||
|  * See doc/Protocol.txt, section II.4: | ||||
|  * "Update webchat/proxy client information". | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @returns		CONNECTED or DISCONNECTED. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_WEBIRC(CLIENT *Client, REQUEST *Req) | ||||
| { | ||||
| 	/* Exactly 4 parameters are requited */ | ||||
| 	if (Req->argc != 4) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	if (!Conf_WebircPwd[0] || strcmp(Req->argv[0], Conf_WebircPwd) != 0) | ||||
| 		return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_PASSWDMISMATCH_MSG, | ||||
| 					  Client_ID(Client)); | ||||
|  | ||||
| 	LogDebug("Connection %d: got valid WEBIRC command: user=%s, host=%s, ip=%s", | ||||
| @@ -649,39 +627,38 @@ IRC_WEBIRC(CLIENT *Client, REQUEST *Req) | ||||
|  | ||||
| 	Client_SetUser(Client, Req->argv[1], true); | ||||
| 	Client_SetOrigUser(Client, Req->argv[1]); | ||||
| 	Client_SetHostname(Client, Req->argv[2]); | ||||
| 	if (Conf_DNS) | ||||
| 		Client_SetHostname(Client, Req->argv[2]); | ||||
| 	else | ||||
| 		Client_SetHostname(Client, Req->argv[3]); | ||||
| 	Client_SetIPAText(Client, Req->argv[3]); | ||||
|  | ||||
| 	return CONNECTED; | ||||
| } /* IRC_WEBIRC */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "QUIT" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.1.7 "Quit", and RFC 2813, 4.1.5 "Quit". | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @returns		CONNECTED or DISCONNECTED. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_QUIT( CLIENT *Client, REQUEST *Req ) | ||||
| { | ||||
| 	CLIENT *target; | ||||
| 	char quitmsg[LINE_LEN]; | ||||
| 	char quitmsg[COMMAND_LEN]; | ||||
|  | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	/* Wrong number of arguments? */ | ||||
| 	if (Req->argc > 1) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	if (Req->argc == 1) | ||||
| 		strlcpy(quitmsg, Req->argv[0], sizeof quitmsg); | ||||
|  | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER) { | ||||
| 		/* Server */ | ||||
| 		_IRC_REQUIRE_PREFIX_OR_RETURN_(Client, Req) | ||||
|  | ||||
| 		target = Client_Search(Req->prefix); | ||||
| 		if (!target) { | ||||
| 			Log(LOG_WARNING, | ||||
| @@ -691,11 +668,11 @@ IRC_QUIT( CLIENT *Client, REQUEST *Req ) | ||||
| 		} | ||||
|  | ||||
| 		if (target != Client) { | ||||
| 			Client_Destroy(target, "Got QUIT command.", | ||||
| 			Client_Destroy(target, "Got QUIT command", | ||||
| 				       Req->argc == 1 ? quitmsg : NULL, true); | ||||
| 			return CONNECTED; | ||||
| 		} else { | ||||
| 			Conn_Close(Client_Conn(Client), "Got QUIT command.", | ||||
| 			Conn_Close(Client_Conn(Client), "Got QUIT command", | ||||
| 				   Req->argc == 1 ? quitmsg : NULL, true); | ||||
| 			return DISCONNECTED; | ||||
| 		} | ||||
| @@ -708,14 +685,13 @@ IRC_QUIT( CLIENT *Client, REQUEST *Req ) | ||||
| 		} | ||||
|  | ||||
| 		/* User, Service, or not yet registered */ | ||||
| 		Conn_Close(Client_Conn(Client), "Got QUIT command.", | ||||
| 		Conn_Close(Client_Conn(Client), "Got QUIT command", | ||||
| 			   Req->argc == 1 ? quitmsg : NULL, true); | ||||
|  | ||||
| 		return DISCONNECTED; | ||||
| 	} | ||||
| } /* IRC_QUIT */ | ||||
|  | ||||
|  | ||||
| #ifndef STRICT_RFC | ||||
|  | ||||
| /** | ||||
| @@ -724,9 +700,9 @@ IRC_QUIT( CLIENT *Client, REQUEST *Req ) | ||||
|  * We handle these commands here to avoid the quite long timeout when | ||||
|  * some user tries to access this IRC daemon using an web browser ... | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @returns		CONNECTED or DISCONNECTED. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_QUIT_HTTP( CLIENT *Client, REQUEST *Req ) | ||||
| @@ -738,15 +714,12 @@ IRC_QUIT_HTTP( CLIENT *Client, REQUEST *Req ) | ||||
|  | ||||
| #endif | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "PING" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.7.2 "Ping message". | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @returns		CONNECTED or DISCONNECTED. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_PING(CLIENT *Client, REQUEST *Req) | ||||
| @@ -757,13 +730,11 @@ IRC_PING(CLIENT *Client, REQUEST *Req) | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	if (Req->argc < 1) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOORIGIN_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOORIGIN_MSG, | ||||
| 					  Client_ID(Client)); | ||||
| #ifdef STRICT_RFC | ||||
| 	/* Don't ignore additional arguments when in "strict" mode */ | ||||
| 	if (Req->argc > 2) | ||||
| 		 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					   Client_ID(Client), Req->command); | ||||
| 	_IRC_ARGC_LE_OR_RETURN_(Client, Req, 2) | ||||
| #endif | ||||
|  | ||||
| 	if (Req->argc > 1) { | ||||
| @@ -771,17 +742,18 @@ IRC_PING(CLIENT *Client, REQUEST *Req) | ||||
| 		target = Client_Search(Req->argv[1]); | ||||
|  | ||||
| 		if (!target || Client_Type(target) != CLIENT_SERVER) | ||||
| 			return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG, | ||||
| 			return IRC_WriteErrClient(Client, ERR_NOSUCHSERVER_MSG, | ||||
| 					Client_ID(Client), Req->argv[1]); | ||||
|  | ||||
| 		if (target != Client_ThisServer()) { | ||||
| 			/* Ok, we have to forward the PING */ | ||||
| 			if (Client_Type(Client) == CLIENT_SERVER) | ||||
| 			if (Client_Type(Client) == CLIENT_SERVER) { | ||||
| 				_IRC_REQUIRE_PREFIX_OR_RETURN_(Client, Req) | ||||
| 				from = Client_Search(Req->prefix); | ||||
| 			else | ||||
| 			} else | ||||
| 				from = Client; | ||||
| 			if (!from) | ||||
| 				return IRC_WriteStrClient(Client, | ||||
| 				return IRC_WriteErrClient(Client, | ||||
| 						ERR_NOSUCHSERVER_MSG, | ||||
| 						Client_ID(Client), Req->prefix); | ||||
|  | ||||
| @@ -799,7 +771,7 @@ IRC_PING(CLIENT *Client, REQUEST *Req) | ||||
| 	} else | ||||
| 		from = Client_ThisServer(); | ||||
| 	if (!from) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOSUCHSERVER_MSG, | ||||
| 					Client_ID(Client), Req->prefix); | ||||
|  | ||||
| 	Log(LOG_DEBUG, "Connection %d: got PING, sending PONG ...", | ||||
| @@ -816,15 +788,12 @@ IRC_PING(CLIENT *Client, REQUEST *Req) | ||||
| #endif | ||||
| } /* IRC_PING */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "PONG" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.7.3 "Pong message". | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @returns		CONNECTED or DISCONNECTED. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_PONG(CLIENT *Client, REQUEST *Req) | ||||
| @@ -842,26 +811,22 @@ IRC_PONG(CLIENT *Client, REQUEST *Req) | ||||
| 	/* Wrong number of arguments? */ | ||||
| 	if (Req->argc < 1) { | ||||
| 		if (Client_Type(Client) == CLIENT_USER) | ||||
| 			return IRC_WriteStrClient(Client, ERR_NOORIGIN_MSG, | ||||
| 			return IRC_WriteErrClient(Client, ERR_NOORIGIN_MSG, | ||||
| 						  Client_ID(Client)); | ||||
| 		else | ||||
| 			return CONNECTED; | ||||
| 	} | ||||
| 	if (Req->argc > 2) { | ||||
| 		if (Client_Type(Client) == CLIENT_USER) | ||||
| 			return IRC_WriteStrClient(Client, | ||||
| 						  ERR_NEEDMOREPARAMS_MSG, | ||||
| 						  Client_ID(Client), | ||||
| 						  Req->command); | ||||
| 		else | ||||
| 			return CONNECTED; | ||||
| 	if (Client_Type(Client) == CLIENT_USER) { | ||||
| 		_IRC_ARGC_LE_OR_RETURN_(Client, Req, 2) | ||||
| 	} | ||||
|  | ||||
| 	/* Forward? */ | ||||
| 	if (Req->argc == 2 && Client_Type(Client) == CLIENT_SERVER) { | ||||
| 		_IRC_REQUIRE_PREFIX_OR_RETURN_(Client, Req) | ||||
|  | ||||
| 		target = Client_Search(Req->argv[0]); | ||||
| 		if (!target) | ||||
| 			return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG, | ||||
| 			return IRC_WriteErrClient(Client, ERR_NOSUCHSERVER_MSG, | ||||
| 					Client_ID(Client), Req->argv[0]); | ||||
|  | ||||
| 		from = Client_Search(Req->prefix); | ||||
| @@ -869,7 +834,7 @@ IRC_PONG(CLIENT *Client, REQUEST *Req) | ||||
| 		if (target != Client_ThisServer() && target != from) { | ||||
| 			/* Ok, we have to forward the message. */ | ||||
| 			if (!from) | ||||
| 				return IRC_WriteStrClient(Client, | ||||
| 				return IRC_WriteErrClient(Client, | ||||
| 						ERR_NOSUCHSERVER_MSG, | ||||
| 						Client_ID(Client), Req->prefix); | ||||
|  | ||||
| @@ -893,58 +858,33 @@ IRC_PONG(CLIENT *Client, REQUEST *Req) | ||||
| 	if (auth_ping) { | ||||
| 		LogDebug("AUTH PONG: waiting for token \"%ld\", got \"%s\" ...", | ||||
| 			 auth_ping, Req->argv[0]); | ||||
| 		if (auth_ping == atoi(Req->argv[0])) { | ||||
| 		if (auth_ping == atol(Req->argv[0])) { | ||||
| 			Conn_SetAuthPing(conn, 0); | ||||
| 			if (Client_Type(Client) == CLIENT_WAITAUTHPING) | ||||
| 				Login_User(Client); | ||||
| 		} else | ||||
| 			if (!IRC_WriteStrClient(Client, | ||||
| 					"To connect, type /QUOTE PONG %ld", | ||||
| 					auth_ping)) | ||||
| 					"NOTICE %s :To connect, type /QUOTE PONG %ld", | ||||
| 					Client_ID(Client), auth_ping)) | ||||
| 				return DISCONNECTED; | ||||
| 	} | ||||
| #endif | ||||
|  | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER && Conn_LastPing(conn) == 0) { | ||||
| 		Log(LOG_INFO, | ||||
| 		    "Synchronization with \"%s\" done (connection %d): %ld seconds [%ld users, %ld channels]", | ||||
| 		    Client_ID(Client), conn, time(NULL) - Conn_GetSignon(conn), | ||||
| 		    "Synchronization with \"%s\" done (connection %d): %ld second%s [%ld users, %ld channels].", | ||||
| 		    Client_ID(Client), conn, | ||||
| 		    (long)(time(NULL) - Conn_GetSignon(conn)), | ||||
| 		    time(NULL) - Conn_GetSignon(conn) == 1 ? "" : "s", | ||||
| 		    Client_UserCount(), Channel_CountVisible(NULL)); | ||||
| 		Conn_UpdatePing(conn); | ||||
| 	} else | ||||
| 		LogDebug("Connection %d: received PONG. Lag: %ld seconds.", | ||||
| 			 conn, time(NULL) - Conn_LastPing(conn)); | ||||
| 			 conn, (long)(time(NULL) - Conn_LastPing(conn))); | ||||
|  | ||||
| 	return CONNECTED; | ||||
| } /* IRC_PONG */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Kill all users with a specific nickname in the network. | ||||
|  * | ||||
|  * @param Nick		Nickname. | ||||
|  * @param Reason	Reason for the KILL. | ||||
|  */ | ||||
| static void | ||||
| Kill_Nick(char *Nick, char *Reason) | ||||
| { | ||||
| 	REQUEST r; | ||||
|  | ||||
| 	assert (Nick != NULL); | ||||
| 	assert (Reason != NULL); | ||||
|  | ||||
| 	r.prefix = NULL; | ||||
| 	r.argv[0] = Nick; | ||||
| 	r.argv[1] = Reason; | ||||
| 	r.argc = 2; | ||||
|  | ||||
| 	Log(LOG_ERR, "User(s) with nick \"%s\" will be disconnected: %s", | ||||
| 	    Nick, Reason); | ||||
|  | ||||
| 	IRC_KILL(Client_ThisServer(), &r); | ||||
| } /* Kill_Nick */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Change the nickname of a client. | ||||
|  * | ||||
| @@ -984,5 +924,4 @@ Change_Nick(CLIENT *Origin, CLIENT *Target, char *NewNick, bool InformClient) | ||||
| 	Client_SetID(Target, NewNick); | ||||
| } | ||||
|  | ||||
|  | ||||
| /* -eof- */ | ||||
|   | ||||
							
								
								
									
										125
									
								
								src/ngircd/irc-macros.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										125
									
								
								src/ngircd/irc-macros.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,125 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
|  * the Free Software Foundation; either version 2 of the License, or | ||||
|  * (at your option) any later version. | ||||
|  * Please read the file COPYING, README and AUTHORS for more information. | ||||
|  */ | ||||
|  | ||||
| #ifndef __irc_macros_h__ | ||||
| #define __irc_macros_h__ | ||||
|  | ||||
| /** | ||||
|  * @file | ||||
|  * Macros for functions that handle IRC commands. | ||||
|  */ | ||||
|  | ||||
| /** | ||||
|  * Make sure that number of passed parameters is equal to Count. | ||||
|  * | ||||
|  * If there are not exactly Count parameters, send an error to the client and | ||||
|  * return from the function. | ||||
|  */ | ||||
| #define _IRC_ARGC_EQ_OR_RETURN_(Client, Req, Count) \ | ||||
| if (Req->argc != Count) { \ | ||||
| 	return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \ | ||||
| 				  Client_ID(Client), Req->command); \ | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Make sure that number of passed parameters is less or equal than Max. | ||||
|  * | ||||
|  * If there are more than Max parameters, send an error to the client and | ||||
|  * return from the function. | ||||
|  */ | ||||
| #define _IRC_ARGC_LE_OR_RETURN_(Client, Req, Max) \ | ||||
| if (Req->argc > Max) { \ | ||||
| 	return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \ | ||||
| 				  Client_ID(Client), Req->command); \ | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Make sure that number of passed parameters is greater or equal than Min. | ||||
|  * | ||||
|  * If there aren't at least Min parameters, send an error to the client and | ||||
|  * return from the function. | ||||
|  */ | ||||
| #define _IRC_ARGC_GE_OR_RETURN_(Client, Req, Min) \ | ||||
| if (Req->argc < Min) { \ | ||||
| 	return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \ | ||||
| 				  Client_ID(Client), Req->command); \ | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Make sure that number of passed parameters is in between Min and Max. | ||||
|  * | ||||
|  * If there aren't at least Min parameters or if there are more than Max | ||||
|  * parameters, send an error to the client and return from the function. | ||||
|  */ | ||||
| #define _IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, Min, Max) \ | ||||
| if (Req->argc < Min || Req->argc > Max) { \ | ||||
| 	return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \ | ||||
| 				  Client_ID(Client), Req->command); \ | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Make sure that the command has a prefix. | ||||
|  * | ||||
|  * If there is no prefix, send an error to the client and return from | ||||
|  * the function. | ||||
|  */ | ||||
| #define _IRC_REQUIRE_PREFIX_OR_RETURN_(Client, Req) \ | ||||
| if (!Req->prefix) { \ | ||||
| 	return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \ | ||||
| 				  Client_ID(Client), Req->command); \ | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Get sender of an IRC command. | ||||
|  * | ||||
|  * The sender is either stored in the prefix if the command has been | ||||
|  * received from a server or set to the client. If the sender is invalid, | ||||
|  * send an error to the client and return from the function. | ||||
|  */ | ||||
| #define _IRC_GET_SENDER_OR_RETURN_(Sender, Req, Client) \ | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER) { \ | ||||
| 		if (!Req->prefix) \ | ||||
| 			return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, \ | ||||
| 						  Client_ID(Client), Req->command); \ | ||||
| 		Sender = Client_Search(Req->prefix); \ | ||||
| 	} else \ | ||||
| 		Sender = Client; \ | ||||
| 	if (!Sender) \ | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, \ | ||||
| 					  Client_ID(Client), \ | ||||
| 					  Req->prefix ? Req->prefix : "(none)"); | ||||
|  | ||||
| /** | ||||
|  * Get target of an IRC command and make sure that it is a server. | ||||
|  * | ||||
|  * Set the target to the local server if no target parameter is given in the | ||||
|  * received command, and send an error to the client and return from the | ||||
|  * function if the given target isn't resolvable to a server: the target | ||||
|  * parameter can be a server name, a nick name (then the target is set to | ||||
|  * the server to which this nick is connected), or a mask matching at least | ||||
|  * one server name in the network. | ||||
|  */ | ||||
| #define _IRC_GET_TARGET_SERVER_OR_RETURN_(Target, Req, Argc, From) \ | ||||
| 	if (Req->argc > Argc) { \ | ||||
| 		Target = Client_Search(Req->argv[Argc]); \ | ||||
| 		if (!Target) \ | ||||
| 			Target = Client_SearchServer(Req->argv[Argc]); \ | ||||
| 		if (!Target) \ | ||||
| 			return IRC_WriteErrClient(From, ERR_NOSUCHSERVER_MSG, \ | ||||
| 					  Client_ID(From), Req->argv[Argc]); \ | ||||
| 		if (Client_Type(Target) != CLIENT_SERVER) \ | ||||
| 			Target = Client_Introducer(Target); \ | ||||
| 	} else \ | ||||
| 		Target = Client_ThisServer(); | ||||
|  | ||||
| #endif	/* __irc_macros_h__ */ | ||||
|  | ||||
| /* -eof- */ | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -18,21 +18,18 @@ | ||||
|  * IRC metadata commands | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <string.h> | ||||
| #include <strings.h> | ||||
| #include <stdio.h> | ||||
|  | ||||
| #include "conn-func.h" | ||||
| #include "channel.h" | ||||
| #include "conn-encoding.h" | ||||
| #include "irc-macros.h" | ||||
| #include "irc-write.h" | ||||
| #include "log.h" | ||||
| #include "messages.h" | ||||
| #include "parse.h" | ||||
| #include "tool.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "irc-metadata.h" | ||||
|  | ||||
| /** | ||||
| @@ -51,26 +48,24 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req) | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	if (Req->argc != 3) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
| 	_IRC_REQUIRE_PREFIX_OR_RETURN_(Client, Req) | ||||
|  | ||||
| 	prefix = Client_Search(Req->prefix); | ||||
| 	if (!prefix) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					  Client_ID(Client), Req->prefix); | ||||
|  | ||||
| 	target = Client_Search(Req->argv[0]); | ||||
| 	if (!target) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					  Client_ID(Client), Req->argv[0]); | ||||
|  | ||||
| 	LogDebug("Got \"METADATA\" command from \"%s\" for client \"%s\": \"%s=%s\".", | ||||
| 		 Client_ID(prefix), Client_ID(target), | ||||
| 		 Req->argv[1], Req->argv[2]); | ||||
|  | ||||
| 	/* Mark client: it has receiveda a METADATA command */ | ||||
| 	if (!strchr(Client_Flags(target), 'M')) { | ||||
| 	/* Mark client: it has received a METADATA command */ | ||||
| 	if (!Client_HasFlag(target, 'M')) { | ||||
| 		snprintf(new_flags, sizeof new_flags, "%sM", | ||||
| 			 Client_Flags(target)); | ||||
| 		Client_SetFlags(target, new_flags); | ||||
| @@ -96,6 +91,10 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req) | ||||
| 		Client_SetInfo(target, Req->argv[2]); | ||||
| 	else if (*Req->argv[2] && strcasecmp(Req->argv[1], "user") == 0) | ||||
| 		Client_SetUser(target, Req->argv[2], true); | ||||
| 	else if (strcasecmp(Req->argv[1], "accountname") == 0) | ||||
| 		Client_SetAccountName(target, Req->argv[2]); | ||||
| 	else if (*Req->argv[2] && strcasecmp(Req->argv[1], "certfp") == 0) | ||||
| 		Conn_SetCertFp(Client_Conn(target), Req->argv[2]); | ||||
| 	else | ||||
| 		Log(LOG_WARNING, | ||||
| 		    "Ignored metadata update from \"%s\" for client \"%s\": \"%s=%s\" - unknown key!", | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,15 +16,14 @@ | ||||
|  * IRC commands for mode changes (like MODE, AWAY, etc.) | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "conn.h" | ||||
| #include "channel.h" | ||||
| #include "irc-macros.h" | ||||
| #include "irc-write.h" | ||||
| #include "lists.h" | ||||
| #include "log.h" | ||||
| @@ -32,10 +31,8 @@ | ||||
| #include "messages.h" | ||||
| #include "conf.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "irc-mode.h" | ||||
|  | ||||
|  | ||||
| static bool Client_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin, | ||||
| 				CLIENT *Target)); | ||||
| static bool Channel_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin, | ||||
| @@ -50,16 +47,15 @@ static bool Send_ListChange PARAMS((const bool IsAdd, const char ModeChar, | ||||
| 				    CLIENT *Prefix, CLIENT *Client, | ||||
| 				    CHANNEL *Channel, const char *Mask)); | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "MODE" command. | ||||
|  * | ||||
|  * See RFC 2812 section 3.1.5 ("user mode message") and section 3.2.3 | ||||
|  * ("channel mode message"), and RFC 2811 section 4 ("channel modes"). | ||||
|  * This function detects whether user or channel modes should be modified | ||||
|  * and calls the appropriate sub-functions. | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @returns		CONNECTED or DISCONNECTED. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_MODE( CLIENT *Client, REQUEST *Req ) | ||||
| @@ -70,20 +66,14 @@ IRC_MODE( CLIENT *Client, REQUEST *Req ) | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	/* No parameters? */ | ||||
| 	if (Req->argc < 1) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
| 	_IRC_GET_SENDER_OR_RETURN_(origin, Req, Client) | ||||
|  | ||||
| 	/* Origin for answers */ | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER) { | ||||
| 		origin = Client_Search(Req->prefix); | ||||
| 		if (!origin) | ||||
| 			return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 						  Client_ID(Client), | ||||
| 						  Req->prefix); | ||||
| 	} else | ||||
| 		origin = Client; | ||||
| 	/* Test for "fake" MODE commands injected by this local instance, | ||||
| 	 * for example when handling the "DefaultUserModes" settings. | ||||
| 	 * This doesn't harm real commands, because prefixes of regular | ||||
| 	 * clients are checked in Validate_Prefix() and can't be faked. */ | ||||
| 	if (Req->prefix && Client_Search(Req->prefix) == Client_ThisServer()) | ||||
| 		Client = Client_Search(Req->prefix); | ||||
|  | ||||
| 	/* Channel or user mode? */ | ||||
| 	cl = NULL; chan = NULL; | ||||
| @@ -98,11 +88,10 @@ IRC_MODE( CLIENT *Client, REQUEST *Req ) | ||||
| 		return Channel_Mode(Client, Req, origin, chan); | ||||
|  | ||||
| 	/* No target found! */ | ||||
| 	return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 	return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 			Client_ID(Client), Req->argv[0]); | ||||
| } /* IRC_MODE */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Check if the "mode limit" for a client has been reached. | ||||
|  * | ||||
| @@ -123,15 +112,14 @@ Mode_Limit_Reached(CLIENT *Client, int Count) | ||||
| 	return true; | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handle client mode requests | ||||
|  * | ||||
|  * @param Client	The client from which this command has been received. | ||||
|  * @param Req		Request structure with prefix and all parameters. | ||||
|  * @param Origin	The originator of the MODE command (prefix). | ||||
|  * @param Target	The target (client) of this MODE command. | ||||
|  * @returns		CONNECTED or DISCONNECTED. | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @param Origin The originator of the MODE command (prefix). | ||||
|  * @param Target The target (client) of this MODE command. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| static bool | ||||
| Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) | ||||
| @@ -146,7 +134,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) | ||||
| 	if (Client_Type(Client) == CLIENT_USER) { | ||||
| 		/* Users are only allowed to manipulate their own modes! */ | ||||
| 		if (Target != Client) | ||||
| 			return IRC_WriteStrClient(Client, | ||||
| 			return IRC_WriteErrClient(Client, | ||||
| 						  ERR_USERSDONTMATCH_MSG, | ||||
| 						  Client_ID(Client)); | ||||
| 	} | ||||
| @@ -168,7 +156,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) | ||||
| 		set = false; | ||||
| 		strcpy(the_modes, "-"); | ||||
| 	} else | ||||
| 		return IRC_WriteStrClient(Origin, ERR_UMODEUNKNOWNFLAG_MSG, | ||||
| 		return IRC_WriteErrClient(Origin, ERR_UMODEUNKNOWNFLAG_MSG, | ||||
| 					  Client_ID(Origin)); | ||||
|  | ||||
| 	x[1] = '\0'; | ||||
| @@ -218,6 +206,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) | ||||
| 		case 'b': /* Block private msgs */ | ||||
| 		case 'C': /* Only messages from clients sharing a channel */ | ||||
| 		case 'i': /* Invisible */ | ||||
| 		case 'I': /* Hide channel list from WHOIS */ | ||||
| 		case 's': /* Server messages */ | ||||
| 		case 'w': /* Wallops messages */ | ||||
| 			x[0] = *mode_ptr; | ||||
| @@ -227,43 +216,35 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) | ||||
| 				x[0] = 'a'; | ||||
| 				Client_SetAway(Origin, DEFAULT_AWAY_MSG); | ||||
| 			} else | ||||
| 				ok = IRC_WriteStrClient(Origin, | ||||
| 				ok = IRC_WriteErrClient(Origin, | ||||
| 							ERR_NOPRIVILEGES_MSG, | ||||
| 							Client_ID(Origin)); | ||||
| 			break; | ||||
| 		case 'B': /* Bot */ | ||||
| 			if (Client_HasMode(Client, 'r')) | ||||
| 				ok = IRC_WriteStrClient(Origin, | ||||
| 				ok = IRC_WriteErrClient(Origin, | ||||
| 							ERR_RESTRICTED_MSG, | ||||
| 							Client_ID(Origin)); | ||||
| 			else | ||||
| 				x[0] = 'B'; | ||||
| 			break; | ||||
| 		case 'c': /* Receive connect notices | ||||
| 			   * (only settable by IRC operators!) */ | ||||
| 		case 'c': /* Receive connect notices */ | ||||
| 		case 'q': /* KICK-protected user */ | ||||
| 		case 'F': /* disable flood protection */ | ||||
| 			  /* (only settable by IRC operators!) */ | ||||
| 			if (!set || Client_Type(Client) == CLIENT_SERVER | ||||
| 			    || Client_OperByMe(Origin)) | ||||
| 				x[0] = 'c'; | ||||
| 			    || Client_HasMode(Origin, 'o')) | ||||
| 				x[0] = *mode_ptr; | ||||
| 			else | ||||
| 				ok = IRC_WriteStrClient(Origin, | ||||
| 				ok = IRC_WriteErrClient(Origin, | ||||
| 							ERR_NOPRIVILEGES_MSG, | ||||
| 							Client_ID(Origin)); | ||||
| 			break; | ||||
| 		case 'o': /* IRC operator (only unsettable!) */ | ||||
| 			if (!set || Client_Type(Client) == CLIENT_SERVER) { | ||||
| 				Client_SetOperByMe(Target, false); | ||||
| 				x[0] = 'o'; | ||||
| 			} else | ||||
| 				ok = IRC_WriteStrClient(Origin, | ||||
| 							ERR_NOPRIVILEGES_MSG, | ||||
| 							Client_ID(Origin)); | ||||
| 			break; | ||||
| 		case 'q': /* KICK-protected user */ | ||||
| 			if (!set || Client_Type(Client) == CLIENT_SERVER | ||||
| 			    || Client_OperByMe(Origin)) | ||||
| 				x[0] = 'q'; | ||||
| 			else | ||||
| 				ok = IRC_WriteStrClient(Origin, | ||||
| 				ok = IRC_WriteErrClient(Origin, | ||||
| 							ERR_NOPRIVILEGES_MSG, | ||||
| 							Client_ID(Origin)); | ||||
| 			break; | ||||
| @@ -271,7 +252,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) | ||||
| 			if (set || Client_Type(Client) == CLIENT_SERVER) | ||||
| 				x[0] = 'r'; | ||||
| 			else | ||||
| 				ok = IRC_WriteStrClient(Origin, | ||||
| 				ok = IRC_WriteErrClient(Origin, | ||||
| 							ERR_RESTRICTED_MSG, | ||||
| 							Client_ID(Origin)); | ||||
| 			break; | ||||
| @@ -279,22 +260,22 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) | ||||
| 			if (Client_Type(Client) == CLIENT_SERVER) | ||||
| 				x[0] = 'R'; | ||||
| 			else | ||||
| 				ok = IRC_WriteStrClient(Origin, | ||||
| 				ok = IRC_WriteErrClient(Origin, | ||||
| 							ERR_NICKREGISTER_MSG, | ||||
| 							Client_ID(Origin)); | ||||
| 			break; | ||||
| 		case 'x': /* Cloak hostname */ | ||||
| 			if (Client_HasMode(Client, 'r')) | ||||
| 				ok = IRC_WriteStrClient(Origin, | ||||
| 				ok = IRC_WriteErrClient(Origin, | ||||
| 							ERR_RESTRICTED_MSG, | ||||
| 							Client_ID(Origin)); | ||||
| 			else if (!set || Conf_CloakHostModeX[0] | ||||
| 				 || Client_Type(Client) == CLIENT_SERVER | ||||
| 				 || Client_OperByMe(Client)) { | ||||
| 				 || Client_HasMode(Origin, 'o')) { | ||||
| 				x[0] = 'x'; | ||||
| 				send_RPL_HOSTHIDDEN_MSG = true; | ||||
| 			} else | ||||
| 				ok = IRC_WriteStrClient(Origin, | ||||
| 				ok = IRC_WriteErrClient(Origin, | ||||
| 							ERR_NOPRIVILEGES_MSG, | ||||
| 							Client_ID(Origin)); | ||||
| 			break; | ||||
| @@ -304,7 +285,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) | ||||
| 				    "Unknown mode \"%c%c\" from \"%s\"!?", | ||||
| 				    set ? '+' : '-', *mode_ptr, | ||||
| 				    Client_ID(Origin)); | ||||
| 				ok = IRC_WriteStrClient(Origin, | ||||
| 				ok = IRC_WriteErrClient(Origin, | ||||
| 							ERR_UMODEUNKNOWNFLAG2_MSG, | ||||
| 							Client_ID(Origin), | ||||
| 							set ? '+' : '-', | ||||
| @@ -369,7 +350,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) | ||||
| 		} | ||||
|  | ||||
| 		if (send_RPL_HOSTHIDDEN_MSG && Client_Conn(Target) > NONE) { | ||||
| 			/* A new (cloaked) hostname must be annoucned */ | ||||
| 			/* A new (cloaked) hostname must be announced */ | ||||
| 			IRC_WriteStrClientPrefix(Target, Origin, | ||||
| 						 RPL_HOSTHIDDEN_MSG, | ||||
| 						 Client_ID(Target), | ||||
| @@ -382,48 +363,60 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) | ||||
| 			 Client_Modes(Target)); | ||||
| 	} | ||||
|  | ||||
| 	IRC_SetPenalty(Client, 1); | ||||
| 	return ok; | ||||
| } /* Client_Mode */ | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Reply to a channel mode request. | ||||
|  * | ||||
|  * @param Origin The originator of the MODE command (prefix). | ||||
|  * @param Channel The channel of which the modes should be sent. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| static bool | ||||
| Channel_Mode_Answer_Request(CLIENT *Origin, CHANNEL *Channel) | ||||
| { | ||||
| 	char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], argadd[CLIENT_PASS_LEN]; | ||||
| 	const char *mode_ptr; | ||||
|  | ||||
| 	/* Member or not? -- That's the question! */ | ||||
| 	if (!Channel_IsMemberOf(Channel, Origin)) | ||||
| 		return IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG, | ||||
| 			Client_ID(Origin), Channel_Name(Channel), Channel_Modes(Channel)); | ||||
| 	if (!Channel_IsMemberOf(Channel, Origin)) { | ||||
| 		/* Not a member: "simple" mode reply */ | ||||
| 		if (!IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG, | ||||
| 					Client_ID(Origin), Channel_Name(Channel), | ||||
| 					Channel_Modes(Channel))) | ||||
| 			return DISCONNECTED; | ||||
| 	} else { | ||||
| 		/* The sender is a member: generate extended reply */ | ||||
| 		strlcpy(the_modes, Channel_Modes(Channel), sizeof(the_modes)); | ||||
| 		mode_ptr = the_modes; | ||||
| 		the_args[0] = '\0'; | ||||
|  | ||||
| 	/* The sender is a member: generate extended reply */ | ||||
| 	strlcpy(the_modes, Channel_Modes(Channel), sizeof(the_modes)); | ||||
| 	mode_ptr = the_modes; | ||||
| 	the_args[0] = '\0'; | ||||
|  | ||||
| 	while(*mode_ptr) { | ||||
| 		switch(*mode_ptr) { | ||||
| 		case 'l': | ||||
| 			snprintf(argadd, sizeof(argadd), " %lu", Channel_MaxUsers(Channel)); | ||||
| 			strlcat(the_args, argadd, sizeof(the_args)); | ||||
| 			break; | ||||
| 		case 'k': | ||||
| 			strlcat(the_args, " ", sizeof(the_args)); | ||||
| 			strlcat(the_args, Channel_Key(Channel), sizeof(the_args)); | ||||
| 			break; | ||||
| 		while(*mode_ptr) { | ||||
| 			switch(*mode_ptr) { | ||||
| 			case 'l': | ||||
| 				snprintf(argadd, sizeof(argadd), " %lu", | ||||
| 					 Channel_MaxUsers(Channel)); | ||||
| 				strlcat(the_args, argadd, sizeof(the_args)); | ||||
| 				break; | ||||
| 			case 'k': | ||||
| 				strlcat(the_args, " ", sizeof(the_args)); | ||||
| 				strlcat(the_args, Channel_Key(Channel), | ||||
| 					sizeof(the_args)); | ||||
| 				break; | ||||
| 			} | ||||
| 			mode_ptr++; | ||||
| 		} | ||||
| 		mode_ptr++; | ||||
| 	} | ||||
| 	if (the_args[0]) | ||||
| 		strlcat(the_modes, the_args, sizeof(the_modes)); | ||||
| 		if (the_args[0]) | ||||
| 			strlcat(the_modes, the_args, sizeof(the_modes)); | ||||
|  | ||||
| 		if (!IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG, | ||||
| 					Client_ID(Origin), Channel_Name(Channel), | ||||
| 					the_modes)) | ||||
| 			return DISCONNECTED; | ||||
| 	} | ||||
|  | ||||
| 	if (!IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG, | ||||
| 				Client_ID(Origin), Channel_Name(Channel), | ||||
| 				the_modes)) | ||||
| 		return DISCONNECTED; | ||||
| #ifndef STRICT_RFC | ||||
| 	/* Channel creation time */ | ||||
| 	if (!IRC_WriteStrClient(Origin, RPL_CREATIONTIME_MSG, | ||||
| 				  Client_ID(Origin), Channel_Name(Channel), | ||||
| 				  Channel_CreationTime(Channel))) | ||||
| @@ -432,15 +425,20 @@ Channel_Mode_Answer_Request(CLIENT *Origin, CHANNEL *Channel) | ||||
| 	return CONNECTED; | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handle channel mode and channel-user mode changes | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @param Origin The originator of the MODE command (prefix). | ||||
|  * @param Channel The target channel of this MODE command. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| static bool | ||||
| Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| { | ||||
| 	char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], x[2], | ||||
| 	    argadd[CLIENT_PASS_LEN], *mode_ptr, *o_mode_ptr; | ||||
| 	    argadd[CLIENT_PASS_LEN], *mode_ptr; | ||||
| 	bool connected, set, skiponce, retval, use_servermode, | ||||
| 	     is_halfop, is_op, is_admin, is_owner, is_machine, is_oper; | ||||
| 	int mode_arg, arg_arg, mode_arg_count = 0; | ||||
| @@ -451,7 +449,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 	is_halfop = is_op = is_admin = is_owner = is_machine = is_oper = false; | ||||
|  | ||||
| 	if (Channel_IsModeless(Channel)) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOCHANMODES_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOCHANMODES_MSG, | ||||
| 				Client_ID(Client), Channel_Name(Channel)); | ||||
|  | ||||
| 	/* Mode request: let's answer it :-) */ | ||||
| @@ -460,7 +458,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
|  | ||||
| 	/* Check if origin is oper and opers can use mode */ | ||||
| 	use_servermode = Conf_OperServerMode; | ||||
| 	if(Client_OperByMe(Client) && Conf_OperCanMode) { | ||||
| 	if(Client_HasMode(Client, 'o') && Conf_OperCanMode) { | ||||
| 		is_oper = true; | ||||
| 	} | ||||
|  | ||||
| @@ -472,7 +470,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
|  | ||||
| 	/* Check if client is member of channel or an oper or an server/service */ | ||||
| 	if(!Channel_IsMemberOf(Channel, Client) && !is_oper && !is_machine) | ||||
| 		return IRC_WriteStrClient(Origin, ERR_NOTONCHANNEL_MSG, | ||||
| 		return IRC_WriteErrClient(Origin, ERR_NOTONCHANNEL_MSG, | ||||
| 					  Client_ID(Origin), | ||||
| 					  Channel_Name(Channel)); | ||||
|  | ||||
| @@ -550,19 +548,15 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 		if (arg_arg >= Req->argc) | ||||
| 			arg_arg = -1; | ||||
|  | ||||
| 		if(!is_machine) { | ||||
| 			o_mode_ptr = Channel_UserModes(Channel, Client); | ||||
| 			while( *o_mode_ptr ) { | ||||
| 				if ( *o_mode_ptr == 'q') | ||||
| 					is_owner = true; | ||||
| 				if ( *o_mode_ptr == 'a') | ||||
| 					is_admin = true; | ||||
| 				if ( *o_mode_ptr == 'o') | ||||
| 					is_op = true; | ||||
| 				if ( *o_mode_ptr == 'h') | ||||
| 					is_halfop = true; | ||||
| 				o_mode_ptr++; | ||||
| 			} | ||||
| 		if(!is_machine && !is_oper) { | ||||
| 			if (Channel_UserHasMode(Channel, Client, 'q')) | ||||
| 				is_owner = true; | ||||
| 			if (Channel_UserHasMode(Channel, Client, 'a')) | ||||
| 				is_admin = true; | ||||
| 			if (Channel_UserHasMode(Channel, Client, 'o')) | ||||
| 				is_op = true; | ||||
| 			if (Channel_UserHasMode(Channel, Client, 'h')) | ||||
| 				is_halfop = true; | ||||
| 		} | ||||
|  | ||||
| 		/* Validate modes */ | ||||
| @@ -576,7 +570,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 		case 'z': /* Secure connections only */ | ||||
| 			if(!is_oper && !is_machine && !is_owner && | ||||
| 			   !is_admin && !is_op) { | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 					Client_ID(Origin), Channel_Name(Channel)); | ||||
| 				goto chan_exit; | ||||
| @@ -586,13 +580,14 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 		case 'M': /* Only identified nicks can write */ | ||||
| 		case 'm': /* Moderated */ | ||||
| 		case 'n': /* Only members can write */ | ||||
| 		case 'N': /* Can't change nick while on this channel */ | ||||
| 		case 'Q': /* No kicks */ | ||||
| 		case 't': /* Topic locked */ | ||||
| 			if(is_oper || is_machine || is_owner || | ||||
| 			   is_admin || is_op || is_halfop) | ||||
| 				x[0] = *mode_ptr; | ||||
| 			else | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 					Client_ID(Origin), Channel_Name(Channel)); | ||||
| 			break; | ||||
| @@ -601,10 +596,14 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 				goto chan_exit; | ||||
| 			if (!set) { | ||||
| 				if (is_oper || is_machine || is_owner || | ||||
| 				    is_admin || is_op || is_halfop) | ||||
| 				    is_admin || is_op || is_halfop) { | ||||
| 					x[0] = *mode_ptr; | ||||
| 				else | ||||
| 					connected = IRC_WriteStrClient(Origin, | ||||
| 					if (Channel_HasMode(Channel, 'k')) | ||||
| 						strlcpy(argadd, "*", sizeof(argadd)); | ||||
| 					if (arg_arg > mode_arg) | ||||
| 						arg_arg++; | ||||
| 				} else | ||||
| 					connected = IRC_WriteErrClient(Origin, | ||||
| 						ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 						Client_ID(Origin), | ||||
| 						Channel_Name(Channel)); | ||||
| @@ -620,7 +619,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 						sizeof(argadd)); | ||||
| 					x[0] = *mode_ptr; | ||||
| 				} else { | ||||
| 					connected = IRC_WriteStrClient(Origin, | ||||
| 					connected = IRC_WriteErrClient(Origin, | ||||
| 						ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 						Client_ID(Origin), | ||||
| 						Channel_Name(Channel)); | ||||
| @@ -628,9 +627,13 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 				Req->argv[arg_arg][0] = '\0'; | ||||
| 				arg_arg++; | ||||
| 			} else { | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| #ifdef STRICT_RFC | ||||
| 				/* Only send error message in "strict" mode, | ||||
| 				 * this is how ircd2.11 and others behave ... */ | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_NEEDMOREPARAMS_MSG, | ||||
| 					Client_ID(Origin), Req->command); | ||||
| #endif | ||||
| 				goto chan_exit; | ||||
| 			} | ||||
| 			break; | ||||
| @@ -642,7 +645,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 				    is_admin || is_op || is_halfop) | ||||
| 					x[0] = *mode_ptr; | ||||
| 				else | ||||
| 					connected = IRC_WriteStrClient(Origin, | ||||
| 					connected = IRC_WriteErrClient(Origin, | ||||
| 						ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 						Client_ID(Origin), | ||||
| 						Channel_Name(Channel)); | ||||
| @@ -660,7 +663,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 						x[0] = *mode_ptr; | ||||
| 					} | ||||
| 				} else { | ||||
| 					connected = IRC_WriteStrClient(Origin, | ||||
| 					connected = IRC_WriteErrClient(Origin, | ||||
| 						ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 						Client_ID(Origin), | ||||
| 						Channel_Name(Channel)); | ||||
| @@ -668,9 +671,13 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 				Req->argv[arg_arg][0] = '\0'; | ||||
| 				arg_arg++; | ||||
| 			} else { | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| #ifdef STRICT_RFC | ||||
| 				/* Only send error message in "strict" mode, | ||||
| 				 * this is how ircd2.11 and others behave ... */ | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_NEEDMOREPARAMS_MSG, | ||||
| 					Client_ID(Origin), Req->command); | ||||
| #endif | ||||
| 				goto chan_exit; | ||||
| 			} | ||||
| 			break; | ||||
| @@ -681,14 +688,14 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 				if(is_oper || is_machine) | ||||
| 					x[0] = 'O'; | ||||
| 				else | ||||
| 					connected = IRC_WriteStrClient(Origin, | ||||
| 					connected = IRC_WriteErrClient(Origin, | ||||
| 						ERR_NOPRIVILEGES_MSG, | ||||
| 						Client_ID(Origin)); | ||||
| 			} else if(is_oper || is_machine || is_owner || | ||||
| 				  is_admin || is_op) | ||||
| 				x[0] = 'O'; | ||||
| 			else | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 					Client_ID(Origin), | ||||
| 					Channel_Name(Channel)); | ||||
| @@ -700,14 +707,14 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 				if(is_oper || is_machine) | ||||
| 					x[0] = 'P'; | ||||
| 				else | ||||
| 					connected = IRC_WriteStrClient(Origin, | ||||
| 					connected = IRC_WriteErrClient(Origin, | ||||
| 						ERR_NOPRIVILEGES_MSG, | ||||
| 						Client_ID(Origin)); | ||||
| 			} else if(is_oper || is_machine || is_owner || | ||||
| 				  is_admin || is_op) | ||||
| 				x[0] = 'P'; | ||||
| 			else | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 					Client_ID(Origin), | ||||
| 					Channel_Name(Channel)); | ||||
| @@ -716,7 +723,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 		case 'q': /* Owner */ | ||||
| 		case 'a': /* Channel admin */ | ||||
| 			if(!is_oper && !is_machine && !is_owner && !is_admin) { | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_CHANOPPRIVTOOLOW_MSG, | ||||
| 					Client_ID(Origin), | ||||
| 					Channel_Name(Channel)); | ||||
| @@ -725,7 +732,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 		case 'o': /* Channel operator */ | ||||
| 			if(!is_oper && !is_machine && !is_owner && | ||||
| 			   !is_admin && !is_op) { | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 					Client_ID(Origin), | ||||
| 					Channel_Name(Channel)); | ||||
| @@ -734,7 +741,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 		case 'h': /* Half Op */ | ||||
| 			if(!is_oper && !is_machine && !is_owner && | ||||
| 			   !is_admin && !is_op) { | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 					Client_ID(Origin), | ||||
| 					Channel_Name(Channel)); | ||||
| @@ -748,12 +755,12 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 					if (client) | ||||
| 						x[0] = *mode_ptr; | ||||
| 					else | ||||
| 						connected = IRC_WriteStrClient(Origin, | ||||
| 						connected = IRC_WriteErrClient(Origin, | ||||
| 							ERR_NOSUCHNICK_MSG, | ||||
| 							Client_ID(Origin), | ||||
| 							Req->argv[arg_arg]); | ||||
| 				} else { | ||||
| 					connected = IRC_WriteStrClient(Origin, | ||||
| 					connected = IRC_WriteErrClient(Origin, | ||||
| 						ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 						Client_ID(Origin), | ||||
| 						Channel_Name(Channel)); | ||||
| @@ -761,9 +768,17 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 				Req->argv[arg_arg][0] = '\0'; | ||||
| 				arg_arg++; | ||||
| 			} else { | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| #ifdef STRICT_RFC | ||||
| 				/* Report an error to the client, when a user | ||||
| 				 * mode should be changed but no nickname is | ||||
| 				 * given. But don't do it when not in "strict" | ||||
| 				 * mode, because most other servers don't do | ||||
| 				 * it as well and some clients send "wired" | ||||
| 				 * MODE commands like "MODE #chan -ooo nick". */ | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_NEEDMOREPARAMS_MSG, | ||||
| 					Client_ID(Origin), Req->command); | ||||
| #endif | ||||
| 				goto chan_exit; | ||||
| 			} | ||||
| 			break; | ||||
| @@ -785,7 +800,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 						Client, Channel, | ||||
| 						Req->argv[arg_arg]); | ||||
| 				} else { | ||||
| 					connected = IRC_WriteStrClient(Origin, | ||||
| 					connected = IRC_WriteErrClient(Origin, | ||||
| 						ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 						Client_ID(Origin), | ||||
| 						Channel_Name(Channel)); | ||||
| @@ -812,7 +827,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 				    "Unknown mode \"%c%c\" from \"%s\" on %s!?", | ||||
| 				    set ? '+' : '-', *mode_ptr, | ||||
| 				    Client_ID(Origin), Channel_Name(Channel)); | ||||
| 				connected = IRC_WriteStrClient(Origin, | ||||
| 				connected = IRC_WriteErrClient(Origin, | ||||
| 					ERR_UNKNOWNMODE_MSG, | ||||
| 					Client_ID(Origin), *mode_ptr, | ||||
| 					Channel_Name(Channel)); | ||||
| @@ -835,12 +850,11 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
|  | ||||
| 		/* Validate target client */ | ||||
| 		if (client && (!Channel_IsMemberOf(Channel, client))) { | ||||
| 			if (!IRC_WriteStrClient | ||||
| 			    (Origin, ERR_USERNOTINCHANNEL_MSG, | ||||
| 			     Client_ID(Origin), Client_ID(client), | ||||
| 			     Channel_Name(Channel))) | ||||
| 			if (!IRC_WriteErrClient(Origin, ERR_USERNOTINCHANNEL_MSG, | ||||
| 						Client_ID(Origin), | ||||
| 						Client_ID(client), | ||||
| 						Channel_Name(Channel))) | ||||
| 				break; | ||||
|  | ||||
| 			continue; | ||||
| 		} | ||||
|  | ||||
| @@ -921,35 +935,38 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	IRC_SetPenalty(Client, 1); | ||||
| 	return connected; | ||||
| } /* Channel_Mode */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "AWAY" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_AWAY( CLIENT *Client, REQUEST *Req ) | ||||
| { | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( Req != NULL ); | ||||
| 	assert (Client != NULL); | ||||
| 	assert (Req != NULL); | ||||
|  | ||||
| 	if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); | ||||
|  | ||||
| 	if(( Req->argc == 1 ) && (Req->argv[0][0] )) | ||||
| 	{ | ||||
| 		Client_SetAway( Client, Req->argv[0] ); | ||||
| 		Client_ModeAdd( Client, 'a' ); | ||||
| 		IRC_WriteStrServersPrefix( Client, Client, "MODE %s :+a", Client_ID( Client )); | ||||
| 		return IRC_WriteStrClient( Client, RPL_NOWAWAY_MSG, Client_ID( Client )); | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
| 		Client_ModeDel( Client, 'a' ); | ||||
| 		IRC_WriteStrServersPrefix( Client, Client, "MODE %s :-a", Client_ID( Client )); | ||||
| 		return IRC_WriteStrClient( Client, RPL_UNAWAY_MSG, Client_ID( Client )); | ||||
| 	if (Req->argc == 1 && Req->argv[0][0]) { | ||||
| 		Client_SetAway(Client, Req->argv[0]); | ||||
| 		Client_ModeAdd(Client, 'a'); | ||||
| 		IRC_WriteStrServersPrefix(Client, Client, "MODE %s :+a", | ||||
| 					  Client_ID( Client)); | ||||
| 		return IRC_WriteStrClient(Client, RPL_NOWAWAY_MSG, | ||||
| 					  Client_ID( Client)); | ||||
| 	} else { | ||||
| 		Client_ModeDel(Client, 'a'); | ||||
| 		IRC_WriteStrServersPrefix(Client, Client, "MODE %s :-a", | ||||
| 					  Client_ID( Client)); | ||||
| 		return IRC_WriteStrClient(Client, RPL_UNAWAY_MSG, | ||||
| 					  Client_ID( Client)); | ||||
| 	} | ||||
| } /* IRC_AWAY */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Add entries to channel invite, ban and exception lists. | ||||
|  * | ||||
| @@ -964,7 +981,7 @@ static bool | ||||
| Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, | ||||
| 	    const char *Pattern) | ||||
| { | ||||
| 	const char *mask; | ||||
| 	char mask[MASK_LEN]; | ||||
| 	struct list_head *list = NULL; | ||||
| 	long int current_count; | ||||
|  | ||||
| @@ -973,7 +990,7 @@ Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, | ||||
| 	assert(Pattern != NULL); | ||||
| 	assert(what == 'I' || what == 'b' || what == 'e'); | ||||
|  | ||||
| 	mask = Lists_MakeMask(Pattern); | ||||
| 	Lists_MakeMask(Pattern, mask, sizeof(mask)); | ||||
| 	current_count = Lists_Count(Channel_GetListInvites(Channel)) | ||||
| 			+ Lists_Count(Channel_GetListExcepts(Channel)) | ||||
| 			+ Lists_Count(Channel_GetListBans(Channel)); | ||||
| @@ -994,31 +1011,30 @@ Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, | ||||
| 		return CONNECTED; | ||||
| 	if (Client_Type(Client) == CLIENT_USER && | ||||
| 	    current_count >= MAX_HNDL_CHANNEL_LISTS) | ||||
| 		return IRC_WriteStrClient(Client, ERR_LISTFULL_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_LISTFULL_MSG, | ||||
| 					  Client_ID(Client), | ||||
| 					  Channel_Name(Channel), mask, | ||||
| 					  MAX_HNDL_CHANNEL_LISTS); | ||||
|  | ||||
| 	switch (what) { | ||||
| 		case 'I': | ||||
| 			if (!Channel_AddInvite(Channel, mask, false)) | ||||
| 			if (!Channel_AddInvite(Channel, mask, false, Client_ID(Client))) | ||||
| 				return CONNECTED; | ||||
| 			break; | ||||
| 		case 'b': | ||||
| 			if (!Channel_AddBan(Channel, mask)) | ||||
| 			if (!Channel_AddBan(Channel, mask, Client_ID(Client))) | ||||
| 				return CONNECTED; | ||||
| 			break; | ||||
| 		case 'e': | ||||
| 			if (!Channel_AddExcept(Channel, mask)) | ||||
| 			if (!Channel_AddExcept(Channel, mask, Client_ID(Client))) | ||||
| 				return CONNECTED; | ||||
| 			break; | ||||
| 	} | ||||
| 	return Send_ListChange(true, what, Prefix, Client, Channel, mask); | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Delete entries from channel invite, ban and exeption lists. | ||||
|  * Delete entries from channel invite, ban and exception lists. | ||||
|  * | ||||
|  * @param what Can be 'I' for invite, 'b' for ban, and 'e' for exception list. | ||||
|  * @param Prefix The originator of the command. | ||||
| @@ -1031,7 +1047,7 @@ static bool | ||||
| Del_From_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, | ||||
| 	      const char *Pattern) | ||||
| { | ||||
| 	const char *mask; | ||||
| 	char mask[MASK_LEN]; | ||||
| 	struct list_head *list = NULL; | ||||
|  | ||||
| 	assert(Client != NULL); | ||||
| @@ -1039,7 +1055,7 @@ Del_From_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, | ||||
| 	assert(Pattern != NULL); | ||||
| 	assert(what == 'I' || what == 'b' || what == 'e'); | ||||
|  | ||||
| 	mask = Lists_MakeMask(Pattern); | ||||
| 	Lists_MakeMask(Pattern, mask, sizeof(mask)); | ||||
|  | ||||
| 	switch (what) { | ||||
| 		case 'I': | ||||
| @@ -1060,7 +1076,6 @@ Del_From_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, | ||||
| 	return Send_ListChange(false, what, Prefix, Client, Channel, mask); | ||||
| } | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Send information about changed channel invite/ban/exception lists to clients. | ||||
|  * | ||||
| @@ -1098,5 +1113,4 @@ Send_ListChange(const bool IsAdd, const char ModeChar, CLIENT *Prefix, | ||||
| 	return ok; | ||||
| } /* Send_ListChange */ | ||||
|  | ||||
|  | ||||
| /* -eof- */ | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2005 by Alexander Barton (alex@barton.de) | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,23 +16,21 @@ | ||||
|  * Channel operator commands | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <string.h> | ||||
| #include <stdio.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "conn.h" | ||||
| #include "channel.h" | ||||
| #include "irc-macros.h" | ||||
| #include "irc-write.h" | ||||
| #include "lists.h" | ||||
| #include "log.h" | ||||
| #include "messages.h" | ||||
| #include "parse.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "irc-op.h" | ||||
|  | ||||
| /* Local functions */ | ||||
|  | ||||
| static bool | ||||
| try_kick(CLIENT *peer, CLIENT* from, const char *nick, const char *channel, | ||||
| @@ -41,13 +39,22 @@ try_kick(CLIENT *peer, CLIENT* from, const char *nick, const char *channel, | ||||
| 	CLIENT *target = Client_Search(nick); | ||||
|  | ||||
| 	if (!target) | ||||
| 		return IRC_WriteStrClient(from, ERR_NOSUCHNICK_MSG, Client_ID(from), nick); | ||||
| 		return IRC_WriteErrClient(from, ERR_NOSUCHNICK_MSG, | ||||
| 					  Client_ID(from), nick); | ||||
|  | ||||
| 	Channel_Kick(peer, target, from, channel, reason); | ||||
| 	return true; | ||||
| } | ||||
|  | ||||
| /* Global functions */ | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC command "KICK". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_KICK(CLIENT *Client, REQUEST *Req) | ||||
| { | ||||
| @@ -60,9 +67,7 @@ IRC_KICK(CLIENT *Client, REQUEST *Req) | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( Req != NULL ); | ||||
|  | ||||
| 	if ((Req->argc < 2) || (Req->argc > 3)) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					Client_ID(Client), Req->command); | ||||
| 	_IRC_GET_SENDER_OR_RETURN_(from, Req, Client) | ||||
|  | ||||
| 	while (*itemList) { | ||||
| 		if (*itemList == ',') { | ||||
| @@ -81,15 +86,6 @@ IRC_KICK(CLIENT *Client, REQUEST *Req) | ||||
| 		itemList++; | ||||
| 	} | ||||
|  | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER) | ||||
| 		from = Client_Search(Req->prefix); | ||||
| 	else | ||||
| 		from = Client; | ||||
|  | ||||
| 	if (!from) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					Client_ID(Client), Req->prefix); | ||||
|  | ||||
| 	reason = Req->argc == 3 ? Req->argv[2] : Client_ID(from); | ||||
| 	currentNick = Req->argv[1]; | ||||
| 	currentChannel = Req->argv[0]; | ||||
| @@ -122,13 +118,19 @@ IRC_KICK(CLIENT *Client, REQUEST *Req) | ||||
| 			nickCount--; | ||||
| 		} | ||||
| 	} else { | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					Client_ID(Client), Req->command); | ||||
| 	} | ||||
| 	return true; | ||||
| } /* IRC_KICK */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC command "INVITE". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_INVITE(CLIENT *Client, REQUEST *Req) | ||||
| { | ||||
| @@ -140,51 +142,56 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( Req != NULL ); | ||||
|  | ||||
| 	if (Req->argc != 2) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					Client_ID(Client), Req->command); | ||||
|  | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER) | ||||
| 		from = Client_Search(Req->prefix); | ||||
| 	else | ||||
| 		from = Client; | ||||
| 	if (!from) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					Client_ID(Client), Req->prefix); | ||||
| 	_IRC_GET_SENDER_OR_RETURN_(from, Req, Client) | ||||
|  | ||||
| 	/* Search user */ | ||||
| 	target = Client_Search(Req->argv[0]); | ||||
| 	if (!target || (Client_Type(target) != CLIENT_USER)) | ||||
| 		return IRC_WriteStrClient(from, ERR_NOSUCHNICK_MSG, | ||||
| 				Client_ID(Client), Req->argv[0]); | ||||
| 		return IRC_WriteErrClient(from, ERR_NOSUCHNICK_MSG, | ||||
| 					  Client_ID(Client), Req->argv[0]); | ||||
|  | ||||
| 	if (Req->argv[1][0] == '&') { | ||||
| 		/* Local channel. Make sure the target user is on this server! */ | ||||
| 		if (Client_Conn(target) == NONE) | ||||
| 			return IRC_WriteErrClient(from, ERR_USERNOTONSERV_MSG, | ||||
| 						  Client_ID(Client), | ||||
| 						  Req->argv[0]); | ||||
| 	} | ||||
|  | ||||
| 	chan = Channel_Search(Req->argv[1]); | ||||
| 	if (chan) { | ||||
| 		/* Channel exists. Is the user a valid member of the channel? */ | ||||
| 		if (!Channel_IsMemberOf(chan, from)) | ||||
| 			return IRC_WriteStrClient(from, ERR_NOTONCHANNEL_MSG, Client_ID(Client), Req->argv[1]); | ||||
| 			return IRC_WriteErrClient(from, ERR_NOTONCHANNEL_MSG, | ||||
| 						  Client_ID(Client), | ||||
| 						  Req->argv[1]); | ||||
|  | ||||
| 		/* Is the channel "invite-disallow"? */ | ||||
| 		if (strchr(Channel_Modes(chan), 'V')) | ||||
| 			return IRC_WriteStrClient(from, ERR_NOINVITE_MSG, | ||||
| 				Client_ID(from), Channel_Name(chan)); | ||||
| 		if (Channel_HasMode(chan, 'V')) | ||||
| 			return IRC_WriteErrClient(from, ERR_NOINVITE_MSG, | ||||
| 						  Client_ID(from), | ||||
| 						  Channel_Name(chan)); | ||||
|  | ||||
| 		/* Is the channel "invite-only"? */ | ||||
| 		if (strchr(Channel_Modes(chan), 'i')) { | ||||
| 			/* Yes. The user must be channel owner/admin/operator/halfop! */ | ||||
| 			if (!strchr(Channel_UserModes(chan, from), 'q') && | ||||
| 			    !strchr(Channel_UserModes(chan, from), 'a') && | ||||
| 			    !strchr(Channel_UserModes(chan, from), 'o') && | ||||
| 			    !strchr(Channel_UserModes(chan, from), 'h')) | ||||
| 				return IRC_WriteStrClient(from, ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 						Client_ID(from), Channel_Name(chan)); | ||||
| 		if (Channel_HasMode(chan, 'i')) { | ||||
| 			/* Yes. The user issuing the INVITE command must be | ||||
| 			 * channel owner/admin/operator/halfop! */ | ||||
| 			if (!Channel_UserHasMode(chan, from, 'q') && | ||||
| 			    !Channel_UserHasMode(chan, from, 'a') && | ||||
| 			    !Channel_UserHasMode(chan, from, 'o') && | ||||
| 			    !Channel_UserHasMode(chan, from, 'h')) | ||||
| 				return IRC_WriteErrClient(from, | ||||
| 							  ERR_CHANOPRIVSNEEDED_MSG, | ||||
| 							  Client_ID(from), | ||||
| 							  Channel_Name(chan)); | ||||
| 			remember = true; | ||||
| 		} | ||||
|  | ||||
| 		/* Is the target user already member of the channel? */ | ||||
| 		if (Channel_IsMemberOf(chan, target)) | ||||
| 			return IRC_WriteStrClient(from, ERR_USERONCHANNEL_MSG, | ||||
| 					Client_ID(from), Req->argv[0], Req->argv[1]); | ||||
| 			return IRC_WriteErrClient(from, ERR_USERONCHANNEL_MSG, | ||||
| 						  Client_ID(from), | ||||
| 						  Req->argv[0], Req->argv[1]); | ||||
|  | ||||
| 		/* If the target user is banned on that channel: remember invite */ | ||||
| 		if (Lists_Check(Channel_GetListBans(chan), target)) | ||||
| @@ -192,33 +199,35 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) | ||||
|  | ||||
| 		if (remember) { | ||||
| 			/* We must remember this invite */ | ||||
| 			if (!Channel_AddInvite(chan, Client_Mask(target), true)) | ||||
| 			if (!Channel_AddInvite(chan, Client_MaskCloaked(target), | ||||
| 						true, Client_ID(from))) | ||||
| 				return CONNECTED; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	LogDebug("User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask(from), Req->argv[0], Req->argv[1]); | ||||
|  | ||||
| 	LogDebug("User \"%s\" invites \"%s\" to \"%s\" ...", Client_Mask(from), | ||||
| 		 Req->argv[0], Req->argv[1]); | ||||
|  | ||||
| 	/* | ||||
| 	 * RFC 2812 says: | ||||
| 	 * 'There is no requirement that the channel [..] must exist or be a valid channel' | ||||
| 	 * The problem with this is that this allows the "channel" to contain spaces, | ||||
| 	 * in which case we must prefix its name with a colon to make it clear that | ||||
| 	 * it is only a single argument. | ||||
| 	 * RFC 2812 states: | ||||
| 	 * 'There is no requirement that the channel [..] must exist or be a | ||||
| 	 * valid channel'. The problem with this is that this allows the | ||||
| 	 * "channel" to contain spaces, in which case we must prefix its name | ||||
| 	 * with a colon to make it clear that it is only a single argument. | ||||
| 	 */ | ||||
| 	colon_if_necessary = strchr(Req->argv[1], ' ') ? ":":""; | ||||
| 	/* Inform target client */ | ||||
| 	IRC_WriteStrClientPrefix(target, from, "INVITE %s %s%s", Req->argv[0], | ||||
| 					colon_if_necessary, Req->argv[1]); | ||||
| 				  colon_if_necessary, Req->argv[1]); | ||||
|  | ||||
| 	if (Client_Conn(target) > NONE) { | ||||
| 		/* The target user is local, so we have to send the status code */ | ||||
| 		if (!IRC_WriteStrClientPrefix(from, target, RPL_INVITING_MSG, | ||||
| 			Client_ID(from), Req->argv[0], colon_if_necessary, Req->argv[1])) | ||||
| 					       Client_ID(from), Req->argv[0], | ||||
| 					       colon_if_necessary, Req->argv[1])) | ||||
| 			return DISCONNECTED; | ||||
|  | ||||
| 		if (strchr(Client_Modes(target), 'a') && | ||||
| 		if (Client_HasMode(target, 'a') && | ||||
| 			!IRC_WriteStrClient(from, RPL_AWAY_MSG, Client_ID(from), | ||||
| 					Client_ID(target), Client_Away(target))) | ||||
| 				return DISCONNECTED; | ||||
| @@ -226,5 +235,4 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) | ||||
| 	return CONNECTED; | ||||
| } /* IRC_INVITE */ | ||||
|  | ||||
|  | ||||
| /* -eof- */ | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,26 +16,28 @@ | ||||
|  * IRC operator commands | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
| #include <signal.h> | ||||
| #include <time.h> | ||||
|  | ||||
| #include "ngircd.h" | ||||
| #include "conn-func.h" | ||||
| #include "conf.h" | ||||
| #include "channel.h" | ||||
| #include "class.h" | ||||
| #include "parse.h" | ||||
| #include "irc.h" | ||||
| #include "irc-macros.h" | ||||
| #include "irc-write.h" | ||||
| #include "lists.h" | ||||
| #include "log.h" | ||||
| #include "match.h" | ||||
| #include "messages.h" | ||||
| #include "parse.h" | ||||
| #include "op.h" | ||||
|  | ||||
| #include <exp.h> | ||||
| #include "irc-oper.h" | ||||
|  | ||||
| /** | ||||
| @@ -45,9 +47,10 @@ | ||||
| static bool | ||||
| Bad_OperPass(CLIENT *Client, char *errtoken, char *errmsg) | ||||
| { | ||||
| 	Log(LOG_WARNING, "Got invalid OPER from \"%s\": \"%s\" -- %s", | ||||
| 	Log(LOG_ERR|LOG_snotice, "Got invalid OPER from \"%s\": \"%s\" -- %s!", | ||||
| 	    Client_Mask(Client), errtoken, errmsg); | ||||
| 	IRC_SetPenalty(Client, 3); | ||||
| 	/* Increase penalty to slow down possible brute force attacks */ | ||||
| 	IRC_SetPenalty(Client, 10); | ||||
| 	return IRC_WriteStrClient(Client, ERR_PASSWDMISMATCH_MSG, | ||||
| 				  Client_ID(Client)); | ||||
| } /* Bad_OperPass */ | ||||
| @@ -55,8 +58,6 @@ Bad_OperPass(CLIENT *Client, char *errtoken, char *errmsg) | ||||
| /** | ||||
|  * Handler for the IRC "OPER" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.1.4 "Oper message". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
| @@ -70,10 +71,6 @@ IRC_OPER( CLIENT *Client, REQUEST *Req ) | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( Req != NULL ); | ||||
|  | ||||
| 	if (Req->argc != 2) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	len = array_length(&Conf_Opers, sizeof(*op)); | ||||
| 	op = array_start(&Conf_Opers); | ||||
| 	for (i = 0; i < len && strcmp(op[i].name, Req->argv[0]); i++) | ||||
| @@ -96,20 +93,16 @@ IRC_OPER( CLIENT *Client, REQUEST *Req ) | ||||
| 					  Client_ID(Client)); | ||||
| 	} | ||||
|  | ||||
| 	if (!Client_OperByMe(Client)) | ||||
| 		Log(LOG_NOTICE|LOG_snotice, | ||||
| 		    "Got valid OPER from \"%s\", user is an IRC operator now.", | ||||
| 		    Client_Mask(Client)); | ||||
| 	Log(LOG_NOTICE|LOG_snotice, | ||||
| 	    "Got valid OPER for \"%s\" from \"%s\", user is an IRC operator now.", | ||||
| 	    Req->argv[0], Client_Mask(Client)); | ||||
|  | ||||
| 	Client_SetOperByMe(Client, true); | ||||
| 	return IRC_WriteStrClient(Client, RPL_YOUREOPER_MSG, Client_ID(Client)); | ||||
| } /* IRC_OPER */ | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC "DIE" command. | ||||
|  * | ||||
|  * See RFC 2812, 4.3 "Die message". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
| @@ -128,15 +121,6 @@ IRC_DIE(CLIENT * Client, REQUEST * Req) | ||||
| 	if (!Op_Check(Client, Req)) | ||||
| 		return Op_NoPrivileges(Client, Req); | ||||
|  | ||||
| 	/* Bad number of parameters? */ | ||||
| #ifdef STRICT_RFC | ||||
| 	if (Req->argc != 0) | ||||
| #else | ||||
| 	if (Req->argc > 1) | ||||
| #endif | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	/* Is a message given? */ | ||||
| 	if (Req->argc > 0) { | ||||
| 		c = Conn_First(); | ||||
| @@ -159,8 +143,6 @@ IRC_DIE(CLIENT * Client, REQUEST * Req) | ||||
| /** | ||||
|  * Handler for the IRC "REHASH" command. | ||||
|  * | ||||
|  * See RFC 2812, 4.2 "Rehash message". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
| @@ -176,11 +158,6 @@ IRC_REHASH( CLIENT *Client, REQUEST *Req ) | ||||
| 	if (!Op_Check(Client, Req)) | ||||
| 		return Op_NoPrivileges(Client, Req); | ||||
|  | ||||
| 	/* Bad number of parameters? */ | ||||
| 	if (Req->argc != 0) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command ); | ||||
|  | ||||
| 	Log(LOG_NOTICE|LOG_snotice, "Got REHASH command from \"%s\" ...", | ||||
| 	    Client_Mask(Client)); | ||||
| 	IRC_WriteStrClient(Client, RPL_REHASHING_MSG, Client_ID(Client)); | ||||
| @@ -193,8 +170,6 @@ IRC_REHASH( CLIENT *Client, REQUEST *Req ) | ||||
| /** | ||||
|  * Handler for the IRC "RESTART" command. | ||||
|  * | ||||
|  * See RFC 2812, 4.4 "Restart message". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
| @@ -210,11 +185,6 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req ) | ||||
| 	if (!Op_Check(Client, Req)) | ||||
| 		return Op_NoPrivileges(Client, Req); | ||||
|  | ||||
| 	/* Bad number of parameters? */ | ||||
| 	if (Req->argc != 0) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	Log(LOG_NOTICE|LOG_snotice, "Got RESTART command from \"%s\" ...", | ||||
| 	    Client_Mask(Client)); | ||||
| 	NGIRCd_SignalRestart = true; | ||||
| @@ -225,8 +195,6 @@ IRC_RESTART( CLIENT *Client, REQUEST *Req ) | ||||
| /** | ||||
|  * Handler for the IRC "CONNECT" command. | ||||
|  * | ||||
|  * See RFC 2812, 3.4.7 "Connect message". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
| @@ -239,21 +207,21 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	if (Client_Type(Client) != CLIENT_SERVER | ||||
| 	    && !Client_HasMode(Client, 'o')) | ||||
| 		return Op_NoPrivileges(Client, Req); | ||||
|  | ||||
| 	/* Bad number of parameters? */ | ||||
| 	if (Req->argc != 1 && Req->argc != 2 && Req->argc != 3 && | ||||
| 	    Req->argc != 5 && Req->argc != 6) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	/* Invalid port number? */ | ||||
| 	if ((Req->argc > 1) && atoi(Req->argv[1]) < 1) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	if (Client_Type(Client) != CLIENT_SERVER | ||||
| 	    && !Client_HasMode(Client, 'o')) | ||||
| 		return Op_NoPrivileges(Client, Req); | ||||
|  | ||||
| 	from = Client; | ||||
| 	target = Client_ThisServer(); | ||||
|  | ||||
| @@ -262,14 +230,14 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) | ||||
| 		if (Client_Type(Client) == CLIENT_SERVER && Req->prefix) | ||||
| 			from = Client_Search(Req->prefix); | ||||
| 		if (! from) | ||||
| 			return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					Client_ID(Client), Req->prefix); | ||||
| 			return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 						  Client_ID(Client), Req->prefix); | ||||
|  | ||||
| 		target = (Req->argc == 3) ? Client_Search(Req->argv[2]) | ||||
| 					  : Client_Search(Req->argv[5]); | ||||
| 		if (! target || Client_Type(target) != CLIENT_SERVER) | ||||
| 			return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG, | ||||
| 					Client_ID(from), Req->argv[0]); | ||||
| 			return IRC_WriteErrClient(from, ERR_NOSUCHSERVER_MSG, | ||||
| 						  Client_ID(from), Req->argv[0]); | ||||
| 	} | ||||
|  | ||||
| 	if (target != Client_ThisServer()) { | ||||
| @@ -292,7 +260,7 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) | ||||
| 	switch (Req->argc) { | ||||
| 	case 1: | ||||
| 		if (!Conf_EnablePassiveServer(Req->argv[0])) | ||||
| 			return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG, | ||||
| 			return IRC_WriteErrClient(from, ERR_NOSUCHSERVER_MSG, | ||||
| 						  Client_ID(from), | ||||
| 						  Req->argv[0]); | ||||
| 		break; | ||||
| @@ -301,7 +269,7 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) | ||||
| 		/* Connect configured server */ | ||||
| 		if (!Conf_EnableServer | ||||
| 		    (Req->argv[0], (UINT16) atoi(Req->argv[1]))) | ||||
| 			return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG, | ||||
| 			return IRC_WriteErrClient(from, ERR_NOSUCHSERVER_MSG, | ||||
| 						  Client_ID(from), | ||||
| 						  Req->argv[0]); | ||||
| 		break; | ||||
| @@ -310,7 +278,7 @@ IRC_CONNECT(CLIENT * Client, REQUEST * Req) | ||||
| 		if (!Conf_AddServer | ||||
| 		    (Req->argv[0], (UINT16) atoi(Req->argv[1]), Req->argv[2], | ||||
| 		     Req->argv[3], Req->argv[4])) | ||||
| 			return IRC_WriteStrClient(from, ERR_NOSUCHSERVER_MSG, | ||||
| 			return IRC_WriteErrClient(from, ERR_NOSUCHSERVER_MSG, | ||||
| 						  Client_ID(from), | ||||
| 						  Req->argv[0]); | ||||
| 	} | ||||
| @@ -346,11 +314,6 @@ IRC_DISCONNECT(CLIENT * Client, REQUEST * Req) | ||||
| 	if (!Op_Check(Client, Req)) | ||||
| 		return Op_NoPrivileges(Client, Req); | ||||
|  | ||||
| 	/* Bad number of parameters? */ | ||||
| 	if (Req->argc != 1) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), | ||||
| 			"Received DISCONNECT %s from %s", | ||||
| 			Req->argv[0], Client_ID(Client)); | ||||
| @@ -364,7 +327,7 @@ IRC_DISCONNECT(CLIENT * Client, REQUEST * Req) | ||||
|  | ||||
| 	/* Disconnect configured server */ | ||||
| 	if (!Conf_DisableServer(Req->argv[0])) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHSERVER_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOSUCHSERVER_MSG, | ||||
| 					  Client_ID(Client), Req->argv[0]); | ||||
|  | ||||
| 	/* Are we still connected or were we killed, too? */ | ||||
| @@ -377,8 +340,6 @@ IRC_DISCONNECT(CLIENT * Client, REQUEST * Req) | ||||
| /** | ||||
|  * Handler for the IRC "WALLOPS" command. | ||||
|  * | ||||
|  * See RFC 2812, 4.7 "Operwall message". | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
| @@ -391,18 +352,14 @@ IRC_WALLOPS( CLIENT *Client, REQUEST *Req ) | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( Req != NULL ); | ||||
|  | ||||
| 	if (Req->argc != 1) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	switch (Client_Type(Client)) { | ||||
| 	case CLIENT_USER: | ||||
| 		if (!Client_OperByMe(Client)) | ||||
| 			return IRC_WriteStrClient(Client, ERR_NOPRIVILEGES_MSG, | ||||
| 						  Client_ID(Client)); | ||||
| 		if (!Op_Check(Client, Req)) | ||||
| 			return Op_NoPrivileges(Client, Req); | ||||
| 		from = Client; | ||||
| 		break; | ||||
| 	case CLIENT_SERVER: | ||||
| 		_IRC_REQUIRE_PREFIX_OR_RETURN_(Client, Req) | ||||
| 		from = Client_Search(Req->prefix); | ||||
| 		break; | ||||
| 	default: | ||||
| @@ -410,7 +367,7 @@ IRC_WALLOPS( CLIENT *Client, REQUEST *Req ) | ||||
| 	} | ||||
|  | ||||
| 	if (!from) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					  Client_ID(Client), Req->prefix); | ||||
|  | ||||
| 	IRC_SendWallops(Client, from, "%s", Req->argv[0]); | ||||
| @@ -427,22 +384,33 @@ IRC_WALLOPS( CLIENT *Client, REQUEST *Req ) | ||||
| GLOBAL bool | ||||
| IRC_xLINE(CLIENT *Client, REQUEST *Req) | ||||
| { | ||||
| 	CLIENT *from; | ||||
| 	CLIENT *from, *c, *c_next; | ||||
| 	char reason[COMMAND_LEN], class_c; | ||||
| 	struct list_head *list; | ||||
| 	time_t timeout; | ||||
| 	int class; | ||||
| 	char class_c; | ||||
|  | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	from = Op_Check(Client, Req); | ||||
| 	if (!from) | ||||
| 		return Op_NoPrivileges(Client, Req); | ||||
|  | ||||
| 	/* Bad number of parameters? */ | ||||
| 	if (Req->argc != 1 && Req->argc != 3) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	if (!Conf_AllowRemoteOper && Client_Type(Client) == CLIENT_SERVER) { | ||||
| 		/* Explicitely forbid remote servers to modify "x-lines" when | ||||
| 		 * the "AllowRemoteOper" configuration option isn't set, even | ||||
| 		 * when the command seems to originate from the remote server | ||||
| 		 * itself: this prevents GLINE's to become set during server | ||||
| 		 * handshake in this case (what wouldn't be possible during | ||||
| 		 * regular runtime when a remote IRC Op sends the command). */ | ||||
| 		from = NULL; | ||||
| 	} else | ||||
| 		from = Op_Check(Client, Req); | ||||
| 	if (!from) | ||||
| 		return Op_NoPrivileges(Client, Req); | ||||
|  | ||||
| 	switch(Req->command[0]) { | ||||
| 		case 'g': | ||||
| 		case 'G': | ||||
| @@ -473,8 +441,11 @@ IRC_xLINE(CLIENT *Client, REQUEST *Req) | ||||
| 		} | ||||
| 	} else { | ||||
| 		/* Add new mask to list */ | ||||
| 		timeout = atol(Req->argv[1]); | ||||
| 		if (timeout > 0) | ||||
| 			timeout += time(NULL); | ||||
| 		if (Class_AddMask(class, Req->argv[0], | ||||
| 				  time(NULL) + atol(Req->argv[1]), | ||||
| 				  timeout, | ||||
| 				  Req->argv[2])) { | ||||
| 			Log(LOG_NOTICE|LOG_snotice, | ||||
| 			    "\"%s\" added \"%s\" to %c-Line list: \"%s\" (%ld seconds).", | ||||
| @@ -487,6 +458,20 @@ IRC_xLINE(CLIENT *Client, REQUEST *Req) | ||||
| 						Req->argv[0], Req->argv[1], | ||||
| 						Req->argv[2]); | ||||
| 			} | ||||
|  | ||||
| 			/* Check currently connected clients */ | ||||
| 			snprintf(reason, sizeof(reason), "%c-Line by \"%s\": \"%s\"", | ||||
| 				 class_c, Client_ID(from), Req->argv[2]); | ||||
| 			list = Class_GetList(class); | ||||
| 			c = Client_First(); | ||||
| 			while (c) { | ||||
| 				c_next = Client_Next(c); | ||||
| 				if ((class == CLASS_GLINE || Client_Conn(c) > NONE) | ||||
| 				    && Lists_Check(list, c)) | ||||
| 					IRC_KillClient(Client, NULL, | ||||
| 						       Client_ID(c), reason); | ||||
| 				c = c_next; | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2007 Alexander Barton (alex@barton.de) | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,41 +16,39 @@ | ||||
|  * IRC commands for server links | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
| #include <strings.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "conn.h" | ||||
| #include "conn-func.h" | ||||
| #include "conn-zip.h" | ||||
| #include "conf.h" | ||||
| #include "channel.h" | ||||
| #include "irc-write.h" | ||||
| #include "lists.h" | ||||
| #include "log.h" | ||||
| #include "messages.h" | ||||
| #include "parse.h" | ||||
| #include "numeric.h" | ||||
| #include "ngircd.h" | ||||
| #include "irc.h" | ||||
| #include "irc-info.h" | ||||
| #include "irc-write.h" | ||||
| #include "op.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "irc-server.h" | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC command "SERVER". | ||||
|  * See RFC 2813 section 4.1.2. | ||||
|  * Handler for the IRC "SERVER" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_SERVER( CLIENT *Client, REQUEST *Req ) | ||||
| { | ||||
| 	char str[LINE_LEN]; | ||||
| 	char str[100]; | ||||
| 	CLIENT *from, *c; | ||||
| 	int i; | ||||
|  | ||||
| @@ -59,7 +57,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) | ||||
|  | ||||
| 	/* Return an error if this is not a local client */ | ||||
| 	if (Client_Conn(Client) <= NONE) | ||||
| 		return IRC_WriteStrClient(Client, ERR_UNKNOWNCOMMAND_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_UNKNOWNCOMMAND_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	if (Client_Type(Client) == CLIENT_GOTPASS || | ||||
| @@ -70,7 +68,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) | ||||
| 			Client_Conn(Client)); | ||||
|  | ||||
| 		if (Req->argc != 2 && Req->argc != 3) | ||||
| 			return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 			return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 						  Client_ID(Client), | ||||
| 						  Req->command); | ||||
|  | ||||
| @@ -79,7 +77,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) | ||||
| 			if (strcasecmp(Req->argv[0], Conf_Server[i].name) == 0) | ||||
| 				break; | ||||
|  | ||||
| 		/* Makre sure the remote server is configured here */ | ||||
| 		/* Make sure the remote server is configured here */ | ||||
| 		if (i >= MAX_SERVERS) { | ||||
| 			Log(LOG_ERR, | ||||
| 			    "Connection %d: Server \"%s\" not configured here!", | ||||
| @@ -149,17 +147,17 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) | ||||
| 		Client_SetType(Client, CLIENT_UNKNOWNSERVER); | ||||
|  | ||||
| #ifdef ZLIB | ||||
| 		if (strchr(Client_Flags(Client), 'Z') | ||||
| 		if (Client_HasFlag(Client, 'Z') | ||||
| 		    && !Zip_InitConn(Client_Conn(Client))) { | ||||
| 			Conn_Close(Client_Conn(Client), | ||||
| 				   "Can't inizialize compression (zlib)!", | ||||
| 				   "Can't initialize compression (zlib)!", | ||||
| 				   NULL, false ); | ||||
| 			return DISCONNECTED; | ||||
| 		} | ||||
| #endif | ||||
|  | ||||
| #ifdef IRCPLUS | ||||
| 		if (strchr(Client_Flags(Client), 'H')) { | ||||
| 		if (Client_HasFlag(Client, 'H')) { | ||||
| 			LogDebug("Peer supports IRC+ extended server handshake ..."); | ||||
| 			if (!IRC_Send_ISUPPORT(Client)) | ||||
| 				return DISCONNECTED; | ||||
| @@ -180,41 +178,66 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) | ||||
| 	{ | ||||
| 		/* New server is being introduced to the network */ | ||||
|  | ||||
| 		if( Req->argc != 4 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); | ||||
| 		if (Req->argc != 4) | ||||
| 			return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 						  Client_ID(Client), Req->command); | ||||
|  | ||||
| 		/* check for existing server with same ID */ | ||||
| 		if( ! Client_CheckID( Client, Req->argv[0] )) return DISCONNECTED; | ||||
| 		if (!Client_CheckID(Client, Req->argv[0])) | ||||
| 			return DISCONNECTED; | ||||
|  | ||||
| 		from = Client_Search( Req->prefix ); | ||||
| 		if( ! from ) | ||||
| 		{ | ||||
| 		if (! from) { | ||||
| 			/* Uh, Server, that introduced the new server is unknown?! */ | ||||
| 			Log( LOG_ALERT, "Unknown ID in prefix of SERVER: \"%s\"! (on connection %d)", Req->prefix, Client_Conn( Client )); | ||||
| 			Conn_Close( Client_Conn( Client ), NULL, "Unknown ID in prefix of SERVER", true); | ||||
| 			Log(LOG_ALERT, | ||||
| 			    "Unknown ID in prefix of SERVER: \"%s\"! (on connection %d)", | ||||
| 			    Req->prefix, Client_Conn(Client)); | ||||
| 			Conn_Close(Client_Conn(Client), NULL, | ||||
| 				   "Unknown ID in prefix of SERVER", true); | ||||
| 			return DISCONNECTED; | ||||
| 		} | ||||
|  | ||||
| 		c = Client_NewRemoteServer(Client, Req->argv[0], from, atoi(Req->argv[1]), atoi(Req->argv[2]), Req->argv[3], true); | ||||
| 		c = Client_NewRemoteServer(Client, Req->argv[0], from, | ||||
| 					   atoi(Req->argv[1]), atoi(Req->argv[2]), | ||||
| 					   Req->argv[3], true); | ||||
| 		if (!c) { | ||||
| 			Log( LOG_ALERT, "Can't create client structure for server! (on connection %d)", Client_Conn( Client )); | ||||
| 			Conn_Close( Client_Conn( Client ), NULL, "Can't allocate client structure for remote server", true); | ||||
| 			Log(LOG_ALERT, | ||||
| 			    "Can't create client structure for server! (on connection %d)", | ||||
| 			    Client_Conn(Client)); | ||||
| 			Conn_Close(Client_Conn(Client), NULL, | ||||
| 				   "Can't allocate client structure for remote server", | ||||
| 				   true); | ||||
| 			return DISCONNECTED; | ||||
| 		} | ||||
|  | ||||
| 		if(( Client_Hops( c ) > 1 ) && ( Req->prefix[0] )) snprintf( str, sizeof( str ), "connected to %s, ", Client_ID( from )); | ||||
| 		else strcpy( str, "" ); | ||||
| 		Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" registered (via %s, %s%d hop%s).", Client_ID( c ), Client_ID( Client ), str, Client_Hops( c ), Client_Hops( c ) > 1 ? "s": "" ); | ||||
| 		if (Client_Hops(c) > 1 && Req->prefix[0]) | ||||
| 			snprintf(str, sizeof(str), "connected to %s, ", | ||||
| 				 Client_ID(from)); | ||||
| 		else | ||||
| 			strcpy(str, ""); | ||||
| 		Log(LOG_NOTICE|LOG_snotice, | ||||
| 		    "Server \"%s\" registered (via %s, %s%d hop%s).", | ||||
| 		    Client_ID(c), Client_ID(Client), str, Client_Hops(c), | ||||
| 		    Client_Hops(c) > 1 ? "s": "" ); | ||||
|  | ||||
| 		/* notify other servers */ | ||||
| 		IRC_WriteStrServersPrefix( Client, from, "SERVER %s %d %d :%s", Client_ID( c ), Client_Hops( c ) + 1, Client_MyToken( c ), Client_Info( c )); | ||||
| 		IRC_WriteStrServersPrefix(Client, from, "SERVER %s %d %d :%s", | ||||
| 					  Client_ID(c), Client_Hops(c) + 1, | ||||
| 					  Client_MyToken(c), Client_Info(c)); | ||||
|  | ||||
| 		return CONNECTED; | ||||
| 	} else | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
| } /* IRC_SERVER */ | ||||
|  | ||||
|  | ||||
| /* | ||||
|  * Handler for the IRC "NJOIN" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_NJOIN( CLIENT *Client, REQUEST *Req ) | ||||
| { | ||||
| @@ -223,80 +246,112 @@ IRC_NJOIN( CLIENT *Client, REQUEST *Req ) | ||||
| 	CHANNEL *chan; | ||||
| 	CLIENT *c; | ||||
|  | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( Req != NULL ); | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Req != NULL); | ||||
|  | ||||
| 	if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); | ||||
|  | ||||
| 	strlcpy( nick_in, Req->argv[1], sizeof( nick_in )); | ||||
| 	strcpy( nick_out, "" ); | ||||
| 	strlcpy(nick_in, Req->argv[1], sizeof(nick_in)); | ||||
| 	strcpy(nick_out, ""); | ||||
|  | ||||
| 	channame = Req->argv[0]; | ||||
| 	ptr = strtok( nick_in, "," ); | ||||
| 	while( ptr ) | ||||
| 	{ | ||||
|  | ||||
| 	ptr = strtok(nick_in, ","); | ||||
| 	while (ptr) { | ||||
| 		is_owner = is_chanadmin = is_op = is_halfop = is_voiced = false; | ||||
|  | ||||
| 		/* cut off prefixes */ | ||||
| 		while(( *ptr == '~') || ( *ptr == '&' ) || ( *ptr == '@' ) || | ||||
| 			( *ptr == '%') || ( *ptr == '+' )) | ||||
| 		{ | ||||
| 			if( *ptr == '~' ) is_owner = true; | ||||
| 			if( *ptr == '&' ) is_chanadmin = true; | ||||
| 			if( *ptr == '@' ) is_op = true; | ||||
| 			if( *ptr == 'h' ) is_halfop = true; | ||||
| 			if( *ptr == '+' ) is_voiced = true; | ||||
| 		while ((*ptr == '~') || (*ptr == '&') || (*ptr == '@') || | ||||
| 		       (*ptr == '%') || (*ptr == '+')) { | ||||
| 			if (*ptr == '~') | ||||
| 				is_owner = true; | ||||
| 			if (*ptr == '&') | ||||
| 				is_chanadmin = true; | ||||
| 			if (*ptr == '@') | ||||
| 				is_op = true; | ||||
| 			if (*ptr == '%') | ||||
| 				is_halfop = true; | ||||
| 			if (*ptr == '+') | ||||
| 				is_voiced = true; | ||||
| 			ptr++; | ||||
| 		} | ||||
|  | ||||
| 		c = Client_Search( ptr ); | ||||
| 		if( c ) | ||||
| 		{ | ||||
| 			Channel_Join( c, channame ); | ||||
| 			chan = Channel_Search( channame ); | ||||
| 			assert( chan != NULL ); | ||||
|  | ||||
| 			if( is_owner ) Channel_UserModeAdd( chan, c, 'q' ); | ||||
| 			if( is_chanadmin ) Channel_UserModeAdd( chan, c, 'a' ); | ||||
| 			if( is_op ) Channel_UserModeAdd( chan, c, 'o' ); | ||||
| 			if( is_halfop ) Channel_UserModeAdd( chan, c, 'h' ); | ||||
| 			if( is_voiced ) Channel_UserModeAdd( chan, c, 'v' ); | ||||
|  | ||||
| 			/* announce to channel... */ | ||||
| 			IRC_WriteStrChannelPrefix( Client, chan, c, false, "JOIN :%s", channame ); | ||||
|  | ||||
| 			/* set Channel-User-Modes */ | ||||
| 			strlcpy( modes, Channel_UserModes( chan, c ), sizeof( modes )); | ||||
| 			if( modes[0] ) | ||||
| 			{ | ||||
| 				/* send modes to channel */ | ||||
| 				IRC_WriteStrChannelPrefix( Client, chan, Client, false, "MODE %s +%s %s", channame, modes, Client_ID( c )); | ||||
| 			} | ||||
|  | ||||
| 			if( nick_out[0] != '\0' ) strlcat( nick_out, ",", sizeof( nick_out )); | ||||
| 			if( is_owner ) strlcat( nick_out, "~", sizeof( nick_out )); | ||||
| 			if( is_chanadmin ) strlcat( nick_out, "&", sizeof( nick_out )); | ||||
| 			if( is_op ) strlcat( nick_out, "@", sizeof( nick_out )); | ||||
| 			if( is_halfop ) strlcat( nick_out, "%", sizeof( nick_out )); | ||||
| 			if( is_voiced ) strlcat( nick_out, "+", sizeof( nick_out )); | ||||
| 			strlcat( nick_out, ptr, sizeof( nick_out )); | ||||
| 		c = Client_Search(ptr); | ||||
| 		if (!c) { | ||||
| 			/* Client not found? */ | ||||
| 			Log(LOG_ERR, | ||||
| 			    "Got NJOIN for unknown nick \"%s\" for channel \"%s\"!", | ||||
| 			    ptr, channame); | ||||
| 			goto skip_njoin; | ||||
| 		} | ||||
| 		else Log( LOG_ERR, "Got NJOIN for unknown nick \"%s\" for channel \"%s\"!", ptr, channame ); | ||||
|  | ||||
| 		/* search for next Nick */ | ||||
| 		ptr = strtok( NULL, "," ); | ||||
| 		if (!Channel_Join(c, channame)) { | ||||
| 			/* Failed to join channel. Ooops!? */ | ||||
| 			Log(LOG_ALERT, | ||||
| 			    "Failed to join client \"%s\" to channel \"%s\" (NJOIN): killing it!", | ||||
| 			    ptr, channame); | ||||
| 			IRC_KillClient(NULL, NULL, ptr, "Internal NJOIN error!"); | ||||
| 			Log(LOG_DEBUG, "... done."); | ||||
| 			goto skip_njoin; | ||||
| 		} | ||||
|  | ||||
| 		chan = Channel_Search(channame); | ||||
| 		assert(chan != NULL); | ||||
|  | ||||
| 		if (is_owner) | ||||
| 			Channel_UserModeAdd(chan, c, 'q'); | ||||
| 		if (is_chanadmin) | ||||
| 			Channel_UserModeAdd(chan, c, 'a'); | ||||
| 		if (is_op) | ||||
| 			Channel_UserModeAdd(chan, c, 'o'); | ||||
| 		if (is_halfop) | ||||
| 			Channel_UserModeAdd(chan, c, 'h'); | ||||
| 		if (is_voiced) | ||||
| 			Channel_UserModeAdd(chan, c, 'v'); | ||||
|  | ||||
| 		/* Announce client to the channel */ | ||||
| 		IRC_WriteStrChannelPrefix(Client, chan, c, false, | ||||
| 					  "JOIN :%s", channame); | ||||
|  | ||||
| 		/* Announce "channel user modes" to the channel, if any */ | ||||
| 		strlcpy(modes, Channel_UserModes(chan, c), sizeof(modes)); | ||||
| 		if (modes[0]) | ||||
| 			IRC_WriteStrChannelPrefix(Client, chan, Client, false, | ||||
| 						  "MODE %s +%s %s", channame, | ||||
| 						  modes, Client_ID(c)); | ||||
|  | ||||
| 		/* Build nick list for forwarding command */ | ||||
| 		if (nick_out[0] != '\0') | ||||
| 			strlcat(nick_out, ",", sizeof(nick_out)); | ||||
| 		if (is_owner) | ||||
| 			strlcat(nick_out, "~", sizeof(nick_out)); | ||||
| 		if (is_chanadmin) | ||||
| 			strlcat(nick_out, "&", sizeof(nick_out)); | ||||
| 		if (is_op) | ||||
| 			strlcat(nick_out, "@", sizeof(nick_out)); | ||||
| 		if (is_halfop) | ||||
| 			strlcat(nick_out, "%", sizeof(nick_out)); | ||||
| 		if (is_voiced) | ||||
| 			strlcat(nick_out, "+", sizeof(nick_out)); | ||||
| 		strlcat(nick_out, ptr, sizeof(nick_out)); | ||||
|  | ||||
| 	      skip_njoin: | ||||
| 		/* Get next nick, if any ... */ | ||||
| 		ptr = strtok(NULL, ","); | ||||
| 	} | ||||
|  | ||||
| 	/* forward to other servers */ | ||||
| 	if( nick_out[0] != '\0' ) IRC_WriteStrServersPrefix( Client, Client_ThisServer( ), "NJOIN %s :%s", Req->argv[0], nick_out ); | ||||
| 	if (nick_out[0] != '\0') | ||||
| 		IRC_WriteStrServersPrefix(Client, Client_ThisServer(), | ||||
| 					  "NJOIN %s :%s", Req->argv[0], nick_out); | ||||
|  | ||||
| 	return CONNECTED; | ||||
| } /* IRC_NJOIN */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Handler for the IRC command "SQUIT". | ||||
|  * See RFC 2813 section 4.1.2 and RFC 2812 section 3.1.8. | ||||
|  * Handler for the IRC "SQUIT" command. | ||||
|  * | ||||
|  * @param Client The client from which this command has been received. | ||||
|  * @param Req Request structure with prefix and all parameters. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| GLOBAL bool | ||||
| IRC_SQUIT(CLIENT * Client, REQUEST * Req) | ||||
| @@ -313,11 +368,6 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req) | ||||
| 	    && !Client_HasMode(Client, 'o')) | ||||
| 		return Op_NoPrivileges(Client, Req); | ||||
|  | ||||
| 	/* Bad number of arguments? */ | ||||
| 	if (Req->argc != 2) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, | ||||
| 					  Client_ID(Client), Req->command); | ||||
|  | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER && Req->prefix) { | ||||
| 		from = Client_Search(Req->prefix); | ||||
| 		if (Client_Type(from) != CLIENT_SERVER | ||||
| @@ -326,7 +376,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req) | ||||
| 	} else | ||||
| 		from = Client; | ||||
| 	if (!from) | ||||
| 		return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 		return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG, | ||||
| 					  Client_ID(Client), Req->prefix); | ||||
|  | ||||
| 	if (Client_Type(Client) == CLIENT_USER) | ||||
| @@ -352,7 +402,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req) | ||||
|  | ||||
| 	if (Req->argv[1][0]) | ||||
| 		if (Client_NextHop(from) != Client || con > NONE) | ||||
| 			snprintf(msg, sizeof(msg), "%s (SQUIT from %s)", | ||||
| 			snprintf(msg, sizeof(msg), "\"%s\" (SQUIT from %s)", | ||||
| 				 Req->argv[1], Client_ID(from)); | ||||
| 		else | ||||
| 			strlcpy(msg, Req->argv[1], sizeof(msg)); | ||||
| @@ -385,7 +435,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req) | ||||
| 			logmsg[0] = '\0'; | ||||
| 			if (!strchr(msg, '(')) | ||||
| 				snprintf(logmsg, sizeof(logmsg), | ||||
| 					 "%s (SQUIT from %s)", Req->argv[1], | ||||
| 					 "\"%s\" (SQUIT from %s)", Req->argv[1], | ||||
| 					 Client_ID(from)); | ||||
| 			Client_Destroy(target, logmsg[0] ? logmsg : msg, | ||||
| 				       msg, false); | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| /* | ||||
|  * ngIRCd -- The Next Generation IRC Daemon | ||||
|  * Copyright (c)2001-2008 Alexander Barton (alex@barton.de) | ||||
|  * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify | ||||
|  * it under the terms of the GNU General Public License as published by | ||||
| @@ -16,7 +16,6 @@ | ||||
|  * Sending IRC commands over the network | ||||
|  */ | ||||
|  | ||||
| #include "imp.h" | ||||
| #include <assert.h> | ||||
| #ifdef PROTOTYPES | ||||
| #	include <stdarg.h> | ||||
| @@ -24,26 +23,64 @@ | ||||
| #	include <varargs.h> | ||||
| #endif | ||||
| #include <stdio.h> | ||||
| #include <string.h> | ||||
|  | ||||
| #include "defines.h" | ||||
| #include "conn-func.h" | ||||
| #include "channel.h" | ||||
|  | ||||
| #include "exp.h" | ||||
| #include "irc-write.h" | ||||
|  | ||||
|  | ||||
| #define SEND_TO_USER 1 | ||||
| #define SEND_TO_SERVER 2 | ||||
|  | ||||
|  | ||||
| static const char *Get_Prefix PARAMS((CLIENT *Target, CLIENT *Client)); | ||||
| static void cb_writeStrServersPrefixFlag PARAMS((CLIENT *Client, | ||||
| 					 CLIENT *Prefix, void *Buffer)); | ||||
| static bool Send_Marked_Connections PARAMS((CLIENT *Prefix, const char *Buffer)); | ||||
| static void Send_Marked_Connections PARAMS((CLIENT *Prefix, const char *Buffer)); | ||||
|  | ||||
| /** | ||||
|  * Send an error message to a client and enforce a penalty time. | ||||
|  * | ||||
|  * @param Client The target client. | ||||
|  * @param Format Format string. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| #ifdef PROTOTYPES | ||||
| GLOBAL bool | ||||
| IRC_WriteErrClient( CLIENT *Client, const char *Format, ... ) | ||||
| #else | ||||
| GLOBAL bool | ||||
| IRC_WriteErrClient( Client, Format, va_alist ) | ||||
| CLIENT *Client; | ||||
| const char *Format; | ||||
| va_dcl | ||||
| #endif | ||||
| { | ||||
| 	char buffer[1000]; | ||||
| 	va_list ap; | ||||
|  | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Format != NULL); | ||||
|  | ||||
| #ifdef PROTOTYPES | ||||
| 	va_start(ap, Format); | ||||
| #else | ||||
| 	va_start(ap); | ||||
| #endif | ||||
| 	vsnprintf(buffer, sizeof(buffer), Format, ap); | ||||
| 	va_end(ap); | ||||
|  | ||||
| 	IRC_SetPenalty(Client, 2); | ||||
| 	return IRC_WriteStrClientPrefix(Client, Client_ThisServer(), | ||||
| 					"%s", buffer); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Send a message to a client. | ||||
|  * | ||||
|  * @param Client The target client. | ||||
|  * @param Format Format string. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| #ifdef PROTOTYPES | ||||
| GLOBAL bool | ||||
| IRC_WriteStrClient( CLIENT *Client, const char *Format, ... ) | ||||
| @@ -56,27 +93,31 @@ va_dcl | ||||
| #endif | ||||
| { | ||||
| 	char buffer[1000]; | ||||
| 	bool ok = CONNECTED; | ||||
| 	va_list ap; | ||||
|  | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( Format != NULL ); | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Format != NULL); | ||||
|  | ||||
| #ifdef PROTOTYPES | ||||
| 	va_start( ap, Format ); | ||||
| 	va_start(ap, Format); | ||||
| #else | ||||
| 	va_start( ap ); | ||||
| 	va_start(ap); | ||||
| #endif | ||||
| 	vsnprintf( buffer, 1000, Format, ap ); | ||||
| 	va_end( ap ); | ||||
|  | ||||
| 	/* to the client itself */ | ||||
| 	ok = IRC_WriteStrClientPrefix( Client, Client_ThisServer( ), "%s", buffer ); | ||||
|  | ||||
| 	return ok; | ||||
| } /* IRC_WriteStrClient */ | ||||
| 	vsnprintf(buffer, sizeof(buffer), Format, ap); | ||||
| 	va_end(ap); | ||||
|  | ||||
| 	return IRC_WriteStrClientPrefix(Client, Client_ThisServer(), | ||||
| 					"%s", buffer); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Send a message to a client using a specific prefix. | ||||
|  * | ||||
|  * @param Client The target client. | ||||
|  * @param Prefix The prefix to use. | ||||
|  * @param Format Format string. | ||||
|  * @return CONNECTED or DISCONNECTED. | ||||
|  */ | ||||
| #ifdef PROTOTYPES | ||||
| GLOBAL bool | ||||
| IRC_WriteStrClientPrefix(CLIENT *Client, CLIENT *Prefix, const char *Format, ...) | ||||
| @@ -103,20 +144,29 @@ va_dcl | ||||
| #else | ||||
| 	va_start( ap ); | ||||
| #endif | ||||
| 	vsnprintf( buffer, 1000, Format, ap ); | ||||
| 	vsnprintf(buffer, sizeof(buffer), Format, ap); | ||||
| 	va_end( ap ); | ||||
|  | ||||
| 	return Conn_WriteStr(Client_Conn(Client_NextHop(Client)), ":%s %s", | ||||
| 			Get_Prefix(Client_NextHop(Client), Prefix), buffer); | ||||
| } /* IRC_WriteStrClientPrefix */ | ||||
|  | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Send a message to all client in a channel. | ||||
|  * | ||||
|  * The message is only sent once per remote server. | ||||
|  * | ||||
|  * @param Client The sending client, excluded while forwarding the message. | ||||
|  * @param Channel The target channel. | ||||
|  * @param Remote If not set, the message is sent to local clients only. | ||||
|  * @param Format Format string. | ||||
|  */ | ||||
| #ifdef PROTOTYPES | ||||
| GLOBAL bool | ||||
| GLOBAL void | ||||
| IRC_WriteStrChannel(CLIENT *Client, CHANNEL *Chan, bool Remote, | ||||
| 		    const char *Format, ...) | ||||
| #else | ||||
| GLOBAL bool | ||||
| GLOBAL void | ||||
| IRC_WriteStrChannel(Client, Chan, Remote, Format, va_alist) | ||||
| CLIENT *Client; | ||||
| CHANNEL *Chan; | ||||
| @@ -136,24 +186,30 @@ va_dcl | ||||
| #else | ||||
| 	va_start( ap ); | ||||
| #endif | ||||
| 	vsnprintf( buffer, 1000, Format, ap ); | ||||
| 	vsnprintf(buffer, sizeof(buffer), Format, ap); | ||||
| 	va_end( ap ); | ||||
|  | ||||
| 	return IRC_WriteStrChannelPrefix( Client, Chan, Client_ThisServer( ), Remote, "%s", buffer ); | ||||
| } /* IRC_WriteStrChannel */ | ||||
|  | ||||
|  | ||||
| 	IRC_WriteStrChannelPrefix(Client, Chan, Client_ThisServer(), | ||||
| 				  Remote, "%s", buffer); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * send message to all clients in the same channel, but only send message | ||||
|  * once per remote server. | ||||
|  * Send a message to all client in a channel using a specific prefix. | ||||
|  * | ||||
|  * The message is only sent once per remote server. | ||||
|  * | ||||
|  * @param Client The sending client, excluded while forwarding the message. | ||||
|  * @param Channel The target channel. | ||||
|  * @param Prefix The prefix to use. | ||||
|  * @param Remote If not set, the message is sent to local clients only. | ||||
|  * @param Format Format string. | ||||
|  */ | ||||
| #ifdef PROTOTYPES | ||||
| GLOBAL bool | ||||
| GLOBAL void | ||||
| IRC_WriteStrChannelPrefix(CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, | ||||
| 			  bool Remote, const char *Format, ...) | ||||
| #else | ||||
| GLOBAL bool | ||||
| GLOBAL void | ||||
| IRC_WriteStrChannelPrefix(Client, Chan, Prefix, Remote, Format, va_alist) | ||||
| CLIENT *Client; | ||||
| CHANNEL *Chan; | ||||
| @@ -179,35 +235,42 @@ va_dcl | ||||
| #else | ||||
| 	va_start( ap  ); | ||||
| #endif | ||||
| 	vsnprintf( buffer, 1000, Format, ap ); | ||||
| 	vsnprintf(buffer, sizeof(buffer), Format, ap); | ||||
| 	va_end( ap ); | ||||
|  | ||||
| 	Conn_ClearFlags( ); | ||||
|  | ||||
| 	cl2chan = Channel_FirstMember( Chan ); | ||||
| 	while( cl2chan ) | ||||
| 	{ | ||||
| 	while(cl2chan) { | ||||
| 		c = Channel_GetClient( cl2chan ); | ||||
| 		if( ! Remote ) | ||||
| 		{ | ||||
| 			if( Client_Conn( c ) <= NONE ) c = NULL; | ||||
| 			else if( Client_Type( c ) == CLIENT_SERVER ) c = NULL; | ||||
| 		if (!Remote) { | ||||
| 			if (Client_Conn(c) <= NONE) | ||||
| 				c = NULL; | ||||
| 			else if(Client_Type(c) == CLIENT_SERVER) | ||||
| 				c = NULL; | ||||
| 		} | ||||
| 		if( c ) c = Client_NextHop( c ); | ||||
| 		if(c) | ||||
| 			c = Client_NextHop(c); | ||||
|  | ||||
| 		if( c && ( c != Client )) | ||||
| 		{ | ||||
| 		if(c && c != Client) { | ||||
| 			/* Ok, another Client */ | ||||
| 			conn = Client_Conn( c ); | ||||
| 			if( Client_Type( c ) == CLIENT_SERVER )	Conn_SetFlag( conn, SEND_TO_SERVER ); | ||||
| 			else Conn_SetFlag( conn, SEND_TO_USER ); | ||||
| 			conn = Client_Conn(c); | ||||
| 			if (Client_Type(c) == CLIENT_SERVER) | ||||
| 				Conn_SetFlag(conn, SEND_TO_SERVER); | ||||
| 			else | ||||
| 				Conn_SetFlag(conn, SEND_TO_USER); | ||||
| 		} | ||||
| 		cl2chan = Channel_NextMember( Chan, cl2chan ); | ||||
| 		cl2chan = Channel_NextMember(Chan, cl2chan); | ||||
| 	} | ||||
| 	return Send_Marked_Connections(Prefix, buffer); | ||||
| } /* IRC_WriteStrChannelPrefix */ | ||||
|  | ||||
| 	Send_Marked_Connections(Prefix, buffer); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Send a message to all the servers in the network. | ||||
|  * | ||||
|  * @param Client The sending client, excluded while forwarding the message. | ||||
|  * @param Format Format string. | ||||
|  */ | ||||
| #ifdef PROTOTYPES | ||||
| GLOBAL void | ||||
| IRC_WriteStrServers(CLIENT *ExceptOf, const char *Format, ...) | ||||
| @@ -229,13 +292,19 @@ va_dcl | ||||
| #else | ||||
| 	va_start( ap ); | ||||
| #endif | ||||
| 	vsnprintf( buffer, 1000, Format, ap ); | ||||
| 	vsnprintf(buffer, sizeof(buffer), Format, ap); | ||||
| 	va_end( ap ); | ||||
|  | ||||
| 	IRC_WriteStrServersPrefix( ExceptOf, Client_ThisServer( ), "%s", buffer ); | ||||
| } /* IRC_WriteStrServers */ | ||||
|  | ||||
| 	IRC_WriteStrServersPrefix(ExceptOf, Client_ThisServer(), "%s", buffer); | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Send a message to all the servers in the network using a specific prefix. | ||||
|  * | ||||
|  * @param Client The sending client, excluded while forwarding the message. | ||||
|  * @param Prefix The prefix to use. | ||||
|  * @param Format Format string. | ||||
|  */ | ||||
| #ifdef PROTOTYPES | ||||
| GLOBAL void | ||||
| IRC_WriteStrServersPrefix(CLIENT *ExceptOf, CLIENT *Prefix, | ||||
| @@ -260,13 +329,21 @@ va_dcl | ||||
| #else | ||||
| 	va_start( ap ); | ||||
| #endif | ||||
| 	vsnprintf( buffer, 1000, Format, ap ); | ||||
| 	vsnprintf(buffer, sizeof(buffer), Format, ap); | ||||
| 	va_end( ap ); | ||||
|  | ||||
| 	IRC_WriteStrServersPrefixFlag( ExceptOf, Prefix, '\0', "%s", buffer ); | ||||
| } /* IRC_WriteStrServersPrefix */ | ||||
|  | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Send a message to all the servers in the network using a specific prefix | ||||
|  * and matching a "client flag". | ||||
|  * | ||||
|  * @param Client The sending client, excluded while forwarding the message. | ||||
|  * @param Prefix The prefix to use. | ||||
|  * @param Flag Client flag that must be set on the target. | ||||
|  * @param Format Format string. | ||||
|  */ | ||||
| #ifdef PROTOTYPES | ||||
| GLOBAL void | ||||
| IRC_WriteStrServersPrefixFlag(CLIENT *ExceptOf, CLIENT *Prefix, char Flag, | ||||
| @@ -292,14 +369,23 @@ va_dcl | ||||
| #else | ||||
| 	va_start( ap ); | ||||
| #endif | ||||
| 	vsnprintf( buffer, 1000, Format, ap ); | ||||
| 	vsnprintf(buffer, sizeof(buffer), Format, ap); | ||||
| 	va_end( ap ); | ||||
|  | ||||
| 	IRC_WriteStrServersPrefixFlag_CB(ExceptOf, Prefix, Flag, | ||||
| 					 cb_writeStrServersPrefixFlag, buffer); | ||||
| } /* IRC_WriteStrServersPrefixFlag */ | ||||
|  | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * Send a message to all the servers in the network using a specific prefix | ||||
|  * and matching a "client flag" using a callback function. | ||||
|  * | ||||
|  * @param Client The sending client, excluded while forwarding the message. | ||||
|  * @param Prefix The prefix to use. | ||||
|  * @param Flag Client flag that must be set on the target. | ||||
|  * @param callback Callback function. | ||||
|  * @param Format Format string. | ||||
|  */ | ||||
| GLOBAL void | ||||
| IRC_WriteStrServersPrefixFlag_CB(CLIENT *ExceptOf, CLIENT *Prefix, char Flag, | ||||
| 		void (*callback)(CLIENT *, CLIENT *, void *), void *cb_data) | ||||
| @@ -311,24 +397,32 @@ IRC_WriteStrServersPrefixFlag_CB(CLIENT *ExceptOf, CLIENT *Prefix, char Flag, | ||||
| 		if (Client_Type(c) == CLIENT_SERVER && Client_Conn(c) > NONE && | ||||
| 		    c != Client_ThisServer() && c != ExceptOf) { | ||||
| 			/* Found a target server, do the flags match? */ | ||||
| 			if (Flag == '\0' || strchr(Client_Flags(c), Flag)) | ||||
| 			if (Flag == '\0' || Client_HasFlag(c, Flag)) | ||||
| 				callback(c, Prefix, cb_data); | ||||
| 		} | ||||
| 		c = Client_Next(c); | ||||
| 	} | ||||
| } /* IRC_WriteStrServersPrefixFlag */ | ||||
|  | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * send message to all clients that are in the same channels as the client sending this message. | ||||
|  * only send message once per reote server. | ||||
|  * Send a message to all "related" clients. | ||||
|  * | ||||
|  * Related clients are the one that share one ore more channels with the client | ||||
|  * sending this message. | ||||
|  * | ||||
|  * The message is only sent once per remote server. | ||||
|  * | ||||
|  * @param Client The sending client, excluded while forwarding the message. | ||||
|  * @param Prefix The prefix to use. | ||||
|  * @param Remote If not set, the message is sent to local clients only. | ||||
|  * @param Format Format string. | ||||
|  */ | ||||
| #ifdef PROTOTYPES | ||||
| GLOBAL bool | ||||
| GLOBAL void | ||||
| IRC_WriteStrRelatedPrefix(CLIENT *Client, CLIENT *Prefix, bool Remote, | ||||
| 			  const char *Format, ...) | ||||
| #else | ||||
| GLOBAL bool | ||||
| GLOBAL void | ||||
| IRC_WriteStrRelatedPrefix(Client, Prefix, Remote, Format, va_alist) | ||||
| CLIENT *Client; | ||||
| CLIENT *Prefix; | ||||
| @@ -353,7 +447,7 @@ va_dcl | ||||
| #else | ||||
| 	va_start( ap ); | ||||
| #endif | ||||
| 	vsnprintf( buffer, 1000, Format, ap ); | ||||
| 	vsnprintf(buffer, sizeof(buffer), Format, ap); | ||||
| 	va_end( ap ); | ||||
|  | ||||
| 	Conn_ClearFlags( ); | ||||
| @@ -384,13 +478,16 @@ va_dcl | ||||
|  | ||||
| 		chan_cl2chan = Channel_NextChannelOf( Client, chan_cl2chan ); | ||||
| 	} | ||||
| 	return Send_Marked_Connections(Prefix, buffer); | ||||
| 	Send_Marked_Connections(Prefix, buffer); | ||||
| } /* IRC_WriteStrRelatedPrefix */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Send WALLOPS message. | ||||
|  */ | ||||
|  * | ||||
|  * @param Client The sending client, excluded while forwarding the message. | ||||
|  * @param From The (remote) sender of the message. | ||||
|  * @param Format Format string. | ||||
| */ | ||||
| #ifdef PROTOTYPES | ||||
| GLOBAL void | ||||
| IRC_SendWallops(CLIENT *Client, CLIENT *From, const char *Format, ...) | ||||
| @@ -412,7 +509,7 @@ va_dcl | ||||
| #else | ||||
| 	va_start(ap); | ||||
| #endif | ||||
| 	vsnprintf(msg, 1000, Format, ap); | ||||
| 	vsnprintf(msg, sizeof(msg), Format, ap); | ||||
| 	va_end(ap); | ||||
|  | ||||
| 	for (to=Client_First(); to != NULL; to=Client_Next(to)) { | ||||
| @@ -424,33 +521,42 @@ va_dcl | ||||
| 			if (Client_HasMode(to, 'w')) | ||||
| 				IRC_WriteStrClientPrefix(to, From, | ||||
| 							 "WALLOPS :%s", msg); | ||||
| 				break; | ||||
| 			break; | ||||
| 		case CLIENT_SERVER: | ||||
| 			if (to != Client) | ||||
| 				IRC_WriteStrClientPrefix(to, From, | ||||
| 							 "WALLOPS :%s", msg); | ||||
| 				break; | ||||
| 			break; | ||||
| 		} | ||||
| 	} | ||||
| } /* IRC_SendWallops */ | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Set a "penalty time" for an IRC client. | ||||
|  * | ||||
|  * Note: penalty times are never set for server links or remote clients! | ||||
|  * | ||||
|  * @param Client The client. | ||||
|  * @param Seconds The additional "penalty time" to enforce. | ||||
|  */ | ||||
| GLOBAL void | ||||
| IRC_SetPenalty( CLIENT *Client, time_t Seconds ) | ||||
| IRC_SetPenalty(CLIENT *Client, time_t Seconds) | ||||
| { | ||||
| 	CONN_ID c; | ||||
|  | ||||
| 	assert( Client != NULL ); | ||||
| 	assert( Seconds > 0 ); | ||||
| 	assert(Client != NULL); | ||||
| 	assert(Seconds > 0); | ||||
|  | ||||
| 	if( Client_Type( Client ) == CLIENT_SERVER ) return; | ||||
| 	if (Client_Type(Client) == CLIENT_SERVER) | ||||
| 		return; | ||||
|  | ||||
| 	c = Client_Conn( Client ); | ||||
| 	if (c > NONE) | ||||
| 		Conn_SetPenalty(c, Seconds); | ||||
| 	c = Client_Conn(Client); | ||||
| 	if (c <= NONE) | ||||
| 		return; | ||||
|  | ||||
| 	Conn_SetPenalty(c, Seconds); | ||||
| } /* IRC_SetPenalty */ | ||||
|  | ||||
|  | ||||
| static const char * | ||||
| Get_Prefix(CLIENT *Target, CLIENT *Client) | ||||
| { | ||||
| @@ -463,19 +569,22 @@ Get_Prefix(CLIENT *Target, CLIENT *Client) | ||||
| 		return Client_MaskCloaked(Client); | ||||
| } /* Get_Prefix */ | ||||
|  | ||||
|  | ||||
| static void | ||||
| cb_writeStrServersPrefixFlag(CLIENT *Client, CLIENT *Prefix, void *Buffer) | ||||
| { | ||||
| 	IRC_WriteStrClientPrefix(Client, Prefix, "%s", Buffer); | ||||
| } /* cb_writeStrServersPrefixFlag */ | ||||
|  | ||||
|  | ||||
| static bool | ||||
| /** | ||||
|  * Send a message to all marked connections using a specific prefix. | ||||
|  * | ||||
|  * @param Prefix The prefix to use. | ||||
|  * @param Buffer The message to send. | ||||
|  */ | ||||
| static void | ||||
| Send_Marked_Connections(CLIENT *Prefix, const char *Buffer) | ||||
| { | ||||
| 	CONN_ID conn; | ||||
| 	bool ok = CONNECTED; | ||||
|  | ||||
| 	assert(Prefix != NULL); | ||||
| 	assert(Buffer != NULL); | ||||
| @@ -483,17 +592,13 @@ Send_Marked_Connections(CLIENT *Prefix, const char *Buffer) | ||||
| 	conn = Conn_First(); | ||||
| 	while (conn != NONE) { | ||||
| 		if (Conn_Flag(conn) == SEND_TO_SERVER) | ||||
| 			ok = Conn_WriteStr(conn, ":%s %s", | ||||
| 					   Client_ID(Prefix), Buffer); | ||||
| 			Conn_WriteStr(conn, ":%s %s", | ||||
| 				      Client_ID(Prefix), Buffer); | ||||
| 		else if (Conn_Flag(conn) == SEND_TO_USER) | ||||
| 			ok = Conn_WriteStr(conn, ":%s %s", | ||||
| 					   Client_MaskCloaked(Prefix), Buffer); | ||||
| 		if (!ok) | ||||
| 			break; | ||||
| 		conn = Conn_Next( conn ); | ||||
| 			Conn_WriteStr(conn, ":%s %s", | ||||
| 				      Client_MaskCloaked(Prefix), Buffer); | ||||
| 		conn = Conn_Next(conn); | ||||
| 	} | ||||
| 	return ok; | ||||
| } | ||||
|  | ||||
|  | ||||
| /* -eof- */ | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user