mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-11-03 23:43:00 +00:00 
			
		
		
		
	Compare commits
	
		
			501 Commits
		
	
	
		
			rel-19-rc1
			...
			rel-21-rc2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					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 | ||
| 
						 | 
					25d35dd6f4 | ||
| 
						 | 
					a445abc10e | ||
| 
						 | 
					1342f78b09 | ||
| 
						 | 
					a0d57a6afd | ||
| 
						 | 
					c6ae353756 | ||
| 
						 | 
					12768e7a54 | ||
| 
						 | 
					35e2dcff88 | ||
| 
						 | 
					dc89e42ef5 | ||
| 
						 | 
					4a2d74c9ab | ||
| 
						 | 
					cd48b8128e | ||
| 
						 | 
					301d4915bc | ||
| 
						 | 
					8061056cec | ||
| 
						 | 
					44926b7f9f | ||
| 
						 | 
					d11a700589 | ||
| 
						 | 
					0a26079af2 | ||
| 
						 | 
					b6e49f3920 | ||
| 
						 | 
					4123118d5a | ||
| 
						 | 
					e29d198700 | ||
| 
						 | 
					6f531a3c99 | ||
| 
						 | 
					53917fa4b8 | ||
| 
						 | 
					646218e6f4 | ||
| 
						 | 
					4185c4a44a | ||
| 
						 | 
					45b0bb5aff | ||
| 
						 | 
					c7db2f8429 | ||
| 
						 | 
					f0b86e6c26 | ||
| 
						 | 
					7871a904d7 | ||
| 
						 | 
					40e3daf560 | ||
| 
						 | 
					44b7ff02fd | ||
| 
						 | 
					35ed57e6c1 | ||
| 
						 | 
					79731a57f3 | ||
| 
						 | 
					a7f37cebdc | ||
| 
						 | 
					47b99c69cc | ||
| 
						 | 
					757f3497bc | ||
| 
						 | 
					f2455cbe33 | ||
| 
						 | 
					e3f300d323 | ||
| 
						 | 
					497edbaf3e | ||
| 
						 | 
					48326e061a | ||
| 
						 | 
					84e9dcbab0 | ||
| 
						 | 
					30b32e84fe | ||
| 
						 | 
					fb92493376 | ||
| 
						 | 
					eb4f9eac0c | ||
| 
						 | 
					d7b5dd1bbf | ||
| 
						 | 
					b18e81b631 | ||
| 
						 | 
					8ff153d7d4 | ||
| 
						 | 
					32f63abb59 | ||
| 
						 | 
					23572af942 | ||
| 
						 | 
					8d9cfa157a | ||
| 
						 | 
					58abd0777b | ||
| 
						 | 
					3ee98d9f72 | ||
| 
						 | 
					b1a5ade88f | ||
| 
						 | 
					73229249d8 | ||
| 
						 | 
					e0da56fc7b | ||
| 
						 | 
					cdaaae0cb2 | ||
| 
						 | 
					c319fb8eaa | ||
| 
						 | 
					538e612a47 | ||
| 
						 | 
					9d97004a28 | ||
| 
						 | 
					87deb43012 | ||
| 
						 | 
					a9cbb375b7 | ||
| 
						 | 
					161adbb1aa | ||
| 
						 | 
					de2fa78d92 | ||
| 
						 | 
					8bede388af | ||
| 
						 | 
					c9d166747d | ||
| 
						 | 
					56cdc2175c | ||
| 
						 | 
					de453d71cb | ||
| 
						 | 
					23b07bdf50 | ||
| 
						 | 
					9ac94339dc | ||
| 
						 | 
					46b0eef721 | ||
| 
						 | 
					d3ae351236 | ||
| 
						 | 
					4790d78c98 | ||
| 
						 | 
					c66e20ce6e | ||
| 
						 | 
					343a90dc37 | ||
| 
						 | 
					09ab0704f4 | ||
| 
						 | 
					114644cdb0 | ||
| 
						 | 
					cf9f9e1f30 | ||
| 
						 | 
					19ce256a95 | ||
| 
						 | 
					eba53f652c | ||
| 
						 | 
					d8ee498a65 | ||
| 
						 | 
					e3a1a61868 | ||
| 
						 | 
					1a2bdd9e4c | ||
| 
						 | 
					384f965fba | ||
| 
						 | 
					005340c83f | ||
| 
						 | 
					d21afce2b6 | ||
| 
						 | 
					808c291c76 | ||
| 
						 | 
					62a07596d6 | ||
| 
						 | 
					b730b64bbe | ||
| 
						 | 
					3e22fc32f3 | ||
| 
						 | 
					e65a35e964 | ||
| 
						 | 
					78d189fbf7 | ||
| 
						 | 
					8cfb910441 | ||
| 
						 | 
					039a939cb8 | ||
| 
						 | 
					d7d5f4330b | ||
| 
						 | 
					79c1222896 | ||
| 
						 | 
					a3f3a1097b | ||
| 
						 | 
					d4df626d88 | ||
| 
						 | 
					eed8a4ee6e | ||
| 
						 | 
					b1b83831d1 | ||
| 
						 | 
					8e1beae4e7 | ||
| 
						 | 
					baed0618ed | ||
| 
						 | 
					e3e181f4b3 | ||
| 
						 | 
					1f2aa4da6f | ||
| 
						 | 
					fc39146f48 | ||
| 
						 | 
					192e304b94 | ||
| 
						 | 
					1744a8d145 | ||
| 
						 | 
					b12acddf4f | ||
| 
						 | 
					ef82ef4ddb | ||
| 
						 | 
					bb20aeb9bc | ||
| 
						 | 
					e9d0b2f039 | ||
| 
						 | 
					222ecbffbb | ||
| 
						 | 
					ce736fc15b | ||
| 
						 | 
					1413a4886f | ||
| 
						 | 
					cfec819f0d | ||
| 
						 | 
					107bfdc821 | ||
| 
						 | 
					5c160921ff | ||
| 
						 | 
					fe3bef55b7 | ||
| 
						 | 
					5300f0082c | ||
| 
						 | 
					85abfd84be | ||
| 
						 | 
					005ffeaa8c | ||
| 
						 | 
					5c8c6d3c70 | ||
| 
						 | 
					7eb3932d3a | ||
| 
						 | 
					ebf2f991b5 | ||
| 
						 | 
					a451cb22f1 | ||
| 
						 | 
					82bf4eb059 | ||
| 
						 | 
					d53d58fff2 | ||
| 
						 | 
					a072180c92 | ||
| 
						 | 
					0fd9a8505a | ||
| 
						 | 
					b2482b39e4 | ||
| 
						 | 
					74c7d7131f | ||
| 
						 | 
					4dd1c31dc7 | ||
| 
						 | 
					2e13e821f8 | ||
| 
						 | 
					2478c5816b | ||
| 
						 | 
					47ad9afcf3 | ||
| 
						 | 
					67e882d4bb | ||
| 
						 | 
					25c216cbdf | ||
| 
						 | 
					f5441d2170 | ||
| 
						 | 
					0d67be3f30 | ||
| 
						 | 
					f37600ee01 | ||
| 
						 | 
					f38a9035e5 | ||
| 
						 | 
					a12d6ff257 | ||
| 
						 | 
					2205227c3b | ||
| 
						 | 
					d2d867ea36 | ||
| 
						 | 
					b232ae2f17 | ||
| 
						 | 
					53b2acc00b | ||
| 
						 | 
					01b62202b2 | ||
| 
						 | 
					b68bb560e9 | ||
| 
						 | 
					21467c76f1 | ||
| 
						 | 
					33fae67579 | ||
| 
						 | 
					864015fa3f | ||
| 
						 | 
					1d3def0cc6 | ||
| 
						 | 
					e01e8f1cb6 | ||
| 
						 | 
					186ab51137 | ||
| 
						 | 
					74be904018 | ||
| 
						 | 
					298cd9a327 | ||
| 
						 | 
					414bfe65eb | ||
| 
						 | 
					c519ba9920 | ||
| 
						 | 
					fee8ff37b3 | ||
| 
						 | 
					fee591b759 | ||
| 
						 | 
					16f94546f5 | ||
| 
						 | 
					55859c1bef | ||
| 
						 | 
					bcefdef1ea | ||
| 
						 | 
					f79d41e927 | ||
| 
						 | 
					1680ea02da | ||
| 
						 | 
					1aaf54ac24 | ||
| 
						 | 
					a5984c702a | ||
| 
						 | 
					9a82304ae9 | ||
| 
						 | 
					a26e37b746 | ||
| 
						 | 
					c2b39fdede | ||
| 
						 | 
					8349a1c0d9 | ||
| 
						 | 
					360a254be0 | ||
| 
						 | 
					ab1fcebeff | ||
| 
						 | 
					a6dd2e33c2 | ||
| 
						 | 
					9d8974d509 | ||
| 
						 | 
					037b4b76df | ||
| 
						 | 
					be97fa8ab1 | ||
| 
						 | 
					164954a788 | ||
| 
						 | 
					c1d7f6216f | ||
| 
						 | 
					7df4c12da9 | ||
| 
						 | 
					0d5de60584 | ||
| 
						 | 
					4b0f526006 | ||
| 
						 | 
					4cf65b973c | ||
| 
						 | 
					160f728530 | ||
| 
						 | 
					922540306e | ||
| 
						 | 
					d48e440a72 | ||
| 
						 | 
					0709a0f050 | ||
| 
						 | 
					097c72aa65 | ||
| 
						 | 
					7b01bb833f | ||
| 
						 | 
					cfd0bddc30 | ||
| 
						 | 
					b53b12aa5f | ||
| 
						 | 
					d0bb185cf5 | ||
| 
						 | 
					49385a98b2 | ||
| 
						 | 
					b9e6cb3e55 | ||
| 
						 | 
					dffe5a9d60 | ||
| 
						 | 
					d7eb343ea0 | ||
| 
						 | 
					bf5610a3b9 | ||
| 
						 | 
					7bce6780ca | ||
| 
						 | 
					bf121ae95f | ||
| 
						 | 
					7b6b492bdd | ||
| 
						 | 
					aa7db2c0e9 | ||
| 
						 | 
					684e50f0a4 | ||
| 
						 | 
					4a90959cb5 | ||
| 
						 | 
					9b1cf420f1 | ||
| 
						 | 
					e7e47e77a3 | ||
| 
						 | 
					695df6532e | ||
| 
						 | 
					6680b536c4 | ||
| 
						 | 
					a21a7d8b66 | ||
| 
						 | 
					c0d059cd0e | ||
| 
						 | 
					7faa3ed7d6 | ||
| 
						 | 
					c9b152fa41 | ||
| 
						 | 
					ae27571414 | ||
| 
						 | 
					5e5377a063 | ||
| 
						 | 
					884c5bcff1 | ||
| 
						 | 
					3a2fcc32cd | ||
| 
						 | 
					a8aa8c6cbc | ||
| 
						 | 
					f01b09ce84 | ||
| 
						 | 
					2419a701d8 | ||
| 
						 | 
					110be707c3 | ||
| 
						 | 
					b2743af0ed | ||
| 
						 | 
					76565022fb | ||
| 
						 | 
					4602cb9891 | ||
| 
						 | 
					1d7e99531a | ||
| 
						 | 
					f0a9dbe3ad | ||
| 
						 | 
					245782897b | ||
| 
						 | 
					2327b17656 | ||
| 
						 | 
					359732af85 | ||
| 
						 | 
					1dea0d91a0 | ||
| 
						 | 
					d67d077a71 | ||
| 
						 | 
					69be7a85a2 | ||
| 
						 | 
					8ec17063a6 | ||
| 
						 | 
					da4c1ebe81 | ||
| 
						 | 
					bd3a7ccb15 | ||
| 
						 | 
					edfcc2f9d5 | ||
| 
						 | 
					ee362b3bd2 | ||
| 
						 | 
					67bd1bf34f | ||
| 
						 | 
					9f3af061cf | ||
| 
						 | 
					88c3d4896a | ||
| 
						 | 
					7b6ef3bc8e | ||
| 
						 | 
					fbaa751da8 | ||
| 
						 | 
					06b6327875 | ||
| 
						 | 
					0d9740b9fa | ||
| 
						 | 
					e9be3334d1 | ||
| 
						 | 
					0ae74ceaed | ||
| 
						 | 
					17ffda1c8a | ||
| 
						 | 
					0de11ead36 | ||
| 
						 | 
					9d486db460 | ||
| 
						 | 
					257fe922d2 | ||
| 
						 | 
					1068f88377 | ||
| 
						 | 
					9e7360e5fa | ||
| 
						 | 
					273d4bdd32 | ||
| 
						 | 
					27d244dfae | ||
| 
						 | 
					a39a1a5273 | ||
| 
						 | 
					ef392e7d37 | ||
| 
						 | 
					c38751191f | ||
| 
						 | 
					5cbdcf4f0d | ||
| 
						 | 
					3641e51109 | ||
| 
						 | 
					3f46e93ccc | 
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -4,11 +4,14 @@ aclocal.m4
 | 
			
		||||
ansi2knr.1
 | 
			
		||||
ansi2knr.c
 | 
			
		||||
ansi2knr.h
 | 
			
		||||
ar-lib
 | 
			
		||||
autom4te.cache
 | 
			
		||||
build-stamp-ngircd*
 | 
			
		||||
compile
 | 
			
		||||
config.log
 | 
			
		||||
config.status
 | 
			
		||||
configure
 | 
			
		||||
configure.ac
 | 
			
		||||
configure.lineno
 | 
			
		||||
cscope.out
 | 
			
		||||
debian
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
language: c
 | 
			
		||||
before_install:
 | 
			
		||||
  - sudo apt-get update -qq
 | 
			
		||||
  - sudo apt-get install -qq 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
 | 
			
		||||
							
								
								
									
										46
									
								
								AUTHORS
									
									
									
									
									
								
							
							
						
						
									
										46
									
								
								AUTHORS
									
									
									
									
									
								
							@@ -2,7 +2,7 @@
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
                           http://ngircd.barton.de/
 | 
			
		||||
 | 
			
		||||
               (c)2001-2012 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.
 | 
			
		||||
 | 
			
		||||
@@ -18,29 +18,41 @@ 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>
 | 
			
		||||
Christoph Biedl <ngircd.anoy@manchmal.in-ulm.de>
 | 
			
		||||
DNS <dns@rbose.org>
 | 
			
		||||
Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu>
 | 
			
		||||
David Kingston <deathking1337@aim.com>
 | 
			
		||||
Eric Grunow <egrunow@ucsd.edu>
 | 
			
		||||
Federico G. Schwindt <fgsch@lodoss.net>
 | 
			
		||||
Gabor Adam Toth <tg@tgbit.net>
 | 
			
		||||
Goetz Hoffart <goetz@hoffart.de>
 | 
			
		||||
Ilja Osthoff <i.osthoff@gmx.net>
 | 
			
		||||
Jari Aalto <jari.aalto@cante.net>
 | 
			
		||||
Neale Pickett <neale@woozle.org>
 | 
			
		||||
Rolf Eike Beer <eike@sf-mail.de>
 | 
			
		||||
Scott Perry <scperry@ucsd.edu>
 | 
			
		||||
Sean Reifschneider <jafo-rpms@tummy.com>
 | 
			
		||||
Sebastian Köhler <sebkoehler@whoami.org.uk>
 | 
			
		||||
Tassilo Schweyer <dev@welterde.de>
 | 
			
		||||
William Pitcock <nenolod@dereferenced.org>
 | 
			
		||||
xor <xorboy@gmail.com>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Code snippets
 | 
			
		||||
~~~~~~~~~~~~~
 | 
			
		||||
J. Kercheval: pattern matching functions
 | 
			
		||||
Patrick Powell, <papowell@astart.com>: snprintf()-function
 | 
			
		||||
Patrick Powell <papowell@astart.com>: snprintf()-function
 | 
			
		||||
Andrew Tridgell & Martin Pool: strl{cpy|cat}()-functions
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										443
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										443
									
								
								ChangeLog
									
									
									
									
									
								
							@@ -2,14 +2,419 @@
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
                           http://ngircd.barton.de/
 | 
			
		||||
 | 
			
		||||
               (c)2001-2012 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.
 | 
			
		||||
 | 
			
		||||
                               -- ChangeLog --
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ngIRCd Release 19
 | 
			
		||||
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) 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>.
 | 
			
		||||
 | 
			
		||||
  ngIRCd 20~rc2 (2012-12-02)
 | 
			
		||||
  - Rework cloaked hostname handling and implement the "METADATA cloakhost"
 | 
			
		||||
    subcommand: Now ngIRCd uses two fields internally, one to store the
 | 
			
		||||
    "real" hostname and one to save the "cloaked" hostname. This allows
 | 
			
		||||
    "foreign servers" (aka "IRC services") to alter the real and cloaked
 | 
			
		||||
    hostnames of clients without problems, even when the user itself issues
 | 
			
		||||
    additional "MODE +x" and "MODE -x" commands.
 | 
			
		||||
  - RPL_UMODEIS: send correct target name, even on server links.
 | 
			
		||||
  - Update platformtest.sh to follow autoconf changes and only generate
 | 
			
		||||
    the "configure" script when it is missing.
 | 
			
		||||
  - Fix the test suite to correctly execute test scripts even when stdout
 | 
			
		||||
    is redirected.
 | 
			
		||||
  - Fix some compiler warnings on NetBSD and OpenBSD.
 | 
			
		||||
 | 
			
		||||
  ngIRCd 20~rc1 (2012-11-11)
 | 
			
		||||
  - Update doc/Services.txt: describe the upcoming version of Anope 1.9.8,
 | 
			
		||||
    then including a protocol module for ngIRCd. And remove our own patches
 | 
			
		||||
    in ./contrib/Anope because they aren't supported any more ...
 | 
			
		||||
  - Implement new "METADATA" command which can be used by remote servers
 | 
			
		||||
    and IRC services to update client metadata like the client info text
 | 
			
		||||
    ("real name"), user name, and hostname, and use this command to
 | 
			
		||||
    configure an cloaked hostname (user mode "+x") on remote servers:
 | 
			
		||||
    This prevents "double cloaking" of hostnames and even cloaked
 | 
			
		||||
    hostnames are in sync on all servers supporting "METADATA" now.
 | 
			
		||||
  - Fix error message when trying to join non-predefined channels and the
 | 
			
		||||
    "PredefChannelsOnly" configuration option is set.
 | 
			
		||||
  - Implement new IRC "SVSNICK" command to allow remote servers (and IRC
 | 
			
		||||
    services) to change nicknames of already registered users. The SVSNICK
 | 
			
		||||
    command itself doesn't change the nickname, but it becomes forwarded
 | 
			
		||||
    to the server to which the user is connected to. And then this server
 | 
			
		||||
    initiates the real nickname changing using regular NICK commands.
 | 
			
		||||
    This allows to run mixed networks with old servers not supporting the
 | 
			
		||||
    SVSNICK command, because SVSNICK commands for nicknames on such servers
 | 
			
		||||
    are silently ignored and don't cause a desynchronization of the network.
 | 
			
		||||
  - Make server reconnect time a little bit more random, so that two
 | 
			
		||||
    servers trying to connect to each other asynchronously don't try this
 | 
			
		||||
    in exactly the same time periods and kick each other off ...
 | 
			
		||||
  - Don't accept connections for servers already being linked: there was a
 | 
			
		||||
    time frame that could result in one connection overwriting the other,
 | 
			
		||||
    e. g. the incoming connection overwriting the status of the outgoing
 | 
			
		||||
    one. And this could lead to all kind of weirdness (even crashes!) later
 | 
			
		||||
    on: now such incoming connections are dropped.
 | 
			
		||||
  - New configuration option "MaxListSize" to configure the maximum number
 | 
			
		||||
    of channels returned by a LIST command. The default is 100, as before.
 | 
			
		||||
  - Implement user mode "b", "block messages": when a user has set mode "b",
 | 
			
		||||
    all private messages and notices to this user are blocked if they don't
 | 
			
		||||
    originate from a registered user, an IRC Op, server or service. The
 | 
			
		||||
    originator gets an error numeric sent back in this case,
 | 
			
		||||
    ERR_NONONREG_MSG (486), which is used by UnrealIRCd, too. (Closes #144)
 | 
			
		||||
  - WHOIS: Not only show RPL_WHOISHOST_MSG to local IRC operators, but show
 | 
			
		||||
    it to all IRC operators in the network. And don't show it to anybody if
 | 
			
		||||
    the "more privacy" configuration option is enabled. (Closes #134)
 | 
			
		||||
  - Test suite: make expect scripts more verbose displaying dots for each
 | 
			
		||||
    reply of the server that it is waiting for.
 | 
			
		||||
  - WHOIS: Implement numeric RPL_WHOISMODES_MSG (379) and show user modes in
 | 
			
		||||
    the reply of the WHOIS command for the user himself or, if MorePrivacy
 | 
			
		||||
    isn't set, for request initiated by an IRC operator. (Closes #129)
 | 
			
		||||
  - Implement channel mode "V" (invite disallow): If the new channel mode
 | 
			
		||||
    "V" is set, the INVITE command becomes invalid and all clients get the
 | 
			
		||||
    new ERR_NOINVITE_MSG (518) reply. (Closes #143)
 | 
			
		||||
  - KICK-protect IRC services.
 | 
			
		||||
  - Implement channel mode "Q" and user mode "q": Both modes protect users
 | 
			
		||||
    from channel kicks: only IRC operators and servers can kick users having
 | 
			
		||||
    mode "q" or in channels with mode "Q". (Closes #141)
 | 
			
		||||
  - Debian: require "telnet" or "telnet-ssl" for building and enable
 | 
			
		||||
    CHARCONV in ngircd-full[-dbg] variants.
 | 
			
		||||
  - Send RPL_REHASHING (382) numeric if a REHASH command was accepted.
 | 
			
		||||
  - Fix spelling and variable names in some log messages.
 | 
			
		||||
  - Allow users to "cloak" their hostname only when the configuration
 | 
			
		||||
    variable "CloakHostModeX" (introduced in 19.2) is set. Otherwise, only
 | 
			
		||||
    IRC operators, other servers, and services are allowed to set the user
 | 
			
		||||
    mode "+x": this prevents regular users from changing their hostmask to
 | 
			
		||||
    the name of the IRC server itself, which confused quite a few people ;-)
 | 
			
		||||
    (Closes #133)
 | 
			
		||||
  - New configuration option "OperChanPAutoOp": If disabled, IRC operators
 | 
			
		||||
    don't become channel operators in persistent channels when joining.
 | 
			
		||||
    Enabled by default, which has been the behavior of ngIRCd up to this
 | 
			
		||||
    patch. (Closes #135)
 | 
			
		||||
  - Allow IRC operators to see secret (+s) channels in LIST command as long
 | 
			
		||||
    as the "MorePrivacy" configuration option isn't enabled in the
 | 
			
		||||
    configuration file. (Closes #136)
 | 
			
		||||
  - Enhance build system: Support new (>=1.12) and old (<=1.11) GNU automake
 | 
			
		||||
    versions, update checks for required and optional features, enable
 | 
			
		||||
    colored test output of automake (if available), rename configure.in to
 | 
			
		||||
    more modern configure.ac, include .mailmap and all build-system files in
 | 
			
		||||
    distribution archives and no longer require a GIT tree to detect the
 | 
			
		||||
    correct version string.
 | 
			
		||||
  - Update documentation: add doc/Contributing.txt and include version
 | 
			
		||||
    numbers in doc/Modes.txt.
 | 
			
		||||
  - Free all listen ports on initialization: now listen ports can be
 | 
			
		||||
    reconfigured on runtime using a configuration reload.
 | 
			
		||||
  - Initialize SSL when needed only, and disable SSL on errors.
 | 
			
		||||
  - Implement new (optional) IRC+ "CHARCONV" command to set a client
 | 
			
		||||
    character set that the server translates all messages to/from UTF-8.
 | 
			
		||||
    This feature requires the "libiconv" library and must be enabled using
 | 
			
		||||
    the new "--with-iconv" option of the ./configure script. See
 | 
			
		||||
    doc/Protocol.txt for details. (Closes #109)
 | 
			
		||||
  - Allow limited punctuation in usernames, for better PAM integration.
 | 
			
		||||
  - Correctly re-initialize signal handlers on RESTART commands.
 | 
			
		||||
  - Show a warning on startup if the configuration file is not a full path:
 | 
			
		||||
    ngIRCd is a long-running process and changes its working directory to
 | 
			
		||||
    "/" to not block mounted filesystems and the like when running as daemon
 | 
			
		||||
    ("not in the foreground"); therefore the path to the configuration file
 | 
			
		||||
    must be relative to "/" (or the chroot() directory), which basically is
 | 
			
		||||
    "not relative", to ensure that "kill -HUP" and the "REHASH" command work
 | 
			
		||||
    as expected later on. (Closes #127)
 | 
			
		||||
  - Make the "&SERVER" channel definable in a [Channel] configuration block,
 | 
			
		||||
    which enables server operators to overwrite the built-in topic and
 | 
			
		||||
    channel modes. (Closes #131)
 | 
			
		||||
  - Don't limit list size of "WHO #channel" commands, because it makes no
 | 
			
		||||
    sense to not return all the users in that channel, so I removed the
 | 
			
		||||
    check. But if there are more than MAX_RPL_WHO(25) replies, the client
 | 
			
		||||
    requesting the list will be "penalized" one second more, then 2 in
 | 
			
		||||
    total. (Closes #125)
 | 
			
		||||
  - Make ngIRCd buildable using the kqueue() IO interface on FreeBSD 4.x.
 | 
			
		||||
  - Fix the "NoticeAuth" configuration option when using SSL connections and
 | 
			
		||||
    enhance the message to show the hostname and IDENT reply of the client.
 | 
			
		||||
  - Introduce numeric RPL_HOSTHIDDEN_MSG (396): This numeric is sent to the
 | 
			
		||||
    client each time it changes its displayed hostname using "MODE +/-x",
 | 
			
		||||
    and if "CloakHost" is set right after the MOTD has been sent.
 | 
			
		||||
  - Fix USERHOST not displaying the correctly cloaked hostname.
 | 
			
		||||
  - Implement user mode "B" ("Bot flag"): it is settable and unsettable by
 | 
			
		||||
    every (non-restricted) client. This is how Unreal and InspIRCd do
 | 
			
		||||
    behave, and so do we :-)
 | 
			
		||||
  - Dynamically allocate memory for connection passwords: This a) saves
 | 
			
		||||
    memory for clients not using passwords at all and b) allows for
 | 
			
		||||
    "arbitrarily" long passwords.
 | 
			
		||||
  - Implement channel mode "M": Only the server, identified users and IRC
 | 
			
		||||
    operators are able to talk in such a channel.
 | 
			
		||||
  - Block nicknames that are reserved for services and are defined using the
 | 
			
		||||
    configuration variable "ServiceMask" in "Server" blocks; And this
 | 
			
		||||
    variable now can handle more than one mask separated by commas.
 | 
			
		||||
  - Now "make uninstall" removes the installed "ngircd.conf" file, if it is
 | 
			
		||||
    still equal to our "sample-ngircd.conf" file and therefore hasn't been
 | 
			
		||||
    modified by the user. If it has been modified, it isn't removed and a
 | 
			
		||||
    notice is displayed to the user. And "make install" now displays a
 | 
			
		||||
    message when no ngircd.conf file exists and the "sample-ngircd.conf"
 | 
			
		||||
    file will be installed as a starting point.
 | 
			
		||||
  - Add contrib/ngircd.service, a systemd service file for ngircd.
 | 
			
		||||
  - Implemented XOP channel user modes: "Half Op" ("+h", prefix "%") can set
 | 
			
		||||
    the channel modes +imntvIbek and kick all +v and normal users; "Admin"
 | 
			
		||||
    ("+a", prefix "&") can set channel modes +imntvIbekoRsz and kick all +o,
 | 
			
		||||
    +h, +v and normal users; and "Owner" ("+q", prefix "~") can set channel
 | 
			
		||||
    modes +imntvIbekoRsz and kick all +a, +o, +h, +v and normal users.
 | 
			
		||||
  - Implement hashed cloaked hostnames for both the "CloakHost" and
 | 
			
		||||
    "CloakHostModeX" configuration options: now the admin can use the new
 | 
			
		||||
    '%x' placeholder to insert a hashed version of the clients hostname,
 | 
			
		||||
    and the new configuration option "CloakHostSalt" defines the salt for
 | 
			
		||||
    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)
 | 
			
		||||
 | 
			
		||||
  - doc/Capabilities.txt: document "multi-prefix" capability
 | 
			
		||||
 | 
			
		||||
  ngIRCd 19.2~rc1 (2012-06-13)
 | 
			
		||||
  - New configuration option "CloakHostModeX" to configure the hostname
 | 
			
		||||
    that gets used for IRC clients which have user mode "+x" enabled.
 | 
			
		||||
    Up to now, the name of the IRC server itself has been used for this,
 | 
			
		||||
    which still is the default when "CloakHostModeX" isn't set.
 | 
			
		||||
  - Correctly handle asynchronously re-established server links: a race
 | 
			
		||||
    condition could let the daemon loose track of an already re-established
 | 
			
		||||
    incoming server link while preparing its own outgoing connection.
 | 
			
		||||
    Peers that both try to connect each other could have been affected.
 | 
			
		||||
  - Log a debug message when SIGUSR2 is handled in debug mode.
 | 
			
		||||
  - Only allow alphanumeric characters in user-supplied user names of
 | 
			
		||||
    USER command and IDENT replies.
 | 
			
		||||
  - Change wording of "TLS initialized" message to make it more consistent.
 | 
			
		||||
  - Don't leak file descriptors on error path when creating "PID files".
 | 
			
		||||
  - Add missing mode "r" to CHANMODES in 005 "ISUPPORT" numeric.
 | 
			
		||||
  - Update doc/Modes.txt and doc/Platforms.txt documents.
 | 
			
		||||
  - contrib/platformtest.sh: correctly detect Open64 C compiler and handle
 | 
			
		||||
    "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
 | 
			
		||||
    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)
 | 
			
		||||
 | 
			
		||||
  - Fix gcc warning (v4.6.3), initialize "list" variable to NULL.
 | 
			
		||||
  - Fix typos: "recieved" -> "received", "Please not" -> "Please note",
 | 
			
		||||
    and fix lintian(1) warning ""hyphen-used-as-minus-sign", too.
 | 
			
		||||
  - Really include _all_ patches to build the Anope module into the
 | 
			
		||||
    distribution archive ... ooops!
 | 
			
		||||
  - 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)
 | 
			
		||||
 | 
			
		||||
  - Update build system: bump config.guess and config.sub files used by
 | 
			
		||||
    GNU autoconf/automake to recent versions.
 | 
			
		||||
  - Fix configuration file parser: don't accept "[SSL]" blocks in the
 | 
			
		||||
    configuration file when no SSL support is built in ngIRCd.
 | 
			
		||||
  - Fix building ngIRCd with old gcc versions (e. g. 2.7.2).
 | 
			
		||||
  - Correctly re-open syslog logging after reading of configuration
 | 
			
		||||
    file: Syslog logging has been initialized before reading the
 | 
			
		||||
    configuration, so ngIRCd always used the default facility and ignored
 | 
			
		||||
    the "SyslogFacility" configuration option ...
 | 
			
		||||
    Thanks to Patrik Schindler for reporting this issue!
 | 
			
		||||
 | 
			
		||||
  ngIRCd 19~rc1 (2012-02-12)
 | 
			
		||||
  - Enhance command limits for server links: the limit now is dependent
 | 
			
		||||
@@ -18,7 +423,7 @@ ngIRCd Release 19
 | 
			
		||||
  - Log more information about server synchronization.
 | 
			
		||||
  - Update preliminary ngIRCd protocol module for Anope 1.9.6, which now
 | 
			
		||||
    is the only supported version.
 | 
			
		||||
  - New numeric RPL_WHOISHOST_MSG(378), which returns the DNS hostname
 | 
			
		||||
  - New numeric RPL_WHOISHOST_MSG(378), which returns the DNS host name
 | 
			
		||||
    (if available) and the IP address of a client in the WHOIS reply.
 | 
			
		||||
    Only the user itself and local IRC operators get this numeric.
 | 
			
		||||
  - Implement channel exception list (mode 'e'). This allows a channel
 | 
			
		||||
@@ -31,7 +436,7 @@ ngIRCd Release 19
 | 
			
		||||
    and receiver are on the same channel. This prevents private flooding
 | 
			
		||||
    by completely unknown clients.
 | 
			
		||||
  - New RPL_WHOISREGNICK_MSG(307) numeric in WHOIS command replies: it
 | 
			
		||||
    indicates if a nick name is registered (if user mode 'R' set).
 | 
			
		||||
    indicates if a nickname is registered (if user mode 'R' set).
 | 
			
		||||
  - Limit channel invite, ban, and exception lists to 50 entries and fix
 | 
			
		||||
    duplicate check and error messages when adding already listed entries
 | 
			
		||||
    or deleting no (longer) existing ones.
 | 
			
		||||
@@ -64,7 +469,7 @@ ngIRCd Release 19
 | 
			
		||||
    commands: this reduces the possibility of flooding channels with
 | 
			
		||||
    commands like "PRIVMSG/NOTICE #a,#n,#c,... :message" a little bit.
 | 
			
		||||
    Problem noticed by Cahata, thanks!
 | 
			
		||||
  - Display correct error message when "Server{UID|GID}" variabe in the
 | 
			
		||||
  - Display correct error message when "Server{UID|GID}" variable in the
 | 
			
		||||
    configuration file is invalid (not a number and no existing user).
 | 
			
		||||
  - Update Copyright notices for 2012 :-)
 | 
			
		||||
  - JOIN command: don't stop handling of channel lists when a single
 | 
			
		||||
@@ -72,7 +477,7 @@ ngIRCd Release 19
 | 
			
		||||
    limit reached), but report an error and continue. And don't check
 | 
			
		||||
    the channel limit and don't report with "too many channels" when
 | 
			
		||||
    trying to join a channel that the client already is a member of.
 | 
			
		||||
  - ISON command: reply with the correct upper-/lowercase nick names.
 | 
			
		||||
  - ISON command: reply with the correct upper-/lowercase nicknames.
 | 
			
		||||
  - New configuration option "PAMIsOptional": when set, clients not
 | 
			
		||||
    sending a password are still allowed to connect: they won't become
 | 
			
		||||
    "identified" and keep the "~" character prepended to their supplied
 | 
			
		||||
@@ -106,8 +511,8 @@ ngIRCd Release 19
 | 
			
		||||
  - ./configure: Fix logic and quoting of poll() detection code: only use
 | 
			
		||||
    poll() when poll.h exists as well.
 | 
			
		||||
  - Suppress 'Can't create pre-defined channel: invalid name: ""' message.
 | 
			
		||||
  - whois-test: handle local hostname = "localhost.localdomain" using the
 | 
			
		||||
    pattern "localhost*" for valid local hostnames.
 | 
			
		||||
  - whois-test: handle local host name = "localhost.localdomain" using the
 | 
			
		||||
    pattern "localhost*" for valid local host names.
 | 
			
		||||
  - sample-ngircd.conf: show correct default for "PAM" variable: The
 | 
			
		||||
    default of "PAM" is "yes" when ngIRCd has been configured to use it,
 | 
			
		||||
    so show the correct default value in the sample configuration file.
 | 
			
		||||
@@ -119,7 +524,7 @@ ngIRCd Release 19
 | 
			
		||||
    The bug has been introduced starting with ngIRCd 17 ... :-(
 | 
			
		||||
    (commit ID 6ebb31ab35e)
 | 
			
		||||
  - Added doc/Modes.txt: document modes supported by ngIRCd.
 | 
			
		||||
  - Implement user mode "R": indicates that the nick name of this user
 | 
			
		||||
  - Implement user mode "R": indicates that the nickname of this user
 | 
			
		||||
    is "registered". This mode isn't handled by ngIRCd itself, but must
 | 
			
		||||
    be set and unset by IRC services like Anope.
 | 
			
		||||
  - Implement channel mode "R": only registered users (having the user
 | 
			
		||||
@@ -137,7 +542,7 @@ ngIRCd Release 19
 | 
			
		||||
  - Handle channel user modes 'a', 'h', and 'q' from remote servers.
 | 
			
		||||
    These channel user modes aren't used for anything at the moment,
 | 
			
		||||
    but ngIRCd knows that these three modes are "channel user modes"
 | 
			
		||||
    and not "channel modes", that is that these modes take an "nick name"
 | 
			
		||||
    and not "channel modes", that is that these modes take an "nickname"
 | 
			
		||||
    argument. Like unknown user and channel modes, these modes are saved
 | 
			
		||||
    and forwarded to other servers, but ignored otherwise.
 | 
			
		||||
  - Correctly inform clients when other servers change their user modes.
 | 
			
		||||
@@ -221,10 +626,10 @@ ngIRCd Release 18 (2011-07-10)
 | 
			
		||||
    variable description.
 | 
			
		||||
  - Don't use "the.net" in sample-ngircd.conf, use "example.net".
 | 
			
		||||
  - Terminate incoming connections on HTTP commands "GET" and "POST".
 | 
			
		||||
  - New configuration option "CloakHost": when set, this hostname is used for
 | 
			
		||||
    every client instead of the real DNS hostname (or IP address).
 | 
			
		||||
  - New configuration option "CloakHost": when set, this host name is used for
 | 
			
		||||
    every client instead of the real DNS host name (or IP address).
 | 
			
		||||
  - New configuration option "CloakUserToNick": when enabled, ngIRCd sets
 | 
			
		||||
    every clients' user name to their nick name and hides the user name
 | 
			
		||||
    every clients' user name to their nickname and hides the user name
 | 
			
		||||
    supplied by the IRC client.
 | 
			
		||||
  - doc/Protocol.txt: Update description of the CHANINFO and WEBIRC commands.
 | 
			
		||||
  - Doxygen'ify (document) much more source files; code cleanup ...
 | 
			
		||||
@@ -327,7 +732,7 @@ ngIRCd Release 17 (2010-11-07)
 | 
			
		||||
  - configure script: correctly indent IPv6 yes/no summary output.
 | 
			
		||||
  - Don't reset My_Connections[Idx].lastping when reading data, so the
 | 
			
		||||
    client lag debug-output is working again.
 | 
			
		||||
  - Implement user mode "x": hostname cloaking (closes: #102).
 | 
			
		||||
  - Implement user mode "x": host name cloaking (closes: #102).
 | 
			
		||||
  - Make configure switch "--docdir" work (closes: #108).
 | 
			
		||||
  - Reformat and update FAQ.txt a little bit.
 | 
			
		||||
  - INSTALL: mention SSL, IPv6, and changed handling of MotdFile.
 | 
			
		||||
@@ -432,7 +837,7 @@ ngIRCd Release 14.1 (2009-05-05)
 | 
			
		||||
  - Allow ping timeout quit messages to show the timeout value.
 | 
			
		||||
  - Fix error handling on compressed links.
 | 
			
		||||
  - Fix server list announcement.
 | 
			
		||||
  - Do not remove hostnames from info text.
 | 
			
		||||
  - Do not remove host names from info text.
 | 
			
		||||
 | 
			
		||||
ngIRCd Release 14 (2009-04-20)
 | 
			
		||||
 | 
			
		||||
@@ -528,7 +933,7 @@ ngIRCd 0.12.0 (2008-05-13)
 | 
			
		||||
  - RPL_WHOREPLY messages generated by IRC_WHO didn't include flags (*,@,+).
 | 
			
		||||
    (Dana Dahlstrom)
 | 
			
		||||
  - IRC_WHO now supports search patterns and will test this against user
 | 
			
		||||
    nickname/servername/hostname, etc. as required by RFC 2812, Section 3.6.1.
 | 
			
		||||
    nickname/server name/host name, etc. as required by RFC 2812, Section 3.6.1.
 | 
			
		||||
    (reported by Dana Dahlstrom)
 | 
			
		||||
  - Add test cases for "WHO" command. (Dana Dahlstrom)
 | 
			
		||||
  - Implement RFC 2812 handling of "0" argument to 'JOIN': must be treated
 | 
			
		||||
@@ -551,12 +956,12 @@ ngIRCd 0.11.0 (2008-01-15)
 | 
			
		||||
    ngircd to crash [from HEAD]. (CVE-2008-0285)
 | 
			
		||||
  
 | 
			
		||||
  ngIRCd 0.11.0-pre1 (2008-01-02)
 | 
			
		||||
  - Use dotted-decimal IP address if hostname is >= 64.
 | 
			
		||||
  - Use dotted-decimal IP address if host name is >= 64.
 | 
			
		||||
  - Add support for /STAT u (server uptime) command.
 | 
			
		||||
  - New [Server] configuration Option "Bind" allows to specify
 | 
			
		||||
    the source IP address to use when connecting to remote server.
 | 
			
		||||
  - New configuration option "MaxNickLength" to specify the allowed maximum
 | 
			
		||||
    length of user nick names. Note: must be unique in an IRC network!
 | 
			
		||||
    length of user nicknames. Note: must be unique in an IRC network!
 | 
			
		||||
  - Enhanced the IRC+ protocol to support an enhanced "server handshake" and
 | 
			
		||||
    enable server to recognize numeric 005 (ISUPPORT) and 376 (ENDOFMOTD).
 | 
			
		||||
    See doc/Protocol.txt for details.
 | 
			
		||||
@@ -777,7 +1182,7 @@ ngIRCd 0.8.0 (2004-06-26)
 | 
			
		||||
    original ircd exactly: the unnecessary but missing ":" before the last
 | 
			
		||||
    parameter has been added.
 | 
			
		||||
  - Fixed TRACE: don't output "Serv" lines for ourself; display more info.
 | 
			
		||||
  - Results of the resolver (hostnames and IDENT names) are discarded after
 | 
			
		||||
  - Results of the resolver (host names and IDENT names) are discarded after
 | 
			
		||||
    the client is successfully registered with the server.
 | 
			
		||||
  - Better logging while establishing and shutting down connections.
 | 
			
		||||
  - The type of service (TOS) of all sockets is set to "interactive" now.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										58
									
								
								INSTALL
									
									
									
									
									
								
							
							
						
						
									
										58
									
								
								INSTALL
									
									
									
									
									
								
							@@ -2,7 +2,7 @@
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
                           http://ngircd.barton.de/
 | 
			
		||||
 | 
			
		||||
               (c)2001-2012 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.
 | 
			
		||||
 | 
			
		||||
@@ -12,6 +12,25 @@
 | 
			
		||||
I. Upgrade Information
 | 
			
		||||
~~~~~~~~~~~~~~~~~~~~~~
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
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 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
 | 
			
		||||
 | 
			
		||||
- Support for ZeroConf/Bonjour/Rendezvous service registration has been
 | 
			
		||||
@@ -93,7 +112,8 @@ automake ("configure") should be no problem.
 | 
			
		||||
The normal installation procedure after getting (and expanding) the source
 | 
			
		||||
files (using a distribution archive or GIT) is as following:
 | 
			
		||||
 | 
			
		||||
  1) ./autogen.sh	[only necessary when using GIT]
 | 
			
		||||
  0) Satisfy prerequisites
 | 
			
		||||
  1) ./autogen.sh  [only necessary when using GIT]
 | 
			
		||||
  2) ./configure
 | 
			
		||||
  3) make
 | 
			
		||||
  4) make install
 | 
			
		||||
@@ -114,6 +134,30 @@ possible options will be installed there. You'll find its template in the
 | 
			
		||||
doc/ directory: sample-ngircd.conf.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
0): Satisfy prerequisites
 | 
			
		||||
 | 
			
		||||
When building from source, you'll need some other software to build ngIRCd:
 | 
			
		||||
for example a working C compiler, make tool, GNU automake and autoconf (only
 | 
			
		||||
when not using a distribution archive), and a few libraries depending on the
 | 
			
		||||
features you want to compile in (like IDENT support, SSL, and PAM).
 | 
			
		||||
 | 
			
		||||
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:
 | 
			
		||||
 | 
			
		||||
  yum install \
 | 
			
		||||
    autoconf automake expect gcc glibc-devel gnutls-devel \
 | 
			
		||||
    libident-devel make pam-devel tcp_wrappers-devel telnet zlib-devel
 | 
			
		||||
 | 
			
		||||
* Debian / Ubuntu based distributions:
 | 
			
		||||
 | 
			
		||||
  apt-get install \
 | 
			
		||||
    autoconf automake build-essential expect libgnutls-dev \
 | 
			
		||||
    libident-dev libpam-dev libwrap0-dev libz-dev telnet
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
1): "autogen.sh"
 | 
			
		||||
 | 
			
		||||
The first step, autogen.sh, is only necessary if the configure-script isn't
 | 
			
		||||
@@ -124,10 +168,14 @@ 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 (use recent versions! autoconf 2.53 and
 | 
			
		||||
automake 1.6.1 are known to work).
 | 
			
		||||
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
 | 
			
		||||
generated Makefile's! Stick with automake 1.11.x for this purpose ...
 | 
			
		||||
So automake 1.11.x and autoconf 2.67+ is recommended.
 | 
			
		||||
 | 
			
		||||
Again: "end users" do not need this step!
 | 
			
		||||
Again: "end users" do not need this step and neither need GNU autoconf nor GNU
 | 
			
		||||
automake at all!
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
2): "./configure"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										30
									
								
								Makefile.am
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								Makefile.am
									
									
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
			
		||||
#
 | 
			
		||||
# ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
# Copyright (c)2001-2011 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
 | 
			
		||||
@@ -13,24 +13,25 @@ AUTOMAKE_OPTIONS = gnu
 | 
			
		||||
 | 
			
		||||
SUBDIRS = doc src man contrib
 | 
			
		||||
 | 
			
		||||
clean-local:
 | 
			
		||||
EXTRA_DIST = autogen.sh configure.ng .mailmap
 | 
			
		||||
 | 
			
		||||
clean-local: osxpkg-clean
 | 
			
		||||
	rm -f build-stamp*
 | 
			
		||||
	rm -rf ngircd.dest
 | 
			
		||||
 | 
			
		||||
maintainer-clean-local:
 | 
			
		||||
	rm -rf autom4te.cache
 | 
			
		||||
	rm -f Makefile.in Makefile aclocal.m4 configure
 | 
			
		||||
	rm -f mkinstalldirs missing depcomp install-sh
 | 
			
		||||
	rm -f Makefile.in Makefile aclocal.m4 configure configure.ac
 | 
			
		||||
	rm -f ar-lib mkinstalldirs missing depcomp install-sh
 | 
			
		||||
	rm -f config.log debian
 | 
			
		||||
 | 
			
		||||
testsuite:
 | 
			
		||||
	make -C src/testsuite check
 | 
			
		||||
	cd src/testsuite && make check
 | 
			
		||||
 | 
			
		||||
lint:
 | 
			
		||||
	make -C src/ngircd lint
 | 
			
		||||
	cd src/ngircd && make lint
 | 
			
		||||
 | 
			
		||||
srcdoc:
 | 
			
		||||
	make -C doc srcdoc
 | 
			
		||||
	cd doc && make srcdoc
 | 
			
		||||
 | 
			
		||||
have-xcodebuild:
 | 
			
		||||
	@xcodebuild -project contrib/MacOSX/ngIRCd.xcodeproj -list \
 | 
			
		||||
@@ -60,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:
 | 
			
		||||
	[ ! -e 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
 | 
			
		||||
@@ -80,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-
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										225
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										225
									
								
								NEWS
									
									
									
									
									
								
							@@ -2,18 +2,219 @@
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
                           http://ngircd.barton.de/
 | 
			
		||||
 | 
			
		||||
               (c)2001-2012 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.
 | 
			
		||||
 | 
			
		||||
                                  -- NEWS --
 | 
			
		||||
 | 
			
		||||
ngIRCd Release 19
 | 
			
		||||
 | 
			
		||||
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) 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>.
 | 
			
		||||
 | 
			
		||||
  ngIRCd 20~rc2 (2012-12-02)
 | 
			
		||||
  - Rework cloaked hostname handling and implement the "METADATA cloakhost"
 | 
			
		||||
    subcommand: Now ngIRCd uses two fields internally, one to store the
 | 
			
		||||
    "real" hostname and one to save the "cloaked" hostname. This allows
 | 
			
		||||
    "foreign servers" (aka "IRC services") to alter the real and cloaked
 | 
			
		||||
    hostnames of clients without problems, even when the user itself issues
 | 
			
		||||
    additional "MODE +x" and "MODE -x" commands.
 | 
			
		||||
 | 
			
		||||
  ngIRCd 20~rc1 (2012-11-11)
 | 
			
		||||
  - Update doc/Services.txt: describe the upcoming version of Anope 1.9.8,
 | 
			
		||||
    then including a protocol module for ngIRCd. And remove our own patches
 | 
			
		||||
    in ./contrib/Anope because they aren't supported any more ...
 | 
			
		||||
  - Implement new "METADATA" command which can be used by remote servers
 | 
			
		||||
    and IRC services to update client metadata like the client info text
 | 
			
		||||
    ("real name"), user name, and hostname, and use this command to
 | 
			
		||||
    configure an cloaked hostname (user mode "+x") on remote servers:
 | 
			
		||||
    This prevents "double cloaking" of hostnames and even cloaked
 | 
			
		||||
    hostnames are in sync on all servers supporting "METADATA" now.
 | 
			
		||||
  - Implement new IRC "SVSNICK" command to allow remote servers (and IRC
 | 
			
		||||
    services) to change nicknames of already registered users. The SVSNICK
 | 
			
		||||
    command itself doesn't change the nickname, but it becomes forwarded
 | 
			
		||||
    to the server to which the user is connected to. And then this server
 | 
			
		||||
    initiates the real nickname changing using regular NICK commands.
 | 
			
		||||
    This allows to run mixed networks with old servers not supporting the
 | 
			
		||||
    SVSNICK command, because SVSNICK commands for nicknames on such servers
 | 
			
		||||
    are silently ignored and don't cause a desynchronization of the network.
 | 
			
		||||
  - New configuration option "MaxListSize" to configure the maximum number
 | 
			
		||||
    of channels returned by a LIST command. The default is 100, as before.
 | 
			
		||||
  - Implement user mode "b", "block messages": when a user has set mode "b",
 | 
			
		||||
    all private messages and notices to this user are blocked if they don't
 | 
			
		||||
    originate from a registered user, an IRC Op, server or service. The
 | 
			
		||||
    originator gets an error numeric sent back in this case,
 | 
			
		||||
    ERR_NONONREG_MSG (486), which is used by UnrealIRCd, too. (Closes #144)
 | 
			
		||||
  - Implement channel mode "V" (invite disallow): If the new channel mode
 | 
			
		||||
    "V" is set, the INVITE command becomes invalid and all clients get the
 | 
			
		||||
    new ERR_NOINVITE_MSG (518) reply. (Closes #143)
 | 
			
		||||
  - Implement channel mode "Q" and user mode "q": Both modes protect users
 | 
			
		||||
    from channel kicks: only IRC operators and servers can kick users having
 | 
			
		||||
    mode "q" or in channels with mode "Q". (Closes #141)
 | 
			
		||||
  - Allow users to "cloak" their hostname only when the configuration
 | 
			
		||||
    variable "CloakHostModeX" (introduced in 19.2) is set. Otherwise, only
 | 
			
		||||
    IRC operators, other servers, and services are allowed to set the user
 | 
			
		||||
    mode "+x": this prevents regular users from changing their hostmask to
 | 
			
		||||
    the name of the IRC server itself, which confused quite a few people ;-)
 | 
			
		||||
    (Closes #133)
 | 
			
		||||
  - New configuration option "OperChanPAutoOp": If disabled, IRC operators
 | 
			
		||||
    don't become channel operators in persistent channels when joining.
 | 
			
		||||
    Enabled by default, which has been the behavior of ngIRCd up to this
 | 
			
		||||
    patch. (Closes #135)
 | 
			
		||||
  - Allow IRC operators to see secret (+s) channels in LIST command as long
 | 
			
		||||
    as the "MorePrivacy" configuration option isn't enabled in the
 | 
			
		||||
    configuration file. (Closes #136)
 | 
			
		||||
  - Implement new (optional) IRC+ "CHARCONV" command to set a client
 | 
			
		||||
    character set that the server translates all messages to/from UTF-8.
 | 
			
		||||
    This feature requires the "libiconv" library and must be enabled using
 | 
			
		||||
    the new "--with-iconv" option of the ./configure script. See
 | 
			
		||||
    doc/Protocol.txt for details. (Closes #109)
 | 
			
		||||
  - Implement user mode "B" ("Bot flag"): it is settable and unsettable by
 | 
			
		||||
    every (non-restricted) client. This is how Unreal and InspIRCd do
 | 
			
		||||
    behave, and so do we :-)
 | 
			
		||||
  - Implement channel mode "M": Only the server, identified users and IRC
 | 
			
		||||
    operators are able to talk in such a channel.
 | 
			
		||||
  - Block nicknames that are reserved for services and are defined using the
 | 
			
		||||
    configuration variable "ServiceMask" in "Server" blocks; And this
 | 
			
		||||
    variable now can handle more than one mask separated by commas.
 | 
			
		||||
  - Implemented XOP channel user modes: "Half Op" ("+h", prefix "%") can set
 | 
			
		||||
    the channel modes +imntvIbek and kick all +v and normal users; "Admin"
 | 
			
		||||
    ("+a", prefix "&") can set channel modes +imntvIbekoRsz and kick all +o,
 | 
			
		||||
    +h, +v and normal users; and "Owner" ("+q", prefix "~") can set channel
 | 
			
		||||
    modes +imntvIbekoRsz and kick all +a, +o, +h, +v and normal users.
 | 
			
		||||
  - Implement hashed cloaked hostnames for both the "CloakHost" and
 | 
			
		||||
    "CloakHostModeX" configuration options: now the admin can use the new
 | 
			
		||||
    '%x' placeholder to insert a hashed version of the clients hostname,
 | 
			
		||||
    and the new configuration option "CloakHostSalt" defines the salt for
 | 
			
		||||
    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~rc1 (2012-06-13)
 | 
			
		||||
  - New configuration option "CloakHostModeX" to configure the hostname
 | 
			
		||||
    that gets used for IRC clients which have user mode "+x" enabled.
 | 
			
		||||
    Up to now, the name of the IRC server itself has been used for this,
 | 
			
		||||
    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
 | 
			
		||||
    handlers to return more than one "class prefix" to the client.
 | 
			
		||||
 | 
			
		||||
ngIRCd Release 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~rc1 (2012-02-12)
 | 
			
		||||
  - Update preliminary ngIRCd protocol module for Anope 1.9.6, which now
 | 
			
		||||
    is the only supported version.
 | 
			
		||||
  - New numeric RPL_WHOISHOST_MSG(378), which returns the DNS hostname
 | 
			
		||||
  - New numeric RPL_WHOISHOST_MSG(378), which returns the DNS host name
 | 
			
		||||
    (if available) and the IP address of a client in the WHOIS reply.
 | 
			
		||||
    Only the user itself and local IRC operators get this numeric.
 | 
			
		||||
  - Implement channel exception list (mode 'e'). This allows a channel
 | 
			
		||||
@@ -25,7 +226,7 @@ ngIRCd Release 19
 | 
			
		||||
    and receiver are on the same channel. This prevents private flooding
 | 
			
		||||
    by completely unknown clients.
 | 
			
		||||
  - New RPL_WHOISREGNICK_MSG(307) numeric in WHOIS command replies: it
 | 
			
		||||
    indicates if a nick name is registered (if user mode 'R' set).
 | 
			
		||||
    indicates if a nickname is registered (if user mode 'R' set).
 | 
			
		||||
  - Limit channel invite, ban, and exception lists to 50 entries and fix
 | 
			
		||||
    duplicate check and error messages when adding already listed entries
 | 
			
		||||
    or deleting no (longer) existing ones.
 | 
			
		||||
@@ -61,7 +262,7 @@ ngIRCd Release 19
 | 
			
		||||
    NICK, and USER commands have been processed) and before the child
 | 
			
		||||
    processes for authentication are forked, so resource usage is smaller.
 | 
			
		||||
  - Added doc/Modes.txt: document modes supported by ngIRCd.
 | 
			
		||||
  - Implement user mode "R": indicates that the nick name of this user
 | 
			
		||||
  - Implement user mode "R": indicates that the nickname of this user
 | 
			
		||||
    is "registered". This mode isn't handled by ngIRCd itself, but must
 | 
			
		||||
    be set and unset by IRC services like Anope.
 | 
			
		||||
  - Implement channel mode "R": only registered users (having the user
 | 
			
		||||
@@ -72,7 +273,7 @@ ngIRCd Release 19
 | 
			
		||||
  - Handle channel user modes 'a', 'h', and 'q' from remote servers.
 | 
			
		||||
    These channel user modes aren't used for anything at the moment,
 | 
			
		||||
    but ngIRCd knows that these three modes are "channel user modes"
 | 
			
		||||
    and not "channel modes", that is that these modes take an "nick name"
 | 
			
		||||
    and not "channel modes", that is that these modes take an "nickname"
 | 
			
		||||
    argument. Like unknown user and channel modes, these modes are saved
 | 
			
		||||
    and forwarded to other servers, but ignored otherwise.
 | 
			
		||||
 | 
			
		||||
@@ -128,10 +329,10 @@ ngIRCd Release 18 (2011-07-10)
 | 
			
		||||
    (booleans, text strings, integer numbers) and add type information to each
 | 
			
		||||
    variable description.
 | 
			
		||||
  - Terminate incoming connections on HTTP commands "GET" and "POST".
 | 
			
		||||
  - New configuration option "CloakHost": when set, this hostname is used for
 | 
			
		||||
    every client instead of the real DNS hostname (or IP address).
 | 
			
		||||
  - New configuration option "CloakHost": when set, this host name is used for
 | 
			
		||||
    every client instead of the real DNS host name (or IP address).
 | 
			
		||||
  - New configuration option "CloakUserToNick": when enabled, ngIRCd sets
 | 
			
		||||
    every clients' user name to their nick name and hides the user name
 | 
			
		||||
    every clients' user name to their nickname and hides the user name
 | 
			
		||||
    supplied by the IRC client.
 | 
			
		||||
  - Make write buffers bigger, but flush early. Before this change, a client
 | 
			
		||||
    got disconnected if the buffer flushing at 4k failed, now regular clients
 | 
			
		||||
@@ -181,7 +382,7 @@ ngIRCd Release 17 (2010-11-07)
 | 
			
		||||
  - Enable the daemon to disable and enable "debug mode" on runtime using
 | 
			
		||||
    signal SIGUSR1, when debug code is compiled in, not only on startup
 | 
			
		||||
    using the command line parameters.
 | 
			
		||||
  - Implement user mode "x": hostname cloaking (closes: #102).
 | 
			
		||||
  - Implement user mode "x": host name cloaking (closes: #102).
 | 
			
		||||
  - Change MOTD file handling: ngIRCd now caches the contens 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.
 | 
			
		||||
@@ -286,7 +487,7 @@ ngIRCd 0.12.0 (2008-05-13)
 | 
			
		||||
  - Implemented IRC commands INFO, SUMMON (dummy), and USERS (dummy) and
 | 
			
		||||
    enhanced test suite to check these commands. (Dana Dahlstrom)
 | 
			
		||||
  - IRC_WHO now supports search patterns and will test this against user
 | 
			
		||||
    nickname/servername/hostname, etc. as required by RFC 2812, Section 3.6.1.
 | 
			
		||||
    nickname/server name/host name, etc. as required by RFC 2812, Section 3.6.1.
 | 
			
		||||
    (reported by Dana Dahlstrom)
 | 
			
		||||
  - Implement RFC 2812 handling of "0" argument to 'JOIN': must be treated
 | 
			
		||||
    as if the user had sent PART commands for all channels the user is a
 | 
			
		||||
@@ -299,7 +500,7 @@ ngIRCd 0.11.0 (2008-01-15)
 | 
			
		||||
  - New [Server] configuration Option "Bind" allows to specify
 | 
			
		||||
    the source IP address to use when connecting to remote server.
 | 
			
		||||
  - New configuration option "MaxNickLength" to specify the allowed maximum
 | 
			
		||||
    length of user nick names. Note: must be unique in an IRC network!
 | 
			
		||||
    length of user nicknames. Note: must be unique in an IRC network!
 | 
			
		||||
  - Numeric 317: implemented "signon time" (displayed in WHOIS result).
 | 
			
		||||
  - Added new server configuration option "Passive" for "Server" blocks to
 | 
			
		||||
    disable automatic outgoing connections (similar to -p option to ngircd,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								README
									
									
									
									
									
								
							@@ -2,7 +2,7 @@
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
                           http://ngircd.barton.de/
 | 
			
		||||
 | 
			
		||||
               (c)2001-2012 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.
 | 
			
		||||
 | 
			
		||||
@@ -12,12 +12,15 @@
 | 
			
		||||
I. Introduction
 | 
			
		||||
~~~~~~~~~~~~~~~
 | 
			
		||||
 | 
			
		||||
ngIRCd is an Open Source server for the Internet Relay Chat (IRC), which
 | 
			
		||||
is developed and published under the terms of the GNU General Public
 | 
			
		||||
Licence, see the file COPYING for details. ngIRCd means "next generation
 | 
			
		||||
IRC daemon" (which is a little bit exaggerated, "lightweight Internet Relay
 | 
			
		||||
Chat server" would be better), it's written from scratch and not deduced
 | 
			
		||||
from the "grandfather of IRC daemons", the daemon of the IRCNet.
 | 
			
		||||
ngIRCd is a free, portable and lightweight Internet Relay Chat server for
 | 
			
		||||
small or private networks, developed under the GNU General Public License
 | 
			
		||||
(GPL; please see the file COPYING for details). It is simple to configure,
 | 
			
		||||
can cope with dynamic IP addresses, and supports IPv6 as well as SSL. It is
 | 
			
		||||
written from scratch and not based on the original IRCd.
 | 
			
		||||
 | 
			
		||||
The name ngIRCd means next generation IRC daemon, which is a little bit
 | 
			
		||||
exaggerated: lightweight Internet Relay Chat server most probably would be a
 | 
			
		||||
better name :-)
 | 
			
		||||
 | 
			
		||||
Please see the INSTALL document for installation and upgrade information!
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										97
									
								
								autogen.sh
									
									
									
									
									
								
							
							
						
						
									
										97
									
								
								autogen.sh
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
#
 | 
			
		||||
# ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
# Copyright (c)2001-2008 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
 | 
			
		||||
@@ -16,6 +16,11 @@
 | 
			
		||||
# GNU autoconf. It tries to be smart in finding the correct/usable/available
 | 
			
		||||
# installed versions of these tools on your system.
 | 
			
		||||
#
 | 
			
		||||
# In addition, it enables or disables the "de-ANSI-fication" support of GNU
 | 
			
		||||
# automake, which is supported up to autoconf 1.11.x an has been removed
 | 
			
		||||
# in automake 1.12 -- make sure to use a version of automake supporting it
 | 
			
		||||
# when generating distribution archives!
 | 
			
		||||
#
 | 
			
		||||
# The following strategy is used for each of aclocal, autoheader, automake,
 | 
			
		||||
# and autoconf: first, "tool" (the regular name of the tool, e. g. "autoconf"
 | 
			
		||||
# or "automake") is checked. If this fails, "tool<major><minor>" (for example
 | 
			
		||||
@@ -68,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
 | 
			
		||||
 | 
			
		||||
@@ -98,6 +107,12 @@ Notfound()
 | 
			
		||||
	exit 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Run()
 | 
			
		||||
{
 | 
			
		||||
	[ "$VERBOSE" = "1" ] && echo " - running \"$@\" ..."
 | 
			
		||||
	$@
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Reset locale settings to suppress warning messages of Perl
 | 
			
		||||
unset LC_ALL
 | 
			
		||||
unset LANG
 | 
			
		||||
@@ -123,19 +138,27 @@ fi
 | 
			
		||||
 | 
			
		||||
# Try to detect the needed tools when no environment variable already
 | 
			
		||||
# specifies one:
 | 
			
		||||
echo "Searching tools ..."
 | 
			
		||||
echo "Searching for required tools ..."
 | 
			
		||||
[ -z "$ACLOCAL" ] && ACLOCAL=`Search aclocal 1`
 | 
			
		||||
[ "$VERBOSE" = "1" ] && echo "ACLOCAL=$ACLOCAL"
 | 
			
		||||
[ "$VERBOSE" = "1" ] && echo " - ACLOCAL=$ACLOCAL"
 | 
			
		||||
[ -z "$AUTOHEADER" ] && AUTOHEADER=`Search autoheader 2`
 | 
			
		||||
[ "$VERBOSE" = "1" ] && echo "AUTOHEADER=$AUTOHEADER"
 | 
			
		||||
[ "$VERBOSE" = "1" ] && echo " - AUTOHEADER=$AUTOHEADER"
 | 
			
		||||
[ -z "$AUTOMAKE" ] && AUTOMAKE=`Search automake 1`
 | 
			
		||||
[ "$VERBOSE" = "1" ] && echo "AUTOMAKE=$AUTOMAKE"
 | 
			
		||||
[ "$VERBOSE" = "1" ] && echo " - AUTOMAKE=$AUTOMAKE"
 | 
			
		||||
[ -z "$AUTOCONF" ] && AUTOCONF=`Search autoconf 2`
 | 
			
		||||
[ "$VERBOSE" = "1" ] && echo "AUTOCONF=$AUTOCONF"
 | 
			
		||||
[ "$VERBOSE" = "1" ] && echo " - AUTOCONF=$AUTOCONF"
 | 
			
		||||
 | 
			
		||||
# Call ./configure when parameters have been passed to this script and
 | 
			
		||||
# GO isn't already defined.
 | 
			
		||||
[ -z "$GO" -a $# -gt 0 ] && GO=1
 | 
			
		||||
AUTOCONF_VERSION=`echo $AUTOCONF | cut -d'-' -f2-`
 | 
			
		||||
[ -n "$AUTOCONF_VERSION" -a "$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" -a "$AUTOMAKE_VERSION" != "automake" ] \
 | 
			
		||||
	&& export AUTOMAKE_VERSION || unset AUTOMAKE_VERSION
 | 
			
		||||
[ "$VERBOSE" = "1" ] && echo " - AUTOMAKE_VERSION=$AUTOMAKE_VERSION"
 | 
			
		||||
 | 
			
		||||
[ $# -gt 0 ] && CONFIGURE_ARGS=" $@" || CONFIGURE_ARGS=""
 | 
			
		||||
[ -z "$GO" -a -n "$CONFIGURE_ARGS" ] && GO=1
 | 
			
		||||
 | 
			
		||||
# Verify that all tools have been found
 | 
			
		||||
[ -z "$ACLOCAL" ] && Notfound aclocal
 | 
			
		||||
@@ -143,14 +166,53 @@ echo "Searching tools ..."
 | 
			
		||||
[ -z "$AUTOMAKE" ] && Notfound automake
 | 
			
		||||
[ -z "$AUTOCONF" ] && Notfound autoconf
 | 
			
		||||
 | 
			
		||||
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"
 | 
			
		||||
echo "Detected automake $AM_VERSION ..."
 | 
			
		||||
 | 
			
		||||
AM_MAKEFILES="src/ipaddr/Makefile.ng src/ngircd/Makefile.ng src/testsuite/Makefile.ng src/tool/Makefile.ng"
 | 
			
		||||
 | 
			
		||||
# De-ANSI-fication?
 | 
			
		||||
if [ "$AM_MAJOR" -eq "1" -a "$AM_MINOR" -lt "12" ]; then
 | 
			
		||||
	# automake < 1.12 => automatic de-ANSI-fication support available
 | 
			
		||||
	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."
 | 
			
		||||
	sed -e "s|^__ng_PROTOTYPES__|AC_C_PROTOTYPES|g" configure.ng >configure.ac
 | 
			
		||||
	DEANSI_START="#"
 | 
			
		||||
	DEANSI_END=" (disabled by ./autogen.sh script)"
 | 
			
		||||
fi
 | 
			
		||||
# Serial test harness?
 | 
			
		||||
if [ "$AM_MAJOR" -eq "1" -a "$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
 | 
			
		||||
	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__|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 ..."
 | 
			
		||||
$ACLOCAL && \
 | 
			
		||||
	$AUTOHEADER && \
 | 
			
		||||
	$AUTOMAKE --add-missing && \
 | 
			
		||||
	$AUTOCONF --force
 | 
			
		||||
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
 | 
			
		||||
	# Success: if we got some parameters we call ./configure and pass
 | 
			
		||||
@@ -158,8 +220,7 @@ if [ $? -eq 0 -a -x ./configure ]; then
 | 
			
		||||
	NAME=`grep PACKAGE_STRING= configure | cut -d"'" -f2`
 | 
			
		||||
	if [ "$GO" = "1" ]; then
 | 
			
		||||
		[ -n "$PREFIX" ] && p=" --prefix=$PREFIX" || p=""
 | 
			
		||||
		[ -n "$*" ] && a=" $*" || a=""
 | 
			
		||||
		c="./configure${p}${a}"
 | 
			
		||||
		c="./configure${p}${CONFIGURE_ARGS}"
 | 
			
		||||
		echo "Okay, autogen.sh for $NAME done."
 | 
			
		||||
		echo "Calling \"$c\" ..."
 | 
			
		||||
		$c
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										561
									
								
								config.guess
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										561
									
								
								config.guess
									
									
									
									
										vendored
									
									
								
							@@ -1,10 +1,10 @@
 | 
			
		||||
#! /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
 | 
			
		||||
#   Free Software Foundation, Inc.
 | 
			
		||||
#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
 | 
			
		||||
#   2011, 2012 Free Software Foundation, Inc.
 | 
			
		||||
 | 
			
		||||
timestamp='2008-01-23'
 | 
			
		||||
timestamp='2012-08-14'
 | 
			
		||||
 | 
			
		||||
# 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
 | 
			
		||||
@@ -17,9 +17,7 @@ timestamp='2008-01-23'
 | 
			
		||||
# General Public License for more details.
 | 
			
		||||
#
 | 
			
		||||
# You should have received a copy of the GNU General Public License
 | 
			
		||||
# along with this program; if not, write to the Free Software
 | 
			
		||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
 | 
			
		||||
# 02110-1301, USA.
 | 
			
		||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
#
 | 
			
		||||
# As a special exception to the GNU General Public License, if you
 | 
			
		||||
# distribute this file as part of a program that contains a
 | 
			
		||||
@@ -27,16 +25,16 @@ timestamp='2008-01-23'
 | 
			
		||||
# the same distribution terms that you use for the rest of that program.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Originally written by Per Bothner <per@bothner.com>.
 | 
			
		||||
# Please send patches to <config-patches@gnu.org>.  Submit a context
 | 
			
		||||
# diff and a properly formatted ChangeLog entry.
 | 
			
		||||
# Originally written by Per Bothner.  Please send patches (context
 | 
			
		||||
# diff format) to <config-patches@gnu.org> and include a ChangeLog
 | 
			
		||||
# entry.
 | 
			
		||||
#
 | 
			
		||||
# 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.
 | 
			
		||||
#
 | 
			
		||||
# The plan is that this can be called by configure scripts if you
 | 
			
		||||
# don't specify an explicit build system type.
 | 
			
		||||
# 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
 | 
			
		||||
 | 
			
		||||
me=`echo "$0" | sed -e 's,.*/,,'`
 | 
			
		||||
 | 
			
		||||
@@ -56,8 +54,9 @@ 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 Free Software Foundation, Inc.
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
This is free software; see the source for copying conditions.  There is NO
 | 
			
		||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
 | 
			
		||||
@@ -144,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 | 
			
		||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 | 
			
		||||
    *:NetBSD:*:*)
 | 
			
		||||
	# NetBSD (nbsd) targets should (where applicable) match one or
 | 
			
		||||
	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
 | 
			
		||||
	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
 | 
			
		||||
	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 | 
			
		||||
	# switched to ELF, *-*-netbsd* would select the old
 | 
			
		||||
	# object file format.  This provides both forward
 | 
			
		||||
@@ -170,7 +169,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 | 
			
		||||
	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 | 
			
		||||
		eval $set_cc_for_build
 | 
			
		||||
		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 | 
			
		||||
			| grep __ELF__ >/dev/null
 | 
			
		||||
			| grep -q __ELF__
 | 
			
		||||
		then
 | 
			
		||||
		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
 | 
			
		||||
		    # Return netbsd for either.  FIX?
 | 
			
		||||
@@ -180,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 | 
			
		||||
		fi
 | 
			
		||||
		;;
 | 
			
		||||
	    *)
 | 
			
		||||
	        os=netbsd
 | 
			
		||||
		os=netbsd
 | 
			
		||||
		;;
 | 
			
		||||
	esac
 | 
			
		||||
	# The OS release
 | 
			
		||||
@@ -201,6 +200,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 | 
			
		||||
	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 | 
			
		||||
	echo "${machine}-${os}${release}"
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:Bitrig:*:*)
 | 
			
		||||
	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
 | 
			
		||||
	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:OpenBSD:*:*)
 | 
			
		||||
	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
 | 
			
		||||
	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
@@ -223,7 +226,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 | 
			
		||||
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
 | 
			
		||||
		;;
 | 
			
		||||
	*5.*)
 | 
			
		||||
	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 | 
			
		||||
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 | 
			
		||||
		;;
 | 
			
		||||
	esac
 | 
			
		||||
	# According to Compaq, /usr/sbin/psrinfo has been available on
 | 
			
		||||
@@ -269,7 +272,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 | 
			
		||||
	# 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'`
 | 
			
		||||
	exit ;;
 | 
			
		||||
	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
 | 
			
		||||
	exitcode=$?
 | 
			
		||||
	trap '' 0
 | 
			
		||||
	exit $exitcode ;;
 | 
			
		||||
    Alpha\ *:Windows_NT*:*)
 | 
			
		||||
	# How do we know it's Interix rather than the generic POSIX subsystem?
 | 
			
		||||
	# Should we change UNAME_MACHINE based on the output of uname instead
 | 
			
		||||
@@ -295,7 +301,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 | 
			
		||||
	echo s390-ibm-zvmoe
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:OS400:*:*)
 | 
			
		||||
        echo powerpc-ibm-os400
 | 
			
		||||
	echo powerpc-ibm-os400
 | 
			
		||||
	exit ;;
 | 
			
		||||
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 | 
			
		||||
	echo arm-acorn-riscix${UNAME_RELEASE}
 | 
			
		||||
@@ -324,14 +330,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 | 
			
		||||
	case `/usr/bin/uname -p` in
 | 
			
		||||
	    sparc) echo sparc-icl-nx7; exit ;;
 | 
			
		||||
	esac ;;
 | 
			
		||||
    s390x:SunOS:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 | 
			
		||||
	exit ;;
 | 
			
		||||
    sun4H:SunOS:5.*:*)
 | 
			
		||||
	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 | 
			
		||||
	exit ;;
 | 
			
		||||
    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 | 
			
		||||
	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
 | 
			
		||||
	echo i386-pc-auroraux${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
 | 
			
		||||
	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 | 
			
		||||
	eval $set_cc_for_build
 | 
			
		||||
	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 (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
 | 
			
		||||
		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
 | 
			
		||||
		grep IS_64BIT_ARCH >/dev/null
 | 
			
		||||
	    then
 | 
			
		||||
		SUN_ARCH="x86_64"
 | 
			
		||||
	    fi
 | 
			
		||||
	fi
 | 
			
		||||
	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 | 
			
		||||
	exit ;;
 | 
			
		||||
    sun4*:SunOS:6*:*)
 | 
			
		||||
	# According to config.sub, this is the proper way to canonicalize
 | 
			
		||||
@@ -375,23 +400,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 | 
			
		||||
    # MiNT.  But MiNT is downward compatible to TOS, so this should
 | 
			
		||||
    # be no problem.
 | 
			
		||||
    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
 | 
			
		||||
        echo m68k-atari-mint${UNAME_RELEASE}
 | 
			
		||||
	echo m68k-atari-mint${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 | 
			
		||||
	echo m68k-atari-mint${UNAME_RELEASE}
 | 
			
		||||
        exit ;;
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
 | 
			
		||||
        echo m68k-atari-mint${UNAME_RELEASE}
 | 
			
		||||
	echo m68k-atari-mint${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
 | 
			
		||||
        echo m68k-milan-mint${UNAME_RELEASE}
 | 
			
		||||
        exit ;;
 | 
			
		||||
	echo m68k-milan-mint${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
 | 
			
		||||
        echo m68k-hades-mint${UNAME_RELEASE}
 | 
			
		||||
        exit ;;
 | 
			
		||||
	echo m68k-hades-mint${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
 | 
			
		||||
        echo m68k-unknown-mint${UNAME_RELEASE}
 | 
			
		||||
        exit ;;
 | 
			
		||||
	echo m68k-unknown-mint${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    m68k:machten:*:*)
 | 
			
		||||
	echo m68k-apple-machten${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
@@ -461,8 +486,8 @@ EOF
 | 
			
		||||
	echo m88k-motorola-sysv3
 | 
			
		||||
	exit ;;
 | 
			
		||||
    AViiON:dgux:*:*)
 | 
			
		||||
        # DG/UX returns AViiON for all architectures
 | 
			
		||||
        UNAME_PROCESSOR=`/usr/bin/uname -p`
 | 
			
		||||
	# DG/UX returns AViiON for all architectures
 | 
			
		||||
	UNAME_PROCESSOR=`/usr/bin/uname -p`
 | 
			
		||||
	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 | 
			
		||||
	then
 | 
			
		||||
	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
 | 
			
		||||
@@ -475,7 +500,7 @@ EOF
 | 
			
		||||
	else
 | 
			
		||||
	    echo i586-dg-dgux${UNAME_RELEASE}
 | 
			
		||||
	fi
 | 
			
		||||
 	exit ;;
 | 
			
		||||
	exit ;;
 | 
			
		||||
    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 | 
			
		||||
	echo m88k-dolphin-sysv3
 | 
			
		||||
	exit ;;
 | 
			
		||||
@@ -532,7 +557,7 @@ EOF
 | 
			
		||||
		echo rs6000-ibm-aix3.2
 | 
			
		||||
	fi
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:AIX:*:[456])
 | 
			
		||||
    *:AIX:*:[4567])
 | 
			
		||||
	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 | 
			
		||||
	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 | 
			
		||||
		IBM_ARCH=rs6000
 | 
			
		||||
@@ -575,52 +600,52 @@ EOF
 | 
			
		||||
	    9000/[678][0-9][0-9])
 | 
			
		||||
		if [ -x /usr/bin/getconf ]; then
 | 
			
		||||
		    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
 | 
			
		||||
                      532)                      # CPU_PA_RISC2_0
 | 
			
		||||
                        case "${sc_kernel_bits}" in
 | 
			
		||||
                          32) HP_ARCH="hppa2.0n" ;;
 | 
			
		||||
                          64) HP_ARCH="hppa2.0w" ;;
 | 
			
		||||
		    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
 | 
			
		||||
		      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
 | 
			
		||||
                        esac ;;
 | 
			
		||||
                    esac
 | 
			
		||||
			esac ;;
 | 
			
		||||
		    esac
 | 
			
		||||
		fi
 | 
			
		||||
		if [ "${HP_ARCH}" = "" ]; then
 | 
			
		||||
		    eval $set_cc_for_build
 | 
			
		||||
		    sed 's/^              //' << EOF >$dummy.c
 | 
			
		||||
		    sed 's/^		//' << EOF >$dummy.c
 | 
			
		||||
 | 
			
		||||
              #define _HPUX_SOURCE
 | 
			
		||||
              #include <stdlib.h>
 | 
			
		||||
              #include <unistd.h>
 | 
			
		||||
		#define _HPUX_SOURCE
 | 
			
		||||
		#include <stdlib.h>
 | 
			
		||||
		#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
              int main ()
 | 
			
		||||
              {
 | 
			
		||||
              #if defined(_SC_KERNEL_BITS)
 | 
			
		||||
                  long bits = sysconf(_SC_KERNEL_BITS);
 | 
			
		||||
              #endif
 | 
			
		||||
                  long cpu  = sysconf (_SC_CPU_VERSION);
 | 
			
		||||
		int main ()
 | 
			
		||||
		{
 | 
			
		||||
		#if defined(_SC_KERNEL_BITS)
 | 
			
		||||
		    long bits = sysconf(_SC_KERNEL_BITS);
 | 
			
		||||
		#endif
 | 
			
		||||
		    long cpu  = sysconf (_SC_CPU_VERSION);
 | 
			
		||||
 | 
			
		||||
                  switch (cpu)
 | 
			
		||||
              	{
 | 
			
		||||
              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
 | 
			
		||||
              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
 | 
			
		||||
              	case CPU_PA_RISC2_0:
 | 
			
		||||
              #if defined(_SC_KERNEL_BITS)
 | 
			
		||||
              	    switch (bits)
 | 
			
		||||
              		{
 | 
			
		||||
              		case 64: puts ("hppa2.0w"); break;
 | 
			
		||||
              		case 32: puts ("hppa2.0n"); break;
 | 
			
		||||
              		default: puts ("hppa2.0"); break;
 | 
			
		||||
              		} break;
 | 
			
		||||
              #else  /* !defined(_SC_KERNEL_BITS) */
 | 
			
		||||
              	    puts ("hppa2.0"); break;
 | 
			
		||||
              #endif
 | 
			
		||||
              	default: puts ("hppa1.0"); break;
 | 
			
		||||
              	}
 | 
			
		||||
                  exit (0);
 | 
			
		||||
              }
 | 
			
		||||
		    switch (cpu)
 | 
			
		||||
			{
 | 
			
		||||
			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
 | 
			
		||||
			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
 | 
			
		||||
			case CPU_PA_RISC2_0:
 | 
			
		||||
		#if defined(_SC_KERNEL_BITS)
 | 
			
		||||
			    switch (bits)
 | 
			
		||||
				{
 | 
			
		||||
				case 64: puts ("hppa2.0w"); break;
 | 
			
		||||
				case 32: puts ("hppa2.0n"); break;
 | 
			
		||||
				default: puts ("hppa2.0"); break;
 | 
			
		||||
				} break;
 | 
			
		||||
		#else  /* !defined(_SC_KERNEL_BITS) */
 | 
			
		||||
			    puts ("hppa2.0"); break;
 | 
			
		||||
		#endif
 | 
			
		||||
			default: puts ("hppa1.0"); break;
 | 
			
		||||
			}
 | 
			
		||||
		    exit (0);
 | 
			
		||||
		}
 | 
			
		||||
EOF
 | 
			
		||||
		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 | 
			
		||||
		    test -z "$HP_ARCH" && HP_ARCH=hppa
 | 
			
		||||
@@ -640,7 +665,7 @@ EOF
 | 
			
		||||
	    # => hppa64-hp-hpux11.23
 | 
			
		||||
 | 
			
		||||
	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
 | 
			
		||||
		grep __LP64__ >/dev/null
 | 
			
		||||
		grep -q __LP64__
 | 
			
		||||
	    then
 | 
			
		||||
		HP_ARCH="hppa2.0w"
 | 
			
		||||
	    else
 | 
			
		||||
@@ -711,22 +736,22 @@ EOF
 | 
			
		||||
	exit ;;
 | 
			
		||||
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 | 
			
		||||
	echo c1-convex-bsd
 | 
			
		||||
        exit ;;
 | 
			
		||||
	exit ;;
 | 
			
		||||
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 | 
			
		||||
	if getsysinfo -f scalar_acc
 | 
			
		||||
	then echo c32-convex-bsd
 | 
			
		||||
	else echo c2-convex-bsd
 | 
			
		||||
	fi
 | 
			
		||||
        exit ;;
 | 
			
		||||
	exit ;;
 | 
			
		||||
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 | 
			
		||||
	echo c34-convex-bsd
 | 
			
		||||
        exit ;;
 | 
			
		||||
	exit ;;
 | 
			
		||||
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 | 
			
		||||
	echo c38-convex-bsd
 | 
			
		||||
        exit ;;
 | 
			
		||||
	exit ;;
 | 
			
		||||
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 | 
			
		||||
	echo c4-convex-bsd
 | 
			
		||||
        exit ;;
 | 
			
		||||
	exit ;;
 | 
			
		||||
    CRAY*Y-MP:*:*:*)
 | 
			
		||||
	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 | 
			
		||||
	exit ;;
 | 
			
		||||
@@ -750,14 +775,14 @@ EOF
 | 
			
		||||
	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_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
 | 
			
		||||
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 | 
			
		||||
        exit ;;
 | 
			
		||||
	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/ /_/'`
 | 
			
		||||
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 | 
			
		||||
	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:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
 | 
			
		||||
@@ -769,34 +794,39 @@ EOF
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:FreeBSD:*:*)
 | 
			
		||||
	case ${UNAME_MACHINE} in
 | 
			
		||||
	    pc98)
 | 
			
		||||
		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 | 
			
		||||
	UNAME_PROCESSOR=`/usr/bin/uname -p`
 | 
			
		||||
	case ${UNAME_PROCESSOR} in
 | 
			
		||||
	    amd64)
 | 
			
		||||
		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 | 
			
		||||
	    *)
 | 
			
		||||
		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 | 
			
		||||
		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 | 
			
		||||
	esac
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*:CYGWIN*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-cygwin
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:MINGW64*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-mingw64
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:MINGW*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-mingw32
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*:MSYS*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-msys
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*:windows32*:*)
 | 
			
		||||
    	# uname -m includes "-pc" on this system.
 | 
			
		||||
    	echo ${UNAME_MACHINE}-mingw32
 | 
			
		||||
	# uname -m includes "-pc" on this system.
 | 
			
		||||
	echo ${UNAME_MACHINE}-mingw32
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*:PW*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-pw32
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:Interix*:[3456]*)
 | 
			
		||||
    	case ${UNAME_MACHINE} in
 | 
			
		||||
    *:Interix*:*)
 | 
			
		||||
	case ${UNAME_MACHINE} in
 | 
			
		||||
	    x86)
 | 
			
		||||
		echo i586-pc-interix${UNAME_RELEASE}
 | 
			
		||||
		exit ;;
 | 
			
		||||
	    EM64T | authenticamd)
 | 
			
		||||
	    authenticamd | genuineintel | EM64T)
 | 
			
		||||
		echo x86_64-unknown-interix${UNAME_RELEASE}
 | 
			
		||||
		exit ;;
 | 
			
		||||
	    IA64)
 | 
			
		||||
@@ -806,6 +836,9 @@ EOF
 | 
			
		||||
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 | 
			
		||||
	echo i${UNAME_MACHINE}-pc-mks
 | 
			
		||||
	exit ;;
 | 
			
		||||
    8664:Windows_NT:*)
 | 
			
		||||
	echo x86_64-pc-mks
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 | 
			
		||||
	# How do we know it's Interix rather than the generic POSIX subsystem?
 | 
			
		||||
	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
 | 
			
		||||
@@ -835,92 +868,13 @@ EOF
 | 
			
		||||
    i*86:Minix:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-minix
 | 
			
		||||
	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
 | 
			
		||||
	else
 | 
			
		||||
	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
 | 
			
		||||
	fi
 | 
			
		||||
	exit ;;
 | 
			
		||||
    avr32*:Linux:*:*)
 | 
			
		||||
    aarch64:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    cris:Linux:*:*)
 | 
			
		||||
	echo cris-axis-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    crisv32:Linux:*:*)
 | 
			
		||||
	echo crisv32-axis-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    frv:Linux:*:*)
 | 
			
		||||
    	echo frv-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    ia64:Linux:*:*)
 | 
			
		||||
    aarch64_be:Linux:*:*)
 | 
			
		||||
	UNAME_MACHINE=aarch64_be
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    m32r*:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    m68*:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    mips:Linux:*:*)
 | 
			
		||||
	eval $set_cc_for_build
 | 
			
		||||
	sed 's/^	//' << EOF >$dummy.c
 | 
			
		||||
	#undef CPU
 | 
			
		||||
	#undef mips
 | 
			
		||||
	#undef mipsel
 | 
			
		||||
	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 | 
			
		||||
	CPU=mipsel
 | 
			
		||||
	#else
 | 
			
		||||
	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 | 
			
		||||
	CPU=mips
 | 
			
		||||
	#else
 | 
			
		||||
	CPU=
 | 
			
		||||
	#endif
 | 
			
		||||
	#endif
 | 
			
		||||
EOF
 | 
			
		||||
	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
 | 
			
		||||
	    /^CPU/{
 | 
			
		||||
		s: ::g
 | 
			
		||||
		p
 | 
			
		||||
	    }'`"
 | 
			
		||||
	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 | 
			
		||||
	;;
 | 
			
		||||
    mips64:Linux:*:*)
 | 
			
		||||
	eval $set_cc_for_build
 | 
			
		||||
	sed 's/^	//' << EOF >$dummy.c
 | 
			
		||||
	#undef CPU
 | 
			
		||||
	#undef mips64
 | 
			
		||||
	#undef mips64el
 | 
			
		||||
	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 | 
			
		||||
	CPU=mips64el
 | 
			
		||||
	#else
 | 
			
		||||
	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 | 
			
		||||
	CPU=mips64
 | 
			
		||||
	#else
 | 
			
		||||
	CPU=
 | 
			
		||||
	#endif
 | 
			
		||||
	#endif
 | 
			
		||||
EOF
 | 
			
		||||
	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
 | 
			
		||||
	    /^CPU/{
 | 
			
		||||
		s: ::g
 | 
			
		||||
		p
 | 
			
		||||
	    }'`"
 | 
			
		||||
	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 | 
			
		||||
	;;
 | 
			
		||||
    or32:Linux:*:*)
 | 
			
		||||
	echo or32-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    ppc:Linux:*:*)
 | 
			
		||||
	echo powerpc-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    ppc64:Linux:*:*)
 | 
			
		||||
	echo powerpc64-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    alpha:Linux:*:*)
 | 
			
		||||
	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 | 
			
		||||
	  EV5)   UNAME_MACHINE=alphaev5 ;;
 | 
			
		||||
@@ -930,11 +884,90 @@ EOF
 | 
			
		||||
	  EV6)   UNAME_MACHINE=alphaev6 ;;
 | 
			
		||||
	  EV67)  UNAME_MACHINE=alphaev67 ;;
 | 
			
		||||
	  EV68*) UNAME_MACHINE=alphaev68 ;;
 | 
			
		||||
        esac
 | 
			
		||||
	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
 | 
			
		||||
	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}
 | 
			
		||||
	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
 | 
			
		||||
	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
 | 
			
		||||
	    else
 | 
			
		||||
		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
 | 
			
		||||
	    fi
 | 
			
		||||
	fi
 | 
			
		||||
	exit ;;
 | 
			
		||||
    avr32*:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    cris:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-axis-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    crisv32:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-axis-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    frv:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    hexagon:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	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}"
 | 
			
		||||
	exit ;;
 | 
			
		||||
    ia64:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    m32r*:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    m68*:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    mips:Linux:*:* | mips64:Linux:*:*)
 | 
			
		||||
	eval $set_cc_for_build
 | 
			
		||||
	sed 's/^	//' << EOF >$dummy.c
 | 
			
		||||
	#undef CPU
 | 
			
		||||
	#undef ${UNAME_MACHINE}
 | 
			
		||||
	#undef ${UNAME_MACHINE}el
 | 
			
		||||
	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 | 
			
		||||
	CPU=${UNAME_MACHINE}el
 | 
			
		||||
	#else
 | 
			
		||||
	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 | 
			
		||||
	CPU=${UNAME_MACHINE}
 | 
			
		||||
	#else
 | 
			
		||||
	CPU=
 | 
			
		||||
	#endif
 | 
			
		||||
	#endif
 | 
			
		||||
EOF
 | 
			
		||||
	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
 | 
			
		||||
	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 | 
			
		||||
	;;
 | 
			
		||||
    or32:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    padre:Linux:*:*)
 | 
			
		||||
	echo sparc-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    parisc64:Linux:*:* | hppa64:Linux:*:*)
 | 
			
		||||
	echo hppa64-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    parisc:Linux:*:* | hppa:Linux:*:*)
 | 
			
		||||
	# Look for CPU level
 | 
			
		||||
	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
 | 
			
		||||
@@ -943,14 +976,17 @@ EOF
 | 
			
		||||
	  *)    echo hppa-unknown-linux-gnu ;;
 | 
			
		||||
	esac
 | 
			
		||||
	exit ;;
 | 
			
		||||
    parisc64:Linux:*:* | hppa64:Linux:*:*)
 | 
			
		||||
	echo hppa64-unknown-linux-gnu
 | 
			
		||||
    ppc64:Linux:*:*)
 | 
			
		||||
	echo powerpc64-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    ppc:Linux:*:*)
 | 
			
		||||
	echo powerpc-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    s390:Linux:*:* | s390x:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-ibm-linux
 | 
			
		||||
	exit ;;
 | 
			
		||||
    sh64*:Linux:*:*)
 | 
			
		||||
    	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    sh*:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
@@ -958,78 +994,18 @@ EOF
 | 
			
		||||
    sparc:Linux:*:* | sparc64:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    tile*:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    vax:Linux:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-dec-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    x86_64:Linux:*:*)
 | 
			
		||||
	echo x86_64-unknown-linux-gnu
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    xtensa*:Linux:*:*)
 | 
			
		||||
    	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-linux-gnu
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*86:Linux:*:*)
 | 
			
		||||
	# The BFD linker knows what the default object file format is, so
 | 
			
		||||
	# first see if it will tell us. cd to the root directory to prevent
 | 
			
		||||
	# problems with other programs or directories called `ld' in the path.
 | 
			
		||||
	# Set LC_ALL=C to ensure ld outputs messages in English.
 | 
			
		||||
	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
 | 
			
		||||
			 | sed -ne '/supported targets:/!d
 | 
			
		||||
				    s/[ 	][ 	]*/ /g
 | 
			
		||||
				    s/.*supported targets: *//
 | 
			
		||||
				    s/ .*//
 | 
			
		||||
				    p'`
 | 
			
		||||
        case "$ld_supported_targets" in
 | 
			
		||||
	  elf32-i386)
 | 
			
		||||
		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
 | 
			
		||||
		;;
 | 
			
		||||
	  a.out-i386-linux)
 | 
			
		||||
		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
 | 
			
		||||
		exit ;;
 | 
			
		||||
	  coff-i386)
 | 
			
		||||
		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
 | 
			
		||||
		exit ;;
 | 
			
		||||
	  "")
 | 
			
		||||
		# Either a pre-BFD a.out linker (linux-gnuoldld) or
 | 
			
		||||
		# one that does not give us useful --help.
 | 
			
		||||
		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
 | 
			
		||||
		exit ;;
 | 
			
		||||
	esac
 | 
			
		||||
	# Determine whether the default compiler is a.out or elf
 | 
			
		||||
	eval $set_cc_for_build
 | 
			
		||||
	sed 's/^	//' << EOF >$dummy.c
 | 
			
		||||
	#include <features.h>
 | 
			
		||||
	#ifdef __ELF__
 | 
			
		||||
	# ifdef __GLIBC__
 | 
			
		||||
	#  if __GLIBC__ >= 2
 | 
			
		||||
	LIBC=gnu
 | 
			
		||||
	#  else
 | 
			
		||||
	LIBC=gnulibc1
 | 
			
		||||
	#  endif
 | 
			
		||||
	# else
 | 
			
		||||
	LIBC=gnulibc1
 | 
			
		||||
	# endif
 | 
			
		||||
	#else
 | 
			
		||||
	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
 | 
			
		||||
	LIBC=gnu
 | 
			
		||||
	#else
 | 
			
		||||
	LIBC=gnuaout
 | 
			
		||||
	#endif
 | 
			
		||||
	#endif
 | 
			
		||||
	#ifdef __dietlibc__
 | 
			
		||||
	LIBC=dietlibc
 | 
			
		||||
	#endif
 | 
			
		||||
EOF
 | 
			
		||||
	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
 | 
			
		||||
	    /^LIBC/{
 | 
			
		||||
		s: ::g
 | 
			
		||||
		p
 | 
			
		||||
	    }'`"
 | 
			
		||||
	test x"${LIBC}" != x && {
 | 
			
		||||
		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
 | 
			
		||||
		exit
 | 
			
		||||
	}
 | 
			
		||||
	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
 | 
			
		||||
	;;
 | 
			
		||||
    i*86:DYNIX/ptx:4*:*)
 | 
			
		||||
	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 | 
			
		||||
	# earlier versions are messed up and put the nodename in both
 | 
			
		||||
@@ -1037,11 +1013,11 @@ EOF
 | 
			
		||||
	echo i386-sequent-sysv4
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*86:UNIX_SV:4.2MP:2.*)
 | 
			
		||||
        # Unixware is an offshoot of SVR4, but it has its own version
 | 
			
		||||
        # number series starting with 2...
 | 
			
		||||
        # I am not positive that other SVR4 systems won't match this,
 | 
			
		||||
	# Unixware is an offshoot of SVR4, but it has its own version
 | 
			
		||||
	# number series starting with 2...
 | 
			
		||||
	# I am not positive that other SVR4 systems won't match this,
 | 
			
		||||
	# I just have to hope.  -- rms.
 | 
			
		||||
        # Use sysv4.2uw... so that sysv4* matches it.
 | 
			
		||||
	# Use sysv4.2uw... so that sysv4* matches it.
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*86:OS/2:*:*)
 | 
			
		||||
@@ -1058,7 +1034,7 @@ EOF
 | 
			
		||||
    i*86:syllable:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-syllable
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 | 
			
		||||
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
 | 
			
		||||
	echo i386-unknown-lynxos${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*86:*DOS:*:*)
 | 
			
		||||
@@ -1073,7 +1049,7 @@ EOF
 | 
			
		||||
	fi
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*86:*:5:[678]*)
 | 
			
		||||
    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 | 
			
		||||
	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 | 
			
		||||
	case `/bin/uname -X | grep "^Machine"` in
 | 
			
		||||
	    *486*)	     UNAME_MACHINE=i486 ;;
 | 
			
		||||
	    *Pentium)	     UNAME_MACHINE=i586 ;;
 | 
			
		||||
@@ -1101,10 +1077,13 @@ EOF
 | 
			
		||||
	exit ;;
 | 
			
		||||
    pc:*:*:*)
 | 
			
		||||
	# Left here for compatibility:
 | 
			
		||||
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
 | 
			
		||||
        # the processor, so we play safe by assuming i386.
 | 
			
		||||
	echo i386-pc-msdosdjgpp
 | 
			
		||||
        exit ;;
 | 
			
		||||
	# 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
 | 
			
		||||
	# this is a cross-build.
 | 
			
		||||
	echo i586-pc-msdosdjgpp
 | 
			
		||||
	exit ;;
 | 
			
		||||
    Intel:Mach:3*:*)
 | 
			
		||||
	echo i386-pc-mach3
 | 
			
		||||
	exit ;;
 | 
			
		||||
@@ -1139,8 +1118,18 @@ EOF
 | 
			
		||||
	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 | 
			
		||||
	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
 | 
			
		||||
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
 | 
			
		||||
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 | 
			
		||||
          && { echo i486-ncr-sysv4; exit; } ;;
 | 
			
		||||
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 | 
			
		||||
	  && { echo i486-ncr-sysv4; exit; } ;;
 | 
			
		||||
    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
 | 
			
		||||
	OS_REL='.3'
 | 
			
		||||
	test -r /etc/.relid \
 | 
			
		||||
	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 | 
			
		||||
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 | 
			
		||||
	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
 | 
			
		||||
	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 | 
			
		||||
	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
 | 
			
		||||
	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
 | 
			
		||||
	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
 | 
			
		||||
    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 | 
			
		||||
	echo m68k-unknown-lynxos${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
@@ -1153,7 +1142,7 @@ EOF
 | 
			
		||||
    rs6000:LynxOS:2.*:*)
 | 
			
		||||
	echo rs6000-unknown-lynxos${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 | 
			
		||||
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
 | 
			
		||||
	echo powerpc-unknown-lynxos${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    SM[BE]S:UNIX_SV:*:*)
 | 
			
		||||
@@ -1173,10 +1162,10 @@ EOF
 | 
			
		||||
		echo ns32k-sni-sysv
 | 
			
		||||
	fi
 | 
			
		||||
	exit ;;
 | 
			
		||||
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 | 
			
		||||
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
 | 
			
		||||
        echo i586-unisys-sysv4
 | 
			
		||||
        exit ;;
 | 
			
		||||
    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 | 
			
		||||
			# says <Richard.M.Bartel@ccMail.Census.GOV>
 | 
			
		||||
	echo i586-unisys-sysv4
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:UNIX_System_V:4*:FTX*)
 | 
			
		||||
	# From Gerald Hewes <hewes@openmarket.com>.
 | 
			
		||||
	# How about differentiating between stratus architectures? -djm
 | 
			
		||||
@@ -1202,11 +1191,11 @@ EOF
 | 
			
		||||
	exit ;;
 | 
			
		||||
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 | 
			
		||||
	if [ -d /usr/nec ]; then
 | 
			
		||||
	        echo mips-nec-sysv${UNAME_RELEASE}
 | 
			
		||||
		echo mips-nec-sysv${UNAME_RELEASE}
 | 
			
		||||
	else
 | 
			
		||||
	        echo mips-unknown-sysv${UNAME_RELEASE}
 | 
			
		||||
		echo mips-unknown-sysv${UNAME_RELEASE}
 | 
			
		||||
	fi
 | 
			
		||||
        exit ;;
 | 
			
		||||
	exit ;;
 | 
			
		||||
    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 | 
			
		||||
	echo powerpc-be-beos
 | 
			
		||||
	exit ;;
 | 
			
		||||
@@ -1216,6 +1205,12 @@ EOF
 | 
			
		||||
    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
 | 
			
		||||
	echo i586-pc-beos
 | 
			
		||||
	exit ;;
 | 
			
		||||
    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
 | 
			
		||||
	echo i586-pc-haiku
 | 
			
		||||
	exit ;;
 | 
			
		||||
    x86_64:Haiku:*:*)
 | 
			
		||||
	echo x86_64-unknown-haiku
 | 
			
		||||
	exit ;;
 | 
			
		||||
    SX-4:SUPER-UX:*:*)
 | 
			
		||||
	echo sx4-nec-superux${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
@@ -1243,6 +1238,16 @@ EOF
 | 
			
		||||
    *: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
 | 
			
		||||
	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 | 
			
		||||
@@ -1258,7 +1263,10 @@ EOF
 | 
			
		||||
    *:QNX:*:4*)
 | 
			
		||||
	echo i386-pc-qnx
 | 
			
		||||
	exit ;;
 | 
			
		||||
    NSE-?:NONSTOP_KERNEL:*:*)
 | 
			
		||||
    NEO-?:NONSTOP_KERNEL:*:*)
 | 
			
		||||
	echo neo-tandem-nsk${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    NSE-*:NONSTOP_KERNEL:*:*)
 | 
			
		||||
	echo nse-tandem-nsk${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    NSR-?:NONSTOP_KERNEL:*:*)
 | 
			
		||||
@@ -1303,13 +1311,13 @@ EOF
 | 
			
		||||
	echo pdp10-unknown-its
 | 
			
		||||
	exit ;;
 | 
			
		||||
    SEI:*:*:SEIUX)
 | 
			
		||||
        echo mips-sei-seiux${UNAME_RELEASE}
 | 
			
		||||
	echo mips-sei-seiux${UNAME_RELEASE}
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:DragonFly:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 | 
			
		||||
	exit ;;
 | 
			
		||||
    *:*VMS:*:*)
 | 
			
		||||
    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 | 
			
		||||
	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 | 
			
		||||
	case "${UNAME_MACHINE}" in
 | 
			
		||||
	    A*) echo alpha-dec-vms ; exit ;;
 | 
			
		||||
	    I*) echo ia64-dec-vms ; exit ;;
 | 
			
		||||
@@ -1324,11 +1332,14 @@ EOF
 | 
			
		||||
    i*86:rdos:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-rdos
 | 
			
		||||
	exit ;;
 | 
			
		||||
    i*86:AROS:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-aros
 | 
			
		||||
	exit ;;
 | 
			
		||||
    x86_64:VMkernel:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-esx
 | 
			
		||||
	exit ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
#echo '(No uname command or uname output not recognized.)' 1>&2
 | 
			
		||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 | 
			
		||||
 | 
			
		||||
eval $set_cc_for_build
 | 
			
		||||
cat >$dummy.c <<EOF
 | 
			
		||||
#ifdef _SEQUENT_
 | 
			
		||||
@@ -1346,11 +1357,11 @@ main ()
 | 
			
		||||
#include <sys/param.h>
 | 
			
		||||
  printf ("m68k-sony-newsos%s\n",
 | 
			
		||||
#ifdef NEWSOS4
 | 
			
		||||
          "4"
 | 
			
		||||
	"4"
 | 
			
		||||
#else
 | 
			
		||||
	  ""
 | 
			
		||||
	""
 | 
			
		||||
#endif
 | 
			
		||||
         ); exit (0);
 | 
			
		||||
	); exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										284
									
								
								config.sub
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										284
									
								
								config.sub
									
									
									
									
										vendored
									
									
								
							@@ -1,10 +1,10 @@
 | 
			
		||||
#! /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
 | 
			
		||||
#   Free Software Foundation, Inc.
 | 
			
		||||
#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
 | 
			
		||||
#   2011, 2012 Free Software Foundation, Inc.
 | 
			
		||||
 | 
			
		||||
timestamp='2008-01-16'
 | 
			
		||||
timestamp='2012-08-18'
 | 
			
		||||
 | 
			
		||||
# This file is (in principle) common to ALL GNU software.
 | 
			
		||||
# The presence of a machine in this file suggests that SOME GNU software
 | 
			
		||||
@@ -21,9 +21,7 @@ timestamp='2008-01-16'
 | 
			
		||||
# 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, write to the Free Software
 | 
			
		||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
 | 
			
		||||
# 02110-1301, USA.
 | 
			
		||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
#
 | 
			
		||||
# As a special exception to the GNU General Public License, if you
 | 
			
		||||
# distribute this file as part of a program that contains a
 | 
			
		||||
@@ -32,13 +30,16 @@ timestamp='2008-01-16'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Please send patches to <config-patches@gnu.org>.  Submit a context
 | 
			
		||||
# diff and a properly formatted ChangeLog entry.
 | 
			
		||||
# diff and a properly formatted GNU ChangeLog entry.
 | 
			
		||||
#
 | 
			
		||||
# Configuration subroutine to validate and canonicalize a configuration type.
 | 
			
		||||
# Supply the specified configuration type as an argument.
 | 
			
		||||
# If it is invalid, we print an error message on stderr and exit with code 1.
 | 
			
		||||
# 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
 | 
			
		||||
 | 
			
		||||
# This file is supposed to be the same for all GNU packages
 | 
			
		||||
# and recognize all the CPU types, system types and aliases
 | 
			
		||||
# that are meaningful with *any* GNU software.
 | 
			
		||||
@@ -72,8 +73,9 @@ 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 Free Software Foundation, Inc.
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
This is free software; see the source for copying conditions.  There is NO
 | 
			
		||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
 | 
			
		||||
@@ -120,12 +122,18 @@ esac
 | 
			
		||||
# Here we must recognize all the valid KERNEL-OS combinations.
 | 
			
		||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 | 
			
		||||
case $maybe_os in
 | 
			
		||||
  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
 | 
			
		||||
  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
 | 
			
		||||
  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
 | 
			
		||||
  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
 | 
			
		||||
  knetbsd*-gnu* | netbsd*-gnu* | \
 | 
			
		||||
  kopensolaris*-gnu* | \
 | 
			
		||||
  storm-chaos* | os2-emx* | rtmk-nova*)
 | 
			
		||||
    os=-$maybe_os
 | 
			
		||||
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
 | 
			
		||||
    ;;
 | 
			
		||||
  android-linux)
 | 
			
		||||
    os=-linux-android
 | 
			
		||||
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
 | 
			
		||||
    ;;
 | 
			
		||||
  *)
 | 
			
		||||
    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
 | 
			
		||||
    if [ $basic_machine != $1 ]
 | 
			
		||||
@@ -148,10 +156,13 @@ 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)
 | 
			
		||||
	-apple | -axis | -knuth | -cray | -microblaze)
 | 
			
		||||
		os=
 | 
			
		||||
		basic_machine=$1
 | 
			
		||||
		;;
 | 
			
		||||
	-bluegene*)
 | 
			
		||||
		os=-cnk
 | 
			
		||||
		;;
 | 
			
		||||
	-sim | -cisco | -oki | -wec | -winbond)
 | 
			
		||||
		os=
 | 
			
		||||
		basic_machine=$1
 | 
			
		||||
@@ -166,10 +177,10 @@ case $os in
 | 
			
		||||
		os=-chorusos
 | 
			
		||||
		basic_machine=$1
 | 
			
		||||
		;;
 | 
			
		||||
 	-chorusrdb)
 | 
			
		||||
 		os=-chorusrdb
 | 
			
		||||
	-chorusrdb)
 | 
			
		||||
		os=-chorusrdb
 | 
			
		||||
		basic_machine=$1
 | 
			
		||||
 		;;
 | 
			
		||||
		;;
 | 
			
		||||
	-hiux*)
 | 
			
		||||
		os=-hiuxwe2
 | 
			
		||||
		;;
 | 
			
		||||
@@ -214,6 +225,12 @@ case $os in
 | 
			
		||||
	-isc*)
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 | 
			
		||||
		;;
 | 
			
		||||
	-lynx*178)
 | 
			
		||||
		os=-lynxos178
 | 
			
		||||
		;;
 | 
			
		||||
	-lynx*5)
 | 
			
		||||
		os=-lynxos5
 | 
			
		||||
		;;
 | 
			
		||||
	-lynx*)
 | 
			
		||||
		os=-lynxos
 | 
			
		||||
		;;
 | 
			
		||||
@@ -238,24 +255,32 @@ case $basic_machine in
 | 
			
		||||
	# Some are omitted here because they have special meanings below.
 | 
			
		||||
	1750a | 580 \
 | 
			
		||||
	| a29k \
 | 
			
		||||
	| aarch64 | aarch64_be \
 | 
			
		||||
	| 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 \
 | 
			
		||||
	| bfin \
 | 
			
		||||
	| c4x | clipper \
 | 
			
		||||
	| d10v | d30v | dlx | dsp16xx \
 | 
			
		||||
	| epiphany \
 | 
			
		||||
	| fido | fr30 | frv \
 | 
			
		||||
	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 | 
			
		||||
	| hexagon \
 | 
			
		||||
	| i370 | i860 | i960 | ia64 \
 | 
			
		||||
	| ip2k | iq2000 \
 | 
			
		||||
	| le32 | le64 \
 | 
			
		||||
	| lm32 \
 | 
			
		||||
	| m32c | m32r | m32rle | m68000 | m68k | m88k \
 | 
			
		||||
	| maxq | mb | microblaze | mcore | mep \
 | 
			
		||||
	| maxq | mb | microblaze | mcore | mep | metag \
 | 
			
		||||
	| mips | mipsbe | mipseb | mipsel | mipsle \
 | 
			
		||||
	| mips16 \
 | 
			
		||||
	| mips64 | mips64el \
 | 
			
		||||
	| mips64vr | mips64vrel \
 | 
			
		||||
	| mips64octeon | mips64octeonel \
 | 
			
		||||
	| mips64orion | mips64orionel \
 | 
			
		||||
	| mips64r5900 | mips64r5900el \
 | 
			
		||||
	| mips64vr | mips64vrel \
 | 
			
		||||
	| mips64vr4100 | mips64vr4100el \
 | 
			
		||||
	| mips64vr4300 | mips64vr4300el \
 | 
			
		||||
	| mips64vr5000 | mips64vr5000el \
 | 
			
		||||
@@ -268,29 +293,42 @@ case $basic_machine in
 | 
			
		||||
	| mipsisa64sr71k | mipsisa64sr71kel \
 | 
			
		||||
	| mipstx39 | mipstx39el \
 | 
			
		||||
	| mn10200 | mn10300 \
 | 
			
		||||
	| moxie \
 | 
			
		||||
	| mt \
 | 
			
		||||
	| msp430 \
 | 
			
		||||
	| nds32 | nds32le | nds32be \
 | 
			
		||||
	| nios | nios2 \
 | 
			
		||||
	| ns16k | ns32k \
 | 
			
		||||
	| open8 \
 | 
			
		||||
	| or32 \
 | 
			
		||||
	| pdp10 | pdp11 | pj | pjl \
 | 
			
		||||
	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 | 
			
		||||
	| powerpc | powerpc64 | powerpc64le | powerpcle \
 | 
			
		||||
	| pyramid \
 | 
			
		||||
	| rl78 | rx \
 | 
			
		||||
	| score \
 | 
			
		||||
	| sh | sh[1234] | sh[24]a | 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[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 | 
			
		||||
	| sh64 | sh64le \
 | 
			
		||||
	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 | 
			
		||||
	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
 | 
			
		||||
	| spu | strongarm \
 | 
			
		||||
	| tahoe | thumb | tic4x | tic80 | tron \
 | 
			
		||||
	| v850 | v850e \
 | 
			
		||||
	| spu \
 | 
			
		||||
	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 | 
			
		||||
	| ubicom32 \
 | 
			
		||||
	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
 | 
			
		||||
	| we32k \
 | 
			
		||||
	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
 | 
			
		||||
	| z8k)
 | 
			
		||||
	| x86 | xc16x | xstormy16 | xtensa \
 | 
			
		||||
	| z8k | z80)
 | 
			
		||||
		basic_machine=$basic_machine-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	m6811 | m68hc11 | m6812 | m68hc12)
 | 
			
		||||
		# Motorola 68HC11/12.
 | 
			
		||||
	c54x)
 | 
			
		||||
		basic_machine=tic54x-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	c55x)
 | 
			
		||||
		basic_machine=tic55x-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	c6x)
 | 
			
		||||
		basic_machine=tic6x-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
 | 
			
		||||
		basic_machine=$basic_machine-unknown
 | 
			
		||||
		os=-none
 | 
			
		||||
		;;
 | 
			
		||||
@@ -300,6 +338,21 @@ case $basic_machine in
 | 
			
		||||
		basic_machine=mt-unknown
 | 
			
		||||
		;;
 | 
			
		||||
 | 
			
		||||
	strongarm | thumb | xscale)
 | 
			
		||||
		basic_machine=arm-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	xgate)
 | 
			
		||||
		basic_machine=$basic_machine-unknown
 | 
			
		||||
		os=-none
 | 
			
		||||
		;;
 | 
			
		||||
	xscaleeb)
 | 
			
		||||
		basic_machine=armeb-unknown
 | 
			
		||||
		;;
 | 
			
		||||
 | 
			
		||||
	xscaleel)
 | 
			
		||||
		basic_machine=armel-unknown
 | 
			
		||||
		;;
 | 
			
		||||
 | 
			
		||||
	# We use `pc' rather than `unknown'
 | 
			
		||||
	# because (1) that's what they normally are, and
 | 
			
		||||
	# (2) the word "unknown" tends to confuse beginning users.
 | 
			
		||||
@@ -314,29 +367,36 @@ case $basic_machine in
 | 
			
		||||
	# Recognize the basic CPU types with company name.
 | 
			
		||||
	580-* \
 | 
			
		||||
	| a29k-* \
 | 
			
		||||
	| aarch64-* | aarch64_be-* \
 | 
			
		||||
	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 | 
			
		||||
	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 | 
			
		||||
	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 | 
			
		||||
	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 | 
			
		||||
	| avr-* | avr32-* \
 | 
			
		||||
	| be32-* | be64-* \
 | 
			
		||||
	| bfin-* | bs2000-* \
 | 
			
		||||
	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
 | 
			
		||||
	| c[123]* | c30-* | [cjt]90-* | c4x-* \
 | 
			
		||||
	| clipper-* | craynv-* | cydra-* \
 | 
			
		||||
	| d10v-* | d30v-* | dlx-* \
 | 
			
		||||
	| 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-* \
 | 
			
		||||
	| le32-* | le64-* \
 | 
			
		||||
	| lm32-* \
 | 
			
		||||
	| m32c-* | m32r-* | m32rle-* \
 | 
			
		||||
	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
 | 
			
		||||
	| m88110-* | m88k-* | maxq-* | mcore-* \
 | 
			
		||||
	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
 | 
			
		||||
	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 | 
			
		||||
	| mips16-* \
 | 
			
		||||
	| mips64-* | mips64el-* \
 | 
			
		||||
	| mips64vr-* | mips64vrel-* \
 | 
			
		||||
	| mips64octeon-* | mips64octeonel-* \
 | 
			
		||||
	| mips64orion-* | mips64orionel-* \
 | 
			
		||||
	| mips64r5900-* | mips64r5900el-* \
 | 
			
		||||
	| mips64vr-* | mips64vrel-* \
 | 
			
		||||
	| mips64vr4100-* | mips64vr4100el-* \
 | 
			
		||||
	| mips64vr4300-* | mips64vr4300el-* \
 | 
			
		||||
	| mips64vr5000-* | mips64vr5000el-* \
 | 
			
		||||
@@ -351,27 +411,32 @@ case $basic_machine in
 | 
			
		||||
	| mmix-* \
 | 
			
		||||
	| mt-* \
 | 
			
		||||
	| msp430-* \
 | 
			
		||||
	| nds32-* | nds32le-* | nds32be-* \
 | 
			
		||||
	| nios-* | nios2-* \
 | 
			
		||||
	| none-* | np1-* | ns16k-* | ns32k-* \
 | 
			
		||||
	| open8-* \
 | 
			
		||||
	| orion-* \
 | 
			
		||||
	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 | 
			
		||||
	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 | 
			
		||||
	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 | 
			
		||||
	| pyramid-* \
 | 
			
		||||
	| romp-* | rs6000-* \
 | 
			
		||||
	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 | 
			
		||||
	| 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-* | strongarm-* | sv1-* | sx?-* \
 | 
			
		||||
	| tahoe-* | thumb-* \
 | 
			
		||||
	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
 | 
			
		||||
	| tahoe-* \
 | 
			
		||||
	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
 | 
			
		||||
	| tile*-* \
 | 
			
		||||
	| tron-* \
 | 
			
		||||
	| v850-* | v850e-* | vax-* \
 | 
			
		||||
	| ubicom32-* \
 | 
			
		||||
	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
 | 
			
		||||
	| vax-* \
 | 
			
		||||
	| we32k-* \
 | 
			
		||||
	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
 | 
			
		||||
	| x86-* | x86_64-* | xc16x-* | xps100-* \
 | 
			
		||||
	| xstormy16-* | xtensa*-* \
 | 
			
		||||
	| ymp-* \
 | 
			
		||||
	| z8k-*)
 | 
			
		||||
	| z8k-* | z80-*)
 | 
			
		||||
		;;
 | 
			
		||||
	# Recognize the basic CPU types without company name, with glob match.
 | 
			
		||||
	xtensa*)
 | 
			
		||||
@@ -393,7 +458,7 @@ case $basic_machine in
 | 
			
		||||
		basic_machine=a29k-amd
 | 
			
		||||
		os=-udi
 | 
			
		||||
		;;
 | 
			
		||||
    	abacus)
 | 
			
		||||
	abacus)
 | 
			
		||||
		basic_machine=abacus-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	adobe68k)
 | 
			
		||||
@@ -439,6 +504,10 @@ case $basic_machine in
 | 
			
		||||
		basic_machine=m68k-apollo
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	aros)
 | 
			
		||||
		basic_machine=i386-pc
 | 
			
		||||
		os=-aros
 | 
			
		||||
		;;
 | 
			
		||||
	aux)
 | 
			
		||||
		basic_machine=m68k-apple
 | 
			
		||||
		os=-aux
 | 
			
		||||
@@ -455,10 +524,27 @@ case $basic_machine in
 | 
			
		||||
		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
		os=-linux
 | 
			
		||||
		;;
 | 
			
		||||
	bluegene*)
 | 
			
		||||
		basic_machine=powerpc-ibm
 | 
			
		||||
		os=-cnk
 | 
			
		||||
		;;
 | 
			
		||||
	c54x-*)
 | 
			
		||||
		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
		;;
 | 
			
		||||
	c55x-*)
 | 
			
		||||
		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
		;;
 | 
			
		||||
	c6x-*)
 | 
			
		||||
		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
		;;
 | 
			
		||||
	c90)
 | 
			
		||||
		basic_machine=c90-cray
 | 
			
		||||
		os=-unicos
 | 
			
		||||
		;;
 | 
			
		||||
	cegcc)
 | 
			
		||||
		basic_machine=arm-unknown
 | 
			
		||||
		os=-cegcc
 | 
			
		||||
		;;
 | 
			
		||||
	convex-c1)
 | 
			
		||||
		basic_machine=c1-convex
 | 
			
		||||
		os=-bsd
 | 
			
		||||
@@ -487,7 +573,7 @@ case $basic_machine in
 | 
			
		||||
		basic_machine=craynv-cray
 | 
			
		||||
		os=-unicosmp
 | 
			
		||||
		;;
 | 
			
		||||
	cr16)
 | 
			
		||||
	cr16 | cr16-*)
 | 
			
		||||
		basic_machine=cr16-unknown
 | 
			
		||||
		os=-elf
 | 
			
		||||
		;;
 | 
			
		||||
@@ -526,6 +612,10 @@ case $basic_machine in
 | 
			
		||||
		basic_machine=m88k-motorola
 | 
			
		||||
		os=-sysv3
 | 
			
		||||
		;;
 | 
			
		||||
	dicos)
 | 
			
		||||
		basic_machine=i686-pc
 | 
			
		||||
		os=-dicos
 | 
			
		||||
		;;
 | 
			
		||||
	djgpp)
 | 
			
		||||
		basic_machine=i586-pc
 | 
			
		||||
		os=-msdosdjgpp
 | 
			
		||||
@@ -641,7 +731,6 @@ case $basic_machine in
 | 
			
		||||
	i370-ibm* | ibm*)
 | 
			
		||||
		basic_machine=i370-ibm
 | 
			
		||||
		;;
 | 
			
		||||
# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 | 
			
		||||
	i*86v32)
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 | 
			
		||||
		os=-sysv32
 | 
			
		||||
@@ -699,6 +788,13 @@ case $basic_machine in
 | 
			
		||||
		basic_machine=ns32k-utek
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	microblaze)
 | 
			
		||||
		basic_machine=microblaze-xilinx
 | 
			
		||||
		;;
 | 
			
		||||
	mingw64)
 | 
			
		||||
		basic_machine=x86_64-pc
 | 
			
		||||
		os=-mingw64
 | 
			
		||||
		;;
 | 
			
		||||
	mingw32)
 | 
			
		||||
		basic_machine=i386-pc
 | 
			
		||||
		os=-mingw32
 | 
			
		||||
@@ -735,10 +831,18 @@ case $basic_machine in
 | 
			
		||||
	ms1-*)
 | 
			
		||||
		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 | 
			
		||||
		;;
 | 
			
		||||
	msys)
 | 
			
		||||
		basic_machine=i386-pc
 | 
			
		||||
		os=-msys
 | 
			
		||||
		;;
 | 
			
		||||
	mvs)
 | 
			
		||||
		basic_machine=i370-ibm
 | 
			
		||||
		os=-mvs
 | 
			
		||||
		;;
 | 
			
		||||
	nacl)
 | 
			
		||||
		basic_machine=le32-unknown
 | 
			
		||||
		os=-nacl
 | 
			
		||||
		;;
 | 
			
		||||
	ncr3000)
 | 
			
		||||
		basic_machine=i486-ncr
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
@@ -803,6 +907,12 @@ case $basic_machine in
 | 
			
		||||
	np1)
 | 
			
		||||
		basic_machine=np1-gould
 | 
			
		||||
		;;
 | 
			
		||||
	neo-tandem)
 | 
			
		||||
		basic_machine=neo-tandem
 | 
			
		||||
		;;
 | 
			
		||||
	nse-tandem)
 | 
			
		||||
		basic_machine=nse-tandem
 | 
			
		||||
		;;
 | 
			
		||||
	nsr-tandem)
 | 
			
		||||
		basic_machine=nsr-tandem
 | 
			
		||||
		;;
 | 
			
		||||
@@ -885,9 +995,10 @@ case $basic_machine in
 | 
			
		||||
		;;
 | 
			
		||||
	power)	basic_machine=power-ibm
 | 
			
		||||
		;;
 | 
			
		||||
	ppc)	basic_machine=powerpc-unknown
 | 
			
		||||
	ppc | ppcbe)	basic_machine=powerpc-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
	ppc-* | ppcbe-*)
 | 
			
		||||
		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
		;;
 | 
			
		||||
	ppcle | powerpclittle | ppc-le | powerpc-little)
 | 
			
		||||
		basic_machine=powerpcle-unknown
 | 
			
		||||
@@ -981,6 +1092,9 @@ case $basic_machine in
 | 
			
		||||
		basic_machine=i860-stratus
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
		;;
 | 
			
		||||
	strongarm-* | thumb-*)
 | 
			
		||||
		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
		;;
 | 
			
		||||
	sun2)
 | 
			
		||||
		basic_machine=m68000-sun
 | 
			
		||||
		;;
 | 
			
		||||
@@ -1037,20 +1151,8 @@ case $basic_machine in
 | 
			
		||||
		basic_machine=t90-cray
 | 
			
		||||
		os=-unicos
 | 
			
		||||
		;;
 | 
			
		||||
	tic54x | c54x*)
 | 
			
		||||
		basic_machine=tic54x-unknown
 | 
			
		||||
		os=-coff
 | 
			
		||||
		;;
 | 
			
		||||
	tic55x | c55x*)
 | 
			
		||||
		basic_machine=tic55x-unknown
 | 
			
		||||
		os=-coff
 | 
			
		||||
		;;
 | 
			
		||||
	tic6x | c6x*)
 | 
			
		||||
		basic_machine=tic6x-unknown
 | 
			
		||||
		os=-coff
 | 
			
		||||
		;;
 | 
			
		||||
	tile*)
 | 
			
		||||
		basic_machine=tile-unknown
 | 
			
		||||
		basic_machine=$basic_machine-unknown
 | 
			
		||||
		os=-linux-gnu
 | 
			
		||||
		;;
 | 
			
		||||
	tx39)
 | 
			
		||||
@@ -1120,6 +1222,9 @@ case $basic_machine in
 | 
			
		||||
	xps | xps100)
 | 
			
		||||
		basic_machine=xps100-honeywell
 | 
			
		||||
		;;
 | 
			
		||||
	xscale-* | xscalee[bl]-*)
 | 
			
		||||
		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
 | 
			
		||||
		;;
 | 
			
		||||
	ymp)
 | 
			
		||||
		basic_machine=ymp-cray
 | 
			
		||||
		os=-unicos
 | 
			
		||||
@@ -1128,6 +1233,10 @@ case $basic_machine in
 | 
			
		||||
		basic_machine=z8k-unknown
 | 
			
		||||
		os=-sim
 | 
			
		||||
		;;
 | 
			
		||||
	z80-*-coff)
 | 
			
		||||
		basic_machine=z80-unknown
 | 
			
		||||
		os=-sim
 | 
			
		||||
		;;
 | 
			
		||||
	none)
 | 
			
		||||
		basic_machine=none-none
 | 
			
		||||
		os=-none
 | 
			
		||||
@@ -1166,7 +1275,7 @@ case $basic_machine in
 | 
			
		||||
	we32k)
 | 
			
		||||
		basic_machine=we32k-att
 | 
			
		||||
		;;
 | 
			
		||||
	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
 | 
			
		||||
	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
 | 
			
		||||
		basic_machine=sh-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
 | 
			
		||||
@@ -1213,9 +1322,12 @@ esac
 | 
			
		||||
if [ x"$os" != x"" ]
 | 
			
		||||
then
 | 
			
		||||
case $os in
 | 
			
		||||
        # First match some system type aliases
 | 
			
		||||
        # that might get confused with valid system types.
 | 
			
		||||
	# First match some system type aliases
 | 
			
		||||
	# that might get confused with valid system types.
 | 
			
		||||
	# -solaris* is a basic system type, with this one exception.
 | 
			
		||||
	-auroraux)
 | 
			
		||||
		os=-auroraux
 | 
			
		||||
		;;
 | 
			
		||||
	-solaris1 | -solaris1.*)
 | 
			
		||||
		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 | 
			
		||||
		;;
 | 
			
		||||
@@ -1236,21 +1348,23 @@ case $os in
 | 
			
		||||
	# Each alternative MUST END IN A *, to match a version number.
 | 
			
		||||
	# -sysv* is not here because it comes later, after sysvr4.
 | 
			
		||||
	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 | 
			
		||||
	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
 | 
			
		||||
	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
 | 
			
		||||
	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
 | 
			
		||||
	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
 | 
			
		||||
	      | -sym* | -kopensolaris* \
 | 
			
		||||
	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 | 
			
		||||
	      | -aos* \
 | 
			
		||||
	      | -aos* | -aros* \
 | 
			
		||||
	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 | 
			
		||||
	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 | 
			
		||||
	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
 | 
			
		||||
	      | -openbsd* | -solidbsd* \
 | 
			
		||||
	      | -bitrig* | -openbsd* | -solidbsd* \
 | 
			
		||||
	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 | 
			
		||||
	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 | 
			
		||||
	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 | 
			
		||||
	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 | 
			
		||||
	      | -chorusos* | -chorusrdb* \
 | 
			
		||||
	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 | 
			
		||||
	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
 | 
			
		||||
	      | -chorusos* | -chorusrdb* | -cegcc* \
 | 
			
		||||
	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 | 
			
		||||
	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
 | 
			
		||||
	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
 | 
			
		||||
	      | -uxpv* | -beos* | -mpeix* | -udk* \
 | 
			
		||||
	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 | 
			
		||||
	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 | 
			
		||||
@@ -1258,7 +1372,7 @@ case $os in
 | 
			
		||||
	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 | 
			
		||||
	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 | 
			
		||||
	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
 | 
			
		||||
	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
 | 
			
		||||
	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
 | 
			
		||||
	# Remember, each alternative MUST END IN *, to match a version number.
 | 
			
		||||
		;;
 | 
			
		||||
	-qnx*)
 | 
			
		||||
@@ -1297,7 +1411,7 @@ case $os in
 | 
			
		||||
	-opened*)
 | 
			
		||||
		os=-openedition
 | 
			
		||||
		;;
 | 
			
		||||
        -os400*)
 | 
			
		||||
	-os400*)
 | 
			
		||||
		os=-os400
 | 
			
		||||
		;;
 | 
			
		||||
	-wince*)
 | 
			
		||||
@@ -1346,7 +1460,7 @@ case $os in
 | 
			
		||||
	-sinix*)
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
		;;
 | 
			
		||||
        -tpf*)
 | 
			
		||||
	-tpf*)
 | 
			
		||||
		os=-tpf
 | 
			
		||||
		;;
 | 
			
		||||
	-triton*)
 | 
			
		||||
@@ -1388,6 +1502,11 @@ case $os in
 | 
			
		||||
	-zvmoe)
 | 
			
		||||
		os=-zvmoe
 | 
			
		||||
		;;
 | 
			
		||||
	-dicos*)
 | 
			
		||||
		os=-dicos
 | 
			
		||||
		;;
 | 
			
		||||
	-nacl*)
 | 
			
		||||
		;;
 | 
			
		||||
	-none)
 | 
			
		||||
		;;
 | 
			
		||||
	*)
 | 
			
		||||
@@ -1410,10 +1529,10 @@ else
 | 
			
		||||
# system, and we'll never get to this point.
 | 
			
		||||
 | 
			
		||||
case $basic_machine in
 | 
			
		||||
        score-*)
 | 
			
		||||
	score-*)
 | 
			
		||||
		os=-elf
 | 
			
		||||
		;;
 | 
			
		||||
        spu-*)
 | 
			
		||||
	spu-*)
 | 
			
		||||
		os=-elf
 | 
			
		||||
		;;
 | 
			
		||||
	*-acorn)
 | 
			
		||||
@@ -1425,8 +1544,20 @@ case $basic_machine in
 | 
			
		||||
	arm*-semi)
 | 
			
		||||
		os=-aout
 | 
			
		||||
		;;
 | 
			
		||||
        c4x-* | tic4x-*)
 | 
			
		||||
        	os=-coff
 | 
			
		||||
	c4x-* | tic4x-*)
 | 
			
		||||
		os=-coff
 | 
			
		||||
		;;
 | 
			
		||||
	hexagon-*)
 | 
			
		||||
		os=-elf
 | 
			
		||||
		;;
 | 
			
		||||
	tic54x-*)
 | 
			
		||||
		os=-coff
 | 
			
		||||
		;;
 | 
			
		||||
	tic55x-*)
 | 
			
		||||
		os=-coff
 | 
			
		||||
		;;
 | 
			
		||||
	tic6x-*)
 | 
			
		||||
		os=-coff
 | 
			
		||||
		;;
 | 
			
		||||
	# This must come before the *-dec entry.
 | 
			
		||||
	pdp10-*)
 | 
			
		||||
@@ -1446,14 +1577,11 @@ case $basic_machine in
 | 
			
		||||
		;;
 | 
			
		||||
	m68000-sun)
 | 
			
		||||
		os=-sunos3
 | 
			
		||||
		# This also exists in the configure program, but was not the
 | 
			
		||||
		# default.
 | 
			
		||||
		# os=-sunos4
 | 
			
		||||
		;;
 | 
			
		||||
	m68*-cisco)
 | 
			
		||||
		os=-aout
 | 
			
		||||
		;;
 | 
			
		||||
        mep-*)
 | 
			
		||||
	mep-*)
 | 
			
		||||
		os=-elf
 | 
			
		||||
		;;
 | 
			
		||||
	mips*-cisco)
 | 
			
		||||
@@ -1480,7 +1608,7 @@ case $basic_machine in
 | 
			
		||||
	*-ibm)
 | 
			
		||||
		os=-aix
 | 
			
		||||
		;;
 | 
			
		||||
    	*-knuth)
 | 
			
		||||
	*-knuth)
 | 
			
		||||
		os=-mmixware
 | 
			
		||||
		;;
 | 
			
		||||
	*-wec)
 | 
			
		||||
@@ -1585,7 +1713,7 @@ case $basic_machine in
 | 
			
		||||
			-sunos*)
 | 
			
		||||
				vendor=sun
 | 
			
		||||
				;;
 | 
			
		||||
			-aix*)
 | 
			
		||||
			-cnk*|-aix*)
 | 
			
		||||
				vendor=ibm
 | 
			
		||||
				;;
 | 
			
		||||
			-beos*)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
#
 | 
			
		||||
# ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
# Copyright (c)2001-2011 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
 | 
			
		||||
@@ -9,46 +9,60 @@
 | 
			
		||||
# Please read the file COPYING, README and AUTHORS for more information.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
define(VERSION_ID,esyscmd(git describe|sed -e 's/rel-//g'|sed -e 's/-/~/'|tr -d \\n))
 | 
			
		||||
define(VERSION_ID,esyscmd([
 | 
			
		||||
	V=`git describe 2>/dev/null | sed -e 's/rel-//g' | sed -e 's/-/~/'`;
 | 
			
		||||
	[ -z "$V" -a -r configure ] \
 | 
			
		||||
		&& V=`grep "PACKAGE_STRING=" configure | cut -d"'" -f2 | cut -d' ' -f2`
 | 
			
		||||
	( [ -n "$V" ] && echo "$V" || echo "??" ) | tr -d '\n';
 | 
			
		||||
]))
 | 
			
		||||
 | 
			
		||||
m4_ifdef([AM_SILENT_RULES],
 | 
			
		||||
	[m4_define([ng_color_tests], [color-tests])],
 | 
			
		||||
	[m4_define([ng_color_tests], [])])
 | 
			
		||||
 | 
			
		||||
# -- Initialisation --
 | 
			
		||||
 | 
			
		||||
AC_PREREQ(2.50)
 | 
			
		||||
AC_INIT(ngircd, VERSION_ID)
 | 
			
		||||
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
 | 
			
		||||
AC_CANONICAL_TARGET
 | 
			
		||||
AM_INIT_AUTOMAKE(1.6)
 | 
			
		||||
AM_CONFIG_HEADER(src/config.h)
 | 
			
		||||
AC_PREREQ([2.61])
 | 
			
		||||
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])
 | 
			
		||||
AC_CANONICAL_HOST
 | 
			
		||||
 | 
			
		||||
AM_INIT_AUTOMAKE([-Wall 1.10 ]ng_color_tests)
 | 
			
		||||
 | 
			
		||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 | 
			
		||||
 | 
			
		||||
# -- Templates for config.h --
 | 
			
		||||
 | 
			
		||||
AH_TEMPLATE([DEBUG], [Define if debug-mode should be enabled])
 | 
			
		||||
AH_TEMPLATE([HAVE_sockaddr_in_len], [Define if sockaddr_in.sin_len exists])
 | 
			
		||||
AH_TEMPLATE([HAVE_socklen_t], [Define if socklen_t exists])
 | 
			
		||||
AH_TEMPLATE([ICONV], [Define if libiconv can be used, e.g. for CHARCONV])
 | 
			
		||||
AH_TEMPLATE([IDENTAUTH], [Define if the server should do IDENT requests])
 | 
			
		||||
AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
 | 
			
		||||
AH_TEMPLATE([PAM], [Define if PAM should be used])
 | 
			
		||||
AH_TEMPLATE([SNIFFER], [Define if IRC sniffer should be enabled])
 | 
			
		||||
AH_TEMPLATE([STRICT_RFC], [Define if ngIRCd should behave strict RFC compliant])
 | 
			
		||||
AH_TEMPLATE([SYSLOG], [Define if syslog should be used for logging])
 | 
			
		||||
AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled])
 | 
			
		||||
AH_TEMPLATE([TCPWRAP], [Define if TCP wrappers should be used])
 | 
			
		||||
AH_TEMPLATE([IRCPLUS], [Define if IRC+ protocol should be used])
 | 
			
		||||
AH_TEMPLATE([WANT_IPV6], [Define if IPV6 protocol should be enabled])
 | 
			
		||||
AH_TEMPLATE([IDENTAUTH], [Define if the server should do IDENT requests])
 | 
			
		||||
AH_TEMPLATE([PAM], [Define if PAM should be used])
 | 
			
		||||
AH_TEMPLATE([HAVE_sockaddr_in_len], [Define if sockaddr_in.sin_len exists])
 | 
			
		||||
AH_TEMPLATE([ZLIB], [Define if zlib compression should be enabled])
 | 
			
		||||
 | 
			
		||||
AH_TEMPLATE([TARGET_OS], [Target operating system name])
 | 
			
		||||
AH_TEMPLATE([TARGET_VENDOR], [Target system vendor])
 | 
			
		||||
AH_TEMPLATE([TARGET_CPU], [Target CPU name])
 | 
			
		||||
AH_TEMPLATE([HOST_OS], [Target operating system name])
 | 
			
		||||
AH_TEMPLATE([HOST_VENDOR], [Target system vendor])
 | 
			
		||||
AH_TEMPLATE([HOST_CPU], [Target CPU name])
 | 
			
		||||
 | 
			
		||||
# -- C Compiler --
 | 
			
		||||
 | 
			
		||||
AC_PROG_CC
 | 
			
		||||
AC_PROG_CC_STDC
 | 
			
		||||
AC_C_PROTOTYPES
 | 
			
		||||
 | 
			
		||||
# -- Helper programs --
 | 
			
		||||
 | 
			
		||||
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 | 
			
		||||
 | 
			
		||||
AC_PROG_AWK
 | 
			
		||||
AC_PROG_INSTALL
 | 
			
		||||
AC_PROG_LN_S
 | 
			
		||||
@@ -57,9 +71,9 @@ AC_PROG_RANLIB
 | 
			
		||||
 | 
			
		||||
# -- Compiler Features --
 | 
			
		||||
 | 
			
		||||
AM_C_PROTOTYPES
 | 
			
		||||
AC_C_CONST
 | 
			
		||||
AC_C_INLINE
 | 
			
		||||
__ng_PROTOTYPES__
 | 
			
		||||
 | 
			
		||||
# -- Hard coded system and compiler dependencies/features/options ... --
 | 
			
		||||
 | 
			
		||||
@@ -85,7 +99,7 @@ if test "$GCC" = "yes"; then
 | 
			
		||||
	GCC_STACK_PROTECT_CC
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
case "$target_os" in
 | 
			
		||||
case "$host_os" in
 | 
			
		||||
	hpux*)
 | 
			
		||||
		# This is HP/UX, we need to define _XOPEN_SOURCE_EXTENDED
 | 
			
		||||
		# (tested with HP/UX 11.11)
 | 
			
		||||
@@ -96,33 +110,25 @@ 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 --
 | 
			
		||||
 | 
			
		||||
AC_HEADER_STDC
 | 
			
		||||
AC_HEADER_TIME
 | 
			
		||||
AC_HEADER_SYS_WAIT
 | 
			
		||||
AC_HEADER_TIME
 | 
			
		||||
 | 
			
		||||
# Required header files
 | 
			
		||||
AC_CHECK_HEADERS([ \
 | 
			
		||||
	ctype.h errno.h 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 unistd.h \
 | 
			
		||||
	],,AC_MSG_ERROR([required C header missing!]))
 | 
			
		||||
 | 
			
		||||
AC_CHECK_HEADERS([ \
 | 
			
		||||
	arpa/inet.h ctype.h malloc.h netinet/ip.h stdbool.h stddef.h varargs.h \
 | 
			
		||||
	],[],[],[[
 | 
			
		||||
	#ifdef HAVE_SYS_TYPES_H
 | 
			
		||||
		#include <sys/types.h>
 | 
			
		||||
	#endif
 | 
			
		||||
	#ifdef HAVE_SYS_SOCKET_H
 | 
			
		||||
		#include <sys/socket.h>
 | 
			
		||||
	#endif
 | 
			
		||||
	#ifdef HAVE_NETINET_IN_H
 | 
			
		||||
		#include <netinet/in.h>
 | 
			
		||||
	#endif
 | 
			
		||||
	]]
 | 
			
		||||
)
 | 
			
		||||
# Optional header files
 | 
			
		||||
AC_CHECK_HEADERS_ONCE([ \
 | 
			
		||||
	arpa/inet.h inttypes.h malloc.h netinet/in_systm.h netinet/ip.h \
 | 
			
		||||
	stdbool.h stddef.h stdint.h varargs.h \
 | 
			
		||||
	])
 | 
			
		||||
 | 
			
		||||
# -- Datatypes --
 | 
			
		||||
 | 
			
		||||
@@ -139,33 +145,51 @@ AC_TRY_COMPILE([
 | 
			
		||||
	AC_MSG_RESULT(no)
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
AC_TYPE_PID_T
 | 
			
		||||
AC_TYPE_SIGNAL
 | 
			
		||||
AC_TYPE_SIZE_T
 | 
			
		||||
AC_TYPE_SSIZE_T
 | 
			
		||||
AC_TYPE_UID_T
 | 
			
		||||
AC_TYPE_UINT16_T
 | 
			
		||||
AC_TYPE_UINT32_T
 | 
			
		||||
AC_TYPE_UINT8_T
 | 
			
		||||
 | 
			
		||||
AC_CHECK_MEMBER([struct sockaddr_in.sin_len], AC_DEFINE(HAVE_sockaddr_in_len),,
 | 
			
		||||
 [#include <arpa/inet.h>])
 | 
			
		||||
 | 
			
		||||
# -- Libraries --
 | 
			
		||||
 | 
			
		||||
# A/UX needs this.
 | 
			
		||||
AC_CHECK_LIB(UTIL,memmove)
 | 
			
		||||
# needed on solaris. GNU libc also has a libnsl, but we do not need it.
 | 
			
		||||
AC_SEARCH_LIBS(gethostbyname,nsl)
 | 
			
		||||
AC_CHECK_LIB(socket,bind)
 | 
			
		||||
# memmove: A/UX libUTIL
 | 
			
		||||
AC_SEARCH_LIBS([memmove], [UTIL], [], [
 | 
			
		||||
	AC_MSG_ERROR([unable to find the memmove() function])
 | 
			
		||||
])
 | 
			
		||||
# gethostbyname: Solaris libnsl
 | 
			
		||||
AC_SEARCH_LIBS([gethostbyname], [bind nsl network], [], [
 | 
			
		||||
	AC_MSG_ERROR([unable to find the gethostbyname() function])
 | 
			
		||||
])
 | 
			
		||||
# bind: SVR4 libsocket
 | 
			
		||||
AC_SEARCH_LIBS([bind], [socket network], [], [
 | 
			
		||||
	AC_MSG_ERROR([unable to find the bind() function])
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
# -- Functions --
 | 
			
		||||
 | 
			
		||||
AC_FUNC_FORK
 | 
			
		||||
AC_FUNC_STRFTIME
 | 
			
		||||
 | 
			
		||||
# Required functions
 | 
			
		||||
AC_CHECK_FUNCS([ \
 | 
			
		||||
	bind gethostbyaddr gethostbyname gethostname inet_ntoa \
 | 
			
		||||
	setsid setsockopt socket strcasecmp waitpid],,
 | 
			
		||||
	alarm dup2 endpwent gethostbyaddr gethostbyname gethostname \
 | 
			
		||||
	gettimeofday inet_ntoa memmove memset setsid socket strcasecmp \
 | 
			
		||||
	strchr strcspn strerror strncasecmp strrchr strspn strstr \
 | 
			
		||||
	],,
 | 
			
		||||
	AC_MSG_ERROR([required function missing!]))
 | 
			
		||||
 | 
			
		||||
AC_CHECK_FUNCS([ \
 | 
			
		||||
	gai_strerror getaddrinfo getnameinfo inet_aton sigaction \
 | 
			
		||||
	sigprocmask snprintf vsnprintf strdup strlcpy strlcat strtok_r])
 | 
			
		||||
# Optional functions
 | 
			
		||||
AC_CHECK_FUNCS_ONCE([ \
 | 
			
		||||
	arc4random gai_strerror getaddrinfo getnameinfo inet_aton sigaction \
 | 
			
		||||
	sigprocmask snprintf vsnprintf strdup strndup strlcpy strlcat strtok_r \
 | 
			
		||||
	waitpid])
 | 
			
		||||
 | 
			
		||||
# -- Configuration options --
 | 
			
		||||
 | 
			
		||||
@@ -173,22 +197,20 @@ AC_CHECK_FUNCS([ \
 | 
			
		||||
 | 
			
		||||
x_syslog_on=no
 | 
			
		||||
AC_ARG_WITH(syslog,
 | 
			
		||||
	[  --without-syslog        disable syslog (autodetected by default)],
 | 
			
		||||
	AS_HELP_STRING([--without-syslog],
 | 
			
		||||
		       [disable syslog (autodetected by default)]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
				CPPFLAGS="-I$withval/include $CPPFLAGS"
 | 
			
		||||
				LDFLAGS="-L$withval/lib $LDFLAGS"
 | 
			
		||||
			fi
 | 
			
		||||
			AC_CHECK_LIB(be, syslog)
 | 
			
		||||
			AC_CHECK_FUNCS(syslog, x_syslog_on=yes,
 | 
			
		||||
			AC_SEARCH_LIBS([syslog], [be], [x_syslog_on=yes], [
 | 
			
		||||
				AC_MSG_ERROR([Can't enable syslog!])
 | 
			
		||||
			)
 | 
			
		||||
			])
 | 
			
		||||
		fi
 | 
			
		||||
	],
 | 
			
		||||
	[
 | 
			
		||||
		AC_CHECK_LIB(be, syslog)
 | 
			
		||||
		AC_CHECK_FUNCS(syslog, x_syslog_on=yes)
 | 
			
		||||
	[	AC_SEARCH_LIBS([syslog], [be], [x_syslog_on=yes])
 | 
			
		||||
	]
 | 
			
		||||
)
 | 
			
		||||
if test "$x_syslog_on" = "yes"; then
 | 
			
		||||
@@ -200,7 +222,8 @@ fi
 | 
			
		||||
 | 
			
		||||
x_zlib_on=no
 | 
			
		||||
AC_ARG_WITH(zlib,
 | 
			
		||||
	[  --without-zlib          disable zlib compression (autodetected by default)],
 | 
			
		||||
	AS_HELP_STRING([--without-zlib],
 | 
			
		||||
		       [disable zlib compression (autodetected by default)]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -227,7 +250,8 @@ fi
 | 
			
		||||
x_io_backend=none
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(select,
 | 
			
		||||
	[  --without-select        disable select IO support (autodetected by default)],
 | 
			
		||||
	AS_HELP_STRING([--without-select],
 | 
			
		||||
		       [disable select IO support (autodetected by default)]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -245,7 +269,8 @@ AC_ARG_WITH(select,
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(poll,
 | 
			
		||||
	[  --without-poll          disable poll support (autodetected by default)],
 | 
			
		||||
	AS_HELP_STRING([--without-poll],
 | 
			
		||||
		       [disable poll support (autodetected by default)]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -271,7 +296,8 @@ AC_ARG_WITH(poll,
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(devpoll,
 | 
			
		||||
	[  --without-devpoll       disable /dev/poll IO support (autodetected by default)],
 | 
			
		||||
	AS_HELP_STRING([--without-devpoll],
 | 
			
		||||
		       [disable /dev/poll IO support (autodetected by default)]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -288,7 +314,8 @@ AC_ARG_WITH(devpoll,
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(epoll,
 | 
			
		||||
	[  --without-epoll         disable epoll IO support (autodetected by default)],
 | 
			
		||||
	AS_HELP_STRING([--without-epoll],
 | 
			
		||||
		       [disable epoll IO support (autodetected by default)]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -306,7 +333,8 @@ AC_ARG_WITH(epoll,
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(kqueue,
 | 
			
		||||
	[  --without-kqueue        disable kqueue IO support (autodetected by default)],
 | 
			
		||||
	AS_HELP_STRING([--without-kqueue],
 | 
			
		||||
		       [disable kqueue IO support (autodetected by default)]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -346,7 +374,8 @@ fi
 | 
			
		||||
# use SSL?
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(openssl,
 | 
			
		||||
	[  --with-openssl          enable SSL support using OpenSSL],
 | 
			
		||||
	AS_HELP_STRING([--with-openssl],
 | 
			
		||||
		       [enable SSL support using OpenSSL]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -363,7 +392,8 @@ AC_ARG_WITH(openssl,
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(gnutls,
 | 
			
		||||
	[  --with-gnutls           enable SSL support using gnutls],
 | 
			
		||||
	AS_HELP_STRING([--with-gnutls],
 | 
			
		||||
		       [enable SSL support using gnutls]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -393,7 +423,8 @@ fi
 | 
			
		||||
 | 
			
		||||
x_tcpwrap_on=no
 | 
			
		||||
AC_ARG_WITH(tcp-wrappers,
 | 
			
		||||
	[  --with-tcp-wrappers     enable TCP wrappers support],
 | 
			
		||||
	AS_HELP_STRING([--with-tcp-wrappers],
 | 
			
		||||
		       [enable TCP wrappers support]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -424,7 +455,8 @@ int deny_severity = 0;
 | 
			
		||||
 | 
			
		||||
x_identauth_on=no
 | 
			
		||||
AC_ARG_WITH(ident,
 | 
			
		||||
	[  --with-ident            enable "IDENT" ("AUTH") protocol support],
 | 
			
		||||
	AS_HELP_STRING([--with-ident],
 | 
			
		||||
		       [enable "IDENT" ("AUTH") protocol support]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -447,7 +479,8 @@ fi
 | 
			
		||||
 | 
			
		||||
x_pam_on=no
 | 
			
		||||
AC_ARG_WITH(pam,
 | 
			
		||||
	[  --with-pam              enable user authentication using PAM],
 | 
			
		||||
	AS_HELP_STRING([--with-pam],
 | 
			
		||||
		       [enable user authentication using PAM]),
 | 
			
		||||
	[	if test "$withval" != "no"; then
 | 
			
		||||
			if test "$withval" != "yes"; then
 | 
			
		||||
				CFLAGS="-I$withval/include $CFLAGS"
 | 
			
		||||
@@ -474,17 +507,47 @@ fi
 | 
			
		||||
 | 
			
		||||
x_ircplus_on=yes
 | 
			
		||||
AC_ARG_ENABLE(ircplus,
 | 
			
		||||
	[  --disable-ircplus       disable IRC+ protocol],
 | 
			
		||||
	AS_HELP_STRING([--disable-ircplus],
 | 
			
		||||
		       [disable IRC+ protocol]),
 | 
			
		||||
	if test "$enableval" = "no"; then x_ircplus_on=no; fi
 | 
			
		||||
)
 | 
			
		||||
if test "$x_ircplus_on" = "yes"; then
 | 
			
		||||
	AC_DEFINE(IRCPLUS, 1)
 | 
			
		||||
 | 
			
		||||
	# Compile in iconv support?
 | 
			
		||||
	# We only check for it when IRC+ is enabled, because the IRC+ command
 | 
			
		||||
	# CHARCONV is the only function depending on it.
 | 
			
		||||
	x_iconv_on=no
 | 
			
		||||
	AC_ARG_WITH(iconv,
 | 
			
		||||
		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"
 | 
			
		||||
				CPPFLAGS="-I$withval/include $CPPFLAGS"
 | 
			
		||||
				LDFLAGS="-L$withval/lib $LDFLAGS"
 | 
			
		||||
			fi
 | 
			
		||||
			AC_CHECK_LIB(iconv, iconv_open)
 | 
			
		||||
			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 ]
 | 
			
		||||
	)
 | 
			
		||||
	if test "$x_iconv_on" = "yes"; then
 | 
			
		||||
		AC_DEFINE(ICONV, 1)
 | 
			
		||||
	fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# enable support for IPv6?
 | 
			
		||||
x_ipv6_on=no
 | 
			
		||||
AC_ARG_ENABLE(ipv6,
 | 
			
		||||
	[  --enable-ipv6           enable IPv6 protocol support],
 | 
			
		||||
	AS_HELP_STRING([--enable-ipv6],
 | 
			
		||||
		       [enable IPv6 protocol support]),
 | 
			
		||||
	if test "$enableval" = "yes"; then x_ipv6_on=yes; fi
 | 
			
		||||
)
 | 
			
		||||
if test "$x_ipv6_on" = "yes"; then
 | 
			
		||||
@@ -500,7 +563,8 @@ fi
 | 
			
		||||
 | 
			
		||||
x_sniffer_on=no; x_debug_on=no
 | 
			
		||||
AC_ARG_ENABLE(sniffer,
 | 
			
		||||
	[  --enable-sniffer        enable IRC traffic sniffer (enables debug mode)],
 | 
			
		||||
	AS_HELP_STRING([--enable-sniffer],
 | 
			
		||||
		       [enable IRC traffic sniffer (enables debug mode)]),
 | 
			
		||||
	if test "$enableval" = "yes"; then
 | 
			
		||||
		AC_DEFINE(SNIFFER, 1)
 | 
			
		||||
		x_sniffer_on=yes; x_debug_on=yes
 | 
			
		||||
@@ -510,7 +574,8 @@ AC_ARG_ENABLE(sniffer,
 | 
			
		||||
# enable additional debugging code?
 | 
			
		||||
 | 
			
		||||
AC_ARG_ENABLE(debug,
 | 
			
		||||
	[  --enable-debug          show additional debug output],
 | 
			
		||||
	AS_HELP_STRING([--enable-debug],
 | 
			
		||||
		       [show additional debug output]),
 | 
			
		||||
	if test "$enableval" = "yes"; then x_debug_on=yes; fi
 | 
			
		||||
)
 | 
			
		||||
if test "$x_debug_on" = "yes"; then
 | 
			
		||||
@@ -523,7 +588,8 @@ fi
 | 
			
		||||
 | 
			
		||||
x_strict_rfc_on=no
 | 
			
		||||
AC_ARG_ENABLE(strict-rfc,
 | 
			
		||||
	[  --enable-strict-rfc     strict RFC conformance -- may break clients!],
 | 
			
		||||
	AS_HELP_STRING([--enable-strict-rfc],
 | 
			
		||||
		       [strict RFC conformance -- may break clients!]),
 | 
			
		||||
	if test "$enableval" = "yes"; then
 | 
			
		||||
		AC_DEFINE(STRICT_RFC, 1)
 | 
			
		||||
		x_strict_rfc_on=yes
 | 
			
		||||
@@ -532,9 +598,9 @@ AC_ARG_ENABLE(strict-rfc,
 | 
			
		||||
 | 
			
		||||
# -- Definitions --
 | 
			
		||||
 | 
			
		||||
AC_DEFINE_UNQUOTED(TARGET_CPU, "$target_cpu" )
 | 
			
		||||
AC_DEFINE_UNQUOTED(TARGET_VENDOR, "$target_vendor" )
 | 
			
		||||
AC_DEFINE_UNQUOTED(TARGET_OS, "$target_os" )
 | 
			
		||||
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.
 | 
			
		||||
@@ -542,25 +608,26 @@ test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END"
 | 
			
		||||
 | 
			
		||||
# -- Generate files --
 | 
			
		||||
 | 
			
		||||
AC_OUTPUT([ \
 | 
			
		||||
AC_CONFIG_FILES([ \
 | 
			
		||||
	Makefile \
 | 
			
		||||
	doc/Makefile \
 | 
			
		||||
	doc/src/Makefile \
 | 
			
		||||
	src/Makefile \
 | 
			
		||||
	src/portab/Makefile \
 | 
			
		||||
	src/ipaddr/Makefile \
 | 
			
		||||
	src/tool/Makefile \
 | 
			
		||||
	src/ngircd/Makefile \
 | 
			
		||||
	src/testsuite/Makefile \
 | 
			
		||||
	man/Makefile \
 | 
			
		||||
	contrib/Makefile \
 | 
			
		||||
	contrib/Anope/Makefile \
 | 
			
		||||
	contrib/Debian/Makefile \
 | 
			
		||||
	contrib/MacOSX/Makefile \
 | 
			
		||||
	contrib/MacOSX/ngIRCd.xcodeproj/Makefile \
 | 
			
		||||
	contrib/MacOSX/ngIRCd.pmdoc/Makefile \
 | 
			
		||||
	contrib/MacOSX/ngIRCd.xcodeproj/Makefile \
 | 
			
		||||
	contrib/Makefile \
 | 
			
		||||
	doc/Makefile \
 | 
			
		||||
	doc/src/Makefile \
 | 
			
		||||
	man/Makefile \
 | 
			
		||||
	src/ipaddr/Makefile \
 | 
			
		||||
	src/Makefile \
 | 
			
		||||
	src/ngircd/Makefile \
 | 
			
		||||
	src/portab/Makefile \
 | 
			
		||||
	src/testsuite/Makefile \
 | 
			
		||||
	src/tool/Makefile \
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
AC_OUTPUT
 | 
			
		||||
 | 
			
		||||
type dpkg >/dev/null 2>&1
 | 
			
		||||
if test $? -eq 0; then
 | 
			
		||||
	# Generate debian/ link if the dpkg command exists
 | 
			
		||||
@@ -582,8 +649,7 @@ C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
 | 
			
		||||
M=`eval echo ${mandir}` ; M=`eval echo ${M}`
 | 
			
		||||
D=`eval echo ${docdir}` ; D=`eval echo ${D}`
 | 
			
		||||
 | 
			
		||||
echo "             Target: ${target}"
 | 
			
		||||
test "$target" != "$host" && echo "               Host: ${host}"
 | 
			
		||||
echo "               Host: ${host}"
 | 
			
		||||
echo "           Compiler: ${CC}"
 | 
			
		||||
test -n "$CFLAGS"	&& echo "     Compiler flags: ${CFLAGS}"
 | 
			
		||||
test -n "$CPPFLAGS"	&& echo " Preprocessor flags: ${CPPFLAGS}"
 | 
			
		||||
@@ -637,7 +703,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" \
 | 
			
		||||
@@ -646,6 +712,18 @@ test "$x_pam_on" = "yes" \
 | 
			
		||||
echo $ECHO_N "        SSL support: $ECHO_C"
 | 
			
		||||
echo "$x_ssl_lib"
 | 
			
		||||
 | 
			
		||||
echo $ECHO_N "   libiconv support: $ECHO_C"
 | 
			
		||||
	echo "$x_iconv_on"
 | 
			
		||||
 | 
			
		||||
echo
 | 
			
		||||
 | 
			
		||||
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!"
 | 
			
		||||
	echo "(Most probably you want to use GNU automake 1.11.x for this purpose ...)"
 | 
			
		||||
	echo
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# -eof-
 | 
			
		||||
@@ -1,496 +0,0 @@
 | 
			
		||||
From bc5023fdba8091ab7eee29fe0deeca6843159743 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Mon, 16 May 2011 18:23:01 +0200
 | 
			
		||||
Subject: [PATCH 1/2] Revert "Removed ngircd as we've decided not to support it at this time"
 | 
			
		||||
 | 
			
		||||
This reverts commit 605b5d57171d2f0fac56ee2ee3e1b1bbdadeb24f and re-enables
 | 
			
		||||
the ngIRCd protocol module for Anope.
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |  475 +++++++++++++++++++++++++++++++++++++++++++
 | 
			
		||||
 1 files changed, 475 insertions(+), 0 deletions(-)
 | 
			
		||||
 create mode 100644 modules/protocol/ngircd.cpp
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
new file mode 100644
 | 
			
		||||
index 0000000..6e1f21f
 | 
			
		||||
--- /dev/null
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -0,0 +1,475 @@
 | 
			
		||||
+/* ngIRCd IRCD functions
 | 
			
		||||
+ *
 | 
			
		||||
+ * (C) 2003-2011 Anope Team
 | 
			
		||||
+ * Contact us at team@anope.org
 | 
			
		||||
+ *
 | 
			
		||||
+ * Please read COPYING and README for further details.
 | 
			
		||||
+ *
 | 
			
		||||
+ * Based on the original code of Epona by Lara.
 | 
			
		||||
+ * Based on the original code of Services by Andy Church.
 | 
			
		||||
+ */
 | 
			
		||||
+
 | 
			
		||||
+#include "services.h"
 | 
			
		||||
+#include "modules.h"
 | 
			
		||||
+
 | 
			
		||||
+IRCDVar myIrcd[] = {
 | 
			
		||||
+	{"ngIRCd",	/* ircd name */
 | 
			
		||||
+	 "+oi",		/* Modes used by pseudoclients */
 | 
			
		||||
+	 0,		/* SVSNICK */
 | 
			
		||||
+	 0,		/* Vhost */
 | 
			
		||||
+	 0,		/* Supports SNlines */
 | 
			
		||||
+	 0,		/* Supports SQlines */
 | 
			
		||||
+	 0,		/* Supports SZlines */
 | 
			
		||||
+	 0,		/* Join 2 Message */
 | 
			
		||||
+	 0,		/* Chan SQlines */
 | 
			
		||||
+	 1,		/* Quit on Kill */
 | 
			
		||||
+	 0,		/* vidents */
 | 
			
		||||
+	 0,		/* svshold */
 | 
			
		||||
+	 0,		/* time stamp on mode */
 | 
			
		||||
+	 0,		/* UMODE */
 | 
			
		||||
+	 0,		/* O:LINE */
 | 
			
		||||
+	 0,		/* No Knock requires +i */
 | 
			
		||||
+	 0,		/* Can remove User Channel Modes with SVSMODE */
 | 
			
		||||
+	 0,		/* Sglines are not enforced until user reconnects */
 | 
			
		||||
+	 0,		/* ts6 */
 | 
			
		||||
+	 "$",		/* TLD Prefix for Global */
 | 
			
		||||
+	 20,		/* Max number of modes we can send per line */
 | 
			
		||||
+	 0,		/* IRCd sends a SSL users certificate fingerprint */
 | 
			
		||||
+	 }
 | 
			
		||||
+	,
 | 
			
		||||
+	{NULL}
 | 
			
		||||
+};
 | 
			
		||||
+
 | 
			
		||||
+/* PASS */
 | 
			
		||||
+class ngIRCdProto : public IRCDProto
 | 
			
		||||
+{
 | 
			
		||||
+	void SendAkill(User *u, const XLine *x)
 | 
			
		||||
+	{
 | 
			
		||||
+		if (SGLine && u == NULL)
 | 
			
		||||
+			for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end();)
 | 
			
		||||
+			{
 | 
			
		||||
+				u = it->second;
 | 
			
		||||
+				++it;
 | 
			
		||||
+				if (SGLine->Check(u) != NULL)
 | 
			
		||||
+					break;
 | 
			
		||||
+			}
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	void SendAkillDel(const XLine*) { }
 | 
			
		||||
+
 | 
			
		||||
+	void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf)
 | 
			
		||||
+	{
 | 
			
		||||
+		send_cmd(source ? source->nick : Config->ServerName, "WALLOPS :%s", buf.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	void SendJoin(BotInfo *user, Channel *c, const ChannelStatus *status)
 | 
			
		||||
+	{
 | 
			
		||||
+		send_cmd(user->nick, "JOIN %s", c->name.c_str());
 | 
			
		||||
+		if (status)
 | 
			
		||||
+			for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i)
 | 
			
		||||
+				if (status->HasFlag(ModeManager::ChannelModes[i]->Name))
 | 
			
		||||
+					c->SetMode(user, ModeManager::ChannelModes[i], user->nick, false);
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
 | 
			
		||||
+	{
 | 
			
		||||
+		send_cmd(source ? source->nick : Config->ServerName, "KILL %s :%s", user->nick.c_str(), buf.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	/* SERVER name hop descript */
 | 
			
		||||
+	void SendServer(const Server *server)
 | 
			
		||||
+	{
 | 
			
		||||
+		send_cmd("", "SERVER %s %d :%s", server->GetName().c_str(), server->GetHops(), server->GetDescription().c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	void SendConnect()
 | 
			
		||||
+	{
 | 
			
		||||
+		send_cmd("", "PASS %s 0210-IRC+ Anope|%s:CLHSo P", uplink_server->password.c_str(), Anope::VersionShort().c_str());
 | 
			
		||||
+		/* Make myself known to myself in the serverlist */
 | 
			
		||||
+		SendServer(Me);
 | 
			
		||||
+		/* finish the enhanced server handshake and register the connection */
 | 
			
		||||
+		this->SendNumeric(Config->ServerName, 376, "*", ":End of MOTD command");
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	// Received: :dev.anope.de NICK DukeP 1 ~DukePyro p57ABF9C9.dip.t-dialin.net 1 +i :DukePyrolator
 | 
			
		||||
+	void SendClientIntroduction(const User *u, const Anope::string &modes)
 | 
			
		||||
+	{
 | 
			
		||||
+		EnforceQlinedNick(u->nick, "");
 | 
			
		||||
+		send_cmd(Config->ServerName, "NICK %s 1 %s %s 1 %s :%s", u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str(), modes.c_str(), u->realname.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	void SendPartInternal(const BotInfo *bi, const Channel *chan, const Anope::string &buf)
 | 
			
		||||
+	{
 | 
			
		||||
+		if (!buf.empty())
 | 
			
		||||
+			send_cmd(bi->nick, "PART %s :%s", chan->name.c_str(), buf.c_str());
 | 
			
		||||
+		else
 | 
			
		||||
+			send_cmd(bi->nick, "PART %s", chan->name.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	void SendModeInternal(const BotInfo *bi, const Channel *dest, const Anope::string &buf)
 | 
			
		||||
+	{
 | 
			
		||||
+		send_cmd(bi ? bi->nick : Config->ServerName, "MODE %s %s", dest->name.c_str(), buf.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
 | 
			
		||||
+	{
 | 
			
		||||
+		send_cmd(bi ? bi->nick : Config->ServerName, "MODE %s %s", u->nick.c_str(), buf.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	void SendKickInternal(const BotInfo *bi, const Channel *chan, const User *user, const Anope::string &buf)
 | 
			
		||||
+	{
 | 
			
		||||
+		if (!buf.empty())
 | 
			
		||||
+			send_cmd(bi->nick, "KICK %s %s :%s", chan->name.c_str(), user->nick.c_str(), buf.c_str());
 | 
			
		||||
+		else
 | 
			
		||||
+			send_cmd(bi->nick, "KICK %s %s", chan->name.c_str(), user->nick.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
 | 
			
		||||
+	{
 | 
			
		||||
+		send_cmd(source ? source->nick : Config->s_ChanServ, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	/* INVITE */
 | 
			
		||||
+	void SendInvite(BotInfo *source, const Anope::string &chan, const Anope::string &nick)
 | 
			
		||||
+	{
 | 
			
		||||
+		send_cmd(source->nick, "INVITE %s %s", nick.c_str(), chan.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	void SendChannel(Channel *c)
 | 
			
		||||
+	{
 | 
			
		||||
+		Anope::string mlock_modes = get_mlock_modes(c->ci, true);
 | 
			
		||||
+		if (mlock_modes.empty())
 | 
			
		||||
+			mlock_modes = "+";
 | 
			
		||||
+		send_cmd(Config->ServerName, "CHANINFO %s %s", c->name.c_str(), mlock_modes.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+	void SendTopic(BotInfo *bi, Channel *c)
 | 
			
		||||
+	{
 | 
			
		||||
+		send_cmd(bi->nick, "TOPIC %s :%s", c->name.c_str(), c->topic.c_str());
 | 
			
		||||
+	}
 | 
			
		||||
+};
 | 
			
		||||
+
 | 
			
		||||
+class ngIRCdIRCdMessage : public IRCdMessage
 | 
			
		||||
+{
 | 
			
		||||
+ public:
 | 
			
		||||
+	bool OnSJoin(const Anope::string&, const std::vector<Anope::string>&) { return false; }
 | 
			
		||||
+
 | 
			
		||||
+	/*
 | 
			
		||||
+	 * Received: :dev.anope.de MODE #anope +b *!*@*aol*
 | 
			
		||||
+	 */
 | 
			
		||||
+	bool OnMode(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+	{
 | 
			
		||||
+		if (params.size() < 2)
 | 
			
		||||
+			return true;
 | 
			
		||||
+
 | 
			
		||||
+		Anope::string modes = params[1];
 | 
			
		||||
+		for (unsigned i = 2; i < params.size(); ++i)
 | 
			
		||||
+			modes += " " + params[i];
 | 
			
		||||
+
 | 
			
		||||
+		if (params[0][0] == '#' || params[0][0] == '&')
 | 
			
		||||
+			do_cmode(source, params[0], modes, "");
 | 
			
		||||
+		else
 | 
			
		||||
+			do_umode(params[0], params[1]);
 | 
			
		||||
+
 | 
			
		||||
+		return true;
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	/*
 | 
			
		||||
+	  Received: :DukeP_ NICK :test2
 | 
			
		||||
+	  Received: :dev.anope.de NICK DukeP_ 1 ~DukePyro ip-2-201-236-154.web.vodafone.de 1 + :DukePyrolator
 | 
			
		||||
+	  source = nickname on nickchange, servername on newuser
 | 
			
		||||
+	  params[0] = nick
 | 
			
		||||
+	  params[1] = <unknown>
 | 
			
		||||
+	  params[2] = username
 | 
			
		||||
+	  params[3] = host
 | 
			
		||||
+	  params[4] = <unknown>
 | 
			
		||||
+	  params[5] = modes
 | 
			
		||||
+	  params[6] = info
 | 
			
		||||
+	*/
 | 
			
		||||
+	bool OnNick(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+	{
 | 
			
		||||
+		if (params.size() == 1)
 | 
			
		||||
+		{
 | 
			
		||||
+			// we have a nickchange
 | 
			
		||||
+			do_nick(source, params[0], "", "", "", "", Anope::CurTime, "", "", "", "");
 | 
			
		||||
+		}
 | 
			
		||||
+		else if (params.size() == 7)
 | 
			
		||||
+		{
 | 
			
		||||
+			// a new user is connecting to the network
 | 
			
		||||
+			User *user = do_nick("", params[0], params[2], params[3], source, params[6], Anope::CurTime, "", "", "", params[5]);
 | 
			
		||||
+			if (user)
 | 
			
		||||
+				validate_user(user);
 | 
			
		||||
+		}
 | 
			
		||||
+		else
 | 
			
		||||
+		{
 | 
			
		||||
+			Log() << "Received NICK with invalid number of parameters. source = " << source << "param[0] = " << params[0] << "params.size() = " << params.size();
 | 
			
		||||
+		}
 | 
			
		||||
+		return true;
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	bool OnServer(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+	{
 | 
			
		||||
+		if (params.size() == 3)
 | 
			
		||||
+			do_server("", params[0], 0, params[2], params[1]);
 | 
			
		||||
+		else
 | 
			
		||||
+			do_server(source, params[0], params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0, params[3], params[2]);
 | 
			
		||||
+		return true;
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	bool OnTopic(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+	{
 | 
			
		||||
+		Channel *c = findchan(params[0]);
 | 
			
		||||
+		if (!c)
 | 
			
		||||
+		{
 | 
			
		||||
+			Log() << "TOPIC for nonexistant channel " << params[0];
 | 
			
		||||
+			return true;
 | 
			
		||||
+		}
 | 
			
		||||
+
 | 
			
		||||
+		c->ChangeTopicInternal(source, params[1]);
 | 
			
		||||
+		return true;
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	/*
 | 
			
		||||
+	 * <@po||ux> DukeP: RFC 2813, 4.2.1: the JOIN command on server-server links
 | 
			
		||||
+	 * separates the modes ("o") with ASCII 7, not space. And you can't see ASCII 7.
 | 
			
		||||
+	 *
 | 
			
		||||
+	 * if a user joins a new channel, the ircd sends <channelname>\7<umode>
 | 
			
		||||
+	 */
 | 
			
		||||
+	bool OnJoin (const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+	{
 | 
			
		||||
+		if (!params.empty())
 | 
			
		||||
+		{
 | 
			
		||||
+			size_t pos = params[0].find('\7');
 | 
			
		||||
+			if (pos != Anope::string::npos)
 | 
			
		||||
+			{
 | 
			
		||||
+				Anope::string channel = params[0].substr(0, pos);
 | 
			
		||||
+				Anope::string mode = '+' + params[0].substr(pos, params[0].length()) + " " + source;
 | 
			
		||||
+				do_join(source, channel, "");
 | 
			
		||||
+				do_cmode(source, channel, mode, "");
 | 
			
		||||
+			}
 | 
			
		||||
+			else
 | 
			
		||||
+				do_join(source, params[0], "");
 | 
			
		||||
+		}
 | 
			
		||||
+		return true;
 | 
			
		||||
+	}
 | 
			
		||||
+};
 | 
			
		||||
+
 | 
			
		||||
+/*
 | 
			
		||||
+ * CHANINFO <chan> +<modes>
 | 
			
		||||
+ * CHANINFO <chan> +<modes> :<topic>
 | 
			
		||||
+ * CHANINFO <chan> +<modes> <key> <limit> :<topic>
 | 
			
		||||
+ */
 | 
			
		||||
+bool event_chaninfo(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+{
 | 
			
		||||
+
 | 
			
		||||
+	Channel *c = findchan(params[0]);
 | 
			
		||||
+	if (!c)
 | 
			
		||||
+		c = new Channel(params[0]);
 | 
			
		||||
+
 | 
			
		||||
+	Anope::string modes = params[1];
 | 
			
		||||
+	
 | 
			
		||||
+	if (params.size() == 3)
 | 
			
		||||
+	{
 | 
			
		||||
+		c->ChangeTopicInternal(source, params[2], Anope::CurTime);
 | 
			
		||||
+	} 
 | 
			
		||||
+	else if (params.size() == 5)
 | 
			
		||||
+	{
 | 
			
		||||
+		for (size_t i = 0, end = params[1].length(); i < end; ++i)
 | 
			
		||||
+		{
 | 
			
		||||
+			switch(params[1][i])
 | 
			
		||||
+			{
 | 
			
		||||
+				case 'k':
 | 
			
		||||
+					modes += " " + params[2];
 | 
			
		||||
+					continue;
 | 
			
		||||
+				case 'l':
 | 
			
		||||
+					modes += " " + params[3];
 | 
			
		||||
+					continue;
 | 
			
		||||
+			}
 | 
			
		||||
+		}
 | 
			
		||||
+		c->ChangeTopicInternal(source, params[4], Anope::CurTime);
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	c->SetModesInternal(NULL, modes);
 | 
			
		||||
+
 | 
			
		||||
+	return true;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
+/*
 | 
			
		||||
+ * Received: :dev.anope.de NJOIN #test :DukeP2,@DukeP
 | 
			
		||||
+ */
 | 
			
		||||
+bool event_njoin(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+{
 | 
			
		||||
+	Channel *c = findchan(params[0]);
 | 
			
		||||
+	commasepstream sep(params[1]);
 | 
			
		||||
+	Anope::string buf;
 | 
			
		||||
+
 | 
			
		||||
+	if (!c)
 | 
			
		||||
+	{
 | 
			
		||||
+		c = new Channel(params[0], Anope::CurTime);
 | 
			
		||||
+		c->SetFlag(CH_SYNCING);
 | 
			
		||||
+	}
 | 
			
		||||
+	
 | 
			
		||||
+	while (sep.GetToken(buf))
 | 
			
		||||
+	{
 | 
			
		||||
+		std::list<ChannelMode *> Status;
 | 
			
		||||
+		char ch;
 | 
			
		||||
+
 | 
			
		||||
+		/* Get prefixes from the nick */
 | 
			
		||||
+		while ((ch = ModeManager::GetStatusChar(buf[0])))
 | 
			
		||||
+		{
 | 
			
		||||
+			buf.erase(buf.begin());
 | 
			
		||||
+			ChannelMode *cm = ModeManager::FindChannelModeByChar(ch);
 | 
			
		||||
+			if (!cm)
 | 
			
		||||
+			{
 | 
			
		||||
+				Log() << "Received unknown mode prefix " << ch << " in NJOIN string.";
 | 
			
		||||
+				continue;
 | 
			
		||||
+			}
 | 
			
		||||
+			Status.push_back(cm);
 | 
			
		||||
+		}
 | 
			
		||||
+		User *u = finduser(buf);
 | 
			
		||||
+		if (!u)
 | 
			
		||||
+		{
 | 
			
		||||
+			Log(LOG_DEBUG) << "NJOIN for nonexistant user " << buf << " on " << c->name;
 | 
			
		||||
+			continue;
 | 
			
		||||
+		}
 | 
			
		||||
+
 | 
			
		||||
+		EventReturn MOD_RESULT;
 | 
			
		||||
+		FOREACH_RESULT(I_OnPreJoinChannel, OnPreJoinChannel(u, c));
 | 
			
		||||
+
 | 
			
		||||
+		/* Add the user to the Channel */
 | 
			
		||||
+		c->JoinUser(u);
 | 
			
		||||
+
 | 
			
		||||
+		/* Update their status internally on the channel
 | 
			
		||||
+		 * This will enforce secureops etc on the user
 | 
			
		||||
+		 */
 | 
			
		||||
+		for (std::list<ChannelMode *>::iterator it = Status.begin(), it_end = Status.end(); it != it_end; ++it)
 | 
			
		||||
+			c->SetModeInternal(*it, buf);
 | 
			
		||||
+		/* Now set whatever modes this user is allowed to have on the channel */
 | 
			
		||||
+		chan_set_correct_modes(u, c, 1);
 | 
			
		||||
+
 | 
			
		||||
+		/* Check to see if modules want the user to join, if they do
 | 
			
		||||
+		 * check to see if they are allowed to join (CheckKick will kick/ban them)
 | 
			
		||||
+		 * Don't trigger OnJoinChannel event then as the user will be destroyed
 | 
			
		||||
+		 */
 | 
			
		||||
+		if (MOD_RESULT != EVENT_STOP && c->ci && c->ci->CheckKick(u))
 | 
			
		||||
+			continue;
 | 
			
		||||
+
 | 
			
		||||
+		FOREACH_MOD(I_OnJoinChannel, OnJoinChannel(u, c));
 | 
			
		||||
+	} /* while */
 | 
			
		||||
+
 | 
			
		||||
+	if (c->HasFlag(CH_SYNCING))
 | 
			
		||||
+	{
 | 
			
		||||
+		c->UnsetFlag(CH_SYNCING);
 | 
			
		||||
+		c->Sync();
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+	return true;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
+bool event_kick(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+{
 | 
			
		||||
+	if (params.size() > 2)
 | 
			
		||||
+		do_kick(source, params[0], params[1], params[2]);
 | 
			
		||||
+	return true;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
+bool event_pass(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+{
 | 
			
		||||
+	return true;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
+bool event_005(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+{
 | 
			
		||||
+	size_t pos;
 | 
			
		||||
+	Anope::string name, data;
 | 
			
		||||
+	for (unsigned i = 0, end = params.size(); i < end; ++i)
 | 
			
		||||
+	{
 | 
			
		||||
+		pos = params[i].find('=');
 | 
			
		||||
+		if (pos != Anope::string::npos)
 | 
			
		||||
+		{
 | 
			
		||||
+			name = params[i].substr(0, pos);
 | 
			
		||||
+			data = params[i].substr(pos+1, params[i].length());
 | 
			
		||||
+			if (name == "NICKLEN")
 | 
			
		||||
+			{
 | 
			
		||||
+				unsigned newlen = convertTo<unsigned>(data);
 | 
			
		||||
+				if (Config->NickLen != newlen)
 | 
			
		||||
+				{
 | 
			
		||||
+					Log() << "Config->NickLen changed from " << Config->NickLen << " to " << newlen;
 | 
			
		||||
+					Config->NickLen = newlen;
 | 
			
		||||
+				}
 | 
			
		||||
+			}
 | 
			
		||||
+		}
 | 
			
		||||
+	}
 | 
			
		||||
+	return true;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
+bool event_442(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+{
 | 
			
		||||
+	return true;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
+bool event_376(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+{
 | 
			
		||||
+	return true;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
+
 | 
			
		||||
+class ProtongIRCd : public Module
 | 
			
		||||
+{
 | 
			
		||||
+	Message message_kick, message_pass, message_njoin, message_chaninfo, message_005, 
 | 
			
		||||
+		message_442, message_376;
 | 
			
		||||
+	
 | 
			
		||||
+	ngIRCdProto ircd_proto;
 | 
			
		||||
+	ngIRCdIRCdMessage ircd_message;
 | 
			
		||||
+
 | 
			
		||||
+	void AddModes()
 | 
			
		||||
+	{
 | 
			
		||||
+		/* Add user modes */
 | 
			
		||||
+		ModeManager::AddUserMode(new UserMode(UMODE_ADMIN, 'a'));
 | 
			
		||||
+		ModeManager::AddUserMode(new UserMode(UMODE_INVIS, 'i'));
 | 
			
		||||
+		ModeManager::AddUserMode(new UserMode(UMODE_OPER, 'o'));
 | 
			
		||||
+		ModeManager::AddUserMode(new UserMode(UMODE_RESTRICTED, 'r'));
 | 
			
		||||
+		ModeManager::AddUserMode(new UserMode(UMODE_SNOMASK, 's'));
 | 
			
		||||
+		ModeManager::AddUserMode(new UserMode(UMODE_WALLOPS, 'w'));
 | 
			
		||||
+		ModeManager::AddUserMode(new UserMode(UMODE_CLOAK, 'x'));
 | 
			
		||||
+
 | 
			
		||||
+		/* b/e/I */
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelModeBan(CMODE_BAN, 'b'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelModeList(CMODE_INVITEOVERRIDE, 'I'));
 | 
			
		||||
+
 | 
			
		||||
+		/* v/h/o/a/q */
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_VOICE, 'v', '+'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_OP, 'o', '@'));
 | 
			
		||||
+
 | 
			
		||||
+		/* Add channel modes */
 | 
			
		||||
+		// channel modes: biIklmnoPstvz
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelMode(CMODE_INVITE, 'i'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelModeKey('k'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelModeParam(CMODE_LIMIT, 'l'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelMode(CMODE_MODERATED, 'm'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelMode(CMODE_NOEXTERNAL, 'n'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelMode(CMODE_PERM, 'P'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelMode(CMODE_SECRET, 's'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelMode(CMODE_TOPIC, 't'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelMode(CMODE_SSL, 'z'));
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
+ public:
 | 
			
		||||
+	ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator),
 | 
			
		||||
+		message_kick("KICK", event_kick), message_pass("PASS", event_pass),
 | 
			
		||||
+		message_njoin("NJOIN", event_njoin), message_chaninfo("CHANINFO", event_chaninfo),
 | 
			
		||||
+		message_005("005", event_005), message_442("442", event_442), message_376("376", event_376)
 | 
			
		||||
+	{
 | 
			
		||||
+		this->SetAuthor("Anope");
 | 
			
		||||
+		this->SetType(PROTOCOL);
 | 
			
		||||
+		
 | 
			
		||||
+		Capab.SetFlag(CAPAB_QS);
 | 
			
		||||
+
 | 
			
		||||
+		pmodule_ircd_var(myIrcd);
 | 
			
		||||
+		pmodule_ircd_proto(&this->ircd_proto);
 | 
			
		||||
+		pmodule_ircd_message(&this->ircd_message);
 | 
			
		||||
+
 | 
			
		||||
+		this->AddModes();
 | 
			
		||||
+	}
 | 
			
		||||
+};
 | 
			
		||||
+
 | 
			
		||||
+MODULE_INIT(ProtongIRCd)
 | 
			
		||||
-- 
 | 
			
		||||
1.7.2.5
 | 
			
		||||
 | 
			
		||||
@@ -1,60 +0,0 @@
 | 
			
		||||
From 1ea1dd2095e63cef34edbebb729edc687f410a96 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Mon, 16 May 2011 18:26:56 +0200
 | 
			
		||||
Subject: [PATCH 2/2] ngircd: whitespace fixes
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |   12 ++++++------
 | 
			
		||||
 1 files changed, 6 insertions(+), 6 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 6e1f21f..e546d05 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -266,11 +266,11 @@ bool event_chaninfo(const Anope::string &source, const std::vector<Anope::string
 | 
			
		||||
 		c = new Channel(params[0]);
 | 
			
		||||
 
 | 
			
		||||
 	Anope::string modes = params[1];
 | 
			
		||||
-	
 | 
			
		||||
+
 | 
			
		||||
 	if (params.size() == 3)
 | 
			
		||||
 	{
 | 
			
		||||
 		c->ChangeTopicInternal(source, params[2], Anope::CurTime);
 | 
			
		||||
-	} 
 | 
			
		||||
+	}
 | 
			
		||||
 	else if (params.size() == 5)
 | 
			
		||||
 	{
 | 
			
		||||
 		for (size_t i = 0, end = params[1].length(); i < end; ++i)
 | 
			
		||||
@@ -307,7 +307,7 @@ bool event_njoin(const Anope::string &source, const std::vector<Anope::string> &
 | 
			
		||||
 		c = new Channel(params[0], Anope::CurTime);
 | 
			
		||||
 		c->SetFlag(CH_SYNCING);
 | 
			
		||||
 	}
 | 
			
		||||
-	
 | 
			
		||||
+
 | 
			
		||||
 	while (sep.GetToken(buf))
 | 
			
		||||
 	{
 | 
			
		||||
 		std::list<ChannelMode *> Status;
 | 
			
		||||
@@ -415,9 +415,9 @@ bool event_376(const Anope::string &source, const std::vector<Anope::string> &pa
 | 
			
		||||
 
 | 
			
		||||
 class ProtongIRCd : public Module
 | 
			
		||||
 {
 | 
			
		||||
-	Message message_kick, message_pass, message_njoin, message_chaninfo, message_005, 
 | 
			
		||||
+	Message message_kick, message_pass, message_njoin, message_chaninfo, message_005,
 | 
			
		||||
 		message_442, message_376;
 | 
			
		||||
-	
 | 
			
		||||
+
 | 
			
		||||
 	ngIRCdProto ircd_proto;
 | 
			
		||||
 	ngIRCdIRCdMessage ircd_message;
 | 
			
		||||
 
 | 
			
		||||
@@ -461,7 +461,7 @@ class ProtongIRCd : public Module
 | 
			
		||||
 	{
 | 
			
		||||
 		this->SetAuthor("Anope");
 | 
			
		||||
 		this->SetType(PROTOCOL);
 | 
			
		||||
-		
 | 
			
		||||
+
 | 
			
		||||
 		Capab.SetFlag(CAPAB_QS);
 | 
			
		||||
 
 | 
			
		||||
 		pmodule_ircd_var(myIrcd);
 | 
			
		||||
-- 
 | 
			
		||||
1.7.2.5
 | 
			
		||||
 | 
			
		||||
@@ -1,128 +0,0 @@
 | 
			
		||||
From d8eddbeaadc7d161865b5342d59748b80266533c Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: DukePyrolator <DukePyrolator@anope.org>
 | 
			
		||||
Date: Mon, 22 Aug 2011 14:53:37 +0200
 | 
			
		||||
Subject: [PATCH 03/16] Update ngIRCd protocol module for current Anope 1.9
 | 
			
		||||
 GIT
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |   37 ++++++++++++++++++-------------------
 | 
			
		||||
 1 files changed, 18 insertions(+), 19 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index e546d05..790b8f4 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -11,6 +11,8 @@
 | 
			
		||||
 
 | 
			
		||||
 #include "services.h"
 | 
			
		||||
 #include "modules.h"
 | 
			
		||||
+#include "nickserv.h"
 | 
			
		||||
+#include "oper.h"
 | 
			
		||||
 
 | 
			
		||||
 IRCDVar myIrcd[] = {
 | 
			
		||||
 	{"ngIRCd",	/* ircd name */
 | 
			
		||||
@@ -45,14 +47,7 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 {
 | 
			
		||||
 	void SendAkill(User *u, const XLine *x)
 | 
			
		||||
 	{
 | 
			
		||||
-		if (SGLine && u == NULL)
 | 
			
		||||
-			for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end();)
 | 
			
		||||
-			{
 | 
			
		||||
-				u = it->second;
 | 
			
		||||
-				++it;
 | 
			
		||||
-				if (SGLine->Check(u) != NULL)
 | 
			
		||||
-					break;
 | 
			
		||||
-			}
 | 
			
		||||
+		// TODO: ADD SOME CODE
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	void SendAkillDel(const XLine*) { }
 | 
			
		||||
@@ -62,13 +57,16 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 		send_cmd(source ? source->nick : Config->ServerName, "WALLOPS :%s", buf.c_str());
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
-	void SendJoin(BotInfo *user, Channel *c, const ChannelStatus *status)
 | 
			
		||||
+	void SendJoin(User *user, Channel *c, const ChannelStatus *status)
 | 
			
		||||
 	{
 | 
			
		||||
 		send_cmd(user->nick, "JOIN %s", c->name.c_str());
 | 
			
		||||
 		if (status)
 | 
			
		||||
+		{
 | 
			
		||||
+			BotInfo *setter = findbot(user->nick);
 | 
			
		||||
 			for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i)
 | 
			
		||||
 				if (status->HasFlag(ModeManager::ChannelModes[i]->Name))
 | 
			
		||||
-					c->SetMode(user, ModeManager::ChannelModes[i], user->nick, false);
 | 
			
		||||
+					c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false);
 | 
			
		||||
+		}
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
 | 
			
		||||
@@ -84,7 +82,7 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 
 | 
			
		||||
 	void SendConnect()
 | 
			
		||||
 	{
 | 
			
		||||
-		send_cmd("", "PASS %s 0210-IRC+ Anope|%s:CLHSo P", uplink_server->password.c_str(), Anope::VersionShort().c_str());
 | 
			
		||||
+		send_cmd("", "PASS %s 0210-IRC+ Anope|%s:CLHSo P", Config->Uplinks[CurrentUplink]->password.c_str(), Anope::VersionShort().c_str());
 | 
			
		||||
 		/* Make myself known to myself in the serverlist */
 | 
			
		||||
 		SendServer(Me);
 | 
			
		||||
 		/* finish the enhanced server handshake and register the connection */
 | 
			
		||||
@@ -92,9 +90,11 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	// Received: :dev.anope.de NICK DukeP 1 ~DukePyro p57ABF9C9.dip.t-dialin.net 1 +i :DukePyrolator
 | 
			
		||||
-	void SendClientIntroduction(const User *u, const Anope::string &modes)
 | 
			
		||||
+	void SendClientIntroduction(const User *u)
 | 
			
		||||
 	{
 | 
			
		||||
-		EnforceQlinedNick(u->nick, "");
 | 
			
		||||
+		Anope::string modes = "+" + u->GetModes();
 | 
			
		||||
+		XLine x(u->nick, "Reserved for services");
 | 
			
		||||
+		ircdproto->SendSQLine(NULL, &x);
 | 
			
		||||
 		send_cmd(Config->ServerName, "NICK %s 1 %s %s 1 %s :%s", u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str(), modes.c_str(), u->realname.c_str());
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
@@ -126,7 +126,7 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 
 | 
			
		||||
 	void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
 | 
			
		||||
 	{
 | 
			
		||||
-		send_cmd(source ? source->nick : Config->s_ChanServ, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
 | 
			
		||||
+		send_cmd(source->nick, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	/* INVITE */
 | 
			
		||||
@@ -196,8 +196,8 @@ class ngIRCdIRCdMessage : public IRCdMessage
 | 
			
		||||
 		{
 | 
			
		||||
 			// a new user is connecting to the network
 | 
			
		||||
 			User *user = do_nick("", params[0], params[2], params[3], source, params[6], Anope::CurTime, "", "", "", params[5]);
 | 
			
		||||
-			if (user)
 | 
			
		||||
-				validate_user(user);
 | 
			
		||||
+			if (user && nickserv)
 | 
			
		||||
+				nickserv->Validate(user);
 | 
			
		||||
 		}
 | 
			
		||||
 		else
 | 
			
		||||
 		{
 | 
			
		||||
@@ -433,7 +433,7 @@ class ProtongIRCd : public Module
 | 
			
		||||
 		ModeManager::AddUserMode(new UserMode(UMODE_CLOAK, 'x'));
 | 
			
		||||
 
 | 
			
		||||
 		/* b/e/I */
 | 
			
		||||
-		ModeManager::AddChannelMode(new ChannelModeBan(CMODE_BAN, 'b'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelModeList(CMODE_BAN, 'b'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelModeList(CMODE_INVITEOVERRIDE, 'I'));
 | 
			
		||||
 
 | 
			
		||||
 		/* v/h/o/a/q */
 | 
			
		||||
@@ -454,13 +454,12 @@ class ProtongIRCd : public Module
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
  public:
 | 
			
		||||
-	ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator),
 | 
			
		||||
+	ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL),
 | 
			
		||||
 		message_kick("KICK", event_kick), message_pass("PASS", event_pass),
 | 
			
		||||
 		message_njoin("NJOIN", event_njoin), message_chaninfo("CHANINFO", event_chaninfo),
 | 
			
		||||
 		message_005("005", event_005), message_442("442", event_442), message_376("376", event_376)
 | 
			
		||||
 	{
 | 
			
		||||
 		this->SetAuthor("Anope");
 | 
			
		||||
-		this->SetType(PROTOCOL);
 | 
			
		||||
 
 | 
			
		||||
 		Capab.SetFlag(CAPAB_QS);
 | 
			
		||||
 
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,93 +0,0 @@
 | 
			
		||||
From 88b2b14a76b8ee053b1f6ea64139350260590043 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: DukePyrolator <DukePyrolator@anope.org>
 | 
			
		||||
Date: Mon, 22 Aug 2011 14:55:07 +0200
 | 
			
		||||
Subject: [PATCH 04/16] ngircd: Do PING-PONG on server burst to "sync servers"
 | 
			
		||||
 | 
			
		||||
Imagine we had three servers, A, B & C linked like so: A<->B<->C:
 | 
			
		||||
 | 
			
		||||
If Anope is linked to A and B splits from A and then reconnects B
 | 
			
		||||
introduces itself, introduces C, sends EOS for C, introduces B's clients
 | 
			
		||||
introduces C's clients, sends EOS for B. This causes all of C's clients
 | 
			
		||||
to be introduced with their server "not syncing".
 | 
			
		||||
 | 
			
		||||
We now send a PING immediately when receiving a new server and then
 | 
			
		||||
finish sync once we get a pong back from that server.
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |   28 ++++++++++++++++++++++++++--
 | 
			
		||||
 1 files changed, 26 insertions(+), 2 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 790b8f4..89aecfd 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -108,11 +108,13 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 
 | 
			
		||||
 	void SendModeInternal(const BotInfo *bi, const Channel *dest, const Anope::string &buf)
 | 
			
		||||
 	{
 | 
			
		||||
+Log(LOG_DEBUG) << "SendModeInternal 1";
 | 
			
		||||
 		send_cmd(bi ? bi->nick : Config->ServerName, "MODE %s %s", dest->name.c_str(), buf.c_str());
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
 | 
			
		||||
 	{
 | 
			
		||||
+Log(LOG_DEBUG) << "SendModeInternal 2";
 | 
			
		||||
 		send_cmd(bi ? bi->nick : Config->ServerName, "MODE %s %s", u->nick.c_str(), buf.c_str());
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
@@ -212,6 +214,8 @@ class ngIRCdIRCdMessage : public IRCdMessage
 | 
			
		||||
 			do_server("", params[0], 0, params[2], params[1]);
 | 
			
		||||
 		else
 | 
			
		||||
 			do_server(source, params[0], params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0, params[3], params[2]);
 | 
			
		||||
+
 | 
			
		||||
+		ircdproto->SendPing(Config->ServerName, params[0]);
 | 
			
		||||
 		return true;
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
@@ -253,6 +257,25 @@ class ngIRCdIRCdMessage : public IRCdMessage
 | 
			
		||||
 	}
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
+/** This is here because:
 | 
			
		||||
+ *
 | 
			
		||||
+ * If we had three servers, A, B & C linked like so: A<->B<->C
 | 
			
		||||
+ * If Anope is linked to A and B splits from A and then reconnects
 | 
			
		||||
+ * B introduces itself, introduces C, sends EOS for C, introduces Bs clients
 | 
			
		||||
+ * introduces Cs clients, sends EOS for B. This causes all of Cs clients to be introduced
 | 
			
		||||
+ * with their server "not syncing". We now send a PING immediately when receiving a new server
 | 
			
		||||
+ * and then finish sync once we get a pong back from that server.
 | 
			
		||||
+ */
 | 
			
		||||
+bool event_pong(const Anope::string &source, const std::vector<Anope::string> ¶ms)
 | 
			
		||||
+{
 | 
			
		||||
+	Server *s = Server::Find(source);
 | 
			
		||||
+	if (s && !s->IsSynced())
 | 
			
		||||
+		s->Sync(false);
 | 
			
		||||
+	return true;
 | 
			
		||||
+}
 | 
			
		||||
+
 | 
			
		||||
+
 | 
			
		||||
+
 | 
			
		||||
 /*
 | 
			
		||||
  * CHANINFO <chan> +<modes>
 | 
			
		||||
  * CHANINFO <chan> +<modes> :<topic>
 | 
			
		||||
@@ -416,7 +439,7 @@ bool event_376(const Anope::string &source, const std::vector<Anope::string> &pa
 | 
			
		||||
 class ProtongIRCd : public Module
 | 
			
		||||
 {
 | 
			
		||||
 	Message message_kick, message_pass, message_njoin, message_chaninfo, message_005,
 | 
			
		||||
-		message_442, message_376;
 | 
			
		||||
+		message_442, message_376, message_pong;
 | 
			
		||||
 
 | 
			
		||||
 	ngIRCdProto ircd_proto;
 | 
			
		||||
 	ngIRCdIRCdMessage ircd_message;
 | 
			
		||||
@@ -457,7 +480,8 @@ class ProtongIRCd : public Module
 | 
			
		||||
 	ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL),
 | 
			
		||||
 		message_kick("KICK", event_kick), message_pass("PASS", event_pass),
 | 
			
		||||
 		message_njoin("NJOIN", event_njoin), message_chaninfo("CHANINFO", event_chaninfo),
 | 
			
		||||
-		message_005("005", event_005), message_442("442", event_442), message_376("376", event_376)
 | 
			
		||||
+		message_005("005", event_005), message_442("442", event_442), message_376("376", event_376),
 | 
			
		||||
+		message_pong("PONG", event_pong)
 | 
			
		||||
 	{
 | 
			
		||||
 		this->SetAuthor("Anope");
 | 
			
		||||
 
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,29 +0,0 @@
 | 
			
		||||
From 0d83f8f9ca0de651d664eca6f467f36df0417f7d Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Mon, 22 Aug 2011 14:59:49 +0200
 | 
			
		||||
Subject: [PATCH 05/16] ngircd: always prefix modes in CHANINFO with "+"
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |    6 ++----
 | 
			
		||||
 1 files changed, 2 insertions(+), 4 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 89aecfd..3e5beb3 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -139,10 +139,8 @@ Log(LOG_DEBUG) << "SendModeInternal 2";
 | 
			
		||||
 
 | 
			
		||||
 	void SendChannel(Channel *c)
 | 
			
		||||
 	{
 | 
			
		||||
-		Anope::string mlock_modes = get_mlock_modes(c->ci, true);
 | 
			
		||||
-		if (mlock_modes.empty())
 | 
			
		||||
-			mlock_modes = "+";
 | 
			
		||||
-		send_cmd(Config->ServerName, "CHANINFO %s %s", c->name.c_str(), mlock_modes.c_str());
 | 
			
		||||
+		Anope::string modes = c->GetModes(true, true);
 | 
			
		||||
+		send_cmd(Config->ServerName, "CHANINFO %s +%s", c->name.c_str(), modes.c_str());
 | 
			
		||||
 	}
 | 
			
		||||
 	void SendTopic(BotInfo *bi, Channel *c)
 | 
			
		||||
 	{
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,47 +0,0 @@
 | 
			
		||||
From 1914a36b83b1fc6b4678ef261a1a06eefab9a0ca Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Fri, 26 Aug 2011 17:51:37 +0200
 | 
			
		||||
Subject: [PATCH 06/16] ngircd: support user mode "R" and channel mode "R"
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |    7 ++++---
 | 
			
		||||
 1 files changed, 4 insertions(+), 3 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 3e5beb3..7f4186e 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -449,26 +449,27 @@ class ProtongIRCd : public Module
 | 
			
		||||
 		ModeManager::AddUserMode(new UserMode(UMODE_INVIS, 'i'));
 | 
			
		||||
 		ModeManager::AddUserMode(new UserMode(UMODE_OPER, 'o'));
 | 
			
		||||
 		ModeManager::AddUserMode(new UserMode(UMODE_RESTRICTED, 'r'));
 | 
			
		||||
+		ModeManager::AddUserMode(new UserMode(UMODE_REGISTERED, 'R'));
 | 
			
		||||
 		ModeManager::AddUserMode(new UserMode(UMODE_SNOMASK, 's'));
 | 
			
		||||
 		ModeManager::AddUserMode(new UserMode(UMODE_WALLOPS, 'w'));
 | 
			
		||||
 		ModeManager::AddUserMode(new UserMode(UMODE_CLOAK, 'x'));
 | 
			
		||||
 
 | 
			
		||||
-		/* b/e/I */
 | 
			
		||||
+		/* Add modes for ban and invite lists */
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelModeList(CMODE_BAN, 'b'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelModeList(CMODE_INVITEOVERRIDE, 'I'));
 | 
			
		||||
 
 | 
			
		||||
-		/* v/h/o/a/q */
 | 
			
		||||
+		/* Add channel user modes */
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_VOICE, 'v', '+'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelModeStatus(CMODE_OP, 'o', '@'));
 | 
			
		||||
 
 | 
			
		||||
 		/* Add channel modes */
 | 
			
		||||
-		// channel modes: biIklmnoPstvz
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_INVITE, 'i'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelModeKey('k'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelModeParam(CMODE_LIMIT, 'l'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_MODERATED, 'm'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_NOEXTERNAL, 'n'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_PERM, 'P'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelMode(CMODE_REGISTEREDONLY, 'R'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_SECRET, 's'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_TOPIC, 't'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_SSL, 'z'));
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,96 +0,0 @@
 | 
			
		||||
From 4c9300ede35310ee5642f34e5ac227bd96fc7384 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: DukePyrolator <DukePyrolator@anope.org>
 | 
			
		||||
Date: Sun, 4 Sep 2011 15:08:55 +0200
 | 
			
		||||
Subject: [PATCH 07/16] ngircd: Fix handling of JOIN commands
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |   60 +++++++++++++++++++++++++++++++++++++++---
 | 
			
		||||
 1 files changed, 55 insertions(+), 5 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 7f4186e..3024fdd 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -240,16 +240,58 @@ class ngIRCdIRCdMessage : public IRCdMessage
 | 
			
		||||
 	{
 | 
			
		||||
 		if (!params.empty())
 | 
			
		||||
 		{
 | 
			
		||||
+			Anope::string channel, mode;
 | 
			
		||||
 			size_t pos = params[0].find('\7');
 | 
			
		||||
 			if (pos != Anope::string::npos)
 | 
			
		||||
 			{
 | 
			
		||||
-				Anope::string channel = params[0].substr(0, pos);
 | 
			
		||||
-				Anope::string mode = '+' + params[0].substr(pos, params[0].length()) + " " + source;
 | 
			
		||||
-				do_join(source, channel, "");
 | 
			
		||||
-				do_cmode(source, channel, mode, "");
 | 
			
		||||
+				channel = params[0].substr(0, pos);
 | 
			
		||||
+				mode = '+' + params[0].substr(pos+1, params[0].length()) + " " + source;
 | 
			
		||||
 			}
 | 
			
		||||
 			else
 | 
			
		||||
-				do_join(source, params[0], "");
 | 
			
		||||
+				channel = params[0];
 | 
			
		||||
+
 | 
			
		||||
+			Channel *c = findchan(channel);
 | 
			
		||||
+
 | 
			
		||||
+			if (!c)
 | 
			
		||||
+			{
 | 
			
		||||
+				c = new Channel(channel, Anope::CurTime);
 | 
			
		||||
+				c->SetFlag(CH_SYNCING);
 | 
			
		||||
+			}
 | 
			
		||||
+
 | 
			
		||||
+			User *u = finduser(source);
 | 
			
		||||
+
 | 
			
		||||
+			if (!u)
 | 
			
		||||
+			{
 | 
			
		||||
+				Log(LOG_DEBUG) << "JOIN for nonexistant user " << source << " on " << channel;
 | 
			
		||||
+				return false;
 | 
			
		||||
+			}
 | 
			
		||||
+
 | 
			
		||||
+			EventReturn MOD_RESULT;
 | 
			
		||||
+			FOREACH_RESULT(I_OnPreJoinChannel, OnPreJoinChannel(u, c));
 | 
			
		||||
+
 | 
			
		||||
+			/* Add the user to the channel */
 | 
			
		||||
+			c->JoinUser(u);
 | 
			
		||||
+
 | 
			
		||||
+			/* set the usermodes to the channel */
 | 
			
		||||
+			do_cmode(source, channel, mode, "");
 | 
			
		||||
+
 | 
			
		||||
+			/* Now set whatever modes this user is allowed to have on the channel */
 | 
			
		||||
+			chan_set_correct_modes(u, c, 1);
 | 
			
		||||
+
 | 
			
		||||
+			/* Check to see if modules want the user to join, if they do
 | 
			
		||||
+			 * check to see if they are allowed to join (CheckKick will kick/ban them)
 | 
			
		||||
+			 * Don't trigger OnJoinChannel event then as the user will be destroyed
 | 
			
		||||
+			 */
 | 
			
		||||
+			if (MOD_RESULT != EVENT_STOP && c->ci && c->ci->CheckKick(u))
 | 
			
		||||
+				return false;
 | 
			
		||||
+
 | 
			
		||||
+			FOREACH_MOD(I_OnJoinChannel, OnJoinChannel(u, c));
 | 
			
		||||
+
 | 
			
		||||
+			if (c->HasFlag(CH_SYNCING))
 | 
			
		||||
+			{
 | 
			
		||||
+				c->UnsetFlag(CH_SYNCING);
 | 
			
		||||
+				c->Sync();
 | 
			
		||||
+			}
 | 
			
		||||
 		}
 | 
			
		||||
 		return true;
 | 
			
		||||
 	}
 | 
			
		||||
@@ -491,7 +533,15 @@ class ProtongIRCd : public Module
 | 
			
		||||
 		pmodule_ircd_message(&this->ircd_message);
 | 
			
		||||
 
 | 
			
		||||
 		this->AddModes();
 | 
			
		||||
+
 | 
			
		||||
+		ModuleManager::Attach(I_OnUserNickChange, this);
 | 
			
		||||
 	}
 | 
			
		||||
+
 | 
			
		||||
+	void OnUserNickChange(User *u, const Anope::string &)
 | 
			
		||||
+	{
 | 
			
		||||
+		u->RemoveModeInternal(ModeManager::FindUserModeByName(UMODE_REGISTERED));
 | 
			
		||||
+	}
 | 
			
		||||
+
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
 MODULE_INIT(ProtongIRCd)
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,38 +0,0 @@
 | 
			
		||||
From d363ebd841ea7e1db3c62730023759d69520e0d8 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Tue, 27 Sep 2011 15:08:09 +0200
 | 
			
		||||
Subject: [PATCH 08/16] ngircd: Allow setting modes by clients on burst
 | 
			
		||||
 | 
			
		||||
This change is required by commit 43201ead9575a for the ngIRCd protocol
 | 
			
		||||
module as well.
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |    7 +++++--
 | 
			
		||||
 1 files changed, 5 insertions(+), 2 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 3024fdd..2774168 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -57,14 +57,17 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 		send_cmd(source ? source->nick : Config->ServerName, "WALLOPS :%s", buf.c_str());
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
-	void SendJoin(User *user, Channel *c, const ChannelStatus *status)
 | 
			
		||||
+	void SendJoin(User *user, Channel *c, ChannelStatus *status)
 | 
			
		||||
 	{
 | 
			
		||||
 		send_cmd(user->nick, "JOIN %s", c->name.c_str());
 | 
			
		||||
 		if (status)
 | 
			
		||||
 		{
 | 
			
		||||
+			ChannelStatus cs = *status;
 | 
			
		||||
+			status->ClearFlags();
 | 
			
		||||
+
 | 
			
		||||
 			BotInfo *setter = findbot(user->nick);
 | 
			
		||||
 			for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i)
 | 
			
		||||
-				if (status->HasFlag(ModeManager::ChannelModes[i]->Name))
 | 
			
		||||
+				if (cs.HasFlag(ModeManager::ChannelModes[i]->Name))
 | 
			
		||||
 					c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false);
 | 
			
		||||
 		}
 | 
			
		||||
 	}
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,143 +0,0 @@
 | 
			
		||||
From e74a5303f2357f4a9915bb91038a2e326323db3c Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Fri, 25 Nov 2011 19:16:37 +0100
 | 
			
		||||
Subject: [PATCH 09/16] ngircd: Update protocol module for current Anope 1.9
 | 
			
		||||
 GIT
 | 
			
		||||
 | 
			
		||||
This changes are rquired by:
 | 
			
		||||
 | 
			
		||||
 - b14f5ea88: Fixed accidentally clearing botmodes when joins are sent
 | 
			
		||||
 - cef3eb78d: Remove send_cmd and replace it with a stringstream
 | 
			
		||||
 - ddc3c2f38: Added options:nonicknameownership config option
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |   54 ++++++++++++++++++++++--------------------
 | 
			
		||||
 1 files changed, 28 insertions(+), 26 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 2774168..55cb8d7 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -54,16 +54,22 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 
 | 
			
		||||
 	void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf)
 | 
			
		||||
 	{
 | 
			
		||||
-		send_cmd(source ? source->nick : Config->ServerName, "WALLOPS :%s", buf.c_str());
 | 
			
		||||
+		UplinkSocket::Message(source ? source->nick : Config->ServerName) << "WALLOPS :" << buf;
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
-	void SendJoin(User *user, Channel *c, ChannelStatus *status)
 | 
			
		||||
+	void SendJoin(User *user, Channel *c, const ChannelStatus *status)
 | 
			
		||||
 	{
 | 
			
		||||
-		send_cmd(user->nick, "JOIN %s", c->name.c_str());
 | 
			
		||||
+		UplinkSocket::Message(user->nick) << "JOIN " << c->name;
 | 
			
		||||
 		if (status)
 | 
			
		||||
 		{
 | 
			
		||||
+			/* First save the channel status incase uc->Status == status */
 | 
			
		||||
 			ChannelStatus cs = *status;
 | 
			
		||||
-			status->ClearFlags();
 | 
			
		||||
+			/* If the user is internally on the channel with flags, kill them so that
 | 
			
		||||
+			 * the stacker will allow this.
 | 
			
		||||
+			 */
 | 
			
		||||
+			UserContainer *uc = c->FindUser(user);
 | 
			
		||||
+			if (uc != NULL)
 | 
			
		||||
+				uc->Status->ClearFlags();
 | 
			
		||||
 
 | 
			
		||||
 			BotInfo *setter = findbot(user->nick);
 | 
			
		||||
 			for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i)
 | 
			
		||||
@@ -74,18 +80,18 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 
 | 
			
		||||
 	void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
 | 
			
		||||
 	{
 | 
			
		||||
-		send_cmd(source ? source->nick : Config->ServerName, "KILL %s :%s", user->nick.c_str(), buf.c_str());
 | 
			
		||||
+		UplinkSocket::Message(source ? source->nick : Config->ServerName) << "KILL " << user->nick << " :" << buf;
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	/* SERVER name hop descript */
 | 
			
		||||
 	void SendServer(const Server *server)
 | 
			
		||||
 	{
 | 
			
		||||
-		send_cmd("", "SERVER %s %d :%s", server->GetName().c_str(), server->GetHops(), server->GetDescription().c_str());
 | 
			
		||||
+		UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :" << server->GetDescription();
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	void SendConnect()
 | 
			
		||||
 	{
 | 
			
		||||
-		send_cmd("", "PASS %s 0210-IRC+ Anope|%s:CLHSo P", Config->Uplinks[CurrentUplink]->password.c_str(), Anope::VersionShort().c_str());
 | 
			
		||||
+		UplinkSocket::Message() << "PASS " << Config->Uplinks[CurrentUplink]->password << " 0210-IRC+ Anope|" << Anope::VersionShort() << ":CLHSo P";
 | 
			
		||||
 		/* Make myself known to myself in the serverlist */
 | 
			
		||||
 		SendServer(Me);
 | 
			
		||||
 		/* finish the enhanced server handshake and register the connection */
 | 
			
		||||
@@ -98,56 +104,52 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 		Anope::string modes = "+" + u->GetModes();
 | 
			
		||||
 		XLine x(u->nick, "Reserved for services");
 | 
			
		||||
 		ircdproto->SendSQLine(NULL, &x);
 | 
			
		||||
-		send_cmd(Config->ServerName, "NICK %s 1 %s %s 1 %s :%s", u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str(), modes.c_str(), u->realname.c_str());
 | 
			
		||||
+		UplinkSocket::Message(Config->ServerName) << "NICK " << u->nick << " 1 " << u->GetIdent() << " " << u->host << " 1 " << modes << " :" << u->realname;
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	void SendPartInternal(const BotInfo *bi, const Channel *chan, const Anope::string &buf)
 | 
			
		||||
 	{
 | 
			
		||||
 		if (!buf.empty())
 | 
			
		||||
-			send_cmd(bi->nick, "PART %s :%s", chan->name.c_str(), buf.c_str());
 | 
			
		||||
+			UplinkSocket::Message(bi->nick) << "PART " << chan->name << " :" << buf;
 | 
			
		||||
 		else
 | 
			
		||||
-			send_cmd(bi->nick, "PART %s", chan->name.c_str());
 | 
			
		||||
+			UplinkSocket::Message(bi->nick) << "PART " << chan->name;
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	void SendModeInternal(const BotInfo *bi, const Channel *dest, const Anope::string &buf)
 | 
			
		||||
 	{
 | 
			
		||||
-Log(LOG_DEBUG) << "SendModeInternal 1";
 | 
			
		||||
-		send_cmd(bi ? bi->nick : Config->ServerName, "MODE %s %s", dest->name.c_str(), buf.c_str());
 | 
			
		||||
+		UplinkSocket::Message(bi ? bi->nick : Config->ServerName) << "MODE " << dest->name << " " << buf;
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf)
 | 
			
		||||
 	{
 | 
			
		||||
-Log(LOG_DEBUG) << "SendModeInternal 2";
 | 
			
		||||
-		send_cmd(bi ? bi->nick : Config->ServerName, "MODE %s %s", u->nick.c_str(), buf.c_str());
 | 
			
		||||
+		UplinkSocket::Message(bi ? bi->nick : Config->ServerName) << "MODE " << u->nick << " " << buf;
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
 	void SendKickInternal(const BotInfo *bi, const Channel *chan, const User *user, const Anope::string &buf)
 | 
			
		||||
 	{
 | 
			
		||||
 		if (!buf.empty())
 | 
			
		||||
-			send_cmd(bi->nick, "KICK %s %s :%s", chan->name.c_str(), user->nick.c_str(), buf.c_str());
 | 
			
		||||
+			UplinkSocket::Message(bi->nick) << "KICK " << chan->name << " " << user->nick << " :" << buf;
 | 
			
		||||
 		else
 | 
			
		||||
-			send_cmd(bi->nick, "KICK %s %s", chan->name.c_str(), user->nick.c_str());
 | 
			
		||||
+			UplinkSocket::Message(bi->nick) << "KICK " << chan->name << " " << user->nick;
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
-	void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
 | 
			
		||||
+	void SendChannel(Channel *c)
 | 
			
		||||
 	{
 | 
			
		||||
-		send_cmd(source->nick, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
 | 
			
		||||
+		Anope::string modes = c->GetModes(true, true);
 | 
			
		||||
+		UplinkSocket::Message(Config->ServerName) << "CHANINFO " << c->name << " +" << modes;
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
-	/* INVITE */
 | 
			
		||||
-	void SendInvite(BotInfo *source, const Anope::string &chan, const Anope::string &nick)
 | 
			
		||||
+	void SendTopic(BotInfo *bi, Channel *c)
 | 
			
		||||
 	{
 | 
			
		||||
-		send_cmd(source->nick, "INVITE %s %s", nick.c_str(), chan.c_str());
 | 
			
		||||
+		UplinkSocket::Message(bi->nick) << "TOPIC " << c->name << " :" << c->topic;
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
-	void SendChannel(Channel *c)
 | 
			
		||||
+	void SendLogin(User *u)
 | 
			
		||||
 	{
 | 
			
		||||
-		Anope::string modes = c->GetModes(true, true);
 | 
			
		||||
-		send_cmd(Config->ServerName, "CHANINFO %s +%s", c->name.c_str(), modes.c_str());
 | 
			
		||||
 	}
 | 
			
		||||
-	void SendTopic(BotInfo *bi, Channel *c)
 | 
			
		||||
+
 | 
			
		||||
+	void SendLogout(User *u)
 | 
			
		||||
 	{
 | 
			
		||||
-		send_cmd(bi->nick, "TOPIC %s :%s", c->name.c_str(), c->topic.c_str());
 | 
			
		||||
 	}
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,57 +0,0 @@
 | 
			
		||||
From d2c45d7c578ec684d3b471020f631847316de196 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Fri, 25 Nov 2011 19:17:19 +0100
 | 
			
		||||
Subject: [PATCH 10/16] ngircd: Add ~ProtongIRCd()
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |   13 ++++++++-----
 | 
			
		||||
 1 files changed, 8 insertions(+), 5 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 55cb8d7..5fd62db 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -302,8 +302,7 @@ class ngIRCdIRCdMessage : public IRCdMessage
 | 
			
		||||
 	}
 | 
			
		||||
 };
 | 
			
		||||
 
 | 
			
		||||
-/** This is here because:
 | 
			
		||||
- *
 | 
			
		||||
+/*
 | 
			
		||||
  * If we had three servers, A, B & C linked like so: A<->B<->C
 | 
			
		||||
  * If Anope is linked to A and B splits from A and then reconnects
 | 
			
		||||
  * B introduces itself, introduces C, sends EOS for C, introduces Bs clients
 | 
			
		||||
@@ -319,8 +318,6 @@ bool event_pong(const Anope::string &source, const std::vector<Anope::string> &p
 | 
			
		||||
 	return true;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-
 | 
			
		||||
-
 | 
			
		||||
 /*
 | 
			
		||||
  * CHANINFO <chan> +<modes>
 | 
			
		||||
  * CHANINFO <chan> +<modes> :<topic>
 | 
			
		||||
@@ -480,7 +477,6 @@ bool event_376(const Anope::string &source, const std::vector<Anope::string> &pa
 | 
			
		||||
 	return true;
 | 
			
		||||
 }
 | 
			
		||||
 
 | 
			
		||||
-
 | 
			
		||||
 class ProtongIRCd : public Module
 | 
			
		||||
 {
 | 
			
		||||
 	Message message_kick, message_pass, message_njoin, message_chaninfo, message_005,
 | 
			
		||||
@@ -542,6 +538,13 @@ class ProtongIRCd : public Module
 | 
			
		||||
 		ModuleManager::Attach(I_OnUserNickChange, this);
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
+        ~ProtongIRCd()
 | 
			
		||||
+        {
 | 
			
		||||
+                pmodule_ircd_var(NULL);
 | 
			
		||||
+                pmodule_ircd_proto(NULL);
 | 
			
		||||
+                pmodule_ircd_message(NULL);
 | 
			
		||||
+        }
 | 
			
		||||
+
 | 
			
		||||
 	void OnUserNickChange(User *u, const Anope::string &)
 | 
			
		||||
 	{
 | 
			
		||||
 		u->RemoveModeInternal(ModeManager::FindUserModeByName(UMODE_REGISTERED));
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,29 +0,0 @@
 | 
			
		||||
From 4dc5a3d3e2fbb218461d9459bff1c0a392a75881 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Sat, 31 Dec 2011 16:12:52 +0100
 | 
			
		||||
Subject: [PATCH 11/16] ngircd: Update protocol module for current Anope 1.9
 | 
			
		||||
 GIT
 | 
			
		||||
 | 
			
		||||
This changes are rquired by:
 | 
			
		||||
 | 
			
		||||
 - 150831c1a: Made capab management a bit simplier
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |    2 +-
 | 
			
		||||
 1 files changed, 1 insertions(+), 1 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 5fd62db..9c26ec8 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -527,7 +527,7 @@ class ProtongIRCd : public Module
 | 
			
		||||
 	{
 | 
			
		||||
 		this->SetAuthor("Anope");
 | 
			
		||||
 
 | 
			
		||||
-		Capab.SetFlag(CAPAB_QS);
 | 
			
		||||
+		Capab.insert("QS");
 | 
			
		||||
 
 | 
			
		||||
 		pmodule_ircd_var(myIrcd);
 | 
			
		||||
 		pmodule_ircd_proto(&this->ircd_proto);
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,25 +0,0 @@
 | 
			
		||||
From 99c18cafdee28bfb17fad5f0526b3ed5d1f5f312 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Sat, 31 Dec 2011 16:17:50 +0100
 | 
			
		||||
Subject: [PATCH 12/16] ngircd: let Anope know that channel mode "r" is
 | 
			
		||||
 supported
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |    1 +
 | 
			
		||||
 1 files changed, 1 insertions(+), 0 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 9c26ec8..6155667 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -512,6 +512,7 @@ class ProtongIRCd : public Module
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_MODERATED, 'm'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_NOEXTERNAL, 'n'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_PERM, 'P'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelModeRegistered('r'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_REGISTEREDONLY, 'R'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_SECRET, 's'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelMode(CMODE_TOPIC, 't'));
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,28 +0,0 @@
 | 
			
		||||
From 5a19b69f0daceb5b12ec751bc919519a7f712f2d Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Sun, 15 Jan 2012 13:36:14 +0100
 | 
			
		||||
Subject: [PATCH 13/16] ngircd: Update copyright notice
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |    7 ++++---
 | 
			
		||||
 1 files changed, 4 insertions(+), 3 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 6155667..024c61d 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -1,7 +1,8 @@
 | 
			
		||||
-/* ngIRCd IRCD functions
 | 
			
		||||
+/*
 | 
			
		||||
+ * ngIRCd Protocol module for Anope IRC Services
 | 
			
		||||
  *
 | 
			
		||||
- * (C) 2003-2011 Anope Team
 | 
			
		||||
- * Contact us at team@anope.org
 | 
			
		||||
+ * (C) 2011-2012 Alexander Barton <alex@barton.de>
 | 
			
		||||
+ * (C) 2011 Anope Team <team@anope.org>
 | 
			
		||||
  *
 | 
			
		||||
  * Please read COPYING and README for further details.
 | 
			
		||||
  *
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,35 +0,0 @@
 | 
			
		||||
From acc24a7f4488f6ef0fb240a76766db4220b62d53 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Sun, 22 Jan 2012 19:05:28 +0100
 | 
			
		||||
Subject: [PATCH 14/16] ngircd: set/unset GLINE's on AKILL commands
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |   10 ++++++++--
 | 
			
		||||
 1 files changed, 8 insertions(+), 2 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 024c61d..3bc3812 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -48,10 +48,16 @@ class ngIRCdProto : public IRCDProto
 | 
			
		||||
 {
 | 
			
		||||
 	void SendAkill(User *u, const XLine *x)
 | 
			
		||||
 	{
 | 
			
		||||
-		// TODO: ADD SOME CODE
 | 
			
		||||
+		// Calculate the time left before this would expire, capping it at 2 days
 | 
			
		||||
+		time_t timeleft = x->Expires - Anope::CurTime;
 | 
			
		||||
+		if (timeleft > 172800 || !x->Expires)
 | 
			
		||||
+			timeleft = 172800;
 | 
			
		||||
+		UplinkSocket::Message(Config->ServerName) << "GLINE " << x->Mask << " " << timeleft << " :" << x->Reason << " (" << x->By << ")";
 | 
			
		||||
 	}
 | 
			
		||||
 
 | 
			
		||||
-	void SendAkillDel(const XLine*) { }
 | 
			
		||||
+	void SendAkillDel(const XLine *x) {
 | 
			
		||||
+		UplinkSocket::Message(Config->ServerName) << "GLINE " << x->Mask;
 | 
			
		||||
+	}
 | 
			
		||||
 
 | 
			
		||||
 	void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf)
 | 
			
		||||
 	{
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,27 +0,0 @@
 | 
			
		||||
From 3a61b190db79848d4519296432ebb2ab714c42b7 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Sun, 22 Jan 2012 19:06:34 +0100
 | 
			
		||||
Subject: [PATCH 15/16] ngircd: ngIRCd supports channel mode 'e' now
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |    3 ++-
 | 
			
		||||
 1 files changed, 2 insertions(+), 1 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 3bc3812..0f87cbd 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -504,8 +504,9 @@ class ProtongIRCd : public Module
 | 
			
		||||
 		ModeManager::AddUserMode(new UserMode(UMODE_WALLOPS, 'w'));
 | 
			
		||||
 		ModeManager::AddUserMode(new UserMode(UMODE_CLOAK, 'x'));
 | 
			
		||||
 
 | 
			
		||||
-		/* Add modes for ban and invite lists */
 | 
			
		||||
+		/* Add modes for ban, exception, and invite lists */
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelModeList(CMODE_BAN, 'b'));
 | 
			
		||||
+		ModeManager::AddChannelMode(new ChannelModeList(CMODE_EXCEPT, 'e'));
 | 
			
		||||
 		ModeManager::AddChannelMode(new ChannelModeList(CMODE_INVITEOVERRIDE, 'I'));
 | 
			
		||||
 
 | 
			
		||||
 		/* Add channel user modes */
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,35 +0,0 @@
 | 
			
		||||
From a7c48fcf47af757cf1b4eeaa6bcc96f4ae1f7410 Mon Sep 17 00:00:00 2001
 | 
			
		||||
From: Alexander Barton <alex@barton.de>
 | 
			
		||||
Date: Sat, 4 Feb 2012 11:13:36 +0100
 | 
			
		||||
Subject: [PATCH 16/16] ngircd: support SQUERY command
 | 
			
		||||
 | 
			
		||||
Thanks to DukePyrolator for explaining these changes to me.
 | 
			
		||||
---
 | 
			
		||||
 modules/protocol/ngircd.cpp |    4 ++--
 | 
			
		||||
 1 files changed, 2 insertions(+), 2 deletions(-)
 | 
			
		||||
 | 
			
		||||
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
 | 
			
		||||
index 0f87cbd..530686e 100644
 | 
			
		||||
--- a/modules/protocol/ngircd.cpp
 | 
			
		||||
+++ b/modules/protocol/ngircd.cpp
 | 
			
		||||
@@ -487,7 +487,7 @@ bool event_376(const Anope::string &source, const std::vector<Anope::string> &pa
 | 
			
		||||
 class ProtongIRCd : public Module
 | 
			
		||||
 {
 | 
			
		||||
 	Message message_kick, message_pass, message_njoin, message_chaninfo, message_005,
 | 
			
		||||
-		message_442, message_376, message_pong;
 | 
			
		||||
+		message_442, message_376, message_pong, message_squery;
 | 
			
		||||
 
 | 
			
		||||
 	ngIRCdProto ircd_proto;
 | 
			
		||||
 	ngIRCdIRCdMessage ircd_message;
 | 
			
		||||
@@ -532,7 +532,7 @@ class ProtongIRCd : public Module
 | 
			
		||||
 		message_kick("KICK", event_kick), message_pass("PASS", event_pass),
 | 
			
		||||
 		message_njoin("NJOIN", event_njoin), message_chaninfo("CHANINFO", event_chaninfo),
 | 
			
		||||
 		message_005("005", event_005), message_442("442", event_442), message_376("376", event_376),
 | 
			
		||||
-		message_pong("PONG", event_pong)
 | 
			
		||||
+		message_pong("PONG", event_pong), message_squery("SQUERY", ::OnPrivmsg)
 | 
			
		||||
 	{
 | 
			
		||||
 		this->SetAuthor("Anope");
 | 
			
		||||
 
 | 
			
		||||
-- 
 | 
			
		||||
1.7.8.3
 | 
			
		||||
 | 
			
		||||
@@ -1,20 +0,0 @@
 | 
			
		||||
#
 | 
			
		||||
# ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
# Copyright (c)2001-2011 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.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = \
 | 
			
		||||
	README \
 | 
			
		||||
	0001-Revert-Removed-ngircd.patch \
 | 
			
		||||
	0002-ngircd-whitespace-fixes.patch
 | 
			
		||||
 | 
			
		||||
maintainer-clean-local:
 | 
			
		||||
	rm -f Makefile Makefile.in
 | 
			
		||||
 | 
			
		||||
# -eof-
 | 
			
		||||
@@ -1,35 +0,0 @@
 | 
			
		||||
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
                           http://ngircd.barton.de/
 | 
			
		||||
 | 
			
		||||
               (c)2001-2012 Alexander Barton and Contributors.
 | 
			
		||||
               ngIRCd is free software and published under the
 | 
			
		||||
                   terms of the GNU General Public License.
 | 
			
		||||
 | 
			
		||||
                          -- contrib/Anope/README --
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
This directory contains two preliminary patches that (re-) add a ngIRCd
 | 
			
		||||
protocol module to the Anope 1.9 development branch. It has been tested
 | 
			
		||||
with Anope 1.9.6, there is no guarantee that it will work with other
 | 
			
		||||
versions as Anope 1.9.x is under heavy development ...
 | 
			
		||||
 | 
			
		||||
To build this Anope protocol module, you have to
 | 
			
		||||
 | 
			
		||||
 - Download the Anope 1.9.x sources (only tested with 1.9.6!),
 | 
			
		||||
 - Patch in the ngIRCd protocol module,
 | 
			
		||||
 - Build and install Anope as usual,
 | 
			
		||||
 - Configure Anope as usual, use "ngircd" as protocol module.
 | 
			
		||||
 | 
			
		||||
So the command sequence can be something like this:
 | 
			
		||||
 | 
			
		||||
 $ tar xzf anope-1.9.6-source.tar.gz
 | 
			
		||||
 $ cd anope-1.9.6-source
 | 
			
		||||
 $ for p in .../ngircd/contrib/Anope/*.patch ; do patch -p1 < $p ; done
 | 
			
		||||
 $ ./Config
 | 
			
		||||
 $ cd build
 | 
			
		||||
 $ make
 | 
			
		||||
 $ make install
 | 
			
		||||
 | 
			
		||||
Please have a look at the file doc/Services.txt for more information about
 | 
			
		||||
how to set up ngIRCd and Anope.
 | 
			
		||||
@@ -1,3 +1,75 @@
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
 -- Alexander Barton <alex@barton.de>  Mon, 17 Dec 2012 13:04:15 +0100
 | 
			
		||||
 | 
			
		||||
ngircd (20~rc2-0ab1) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * New "upstream" release candidate 2 for ngIRCd Release 20.
 | 
			
		||||
 | 
			
		||||
 -- Alexander Barton <alex@barton.de>  Sun, 02 Dec 2012 18:51:06 +0100
 | 
			
		||||
 | 
			
		||||
ngircd (20~rc1-0ab1) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * New "upstream" release candidate 1 for ngIRCd Release 20.
 | 
			
		||||
 | 
			
		||||
 -- Alexander Barton <alex@barton.de>  Sun, 11 Nov 2012 16:03:32 +0100
 | 
			
		||||
 | 
			
		||||
ngircd (19.2-0ab1) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * New "upstream" release: ngIRCd 19.2.
 | 
			
		||||
 | 
			
		||||
 -- Alexander Barton <alex@barton.de>  Tue, 19 Jun 2012 11:03:12 +0200
 | 
			
		||||
 | 
			
		||||
ngircd (19.2~rc1-0ab1) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * New "upstream" release candidate 1 for ngIRC Release 19.2.
 | 
			
		||||
 | 
			
		||||
 -- Alexander Barton <alex@barton.de>  Wed, 13 Jun 2012 10:59:34 +0200
 | 
			
		||||
 | 
			
		||||
ngircd (19.1-0ab1) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * New "upstream" release: ngIRCd 19.1.
 | 
			
		||||
 | 
			
		||||
 -- Alexander Barton <alex@barton.de>  Mon, 19 Mar 2012 19:18:28 +0100
 | 
			
		||||
 | 
			
		||||
ngircd (19-0ab1) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * New "upstream" release: ngIRCd 19.
 | 
			
		||||
 | 
			
		||||
 -- Alexander Barton <alex@barton.de>  Wed, 29 Feb 2012 17:34:08 +0100
 | 
			
		||||
 | 
			
		||||
ngircd (19~rc1-0ab1) unstable; urgency=low
 | 
			
		||||
 | 
			
		||||
  * New "upstream" release candidate 1 for ngIRCd Release 19.
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ Build-Depends: debhelper (>> 4.0.0),
 | 
			
		||||
    libident-dev,
 | 
			
		||||
    libgnutls-dev,
 | 
			
		||||
    libpam0g-dev,
 | 
			
		||||
    telnet,
 | 
			
		||||
    telnet | telnet-ssl,
 | 
			
		||||
Standards-Version: 3.9.1
 | 
			
		||||
 | 
			
		||||
Package: ngircd
 | 
			
		||||
@@ -18,11 +18,11 @@ Architecture: any
 | 
			
		||||
Depends: ${shlibs:Depends}, ${misc:Depends}
 | 
			
		||||
Provides: ircd
 | 
			
		||||
Description: lightweight Internet Relay Chat server
 | 
			
		||||
 This package provides ngIRCd, a lightweight Internet Relay Chat
 | 
			
		||||
 server for small or private networks. It is simple to configure, can
 | 
			
		||||
 cope with dynamic IP addresses, and supports IPv6 as well as SSL. It
 | 
			
		||||
 is written from scratch, not based on the original IRCd and quite
 | 
			
		||||
 portable.
 | 
			
		||||
 This package provides ngIRCd, a portable and lightweight Internet Relay
 | 
			
		||||
 Chat server for small or private networks, developed under the GNU
 | 
			
		||||
 General Public License (GPL). It is simple to configure, can cope with
 | 
			
		||||
 dynamic IP addresses, and supports IPv6 as well as SSL. It is written
 | 
			
		||||
 from scratch and not based on the original IRCd.
 | 
			
		||||
 .
 | 
			
		||||
 This package contains the "standard distribution", including support for
 | 
			
		||||
 syslog logging and compressed server-links using zlib. Please have a look
 | 
			
		||||
@@ -35,11 +35,11 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
 | 
			
		||||
Provides: ircd
 | 
			
		||||
Conflicts: ngircd, ngircd-dbg
 | 
			
		||||
Description: lightweight Internet Relay Chat server
 | 
			
		||||
 This package provides ngIRCd, a lightweight Internet Relay Chat
 | 
			
		||||
 server for small or private networks. It is simple to configure, can
 | 
			
		||||
 cope with dynamic IP addresses, and supports IPv6 as well as SSL. It
 | 
			
		||||
 is written from scratch, not based on the original IRCd and quite
 | 
			
		||||
 portable.
 | 
			
		||||
 This package provides ngIRCd, a portable and lightweight Internet Relay
 | 
			
		||||
 Chat server for small or private networks, developed under the GNU
 | 
			
		||||
 General Public License (GPL). It is simple to configure, can cope with
 | 
			
		||||
 dynamic IP addresses, and supports IPv6 as well as SSL. It is written
 | 
			
		||||
 from scratch and not based on the original IRCd.
 | 
			
		||||
 .
 | 
			
		||||
 In addition to the features of the "standard package", this package
 | 
			
		||||
 includes support for TCP wrappers, IDENT requests, the IPv6 protocol and
 | 
			
		||||
@@ -51,11 +51,11 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
 | 
			
		||||
Provides: ircd
 | 
			
		||||
Conflicts: ngircd, ngircd-full
 | 
			
		||||
Description: lightweight Internet Relay Chat server
 | 
			
		||||
 This package provides ngIRCd, a lightweight Internet Relay Chat
 | 
			
		||||
 server for small or private networks. It is simple to configure, can
 | 
			
		||||
 cope with dynamic IP addresses, and supports IPv6 as well as SSL. It
 | 
			
		||||
 is written from scratch, not based on the original IRCd and quite
 | 
			
		||||
 portable.
 | 
			
		||||
 This package provides ngIRCd, a portable and lightweight Internet Relay
 | 
			
		||||
 Chat server for small or private networks, developed under the GNU
 | 
			
		||||
 General Public License (GPL). It is simple to configure, can cope with
 | 
			
		||||
 dynamic IP addresses, and supports IPv6 as well as SSL. It is written
 | 
			
		||||
 from scratch and not based on the original IRCd.
 | 
			
		||||
 .
 | 
			
		||||
 In addition to the features of the "standard package", this package
 | 
			
		||||
 includes support for TCP wrappers, IDENT requests, the IPv6 protocol and
 | 
			
		||||
 
 | 
			
		||||
@@ -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-2013 Alexander Barton <alex@barton.de>
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
### BEGIN INIT INFO
 | 
			
		||||
@@ -24,13 +24,13 @@ 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() {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
#!/usr/bin/make -f
 | 
			
		||||
#
 | 
			
		||||
# ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
# Copyright (c)2001-2009 Alexander Barton <alex@barton.de>
 | 
			
		||||
# Copyright (c)2001-2012 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
 | 
			
		||||
@@ -53,7 +53,8 @@ configure-ngircd-full: configure
 | 
			
		||||
	  --sysconfdir=/etc/ngircd \
 | 
			
		||||
	  --mandir=\$${prefix}/share/man \
 | 
			
		||||
	  --with-syslog --with-zlib \
 | 
			
		||||
	  --with-gnutls --with-ident --with-tcp-wrappers --with-pam \
 | 
			
		||||
	  --with-gnutls --with-iconv --with-ident --with-tcp-wrappers \
 | 
			
		||||
	  --with-pam \
 | 
			
		||||
	  --enable-ipv6
 | 
			
		||||
 | 
			
		||||
configure-ngircd-full-dbg: configure
 | 
			
		||||
@@ -66,7 +67,8 @@ configure-ngircd-full-dbg: configure
 | 
			
		||||
	  --mandir=\$${prefix}/share/man \
 | 
			
		||||
	  --enable-debug --enable-sniffer \
 | 
			
		||||
	  --with-syslog --with-zlib \
 | 
			
		||||
	  --with-gnutls --with-ident --with-tcp-wrappers --with-pam \
 | 
			
		||||
	  --with-gnutls --with-iconv --with-ident --with-tcp-wrappers \
 | 
			
		||||
	  --with-pam \
 | 
			
		||||
	  --enable-ipv6
 | 
			
		||||
 | 
			
		||||
build:
 | 
			
		||||
@@ -214,7 +216,7 @@ binary-arch: build install
 | 
			
		||||
	dh_installdocs -a
 | 
			
		||||
	dh_installinit -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
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2011 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
 | 
			
		||||
@@ -11,17 +11,23 @@
 | 
			
		||||
 * Static configuration file for Mac OS X Xcode project
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define PACKAGE_NAME "ngircd"
 | 
			
		||||
#define PACKAGE_NAME "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 */
 | 
			
		||||
@@ -51,6 +57,9 @@
 | 
			
		||||
/* Define if PAM should be used */
 | 
			
		||||
#define PAM 1
 | 
			
		||||
 | 
			
		||||
/* Define if libiconv can be used, e.g. for CHARCONV */
 | 
			
		||||
#define ICONV 1
 | 
			
		||||
 | 
			
		||||
/* -- Supported features -- */
 | 
			
		||||
 | 
			
		||||
/* Define if SSP C support is enabled. */
 | 
			
		||||
@@ -76,6 +85,8 @@
 | 
			
		||||
 | 
			
		||||
/* Define to 1 if you have the `gai_strerror' function. */
 | 
			
		||||
#define HAVE_GAI_STRERROR 1
 | 
			
		||||
/* Define to 1 if you have the `iconv_open' function. */
 | 
			
		||||
#define HAVE_ICONV_OPEN 1
 | 
			
		||||
/* Define to 1 if you have the `kqueue' function. */
 | 
			
		||||
#define HAVE_KQUEUE 1
 | 
			
		||||
/* Define to 1 if you have the `inet_ntoa' function. */
 | 
			
		||||
@@ -98,6 +109,8 @@
 | 
			
		||||
#define HAVE_GETNAMEINFO 1
 | 
			
		||||
/* Define to 1 if you have the `sigaction' function. */
 | 
			
		||||
#define HAVE_SIGACTION 1
 | 
			
		||||
/* Define to 1 if you have the `setsid' function. */
 | 
			
		||||
#define HAVE_SETSID 1
 | 
			
		||||
 | 
			
		||||
/* Define if socklen_t exists */
 | 
			
		||||
#define HAVE_socklen_t 1
 | 
			
		||||
 
 | 
			
		||||
@@ -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-2013 Alexander Barton and Contributors.\
 | 
			
		||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
 | 
			
		||||
 | 
			
		||||
\i0 \cf0 \
 | 
			
		||||
@@ -156,7 +156,7 @@ Each version is given a distinguishing version number.  If the Program specifies
 | 
			
		||||
{\colortbl;\red255\green255\blue255;}
 | 
			
		||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
 | 
			
		||||
 | 
			
		||||
\f0\fs26 \cf0 Please not:\
 | 
			
		||||
\f0\fs26 \cf0 Please note:\
 | 
			
		||||
\
 | 
			
		||||
\pard\tx260\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li260\fi-260\ql\qnatural\pardirnatural
 | 
			
		||||
\cf0 \'95	You 
 | 
			
		||||
 
 | 
			
		||||
@@ -36,11 +36,18 @@
 | 
			
		||||
		FA322DBE0CEF7766001761B3 /* tool.c in Sources */ = {isa = PBXBuildFile; fileRef = FA322D330CEF74B1001761B3 /* tool.c */; };
 | 
			
		||||
		FA322DC10CEF77CB001761B3 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FA322DC00CEF77CB001761B3 /* libz.dylib */; };
 | 
			
		||||
		FA407F2E0DB159F400271AF1 /* ng_ipaddr.c in Sources */ = {isa = PBXBuildFile; fileRef = FA407F2C0DB159F400271AF1 /* ng_ipaddr.c */; };
 | 
			
		||||
		FA4F165A164836B100DBD011 /* irc-metadata.c in Sources */ = {isa = PBXBuildFile; fileRef = FA4F1659164836B100DBD011 /* irc-metadata.c */; };
 | 
			
		||||
		FA6BBC631605F0AC0004247A /* conn-encoding.c in Sources */ = {isa = PBXBuildFile; fileRef = FA6BBC5F1605F0AB0004247A /* conn-encoding.c */; };
 | 
			
		||||
		FA6BBC641605F0AC0004247A /* irc-encoding.c in Sources */ = {isa = PBXBuildFile; fileRef = FA6BBC611605F0AC0004247A /* irc-encoding.c */; };
 | 
			
		||||
		FA6BBC661605F6D60004247A /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FA6BBC651605F6D60004247A /* libiconv.dylib */; };
 | 
			
		||||
		FA85178C0FA061EC006A1F5A /* op.c in Sources */ = {isa = PBXBuildFile; fileRef = FA85178B0FA061EC006A1F5A /* op.c */; };
 | 
			
		||||
		FA99428C10E82A27007F27ED /* proc.c in Sources */ = {isa = PBXBuildFile; fileRef = FA99428B10E82A27007F27ED /* proc.c */; };
 | 
			
		||||
		FAA3D27B0F139CDC00B2447E /* conn-ssl.c in Sources */ = {isa = PBXBuildFile; fileRef = FAA3D2790F139CDC00B2447E /* conn-ssl.c */; };
 | 
			
		||||
		FAA97C57124A271400D5BBA9 /* sighandlers.c in Sources */ = {isa = PBXBuildFile; fileRef = FAA97C55124A271400D5BBA9 /* sighandlers.c */; };
 | 
			
		||||
		FAACD5F514A6099C006ED74F /* class.c in Sources */ = {isa = PBXBuildFile; fileRef = FAACD5F314A6099C006ED74F /* class.c */; };
 | 
			
		||||
		FAD5853215271AAB00328741 /* client-cap.c in Sources */ = {isa = PBXBuildFile; fileRef = FAD5853015271AAB00328741 /* client-cap.c */; };
 | 
			
		||||
		FAD5853515271AB800328741 /* irc-cap.c in Sources */ = {isa = PBXBuildFile; fileRef = FAD5853315271AB800328741 /* irc-cap.c */; };
 | 
			
		||||
		FAD5853815272C2600328741 /* login.c in Sources */ = {isa = PBXBuildFile; fileRef = FAD5853615272C2500328741 /* login.c */; };
 | 
			
		||||
		FAE5CC2E0CF2308A007D69B6 /* numeric.c in Sources */ = {isa = PBXBuildFile; fileRef = FAE5CC2D0CF2308A007D69B6 /* numeric.c */; };
 | 
			
		||||
/* End PBXBuildFile section */
 | 
			
		||||
 | 
			
		||||
@@ -57,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; name = ngIRCd; 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>"; };
 | 
			
		||||
@@ -105,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>"; };
 | 
			
		||||
@@ -119,7 +140,6 @@
 | 
			
		||||
		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>"; };
 | 
			
		||||
@@ -131,8 +151,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>"; };
 | 
			
		||||
@@ -142,9 +160,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; };
 | 
			
		||||
@@ -152,7 +167,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; };
 | 
			
		||||
@@ -167,9 +181,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>"; };
 | 
			
		||||
@@ -183,16 +196,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>"; };
 | 
			
		||||
@@ -200,6 +210,13 @@
 | 
			
		||||
		FA4B08E613E7F91700765BA3 /* ngIRCd-Logo.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "ngIRCd-Logo.gif"; sourceTree = "<group>"; };
 | 
			
		||||
		FA4B08E713E7F91700765BA3 /* ngircd-redhat.init */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "ngircd-redhat.init"; sourceTree = "<group>"; };
 | 
			
		||||
		FA4B08E813E7F91C00765BA3 /* platformtest.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = platformtest.sh; sourceTree = "<group>"; };
 | 
			
		||||
		FA4F1659164836B100DBD011 /* irc-metadata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "irc-metadata.c"; sourceTree = "<group>"; };
 | 
			
		||||
		FA4F165C164836BF00DBD011 /* irc-metadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "irc-metadata.h"; sourceTree = "<group>"; };
 | 
			
		||||
		FA6BBC5F1605F0AB0004247A /* conn-encoding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "conn-encoding.c"; sourceTree = "<group>"; };
 | 
			
		||||
		FA6BBC601605F0AC0004247A /* conn-encoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "conn-encoding.h"; sourceTree = "<group>"; };
 | 
			
		||||
		FA6BBC611605F0AC0004247A /* irc-encoding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "irc-encoding.c"; sourceTree = "<group>"; };
 | 
			
		||||
		FA6BBC621605F0AC0004247A /* irc-encoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "irc-encoding.h"; sourceTree = "<group>"; };
 | 
			
		||||
		FA6BBC651605F6D60004247A /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = ../../../../../../../usr/lib/libiconv.dylib; sourceTree = "<group>"; };
 | 
			
		||||
		FA77849A133FB9FF00740057 /* sample-ngircd.conf.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "sample-ngircd.conf.tmpl"; sourceTree = "<group>"; };
 | 
			
		||||
		FA85178A0FA061EC006A1F5A /* op.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = op.h; sourceTree = "<group>"; };
 | 
			
		||||
		FA85178B0FA061EC006A1F5A /* op.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = op.c; sourceTree = "<group>"; };
 | 
			
		||||
@@ -231,6 +248,19 @@
 | 
			
		||||
		FAA97C56124A271400D5BBA9 /* sighandlers.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = sighandlers.h; sourceTree = "<group>"; };
 | 
			
		||||
		FAACD5F314A6099C006ED74F /* class.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = class.c; sourceTree = "<group>"; };
 | 
			
		||||
		FAACD5F414A6099C006ED74F /* class.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = class.h; sourceTree = "<group>"; };
 | 
			
		||||
		FAD5852F15271A7800328741 /* Capabilities.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Capabilities.txt; sourceTree = "<group>"; };
 | 
			
		||||
		FAD5853015271AAB00328741 /* client-cap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "client-cap.c"; sourceTree = "<group>"; };
 | 
			
		||||
		FAD5853115271AAB00328741 /* client-cap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "client-cap.h"; sourceTree = "<group>"; };
 | 
			
		||||
		FAD5853315271AB800328741 /* irc-cap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "irc-cap.c"; sourceTree = "<group>"; };
 | 
			
		||||
		FAD5853415271AB800328741 /* irc-cap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "irc-cap.h"; sourceTree = "<group>"; };
 | 
			
		||||
		FAD5853615272C2500328741 /* login.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = login.c; sourceTree = "<group>"; };
 | 
			
		||||
		FAD5853715272C2500328741 /* login.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = login.h; sourceTree = "<group>"; };
 | 
			
		||||
		FAE22BD215270EA300F1A5AB /* Bopm.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Bopm.txt; sourceTree = "<group>"; };
 | 
			
		||||
		FAE22BD415270EA300F1A5AB /* Contributing.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Contributing.txt; sourceTree = "<group>"; };
 | 
			
		||||
		FAE22BD515270EB500F1A5AB /* HowToRelease.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = HowToRelease.txt; sourceTree = "<group>"; };
 | 
			
		||||
		FAE22BD615270EB500F1A5AB /* Modes.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = Modes.txt; sourceTree = "<group>"; };
 | 
			
		||||
		FAE22BD715270EB500F1A5AB /* PAM.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = PAM.txt; sourceTree = "<group>"; };
 | 
			
		||||
		FAE22BD815270EC400F1A5AB /* README-Interix.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = "README-Interix.txt"; sourceTree = "<group>"; };
 | 
			
		||||
		FAE5CC2C0CF2308A007D69B6 /* numeric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = numeric.h; sourceTree = "<group>"; };
 | 
			
		||||
		FAE5CC2D0CF2308A007D69B6 /* numeric.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = numeric.c; sourceTree = "<group>"; };
 | 
			
		||||
/* End PBXFileReference section */
 | 
			
		||||
@@ -242,6 +272,7 @@
 | 
			
		||||
			files = (
 | 
			
		||||
				FA322DC10CEF77CB001761B3 /* libz.dylib in Frameworks */,
 | 
			
		||||
				FA2D567B11EA1AB300D37A35 /* libpam.dylib in Frameworks */,
 | 
			
		||||
				FA6BBC661605F6D60004247A /* libiconv.dylib in Frameworks */,
 | 
			
		||||
			);
 | 
			
		||||
			runOnlyForDeploymentPostprocessing = 0;
 | 
			
		||||
		};
 | 
			
		||||
@@ -251,27 +282,32 @@
 | 
			
		||||
		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 */,
 | 
			
		||||
				FA322DC00CEF77CB001761B3 /* libz.dylib */,
 | 
			
		||||
				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;
 | 
			
		||||
@@ -284,12 +320,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;
 | 
			
		||||
@@ -298,8 +334,7 @@
 | 
			
		||||
		FA322CD70CEF74B1001761B3 /* ngircd */ = {
 | 
			
		||||
			isa = PBXGroup;
 | 
			
		||||
			children = (
 | 
			
		||||
				FAA3D2790F139CDC00B2447E /* conn-ssl.c */,
 | 
			
		||||
				FAA3D27A0F139CDC00B2447E /* conn-ssl.h */,
 | 
			
		||||
				FA18A64616CEE0DD00132F66 /* Makefile.ng */,
 | 
			
		||||
				FA322CD90CEF74B1001761B3 /* array.c */,
 | 
			
		||||
				FA322CDA0CEF74B1001761B3 /* array.h */,
 | 
			
		||||
				FA322CDB0CEF74B1001761B3 /* channel.c */,
 | 
			
		||||
@@ -308,26 +343,41 @@
 | 
			
		||||
				FAACD5F414A6099C006ED74F /* class.h */,
 | 
			
		||||
				FA322CDD0CEF74B1001761B3 /* client.c */,
 | 
			
		||||
				FA322CDE0CEF74B1001761B3 /* client.h */,
 | 
			
		||||
				FAD5853015271AAB00328741 /* client-cap.c */,
 | 
			
		||||
				FAD5853115271AAB00328741 /* client-cap.h */,
 | 
			
		||||
				FA322CDF0CEF74B1001761B3 /* conf.c */,
 | 
			
		||||
				FA322CE00CEF74B1001761B3 /* conf.h */,
 | 
			
		||||
				FAA3D2780F139CDC00B2447E /* conf-ssl.h */,
 | 
			
		||||
				FA322CE10CEF74B1001761B3 /* conn-func.c */,
 | 
			
		||||
				FA322CE20CEF74B1001761B3 /* conn-func.h */,
 | 
			
		||||
				FA322CE30CEF74B1001761B3 /* conn-zip.c */,
 | 
			
		||||
				FA322CE40CEF74B1001761B3 /* conn-zip.h */,
 | 
			
		||||
				FA322CE50CEF74B1001761B3 /* conn.c */,
 | 
			
		||||
				FA322CE60CEF74B1001761B3 /* conn.h */,
 | 
			
		||||
				FA6BBC5F1605F0AB0004247A /* conn-encoding.c */,
 | 
			
		||||
				FA6BBC601605F0AC0004247A /* conn-encoding.h */,
 | 
			
		||||
				FA322CE10CEF74B1001761B3 /* conn-func.c */,
 | 
			
		||||
				FA322CE20CEF74B1001761B3 /* conn-func.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 */,
 | 
			
		||||
				FA322CEA0CEF74B1001761B3 /* io.c */,
 | 
			
		||||
				FA322CEB0CEF74B1001761B3 /* io.h */,
 | 
			
		||||
				FA322CFC0CEF74B1001761B3 /* irc.c */,
 | 
			
		||||
				FA322CFD0CEF74B1001761B3 /* irc.h */,
 | 
			
		||||
				FAD5853315271AB800328741 /* irc-cap.c */,
 | 
			
		||||
				FAD5853415271AB800328741 /* irc-cap.h */,
 | 
			
		||||
				FA322CEC0CEF74B1001761B3 /* irc-channel.c */,
 | 
			
		||||
				FA322CED0CEF74B1001761B3 /* irc-channel.h */,
 | 
			
		||||
				FA6BBC611605F0AC0004247A /* irc-encoding.c */,
 | 
			
		||||
				FA6BBC621605F0AC0004247A /* irc-encoding.h */,
 | 
			
		||||
				FA322CEE0CEF74B1001761B3 /* irc-info.c */,
 | 
			
		||||
				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 */,
 | 
			
		||||
				FA322CF30CEF74B1001761B3 /* irc-mode.h */,
 | 
			
		||||
				FA322CF40CEF74B1001761B3 /* irc-op.c */,
 | 
			
		||||
@@ -338,13 +388,12 @@
 | 
			
		||||
				FA322CF90CEF74B1001761B3 /* irc-server.h */,
 | 
			
		||||
				FA322CFA0CEF74B1001761B3 /* irc-write.c */,
 | 
			
		||||
				FA322CFB0CEF74B1001761B3 /* irc-write.h */,
 | 
			
		||||
				FA322CFC0CEF74B1001761B3 /* irc.c */,
 | 
			
		||||
				FA322CFD0CEF74B1001761B3 /* irc.h */,
 | 
			
		||||
				FA322CFE0CEF74B1001761B3 /* lists.c */,
 | 
			
		||||
				FA322CFF0CEF74B1001761B3 /* lists.h */,
 | 
			
		||||
				FA322D000CEF74B1001761B3 /* log.c */,
 | 
			
		||||
				FA322D010CEF74B1001761B3 /* log.h */,
 | 
			
		||||
				FA322D020CEF74B1001761B3 /* Makefile.am */,
 | 
			
		||||
				FAD5853615272C2500328741 /* login.c */,
 | 
			
		||||
				FAD5853715272C2500328741 /* login.h */,
 | 
			
		||||
				FA322D030CEF74B1001761B3 /* match.c */,
 | 
			
		||||
				FA322D040CEF74B1001761B3 /* match.h */,
 | 
			
		||||
				FA322D050CEF74B1001761B3 /* messages.h */,
 | 
			
		||||
@@ -371,19 +420,19 @@
 | 
			
		||||
		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>";
 | 
			
		||||
@@ -391,32 +440,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>";
 | 
			
		||||
@@ -424,9 +474,7 @@
 | 
			
		||||
		FA322D2E0CEF74B1001761B3 /* tool */ = {
 | 
			
		||||
			isa = PBXGroup;
 | 
			
		||||
			children = (
 | 
			
		||||
				FA322D300CEF74B1001761B3 /* ansi2knr.1 */,
 | 
			
		||||
				FA322D310CEF74B1001761B3 /* ansi2knr.c */,
 | 
			
		||||
				FA322D320CEF74B1001761B3 /* Makefile.am */,
 | 
			
		||||
				FA18A64F16CEE27700132F66 /* Makefile.ng */,
 | 
			
		||||
				FA322D330CEF74B1001761B3 /* tool.c */,
 | 
			
		||||
				FA322D340CEF74B1001761B3 /* tool.h */,
 | 
			
		||||
			);
 | 
			
		||||
@@ -436,16 +484,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;
 | 
			
		||||
@@ -455,13 +505,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 */,
 | 
			
		||||
			);
 | 
			
		||||
@@ -471,88 +522,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 = (
 | 
			
		||||
@@ -563,18 +543,26 @@
 | 
			
		||||
		FA322D970CEF752C001761B3 /* doc */ = {
 | 
			
		||||
			isa = PBXGroup;
 | 
			
		||||
			children = (
 | 
			
		||||
				FAA3D2800F139D1500B2447E /* Services.txt */,
 | 
			
		||||
				FA407F380DB15AC700271AF1 /* GIT.txt */,
 | 
			
		||||
				FA322D9A0CEF752C001761B3 /* FAQ.txt */,
 | 
			
		||||
				FA322D9B0CEF752C001761B3 /* Makefile.am */,
 | 
			
		||||
				FA322DA20CEF752C001761B3 /* src */,
 | 
			
		||||
				FAE22BD215270EA300F1A5AB /* Bopm.txt */,
 | 
			
		||||
				FAD5852F15271A7800328741 /* Capabilities.txt */,
 | 
			
		||||
				FA18A64416CEDFCE00132F66 /* Commands.txt */,
 | 
			
		||||
				FAE22BD415270EA300F1A5AB /* Contributing.txt */,
 | 
			
		||||
				FA322D9A0CEF752C001761B3 /* FAQ.txt */,
 | 
			
		||||
				FA407F380DB15AC700271AF1 /* GIT.txt */,
 | 
			
		||||
				FAE22BD515270EB500F1A5AB /* HowToRelease.txt */,
 | 
			
		||||
				FAE22BD615270EB500F1A5AB /* Modes.txt */,
 | 
			
		||||
				FAE22BD715270EB500F1A5AB /* PAM.txt */,
 | 
			
		||||
				FA322D9C0CEF752C001761B3 /* Platforms.txt */,
 | 
			
		||||
				FA322D9D0CEF752C001761B3 /* Protocol.txt */,
 | 
			
		||||
				FA322D9E0CEF752C001761B3 /* README-AUX.txt */,
 | 
			
		||||
				FA322D9F0CEF752C001761B3 /* README-BeOS.txt */,
 | 
			
		||||
				FAE22BD815270EC400F1A5AB /* README-Interix.txt */,
 | 
			
		||||
				FA322DA00CEF752C001761B3 /* RFC.txt */,
 | 
			
		||||
				FA77849A133FB9FF00740057 /* sample-ngircd.conf.tmpl */,
 | 
			
		||||
				FA322DA20CEF752C001761B3 /* src */,
 | 
			
		||||
				FAA3D2800F139D1500B2447E /* Services.txt */,
 | 
			
		||||
				FA322DA90CEF752C001761B3 /* SSL.txt */,
 | 
			
		||||
				FA77849A133FB9FF00740057 /* sample-ngircd.conf.tmpl */,
 | 
			
		||||
			);
 | 
			
		||||
			name = doc;
 | 
			
		||||
			path = ../../doc;
 | 
			
		||||
@@ -583,11 +571,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>";
 | 
			
		||||
@@ -606,7 +592,7 @@
 | 
			
		||||
		FA407F270DB1598D00271AF1 /* ipaddr */ = {
 | 
			
		||||
			isa = PBXGroup;
 | 
			
		||||
			children = (
 | 
			
		||||
				FA407F2B0DB159F400271AF1 /* Makefile.am */,
 | 
			
		||||
				FA18A64516CEE0C700132F66 /* Makefile.ng */,
 | 
			
		||||
				FA407F2C0DB159F400271AF1 /* ng_ipaddr.c */,
 | 
			
		||||
				FA407F2D0DB159F400271AF1 /* ng_ipaddr.h */,
 | 
			
		||||
			);
 | 
			
		||||
@@ -616,12 +602,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>";
 | 
			
		||||
@@ -653,7 +639,7 @@
 | 
			
		||||
		08FB7793FE84155DC02AAC07 /* Project object */ = {
 | 
			
		||||
			isa = PBXProject;
 | 
			
		||||
			attributes = {
 | 
			
		||||
				LastUpgradeCheck = 0420;
 | 
			
		||||
				LastUpgradeCheck = 0430;
 | 
			
		||||
			};
 | 
			
		||||
			buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "ngIRCd" */;
 | 
			
		||||
			compatibilityVersion = "Xcode 3.2";
 | 
			
		||||
@@ -718,6 +704,12 @@
 | 
			
		||||
				FA2D564A11EA158B00D37A35 /* pam.c in Sources */,
 | 
			
		||||
				FAA97C57124A271400D5BBA9 /* sighandlers.c in Sources */,
 | 
			
		||||
				FAACD5F514A6099C006ED74F /* class.c in Sources */,
 | 
			
		||||
				FAD5853215271AAB00328741 /* client-cap.c in Sources */,
 | 
			
		||||
				FAD5853515271AB800328741 /* irc-cap.c in Sources */,
 | 
			
		||||
				FAD5853815272C2600328741 /* login.c in Sources */,
 | 
			
		||||
				FA6BBC631605F0AC0004247A /* conn-encoding.c in Sources */,
 | 
			
		||||
				FA6BBC641605F0AC0004247A /* irc-encoding.c in Sources */,
 | 
			
		||||
				FA4F165A164836B100DBD011 /* irc-metadata.c in Sources */,
 | 
			
		||||
			);
 | 
			
		||||
			runOnlyForDeploymentPostprocessing = 0;
 | 
			
		||||
		};
 | 
			
		||||
@@ -747,7 +739,7 @@
 | 
			
		||||
				GCC_WARN_UNUSED_PARAMETER = YES;
 | 
			
		||||
				GCC_WARN_UNUSED_VALUE = YES;
 | 
			
		||||
				INSTALL_PATH = /usr/local/bin;
 | 
			
		||||
				PRODUCT_NAME = ngIRCd;
 | 
			
		||||
				PRODUCT_NAME = ngircd;
 | 
			
		||||
			};
 | 
			
		||||
			name = Default;
 | 
			
		||||
		};
 | 
			
		||||
@@ -755,10 +747,12 @@
 | 
			
		||||
			isa = XCBuildConfiguration;
 | 
			
		||||
			buildSettings = {
 | 
			
		||||
				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
 | 
			
		||||
				GCC_VERSION = 4.2;
 | 
			
		||||
				CODE_SIGN_IDENTITY = "";
 | 
			
		||||
				GCC_VERSION = "";
 | 
			
		||||
				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 | 
			
		||||
				GCC_WARN_UNUSED_VARIABLE = YES;
 | 
			
		||||
				SDKROOT = macosx10.6;
 | 
			
		||||
				MACOSX_DEPLOYMENT_TARGET = 10.6;
 | 
			
		||||
				SDKROOT = "";
 | 
			
		||||
			};
 | 
			
		||||
			name = Default;
 | 
			
		||||
		};
 | 
			
		||||
@@ -768,11 +762,12 @@
 | 
			
		||||
				ARCHS = "$(NATIVE_ARCH_ACTUAL)";
 | 
			
		||||
				GCC_DEBUGGING_SYMBOLS = full;
 | 
			
		||||
				GCC_OPTIMIZATION_LEVEL = 0;
 | 
			
		||||
				GCC_VERSION = 4.2;
 | 
			
		||||
				GCC_VERSION = "";
 | 
			
		||||
				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 | 
			
		||||
				GCC_WARN_UNUSED_VARIABLE = YES;
 | 
			
		||||
				MACOSX_DEPLOYMENT_TARGET = 10.6;
 | 
			
		||||
				ONLY_ACTIVE_ARCH = YES;
 | 
			
		||||
				SDKROOT = macosx;
 | 
			
		||||
				SDKROOT = "";
 | 
			
		||||
			};
 | 
			
		||||
			name = Debug;
 | 
			
		||||
		};
 | 
			
		||||
@@ -799,7 +794,7 @@
 | 
			
		||||
				GCC_WARN_UNUSED_PARAMETER = YES;
 | 
			
		||||
				GCC_WARN_UNUSED_VALUE = YES;
 | 
			
		||||
				INSTALL_PATH = /usr/local/bin;
 | 
			
		||||
				PRODUCT_NAME = ngIRCd;
 | 
			
		||||
				PRODUCT_NAME = ngircd;
 | 
			
		||||
			};
 | 
			
		||||
			name = Debug;
 | 
			
		||||
		};
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
#
 | 
			
		||||
# ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
# Copyright (c)2001-2011 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
 | 
			
		||||
@@ -9,10 +9,18 @@
 | 
			
		||||
# Please read the file COPYING, README and AUTHORS for more information.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
SUBDIRS = Anope Debian MacOSX
 | 
			
		||||
SUBDIRS = Debian MacOSX
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = README ngircd.spec systrace.policy ngindent ngircd-bsd.sh \
 | 
			
		||||
	ngIRCd-Logo.gif ngircd-redhat.init platformtest.sh
 | 
			
		||||
EXTRA_DIST = README \
 | 
			
		||||
	ngindent \
 | 
			
		||||
	ngircd-bsd.sh \
 | 
			
		||||
	ngIRCd-Logo.gif \
 | 
			
		||||
	ngircd-redhat.init \
 | 
			
		||||
	ngircd.service \
 | 
			
		||||
	ngircd.socket \
 | 
			
		||||
	ngircd.spec \
 | 
			
		||||
	platformtest.sh \
 | 
			
		||||
	systrace.policy
 | 
			
		||||
 | 
			
		||||
maintainer-clean-local:
 | 
			
		||||
	rm -f Makefile Makefile.in
 | 
			
		||||
 
 | 
			
		||||
@@ -2,21 +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 --
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Anope/
 | 
			
		||||
 - A preliminary patch that adds a ngIRCd protocol module to Anope 1.9.
 | 
			
		||||
 | 
			
		||||
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 configuraton.
 | 
			
		||||
 | 
			
		||||
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".
 | 
			
		||||
@@ -27,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.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								contrib/ngircd.service
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								contrib/ngircd.service
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=Next Generation IRC Daemon
 | 
			
		||||
After=network.target
 | 
			
		||||
 | 
			
		||||
[Service]
 | 
			
		||||
Type=forking
 | 
			
		||||
ExecStart=/usr/sbin/ngircd
 | 
			
		||||
ExecReload=/bin/kill -HUP $MAINPID
 | 
			
		||||
 | 
			
		||||
[Install]
 | 
			
		||||
WantedBy=multi-user.target
 | 
			
		||||
							
								
								
									
										11
									
								
								contrib/ngircd.socket
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								contrib/ngircd.socket
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=Next Generation IRC Daemon (Socket)
 | 
			
		||||
 | 
			
		||||
[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 19~rc1
 | 
			
		||||
%define version 21~rc2
 | 
			
		||||
%define release 1
 | 
			
		||||
%define prefix  %{_prefix}
 | 
			
		||||
 | 
			
		||||
@@ -15,11 +15,11 @@ BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 | 
			
		||||
BuildRequires:  zlib-devel, openssl-devel
 | 
			
		||||
 | 
			
		||||
%description
 | 
			
		||||
This package provides ngIRCd, a lightweight Internet Relay Chat
 | 
			
		||||
server for small or private networks. It is simple to configure, can
 | 
			
		||||
cope with dynamic IP addresses, and supports IPv6 as well as SSL. It
 | 
			
		||||
is written from scratch, not based on the original IRCd and quite
 | 
			
		||||
portable.
 | 
			
		||||
This package provides ngIRCd, a portable and lightweight Internet Relay
 | 
			
		||||
Chat server for small or private networks, developed under the GNU
 | 
			
		||||
General Public License (GPL). It is simple to configure, can cope with
 | 
			
		||||
dynamic IP addresses, and supports IPv6 as well as SSL. It is written
 | 
			
		||||
from scratch and not based on the original IRCd.
 | 
			
		||||
 | 
			
		||||
Advantages:
 | 
			
		||||
 - well arranged (lean) configuration file
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
#
 | 
			
		||||
# ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
# Copyright (c)2001-2010 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
 | 
			
		||||
@@ -21,13 +21,16 @@ PLATFORM=
 | 
			
		||||
COMPILER="unknown"
 | 
			
		||||
VERSION="unknown"
 | 
			
		||||
DATE=`date "+%y-%m-%d"`
 | 
			
		||||
 | 
			
		||||
CONFIGURE=
 | 
			
		||||
MAKE=
 | 
			
		||||
CHECK=
 | 
			
		||||
RUN=
 | 
			
		||||
COMMENT=
 | 
			
		||||
 | 
			
		||||
R_CONFIGURE=
 | 
			
		||||
R_MAKE=
 | 
			
		||||
R_CHECK=
 | 
			
		||||
R_RUN=
 | 
			
		||||
 | 
			
		||||
[ -n "$MAKE" ] || MAKE="make"
 | 
			
		||||
export MAKE CC
 | 
			
		||||
 | 
			
		||||
while [ $# -gt 0 ]; do
 | 
			
		||||
	case "$1" in
 | 
			
		||||
		"-v")
 | 
			
		||||
@@ -51,8 +54,18 @@ if [ $? -ne 0 ]; then
 | 
			
		||||
	cd ..
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
echo "$NAME: Checking for \"./autogen.sh\" script ..."
 | 
			
		||||
if [ -r ./autogen.sh ]; then
 | 
			
		||||
echo "$NAME: Checking for GIT tree ..."
 | 
			
		||||
if [ -d .git ]; then
 | 
			
		||||
	echo "$NAME: Checking for \"git\" command ..."
 | 
			
		||||
	git version >/dev/null 2>&1
 | 
			
		||||
	if [ $? -eq 0 ]; then
 | 
			
		||||
		echo "$NAME: Running \"git clean\" ..."
 | 
			
		||||
		[ -n "$VERBOSE" ] && git clean -dxf || git clean -dxf >/dev/null
 | 
			
		||||
	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
 | 
			
		||||
fi
 | 
			
		||||
@@ -61,20 +74,20 @@ if [ -r ./configure ]; then
 | 
			
		||||
	echo "$NAME: Running \"./configure\" script ..."
 | 
			
		||||
	[ -n "$VERBOSE" ] && ./configure || ./configure >/dev/null
 | 
			
		||||
	if [ $? -eq 0 -a -r ./Makefile ]; then
 | 
			
		||||
		CONFIGURE=1
 | 
			
		||||
		echo "$NAME: Running \"make\" ..."
 | 
			
		||||
		[ -n "$VERBOSE" ] && make || make >/dev/null
 | 
			
		||||
		R_CONFIGURE=1
 | 
			
		||||
		echo "$NAME: Running \"$MAKE\" ..."
 | 
			
		||||
		[ -n "$VERBOSE" ] && "$MAKE" || "$MAKE" >/dev/null
 | 
			
		||||
		if [ $? -eq 0 -a -x src/ngircd/ngircd ]; then
 | 
			
		||||
			MAKE=1
 | 
			
		||||
			echo "$NAME: Running \"make check\" ..."
 | 
			
		||||
			[ -n "$VERBOSE" ] && make check || make check >/dev/null
 | 
			
		||||
			R_MAKE=1
 | 
			
		||||
			echo "$NAME: Running \"$MAKE check\" ..."
 | 
			
		||||
			[ -n "$VERBOSE" ] && "$MAKE" check || "$MAKE" check >/dev/null
 | 
			
		||||
			if [ $? -eq 0 ]; then
 | 
			
		||||
				CHECK=1
 | 
			
		||||
				RUN=$CHECK
 | 
			
		||||
				R_CHECK=1
 | 
			
		||||
				R_RUN=$R_CHECK
 | 
			
		||||
			else
 | 
			
		||||
				./src/ngircd/ngircd --help 2>/dev/null \
 | 
			
		||||
				 | grep "^ngircd" >/dev/null
 | 
			
		||||
				[ $? -eq 0 ] && RUN=1
 | 
			
		||||
				 | grep "^ngIRCd" >/dev/null
 | 
			
		||||
				[ $? -eq 0 ] && R_RUN=1
 | 
			
		||||
			fi
 | 
			
		||||
		fi
 | 
			
		||||
	fi
 | 
			
		||||
@@ -82,9 +95,9 @@ fi
 | 
			
		||||
 | 
			
		||||
# Get target platform information
 | 
			
		||||
if [ -r "src/config.h" ]; then
 | 
			
		||||
	CPU=`grep "TARGET_CPU" "src/config.h" | cut -d'"' -f2`
 | 
			
		||||
	OS=`grep "TARGET_OS" "src/config.h" | cut -d'"' -f2`
 | 
			
		||||
	VENDOR=`grep "TARGET_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
 | 
			
		||||
@@ -96,16 +109,34 @@ if [ -r "Makefile" ]; then
 | 
			
		||||
	CC=$(grep "^CC = " Makefile | cut -d' ' -f3)
 | 
			
		||||
	$CC --version 2>&1 | grep -i "GCC" >/dev/null
 | 
			
		||||
	if [ $? -eq 0 ]; then
 | 
			
		||||
		COMPILER=$($CC --version | head -1 \
 | 
			
		||||
		  | cut -d')' -f2 | cut -d' ' -f2)
 | 
			
		||||
		COMPILER="gcc $COMPILER"
 | 
			
		||||
		# GCC, or compiler that mimics GCC
 | 
			
		||||
		$CC --version 2>&1 | grep -i "Open64" >/dev/null
 | 
			
		||||
		if [ $? -eq 0 ]; then
 | 
			
		||||
			COMPILER="Open64"
 | 
			
		||||
		else
 | 
			
		||||
			COMPILER=$($CC --version | head -1 \
 | 
			
		||||
			  | cut -d')' -f2 | cut -d' ' -f2)
 | 
			
		||||
			COMPILER="gcc $COMPILER"
 | 
			
		||||
		fi
 | 
			
		||||
	else
 | 
			
		||||
		case "$CC" in
 | 
			
		||||
		  gcc*)
 | 
			
		||||
		# 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`"
 | 
			
		||||
			[ -n "$v" ] && COMPILER="gcc $v"
 | 
			
		||||
			;;
 | 
			
		||||
		esac
 | 
			
		||||
			[ -z "$v" ] && v="`$CC -version 2>/dev/null | head -1`"
 | 
			
		||||
			[ -n "$v" ] && COMPILER="$v"
 | 
			
		||||
		fi
 | 
			
		||||
	fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
@@ -130,10 +161,10 @@ else
 | 
			
		||||
	[ $? -eq 0 ] && COMMENT="(3)"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
[ -n "$CONFIGURE" ] && C="Y" || C="N"
 | 
			
		||||
[ -n "$MAKE" ] && M="Y" || M="N"
 | 
			
		||||
[ -n "$CHECK" ] && T="Y" || T="N"
 | 
			
		||||
[ -n "$RUN" ] && R="Y" || R="N"
 | 
			
		||||
[ -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 "$COMMENT" ] && COMMENT=" $COMMENT"
 | 
			
		||||
 | 
			
		||||
echo
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										28
									
								
								doc/Capabilities.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								doc/Capabilities.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
                           http://ngircd.barton.de/
 | 
			
		||||
 | 
			
		||||
               (c)2001-2012 Alexander Barton and Contributors.
 | 
			
		||||
               ngIRCd is free software and published under the
 | 
			
		||||
                   terms of the GNU General Public License.
 | 
			
		||||
 | 
			
		||||
                            -- Capabilities.txt --
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
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>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
I. Supported Capabilities
 | 
			
		||||
~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
			
		||||
 | 
			
		||||
* "multi-prefix"
 | 
			
		||||
 | 
			
		||||
   When requested, the multi-prefix client capability will cause the IRC
 | 
			
		||||
   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>.
 | 
			
		||||
							
								
								
									
										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.atheme.org/specification/capability-negotiation-3.1>
 | 
			
		||||
	 - <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 behaviour, 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
 | 
			
		||||
							
								
								
									
										14
									
								
								doc/FAQ.txt
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								doc/FAQ.txt
									
									
									
									
									
								
							@@ -64,11 +64,19 @@ A: ngIRCd does not write its own log file. Instead, ngIRCd uses syslog(3).
 | 
			
		||||
 | 
			
		||||
Q: I cannot connect to remote peers when I use the chroot option, the
 | 
			
		||||
   following is logged: "Can't resolve example.com: unknown error!".
 | 
			
		||||
A: see next question blow ...
 | 
			
		||||
 | 
			
		||||
Q: When running ngIRCd inside a chroot, no IP addresses can be translated
 | 
			
		||||
   in DNS names, errors like "Name or service not known" are logged.
 | 
			
		||||
A: On Linux/glibc with chroot enabled you need to put some libraries inside
 | 
			
		||||
   the chroot as well, notably libnss_dns; maybe others. Unfortunately, even
 | 
			
		||||
   linking ngIRCd statically does not help this. The only known workaround
 | 
			
		||||
   is to either disable chroot support or to link against dietlibc instead
 | 
			
		||||
   of glibc. (tnx to Sebastian Siewior)
 | 
			
		||||
   linking ngIRCd statically does not help this. So you can either copy
 | 
			
		||||
   all the required files into the chroot directory:
 | 
			
		||||
     $ mkdir -p ./chroot/etc ./chroot/lib
 | 
			
		||||
     $ cp -a /etc/hosts /etc/resolv.conf /etc/nsswitch.conf ./chroot/etc/
 | 
			
		||||
     $ cp -a /lib/libresolv* /lib/libnss_* ./chroot/lib/
 | 
			
		||||
   Or you can try to link ngIRCd against an other C library (like dietlibc)
 | 
			
		||||
   that doesn't depend on NSS modules and/or these files.
 | 
			
		||||
 | 
			
		||||
Q: I have added an [Oper] section, how do i log on as IRC operator?
 | 
			
		||||
A: You can use the /OPER command in your IRC client to become an IRC operator.
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ a) Make sure the source tree is in a releasable state ;-)
 | 
			
		||||
 | 
			
		||||
b) Make sure you have working versions of GNU autoconf and GNU automake
 | 
			
		||||
   installed on the system you use for generating the release:
 | 
			
		||||
   as of October 2010 we are using GNU autoconf 2.61 and GNU automake 1.10.1
 | 
			
		||||
   as of October 2010 we are using GNU autoconf 2.67 and GNU automake 1.11.1
 | 
			
		||||
   which seem to work just fine.
 | 
			
		||||
 | 
			
		||||
c) Update the files describing the new release:
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
#
 | 
			
		||||
# ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
# Copyright (c)2001-2011 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
 | 
			
		||||
@@ -10,15 +10,31 @@
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
.tmpl:
 | 
			
		||||
	sed \
 | 
			
		||||
	    -e s@:ETCDIR:@${sysconfdir}@ \
 | 
			
		||||
	$(AM_V_GEN)sed \
 | 
			
		||||
	    -e "s@:ETCDIR:@${sysconfdir}@" \
 | 
			
		||||
	    -e "s@:DOCDIR:@${docdir}@" \
 | 
			
		||||
	    <$< >$@
 | 
			
		||||
 | 
			
		||||
SUFFIXES = .tmpl
 | 
			
		||||
 | 
			
		||||
static_docs = Bopm.txt FAQ.txt GIT.txt HowToRelease.txt Modes.txt PAM.txt \
 | 
			
		||||
	Platforms.txt Protocol.txt README-AUX.txt README-BeOS.txt \
 | 
			
		||||
	README-Interix.txt RFC.txt SSL.txt Services.txt
 | 
			
		||||
static_docs = \
 | 
			
		||||
	Bopm.txt \
 | 
			
		||||
	Capabilities.txt \
 | 
			
		||||
	Commands.txt \
 | 
			
		||||
	Contributing.txt \
 | 
			
		||||
	FAQ.txt \
 | 
			
		||||
	GIT.txt \
 | 
			
		||||
	HowToRelease.txt \
 | 
			
		||||
	Modes.txt \
 | 
			
		||||
	PAM.txt \
 | 
			
		||||
	Platforms.txt \
 | 
			
		||||
	Protocol.txt \
 | 
			
		||||
	README-AUX.txt \
 | 
			
		||||
	README-BeOS.txt \
 | 
			
		||||
	README-Interix.txt \
 | 
			
		||||
	RFC.txt \
 | 
			
		||||
	Services.txt \
 | 
			
		||||
	SSL.txt
 | 
			
		||||
 | 
			
		||||
doc_templates = sample-ngircd.conf.tmpl
 | 
			
		||||
 | 
			
		||||
@@ -39,8 +55,8 @@ all: $(generated_docs)
 | 
			
		||||
 | 
			
		||||
install-data-hook: $(static_docs) $(toplevel_docs) $(generated_docs)
 | 
			
		||||
	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
 | 
			
		||||
	if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then \
 | 
			
		||||
	  $(INSTALL) -m 600 -c sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; \
 | 
			
		||||
	@if [ ! -f $(DESTDIR)$(sysconfdir)/ngircd.conf ]; then \
 | 
			
		||||
	  make install-config; \
 | 
			
		||||
	 fi
 | 
			
		||||
	$(mkinstalldirs) $(DESTDIR)$(docdir)
 | 
			
		||||
	for f in $(static_docs) $(toplevel_docs); do \
 | 
			
		||||
@@ -50,10 +66,30 @@ install-data-hook: $(static_docs) $(toplevel_docs) $(generated_docs)
 | 
			
		||||
	  $(INSTALL) -m 644 -c $$f $(DESTDIR)$(docdir)/; \
 | 
			
		||||
	 done
 | 
			
		||||
 | 
			
		||||
install-config:
 | 
			
		||||
	$(INSTALL) -m 600 -c sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf
 | 
			
		||||
	@echo; \
 | 
			
		||||
	 echo " ** NOTE: Installed sample configuration file:"; \
 | 
			
		||||
	 echo " ** \"$(DESTDIR)$(sysconfdir)/ngircd.conf\""; \
 | 
			
		||||
	 echo
 | 
			
		||||
 | 
			
		||||
uninstall-hook:
 | 
			
		||||
	rm -rf $(DESTDIR)$(docdir)
 | 
			
		||||
	@if cmp --silent sample-ngircd.conf $(DESTDIR)$(sysconfdir)/ngircd.conf; then \
 | 
			
		||||
	  make uninstall-config; \
 | 
			
		||||
	 else \
 | 
			
		||||
	  echo; \
 | 
			
		||||
	  echo " ** NOTE: Not uninstalling changed configuration file:"; \
 | 
			
		||||
	  echo " ** \"$(DESTDIR)$(sysconfdir)/ngircd.conf\""; \
 | 
			
		||||
	  echo; \
 | 
			
		||||
	 fi
 | 
			
		||||
 | 
			
		||||
uninstall-config:
 | 
			
		||||
	rm -f $(DESTDIR)$(sysconfdir)/ngircd.conf
 | 
			
		||||
 | 
			
		||||
srcdoc:
 | 
			
		||||
	make -C src srcdoc
 | 
			
		||||
 | 
			
		||||
.PHONY: install-config uninstall-config srcdoc
 | 
			
		||||
 | 
			
		||||
# -eof-
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
                           http://ngircd.barton.de/
 | 
			
		||||
 | 
			
		||||
               (c)2001-2011 Alexander Barton and Contributors.
 | 
			
		||||
               (c)2001-2012 Alexander Barton and Contributors.
 | 
			
		||||
               ngIRCd is free software and published under the
 | 
			
		||||
                   terms of the GNU General Public License.
 | 
			
		||||
 | 
			
		||||
@@ -22,10 +22,13 @@ channels he is using at the moment.
 | 
			
		||||
  mode	since	description
 | 
			
		||||
 | 
			
		||||
  a	0.3.0	User is away.
 | 
			
		||||
  b	20	User blocks private messages and notices.
 | 
			
		||||
  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.
 | 
			
		||||
  i	0.0.1	User is "invisible".
 | 
			
		||||
  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.
 | 
			
		||||
  R (1)	19	User is registered (e.g. by NickServ).
 | 
			
		||||
  s	0.4.0	User wants to receive server notices.
 | 
			
		||||
@@ -43,18 +46,22 @@ users to lists (e.g. "invite list", "ban list"), others have parameters
 | 
			
		||||
  mode	since	description
 | 
			
		||||
 | 
			
		||||
  b	0.5.0	Add/remove a host mask to the ban list.
 | 
			
		||||
  e	19	Add/remove a host mask to the exception list.
 | 
			
		||||
  i	0.5.0	Channel is "invite only".
 | 
			
		||||
  I	0.5.0	Add/remove a host mask to the invite list.
 | 
			
		||||
  k	0.6.0	Channel has a "key" (a password).
 | 
			
		||||
  l	0.6.0	Channel has a user limit.
 | 
			
		||||
  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.
 | 
			
		||||
  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.
 | 
			
		||||
  r (1)	19	Channel is "registered" (e.g. by ChanServ).
 | 
			
		||||
  R	19	Only registered users are allowed to join this channel.
 | 
			
		||||
  s	0.9.0	Channel is "secret".
 | 
			
		||||
  t	0.3.0	Only ChanOps are allowed to modify the channel topic.
 | 
			
		||||
  V	20	Channel doesn't allow invites.
 | 
			
		||||
  z	16	Only users connected via SSL are allowed to join the channel.
 | 
			
		||||
 | 
			
		||||
III. Channel User Modes
 | 
			
		||||
@@ -65,7 +72,12 @@ 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
 | 
			
		||||
  o	0.2.0	User is channel operator and can op/kick/... other members.
 | 
			
		||||
  h	20	User is half op and can set channel modes imntvIbek and kick
 | 
			
		||||
		voiced and normal users.
 | 
			
		||||
  v	0.2.0	User is "voiced" and can speak even if channel is moderated.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								doc/PAM.txt
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								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.
 | 
			
		||||
 | 
			
		||||
@@ -34,3 +33,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,7 +2,7 @@
 | 
			
		||||
                     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.
 | 
			
		||||
 | 
			
		||||
@@ -26,52 +26,63 @@ list can be updated. Thanks for your help!
 | 
			
		||||
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.7.2    20.2       13-03-08 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.7.0     gcc 4.2.1    18         11-07-05 alex   Y Y Y Y (3)
 | 
			
		||||
i386/apple/darwin11.0.0     gcc 4.2.1    18         11-07-02 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    18         11-07-10 alex   Y Y N Y (4)
 | 
			
		||||
i386/pc/solaris2.11         gcc 4.2.3    18         11-08-17 goetz  Y Y Y Y (4)
 | 
			
		||||
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    18         11-07-10 alex   Y Y Y Y (3)
 | 
			
		||||
i386/unknown/freebsd7.3     gcc 4.2.1    18         11-07-10 alex   Y Y Y Y (3)
 | 
			
		||||
i686/unknown/gnu0.3         gcc 4.4.5    18         11-07-10 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    18         11-07-10 alex   Y Y Y Y (3)
 | 
			
		||||
i386/unknown/netbsdelf5.0.2 gcc 4.1.3    18         11-07-10 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/interix3.5          gcc 3.3      18         11-07-10 alex   Y Y N Y
 | 
			
		||||
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    18         11-07-02 alex   Y Y N Y
 | 
			
		||||
m68k/apple/aux3.1.1         Orig. A/UX   18         11-07-02 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      CVSHEAD    06-05-07 fw     Y Y Y Y (3)
 | 
			
		||||
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/unknown/freebsd8.1   gcc 4.2.1    18         11-07-10 alex   Y Y Y Y (3)
 | 
			
		||||
x86_64/unknown/linux-gnu    gcc 4.4.5    18         11-07-02 alex   Y Y Y Y (1)
 | 
			
		||||
x86_64/unknown/openbsd4.7   gcc 3.3.5    18         11-07-10 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~rc1     13-10-16 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    clang 3.2    21~rc1     13-10-16 alex   Y Y Y Y (1)
 | 
			
		||||
x86_64/unknown/linux-gnu    gcc 4.4.5    20.2       13-04-01 alex   Y Y Y Y (1)
 | 
			
		||||
x86_64/unknown/linux-gnu    Open64       20.3       13-10-16 goetz  Y Y Y Y (1)
 | 
			
		||||
x86_64/unknown/linux-gnu    tcc 0.9.25   20.3       13-10-16 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    20~rc1     12-11-13 alex   Y Y Y Y (3)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Notes
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,8 @@
 | 
			
		||||
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
                           http://ngircd.barton.de/
 | 
			
		||||
 | 
			
		||||
                        (c)2001-2008 Alexander Barton,
 | 
			
		||||
                    alex@barton.de, http://www.barton.de/
 | 
			
		||||
 | 
			
		||||
               (c)2001-2012 Alexander Barton and Contributors.
 | 
			
		||||
               ngIRCd is free software and published under the
 | 
			
		||||
                   terms of the GNU General Public License.
 | 
			
		||||
 | 
			
		||||
@@ -82,11 +81,17 @@ The following <serverflags> are defined at the moment:
 | 
			
		||||
- H: The server supports the "enhanced server handshake", see section II.2
 | 
			
		||||
     for a detailed description.
 | 
			
		||||
 | 
			
		||||
- M: Changing client "metadata" (hostname, real name, ...) using the
 | 
			
		||||
     METADATA command is supported.
 | 
			
		||||
 | 
			
		||||
- o: IRC operators are allowed to change channel- and channel-user-modes
 | 
			
		||||
     even if they aren't channel-operator of the affected channel.
 | 
			
		||||
 | 
			
		||||
- S: The server supports the SERVICE command (on this link).
 | 
			
		||||
 | 
			
		||||
- X: Server supports XOP channel modes (owner, admin, halfop) and supports
 | 
			
		||||
     these user prefixes in CHANINFO commands, for example.
 | 
			
		||||
 | 
			
		||||
- Z: Compressed server links are supported by the server.
 | 
			
		||||
 | 
			
		||||
Example for a complete <flags> string: "ngircd|0.7.5:CZ".
 | 
			
		||||
@@ -134,7 +139,7 @@ protocol which allows at max 15 arguments per command).
 | 
			
		||||
Please see <http://www.irc.org/tech_docs/005.html> for details.
 | 
			
		||||
 | 
			
		||||
The information exchanged using ISUPPORT can be used to detect configuration
 | 
			
		||||
incompatibilities (different maximum nick name length, for example) and
 | 
			
		||||
incompatibilities (different maximum nickname length, for example) and
 | 
			
		||||
therefore to disconnect the peer prior to registering it in the network.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -181,3 +186,71 @@ 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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
II.5 Client character encoding conversion
 | 
			
		||||
 | 
			
		||||
     Command: CHARCONV
 | 
			
		||||
  Parameters: <client-charset>
 | 
			
		||||
     Used by: registered clients
 | 
			
		||||
     Replies: RPL_IP_CHARCONV, ERR_IP_CHARCONV
 | 
			
		||||
 | 
			
		||||
A client can set its character set encoding using the CHARCONV command:
 | 
			
		||||
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>.
 | 
			
		||||
 | 
			
		||||
The list of supported client character sets is implementation dependent.
 | 
			
		||||
 | 
			
		||||
If a client sets its <client-charset> to the server encoding (UTF-8),
 | 
			
		||||
it disables all conversions; the connection behaves as if no CHARCONV
 | 
			
		||||
command has been sent at all in this session.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
II.6 Update client "metadata"
 | 
			
		||||
 | 
			
		||||
     Command: METADATA
 | 
			
		||||
  Parameters: <target> <key> <value>
 | 
			
		||||
     Used by: servers only
 | 
			
		||||
 | 
			
		||||
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 server updates its client database according to the received <key> and
 | 
			
		||||
<value> parameters, and passes the METADATA command on to all the other
 | 
			
		||||
servers in the network that support this command (see section II.1 "Register
 | 
			
		||||
new server link", <serverflag> "M"), even if it doesn't support the given
 | 
			
		||||
<key> itself: unknown <key> names are ignored silently!
 | 
			
		||||
 | 
			
		||||
The following <key> names are defined:
 | 
			
		||||
 | 
			
		||||
 - "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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
III. Numerics used by IRC+ Protocol
 | 
			
		||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
			
		||||
 | 
			
		||||
The IRC+ protocol uses numerics in the range 800-899 which aren't used by
 | 
			
		||||
RFC 2812 and hopefully don't clash with other implementations ...
 | 
			
		||||
 | 
			
		||||
Numerics 800-849 are used for status and success messages, and numerics
 | 
			
		||||
850-899 are failure and error messages.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
III.1 IRC+ status and success numerics
 | 
			
		||||
 | 
			
		||||
801 - RPL_IP_CHARCONV
 | 
			
		||||
	%1 :Client encoding set"
 | 
			
		||||
 | 
			
		||||
		%1	client character set
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
III.2 IRC+ failure and error numerics
 | 
			
		||||
 | 
			
		||||
851 - ERR_IP_CHARCONV
 | 
			
		||||
	:Can't initialize client encoding
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,10 @@
 | 
			
		||||
 | 
			
		||||
                    ngIRCd - Next Generation IRC Server
 | 
			
		||||
 | 
			
		||||
                      (c)2001-2010 Alexander Barton,
 | 
			
		||||
                   alex@barton.de, http://www.barton.de/
 | 
			
		||||
                     ngIRCd - Next Generation IRC Server
 | 
			
		||||
                           http://ngircd.barton.de/
 | 
			
		||||
 | 
			
		||||
               (c)2001-2012 Alexander Barton and Contributors.
 | 
			
		||||
               ngIRCd is free software and published under the
 | 
			
		||||
                  terms of the GNU General Public License.
 | 
			
		||||
 | 
			
		||||
                   terms of the GNU General Public License.
 | 
			
		||||
 | 
			
		||||
                         -- README-Interix.txt --
 | 
			
		||||
 | 
			
		||||
@@ -20,10 +18,13 @@ Windows Server 2003. SUA is supported on Windows Server 2003 R2, Windows
 | 
			
		||||
Server 2008 & 2008 R2, Windows Vista, and Windows 7 -- so ngIRCd should be
 | 
			
		||||
able to run on all of these platforms.
 | 
			
		||||
 | 
			
		||||
But please note that the poll() API function is not fully implemented by
 | 
			
		||||
SFU/SUA and therefore can't be used by ngIRCd -- which normally would be
 | 
			
		||||
the default. Please see <http://www.suacommunity.com/faqs.aspx> section
 | 
			
		||||
4.25 for details:
 | 
			
		||||
But please note that two things:
 | 
			
		||||
 | 
			
		||||
1. Don't use the poll() IO API
 | 
			
		||||
 | 
			
		||||
The poll() API function is not fully implemented by SFU/SUA and therefore
 | 
			
		||||
can't be used by ngIRCd -- which normally would be the default. Please see
 | 
			
		||||
<http://www.suacommunity.com/faqs.aspx> section 4.25 for details:
 | 
			
		||||
 | 
			
		||||
  "If you do try to use the poll() API your program will block on the
 | 
			
		||||
  API call forever. You must direct your program to build using the
 | 
			
		||||
@@ -35,3 +36,9 @@ So when running the ./configure script, you HAVE TO DISABLE poll() support:
 | 
			
		||||
 | 
			
		||||
ngIRCd then defaults to using the select() API function which works fine.
 | 
			
		||||
 | 
			
		||||
2. Use GNU make(1)
 | 
			
		||||
 | 
			
		||||
Starting with ngIRCd 18, our build system doesn't work with the default
 | 
			
		||||
make(1) binary of Interix, you should use GNU make instead (tested with
 | 
			
		||||
version 3.82 built from source).
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,16 +9,20 @@
 | 
			
		||||
                              -- Services.txt --
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
At the moment, ngIRCd doesn't implement a "special IRC services interface".
 | 
			
		||||
But services acting as a "regular server" are supported, either using the IRC
 | 
			
		||||
protocol defined in RFC 1459 or RFC 2812.
 | 
			
		||||
ngIRCd doesn't implement a "special IRC services interface", but services
 | 
			
		||||
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 "IRC Services" version 5.x by
 | 
			
		||||
Andrew Church (<http://achurch.org/services/>), and a Anope 1.9 using a
 | 
			
		||||
preliminary protocol module for ngIRCd (<http://www.anope.org/>).
 | 
			
		||||
Support for Services has been tested using
 | 
			
		||||
 - 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/>)
 | 
			
		||||
 | 
			
		||||
This document describes setting up ngIRCd and these services.
 | 
			
		||||
 | 
			
		||||
Please let us know if you are successfully using other IRC service packages or
 | 
			
		||||
which problems you encounter -- thanks!
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Setting up ngIRCd
 | 
			
		||||
~~~~~~~~~~~~~~~~~
 | 
			
		||||
@@ -40,13 +44,19 @@ Example:
 | 
			
		||||
Setting up Anope 1.9.x
 | 
			
		||||
~~~~~~~~~~~~~~~~~~~~~~
 | 
			
		||||
 | 
			
		||||
Anope 1.9.4 (and above) can be used with ngIRCd using a preliminary "ngircd"
 | 
			
		||||
protocol module contained in our contrib/Anope/ directory. Please see the
 | 
			
		||||
file contrib/Anope/README for installation instructions!
 | 
			
		||||
Anope 1.9.8 or later (<http://www.anope.org/>) can be used with ngIRCd using
 | 
			
		||||
the "ngircd" protocol module.
 | 
			
		||||
 | 
			
		||||
After patching and installing Anope, at least the following configuration
 | 
			
		||||
variables have to be adjusted in data/services.conf, in addition to all the
 | 
			
		||||
settings marked as required:
 | 
			
		||||
At least the following settings have to be tweaked, in addition to all the
 | 
			
		||||
settings marked as required by Anope:
 | 
			
		||||
 | 
			
		||||
In conf/services.conf:
 | 
			
		||||
 | 
			
		||||
  define
 | 
			
		||||
  {
 | 
			
		||||
	name = "services.host"
 | 
			
		||||
	value = "services.irc.net"
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  uplink
 | 
			
		||||
  {
 | 
			
		||||
@@ -55,12 +65,45 @@ settings marked as required:
 | 
			
		||||
	password = "123abc"
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  serverinfo
 | 
			
		||||
  # Load ngIRCd protocol module
 | 
			
		||||
  module { name = "ngircd" }
 | 
			
		||||
 | 
			
		||||
  networkinfo
 | 
			
		||||
  {
 | 
			
		||||
	name = "services.irc.net"
 | 
			
		||||
	type = "ngircd"
 | 
			
		||||
	# Must be set to the "MaxNickLength" setting of ngIRCd!
 | 
			
		||||
	nicklen = 9
 | 
			
		||||
 | 
			
		||||
	chanlen = 50
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
In conf/nickserv.conf:
 | 
			
		||||
 | 
			
		||||
  nickserv
 | 
			
		||||
  {
 | 
			
		||||
	# not required if you are running ngIRCd with a higher nickname limit
 | 
			
		||||
	# ("MaxNickLength") than 11 characters, but REQUIRED by default!
 | 
			
		||||
	guestnickprefix = "G-"
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Setting up Atheme 7.0.2 or later
 | 
			
		||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
			
		||||
 | 
			
		||||
Atheme 7.0.2 or later (<http://www.atheme.net>) may be used with ngIRCd using
 | 
			
		||||
the "ngircd" protocol module.
 | 
			
		||||
 | 
			
		||||
The following settings need to be in atheme.conf:
 | 
			
		||||
 | 
			
		||||
  loadmodule "modules/protocol/ngircd";
 | 
			
		||||
 | 
			
		||||
  uplink "server.irc.net" {
 | 
			
		||||
	password = "123abc";
 | 
			
		||||
	port = 6667;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
The documentation of Atheme can be found in the doc/ directory of the
 | 
			
		||||
Atheme source distribution.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Setting up IRC Services 5.1.x
 | 
			
		||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
			
		||||
@@ -91,7 +134,3 @@ In modules.conf:
 | 
			
		||||
 | 
			
		||||
The documentation of IRC Services can be found here:
 | 
			
		||||
<http://www.ircservices.za.net/docs/>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Please let us know if you are successfully using other IRC service packages or
 | 
			
		||||
which problems you encounter, thanks!
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -84,6 +88,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
 | 
			
		||||
@@ -95,11 +106,15 @@
 | 
			
		||||
	# Maximum number of channels a user can be member of (0: no limit):
 | 
			
		||||
	;MaxJoins = 10
 | 
			
		||||
 | 
			
		||||
	# Maximum length of an user nick name (Default: 9, as in RFC 2812).
 | 
			
		||||
	# Maximum length of an user nickname (Default: 9, as in RFC 2812).
 | 
			
		||||
	# Please note that all servers in an IRC network MUST use the same
 | 
			
		||||
	# maximum nick name length!
 | 
			
		||||
	# maximum nickname length!
 | 
			
		||||
	;MaxNickLength = 9
 | 
			
		||||
 | 
			
		||||
	# Maximum number of channels returned in response to a /list
 | 
			
		||||
	# command (0: unlimited):
 | 
			
		||||
	;MaxListSize = 100
 | 
			
		||||
 | 
			
		||||
	# After <PingTimeout> seconds of inactivity the server will send a
 | 
			
		||||
	# PING to the peer to test whether it is alive or not.
 | 
			
		||||
	;PingTimeout = 120
 | 
			
		||||
@@ -113,6 +128,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
 | 
			
		||||
@@ -125,18 +146,31 @@
 | 
			
		||||
	;ChrootDir = /var/empty
 | 
			
		||||
 | 
			
		||||
	# Set this hostname for every client instead of the real one.
 | 
			
		||||
	# Please note: don't use the percentage sign ("%"), it is reserved for
 | 
			
		||||
	# future extensions!
 | 
			
		||||
	;CloakHost = irc.example.net
 | 
			
		||||
	# Use %x to add the hashed value of the original hostname.
 | 
			
		||||
	;CloakHost = cloaked.host
 | 
			
		||||
 | 
			
		||||
	# Set every clients' user name to their nick name
 | 
			
		||||
	# Use this hostname for hostname cloaking on clients that have the
 | 
			
		||||
	# user mode "+x" set, instead of the name of the server.
 | 
			
		||||
	# Use %x to add the hashed value of the original hostname.
 | 
			
		||||
	;CloakHostModeX = cloaked.user
 | 
			
		||||
 | 
			
		||||
	# The Salt for cloaked hostname hashing. When undefined a random
 | 
			
		||||
	# hash is generated after each server start.
 | 
			
		||||
	;CloakHostSalt = abcdefghijklmnopqrstuvwxyz
 | 
			
		||||
 | 
			
		||||
	# Set every clients' user name to their nickname
 | 
			
		||||
	;CloakUserToNick = yes
 | 
			
		||||
 | 
			
		||||
	# Try to connect to other IRC servers using IPv4 and IPv6, if possible.
 | 
			
		||||
	;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 on itself, you can't
 | 
			
		||||
	# set "a" (away) or "o" (IRC Op), 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.
 | 
			
		||||
@@ -144,6 +178,10 @@
 | 
			
		||||
	# 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
 | 
			
		||||
@@ -157,6 +195,9 @@
 | 
			
		||||
	# they are not(!) channel-operators?
 | 
			
		||||
	;OperCanUseMode = no
 | 
			
		||||
 | 
			
		||||
	# Should IRC Operators get AutoOp (+o) in persistent (+P) channels?
 | 
			
		||||
	;OperChanPAutoOp = yes
 | 
			
		||||
 | 
			
		||||
	# Mask IRC Operator mode requests as if they were coming from the
 | 
			
		||||
	# server? (This is a compatibility hack for ircd-irc2 servers)
 | 
			
		||||
	;OperServerMode = no
 | 
			
		||||
@@ -179,9 +220,6 @@
 | 
			
		||||
	# character prepended to their respective user names!
 | 
			
		||||
	;PAMIsOptional = no
 | 
			
		||||
 | 
			
		||||
	# Allow Pre-Defined Channels only (see Section [Channels])
 | 
			
		||||
	;PredefChannelsOnly = no
 | 
			
		||||
 | 
			
		||||
	# Let ngIRCd send an "authentication PING" when a new client connects,
 | 
			
		||||
	# and register this client only after receiving the corresponding
 | 
			
		||||
	# "PONG" reply.
 | 
			
		||||
@@ -210,6 +248,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
 | 
			
		||||
	# For GnuTLS:
 | 
			
		||||
	;CipherList = SECURE128
 | 
			
		||||
 | 
			
		||||
	# Diffie-Hellman parameters
 | 
			
		||||
	;DHFile = :ETCDIR:/ssl/dhparams.pem
 | 
			
		||||
 | 
			
		||||
@@ -226,7 +273,7 @@
 | 
			
		||||
	# [Operator] sections are used to define IRC Operators. There may be
 | 
			
		||||
	# more than one [Operator] block, one for each local operator.
 | 
			
		||||
 | 
			
		||||
	# ID of the operator (may be different of the nick name)
 | 
			
		||||
	# ID of the operator (may be different of the nickname)
 | 
			
		||||
	;Name = TheOper
 | 
			
		||||
 | 
			
		||||
	# Password of the IRC operator
 | 
			
		||||
@@ -289,15 +336,16 @@
 | 
			
		||||
	# Connect to the remote server using TLS/SSL (Default: false)
 | 
			
		||||
	;SSLConnect = yes
 | 
			
		||||
 | 
			
		||||
	# Define a (case insensitive) mask matching nick names that should be
 | 
			
		||||
	# treated as IRC services when introduced via this remote server.
 | 
			
		||||
	# Define a (case insensitive) list of masks matching nicknames that
 | 
			
		||||
	# should be treated as IRC services when introduced via this remote
 | 
			
		||||
	# server, separated by commas (",").
 | 
			
		||||
	# REGULAR SERVERS DON'T NEED this parameter, so leave it empty
 | 
			
		||||
	# (which is the default).
 | 
			
		||||
	# When you are connecting IRC services which mask as a IRC server
 | 
			
		||||
	# and which use "virtual users" to communicate with, for example
 | 
			
		||||
	# "NickServ" and "ChanServ", you should set this parameter to
 | 
			
		||||
	# something like "*Serv".
 | 
			
		||||
	;ServiceMask = *Serv
 | 
			
		||||
	# something like "*Serv" or "NickServ,ChanServ,XyzServ".
 | 
			
		||||
	;ServiceMask = *Serv,Global
 | 
			
		||||
 | 
			
		||||
[Server]
 | 
			
		||||
	# More [Server] sections, if you like ...
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										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>,
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -17,10 +14,10 @@ TEMPLATE_MANS = ngircd.conf.5.tmpl ngircd.8.tmpl
 | 
			
		||||
SUFFIXES = .tmpl .
 | 
			
		||||
 | 
			
		||||
.tmpl:
 | 
			
		||||
	sed \
 | 
			
		||||
	    -e s@:SBINDIR:@${sbindir}@ \
 | 
			
		||||
	    -e s@:BINDIR:@${bindir}@ \
 | 
			
		||||
	    -e s@:ETCDIR:@${sysconfdir}@ \
 | 
			
		||||
	$(AM_V_GEN)sed \
 | 
			
		||||
	    -e "s@:SBINDIR:@${sbindir}@" \
 | 
			
		||||
	    -e "s@:BINDIR:@${bindir}@" \
 | 
			
		||||
	    -e "s@:ETCDIR:@${sysconfdir}@" \
 | 
			
		||||
	    <$< >$@
 | 
			
		||||
 | 
			
		||||
man_MANS = ngircd.conf.5 ngircd.8
 | 
			
		||||
 
 | 
			
		||||
@@ -1,30 +1,37 @@
 | 
			
		||||
.\"
 | 
			
		||||
.\" ngircd(8) manual page template
 | 
			
		||||
.\"
 | 
			
		||||
.TH ngircd 8 "Jul 2011" ngircd "ngIRCd Manual"
 | 
			
		||||
.TH ngircd 8 "Oct 2013" ngIRCd "ngIRCd Manual"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ngIRCd \- the next generation IRC daemon
 | 
			
		||||
ngIRCd \- the "next generation" IRC daemon
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.B ngircd [
 | 
			
		||||
.B ngircd
 | 
			
		||||
[
 | 
			
		||||
.I Options
 | 
			
		||||
.B ]
 | 
			
		||||
]
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
.BR ngIRCd
 | 
			
		||||
is a free open source daemon for the Internet Relay Chat (IRC),
 | 
			
		||||
developed under the GNU General Public License (GPL).
 | 
			
		||||
is a free, portable and lightweight Internet Relay Chat server for small
 | 
			
		||||
or private networks, developed under the GNU General Public License (GPL).
 | 
			
		||||
It is easy to configure, can cope with dynamic IP addresses, and supports
 | 
			
		||||
IPv6, SSL-protected connections as well as PAM for authentication.
 | 
			
		||||
It is written from scratch and not based on the original IRCd.
 | 
			
		||||
.PP
 | 
			
		||||
It's written from scratch and is not based upon the original IRCd like
 | 
			
		||||
many others. It is easy to configure, supports server links (even with
 | 
			
		||||
original ircd's) and runs on hosts with changing IP addresses (such as
 | 
			
		||||
dial-in networks).
 | 
			
		||||
.PP
 | 
			
		||||
Currently supported platforms include AIX, A/UX, FreeBSD, HP-UX, IRIX,
 | 
			
		||||
Linux, Mac OS X, NetBSD, OpenBSD, Solaris, and Windows with Cygwin.
 | 
			
		||||
The name ngIRCd means
 | 
			
		||||
.IR "next generation IRC daemon",
 | 
			
		||||
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, 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
 | 
			
		||||
@@ -78,7 +85,7 @@ It's wise to use "ngircd \-\-configtest" to validate the configuration file
 | 
			
		||||
after changing it.
 | 
			
		||||
.SH DEBUGGING
 | 
			
		||||
When ngIRCd is compiled with debug code, that is, its source code has
 | 
			
		||||
been ./configure'd with "--enable-debug" and/or "--enable-sniffer" (witch
 | 
			
		||||
been ./configure'd with "\-\-enable\-debug" and/or "\-\-enable\-sniffer" (witch
 | 
			
		||||
enables debug mode automatically as well), you can use two more command
 | 
			
		||||
line options and two more signals to debug problems with the daemon itself
 | 
			
		||||
or IRC clients:
 | 
			
		||||
@@ -91,7 +98,7 @@ Enable debug mode and log extra messages.
 | 
			
		||||
\fB\-s\fR, \fB\-\-sniffer\fR
 | 
			
		||||
Enable IRC protocol sniffer, which logs all sent and received IRC commands to
 | 
			
		||||
the console/syslog. This option requires that ngIRCd has been ./configure'd
 | 
			
		||||
with "--enable-sniffer" and enables debug mode automatically, too.
 | 
			
		||||
with "\-\-enable\-sniffer" and enables debug mode automatically, too.
 | 
			
		||||
.PP
 | 
			
		||||
\fBSignals:\fR
 | 
			
		||||
.TP
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
.\"
 | 
			
		||||
.\" ngircd.conf(5) manual page template
 | 
			
		||||
.\"
 | 
			
		||||
.TH ngircd.conf 5 "Jun 2011" ngircd "ngIRCd Manual"
 | 
			
		||||
.TH ngircd.conf 5 "Oct 2013" ngIRCd "ngIRCd Manual"
 | 
			
		||||
.SH NAME
 | 
			
		||||
ngircd.conf \- configuration file of ngIRCd
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
@@ -101,6 +101,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.
 | 
			
		||||
@@ -127,8 +133,8 @@ 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
 | 
			
		||||
"PID file" is written AFTER chroot and switching the user ID, e.g. 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)
 | 
			
		||||
@@ -164,6 +170,12 @@ should be safe, but it is wise to double-check :-)
 | 
			
		||||
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.
 | 
			
		||||
@@ -178,10 +190,13 @@ Maximum number of channels a user can be member of (0: no limit).
 | 
			
		||||
Default: 10.
 | 
			
		||||
.TP
 | 
			
		||||
\fBMaxNickLength\fR (number)
 | 
			
		||||
Maximum length of an user nick name (Default: 9, as in RFC 2812). Please
 | 
			
		||||
note that all servers in an IRC network MUST use the same maximum nick name
 | 
			
		||||
Maximum length of an user nickname (Default: 9, as in RFC 2812). Please
 | 
			
		||||
note that all servers in an IRC network MUST use the same maximum nickname
 | 
			
		||||
length!
 | 
			
		||||
.TP
 | 
			
		||||
\fBMaxListSize\fR (number)
 | 
			
		||||
Maximum number of channels returned in response to a LIST command. Default: 100.
 | 
			
		||||
.TP
 | 
			
		||||
\fBPingTimeout\fR (number)
 | 
			
		||||
After <PingTimeout> seconds of inactivity the server will send a PING to
 | 
			
		||||
the peer to test whether it is alive or not. Default: 120.
 | 
			
		||||
@@ -194,6 +209,12 @@ 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.
 | 
			
		||||
.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,
 | 
			
		||||
@@ -212,16 +233,19 @@ For this to work the server must have been started with root privileges!
 | 
			
		||||
.TP
 | 
			
		||||
\fBCloakHost\fR (string)
 | 
			
		||||
Set this hostname for every client instead of the real one. Default: empty,
 | 
			
		||||
don't change.
 | 
			
		||||
.PP
 | 
			
		||||
.RS
 | 
			
		||||
.B Please note:
 | 
			
		||||
.br
 | 
			
		||||
Don't use the percentage sign ("%"), it is reserved for future extensions!
 | 
			
		||||
.RE
 | 
			
		||||
don't change. Use %x to add the hashed value of the original hostname.
 | 
			
		||||
.TP
 | 
			
		||||
\fBCloakHostModeX\fR (string)
 | 
			
		||||
Use this hostname for hostname cloaking on clients that have the user mode
 | 
			
		||||
"+x" set, instead of the name of the server. Default: empty, use the name
 | 
			
		||||
of the server. Use %x to add the hashed value of the original hostname
 | 
			
		||||
.TP
 | 
			
		||||
\fBCloakHostSalt\fR (string)
 | 
			
		||||
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 nick name and hide the one supplied
 | 
			
		||||
Set every clients' user name to their nickname and hide the one supplied
 | 
			
		||||
by the IRC client. Default: no.
 | 
			
		||||
.TP
 | 
			
		||||
\fBConnectIPv4\fR (boolean)
 | 
			
		||||
@@ -234,6 +258,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 on itself, you can't set "a" (away) or
 | 
			
		||||
"o" (IRC Op), 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
 | 
			
		||||
@@ -247,6 +277,11 @@ Users identified using IDENT are registered without the "~" character
 | 
			
		||||
prepended to their user name.
 | 
			
		||||
Default: yes.
 | 
			
		||||
.TP
 | 
			
		||||
.TP
 | 
			
		||||
\fBIncludeDir\fR (string)
 | 
			
		||||
Directory containing configuration snippets (*.conf), that should be read in
 | 
			
		||||
after parsing the current configuration file.
 | 
			
		||||
Default: none.
 | 
			
		||||
\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
 | 
			
		||||
@@ -265,6 +300,10 @@ while connecting. Default: no.
 | 
			
		||||
Should IRC Operators be allowed to use the MODE command even if they are
 | 
			
		||||
not(!) channel-operators? Default: no.
 | 
			
		||||
.TP
 | 
			
		||||
\fBOperChanPAutoOp\fR (boolean)
 | 
			
		||||
Should IRC Operators get AutoOp (+o) in persistent (+P) channels?
 | 
			
		||||
Default: yes.
 | 
			
		||||
.TP
 | 
			
		||||
\fBOperServerMode\fR (boolean)
 | 
			
		||||
If \fBOperCanUseMode\fR is enabled, this may lead the compatibility problems
 | 
			
		||||
with Servers that run the ircd-irc2 Software. This Option "masks" mode
 | 
			
		||||
@@ -292,12 +331,6 @@ 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.
 | 
			
		||||
.TP
 | 
			
		||||
\fBRequireAuthPing\fR (boolean)
 | 
			
		||||
Let ngIRCd send an "authentication PING" when a new client connects, and
 | 
			
		||||
register this client only after receiving the corresponding "PONG" reply.
 | 
			
		||||
@@ -333,6 +366,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" (OpenSSL) or "SECURE128" (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
 | 
			
		||||
@@ -359,7 +398,7 @@ sections are used to define IRC Operators. There may be more than one
 | 
			
		||||
block, one for each local operator.
 | 
			
		||||
.TP
 | 
			
		||||
\fBName\fR (string)
 | 
			
		||||
ID of the operator (may be different of the nick name).
 | 
			
		||||
ID of the operator (may be different of the nickname).
 | 
			
		||||
.TP
 | 
			
		||||
\fBPassword\fR (string)
 | 
			
		||||
Password of the IRC operator.
 | 
			
		||||
@@ -419,14 +458,16 @@ You can use the IRC Operator command CONNECT later on to create the link.
 | 
			
		||||
Connect to the remote server using TLS/SSL. Default: false.
 | 
			
		||||
.TP
 | 
			
		||||
\fBServiceMask\fR (string)
 | 
			
		||||
Define a (case insensitive) mask matching nick names that should be treated as
 | 
			
		||||
IRC services when introduced via this remote server. REGULAR SERVERS DON'T NEED
 | 
			
		||||
this parameter, so leave it empty (which is the default).
 | 
			
		||||
Define a (case insensitive) list of masks matching nicknames that should be
 | 
			
		||||
treated as IRC services when introduced via this remote server, separated
 | 
			
		||||
by commas (","). REGULAR SERVERS DON'T NEED this parameter, so leave it empty
 | 
			
		||||
(which is the default).
 | 
			
		||||
.PP
 | 
			
		||||
.RS
 | 
			
		||||
When you are connecting IRC services which mask as a IRC server and which use
 | 
			
		||||
"virtual users" to communicate with, for example "NickServ" and "ChanServ",
 | 
			
		||||
you should set this parameter to something like "*Serv".
 | 
			
		||||
you should set this parameter to something like "*Serv", "*Serv,OtherNick",
 | 
			
		||||
or "NickServ,ChanServ,XyzServ".
 | 
			
		||||
.SH [CHANNEL]
 | 
			
		||||
Pre-defined channels can be configured in
 | 
			
		||||
.I [Channel]
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								src/ipaddr/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								src/ipaddr/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
Makefile.am
 | 
			
		||||
@@ -1,14 +0,0 @@
 | 
			
		||||
AUTOMAKE_OPTIONS = ansi2knr
 | 
			
		||||
 | 
			
		||||
INCLUDES = -I$(srcdir)/../portab
 | 
			
		||||
 | 
			
		||||
noinst_LIBRARIES = libngipaddr.a
 | 
			
		||||
 | 
			
		||||
libngipaddr_a_SOURCES = ng_ipaddr.c
 | 
			
		||||
 | 
			
		||||
noinst_HEADERS = ng_ipaddr.h
 | 
			
		||||
 | 
			
		||||
maintainer-clean-local:
 | 
			
		||||
	rm -f Makefile Makefile.in
 | 
			
		||||
 | 
			
		||||
# -eof-
 | 
			
		||||
							
								
								
									
										21
									
								
								src/ipaddr/Makefile.ng
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								src/ipaddr/Makefile.ng
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
#
 | 
			
		||||
# ipaddr/Makefile.am
 | 
			
		||||
# (c) 2008 Florian Westphal <fw@strlen.de>, public domain.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
__ng_Makefile_am_template__
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = Makefile.ng
 | 
			
		||||
 | 
			
		||||
AM_CPPFLAGS = -I$(srcdir)/../portab
 | 
			
		||||
 | 
			
		||||
noinst_LIBRARIES = libngipaddr.a
 | 
			
		||||
 | 
			
		||||
libngipaddr_a_SOURCES = ng_ipaddr.c
 | 
			
		||||
 | 
			
		||||
noinst_HEADERS = ng_ipaddr.h
 | 
			
		||||
 | 
			
		||||
maintainer-clean-local:
 | 
			
		||||
	rm -f Makefile Makefile.in Makefile.am
 | 
			
		||||
 | 
			
		||||
# -eof-
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -47,6 +47,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 +60,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 +77,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 +114,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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								src/ngircd/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/ngircd/.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,3 +1,5 @@
 | 
			
		||||
Makefile.am
 | 
			
		||||
check-help
 | 
			
		||||
check-version
 | 
			
		||||
ngircd
 | 
			
		||||
ngircd.exe
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
#
 | 
			
		||||
# ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
# Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
 | 
			
		||||
# Copyright (c)2001-2012 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,36 +9,108 @@
 | 
			
		||||
# Please read the file COPYING, README and AUTHORS for more information.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
AUTOMAKE_OPTIONS = ../portab/ansi2knr
 | 
			
		||||
__ng_Makefile_am_template__
 | 
			
		||||
 | 
			
		||||
INCLUDES = -I$(srcdir)/../portab -I$(srcdir)/../tool -I$(srcdir)/../ipaddr
 | 
			
		||||
EXTRA_DIST = Makefile.ng
 | 
			
		||||
 | 
			
		||||
AM_CPPFLAGS = -I$(srcdir)/../portab -I$(srcdir)/../tool -I$(srcdir)/../ipaddr
 | 
			
		||||
 | 
			
		||||
LINTARGS = -weak -warnunixlib +unixlib -booltype BOOLEAN \
 | 
			
		||||
 -varuse -retvalother -emptyret -unrecog
 | 
			
		||||
 | 
			
		||||
sbin_PROGRAMS = ngircd
 | 
			
		||||
 | 
			
		||||
ngircd_SOURCES = ngircd.c array.c channel.c class.c client.c conf.c conn.c \
 | 
			
		||||
	conn-func.c conn-ssl.c conn-zip.c hash.c io.c irc.c irc-channel.c \
 | 
			
		||||
	irc-info.c irc-login.c irc-mode.c irc-op.c irc-oper.c irc-server.c \
 | 
			
		||||
	irc-write.c lists.c log.c match.c op.c numeric.c pam.c parse.c \
 | 
			
		||||
	proc.c resolve.c sighandlers.c
 | 
			
		||||
ngircd_SOURCES = \
 | 
			
		||||
	ngircd.c \
 | 
			
		||||
	array.c \
 | 
			
		||||
	channel.c \
 | 
			
		||||
	class.c \
 | 
			
		||||
	client.c \
 | 
			
		||||
	client-cap.c \
 | 
			
		||||
	conf.c \
 | 
			
		||||
	conn.c \
 | 
			
		||||
	conn-encoding.c \
 | 
			
		||||
	conn-func.c \
 | 
			
		||||
	conn-ssl.c \
 | 
			
		||||
	conn-zip.c \
 | 
			
		||||
	hash.c \
 | 
			
		||||
	io.c \
 | 
			
		||||
	irc.c \
 | 
			
		||||
	irc-cap.c \
 | 
			
		||||
	irc-channel.c \
 | 
			
		||||
	irc-encoding.c \
 | 
			
		||||
	irc-info.c \
 | 
			
		||||
	irc-login.c \
 | 
			
		||||
	irc-metadata.c \
 | 
			
		||||
	irc-mode.c \
 | 
			
		||||
	irc-op.c \
 | 
			
		||||
	irc-oper.c \
 | 
			
		||||
	irc-server.c \
 | 
			
		||||
	irc-write.c \
 | 
			
		||||
	lists.c \
 | 
			
		||||
	log.c \
 | 
			
		||||
	login.c \
 | 
			
		||||
	match.c \
 | 
			
		||||
	numeric.c \
 | 
			
		||||
	op.c \
 | 
			
		||||
	pam.c \
 | 
			
		||||
	parse.c \
 | 
			
		||||
	proc.c \
 | 
			
		||||
	resolve.c \
 | 
			
		||||
	sighandlers.c
 | 
			
		||||
 | 
			
		||||
ngircd_LDFLAGS = -L../portab -L../tool -L../ipaddr
 | 
			
		||||
 | 
			
		||||
ngircd_LDADD = -lngportab -lngtool -lngipaddr
 | 
			
		||||
 | 
			
		||||
noinst_HEADERS = ngircd.h array.h channel.h class.h client.h conf.h \
 | 
			
		||||
	conf-ssl.h conn.h conn-func.h conn-ssl.h conn-zip.h hash.h io.h \
 | 
			
		||||
	irc.h irc-channel.h irc-info.h irc-login.h irc-mode.h irc-op.h \
 | 
			
		||||
	irc-oper.h irc-server.h irc-write.h lists.h log.h match.h numeric.h \
 | 
			
		||||
	op.h pam.h parse.h proc.h resolve.h sighandlers.h defines.h messages.h
 | 
			
		||||
noinst_HEADERS = \
 | 
			
		||||
	ngircd.h \
 | 
			
		||||
	array.h \
 | 
			
		||||
	channel.h \
 | 
			
		||||
	class.h \
 | 
			
		||||
	client.h \
 | 
			
		||||
	client-cap.h \
 | 
			
		||||
	conf.h \
 | 
			
		||||
	conf-ssl.h \
 | 
			
		||||
	conn.h \
 | 
			
		||||
	conn-encoding.h \
 | 
			
		||||
	conn-func.h \
 | 
			
		||||
	conn-ssl.h \
 | 
			
		||||
	conn-zip.h \
 | 
			
		||||
	defines.h \
 | 
			
		||||
	hash.h \
 | 
			
		||||
	io.h \
 | 
			
		||||
	irc.h \
 | 
			
		||||
	irc-cap.h \
 | 
			
		||||
	irc-channel.h \
 | 
			
		||||
	irc-encoding.h \
 | 
			
		||||
	irc-info.h \
 | 
			
		||||
	irc-login.h \
 | 
			
		||||
	irc-macros.h \
 | 
			
		||||
	irc-metadata.h \
 | 
			
		||||
	irc-mode.h \
 | 
			
		||||
	irc-op.h \
 | 
			
		||||
	irc-oper.h \
 | 
			
		||||
	irc-server.h \
 | 
			
		||||
	irc-write.h \
 | 
			
		||||
	lists.h \
 | 
			
		||||
	log.h \
 | 
			
		||||
	login.h \
 | 
			
		||||
	match.h \
 | 
			
		||||
	messages.h \
 | 
			
		||||
	numeric.h \
 | 
			
		||||
	op.h \
 | 
			
		||||
	pam.h \
 | 
			
		||||
	parse.h \
 | 
			
		||||
	proc.h \
 | 
			
		||||
	resolve.h \
 | 
			
		||||
	sighandlers.h
 | 
			
		||||
 | 
			
		||||
clean-local:
 | 
			
		||||
	rm -f check-version check-help lint.out
 | 
			
		||||
 | 
			
		||||
maintainer-clean-local:
 | 
			
		||||
	rm -f Makefile Makefile.in
 | 
			
		||||
	rm -f Makefile Makefile.in Makefile.am
 | 
			
		||||
 | 
			
		||||
check-version: Makefile
 | 
			
		||||
	echo "#!/bin/sh" > check-version
 | 
			
		||||
@@ -57,7 +129,7 @@ lint:
 | 
			
		||||
	for f in *.c; do \
 | 
			
		||||
	 echo "checking $$f ..."; \
 | 
			
		||||
	 splint $$f $(LINTARGS) -I$(srcdir) -I$(srcdir)/.. \
 | 
			
		||||
	  $(INCLUDES) $(AM_CFLAGS) >lint.out 2>&1; \
 | 
			
		||||
	  $(AM_CPPFLAGS) $(AM_CFLAGS) >lint.out 2>&1; \
 | 
			
		||||
	 grep "no warnings" lint.out > /dev/null 2>&1; \
 | 
			
		||||
	 if [ $$? -ne 0 ]; then \
 | 
			
		||||
	  waswarning=1; \
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -66,16 +66,8 @@ static void Set_KeyFile PARAMS((CHANNEL *Chan, const char *KeyFile));
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Channel_Init( void )
 | 
			
		||||
{
 | 
			
		||||
	CHANNEL *sc;
 | 
			
		||||
 | 
			
		||||
	My_Channels = NULL;
 | 
			
		||||
	My_Cl2Chan = NULL;
 | 
			
		||||
 | 
			
		||||
	sc = Channel_Create("&SERVER");
 | 
			
		||||
	if (sc) {
 | 
			
		||||
		Channel_SetModes(sc, "mnPt");
 | 
			
		||||
		Channel_SetTopic(sc, Client_ThisServer(), "Server Messages");
 | 
			
		||||
	}
 | 
			
		||||
} /* Channel_Init */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -103,11 +95,12 @@ Channel_GetListInvites(CHANNEL *c)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Generate predefined persistent channels and &SERVER
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Channel_InitPredefined( void )
 | 
			
		||||
{
 | 
			
		||||
	/* Generate predefined persistent channels */
 | 
			
		||||
 | 
			
		||||
	CHANNEL *new_chan;
 | 
			
		||||
	const struct Conf_Channel *conf_chan;
 | 
			
		||||
	const char *c;
 | 
			
		||||
@@ -138,11 +131,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');
 | 
			
		||||
@@ -160,6 +153,18 @@ Channel_InitPredefined( void )
 | 
			
		||||
	}
 | 
			
		||||
	if (channel_count)
 | 
			
		||||
		array_free(&Conf_Channels);
 | 
			
		||||
 | 
			
		||||
	/* Make sure the local &SERVER channel exists */
 | 
			
		||||
	if (!Channel_Search("&SERVER")) {
 | 
			
		||||
		new_chan = Channel_Create("&SERVER");
 | 
			
		||||
		if (new_chan) {
 | 
			
		||||
			Channel_SetModes(new_chan, "mnPt");
 | 
			
		||||
			Channel_SetTopic(new_chan, Client_ThisServer(),
 | 
			
		||||
					 "Server Messages");
 | 
			
		||||
		} else
 | 
			
		||||
			Log(LOG_ERR, "Failed to create \"&SERVER\" channel!");
 | 
			
		||||
	} else
 | 
			
		||||
		LogDebug("Required channel \"&SERVER\" already exists, ok.");
 | 
			
		||||
} /* Channel_InitPredefined */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -218,7 +223,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;
 | 
			
		||||
	}
 | 
			
		||||
@@ -263,14 +268,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;
 | 
			
		||||
	}
 | 
			
		||||
@@ -294,6 +299,7 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name,
 | 
			
		||||
	     const char *Reason )
 | 
			
		||||
{
 | 
			
		||||
	CHANNEL *chan;
 | 
			
		||||
	bool can_kick = false;
 | 
			
		||||
 | 
			
		||||
	assert(Peer != NULL);
 | 
			
		||||
	assert(Target != NULL);
 | 
			
		||||
@@ -303,9 +309,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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -313,14 +319,7 @@ 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;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* Check if user has operator status */
 | 
			
		||||
		if (!strchr(Channel_UserModes(chan, Origin), 'o')) {
 | 
			
		||||
			IRC_WriteStrClient(Origin, ERR_CHANOPRIVSNEEDED_MSG,
 | 
			
		||||
			IRC_WriteErrClient(Origin, ERR_NOTONCHANNEL_MSG,
 | 
			
		||||
					   Client_ID(Origin), Name);
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
@@ -328,11 +327,55 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name,
 | 
			
		||||
 | 
			
		||||
	/* 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;
 | 
			
		||||
 | 
			
		||||
		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 */
 | 
			
		||||
@@ -377,7 +420,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
 | 
			
		||||
@@ -443,6 +486,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 )
 | 
			
		||||
{
 | 
			
		||||
@@ -580,7 +631,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 ));
 | 
			
		||||
@@ -689,6 +740,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 )
 | 
			
		||||
{
 | 
			
		||||
@@ -807,9 +865,9 @@ Channel_SetMaxUsers(CHANNEL *Chan, unsigned long Count)
 | 
			
		||||
static bool
 | 
			
		||||
Can_Send_To_Channel(CHANNEL *Chan, CLIENT *From)
 | 
			
		||||
{
 | 
			
		||||
	bool is_member, has_voice, is_op;
 | 
			
		||||
	bool is_member, has_voice, is_halfop, is_op, is_chanadmin, is_owner;
 | 
			
		||||
 | 
			
		||||
	is_member = has_voice = is_op = false;
 | 
			
		||||
	is_member = has_voice = is_halfop = is_op = is_chanadmin = is_owner = false;
 | 
			
		||||
 | 
			
		||||
	/* The server itself always can send messages :-) */
 | 
			
		||||
	if (Client_ThisServer() == From)
 | 
			
		||||
@@ -817,10 +875,16 @@ 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), 'o'))
 | 
			
		||||
		if (Channel_UserHasMode(Chan, From, 'h'))
 | 
			
		||||
			is_halfop = true;
 | 
			
		||||
		if (Channel_UserHasMode(Chan, From, 'o'))
 | 
			
		||||
			is_op = true;
 | 
			
		||||
		if (Channel_UserHasMode(Chan, From, 'a'))
 | 
			
		||||
			is_chanadmin = true;
 | 
			
		||||
		if (Channel_UserHasMode(Chan, From, 'q'))
 | 
			
		||||
			is_owner = true;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
@@ -829,13 +893,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 (is_op || has_voice)
 | 
			
		||||
	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))
 | 
			
		||||
@@ -852,15 +920,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 */
 | 
			
		||||
		return IRC_WriteStrClient(From, ERR_CANNOTSENDTOCHAN_MSG,
 | 
			
		||||
		if (Channel_HasMode(Chan, 'M'))
 | 
			
		||||
			return IRC_WriteErrClient(From, ERR_NEEDREGGEDNICK_MSG,
 | 
			
		||||
						  Client_ID(From), Channel_Name(Chan));
 | 
			
		||||
		else
 | 
			
		||||
			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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -1019,7 +1092,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 );
 | 
			
		||||
	}
 | 
			
		||||
@@ -1147,7 +1220,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;
 | 
			
		||||
@@ -1187,64 +1260,6 @@ Channel_CheckKey(CHANNEL *Chan, CLIENT *Client, const char *Key)
 | 
			
		||||
} /* Channel_CheckKey */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Check wether a client is allowed to administer a channel or not.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Chan		The channel to test.
 | 
			
		||||
 * @param Client	The client from which the command has been received.
 | 
			
		||||
 * @param Origin	The originator of the command (or NULL).
 | 
			
		||||
 * @param OnChannel	Set to true if the originator is member of the channel.
 | 
			
		||||
 * @param AdminOk	Set to true if the client is allowed to do
 | 
			
		||||
 *			administrative tasks on this channel.
 | 
			
		||||
 * @param UseServerMode	Set to true if ngIRCd should emulate "server mode",
 | 
			
		||||
 *			that is send commands as if originating from a server
 | 
			
		||||
 *			and not the originator of the command.
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Channel_CheckAdminRights(CHANNEL *Chan, CLIENT *Client, CLIENT *Origin,
 | 
			
		||||
			 bool *OnChannel, bool *AdminOk, bool *UseServerMode)
 | 
			
		||||
{
 | 
			
		||||
	assert (Chan != NULL);
 | 
			
		||||
	assert (Client != NULL);
 | 
			
		||||
	assert (OnChannel != NULL);
 | 
			
		||||
	assert (AdminOk != NULL);
 | 
			
		||||
	assert (UseServerMode != NULL);
 | 
			
		||||
 | 
			
		||||
	/* Use the client as origin, if no origin has been given (no prefix?) */
 | 
			
		||||
	if (!Origin)
 | 
			
		||||
		Origin = Client;
 | 
			
		||||
 | 
			
		||||
	*OnChannel = false;
 | 
			
		||||
	*AdminOk = false;
 | 
			
		||||
	*UseServerMode = false;
 | 
			
		||||
 | 
			
		||||
	if (Client_Type(Client) != CLIENT_USER
 | 
			
		||||
	    && Client_Type(Client) != CLIENT_SERVER
 | 
			
		||||
	    && Client_Type(Client) != CLIENT_SERVICE)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	/* Allow channel administration if the client is a server or service */
 | 
			
		||||
	if (Client_Type(Client) != CLIENT_USER) {
 | 
			
		||||
		*AdminOk = true;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	*OnChannel = Channel_IsMemberOf(Chan, Origin);
 | 
			
		||||
 | 
			
		||||
	if (*OnChannel && strchr(Channel_UserModes(Chan, Origin), 'o')) {
 | 
			
		||||
		/* User is a channel operator */
 | 
			
		||||
		*AdminOk = true;
 | 
			
		||||
	} else if (Conf_OperCanMode) {
 | 
			
		||||
		/* IRC operators are allowed to administer channels as well */
 | 
			
		||||
		if (Client_OperByMe(Origin)) {
 | 
			
		||||
			*AdminOk = true;
 | 
			
		||||
			if (Conf_OperServerMode)
 | 
			
		||||
				*UseServerMode = true;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
} /* Channel_CheckAdminRights */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static CL2CHAN *
 | 
			
		||||
Get_First_Cl2Chan( CLIENT *Client, CHANNEL *Chan )
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -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 ));
 | 
			
		||||
 
 | 
			
		||||
@@ -33,8 +33,6 @@
 | 
			
		||||
 | 
			
		||||
struct list_head My_Classes[CLASS_COUNT];
 | 
			
		||||
 | 
			
		||||
char Reject_Reason[COMMAND_LEN];
 | 
			
		||||
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Class_Init(void)
 | 
			
		||||
{
 | 
			
		||||
@@ -49,32 +47,29 @@ 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] = "listed";
 | 
			
		||||
 | 
			
		||||
	assert(Class < CLASS_COUNT);
 | 
			
		||||
	assert(Client != NULL);
 | 
			
		||||
 | 
			
		||||
	reason = Lists_CheckReason(&My_Classes[Class], Client);
 | 
			
		||||
	if (!reason)
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
	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 +83,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 +98,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),
 | 
			
		||||
	Lists_MakeMask(Pattern, mask, sizeof(mask));
 | 
			
		||||
	return Lists_Add(&My_Classes[Class], mask,
 | 
			
		||||
			 ValidUntil, Reason);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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));
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										73
									
								
								src/ngircd/client-cap.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								src/ngircd/client-cap.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,73 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2012 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.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define __client_cap_c__
 | 
			
		||||
 | 
			
		||||
#include "portab.h"
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * 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
 | 
			
		||||
Client_Cap(CLIENT *Client)
 | 
			
		||||
{
 | 
			
		||||
	assert (Client != NULL);
 | 
			
		||||
 | 
			
		||||
	return Client->capabilities;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Client_CapSet(CLIENT *Client, int Cap)
 | 
			
		||||
{
 | 
			
		||||
	assert(Client != NULL);
 | 
			
		||||
	assert(Cap >= 0);
 | 
			
		||||
 | 
			
		||||
	Client->capabilities = Cap;
 | 
			
		||||
	LogDebug("Set new capability of \"%s\" to %d.",
 | 
			
		||||
		 Client_ID(Client), Client->capabilities);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Client_CapAdd(CLIENT *Client, int Cap)
 | 
			
		||||
{
 | 
			
		||||
	assert(Client != NULL);
 | 
			
		||||
	assert(Cap > 0);
 | 
			
		||||
 | 
			
		||||
	Client->capabilities |= Cap;
 | 
			
		||||
	LogDebug("Add capability %d, new capability of \"%s\" is %d.",
 | 
			
		||||
		 Cap, Client_ID(Client), Client->capabilities);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Client_CapDel(CLIENT *Client, int Cap)
 | 
			
		||||
{
 | 
			
		||||
	assert(Client != NULL);
 | 
			
		||||
	assert(Cap > 0);
 | 
			
		||||
 | 
			
		||||
	Client->capabilities &= ~Cap;
 | 
			
		||||
	LogDebug("Delete capability %d, new capability of \"%s\" is %d.",
 | 
			
		||||
		 Cap, Client_ID(Client), Client->capabilities);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* -eof- */
 | 
			
		||||
							
								
								
									
										31
									
								
								src/ngircd/client-cap.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								src/ngircd/client-cap.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2012 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 __client_cap_h__
 | 
			
		||||
#define __client_cap_h__
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * Functions to deal with IRC Capabilities (header)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define CLIENT_CAP_PENDING 1		/* Capability negotiation pending */
 | 
			
		||||
#define CLIENT_CAP_SUPPORTED 2		/* Client supports IRC capabilities */
 | 
			
		||||
 | 
			
		||||
#define CLIENT_CAP_MULTI_PREFIX 4	/* multi-prefix */
 | 
			
		||||
 | 
			
		||||
GLOBAL int Client_Cap PARAMS((CLIENT *Client));
 | 
			
		||||
 | 
			
		||||
GLOBAL void Client_CapSet PARAMS((CLIENT *Client, int Cap));
 | 
			
		||||
GLOBAL void Client_CapAdd PARAMS((CLIENT *Client, int Cap));
 | 
			
		||||
GLOBAL void Client_CapDel PARAMS((CLIENT *Client, int Cap));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2010 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
 | 
			
		||||
@@ -37,9 +37,11 @@
 | 
			
		||||
#include "ngircd.h"
 | 
			
		||||
#include "channel.h"
 | 
			
		||||
#include "conf.h"
 | 
			
		||||
#include "conn-func.h"
 | 
			
		||||
#include "hash.h"
 | 
			
		||||
#include "irc-write.h"
 | 
			
		||||
#include "log.h"
 | 
			
		||||
#include "match.h"
 | 
			
		||||
#include "messages.h"
 | 
			
		||||
 | 
			
		||||
#include <exp.h>
 | 
			
		||||
@@ -60,6 +62,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,
 | 
			
		||||
@@ -69,6 +73,8 @@ static CLIENT *Init_New_Client PARAMS((CONN_ID Idx, CLIENT *Introducer,
 | 
			
		||||
static void Destroy_UserOrService PARAMS((CLIENT *Client,const char *Txt, const char *FwdMsg,
 | 
			
		||||
					bool SendQuit));
 | 
			
		||||
 | 
			
		||||
static void cb_introduceClient PARAMS((CLIENT *Client, CLIENT *Prefix,
 | 
			
		||||
				       void *i));
 | 
			
		||||
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Client_Init( void )
 | 
			
		||||
@@ -83,7 +89,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;
 | 
			
		||||
@@ -116,14 +122,15 @@ Client_Exit( void )
 | 
			
		||||
	
 | 
			
		||||
	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 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -213,8 +220,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;
 | 
			
		||||
@@ -231,14 +238,14 @@ Client_Destroy( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool Sen
 | 
			
		||||
	/* 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 ) {
 | 
			
		||||
@@ -278,10 +285,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 */
 | 
			
		||||
@@ -293,17 +305,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;
 | 
			
		||||
@@ -328,9 +346,15 @@ Client_SetHostname( CLIENT *Client, const char *Hostname )
 | 
			
		||||
	assert(Hostname != NULL);
 | 
			
		||||
 | 
			
		||||
	if (strlen(Conf_CloakHost)) {
 | 
			
		||||
		char cloak[GETID_LEN];
 | 
			
		||||
 | 
			
		||||
		strlcpy(cloak, Hostname, GETID_LEN);
 | 
			
		||||
		strlcat(cloak, Conf_CloakHostSalt, GETID_LEN);
 | 
			
		||||
		snprintf(cloak, GETID_LEN, Conf_CloakHost, Hash(cloak));
 | 
			
		||||
 | 
			
		||||
		LogDebug("Updating hostname of \"%s\": \"%s\" -> \"%s\"",
 | 
			
		||||
			 Client_ID(Client), Client->host, Conf_CloakHost);
 | 
			
		||||
		strlcpy(Client->host, Conf_CloakHost, sizeof(Client->host));
 | 
			
		||||
			Client_ID(Client), Client->host, cloak);
 | 
			
		||||
		strlcpy(Client->host, cloak, sizeof(Client->host));
 | 
			
		||||
	} else {
 | 
			
		||||
		LogDebug("Updating hostname of \"%s\": \"%s\" -> \"%s\"",
 | 
			
		||||
			 Client_ID(Client), Client->host, Hostname);
 | 
			
		||||
@@ -339,6 +363,27 @@ 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 )
 | 
			
		||||
{
 | 
			
		||||
@@ -432,15 +477,19 @@ Client_SetFlags( CLIENT *Client, const char *Flags )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Client_SetPassword( CLIENT *Client, const char *Pwd )
 | 
			
		||||
Client_SetAccountName(CLIENT *Client, const char *AccountName)
 | 
			
		||||
{
 | 
			
		||||
	/* set password sent by client */
 | 
			
		||||
	assert(Client != NULL);
 | 
			
		||||
 | 
			
		||||
	assert( Client != NULL );
 | 
			
		||||
	assert( Pwd != NULL );
 | 
			
		||||
	if (Client->account_name)
 | 
			
		||||
		free(Client->account_name);
 | 
			
		||||
 | 
			
		||||
	strlcpy(Client->pwd, Pwd, sizeof(Client->pwd));
 | 
			
		||||
} /* Client_SetPassword */
 | 
			
		||||
	if (*AccountName)
 | 
			
		||||
		Client->account_name = strndup(AccountName,
 | 
			
		||||
					       CLIENT_NICK_LEN - 1);
 | 
			
		||||
	else
 | 
			
		||||
		Client->account_name = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GLOBAL void
 | 
			
		||||
@@ -451,7 +500,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 */
 | 
			
		||||
@@ -492,19 +545,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.
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
@@ -513,7 +558,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;
 | 
			
		||||
	}
 | 
			
		||||
@@ -548,13 +593,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;
 | 
			
		||||
@@ -575,7 +621,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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -674,7 +752,6 @@ Client_OrigUser(CLIENT *Client) {
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Return the hostname of a client.
 | 
			
		||||
 * @param Client Pointer to client structure
 | 
			
		||||
@@ -685,33 +762,108 @@ Client_Hostname(CLIENT *Client)
 | 
			
		||||
{
 | 
			
		||||
	assert (Client != NULL);
 | 
			
		||||
	return Client->host;
 | 
			
		||||
} /* Client_Hostname */
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get potentially cloaked hostname of a client.
 | 
			
		||||
 * If the client has not enabled cloaking, the real hostname is used.
 | 
			
		||||
 * @param Client Pointer to client structure
 | 
			
		||||
 * @return Pointer to client hostname
 | 
			
		||||
 * Return the cloaked hostname of a client, if set.
 | 
			
		||||
 * @param Client Pointer to the client structure.
 | 
			
		||||
 * @return Pointer to the cloaked hostname or NULL if not set.
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL char *
 | 
			
		||||
Client_HostnameCloaked(CLIENT *Client)
 | 
			
		||||
{
 | 
			
		||||
	assert(Client != NULL);
 | 
			
		||||
	if (Client_HasMode(Client, 'x'))
 | 
			
		||||
		return Client_ID(Client->introducer);
 | 
			
		||||
	else
 | 
			
		||||
		return Client_Hostname(Client);
 | 
			
		||||
} /* Client_HostnameCloaked */
 | 
			
		||||
 | 
			
		||||
	return Client->cloaked;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 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.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Client Pointer to client structure
 | 
			
		||||
 * @return Pointer to client hostname
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL char *
 | 
			
		||||
Client_Password( CLIENT *Client )
 | 
			
		||||
Client_HostnameDisplayed(CLIENT *Client)
 | 
			
		||||
{
 | 
			
		||||
	assert( Client != NULL );
 | 
			
		||||
	return Client->pwd;
 | 
			
		||||
} /* Client_Password */
 | 
			
		||||
	assert(Client != NULL);
 | 
			
		||||
 | 
			
		||||
	/* Client isn't cloaked at all, return real hostname: */
 | 
			
		||||
	if (!Client_HasMode(Client, 'x'))
 | 
			
		||||
		return Client_Hostname(Client);
 | 
			
		||||
 | 
			
		||||
	/* Use an already saved cloaked hostname, if there is one */
 | 
			
		||||
	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.
 | 
			
		||||
 *
 | 
			
		||||
 * The newly set cloaked hostname is announced in the network using METADATA
 | 
			
		||||
 * commands to peers that support this feature.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Client The client of which the cloaked hostname should be updated.
 | 
			
		||||
 * @param Origin The originator of the hostname change, or NULL if this server.
 | 
			
		||||
 * @param Hostname The new cloaked hostname, or NULL if it should be generated.
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Client_UpdateCloakedHostname(CLIENT *Client, CLIENT *Origin,
 | 
			
		||||
			     const char *Hostname)
 | 
			
		||||
{
 | 
			
		||||
	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,
 | 
			
		||||
				sizeof(Cloak_Buffer));
 | 
			
		||||
			strlcat(Cloak_Buffer, Conf_CloakHostSalt,
 | 
			
		||||
				sizeof(Cloak_Buffer));
 | 
			
		||||
			snprintf(Client->cloaked, CLIENT_HOST_LEN,
 | 
			
		||||
				 Conf_CloakHostModeX, Hash(Cloak_Buffer));
 | 
			
		||||
		} else
 | 
			
		||||
			strlcpy(Client->cloaked, Client_ID(Client->introducer),
 | 
			
		||||
				CLIENT_HOST_LEN);
 | 
			
		||||
	} else
 | 
			
		||||
		strlcpy(Client->cloaked, Hostname, CLIENT_HOST_LEN);
 | 
			
		||||
	LogDebug("Cloaked hostname of \"%s\" updated to \"%s\"",
 | 
			
		||||
		 Client_ID(Client), Client->cloaked);
 | 
			
		||||
 | 
			
		||||
	/* Inform other servers in the network */
 | 
			
		||||
	IRC_WriteStrServersPrefixFlag(Client_NextHop(Origin), Origin, 'M',
 | 
			
		||||
				      "METADATA %s cloakhost :%s",
 | 
			
		||||
				      Client_ID(Client), Client->cloaked);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GLOBAL char *
 | 
			
		||||
Client_Modes( CLIENT *Client )
 | 
			
		||||
@@ -729,14 +881,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 )
 | 
			
		||||
{
 | 
			
		||||
@@ -803,10 +947,12 @@ Client_Mask( CLIENT *Client )
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Return ID of a client with cloaked hostname: "client!user@server-name"
 | 
			
		||||
 *
 | 
			
		||||
 * This client ID is used for IRC prefixes, for example.
 | 
			
		||||
 * Please note that this function uses a global static buffer, so you can't
 | 
			
		||||
 * nest invocations without overwriting earlier results!
 | 
			
		||||
 * If the client has not enabled cloaking, the real hostname is used.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Client Pointer to client structure
 | 
			
		||||
 * @return Pointer to global buffer containing the client ID
 | 
			
		||||
 */
 | 
			
		||||
@@ -819,10 +965,11 @@ Client_MaskCloaked(CLIENT *Client)
 | 
			
		||||
 | 
			
		||||
	/* Is the client using cloaking at all? */
 | 
			
		||||
	if (!Client_HasMode(Client, 'x'))
 | 
			
		||||
	    return Client_Mask(Client);
 | 
			
		||||
		return Client_Mask(Client);
 | 
			
		||||
 | 
			
		||||
	snprintf(Mask_Buffer, GETID_LEN, "%s!%s@%s", Client->id, Client->user,
 | 
			
		||||
		 Client_HostnameDisplayed(Client));
 | 
			
		||||
 | 
			
		||||
	snprintf(Mask_Buffer, GETID_LEN, "%s!%s@%s",
 | 
			
		||||
		 Client->id, Client->user, Client_ID(Client->introducer));
 | 
			
		||||
	return Mask_Buffer;
 | 
			
		||||
} /* Client_MaskCloaked */
 | 
			
		||||
 | 
			
		||||
@@ -851,6 +998,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 )
 | 
			
		||||
{
 | 
			
		||||
@@ -859,6 +1014,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.
 | 
			
		||||
 *
 | 
			
		||||
@@ -866,7 +1029,7 @@ Client_Away( CLIENT *Client )
 | 
			
		||||
 * the appropriate error messages.
 | 
			
		||||
 *
 | 
			
		||||
 * @param	Client Client that wants to change the nickname.
 | 
			
		||||
 * @param	Nick New nick name.
 | 
			
		||||
 * @param	Nick New nickname.
 | 
			
		||||
 * @returns	true if nickname is valid, false otherwise.
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL bool
 | 
			
		||||
@@ -877,18 +1040,28 @@ 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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (Client_Type(Client) != CLIENT_SERVER
 | 
			
		||||
	    && Client_Type(Client) != CLIENT_SERVICE) {
 | 
			
		||||
		/* Make sure that this isn't a restricted/forbidden nickname */
 | 
			
		||||
		if (Conf_NickIsBlocked(Nick)) {
 | 
			
		||||
			IRC_WriteErrClient(Client, ERR_FORBIDDENNICKNAME_MSG,
 | 
			
		||||
					   Client_ID(Client), Nick);
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* 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;
 | 
			
		||||
	}
 | 
			
		||||
@@ -909,7 +1082,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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -1007,7 +1181,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;
 | 
			
		||||
@@ -1142,6 +1317,46 @@ Client_Reject(CLIENT *Client, const char *Reason, bool InformClient)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Introduce a new user or service client in the network.
 | 
			
		||||
 *
 | 
			
		||||
 * @param From Remote server introducing the client or NULL (local).
 | 
			
		||||
 * @param Client New client.
 | 
			
		||||
 * @param Type Type of the client (CLIENT_USER or CLIENT_SERVICE).
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Client_Introduce(CLIENT *From, CLIENT *Client, int Type)
 | 
			
		||||
{
 | 
			
		||||
	/* Set client type (user or service) */
 | 
			
		||||
	Client_SetType(Client, Type);
 | 
			
		||||
 | 
			
		||||
	if (From) {
 | 
			
		||||
		if (Conf_NickIsService(Conf_GetServer(Client_Conn(From)),
 | 
			
		||||
				   Client_ID(Client)))
 | 
			
		||||
			Client_SetType(Client, CLIENT_SERVICE);
 | 
			
		||||
		LogDebug("%s \"%s\" (+%s) registered (via %s, on %s, %d hop%s).",
 | 
			
		||||
			 Client_TypeText(Client), Client_Mask(Client),
 | 
			
		||||
			 Client_Modes(Client), Client_ID(From),
 | 
			
		||||
			 Client_ID(Client_Introducer(Client)),
 | 
			
		||||
			 Client_Hops(Client), Client_Hops(Client) > 1 ? "s": "");
 | 
			
		||||
	} else {
 | 
			
		||||
		Log(LOG_NOTICE, "%s \"%s\" registered (connection %d).",
 | 
			
		||||
		    Client_TypeText(Client), Client_Mask(Client),
 | 
			
		||||
		    Client_Conn(Client));
 | 
			
		||||
		Log_ServerNotice('c', "Client connecting: %s (%s@%s) [%s] - %s",
 | 
			
		||||
			         Client_ID(Client), Client_User(Client),
 | 
			
		||||
				 Client_Hostname(Client),
 | 
			
		||||
				 Conn_IPA(Client_Conn(Client)),
 | 
			
		||||
				 Client_TypeText(Client));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Inform other servers */
 | 
			
		||||
	IRC_WriteStrServersPrefixFlag_CB(From,
 | 
			
		||||
				From != NULL ? From : Client_ThisServer(),
 | 
			
		||||
				'\0', cb_introduceClient, (void *)Client);
 | 
			
		||||
} /* Client_Introduce */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static unsigned long
 | 
			
		||||
Count( CLIENT_TYPE Type )
 | 
			
		||||
{
 | 
			
		||||
@@ -1174,11 +1389,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 ));
 | 
			
		||||
@@ -1192,14 +1410,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 )
 | 
			
		||||
@@ -1213,7 +1451,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;
 | 
			
		||||
@@ -1280,7 +1518,7 @@ Client_RegisterWhowas( CLIENT *Client )
 | 
			
		||||
		 sizeof( My_Whowas[slot].id ));
 | 
			
		||||
	strlcpy( My_Whowas[slot].user, Client_User( Client ),
 | 
			
		||||
		 sizeof( My_Whowas[slot].user ));
 | 
			
		||||
	strlcpy( My_Whowas[slot].host, Client_HostnameCloaked( Client ),
 | 
			
		||||
	strlcpy( My_Whowas[slot].host, Client_HostnameDisplayed( Client ),
 | 
			
		||||
		 sizeof( My_Whowas[slot].host ));
 | 
			
		||||
	strlcpy( My_Whowas[slot].info, Client_Info( Client ),
 | 
			
		||||
		 sizeof( My_Whowas[slot].info ));
 | 
			
		||||
@@ -1320,7 +1558,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]",
 | 
			
		||||
@@ -1338,7 +1576,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) {
 | 
			
		||||
@@ -1361,6 +1599,113 @@ Destroy_UserOrService(CLIENT *Client, const char *Txt, const char *FwdMsg, bool
 | 
			
		||||
} /* Destroy_UserOrService */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Introduce a new user or service client to a remote server.
 | 
			
		||||
 *
 | 
			
		||||
 * @param To		The remote server to inform.
 | 
			
		||||
 * @param Prefix	Prefix for the generated commands.
 | 
			
		||||
 * @param data		CLIENT structure of the new client.
 | 
			
		||||
 */
 | 
			
		||||
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(User);
 | 
			
		||||
	user = Client_User(User) ? Client_User(User) : "-";
 | 
			
		||||
	host = Client_Hostname(User) ? Client_Hostname(User) : "-";
 | 
			
		||||
 | 
			
		||||
	conn = Client_Conn(Client);
 | 
			
		||||
	if (Conn_Options(conn) & CONN_RFC1459) {
 | 
			
		||||
		/* RFC 1459 mode: separate NICK and USER commands */
 | 
			
		||||
		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(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;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	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
 | 
			
		||||
 | 
			
		||||
GLOBAL void
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2008 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,24 +17,26 @@
 | 
			
		||||
 * 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	0x0400	/* waiting for "CAP END" command */
 | 
			
		||||
#define CLIENT_ANY		0xFFFF
 | 
			
		||||
 | 
			
		||||
#define CLIENT_TYPE int
 | 
			
		||||
 | 
			
		||||
#include "defines.h"
 | 
			
		||||
 | 
			
		||||
#if defined(__client_c__) | defined(S_SPLINT_S)
 | 
			
		||||
#if defined(__client_c__) | defined(__client_cap_c__) | defined(S_SPLINT_S)
 | 
			
		||||
 | 
			
		||||
typedef struct _CLIENT
 | 
			
		||||
{
 | 
			
		||||
@@ -46,8 +48,9 @@ typedef struct _CLIENT
 | 
			
		||||
	CONN_ID conn_id;		/* ID of the connection (if local) or NONE (remote) */
 | 
			
		||||
	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 pwd[CLIENT_PASS_LEN];	/* password received of the client */
 | 
			
		||||
	char host[CLIENT_HOST_LEN];	/* 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 */
 | 
			
		||||
@@ -55,9 +58,10 @@ typedef struct _CLIENT
 | 
			
		||||
	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;
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
@@ -70,7 +74,7 @@ typedef POINTER CLIENT;
 | 
			
		||||
typedef struct _WHOWAS
 | 
			
		||||
{
 | 
			
		||||
	time_t time;			/* time stamp of entry or 0 if unused */
 | 
			
		||||
	char id[CLIENT_NICK_LEN];	/* client nick name */
 | 
			
		||||
	char id[CLIENT_NICK_LEN];	/* client nickname */
 | 
			
		||||
	char host[CLIENT_HOST_LEN];	/* hostname of the client */
 | 
			
		||||
	char user[CLIENT_USER_LEN];	/* user name ("login") */
 | 
			
		||||
	char info[CLIENT_INFO_LEN];	/* long user name */
 | 
			
		||||
@@ -91,7 +95,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 ));
 | 
			
		||||
 | 
			
		||||
@@ -106,36 +113,38 @@ GLOBAL char *Client_User PARAMS(( CLIENT *Client ));
 | 
			
		||||
GLOBAL char *Client_OrigUser PARAMS(( CLIENT *Client ));
 | 
			
		||||
#endif
 | 
			
		||||
GLOBAL char *Client_Hostname PARAMS(( CLIENT *Client ));
 | 
			
		||||
GLOBAL char *Client_HostnameCloaked PARAMS(( CLIENT *Client ));
 | 
			
		||||
GLOBAL char *Client_Password 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 ));
 | 
			
		||||
GLOBAL void Client_SetInfo PARAMS(( CLIENT *Client, const char *Info ));
 | 
			
		||||
GLOBAL void Client_SetPassword PARAMS(( CLIENT *Client, const char *Pwd ));
 | 
			
		||||
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 ));
 | 
			
		||||
@@ -165,6 +174,12 @@ GLOBAL const char *Client_TypeText PARAMS((CLIENT *Client));
 | 
			
		||||
 | 
			
		||||
GLOBAL void Client_Reject PARAMS((CLIENT *Client, const char *Reason,
 | 
			
		||||
				  bool InformClient));
 | 
			
		||||
GLOBAL void Client_Introduce PARAMS((CLIENT *From, CLIENT *Client, int Type));
 | 
			
		||||
 | 
			
		||||
GLOBAL void Client_UpdateCloakedHostname PARAMS((CLIENT *Client,
 | 
			
		||||
						 CLIENT *Originator,
 | 
			
		||||
						 const char *hostname));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
GLOBAL void Client_DebugDump PARAMS((void));
 | 
			
		||||
 
 | 
			
		||||
@@ -33,19 +33,16 @@ struct ConnSSL_State {
 | 
			
		||||
	SSL *ssl;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_LIBGNUTLS
 | 
			
		||||
	gnutls_session gnutls_session;
 | 
			
		||||
	gnutls_session_t gnutls_session;
 | 
			
		||||
	void *cookie;		/* pointer to server configuration structure
 | 
			
		||||
				   (for outgoing connections), or NULL. */
 | 
			
		||||
#endif
 | 
			
		||||
	char *fingerprint;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
bool
 | 
			
		||||
ConnSSL_InitLibrary(void);
 | 
			
		||||
#else
 | 
			
		||||
static inline bool
 | 
			
		||||
ConnSSL_InitLibrary(void)
 | 
			
		||||
{ return true; }
 | 
			
		||||
#endif /* SSL_SUPPORT */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
bool	ConnSSL_InitLibrary(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-2011 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
 | 
			
		||||
@@ -62,7 +62,7 @@ typedef struct _Conf_Server
 | 
			
		||||
#ifdef SSL_SUPPORT
 | 
			
		||||
	bool SSLConnect;		/**< Establish connection using SSL? */
 | 
			
		||||
#endif
 | 
			
		||||
	char svs_mask[CLIENT_ID_LEN];	/**< Mask of nick names that should be
 | 
			
		||||
	char svs_mask[CLIENT_ID_LEN];	/**< Mask of nicknames that should be
 | 
			
		||||
					     treated and counted as services */
 | 
			
		||||
} CONF_SERVER;
 | 
			
		||||
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
@@ -111,6 +112,9 @@ GLOBAL char Conf_ServerAdminMail[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,12 +149,15 @@ 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;
 | 
			
		||||
 | 
			
		||||
/** Flag indicating if IRC operators get AutoOp in persistent (+P) channels */
 | 
			
		||||
GLOBAL bool Conf_OperChanPAutoOp;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * If true, mask channel MODE commands of IRC operators to the server.
 | 
			
		||||
 * Background: ircd2 will ignore channel MODE commands if an IRC operator
 | 
			
		||||
@@ -166,7 +173,13 @@ GLOBAL bool Conf_AllowRemoteOper;
 | 
			
		||||
/** Cloaked hostname of the clients */
 | 
			
		||||
GLOBAL char Conf_CloakHost[CLIENT_ID_LEN];
 | 
			
		||||
 | 
			
		||||
/** Use nick name as user name? */
 | 
			
		||||
/** Cloaked hostname for clients that did +x */
 | 
			
		||||
GLOBAL char Conf_CloakHostModeX[CLIENT_ID_LEN];
 | 
			
		||||
 | 
			
		||||
/** Salt for hostname hash for cloaked hostnames */
 | 
			
		||||
GLOBAL char Conf_CloakHostSalt[CLIENT_ID_LEN];
 | 
			
		||||
 | 
			
		||||
/** Use nickname as user name? */
 | 
			
		||||
GLOBAL bool Conf_CloakUserToNick;
 | 
			
		||||
 | 
			
		||||
/** Enable all DNS functions? */
 | 
			
		||||
@@ -190,6 +203,9 @@ GLOBAL bool Conf_PAMIsOptional;
 | 
			
		||||
/** 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)
 | 
			
		||||
@@ -199,8 +215,11 @@ 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 long Conf_MaxConnections;
 | 
			
		||||
GLOBAL int Conf_MaxConnections;
 | 
			
		||||
 | 
			
		||||
/** Maximum number of channels a user can join */
 | 
			
		||||
GLOBAL int Conf_MaxJoins;
 | 
			
		||||
@@ -208,9 +227,12 @@ GLOBAL int Conf_MaxJoins;
 | 
			
		||||
/** Maximum number of connections per IP address */
 | 
			
		||||
GLOBAL int Conf_MaxConnectionsIP;
 | 
			
		||||
 | 
			
		||||
/** Maximum length of a nick name */
 | 
			
		||||
/** Maximum length of a nickname */
 | 
			
		||||
GLOBAL unsigned int Conf_MaxNickLength;
 | 
			
		||||
 | 
			
		||||
/** Maximum number of channels returned to /list */
 | 
			
		||||
GLOBAL int Conf_MaxListSize;
 | 
			
		||||
 | 
			
		||||
#ifndef STRICT_RFC
 | 
			
		||||
 | 
			
		||||
/** Require "AUTH PING-PONG" on login */
 | 
			
		||||
@@ -230,7 +252,7 @@ GLOBAL bool Conf_Rehash PARAMS((void));
 | 
			
		||||
GLOBAL int Conf_Test PARAMS((void));
 | 
			
		||||
 | 
			
		||||
GLOBAL void Conf_UnsetServer PARAMS(( CONN_ID Idx ));
 | 
			
		||||
GLOBAL void Conf_SetServer PARAMS(( int ConfServer, CONN_ID Idx ));
 | 
			
		||||
GLOBAL bool Conf_SetServer PARAMS(( int ConfServer, CONN_ID Idx ));
 | 
			
		||||
GLOBAL int Conf_GetServer PARAMS(( CONN_ID Idx ));
 | 
			
		||||
 | 
			
		||||
GLOBAL bool Conf_EnableServer PARAMS(( const char *Name, UINT16 Port ));
 | 
			
		||||
@@ -238,7 +260,12 @@ GLOBAL bool Conf_EnablePassiveServer PARAMS((const char *Name));
 | 
			
		||||
GLOBAL bool Conf_DisableServer PARAMS(( const char *Name ));
 | 
			
		||||
GLOBAL bool Conf_AddServer PARAMS(( const char *Name, UINT16 Port, const char *Host, const char *MyPwd, const char *PeerPwd ));
 | 
			
		||||
 | 
			
		||||
GLOBAL bool Conf_IsService PARAMS((int ConfServer, const char *Nick));
 | 
			
		||||
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];
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										192
									
								
								src/ngircd/conn-encoding.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										192
									
								
								src/ngircd/conn-encoding.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,192 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2012 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.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define __conn_encoding_c__
 | 
			
		||||
 | 
			
		||||
#define CONN_MODULE
 | 
			
		||||
 | 
			
		||||
#include "portab.h"
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * Functions to deal with character encodings and conversions
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "imp.h"
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include "defines.h"
 | 
			
		||||
#include "conn.h"
 | 
			
		||||
#include "log.h"
 | 
			
		||||
 | 
			
		||||
#include "exp.h"
 | 
			
		||||
#include "conn-encoding.h"
 | 
			
		||||
 | 
			
		||||
#ifdef ICONV
 | 
			
		||||
 | 
			
		||||
char Encoding_Buffer[COMMAND_LEN];
 | 
			
		||||
 | 
			
		||||
char *Convert_Message PARAMS((iconv_t Handle, char *Message));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Set client character encoding on a connection.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Conn Connection identifier.
 | 
			
		||||
 * @param ClientEnc Client encoding (for example "ASCII", "MacRoman", ...).
 | 
			
		||||
 * @return true on success, false otherwise.
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL bool
 | 
			
		||||
Conn_SetEncoding(CONN_ID Conn, const char *ClientEnc)
 | 
			
		||||
{
 | 
			
		||||
	char client_enc[25], server_enc[25];
 | 
			
		||||
 | 
			
		||||
	assert(Conn > NONE);
 | 
			
		||||
	assert(ClientEnc != NULL);
 | 
			
		||||
 | 
			
		||||
	Conn_UnsetEncoding(Conn);
 | 
			
		||||
 | 
			
		||||
	/* Is the client character set identical to server character set? */
 | 
			
		||||
	if (strcasecmp(ClientEnc, "UTF-8") == 0)
 | 
			
		||||
		return true;
 | 
			
		||||
 | 
			
		||||
	snprintf(client_enc, sizeof(client_enc), "%s//TRANSLIT", ClientEnc);
 | 
			
		||||
	snprintf(server_enc, sizeof(server_enc), "%s//TRANSLIT", "UTF-8");
 | 
			
		||||
 | 
			
		||||
	My_Connections[Conn].iconv_from = iconv_open(server_enc, client_enc);
 | 
			
		||||
	if (My_Connections[Conn].iconv_from == (iconv_t)(-1)) {
 | 
			
		||||
		Conn_UnsetEncoding(Conn);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
	My_Connections[Conn].iconv_to = iconv_open(client_enc, server_enc);
 | 
			
		||||
	if (My_Connections[Conn].iconv_to == (iconv_t)(-1)) {
 | 
			
		||||
		Conn_UnsetEncoding(Conn);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	LogDebug("Set client character set of connection \"%d\" to \"%s\".",
 | 
			
		||||
		 Conn, client_enc);
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Remove client character encoding conversion on a connection.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Conn Connection identifier.
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Conn_UnsetEncoding(CONN_ID Conn)
 | 
			
		||||
{
 | 
			
		||||
	assert(Conn > NONE);
 | 
			
		||||
 | 
			
		||||
	if (My_Connections[Conn].iconv_from != (iconv_t)(-1))
 | 
			
		||||
		iconv_close(My_Connections[Conn].iconv_from);
 | 
			
		||||
	if (My_Connections[Conn].iconv_to != (iconv_t)(-1))
 | 
			
		||||
		iconv_close(My_Connections[Conn].iconv_to);
 | 
			
		||||
 | 
			
		||||
	My_Connections[Conn].iconv_from = (iconv_t)(-1);
 | 
			
		||||
	My_Connections[Conn].iconv_to = (iconv_t)(-1);
 | 
			
		||||
 | 
			
		||||
	LogDebug("Unset character conversion of connection %d.", Conn);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Convert the encoding of a given message.
 | 
			
		||||
 *
 | 
			
		||||
 * This function uses a static buffer for the result of the encoding
 | 
			
		||||
 * conversion which is overwritten by subsequent calls to this function!
 | 
			
		||||
 *
 | 
			
		||||
 * @param Handle libiconv handle.
 | 
			
		||||
 * @param Message The message to convert.
 | 
			
		||||
 * @return Pointer to the result.
 | 
			
		||||
 */
 | 
			
		||||
char *
 | 
			
		||||
Convert_Message(iconv_t Handle, char *Message)
 | 
			
		||||
{
 | 
			
		||||
	size_t in_left, out_left;
 | 
			
		||||
	char *out = Encoding_Buffer;
 | 
			
		||||
 | 
			
		||||
	assert (Handle != (iconv_t)(-1));
 | 
			
		||||
	assert (Message != NULL);
 | 
			
		||||
 | 
			
		||||
	in_left = strlen(Message);
 | 
			
		||||
	out_left = sizeof(Encoding_Buffer) - 1;
 | 
			
		||||
 | 
			
		||||
	if (iconv(Handle, &Message, &in_left, &out, &out_left) == (size_t)(-1)) {
 | 
			
		||||
		/* An error occurred! */
 | 
			
		||||
		LogDebug("Error converting message encoding!");
 | 
			
		||||
		strlcpy(Encoding_Buffer, Message, sizeof(Encoding_Buffer));
 | 
			
		||||
		iconv(Handle, NULL, NULL, NULL, NULL);
 | 
			
		||||
	} else
 | 
			
		||||
		*out = '\0';
 | 
			
		||||
 | 
			
		||||
	return Encoding_Buffer;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Convert encoding of a message received from a connection.
 | 
			
		||||
 *
 | 
			
		||||
 * Note 1: If no conversion is required, this function returns the original
 | 
			
		||||
 * pointer to the message.
 | 
			
		||||
 *
 | 
			
		||||
 * Note 2: This function uses Convert_Message(), so subsequent calls to this
 | 
			
		||||
 * function will overwrite the earlier results.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Conn Connection identifier.
 | 
			
		||||
 * @param Message The message to convert.
 | 
			
		||||
 * @return Pointer to the result.
 | 
			
		||||
 * @see Convert_Message
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL char *
 | 
			
		||||
Conn_EncodingFrom(UNUSED CONN_ID Conn, char *Message)
 | 
			
		||||
{
 | 
			
		||||
	assert(Conn > NONE);
 | 
			
		||||
	assert (Message != NULL);
 | 
			
		||||
 | 
			
		||||
#ifdef ICONV
 | 
			
		||||
	if (My_Connections[Conn].iconv_from != (iconv_t)(-1))
 | 
			
		||||
		return Convert_Message(My_Connections[Conn].iconv_from, Message);
 | 
			
		||||
#endif
 | 
			
		||||
	return Message;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Convert encoding of a message for sending on a connection.
 | 
			
		||||
 *
 | 
			
		||||
 * Note 1: If no conversion is required, this function returns the original
 | 
			
		||||
 * pointer to the message.
 | 
			
		||||
 *
 | 
			
		||||
 * Note 2: This function uses Convert_Message(), so subsequent calls to this
 | 
			
		||||
 * function will overwrite the earlier results.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Conn Connection identifier.
 | 
			
		||||
 * @param Message The message to convert.
 | 
			
		||||
 * @return Pointer to the result.
 | 
			
		||||
 * @see Convert_Message
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL char *
 | 
			
		||||
Conn_EncodingTo(UNUSED CONN_ID Conn, char *Message)
 | 
			
		||||
{
 | 
			
		||||
	assert(Conn > NONE);
 | 
			
		||||
	assert (Message != NULL);
 | 
			
		||||
 | 
			
		||||
#ifdef ICONV
 | 
			
		||||
	if (My_Connections[Conn].iconv_to != (iconv_t)(-1))
 | 
			
		||||
		return Convert_Message(My_Connections[Conn].iconv_to, Message);
 | 
			
		||||
#endif
 | 
			
		||||
	return Message;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* -eof- */
 | 
			
		||||
							
								
								
									
										30
									
								
								src/ngircd/conn-encoding.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								src/ngircd/conn-encoding.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2012 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 __conn_encoding_h__
 | 
			
		||||
#define __conn_encoding_h__
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * Functions to deal with character encodings and conversions (header)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifdef ICONV
 | 
			
		||||
 | 
			
		||||
GLOBAL bool Conn_SetEncoding PARAMS((CONN_ID Idx, const char *ClientEnc));
 | 
			
		||||
GLOBAL void Conn_UnsetEncoding PARAMS((CONN_ID Idx));
 | 
			
		||||
 | 
			
		||||
#endif /* ICONV */
 | 
			
		||||
 | 
			
		||||
GLOBAL char* Conn_EncodingFrom PARAMS((CONN_ID Idx, char *Message));
 | 
			
		||||
GLOBAL char* Conn_EncodingTo PARAMS((CONN_ID Idx, char *Message));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -117,24 +117,6 @@ Conn_SetPenalty(CONN_ID Idx, time_t Seconds)
 | 
			
		||||
} /* 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 )
 | 
			
		||||
{
 | 
			
		||||
@@ -155,8 +137,6 @@ Conn_Flag( CONN_ID Idx )
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Conn_SetFlag( CONN_ID Idx, int Flag )
 | 
			
		||||
{
 | 
			
		||||
	/* Connection markieren */
 | 
			
		||||
 | 
			
		||||
	assert( Idx > NONE );
 | 
			
		||||
	My_Connections[Idx].flag = Flag;
 | 
			
		||||
} /* Conn_SetFlag */
 | 
			
		||||
@@ -165,9 +145,6 @@ Conn_SetFlag( CONN_ID Idx, int Flag )
 | 
			
		||||
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++ )
 | 
			
		||||
@@ -181,9 +158,6 @@ Conn_First( void )
 | 
			
		||||
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 );
 | 
			
		||||
 
 | 
			
		||||
@@ -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 ));
 | 
			
		||||
 
 | 
			
		||||
@@ -54,11 +54,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 +114,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 +152,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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -156,7 +177,7 @@ Load_DH_params(void)
 | 
			
		||||
	bool ret = true;
 | 
			
		||||
 | 
			
		||||
	if (!Conf_SSLOptions.DHFile) {
 | 
			
		||||
		Log(LOG_NOTICE, "Configuration option \"SSLDHFile\" not set!");
 | 
			
		||||
		Log(LOG_NOTICE, "Configuration option \"DHFile\" not set!");
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
	fp = fopen(Conf_SSLOptions.DHFile, "r");
 | 
			
		||||
@@ -166,7 +187,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 +201,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 +215,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);
 | 
			
		||||
@@ -201,11 +225,12 @@ Load_DH_params(void)
 | 
			
		||||
	}
 | 
			
		||||
	if (need_dhgenerate) {
 | 
			
		||||
		Log(LOG_WARNING,
 | 
			
		||||
		    "SSLDHFile not set, generating %u bit DH parameters. This may take a while ...",
 | 
			
		||||
		    "DHFile not set, generating %u bit DH parameters. This may take a while ...",
 | 
			
		||||
		    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 +248,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,6 +270,11 @@ void ConnSSL_Free(CONNECTION *c)
 | 
			
		||||
bool
 | 
			
		||||
ConnSSL_InitLibrary( void )
 | 
			
		||||
{
 | 
			
		||||
	if (!Conf_SSLInUse()) {
 | 
			
		||||
		LogDebug("SSL not in use, skipping initialization.");
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_LIBSSL
 | 
			
		||||
	SSL_CTX *newctx;
 | 
			
		||||
 | 
			
		||||
@@ -252,48 +286,79 @@ ConnSSL_InitLibrary( void )
 | 
			
		||||
	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);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	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_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));
 | 
			
		||||
	return true;
 | 
			
		||||
out:
 | 
			
		||||
	SSL_CTX_free(newctx);
 | 
			
		||||
	array_free(&Conf_SSLOptions.ListenPorts);
 | 
			
		||||
	return false;
 | 
			
		||||
#endif
 | 
			
		||||
#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));
 | 
			
		||||
		return false;
 | 
			
		||||
		Log(LOG_ERR, "Failed to initialize GnuTLS: %s",
 | 
			
		||||
		    gnutls_strerror(err));
 | 
			
		||||
		goto out;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!ConnSSL_LoadServerKey_gnutls())
 | 
			
		||||
		return false;
 | 
			
		||||
	Log(LOG_INFO, "gnutls %s initialized.", gnutls_check_version(NULL));
 | 
			
		||||
		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));
 | 
			
		||||
	initialized = true;
 | 
			
		||||
	return true;
 | 
			
		||||
out:
 | 
			
		||||
	array_free(&Conf_SSLOptions.ListenPorts);
 | 
			
		||||
	return false;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -307,19 +372,20 @@ 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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	cert_file = Conf_SSLOptions.CertFile ? Conf_SSLOptions.CertFile:Conf_SSLOptions.KeyFile;
 | 
			
		||||
	if (!cert_file) {
 | 
			
		||||
		Log(LOG_NOTICE, "No SSL server key configured, SSL disabled.");
 | 
			
		||||
		Log(LOG_ERR, "No SSL server key configured!");
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	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;
 | 
			
		||||
@@ -327,8 +393,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;
 | 
			
		||||
@@ -344,7 +413,7 @@ ConnSSL_LoadServerKey_openssl(SSL_CTX *ctx)
 | 
			
		||||
 | 
			
		||||
	assert(ctx);
 | 
			
		||||
	if (!Conf_SSLOptions.KeyFile) {
 | 
			
		||||
		Log(LOG_NOTICE, "No SSL server key configured, SSL disabled.");
 | 
			
		||||
		Log(LOG_ERR, "No SSL server key configured!");
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -353,26 +422,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;
 | 
			
		||||
@@ -386,31 +455,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;
 | 
			
		||||
	}
 | 
			
		||||
@@ -420,16 +497,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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -443,7 +524,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
 | 
			
		||||
@@ -459,16 +541,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;
 | 
			
		||||
@@ -476,6 +565,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);
 | 
			
		||||
@@ -487,31 +577,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;
 | 
			
		||||
@@ -531,7 +623,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;
 | 
			
		||||
		}
 | 
			
		||||
@@ -549,17 +642,18 @@ ConnSSL_LogCertInfo( CONNECTION *c )
 | 
			
		||||
 | 
			
		||||
	assert(ssl);
 | 
			
		||||
 | 
			
		||||
	Log(LOG_INFO, "New %s connection using cipher %s on socket %d.",
 | 
			
		||||
		SSL_get_version(ssl), SSL_get_cipher(ssl), c->sock);
 | 
			
		||||
	Log(LOG_INFO, "Connection %d: initialized %s using cipher %s.",
 | 
			
		||||
		c->sock, SSL_get_version(ssl), SSL_get_cipher(ssl));
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef HAVE_LIBGNUTLS
 | 
			
		||||
	gnutls_session_t sess = c->ssl_state.gnutls_session;
 | 
			
		||||
	gnutls_cipher_algorithm_t cipher = gnutls_cipher_get(sess);
 | 
			
		||||
 | 
			
		||||
	Log(LOG_INFO, "New %s connection using cipher %s-%s on socket %d.",
 | 
			
		||||
	Log(LOG_INFO, "Connection %d: initialized %s using cipher %s-%s.",
 | 
			
		||||
	    c->sock,
 | 
			
		||||
	    gnutls_protocol_get_name(gnutls_protocol_get_version(sess)),
 | 
			
		||||
	    gnutls_cipher_get_name(cipher),
 | 
			
		||||
	    gnutls_mac_get_name(gnutls_mac_get(sess)), c->sock);
 | 
			
		||||
	    gnutls_mac_get_name(gnutls_mac_get(sess)));
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -579,11 +673,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;
 | 
			
		||||
	}
 | 
			
		||||
@@ -602,6 +696,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
 | 
			
		||||
@@ -622,8 +790,12 @@ 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);
 | 
			
		||||
 | 
			
		||||
	Conn_StartLogin(CONNECTION2ID(c));
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -711,6 +883,26 @@ 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
 | 
			
		||||
ConnSSL_InitLibrary(void)
 | 
			
		||||
{
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#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-2011 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
 | 
			
		||||
@@ -47,10 +47,6 @@
 | 
			
		||||
# include <netinet/ip.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_STDINT_H
 | 
			
		||||
# include <stdint.h>			/* e.g. for Mac OS X */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef TCPWRAP
 | 
			
		||||
# include <tcpd.h>			/* for TCP Wrappers */
 | 
			
		||||
#endif
 | 
			
		||||
@@ -67,6 +63,7 @@
 | 
			
		||||
#include "client.h"
 | 
			
		||||
#include "class.h"
 | 
			
		||||
#include "conf.h"
 | 
			
		||||
#include "conn-encoding.h"
 | 
			
		||||
#include "conn-ssl.h"
 | 
			
		||||
#include "conn-zip.h"
 | 
			
		||||
#include "conn-func.h"
 | 
			
		||||
@@ -85,10 +82,12 @@
 | 
			
		||||
#define MAX_COMMANDS_SERVER_MIN 10
 | 
			
		||||
#define MAX_COMMANDS_SERVICE 10
 | 
			
		||||
 | 
			
		||||
#define SD_LISTEN_FDS_START 3
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static bool Handle_Write PARAMS(( CONN_ID Idx ));
 | 
			
		||||
static bool Conn_Write PARAMS(( CONN_ID Idx, char *Data, size_t Len ));
 | 
			
		||||
static int New_Connection PARAMS(( int Sock ));
 | 
			
		||||
static int New_Connection PARAMS(( int Sock, bool IsSSL ));
 | 
			
		||||
static CONN_ID Socket2Index PARAMS(( int Sock ));
 | 
			
		||||
static void Read_Request PARAMS(( CONN_ID Idx ));
 | 
			
		||||
static unsigned int Handle_Buffer PARAMS(( CONN_ID Idx ));
 | 
			
		||||
@@ -122,6 +121,42 @@ static void cb_Read_Resolver_Result PARAMS((int sock, UNUSED short what));
 | 
			
		||||
static void cb_Connect_to_Server PARAMS((int sock, UNUSED short what));
 | 
			
		||||
static void cb_clientserver PARAMS((int sock, short what));
 | 
			
		||||
 | 
			
		||||
time_t idle_t = 0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get number of sockets available from systemd(8).
 | 
			
		||||
 *
 | 
			
		||||
 * ngIRCd needs to implement its own sd_listen_fds(3) function and can't
 | 
			
		||||
 * use the one provided by systemd itself, because the sockets will be
 | 
			
		||||
 * used in a forked child process with a new PID, and this would trigger
 | 
			
		||||
 * an error in the standard implementation.
 | 
			
		||||
 *
 | 
			
		||||
 * @return Number of sockets available, -1 if sockets have already been
 | 
			
		||||
 *         initialized, or 0 when no sockets have been passed.
 | 
			
		||||
 */
 | 
			
		||||
static int
 | 
			
		||||
my_sd_listen_fds(void)
 | 
			
		||||
{
 | 
			
		||||
	const char *e;
 | 
			
		||||
	int count;
 | 
			
		||||
 | 
			
		||||
	/* Check if LISTEN_PID exists; but we ignore the result, because
 | 
			
		||||
	 * normally ngircd forks a child before checking this, and therefore
 | 
			
		||||
	 * the PID set in the environment is always wrong ... */
 | 
			
		||||
	e = getenv("LISTEN_PID");
 | 
			
		||||
	if (!e || !*e)
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	e = getenv("LISTEN_FDS");
 | 
			
		||||
	if (!e || !*e)
 | 
			
		||||
		return -1;
 | 
			
		||||
	count = atoi(e);
 | 
			
		||||
	unsetenv("LISTEN_FDS");
 | 
			
		||||
 | 
			
		||||
	return count;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * IO callback for listening sockets: handle new connections. This callback
 | 
			
		||||
@@ -134,7 +169,7 @@ static void
 | 
			
		||||
cb_listen(int sock, short irrelevant)
 | 
			
		||||
{
 | 
			
		||||
	(void) irrelevant;
 | 
			
		||||
	(void) New_Connection(sock);
 | 
			
		||||
	(void) New_Connection(sock, false);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -152,7 +187,7 @@ cb_listen_ssl(int sock, short irrelevant)
 | 
			
		||||
	int fd;
 | 
			
		||||
 | 
			
		||||
	(void) irrelevant;
 | 
			
		||||
	fd = New_Connection(sock);
 | 
			
		||||
	fd = New_Connection(sock, true);
 | 
			
		||||
	if (fd < 0)
 | 
			
		||||
		return;
 | 
			
		||||
	io_event_setcb(My_Connections[fd].sock, cb_clientserver_ssl);
 | 
			
		||||
@@ -187,7 +222,7 @@ cb_connserver(int sock, UNUSED short what)
 | 
			
		||||
	if (server < 0) {
 | 
			
		||||
		Log(LOG_ERR, "Connection on socket %d to \"%s\" aborted!",
 | 
			
		||||
		    sock, My_Connections[idx].host);
 | 
			
		||||
		Conn_Close(idx, "Connection aborted!", NULL, false);
 | 
			
		||||
		Conn_Close(idx, "Connection aborted", NULL, false);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -208,7 +243,7 @@ cb_connserver(int sock, UNUSED short what)
 | 
			
		||||
			    My_Connections[idx].host, Conf_Server[server].port,
 | 
			
		||||
 			    idx, strerror(err));
 | 
			
		||||
 | 
			
		||||
		Conn_Close(idx, "Can't connect!", NULL, false);
 | 
			
		||||
		Conn_Close(idx, "Can't connect", NULL, false);
 | 
			
		||||
 | 
			
		||||
		if (ng_ipaddr_af(&Conf_Server[server].dst_addr[0])) {
 | 
			
		||||
			/* more addresses to try... */
 | 
			
		||||
@@ -285,7 +320,7 @@ cb_connserver_login_ssl(int sock, short unused)
 | 
			
		||||
		return;
 | 
			
		||||
	case -1:
 | 
			
		||||
		Log(LOG_ERR, "SSL connection on socket %d failed!", sock);
 | 
			
		||||
		Conn_Close(idx, "Can't connect!", NULL, false);
 | 
			
		||||
		Conn_Close(idx, "Can't connect", NULL, false);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -332,13 +367,13 @@ cb_clientserver(int sock, short what)
 | 
			
		||||
 | 
			
		||||
#ifdef SSL_SUPPORT
 | 
			
		||||
/**
 | 
			
		||||
 * IO callback for established SSL-enabled client and server connections.
 | 
			
		||||
 * IO callback for new SSL-enabled client and server connections.
 | 
			
		||||
 *
 | 
			
		||||
 * @param sock	Socket descriptor.
 | 
			
		||||
 * @param what	IO specification (IO_WANTREAD/IO_WANTWRITE/...).
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
cb_clientserver_ssl(int sock, short what)
 | 
			
		||||
cb_clientserver_ssl(int sock, UNUSED short what)
 | 
			
		||||
{
 | 
			
		||||
	CONN_ID idx = Socket2Index(sock);
 | 
			
		||||
 | 
			
		||||
@@ -355,14 +390,11 @@ cb_clientserver_ssl(int sock, short what)
 | 
			
		||||
	case 0:
 | 
			
		||||
		return;	/* EAGAIN: callback will be invoked again by IO layer */
 | 
			
		||||
	default:
 | 
			
		||||
		Conn_Close(idx, "SSL accept error, closing socket", "SSL accept error", false);
 | 
			
		||||
		Conn_Close(idx,
 | 
			
		||||
			   "SSL accept error, closing socket", "SSL accept error",
 | 
			
		||||
			   false);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	if (what & IO_WANTREAD)
 | 
			
		||||
		Read_Request(idx);
 | 
			
		||||
 | 
			
		||||
	if (what & IO_WANTWRITE)
 | 
			
		||||
		Handle_Write(idx);
 | 
			
		||||
 | 
			
		||||
	io_event_setcb(sock, cb_clientserver);	/* SSL handshake completed */
 | 
			
		||||
}
 | 
			
		||||
@@ -370,14 +402,13 @@ cb_clientserver_ssl(int sock, short what)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Initialize connecion module.
 | 
			
		||||
 * Initialize connection module.
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Conn_Init( void )
 | 
			
		||||
{
 | 
			
		||||
	CONN_ID i;
 | 
			
		||||
 | 
			
		||||
	/* Speicher fuer Verbindungs-Pool anfordern */
 | 
			
		||||
	Pool_Size = CONNECTION_POOL;
 | 
			
		||||
	if ((Conf_MaxConnections > 0) &&
 | 
			
		||||
		(Pool_Size > Conf_MaxConnections))
 | 
			
		||||
@@ -457,7 +488,7 @@ Conn_CloseAllSockets(int ExceptOf)
 | 
			
		||||
 * @returns		Number of listening sockets created.
 | 
			
		||||
 */
 | 
			
		||||
static unsigned int
 | 
			
		||||
ports_initlisteners(array *a, const char *listen_addr, void (*func)(int,short))
 | 
			
		||||
Init_Listeners(array *a, const char *listen_addr, void (*func)(int,short))
 | 
			
		||||
{
 | 
			
		||||
	unsigned int created = 0;
 | 
			
		||||
	size_t len;
 | 
			
		||||
@@ -473,8 +504,9 @@ ports_initlisteners(array *a, const char *listen_addr, void (*func)(int,short))
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
		if (!io_event_create( fd, IO_WANTREAD, func )) {
 | 
			
		||||
			Log( LOG_ERR, "io_event_create(): Could not add listening fd %d (port %u): %s!",
 | 
			
		||||
						fd, (unsigned int) *port, strerror(errno));
 | 
			
		||||
			Log(LOG_ERR,
 | 
			
		||||
			    "io_event_create(): Can't add fd %d (port %u): %s!",
 | 
			
		||||
			    fd, (unsigned int) *port, strerror(errno));
 | 
			
		||||
			close(fd);
 | 
			
		||||
			port++;
 | 
			
		||||
			continue;
 | 
			
		||||
@@ -496,14 +528,76 @@ Conn_InitListeners( void )
 | 
			
		||||
{
 | 
			
		||||
	/* Initialize ports on which the server should accept connections */
 | 
			
		||||
	unsigned int created = 0;
 | 
			
		||||
	char *copy, *listen_addr;
 | 
			
		||||
	char *af_str, *copy, *listen_addr;
 | 
			
		||||
	int count, fd, i, addr_len;
 | 
			
		||||
	ng_ipaddr_t addr;
 | 
			
		||||
 | 
			
		||||
	assert(Conf_ListenAddress);
 | 
			
		||||
 | 
			
		||||
	count = my_sd_listen_fds();
 | 
			
		||||
	if (count < 0) {
 | 
			
		||||
		Log(LOG_INFO,
 | 
			
		||||
		    "Not re-initializing listening sockets of systemd(8) ...");
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
	if (count > 0) {
 | 
			
		||||
		/* systemd(8) passed sockets to us, so don't try to initialize
 | 
			
		||||
		 * listening sockets on our own but use the passed ones */
 | 
			
		||||
		LogDebug("Initializing %d systemd sockets ...", count);
 | 
			
		||||
		for (i = 0; i < count; i++) {
 | 
			
		||||
			fd = SD_LISTEN_FDS_START + i;
 | 
			
		||||
			addr_len = (int)sizeof(addr);
 | 
			
		||||
			getsockname(fd, (struct sockaddr *)&addr, (socklen_t*)&addr_len);
 | 
			
		||||
#ifdef WANT_IPV6
 | 
			
		||||
			if (addr.sin4.sin_family != AF_INET && addr.sin4.sin_family != AF_INET6)
 | 
			
		||||
#else
 | 
			
		||||
			if (addr.sin4.sin_family != AF_INET)
 | 
			
		||||
#endif
 | 
			
		||||
			{
 | 
			
		||||
				/* Socket is of unsupported type! For example, systemd passed in
 | 
			
		||||
				 * an IPv6 socket but ngIRCd isn't compiled with IPv6 support. */
 | 
			
		||||
				switch (addr.sin4.sin_family)
 | 
			
		||||
				{
 | 
			
		||||
					case AF_UNSPEC: af_str = "AF_UNSPEC"; break;
 | 
			
		||||
					case AF_UNIX: af_str = "AF_UNIX"; break;
 | 
			
		||||
					case AF_INET: af_str = "AF_INET"; break;
 | 
			
		||||
#ifdef AF_INET6
 | 
			
		||||
					case AF_INET6: af_str = "AF_INET6"; break;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef AF_NETLINK
 | 
			
		||||
					case AF_NETLINK: af_str = "AF_NETLINK"; break;
 | 
			
		||||
#endif
 | 
			
		||||
					default: af_str = "unknown"; break;
 | 
			
		||||
				}
 | 
			
		||||
				Log(LOG_CRIT,
 | 
			
		||||
				    "Socket %d is of unsupported type \"%s\" (%d), have to ignore it!",
 | 
			
		||||
				    fd, af_str, addr.sin4.sin_family);
 | 
			
		||||
				close(fd);
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			Init_Socket(fd);
 | 
			
		||||
			if (!io_event_create(fd, IO_WANTREAD, cb_listen)) {
 | 
			
		||||
				Log(LOG_ERR,
 | 
			
		||||
				    "io_event_create(): Can't add fd %d: %s!",
 | 
			
		||||
				    fd, strerror(errno));
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			Log(LOG_INFO,
 | 
			
		||||
			    "Initialized socket %d from systemd(8): %s:%d.", fd,
 | 
			
		||||
			    ng_ipaddr_tostr(&addr), ng_ipaddr_getport(&addr));
 | 
			
		||||
			created++;
 | 
			
		||||
		}
 | 
			
		||||
		return created;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* not using systemd socket activation, initialize listening sockets: */
 | 
			
		||||
 | 
			
		||||
	/* can't use Conf_ListenAddress directly, see below */
 | 
			
		||||
	copy = strdup(Conf_ListenAddress);
 | 
			
		||||
	if (!copy) {
 | 
			
		||||
		Log(LOG_CRIT, "Cannot copy %s: %s", Conf_ListenAddress, strerror(errno));
 | 
			
		||||
		Log(LOG_CRIT, "Cannot copy %s: %s", Conf_ListenAddress,
 | 
			
		||||
		    strerror(errno));
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
	listen_addr = strtok(copy, ",");
 | 
			
		||||
@@ -511,9 +605,11 @@ Conn_InitListeners( void )
 | 
			
		||||
	while (listen_addr) {
 | 
			
		||||
		ngt_TrimStr(listen_addr);
 | 
			
		||||
		if (*listen_addr) {
 | 
			
		||||
			created += ports_initlisteners(&Conf_ListenPorts, listen_addr, cb_listen);
 | 
			
		||||
			created += Init_Listeners(&Conf_ListenPorts,
 | 
			
		||||
						  listen_addr, cb_listen);
 | 
			
		||||
#ifdef SSL_SUPPORT
 | 
			
		||||
			created += ports_initlisteners(&Conf_SSLOptions.ListenPorts, listen_addr, cb_listen_ssl);
 | 
			
		||||
			created += Init_Listeners(&Conf_SSLOptions.ListenPorts,
 | 
			
		||||
						  listen_addr, cb_listen_ssl);
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -540,7 +636,12 @@ Conn_ExitListeners( void )
 | 
			
		||||
	int *fd;
 | 
			
		||||
	size_t arraylen;
 | 
			
		||||
 | 
			
		||||
	/* Get number of listening sockets to shut down. There can be none
 | 
			
		||||
	 * if ngIRCd has been "socket activated" by systemd. */
 | 
			
		||||
	arraylen = array_length(&My_Listeners, sizeof (int));
 | 
			
		||||
	if (arraylen < 1)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	Log(LOG_INFO,
 | 
			
		||||
	    "Shutting down all listening sockets (%d total) ...", arraylen);
 | 
			
		||||
	fd = array_start(&My_Listeners);
 | 
			
		||||
@@ -571,7 +672,7 @@ InitSinaddrListenAddr(ng_ipaddr_t *addr, const char *listen_addrstr, UINT16 Port
 | 
			
		||||
	ret = ng_ipaddr_init(addr, listen_addrstr, Port);
 | 
			
		||||
	if (!ret) {
 | 
			
		||||
		assert(listen_addrstr);
 | 
			
		||||
		Log(LOG_CRIT, "Can't bind to [%s]:%u: can't convert ip address \"%s\"",
 | 
			
		||||
		Log(LOG_CRIT, "Can't bind to [%s]:%u: can't convert ip address \"%s\"!",
 | 
			
		||||
						listen_addrstr, Port, listen_addrstr);
 | 
			
		||||
	}
 | 
			
		||||
	return ret;
 | 
			
		||||
@@ -623,8 +724,9 @@ NewListener(const char *listen_addr, UINT16 Port)
 | 
			
		||||
 | 
			
		||||
	af = ng_ipaddr_af(&addr);
 | 
			
		||||
	sock = socket(af, SOCK_STREAM, 0);
 | 
			
		||||
	if( sock < 0 ) {
 | 
			
		||||
		Log(LOG_CRIT, "Can't create socket (af %d) : %s!", af, strerror(errno));
 | 
			
		||||
	if (sock < 0) {
 | 
			
		||||
		Log(LOG_CRIT, "Can't create socket (af %d) : %s!", af,
 | 
			
		||||
		    strerror(errno));
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -634,22 +736,23 @@ NewListener(const char *listen_addr, UINT16 Port)
 | 
			
		||||
		return -1;
 | 
			
		||||
 | 
			
		||||
	if (bind(sock, (struct sockaddr *)&addr, ng_ipaddr_salen(&addr)) != 0) {
 | 
			
		||||
		Log(LOG_CRIT, "Can't bind socket to address %s:%d - %s",
 | 
			
		||||
			ng_ipaddr_tostr(&addr), Port, strerror(errno));
 | 
			
		||||
		Log(LOG_CRIT, "Can't bind socket to address %s:%d - %s!",
 | 
			
		||||
		    ng_ipaddr_tostr(&addr), Port, strerror(errno));
 | 
			
		||||
		close(sock);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if( listen( sock, 10 ) != 0 ) {
 | 
			
		||||
		Log( LOG_CRIT, "Can't listen on socket: %s!", strerror( errno ));
 | 
			
		||||
		close( sock );
 | 
			
		||||
	if (listen(sock, 10) != 0) {
 | 
			
		||||
		Log(LOG_CRIT, "Can't listen on socket: %s!", strerror(errno));
 | 
			
		||||
		close(sock);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* keep fd in list so we can close it when ngircd restarts/shuts down */
 | 
			
		||||
	if (!array_catb( &My_Listeners,(char*) &sock, sizeof(int) )) {
 | 
			
		||||
		Log( LOG_CRIT, "Can't add socket to My_Listeners array: %s!", strerror( errno ));
 | 
			
		||||
		close( sock );
 | 
			
		||||
	if (!array_catb(&My_Listeners, (char *)&sock, sizeof(int))) {
 | 
			
		||||
		Log(LOG_CRIT, "Can't add socket to My_Listeners array: %s!",
 | 
			
		||||
		    strerror(errno));
 | 
			
		||||
		close(sock);
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -749,8 +852,7 @@ Conn_Handler(void)
 | 
			
		||||
		/* Look for non-empty read buffers ... */
 | 
			
		||||
		for (i = 0; i < Pool_Size; i++) {
 | 
			
		||||
			if ((My_Connections[i].sock > NONE)
 | 
			
		||||
			    && (array_bytes(&My_Connections[i].rbuf) > 0)
 | 
			
		||||
			    && (My_Connections[i].delaytime <= t)) {
 | 
			
		||||
			    && (array_bytes(&My_Connections[i].rbuf) > 0)) {
 | 
			
		||||
				/* ... and try to handle the received data */
 | 
			
		||||
				bytes_processed = Handle_Buffer(i);
 | 
			
		||||
				/* if we processed data, and there might be
 | 
			
		||||
@@ -820,7 +922,7 @@ Conn_Handler(void)
 | 
			
		||||
		 * which is the granularity with witch we handle "penalty
 | 
			
		||||
		 * times" for example.
 | 
			
		||||
		 * Note: tv_sec/usec are undefined(!) after io_dispatch()
 | 
			
		||||
		 * returns, so we have to set it beforce each call to it! */
 | 
			
		||||
		 * returns, so we have to set it before each call to it! */
 | 
			
		||||
		tv.tv_usec = 0;
 | 
			
		||||
		tv.tv_sec = 1;
 | 
			
		||||
 | 
			
		||||
@@ -833,6 +935,15 @@ Conn_Handler(void)
 | 
			
		||||
			    PACKAGE_NAME);
 | 
			
		||||
			exit(1);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* Should ngIRCd timeout when idle? */
 | 
			
		||||
		if (Conf_IdleTimeout > 0 && NumConnectionsAccepted > 0
 | 
			
		||||
		    && idle_t > 0 && time(NULL) - idle_t >= Conf_IdleTimeout) {
 | 
			
		||||
			LogDebug("Server idle timeout reached: %d second%s. Initiating shutdown ...",
 | 
			
		||||
				 Conf_IdleTimeout,
 | 
			
		||||
				 Conf_IdleTimeout == 1 ? "" : "s");
 | 
			
		||||
			NGIRCd_SignalQuit = true;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (NGIRCd_SignalQuit)
 | 
			
		||||
@@ -865,6 +976,9 @@ va_dcl
 | 
			
		||||
#endif
 | 
			
		||||
{
 | 
			
		||||
	char buffer[COMMAND_LEN];
 | 
			
		||||
#ifdef ICONV
 | 
			
		||||
	char *ptr, *message;
 | 
			
		||||
#endif
 | 
			
		||||
	size_t len;
 | 
			
		||||
	bool ok;
 | 
			
		||||
	va_list ap;
 | 
			
		||||
@@ -893,7 +1007,7 @@ va_dcl
 | 
			
		||||
		 *
 | 
			
		||||
		 * So we have a big problem here: we should send more bytes
 | 
			
		||||
		 * to the network than we are allowed to and we don't know
 | 
			
		||||
		 * the originator (any more). The "old" behaviour of blaming
 | 
			
		||||
		 * the originator (any more). The "old" behavior of blaming
 | 
			
		||||
		 * the receiver ("next hop") is a bad idea (it could be just
 | 
			
		||||
		 * an other server only routing the message!), so the only
 | 
			
		||||
		 * option left is to shorten the string and to hope that the
 | 
			
		||||
@@ -905,6 +1019,16 @@ va_dcl
 | 
			
		||||
			CUT_TXTSUFFIX);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#ifdef ICONV
 | 
			
		||||
	ptr = strchr(buffer + 1, ':');
 | 
			
		||||
	if (ptr) {
 | 
			
		||||
		ptr++;
 | 
			
		||||
		message = Conn_EncodingTo(Idx, ptr);
 | 
			
		||||
		if (message != ptr)
 | 
			
		||||
			strlcpy(ptr, message, sizeof(buffer) - (ptr - buffer));
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef SNIFFER
 | 
			
		||||
	if (NGIRCd_Sniffer)
 | 
			
		||||
		Log(LOG_DEBUG, " -> connection %d: '%s'.", Idx, buffer);
 | 
			
		||||
@@ -918,6 +1042,30 @@ va_dcl
 | 
			
		||||
	return ok;
 | 
			
		||||
} /* Conn_WriteStr */
 | 
			
		||||
 | 
			
		||||
GLOBAL char*
 | 
			
		||||
Conn_Password( CONN_ID Idx )
 | 
			
		||||
{
 | 
			
		||||
	assert( Idx > NONE );
 | 
			
		||||
	if (My_Connections[Idx].pwd == NULL)
 | 
			
		||||
		return (char*)"\0";
 | 
			
		||||
	else
 | 
			
		||||
		return My_Connections[Idx].pwd;
 | 
			
		||||
} /* Conn_Password */
 | 
			
		||||
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Conn_SetPassword( CONN_ID Idx, const char *Pwd )
 | 
			
		||||
{
 | 
			
		||||
	assert( Idx > NONE );
 | 
			
		||||
 | 
			
		||||
	if (My_Connections[Idx].pwd)
 | 
			
		||||
		free(My_Connections[Idx].pwd);
 | 
			
		||||
 | 
			
		||||
	My_Connections[Idx].pwd = strdup(Pwd);
 | 
			
		||||
	if (My_Connections[Idx].pwd == NULL) {
 | 
			
		||||
		Log(LOG_EMERG, "Can't allocate memory! [Conn_SetPassword]");
 | 
			
		||||
		exit(1);
 | 
			
		||||
	}
 | 
			
		||||
} /* Conn_SetPassword */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Append Data to the outbound write buffer of a connection.
 | 
			
		||||
@@ -1033,8 +1181,8 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
 | 
			
		||||
	/* Is this link already shutting down? */
 | 
			
		||||
	if( Conn_OPTION_ISSET( &My_Connections[Idx], CONN_ISCLOSING )) {
 | 
			
		||||
		/* Conn_Close() has been called recursively for this link;
 | 
			
		||||
		 * probabe reason: Handle_Write() failed  -- see below. */
 | 
			
		||||
		LogDebug("Recursive request to close connection: %d", Idx );
 | 
			
		||||
		 * probable reason: Handle_Write() failed -- see below. */
 | 
			
		||||
		LogDebug("Recursive request to close connection %d!", Idx );
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -1044,7 +1192,7 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
 | 
			
		||||
	Conn_OPTION_ADD( &My_Connections[Idx], CONN_ISCLOSING );
 | 
			
		||||
 | 
			
		||||
	port = ng_ipaddr_getport(&My_Connections[Idx].addr);
 | 
			
		||||
	Log(LOG_INFO, "Shutting down connection %d (%s) with %s:%d ...", Idx,
 | 
			
		||||
	Log(LOG_INFO, "Shutting down connection %d (%s) with \"%s:%d\" ...", Idx,
 | 
			
		||||
	    LogMsg ? LogMsg : FwdMsg, My_Connections[Idx].host, port);
 | 
			
		||||
 | 
			
		||||
	/* Search client, if any */
 | 
			
		||||
@@ -1080,7 +1228,7 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
 | 
			
		||||
	c = Conn_GetClient( Idx );
 | 
			
		||||
#ifdef SSL_SUPPORT
 | 
			
		||||
	if ( Conn_OPTION_ISSET( &My_Connections[Idx], CONN_SSL )) {
 | 
			
		||||
		Log(LOG_INFO, "SSL connection %d shutting down ...", Idx);
 | 
			
		||||
		LogDebug("SSL connection %d shutting down ...", Idx);
 | 
			
		||||
		ConnSSL_Free(&My_Connections[Idx]);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
@@ -1118,7 +1266,7 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
 | 
			
		||||
		in_p = (int)(( in_k * 100 ) / in_z_k );
 | 
			
		||||
		out_p = (int)(( out_k * 100 ) / out_z_k );
 | 
			
		||||
		Log(LOG_INFO,
 | 
			
		||||
		    "Connection %d with %s:%d closed (in: %.1fk/%.1fk/%d%%, out: %.1fk/%.1fk/%d%%).",
 | 
			
		||||
		    "Connection %d with \"%s:%d\" closed (in: %.1fk/%.1fk/%d%%, out: %.1fk/%.1fk/%d%%).",
 | 
			
		||||
		    Idx, My_Connections[Idx].host, port,
 | 
			
		||||
		    in_k, in_z_k, in_p, out_k, out_z_k, out_p);
 | 
			
		||||
	}
 | 
			
		||||
@@ -1126,7 +1274,7 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
 | 
			
		||||
#endif
 | 
			
		||||
	{
 | 
			
		||||
		Log(LOG_INFO,
 | 
			
		||||
		    "Connection %d with %s:%d closed (in: %.1fk, out: %.1fk).",
 | 
			
		||||
		    "Connection %d with \"%s:%d\" closed (in: %.1fk, out: %.1fk).",
 | 
			
		||||
		    Idx, My_Connections[Idx].host, port,
 | 
			
		||||
		    in_k, out_k);
 | 
			
		||||
	}
 | 
			
		||||
@@ -1146,6 +1294,8 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
 | 
			
		||||
 | 
			
		||||
	array_free(&My_Connections[Idx].rbuf);
 | 
			
		||||
	array_free(&My_Connections[Idx].wbuf);
 | 
			
		||||
	if (My_Connections[Idx].pwd != NULL)
 | 
			
		||||
		free(My_Connections[Idx].pwd);
 | 
			
		||||
 | 
			
		||||
	/* Clean up connection structure (=free it) */
 | 
			
		||||
	Init_Conn_Struct( Idx );
 | 
			
		||||
@@ -1155,6 +1305,8 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
 | 
			
		||||
		NumConnections--;
 | 
			
		||||
	LogDebug("Shutdown of connection %d completed, %ld connection%s left.",
 | 
			
		||||
		 Idx, NumConnections, NumConnections != 1 ? "s" : "");
 | 
			
		||||
 | 
			
		||||
	idle_t = NumConnections > 0 ? 0 : time(NULL);
 | 
			
		||||
} /* Conn_Close */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -1298,9 +1450,14 @@ Handle_Write( CONN_ID Idx )
 | 
			
		||||
		if (errno == EAGAIN || errno == EINTR)
 | 
			
		||||
			return true;
 | 
			
		||||
 | 
			
		||||
		Log(LOG_ERR, "Write error on connection %d (socket %d): %s!",
 | 
			
		||||
		    Idx, My_Connections[Idx].sock, strerror(errno));
 | 
			
		||||
		Conn_Close(Idx, "Write error!", NULL, false);
 | 
			
		||||
		if (!Conn_OPTION_ISSET(&My_Connections[Idx], CONN_ISCLOSING))
 | 
			
		||||
			Log(LOG_ERR,
 | 
			
		||||
			    "Write error on connection %d (socket %d): %s!",
 | 
			
		||||
			    Idx, My_Connections[Idx].sock, strerror(errno));
 | 
			
		||||
		else
 | 
			
		||||
			LogDebug("Recursive write error on connection %d (socket %d): %s!",
 | 
			
		||||
				 Idx, My_Connections[Idx].sock, strerror(errno));
 | 
			
		||||
		Conn_Close(Idx, "Write error", NULL, false);
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -1336,17 +1493,18 @@ Count_Connections(ng_ipaddr_t *a)
 | 
			
		||||
 * Initialize new client connection on a listening socket.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Sock	Listening socket descriptor.
 | 
			
		||||
 * @param IsSSL	true if this socket expects SSL-encrypted data.
 | 
			
		||||
 * @returns	Accepted socket descriptor or -1 on error.
 | 
			
		||||
 */
 | 
			
		||||
static int
 | 
			
		||||
New_Connection(int Sock)
 | 
			
		||||
New_Connection(int Sock, UNUSED bool IsSSL)
 | 
			
		||||
{
 | 
			
		||||
#ifdef TCPWRAP
 | 
			
		||||
	struct request_info req;
 | 
			
		||||
#endif
 | 
			
		||||
	ng_ipaddr_t new_addr;
 | 
			
		||||
	char ip_str[NG_INET_ADDRSTRLEN];
 | 
			
		||||
	int new_sock, new_sock_len, identsock;
 | 
			
		||||
	int new_sock, new_sock_len;
 | 
			
		||||
	CLIENT *c;
 | 
			
		||||
	long cnt;
 | 
			
		||||
 | 
			
		||||
@@ -1463,35 +1621,65 @@ New_Connection(int Sock)
 | 
			
		||||
 | 
			
		||||
	Client_SetHostname(c, My_Connections[new_sock].host);
 | 
			
		||||
 | 
			
		||||
	Log(LOG_INFO, "Accepted connection %d from %s:%d on socket %d.",
 | 
			
		||||
	Log(LOG_INFO, "Accepted connection %d from \"%s:%d\" on socket %d.",
 | 
			
		||||
	    new_sock, My_Connections[new_sock].host,
 | 
			
		||||
	    ng_ipaddr_getport(&new_addr), Sock);
 | 
			
		||||
 | 
			
		||||
	identsock = new_sock;
 | 
			
		||||
#ifdef IDENTAUTH
 | 
			
		||||
	if (!Conf_Ident)
 | 
			
		||||
		identsock = -1;
 | 
			
		||||
#endif
 | 
			
		||||
	if (Conf_DNS) {
 | 
			
		||||
		if (Conf_NoticeAuth) {
 | 
			
		||||
#ifdef IDENTAUTH
 | 
			
		||||
			if (Conf_Ident)
 | 
			
		||||
				(void)Conn_WriteStr(new_sock,
 | 
			
		||||
					"NOTICE AUTH :*** Looking up your hostname and checking ident");
 | 
			
		||||
			else
 | 
			
		||||
#endif
 | 
			
		||||
				(void)Conn_WriteStr(new_sock,
 | 
			
		||||
					"NOTICE AUTH :*** Looking up your hostname");
 | 
			
		||||
		}
 | 
			
		||||
		Resolve_Addr(&My_Connections[new_sock].proc_stat, &new_addr,
 | 
			
		||||
			     identsock, cb_Read_Resolver_Result);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Account_Connection();
 | 
			
		||||
 | 
			
		||||
#ifdef SSL_SUPPORT
 | 
			
		||||
	/* Delay connection initalization until SSL handshake is finished */
 | 
			
		||||
	if (!IsSSL)
 | 
			
		||||
#endif
 | 
			
		||||
		Conn_StartLogin(new_sock);
 | 
			
		||||
 | 
			
		||||
	return new_sock;
 | 
			
		||||
} /* New_Connection */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Finish connection initialization, start resolver subprocess.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Idx Connection index.
 | 
			
		||||
 */
 | 
			
		||||
GLOBAL void
 | 
			
		||||
Conn_StartLogin(CONN_ID Idx)
 | 
			
		||||
{
 | 
			
		||||
	int ident_sock = -1;
 | 
			
		||||
 | 
			
		||||
	assert(Idx >= 0);
 | 
			
		||||
 | 
			
		||||
	/* Nothing to do if DNS (and resolver subprocess) is disabled */
 | 
			
		||||
	if (!Conf_DNS)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
#ifdef IDENTAUTH
 | 
			
		||||
	/* Should we make an IDENT request? */
 | 
			
		||||
	if (Conf_Ident)
 | 
			
		||||
		ident_sock = My_Connections[Idx].sock;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (Conf_NoticeAuth) {
 | 
			
		||||
		/* Send "NOTICE AUTH" messages to the client */
 | 
			
		||||
#ifdef IDENTAUTH
 | 
			
		||||
		if (Conf_Ident)
 | 
			
		||||
			(void)Conn_WriteStr(Idx,
 | 
			
		||||
				"NOTICE AUTH :*** Looking up your hostname and checking ident");
 | 
			
		||||
		else
 | 
			
		||||
#endif
 | 
			
		||||
			(void)Conn_WriteStr(Idx,
 | 
			
		||||
				"NOTICE AUTH :*** Looking up your hostname");
 | 
			
		||||
		/* Send buffered data to the client, but break on errors
 | 
			
		||||
		 * because Handle_Write() would have closed the connection
 | 
			
		||||
		 * again in this case! */
 | 
			
		||||
		if (!Handle_Write(Idx))
 | 
			
		||||
			return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	Resolve_Addr(&My_Connections[Idx].proc_stat, &My_Connections[Idx].addr,
 | 
			
		||||
		     ident_sock, cb_Read_Resolver_Result);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Update global connection counters.
 | 
			
		||||
 */
 | 
			
		||||
@@ -1499,6 +1687,7 @@ static void
 | 
			
		||||
Account_Connection(void)
 | 
			
		||||
{
 | 
			
		||||
	NumConnections++;
 | 
			
		||||
	idle_t = 0;
 | 
			
		||||
	if (NumConnections > NumConnectionsMax)
 | 
			
		||||
		NumConnectionsMax = NumConnections;
 | 
			
		||||
	LogDebug("Total number of connections now %lu (max %lu).",
 | 
			
		||||
@@ -1528,7 +1717,7 @@ Socket2Index( int Sock )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Read data from the network to the read buffer. If an error occures,
 | 
			
		||||
 * Read data from the network to the read buffer. If an error occurs,
 | 
			
		||||
 * the socket of this connection will be shut down.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Idx	Connection index.
 | 
			
		||||
@@ -1566,13 +1755,10 @@ Read_Request( CONN_ID Idx )
 | 
			
		||||
#endif
 | 
			
		||||
	len = read(My_Connections[Idx].sock, readbuf, sizeof(readbuf));
 | 
			
		||||
	if (len == 0) {
 | 
			
		||||
		Log(LOG_INFO, "%s:%u (%s) is closing the connection ...",
 | 
			
		||||
				My_Connections[Idx].host,
 | 
			
		||||
				(unsigned int) ng_ipaddr_getport(&My_Connections[Idx].addr),
 | 
			
		||||
				ng_ipaddr_tostr(&My_Connections[Idx].addr));
 | 
			
		||||
		Conn_Close(Idx,
 | 
			
		||||
			   "Socket closed!", "Client closed connection",
 | 
			
		||||
			   false);
 | 
			
		||||
		LogDebug("Client \"%s:%u\" is closing connection %d ...",
 | 
			
		||||
			 My_Connections[Idx].host,
 | 
			
		||||
			 ng_ipaddr_tostr(&My_Connections[Idx].addr), Idx);
 | 
			
		||||
		Conn_Close(Idx, NULL, "Client closed connection", false);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -1580,7 +1766,7 @@ Read_Request( CONN_ID Idx )
 | 
			
		||||
		if( errno == EAGAIN ) return;
 | 
			
		||||
		Log(LOG_ERR, "Read error on connection %d (socket %d): %s!",
 | 
			
		||||
		    Idx, My_Connections[Idx].sock, strerror(errno));
 | 
			
		||||
		Conn_Close(Idx, "Read error!", "Client closed connection",
 | 
			
		||||
		Conn_Close(Idx, "Read error", "Client closed connection",
 | 
			
		||||
			   false);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
@@ -1589,7 +1775,7 @@ Read_Request( CONN_ID Idx )
 | 
			
		||||
		if (!array_catb(&My_Connections[Idx].zip.rbuf, readbuf,
 | 
			
		||||
				(size_t) len)) {
 | 
			
		||||
			Log(LOG_ERR,
 | 
			
		||||
			    "Could not append recieved data to zip input buffer (connection %d): %d bytes!",
 | 
			
		||||
			    "Could not append received data to zip input buffer (connection %d): %d bytes!",
 | 
			
		||||
			    Idx, len);
 | 
			
		||||
			Conn_Close(Idx, "Receive buffer space exhausted", NULL,
 | 
			
		||||
				   false);
 | 
			
		||||
@@ -1600,7 +1786,7 @@ Read_Request( CONN_ID Idx )
 | 
			
		||||
	{
 | 
			
		||||
		if (!array_catb( &My_Connections[Idx].rbuf, readbuf, len)) {
 | 
			
		||||
			Log(LOG_ERR,
 | 
			
		||||
			    "Could not append recieved data to input buffer (connection %d): %d bytes!",
 | 
			
		||||
			    "Could not append received data to input buffer (connection %d): %d bytes!",
 | 
			
		||||
			    Idx, len);
 | 
			
		||||
			Conn_Close(Idx, "Receive buffer space exhausted", NULL, false );
 | 
			
		||||
		}
 | 
			
		||||
@@ -1680,7 +1866,7 @@ Handle_Buffer(CONN_ID Idx)
 | 
			
		||||
		maxcmd = (int)(Client_UserCount() / 5)
 | 
			
		||||
		       + MAX_COMMANDS_SERVER_MIN;
 | 
			
		||||
		/* Allow servers to handle even more commands while peering
 | 
			
		||||
		 * to speed up server login and network synchronisation. */
 | 
			
		||||
		 * to speed up server login and network synchronization. */
 | 
			
		||||
		if (Conn_LastPing(Idx) == 0)
 | 
			
		||||
			maxcmd *= 5;
 | 
			
		||||
		break;
 | 
			
		||||
@@ -1839,10 +2025,10 @@ Check_Connections(void)
 | 
			
		||||
				if (My_Connections[i].lastping <
 | 
			
		||||
				    time(NULL) - Conf_PongTimeout) {
 | 
			
		||||
					/* Timeout */
 | 
			
		||||
					LogDebug
 | 
			
		||||
					    ("Connection %d: Ping timeout: %d seconds.",
 | 
			
		||||
					     i, Conf_PongTimeout);
 | 
			
		||||
					snprintf(msg, sizeof(msg), "Ping timeout: %d seconds", Conf_PongTimeout);
 | 
			
		||||
					snprintf(msg, sizeof(msg),
 | 
			
		||||
						 "Ping timeout: %d seconds",
 | 
			
		||||
						 Conf_PongTimeout);
 | 
			
		||||
					LogDebug("Connection %d: %s.", i, msg);
 | 
			
		||||
					Conn_Close(i, NULL, msg, true);
 | 
			
		||||
				}
 | 
			
		||||
			} else if (My_Connections[i].lastdata <
 | 
			
		||||
@@ -1935,8 +2121,17 @@ New_Server( int Server , ng_ipaddr_t *dest)
 | 
			
		||||
 | 
			
		||||
	assert( Server > NONE );
 | 
			
		||||
 | 
			
		||||
	/* Make sure that the remote server hasn't re-linked to this server
 | 
			
		||||
	 * asynchronously on its own */
 | 
			
		||||
	if (Conf_Server[Server].conn_id > NONE) {
 | 
			
		||||
		Log(LOG_INFO,
 | 
			
		||||
			"Connection to \"%s\" meanwhile re-established, aborting preparation.");
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!ng_ipaddr_tostr_r(dest, ip_str)) {
 | 
			
		||||
		Log(LOG_WARNING, "New_Server: Could not convert IP to string");
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -1951,11 +2146,14 @@ New_Server( int Server , ng_ipaddr_t *dest)
 | 
			
		||||
	if (new_sock < 0) {
 | 
			
		||||
		Log(LOG_CRIT, "Can't create socket (af %d): %s!",
 | 
			
		||||
		    af_dest, strerror(errno));
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!Init_Socket(new_sock))
 | 
			
		||||
	if (!Init_Socket(new_sock)) {
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* is a bind address configured? */
 | 
			
		||||
	res = ng_ipaddr_af(&Conf_Server[Server].bind_addr);
 | 
			
		||||
@@ -1971,6 +2169,7 @@ New_Server( int Server , ng_ipaddr_t *dest)
 | 
			
		||||
	if(( res != 0 ) && ( errno != EINPROGRESS )) {
 | 
			
		||||
		Log( LOG_CRIT, "Can't connect socket: %s!", strerror( errno ));
 | 
			
		||||
		close( new_sock );
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -1979,12 +2178,14 @@ New_Server( int Server , ng_ipaddr_t *dest)
 | 
			
		||||
		    "Cannot allocate memory for server connection (socket %d)",
 | 
			
		||||
		    new_sock);
 | 
			
		||||
		close( new_sock );
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!io_event_create( new_sock, IO_WANTWRITE, cb_connserver)) {
 | 
			
		||||
		Log(LOG_ALERT, "io_event_create(): could not add fd %d", strerror(errno));
 | 
			
		||||
		close(new_sock);
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -1999,6 +2200,7 @@ New_Server( int Server , ng_ipaddr_t *dest)
 | 
			
		||||
	if (!c) {
 | 
			
		||||
		Log( LOG_ALERT, "Can't establish connection: can't create client structure!" );
 | 
			
		||||
		io_close(new_sock);
 | 
			
		||||
		Conf_Server[Server].conn_id = NONE;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -2008,7 +2210,8 @@ New_Server( int Server , ng_ipaddr_t *dest)
 | 
			
		||||
	Client_SetToken( c, TOKEN_OUTBOUND );
 | 
			
		||||
 | 
			
		||||
	/* Register connection */
 | 
			
		||||
	Conf_Server[Server].conn_id = new_sock;
 | 
			
		||||
	if (!Conf_SetServer(Server, new_sock))
 | 
			
		||||
		return;
 | 
			
		||||
	My_Connections[new_sock].sock = new_sock;
 | 
			
		||||
	My_Connections[new_sock].addr = *dest;
 | 
			
		||||
	My_Connections[new_sock].client = c;
 | 
			
		||||
@@ -2048,6 +2251,11 @@ Init_Conn_Struct(CONN_ID Idx)
 | 
			
		||||
	My_Connections[Idx].lastdata = now;
 | 
			
		||||
	My_Connections[Idx].lastprivmsg = now;
 | 
			
		||||
	Proc_InitStruct(&My_Connections[Idx].proc_stat);
 | 
			
		||||
 | 
			
		||||
#ifdef ICONV
 | 
			
		||||
	My_Connections[Idx].iconv_from = (iconv_t)(-1);
 | 
			
		||||
	My_Connections[Idx].iconv_to = (iconv_t)(-1);
 | 
			
		||||
#endif
 | 
			
		||||
} /* Init_Conn_Struct */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -2160,7 +2368,7 @@ cb_Connect_to_Server(int fd, UNUSED short events)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Read results of a resolver sub-process from the pipe and update the
 | 
			
		||||
 * apropriate connection/client structure(s): hostname and/or IDENT user name.
 | 
			
		||||
 * appropriate connection/client structure(s): hostname and/or IDENT user name.
 | 
			
		||||
 *
 | 
			
		||||
 * @param r_fd		File descriptor of the pipe to the sub-process.
 | 
			
		||||
 * @param events	(ignored IO specification)
 | 
			
		||||
@@ -2174,6 +2382,7 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
 | 
			
		||||
	char *identptr;
 | 
			
		||||
#ifdef IDENTAUTH
 | 
			
		||||
	char readbuf[HOST_LEN + 2 + CLIENT_USER_LEN];
 | 
			
		||||
	char *ptr;
 | 
			
		||||
#else
 | 
			
		||||
	char readbuf[HOST_LEN + 1];
 | 
			
		||||
#endif
 | 
			
		||||
@@ -2222,26 +2431,58 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
 | 
			
		||||
		Client_SetHostname(c, readbuf);
 | 
			
		||||
		if (Conf_NoticeAuth)
 | 
			
		||||
			(void)Conn_WriteStr(i,
 | 
			
		||||
					"NOTICE AUTH :*** Found your hostname");
 | 
			
		||||
					"NOTICE AUTH :*** Found your hostname: %s",
 | 
			
		||||
					My_Connections[i].host);
 | 
			
		||||
#ifdef IDENTAUTH
 | 
			
		||||
		++identptr;
 | 
			
		||||
		if (*identptr) {
 | 
			
		||||
			Log(LOG_INFO, "IDENT lookup for connection %d: \"%s\".", i, identptr);
 | 
			
		||||
			Client_SetUser(c, identptr, true);
 | 
			
		||||
			if (Conf_NoticeAuth)
 | 
			
		||||
			ptr = identptr;
 | 
			
		||||
			while (*ptr) {
 | 
			
		||||
				if ((*ptr < '0' || *ptr > '9') &&
 | 
			
		||||
				    (*ptr < 'A' || *ptr > 'Z') &&
 | 
			
		||||
				    (*ptr < 'a' || *ptr > 'z'))
 | 
			
		||||
					break;
 | 
			
		||||
				ptr++;
 | 
			
		||||
			}
 | 
			
		||||
			if (*ptr) {
 | 
			
		||||
				/* Erroneous IDENT reply */
 | 
			
		||||
				Log(LOG_NOTICE,
 | 
			
		||||
				    "Got invalid IDENT reply for connection %d! Ignored.",
 | 
			
		||||
				    i);
 | 
			
		||||
			} else {
 | 
			
		||||
				Log(LOG_INFO,
 | 
			
		||||
				    "IDENT lookup for connection %d: \"%s\".",
 | 
			
		||||
				    i, identptr);
 | 
			
		||||
				Client_SetUser(c, identptr, true);
 | 
			
		||||
			}
 | 
			
		||||
			if (Conf_NoticeAuth) {
 | 
			
		||||
				(void)Conn_WriteStr(i,
 | 
			
		||||
					"NOTICE AUTH :*** Got ident response");
 | 
			
		||||
		} else {
 | 
			
		||||
					"NOTICE AUTH :*** Got %sident response%s%s",
 | 
			
		||||
					*ptr ? "invalid " : "",
 | 
			
		||||
					*ptr ? "" : ": ",
 | 
			
		||||
					*ptr ? "" : identptr);
 | 
			
		||||
			}
 | 
			
		||||
		} else if(Conf_Ident) {
 | 
			
		||||
			Log(LOG_INFO, "IDENT lookup for connection %d: no result.", i);
 | 
			
		||||
			if (Conf_NoticeAuth && Conf_Ident)
 | 
			
		||||
			if (Conf_NoticeAuth)
 | 
			
		||||
				(void)Conn_WriteStr(i,
 | 
			
		||||
					"NOTICE AUTH :*** No ident response");
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		if (Conf_NoticeAuth) {
 | 
			
		||||
			/* Send buffered data to the client, but break on
 | 
			
		||||
			 * errors because Handle_Write() would have closed
 | 
			
		||||
			 * the connection again in this case! */
 | 
			
		||||
			if (!Handle_Write(i))
 | 
			
		||||
				return;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		Class_HandleServerBans(c);
 | 
			
		||||
	}
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		else Log( LOG_DEBUG, "Resolver: discarding result for already registered connection %d.", i );
 | 
			
		||||
	else
 | 
			
		||||
		LogDebug("Resolver: discarding result for already registered connection %d.", i);
 | 
			
		||||
#endif
 | 
			
		||||
} /* cb_Read_Resolver_Result */
 | 
			
		||||
 | 
			
		||||
@@ -2360,7 +2601,7 @@ Conn_SetAuthPing(CONN_ID Idx, long ID)
 | 
			
		||||
#ifdef SSL_SUPPORT
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get information about used SSL chiper.
 | 
			
		||||
 * Get information about used SSL cipher.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Idx	Connection index number.
 | 
			
		||||
 * @param buf	Buffer for returned information text.
 | 
			
		||||
@@ -2392,6 +2633,45 @@ Conn_UsesSSL(CONN_ID Idx)
 | 
			
		||||
	return Conn_OPTION_ISSET(&My_Connections[Idx], CONN_SSL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GLOBAL char *
 | 
			
		||||
Conn_GetCertFp(CONN_ID Idx)
 | 
			
		||||
{
 | 
			
		||||
	if (Idx < 0)
 | 
			
		||||
		return NULL;
 | 
			
		||||
	assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION)));
 | 
			
		||||
	return ConnSSL_GetCertFp(&My_Connections[Idx]);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GLOBAL bool
 | 
			
		||||
Conn_SetCertFp(CONN_ID Idx, const char *fingerprint)
 | 
			
		||||
{
 | 
			
		||||
	if (Idx < 0)
 | 
			
		||||
		return false;
 | 
			
		||||
	assert(Idx < (int) array_length(&My_ConnArray, sizeof(CONNECTION)));
 | 
			
		||||
	return ConnSSL_SetCertFp(&My_Connections[Idx], fingerprint);
 | 
			
		||||
}
 | 
			
		||||
#else
 | 
			
		||||
GLOBAL bool
 | 
			
		||||
Conn_UsesSSL(UNUSED CONN_ID Idx)
 | 
			
		||||
{
 | 
			
		||||
	return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GLOBAL char *
 | 
			
		||||
Conn_GetCertFp(UNUSED CONN_ID Idx)
 | 
			
		||||
{
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GLOBAL bool
 | 
			
		||||
Conn_SetCertFp(UNUSED CONN_ID Idx, UNUSED const char *fingerprint)
 | 
			
		||||
{
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@
 | 
			
		||||
#define CONN_SSL_WANT_READ	128	/* SSL/TLS library needs to read protocol data */
 | 
			
		||||
#define CONN_SSL_FLAGS_ALL	(CONN_SSL_CONNECT|CONN_SSL|CONN_SSL_WANT_WRITE|CONN_SSL_WANT_READ)
 | 
			
		||||
#endif
 | 
			
		||||
typedef long CONN_ID;
 | 
			
		||||
typedef int CONN_ID;
 | 
			
		||||
 | 
			
		||||
#include "client.h"
 | 
			
		||||
#include "proc.h"
 | 
			
		||||
@@ -54,6 +54,10 @@ typedef long CONN_ID;
 | 
			
		||||
#include "tool.h"
 | 
			
		||||
#include "ng_ipaddr.h"
 | 
			
		||||
 | 
			
		||||
#ifdef ICONV
 | 
			
		||||
# include <iconv.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef ZLIB
 | 
			
		||||
#include <zlib.h>
 | 
			
		||||
typedef struct _ZipData
 | 
			
		||||
@@ -72,6 +76,7 @@ typedef struct _Connection
 | 
			
		||||
	ng_ipaddr_t addr;		/* Client address */
 | 
			
		||||
	PROC_STAT proc_stat;		/* Status of resolver process */
 | 
			
		||||
	char host[HOST_LEN];		/* Hostname */
 | 
			
		||||
	char *pwd;			/* password received of the client */
 | 
			
		||||
	array rbuf;			/* Read buffer */
 | 
			
		||||
	array wbuf;			/* Write buffer */
 | 
			
		||||
	time_t signon;			/* Signon ("connect") time */
 | 
			
		||||
@@ -94,12 +99,18 @@ typedef struct _Connection
 | 
			
		||||
#ifndef STRICT_RFC
 | 
			
		||||
	long auth_ping;			/** PING response expected on login */
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef ICONV
 | 
			
		||||
	iconv_t iconv_from;		/** iconv: convert from client to server */
 | 
			
		||||
	iconv_t iconv_to;		/** iconv: convert from server to client */
 | 
			
		||||
#endif
 | 
			
		||||
} CONNECTION;
 | 
			
		||||
 | 
			
		||||
GLOBAL CONNECTION *My_Connections;
 | 
			
		||||
GLOBAL CONN_ID Pool_Size;
 | 
			
		||||
GLOBAL long WCounter;
 | 
			
		||||
 | 
			
		||||
#define CONNECTION2ID(x) (long)(x - My_Connections)
 | 
			
		||||
 | 
			
		||||
#endif /* CONN_MODULE */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -111,10 +122,15 @@ GLOBAL void Conn_CloseAllSockets PARAMS((int ExceptOf));
 | 
			
		||||
GLOBAL unsigned int Conn_InitListeners PARAMS(( void ));
 | 
			
		||||
GLOBAL void Conn_ExitListeners PARAMS(( void ));
 | 
			
		||||
 | 
			
		||||
GLOBAL void Conn_StartLogin PARAMS((CONN_ID Idx));
 | 
			
		||||
 | 
			
		||||
GLOBAL void Conn_Handler PARAMS(( void ));
 | 
			
		||||
 | 
			
		||||
GLOBAL bool Conn_WriteStr PARAMS(( CONN_ID Idx, const char *Format, ... ));
 | 
			
		||||
 | 
			
		||||
GLOBAL char* Conn_Password PARAMS(( CONN_ID Idx ));
 | 
			
		||||
GLOBAL void Conn_SetPassword PARAMS(( CONN_ID Idx, const char *Pwd ));
 | 
			
		||||
 | 
			
		||||
GLOBAL void Conn_Close PARAMS(( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClient ));
 | 
			
		||||
 | 
			
		||||
GLOBAL void Conn_SyncServerStruct PARAMS(( void ));
 | 
			
		||||
@@ -122,13 +138,13 @@ GLOBAL void Conn_SyncServerStruct PARAMS(( void ));
 | 
			
		||||
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-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
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -44,9 +44,11 @@
 | 
			
		||||
/** Max. length of file name. */
 | 
			
		||||
#define FNAME_LEN 256
 | 
			
		||||
 | 
			
		||||
/** Max. lenght of fully qualified host names (e. g. "abc.domain.tld"). */
 | 
			
		||||
/** Max. length of fully qualified host names (e. g. "abc.domain.tld"). */
 | 
			
		||||
#define HOST_LEN 256
 | 
			
		||||
 | 
			
		||||
/** Max. length of random salt */
 | 
			
		||||
#define RANDOM_SALT_LEN 32
 | 
			
		||||
 | 
			
		||||
/* Size of structures */
 | 
			
		||||
 | 
			
		||||
@@ -71,9 +73,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 ""
 | 
			
		||||
 | 
			
		||||
@@ -89,14 +97,18 @@
 | 
			
		||||
/** Default nick length (including NULL), see. RFC 2812 section 1.2.1. */
 | 
			
		||||
#define CLIENT_NICK_LEN_DEFAULT 10
 | 
			
		||||
 | 
			
		||||
/** Maximum nick name length (including NULL). */
 | 
			
		||||
/** Maximum nickname length (including NULL). */
 | 
			
		||||
#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. */
 | 
			
		||||
#define CLIENT_USER_LEN 10
 | 
			
		||||
#ifndef STRICT_RFC
 | 
			
		||||
# define CLIENT_USER_LEN 20
 | 
			
		||||
#else
 | 
			
		||||
# define CLIENT_USER_LEN 10
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/** Max. length of "real names" (including NULL). */
 | 
			
		||||
#define CLIENT_NAME_LEN 32
 | 
			
		||||
@@ -104,8 +116,11 @@
 | 
			
		||||
/** 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 16
 | 
			
		||||
#define CLIENT_MODE_LEN 21
 | 
			
		||||
 | 
			
		||||
/** Max. length of server info texts (including NULL). */
 | 
			
		||||
#define CLIENT_INFO_LEN 64
 | 
			
		||||
@@ -120,7 +135,7 @@
 | 
			
		||||
#define CHANNEL_NAME_LEN 51
 | 
			
		||||
 | 
			
		||||
/** Max. length of channel modes (including NULL). */
 | 
			
		||||
#define CHANNEL_MODE_LEN 9
 | 
			
		||||
#define CHANNEL_MODE_LEN 21
 | 
			
		||||
 | 
			
		||||
/** Max. IRC command length (including NULL), see. RFC 2812 section 3.2. */
 | 
			
		||||
#define COMMAND_LEN 513
 | 
			
		||||
@@ -154,14 +169,17 @@
 | 
			
		||||
 | 
			
		||||
#ifdef IRCPLUS
 | 
			
		||||
/** Standard IRC+ flags. */
 | 
			
		||||
# define IRCPLUSFLAGS "CHLS"
 | 
			
		||||
# define IRCPLUSFLAGS "CHLMSX"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/** Supported user modes. */
 | 
			
		||||
#define USERMODES "acCiorRswx"
 | 
			
		||||
#define USERMODES "abBcCioqrRswx"
 | 
			
		||||
 | 
			
		||||
/** Supported channel modes. */
 | 
			
		||||
#define CHANMODES "beiIklmnoOPRstvz"
 | 
			
		||||
#define CHANMODES "abehiIklmMnoOPqQrRstvVz"
 | 
			
		||||
 | 
			
		||||
/** Supported channel types. */
 | 
			
		||||
#define CHANTYPES "#&+"
 | 
			
		||||
 | 
			
		||||
/** Away message for users connected to linked servers. */
 | 
			
		||||
#define DEFAULT_AWAY_MSG "Away"
 | 
			
		||||
@@ -178,9 +196,6 @@
 | 
			
		||||
 | 
			
		||||
/* Defaults and limits for IRC commands */
 | 
			
		||||
 | 
			
		||||
/** Max. number of LIST replies. */
 | 
			
		||||
#define MAX_RPL_LIST 100
 | 
			
		||||
 | 
			
		||||
/** Max. number of elemets allowed in channel invite and ban lists. */
 | 
			
		||||
#define MAX_HNDL_CHANNEL_LISTS 50
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -37,7 +37,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),
 | 
			
		||||
 
 | 
			
		||||
@@ -86,6 +86,20 @@ static int io_masterfd;
 | 
			
		||||
 | 
			
		||||
static int io_dispatch_kqueue(struct timeval *tv);
 | 
			
		||||
static bool io_event_change_kqueue(int, short, const int action);
 | 
			
		||||
 | 
			
		||||
#ifndef EV_SET
 | 
			
		||||
/* Taken from /usr/include/sys/event.h of FreeBSD 8.1 and required by all
 | 
			
		||||
 * platforms that have kqueue but lack EV_SET() -- for example FreeBSD 4. */
 | 
			
		||||
#define EV_SET(kevp, a, b, c, d, e, f) do {	\
 | 
			
		||||
	struct kevent *__kevp__ = (kevp);	\
 | 
			
		||||
	__kevp__->ident = (a);			\
 | 
			
		||||
	__kevp__->filter = (b);			\
 | 
			
		||||
	__kevp__->flags = (c);			\
 | 
			
		||||
	__kevp__->fflags = (d);			\
 | 
			
		||||
	__kevp__->data = (e);			\
 | 
			
		||||
	__kevp__->udata = (f);			\
 | 
			
		||||
} while(0)
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef IO_USE_POLL
 | 
			
		||||
@@ -617,7 +631,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;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										279
									
								
								src/ngircd/irc-cap.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										279
									
								
								src/ngircd/irc-cap.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,279 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * 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
 | 
			
		||||
 * 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"
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * Handler for IRC capability ("CAP") commands
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "imp.h"
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include "defines.h"
 | 
			
		||||
#include "conn.h"
 | 
			
		||||
#include "channel.h"
 | 
			
		||||
#include "client-cap.h"
 | 
			
		||||
#include "irc-macros.h"
 | 
			
		||||
#include "irc-write.h"
 | 
			
		||||
#include "log.h"
 | 
			
		||||
#include "login.h"
 | 
			
		||||
#include "messages.h"
 | 
			
		||||
#include "parse.h"
 | 
			
		||||
 | 
			
		||||
#include "exp.h"
 | 
			
		||||
#include "irc-cap.h"
 | 
			
		||||
 | 
			
		||||
/* Local functions */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Set CAP negotiation status and mark client as "supports capabilities".
 | 
			
		||||
 *
 | 
			
		||||
 * @param Client The client to handle.
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
Set_CAP_Negotiation(CLIENT *Client)
 | 
			
		||||
{
 | 
			
		||||
	assert(Client != NULL);
 | 
			
		||||
 | 
			
		||||
	if (Client_Type(Client) != CLIENT_USER)
 | 
			
		||||
		Client_CapAdd(Client, CLIENT_CAP_PENDING);
 | 
			
		||||
	Client_CapAdd(Client, CLIENT_CAP_SUPPORTED);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Parse capability string and return numeric flag value.
 | 
			
		||||
 *
 | 
			
		||||
 * @param Args The string containing space-separated capability names.
 | 
			
		||||
 * @return Changed capability flags or 0 on error.
 | 
			
		||||
 */
 | 
			
		||||
static int
 | 
			
		||||
Parse_CAP(int Capabilities, char *Args)
 | 
			
		||||
{
 | 
			
		||||
	static char tmp[COMMAND_LEN];
 | 
			
		||||
	char *ptr;
 | 
			
		||||
 | 
			
		||||
	assert(Args != NULL);
 | 
			
		||||
 | 
			
		||||
	strlcpy(tmp, Args, sizeof(tmp));
 | 
			
		||||
 | 
			
		||||
	ptr = strtok(tmp, " ");
 | 
			
		||||
	while (ptr) {
 | 
			
		||||
		if (*ptr == '-') {
 | 
			
		||||
			/* drop capabilities */
 | 
			
		||||
			ptr++;
 | 
			
		||||
			if (strcmp(ptr, "multi-prefix") == 0)
 | 
			
		||||
				Capabilities &= ~CLIENT_CAP_MULTI_PREFIX;
 | 
			
		||||
			else
 | 
			
		||||
				return -1;
 | 
			
		||||
		} else {
 | 
			
		||||
			/* request capabilities */
 | 
			
		||||
			if (strcmp(ptr, "multi-prefix") == 0)
 | 
			
		||||
				Capabilities |= CLIENT_CAP_MULTI_PREFIX;
 | 
			
		||||
			else
 | 
			
		||||
				return -1;
 | 
			
		||||
		}
 | 
			
		||||
		ptr = strtok(NULL, " ");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return Capabilities;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Return textual representation of capability flags.
 | 
			
		||||
 *
 | 
			
		||||
 * Please note: this function returns a pointer to a global buffer and
 | 
			
		||||
 * therefore isn't thread safe!
 | 
			
		||||
 *
 | 
			
		||||
 * @param Capabilities Capability flags (bitmask).
 | 
			
		||||
 * @return Pointer to textual representation.
 | 
			
		||||
 */
 | 
			
		||||
static char *
 | 
			
		||||
Get_CAP_String(int Capabilities)
 | 
			
		||||
{
 | 
			
		||||
	static char txt[COMMAND_LEN];
 | 
			
		||||
 | 
			
		||||
	txt[0] = '\0';
 | 
			
		||||
 | 
			
		||||
	if (Capabilities & CLIENT_CAP_MULTI_PREFIX)
 | 
			
		||||
		strlcat(txt, "multi-prefix ", sizeof(txt));
 | 
			
		||||
 | 
			
		||||
	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- */
 | 
			
		||||
							
								
								
									
										24
									
								
								src/ngircd/irc-cap.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								src/ngircd/irc-cap.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2010 Alexander Barton (alex@barton.de).
 | 
			
		||||
 *
 | 
			
		||||
 * 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_cap_h__
 | 
			
		||||
#define __irc_cap_h__
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * Handler for IRC capability ("CAP") commands (header)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
GLOBAL bool IRC_CAP PARAMS((CLIENT *Client, REQUEST *Req));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* -eof- */
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2010 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
 | 
			
		||||
@@ -33,13 +33,13 @@
 | 
			
		||||
#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 +67,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.
 | 
			
		||||
@@ -82,11 +81,10 @@ static bool
 | 
			
		||||
join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame,
 | 
			
		||||
	     const char *key)
 | 
			
		||||
{
 | 
			
		||||
	bool is_invited, is_banned, is_exception;;
 | 
			
		||||
	const char *channel_modes;
 | 
			
		||||
	bool is_invited, is_banned, is_exception;
 | 
			
		||||
 | 
			
		||||
	/* 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 +93,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 +108,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 +146,6 @@ join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame,
 | 
			
		||||
	return true;
 | 
			
		||||
} /* join_allowed */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Set user channel modes.
 | 
			
		||||
 *
 | 
			
		||||
@@ -167,16 +163,17 @@ join_set_channelmodes(CHANNEL *chan, CLIENT *target, const char *flags)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* If channel persistent and client is ircop: make client chanop */
 | 
			
		||||
	if (strchr(Channel_Modes(chan), 'P') && strchr(Client_Modes(target), 'o'))
 | 
			
		||||
	/* If the channel is persistent (+P) and client is an IRC op:
 | 
			
		||||
	 * make client chanop, if not disabled in configuration. */
 | 
			
		||||
	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.
 | 
			
		||||
@@ -209,7 +206,6 @@ cb_join_forward(CLIENT *To, CLIENT *Prefix, void *Data)
 | 
			
		||||
					 Client_ID(Prefix));
 | 
			
		||||
} /* cb_join_forward */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Forward JOIN command to all servers
 | 
			
		||||
 *
 | 
			
		||||
@@ -254,9 +250,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
 | 
			
		||||
@@ -297,15 +292,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 )
 | 
			
		||||
@@ -317,20 +309,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))
 | 
			
		||||
@@ -344,9 +323,11 @@ 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) {
 | 
			
		||||
		IRC_SetPenalty(Client, 2);
 | 
			
		||||
		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
 | 
			
		||||
					  Client_ID(Client), Req->command);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	while (channame) {
 | 
			
		||||
		flags = NULL;
 | 
			
		||||
@@ -361,12 +342,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_BANNEDFROMCHAN_MSG,
 | 
			
		||||
					   Client_ID(Client), channame);
 | 
			
		||||
			goto join_next;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* Local client? */
 | 
			
		||||
		if (Client_Type(Client) == CLIENT_USER) {
 | 
			
		||||
@@ -374,12 +349,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;
 | 
			
		||||
@@ -441,15 +425,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)
 | 
			
		||||
@@ -460,26 +441,17 @@ 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) {
 | 
			
		||||
		IRC_SetPenalty(Client, 2);
 | 
			
		||||
		return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
 | 
			
		||||
					  Client_ID(Client), Req->command);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	while (chan) {
 | 
			
		||||
		Channel_Part(target, Client, chan,
 | 
			
		||||
@@ -494,15 +466,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 )
 | 
			
		||||
@@ -510,35 +479,31 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req )
 | 
			
		||||
	CHANNEL *chan;
 | 
			
		||||
	CLIENT *from;
 | 
			
		||||
	char *topic;
 | 
			
		||||
	bool onchannel, topicok, use_servermode, r;
 | 
			
		||||
	bool r, topic_power;
 | 
			
		||||
 | 
			
		||||
	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);
 | 
			
		||||
	IRC_SetPenalty(Client, 1);
 | 
			
		||||
 | 
			
		||||
	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]);
 | 
			
		||||
 | 
			
		||||
	Channel_CheckAdminRights(chan, Client, from,
 | 
			
		||||
				 &onchannel, &topicok, &use_servermode);
 | 
			
		||||
 | 
			
		||||
	if (!onchannel && !topicok)
 | 
			
		||||
		return IRC_WriteStrClient(from, ERR_NOTONCHANNEL_MSG,
 | 
			
		||||
					  Client_ID(from), Req->argv[0]);
 | 
			
		||||
	/* Only remote servers and channel members are allowed to change the
 | 
			
		||||
	 * 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_WriteErrClient(from, ERR_NOTONCHANNEL_MSG,
 | 
			
		||||
						  Client_ID(from), Req->argv[0]);
 | 
			
		||||
	} else
 | 
			
		||||
		topic_power = true;
 | 
			
		||||
 | 
			
		||||
	if (Req->argc == 1) {
 | 
			
		||||
		/* Request actual topic */
 | 
			
		||||
@@ -564,10 +529,14 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req )
 | 
			
		||||
						  Channel_Name(chan));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (strchr(Channel_Modes(chan), 't')) {
 | 
			
		||||
		/* Topic Lock. Is the user a channel or IRC operator? */
 | 
			
		||||
		if (!topicok)
 | 
			
		||||
			return IRC_WriteStrClient(from, ERR_CHANOPRIVSNEEDED_MSG,
 | 
			
		||||
	if (Channel_HasMode(chan, 't')) {
 | 
			
		||||
		/* Topic Lock. Is the user a channel op or IRC operator? */
 | 
			
		||||
		if(!topic_power &&
 | 
			
		||||
		   !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));
 | 
			
		||||
	}
 | 
			
		||||
@@ -578,7 +547,7 @@ IRC_TOPIC( CLIENT *Client, REQUEST *Req )
 | 
			
		||||
		 Client_TypeText(from), Client_Mask(from), Channel_Name(chan),
 | 
			
		||||
		 Req->argv[1][0] ? Req->argv[1] : "<none>");
 | 
			
		||||
 | 
			
		||||
	if (use_servermode)
 | 
			
		||||
	if (Conf_OperServerMode)
 | 
			
		||||
		from = Client_ThisServer();
 | 
			
		||||
 | 
			
		||||
	/* Update channel and forward new topic to other servers */
 | 
			
		||||
@@ -595,15 +564,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.
 | 
			
		||||
@@ -619,31 +582,20 @@ 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_SetPenalty(Client, 2);
 | 
			
		||||
 | 
			
		||||
	_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]);
 | 
			
		||||
 | 
			
		||||
@@ -665,11 +617,16 @@ IRC_LIST( CLIENT *Client, REQUEST *Req )
 | 
			
		||||
			/* Check search pattern */
 | 
			
		||||
			if (MatchCaseInsensitive(pattern, Channel_Name(chan))) {
 | 
			
		||||
				/* Gotcha! */
 | 
			
		||||
				if (!strchr(Channel_Modes(chan), 's')
 | 
			
		||||
				    || Channel_IsMemberOf(chan, from)) {
 | 
			
		||||
					if (IRC_CheckListTooBig(from, count,
 | 
			
		||||
								 MAX_RPL_LIST,
 | 
			
		||||
								 "LIST"))
 | 
			
		||||
				if (!Channel_HasMode(chan, 's')
 | 
			
		||||
				    || Channel_IsMemberOf(chan, from)
 | 
			
		||||
				    || (!Conf_MorePrivacy
 | 
			
		||||
					&& Client_HasMode(Client, 'o')
 | 
			
		||||
					&& Client_Conn(Client) > NONE))
 | 
			
		||||
				{
 | 
			
		||||
					if ((Conf_MaxListSize > 0)
 | 
			
		||||
					    && IRC_CheckListTooBig(from, count,
 | 
			
		||||
								   Conf_MaxListSize,
 | 
			
		||||
								   "LIST"))
 | 
			
		||||
						break;
 | 
			
		||||
					if (!IRC_WriteStrClient(from,
 | 
			
		||||
					     RPL_LIST_MSG, Client_ID(from),
 | 
			
		||||
@@ -690,25 +647,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;
 | 
			
		||||
@@ -717,73 +669,70 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
 | 
			
		||||
	assert( Req != NULL );
 | 
			
		||||
 | 
			
		||||
	/* Bad number of parameters? */
 | 
			
		||||
	if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5)
 | 
			
		||||
		return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
 | 
			
		||||
	if (Req->argc < 2 || Req->argc == 4 || Req->argc > 5) {
 | 
			
		||||
		IRC_SetPenalty(Client, 2);
 | 
			
		||||
		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,
 | 
			
		||||
@@ -791,13 +740,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- */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										64
									
								
								src/ngircd/irc-encoding.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								src/ngircd/irc-encoding.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,64 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * 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
 | 
			
		||||
 * 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"
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * IRC encoding commands
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "imp.h"
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include "conn-func.h"
 | 
			
		||||
#include "channel.h"
 | 
			
		||||
#include "conn-encoding.h"
 | 
			
		||||
#include "irc-write.h"
 | 
			
		||||
#include "messages.h"
 | 
			
		||||
#include "parse.h"
 | 
			
		||||
#include "tool.h"
 | 
			
		||||
 | 
			
		||||
#include "exp.h"
 | 
			
		||||
#include "irc-encoding.h"
 | 
			
		||||
 | 
			
		||||
#ifdef ICONV
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Handler for the IRC+ "CHARCONV" 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_CHARCONV(CLIENT *Client, REQUEST *Req)
 | 
			
		||||
{
 | 
			
		||||
	char encoding[20];
 | 
			
		||||
 | 
			
		||||
	assert (Client != NULL);
 | 
			
		||||
	assert (Req != NULL);
 | 
			
		||||
 | 
			
		||||
	strlcpy(encoding, Req->argv[0], sizeof(encoding));
 | 
			
		||||
	ngt_UpperStr(encoding);
 | 
			
		||||
 | 
			
		||||
	if (!Conn_SetEncoding(Client_Conn(Client), encoding))
 | 
			
		||||
		return IRC_WriteErrClient(Client, ERR_IP_CHARCONV_MSG,
 | 
			
		||||
					  Client_ID(Client), encoding);
 | 
			
		||||
 | 
			
		||||
	return IRC_WriteStrClient(Client, RPL_IP_CHARCONV_MSG,
 | 
			
		||||
				  Client_ID(Client), encoding);
 | 
			
		||||
} /* IRC_CHARCONV */
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* -eof- */
 | 
			
		||||
							
								
								
									
										24
									
								
								src/ngircd/irc-encoding.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								src/ngircd/irc-encoding.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2012 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_encoding_h__
 | 
			
		||||
#define __irc_encoding_h__
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * IRC encoding commands (header)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
GLOBAL bool IRC_CHARCONV PARAMS((CLIENT *Client, REQUEST *Req));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* -eof- */
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,6 +1,6 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ngIRCd -- The Next Generation IRC Daemon
 | 
			
		||||
 * Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
 | 
			
		||||
 * Copyright (c)2001-2012 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
 | 
			
		||||
@@ -26,6 +26,7 @@ GLOBAL bool IRC_PING PARAMS((CLIENT *Client, REQUEST *Req));
 | 
			
		||||
GLOBAL bool IRC_PONG PARAMS((CLIENT *Client, REQUEST *Req));
 | 
			
		||||
GLOBAL bool IRC_QUIT PARAMS((CLIENT *Client, REQUEST *Req));
 | 
			
		||||
GLOBAL bool IRC_QUIT_HTTP PARAMS((CLIENT *Client, REQUEST *Req));
 | 
			
		||||
GLOBAL bool IRC_SVSNICK PARAMS(( CLIENT *Client, REQUEST *Req ));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user