The branch, backport-lenny has been updated via 433d2c5595ab168f6b2941e41c0241bc51e8d2c4 (commit) via 5b7e8c33ba222879a7d0d05703bd8e21c3caef4d (commit) via 6c55a3e89c32e3ca2cef68e10f687f857bcaa568 (commit) via 92bea7f0e26e93a97574366244608806659d0f02 (commit) via 9ac2ec7f66f8ab4b802d559cd935d57a537c38a8 (commit) via 07ffa2666b5959f61264c1cd9dcc1716d77699eb (commit) via 25e9c4f0c38348dd8475fec134d3fc98321ae3b8 (commit) via ab58c51c9502d8e5dd195c6c426955c9430dc637 (commit) via be5a64d7e9d79c653e6eb01f5513dbb26f82efea (commit) via a1c4caf9ad6e209c5ff98aa78da485e98aff1855 (commit) via 6389d6f351aacc8e1b25b6b436ddcd60aa9b4711 (commit) via a1fe7b58f909c900fb15faaedd932099722713c7 (commit) via 472904a80686275a0aafaa241b2eecb49b19d9f5 (commit) via 8e22802381b269d7c8a24c2ca459bc5f019c7ef3 (commit) via d43b9554969074fc25a5319715a4cd2f44b8b4ab (commit) via 6758b0beb731410caa99b87ac6a7d345c472ced7 (commit) via 4a4ca78e79a24bbed83652566e4aa06ab1abe379 (commit) via 6026a8912aba41102648c984c945f9b05eae9dc1 (commit) via 8f77b2bc5b792ab4e36fdd5f0bc32058d4ccf8eb (commit) via 3e940f3f95c610ae5121509053cf0a67a1724a50 (commit) via 3c7fa879406857e97a5d0d65da16106e64cdf853 (commit) via 3303fef8314cc69b9ddb2db3fab3808ef8e4acff (commit) via 4e8769042f3f939f39816d1ed1bd6994c4eb46da (commit) via b154392c4e048dc41146d8f4a827258f887b9d8f (commit) via ef2560f37dea3f69eb89582db0b415507e4cac51 (commit) via c786abd622d6041ae6f38be60197c219a727851e (commit) via ff049959c356e9fb0642ced64d7fe6798829c7a4 (commit) via 528859fbf5955a8dbab6a2112604696349a3c844 (commit) via e972d17db61fe97bcc09aea01ce5dc79a6c369fb (commit) via ba403871c07b8ec6527d5ec8de0223ace6ede4d1 (commit) via 4cd61612addb25a787e43c20318ad393f69990fd (commit) via 06a301e83b237ae25c25e0ff2b6c9edb8940a574 (commit) via 35d36f46705678c0ebe246d1ffcbfe313ccfd95e (commit) via 5b09bf294a54dc3ebe331b40a54865916c47e8f1 (commit) via b252b0b4c3765c4a6674e4b1a51396e83ffe4de2 (commit) via fda48ba301fce838208d9194bd1717a992766fb7 (commit) via 2aa50c8f5410dec4c34d982164a14b96cc99184e (commit) via 833b3e7700b8d961cd408ecd5ee00be8a158a8ca (commit) via e3a1260245b5f3d16433fc970b511ad8e38d04ba (commit) via dbd701007ecb28e66ccad9b9549423bd22842add (commit) via e04533eeb6ca43d13c9b851e23ba32fb0365a1a2 (commit) via dc20c8b3ba24918bc99b07a6e2b08473e3d65132 (commit) via 578c15d335bf409bc9d24578e44d837c6a87f24f (commit) via ca1839dddee53a649348375d81ed0229c3f04940 (commit) via 411a93ab86b686cbf3552acc1eeda8fc859d9804 (commit) via 95f9019a6853c890130d8b3d8043cc6e82e2c42e (commit) via cf2747093fca5f45761d78e44ce2d140715984b4 (commit) via 494da744b0983787b8dfa5885047d18643117480 (commit) via cacbc7c1df4a18c80c71befd163bec0d5385e5d1 (commit) via 83f8aff9e6a8a3dc21a2bf28b075c659bba922f6 (commit) via 21a9cffc1dd70f92d0940d505001d3e2ce60f935 (commit) via e54569843d1cc2afdfdfc7c9cae88c8563c34eda (commit) via 9ac427b98d9775438363971ddd977f8501370916 (commit) via d09115857ac2b5a8f74d4f06f9d2c1b346f2017a (commit) via b4bcf5d9e572829ab77ac0e3eb241cbbe9fdff63 (commit) via 969ca1e4286a62563707fd5b385d367cf6429324 (commit) via 9eed4a9fec21e45905509cab39bfc72acf746310 (commit) via e6eed79f2bc30e48ab9793751ac45abcdfc22d9d (commit) via 0aeebc5f88e93219bf470e8b242e8c6c2866700b (commit) via 6e7973ffcdab5b6e164975ded65888d249d30649 (commit) via 23931da0f346688cebf9d20b0799b57da4d23bea (commit) via 2e09448d5dd66b8f3147ed49a659c6f051588e28 (commit) via bc39a6be9af6487c3a237127335d832a0ab4e416 (commit) via 167a2fb994ee253a64b2d505e0b7ab588debee91 (commit) via dd14a038358f398ce4754de4c79e1b66b73bbd56 (commit) via f523fdc45d0b86fd3d3014672dfcbac0e4af6def (commit) via cdecd4c5266b36c50168c590dc3aa515e89593ad (commit) via f8f06643508fcfd324ae9dc422d580a8d5a4c498 (commit) via 34f1e0e38141e944eb51d70ad6b688ada13036ea (commit) via 9d7cf5882bd3abe5a68746701c367a9160e35ae4 (commit) via a3625b13811059585ba85d1c7ca27508c1ac8a4d (commit) via ca1ffe5bfe6cf3219329a5f6d34388da9d0b2d94 (commit) via b550cba7c87c55705266f915d650be0a06050c22 (commit) via b59a76b8924347c52a661f305c4c1606b406d3b5 (commit) via 90ef11211b9b1ecbb395f17560e1631c16741591 (commit) via 7bd9d06580402d68ef3bb2f287406517ad0adac1 (commit) via bd8cdb39ee4fe8050d5b218b2a46f93a4f13b869 (commit) via 3420ecace39ad5ec790a4ddff39beacf7e542edd (commit) via 3bbf08a81cc3a25b08cd96792b1b8a31ec60d7da (commit) via 8991e334ed299f5d86fd561ddd7f20e2ba180ec6 (commit) via 1849716488faf1526dcaca1ca89ed6fcc2cbcfa6 (commit) via 481df0e0ce448a56a3374464317ad622a38c51f0 (commit) via 6b7a98602f4bda708b4ba344d8290e931b1bd8ca (commit) via 40ede834e1477c5a6745f08c304754a7b3ed83ba (commit) via 2df7cc7b0ab6b0971e5440755e1afcfcb2f15ce9 (commit) via 2e16ac11a46433fd4173e161ca5cbff0319145a9 (commit) via 36b860f6c6ef2fd3c67bb546617acc2536876e13 (commit) via dbc8b65786c10b58cf431d937787c2606fd73ba7 (commit) via 6c036b0fc47a2207da98ddbd829382ef09ab510d (commit) via a027266c4c6d1b42451e522642209adb44713886 (commit) via 059822be07d7f0750bb732e0eae554d3d6244e79 (commit) via 42f740fa91c73ecf5e4e3a9124172b63213e8ac8 (commit) via 0ead4f8a5978fa46a852b26ff9825bf6284ffa3d (commit) via d626f0842b46f90e7e83f825c69290c3d05e2486 (commit) via 17b4e16035b8ea19c3614fc820208d2b722b01cf (commit) via 1f60430540f344d52003d10ccf3d828ed47de440 (commit) via 9371c0977e66e0ea7b0907249e6745080f737215 (commit) via 7137e200cea19601aa478e8abb6a9d271d33c4a9 (commit) via e4468527037a3f09ebe9fb4cd436514981e298c8 (commit) via 42467f0ad54f853abfe871a1d93f7c5d1fb91c24 (commit) via 16aefec3a79ee216a04b7713602c3cc9dd5cccba (commit) via bc2de64413393a3778b004e7ee9fad6bb5b3c456 (commit) via ddd465ba2e1dee511eccdb98477d723d6d346fed (commit) via 4db40a9be5765c445f3db97f8a1d395e636408f9 (commit) via 0729b55978bd0500d71357203a39c9faac39170a (commit) via 7af28ec4a48059c2ce0fc0ed9202e80cd8f71f65 (commit) via baadaa4917609e29c25428d02bf8c52c920ca030 (commit) via 2004c50fe8cd29521f4cc2dc409bda4bf3d09221 (commit) via 99859e9384f5adab67f675a94d3dba53d64a67cb (commit) via 908170be87c8b04328250de30515375487a4dcc0 (commit) via fcd3bd7ac6be3e7250f0cb63c9ac6edb617092de (commit) via fb75118096c82e839155dc377f4cde8adc10671c (commit) via a7a070897ce47ee54dafeab82cc0404b9d7fb125 (commit) via c6356cae45e692e344738f2eeda765a512a436f0 (commit) via 7a93c8919e4ddeecb5463739c18bf8724a3cfd77 (commit) via abaec5211c45e263ab33ba047ab5323d1dcce727 (commit) via cf670139b4c9a2da6503d43119fc4f9f0efcf74a (commit) via 5304dd8fc2e1b91e18a1026b297737404fa32633 (commit) via 8354e72b21849d830775fd1c75bc1026c429381b (commit) via 1f7e8107ce21afce0dbdd73b18c6fb143505a5bc (commit) via e836ae7f1af36f3b2afe1ab178e65432e9924310 (commit) via 6a71905489ccd4b3aa49383b0944fe56a7d7da7c (commit) via 2401549fd6e43625b9bda9216bfde62d6ead04ee (commit) via d0f792ba43b9c10cc7387f2f4213177973b749c8 (commit) via 4f56f780bf4315040a95b0b109ec947875b9d64b (commit) via 619d20c30977921a398d1900a6075b670c7dfed7 (commit) via 5c17aea27c85250a2ab026f911a52b306a1bb21f (commit) via 97e675be340ef5c1d429acb22ab90074e2ec8a3e (commit) via 0b8db07480a50be05f8c1ffcd8a759bcf3677ee6 (commit) via 63a837ebf03771e6d87141d6ed95a6c3404c6664 (commit) via 2813be555b2d67ce6775495464df29b4fb1d02bb (commit) via 0ccd51ec1e6075157f32d36807d6148856f43492 (commit) via d8caab889be858d8c258cbc1e4d8e979c33ee84b (commit) via 4e537256e5e37bdd35fcd79ebe71e4181d707fe0 (commit) via f19f6dae198943c6803516d48de617f12bba7866 (commit) via 291575906708c5ad6233fb114050f73895dea87a (commit) via a2e61b7dc9b944c8cc31e8f9b2f1f46029106fdd (commit) via 518a0e4a5d56da0db6e0960a06ccdd3379d2f45b (commit) via 2c440f2a24fe624e9190918703102c2c9178e4c0 (commit) via 134451de62c543656806be4efa1f7283ac76b677 (commit) via 24d40c2a9e78dfdc7e1248469746112d3c469d1a (commit) via db14c4eb01df94bf5a890e08dbc85af67adc8a9a (commit) via d48b906aad15e03612a617bac2dd8e9439a6c418 (commit) via 277e82b2587ce9eda48cefe3147744922f8a6cbe (commit) via b41cd4b680777412305d16bb905ad18263b251ca (commit) via ef6b27b95f398b74c696e2376785caf58a94eff7 (commit) via beed56213aa11751c94e4883b492c6669062a276 (commit) via 198de410e8667ce20a22d1645436153032e5369b (commit) via 202f77be1052788a3a62738b75da084a8f329846 (commit) via 2491c255688ed59eb20ec9bd52deb2501184baf9 (commit) via f406286ff48cbeb567c7f6ee5ab35d4427f73671 (commit) via 0d862d3b0be0dbf19d2f9de6863e4ba78ac6de1f (commit) via 146357950bde2552222ebb1b522b855eefdb4855 (commit) via 66a3004afe55fe8209d8dfef9e88a68d1822a88a (commit) via f8b7522b0a7f30507e74b579e8a2728cd7d62d97 (commit) via 407004bc51006b4540915615f0a64298934921bd (commit) via 3759d04f57d6a060a1eeaf0537012bb026c5a758 (commit) via bc4411e52d17f949f548a153f732225121372367 (commit) via bb7be650703fe3b527eba689d90adff4eb19ed87 (commit) via 70524c9b9f2f151e38b96df897b288c7da996282 (commit) via 218a891a0906bf64eec19dc6947d4f74468b003d (commit) via ce6e51d5b8c5936381ee90c34c7953166e6a5291 (commit) via 210dcfb45cee35c0c158dc4248d8ac93525a9e3e (commit) via 5d259f390c4be5a066d0b1b3eb08407acb33caa3 (commit) via b11852eba8e71eae911961f17f89ea2369f253ce (commit) via 0abf3435029a4a1294c6295b48c4982b99606d26 (commit) via e9dba469011bf6d3d42f01fbc533257e53c90b50 (commit) via 56e53371f68ce6180f6d8d3b8ebbf625a8059f07 (commit) via 2d05fedca493fdd39d88b9ad9dd749fbeffc415a (commit) via 014ed225f9711d2646c68f69768fe8f851dff617 (commit) via 7f66504124ba057dcf08f97176a317ad2d9e6816 (commit) via fb949522981f57ccd799b317dc8ba8b7e7891e95 (commit) via ff81b92f52597a6119b9da355dcc49fd02535822 (commit) via bf5c4bceef7408aa5bc8a915569c49f7191d2dcb (commit) via a140a74f7a9b690c3eaa379326dc21547c4e529e (commit) via 0ddbb7e54bbe81feaa377b0cd43e3e8edd3fcb29 (commit) via 5b256f599e68d794315f1d2904e356c3951f4fd3 (commit) via e57bc2ef74f2e92c8c1bfd9e5155ed63ebe03677 (commit) via fe730d34848f7377d4137c47ba6b6f3e95fe84f3 (commit) via 069f7ce89da967db35555f980ece7193d22ea2bf (commit) via 017593f5b041588b8ed3b0039d62f030ee600da6 (commit) via e47d1d5fb315121719162ed8433923057a2b82d8 (commit) via c56a4a0314608e1687024aae8ccde799113e21be (commit) via 6fbc9a4762f26f3c52a8793bb61caab2d3391bda (commit) via 86588f9e8dfaa1889422d7551e47af1cdafbe5f7 (commit) via 98512e5a7e4f70822a19dc3d097a41bb7848cd11 (commit) via b58617cb9127091ff2b89d6e1c72f105ea746ab3 (commit) via f801701fc9cd6fe69215413d0626d6b78eebf351 (commit) via 80df2bc1e1b6f6e810efeda11b338f9e4b40fc92 (commit) via 75f2ddb8af58ba29d0a0649ac8292bcfb5b862e3 (commit) via 929d55a4cb4bf0b7eed74465a493ca05cae2de7d (commit) via f3ec5bdb621e04e4b29eb38991f4ecf3cfca0e1e (commit) via 3c5a07a430075592b0312d275f00b8f30c6445f5 (commit) via 300a662ed1622d35b6be0a1a2044abc444a80a62 (commit) via 58a8b61a31c38b74229bec3dd015a7540009db88 (commit) via a108bf04a19f321aa96c0f780aa017e1111043f7 (commit) via 68e52a6e2c8441a7ff082310fdfc2f29570d188e (commit) via 6f1554f1dea846633c27c9e8aff4364688722809 (commit) via 19d1ed0cd0eecef8afd021e2fff34cdce35fcc85 (commit) via 9c07dbbcc6022d4e8f40f5981a1220d84c9e15ba (commit) via d52c8eeaebd500f07244e06be5c7283b65f58a51 (commit) via db26fb43234a1d3e0879b9ecf5df4e79811a429b (commit) via 4536197faa661ae139fd7699bf511789fc742226 (commit) via d77e38b37a34ccfd64fdbb80423cd69f0d3eb909 (commit) via 478cbc572681b63403636b56aab40a15b7bb9ffb (commit) via ab07b1d03c276a4106637651722d81164685e114 (commit) via d6c30f9c25311af437cccc01414b41d44bde069a (commit) via 25ba5146368926f5137e7a79abdcffc753c5c02f (commit) via d5e69533693c555b2ca8b280a3247b35e81104c2 (commit) via 2b7f970dde5a9fad4446de16f9f24bb92be23f60 (commit) via 291a0f8f085991d8cd54891bbf8507046cc9fd5d (commit) via a67576ec6300d8037bef5b748899472ec9ef0a55 (commit) via f106b6c22c68f2f7d4cba48b85d09e09cc23b4f9 (commit) via 8dc25cdefd6c979b0f4869708b8b52fcd38d98b2 (commit) via 7f5de278dee5c1d7711342c848e5afe69130d402 (commit) via f57491ef0d0de756f949992a3922f2269d161d0d (commit) via ee9c60cfb9cdc1933d1fbcea549841fe32f7ffdd (commit) via 6f747eb1f19811bbeb303609b63e65123aec2be1 (commit) via 53bea426489767381ad61df1803611098fc19832 (commit) via 14ef31a4ebf938da5e560bf182b23f4ad898493a (commit) via bbb9cc872d179f40c461d7b857d33b23fbeea0ae (commit) via 23ef05aa2005114d2fc54427df4de42017622882 (commit) via 7f76f3f2db65d2875393d6e4b81ecc11bf41058c (commit) via a23075dbc2cf330e3a184c8d9a2fe4f0ae770c86 (commit) via 735526b3640021149403487b1d224bc3e5296bbe (commit) via 3f53e3c7a2b9640ed1ec06fb086d0ec5a3af086b (commit) via f576ea238ca175fab39b9b8d86c9a0204d0a776a (commit) via 09dcc668cc5bc83e810b5878a3de81cf31ba1330 (commit) via dfea39939eab0730a93cd5d5876d065e787a4703 (commit) via 1b215fb5eb64fb8f0512cd2bc1571a9a551fb512 (commit) via 39e6fcac5c60c43e3849e9f214aaf27ae06d013f (commit) via 6fbd20b43e0b2eb1760e4f13ecc5ba016903b407 (commit) via ee439b1b82da703178fa2ebcbc45981d475200ee (commit) via f670104e54b5280400fad3108ddf7b124c2c43f2 (commit) via e658a07c74ec97c7c9b60b6f1e3f54a8d0377cb5 (commit) via 45902ab4ea718057ff30f020f7b3a11154814248 (commit) via 7587523ca9c476ef105592bbcaa0572d712e50ae (commit) via e4181ea96cc5b9db7535afc8cfd6a8e25f6c52a6 (commit) via 4d1f7d1127e0b50df3c63b8d2f8807a63e1a5bc8 (commit) via 3366992d7d48caecf15d10a3f304182c5f3e321d (commit) via 21942339045ffff12d447b8280f7b27352f87197 (commit) via a0ad10380b7fbf72807b435915478f57a651e640 (commit) via 905cbbeb90c7f5e875a7bd169215db6d0767056f (commit) via 6666866026ffa7d038f66ab2e3511c6cd63bf1c6 (commit) via 6857da441eecf0d392ce111470bea6c40d9e3685 (commit) via 7e850a0497496bcc1871673fcace660fa402a89d (commit) via 24eff92c2d792b9f244c1d3fb29341bb434f9ccc (commit) via 6bd23bd8ab95c5d8e7296049f3197e1de46f6f6b (commit) via ddf08d21857b9a5876b7398f6b9deb024b265e73 (commit) via be5284d63ce14b8565aeb36b850035e063a74b6c (commit) via 71faaac9efd39f7339fd2f4675f182380223aa0f (commit) via d7ee2a6f2266e78323ead8940df6703afac60ccb (commit) via 218f930eee01fed942bc8e8f778cfe503fee875c (commit) via 5e3637dfc6d0fd9506d1f5a91b2bf0ff553c9b81 (commit) via d6a8716bc241d22fdb9e34e1484d186bc54bfad9 (commit) via e7230c9cda789c4d215f5b2e9d1d02293c593949 (commit) via ea10346653e2eddff339cd62225ab508d6f5517a (commit) via 268c559147083f1c2439befda9d2aefe94c94628 (commit) via a9a204693b922f6cf742b1cc2582d0597be25788 (commit) via 4af32b75c6effdbd11a4a54ed830a8b13a1f9dc3 (commit) via 5503c7bbb6bdb7d01dd7f65e64b0e61eea2bb0d2 (commit) via ed302ff6f618edd1072cf97d12e26ee8ca9629c2 (commit) via 82ace2748b0409d064df00e18f97be2c1d34e15c (commit) via a3a333951634afccb4e22b7c4f116febc6622dc9 (commit) via a333e079faa9116d9002d8d8efd141672825d5a8 (commit) via d40bfbdb762dceac35985966e444518947b4869d (commit) via 5ffd06b14d6820c40262bf14a67b2245c2687ea1 (commit) via 72044358fefe7f85abeb3a1f445dbdc9afdafe1c (commit) via 2bfaa5d8768169eb7a53119d60951e806f10ed7a (commit) via c010848a801c638c1c91680a2025f8c6e5c4f767 (commit) via 08aeff25af7d0169bbe640f1ad4ff35aeda6c7bb (commit) via 6b26017aa6402f53664aed8bb086f7ffd8185aa0 (commit) via 7fa6e85fec9ad10276f3c08cc5bd9ce96165ee09 (commit) via 77544876338c1baf237f6ad8a3d4a9a93ada1887 (commit) via a5c56b347a83dd786f40bb5603852fbe7ee91c95 (commit) via 757ff486312c57598c55a34e848ec09e74cb9474 (commit) via 85c48dda313b0512d8a322f82e2c050b03ee39a0 (commit) via affdd3999fb861329a91673fa78d5af1394874ff (commit) via 8d01703b62f80b09de720494669696d96539d7ea (commit) via 14408a4977885dc018df86c3e99e3a990744b00d (commit) via 93da053b174687f1a5190594b5542eef99f55268 (commit) via 259b54fda768912f281ac2a98564e21f35ab5c3e (commit) via 95fbea12105d81206e03141c9a29e72e3106a7fa (commit) via 1dd6b78799ca8a04505e17114576a30dca9d820d (commit) via 52995fb26588a756a22bf8aa80d3c0ac3dffd3f0 (commit) via 14e8e53a22a18c9470b507f6efa82a656365785a (commit) via 1adbbac7b8741894a820762c88b17d5edd6319d6 (commit) via 8bbde2e3a9aa6209bf7ccff74753b8693f5f57f5 (commit) via fa9c5da9b13e7e3ca1acf71e6f8e87908f5beec2 (commit) via f6cc0932dbb8a7d050bd90a061a48b4403ccaa0b (commit) via 9b8d1300d52f84176fcea36a0f785e30cc00e722 (commit) from 0e7d4eacdaa09c0bcbaef8d0185e6a27e3d44e94 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 433d2c5595ab168f6b2941e41c0241bc51e8d2c4 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Nov 20 19:40:31 2011 +0100 Debian lenny backport for x2goserver 3.0.99.8 commit 5b7e8c33ba222879a7d0d05703bd8e21c3caef4d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Nov 20 18:54:45 2011 +0100 release 3.0.99.8 commit 6c55a3e89c32e3ca2cef68e10f687f857bcaa568 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Nov 9 12:09:52 2011 +0100 fix for last commit (x2goserver-printing.postinst) commit 92bea7f0e26e93a97574366244608806659d0f02 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 8 12:44:46 2011 +0100 type fix in x2goserver-printing.postinst commit 9ac2ec7f66f8ab4b802d559cd935d57a537c38a8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 8 12:44:23 2011 +0100 Fix non-local printing with X2Go: x2goprint user on X2Go server host needs a shell to accept incoming print jobs from the central CUPS server(s). commit 07ffa2666b5959f61264c1cd9dcc1716d77699eb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Nov 5 22:48:51 2011 +0100 description fix in control file commit 25e9c4f0c38348dd8475fec134d3fc98321ae3b8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 1 14:26:35 2011 +0100 Set X2Go log level to info when running Xsession parts. commit ab58c51c9502d8e5dd195c6c426955c9430dc637 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 1 13:45:55 2011 +0100 Make sure that package scripts (postinst, postrm, etc.) exit with exit code 0 at the end of the script. commit be5a64d7e9d79c653e6eb01f5513dbb26f82efea Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 1 13:29:38 2011 +0100 more locations where to ignore x2gofeature failures... commit a1c4caf9ad6e209c5ff98aa78da485e98aff1855 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Nov 1 13:28:25 2011 +0100 Ignore failures of x2gofeature calls, fixes x2goserver being installed without x2goserver-extensions. commit 6389d6f351aacc8e1b25b6b436ddcd60aa9b4711 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Oct 28 23:59:42 2011 +0200 fix STARTUP variable content in x2goruncommand when using X2GOSERVER_XSESSION feature commit a1fe7b58f909c900fb15faaedd932099722713c7 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Oct 27 13:11:57 2011 +0200 remove obsolete line from x2goruncommand commit 472904a80686275a0aafaa241b2eecb49b19d9f5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Oct 27 12:52:46 2011 +0200 fix for x2goserver-xsession implementation (tested on Debian Edu) commit 8e22802381b269d7c8a24c2ca459bc5f019c7ef3 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Oct 27 10:34:17 2011 +0200 no man pages in package x2goserver-xsession commit d43b9554969074fc25a5319715a4cd2f44b8b4ab Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Oct 27 10:31:59 2011 +0200 forgot to add files commit 6758b0beb731410caa99b87ac6a7d345c472ced7 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Oct 27 10:02:50 2011 +0200 Add Xsession.d processing to X2Go (as x2goserver-xsession add-on package). commit 4a4ca78e79a24bbed83652566e4aa06ab1abe379 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Oct 26 17:40:07 2011 +0200 Fix feature list in x2goserver-extensions. commit 6026a8912aba41102648c984c945f9b05eae9dc1 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Oct 26 17:39:30 2011 +0200 version increment commit 8f77b2bc5b792ab4e36fdd5f0bc32058d4ccf8eb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Oct 26 13:06:29 2011 +0200 release 3.0.99.7 commit 3e940f3f95c610ae5121509053cf0a67a1724a50 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Oct 25 19:08:16 2011 +0200 X2go server extensions: fix regular expression when scanning modality dirs. commit 3c7fa879406857e97a5d0d65da16106e64cdf853 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Oct 13 03:45:13 2011 +0200 revert add936413c185eeee07d97bbbde731628cb0f152 (last commit) commit 3303fef8314cc69b9ddb2db3fab3808ef8e4acff Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Oct 13 03:11:51 2011 +0200 Do not create desktop links for shared folders when running KDE/Plasma. Users are recommended to use the X2go Plasma widget. commit 4e8769042f3f939f39816d1ed1bd6994c4eb46da Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Oct 12 13:19:39 2011 +0200 Move x2golistmounts script from x2goserver-extensions to x2goserver core. commit b154392c4e048dc41146d8f4a827258f887b9d8f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Oct 12 13:18:02 2011 +0200 continue development, version increment... commit ef2560f37dea3f69eb89582db0b415507e4cac51 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Oct 12 12:07:16 2011 +0200 release 3.0.99.6, rework changelog commit c786abd622d6041ae6f38be60197c219a727851e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Oct 5 15:49:08 2011 +0200 tabfix commit ff049959c356e9fb0642ced64d7fe6798829c7a4 Author: Oleksandr Shneyder <oleksandr.shneyder@treuchtlingen.de> Date: Wed Oct 5 14:27:24 2011 +0200 remove session directory after 10 sec delay to let x2goclient check cmdoutput file commit 528859fbf5955a8dbab6a2112604696349a3c844 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Oct 4 13:46:57 2011 +0200 Fix for session dir cleanup, x2gologlevel returns int value, not string. commit e972d17db61fe97bcc09aea01ce5dc79a6c369fb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Oct 4 12:31:41 2011 +0200 path fix for x2go-run-extensions commit ba403871c07b8ec6527d5ec8de0223ace6ede4d1 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 30 11:22:37 2011 +0200 some shots are to quick... fix for last commit commit 4cd61612addb25a787e43c20318ad393f69990fd Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 30 10:32:41 2011 +0200 Use find instead of ls to list up installed X2go server extensions scripts/binaries. commit 06a301e83b237ae25c25e0ff2b6c9edb8940a574 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 30 09:11:34 2011 +0200 Make digits at the beginning of X2go server extension scripts a must, not a suggestion. Contributed by Morty. commit 35d36f46705678c0ebe246d1ffcbfe313ccfd95e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 30 08:54:16 2011 +0200 X2go server extensions have to completely quiet, diverting stdout/stderr to /dev/null. commit 5b09bf294a54dc3ebe331b40a54865916c47e8f1 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 30 08:25:44 2011 +0200 man page improval: x2goserver-run-extensions commit b252b0b4c3765c4a6674e4b1a51396e83ffe4de2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 29 23:06:57 2011 +0200 Provide man page for x2goserver-run-extensions that explains the new plug-in mechanism of x2goserver. commit fda48ba301fce838208d9194bd1717a992766fb7 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 29 08:30:31 2011 +0200 Adapt to renaming of x2godesktopsharing scripts. commit 2aa50c8f5410dec4c34d982164a14b96cc99184e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 29 08:05:55 2011 +0200 add log messages to x2goserver-run-extensions commit 833b3e7700b8d961cd408ecd5ee00be8a158a8ca Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 29 00:49:31 2011 +0200 Makefile fix for x2goserver-extensions commit e3a1260245b5f3d16433fc970b511ad8e38d04ba Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 29 00:46:48 2011 +0200 add debug message commit dbd701007ecb28e66ccad9b9549423bd22842add Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 29 00:27:45 2011 +0200 Provide pluggable X2go extension system for main X2go server functions. commit e04533eeb6ca43d13c9b851e23ba32fb0365a1a2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Sep 28 23:09:27 2011 +0200 Resume/suspend x2godesktopsharing during x2goresume-session, x2gosuspend-session. commit dc20c8b3ba24918bc99b07a6e2b08473e3d65132 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Sep 28 17:10:38 2011 +0200 copy+paste error commit 578c15d335bf409bc9d24578e44d837c6a87f24f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Sep 28 17:02:41 2011 +0200 changelog-line-too-long fixes commit ca1839dddee53a649348375d81ed0229c3f04940 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Sep 28 16:55:53 2011 +0200 Terminate x2godesktopsharing for current session on x2goterminate-session or when x2goruncommand is about to exit. commit 411a93ab86b686cbf3552acc1eeda8fc859d9804 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Sep 28 16:52:44 2011 +0200 Add usage to x2gofeature, exit with -1 if feature is not available, with -2 if usage has been called. commit 95f9019a6853c890130d8b3d8043cc6e82e2c42e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 27 16:52:42 2011 +0200 Syntax fix in x2golistsessions_sql, hopefully fixes broken x2gocleansessions. commit cf2747093fca5f45761d78e44ce2d140715984b4 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Sep 26 10:52:30 2011 +0200 typo fix commit 494da744b0983787b8dfa5885047d18643117480 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Sep 26 10:34:14 2011 +0200 Improve Makefile.docupload. commit cacbc7c1df4a18c80c71befd163bec0d5385e5d1 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Sep 26 08:54:46 2011 +0200 Only remove server-side session directory if x2goruncommand has not failed. commit 83f8aff9e6a8a3dc21a2bf28b075c659bba922f6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Sep 26 02:17:59 2011 +0200 fix detection of current desktop(3) commit 21a9cffc1dd70f92d0940d505001d3e2ce60f935 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Sep 26 01:45:56 2011 +0200 fix detection of current desktop(2) commit e54569843d1cc2afdfdfc7c9cae88c8563c34eda Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Sep 26 01:04:45 2011 +0200 fix detection of current desktop commit 9ac427b98d9775438363971ddd977f8501370916 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Sep 26 00:25:36 2011 +0200 version increment commit d09115857ac2b5a8f74d4f06f9d2c1b346f2017a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Sep 26 00:24:54 2011 +0200 Change of Desktop icons for shared folders. This change is needed for parallel installation of x2gognomebindings and x2golxdebindings. commit b4bcf5d9e572829ab77ac0e3eb241cbbe9fdff63 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 20:56:38 2011 +0200 Clean session dir ~/.x2go/C-<session_id> after session terminates, if not running in debug mode. commit 969ca1e4286a62563707fd5b385d367cf6429324 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 03:30:54 2011 +0200 Pass extra argument $USER to client-mode x2godesktopsharing, requires x2godesktopsharing (>=3.0.1.3) for it to work. commit 9eed4a9fec21e45905509cab39bfc72acf746310 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 03:28:47 2011 +0200 log message improvement commit e6eed79f2bc30e48ab9793751ac45abcdfc22d9d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 03:06:42 2011 +0200 Add debug output around shadow session startup (in x2gostartagent). commit 0aeebc5f88e93219bf470e8b242e8c6c2866700b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 02:04:32 2011 +0200 Makefile update for including x2gofeature scripts into installation, minor fixes to x2goserver core package Makefile. commit 6e7973ffcdab5b6e164975ded65888d249d30649 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 01:48:52 2011 +0200 add X2GO_COMPAT_SCRIPTS feature to x2goserver-compat commit 23931da0f346688cebf9d20b0799b57da4d23bea Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 01:44:48 2011 +0200 add more features to x2gofeature commit 2e09448d5dd66b8f3147ed49a659c6f051588e28 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 01:43:48 2011 +0200 Move x2goversion into x2goserver core package. commit bc39a6be9af6487c3a237127335d832a0ab4e416 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 01:42:42 2011 +0200 update of x2golistmount man page commit 167a2fb994ee253a64b2d505e0b7ab588debee91 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 01:17:40 2011 +0200 fix for x2goserver-printing.features commit dd14a038358f398ce4754de4c79e1b66b73bbd56 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 01:06:29 2011 +0200 add x2gofeature man page commit f523fdc45d0b86fd3d3014672dfcbac0e4af6def Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 01:05:12 2011 +0200 split off x2goserver.features feature.d script from x2gofeature, remove placeholder commit cdecd4c5266b36c50168c590dc3aa515e89593ad Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 01:01:07 2011 +0200 Add x2gofeature man page. commit f8f06643508fcfd324ae9dc422d580a8d5a4c498 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 00:52:04 2011 +0200 Add x2gofeature script and x2gofeature.d subscript for x2goserver-extensions and x2goserver-printing. commit 34f1e0e38141e944eb51d70ad6b688ada13036ea Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 00:50:29 2011 +0200 moved x2golistmounts to x2goserver-extensions commit 9d7cf5882bd3abe5a68746701c367a9160e35ae4 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 00:39:14 2011 +0200 fix debian-changelog-line-too-long line 78 commit a3625b13811059585ba85d1c7ca27508c1ac8a4d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 00:04:13 2011 +0200 Add x2golistmounts script to X2go server core. commit ca1ffe5bfe6cf3219329a5f6d34388da9d0b2d94 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 25 00:02:59 2011 +0200 newline and EOF commit b550cba7c87c55705266f915d650be0a06050c22 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 24 23:39:02 2011 +0200 removed obsolete copy of x2golistsessions_root from /lib dir, current version is in /sbin dir commit b59a76b8924347c52a661f305c4c1606b406d3b5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 24 21:38:26 2011 +0200 Identified x2goumount script (x2goserver-compat) as a necessary component of x2gognomebindings and moved it there (with new name: x2goumount-session-gnome). commit 90ef11211b9b1ecbb395f17560e1631c16741591 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 24 01:49:46 2011 +0200 control description improvement for x2goserver-printing commit 7bd9d06580402d68ef3bb2f287406517ad0adac1 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 24 01:43:05 2011 +0200 spelling-error-in-changelog seperate separate commit bd8cdb39ee4fe8050d5b218b2a46f93a4f13b869 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 24 01:41:39 2011 +0200 Add man page for x2gobasepath and man page draft for x2gosessionlimit. commit 3420ecace39ad5ec790a4ddff39beacf7e542edd Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 24 01:40:41 2011 +0200 Split up x2goprint script + man page + adduser x2goprint as seperate package x2goserver-printing. commit 3bbf08a81cc3a25b08cd96792b1b8a31ec60d7da Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 24 01:31:53 2011 +0200 changelog-line-too-long fix commit 8991e334ed299f5d86fd561ddd7f20e2ba180ec6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 24 01:22:57 2011 +0200 path fix in dh manpages for x2goserver-extensions commit 1849716488faf1526dcaca1ca89ed6fcc2cbcfa6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 23 12:11:47 2011 +0200 Man page update for x2gosession-terminate, x2gosession-resume. commit 481df0e0ce448a56a3374464317ad622a38c51f0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 23 12:06:57 2011 +0200 If resuming or suspending of a session fails, mark the session has finished (because the session's x2goagent is very probably dead). Do not write an error to stderr if x2goterminate-session fails (i.e. if x2goagent is dead). commit 6b7a98602f4bda708b4ba344d8290e931b1bd8ca Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 22 18:22:16 2011 +0200 Add return value information of X2go commands to man pages. commit 40ede834e1477c5a6745f08c304754a7b3ed83ba Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 22 18:00:02 2011 +0200 tab fixes commit 2df7cc7b0ab6b0971e5440755e1afcfcb2f15ce9 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 22 17:49:08 2011 +0200 add newline at EOF commit 2e16ac11a46433fd4173e161ca5cbff0319145a9 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 20 16:57:36 2011 +0200 typo fixes commit 36b860f6c6ef2fd3c67bb546617acc2536876e13 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 20 16:56:41 2011 +0200 replace - by _ in man pages commit dbc8b65786c10b58cf431d937787c2606fd73ba7 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 20 16:51:41 2011 +0200 Improvement of man pages. commit 6c036b0fc47a2207da98ddbd829382ef09ab510d Author: Ivan Kabaivanov <chepati@yahoo.com> Date: Tue Sep 20 11:19:09 2011 +0200 Proof-reading code, fixing typos commit a027266c4c6d1b42451e522642209adb44713886 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Sep 18 19:37:15 2011 +0200 Let db_insertmount create a proper return value (success vs. failed). commit 059822be07d7f0750bb732e0eae554d3d6244e79 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 17 01:47:27 2011 +0200 Fix x2goumount-session for individual paths (folder type: disk), ToDo: folder type CDROM and removable media. commit 42f740fa91c73ecf5e4e3a9124172b63213e8ac8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 16 23:38:15 2011 +0200 Silence knotify SIGHUP signals in case that no knotify is running in the X2go session. commit 0ead4f8a5978fa46a852b26ff9825bf6284ffa3d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 16 23:24:39 2011 +0200 grammar fix in log messages commit d626f0842b46f90e7e83f825c69290c3d05e2486 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 15 14:46:06 2011 +0200 (awful syntax error fixes) commit 17b4e16035b8ea19c3614fc820208d2b722b01cf Author: Ivan Kabaivanov <chepati@yahoo.com> Date: Wed Sep 14 22:40:01 2011 +0200 Makefile fix around man page installation in x2goserver-extensions package. commit 1f60430540f344d52003d10ccf3d828ed47de440 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Sep 14 18:34:32 2011 +0200 Present an ISO-8601 compliant datetime string in session lists rendered by x2golistsessions (and similar) command(s). commit 9371c0977e66e0ea7b0907249e6745080f737215 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Sep 14 16:23:07 2011 +0200 SQLite DB backend: Fix typo in date format template. commit 7137e200cea19601aa478e8abb6a9d271d33c4a9 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Sep 14 16:20:36 2011 +0200 Add real error message if client fails to resume/suspend/terminate a session. commit e4468527037a3f09ebe9fb4cd436514981e298c8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Sep 13 09:08:20 2011 +0200 x2goserver.postinst: fix home path updates if new home path already exists commit 42467f0ad54f853abfe871a1d93f7c5d1fb91c24 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 17:01:32 2011 +0200 Makefile and man page area fix for x2goserver-extensions. commit 16aefec3a79ee216a04b7713602c3cc9dd5cccba Author: Ivan Kabaivanov <chepati@yahoo.com> Date: Sat Sep 10 17:01:00 2011 +0200 minor Makefile fix commit bc2de64413393a3778b004e7ee9fad6bb5b3c456 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 15:55:21 2011 +0200 Rename example user and group for session limits in x2goserver.conf so that people do not get the idea to put users in x2gouser group. commit ddd465ba2e1dee511eccdb98477d723d6d346fed Author: Ivan Kabaivanov <chepati@yahoo.com> Date: Sat Sep 10 15:51:19 2011 +0200 Makefile fix around man page installation in x2goserver-compat package. commit 4db40a9be5765c445f3db97f8a1d395e636408f9 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 14:38:24 2011 +0200 Cleanup of man page area, thanks to Ivan Kabaivanov for pointing that out. commit 0729b55978bd0500d71357203a39c9faac39170a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 02:47:17 2011 +0200 loglevel warn has to be warning commit 7af28ec4a48059c2ce0fc0ed9202e80cd8f71f65 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 02:32:03 2011 +0200 not showing x2golistsessions calls in loglevel mode info commit baadaa4917609e29c25428d02bf8c52c920ca030 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 02:21:38 2011 +0200 minor log message fix commit 2004c50fe8cd29521f4cc2dc409bda4bf3d09221 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 02:10:20 2011 +0200 add log messages to x2goumount-session commit 99859e9384f5adab67f675a94d3dba53d64a67cb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 02:10:06 2011 +0200 add log messages to x2goruncommand commit 908170be87c8b04328250de30515375487a4dcc0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 02:09:45 2011 +0200 log message fix for x2gostartagent commit fcd3bd7ac6be3e7250f0cb63c9ac6edb617092de Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 01:29:21 2011 +0200 log message fix for x2gostartagent commit fb75118096c82e839155dc377f4cde8adc10671c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 00:53:05 2011 +0200 changelog update commit a7a070897ce47ee54dafeab82cc0404b9d7fb125 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 00:52:56 2011 +0200 notice log message for x2gostartagent commit c6356cae45e692e344738f2eeda765a512a436f0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 00:38:27 2011 +0200 minor log message fix commit 7a93c8919e4ddeecb5463739c18bf8724a3cfd77 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 00:31:19 2011 +0200 notice message for x2gosuspend-session, x2goterminate-session commit abaec5211c45e263ab33ba047ab5323d1dcce727 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 00:23:42 2011 +0200 notice message for x2goresume-session commit cf670139b4c9a2da6503d43119fc4f9f0efcf74a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 00:13:08 2011 +0200 minor log message fix commit 5304dd8fc2e1b91e18a1026b297737404fa32633 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 00:11:27 2011 +0200 minor log message fix commit 8354e72b21849d830775fd1c75bc1026c429381b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Sep 10 00:07:14 2011 +0200 Use usermapping for SSHFS mount points. commit 1f7e8107ce21afce0dbdd73b18c6fb143505a5bc Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 23:44:57 2011 +0200 add port in x2gomountdirs log message commit e836ae7f1af36f3b2afe1ab178e65432e9924310 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 23:43:05 2011 +0200 log message fix commit 6a71905489ccd4b3aa49383b0944fe56a7d7da7c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 23:11:52 2011 +0200 minor fix commit 2401549fd6e43625b9bda9216bfde62d6ead04ee Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 23:05:51 2011 +0200 fix data type mismatch (Mike's learning Perl...) commit d0f792ba43b9c10cc7387f2f4213177973b749c8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 22:45:42 2011 +0200 Add debug messages to x2gomountdirs script. commit 4f56f780bf4315040a95b0b109ec947875b9d64b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 22:45:05 2011 +0200 syslogging for x2gocmdexitmessage commit 619d20c30977921a398d1900a6075b670c7dfed7 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 22:30:44 2011 +0200 Add info loglevel messages for x2goserver-extensions scripts. commit 5c17aea27c85250a2ab026f911a52b306a1bb21f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 22:28:47 2011 +0200 mark log messages with loglevel err with the string ERROR commit 97e675be340ef5c1d429acb22ab90074e2ec8a3e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 18:46:09 2011 +0200 Fix for x2godbwrapper.pm: we can't open/close the syslog socket in a package. This has to be done by the scripts that use x2godbwrapper.pm. commit 0b8db07480a50be05f8c1ffcd8a759bcf3677ee6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 18:37:10 2011 +0200 properly closing syslog socket commit 63a837ebf03771e6d87141d6ed95a6c3404c6664 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 18:25:23 2011 +0200 Add info loglevel messages for all scripts in bin dir. commit 2813be555b2d67ce6775495464df29b4fb1d02bb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 18:11:09 2011 +0200 fix line-too-long in changelog commit 0ccd51ec1e6075157f32d36807d6148856f43492 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 17:40:41 2011 +0200 Add debugging support for almost all DB functions in x2godbwrapper.pm, fix for Syslog module initialization in all Perl scripts. commit d8caab889be858d8c258cbc1e4d8e979c33ee84b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 17:16:03 2011 +0200 add package statement for x2gologlevel package commit 4e537256e5e37bdd35fcd79ebe71e4181d707fe0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 16:45:18 2011 +0200 dropping duplicate script x2gosessionlimit from lib dir commit f19f6dae198943c6803516d48de617f12bba7866 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 16:04:10 2011 +0200 fix for module import commit 291575906708c5ad6233fb114050f73895dea87a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 15:56:50 2011 +0200 comment update that explains different loglevels commit a2e61b7dc9b944c8cc31e8f9b2f1f46029106fdd Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 15:48:47 2011 +0200 Initialize Syslog module for all Perl scripts in x2goserver package. commit 518a0e4a5d56da0db6e0960a06ccdd3379d2f45b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 15:37:45 2011 +0200 Change x2gologlevel script into a Perl module (and a script that calls it). Using x2gologlevel function in x2goprint to set loglevel mask. commit 2c440f2a24fe624e9190918703102c2c9178e4c0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 13:56:20 2011 +0200 x2gologlevel delivers int (instead of str) so that Perl scripts can handle it immediately commit 134451de62c543656806be4efa1f7283ac76b677 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Sep 9 12:50:45 2011 +0200 Add script lib/x2gologlevel: introduce [log] section in x2goserver.conf with only parameter ,,loglevel''. commit 24d40c2a9e78dfdc7e1248469746112d3c469d1a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 8 17:38:45 2011 +0200 Fix x2goprint, add syslogging, add inline comments. commit db14c4eb01df94bf5a890e08dbc85af67adc8a9a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 8 01:29:05 2011 +0200 Add sanity checks to x2goprint, script can only be run as root. commit d48b906aad15e03612a617bac2dd8e9439a6c418 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 8 01:27:14 2011 +0200 postinst fix commit 277e82b2587ce9eda48cefe3147744922f8a6cbe Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 8 01:18:25 2011 +0200 revert test code in dbwrapper commit b41cd4b680777412305d16bb905ad18263b251ca Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 8 01:14:51 2011 +0200 revert setgid wrapper for x2goprint commit ef6b27b95f398b74c696e2376785caf58a94eff7 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Sep 8 00:04:27 2011 +0200 Partially revert setgid changes committed earlier. commit beed56213aa11751c94e4883b492c6669062a276 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 15:10:53 2011 +0200 Hand over creation of ~x2goprint to adduser script. commit 198de410e8667ce20a22d1645436153032e5369b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 14:46:02 2011 +0200 derive x2goprint.pl full path name properly commit 202f77be1052788a3a62738b75da084a8f329846 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 13:16:16 2011 +0200 fix for x2goprint install location commit 2491c255688ed59eb20ec9bd52deb2501184baf9 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 11:51:27 2011 +0200 now also installing x2goprint into the x2goserver package... (grml) commit f406286ff48cbeb567c7f6ee5ab35d4427f73671 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 11:43:24 2011 +0200 add permission setting for home dir commit 0d862d3b0be0dbf19d2f9de6863e4ba78ac6de1f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 11:42:20 2011 +0200 make sure permissions for /var/spool/x2goprint are set correctly commit 146357950bde2552222ebb1b522b855eefdb4855 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 11:31:29 2011 +0200 Purge section for x2goprint user and setgid bit on x2goprint wrapper in x2goserver.postrm. commit 66a3004afe55fe8209d8dfef9e88a68d1822a88a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 11:29:27 2011 +0200 remove x2gouser group and x2gousers group if empty... commit f8b7522b0a7f30507e74b579e8a2728cd7d62d97 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 11:21:10 2011 +0200 typo fix in postinst script commit 407004bc51006b4540915615f0a64298934921bd Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:30:03 2011 +0200 Update of x2goserver-compat.manpages DH config file. commit 3759d04f57d6a060a1eeaf0537012bb026c5a758 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:29:02 2011 +0200 Man pages of compat package moved to section 8, add man page for compat script x2gosuspend-agent, fix man page header of x2gosuspend man page. commit bc4411e52d17f949f548a153f732225121372367 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:26:41 2011 +0200 Lintian fix: debian-changelog-line-too long. commit bb7be650703fe3b527eba689d90adff4eb19ed87 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:21:36 2011 +0200 INSTALL howto update. commit 70524c9b9f2f151e38b96df897b288c7da996282 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:18:43 2011 +0200 Makefile update for x2goprint setgid wrapper. commit 218a891a0906bf64eec19dc6947d4f74468b003d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:14:14 2011 +0200 and... at last... a compat script... commit ce6e51d5b8c5936381ee90c34c7953166e6a5291 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:12:22 2011 +0200 ... and more man pages for x2goserver-extensions package commit 210dcfb45cee35c0c158dc4248d8ac93525a9e3e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:11:25 2011 +0200 ... and here the scripts x2gosessionlimit, x2golistsessions_root... commit 5d259f390c4be5a066d0b1b3eb08407acb33caa3 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:10:23 2011 +0200 Just realized, that I forgot to re-add many files after the /bin -> /lib migration in x2goserver source tree... So here come the man pages... commit b11852eba8e71eae911961f17f89ea2369f253ce Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:09:24 2011 +0200 Change X2go printing concept: use setgit and a sgid wrapper instead of sudo. commit 0abf3435029a4a1294c6295b48c4982b99606d26 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 09:06:12 2011 +0200 Create x2goprint user/group on package installation, add same info to INSTALL howto. Change permissions on x2goprint, using 2755:root:x2goprint (setgid). commit e9dba469011bf6d3d42f01fbc533257e53c90b50 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 30 08:09:18 2011 +0200 Spelling fix for error message. commit 56e53371f68ce6180f6d8d3b8ebbf625a8059f07 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Aug 22 23:29:54 2011 +0200 Fixing x2goserver.postinst commit 2d05fedca493fdd39d88b9ad9dd749fbeffc415a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Aug 19 18:58:57 2011 +0200 typo fix commit 014ed225f9711d2646c68f69768fe8f851dff617 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Fri Aug 19 18:58:32 2011 +0200 Silence x2golistsessions on missing session.log files. commit 7f66504124ba057dcf08f97176a317ad2d9e6816 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Aug 15 22:01:05 2011 +0200 remove redundant which call in x2goruncommand commit fb949522981f57ccd799b317dc8ba8b7e7891e95 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Aug 15 22:00:37 2011 +0200 Fix for TERMINAL command execution if konsole (KDE4) is installed on the server (closes upstream issue #87) commit ff81b92f52597a6119b9da355dcc49fd02535822 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Aug 15 21:53:26 2011 +0200 Add LibreOffice.org as possible OFFICE application to x2goruncommand. commit bf5c4bceef7408aa5bc8a915569c49f7191d2dcb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Aug 15 21:51:55 2011 +0200 indentation fix commit a140a74f7a9b690c3eaa379326dc21547c4e529e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Aug 15 21:15:06 2011 +0200 comment fix commit 0ddbb7e54bbe81feaa377b0cd43e3e8edd3fcb29 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Aug 15 21:12:26 2011 +0200 Add lxterminal as possible TERMINAL to x2goruncommand. commit 5b256f599e68d794315f1d2904e356c3951f4fd3 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Aug 15 21:11:25 2011 +0200 Add chromium-browser as possible WWWBROWSER to x2goruncommand. commit e57bc2ef74f2e92c8c1bfd9e5155ed63ebe03677 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Aug 14 21:34:55 2011 +0200 Add a note on fuse membership to printing section of INSTALL howto. commit fe730d34848f7377d4137c47ba6b6f3e95fe84f3 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Aug 14 21:33:25 2011 +0200 Add short note on X2go printing in INSTALL howto. commit 069f7ce89da967db35555f980ece7193d22ea2bf Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Aug 14 21:28:11 2011 +0200 Add INSTALL howto section for local folder sharing. commit 017593f5b041588b8ed3b0039d62f030ee600da6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Aug 14 21:25:25 2011 +0200 fixed numbering scheme in INSTALL howto commit e47d1d5fb315121719162ed8433923057a2b82d8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Aug 14 21:15:39 2011 +0200 Remove Debianisms from INSTALL howto. commit c56a4a0314608e1687024aae8ccde799113e21be Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 2 14:50:09 2011 +0200 INSTALL howto update commit 6fbc9a4762f26f3c52a8793bb61caab2d3391bda Author: Reinhard Tartler <siretart@tauware.de> Date: Tue Aug 2 10:26:53 2011 +0200 Do proper error checking in maintainer scripts Maintainer scripts need to be correct as they have the potential to corrupt the whole system. Never ever ignore error conditions but handle them gracefully. Moreover, don't ignore failures of scripts. If they fail, we definitly want to investigate why they fail and handle these conditions additionally. commit 86588f9e8dfaa1889422d7551e47af1cdafbe5f7 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Aug 2 07:12:52 2011 +0200 replaced bashism in x2goserver.postinst commit 98512e5a7e4f70822a19dc3d097a41bb7848cd11 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Aug 1 23:33:06 2011 +0200 fixes dpkg-statoverride on package removal/purge commit b58617cb9127091ff2b89d6e1c72f105ea746ab3 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Jul 31 00:28:22 2011 +0200 silencing misleading error output during x2goserver postinst commit f801701fc9cd6fe69215413d0626d6b78eebf351 Author: Patrick Willam <p.willam@gmx.de> Date: Sun Jul 31 00:02:38 2011 +0200 Fix for failing x2goresume-session script after removing hard-coded paths from all x2goserver scripts. commit 80df2bc1e1b6f6e810efeda11b338f9e4b40fc92 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 17:12:46 2011 +0200 also uninstall x2gosqlitewrapper (explicitly) commit 75f2ddb8af58ba29d0a0649ac8292bcfb5b862e3 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 17:11:01 2011 +0200 making uinstall through Makefile even more robust commit 929d55a4cb4bf0b7eed74465a493ca05cae2de7d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 17:06:59 2011 +0200 section typo commit f3ec5bdb621e04e4b29eb38991f4ecf3cfca0e1e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 17:03:57 2011 +0200 changing uninstall order of components, making uninstallation more robust commit 3c5a07a430075592b0312d275f00b8f30c6445f5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 17:01:06 2011 +0200 permission fix for scripts in lib/x2go commit 300a662ed1622d35b6be0a1a2044abc444a80a62 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:58:42 2011 +0200 installing x2gosqlitewrapper also through Makefile commit 58a8b61a31c38b74229bec3dd015a7540009db88 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:56:47 2011 +0200 calling build-arch when making build commit a108bf04a19f321aa96c0f780aa017e1111043f7 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:54:45 2011 +0200 fix for setgid part in Makefile commit 68e52a6e2c8441a7ff082310fdfc2f29570d188e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:54:38 2011 +0200 update of INSTALL file commit 6f1554f1dea846633c27c9e8aff4364688722809 Author: Git Administrator <hostmasters@das-netzwerkteam.de> Date: Thu Jul 28 16:48:33 2011 +0200 Add setgid for x2gosqlitewrapper to Makefile. commit 19d1ed0cd0eecef8afd021e2fff34cdce35fcc85 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:43:48 2011 +0200 typo commit 9c07dbbcc6022d4e8f40f5981a1220d84c9e15ba Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:42:28 2011 +0200 more Makefile fixes related to man pages. commit d52c8eeaebd500f07244e06be5c7283b65f58a51 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:40:40 2011 +0200 Makefile fix, uncommented SHAREDIR commit db26fb43234a1d3e0879b9ecf5df4e79811a429b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:38:52 2011 +0200 typo fix commit 4536197faa661ae139fd7699bf511789fc742226 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:37:56 2011 +0200 fixes man page sections in Makefile commit d77e38b37a34ccfd64fdbb80423cd69f0d3eb909 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:35:14 2011 +0200 Makefile fix for obsolete folder x2goserver/compat/bin commit 478cbc572681b63403636b56aab40a15b7bb9ffb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 16:21:27 2011 +0200 Add man page for x2gobasepath. commit ab07b1d03c276a4106637651722d81164685e114 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 15:15:26 2011 +0200 using x2gobasepath script whenever we have to find the X2GO_LIB dir commit d6c30f9c25311af437cccc01414b41d44bde069a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 15:09:45 2011 +0200 syntax fix commit 25ba5146368926f5137e7a79abdcffc753c5c02f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 15:05:01 2011 +0200 Add x2gobasepath script to reliably detect x2goserver install path. commit d5e69533693c555b2ca8b280a3247b35e81104c2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 14:39:22 2011 +0200 x2gocleansessions fix for $X2GO_LIB_PATH changes commit 2b7f970dde5a9fad4446de16f9f24bb92be23f60 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:52:20 2011 +0200 path fix for $x2go_lib_path in x2godbwrapper.pm commit 291a0f8f085991d8cd54891bbf8507046cc9fd5d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:47:23 2011 +0200 enable x2gosqlitewrapper to find x2gosqlitewrapper.pl again (same folder now) commit a67576ec6300d8037bef5b748899472ec9ef0a55 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:35:34 2011 +0200 add dh doc install script commit f106b6c22c68f2f7d4cba48b85d09e09cc23b4f9 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:31:54 2011 +0200 add man page for x2gosessionlimit commit 8dc25cdefd6c979b0f4869708b8b52fcd38d98b2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:29:22 2011 +0200 provide man pages for all script in $PREFIX/sbin commit 7f5de278dee5c1d7711342c848e5afe69130d402 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:29:08 2011 +0200 add version file for x2goserver-compat package commit f57491ef0d0de756f949992a3922f2269d161d0d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:24:26 2011 +0200 man pages for x2goserver-compat complete (for now) commit ee9c60cfb9cdc1933d1fbcea549841fe32f7ffdd Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:18:50 2011 +0200 updated man page section (8 -> 1) commit 6f747eb1f19811bbeb303609b63e65123aec2be1 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:17:44 2011 +0200 updated man page section (8 -> 1) commit 53bea426489767381ad61df1803611098fc19832 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:15:06 2011 +0200 moved x2gosqlitewrapper into $PREFIX/lib/x2go commit 14ef31a4ebf938da5e560bf182b23f4ad898493a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:11:55 2011 +0200 x2gosqlitewrapper -> $PREFIX/lib/x2go, removal of compat scripts from x2goserver package commit bbb9cc872d179f40c461d7b857d33b23fbeea0ae Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:11:08 2011 +0200 Makefiles, control file update (for package x2goserver-compat) commit 23ef05aa2005114d2fc54427df4de42017622882 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:10:06 2011 +0200 moved man pages of x2goserver-extensions from section 8 -> 1 commit 7f76f3f2db65d2875393d6e4b81ecc11bf41058c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:09:05 2011 +0200 moved compat scripts into separate package x2goserver-compat commit a23075dbc2cf330e3a184c8d9a2fe4f0ae770c86 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 13:06:39 2011 +0200 man page separation (section 1 + 8) commit 735526b3640021149403487b1d224bc3e5296bbe Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 11:55:39 2011 +0200 ooopps... lost the first line... commit 3f53e3c7a2b9640ed1ec06fb086d0ec5a3af086b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 11:49:12 2011 +0200 X2GO_LIB_PATH fix for x2golistsessions_root commit f576ea238ca175fab39b9b8d86c9a0204d0a776a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 11:16:01 2011 +0200 syntax fix commit 09dcc668cc5bc83e810b5878a3de81cf31ba1330 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 11:14:03 2011 +0200 moved x2golistsessions_root to $PREFIX/sbin commit dfea39939eab0730a93cd5d5876d065e787a4703 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 11:09:03 2011 +0200 adapting x2golistsessions_root to new $PREFIX/lib/x2go path commit 1b215fb5eb64fb8f0512cd2bc1571a9a551fb512 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 10:58:59 2011 +0200 relying on $PATH, not using full paths at all commit 39e6fcac5c60c43e3849e9f214aaf27ae06d013f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 10:58:23 2011 +0200 moved x2gosessionlimit to $PREFIX/bin commit 6fbd20b43e0b2eb1760e4f13ecc5ba016903b407 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 10:57:48 2011 +0200 tab fix commit ee439b1b82da703178fa2ebcbc45981d475200ee Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 10:49:35 2011 +0200 line-too-long fix for Debian changelog commit f670104e54b5280400fad3108ddf7b124c2c43f2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 10:45:41 2011 +0200 re-added lost/moved script x2gosuspend-agent commit e658a07c74ec97c7c9b60b6f1e3f54a8d0377cb5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 28 10:44:16 2011 +0200 Install internal x2goserver scripts to /usr/lib/x2go, make sure scripts in /usr/bin find these scripts. commit 45902ab4ea718057ff30f020f7b3a11154814248 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jul 26 13:33:47 2011 +0200 re-arranged server-side paths for man pages commit 7587523ca9c476ef105592bbcaa0572d712e50ae Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jul 26 13:26:47 2011 +0200 add Makefile.docupload to provide html man pages ttw. commit e4181ea96cc5b9db7535afc8cfd6a8e25f6c52a6 Author: Reinhard Tartler <siretart@tauware.de> Date: Tue Jul 26 08:45:31 2011 +0200 restore behavior that allows 'root' to execute any command b053c030b22066f5a712e2c4dd25c0be0f7dc256 restricted certain commands to act only on the respective user. However, the user 'root' still needs to be able to execute any command. commit 4d1f7d1127e0b50df3c63b8d2f8807a63e1a5bc8 Author: Reinhard Tartler <siretart@tauware.de> Date: Mon Jul 25 20:56:25 2011 +0200 fix $realuser variable after 6ec99657c4be82fe659cf3d13614be7a9734a380 Obviously, the code assumes that $realuser contains the user name instead of the userid. This should unbreak for instance the cleanup daemon after switching from sudo to perlsuid. commit 3366992d7d48caecf15d10a3f304182c5f3e321d Author: Reinhard Tartler <siretart@tauware.de> Date: Mon Jul 25 00:07:53 2011 +0200 Allow users to edit their *own* sessions only previously, users could create sessions under wrong uids or delete sessions from other users. This patch implements prevents this by checking the userid of the caller with the session id. commit 21942339045ffff12d447b8280f7b27352f87197 Author: Reinhard Tartler <siretart@tauware.de> Date: Mon Jul 25 19:38:17 2011 +0200 Remove files that get cleaned by the Makefile commit a0ad10380b7fbf72807b435915478f57a651e640 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jul 19 16:28:01 2011 +0200 /var/lib/x2go FHS path fixup in x2goserver.dirs commit 905cbbeb90c7f5e875a7bd169215db6d0767056f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jul 19 16:03:55 2011 +0200 Tab'ified (forgotten) scripts in x2goserver-extensions package. commit 6666866026ffa7d038f66ab2e3511c6cd63bf1c6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jul 19 16:02:21 2011 +0200 Tab'ified (forgotten) init script. commit 6857da441eecf0d392ce111470bea6c40d9e3685 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jul 19 16:00:34 2011 +0200 Tab'ified (forgotten) scripts in /usr/sbin. commit 7e850a0497496bcc1871673fcace660fa402a89d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Tue Jul 19 15:20:26 2011 +0200 Store SQLite db in /var/lib/x2go to comply to latest FHS. commit 24eff92c2d792b9f244c1d3fb29341bb434f9ccc Author: Moritz 'Morty' Strübe <morty@gmx.net> Date: Tue Jul 19 12:00:20 2011 +0000 Fix copyleft commit 6bd23bd8ab95c5d8e7296049f3197e1de46f6f6b Author: Moritz 'Morty' Strübe <morty@gmx.net> Date: Mon Jul 18 12:47:39 2011 +0200 Make S-bit wrapper more robust commit ddf08d21857b9a5876b7398f6b9deb024b265e73 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 23:37:54 2011 +0200 x2godbadmin: write access to /var/db/x2go for egid x2gouser commit be5284d63ce14b8565aeb36b850035e063a74b6c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 23:36:49 2011 +0200 write access to /var/db/x2go for egid x2gouser. commit 71faaac9efd39f7339fd2f4675f182380223aa0f Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 23:33:32 2011 +0200 dh_dirs fix, create /var/db/x2go instead of /var/lib/x2go commit d7ee2a6f2266e78323ead8940df6703afac60ccb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 23:26:07 2011 +0200 syntax fix for usermod used in x2goserver.postinst commit 218f930eee01fed942bc8e8f778cfe503fee875c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 23:25:43 2011 +0200 line lenght fix for changelog commit 5e3637dfc6d0fd9506d1f5a91b2bf0ff553c9b81 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 23:15:11 2011 +0200 debian-changelog-line-too-long line 14 commit d6a8716bc241d22fdb9e34e1484d186bc54bfad9 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 23:05:03 2011 +0200 make sure the x2gouser has correct home dir and shell commit e7230c9cda789c4d215f5b2e9d1d02293c593949 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 23:00:55 2011 +0200 add some more cleanup for x2goserver versions that installed to /var/lib/x2go commit ea10346653e2eddff339cd62225ab508d6f5517a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 22:55:15 2011 +0200 permissions fix commit 268c559147083f1c2439befda9d2aefe94c94628 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 22:54:58 2011 +0200 make old x2gousers group warning louder commit a9a204693b922f6cf742b1cc2582d0597be25788 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 22:45:41 2011 +0200 path fix commit 4af32b75c6effdbd11a4a54ed830a8b13a1f9dc3 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 22:36:19 2011 +0200 fix for dpkg-statoverride in x2goserver.postinst script commit 5503c7bbb6bdb7d01dd7f65e64b0e61eea2bb0d2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 22:19:07 2011 +0200 fixed x2goserver.preinst script... commit ed302ff6f618edd1072cf97d12e26ee8ca9629c2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 22:07:20 2011 +0200 run x2goserver.postinst configure also on upgrades commit 82ace2748b0409d064df00e18f97be2c1d34e15c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 21:58:16 2011 +0200 x2goserver.postrm fix commit a3a333951634afccb4e22b7c4f116febc6622dc9 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 21:57:58 2011 +0200 Update of INSTALL, UNINSTALL file. commit a333e079faa9116d9002d8d8efd141672825d5a8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 21:49:26 2011 +0200 Make sure upgrades from old x2goserver versions work more cleanly. commit d40bfbdb762dceac35985966e444518947b4869d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 21:47:02 2011 +0200 indentation fix commit 5ffd06b14d6820c40262bf14a67b2245c2687ea1 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 21:38:33 2011 +0200 Tab'ified postinst/postrm scripts. commit 72044358fefe7f85abeb3a1f445dbdc9afdafe1c Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 21:19:21 2011 +0200 Switch to setgid instead of setuid for SQLite wrapper. commit 2bfaa5d8768169eb7a53119d60951e806f10ed7a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Mon Jul 18 18:02:13 2011 +0200 Revert "disabled perlsuid check..." This reverts commit 82c6545adef362a9d759b5ddf41473af052156c7. commit c010848a801c638c1c91680a2025f8c6e5c4f767 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Jul 17 21:57:37 2011 +0200 Breaks/replaces packages: x2goserver-one, x2goserver-home, x2goprint (instead of Conflicts). commit 08aeff25af7d0169bbe640f1ad4ff35aeda6c7bb Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Jul 17 21:52:09 2011 +0200 * Fix of Debian clean rules, fix of Makefile's clean rules. commit 6b26017aa6402f53664aed8bb086f7ffd8185aa0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Jul 17 21:50:36 2011 +0200 make man2html build easily available in base folder's Makefile commit 7fa6e85fec9ad10276f3c08cc5bd9ce96165ee09 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Jul 17 21:50:08 2011 +0200 rebuilt html man pages commit 77544876338c1baf237f6ad8a3d4a9a93ada1887 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Jul 17 21:47:43 2011 +0200 Use source format 3.0 (native). commit a5c56b347a83dd786f40bb5603852fbe7ee91c95 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 14 14:07:37 2011 +0200 Provide C wrapper for setuid call of x2gosqlitewrapper.pl. Remove dependency from perlsuid. commit 757ff486312c57598c55a34e848ec09e74cb9474 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 14 14:04:50 2011 +0200 let package build with setuidwrapper commit 85c48dda313b0512d8a322f82e2c050b03ee39a0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 14 14:04:02 2011 +0200 fix for typo that stem from indentation cleanup commit affdd3999fb861329a91673fa78d5af1394874ff Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 14 14:03:40 2011 +0200 disabled perlsuid check... commit 8d01703b62f80b09de720494669696d96539d7ea Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 14 14:03:00 2011 +0200 fix setuidwrapper script (accept options as x2gosqlitewrapper.pl does) commit 14408a4977885dc018df86c3e99e3a990744b00d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 14 14:02:29 2011 +0200 rebuilt html man pages commit 93da053b174687f1a5190594b5542eef99f55268 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 14 14:00:17 2011 +0200 Fixup for Conflicts stanza, make x2goserver-extensions binNMUable again. commit 259b54fda768912f281ac2a98564e21f35ab5c3e Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 14 13:00:01 2011 +0200 Add setuidwrapper to x2goserver package to replace usage of perlsuid. commit 95fbea12105d81206e03141c9a29e72e3106a7fa Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 14 12:59:01 2011 +0200 x2goresume is no compat script, moving it to /lib dir commit 1dd6b78799ca8a04505e17114576a30dca9d820d Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Jul 14 12:58:30 2011 +0200 re-arranged compat scripts commit 52995fb26588a756a22bf8aa80d3c0ac3dffd3f0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Jul 13 22:57:20 2011 +0200 Fix for x2gomountdirs, now also usernames containing blanks can use local folder sharing. commit 14e8e53a22a18c9470b507f6efa82a656365785a Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Jul 13 21:35:22 2011 +0200 Tab'ified all script files, proper indentation, coding style. commit 1adbbac7b8741894a820762c88b17d5edd6319d6 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Jul 13 09:24:12 2011 +0200 Re-arranged script files in /bin and /lib directories, this is still compensated by dh_install and dh_link and needs more work. commit 8bbde2e3a9aa6209bf7ccff74753b8693f5f57f5 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Jul 13 09:20:54 2011 +0200 rebuilt html man pages commit fa9c5da9b13e7e3ca1acf71e6f8e87908f5beec2 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Jul 13 09:20:11 2011 +0200 added man pages commit f6cc0932dbb8a7d050bd90a061a48b4403ccaa0b Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Jul 13 09:18:13 2011 +0200 removed setuidwrapper test code commit 9b8d1300d52f84176fcea36a0f785e30cc00e722 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Wed Jul 13 08:51:48 2011 +0200 removed tab ----------------------------------------------------------------------- Summary of changes: INSTALL | 86 ++- Makefile | 31 +- Makefile.docupload | 34 + UNINSTALL | 2 +- debian/changelog | 147 +++- debian/control | 95 ++- debian/rules | 7 + debian/source/format | 1 + debian/x2goserver-compat.docs | 1 + debian/x2goserver-compat.install | 2 + debian/x2goserver-compat.manpages | 1 + debian/x2goserver-extensions.install | 4 +- ...er-extensions.dirs => x2goserver-printing.dirs} | 0 debian/x2goserver-printing.docs | 1 + debian/x2goserver-printing.install | 3 + debian/x2goserver-printing.lintian-overrides | 1 + debian/x2goserver-printing.manpages | 1 + debian/x2goserver-printing.postinst | 87 ++ ...2goserver.postrm => x2goserver-printing.postrm} | 27 +- ...er-extensions.dirs => x2goserver-xsession.dirs} | 2 +- debian/x2goserver-xsession.docs | 1 + debian/x2goserver-xsession.install | 3 + debian/x2goserver.init | 32 +- debian/x2goserver.install | 14 +- debian/x2goserver.link | 2 + debian/x2goserver.lintian-overrides | 1 + debian/x2goserver.postinst | 115 ++- debian/x2goserver.postrm | 32 +- debian/x2goserver.preinst | 45 + .../Makefile | 24 +- x2goserver-compat/VERSION.x2goserver-compat | 1 + .../bin/x2gosuspend | 11 +- .../bin/x2gosuspend-agent | 0 .../bin/x2goterminate | 0 x2goserver-compat/man/man8/x2gosuspend-agent.8 | 23 + x2goserver-compat/man/man8/x2gosuspend.8 | 23 + x2goserver-compat/man/man8/x2goterminate.8 | 23 + .../share/x2gofeature.d/x2goserver-compat.features | 20 +- .../html/man8/x2gosetkeyboard.8.html | 61 -- .../.build_man2html/html/man8/x2goversion.8.html | 69 -- x2goserver-extensions/Makefile | 51 +- .../VERSION.x2goserver-extensions | 2 +- .../bin/{x2goversion => x2goserver-run-extensions} | 38 +- x2goserver-extensions/bin/x2gosetkeyboard | 32 +- .../man/man8/x2goserver-run-extensions.8 | 87 ++ x2goserver-extensions/man/man8/x2gosetkeyboard.8 | 5 + .../x2gofeature.d/x2goserver-extensions.features | 27 +- .../Makefile | 23 +- x2goserver-printing/VERSION.x2goserver-printing | 1 + x2goserver-printing/bin/x2goprint | 142 +++ x2goserver-printing/man/man8/x2goprint.8 | 64 ++ .../x2gofeature.d/x2goserver-printing.features | 19 +- x2goserver-xsession/Makefile | 95 ++ x2goserver-xsession/VERSION.x2goserver-xsession | 1 + x2goserver-xsession/doc/README.Xsession-x2go | 15 + x2goserver-xsession/etc/Xresources | 1 + x2goserver-xsession/etc/Xsession | 121 +++ x2goserver-xsession/etc/Xsession.d | 1 + x2goserver-xsession/etc/Xsession.options | 1 + .../x2gofeature.d/x2goserver-xsession.features | 20 +- .../html/man8/x2gocleansessions.8.html | 49 -- .../html/man8/x2golistsessions.8.html | 49 -- .../.build_man2html/html/man8/x2gomountdirs.8.html | 49 -- .../.build_man2html/html/man8/x2goprint.8.html | 49 -- .../html/man8/x2goresume-session.8.html | 49 -- .../html/man8/x2goruncommand.8.html | 49 -- .../html/man8/x2gostartagent.8.html | 49 -- .../html/man8/x2gosuspend-session.8.html | 49 -- .../html/man8/x2goterminate-session.8.html | 49 -- .../html/man8/x2goumount-session.8.html | 49 -- .../.build_man2html/html/man8/x2goumount.8.html | 49 -- x2goserver/Makefile | 39 +- x2goserver/VERSION.x2goserver | 2 +- x2goserver/bin/{x2gogetservers => x2gobasepath} | 11 +- x2goserver/bin/x2gocmdexitmessage | 7 +- .../bin/x2goversion => x2goserver/bin/x2gofeature | 35 +- x2goserver/bin/x2golistdesktops | 61 +- .../bin/{x2gochangestatus => x2golistmounts} | 18 +- x2goserver/bin/x2golistsessions | 83 +- x2goserver/bin/x2gomountdirs | 332 ++++---- x2goserver/bin/x2goprint | 82 -- x2goserver/bin/x2goresume-session | 52 +- x2goserver/bin/x2goruncommand | 175 +++-- x2goserver/bin/x2gosessionlimit | 95 ++- x2goserver/bin/x2goshowblocks | 18 +- x2goserver/bin/x2gostartagent | 278 +++---- x2goserver/bin/x2gosuspend-session | 36 +- x2goserver/bin/x2goterminate-session | 39 +- x2goserver/bin/x2goumount-session | 178 +++-- .../bin/x2goversion | 6 +- x2goserver/etc/x2goserver.conf | 8 +- x2goserver/lib/a.out | Bin 6867 -> 0 bytes x2goserver/lib/setuidwrapper.c | 12 - x2goserver/lib/test.py | 9 - x2goserver/{bin => lib}/x2gochangestatus | 12 +- x2goserver/{bin => lib}/x2gocreatesession | 10 +- x2goserver/lib/x2godbwrapper.pm | 912 ++++++++++---------- .../{bin/x2gochangestatus => lib/x2gogetagent} | 14 +- x2goserver/{bin => lib}/x2gogetdisplays | 14 +- x2goserver/{bin => lib}/x2gogetports | 15 +- .../{bin/x2gochangestatus => lib/x2gogetservers} | 15 +- x2goserver/{bin => lib}/x2goinsertport | 10 +- x2goserver/{bin => lib}/x2goinsertsession | 11 +- x2goserver/{bin => lib}/x2golistsessions_sql | 27 +- .../{bin/x2gogetservers => lib/x2gologlevel} | 6 +- x2goserver/{bin/x2goumount => lib/x2gologlevel.pm} | 62 +- x2goserver/{bin => lib}/x2goresume | 11 +- .../x2gosqlitewrapper => lib/x2gosqlitewrapper.pl} | 52 +- x2goserver/{bin => lib}/x2gosuspend-agent | 15 +- .../{bin/x2gochangestatus => lib/x2gosyslog} | 16 +- .../man8/{x2golistsessions.8 => x2gobasepath.8} | 11 +- x2goserver/man/man8/x2gocleansessions.8 | 3 +- x2goserver/man/man8/x2gocmdexitmessage.8 | 28 + x2goserver/man/man8/x2godbadmin.8 | 24 + x2goserver/man/man8/x2gofeature.8 | 29 + x2goserver/man/man8/x2golistdesktops.8 | 36 + x2goserver/man/man8/x2golistmounts.8 | 37 + x2goserver/man/man8/x2golistsessions.8 | 40 +- x2goserver/man/man8/x2golistsessions_root.8 | 29 + x2goserver/man/man8/x2gomountdirs.8 | 53 ++- x2goserver/man/man8/x2goresume-session.8 | 18 +- x2goserver/man/man8/x2goruncommand.8 | 36 +- .../man/man8/{x2goprint.8 => x2gosessionlimit.8} | 11 +- x2goserver/man/man8/x2goshowblocks.8 | 26 + x2goserver/man/man8/x2gostartagent.8 | 74 ++- x2goserver/man/man8/x2gosuspend-session.8 | 17 +- x2goserver/man/man8/x2goterminate-session.8 | 15 +- x2goserver/man/man8/x2goumount-session.8 | 28 +- x2goserver/man/man8/x2goumount.8 | 22 - x2goserver/man/man8/x2goumount_session.8 | 1 + .../man/man8/x2goversion.8 | 3 + x2goserver/sbin/x2gocleansessions | 157 ++-- x2goserver/sbin/x2godbadmin | 902 ++++++++++--------- x2goserver/{bin => sbin}/x2golistsessions_root | 72 +- .../x2gofeature.d/x2goserver.features} | 30 +- x2goserver/x2gosqlitewrapper.c | 78 ++ 136 files changed, 4085 insertions(+), 2791 deletions(-) create mode 100644 Makefile.docupload create mode 100644 debian/source/format create mode 100644 debian/x2goserver-compat.docs create mode 100644 debian/x2goserver-compat.install create mode 100644 debian/x2goserver-compat.manpages copy debian/{x2goserver-extensions.dirs => x2goserver-printing.dirs} (100%) create mode 100644 debian/x2goserver-printing.docs create mode 100644 debian/x2goserver-printing.install create mode 100644 debian/x2goserver-printing.lintian-overrides create mode 100644 debian/x2goserver-printing.manpages create mode 100755 debian/x2goserver-printing.postinst copy debian/{x2goserver.postrm => x2goserver-printing.postrm} (52%) copy debian/{x2goserver-extensions.dirs => x2goserver-xsession.dirs} (81%) create mode 100644 debian/x2goserver-xsession.docs create mode 100644 debian/x2goserver-xsession.install create mode 100644 debian/x2goserver.link create mode 100644 debian/x2goserver.lintian-overrides create mode 100755 debian/x2goserver.preinst copy {x2goserver-extensions => x2goserver-compat}/Makefile (77%) create mode 100644 x2goserver-compat/VERSION.x2goserver-compat rename x2goserver/bin/x2gogetagent => x2goserver-compat/bin/x2gosuspend (88%) copy {x2goserver => x2goserver-compat}/bin/x2gosuspend-agent (100%) rename {x2goserver => x2goserver-compat}/bin/x2goterminate (100%) create mode 100644 x2goserver-compat/man/man8/x2gosuspend-agent.8 create mode 100644 x2goserver-compat/man/man8/x2gosuspend.8 create mode 100644 x2goserver-compat/man/man8/x2goterminate.8 copy x2goserver/bin/x2gocmdexitmessage => x2goserver-compat/share/x2gofeature.d/x2goserver-compat.features (63%) delete mode 100644 x2goserver-extensions/.build_man2html/html/man8/x2gosetkeyboard.8.html delete mode 100644 x2goserver-extensions/.build_man2html/html/man8/x2goversion.8.html copy x2goserver-extensions/bin/{x2goversion => x2goserver-run-extensions} (52%) create mode 100644 x2goserver-extensions/lib/extensions/fail-resume.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/fail-runcommand.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/fail-start.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/fail-suspend.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/fail-terminate.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/post-resume.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/post-runcommand.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/post-start.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/post-suspend.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/post-terminate.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/pre-resume.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/pre-runcommand.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/pre-start.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/pre-suspend.d/.placeholder create mode 100644 x2goserver-extensions/lib/extensions/pre-terminate.d/.placeholder create mode 100644 x2goserver-extensions/man/man8/x2goserver-run-extensions.8 copy x2goserver/bin/x2goterminate-session => x2goserver-extensions/share/x2gofeature.d/x2goserver-extensions.features (61%) copy {x2goserver-extensions => x2goserver-printing}/Makefile (77%) create mode 100644 x2goserver-printing/VERSION.x2goserver-printing create mode 100755 x2goserver-printing/bin/x2goprint create mode 100644 x2goserver-printing/man/man8/x2goprint.8 copy x2goserver/bin/x2gocmdexitmessage => x2goserver-printing/share/x2gofeature.d/x2goserver-printing.features (64%) create mode 100755 x2goserver-xsession/Makefile create mode 100644 x2goserver-xsession/VERSION.x2goserver-xsession create mode 100644 x2goserver-xsession/doc/README.Xsession-x2go create mode 120000 x2goserver-xsession/etc/Xresources create mode 100755 x2goserver-xsession/etc/Xsession create mode 120000 x2goserver-xsession/etc/Xsession.d create mode 120000 x2goserver-xsession/etc/Xsession.options copy x2goserver/bin/x2gocmdexitmessage => x2goserver-xsession/share/x2gofeature.d/x2goserver-xsession.features (64%) delete mode 100644 x2goserver/.build_man2html/html/man8/x2gocleansessions.8.html delete mode 100644 x2goserver/.build_man2html/html/man8/x2golistsessions.8.html delete mode 100644 x2goserver/.build_man2html/html/man8/x2gomountdirs.8.html delete mode 100644 x2goserver/.build_man2html/html/man8/x2goprint.8.html delete mode 100644 x2goserver/.build_man2html/html/man8/x2goresume-session.8.html delete mode 100644 x2goserver/.build_man2html/html/man8/x2goruncommand.8.html delete mode 100644 x2goserver/.build_man2html/html/man8/x2gostartagent.8.html delete mode 100644 x2goserver/.build_man2html/html/man8/x2gosuspend-session.8.html delete mode 100644 x2goserver/.build_man2html/html/man8/x2goterminate-session.8.html delete mode 100644 x2goserver/.build_man2html/html/man8/x2goumount-session.8.html delete mode 100644 x2goserver/.build_man2html/html/man8/x2goumount.8.html copy x2goserver/bin/{x2gogetservers => x2gobasepath} (76%) copy x2goserver-extensions/bin/x2goversion => x2goserver/bin/x2gofeature (56%) copy x2goserver/bin/{x2gochangestatus => x2golistmounts} (76%) delete mode 100755 x2goserver/bin/x2goprint rename {x2goserver-extensions => x2goserver}/bin/x2goversion (89%) delete mode 100755 x2goserver/lib/a.out delete mode 100644 x2goserver/lib/setuidwrapper.c delete mode 100755 x2goserver/lib/test.py copy x2goserver/{bin => lib}/x2gochangestatus (84%) rename x2goserver/{bin => lib}/x2gocreatesession (85%) copy x2goserver/{bin/x2gochangestatus => lib/x2gogetagent} (80%) rename x2goserver/{bin => lib}/x2gogetdisplays (78%) rename x2goserver/{bin => lib}/x2gogetports (79%) copy x2goserver/{bin/x2gochangestatus => lib/x2gogetservers} (79%) rename x2goserver/{bin => lib}/x2goinsertport (84%) rename x2goserver/{bin => lib}/x2goinsertsession (84%) rename x2goserver/{bin => lib}/x2golistsessions_sql (69%) rename x2goserver/{bin/x2gogetservers => lib/x2gologlevel} (91%) rename x2goserver/{bin/x2goumount => lib/x2gologlevel.pm} (53%) mode change 100755 => 100644 rename x2goserver/{bin => lib}/x2goresume (83%) rename x2goserver/{bin/x2gosqlitewrapper => lib/x2gosqlitewrapper.pl} (87%) rename x2goserver/{bin => lib}/x2gosuspend-agent (79%) rename x2goserver/{bin/x2gochangestatus => lib/x2gosyslog} (77%) copy x2goserver/man/man8/{x2golistsessions.8 => x2gobasepath.8} (51%) create mode 100644 x2goserver/man/man8/x2gocmdexitmessage.8 create mode 100644 x2goserver/man/man8/x2godbadmin.8 create mode 100644 x2goserver/man/man8/x2gofeature.8 create mode 100644 x2goserver/man/man8/x2golistdesktops.8 create mode 100644 x2goserver/man/man8/x2golistmounts.8 create mode 100644 x2goserver/man/man8/x2golistsessions_root.8 rename x2goserver/man/man8/{x2goprint.8 => x2gosessionlimit.8} (58%) create mode 100644 x2goserver/man/man8/x2goshowblocks.8 delete mode 100644 x2goserver/man/man8/x2goumount.8 create mode 120000 x2goserver/man/man8/x2goumount_session.8 rename {x2goserver-extensions => x2goserver}/man/man8/x2goversion.8 (88%) rename x2goserver/{bin => sbin}/x2golistsessions_root (55%) copy x2goserver/{bin/x2gosuspend-session => share/x2gofeature.d/x2goserver.features} (57%) create mode 100644 x2goserver/x2gosqlitewrapper.c The diff of changes is: diff --git a/INSTALL b/INSTALL index a189806..15a0dfb 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,25 @@ TARBALL INSTALLATION OF x2goserver ================================== -1.) INSTALL x2goserver FILES +1.) USERS + GROUPS for X2go +--------------------------- +Set up x2gouser account and its group if they do not exist +already: + + $ groupadd --system x2gouser + $ useradd --system --no-create-home \ + --shell /bin/false --home /var/lib/x2go x2gouser + +Set up x2goprint account and its group if they do not exist +already: + + $ groupadd --system x2goprint + $ useradd --system \ + --shell /bin/false --home /var/spool/x2goprint x2goprint + $ chown x2goprint:x2goprint ~x2goprint + $ chmod 0770 ~x2goprint + +2.) INSTALL x2goserver FILES ----------------------------- Extract tarball and run @@ -10,22 +28,18 @@ Extract tarball and run in base folder of the extracted tarball. -2.) USER + GROUP for X2go -------------------------- -Set up x2gouser account and its group if they do not exist -already: +3.) SGID GROUP +-------------- +Configure ownership, permissions and setgid group bits of x2gosqlitewrapper and x2goprint: - $ addgroup --system x2gousers - $ adduser --system --no-create-home \ - --disabled-password --disabled-login \ - --shell /bin/false --group --home /var/lib/x2go x2gouser + NOTE: The described actions have already been performed by the Makefile + run, leaving this here for documentation only. -3.) SUID USER -------------- -Configure ownership, permissions and setuid user bit of x2gosqlitewrapper: + $ chown root:x2gouser /usr/lib/x2go/x2gosqlitewrapper + $ chmod 2755 /usr/lib/x2go/x2gosqlitewrapper - $ chown x2gouser:x2gousers /usr/bin/x2gosqlitewrapper - $ chmod 6755 /usr/bin/x2gosqlitewrapper + $ chown root:x2goprint /usr/bin/x2goprint + $ chmod 2755 /usr/bin/x2goprint 4.) INIT SCRIPT @@ -38,16 +52,44 @@ Alternatively, you can add a single line to /etc/rc.local: /usr/local/sbin/x2gocleansessions & -5.) OPTIONAL: PostgreSQL setup ------------------------------- -This last step is optional and is only needed for a setup of x2goserver -with PostgreSQL as database backend... +5.) LOCAL FOLDER SHARING +------------------------ +Users that shall be able to use X2go's local folder sharing functionality (via sshfs) +have to be members of your server system's ,,fuse'' group + + $ usermod -a -G fuse <username> -When using PostgreSQL the following steps are necessary: - $ chmod 700 /etc/x2go/x2gosql/passwords - $ touch /etc/x2go/x2gosql/passwords/pgadmin - $ chmod 600 /etc/x2go/x2gosql/passwords/pgadmin +6.) PRINTING +------------ +Also users that shall be able to send print jobs to client-side printers have to be +members of the server-side ,,fuse'' group (see above). + +As X2go printing setups can be rather versatile, details on X2go printing are explained in +the project's wiki: +http://wiki.x2go.org/installing_x2go_printing_debian_ubuntu + + +7.) DATABASE SETUP (SQLite only) +-------------------------------- + $ x2godbadmin --createdb +7a.) DEFAULT: SQLite setup +-------------------------- +This variant is the default X2go database setup. The X2go database keeps track of +running/suspended/finished X2go sessions, mounted devices, etc. If you use SQLite +as DB backend, X2go will run on one single server. + +For multi-X2goServer support use the PostgreSQL setup variant of X2go server. All files +should be present for this setup. If not, please report it as a bug. + + +7b.) ALTERNATIVE: PostgreSQL setup +---------------------------------- +This variant is for a setup of x2goserver that uses a PostgreSQL database backend... + +The exact installation of x2goserver with PostgreSQL support is described here: +http://wiki.x2go.org/adding_x2go_server_postgresql_support + diff --git a/Makefile b/Makefile index 444112f..657dcfc 100755 --- a/Makefile +++ b/Makefile @@ -2,22 +2,49 @@ all: build -build: build-indep +build: build-arch build-indep + +# make man2html build available from project's base folder... +build_man2html: + cd x2goserver && make $@ + cd x2goserver-printing && make $@ + cd x2goserver-compat && make $@ + cd x2goserver-extensions && make $@ + cd x2goserver-xsession && make $@ clean: cd x2goserver && make $@ + cd x2goserver-printing && make $@ + cd x2goserver-compat && make $@ + cd x2goserver-extensions && make $@ + cd x2goserver-xsession && make $@ + +build-arch: + cd x2goserver && make $@ + cd x2goserver-printing && make $@ + cd x2goserver-compat && make $@ cd x2goserver-extensions && make $@ + cd x2goserver-xsession && make $@ build-indep: cd x2goserver && make $@ + cd x2goserver-printing && make $@ + cd x2goserver-compat && make $@ cd x2goserver-extensions && make $@ + cd x2goserver-xsession && make $@ install: cd x2goserver && make $@ + cd x2goserver-printing && make $@ + cd x2goserver-compat && make $@ cd x2goserver-extensions && make $@ + cd x2goserver-xsession && make $@ uninstall: - cd x2goserver && make $@ cd x2goserver-extensions && make $@ + cd x2goserver-compat && make $@ + cd x2goserver-printing && make $@ + cd x2goserver && make $@ + cd x2goserver-xsession && make $@ diff --git a/Makefile.docupload b/Makefile.docupload new file mode 100644 index 0000000..70dfc1c --- /dev/null +++ b/Makefile.docupload @@ -0,0 +1,34 @@ +#!/usr/bin/make -f +# Makefile.docupload file - for x2goserver +# Copyright 2010-2011 by Mike Gabriel <mike.gabriel@das-netzwerkteam.de>, GPLv3 applies to this file + +VERSION=`head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,' | cut -d"-" -f1` +DOC_HOST=code.x2go.org +DOC_PATCH_x2goserver=/srv/sites/x2go.org/packages/doc/x2goserver/man/ +DOC_PATCH_printing=/srv/sites/x2go.org/packages/doc/x2goserver-printing/man/ +DOC_PATCH_compat=/srv/sites/x2go.org/packages/doc/x2goserver-compat/man/ +DOC_PATCH_extensions=/srv/sites/x2go.org/packages/doc/x2goserver-extensions/man/ +DOC_USER=x2go-admin + +all: doc + +doc: clean docbuild docupload + +docbuild: + make -f Makefile build_man2html + +docupload: + ssh -l${DOC_USER} ${DOC_HOST} "{ mkdir -p ${DOC_PATCH_x2goserver}; rm -Rfv ${DOC_PATCH_x2goserver}/*; }" + ssh -l${DOC_USER} ${DOC_HOST} "{ mkdir -p ${DOC_PATCH_printing}; rm -Rfv ${DOC_PATCH_printing}/*; }" + ssh -l${DOC_USER} ${DOC_HOST} "{ mkdir -p ${DOC_PATCH_compat}; rm -Rfv ${DOC_PATCH_compat}/*; }" + ssh -l${DOC_USER} ${DOC_HOST} "{ mkdir -p ${DOC_PATCH_extensions}; rm -Rfv ${DOC_PATCH_extensions}/*; }" + scp -r x2goserver/.build_man2html/html/* ${DOC_USER}@${DOC_HOST}:${DOC_PATCH_x2goserver}/ + scp -r x2goserver-printing/.build_man2html/html/* ${DOC_USER}@${DOC_HOST}:${DOC_PATCH_printing}/ + scp -r x2goserver-compat/.build_man2html/html/* ${DOC_USER}@${DOC_HOST}:${DOC_PATCH_compat}/ + scp -r x2goserver-extensions/.build_man2html/html/* ${DOC_USER}@${DOC_HOST}:${DOC_PATCH_extensions}/ + +clean: + rm -Rf x2goserver/.build_man2html/html/* + rm -Rf x2goserver-printing/.build_man2html/html/* + rm -Rf x2goserver-compat/.build_man2html/html/* + rm -Rf x2goserver-extensions/.build_man2html/html/* diff --git a/UNINSTALL b/UNINSTALL index e75d6fc..aac101c 100644 --- a/UNINSTALL +++ b/UNINSTALL @@ -15,7 +15,7 @@ TARBALL UNINSTALL OF x2goserver ---------------------------------------------- $ deluser x2gouser - $ delgroup x2gousers + $ delgroup x2gouser 4.) Run Makefile's uninstall diff --git a/debian/changelog b/debian/changelog index 20a241b..2af3cf0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,23 +1,146 @@ -x2goserver (3.0.99.5-0~x2go-bpo1) UNRELEASED; urgency=low +x2goserver (3.0.99.8-0~x2go-bpo1) unstable; urgency=low * Debian lenny backport. - * Fix for x2gomountdirs, now also usernames containing blanks can use local - folder sharing. - * Conflict with old x2goserver-* packages (-home, -one) and x2goprint package. - -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Mon, 04 Jul 2011 14:50:35 +0200 + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Sun, 20 Nov 2011 18:54:26 +0100 + +x2goserver (3.0.99.8-0~x2go1) unstable; urgency=low + + * New upstream version (3.0.99.8): + - Fix feature list in x2goserver-extensions. + - Add Xsession.d processing to X2Go (as x2goserver-xsession add-on + package). + - Ignore failures of x2gofeature calls, fixes x2goserver being + installed without x2goserver-extensions. + - Set X2Go log level to info when running Xsession parts. + * Make sure that package scripts (postinst, postrm, etc.) exit with + exit code 0 at the end of the script. + * Fix non-local printing with X2Go: x2goprint user on X2Go server host + needs a shell to accept incoming print jobs from the central CUPS + server(s). + + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Sun, 20 Nov 2011 18:54:26 +0100 + +x2goserver (3.0.99.7-0~x2go1) unstable; urgency=low + + * New upstream version (3.0.99.7): + - Move x2golistmounts script from x2goserver-extensions to x2goserver + core. + - X2go server extensions: fix regular expression when scanning modality dirs. + + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Wed, 26 Oct 2011 13:04:54 +0200 + +x2goserver (3.0.99.6-0~x2go1) unstable; urgency=low + + [ Mike Gabriel ] + * New upstream version (3.0.99.6): + - Rename x2goumount_session calls to x2goumount-session calls in + x2goserver internal scripts. + - Re-arranged script files into /bin and /lib directories. + - Tab'ified all script files, proper indentation, coding style. + - Fix for x2gomountdirs, now also usernames containing blanks can use + local folder sharing. + - Provide C wrapper for setgid call of x2gosqlitewrapper.pl. Remove + dependency from perlsuid. + - Store SQLite db in /var/lib/x2go to comply to latest FHS. + - Add x2gobasepath script to reliably detect x2goserver install path. + - Add man page for x2gobasepath. + - Remove Debianisms from INSTALL howto. + - Add chromium-browser as possible WWWBROWSER to x2goruncommand. + - Add lxterminal as possible TERMINAL to x2goruncommand. + - Add LibreOffice.org as possible OFFICE application to x2goruncommand. + - Fix for TERMINAL command execution if konsole (KDE4) is installed on the + server (closes upstream issue #87). + - Silence x2golistsessions on missing session.log files. + - Add x2goprint user creation information to INSTALL howto. + - Add sanity checks to x2goprint, script can only be run as root. + - Fix x2goprint, add syslogging, add inline comments. + - Add script lib/x2gologlevel: introduce [log] section in x2goserver.conf + with only parameter ,,loglevel''. + - Initialize Syslog module for all Perl scripts in x2goserver package. + - Add debugging support for almost all DB functions in x2godbwrapper.pm, fix + for Syslog module initialization in all Perl scripts. + - Add info loglevel messages for all scripts in bin dir. + - Add notice messages for start, suspend, resume, terminate, mountdirs + actions. + - Fix for x2godbwrapper.pm: we can't open/close the syslog socket in a + package. This has to be done by the scripts that use x2godbwrapper.pm. + - Add info loglevel messages for x2goserver-extensions scripts. + - Use usermapping for SSHFS mount points. + - Cleanup of man page area, thanks to Ivan Kabaivanov for pointing that out. + - Rename example user and group for session limits in x2goserver.conf so that + people do not get the idea to put users in x2gouser group. + - Add real error message if client fails to resume/suspend/terminate + a session. + - Present an ISO-8601 compliant datetime string in session lists + rendered by x2golistsessions (and similar) command(s). + - Silence knotify SIGHUP signals in case that no knotify is running in the + X2go session. + - Fix x2goumount-session for individual paths (folder type: disk), + ToDo: folder type CDROM and removable media. + - Let db_insertmount create a proper return value (success vs. failed). + - If resuming or suspending of a session fails, mark the session as + finished (because the session's x2goagent is very probably dead). + Do not write an error to stderr if x2goterminate-session fails (i.e. if + x2goagent is dead). + - Identified x2goumount script (x2goserver-compat) as a necessary + component of x2gognomebindings and moved it there (with new name: + x2goumount-session-gnome). + - Add x2golistmounts script to X2go server extensions. + - Add x2gofeature script and x2gofeature.d subscripts. + - Add x2gofeature man page. + - Move x2goversion script into x2goserver core. + - Add debug output around shadow session startup (in x2gostartagent). + - Pass extra argument $USER to client-mode x2godesktopsharing, requires + x2godesktopsharing (>=3.0.1.3) for it to work. + - Clean session dir ~/.x2go/C-<session_id> after session terminates, if not + running in debug mode. + - Change of Desktop icons for shared folders. This change is needed for + parallel installation of x2gognomebindings and x2golxdebindings. + - Terminate x2godesktopsharing cleanly for current session on + x2goterminate-session or when x2goruncommand is about to exit. + - Resume/suspend x2godesktopsharing during x2goresume-session, + x2gosuspend-session. + - Provide pluggable X2go extension system for main X2go server + functions. + - Provide man page for x2goserver-run-extensions that explains the new plug-in + mechanism of x2goserver. -x2goserver (3.0.99.5-0~x2go3) unstable; urgency=low - [Mike Gabriel] - * Rename x2goumount_session calls to x2goumount-session calls in x2goserver - internal scripts. - * React to bug #627990, prefer man2html-base over man2html. - - [Martin Oehler] - * Removes old debug code fragment, fixes x2golistsessions parsing. - -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Mon, 04 Jul 2011 14:50:28 +0200 + * React to bug #627990, prefer man2html-base over man2html. + * Do not depend on package perlsuid anymore. + * Use source format 3.0 (native). + * Fix of Debian clean rules, fix of Makefile's clean rules. + * Breaks/replaces packages: x2goserver-one, x2goserver-home, x2goprint + (instead ofB Conflicts). + * Tab'ified postinst/postrm scripts. + * Install internal x2goserver scripts to /usr/lib/x2go, make sure scripts + in /usr/bin find these scripts. + * x2goserver.postinst: fix home path updates if new home path already exists + * Provide separate package x2goserver-printing: x2goprint script + man page + + adduser x2goprint. + + [ Moritz Strübe ] + * Improvements for new upstream version (3.0.99.6): + - Make digits at the beginning of X2go server extension scripts a must, not a + suggestion. + + [ Ivan Kabaivanov ] + * Improvements for new upstream version (3.0.99.6): + - Many Makefile fixes around man page installation. + - Proof-reading code, fixing typos. + + [ Martin Oehler ] + * Fixes for new upstream version (3.0.99.6): + - Removes old debug code fragment, fixes x2golistsessions parsing. + + [ Oleksandr Shneyder ] + * Improvements for new upstream version (3.0.99.6): + - Remove session directory after 10 sec delay to let x2goclient check + cmdoutput file. + + -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Wed, 12 Oct 2011 11:44:59 +0200 x2goserver (3.0.99.5-0~x2go2) unstable; urgency=low diff --git a/debian/control b/debian/control index bf30438..e4e0f5b 100644 --- a/debian/control +++ b/debian/control @@ -13,11 +13,11 @@ Vcs-Git: git://code.x2go.org/x2goserver.git Vcs-Browser: http://code.x2go.org/gitweb?p=x2goserver.git;a=summary Package: x2goserver -Architecture: all +Architecture: any Depends: + ${shlibs:Depends}, ${misc:Depends}, x2goagent, - perl-suid, lsof, openssh-client, openssh-server, @@ -37,12 +37,18 @@ Recommends: x11-xserver-utils, xinit, x2goserver-extensions (= ${source:Version}) -Conflicts: +Suggests: + x2goserver-printing (= ${source:Version}), + x2goserver-compat (= ${source:Version}), + x2goserver-xsession (= ${source:Version}) +Breaks: + x2goserver-one, + x2goserver-home, +Replaces: x2goserver-one, x2goserver-home, - x2goprint Description: X2go server daemon scripts - X2go is a serverbased computing environment with + X2go is a server based computing environment with - session resuming - low bandwith support - LDAP support @@ -61,14 +67,65 @@ Description: X2go server daemon scripts of X2go make sure that you also have X2go server extensions package (x2goserver-extensions) installed. +Package: x2goserver-printing +Architecture: all +Depends: + ${misc:Depends}, + x2goserver (>= ${source:Version}), x2goserver (<< ${source:Version}.1~), + adduser +Breaks: + x2goprint +Replaces: + x2goprint +Suggests: + cups-x2go +Description: X2go server daemon scripts (printing) + X2go is a server based computing environment with + - session resuming + - low bandwith support + - LDAP support + - client side mass storage mounting support + - audio support + - authentication by smartcard and USB stick + . + The X2go server printing package provides + client-side printing support for X2go. + . + This package has to be installed on X2go servers + that shall be able to pass X2go print jobs on + to the X2go client. + . + This package co-operates with the cups-x2go CUPS + backend. If CUPS server and X2go server are hosted + on different machines, then make sure you install + this package on the X2go server/s (and the cups-x2go + package on the CUPS server). + +Package: x2goserver-compat +Architecture: all +Depends: + ${misc:Depends}, + x2goserver (>= ${source:Version}), x2goserver (<< ${source:Version}.1~) +Description: X2go server daemon scripts (backwards compatitbity to old client versions) + X2go is a server based computing environment with + - session resuming + - low bandwith support + - LDAP support + - client side mass storage mounting support + - audio support + - authentication by smartcard and USB stick + . + This package contains compatitbility scripts to allow + old x2goclient versions to connect to your X2go server. + Package: x2goserver-extensions Architecture: all Depends: ${misc:Depends}, - x2goserver (= ${source:Version}), + x2goserver (>= ${source:Version}), x2goserver (<< ${source:Version}.1~), x11-xkb-utils Description: X2go server daemon scripts (extensions) - X2go is a serverbased computing environment with + X2go is a server based computing environment with - session resuming - low bandwith support - LDAP support @@ -83,3 +140,27 @@ Description: X2go server daemon scripts (extensions) Make sure you have this package installed on your server if you want non-legacy X2go clients to be able to access your server without lack of features. + +Package: x2goserver-xsession +Architecture: all +Depends: + ${misc:Depends}, + x2goserver (>= ${source:Version}), x2goserver (<< ${source:Version}.1~), + x11-common +Description: X2go server daemon scripts (Xsession runner) + X2go is a server based computing environment with + - session resuming + - low bandwith support + - LDAP support + - client side mass storage mounting support + - audio support + - authentication by smartcard and USB stick + . + This X2go server add-on enables Xsession script handling + when starting desktop sessions with X2go. + . + Amongst others the parsing of Xsession scripts will + enable desktop-profiles, ssh-agent startups, gpgagent + startups and many more Xsession related features on + X2go session login automagically. + diff --git a/debian/rules b/debian/rules index c34429d..b32e08d 100755 --- a/debian/rules +++ b/debian/rules @@ -4,3 +4,10 @@ dh $@ override_dh_auto_install: + make -f Makefile build-arch + +override_dh_auto_clean: + rm -fv x2gosqlitewrapper + rm -Rfv x2goserver/.build_html + rm -Rfv x2goserver-extensions/.build_html + dh_auto_clean diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..9f67427 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) \ No newline at end of file diff --git a/debian/x2goserver-compat.docs b/debian/x2goserver-compat.docs new file mode 100644 index 0000000..121edd8 --- /dev/null +++ b/debian/x2goserver-compat.docs @@ -0,0 +1 @@ +x2goserver-compat/.build_man2html/html diff --git a/debian/x2goserver-compat.install b/debian/x2goserver-compat.install new file mode 100644 index 0000000..5059ee2 --- /dev/null +++ b/debian/x2goserver-compat.install @@ -0,0 +1,2 @@ +x2goserver-compat/bin/x2go* /usr/bin/ +x2goserver-compat/share/x2gofeature.d/* /usr/share/x2go/x2gofeature.d/ diff --git a/debian/x2goserver-compat.manpages b/debian/x2goserver-compat.manpages new file mode 100644 index 0000000..dc59c8c --- /dev/null +++ b/debian/x2goserver-compat.manpages @@ -0,0 +1 @@ +x2goserver-compat/man/man8/* \ No newline at end of file diff --git a/debian/x2goserver-extensions.install b/debian/x2goserver-extensions.install index 8263b77..30d64d3 100644 --- a/debian/x2goserver-extensions.install +++ b/debian/x2goserver-extensions.install @@ -1,2 +1,4 @@ x2goserver-extensions/bin/x2go* /usr/bin/ -x2goserver-extensions/VERSION.x2goserver-extensions /usr/share/x2go/versions/ \ No newline at end of file +x2goserver-extensions/VERSION.x2goserver-extensions /usr/share/x2go/versions/ +x2goserver-extensions/share/x2gofeature.d/* /usr/share/x2go/x2gofeature.d/ +x2goserver-extensions/lib/* /usr/lib/x2go/ \ No newline at end of file diff --git a/debian/x2goserver-extensions.dirs b/debian/x2goserver-printing.dirs similarity index 100% copy from debian/x2goserver-extensions.dirs copy to debian/x2goserver-printing.dirs diff --git a/debian/x2goserver-printing.docs b/debian/x2goserver-printing.docs new file mode 100644 index 0000000..4f81c88 --- /dev/null +++ b/debian/x2goserver-printing.docs @@ -0,0 +1 @@ +x2goserver-printing/.build_man2html/html diff --git a/debian/x2goserver-printing.install b/debian/x2goserver-printing.install new file mode 100644 index 0000000..c37db3c --- /dev/null +++ b/debian/x2goserver-printing.install @@ -0,0 +1,3 @@ +x2goserver-printing/bin/x2go* /usr/bin/ +x2goserver-printing/VERSION.x2goserver-printing /usr/share/x2go/versions/ +x2goserver-printing/share/x2gofeature.d/* /usr/share/x2go/x2gofeature.d/ \ No newline at end of file diff --git a/debian/x2goserver-printing.lintian-overrides b/debian/x2goserver-printing.lintian-overrides new file mode 100644 index 0000000..1c853c2 --- /dev/null +++ b/debian/x2goserver-printing.lintian-overrides @@ -0,0 +1 @@ +x2goserver-printing: breaks-without-version diff --git a/debian/x2goserver-printing.manpages b/debian/x2goserver-printing.manpages new file mode 100644 index 0000000..9b5b500 --- /dev/null +++ b/debian/x2goserver-printing.manpages @@ -0,0 +1 @@ +x2goserver-printing/man/man8/* \ No newline at end of file diff --git a/debian/x2goserver-printing.postinst b/debian/x2goserver-printing.postinst new file mode 100755 index 0000000..8ad8f80 --- /dev/null +++ b/debian/x2goserver-printing.postinst @@ -0,0 +1,87 @@ +#!/bin/sh +# postinst script for x2goserver-printing +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + ### + ### X2go printing + ### + + # setup x2goprint user and x2goprint group + if ! getent group x2goprint >/dev/null; then + echo "Creating x2goprint group." >&2 + addgroup --system x2goprint + else + echo "Group x2goprint already exists." >&2 + fi + if ! getent passwd x2goprint >/dev/null; then + echo "Creating x2goprint user." >&2 + adduser --system \ + --disabled-password --disabled-login \ + --shell /bin/sh --group --home /var/spool/x2goprint x2goprint + else + echo "User x2goprint already exists." >&2 + # make sure all settings are appropriate + if [ "`id -gn x2goprint`" != "x2goprint" ]; then + usermod --gid x2goprint x2goprint + fi + if getent passwd x2goprint | egrep -v ".*:x:.*:.*:.*:.*:/bin/sh" 1>/dev/null 2>/dev/null; then + usermod --shell /bin/sh x2goprint + fi + if [ "`ls -1d ~x2goprint`" != "/var/spool/x2goprint" ]; then + test -d /var/spool/x2goprint && \ + usermod --home /var/spool/x2goprint x2goprint || \ + usermod --move-home --home /var/spool/x2goprint x2goprint + fi + # we leave user shell alone. we have never set this wrongly + # and we need to respect the administrator's choices + fi + + # make sure x2goprint spool dir permissions are set correctly + chown -R x2goprint:x2goprint /var/spool/x2goprint + # egid x2goprint needs write access to the spool dir + chmod 0770 /var/spool/x2goprint + + # we may be upgrading versions of x2goserver that had + # /usr/bin/x2goprint set to setuid x2goprint. + if dpkg-statoverride --list /usr/bin/x2goprint >/dev/null; then + dpkg-statoverride --remove /usr/bin/x2goprint + chown root:root /usr/bin/x2goprint + chmod 0755 /usr/bin/x2goprint + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/x2goserver.postrm b/debian/x2goserver-printing.postrm similarity index 52% copy from debian/x2goserver.postrm copy to debian/x2goserver-printing.postrm index 37f8c02..16b0f1e 100755 --- a/debian/x2goserver.postrm +++ b/debian/x2goserver-printing.postrm @@ -1,5 +1,5 @@ #! /bin/sh -# postrm script for x2goserver +# postrm script for x2goserver-printing # # see: dh_installdeb(1) # summary of how this script can be called: @@ -17,22 +17,21 @@ set -e case "$1" in - purge) - dpkg-statoverride --remove /usr/bin/x2gosqlitewrapper || true - echo "Removing x2go session database" >&2 - rm -vf /var/lib/x2go/x2go_sessions - rm -vf /etc/x2go/x2gosql/passwords/pgadmin - getent passwd x2gouser >/dev/null && deluser x2gouser - getent group x2gousers >/dev/null && delgroup x2gousers - ;; - remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - ;; - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 0 + purge) + getent passwd x2goprint >/dev/null && deluser x2goprint + getent group x2goprint >/dev/null && delgroup x2goprint + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 0 + ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# + +exit 0 \ No newline at end of file diff --git a/debian/x2goserver-extensions.dirs b/debian/x2goserver-xsession.dirs similarity index 81% copy from debian/x2goserver-extensions.dirs copy to debian/x2goserver-xsession.dirs index 45adc59..e1541a6 100644 --- a/debian/x2goserver-extensions.dirs +++ b/debian/x2goserver-xsession.dirs @@ -1,3 +1,3 @@ -usr/bin +etc/x2go usr/share/x2go usr/share/x2go/versions diff --git a/debian/x2goserver-xsession.docs b/debian/x2goserver-xsession.docs new file mode 100644 index 0000000..093650e --- /dev/null +++ b/debian/x2goserver-xsession.docs @@ -0,0 +1 @@ +x2goserver-xsession/doc \ No newline at end of file diff --git a/debian/x2goserver-xsession.install b/debian/x2goserver-xsession.install new file mode 100644 index 0000000..31531bb --- /dev/null +++ b/debian/x2goserver-xsession.install @@ -0,0 +1,3 @@ +x2goserver-xsession/etc/* /etc/x2go/ +x2goserver-xsession/VERSION.x2goserver-xsession /usr/share/x2go/versions/ +x2goserver-xsession/share/x2gofeature.d/* /usr/share/x2go/x2gofeature.d/ diff --git a/debian/x2goserver.init b/debian/x2goserver.init index 14dbbe2..b553c3a 100644 --- a/debian/x2goserver.init +++ b/debian/x2goserver.init @@ -11,25 +11,25 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin case "$1" in - start) - echo "Cleaning up stale x2go sessions." - /usr/sbin/x2gocleansessions + start) + echo "Cleaning up stale x2go sessions." + /usr/sbin/x2gocleansessions ;; - stop) - # kill x2gocleansessions, ignore on failure - killall x2gocleansessions || true + stop) + # kill x2gocleansessions, ignore on failure + killall x2gocleansessions || true ;; - reload|force-reload|restart) - # kill x2gocleansessions, ignore on failure - killall x2gocleansessions || true - echo "Cleaning up stale x2go sessions." - /usr/sbin/x2gocleansessions + reload|force-reload|restart) + # kill x2gocleansessions, ignore on failure + killall x2gocleansessions || true + echo "Cleaning up stale x2go sessions." + /usr/sbin/x2gocleansessions ;; - *) - N=/etc/init.d/x2goserver - # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $N {start|stop|restart|force-reload}" >&2 - exit 1 + *) + N=/etc/init.d/x2goserver + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 ;; esac diff --git a/debian/x2goserver.install b/debian/x2goserver.install index d33709c..ea91840 100644 --- a/debian/x2goserver.install +++ b/debian/x2goserver.install @@ -1,6 +1,8 @@ -x2goserver/bin/x2go* /usr/bin/ -x2goserver/sbin/x2go* /usr/sbin/ -x2goserver/etc/x2gosql/sql /etc/x2go/x2gosql/ -x2goserver/etc/x2goserver.conf /etc/x2go/ -x2goserver/lib/x2godbwrapper.pm /usr/lib/x2go/ -x2goserver/VERSION.x2goserver /usr/share/x2go/versions/ \ No newline at end of file +x2goserver/bin/x2go* /usr/bin/ +x2goserver/sbin/x2go* /usr/sbin/ +x2goserver/lib/x2go* /usr/lib/x2go/ +x2goserver/etc/x2gosql/sql /etc/x2go/x2gosql/ +x2goserver/etc/x2goserver.conf /etc/x2go/ +x2goserver/VERSION.x2goserver /usr/share/x2go/versions/ +x2goserver/x2gosqlitewrapper /usr/lib/x2go/ +x2goserver/share/x2gofeature.d /usr/share/x2go/ diff --git a/debian/x2goserver.link b/debian/x2goserver.link new file mode 100644 index 0000000..8722bcf --- /dev/null +++ b/debian/x2goserver.link @@ -0,0 +1,2 @@ +# compatibility +/usr/bin/x2goumount-session /usr/bin/x2goumount_session \ No newline at end of file diff --git a/debian/x2goserver.lintian-overrides b/debian/x2goserver.lintian-overrides new file mode 100644 index 0000000..637b7db --- /dev/null +++ b/debian/x2goserver.lintian-overrides @@ -0,0 +1 @@ +x2goserver: breaks-without-version diff --git a/debian/x2goserver.postinst b/debian/x2goserver.postinst index 4e75de8..9d5d3bb 100755 --- a/debian/x2goserver.postinst +++ b/debian/x2goserver.postinst @@ -19,41 +19,86 @@ set -e case "$1" in - configure) - chmod 700 /etc/x2go/x2gosql/passwords - touch /etc/x2go/x2gosql/passwords/pgadmin - chmod 600 /etc/x2go/x2gosql/passwords/pgadmin - - # setup x2gouser and group - if ! getent group x2gousers >/dev/null; then - echo "Creating x2gouser user." >&2 - addgroup --system x2gousers - else - echo "User x2gouser already exists." >&2 - fi - if ! getent passwd x2gouser >/dev/null; then - echo "Creating x2gouser user." >&2 - adduser --system --no-create-home \ - --disabled-password --disabled-login \ - --shell /bin/false --group --home /var/lib/x2go x2gouser - else - echo "User x2gouser already exists." >&2 - fi - - if [ ! -f /var/lib/x2go/x2go_sessions ]; then - x2godbadmin --createdb - fi - - dpkg-statoverride --add --update x2gouser x2gousers 6755 /usr/bin/x2gosqlitewrapper || true - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; + configure) + mkdir -p /etc/x2go/x2gosql/passwords + chmod 700 /etc/x2go/x2gosql/passwords + touch /etc/x2go/x2gosql/passwords/pgadmin + chmod 600 /etc/x2go/x2gosql/passwords/pgadmin + + ### + ### X2go session DB management + ### + + # setup x2gouser and group + if ! getent group x2gouser >/dev/null; then + echo "Creating x2gouser group." >&2 + addgroup --system x2gouser + else + echo "Group x2gouser already exists." >&2 + fi + if ! getent passwd x2gouser >/dev/null; then + echo "Creating x2gouser user." >&2 + adduser --system --no-create-home \ + --disabled-password --disabled-login \ + --shell /bin/false --group --home /var/lib/x2go x2gouser + else + echo "User x2gouser already exists." >&2 + # make sure all settings are appropriate + if [ "`id -gn x2gouser`" != "x2gouser" ]; then + usermod --gid x2gouser x2gouser + test -d /var/lib/x2go && \ + usermod --home /var/lib/x2go x2gouser || \ + usermod --move-home --home /var/lib/x2go x2gouser + fi + if [ "`ls -1d ~x2gouser`" != "/var/lib/x2go" ]; then + usermod --move-home --home /var/lib/x2go x2gouser + fi + # we leave user shell alone. we have never set this wrongly + # and we need to respect the administrator's choices + fi + + if [ ! -f /var/lib/x2go/x2go_sessions ]; then + x2godbadmin --createdb + else + # make sure db permissions are set correctly + chown -R root:x2gouser /var/lib/x2go + # egid x2gouser needs write access to the db dir (for temporary db journal file) + chmod 0770 /var/lib/x2go + # ... and to the db file itself, of course + chmod 0660 /var/lib/x2go/x2go_sessions + fi + + ### setgid section for x2gouser (SQLite DB access) + + # we may be upgrading versions of x2goserver that had + # /usr/lib/x2go/x2gosqlitewrapper.pl set to setuid x2gouser. + if dpkg-statoverride --list /usr/lib/x2go/x2gosqlitewrapper.pl >/dev/null; then + dpkg-statoverride --remove /usr/lib/x2go/x2gosqlitewrapper.pl + chown root:root /usr/lib/x2go/x2gosqlitewrapper.pl + chmod 0755 /usr/lib/x2go/x2gosqlitewrapper.pl + fi + + # we may be upgrading versions of x2goserver that had + # /usr/bin/x2gosqlitewrapper set to setuid or setgid x2gouser, the script itself is + # at this location anymore, we just clear the dpkg-statoverride config entry. + if dpkg-statoverride --list /usr/bin/x2gosqlitewrapper >/dev/null; then + dpkg-statoverride --remove /usr/bin/x2gosqlitewrapper + fi + + # the sqlite db has to be accessed as uid x2gouser + if ! dpkg-statoverride --list /usr/lib/x2go/x2gosqlitewrapper >/dev/null; then + dpkg-statoverride --add --update root x2gouser 2755 /usr/lib/x2go/x2gosqlitewrapper + fi + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; esac # dh_installdeb will replace this with shell code automatically diff --git a/debian/x2goserver.postrm b/debian/x2goserver.postrm index 37f8c02..ec6b579 100755 --- a/debian/x2goserver.postrm +++ b/debian/x2goserver.postrm @@ -17,22 +17,28 @@ set -e case "$1" in - purge) - dpkg-statoverride --remove /usr/bin/x2gosqlitewrapper || true - echo "Removing x2go session database" >&2 - rm -vf /var/lib/x2go/x2go_sessions - rm -vf /etc/x2go/x2gosql/passwords/pgadmin - getent passwd x2gouser >/dev/null && deluser x2gouser - getent group x2gousers >/dev/null && delgroup x2gousers - ;; - remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - ;; - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 0 + purge) + if dpkg-statoverride --list /usr/lib/x2go/x2gosqlitewrapper >/dev/null; then + dpkg-statoverride --remove /usr/lib/x2go/x2gosqlitewrapper + fi + echo "Removing x2go session database" >&2 + rm -vf /var/lib/x2go/x2go_sessions + rm -vf /etc/x2go/x2gosql/passwords/pgadmin + getent passwd x2gouser >/dev/null && deluser x2gouser + getent group x2gouser >/dev/null && delgroup x2gouser + getent group x2gousers >/dev/null && delgroup x2gousers + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 0 + ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# + +exit 0 \ No newline at end of file diff --git a/debian/x2goserver.preinst b/debian/x2goserver.preinst new file mode 100755 index 0000000..117bb2c --- /dev/null +++ b/debian/x2goserver.preinst @@ -0,0 +1,45 @@ +#!/bin/sh +# preinst script for x2goserver +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postinst> `configure' <most-recently-configured-version> +# * <old-postinst> `abort-upgrade' <new version> +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> +# <new-version> +# * <postinst> `abort-remove' +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' +# <failed-install-package> <version> `removing' +# <conflicting-package> <version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + # cleanup old x2goserver installations + rm -Rfv /var/db/x2go/ + if getent group x2gousers >/dev/null; then + echo "The ,,x2gousers'' is no longer used by x2go and can be" + echo "removed as soon as no users are members of this group" + fi + ;; + abort-upgrade) + ;; + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/x2goserver-extensions/Makefile b/x2goserver-compat/Makefile similarity index 77% copy from x2goserver-extensions/Makefile copy to x2goserver-compat/Makefile index d95bc71..576f9ce 100755 --- a/x2goserver-extensions/Makefile +++ b/x2goserver-compat/Makefile @@ -17,11 +17,12 @@ BINDIR=$(PREFIX)/bin #SBINDIR=$(PREFIX)/sbin #LIBDIR=$(PREFIX)/lib/x2go MANDIR=$(PREFIX)/share/man -#SHAREDIR=$(PREFIX)/share/x2go +SHAREDIR=$(PREFIX)/share/x2go BIN_SCRIPTS=$(shell cd bin && ls) #SBIN_SCRIPTS=$(shell cd sbin && ls) #LIB_FILES=$(shell cd lib && ls) +FEATURE_SCRIPTS=$(shell cd share/x2gofeature.d && ls *.features) man_pages = `cd man && find * -type f` @@ -35,6 +36,8 @@ build: build-indep build-indep: build_man2html +build-arch: + build_man2html: mkdir -p $(MAN2HTML_DEST) for man_page in $(man_pages); do mkdir -p `dirname $(MAN2HTML_DEST)/$$man_page`; done @@ -51,9 +54,11 @@ install_scripts: $(INSTALL_DIR) $(DESTDIR)$(BINDIR) # $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) # $(INSTALL_DIR) $(DESTDIR)$(LIBDIR) + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR) $(INSTALL_PROGRAM) bin/* $(DESTDIR)$(BINDIR)/ # $(INSTALL_PROGRAM) sbin/* $(DESTDIR)$(SBINDIR)/ # $(INSTALL_FILE) lib/* $(DESTDIR)$(LIBDIR)/ + $(INSTALL_PROGRAM) share/x2gofeature.d/*.features $(DESTDIR)$(SHAREDIR)/x2gofeature.d/ install_config: # $(INSTALL_DIR) $(DESTDIR)$(ETCDIR) @@ -71,28 +76,29 @@ install_man: install_version: $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR) $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/versions - $(INSTALL_FILE) VERSION.x2goserver-extensions $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-extensions + $(INSTALL_FILE) VERSION.x2goserver-compat $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-compat uninstall: uninstall_scripts uninstall_config uninstall_man uninstall_version uninstall_scripts: for file in $(BIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(BINDIR)/$$file; done + for file in $(FEATURE_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(SHAREDIR)/x2gofeature.d/$$file; done # for file in $(SBIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(SBINDIR)/$$file; done # for file in $(LIB_FILES); do $(RM_FILE) $(DESTDIR)$(LIBDIR)/$$file; done -# $(RM_DIR) $(DESTDIR)$(LIBDIR) +# $(RM_DIR) $(DESTDIR)$(LIBDIR) || true uninstall_config: # $(RM_FILE) $(DESTDIR)$(ETCDIR)/x2goserver.conf # $(RM_FILE) $(DESTDIR)$(ETCDIR)/x2gosql/sql -# $(RM_DIR) $(DESTDIR)$(ETCDIR) -# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql/passwords -# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql +# $(RM_DIR) $(DESTDIR)$(ETCDIR) || true +# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql/passwords || true +# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql || true uninstall_man: for file in $(BIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(MANDIR)/man8/$$file.8.gz; done for file in $(SBIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(MANDIR)/man8/$$file.8.gz; done - $(RM_DIR) $(DESTDIR)$(MANDIR) + $(RM_DIR) $(DESTDIR)$(MANDIR) || true uninstall_version: - $(RM_FILE) $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-extensions - $(RM_DIR) $(DESTDIR)$(SHAREDIR)/versions + $(RM_FILE) $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-compat + $(RM_DIR) $(DESTDIR)$(SHAREDIR)/versions || true diff --git a/x2goserver-compat/VERSION.x2goserver-compat b/x2goserver-compat/VERSION.x2goserver-compat new file mode 100644 index 0000000..d720f99 --- /dev/null +++ b/x2goserver-compat/VERSION.x2goserver-compat @@ -0,0 +1 @@ +3.0.99.8 \ No newline at end of file diff --git a/x2goserver/bin/x2gogetagent b/x2goserver-compat/bin/x2gosuspend similarity index 88% rename from x2goserver/bin/x2gogetagent rename to x2goserver-compat/bin/x2gosuspend index 9a66104..4ddd3df 100755 --- a/x2goserver/bin/x2gogetagent +++ b/x2goserver-compat/bin/x2gosuspend @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/bin/bash # Copyright (C) 2007-2011 X2go Project - http://wiki.x2go.org # @@ -20,10 +20,5 @@ # Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -use strict; - -use lib "/usr/lib/x2go"; -use x2godbwrapper; - -my $sid=shift or die; -print db_getagent $sid; +# this script is here for reasons of backwards compatibility with older clients +x2gosuspend-session $@ \ No newline at end of file diff --git a/x2goserver/bin/x2gosuspend-agent b/x2goserver-compat/bin/x2gosuspend-agent similarity index 100% copy from x2goserver/bin/x2gosuspend-agent copy to x2goserver-compat/bin/x2gosuspend-agent diff --git a/x2goserver/bin/x2goterminate b/x2goserver-compat/bin/x2goterminate similarity index 100% rename from x2goserver/bin/x2goterminate rename to x2goserver-compat/bin/x2goterminate diff --git a/x2goserver-compat/man/man8/x2gosuspend-agent.8 b/x2goserver-compat/man/man8/x2gosuspend-agent.8 new file mode 100644 index 0000000..e6e8116 --- /dev/null +++ b/x2goserver-compat/man/man8/x2gosuspend-agent.8 @@ -0,0 +1,23 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2gosuspend-agent 1 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.SH NAME +x2gosuspend-agent \- X2go Server Script (deprecated, shipped for compatibility with old clients) +.SH SYNOPSIS +'nh +.fi +.ad l +x2gosuspend-agent <session-name> + +.SH DESCRIPTION +\fBx2gosuspend\fR is a deprecated script belonging to X2go Server. The availability of this script +is required to allow session suspending for old \fBx2goclient\fR versions. +.PP +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver-compat/man/man8/x2gosuspend.8 b/x2goserver-compat/man/man8/x2gosuspend.8 new file mode 100644 index 0000000..af119ee --- /dev/null +++ b/x2goserver-compat/man/man8/x2gosuspend.8 @@ -0,0 +1,23 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2gosuspend 1 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.SH NAME +x2gosuspend \- X2go Server Script (deprecated, shipped for compatibility with old clients) +.SH SYNOPSIS +'nh +.fi +.ad l +x2gosuspend <session-name> + +.SH DESCRIPTION +\fBx2gosuspend\fR is a deprecated script belonging to X2go Server. The availability of this script +is required to allow session suspending for old \fBx2goclient\fR versions. +.PP +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver-compat/man/man8/x2goterminate.8 b/x2goserver-compat/man/man8/x2goterminate.8 new file mode 100644 index 0000000..68fc016 --- /dev/null +++ b/x2goserver-compat/man/man8/x2goterminate.8 @@ -0,0 +1,23 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2goterminate 1 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.SH NAME +x2goterminate \- X2go Server Script (deprecated, shipped for compatibility with old clients) +.SH SYNOPSIS +'nh +.fi +.ad l +x2goterminate <session-name> + +.SH DESCRIPTION +\fBx2goterminate\fR is a deprecated script belonging to X2go Server. The availability of this script +is required to allow session termination from old \fBx2goclient\fR versions. +.PP +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver/bin/x2gocmdexitmessage b/x2goserver-compat/share/x2gofeature.d/x2goserver-compat.features similarity index 63% copy from x2goserver/bin/x2gocmdexitmessage copy to x2goserver-compat/share/x2gofeature.d/x2goserver-compat.features index 9c5e7bd..030aa6e 100755 --- a/x2goserver/bin/x2gocmdexitmessage +++ b/x2goserver-compat/share/x2gofeature.d/x2goserver-compat.features @@ -17,10 +17,20 @@ # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # -# Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> -# Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +# Copyright (C) 2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> +# Copyright (C) 2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -X2GO_ROOT=${HOME}/.x2go -MESSAGE_FILE=$X2GO_ROOT/C-$1/cmdoutput +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` + +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" + +X2GO_FEATURE=$1 + +# check for X2go server core features +case "$X2GO_FEATURE" in + + "X2GO_COMPAT_SCRIPTS") echo "ok"; exit 0;; + *) exit -1;; + +esac -cat $MESSAGE_FILE \ No newline at end of file diff --git a/x2goserver-extensions/.build_man2html/html/man8/x2gosetkeyboard.8.html b/x2goserver-extensions/.build_man2html/html/man8/x2gosetkeyboard.8.html deleted file mode 100644 index cff91de..0000000 --- a/x2goserver-extensions/.build_man2html/html/man8/x2gosetkeyboard.8.html +++ /dev/null @@ -1,61 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2gosetkeyboard</TITLE> -</HEAD><BODY> -<H1>x2gosetkeyboard</H1> -Section: X2go Server Tool (Extension) (8)<BR>Updated: 31 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2gosetkeyboard - Allow server-side Keyboard Setting Updates issued by X2go Client -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2gosetkeyboard</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2gosetkeyboard</B> looks for a 'keyboard' file in the X2go session directory and introspects -the X2go session keyboard settings requested from the client side. -<P> - -If no 'keyboard' file is present in the X2go session directory, nothing happens (i.e. no error -will be raised). -<P> - -<A NAME="lbAE"> </A> -<H2>FILES</H2> - -${HOME}/.x2go/C-${X2GO_SESSION}/keyboard -<P> - -<A NAME="lbAF"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">FILES</A><DD> -<DT><A HREF="#lbAF">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver-extensions/.build_man2html/html/man8/x2goversion.8.html b/x2goserver-extensions/.build_man2html/html/man8/x2goversion.8.html deleted file mode 100644 index 458ec41..0000000 --- a/x2goserver-extensions/.build_man2html/html/man8/x2goversion.8.html +++ /dev/null @@ -1,69 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2goversion</TITLE> -</HEAD><BODY> -<H1>x2goversion</H1> -Section: X2go Server Tool (Extension) (8)<BR>Updated: 31 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2goversion - Retrieve Code Versions of X2go Server Components -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2goversion [<x2go-component>]</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2goversion</B> allows to retrieve code versions of X2go server components. -<P> - -If the -<B>[<x2go-component>]</B> parameter is omitted then a list of all available X2go server -component names and versions is listed. -<P> - -If an X2go component is specified with the <B>[<x2go-component>]</B> parameter, then only the -component's version is printed to stdout. -<P> - -The <B>x2goversion</B> tool can be used by X2go client implementations to query server-side versions -of X2go components. -<P> - -<A NAME="lbAE"> </A> -<H2>FILES</H2> - -/usr/share/x2go/versions/VERSION.* -<P> - -<A NAME="lbAF"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">FILES</A><DD> -<DT><A HREF="#lbAF">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver-extensions/Makefile b/x2goserver-extensions/Makefile index d95bc71..2ecf49a 100755 --- a/x2goserver-extensions/Makefile +++ b/x2goserver-extensions/Makefile @@ -15,13 +15,14 @@ PREFIX=/usr/local ETCDIR=/etc/x2go BINDIR=$(PREFIX)/bin #SBINDIR=$(PREFIX)/sbin -#LIBDIR=$(PREFIX)/lib/x2go +LIBDIR=$(PREFIX)/lib/x2go MANDIR=$(PREFIX)/share/man -#SHAREDIR=$(PREFIX)/share/x2go +SHAREDIR=$(PREFIX)/share/x2go BIN_SCRIPTS=$(shell cd bin && ls) #SBIN_SCRIPTS=$(shell cd sbin && ls) #LIB_FILES=$(shell cd lib && ls) +FEATURE_SCRIPTS=$(shell cd share/x2gofeature.d && ls *.features) man_pages = `cd man && find * -type f` @@ -35,6 +36,8 @@ build: build-indep build-indep: build_man2html +build-arch: + build_man2html: mkdir -p $(MAN2HTML_DEST) for man_page in $(man_pages); do mkdir -p `dirname $(MAN2HTML_DEST)/$$man_page`; done @@ -50,10 +53,37 @@ install: install_scripts install_config install_man install_version install_scripts: $(INSTALL_DIR) $(DESTDIR)$(BINDIR) # $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) -# $(INSTALL_DIR) $(DESTDIR)$(LIBDIR) + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR) + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/pre-start.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/post-start.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/fail-start.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/pre-resume.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/post-resume.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/fail-resume.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/pre-suspend.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/post-suspend.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/fail-suspend.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/pre-terminate.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/post-terminate.d + $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/extensions/fail-terminate.d + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR) + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/x2gofeature.d $(INSTALL_PROGRAM) bin/* $(DESTDIR)$(BINDIR)/ # $(INSTALL_PROGRAM) sbin/* $(DESTDIR)$(SBINDIR)/ -# $(INSTALL_FILE) lib/* $(DESTDIR)$(LIBDIR)/ + $(INSTALL_FILE) lib/extensions/pre-start.d/* $(DESTDIR)$(LIBDIR)/extensions/pre-start.d/ + $(INSTALL_FILE) lib/extensions/post-start.d/* $(DESTDIR)$(LIBDIR)/extensions/post-start.d/ + $(INSTALL_FILE) lib/extensions/fail-start.d/* $(DESTDIR)$(LIBDIR)/extensions/fail-start.d/ + $(INSTALL_FILE) lib/extensions/pre-resume.d/* $(DESTDIR)$(LIBDIR)/extensions/pre-resume.d/ + $(INSTALL_FILE) lib/extensions/post-resume.d/* $(DESTDIR)$(LIBDIR)/extensions/post-resume.d/ + $(INSTALL_FILE) lib/extensions/post-fail.d/* $(DESTDIR)$(LIBDIR)/extensions/fail-resume.d/ + $(INSTALL_FILE) lib/extensions/pre-suspend.d/* $(DESTDIR)$(LIBDIR)/extensions/pre-suspend.d/ + $(INSTALL_FILE) lib/extensions/post-suspend.d/* $(DESTDIR)$(LIBDIR)/extensions/post-suspend.d/ + $(INSTALL_FILE) lib/extensions/fail-suspend.d/* $(DESTDIR)$(LIBDIR)/extensions/fail-suspend.d/ + $(INSTALL_FILE) lib/extensions/pre-terminate.d/* $(DESTDIR)$(LIBDIR)/extensions/pre-terminate.d/ + $(INSTALL_FILE) lib/extensions/post-terminate.d/* $(DESTDIR)$(LIBDIR)/extensions/post-terminate.d/ + $(INSTALL_FILE) lib/extensions/fail-terminate.d/* $(DESTDIR)$(LIBDIR)/extensions/fail-terminate.d/ + $(INSTALL_PROGRAM) share/x2gofeature.d/*.features $(DESTDIR)$(SHAREDIR)/x2gofeature.d/ install_config: # $(INSTALL_DIR) $(DESTDIR)$(ETCDIR) @@ -79,20 +109,21 @@ uninstall_scripts: for file in $(BIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(BINDIR)/$$file; done # for file in $(SBIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(SBINDIR)/$$file; done # for file in $(LIB_FILES); do $(RM_FILE) $(DESTDIR)$(LIBDIR)/$$file; done -# $(RM_DIR) $(DESTDIR)$(LIBDIR) + $(RM_DIR) $(DESTDIR)$(LIBDIR)/extensions/ || true + for file in $(FEATURE_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(SHAREDIR)/x2gofeature.d/$$file; done uninstall_config: # $(RM_FILE) $(DESTDIR)$(ETCDIR)/x2goserver.conf # $(RM_FILE) $(DESTDIR)$(ETCDIR)/x2gosql/sql -# $(RM_DIR) $(DESTDIR)$(ETCDIR) -# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql/passwords -# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql +# $(RM_DIR) $(DESTDIR)$(ETCDIR) || true +# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql/passwords || true +# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql || true uninstall_man: for file in $(BIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(MANDIR)/man8/$$file.8.gz; done for file in $(SBIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(MANDIR)/man8/$$file.8.gz; done - $(RM_DIR) $(DESTDIR)$(MANDIR) + $(RM_DIR) $(DESTDIR)$(MANDIR) || true uninstall_version: $(RM_FILE) $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-extensions - $(RM_DIR) $(DESTDIR)$(SHAREDIR)/versions + $(RM_DIR) $(DESTDIR)$(SHAREDIR)/versions || true diff --git a/x2goserver-extensions/VERSION.x2goserver-extensions b/x2goserver-extensions/VERSION.x2goserver-extensions index 34936c7..d720f99 100644 --- a/x2goserver-extensions/VERSION.x2goserver-extensions +++ b/x2goserver-extensions/VERSION.x2goserver-extensions @@ -1 +1 @@ -3.0.99.5 \ No newline at end of file +3.0.99.8 \ No newline at end of file diff --git a/x2goserver-extensions/bin/x2goversion b/x2goserver-extensions/bin/x2goserver-run-extensions similarity index 52% copy from x2goserver-extensions/bin/x2goversion copy to x2goserver-extensions/bin/x2goserver-run-extensions index 64dd758..3a640a2 100755 --- a/x2goserver-extensions/bin/x2goversion +++ b/x2goserver-extensions/bin/x2goserver-run-extensions @@ -19,29 +19,25 @@ # # Copyright (C) 2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +# Copyright (C) 2011 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> -X2GO_VERSIONS_BASEPATH="$(dirname $0)/../share/x2go/versions" +set -e -get_version() { - cat "$1" | egrep -v "^#.*" | head -n1 | cut -d" " -f1 -} +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` -if [ -n "$1" ]; then - X2GO_COMPONENT="$1" - X2GO_COMPONENT_VERFILE="${X2GO_VERSIONS_BASEPATH}/VERSION.${X2GO_COMPONENT}" +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" - if [ -f "${X2GO_COMPONENT_VERFILE}" ]; then - echo "$(get_version ${X2GO_COMPONENT_VERFILE})" - else - echo "Version information for X2go component '$X2GO_COMPONENT' is not available." >&1 - fi -else - cd ${X2GO_VERSIONS_BASEPATH} - for compfile in `ls ${X2GO_VERSIONS_BASEPATH}`; do - X2GO_COMPONENT="$(echo $compfile | cut -d"." -f2)" - X2GO_COMPONENT_VERSION="$(get_version $compfile)" - echo "${X2GO_COMPONENT}: ${X2GO_COMPONENT_VERSION}" - done - cd - >/dev/null -fi +X2GO_SESSION=$1 +X2GO_MODALITY=$2 +# scan extensions and execute them +find /usr/lib/x2go/extensions/${X2GO_MODALITY}.d/ -maxdepth 1 -mindepth 1 | egrep "/[0-9]{3}_[[:alnum:]]+" | sort | while read x2go_extension; do + $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "executing $x2go_extension with option $X2GO_SESSION" + $x2go_extension $X2GO_SESSION &>/dev/null && { + $X2GO_LIB_PATH/x2gosyslog "$0" "info" "$x2go_extension$(basename $0) for session $X2GO_SESSION has finished sucessfully" + } || { + $X2GO_LIB_PATH/x2gosyslog "$0" "warn" "$x2go_extension$(basename $0) for session $X2GO_SESSION returned a non-zero exit code, continuing..." + } +done + +exit 0 diff --git a/x2goserver-extensions/bin/x2gosetkeyboard b/x2goserver-extensions/bin/x2gosetkeyboard index 022f97d..4073fa9 100755 --- a/x2goserver-extensions/bin/x2gosetkeyboard +++ b/x2goserver-extensions/bin/x2gosetkeyboard @@ -22,6 +22,10 @@ set -e +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` + +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" + # set up paths X2GO_SESSION_ROOT=${HOME}/.x2go X2GO_SESSION_DIR=${X2GO_SESSION_ROOT}/C-${X2GO_SESSION} @@ -33,26 +37,26 @@ test -f ${X2GO_CLIENT_KBD_FILE} || exit 0 read_keyboard_file() { - # retrieve keyboard settings from keyboard file in X2go session dir - XKB_RULES=$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^rules.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1) - XKB_MODEL=$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^model.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1) - XKB_LAYOUT=$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^layout.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1) - XKB_VARIANT=$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^variant.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1) - XKB_OPTIONS=$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^options.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1) + # retrieve keyboard settings from keyboard file in X2go session dir + XKB_RULES=$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^rules.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1) + XKB_MODEL=$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^model.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1) + XKB_LAYOUT=$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^layout.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1) + XKB_VARIANT=$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^variant.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1) + XKB_OPTIONS=$(cat ${X2GO_CLIENT_KBD_FILE} | egrep "^options.*" | head -n1 | cut -d "=" -f2 | cut -d" " -f1) } update_keymap() { - # prepare for setxkbmap call - [ -n "$XKB_RULES" ] && XKB_RULES="-rules $XKB_RULES" - [ -n "$XKB_MODEL" ] && XKB_MODEL="-model $XKB_MODEL" - [ -n "$XKB_LAYOUT" ] && XKB_LAYOUT="-layout $XKB_LAYOUT" - [ -n "$XKB_VARIANT" ] && XKB_VARIANT="-variant $XKB_VARIANT" - [ -n "$XKB_OPTIONS" ] && XKB_OPTIONS="-options $XKB_OPTIONS" + # prepare for setxkbmap call + [ -n "$XKB_RULES" ] && XKB_RULES="-rules $XKB_RULES" + [ -n "$XKB_MODEL" ] && XKB_MODEL="-model $XKB_MODEL" + [ -n "$XKB_LAYOUT" ] && XKB_LAYOUT="-layout $XKB_LAYOUT" + [ -n "$XKB_VARIANT" ] && XKB_VARIANT="-variant $XKB_VARIANT" + [ -n "$XKB_OPTIONS" ] && XKB_OPTIONS="-options $XKB_OPTIONS" - # update keyboard map - setxkbmap $XKB_RULES $XKB_MODEL $XKB_LAYOUT $XKB_VARIANT $XKB_OPTIONS + # update keyboard map + setxkbmap $XKB_RULES $XKB_MODEL $XKB_LAYOUT $XKB_VARIANT $XKB_OPTIONS } ### main ### diff --git a/x2goserver-extensions/lib/extensions/fail-resume.d/.placeholder b/x2goserver-extensions/lib/extensions/fail-resume.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/fail-runcommand.d/.placeholder b/x2goserver-extensions/lib/extensions/fail-runcommand.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/fail-start.d/.placeholder b/x2goserver-extensions/lib/extensions/fail-start.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/fail-suspend.d/.placeholder b/x2goserver-extensions/lib/extensions/fail-suspend.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/fail-terminate.d/.placeholder b/x2goserver-extensions/lib/extensions/fail-terminate.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/post-resume.d/.placeholder b/x2goserver-extensions/lib/extensions/post-resume.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/post-runcommand.d/.placeholder b/x2goserver-extensions/lib/extensions/post-runcommand.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/post-start.d/.placeholder b/x2goserver-extensions/lib/extensions/post-start.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/post-suspend.d/.placeholder b/x2goserver-extensions/lib/extensions/post-suspend.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/post-terminate.d/.placeholder b/x2goserver-extensions/lib/extensions/post-terminate.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/pre-resume.d/.placeholder b/x2goserver-extensions/lib/extensions/pre-resume.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/pre-runcommand.d/.placeholder b/x2goserver-extensions/lib/extensions/pre-runcommand.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/pre-start.d/.placeholder b/x2goserver-extensions/lib/extensions/pre-start.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/pre-suspend.d/.placeholder b/x2goserver-extensions/lib/extensions/pre-suspend.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/lib/extensions/pre-terminate.d/.placeholder b/x2goserver-extensions/lib/extensions/pre-terminate.d/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/x2goserver-extensions/man/man8/x2goserver-run-extensions.8 b/x2goserver-extensions/man/man8/x2goserver-run-extensions.8 new file mode 100644 index 0000000..2a5ad19 --- /dev/null +++ b/x2goserver-extensions/man/man8/x2goserver-run-extensions.8 @@ -0,0 +1,87 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2goserver-run-extensions 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" +.SH NAME +x2goserver-run-extensions \- Run X2go Server Extensions +.SH SYNOPSIS +'nh +.fi +.ad l +x2goserver-run-extensions <session_id> <modality> + +.SH DESCRIPTION +\fBx2goserver-run-extensions\fR is called from within a number of X2go Server core scripts. +.PP +\fIWARNING:\fR Do not call it directly unless you really know what you are doing. +.PP +\fBx2goserver-run-extensions\fR executes scripts that have been +provided by third-party X2go extension packages. +.PP +What this man page is about is not the script usage itself but the way of how to provide X2go server +extensions and features without the need to change the core X2go server scripts. +.SH MODALITIES +\fBx2goserver-run-extensions\fR is called with user privileges, as first cmd line argument the session ID is provided +as the second cmd line argument a (what we call it) modality is provided. +.PP +This modality tells \fBx2goserver-run-extensions\fR at what stage of an X2go +session startup, resumption, suspension or termination the calling script currently is at. +.PP +Calling X2go Server core scripts currently are: \fBx2gostartagent(8)\fR, \fBx2goruncommand(8)\fR, \fBx2goresume-session(8)\fR, +\fBx2gosuspend-session(8)\fR or \fBx2goterminate-session(8)\fR. +.PP +The modality names all refer to a sub-directory of the path: + + \fI<INSTALL_PREFIX>/lib/x2go/extensions\fR, + +where <INSTALL_PREFIX> mostly is /usr on commonly-used GNU/Linux systems. +.PP +In any of these sub-directories third-party X2go extension packages can place scripts or binaries that will then get executed by the core X2go server +commands, either before or after the essential functionality (e.g. x2goagent startup, x2goagent suspension, x2goagent resumption, etc.) or on failure of that +essential functionality. +.PP +The following table shows the available modalities, the calling scripts and the location where to place third-party extension scripts: + + + CALLING SCRIPT MODALITY NAMES EXTENSION SCRIPTS LOCATION + -------------- --------------- -------------------------- + x2gostartagent pre-start extensions/pre-start.d/ + post-start extensions/post-start.d/ + fail-start extensions/fail-start.d/ + x2goruncommand pre-runcommand extensions/pre-runcommand.d/ + post-runcommand extensions/post-runcommand.d/ + fail-runcommand extensions/fail-runcommand.d/ + x2goresume-session pre-resume extensions/pre-resume.d/ + post-resume extensions/post-resume.d/ + fail-resume extensions/fail-resume.d/ + x2gosuspend-session pre-suspend extensions/pre-suspend.d/ + post-suspend extensions/post-suspend.d/ + fail-suspend extensions/fail-suspend.d/ + x2goterminate-session pre-terminate extensions/pre-terminate.d/ + post-terminate extensions/post-terminate.d/ + fail-terminate extensions/fail-terminate.d/ + +\fIIMPORTANT:\fR When providing X2go Server extensions by this mechanism, please pretty well make sure that these extension scripts of yours that you place +in either of the above folders do under no circumstance fail during execution. Return codes are ignored and failures are therefore not (yet) propagated. +.SH EXECUTION OF EXTENSIONS +Scripts (or binaries) that have been placed into one of the pre/post/fail modality folders (see above) are executed in alpha-numerical sorting order. +.PP +Extensions will only get executed if their file names start with three digits. +This restriction is there to make sure that X2go Server extensions get executed in the correct/wanted order: +.PP +For example: + 010_x2goserver-statistics + 020_x2goserver-mail-notify + 021_x2goserver-monitoring + etc.pp. +.SH RETURN VALUES +As exitcode \fBx2goserver-run-extensions\fR always returns 0 and pretends to be permanently happy :-). +.SH SEE ALSO +\fBx2gostartagent(8)\fR, \fBx2goruncommand(8)\fR, \fBx2goresume-session(8)\fR, \fBx2gosuspend-session(8)\fR and \fBx2goterminate-session(8)\fR. +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver-extensions/man/man8/x2gosetkeyboard.8 b/x2goserver-extensions/man/man8/x2gosetkeyboard.8 index 702155f..e77ee77 100644 --- a/x2goserver-extensions/man/man8/x2gosetkeyboard.8 +++ b/x2goserver-extensions/man/man8/x2gosetkeyboard.8 @@ -20,7 +20,12 @@ the X2go session keyboard settings requested from the client side. .PP If no 'keyboard' file is present in the X2go session directory, nothing happens (i.e. no error will be raised). +.SH RETURN VALUES +If \fBx2gosetkeyboard\fR successfully sets the session's keyboard parameters an exit code of 0 is +returned. Also, if the file ${HOME}/.x2go/C-${X2GO_SESSION}/keyboard is not presented at the +expected location, a zero-exitcode is returned. .PP +If the command fails on its way, then the exitcode of the failing command is returned. .SH FILES ${HOME}/.x2go/C-${X2GO_SESSION}/keyboard .PP diff --git a/x2goserver/bin/x2goterminate-session b/x2goserver-extensions/share/x2gofeature.d/x2goserver-extensions.features similarity index 61% copy from x2goserver/bin/x2goterminate-session copy to x2goserver-extensions/share/x2gofeature.d/x2goserver-extensions.features index 989e272..7e50dd7 100755 --- a/x2goserver/bin/x2goterminate-session +++ b/x2goserver-extensions/share/x2gofeature.d/x2goserver-extensions.features @@ -17,20 +17,21 @@ # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # -# Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> -# Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +# Copyright (C) 2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> +# Copyright (C) 2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -if [ $# -eq 1 ]; then - SESSION_NAME=$1 -else - SESSION_NAME=$X2GO_SESSION -fi +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` -X2GO_AGENT_PID=`x2gogetagent $SESSION_NAME` -X2GO_AGENT_PID=`echo "$X2GO_AGENT_PID"| awk {'print $1'}` +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" -x2gochangestatus 'F' $SESSION_NAME > /dev/null +X2GO_FEATURE=$1 + +# check for X2go server core features +case "$X2GO_FEATURE" in + + "X2GO_SET_KEYBOARD") echo "ok"; exit 0;; + "X2GO_RUN_EXTENSIONS") echo "ok"; exit 0;; + *) exit -1;; + +esac -kill -TERM $X2GO_AGENT_PID -export HOSTNAME -x2goumount-session $SESSION_NAME diff --git a/x2goserver-extensions/Makefile b/x2goserver-printing/Makefile similarity index 77% copy from x2goserver-extensions/Makefile copy to x2goserver-printing/Makefile index d95bc71..04f93bf 100755 --- a/x2goserver-extensions/Makefile +++ b/x2goserver-printing/Makefile @@ -17,11 +17,12 @@ BINDIR=$(PREFIX)/bin #SBINDIR=$(PREFIX)/sbin #LIBDIR=$(PREFIX)/lib/x2go MANDIR=$(PREFIX)/share/man -#SHAREDIR=$(PREFIX)/share/x2go +SHAREDIR=$(PREFIX)/share/x2go BIN_SCRIPTS=$(shell cd bin && ls) #SBIN_SCRIPTS=$(shell cd sbin && ls) #LIB_FILES=$(shell cd lib && ls) +FEATURE_SCRIPTS=$(shell cd share/x2gofeature.d && ls *.features) man_pages = `cd man && find * -type f` @@ -35,6 +36,8 @@ build: build-indep build-indep: build_man2html +build-arch: + build_man2html: mkdir -p $(MAN2HTML_DEST) for man_page in $(man_pages); do mkdir -p `dirname $(MAN2HTML_DEST)/$$man_page`; done @@ -51,9 +54,11 @@ install_scripts: $(INSTALL_DIR) $(DESTDIR)$(BINDIR) # $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) # $(INSTALL_DIR) $(DESTDIR)$(LIBDIR) + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR) $(INSTALL_PROGRAM) bin/* $(DESTDIR)$(BINDIR)/ # $(INSTALL_PROGRAM) sbin/* $(DESTDIR)$(SBINDIR)/ # $(INSTALL_FILE) lib/* $(DESTDIR)$(LIBDIR)/ + $(INSTALL_PROGRAM) share/x2gofeature.d/*.features $(DESTDIR)$(SHAREDIR)/x2gofeature.d/ install_config: # $(INSTALL_DIR) $(DESTDIR)$(ETCDIR) @@ -71,7 +76,7 @@ install_man: install_version: $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR) $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/versions - $(INSTALL_FILE) VERSION.x2goserver-extensions $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-extensions + $(INSTALL_FILE) VERSION.x2goserver-printing $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-printing uninstall: uninstall_scripts uninstall_config uninstall_man uninstall_version @@ -79,20 +84,20 @@ uninstall_scripts: for file in $(BIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(BINDIR)/$$file; done # for file in $(SBIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(SBINDIR)/$$file; done # for file in $(LIB_FILES); do $(RM_FILE) $(DESTDIR)$(LIBDIR)/$$file; done -# $(RM_DIR) $(DESTDIR)$(LIBDIR) + for file in $(FEATURE_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(SHAREDIR)/x2gofeature.d/$$file; done uninstall_config: # $(RM_FILE) $(DESTDIR)$(ETCDIR)/x2goserver.conf # $(RM_FILE) $(DESTDIR)$(ETCDIR)/x2gosql/sql -# $(RM_DIR) $(DESTDIR)$(ETCDIR) -# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql/passwords -# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql +# $(RM_DIR) $(DESTDIR)$(ETCDIR) || true +# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql/passwords || true +# $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql || true uninstall_man: for file in $(BIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(MANDIR)/man8/$$file.8.gz; done for file in $(SBIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(MANDIR)/man8/$$file.8.gz; done - $(RM_DIR) $(DESTDIR)$(MANDIR) + $(RM_DIR) $(DESTDIR)$(MANDIR) || true uninstall_version: - $(RM_FILE) $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-extensions - $(RM_DIR) $(DESTDIR)$(SHAREDIR)/versions + $(RM_FILE) $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-printing + $(RM_DIR) $(DESTDIR)$(SHAREDIR)/versions || true diff --git a/x2goserver-printing/VERSION.x2goserver-printing b/x2goserver-printing/VERSION.x2goserver-printing new file mode 100644 index 0000000..d720f99 --- /dev/null +++ b/x2goserver-printing/VERSION.x2goserver-printing @@ -0,0 +1 @@ +3.0.99.8 \ No newline at end of file diff --git a/x2goserver-printing/bin/x2goprint b/x2goserver-printing/bin/x2goprint new file mode 100755 index 0000000..fa3e4ae --- /dev/null +++ b/x2goserver-printing/bin/x2goprint @@ -0,0 +1,142 @@ +#!/usr/bin/perl + +# Copyright (C) 2007-2011 X2go Project - http://wiki.x2go.org +# +# 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. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> +# Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> + +use strict; +use File::Basename; +use File::Copy; +use File::Path; +use Sys::Syslog qw( :standard :macros ); + +use lib `echo -n \$(x2gobasepath)/lib/x2go`; +use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + + +syslog('info', "x2goprint has been called with options: @ARGV"); + +sub check_root +{ + my ($uname, $pass, $uid, $pgid, $quota, $comment, $gcos, $homedir, $shell, $expire) = getpwuid($<); + my $realuser=$uname; + if ($realuser ne "root") + { + syslog('err', "ERROR: x2goprint was called by user $realuser directly, x2goprint exits now!"); + die "$realuser, you cannot use x2goprint as non-root user..."; + } +} + +sub check_usage +{ + if (scalar(@ARGV) == 1) + { + syslog('info', "x2goprint was called with only one cmd line arg, running in x2golistsessions wrapper mode"); + system ("su @ARGV[0] -c \"x2golistsessions --all-servers\""); + exit 0; + } + elsif (scalar(@ARGV) != 4) + { + syslog('err', "ERROR: x2goprint was called with a wrong number of cmd line args, x2goprint exits now!"); + print STDERR "ERROR: Usage:\nx2goprint user session file titleFile\nx2goprint user\n"; + exit 1; + } +} + +# sanity check, this script has to be run with root privileges +check_root(); + +# check number of cmd line args +check_usage(); + +# get options from the command line +my ($user, $session, $pdfFile, $titleFile)=@ARGV; + +# location for incoming jobs is ~x2goprint +my ($tm,$tm,$uid,$gid,$tm,$tm,$tm,$homedir)=getpwnam("x2goprint"); +my $printdir=$homedir; + +# extract necessary information from title file and drop it afterwards +my $title='UNTITLED'; +if( -e "$printdir/$titleFile") +{ + open (TITLE,"<$printdir/$titleFile"); + $title=<TITLE>; + close (TITLE); + unlink("$printdir/$titleFile"); +} +syslog('notice', "x2goprint is processing $printdir/$pdfFile with print job title ,,$title\''"); + +# temp location for placing incoming spool files, so that +# they can can be picked by the session user and further processed +# with user privileges +($tm,$tm,$uid,$gid,$tm,$tm,$tm,$homedir)=getpwnam($user); + +my $spoolbase="/tmp/spool_$user"; +my $spooldir="$spoolbase/$session"; +my $spooltmp="$spoolbase/tmp"; +mkpath($spooltmp); +chown $uid, $gid, "$spooltmp"; +chmod 0700, "$spooltmp"; + +# this last part mainly uses the session user's privileges +my ($mounts)=db_getmounts($session); +if ( $mounts=~m/$spooldir/) +{ + + # if the client side spool dir (the directory where x2goclient + # waits for incoming print job files) is mounted in the session + # we will copy the print files from the temp location above to + # the SSHFS share mounted from the client system. + + syslog('info', "client-side spool dir is mounted, transferring printable file $pdfFile to X2go client system"); + + if (not move("$printdir/$pdfFile", "$spooltmp")) { + syslog('err', "ERROR: x2goprint failed to process print spool job for file $pdfFile"); + die "$0: Can't move $printdir/$pdfFile to $spooltmp/"; + } + chown $uid, $gid, "$spooltmp/$pdfFile"; + + system("su $user -c \"mv $spooltmp/$pdfFile $spooldir\""); + syslog('debug', "x2goprint moved file $pdfFile to X2go client's spool dir"); + + open (RFILE,">$spooltmp/$pdfFile.ready"); + print RFILE "$pdfFile\n$title"; + close (RFILE); + + chown $uid, $gid, "$spooltmp/$pdfFile.ready"; + system ("su $user -c \"mv $spooltmp/$pdfFile.ready $spooldir\""); + syslog('debug', "x2goprint moved file $pdfFile.ready to X2go client's spool dir, X2go client should start the print dialog very soon"); + +} else { + + # if the client-side spool dir is not mounted via SSHFS, we will simply drop the + # printable PDF file + + syslog('info', "client-side spool dir is _not_ mounted, dropping spool job $pdfFile"); + + unlink("$printdir/$pdfFile"); +} + +# closing syslog +closelog; diff --git a/x2goserver-printing/man/man8/x2goprint.8 b/x2goserver-printing/man/man8/x2goprint.8 new file mode 100644 index 0000000..1075652 --- /dev/null +++ b/x2goserver-printing/man/man8/x2goprint.8 @@ -0,0 +1,64 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2goprint 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" +.SH NAME +x2goprint \- Process X2go Print Job +.SH SYNOPSIS +'nh +.fi +.ad l +x2goprint <username> <session_id> <pdf_file> <title_file> + +.SH DESCRIPTION +X2go print jobs are rendered by the \fBcups-x2go\fR backend on your network's (central) CUPS server and +then get copied to the X2go server that the X2go print job was issued from. +.PP +On that X2go server \fBcups-x2go\fR places two print job files (a PDF file and a title file) +into the home directory of the POSIX system user ,,x2goprint'' where they await further processing +by \fBx2goprint\fR. +.PP +The \fBx2goprint\fR command on the session's X2go server (executed by \fBcups-x2go\fR backend) then +prepares the job files for delivery to the X2go client-side. +.PP +\fBx2goprint\fR must run with root privileges and is executed by \fBcups-x2go\fR. +.SH ARGUMENTS +.TP +\*(T<\fB\<username>\fR\*(T> +The owner of the incoming print jobs is given as the <username> argument. +.TP +\*(T<\fB\<session_id>\fR\*(T> +The <session_id> is the unique identifier of the X2go session that the processed print job is +coming from. +.TP +\*(T<\fB\<pdf_file>\fR\*(T> +The filename of the PDF file as dropped into ~x2goprint by \fBcups-x2go\fR. +.TP +\*(T<\fB\<title_file>\fR\*(T> +The filename of the title file as dropped into ~x2goprint by \fBcups-x2go\fR. +.PP +.SH PERMISSIONS +X2go uses the fuse-based SSH filesystem (SSHFS) for transferring print jobs from X2go server to X2go client. +Users that shall use X2go printing must be members of the X2go server's ,,fuse'' POSIX group. +.PP +.SH X2GO CLUSTER MODE +If X2go server and CUPS server are the same machine, no further setup for X2go printing is necessary. +.PP +However, if X2go server and CUPS server are hosted on separate machines then a special setup of sudo and SSH +is required on X2go server(s) and the central CUPS server. +.PP +Refer to http://wiki.x2go.org/installing_x2go_printing_debian_ubuntu for further information. +.PP +.SH RETURN VALUES +By \fBx2goprint\fR nothing is reported on stdout or stderr. +.PP +If \fBx2goprint\fR has run successfully, an exitcode of 0 is returned. If the script has either been +called by a non-root user or with the wrong number of command line arguments, a non-zero exitcode is +returned. +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver/bin/x2gocmdexitmessage b/x2goserver-printing/share/x2gofeature.d/x2goserver-printing.features similarity index 64% copy from x2goserver/bin/x2gocmdexitmessage copy to x2goserver-printing/share/x2gofeature.d/x2goserver-printing.features index 9c5e7bd..7332656 100755 --- a/x2goserver/bin/x2gocmdexitmessage +++ b/x2goserver-printing/share/x2gofeature.d/x2goserver-printing.features @@ -17,10 +17,19 @@ # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # -# Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> -# Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +# Copyright (C) 2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> +# Copyright (C) 2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -X2GO_ROOT=${HOME}/.x2go -MESSAGE_FILE=$X2GO_ROOT/C-$1/cmdoutput +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` + +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" + +X2GO_FEATURE=$1 + +# check for X2go server core features +case "$X2GO_FEATURE" in + + "X2GO_PRINTING") echo "ok"; exit 0;; + *) exit -1;; +esac -cat $MESSAGE_FILE \ No newline at end of file diff --git a/x2goserver-xsession/Makefile b/x2goserver-xsession/Makefile new file mode 100755 index 0000000..ec4a063 --- /dev/null +++ b/x2goserver-xsession/Makefile @@ -0,0 +1,95 @@ +#!/usr/bin/make -f + +SRC_DIR=$(CURDIR) +SHELL=/bin/bash + +INSTALL_DIR=install -d -o root -g root -m 755 +INSTALL_FILE=install -o root -g root -m 644 +INSTALL_PROGRAM=install -o root -g root -m 755 + +RM_FILE=rm -f +RM_DIR=rmdir -p --ignore-fail-on-non-empty + +DESTDIR= +PREFIX=/usr/local +ETCDIR=/etc/x2go +#BINDIR=$(PREFIX)/bin +#SBINDIR=$(PREFIX)/sbin +#LIBDIR=$(PREFIX)/lib/x2go +MANDIR=$(PREFIX)/share/man +SHAREDIR=$(PREFIX)/share/x2go + +#BIN_SCRIPTS=$(shell cd bin && ls) +#SBIN_SCRIPTS=$(shell cd sbin && ls) +#LIB_FILES=$(shell cd lib && ls) +ETC_FILES=$(shell cd etc && ls) +FEATURE_SCRIPTS=$(shell cd share/x2gofeature.d && ls *.features) + +#man_pages = `cd man && find * -type f` + +#MAN2HTML_BIN = man2html +#MAN2HTML_SRC = man +#MAN2HTML_DEST = .build_man2html/html + +all: clean build + +build: build-indep + +build-indep: build_man2html + +build-arch: + +build_man2html: +# mkdir -p $(MAN2HTML_DEST) +# for man_page in $(man_pages); do mkdir -p `dirname $(MAN2HTML_DEST)/$$man_page`; done +# for man_page in $(man_pages); do $(MAN2HTML_BIN) -r $(MAN2HTML_SRC)/$$man_page > $(MAN2HTML_DEST)/$$man_page.html; done + +clean: clean_man2html + +clean_man2html: +# rm -rf `dirname $(MAN2HTML_DEST)` + +install: install_scripts install_config install_man install_version + +install_scripts: +# $(INSTALL_DIR) $(DESTDIR)$(BINDIR) +# $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR) + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/x2gofeature.d +# $(INSTALL_PROGRAM) bin/* $(DESTDIR)$(BINDIR)/ +# $(INSTALL_PROGRAM) sbin/* $(DESTDIR)$(SBINDIR)/ + $(INSTALL_PROGRAM) share/x2gofeature.d/*.features $(DESTDIR)$(SHAREDIR)/x2gofeature.d/ + +install_config: + $(INSTALL_DIR) $(DESTDIR)$(ETCDIR) + $(INSTALL_FILE) etc/* $(DESTDIR)$(ETCDIR)/ + +install_man: +# $(INSTALL_DIR) $(DESTDIR)$(MANDIR) +# $(INSTALL_DIR) $(DESTDIR)$(MANDIR)/man8 +# $(INSTALL_FILE) man/man8/*.8 $(DESTDIR)$(MANDIR)/man8 +# gzip -f $(DESTDIR)$(MANDIR)/man8/x2go*.8 + +install_version: + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR) + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/versions + $(INSTALL_FILE) VERSION.x2goserver-xsession $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-xsession + +uninstall: uninstall_scripts uninstall_config uninstall_man uninstall_version + +uninstall_scripts: +# for file in $(BIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(BINDIR)/$$file; done +# for file in $(SBIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(SBINDIR)/$$file; done + for file in $(FEATURE_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(SHAREDIR)/x2gofeature.d/$$file; done + +uninstall_config: + for file in $(ETC_FILES); do $(RM_FILE) $(DESTDIR)$(ETCDIR)/$$file; done + +uninstall_man: +# for file in $(BIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(MANDIR)/man8/$$file.8.gz; done +# for file in $(SBIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(MANDIR)/man8/$$file.8.gz; done +# $(RM_DIR) $(DESTDIR)$(MANDIR) || true + +uninstall_version: + $(RM_FILE) $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver-xsession + $(RM_DIR) $(DESTDIR)$(SHAREDIR)/versions || true diff --git a/x2goserver-xsession/VERSION.x2goserver-xsession b/x2goserver-xsession/VERSION.x2goserver-xsession new file mode 100644 index 0000000..d720f99 --- /dev/null +++ b/x2goserver-xsession/VERSION.x2goserver-xsession @@ -0,0 +1 @@ +3.0.99.8 \ No newline at end of file diff --git a/x2goserver-xsession/doc/README.Xsession-x2go b/x2goserver-xsession/doc/README.Xsession-x2go new file mode 100644 index 0000000..6324737 --- /dev/null +++ b/x2goserver-xsession/doc/README.Xsession-x2go @@ -0,0 +1,15 @@ +Xsession-x2go README +==================== + +With X2Go it is possible to use Xsession config files of your +local X11 system. + +By default most files and folders related to Xsession config +are symlinks to the corresponding file/folder in /etc/X11. + +If you want to customize your X2Go server's Xsession setup +copy the corresponding files from /etc/X11 to /etc/x2go and +adapt the setup to your needs. + +light+love, +Mike Gabriel, 20111027 diff --git a/x2goserver-xsession/etc/Xresources b/x2goserver-xsession/etc/Xresources new file mode 120000 index 0000000..484aa45 --- /dev/null +++ b/x2goserver-xsession/etc/Xresources @@ -0,0 +1 @@ +/etc/X11/Xresources \ No newline at end of file diff --git a/x2goserver-xsession/etc/Xsession b/x2goserver-xsession/etc/Xsession new file mode 100755 index 0000000..bda13bd --- /dev/null +++ b/x2goserver-xsession/etc/Xsession @@ -0,0 +1,121 @@ +#!/bin/sh +# +# /etc/x2go/Xsession +# +# X2go Xsession file -- used by x2goserver Xsession.d add-on. + +# This file has been derived from the global Xsession file in Debian squeeze + +set -e + +PROGNAME=XSession-x2go + +message () { + # pretty-print messages of arbitrary length; use xmessage if it + # is available and $DISPLAY is set + MESSAGE="$PROGNAME: $*" + echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2 + if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then + echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file - + fi +} + +message_nonl () { + # pretty-print messages of arbitrary length (no trailing newline); use + # xmessage if it is available and $DISPLAY is set + MESSAGE="$PROGNAME: $*" + echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2; + if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then + echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file - + fi +} + +errormsg () { + # exit script with error + message "$*" + exit 1 +} + +internal_errormsg () { + # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message + # One big call to message() for the sake of xmessage; if we had two then + # the user would have dismissed the error we want reported before seeing the + # request to report it. + errormsg "$*" \ + "Please report the installed version of the \"x2goserver\"" \ + "package and the complete text of this error message to" \ + "<x2go-dev@lists.x2go.org>." +} + +# initialize variables for use by all session scripts + +OPTIONFILE=/etc/x2go/Xsession.options + +SYSRESOURCES=/etc/x2go/Xresources +USRRESOURCES=$HOME/.Xresources-x2go + +SYSSESSIONDIR=/etc/x2go/Xsession.d +USERXSESSION=$HOME/.xsession-x2go +USERXSESSIONRC=$HOME/.xsessionrc-x2go +ALTUSERXSESSION=$HOME/.Xsession-x2go +ERRFILE=$HOME/.xsession-x2go-errors + +# attempt to create an error file; abort if we cannot +if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] && + [ ! -L "$ERRFILE" ]; then + chmod 600 "$ERRFILE" +elif ERRFILE=$(tempfile 2> /dev/null); then + if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-x2go-$USER"; then + message "warning: unable to symlink \"$TMPDIR/xsession-x2go-$USER\" to" \ + "\"$ERRFILE\"; look for session log/errors in" \ + "\"$TMPDIR/xsession-x2go-$USER\"." + fi +else + errormsg "unable to create X session (X2Go) log/error file; aborting." +fi + +exec >>"$ERRFILE" 2>&1 + +echo "$PROGNAME: X session started for $LOGNAME at $(date)" + +# sanity check; is our session script directory present? +if [ ! -d "$SYSSESSIONDIR" ]; then + errormsg "no \"$SYSSESSIONDIR\" directory found; aborting." +fi + +# Attempt to create a file of non-zero length in /tmp; a full filesystem can +# cause mysterious X session failures. We do not use touch, :, or test -w +# because they won't actually create a file with contents. We also let standard +# error from tempfile and echo go to the error file to aid the user in +# determining what went wrong. +WRITE_TEST=$(tempfile) +if ! echo "*" >>"$WRITE_TEST"; then + message "warning: unable to write to ${WRITE_TEST%/*}; X session (X2Go) may" \ + "exit with an error" +fi +rm -f "$WRITE_TEST" + +# use run-parts to source every file in the session directory; we source +# instead of executing so that the variables and functions defined above +# are available to the scripts, and so that they can pass variables to each +# other + +SESSIONFILES=$(run-parts --list $SYSSESSIONDIR) +SYSSESSIONDIR=/etc/x2go/Xsession.d + +SESSIONFILES=$(run-parts --list $SYSSESSIONDIR) + +### source Xsession files +if [ -n "$SESSIONFILES" ]; then + + set +e + for SESSIONFILE in $SESSIONFILES; do + /usr/lib/x2go/x2gosyslog "$0" "info" "executing $SESSIONFILE" + . $SESSIONFILE + done + set -e +fi + +exit 0 + +# vim:set ai et sts=2 sw=2 tw=80: diff --git a/x2goserver-xsession/etc/Xsession.d b/x2goserver-xsession/etc/Xsession.d new file mode 120000 index 0000000..f64317e --- /dev/null +++ b/x2goserver-xsession/etc/Xsession.d @@ -0,0 +1 @@ +/etc/X11/Xsession.d \ No newline at end of file diff --git a/x2goserver-xsession/etc/Xsession.options b/x2goserver-xsession/etc/Xsession.options new file mode 120000 index 0000000..72929e1 --- /dev/null +++ b/x2goserver-xsession/etc/Xsession.options @@ -0,0 +1 @@ +/etc/X11/Xsession.options \ No newline at end of file diff --git a/x2goserver/bin/x2gocmdexitmessage b/x2goserver-xsession/share/x2gofeature.d/x2goserver-xsession.features similarity index 64% copy from x2goserver/bin/x2gocmdexitmessage copy to x2goserver-xsession/share/x2gofeature.d/x2goserver-xsession.features index 9c5e7bd..9fb329e 100755 --- a/x2goserver/bin/x2gocmdexitmessage +++ b/x2goserver-xsession/share/x2gofeature.d/x2goserver-xsession.features @@ -17,10 +17,20 @@ # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # -# Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> -# Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +# Copyright (C) 2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> +# Copyright (C) 2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -X2GO_ROOT=${HOME}/.x2go -MESSAGE_FILE=$X2GO_ROOT/C-$1/cmdoutput +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` + +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" + +X2GO_FEATURE=$1 + +# check for X2go server core features +case "$X2GO_FEATURE" in + + "X2GO_XSESSION") echo "ok"; exit 0;; + *) exit -1;; + +esac -cat $MESSAGE_FILE \ No newline at end of file diff --git a/x2goserver/.build_man2html/html/man8/x2gocleansessions.8.html b/x2goserver/.build_man2html/html/man8/x2gocleansessions.8.html deleted file mode 100644 index 5fa85bd..0000000 --- a/x2goserver/.build_man2html/html/man8/x2gocleansessions.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2gocleansessions</TITLE> -</HEAD><BODY> -<H1>x2gocleansessions</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2gocleansessions - X2go Server Cleanup Daemon -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2gocleansessions</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2gocleansessions</B> is run as a service on X2go servers to handle the cleanup of stale sessions. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/.build_man2html/html/man8/x2golistsessions.8.html b/x2goserver/.build_man2html/html/man8/x2golistsessions.8.html deleted file mode 100644 index b91d5b3..0000000 --- a/x2goserver/.build_man2html/html/man8/x2golistsessions.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2golistsessions</TITLE> -</HEAD><BODY> -<H1>x2golistsessions</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2golistsessions - X2go Server Script -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2golistsessions</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2golistsessions</B> is one of many scripts belonging to X2go Server. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/.build_man2html/html/man8/x2gomountdirs.8.html b/x2goserver/.build_man2html/html/man8/x2gomountdirs.8.html deleted file mode 100644 index 81e8d63..0000000 --- a/x2goserver/.build_man2html/html/man8/x2gomountdirs.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2gomountdirs</TITLE> -</HEAD><BODY> -<H1>x2gomountdirs</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2gomountdirs - X2go Server Script -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2gomountdirs</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2gomountdirs</B> is one of many scripts belonging to X2go Server. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/.build_man2html/html/man8/x2goprint.8.html b/x2goserver/.build_man2html/html/man8/x2goprint.8.html deleted file mode 100644 index d71bba5..0000000 --- a/x2goserver/.build_man2html/html/man8/x2goprint.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2goprint</TITLE> -</HEAD><BODY> -<H1>x2goprint</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2goprint - X2go Server Script -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2goprint</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2goprint</B> is one of many scripts belonging to X2go Server. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/.build_man2html/html/man8/x2goresume-session.8.html b/x2goserver/.build_man2html/html/man8/x2goresume-session.8.html deleted file mode 100644 index 7ac8a17..0000000 --- a/x2goserver/.build_man2html/html/man8/x2goresume-session.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2goresume-session</TITLE> -</HEAD><BODY> -<H1>x2goresume-session</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2goresume-session - X2go Server Script -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2goresume-session</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2goresume-session</B> is one of many scripts belonging to X2go Server. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/.build_man2html/html/man8/x2goruncommand.8.html b/x2goserver/.build_man2html/html/man8/x2goruncommand.8.html deleted file mode 100644 index 8a6506e..0000000 --- a/x2goserver/.build_man2html/html/man8/x2goruncommand.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2goruncommand</TITLE> -</HEAD><BODY> -<H1>x2goruncommand</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2goruncommand - X2go Server Script -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2goruncommand</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2goruncommand</B> is one of many scripts belonging to X2go Server. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/.build_man2html/html/man8/x2gostartagent.8.html b/x2goserver/.build_man2html/html/man8/x2gostartagent.8.html deleted file mode 100644 index 38b5340..0000000 --- a/x2goserver/.build_man2html/html/man8/x2gostartagent.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2gostartagent</TITLE> -</HEAD><BODY> -<H1>x2gostartagent</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2gostartagent - X2go Server Script -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2gostartagent</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2gostartagent</B> is one of many scripts belonging to X2go Server. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/.build_man2html/html/man8/x2gosuspend-session.8.html b/x2goserver/.build_man2html/html/man8/x2gosuspend-session.8.html deleted file mode 100644 index 9e1308e..0000000 --- a/x2goserver/.build_man2html/html/man8/x2gosuspend-session.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2gosuspend-session</TITLE> -</HEAD><BODY> -<H1>x2gosuspend-session</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2gosuspend-session - X2go Server Script -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2gosuspend-session</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2gosuspend-session</B> is one of many scripts belonging to X2go Server. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/.build_man2html/html/man8/x2goterminate-session.8.html b/x2goserver/.build_man2html/html/man8/x2goterminate-session.8.html deleted file mode 100644 index 3f7bb19..0000000 --- a/x2goserver/.build_man2html/html/man8/x2goterminate-session.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2goterminate-session</TITLE> -</HEAD><BODY> -<H1>x2goterminate-session</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2goterminate-session - X2go Server Script -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2goterminate-session</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2goterminate-session</B> is one of many scripts belonging to X2go Server. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/.build_man2html/html/man8/x2goumount-session.8.html b/x2goserver/.build_man2html/html/man8/x2goumount-session.8.html deleted file mode 100644 index 1940b50..0000000 --- a/x2goserver/.build_man2html/html/man8/x2goumount-session.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2goumount_session</TITLE> -</HEAD><BODY> -<H1>x2goumount_session</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2goumount_session - X2go Server Script -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2goumount_session</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2goumount_session</B> is one of many scripts belonging to X2go Server. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/.build_man2html/html/man8/x2goumount.8.html b/x2goserver/.build_man2html/html/man8/x2goumount.8.html deleted file mode 100644 index 7c6b79d..0000000 --- a/x2goserver/.build_man2html/html/man8/x2goumount.8.html +++ /dev/null @@ -1,49 +0,0 @@ -Content-type: text/html - -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML><HEAD><TITLE>Man page of x2goumount</TITLE> -</HEAD><BODY> -<H1>x2goumount</H1> -Section: X2go Server Tool (8)<BR>Updated: 18 May 2011<BR><A HREF="#index">Index</A> -<A HREF="../index.html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -x2goumount - X2go Server Script -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - - - - -<B>x2goumount</B> -<P> -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -<B>x2goumount</B> is one of many scripts belonging to X2go Server. -<P> - -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -This manual has been written by Mike Gabriel <<A HREF="mailto:mike.gabriel@das-netzwerkteam.de">mike.gabriel@das-netzwerkteam.de</A>> for the X2go project -(<A HREF="http://www.x2go.org).">http://www.x2go.org).</A> -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -</DL> -<HR> -This document was created by -<A HREF="/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 10:13:24 GMT, May 31, 2011 -</BODY> -</HTML> diff --git a/x2goserver/Makefile b/x2goserver/Makefile index 765f17f..2cc1bbd 100755 --- a/x2goserver/Makefile +++ b/x2goserver/Makefile @@ -22,6 +22,7 @@ SHAREDIR=$(PREFIX)/share/x2go BIN_SCRIPTS=$(shell cd bin && ls) SBIN_SCRIPTS=$(shell cd sbin && ls) LIB_FILES=$(shell cd lib && ls) +FEATURE_SCRIPTS=$(shell cd share/x2gofeature.d && ls *.features) man_pages = `cd man && find * -type f` @@ -31,7 +32,12 @@ MAN2HTML_DEST = .build_man2html/html all: clean build -build: build-indep +build: build-arch build-indep + +build-arch: build_setgidwrappers + +build_setgidwrappers: + gcc -o x2gosqlitewrapper x2gosqlitewrapper.c build-indep: build_man2html @@ -40,10 +46,13 @@ build_man2html: for man_page in $(man_pages); do mkdir -p `dirname $(MAN2HTML_DEST)/$$man_page`; done for man_page in $(man_pages); do $(MAN2HTML_BIN) -r $(MAN2HTML_SRC)/$$man_page > $(MAN2HTML_DEST)/$$man_page.html; done -clean: clean_man2html +clean: clean_arch clean_man2html + +clean_arch: + rm -f x2gosqlitewrapper clean_man2html: - rm -rf `dirname $(MAN2HTML_DEST)` + rm -Rf `dirname $(MAN2HTML_DEST)` install: install_scripts install_config install_man install_version @@ -51,9 +60,15 @@ install_scripts: $(INSTALL_DIR) $(DESTDIR)$(BINDIR) $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) $(INSTALL_DIR) $(DESTDIR)$(LIBDIR) + $(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/x2gofeature.d $(INSTALL_PROGRAM) bin/* $(DESTDIR)$(BINDIR)/ $(INSTALL_PROGRAM) sbin/* $(DESTDIR)$(SBINDIR)/ - $(INSTALL_FILE) lib/* $(DESTDIR)$(LIBDIR)/ + $(INSTALL_PROGRAM) x2gosqlitewrapper $(DESTDIR)$(LIBDIR)/ + $(INSTALL_PROGRAM) lib/* $(DESTDIR)$(LIBDIR)/ + $(INSTALL_PROGRAM) share/x2gofeature.d/*.features $(DESTDIR)$(SHAREDIR)/x2gofeature.d/ + chmod a-x $(DESTDIR)$(LIBDIR)/*.pm + chown root:x2gouser $(DESTDIR)$(LIBDIR)/x2gosqlitewrapper + chmod 2755 $(DESTDIR)$(LIBDIR)/x2gosqlitewrapper install_config: $(INSTALL_DIR) $(DESTDIR)$(ETCDIR) @@ -79,20 +94,24 @@ uninstall_scripts: for file in $(BIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(BINDIR)/$$file; done for file in $(SBIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(SBINDIR)/$$file; done for file in $(LIB_FILES); do $(RM_FILE) $(DESTDIR)$(LIBDIR)/$$file; done - $(RM_DIR) $(DESTDIR)$(LIBDIR) + for file in $(FEATURE_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(SHAREDIR)/x2gofeature.d/$$file; done + $(RM_FILE) $(DESTDIR)$(LIBDIR)/x2gosqlitewrapper + $(RM_DIR) $(DESTDIR)$(LIBDIR) || true + $(RM_DIR) $(DESTDIR)$(SHAREDIR)/x2gofeature.d || true + $(RM_DIR) $(DESTDIR)$(SHAREDIR) || true uninstall_config: $(RM_FILE) $(DESTDIR)$(ETCDIR)/x2goserver.conf $(RM_FILE) $(DESTDIR)$(ETCDIR)/x2gosql/sql - $(RM_DIR) $(DESTDIR)$(ETCDIR) - $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql/passwords - $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql + $(RM_DIR) $(DESTDIR)$(ETCDIR) || true + $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql/passwords || true + $(RM_DIR) $(DESTDIR)$(ETCDIR)/x2gosql || true uninstall_man: for file in $(BIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(MANDIR)/man8/$$file.8.gz; done for file in $(SBIN_SCRIPTS); do $(RM_FILE) $(DESTDIR)$(MANDIR)/man8/$$file.8.gz; done - $(RM_DIR) $(DESTDIR)$(MANDIR) + $(RM_DIR) $(DESTDIR)$(MANDIR) || true uninstall_version: $(RM_FILE) $(DESTDIR)$(SHAREDIR)/versions/VERSION.x2goserver - $(RM_DIR) $(DESTDIR)$(SHAREDIR)/versions + $(RM_DIR) $(DESTDIR)$(SHAREDIR)/versions || true diff --git a/x2goserver/VERSION.x2goserver b/x2goserver/VERSION.x2goserver index 34936c7..d720f99 100644 --- a/x2goserver/VERSION.x2goserver +++ b/x2goserver/VERSION.x2goserver @@ -1 +1 @@ -3.0.99.5 \ No newline at end of file +3.0.99.8 \ No newline at end of file diff --git a/x2goserver/bin/x2gogetservers b/x2goserver/bin/x2gobasepath similarity index 76% copy from x2goserver/bin/x2gogetservers copy to x2goserver/bin/x2gobasepath index 38aa496..4f9198b 100755 --- a/x2goserver/bin/x2gogetservers +++ b/x2goserver/bin/x2gobasepath @@ -17,12 +17,13 @@ # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # -# Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> -# Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +# Copyright (C) 2007-2011 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> use strict; +use Cwd; +use Cwd 'abs_path'; -use lib "/usr/lib/x2go"; -use x2godbwrapper; +my $dir = getcwd; +my $base_path = abs_path("$0/../.."); -print join("\n", db_getservers); +print "$base_path"; diff --git a/x2goserver/bin/x2gocmdexitmessage b/x2goserver/bin/x2gocmdexitmessage index 9c5e7bd..8c96e92 100755 --- a/x2goserver/bin/x2gocmdexitmessage +++ b/x2goserver/bin/x2gocmdexitmessage @@ -20,7 +20,12 @@ # Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` X2GO_ROOT=${HOME}/.x2go MESSAGE_FILE=$X2GO_ROOT/C-$1/cmdoutput -cat $MESSAGE_FILE \ No newline at end of file +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" +$X2GO_LIB_PATH/x2gosyslog "$0" "debug" "command output starts with: $(head -n5 $MESSAGE_FILE | sed s/\n/ /g)" + +# return command output of the command that was issued by x2goruncommand +cat $MESSAGE_FILE diff --git a/x2goserver-extensions/bin/x2goversion b/x2goserver/bin/x2gofeature similarity index 56% copy from x2goserver-extensions/bin/x2goversion copy to x2goserver/bin/x2gofeature index 64dd758..6bb7d6a 100755 --- a/x2goserver-extensions/bin/x2goversion +++ b/x2goserver/bin/x2gofeature @@ -20,28 +20,21 @@ # Copyright (C) 2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -X2GO_VERSIONS_BASEPATH="$(dirname $0)/../share/x2go/versions" +[ -z $1 ] && { echo usage: "$(basename $0) <X2GO_FEATURE_NAME>"; exit -2; } -get_version() { - cat "$1" | egrep -v "^#.*" | head -n1 | cut -d" " -f1 -} +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` +X2GO_SHARE_PATH=`echo -n \$(x2gobasepath)/share/x2go` + +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" -if [ -n "$1" ]; then - X2GO_COMPONENT="$1" - X2GO_COMPONENT_VERFILE="${X2GO_VERSIONS_BASEPATH}/VERSION.${X2GO_COMPONENT}" +X2GO_FEATURE=$1 - if [ -f "${X2GO_COMPONENT_VERFILE}" ]; then - echo "$(get_version ${X2GO_COMPONENT_VERFILE})" - else - echo "Version information for X2go component '$X2GO_COMPONENT' is not available." >&1 - fi -else - cd ${X2GO_VERSIONS_BASEPATH} - for compfile in `ls ${X2GO_VERSIONS_BASEPATH}`; do - X2GO_COMPONENT="$(echo $compfile | cut -d"." -f2)" - X2GO_COMPONENT_VERSION="$(get_version $compfile)" - echo "${X2GO_COMPONENT}: ${X2GO_COMPONENT_VERSION}" - done - cd - >/dev/null -fi +# run x2gofeature scripts of X2go extensions +test -d $X2GO_SHARE_PATH/x2gofeature.d && { + for subscript in $X2GO_SHARE_PATH/x2gofeature.d/*.features; do + $subscript $@ && exit 0 + done +} +echo "not available" +exit -1 diff --git a/x2goserver/bin/x2golistdesktops b/x2goserver/bin/x2golistdesktops index 8ba46ae..743d23d 100755 --- a/x2goserver/bin/x2golistdesktops +++ b/x2goserver/bin/x2golistdesktops @@ -22,20 +22,34 @@ use strict; use Sys::Hostname; +use Sys::Syslog qw( :standard :macros ); + +use lib `echo -n \$(x2gobasepath)/lib/x2go`; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + + +if ( @ARGV ) { + syslog('info', "x2golistdesktops has been called with options: @ARGV"); +} else { + syslog('info', "x2golistdesktops has been called without options"); +} my $serv=shift; if( ! $serv) { - $serv=hostname; + $serv=hostname; } my $rsess=`x2golistsessions x2goserver |grep _stR`; my @rsess=split("\n","$rsess"); my @rdisplays; -for(my $i=0;$i<@rsess;$i++) +for (my $i=0;$i<@rsess;$i++) { - my @sinfo=split("\\|",@rsess[$i]); - @rdisplays[$i]=@sinfo[2]; + my @sinfo=split("\\|",@rsess[$i]); + @rdisplays[$i]=@sinfo[2]; } my $rdisp=join("I",@rdisplays); @@ -46,19 +60,19 @@ my $outp=`ls -1 /tmp/.X11-unix/`; my @outp=split("\n","$outp"); for(my $i=0;$i<@outp;$i++) { - my $display=@outp[$i]; - $display=~s/X/:/; - my $checkdisp=$display; - $checkdisp=~s/:/I/; - $checkdisp="${checkdisp}I"; - if (!( $rdisp =~ m/$checkdisp/ )) - { - my $inf=`xwininfo -root -display $display 2> /dev/null`; - if ( $inf=~ m/geometry/) - { - print "$uname\@$display\n"; - } - } + my $display=@outp[$i]; + $display=~s/X/:/; + my $checkdisp=$display; + $checkdisp=~s/:/I/; + $checkdisp="${checkdisp}I"; + if (!( $rdisp =~ m/$checkdisp/ )) + { + my $inf=`xwininfo -root -display $display 2> /dev/null`; + if ( $inf=~ m/geometry/) + { + print "$uname\@$display\n"; + } + } } $outp=`ls -1 /tmp/ | grep x2godesktopsharing_`; @@ -66,9 +80,12 @@ $outp=`ls -1 /tmp/ | grep x2godesktopsharing_`; for(my $i=0;$i<@outp;$i++) { - my @ln=split("\@",@outp[$i]); - if( @ln[1] ne $uname ) - { - print "@ln[1]\@@ln[2]\n"; - } + my @ln=split("\@",@outp[$i]); + if ( @ln[1] ne $uname ) + { + print "@ln[1]\@@ln[2]\n"; + } } + +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/bin/x2gochangestatus b/x2goserver/bin/x2golistmounts similarity index 76% copy from x2goserver/bin/x2gochangestatus copy to x2goserver/bin/x2golistmounts index 542cab4..561c554 100755 --- a/x2goserver/bin/x2gochangestatus +++ b/x2goserver/bin/x2golistmounts @@ -21,12 +21,20 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); - -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + + +my $session_id=shift or die; -my $status=shift or die; -my $sid=shift or die; +my $mounts = join("\n", db_getmounts($session_id)); +print "$mounts\n"; -db_changestatus($status, $sid); +# closing syslog +closelog; diff --git a/x2goserver/bin/x2golistsessions b/x2goserver/bin/x2golistsessions index 0119f3b..080aa94 100755 --- a/x2goserver/bin/x2golistsessions +++ b/x2goserver/bin/x2golistsessions @@ -20,62 +20,75 @@ # Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -use Sys::Hostname; use strict; +use Sys::Hostname; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); +if ( @ARGV ) { + syslog('info', "x2golistsessions has been called with options: @ARGV"); +} else { + # hiding normal x2golistsessions calls into debug loglevel + syslog('debug', "x2golistsessions has been called with no option"); +} sub check_stat { - my $sess=shift; - my $log="$ENV{'HOME'}/.x2go/C-$sess/session.log"; - my $text=`tail -1 $log`; - if($text =~ m/Session suspended/) - { - return 0; - } - return 1; + my $sess=shift; + my $log="$ENV{'HOME'}/.x2go/C-$sess/session.log"; + my $text=`tail -1 $log 2>/dev/null`; + if ($text =~ m/Session suspended/) + { + return 0; + } + return 1; } my $serv=shift; if( ! $serv) { - $serv=hostname; + $serv=hostname; } my @outp; if($serv eq "--all-servers") { - @outp=db_listsessions_all(); + @outp=db_listsessions_all(); } else { - @outp=db_listsessions($serv); + @outp=db_listsessions($serv); } -for(my $i=0;$i<@outp;$i++) +for (my $i=0;$i<@outp;$i++) { - @outp[$i] =~ s/ //g; - @outp[$i] =~ s/\*/ /g; - my @sinfo=split('\\|',"@outp[$i]"); - if(@sinfo[4]eq 'F') - { - print "@outp[$i]\n"; - } - else - { - if(@sinfo[4]eq 'R') - { - if(!check_stat(@sinfo[1])) - { - db_changestatus( 'S', @sinfo[1] ); - @outp[$i] =~ s/\|R\|/\|S\|/; - system( "x2goumount-session @sinfo[1]"); - - } - } - print "@outp[$i]\n"; - } + @outp[$i] =~ s/ //g; + @outp[$i] =~ s/\*/ /g; + my @sinfo=split('\\|',"@outp[$i]"); + if (@sinfo[4]eq 'F') + { + print "@outp[$i]\n"; + } + else + { + if (@sinfo[4]eq 'R') + { + if(!check_stat(@sinfo[1])) + { + db_changestatus( 'S', @sinfo[1] ); + @outp[$i] =~ s/\|R\|/\|S\|/; + system( "x2goumount-session @sinfo[1]"); + } + } + print "@outp[$i]\n"; + } } + +# closing syslog +closelog; diff --git a/x2goserver/bin/x2gomountdirs b/x2goserver/bin/x2gomountdirs index f48fa6f..7f65d07 100755 --- a/x2goserver/bin/x2gomountdirs +++ b/x2goserver/bin/x2gomountdirs @@ -21,51 +21,60 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + + +syslog('info', "x2golistmountdirs has been called with options: @ARGV"); my $type=shift; my $session=shift; my $user=shift; my $key=shift; my @dl; +my $msg; my $i=0; @dl[$i]=shift; while(@dl[$i]) { - $i++; - @dl[$i]=shift; + $i++; + @dl[$i]=shift; } my $dirlist=join(" ",@dl); chop($dirlist); my $reverse=0; my $port="22"; print "dirs:$dirlist\n"; -if($dirlist =~ m/__REVERSESSH_PORT__/) +if ($dirlist =~ m/__REVERSESSH_PORT__/) { - @dl=split("__REVERSESSH_PORT__","$dirlist"); - $dirlist=@dl[0]; - $port=@dl[1]; - $reverse=1; + @dl=split("__REVERSESSH_PORT__","$dirlist"); + $dirlist=@dl[0]; + $port=@dl[1]; + $reverse=1; } -if($dirlist =~ m/__SSH_PORT__/) +if ($dirlist =~ m/__SSH_PORT__/) { - @dl=split("__SSH_PORT__","$dirlist"); - $dirlist=@dl[0]; - $port=@dl[1]; + @dl=split("__SSH_PORT__","$dirlist"); + $dirlist=@dl[0]; + $port=@dl[1]; } print "ssh port:$port\n"; my $host; if($reverse == 0) { - $host=(split(" ",$ENV{'SSH_CLIENT'}))[0]; + $host=(split(" ",$ENV{'SSH_CLIENT'}))[0]; } else { - $host='127.0.0.1'; + $host='127.0.0.1'; } print "Host:$host\n"; print "User:$user\n"; @@ -96,201 +105,224 @@ my $spooldir="/tmp/spool_$ENV{'USER'}"; my $mimeboxdir_lnk="$ENV{'HOME'}/.x2go/C-$session/mimebox"; my $mimeboxdir="/tmp/mimebox_$ENV{'USER'}"; -if(! -e $mdir) +if (! -e $mdir) { - mkdir($mdir); + mkdir($mdir); } chmod(0700,$mdir); -if(! -e "$mdir/disk") +if (! -e "$mdir/disk") { - mkdir("$mdir/disk"); + mkdir("$mdir/disk"); } chmod(0700,"$mdir/disk"); -if(! -e "$mdir/cd") +if (! -e "$mdir/cd") { - mkdir("$mdir/cd"); + mkdir("$mdir/cd"); } chmod(0700,"$mdir/cd"); -if(! -e "$mdir/rm") +if (! -e "$mdir/rm") { - mkdir("$mdir/rm"); + mkdir("$mdir/rm"); } chmod(0700,"$mdir/rm"); my $plasmstamp=$mdir."/".$session.".plasmoid"; -if(! -e $spooldir) +if (! -e $spooldir) { - mkdir($spooldir); + mkdir($spooldir); } chmod(0700,$spooldir); $spooldir="$spooldir/$session"; -if(! -e $spooldir) +if (! -e $spooldir) { - mkdir($spooldir); + mkdir($spooldir); } chmod(0700,$spooldir); -if(! -e $mimeboxdir) +if (! -e $mimeboxdir) { - mkdir($mimeboxdir); + mkdir($mimeboxdir); } chmod(0700,$mimeboxdir); $mimeboxdir="$mimeboxdir/$session"; -if(! -e $mimeboxdir) +if (! -e $mimeboxdir) { - mkdir($mimeboxdir); + mkdir($mimeboxdir); } chmod(0700,$mimeboxdir); -if( -d $ldir) +if ( -d $ldir) { - rmdir($ldir); + rmdir($ldir); } -if( ! -l $ldir) +if ( ! -l $ldir) { - system ("ln -s $mdir $ldir"); + system ("ln -s $mdir $ldir"); } -if( -d $spooldir_lnk) +if ( -d $spooldir_lnk) { - rmdir($spooldir_lnk); + rmdir($spooldir_lnk); } -if( ! -l $spooldir_lnk) +if ( ! -l $spooldir_lnk) { - system ("ln -s $spooldir $spooldir_lnk"); + system ("ln -s $spooldir $spooldir_lnk"); } -if( -d $mimeboxdir_lnk) +if ( -d $mimeboxdir_lnk) { - rmdir($mimeboxdir_lnk); + rmdir($mimeboxdir_lnk); } -if( ! -l $mimeboxdir_lnk) +if ( ! -l $mimeboxdir_lnk) { - system ("ln -s $mimeboxdir $mimeboxdir_lnk"); + system ("ln -s $mimeboxdir $mimeboxdir_lnk"); } my $uname=$ENV{'USER'}; my @dirs=split(':',$dirlist); -for(my $i=0;$i<@dirs;$i++) +for (my $i=0;$i<@dirs;$i++) { - my $printspool=0; - my $mimeboxspool=0; - my $mntpath; - if(@dirs[$i]=~m/__PRINT_SPOOL_/) - { - @dirs[$i]=~s/__PRINT_SPOOL_//; - $printspool=1; - $mntpath=$spooldir; - } - elsif(@dirs[$i]=~m/__MIMEBOX_SPOOL_/) - { - @dirs[$i]=~s/__MIMEBOX_SPOOL_//; - $mimeboxspool=1; - $mntpath=$mimeboxdir; - } - else - { - my $p=@dirs[$i]; - if($type ne "dir") - { - $p=~s/\/ramdrive\/mnt\///; - if($p =~ m/CDROM/) - { - $mdir=$mdir."/cd"; - } - else - { - $mdir=$mdir."/rm"; - } - - } - else - { - $mdir=$mdir."/disk"; - } - $p=~s/\//_/g; - $p=~s/ /_/g; - $p=~s/_cygdrive_//g; - $p=~s/~//g; - mkdir("$mdir/$p"); - $mntpath="$mdir/$p"; - } - - if(db_insertmount( $session, $mntpath, $host)) - { - my $code_conv=$ENV{'X2GO_ICONV'}; - if($code_conv ne "") - { - $code_conv="-o $code_conv"; - } - print "inserted,\nsshfs $code_conv -o IdentityFile=$key,UserKnownHostsFile=$key.ident \"$user\"\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port\n"; - if(system("sshfs $code_conv -o ServerAliveInterval=300,Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident \"$user\"\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port 2>>~/mounts.log")==0) - { - print "mount @dirs[$i] ok\n"; - - # check if kde4 plasmoid running - my $useplasmoid=0; - if( -e $plasmstamp ) - { - open(STMP,"<$plasmstamp"); - my $stamp=<STMP>; - close (STMP); - if(abs($stamp-time())<15) - { - $useplasmoid=1; - } - } - if(! $printspool && ! $mimeboxspool && ! $useplasmoid) - { - my $fname="$ENV{'HOME'}/Desktop"; - my $p=@dirs[$i]; - $p=~s/\/cygdrive\///g; - $p=~s/\//_/g; - $fname="$fname/$p"; - if($type eq "dir") - { - $fname="$fname(sshfs-disk)"; - } - else - { - if($fname =~ m/CDROM/) - { - $fname="$fname(sshfs-cdrom)"; - } - else - { - $fname="$fname(sshfs-removable)"; - } - $fname=~s/_ramdrive_mnt_//; - } - print "fname: $fname\n"; - open(F,">$fname"); - print F "$mntpath\n$session\n\n\0"; - close(F); - } - } - else - { - print "mount @dirs[$i] failed\n"; - db_deletemount( $session, $mntpath); - rmdir($mntpath); - } - } - else - { - print "insertion failed(already mounted?), not mounting\n"; - } + my $printspool=0; + my $mimeboxspool=0; + my $mntpath; + if(@dirs[$i]=~m/__PRINT_SPOOL_/) + { + @dirs[$i]=~s/__PRINT_SPOOL_//; + $printspool=1; + $mntpath=$spooldir; + syslog('debug', "mounting $spooldir, mount point type is print spool directory"); + } + elsif(@dirs[$i]=~m/__MIMEBOX_SPOOL_/) + { + @dirs[$i]=~s/__MIMEBOX_SPOOL_//; + $mimeboxspool=1; + $mntpath=$mimeboxdir; + syslog('debug', "mounting $mimeboxdir, mount point type is MIME box directory"); + } + else + { + my $p=@dirs[$i]; + if ($type ne "dir") + { + $p=~s/\/ramdrive\/mnt\///; + if ($p =~ m/CDROM/) + { + $mdir=$mdir."/cd"; + } + else + { + $mdir=$mdir."/rm"; + } + } + else + { + $mdir=$mdir."/disk"; + } + $p=~s/\//_/g; + $p=~s/ /_/g; + $p=~s/_cygdrive_//g; + $p=~s/~//g; + mkdir("$mdir/$p"); + $mntpath="$mdir/$p"; + } + + if (db_insertmount( $session, $mntpath, $host)) + { + my $code_conv=$ENV{'X2GO_ICONV'}; + if ($code_conv ne "") + { + $code_conv="-o $code_conv"; + } + $msg = "sshfs $code_conv -o idmap=user,uid=`id -u`,gid=`id -g`,ServerAliveInterval=300,Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident \"$user\"\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port"; + syslog('debug', "executing: $msg"); + print "inserted, $msg\n"; + if (system("sshfs $code_conv -o idmap=user,uid=`id -u`,gid=`id -g`,ServerAliveInterval=300,Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident \"$user\"\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port 2>>~/mounts.log")==0) + { + print "mount @dirs[$i] ok\n"; + syslog('notice', "successfully mounted $user\@$host:$port@dirs[$i] to $mntpath"); + # check if kde4 plasmoid running + my $useplasmoid=0; + if ( -e $plasmstamp ) + { + open(STMP,"<$plasmstamp"); + my $stamp=<STMP>; + close (STMP); + if (abs($stamp-time())<15) + { + $useplasmoid=1; + } + } + if (! $printspool && ! $mimeboxspool && ! $useplasmoid ) + { + my $fname="$ENV{'HOME'}/Desktop"; + my $current_desktop = ""; + if ($session =~ m/stDGNOME/) + { + $current_desktop="-gnome"; + } + elsif ($session =~ m/stDLXDE/) + { + $current_desktop="-lxde"; + } + + my $p=@dirs[$i]; + $p=~s/\/cygdrive\///g; + $p=~s/\//_/g; + $fname="$fname/$p"; + if ($type eq "dir") + { + $fname="$fname\ (sshfs-disk$current_desktop)"; + syslog('info', "creating desktop icon for ,,@dirs[$i]'' at ,,$fname'', media type is: client-side folder on harddrive"); + } + else + { + if ($fname =~ m/CDROM/) + { + $fname="$fname\ (sshfs-cdrom$current_desktop)"; + syslog('info', "creating desktop icon for ,,@dirs[$i]'' at ,,$fname'', media type is: optical disc"); + } + else + { + $fname="$fname\ (sshfs-removable$current_desktop)"; + syslog('info', "creating desktop icon for ,,@dirs[$i]'' at ,,$fname'', media type is: removable device"); + } + $fname=~s/_ramdrive_mnt_//; + } + print "fname: $fname\n"; + open(F,">$fname"); + print F "$mntpath\n$session\n\n\0"; + close(F); + } + } + else + { + $msg = "mounting of @dirs[$i] failed"; + print "$msg\n"; + syslog('warning', "WARNING: $msg"); + db_deletemount( $session, $mntpath); + rmdir($mntpath); + } + } + else + { + $msg = "insertion of @dirs[$i] failed (already mounted?), not mounting"; + syslog('warning', "WARNING: $msg"); + print "$msg\n"; + } } unlink($key); unlink("$key.ident"); + +# closing syslog +closelog; diff --git a/x2goserver/bin/x2goprint b/x2goserver/bin/x2goprint deleted file mode 100755 index 1a4ebaf..0000000 --- a/x2goserver/bin/x2goprint +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/perl - -# Copyright (C) 2007-2011 X2go Project - http://wiki.x2go.org -# -# 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. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -# -# Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> -# Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> - -use File::Basename; -use File::Copy; -use File::Path; -use strict; - -use lib "/usr/lib/x2go"; -use x2godbwrapper; - -if (scalar(@ARGV) ==1) -{ - system ("su @ARGV[0] -c \"x2golistsessions --all-servers\" "); -} -elsif (scalar(@ARGV) != 4) -{ - print STDERR "ERROR: Usage:\nx2goprint user session file titleFile\nx2goprint user\n"; - exit 1; -} - -my ($user, $session, $file, $titleFile)=@ARGV; - -my ($tm,$tm,$uid,$gid,$tm,$tm,$tm,$homedir)=getpwnam("x2goprint"); -my $printdir=$homedir; - -my $title; -if( -e "$printdir/$titleFile") -{ - open (TITLE,"<$printdir/$titleFile"); - $title=<TITLE>; - close (TITLE); - unlink("$printdir/$titleFile"); -} - - -($tm,$tm,$uid,$gid,$tm,$tm,$tm,$homedir)=getpwnam($user); - -my $spoolbase="/tmp/spool_$user"; -my $spooldir="$spoolbase/$session"; -my $spooltmp="$spoolbase/tmp"; -mkpath($spooltmp); -chown $uid, $gid, "$spooltmp"; -chmod 0700, "$spooltmp"; - -my ($mounts)=db_getmounts($session); -if( $mounts=~m/$spooldir/) -{ - move("$printdir/$file", "$spooltmp") or die "$!: Can't move $file to $spooltmp/"; - chown $uid, $gid, "$spooltmp/$file"; - system("su $user -c \"mv $spooltmp/$file $spooldir\""); - - open (RFILE,">$spooltmp/$file.ready"); - print RFILE "$file\n$title"; - close (RFILE); - - chown $uid, $gid, "$spooltmp/$file.ready"; - system ("su $user -c \"mv $spooltmp/$file.ready $spooldir\""); -} -else -{ - unlink("$printdir/$file"); -} diff --git a/x2goserver/bin/x2goresume-session b/x2goserver/bin/x2goresume-session index 25e7832..16a7f0c 100755 --- a/x2goserver/bin/x2goresume-session +++ b/x2goserver/bin/x2goresume-session @@ -28,24 +28,24 @@ X2GO_KBD_LAYOUT=$5 X2GO_KBD_TYPE=$6 X2GO_SET_KBD=$7 - - -X2GO_AGENT_PID=`x2gogetagent $SESSION_NAME` - +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` +X2GO_AGENT_PID=`$X2GO_LIB_PATH/x2gogetagent $SESSION_NAME` X2GO_ROOT=${HOME}/.x2go X2GO_RESIZE=0 X2GO_FULLSCREEN=0 +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" + if [ "$X2GO_GEOMETRY" == "" ] then - X2GO_GEOMETRY=fullscreen + X2GO_GEOMETRY=fullscreen fi if [ "$X2GO_GEOMETRY" == "fullscreen" ] then - X2GO_RESIZE=1 - X2GO_FULLSCREEN=1 + X2GO_RESIZE=1 + X2GO_FULLSCREEN=1 fi SESSION_DIR=${X2GO_ROOT}/C-${SESSION_NAME} @@ -58,13 +58,12 @@ LSTR=`echo "$OPTIONS" | awk -F, {'print $2'}` PSTR=`echo "$OPTIONS" | awk -F, {'print $3'}` KTSTR=`echo "$OPTIONS" | awk -F, {'print $12'}` - KTSTR=`echo $KTSTR | sed "s/\//\\\\\\\\\//"` X2GO_KBD_TYPE=`echo $X2GO_KBD_TYPE | sed "s/\//\\\\\\\\\//"` if [ "$X2GO_SET_KBD" == "0" ] then - X2GO_KBD_TYPE="null\/null" + X2GO_KBD_TYPE="null\/null" fi NEWOPTIONS=`echo "$OPTIONS" | sed -e "s/$LSTR/link=$X2GO_LINK/"\ @@ -74,18 +73,39 @@ NEWOPTIONS=`echo "$OPTIONS" | sed -e "s/$LSTR/link=$X2GO_LINK/"\ -e "s/$RSTR/resize=$X2GO_RESIZE/"\ -e "s/$FSTR/fullscreen=$X2GO_FULLSCREEN/"` - -#echo -e "old options:$OPTIONS\n\nnew options:$NEWOPTIONS" - - X2GO_CLIENT=`echo $SSH_CLIENT | awk '{print $1}'` if [ "$X2GO_CLIENT" == "" ] then - X2GO_CLIENT=$HOSTNAME + X2GO_CLIENT=$HOSTNAME fi echo "$NEWOPTIONS" >${SESSION_DIR}/options -x2goresume $X2GO_CLIENT $SESSION_NAME > /dev/null +$X2GO_LIB_PATH/x2goresume $X2GO_CLIENT $SESSION_NAME > /dev/null + +# run x2goserver-extensions for pre-resume +x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME pre-resume || true + +kill -HUP $X2GO_AGENT_PID &>/dev/null && { + $X2GO_LIB_PATH/x2gosyslog "$0" "notice" "client $X2GO_CLIENT has successfully resumed session with ID $SESSION_NAME" + + # resume x2godesktopsharing, if it has been in use before the session got suspended + x2gofeature X2GO_DESKTOPSHARING &>/dev/null && x2goresume-desktopsharing $SESSION_NAME || true + + # run x2goserver-extensions for post-resume + x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME post-resume || true + +} || { + err_msg="ERROR: failed to resume session with ID $SESSION_NAME" + echo "$err_msg" 1>&2 + $X2GO_LIB_PATH/x2gosyslog "$0" "err" "$err_msg" + + # If we reach here it means that the x2goagent process of the session has vanisshed + # If this happens than we mark the session as finished... + $X2GO_LIB_PATH/x2gochangestatus 'F' $SESSION_NAME > /dev/null + + # run x2goserver-extensions for fail-resume + x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME fail-resume || true + +} -kill -HUP $X2GO_AGENT_PID diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand index b639774..d3f0d98 100755 --- a/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -26,6 +26,11 @@ X2GO_SESSION=$3 cmd=$5 sndsys=$6 X2GO_SESS_TYPE=$7 + +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` + +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" + export DISPLAY export X2GO_AGENT_PID export X2GO_SESSION @@ -37,75 +42,63 @@ echo "exec $cmd" >> $MESSAGE_FILE IMEXIT="false" -if [ "$sndsys" == "esd" ] -then - export ESPEAKER=localhost:$4 -elif [ "$sndsys" == "arts" ] -then - export ARTS_SERVER=localhost:$4 +if [ "$sndsys" == "esd" ]; then + export ESPEAKER=localhost:$4 +elif [ "$sndsys" == "arts" ]; then + export ARTS_SERVER=localhost:$4 fi -if [ "$cmd" == "WWWBROWSER" ] -then - if [ -e "/usr/bin/firefox" ] - then - cmd="/usr/bin/firefox" - elif [ -e "/usr/bin/iceweasel" ] - then - cmd="/usr/bin/iceweasel" - elif [ -e "/usr/bin/abrowser" ] - then - cmd="/usr/bin/abrowser" - elif [ -e "/usr/bin/konqueror" ] - then - cmd="/usr/bin/konqueror" - elif [ -e "/usr/bin/galeon" ] - then - cmd="/usr/bin/galeon" - fi +if [ "$cmd" == "WWWBROWSER" ]; then + if [ -e "/usr/bin/firefox" ]; then + cmd="/usr/bin/firefox" + elif [ -e "/usr/bin/iceweasel" ]; then + cmd="/usr/bin/iceweasel" + elif [ -e "/usr/bin/abrowser" ]; then + cmd="/usr/bin/abrowser" + elif [ -e "/usr/bin/konqueror" ]; then + cmd="/usr/bin/konqueror" + elif [ -e "/usr/bin/galeon" ]; then + cmd="/usr/bin/galeon" + elif [ -e "/usr/bin/chromium-browser" ]; then + cmd="/usr/bin/chromium-browser" + fi fi -if [ "$cmd" == "MAILCLIENT" ] -then - if [ -e "/usr/bin/thunderbird" ] - then - cmd="/usr/bin/thunderbird" - elif [ -e "/usr/bin/icedove" ] - then - cmd="/usr/bin/icedove" - elif [ -e "/usr/bin/kmail" ] - then - cmd="/usr/bin/kmail" - elif [ -e "/usr/bin/evolution" ] - then - cmd="/usr/bin/evolution" - fi +if [ "$cmd" == "MAILCLIENT" ]; then + if [ -e "/usr/bin/thunderbird" ]; then + cmd="/usr/bin/thunderbird" + elif [ -e "/usr/bin/icedove" ]; then + cmd="/usr/bin/icedove" + elif [ -e "/usr/bin/kmail" ]; then + cmd="/usr/bin/kmail" + elif [ -e "/usr/bin/evolution" ]; then + cmd="/usr/bin/evolution" + fi fi -if [ "$cmd" == "OFFICE" ] -then - if [ -e "/usr/bin/ooffice" ] - then - cmd="/usr/bin/ooffice" - fi +if [ "$cmd" == "OFFICE" ]; then + if [ -e "/usr/bin/loffice" ]; then + cmd="/usr/bin/loffice" + elif [ -e "/usr/bin/ooffice" ]; then + cmd="/usr/bin/ooffice" + fi fi -if [ "$cmd" == "TERMINAL" ] -then - IMEXIT="true" - if [ -e "/usr/bin/konsole" ] - then - cmd="/usr/bin/konsole" - elif [ -e "/usr/bin/gnome-terminal" ] - then - cmd="/usr/bin/gnome-terminal" - elif [ -e "/usr/bin/rxvt" ] - then - cmd="/usr/bin/rxvt" - elif [ -e "/usr/bin/xterm" ] - then - cmd="/usr/bin/xterm" - fi +if [ "$cmd" == "TERMINAL" ]; then + IMEXIT="true" + if [ -e "/usr/bin/konsole" ]; then + cmd="/usr/bin/konsole" + # KDE4 konsole behaves differently from other terminals + IMEXIT="false" + elif [ -e "/usr/bin/gnome-terminal" ]; then + cmd="/usr/bin/gnome-terminal" + elif [ -e "/usr/bin/lxterminal" ]; then + cmd="/usr/bin/lxterminal" + elif [ -e "/usr/bin/rxvt" ]; then + cmd="/usr/bin/rxvt" + elif [ -e "/usr/bin/xterm" ]; then + cmd="/usr/bin/xterm" + fi fi EXEC=`which $cmd` @@ -113,25 +106,55 @@ EXEC=`which $cmd` BNAME=`basename $EXEC` if [ "$BNAME" == "rdesktop" ] then - IMEXIT="true" + IMEXIT="true" fi -if [ "$EXEC" != "" ] && [ -x `which $cmd` ] -then - $cmd - #### some applications can quit immediately, we waiting until x2goagent exists - if [ "$X2GO_SESS_TYPE" == "R" ] && [ "$IMEXIT" == "false" ] - then - while [ -d /proc/$X2GO_AGENT_PID ] - do - sleep 1 - done - fi +# run x2goserver-extensions for pre-runcommand +x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME pre-runcommand || true + +sucessful_run=false +if [ "$EXEC" != "" ] && [ -x $EXEC ]; then + $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "running command $EXEC" + + x2gofeature X2GO_XSESSION &>/dev/null && [ "x$X2GO_SESS_TYPE" = "xD" ] && { + STARTUP=$cmd + $X2GO_LIB_PATH/x2gosyslog "$0" "notice" "launching session with Xsession-x2go mechanism, using STARTUP=\"$STARTUP\"" + STARTUP="$STARTUP" /etc/x2go/Xsession + } || { + $cmd + } + + #### some applications can quit immediately, we will wait here as long as x2goagent exists + if [ "$X2GO_SESS_TYPE" == "R" ] && [ "$IMEXIT" == "false" ]; then + $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "command $EXEC forked to background, waiting for agent to finish" + while [ -d /proc/$X2GO_AGENT_PID ]; do + sleep 1 + done + fi + # if we reach here the possibility of a successful command execution is rather high + successful_run=true + + # run x2goserver-extensions for post-runcommand + x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME post-runcommand || true + else - echo "X2GORUNCOMMAND ERR NOEXEC:$cmd" > $MESSAGE_FILE -fi + $X2GO_LIB_PATH/x2gosyslog "$0" "err" "ERROR: command $EXEC failed to execute" + echo "X2GORUNCOMMAND ERR NOEXEC:$cmd" > $MESSAGE_FILE + + # run x2goserver-extensions for fail-runcommand + x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME fail-runcommand || true + +fi + +# stop x2godesktopsharing process gracefully... +x2gofeature X2GO_DESKTOPSHARING >/dev/null && x2godesktopsharing-terminate $X2GO_SESSION || true kill -TERM $X2GO_AGENT_PID -x2gochangestatus 'F' $X2GO_SESSION > /dev/null +$X2GO_LIB_PATH/x2gochangestatus 'F' $X2GO_SESSION > /dev/null export HOSTNAME x2goumount-session $X2GO_SESSION + +# clean up session dir if not in debug mode and if session has been successful +if [ "$($X2GO_LIB_PATH/x2gologlevel)" != "7" ] && [ "x$successful_run" = "xtrue" ]; then + (sleep 10; rm -Rf $HOME/.x2go/C-$X2GO_SESSION)& +fi diff --git a/x2goserver/bin/x2gosessionlimit b/x2goserver/bin/x2gosessionlimit index 36b275c..073d0c0 100755 --- a/x2goserver/bin/x2gosessionlimit +++ b/x2goserver/bin/x2gosessionlimit @@ -22,6 +22,16 @@ use strict; use Config::Simple; +use Sys::Syslog qw( :standard :macros ); + +use lib `echo -n \$(x2gobasepath)/lib/x2go`; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + + +syslog('info', "x2gosessionlimit has been called"); my $maxlimit=0; my $Config = new Config::Simple(syntax=>'ini'); @@ -29,20 +39,20 @@ $Config->read('/etc/x2go/x2goserver.conf' ); sub getGroupLimit { - my $group=shift; - my $strlimit=$Config->param("limit groups.$group"); - if($strlimit ne "") - { - if($strlimit == 0) - { - print "0\n"; - exit 0; - } - if($strlimit > $maxlimit) - { - $maxlimit=$strlimit; - } - } + my $group=shift; + my $strlimit=$Config->param("limit groups.$group"); + if ($strlimit ne "") + { + if ($strlimit == 0) + { + print "0\n"; + exit 0; + } + if ($strlimit > $maxlimit) + { + $maxlimit=$strlimit; + } + } } my $uname; @@ -56,18 +66,18 @@ my $strlimit=$Config->param("limit users.$uname"); if($strlimit ne "") { - if($strlimit == 0) - { - print "0\n"; - exit 0; - } - if($strlimit <= $scount) - { - print "$strlimit\n"; - exit 0; - } - print "$strlimit\n"; - exit 0; + if ($strlimit == 0) + { + print "0\n"; + exit 0; + } + if ($strlimit <= $scount) + { + print "$strlimit\n"; + exit 0; + } + print "$strlimit\n"; + exit 0; } @@ -75,23 +85,26 @@ my ($name, $pass, $uid, $pgid, $quota, $comment, $gcos, $dir, $shell, $expire) = while (my ($name, $passwd, $gid, $members) = getgrent()) { - if( $pgid eq $gid) - { - getGroupLimit $name; - } - my @memebers=split(" ",$members); - foreach my $member (@memebers) - { - if($uname eq $member ) - { - getGroupLimit $name; - } - } + if ( $pgid eq $gid) + { + getGroupLimit $name; + } + my @memebers=split(" ",$members); + foreach my $member (@memebers) + { + if ($uname eq $member ) + { + getGroupLimit $name; + } + } } -if($maxlimit <= $scount) +if ($maxlimit <= $scount) { - print "$maxlimit\n"; - exit 0; + print "$maxlimit\n"; + exit 0; } print "$maxlimit\n"; + +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/bin/x2goshowblocks b/x2goserver/bin/x2goshowblocks index ad64f65..d762645 100755 --- a/x2goserver/bin/x2goshowblocks +++ b/x2goserver/bin/x2goshowblocks @@ -21,17 +21,27 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + + +syslog('info', "x2goshowblocks has been called with options: @ARGV"); my $uname=shift; my $id=shift; my $tbl="mounts"; my @outp=dbsys_getmounts( $id); -for(my $i=0;$i<@outp;$i++) +for (my $i=0;$i<@outp;$i++) { - my $path=(split("\\|",@outp[$i]))[1]; - print `su $uname -c "lsof 2>/dev/null | grep $path"`; + my $path=(split("\\|",@outp[$i]))[1]; + print `su $uname -c "lsof 2>/dev/null | grep $path"`; } + +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/bin/x2gostartagent b/x2goserver/bin/x2gostartagent index ff19983..32d16b8 100755 --- a/x2goserver/bin/x2gostartagent +++ b/x2goserver/bin/x2gostartagent @@ -20,6 +20,10 @@ # Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` + +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" + X2GO_PORT=49 #First port for X2GO=50 SSH_PORT=30000 #First ssh port 30001 @@ -38,162 +42,144 @@ X2GO_CMD=$9 X2GO_RESIZE=0 X2GO_FULLSCREEN=0 -if [ "$X2GO_STYPE" == "S" ] -then - - SHADOW_MODE=`echo "$X2GO_CMD"|awk '{split($0,a,"XSHAD"); print a[1]}'` - SHADOW_USER=`echo "$X2GO_CMD"|awk '{split($0,a,"XSHAD"); print a[2]}'` - SHADOW_DESKTOP=`echo "$X2GO_CMD"|awk '{split($0,a,"XSHAD"); print a[3]}'` - - echo "suser $SHADOW_USER user $USER " >> /tmp/uagent - - if [ "$SHADOW_USER" != "$USER" ] - then - - OUTPUT=`x2godesktopsharing client $X2GO_CLIENT $@` - if [ "$OUTPUT" == "DENY" ] - then - echo "ACCESS DENIED" 1>&2 - exit -1 +if [ "$X2GO_STYPE" == "S" ]; then + + SHADOW_MODE=`echo "$X2GO_CMD"|awk '{split($0,a,"XSHAD"); print a[1]}'` + SHADOW_USER=`echo "$X2GO_CMD"|awk '{split($0,a,"XSHAD"); print a[2]}'` + SHADOW_DESKTOP=`echo "$X2GO_CMD"|awk '{split($0,a,"XSHAD"); print a[3]}'` + $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "shadow session requested: mode $SHADOW_MODE, user: $SHADOW_USER, desktop: $SHADOW_DESKTOP" + + echo "suser $SHADOW_USER user $USER " >> /tmp/uagent + + if [ "$SHADOW_USER" != "$USER" ]; then + + $X2GO_LIB_PATH/x2gosyslog "$0" "notice" "user ,,$USER'' requests desktop sharing from user ,,$SHADOW_USER'' for desktop ,,$SHADOW_DESKTOP''" + $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "executing command: x2godesktopsharing client $X2GO_CLIENT $@ $USER" + OUTPUT=`x2godesktopsharing client $X2GO_CLIENT $@ $USER` + $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "command result is: $OUTPUT" + if [ "$OUTPUT" == "DENY" ]; then + echo "ACCESS DENIED" 1>&2 + $X2GO_LIB_PATH/x2gosyslog "$0" "err" "ERROR: user $SHADOW_USER denied desktop sharing session" + exit -1 + fi + X2GO_COOKIE=`echo $OUTPUT | awk '{print $2}'` + X2GO_PORT=`echo $OUTPUT | awk '{print $1}'` + $X2GO_LIB_PATH/x2gosyslog "$0" "debug" "received shadow session information: cookie: $X2GO_COOKIE, port: $X2GO_PORT" + xauth add ${HOSTNAME}/unix:${X2GO_PORT} MIT-MAGIC-COOKIE-1 ${X2GO_COOKIE} + xauth add ${HOSTNAME}:${X2GO_PORT} MIT-MAGIC-COOKIE-1 ${X2GO_COOKIE} + + echo $X2GO_PORT + echo $X2GO_COOKIE + echo $OUTPUT | awk '{print $3}' + echo $OUTPUT | awk '{print $4}' + echo $OUTPUT | awk '{print $5}' + echo $OUTPUT | awk '{print $6}' + echo $OUTPUT | awk '{print $7}' + exit 0 fi - X2GO_COOKIE=`echo $OUTPUT | awk '{print $2}'` - X2GO_PORT=`echo $OUTPUT | awk '{print $1}'` - xauth add ${HOSTNAME}/unix:${X2GO_PORT} MIT-MAGIC-COOKIE-1 ${X2GO_COOKIE} - xauth add ${HOSTNAME}:${X2GO_PORT} MIT-MAGIC-COOKIE-1 ${X2GO_COOKIE} - - echo $X2GO_PORT - echo $X2GO_COOKIE - echo $OUTPUT | awk '{print $3}' - echo $OUTPUT | awk '{print $4}' - echo $OUTPUT | awk '{print $5}' - echo $OUTPUT | awk '{print $6}' - echo $OUTPUT | awk '{print $7}' - exit - fi fi LIMIT=`x2gosessionlimit` LWORD=`echo $LIMIT | awk '{print $1}'` -if [ "$LWORD" == "LIMIT" ] -then - echo $LIMIT 1>&2 - exit -1 +if [ "$LWORD" == "LIMIT" ]; then + echo $LIMIT 1>&2 + exit -1 fi -export NX_CLIENT=/usr/bin/x2gosuspend-agent +export NX_CLIENT=$X2GO_LIB_PATH/x2gosuspend-agent COLORDEPTH=`echo "$X2GO_TYPE"|awk '{split($0,a,"-depth_"); print a[2]}'` SESSION_TYPE="D" -if [ "$X2GO_STYPE" == "R" ] -then - SESSION_TYPE="R" -elif [ "$X2GO_STYPE" == "S" ] -then - SESSION_TYPE="S" +if [ "$X2GO_STYPE" == "R" ]; then + SESSION_TYPE="R" +elif [ "$X2GO_STYPE" == "S" ]; then + SESSION_TYPE="S" fi -if [ "$X2GO_CLIENT" == "" ] -then - X2GO_CLIENT=$HOSTNAME +if [ "$X2GO_CLIENT" == "" ]; then + X2GO_CLIENT=$HOSTNAME fi - -USED_DISPLAYS=`x2gogetdisplays $HOSTNAME` +USED_DISPLAYS=`$X2GO_LIB_PATH/x2gogetdisplays $HOSTNAME` -while [ "$OUTPUT" != "inserted" ] -do - X2GO_PORT=$(($X2GO_PORT + 1)) - X2GO_PORT=`echo "for(\\$i=$X2GO_PORT;\\$br ne \"true\";\\$i++){ if(\"$USED_DISPLAYS\" =~ m/\\|\\$i\\|/){\\$br=\"false\";}else{\\$br=\"true\";print \\$i;}}"|perl` +while [ "$OUTPUT" != "inserted" ]; do + X2GO_PORT=$(($X2GO_PORT + 1)) + X2GO_PORT=`echo "for(\\$i=$X2GO_PORT;\\$br ne \"true\";\\$i++){ if(\"$USED_DISPLAYS\" =~ m/\\|\\$i\\|/){\\$br=\"false\";}else{\\$br=\"true\";print \\$i;}}"|perl` - if [ -e "/tmp/.X${X2GO_PORT}-lock" ] || [ -e "/tmp/.X11-unix/X${X2GO_PORT}" ] - then - OUTPUT="XXX" - else - SESSION_NAME=${USER}-${X2GO_PORT}-`date +"%s"` - if [ "$COLORDEPTH" != "" ] - then - SESSION_NAME="$SESSION_NAME"_st${SESSION_TYPE}${X2GO_CMD}_dp${COLORDEPTH} - SESSION_NAME=`echo "$SESSION_NAME" | sed -e "s/:/PP/g"` - fi - OUTPUT=`x2goinsertsession $X2GO_PORT $HOSTNAME $SESSION_NAME` - fi + if [ -e "/tmp/.X${X2GO_PORT}-lock" ] || [ -e "/tmp/.X11-unix/X${X2GO_PORT}" ]; then + OUTPUT="XXX" + else + SESSION_NAME=${USER}-${X2GO_PORT}-`date +"%s"` + if [ "$COLORDEPTH" != "" ]; then + SESSION_NAME="$SESSION_NAME"_st${SESSION_TYPE}${X2GO_CMD}_dp${COLORDEPTH} + SESSION_NAME=`echo "$SESSION_NAME" | sed -e "s/:/PP/g"` + fi + OUTPUT=`$X2GO_LIB_PATH/x2goinsertsession $X2GO_PORT $HOSTNAME $SESSION_NAME` + fi done -USED_PORTS=`x2gogetports $HOSTNAME` +USED_PORTS=`$X2GO_LIB_PATH/x2gogetports $HOSTNAME` -while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ] -do - OUTPUT="" - while [ "$OUTPUT" != "inserted" ] - do - SSH_PORT=$(($SSH_PORT + 1)) +while [ "$GR_PORT" == "" ] || [ "$SOUND_PORT" == "" ] || [ "$FS_PORT" == "" ]; do + OUTPUT="" + while [ "$OUTPUT" != "inserted" ]; do + SSH_PORT=$(($SSH_PORT + 1)) - ##check if port in /etc/services + #check if port in /etc/services + SSH_PORT=`echo "for(\\$i=$SSH_PORT;\\$br ne \"true\";\\$i++){ if(\"$USED_PORTS\" =~ m/\\|\\$i\\|/){\\$br=\"false\";}else{\\$br=\"true\";print \\$i;}}"|perl` - SSH_PORT=`echo "for(\\$i=$SSH_PORT;\\$br ne \"true\";\\$i++){ if(\"$USED_PORTS\" =~ m/\\|\\$i\\|/){\\$br=\"false\";}else{\\$br=\"true\";print \\$i;}}"|perl` - - SERV=`grep $SSH_PORT /etc/services` - if [ "$SERV" == "" ] - then - CR=`echo "use IO::Socket; \\$sock = new IO::Socket::INET ( LocalAddr => 'localhost',LocalPort => \"$SSH_PORT\",\ + SERV=`grep $SSH_PORT /etc/services` + if [ "$SERV" == "" ]; then + CR=`echo "use IO::Socket; \\$sock = new IO::Socket::INET ( LocalAddr => 'localhost',LocalPort => \"$SSH_PORT\",\ Proto => 'tcp',Listen => 1,Reuse =>1 ) or die ;print \"OK\";close(\\$sock);"|perl 2>/dev/null` - if [ "$CR" == "OK" ] - then - OUTPUT=`x2goinsertport $HOSTNAME $SESSION_NAME $SSH_PORT` - fi - fi - done - if [ "$GR_PORT" == "" ] - then - GR_PORT=$SSH_PORT - elif [ "$SOUND_PORT" == "" ] - then - SOUND_PORT=$SSH_PORT - else - FS_PORT=$SSH_PORT - fi + if [ "$CR" == "OK" ]; then + OUTPUT=`$X2GO_LIB_PATH/x2goinsertport $HOSTNAME $SESSION_NAME $SSH_PORT` + fi + fi + done + if [ "$GR_PORT" == "" ]; then + GR_PORT=$SSH_PORT + elif [ "$SOUND_PORT" == "" ]; then + SOUND_PORT=$SSH_PORT + else + FS_PORT=$SSH_PORT + fi done - -if [ "$X2GO_GEOMETRY" == "" ] -then - X2GO_GEOMETRY=fullscreen +if [ "$X2GO_GEOMETRY" == "" ]; then + X2GO_GEOMETRY=fullscreen fi -if [ "$X2GO_GEOMETRY" == "fullscreen" ] -then - X2GO_RESIZE=1 - X2GO_FULLSCREEN=1 +if [ "$X2GO_GEOMETRY" == "fullscreen" ]; then + X2GO_RESIZE=1 + X2GO_FULLSCREEN=1 fi -if [ "$X2GO_STYPE" == "S" ] -then - X2GO_GEOMETRY=`DISPLAY=$SHADOW_DESKTOP xwininfo -root | grep geometry` - X2GO_GEOMETRY=`echo "$X2GO_GEOMETRY" | sed -e "s/ //g"` - X2GO_GEOMETRY=`echo "$X2GO_GEOMETRY" | sed -e "s/-geometry//"` + +if [ "$X2GO_STYPE" == "S" ]; then + X2GO_GEOMETRY=`DISPLAY=$SHADOW_DESKTOP xwininfo -root | grep geometry` + X2GO_GEOMETRY=`echo "$X2GO_GEOMETRY" | sed -e "s/ //g"` + X2GO_GEOMETRY=`echo "$X2GO_GEOMETRY" | sed -e "s/-geometry//"` fi SESSION_DIR=${X2GO_ROOT}/C-${SESSION_NAME} -if [ ! -d $X2GO_ROOT ] -then - mkdir $X2GO_ROOT +if [ ! -d $X2GO_ROOT ]; then + mkdir $X2GO_ROOT fi -if [ ! -d $X2GO_ROOT/ssh ] -then - mkdir $X2GO_ROOT/ssh +if [ ! -d $X2GO_ROOT/ssh ]; then + mkdir $X2GO_ROOT/ssh fi -if [ ! -d $SESSION_DIR ] -then - mkdir $SESSION_DIR +if [ ! -d $SESSION_DIR ]; then + mkdir $SESSION_DIR fi X2GO_COOKIE=`mcookie` @@ -210,62 +196,62 @@ xauth add ${HOSTNAME}/unix:${X2GO_PORT} MIT-MAGIC-COOKIE-1 ${X2GO_COOKIE} xauth add ${HOSTNAME}:${X2GO_PORT} MIT-MAGIC-COOKIE-1 ${X2GO_COOKIE} - if [ "$X2GO_SET_KBD" == "0" ] then -X2GO_HOST=nx/nx,link=${X2GO_LINK},pack=${X2GO_PACK},limit=0,root=${SESSION_DIR},cache=8M,images=32M,type=${X2GO_TYPE},\ -id=${SESSION_NAME},\ -cookie=$X2GO_COOKIE,errors=${SESSION_DIR}/session.log,kbtype=null/null,\ -geometry=${X2GO_GEOMETRY},resize=${X2GO_RESIZE},fullscreen=${X2GO_FULLSCREEN},accept=${REMOTE},listen=${GR_PORT},client=linux,menu=0 + X2GO_HOST="nx/nx,link=${X2GO_LINK},pack=${X2GO_PACK},limit=0,root=${SESSION_DIR},cache=8M,images=32M,type=${X2GO_TYPE},id=${SESSION_NAME},cookie=$X2GO_COOKIE,errors=${SESSION_DIR}/session.log,kbtype=null/null,geometry=${X2GO_GEOMETRY},resize=${X2GO_RESIZE},fullscreen=${X2GO_FULLSCREEN},accept=${REMOTE},listen=${GR_PORT},client=linux,menu=0" else -X2GO_HOST=nx/nx,link=${X2GO_LINK},pack=${X2GO_PACK},limit=0,root=${SESSION_DIR},cache=8M,images=32M,type=${X2GO_TYPE},\ -id=${SESSION_NAME},\ -cookie=$X2GO_COOKIE,errors=${SESSION_DIR}/session.log,kbtype=${X2GO_KBD_TYPE},\ -geometry=${X2GO_GEOMETRY},resize=${X2GO_RESIZE},fullscreen=${X2GO_FULLSCREEN},accept=${REMOTE},listen=${GR_PORT},client=linux,menu=0 + X2GO_HOST="nx/nx,link=${X2GO_LINK},pack=${X2GO_PACK},limit=0,root=${SESSION_DIR},cache=8M,images=32M,type=${X2GO_TYPE},id=${SESSION_NAME},cookie=$X2GO_COOKIE,errors=${SESSION_DIR}/session.log,kbtype=${X2GO_KBD_TYPE},geometry=${X2GO_GEOMETRY},resize=${X2GO_RESIZE},fullscreen=${X2GO_FULLSCREEN},accept=${REMOTE},listen=${GR_PORT},client=linux,menu=0" fi - echo "${X2GO_HOST}:${X2GO_PORT}" >${SESSION_DIR}/options -NX_AGENT=:${X2GO_PORT} - - -SAVED_DISPLAY=$DISPLAY - -DISPLAY=nx/nx,options=${SESSION_DIR}/options:${X2GO_PORT} +NX_AGENT=":${X2GO_PORT}" +SAVED_DISPLAY="$DISPLAY" +DISPLAY="nx/nx,options=${SESSION_DIR}/options:${X2GO_PORT}" export DISPLAY -if [ "$X2GODPI" == "" ] -then - X2GODPIOPTION_="" +if [ "$X2GODPI" == "" ]; then + X2GODPIOPTION_="" else - X2GODPIOPTION_="-dpi $X2GODPI" + X2GODPIOPTION_="-dpi $X2GODPI" fi -if [ "$X2GOXDMCP" == "" ] -then - XDMCPOPT="" +if [ "$X2GOXDMCP" == "" ] ;then + XDMCPOPT="" else - XDMCPOPT="-query $X2GOXDMCP" + XDMCPOPT="-query $X2GOXDMCP" fi -if [ "$X2GO_STYPE" == "S" ] -then - LD_LIBRARY_PATH=$X2GO_LIB x2goagent $X2GODPIOPTION_ -$SESSION_TYPE -auth ~/.Xauthority \ - -S -shadow $SHADOW_DESKTOP -shadowmode $SHADOW_MODE \ - -geometry ${X2GO_GEOMETRY} -name "X2GO-${SESSION_NAME}" ${NX_AGENT} 2>${SESSION_DIR}/session.log & +# run x2goserver-extensions for pre-start +x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME pre-start || true + +if [ "$X2GO_STYPE" == "S" ]; then + LD_LIBRARY_PATH=$X2GO_LIB x2goagent $X2GODPIOPTION_ -$SESSION_TYPE -auth ~/.Xauthority -S -shadow $SHADOW_DESKTOP -shadowmode $SHADOW_MODE -geometry ${X2GO_GEOMETRY} -name "X2GO-${SESSION_NAME}" ${NX_AGENT} 2>${SESSION_DIR}/session.log & else - LD_LIBRARY_PATH=$X2GO_LIB x2goagent $X2GODPIOPTION_ $XDMCPOPT -$SESSION_TYPE -auth ~/.Xauthority \ - -geometry ${X2GO_GEOMETRY} -name "X2GO-${SESSION_NAME}" ${NX_AGENT} 2>${SESSION_DIR}/session.log & + LD_LIBRARY_PATH=$X2GO_LIB x2goagent $X2GODPIOPTION_ $XDMCPOPT -$SESSION_TYPE -auth ~/.Xauthority -geometry ${X2GO_GEOMETRY} -name "X2GO-${SESSION_NAME}" ${NX_AGENT} 2>${SESSION_DIR}/session.log & fi X2GO_AGENT_PID=$! +X2GO_AGENT_RETVAL=$? +test $X2GO_AGENT_RETVAL && { + $X2GO_LIB_PATH/x2gosyslog "$0" "notice" "successfully started X2go agent session with ID $SESSION_NAME" + + # run x2goserver-extensions for post-start + x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME post-start || true + +} || { + $X2GO_LIB_PATH/x2gosyslog "$0" "err" "ERROR: failed to start X2go agent session with ID $SESSION_NAME" + + # run x2goserver-extensions for fail-start + x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME fail-start || true + +} X2GO_SND_PORT=1024 -x2gocreatesession $X2GO_COOKIE $X2GO_AGENT_PID $X2GO_CLIENT $GR_PORT $SOUND_PORT $FS_PORT $SESSION_NAME > /dev/null +$X2GO_LIB_PATH/x2gocreatesession $X2GO_COOKIE $X2GO_AGENT_PID $X2GO_CLIENT $GR_PORT $SOUND_PORT $FS_PORT $SESSION_NAME > /dev/null echo $X2GO_PORT echo $X2GO_COOKIE diff --git a/x2goserver/bin/x2gosuspend-session b/x2goserver/bin/x2gosuspend-session index 1f4084c..ffc19f9 100755 --- a/x2goserver/bin/x2gosuspend-session +++ b/x2goserver/bin/x2gosuspend-session @@ -26,18 +26,44 @@ else SESSION_NAME=$X2GO_SESSION fi +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` -X2GO_AGENT_PID=`x2gogetagent $SESSION_NAME` +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" + +X2GO_AGENT_PID=`$X2GO_LIB_PATH/x2gogetagent $SESSION_NAME` X2GO_AGENT_PID=`echo "$X2GO_AGENT_PID"| awk {'print $1'}` +# workaround for knotify, keep silent in case no knotify is running +killall -HUP knotify &>/dev/null + +$X2GO_LIB_PATH/x2gochangestatus 'S' $SESSION_NAME > /dev/null + +# terminate x2godesktopsharing instance and remember that it was running... +x2gofeature X2GO_DESKTOPSHARING &>/dev/null && x2gosuspend-desktopsharing $SESSION_NAME || true + +# run x2goserver-extensions for pre-suspend +x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME pre-suspend || true -#workaround for knotify -killall -HUP knotify +kill -HUP $X2GO_AGENT_PID &>/dev/null && { + $X2GO_LIB_PATH/x2gosyslog "$0" "notice" "session with ID $SESSION_NAME has been suspended successfully" -x2gochangestatus 'S' $SESSION_NAME > /dev/null + # run x2goserver-extensions for post-suspend + x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME post-suspend || true +} || { + err_msg="ERROR: failed to suspend session with ID $SESSION_NAME" + echo "$err_msg" 1>&2 + $X2GO_LIB_PATH/x2gosyslog "$0" "err" "$err_msg" -kill -HUP $X2GO_AGENT_PID + # If we reach here it means that the x2goagent process of the session has vanisshed + # If this happens than we mark the session as finished... + $X2GO_LIB_PATH/x2gochangestatus 'F' $SESSION_NAME > /dev/null + + # run x2goserver-extensions for fail-suspend + x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME fail-suspend || true + +} export HOSTNAME x2goumount-session $SESSION_NAME + diff --git a/x2goserver/bin/x2goterminate-session b/x2goserver/bin/x2goterminate-session index 989e272..d07b9c0 100755 --- a/x2goserver/bin/x2goterminate-session +++ b/x2goserver/bin/x2goterminate-session @@ -26,11 +26,44 @@ else SESSION_NAME=$X2GO_SESSION fi -X2GO_AGENT_PID=`x2gogetagent $SESSION_NAME` +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` + +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" + +X2GO_AGENT_PID=`$X2GO_LIB_PATH/x2gogetagent $SESSION_NAME` X2GO_AGENT_PID=`echo "$X2GO_AGENT_PID"| awk {'print $1'}` -x2gochangestatus 'F' $SESSION_NAME > /dev/null +$X2GO_LIB_PATH/x2gochangestatus 'F' $SESSION_NAME > /dev/null + +# stop x2godesktopsharing process gracefully... +x2gofeature X2GO_DESKTOPSHARING &>/dev/null && x2goterminate-desktopsharing $SESSION_NAME || true + +# run x2goserver-extensions for pre-terminate +x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME pre-terminate || true + +kill -TERM $X2GO_AGENT_PID &>/dev/null && { + $X2GO_LIB_PATH/x2gosyslog "$0" "notice" "session with ID $SESSION_NAME has been terminated successfully" + + # run x2goserver-extensions for post-terminate + x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME post-terminate || true + +} || { + err_msg="ERROR: failed to terminate session with ID $SESSION_NAME" + + # some x2goclient versions behave weirdly if we give an error message here, so we only write syslog for now... + #echo "$err_msg" 1>&2 + + $X2GO_LIB_PATH/x2gosyslog "$0" "err" "$err_msg" + + # run x2goserver-extensions for fail-terminate + x2gofeature X2GO_RUN_EXTENSIONS &>/dev/null && x2goserver-run-extensions $SESSION_NAME fail-terminate || true + +} -kill -TERM $X2GO_AGENT_PID export HOSTNAME x2goumount-session $SESSION_NAME + +# if we are not running in log level debug (=7) then clean up session dir +if [ "$($X2GO_LIB_PATH/x2gologlevel)" != "7" ]; then + (sleep 10; rm -Rf $HOME/.x2go/C-$X2GO_SESSION)& +fi diff --git a/x2goserver/bin/x2goumount-session b/x2goserver/bin/x2goumount-session index 92228a6..971c689 100755 --- a/x2goserver/bin/x2goumount-session +++ b/x2goserver/bin/x2goumount-session @@ -20,26 +20,35 @@ # Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -use Sys::Hostname; use strict; +use Sys::Hostname; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); -my $session=shift; -my $only_path=shift; +syslog('info', "x2goumount-session has been called with options: @ARGV"); +my $session=shift; +my $only_path=shift; my $uname=$ENV{'USER'}; my $serv=hostname; -if($only_path) +if ($only_path) { - $only_path=~s/\/ramdrive\/mnt\///; - $only_path=~ s/\//_/g; - my $end="_media"; - $only_path="$ENV{'HOME'}/media/$only_path"; + $only_path=~s/\/ramdrive\/mnt\///; + $only_path=~ s/\//_/g; + + ### FIXME: handle CDROM and Removable Media mounts here, as well!!! + + $only_path="/tmp/$ENV{'USER'}_media/disk/$only_path"; + # ^^^^ + syslog('debug',"x2goumount-session unmounting $only_path only"); } @@ -55,82 +64,101 @@ close(F); my $use_zenity=0; -if($ENV{'GNOME_DESKTOP_SESSION_ID'} ne "") +if ($ENV{'GNOME_DESKTOP_SESSION_ID'} ne "") { - $use_zenity=1; + $use_zenity=1; } -for($i=0;$i<@outp;$i++) +for ($i=0;$i<@outp;$i++) { - @outp[$i]=~s/ //g; - chomp(@outp[$i]); - chomp(@outp[$i]); - chomp(@outp[$i]); - my @line=split('\|',"@outp[$i]"); - my $path="@line[0]:@line[1]"; - if($only_path) - { - if (@line[1] ne $only_path) - { - goto cont; - } - } - my $j; - my $found=0; - my $remote; - for($j;$j<@mounts;$j++) - { - if(@mounts[$j]=~m/sshfs/ && @mounts[$j]=~m/@line[0]/ && @mounts[$j]=~m/@line[1]/ ) - { - $found=1; - $remote=(split(" ",@mounts[$j]))[0]; - goto break; - } - } -break: - if($found) - { - if(system( "fusermount -u @line[1]" ) == 0) - { - $found=0; - } - else - { - $ENV{'DISPLAY'}=":$display"; - if($use_zenity == 0) - { - system("kdialog --error \"@line[1]\"&"); - } - else - { - system("zenity --error --text \"@line[1]\"&"); - } - } - } - if(! $found) - { - $remote=~s/\//_/g; - $remote=(split(":","$remote"))[1]; - $remote="$ENV{'HOME'}/Desktop/$remote"; - if( -e "$remote(sshfs-disk)") + @outp[$i]=~s/ //g; + chomp(@outp[$i]); + chomp(@outp[$i]); + chomp(@outp[$i]); + my @line=split('\|',"@outp[$i]"); + my $path="@line[0]:@line[1]"; + if ($only_path) { - unlink("$remote(sshfs-disk)"); + if (@line[1] ne $only_path) + { + syslog('debug', "skipping non-requested path @line[1]"); + goto cont; + } } - - $remote=~s/%2framdrive%2fmnt%2f//; - if( -e "$remote(sshfs-removable)") + my $j; + my $found=0; + my $remote; + for ($j;$j<@mounts;$j++) { - unlink("$remote(sshfs-removable)"); + if (@mounts[$j]=~m/sshfs/ && @mounts[$j]=~m/@line[0]/ && @mounts[$j]=~m/@line[1]/ ) + { + $found=1; + syslog('debug', "found mounted share @mounts[$j]"); + $remote=(split(" ",@mounts[$j]))[0]; + goto break; + } } - if( -e "$remote(sshfs-cdrom)") +break: + if ($found) { - unlink("$remote(sshfs-cdrom)"); + if (system( "fusermount -u @line[1]" ) == 0) + { + syslog('notice', "successfully unmounted @line[1]"); + $found=0; + } + else + { + $ENV{'DISPLAY'}=":$display"; + syslog('err', "ERROR: failed to unmount @line[1]"); + if ($use_zenity == 0) + { + system("kdialog --error \"@line[1]\"&"); + } + else + { + system("zenity --error --text \"@line[1]\"&"); + } + } } - #print "$session \"@line[1]\"\n"; - db_deletemount ($session, @line[1]); - rmdir (@line[1]); - } -cont: + if (! $found) + { + $remote=~s/\//_/g; + $remote=(split(":","$remote"))[1]; + $remote="$ENV{'HOME'}/Desktop/$remote"; + + my $current_desktop = ''; + if ($session =~ m/stDGNOME/) + { + $current_desktop="-gnome"; + } + elsif ($session =~ m/stDLXDE/) + { + $current_desktop="-lxde"; + } + + if ( -e "$remote\ (sshfs-disk$current_desktop)") + { + syslog('info', "removing desktop icon ,,$remote (sshfs-disk$current_desktop)''"); + unlink("$remote\ (sshfs-disk$current_desktop)"); + } + $remote=~s/%2framdrive%2fmnt%2f//; + if ( -e "$remote\ (sshfs-removable$current_desktop)") + { + syslog('info', "removing desktop icon ,,$remote\ (sshfs-removable$current_desktop)''"); + unlink("$remote\ (sshfs-removable$current_desktop)"); + } + if ( -e "$remote\ (sshfs-cdrom/$current_desktop)") + { + syslog('info', "removing desktop icon ,,$remote\ (sshfs-cdrom$current_desktop)''"); + unlink("$remote\ (sshfs-cdrom$current_desktop)"); + } + db_deletemount ($session, @line[1]); + rmdir (@line[1]); + } +cont: } +# closing syslog +closelog; + diff --git a/x2goserver-extensions/bin/x2goversion b/x2goserver/bin/x2goversion similarity index 89% rename from x2goserver-extensions/bin/x2goversion rename to x2goserver/bin/x2goversion index 64dd758..ecc11d1 100755 --- a/x2goserver-extensions/bin/x2goversion +++ b/x2goserver/bin/x2goversion @@ -20,10 +20,14 @@ # Copyright (C) 2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` + +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" + X2GO_VERSIONS_BASEPATH="$(dirname $0)/../share/x2go/versions" get_version() { - cat "$1" | egrep -v "^#.*" | head -n1 | cut -d" " -f1 + cat "$1" | egrep -v "^#.*" | head -n1 | cut -d" " -f1 } if [ -n "$1" ]; then diff --git a/x2goserver/etc/x2goserver.conf b/x2goserver/etc/x2goserver.conf index af1e1b6..5fa6baf 100644 --- a/x2goserver/etc/x2goserver.conf +++ b/x2goserver/etc/x2goserver.conf @@ -1,5 +1,9 @@ [limit users] -#beispielb=1 +#user-foo=1 [limit groups] -#x2gousers=1 +#bar-group=1 + +[log] +# possible levels are: emerg, alert, crit, err, warning, notice, info, debug +loglevel=notice diff --git a/x2goserver/lib/a.out b/x2goserver/lib/a.out deleted file mode 100755 index af8f40e..0000000 Binary files a/x2goserver/lib/a.out and /dev/null differ diff --git a/x2goserver/lib/setuidwrapper.c b/x2goserver/lib/setuidwrapper.c deleted file mode 100644 index 9280cdc..0000000 --- a/x2goserver/lib/setuidwrapper.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <unistd.h> -#include <stdio.h> - -#define myfile "test.py" - -main(argc, argv) -char **argv; -{ - setuid(0); - seteuid(0); - execv(myfile, argv); -} diff --git a/x2goserver/lib/test.py b/x2goserver/lib/test.py deleted file mode 100755 index 7eea6e3..0000000 --- a/x2goserver/lib/test.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python - -import os -import time - -print os.geteuid() -print os.getegid() - -time.sleep(1000) diff --git a/x2goserver/bin/x2gochangestatus b/x2goserver/lib/x2gochangestatus similarity index 84% copy from x2goserver/bin/x2gochangestatus copy to x2goserver/lib/x2gochangestatus index 542cab4..5b75400 100755 --- a/x2goserver/bin/x2gochangestatus +++ b/x2goserver/lib/x2gochangestatus @@ -21,12 +21,20 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); - -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + my $status=shift or die; my $sid=shift or die; db_changestatus($status, $sid); + +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/bin/x2gocreatesession b/x2goserver/lib/x2gocreatesession similarity index 85% rename from x2goserver/bin/x2gocreatesession rename to x2goserver/lib/x2gocreatesession index 3609a34..92a3cdc 100755 --- a/x2goserver/bin/x2gocreatesession +++ b/x2goserver/lib/x2gocreatesession @@ -21,9 +21,14 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); my $cookie=shift or die; @@ -35,3 +40,6 @@ my $fs_port=shift or die; my $sid=shift or die; db_createsession($cookie,$pid,$client,$gr_port, $snd_port, $fs_port, $sid); + +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/lib/x2godbwrapper.pm b/x2goserver/lib/x2godbwrapper.pm index be84bc8..92e4549 100644 --- a/x2goserver/lib/x2godbwrapper.pm +++ b/x2goserver/lib/x2godbwrapper.pm @@ -21,10 +21,15 @@ package x2godbwrapper; use strict; -use Config::Simple; -use DBI; - +use Config::Simple; +use DBI; use POSIX; +use Sys::Syslog qw( :standard :macros ); + +my $x2go_lib_path=`echo -n \$(x2gobasepath)/lib/x2go`; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; +use x2gologlevel; + my ($uname, $pass, $uid, $pgid, $quota, $comment, $gcos, $homedir, $shell, $expire) = getpwuid(getuid()); @@ -39,285 +44,286 @@ my $dbpass; my $dbuser; my $sslmode; -if($backend ne 'postgres' && $backend ne 'sqlite') +if ($backend ne 'postgres' && $backend ne 'sqlite') { - die "unknown backend $backend"; + die "unknown backend $backend"; } -if($backend eq 'postgres') +if ($backend eq 'postgres') { - $host=$Config->param("postgres.host"); - $port=$Config->param("postgres.port"); - if(!$host) - { - $host='localhost'; - } - if(!$port) - { - $port='5432'; - } - my $passfile; - if($uname eq 'root') - { - $dbuser='x2godbuser'; - $passfile="/etc/x2go/x2gosql/passwords/x2goadmin"; - } - else - { - $dbuser="x2gouser_$uname"; - $passfile="$homedir/.x2go/sqlpass"; - } - $sslmode=$Config->param("postgres.ssl"); - if(!$sslmode) - { - $sslmode="prefer"; - } - open (FL,"< $passfile") or die "Can't read password file $passfile<br><b>Use x2godbadmin on server to configure database access for user $uname</b><br>"; - $dbpass=<FL>; - close(FL); - chomp($dbpass); + $host=$Config->param("postgres.host"); + $port=$Config->param("postgres.port"); + if (!$host) + { + $host='localhost'; + } + if (!$port) + { + $port='5432'; + } + my $passfile; + if ($uname eq 'root') + { + $dbuser='x2godbuser'; + $passfile="/etc/x2go/x2gosql/passwords/x2goadmin"; + } + else + { + $dbuser="x2gouser_$uname"; + $passfile="$homedir/.x2go/sqlpass"; + } + $sslmode=$Config->param("postgres.ssl"); + if (!$sslmode) + { + $sslmode="prefer"; + } + open (FL,"< $passfile") or die "Can't read password file $passfile<br><b>Use x2godbadmin on server to configure database access for user $uname</b><br>"; + $dbpass=<FL>; + close(FL); + chomp($dbpass); } use base 'Exporter'; our @EXPORT=('db_listsessions','db_listsessions_all', 'db_getservers', 'db_getagent', 'db_resume', 'db_changestatus', - 'db_getdisplays', 'db_insertsession', 'db_getports', 'db_insertport', 'db_createsession', 'db_insertmount', - 'db_getmounts', 'db_deletemount', 'db_getdisplay', 'dbsys_getmounts', 'dbsys_listsessionsroot', - 'dbsys_listsessionsroot_all', 'dbsys_rmsessionsroot'); - - - - - + 'db_getdisplays', 'db_insertsession', 'db_getports', 'db_insertport', 'db_createsession', 'db_insertmount', + 'db_getmounts', 'db_deletemount', 'db_getdisplay', 'dbsys_getmounts', 'dbsys_listsessionsroot', + 'dbsys_listsessionsroot_all', 'dbsys_rmsessionsroot'); + sub dbsys_rmsessionsroot { - my $sid=shift or die "argument \"session_id\" missed"; - if($backend eq 'postgres') - { - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", - "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - - my $sth=$dbh->prepare("delete from sessions where session_id='$sid'"); - $sth->execute()or die; - } - if($backend eq 'sqlite') - { - `x2gosqlitewrapper rmsessionsroot $sid`; - } + my $sid=shift or die "argument \"session_id\" missed"; + if($backend eq 'postgres') + { + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", + "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + + my $sth=$dbh->prepare("delete from sessions where session_id='$sid'"); + $sth->execute() or die; + } + if($backend eq 'sqlite') + { + `$x2go_lib_path/x2gosqlitewrapper rmsessionsroot $sid`; + } } sub dbsys_listsessionsroot { - my $server=shift or die "argument \"server\" missed"; - if($backend eq 'postgres') - { - my @strings; - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", - "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - - my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, - to_char(init_time,'DD.MM.YY*HH24:MI:SS'),cookie,client,gr_port, - sound_port,to_char(last_time,'DD.MM.YY*HH24:MI:SS'),uname, - to_char(now()-init_time,'SSSS'),fs_port from sessions - where server='$server' order by status desc"); - $sth->execute()or die; - my @data; - my $i=0; - while (@data = $sth->fetchrow_array) - { - @strings[$i++]=join('|',@data); - } - $sth->finish(); - $dbh->disconnect(); - return @strings; - } - if($backend eq 'sqlite') - { - return split("\n",`x2gosqlitewrapper listsessionsroot $server`); - } + my $server=shift or die "argument \"server\" missed"; + if ($backend eq 'postgres') + { + my @strings; + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", + "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + + my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, + to_char(init_time,'YYYY-MM-DDTHH24:MI:SS'),cookie,client,gr_port, + sound_port,to_char(last_time,'YYYY-MM-DDTHH24:MI:SS'),uname, + to_char(now()-init_time,'SSSS'),fs_port from sessions + where server='$server' order by status desc"); + $sth->execute()or die; + my @data; + my $i=0; + while (@data = $sth->fetchrow_array) + { + @strings[$i++]=join('|',@data); + } + $sth->finish(); + $dbh->disconnect(); + return @strings; + } + if($backend eq 'sqlite') + { + return split("\n",`$x2go_lib_path/x2gosqlitewrapper listsessionsroot $server`); + } } sub dbsys_listsessionsroot_all { - if($backend eq 'postgres') - { - my @strings; - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - - my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, - to_char(init_time,'DD.MM.YY*HH24:MI:SS'),cookie,client,gr_port, - sound_port,to_char(last_time,'DD.MM.YY*HH24:MI:SS'),uname, - to_char(now()-init_time,'SSSS'),fs_port from sessions - order by status desc"); - $sth->execute()or die; - my @data; - my $i=0; - while (@data = $sth->fetchrow_array) - { - @strings[$i++]=join('|',@data); - } - $sth->finish(); - $dbh->disconnect(); - return @strings; - } - if($backend eq 'sqlite') - { - return split("\n",`x2gosqlitewrapper listsessionsroot_all`); - } + if ($backend eq 'postgres') + { + my @strings; + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, + to_char(init_time,'YYYY-MM-DDTHH24:MI:SS'),cookie,client,gr_port, + sound_port,to_char(last_time,'YYYY-MM-DDTHH24:MI:SS'),uname, + to_char(now()-init_time,'SSSS'),fs_port from sessions + order by status desc"); + $sth->execute()or die; + my @data; + my $i=0; + while (@data = $sth->fetchrow_array) + { + @strings[$i++]=join('|',@data); + } + $sth->finish(); + $dbh->disconnect(); + return @strings; + } + if ($backend eq 'sqlite') + { + return split("\n",`$x2go_lib_path/x2gosqlitewrapper listsessionsroot_all`); + } } - sub dbsys_getmounts { - my $sid=shift or die "argument \"session_id\" missed"; - if($backend eq 'postgres') - { - my @strings; - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("select client, path from mounts where session_id='$sid'"); - $sth->execute()or die; - my @data; - my $i=0; - while (@data = $sth->fetchrow_array) - { - @strings[$i++]=join("|",@data); - } - $sth->finish(); - $dbh->disconnect(); - return @strings; - } - if($backend eq 'sqlite') - { - return split("\n",`x2gosqlitewrapper getmounts $sid`); - } - + my @mounts; + my $sid=shift or die "argument \"session_id\" missed"; + if ($backend eq 'postgres') + { + my @strings; + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("select client, path from mounts where session_id='$sid'"); + $sth->execute()or die; + my @data; + my $i=0; + while (@data = $sth->fetchrow_array) + { + @strings[$i++]=join("|",@data); + } + $sth->finish(); + $dbh->disconnect(); + @mounts = @strings; + } + if ($backend eq 'sqlite') + { + @mounts = split("\n",`$x2go_lib_path/x2gosqlitewrapper getmounts $sid`); + } + my $log_retval = join(" ", @mounts); + syslog('debug', "dbsys_getmounts called, session ID: $sid; return value: $log_retval"); + return @mounts; } sub db_getmounts { - my $sid=shift or die "argument \"session_id\" missed"; - if($backend eq 'postgres') - { - my @strings; - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("select client, path from mounts_view where session_id='$sid'"); - $sth->execute()or die; - my @data; - my $i=0; - while (@data = $sth->fetchrow_array) - { - @strings[$i++]=join("|",@data); - } - $sth->finish(); - $dbh->disconnect(); - return @strings; - } - if($backend eq 'sqlite') - { - return split("\n",`x2gosqlitewrapper getmounts $sid`); - } + my @mounts; + my $sid=shift or die "argument \"session_id\" missed"; + if($backend eq 'postgres') + { + my @strings; + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("select client, path from mounts_view where session_id='$sid'"); + $sth->execute()or die; + my @data; + my $i=0; + while (@data = $sth->fetchrow_array) + { + @strings[$i++]=join("|",@data); + } + $sth->finish(); + $dbh->disconnect(); + @mounts = @strings; + } + if ($backend eq 'sqlite') + { + @mounts = split("\n",`$x2go_lib_path/x2gosqlitewrapper getmounts $sid`); + } + my $log_retval = join(" ", @mounts); + syslog('debug', "db_getmounts called, session ID: $sid; return value: $log_retval"); + return @mounts; } - + sub db_deletemount { - my $sid=shift or die "argument \"session_id\" missed"; - my $path=shift or die "argument \"path\" missed"; - if($backend eq 'postgres') - { - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("delete from mounts_view where session_id='$sid' and path='$path'"); - $sth->execute(); - $sth->finish(); - $dbh->disconnect(); - } - if($backend eq 'sqlite') - { - `x2gosqlitewrapper deletemount $sid \"$path\"`; - } - + my $sid=shift or die "argument \"session_id\" missed"; + my $path=shift or die "argument \"path\" missed"; + if ($backend eq 'postgres') + { + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("delete from mounts_view where session_id='$sid' and path='$path'"); + $sth->execute(); + $sth->finish(); + $dbh->disconnect(); + } + if ($backend eq 'sqlite') + { + `$x2go_lib_path/x2gosqlitewrapper deletemount $sid \"$path\"`; + } + syslog('debug', "db_deletemount called, session ID: $sid, path: $path"); } sub db_insertmount { - my $sid=shift or die "argument \"session_id\" missed"; - my $path=shift or die "argument \"path\" missed"; - my $client=shift or die "argument \"client\" missed"; - my $res_ok=1; - if($backend eq 'postgres') - { - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("insert into mounts (session_id,path,client) values ('$sid','$path','$client')"); - $sth->execute(); - if(!$sth->err()) - { - $res_ok=1; - } - $sth->finish(); - $dbh->disconnect(); - } - if($backend eq 'sqlite') - { - if( `x2gosqlitewrapper insertmount $sid \"$path\" $client` eq "ok") - { - $res_ok=1; - } - } - return $res_ok; + my $sid=shift or die "argument \"session_id\" missed"; + my $path=shift or die "argument \"path\" missed"; + my $client=shift or die "argument \"client\" missed"; + my $res_ok=0; + if ($backend eq 'postgres') + { + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("insert into mounts (session_id,path,client) values ('$sid','$path','$client')"); + $sth->execute(); + if (!$sth->err()) + { + $res_ok=1; + } + $sth->finish(); + $dbh->disconnect(); + } + if ($backend eq 'sqlite') + { + if( `$x2go_lib_path/x2gosqlitewrapper insertmount $sid \"$path\" $client` eq "ok") + { + $res_ok=1; + } + } + syslog('debug', "db_insertmount called, session ID: $sid, path: $path, client: $client; return value: $res_ok"); + return $res_ok; } - sub db_insertsession { my $display=shift or die "argument \"display\" missed"; my $server=shift or die "argument \"server\" missed"; - my $sid=shift or die "argument \"session_id\" missed"; - if($backend eq 'postgres') - { - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("insert into sessions (display,server,uname,session_id) values ('$display','$server','$uname','$sid')"); - $sth->execute()or die $_; - $sth->finish(); - $dbh->disconnect(); - } - if($backend eq 'sqlite') - { - my $err=`x2gosqlitewrapper insertsession $display $server $sid`; - if($err ne "ok") - { - die "$err: x2gosqlitewrapper insertsession $display $server $sid"; - } - } - + my $sid=shift or die "argument \"session_id\" missed"; + if ($backend eq 'postgres') + { + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("insert into sessions (display,server,uname,session_id) values ('$display','$server','$uname','$sid')"); + $sth->execute()or die $_; + $sth->finish(); + $dbh->disconnect(); + } + if ($backend eq 'sqlite') + { + my $err=`$x2go_lib_path/x2gosqlitewrapper insertsession $display $server $sid`; + if ($err ne "ok") + { + die "$err: $x2go_lib_path/x2gosqlitewrapper insertsession $display $server $sid"; + } + } + syslog('debug', "db_insertsession called, session ID: $sid, server: $server, session ID: $sid"); } sub db_createsession { - my $cookie=shift or die"argument \"cookie\" missed"; - my $pid=shift or die"argument \"pid\" missed"; - my $client=shift or die"argument \"client\" missed"; - my $gr_port=shift or die"argument \"gr_port\" missed"; - my $snd_port=shift or die"argument \"snd_port\" missed"; - my $fs_port=shift or die"argument \"fs_port\" missed"; - my $sid=shift or die "argument \"session_id\" missed"; - if($backend eq 'postgres') - { - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("update sessions_view set status='R',last_time=now(), - cookie='$cookie',agent_pid='$pid',client='$client',gr_port='$gr_port', - sound_port='$snd_port',fs_port='$fs_port' where session_id='$sid'"); - $sth->execute()or die; - $sth->finish(); - $dbh->disconnect(); - } - if($backend eq 'sqlite') - { - my $err= `x2gosqlitewrapper createsession $cookie $pid $client $gr_port $snd_port $fs_port $sid`; - if($err ne "ok") - { - die $err; - } - } - + my $cookie=shift or die"argument \"cookie\" missed"; + my $pid=shift or die"argument \"pid\" missed"; + my $client=shift or die"argument \"client\" missed"; + my $gr_port=shift or die"argument \"gr_port\" missed"; + my $snd_port=shift or die"argument \"snd_port\" missed"; + my $fs_port=shift or die"argument \"fs_port\" missed"; + my $sid=shift or die "argument \"session_id\" missed"; + if ($backend eq 'postgres') + { + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("update sessions_view set status='R',last_time=now(), + cookie='$cookie',agent_pid='$pid',client='$client',gr_port='$gr_port', + sound_port='$snd_port',fs_port='$fs_port' where session_id='$sid'"); + $sth->execute()or die; + $sth->finish(); + $dbh->disconnect(); + } + if ($backend eq 'sqlite') + { + my $err= `$x2go_lib_path/x2gosqlitewrapper createsession $cookie $pid $client $gr_port $snd_port $fs_port $sid`; + if ($err ne "ok") + { + die $err; + } + } + syslog('debug', "db_createsession called, session ID: $sid, cookie: $cookie, client: $client, pid: $pid, graphics port: $gr_port, sound port: $snd_port, file sharing port: $fs_port"); } sub db_insertport @@ -325,252 +331,256 @@ sub db_insertport my $server=shift or die "argument \"server\" missed"; my $sid=shift or die "argument \"session_id\" missed"; my $sshport=shift or die "argument \"port\" missed"; - if($backend eq 'postgres') - { - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("insert into used_ports (server,session_id,port) values ('$server','$sid','$sshport')"); - $sth->execute()or die; - $sth->finish(); - $dbh->disconnect(); - } - if($backend eq 'sqlite') - { - `x2gosqlitewrapper insertport $server $sid $sshport`; - } - + if ($backend eq 'postgres') + { + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("insert into used_ports (server,session_id,port) values ('$server','$sid','$sshport')"); + $sth->execute()or die; + $sth->finish(); + $dbh->disconnect(); + } + if ($backend eq 'sqlite') + { + `$x2go_lib_path/x2gosqlitewrapper insertport $server $sid $sshport`; + } + syslog('debug', "db_insertport called, session ID: $sid, server: $server, SSH port: $sshport"); } - sub db_resume { - my $client=shift or die "argument \"client\" missed"; - my $sid=shift or die "argument \"session_id\" missed"; - if($backend eq 'postgres') - { - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("update sessions_view set last_time=now(),status='R',client='$client' where session_id = '$sid'"); - $sth->execute()or die; - $sth->finish(); - $dbh->disconnect(); - } - if($backend eq 'sqlite') - { - `x2gosqlitewrapper resume $client $sid`; - } - + my $client=shift or die "argument \"client\" missed"; + my $sid=shift or die "argument \"session_id\" missed"; + if ($backend eq 'postgres') + { + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("update sessions_view set last_time=now(),status='R',client='$client' where session_id = '$sid'"); + $sth->execute()or die; + $sth->finish(); + $dbh->disconnect(); + } + if ($backend eq 'sqlite') + { + `$x2go_lib_path/x2gosqlitewrapper resume $client $sid`; + } + syslog('debug', "db_resume called, session ID: $sid, client: $client"); } sub db_changestatus { - my $status=shift or die "argument \"status\" missed"; - my $sid=shift or die "argument \"session_id\" missed"; - if($backend eq 'postgres') - { - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("update sessions_view set last_time=now(),status='$status' where session_id = '$sid'"); - $sth->execute()or die; - $sth->finish(); - $dbh->disconnect(); - } - if($backend eq 'sqlite') - { - `x2gosqlitewrapper changestatus $status $sid`; - } - + my $status=shift or die "argument \"status\" missed"; + my $sid=shift or die "argument \"session_id\" missed"; + if ($backend eq 'postgres') + { + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("update sessions_view set last_time=now(),status='$status' where session_id = '$sid'"); + $sth->execute()or die; + $sth->finish(); + $dbh->disconnect(); + } + if ($backend eq 'sqlite') + { + `$x2go_lib_path/x2gosqlitewrapper changestatus $status $sid`; + } + syslog('debug', "db_changestatus called, session ID: $sid, new status: $status"); } sub db_getdisplays { - #ignore $server - my $server=shift or die "argument \"server\" missed"; - if($backend eq 'postgres') - { - my @strings; - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("select display from servers_view"); - $sth->execute()or die; - my @data; - my $i=0; - while (@data = $sth->fetchrow_array) - { - @strings[$i++]='|'.@data[0].'|'; - } - $sth->finish(); - $dbh->disconnect(); - return @strings; - } - if($backend eq 'sqlite') - { - return split("\n",`x2gosqlitewrapper getdisplays $server`); - } - + my @displays; + #ignore $server + my $server=shift or die "argument \"server\" missed"; + if ($backend eq 'postgres') + { + my @strings; + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("select display from servers_view"); + $sth->execute()or die; + my @data; + my $i=0; + while (@data = $sth->fetchrow_array) + { + @strings[$i++]='|'.@data[0].'|'; + } + $sth->finish(); + $dbh->disconnect(); + @displays = @strings; + } + if ($backend eq 'sqlite') + { + @displays = split("\n",`$x2go_lib_path/x2gosqlitewrapper getdisplays $server`); + } + my $log_retval = join(" ", @displays); + syslog('debug', "db_getdisplays called, server: $server; return value: $log_retval"); + return @displays; } sub db_getports { - #ignore $server - my $server=shift or die "argument \"server\" missed"; - if($backend eq 'postgres') - { - my @strings; - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - my $sth=$dbh->prepare("select port from ports_view"); - $sth->execute()or die; - my @data; - my $i=0; - while (@data = $sth->fetchrow_array) - { - @strings[$i++]='|'.@data[0].'|'; - } - $sth->finish(); - $dbh->disconnect(); - return @strings; - } - if($backend eq 'sqlite') - { - return split("\n",`x2gosqlitewrapper getports $server`); - } - + my @ports; + #ignore $server + my $server=shift or die "argument \"server\" missed"; + if ($backend eq 'postgres') + { + my @strings; + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("select port from ports_view"); + $sth->execute()or die; + my @data; + my $i=0; + while (@data = $sth->fetchrow_array) + { + @strings[$i++]='|'.@data[0].'|'; + } + $sth->finish(); + $dbh->disconnect(); + @ports = @strings; + } + if ($backend eq 'sqlite') + { + @ports = split("\n",`$x2go_lib_path/x2gosqlitewrapper getports $server`); + } + my $log_retval = join(" ", @ports); + syslog('debug', "db_getports called, server: $server; return value: $log_retval"); + return @ports; } sub db_getservers { - if($backend eq 'postgres') - { - my @strings; - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - - my $sth=$dbh->prepare("select server,count(*) from servers_view where status != 'F' group by server"); - $sth->execute()or die; - my @data; - my $i=0; - while (@data = $sth->fetchrow_array) - { - @strings[$i++]=@data[0]." ".@data[1]; - } - $sth->finish(); - $dbh->disconnect(); - return @strings; - } - if($backend eq 'sqlite') - { - return split("\n",`x2gosqlitewrapper getservers`); - } - + my @servers; + if ($backend eq 'postgres') + { + my @strings; + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("select server,count(*) from servers_view where status != 'F' group by server"); + $sth->execute()or die; + my @data; + my $i=0; + while (@data = $sth->fetchrow_array) + { + @strings[$i++]=@data[0]." ".@data[1]; + } + $sth->finish(); + $dbh->disconnect(); + @servers = @strings; + } + if ($backend eq 'sqlite') + { + @servers = split("\n",`$x2go_lib_path/x2gosqlitewrapper getservers`); + } + my $log_retval = join(" ", @servers); + syslog('debug', "db_getservers called, return value: $log_retval"); + return @servers; } sub db_getagent { - my $sid=shift or die "argument \"session_id\" missed"; - my $agent; - if($backend eq 'postgres') - { - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - - my $sth=$dbh->prepare("select agent_pid from sessions_view - where session_id ='$sid'"); - $sth->execute()or die; - my @data; - my $i=0; - if(@data = $sth->fetchrow_array) - { - $agent=@data[0]; - } - $sth->finish(); - $dbh->disconnect(); - } - if($backend eq 'sqlite') - { - $agent=`x2gosqlitewrapper getagent $sid`; - } - return $agent; + my $agent; + my $sid=shift or die "argument \"session_id\" missed"; + if ($backend eq 'postgres') + { + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("select agent_pid from sessions_view + where session_id ='$sid'"); + $sth->execute()or die; + my @data; + my $i=0; + if (@data = $sth->fetchrow_array) + { + $agent=@data[0]; + } + $sth->finish(); + $dbh->disconnect(); + } + if($backend eq 'sqlite') + { + $agent=`$x2go_lib_path/x2gosqlitewrapper getagent $sid`; + } + syslog('debug', "db_getagent called, session ID: $sid; return value: $agent"); + return $agent; } sub db_getdisplay { - my $sid=shift or die "argument \"session_id\" missed"; - my $display; - if($backend eq 'postgres') - { - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - - my $sth=$dbh->prepare("select display from sessions_view - where session_id ='$sid'"); - $sth->execute()or die; - my @data; - my $i=0; - if(@data = $sth->fetchrow_array) - { - $display=@data[0]; - } - $sth->finish(); - $dbh->disconnect(); - } - if($backend eq 'sqlite') - { - $display=`x2gosqlitewrapper getdisplay $sid`; - } - return $display; + my $display; + my $sid=shift or die "argument \"session_id\" missed"; + if ($backend eq 'postgres') + { + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("select display from sessions_view + where session_id ='$sid'"); + $sth->execute() or die; + my @data; + my $i=0; + if (@data = $sth->fetchrow_array) + { + $display=@data[0]; + } + $sth->finish(); + $dbh->disconnect(); + } + if ($backend eq 'sqlite') + { + $display=`$x2go_lib_path/x2gosqlitewrapper getdisplay $sid`; + } + syslog('debug', "db_getdisplay called, session ID: $sid; return value: $display"); + return $display; } + sub db_listsessions { - my $server=shift or die "argument \"server\" missed"; - if($backend eq 'postgres') - { - my @strings; - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - - my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, - to_char(init_time,'DD.MM.YY*HH24:MI:SS'), cookie, client, gr_port, - sound_port, to_char( last_time, 'DD.MM.YY*HH24:MI:SS'), uname, - to_char(now()- init_time,'SSSS'), fs_port from sessions_view - where status !='F' and server='$server' and - ( session_id not like '%XSHAD%') order by status desc"); - $sth->execute()or die; - my @data; - my $i=0; - while (@data = $sth->fetchrow_array) - { - @strings[$i++]=join('|',@data); - } - $sth->finish(); - $dbh->disconnect(); - return @strings; - } - if($backend eq 'sqlite') - { - return split("\n",`x2gosqlitewrapper listsessions $server`); - } - + my $server=shift or die "argument \"server\" missed"; + if ($backend eq 'postgres') + { + my @strings; + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, + to_char(init_time,'YYYY-MM-DDTHH24:MI:SS'), cookie, client, gr_port, + sound_port, to_char( last_time, 'YYYY-MM-DDTHH24:MI:SS'), uname, + to_char(now()- init_time,'SSSS'), fs_port from sessions_view + where status !='F' and server='$server' and + (session_id not like '%XSHAD%') order by status desc"); + $sth->execute() or die; + my @data; + my $i=0; + while (@data = $sth->fetchrow_array) + { + @strings[$i++]=join('|',@data); + } + $sth->finish(); + $dbh->disconnect(); + return @strings; + } + if ($backend eq 'sqlite') + { + return split("\n",`$x2go_lib_path/x2gosqlitewrapper listsessions $server`); + } } sub db_listsessions_all { - if($backend eq 'postgres') - { - my @strings; - my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; - - my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, - to_char(init_time,'DD.MM.YY*HH24:MI:SS'), cookie, client, gr_port, - sound_port, to_char( last_time, 'DD.MM.YY*HH24:MI:SS'), uname, - to_char(now()- init_time,'SSSS'), fs_port from sessions_view - where status !='F' and - ( session_id not like '%XSHAD%') order by status desc"); - $sth->execute()or die; - my @data; - my $i=0; - while (@data = $sth->fetchrow_array) - { - @strings[$i++]=join('|',@data); - } - $sth->finish(); - $dbh->disconnect(); - return @strings; - } - if($backend eq 'sqlite') - { - return split("\n",`x2gosqlitewrapper listsessions_all`); - } - + if($backend eq 'postgres') + { + my @strings; + my $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbuser", "$dbpass",{AutoCommit => 1}) or die $_; + my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, + to_char(init_time,'YYYY-MM-DDTHH24:MI:SS'), cookie, client, gr_port, + sound_port, to_char( last_time, 'YYYY-MM-DDTHH24:MI:SS'), uname, + to_char(now()- init_time,'SSSS'), fs_port from sessions_view + where status !='F' and + (session_id not like '%XSHAD%') order by status desc"); + $sth->execute()or die; + my @data; + my $i=0; + while (@data = $sth->fetchrow_array) + { + @strings[$i++]=join('|',@data); + } + $sth->finish(); + $dbh->disconnect(); + return @strings; + } + if ($backend eq 'sqlite') + { + return split("\n",`$x2go_lib_path/x2gosqlitewrapper listsessions_all`); + } } diff --git a/x2goserver/bin/x2gochangestatus b/x2goserver/lib/x2gogetagent similarity index 80% copy from x2goserver/bin/x2gochangestatus copy to x2goserver/lib/x2gogetagent index 542cab4..66b49df 100755 --- a/x2goserver/bin/x2gochangestatus +++ b/x2goserver/lib/x2gogetagent @@ -21,12 +21,18 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); - -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); -my $status=shift or die; my $sid=shift or die; +my $agent = db_getagent $sid; +print $agent; -db_changestatus($status, $sid); +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/bin/x2gogetdisplays b/x2goserver/lib/x2gogetdisplays similarity index 78% rename from x2goserver/bin/x2gogetdisplays rename to x2goserver/lib/x2gogetdisplays index 75b9f18..3ce65b9 100755 --- a/x2goserver/bin/x2gogetdisplays +++ b/x2goserver/lib/x2gogetdisplays @@ -21,9 +21,19 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + my $host=shift or die; -print join("\n", db_getdisplays($host)); +my $displays = join("\n", db_getdisplays($host)); +print $displays; + +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/bin/x2gogetports b/x2goserver/lib/x2gogetports similarity index 79% rename from x2goserver/bin/x2gogetports rename to x2goserver/lib/x2gogetports index bf0d345..6a637a2 100755 --- a/x2goserver/bin/x2gogetports +++ b/x2goserver/lib/x2gogetports @@ -21,9 +21,20 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + my $host=shift or die; -print join("\n", db_getports($host)); + +my $ports = join("\n", db_getports($host)); +print $ports; + +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/bin/x2gochangestatus b/x2goserver/lib/x2gogetservers similarity index 79% copy from x2goserver/bin/x2gochangestatus copy to x2goserver/lib/x2gogetservers index 542cab4..6d501a4 100755 --- a/x2goserver/bin/x2gochangestatus +++ b/x2goserver/lib/x2gogetservers @@ -21,12 +21,17 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); - -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); -my $status=shift or die; -my $sid=shift or die; +my $servers = join("\n", db_getservers); +print $servers; -db_changestatus($status, $sid); +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/bin/x2goinsertport b/x2goserver/lib/x2goinsertport similarity index 84% rename from x2goserver/bin/x2goinsertport rename to x2goserver/lib/x2goinsertport index 75ec3c5..d1994e1 100755 --- a/x2goserver/bin/x2goinsertport +++ b/x2goserver/lib/x2goinsertport @@ -21,9 +21,15 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + my $server=shift or die; my $sid=shift or die; @@ -32,3 +38,5 @@ my $port=shift or die; db_insertport($server,$sid,$port); print "inserted"; +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/bin/x2goinsertsession b/x2goserver/lib/x2goinsertsession similarity index 84% rename from x2goserver/bin/x2goinsertsession rename to x2goserver/lib/x2goinsertsession index 300c71f..553af07 100755 --- a/x2goserver/bin/x2goinsertsession +++ b/x2goserver/lib/x2goinsertsession @@ -21,9 +21,15 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + my $display=shift or die; my $server=shift or die; @@ -31,3 +37,6 @@ my $sid=shift or die; db_insertsession($display, $server, $sid); print "inserted"; + +# closing syslog +closelog; \ No newline at end of file diff --git a/x2goserver/bin/x2golistsessions_sql b/x2goserver/lib/x2golistsessions_sql similarity index 69% rename from x2goserver/bin/x2golistsessions_sql rename to x2goserver/lib/x2golistsessions_sql index 4f1abdc..bde7a25 100755 --- a/x2goserver/bin/x2golistsessions_sql +++ b/x2goserver/lib/x2golistsessions_sql @@ -21,29 +21,38 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); my $serv=shift; my @array; if($serv eq "--all-servers") { - @array=dbsys_listsessionsroot_all(); + @array=dbsys_listsessionsroot_all(); } else { - @array=dbsys_listsessionsroot ($serv); + @array=dbsys_listsessionsroot ($serv); } my $i; for ( $i=0;$i<@array;$i++) { - my @ln=split('\|',@array[$i]); - if(@ln[4] eq "F") - { - dbsys_rmsessionsroot( @ln[1]); - } - print "@array[$i]\n"; + my @ln=split('\|',@array[$i]); + if (@ln[4] eq "F") + { + my $sid = @ln[1]; + dbsys_rmsessionsroot($sid); + syslog('debug', "Purging finished session from X2go db, session ID: $sid"); + } + print "@array[$i]\n"; } + +# closing syslog +closelog; diff --git a/x2goserver/bin/x2gogetservers b/x2goserver/lib/x2gologlevel similarity index 91% rename from x2goserver/bin/x2gogetservers rename to x2goserver/lib/x2gologlevel index 38aa496..945f84e 100755 --- a/x2goserver/bin/x2gogetservers +++ b/x2goserver/lib/x2gologlevel @@ -22,7 +22,7 @@ use strict; -use lib "/usr/lib/x2go"; -use x2godbwrapper; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; +use x2gologlevel; -print join("\n", db_getservers); +print x2gologlevel(); diff --git a/x2goserver/bin/x2goumount b/x2goserver/lib/x2gologlevel.pm old mode 100755 new mode 100644 similarity index 53% rename from x2goserver/bin/x2goumount rename to x2goserver/lib/x2gologlevel.pm index 7d160f2..b6df771 --- a/x2goserver/bin/x2goumount +++ b/x2goserver/lib/x2gologlevel.pm @@ -20,43 +20,31 @@ # Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -use strict; - -use lib "/usr/lib/x2go"; -use x2godbwrapper; - -my $fname=shift; -open(F,"<$fname") or die "can't open $fname"; -my $dir=<F>; -my $session=<F>; -close(F); - -$session=~s/\n//; - -chomp($dir); -my $uname=$ENV{'USER'}; +package x2gologlevel; -my $use_zenity=0; - -if($ENV{'GNOME_DESKTOP_SESSION_ID'} ne "") -{ - $use_zenity=1; +use strict; +use Config::Simple; +use Sys::Syslog qw( :standard :macros ); + +use base 'Exporter'; +our @EXPORT = ( 'x2gologlevel' ); + +my $Config = new Config::Simple(syntax=>'ini'); +$Config->read('/etc/x2go/x2goserver.conf' ); + +my $strloglevel = $Config->param("log.loglevel"); + +sub x2gologlevel { + my $loglevel = LOG_NOTICE; + if ( $strloglevel eq "emerg" ) { $loglevel = LOG_EMERG; } + elsif ( $strloglevel eq "alert" ) { $loglevel = LOG_ALERT; } + elsif ( $strloglevel eq "crit" ) { $loglevel = LOG_CRIT; } + elsif ( $strloglevel eq "err" ) { $loglevel = LOG_ERR; } + elsif ( $strloglevel eq "warning" ) { $loglevel = LOG_WARNING; } + elsif ( $strloglevel eq "notice" ) { $loglevel = LOG_NOTICE; } + elsif ( $strloglevel eq "info" ) { $loglevel = LOG_INFO; } + elsif ( $strloglevel eq "debug" ) { $loglevel = LOG_DEBUG; } + return $loglevel; } -if(system( "fusermount -u $dir" ) == 0) -{ - unlink($fname); - db_deletemount( $session, $dir); - rmdir ($dir); -} -else -{ - if($use_zenity == 0) - { - system("kdialog --error \"Can't umount:\n $dir\"&"); - } - else - { - system("zenity --error --text \"Can't umount:\n $dir\"&"); - } -} +1; diff --git a/x2goserver/bin/x2goresume b/x2goserver/lib/x2goresume similarity index 83% rename from x2goserver/bin/x2goresume rename to x2goserver/lib/x2goresume index eb65a5d..028e34f 100755 --- a/x2goserver/bin/x2goresume +++ b/x2goserver/lib/x2goresume @@ -21,11 +21,20 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); -use lib "/usr/lib/x2go"; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; use x2godbwrapper; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + my $client=shift or die; my $sid=shift or die; db_resume($client, $sid); + +# closing syslog +closelog; diff --git a/x2goserver/bin/x2gosqlitewrapper b/x2goserver/lib/x2gosqlitewrapper.pl similarity index 87% rename from x2goserver/bin/x2gosqlitewrapper rename to x2goserver/lib/x2gosqlitewrapper.pl index 9cbf663..c7ba72b 100755 --- a/x2goserver/bin/x2gosqlitewrapper +++ b/x2goserver/lib/x2gosqlitewrapper.pl @@ -21,19 +21,18 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; - use DBI; use POSIX; -if ($< eq $>) -{ - die "Please install this program as SUID x2gouser!\n"; -} - -my $realuser=$<; -my ($uname, $pass, $uid, $pgid, $quota, $comment, $gcos, $homedir, $shell, $expire) = getpwuid($>); +# retrieve home dir of x2gouser +my $x2gouser='x2gouser'; +my ($uname, $pass, $uid, $pgid, $quota, $comment, $gcos, $homedir, $shell, $expire) = getpwnam($x2gouser); my $dbfile="$homedir/x2go_sessions"; +# retrieve account data of real user +my ($uname, $pass, $uid, $pgid, $quota, $comment, $gcos, $homedir, $shell, $expire) = getpwuid($<); +my $realuser=$uname; + my $dbh=DBI->connect("dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 1}) or die $_; my $cmd=shift or die "command not specified"; @@ -53,9 +52,9 @@ elsif($cmd eq "listsessionsroot") my $server=shift or die "argument \"server\" missed"; my @strings; my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, - substr(strftime('%d.%m.%Y*%H:%M:%S',init_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',init_time),9,11), + strftime('%Y-%m-%dT%H:%M:%S',init_time), cookie,client,gr_port,sound_port, - substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),9,11), + strftime('%Y-%m-%dT%H:%M:%S',last_time), uname, strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions where server=? order by status desc"); @@ -68,9 +67,9 @@ elsif($cmd eq "listsessionsroot_all") checkroot(); my @strings; my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, - substr(strftime('%d.%m.%Y*%H:%M:%S',init_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',init_time),9,11), + strftime('%Y-%m-%dT%H:%M:%S',init_time), cookie,client,gr_port,sound_port, - substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),9,11), + strftime('%Y-%m-%dT%H:%M:%S',last_time), uname, strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions order by status desc"); @@ -81,6 +80,7 @@ elsif($cmd eq "listsessionsroot_all") elsif($cmd eq "getmounts") { my $sid=shift or die "argument \"session_id\" missed"; + check_user($sid); my @strings; my $sth=$dbh->prepare("select client, path from mounts where session_id=?"); $sth->execute($sid)or die; @@ -91,6 +91,7 @@ elsif($cmd eq "deletemount") { my $sid=shift or die "argument \"session_id\" missed"; my $path=shift or die "argument \"path\" missed"; + check_user($sid); my $sth=$dbh->prepare("delete from mounts where session_id=? and path=?"); $sth->execute($sid, $path); $sth->finish(); @@ -101,6 +102,7 @@ elsif($cmd eq "insertmount") my $sid=shift or die "argument \"session_id\" missed"; my $path=shift or die "argument \"path\" missed"; my $client=shift or die "argument \"client\" missed"; + check_user($sid); my $sth=$dbh->prepare("insert into mounts (session_id,path,client) values (?, ?, ?)"); $sth->execute($sid, $path, $client); if(!$sth->err()) @@ -115,6 +117,7 @@ elsif($cmd eq "insertsession") my $display=shift or die "argument \"display\" missed"; my $server=shift or die "argument \"server\" missed"; my $sid=shift or die "argument \"session_id\" missed"; + check_user($sid); my $sth=$dbh->prepare("insert into sessions (display,server,uname,session_id, init_time, last_time) values (?, ?, ?, ?, datetime('now','localtime'), datetime('now','localtime'))"); $sth->execute($display, $server, $realuser, $sid) or die $_; @@ -131,6 +134,7 @@ elsif($cmd eq "createsession") my $snd_port=shift or die"argument \"snd_port\" missed"; my $fs_port=shift or die"argument \"fs_port\" missed"; my $sid=shift or die "argument \"session_id\" missed"; + check_user($sid); my $sth=$dbh->prepare("update sessions set status='R',last_time=datetime('now','localtime'),cookie=?,agent_pid=?, client=?,gr_port=?,sound_port=?,fs_port=? where session_id=? and uname=?"); $sth->execute($cookie, $pid, $client, $gr_port, $snd_port, $fs_port, $sid, $realuser)or die; @@ -144,6 +148,7 @@ elsif($cmd eq "insertport") my $sid=shift or die "argument \"session_id\" missed"; my $sshport=shift or die "argument \"port\" missed"; my $sth=$dbh->prepare("insert into used_ports (server,session_id,port) values (?, ?, ?)"); + check_user($sid); $sth->execute($server, $sid, $sshport) or die; $sth->finish(); } @@ -152,6 +157,7 @@ elsif($cmd eq "resume") { my $client=shift or die "argument \"client\" missed"; my $sid=shift or die "argument \"session_id\" missed"; + check_user($sid); my $sth=$dbh->prepare("update sessions set last_time=datetime('now','localtime'),status='R', client=? where session_id = ? and uname=?"); $sth->execute($client, $sid, $realuser) or die; @@ -162,6 +168,7 @@ elsif($cmd eq "changestatus") { my $status=shift or die "argument \"status\" missed"; my $sid=shift or die "argument \"session_id\" missed"; + check_user($sid); my $sth=$dbh->prepare("update sessions set last_time=datetime('now','localtime'), status=? where session_id = ? and uname=?"); $sth->execute($status, $sid, $realuser)or die; @@ -170,7 +177,6 @@ elsif($cmd eq "changestatus") elsif($cmd eq "getdisplays") { - #ignore $server my @strings; my $sth=$dbh->prepare("select display from sessions"); @@ -222,6 +228,7 @@ elsif($cmd eq "getagent") { my $sid=shift or die "argument \"session_id\" missed"; my $agent; + check_user($sid); my $sth=$dbh->prepare("select agent_pid from sessions where session_id=?"); $sth->execute($sid)or die; @@ -239,6 +246,7 @@ elsif($cmd eq "getdisplay") { my $sid=shift or die "argument \"session_id\" missed"; my $display; + check_user($sid); my $sth=$dbh->prepare("select display from sessions where session_id =?"); $sth->execute($sid)or die; @@ -257,9 +265,9 @@ elsif($cmd eq "listsessions") my $server=shift or die "argument \"server\" missed"; my @strings; my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, - substr(strftime('%d.%m.%Y*%H:%M:%S',init_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',init_time),9,11), + strftime('%Y-%m-%dT%H:%M:%S',init_time), cookie,client,gr_port,sound_port, - substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),9,11), + strftime('%Y-%m-%dT%H:%M:%S',last_time), uname, strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions where status !='F' and server=? and uname=? @@ -272,12 +280,13 @@ elsif($cmd eq "listsessions_all") { my @strings; my $sth=$dbh->prepare("select agent_pid, session_id, display, server, status, - substr(strftime('%d.%m.%Y*%H:%M:%S',init_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',init_time),9,11), + strftime('%Y-%m-%dT%H:%M:%S',init_time), cookie,client,gr_port,sound_port, - substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),0,6)||substr(strftime('%d.%m.%Y*%H:%M:%S',last_time),9,11), + strftime('%Y-%m-%dT%H:%M:%S',last_time), uname, strftime('%s','now','localtime') - strftime('%s',init_time),fs_port from sessions where status !='F' and uname=? and ( session_id not like '%XSHAD%') order by status desc"); + $sth->execute($realuser)or die; fetchrow_printall_array($sth); } @@ -296,6 +305,15 @@ sub checkroot } } +sub check_user +{ + my $sid=shift or die "argument \"session_id\" missed"; + return if $realuser eq "root"; + # session id looks like someuser-51-1304005895_stDgnome-session_dp24 + my ( $user, $rest ) = split('-', $sid, 2); + $user eq $realuser or die "$realuser is not authorized (should be $user)"; +} + sub fetchrow_printall_array { # print all arrays separated by the pipe symbol diff --git a/x2goserver/bin/x2gosuspend-agent b/x2goserver/lib/x2gosuspend-agent similarity index 79% rename from x2goserver/bin/x2gosuspend-agent rename to x2goserver/lib/x2gosuspend-agent index 9ca6d4f..1873fac 100755 --- a/x2goserver/bin/x2gosuspend-agent +++ b/x2goserver/lib/x2gosuspend-agent @@ -20,6 +20,16 @@ # Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +strict; +use Sys::Syslog qw( :standard :macros ); + +use lib `echo -n \$(x2gobasepath)/lib/x2go`; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + + shift; shift; shift; @@ -27,4 +37,7 @@ shift; my $capt=shift; my @words=split(" ",$capt); -system("/usr/bin/x2gosuspend-session @words[2] > /dev/null"); \ No newline at end of file +system("x2gosuspend-session @words[2] > /dev/null"); + +# closing syslog +closelog; diff --git a/x2goserver/bin/x2gochangestatus b/x2goserver/lib/x2gosyslog similarity index 77% rename from x2goserver/bin/x2gochangestatus rename to x2goserver/lib/x2gosyslog index 542cab4..a4d70d0 100755 --- a/x2goserver/bin/x2gochangestatus +++ b/x2goserver/lib/x2gosyslog @@ -21,12 +21,18 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; +use Sys::Syslog qw( :standard :macros ); +use lib `echo -n \$(x2gobasepath)/lib/x2go`; +use x2gologlevel; -use lib "/usr/lib/x2go"; -use x2godbwrapper; +setlogmask( LOG_UPTO(x2gologlevel()) ); -my $status=shift or die; -my $sid=shift or die; +my $component = shift; +my $loglevel = shift; +my $msg = "@ARGV"; + +openlog($component,'cons','user'); +syslog($loglevel, $msg); +closelog; -db_changestatus($status, $sid); diff --git a/x2goserver/man/man8/x2golistsessions.8 b/x2goserver/man/man8/x2gobasepath.8 similarity index 51% copy from x2goserver/man/man8/x2golistsessions.8 copy to x2goserver/man/man8/x2gobasepath.8 index 54f85b3..01a9fd3 100644 --- a/x2goserver/man/man8/x2golistsessions.8 +++ b/x2goserver/man/man8/x2gobasepath.8 @@ -5,18 +5,19 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH x2golistsessions 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.TH x2gobasepath 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Admin Tool" .SH NAME -x2golistsessions \- X2go Server Script +x2gobasepath \- Detect Base Path of X2go Server Installation .SH SYNOPSIS 'nh .fi -.ad l -x2golistsessions +.ad 1 +x2gobasepath .SH DESCRIPTION -\fBx2golistsessions\fR is one of many scripts belonging to X2go Server. +\fBx2gobasepath\fR writes the X2go server installation base path (/usr, /usr/local, ...) to stdout. .PP +\fBx2gobasepath\fR can be run with user privileges. .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2gocleansessions.8 b/x2goserver/man/man8/x2gocleansessions.8 index 93e9b0d..cfc79fc 100644 --- a/x2goserver/man/man8/x2gocleansessions.8 +++ b/x2goserver/man/man8/x2gocleansessions.8 @@ -5,7 +5,7 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH x2gocleansessions 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.TH x2gocleansessions 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Admin Tool" .SH NAME x2gocleansessions \- X2go Server Cleanup Daemon .SH SYNOPSIS @@ -17,6 +17,7 @@ x2gocleansessions .SH DESCRIPTION \fBx2gocleansessions\fR is run as a service on X2go servers to handle the cleanup of stale sessions. .PP +\fBx2gocleansessions\fR must be run (as a service) with root privileges. .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2gocmdexitmessage.8 b/x2goserver/man/man8/x2gocmdexitmessage.8 new file mode 100644 index 0000000..c27f142 --- /dev/null +++ b/x2goserver/man/man8/x2gocmdexitmessage.8 @@ -0,0 +1,28 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2gocmdexitmessage 8 "July 2011" "Version 3.0.99.x" "X2go Server Tool" +.SH NAME +x2gocmdexitmessage \- Exit Message of X2go Command +.SH SYNOPSIS +'nh +.fi +.ad l +x2gocmdexitmessage <session_id> + +.SH DESCRIPTION +\fBx2gocmdexitmessage\fR prints out the exit message of the last command run with \fBx2goruncommand\fR for session <session_id>. + +\fBx2gocmdexitmessage\fR is run with X2go user privileges. +.PP +.SH RETURN VALUES +\fBx2gocmdexitmessage\fR prints out the last command's exit message. +.PP +As exitcode \fBx2gocmdexitmessage\fR always returns 0. +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver/man/man8/x2godbadmin.8 b/x2goserver/man/man8/x2godbadmin.8 new file mode 100644 index 0000000..01ac1b0 --- /dev/null +++ b/x2goserver/man/man8/x2godbadmin.8 @@ -0,0 +1,24 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2godbadmin 8 "July 2011" "Version 3.0.99.x" "X2go Server Admin Tool" +.SH NAME +x2godbadmin \- X2go Server Database Administrator +.SH SYNOPSIS +'nh +.fi +.ad l +x2godbadmin <options> + +.SH DESCRIPTION +\fBx2godbadmin\fR is used to set up the initial X2go session database and perform other +maintenance tasks on the X2go server's database. +.PP +\fBx2godbadmin\fR must be run with root privileges. +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver/man/man8/x2gofeature.8 b/x2goserver/man/man8/x2gofeature.8 new file mode 100644 index 0000000..f6e8584 --- /dev/null +++ b/x2goserver/man/man8/x2gofeature.8 @@ -0,0 +1,29 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2gofeature 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Admin Tool" +.SH NAME +x2gofeature \- Query X2go Feature Availability on X2go Server +.SH SYNOPSIS +'nh +.fi +.ad 1 +x2gofeature <feature_name> + +.SH DESCRIPTION +\fBx2gofeature\fR allows client applications to query the server for certain features +before trying to use them. +.PP +\fBx2gofeature\fR can be run with user privileges. +.SH RETURN VALUES +If feature <feature_name> is available on the X2go server, then ,,ok'' is written to stdout. +Otherwise the expression ,,not available'' is written to stdout. +.SH SEE ALSO +/usr/share/x2go/x2gofeature.d/*.features +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver/man/man8/x2golistdesktops.8 b/x2goserver/man/man8/x2golistdesktops.8 new file mode 100644 index 0000000..3703f79 --- /dev/null +++ b/x2goserver/man/man8/x2golistdesktops.8 @@ -0,0 +1,36 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2golistdesktops 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" +.SH NAME +x2golistdesktops \- List Available X Desktops +.SH SYNOPSIS +'nh +.fi +.ad l +x2golistdesktops [<server_hostname>] + +.SH DESCRIPTION +\fBx2golistdesktops\fR returns a list of active desktop sessions running on server <server_hostname>. +If no server hostname is given at the command line, the fully qualified domain name of the local system +is used here. +.PP +\fBx2golistdesktops\fR is run with X2go user privileges and it is used by X2go clients to render +a list of available desktops that may be candidates for X2go desktop sharing (shadow sessions). +.PP +The list of desktops will include local desktop sessions (launched via KDM, GDM, etc.) run by the same user, X2go desktop +sessions run by the same user and desktop sessions of other users (local or remote) that are announced via +the \fBx2godesktopsharing\fR utility. +.SH RETURN VALUES +A list of available X desktops, line-by-line. +.PP +As exitcode \fBx2golistdesktop\fR always returns 0. +.SH SEE ALSO +x2godesktopsharing(1) +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver/man/man8/x2golistmounts.8 b/x2goserver/man/man8/x2golistmounts.8 new file mode 100644 index 0000000..1263a55 --- /dev/null +++ b/x2goserver/man/man8/x2golistmounts.8 @@ -0,0 +1,37 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2golistmounts 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" +.SH NAME +x2golistmounts \- List Mounted Shares for an X2go Session +.SH SYNOPSIS +'nh +.fi +.ad l +x2golistmounts <session_id> + +.SH DESCRIPTION +\fBx2golistmounts\fR returns a list of mounted client-side folders or devices for X2go +session <session_id>. +.PP +\fBx2golistmounts\fR is run with normal user privileges and it is used by X2go clients to render +a list of SSHFS mounts for a given X2go sessions. +.SH RETURN VALUES +A line-by-line list of mounted shares is returned by \fBx2golistmounts\fR. Each line consists of +two mount point attribute fields separated by the pipe symbol (,,|''). +.PP +The meanings of these mount point attributes are: + + field 01: <sshfs_target_host_ip> + field 02: <mount_point_path_on_server> + +As exitcode \fBx2golistmounts\fR always returns 0. +.SH SEE ALSO +x2gomountdirs(8), x2goumount-session(8) +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver/man/man8/x2golistsessions.8 b/x2goserver/man/man8/x2golistsessions.8 index 54f85b3..adbbac6 100644 --- a/x2goserver/man/man8/x2golistsessions.8 +++ b/x2goserver/man/man8/x2golistsessions.8 @@ -5,18 +5,50 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH x2golistsessions 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.TH x2golistsessions 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" .SH NAME -x2golistsessions \- X2go Server Script +x2golistsessions \- List Available X2go Sessions for User .SH SYNOPSIS 'nh .fi .ad l -x2golistsessions +x2golistsessions [<server_hostname>|--all-servers] .SH DESCRIPTION -\fBx2golistsessions\fR is one of many scripts belonging to X2go Server. +\fBx2golistsessions\fR returns a list of running or suspended X2go sessions for X2go server <server_hostname>. +If no server hostname is given at the command line, the session list query runs for the local system. .PP +\fBx2golistsessions\fR is run with normal user privileges and it is used by X2go clients to render +a list of available X2go sessions. +.SH X2GO CLUSTER MODE +If \fBx2golistsessions\fR is executed with the \fI--all-servers\fR option then the central database +of your X2go cluster is queried for running/suspended sessions belonging to the user executing this command. +These sessions may be active on any of the X2go servers within you cluster. +.SH RETURN VALUES +A line-by-line list of available X2go sessions. Each line consists of several session attribute fields separated by the pipe +symbol (,,|''). +.PP +The meaning of the session attributes of each output line are shown below: + + field 01: <agent_pid> + field 02: <session_id> + field 03: <port> + field 04: <host> + field 05: <state> + field 06: <init_time> + field 07: <session_cookie> + field 08: <client_ip> + field 09: <gr_port> + field 10: <snd_port> + field 11: <last_time> + field 12: <user> + field 13: <age_in_secs> + field 14: <sshfs_port> + +.PP +As exitcode \fBx2golistsessions\fR always returns 0. +.SH SEE ALSO +x2golistsessions_root(8), x2golistdesktops(8), x2goresume-session(8), x2gosuspend-session(8), x2goterminate-session(8) .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2golistsessions_root.8 b/x2goserver/man/man8/x2golistsessions_root.8 new file mode 100644 index 0000000..9c7f18e --- /dev/null +++ b/x2goserver/man/man8/x2golistsessions_root.8 @@ -0,0 +1,29 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2golistsessions_root 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Admin Tool" +.SH NAME +x2golistsessions_root \- List X2go Sessions for System +.SH SYNOPSIS +'nh +.fi +.ad l +x2golistsessions_root [<server_hostname>] + +.SH DESCRIPTION +\fBx2golistsessions_root\fR shows a list of all available X2go sessions on the server <server_hostname>. +If no server hostname is given at the command line, the session list query runs for the local system. +.PP +\fBx2golistsessions_root\fR must be run with root privileges. +.PP +.SH RETURN VALUES +Same as explained in x2golistsessions(8). +.SH SEE ALSO +x2golistsessions(8) +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver/man/man8/x2gomountdirs.8 b/x2goserver/man/man8/x2gomountdirs.8 index fec5c97..33b8f09 100644 --- a/x2goserver/man/man8/x2gomountdirs.8 +++ b/x2goserver/man/man8/x2gomountdirs.8 @@ -5,18 +5,63 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH x2gomountdirs 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.TH x2gomountdirs 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" .SH NAME -x2gomountdirs \- X2go Server Script +x2gomountdirs \- Share Client-Side Folder with X2go Session .SH SYNOPSIS 'nh .fi .ad l -x2gomountdirs +x2gomountdirs <mount_type> <session_id> <username> <key_file> <dir1> [<dir2> [<dir3> [...]]] .SH DESCRIPTION -\fBx2gomountdirs\fR is one of many scripts belonging to X2go Server. +\fBx2gomountdirs\fR mounts client-side folders or devices onto mountpoints that are accessible +from within your remote X2go session. .PP +\fBx2gomountdirs\fR is run with X2go user privileges and normally issued by an X2go client application. +.SH ARGUMENTS +.TP +\*(T<\fB\<mount_type>\fR\*(T> +If the mount type is set to ,,dir'' then the client-side mount target is interpreted as a folder. If other, +it is interpreted as a device. +.TP +\*(T<\fB\<session_id>\fR\*(T> +The <session_id> is the unique identifier of the X2go session that this command is run for. +.TP +\*(T<\fB\<username>\fR\*(T> +The owner of session <session_id> is given as the <username> argument. +.TP +\*(T<\fB\<key_file>\fR\*(T> +Location of a temporary private SSH key file (only valid for this command execution). +.TP +\*(T<\fB\<dir1> [<dir2> [<dir3> [...]]]\fR\*(T> +A list of client-side folders or device mount points that shall be mounted for X2go session <session_id>. +.PP +.SH PERMISSIONS +X2go uses the fuse-based SSH filesystem (SSHFS) for sharing client-side file ressources with X2go sessions. +Users that shall use X2go folder sharing must be members of the X2go server's ,,fuse'' POSIX group. +.SH RETURN VALUES +\fBx2gomountdirs\fR returns some mount point information to stdout if the mounting process has been successful. +The mount results are printed line-by-line. The individual lines must be interpreted as shown below: + + line 01: dirs:<local_path>__REVERSESSH_PORT__<sshfs_port> + line 02: ssh port:<sshfs_port> + line 03: Host:<client_ip> + line 04: User:<user> + line 05: inserted, sshfs -o <options> \\ + "<user">@<client_ip>:"<local_path>" \\ + "<server_path>" -p <sshfs_port> + line 06: mount <local_path> ok + line 07: fname: <desktop_icon_name> +.PP +If mounting of a client folder fails, either of the errors is returned (on stdout): + + error 01: mounting of <local_path> failed + error 02: insertion of <local_path> failed (already mounted?), not mounting +.PP +As exitcode \fBx2gomoundirs\fR always returns 0. +.SH SEE ALSO +x2goumount-session(8) .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2goresume-session.8 b/x2goserver/man/man8/x2goresume-session.8 index f18f421..eb0e246 100644 --- a/x2goserver/man/man8/x2goresume-session.8 +++ b/x2goserver/man/man8/x2goresume-session.8 @@ -5,18 +5,28 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH x2goresume-session 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.TH x2goresume-session 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" .SH NAME -x2goresume-session \- X2go Server Script +x2goresume-session \- Resume X2go Session .SH SYNOPSIS 'nh .fi .ad l -x2goresume-session +x2goresume-session <session_id> .SH DESCRIPTION -\fBx2goresume-session\fR is one of many scripts belonging to X2go Server. +\fBx2goresume-session\fR resumes the suspended session with session ID <session_id>. .PP +This command is normally issued +by an X2go client application with X2go user privileges. +.SH RETURN VALUES +\fBx2goresume-session\fR reports to stderr if resuming of session <session_id> failed. This +very probably means that the session's X agent has died, so the session <session_id> will +be marked as finished in the X2go session database. +.PP +As exitcode \fBx2goresume-session\fR always returns 0. +.SH SEE ALSO +x2gostartagent(8), x2goruncommand(8), x2gosuspend-session(8), x2goterminate-session(8) .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2goruncommand.8 b/x2goserver/man/man8/x2goruncommand.8 index 370d907..4a64515 100644 --- a/x2goserver/man/man8/x2goruncommand.8 +++ b/x2goserver/man/man8/x2goruncommand.8 @@ -5,18 +5,46 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH x2goruncommand 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.TH x2goruncommand 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" .SH NAME -x2goruncommand \- X2go Server Script +x2goruncommand \- Launch Command inside an X2go Session .SH SYNOPSIS 'nh .fi .ad l -x2goruncommand +x2goruncommand <display> <agent_pid> <session_id> <command> <sound_system> <session_type> .SH DESCRIPTION -\fBx2goruncommand\fR is one of many scripts belonging to X2go Server. +\fBx2goruncommand\fR launches a(n X-based) command inside of a given X2go session. .PP +\fBx2goruncommand\fR is run with X2go user privileges and normally executed by an X2go client application. +.SH ARGUMENTS +.TP +\*(T<\fB\<display>\fR\*(T> +The X display number/port of the session this command is for. +.TP +\*(T<\fB\<agent_pid>\fR\*(T> +The process ID (pid) of the x2goagent instance that the given session runs in. +.TP +\*(T<\fB\<session_id>\fR\*(T> +The <session_id> is the unique identifier of the X2go session that this command is intended for. +.TP +\*(T<\fB\<command>\fR\*(T> +Execute command <command>. Full paths will be ignored, the command has to be in the server's $PATH. + +Possible generic values for <command> are: WWWBROWSER, OFFICE, MAILCLIENT and TERMINAL. +.TP +\*(T<\fB\<sound_system>\fR\*(T> +Either of the possible sound systems supported by X2go: pulse, esd, arts (obsolete) or none. +.TP +\*(T<\fB\<session_type>\fR\*(T> +Allowed values for <session_type> are: D (desktop) and R (rootless). +.SH RETURN VALUES +By \fBx2goruncommand\fR nothing is reported on stdout or stderr. +.PP +As exitcode \fBx2goruncommand\fR always returns 0. +.SH SEE ALSO +x2gostartagent(8), x2goresume-session(8), x2gosuspend-session(8), x2goterminate-sessions(8) .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2goprint.8 b/x2goserver/man/man8/x2gosessionlimit.8 similarity index 58% rename from x2goserver/man/man8/x2goprint.8 rename to x2goserver/man/man8/x2gosessionlimit.8 index 542aa2c..f1cbf96 100644 --- a/x2goserver/man/man8/x2goprint.8 +++ b/x2goserver/man/man8/x2gosessionlimit.8 @@ -5,18 +5,17 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH x2goprint 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.TH x2gosessionlimit 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Admin Tool" .SH NAME -x2goprint \- X2go Server Script +x2gosessionlimit \- Detect Session Limit for User or Group .SH SYNOPSIS 'nh .fi -.ad l -x2goprint +.ad 1 +x2gosessionlimit .SH DESCRIPTION -\fBx2goprint\fR is one of many scripts belonging to X2go Server. -.PP +\fBx2gosessionlimit\fR is not yet documented as a man page... TODO! .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2goshowblocks.8 b/x2goserver/man/man8/x2goshowblocks.8 new file mode 100644 index 0000000..372a995 --- /dev/null +++ b/x2goserver/man/man8/x2goshowblocks.8 @@ -0,0 +1,26 @@ +'\" -*- coding: utf-8 -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH x2goshowblocks 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" +.SH NAME +x2goshowblocks \- Show X2go-Mounted Block Devices +.SH SYNOPSIS +'nh +.fi +.ad l +x2goshowblocks <username> <session_id> + +.SH DESCRIPTION +\fBx2goshowblocks\fR lists mounted shares for user <username> and X2go session with ID <session_id>. +.PP +The \fBx2goshowblocks\fR must be run with root privileges. + +.SH SEE ALSO +x2gomountdirs(8), x2goumount-session(8) +.SH AUTHOR +This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project +(http://www.x2go.org). diff --git a/x2goserver/man/man8/x2gostartagent.8 b/x2goserver/man/man8/x2gostartagent.8 index 6a84a72..65bc07e 100644 --- a/x2goserver/man/man8/x2gostartagent.8 +++ b/x2goserver/man/man8/x2gostartagent.8 @@ -7,29 +7,79 @@ .if \n(.g .mso www.tmac .TH x2gostartagent 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" .SH NAME -x2gostartagent \- X2go Server Script +x2gostartagent \- Start a New X2go Session .SH SYNOPSIS 'nh .fi .ad l -x2gostartagent <geometry> <link-quality> <nx-pack-meth> <cache-type+dpi> <kblayout> <kbtype> <setkbd> <session-type> <command> +x2gostartagent <geometry> <link_quality> <nx_pack_meth> <cache_type+dpi> <kblayout> <kbtype> <setkbd> <session_type> <command> .SH DESCRIPTION -\fBx2gostartagent\fR is a script that coordinates the startup process of new X2go sessions. +\fBx2gostartagent\fR coordinates the startup process of a new X2go session. It expects quite a list of parameters, all of which are obligatory. +.PP +\fBx2gostartagent\fR is run with X2go user privileges and normally executed by an X2go client application. +.SH ARGUMENTS +.TP +\*(T<\fB\<geometry>\fR\*(T> +Session window size on screen (allowed values: <width>x<height> or fullscreen). +.TP +\*(T<\fB\<link_quality>\fR\*(T> +Any value out of: modem, isdn, adsl, wan or lan. +.TP +\*(T<\fB\<nx_pack_method>\fR\*(T> +NX compression method (see below for possible values). +.TP +\*(T<\fB\<cache_type+dpi>\fR\*(T> +Cache type and color depth for X2go session window. The most common value is: unix-kde-depth_24 where ,,24'' is the color depth in bit. +.TP +\*(T<\fB\<kblayout>\fR\*(T> +Keyboard layout (e.g. us, de, etc.). +.TP +\*(T<\fB\<kbtype>\fR\*(T> +Keyboard type/model (e.g. pc105/us). +.TP +\*(T<\fB\<setkbd>\fR\*(T> +Force setting keyboard layout and type within the X2go session on startup. Values: 0 or 1. +.TP +\*(T<\fB\<session_type>\fR\*(T> +Allowed values for <session_type> are: D (desktop), R (rootless) or S (shadow session, X2go desktop sharing). +.TP +\*(T<\fB\<command>\fR\*(T> +The command given by the <command> argument is only used to create the session ID for this new X2go session. The +actual execution of a command is handled by \fBx2goruncommand\fR. +.PP .SH RETURN VALUES -A list of parameters will be returned after a successful session startup. Each value will be presented on -a new line: +A list of session attributes is returned after successful session startup. Session attributes will be presented +on a line-by-line basis: - \fB<X-display-number>\fR - \fB<session-cookie-hash>\fR - \fB<x2goagent-pid>\fR - \fB<session-name>\fR - \fB<graphics-port>\fR - \fB<sound-port>\fR - \fB<sshfs-port>\fR + \fB<X_display_number>\fR + \fB<session_cookie_hash>\fR + \fB<agent_pid>\fR + \fB<session_id>\fR + \fB<graphics_port>\fR + \fB<sound_port>\fR + \fB<sshfs_port>\fR .PP +.SH NX COMPRESSION METHODS +As NX compression methods (\fB<link-quality>\fR argument) the following values are possible. The % character must be replaced by a digit 0-9. +.PP +nopack, 8, 64, 256, 512, 4k, 32k, 64k, 256k, 2m, 16m +256-rdp, 256-rdp-compressed, 32k-rdp, 32k-rdp-compressed, 64k-rdp +64k-rdp-compressed, 16m-rdp, 16m-rdp-compressed +rfb-hextile, rfb-tight, rfb-tight-compressed +8-tight, 64-tight, 256-tight, 512-tight, 4k-tight, 32k-tight +64k-tight, 256k-tight, 2m-tight, 16m-tight +8-jpeg-%, 64-jpeg, 256-jpeg, 512-jpeg, 4k-jpeg, 32k-jpeg +64k-jpeg, 256k-jpeg, 2m-jpeg, 16m-jpeg-% +8-png-jpeg-%, 64-png-jpeg, 256-png-jpeg, 512-png-jpeg, 4k-png-jpeg +32k-png-jpeg, 64k-png-jpeg, 256k-png-jpeg, 2m-png-jpeg, 16m-png-jpeg-% +8-png-%, 64-png, 256-png, 512-png, 4k-png +32k-png, 64k-png, 256k-png, 2m-png, 16m-png-% +16m-rgb-%, 16m-rle-% +.SH SEE ALSO +x2goruncommand(8), x2goresume-session(8), x2gosuspend-session(8), x2goterminate-session(8) .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2gosuspend-session.8 b/x2goserver/man/man8/x2gosuspend-session.8 index ec4aa2c..f78e978 100644 --- a/x2goserver/man/man8/x2gosuspend-session.8 +++ b/x2goserver/man/man8/x2gosuspend-session.8 @@ -5,18 +5,27 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH x2gosuspend-session 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.TH x2gosuspend-session 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" .SH NAME -x2gosuspend-session \- X2go Server Script +x2gosuspend-session \- Suspend an X2go Session .SH SYNOPSIS 'nh .fi .ad l -x2gosuspend-session +x2gosuspend-session <session_id> .SH DESCRIPTION -\fBx2gosuspend-session\fR is one of many scripts belonging to X2go Server. +\fBx2gosuspend-session\fR suspends the running session with session ID <session_id>. .PP +This command is normally issued by an X2go client application with X2go user privileges. +.SH RETURN VALUES +\fBx2gosuspend-session\fR reports to stderr if resuming of session <session_id> failed. This +very probably means that the session's X agent has died, so the session <session_id> will +be marked as finished in the X2go session database. +.PP +As exitcode \fBx2gosuspend-session\fR always returns 0. +.SH SEE ALSO +x2gostartagent(8), x2goruncommand(8), x2goresume-session(8), x2goterminate-session(8) .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2goterminate-session.8 b/x2goserver/man/man8/x2goterminate-session.8 index 2bfcce8..9089c04 100644 --- a/x2goserver/man/man8/x2goterminate-session.8 +++ b/x2goserver/man/man8/x2goterminate-session.8 @@ -5,18 +5,25 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH x2goterminate-session 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.TH x2goterminate-session 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" .SH NAME -x2goterminate-session \- X2go Server Script +x2goterminate-session \- Terminate an X2go Session .SH SYNOPSIS 'nh .fi .ad l -x2goterminate-session +x2goterminate-session <session_id> .SH DESCRIPTION -\fBx2goterminate-session\fR is one of many scripts belonging to X2go Server. +\fBx2goterminate-session\fR cleanly terminates the running or suspended session with session ID <session_id>. .PP +This command is normally issued by an X2go client application with X2go user privileges. +.SH RETURN VALUES +By \fBx2goterminate-session\fR nothing is reported on stdout or stderr. +.PP +As exitcode \fBx2goterminate-session\fR always returns 0. +.SH SEE ALSO +x2gostartagent(8), x2goruncommand(8), x2goresume-session(8), x2gosuspend-session(8) .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2goumount-session.8 b/x2goserver/man/man8/x2goumount-session.8 index bdf226c..a2cc555 100644 --- a/x2goserver/man/man8/x2goumount-session.8 +++ b/x2goserver/man/man8/x2goumount-session.8 @@ -5,18 +5,38 @@ \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac -.TH x2goumount-session 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" +.TH x2goumount-session 8 "Sep 2011" "Version 3.0.99.x" "X2go Server Tool" .SH NAME -x2goumount-session \- X2go Server Script +x2goumount-session \- Unshare mounted Folders from X2go Session .SH SYNOPSIS 'nh .fi .ad l -\fBx2goumount-session\fR +x2goumount-session <session_id> [<local_path_on_client>] .SH DESCRIPTION -\fBx2goumount-session\fR is one of many scripts belonging to X2go Server. +\fBx2goumount-session\fR is used to unshare client folders from X2go session with session ID <session_id>. +Shared folders have been previously mounted into the X2go session by the \fBx2gomountdirs\fR command. .PP +\fBx2goumount-session\fR is run with X2go user privileges and normally issued by an X2go client application. +.SH ARGUMENTS +.TP +\*(T<\fB\<session_id>\fR\*(T> +Unmount shared folder(s) as registered for X2go session ID <session_id> in the X2go session database. +.TP +\*(T<\fB\<local_path_on_client>\fR\*(T> +Optionally, you can name a local path name (path name as found on the client-side) here. If given, +only the named folder is unshared from the X2go session <session_id>. +.PP +If this optional argument is omitted, then ALL session folders will be unshared (including spool folders for printing and MIME box). +.SH RETURN VALUES +.SH RETURN VALUES +By \fBx2goumount-session\fR nothing is reported on stdout or stderr. +.PP +As exitcode \fBx2goumount-session\fR return 0 on successful an umount action. If there is a failure during +unmounting a shared folder a non-zero exit code is returned. +.SH SEE ALSO +x2gomountdirs(8) .SH AUTHOR This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project (http://www.x2go.org). diff --git a/x2goserver/man/man8/x2goumount.8 b/x2goserver/man/man8/x2goumount.8 deleted file mode 100644 index 99bd655..0000000 --- a/x2goserver/man/man8/x2goumount.8 +++ /dev/null @@ -1,22 +0,0 @@ -'\" -*- coding: utf-8 -*- -.if \n(.g .ds T< \\FC -.if \n(.g .ds T> \\F[\n[.fam]] -.de URL -\\$2 \(la\\$1\(ra\\$3 -.. -.if \n(.g .mso www.tmac -.TH x2goumount 8 "18 May 2011" "Version 3.0.99.x" "X2go Server Tool" -.SH NAME -x2goumount \- X2go Server Script -.SH SYNOPSIS -'nh -.fi -.ad l -x2goumount - -.SH DESCRIPTION -\fBx2goumount\fR is one of many scripts belonging to X2go Server. -.PP -.SH AUTHOR -This manual has been written by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> for the X2go project -(http://www.x2go.org). diff --git a/x2goserver/man/man8/x2goumount_session.8 b/x2goserver/man/man8/x2goumount_session.8 new file mode 120000 index 0000000..59dd168 --- /dev/null +++ b/x2goserver/man/man8/x2goumount_session.8 @@ -0,0 +1 @@ +x2goumount-session.8 \ No newline at end of file diff --git a/x2goserver-extensions/man/man8/x2goversion.8 b/x2goserver/man/man8/x2goversion.8 similarity index 88% rename from x2goserver-extensions/man/man8/x2goversion.8 rename to x2goserver/man/man8/x2goversion.8 index bb07d83..4d99559 100644 --- a/x2goserver-extensions/man/man8/x2goversion.8 +++ b/x2goserver/man/man8/x2goversion.8 @@ -26,7 +26,10 @@ component's version is printed to stdout. .PP The \fBx2goversion\fR tool can be used by X2go client implementations to query server-side versions of X2go components. +.SH RETURN VALUES +\fBx2goversion\fR reports X2go component version information to stdout. .PP +As exitcode \fBx2goversion\fR always returns 0. .SH FILES /usr/share/x2go/versions/VERSION.* .PP diff --git a/x2goserver/sbin/x2gocleansessions b/x2goserver/sbin/x2gocleansessions index 14c38ac..af5afee 100755 --- a/x2goserver/sbin/x2gocleansessions +++ b/x2goserver/sbin/x2gocleansessions @@ -20,46 +20,54 @@ # Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -use Sys::Hostname; use strict; +use Sys::Hostname; +use Sys::Syslog qw( :standard :macros ); + +my $x2go_lib_path=`echo -n \$(x2gobasepath)/lib/x2go`; +use lib `echo -n \$(x2gobasepath)/lib/x2go`; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + sub check_pid { - my $pid=shift; - my $sess=shift; - my $sec=shift; - if($sec < 30) - { - return 1; - } - open (F,"</proc/$pid/cmdline") or return 0; - my $text=<F>; - close (F); - if($text =~ m/$sess/) - { - return 1; - } - return 0; + my $pid=shift; + my $sess=shift; + my $sec=shift; + if ($sec < 30) + { + return 1; + } + open (F,"</proc/$pid/cmdline") or return 0; + my $text=<F>; + close (F); + if ($text =~ m/$sess/) + { + return 1; + } + return 0; } sub check_stat { - my $sess=shift; - my $user=shift; - my $log="~$user/.x2go/C-$sess/session.log"; - my $text=`tail -1 $log`; - if($text =~ m/Session suspended/) - { - return 0; - } - return 1; + my $sess=shift; + my $user=shift; + my $log="~$user/.x2go/C-$sess/session.log"; + my $text=`tail -1 $log`; + if ($text =~ m/Session suspended/) + { + return 0; + } + return 1; } - sub catch_term { - unlink("/var/run/x2goserver.pid"); - exit; + unlink("/var/run/x2goserver.pid"); + exit; } my $uname; @@ -68,59 +76,56 @@ my $serv = hostname; my $pid = fork(); if (not defined $pid) { - print "resources not avilable.\n"; + print "resources not avilable.\n"; } elsif ($pid != 0) { - open (F,">/var/run/x2goserver.pid"); - print F "$pid\n"; - close(F); + open (F,">/var/run/x2goserver.pid"); + print F "$pid\n"; + close(F); } elsif ($pid == 0 ) { + close(STDIN); + close(STDOUT); + close(STDERR); - close(STDIN); - close(STDOUT); - close(STDERR); - - $SIG{TERM}=\&catch_term; - - while(sleep 5) - { - $serv=`hostname`; - my $outp=`x2golistsessions_sql $serv 2>/dev/null`; + $SIG{TERM}=\&catch_term; - my @outp=split("\n","$outp"); - - for(my $i=0;$i<@outp;$i++) - { - my @sinfo=split('\\|',"@outp[$i]"); - if(@sinfo[4]eq 'F') - { - #print "@sinfo[1], is blocked\n"; - #print "(@sinfo[1])Unmounting all shares\n"; - system( "su @sinfo[11] -c \"export HOSTNAME && x2goumount-session @sinfo[1]\" 2> /dev/null"); - } - elsif(! check_pid (@sinfo[0],@sinfo[1],@sinfo[12])) - { - system("su @sinfo[11] -c \"x2gochangestatus 'F' @sinfo[1] \" > /dev/null"); - #print "@sinfo[1], pid @sinfo[0] not exist, changing status from @sinfo[4] to F\n"; - #print "(@sinfo[1])Unmounting all shares\n"; - system( "su @sinfo[11] -c \"export HOSTNAME && x2goumount-session @sinfo[1]\" 2> /dev/null"); - } - else - { - if(@sinfo[4]eq 'R') - { - if(!check_stat(@sinfo[1],@sinfo[11])) - { - system("su @sinfo[11] -c \"x2gochangestatus 'S' @sinfo[1] \" > /dev/null"); - #print "@sinfo[1], is suspended, changing status from @sinfo[4] to S\n"; - #print "(@sinfo[1])Unmounting all shares\n"; - system( "su @sinfo[11] -c \"export HOSTNAME && x2goumount-session @sinfo[1]\" 2> /dev/null"); - } - } - } - } - } -} \ No newline at end of file + while(sleep 5) + { + $serv=`hostname`; + my $outp=`$x2go_lib_path/x2golistsessions_sql $serv 2>/dev/null`; + my @outp=split("\n","$outp"); + for (my $i=0;$i<@outp;$i++) + { + my @sinfo=split('\\|',"@outp[$i]"); + if (@sinfo[4]eq 'F') + { + #print "@sinfo[1], is blocked\n"; + #print "(@sinfo[1])Unmounting all shares\n"; + system( "su @sinfo[11] -c \"export HOSTNAME && x2goumount-session @sinfo[1]\" 2> /dev/null"); + } + elsif (! check_pid (@sinfo[0],@sinfo[1],@sinfo[12])) + { + system("su @sinfo[11] -c \"$x2go_lib_path/x2gochangestatus 'F' @sinfo[1] \" > /dev/null"); + #print "@sinfo[1], pid @sinfo[0] not exist, changing status from @sinfo[4] to F\n"; + #print "(@sinfo[1])Unmounting all shares\n"; + system( "su @sinfo[11] -c \"export HOSTNAME && x2goumount-session @sinfo[1]\" 2> /dev/null"); + } + else + { + if (@sinfo[4]eq 'R') + { + if (!check_stat(@sinfo[1],@sinfo[11])) + { + system("su @sinfo[11] -c \"$x2go_lib_path/x2gochangestatus 'S' @sinfo[1] \" > /dev/null"); + #print "@sinfo[1], is suspended, changing status from @sinfo[4] to S\n"; + #print "(@sinfo[1])Unmounting all shares\n"; + system( "su @sinfo[11] -c \"export HOSTNAME && x2goumount-session @sinfo[1]\" 2> /dev/null"); + } + } + } + } + } +} diff --git a/x2goserver/sbin/x2godbadmin b/x2goserver/sbin/x2godbadmin index 7dc98b6..441b176 100755 --- a/x2goserver/sbin/x2godbadmin +++ b/x2goserver/sbin/x2godbadmin @@ -21,19 +21,24 @@ # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> use strict; - +use Sys::Syslog qw( :standard :macros ); use Getopt::Long; use Config::Simple; -use DBI; - - +use DBI; + +use lib `echo -n \$(x2gobasepath)/lib/x2go`; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); + sub show_usage() { - print "X2Go SQL admin interface. Use it to create x2go database and insert or remove users or groups in x2go database\n". - "Usage:\nx2godbadmin --createdb\n". - "x2godbadmin --listusers\n". - "x2godbadmin --adduser|rmuser <UNIX user>\n". - "x2godbadmin --addgroup|rmgroup <UNIX group>\n"; + print "X2Go SQL admin interface. Use it to create x2go database and insert or remove users or groups in x2go database\n". + "Usage:\nx2godbadmin --createdb\n". + "x2godbadmin --listusers\n". + "x2godbadmin --adduser|rmuser <UNIX user>\n". + "x2godbadmin --addgroup|rmgroup <UNIX group>\n"; } my $help=''; @@ -49,449 +54,490 @@ GetOptions('listusers' => \$listusers, 'createdb' => \$createdb, 'help' => \$hel if ($help || ! ( $createdb || $adduser || $rmuser || $addgroup || $rmgroup || $listusers)) { - show_usage(); - exit(0); + show_usage(); + exit(0); } - my $Config = new Config::Simple(syntax=>'ini'); $Config->read('/etc/x2go/x2gosql/sql' ) or die "Can't read config file /etc/x2go/x2gosql/sql"; -if($Config->param("backend") eq 'sqlite') + +if ($Config->param("backend") eq 'sqlite') +{ +my $user="x2gouser"; + my ($name, $pass, $uid, $pgid, $quota, $comment, $gcos, $dir, $shell, $expire) = getpwnam($user); + my $dbfile="$dir/x2go_sessions"; + + if (! $uid) + { + print "Can not find user ($user)\n"; + exit(-1); + } + + if ($listusers|| $adduser||$addgroup||$rmuser||$rmgroup) + { + print "Only \"--createdb\" option is available with sqlite backend\n"; + exit(0); + } + if ($createdb) + { + if (! -d "$dir" ) + { + mkdir("$dir"); + } + if ( -e $dbfile) + { + unlink($dbfile); + } + my $dbh=DBI->connect("dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 1}) or die $_; + + my $sth=$dbh->prepare(" + create table sessions( + session_id varchar(500) primary key, + display integer not null, + uname varchar(100) not null, + server varchar(100) not null, + client inet, + status char(1) not null default 'R', + init_time timestamp not null default CURRENT_TIMESTAMP, + last_time timestamp not null default CURRENT_TIMESTAMP, + cookie char(33), + agent_pid int, + gr_port int, + sound_port int, + fs_port int, + unique(display)) + "); + $sth->execute() or die; + + my $sth=$dbh->prepare(" + create table messages(mess_id varchar(20) primary key, message text) + "); + $sth->execute() or die; + + my $sth=$dbh->prepare(" + create table user_messages( + mess_id varchar(20) not null, + uname varchar(100) not null) + "); + $sth->execute() or die; + + my $sth=$dbh->prepare(" + create table used_ports( + server varchar(100) not null, + session_id varchar(500) references sessions on delete cascade, + port integer primary key) + "); + $sth->execute() or die; + + my $sth=$dbh->prepare(" + create table mounts( + session_id varchar(500) references sessions on delete restrict, + path varchar(512) not null, + client inet not null, + primary key(path,client)) + "); + $sth->execute() or die; + + my $sth=$dbh->prepare(" + CREATE TRIGGER fkd_mounts_session_id + BEFORE DELETE ON sessions + FOR EACH ROW BEGIN + SELECT CASE + WHEN ((SELECT session_id FROM mounts WHERE session_id = OLD.session_id) IS NOT NULL) + THEN RAISE(ABORT, 'delete on table \"sessions\" violates foreign key on table \"mounts\"') + END; + END; + "); + $sth->execute() or die; + + my $sth=$dbh->prepare(" + CREATE TRIGGER fkd_ports_session_id + BEFORE DELETE ON sessions + FOR EACH ROW + BEGIN + DELETE FROM used_ports WHERE session_id = OLD.session_id; + END; + END; + "); + $sth->execute() or die; + + $sth->finish(); + $dbh->disconnect(); + chmod(0770, "$dir"); + chown('root',$pgid,"$dir"); + chmod(0660, "$dbfile"); + chown('root',$pgid,"$dbfile"); + + exit(0); + } +} + +my $host=$Config->param("postgres.host"); +my $port=$Config->param("postgres.port"); +my $sslmode=$Config->param("postgres.ssl"); +if (!$sslmode) +{ + $sslmode="prefer"; +} +my $dbadmin=$Config->param("postgres.dbadmin"); +my $x2goadmin="x2godbuser"; +my $x2goadminpass=`makepasswd`; +chomp ($x2goadminpass); +my $db="x2go_sessions"; + +if (!$host) +{ + $host='localhost'; +} +if (!$port) +{ + $port='5432'; +} +if (!$dbadmin) +{ + $dbadmin='postgres'; +} + +open (FL,"< /etc/x2go/x2gosql/passwords/pgadmin ") or die "Can't read password file /etc/x2go/x2gosql/passwords/pgadmin"; +my $dbadminpass=<FL>; +close(FL); +chomp($dbadminpass); + +my $dbh; +if ($createdb) +{ + $dbh=DBI->connect("dbi:Pg:dbname=postgres;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; + create_database(); + $dbh->disconnect(); + $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; + create_tables(); + $dbh->disconnect(); + exit(0); +} + +if ($listusers) { - my $user="x2gouser"; - my ($name, $pass, $uid, $pgid, $quota, $comment, $gcos, $dir, $shell, $expire) = getpwnam($user); - my $dbfile="$dir/x2go_sessions"; - - if(! $uid) - { - print "Can not find user ($user)\n"; - exit(-1); - } - - - - if($listusers|| $adduser||$addgroup||$rmuser||$rmgroup) - { - print "Only \"--createdb\" option is available with sqlite backend\n"; - exit(0); - } - if($createdb) - { - if (! -d "$dir" ) - { - mkdir("$dir"); - } - if( -e $dbfile) - { - unlink($dbfile); - } - my $dbh=DBI->connect( - "dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 1}) or die $_; - - my $sth=$dbh->prepare("create table sessions( - session_id varchar(500) primary key, - display integer not null, - uname varchar(100) not null, - server varchar(100) not null, - client inet, - status char(1) not null default 'R', - init_time timestamp not null default CURRENT_TIMESTAMP, - last_time timestamp not null default CURRENT_TIMESTAMP, - cookie char(33), - agent_pid int, - gr_port int, - sound_port int, - fs_port int, - unique(display))"); - $sth->execute() or die; - - my $sth=$dbh->prepare("create table messages(mess_id varchar(20) primary key, message text)"); - $sth->execute() or die; - - my $sth=$dbh->prepare("create table user_messages( - mess_id varchar(20) not null, - uname varchar(100) not null)"); - $sth->execute() or die; - - my $sth=$dbh->prepare("create table used_ports( - server varchar(100) not null, - session_id varchar(500) references sessions on delete cascade, - port integer primary key)"); - $sth->execute() or die; - - my $sth=$dbh->prepare("create table mounts( - session_id varchar(500) references sessions on delete restrict, - path varchar(512) not null, - client inet not null, - primary key(path,client))"); - $sth->execute() or die; - - my $sth=$dbh->prepare("CREATE TRIGGER fkd_mounts_session_id - BEFORE DELETE ON sessions - FOR EACH ROW BEGIN - SELECT CASE - WHEN ((SELECT session_id FROM mounts WHERE session_id = OLD.session_id) IS NOT NULL) - THEN RAISE(ABORT, 'delete on table \"sessions\" violates foreign key on table \"mounts\"') - END; - END;"); - $sth->execute() or die; - - my $sth=$dbh->prepare("CREATE TRIGGER fkd_ports_session_id - BEFORE DELETE ON sessions - FOR EACH ROW - BEGIN - DELETE FROM used_ports WHERE session_id = OLD.session_id; - END; - END;"); - $sth->execute() or die; - - $sth->finish(); - $dbh->disconnect(); - chmod(0700,"$dir"); - chown($uid,$pgid,"$dir"); - chmod(0600,"$dbfile"); - chown($uid,$pgid,"$dbfile"); - - exit(0); - } + $dbh=DBI->connect("dbi:Pg:dbname=postgres;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; + list_users(); + $dbh->disconnect(); + exit(0); } - my $host=$Config->param("postgres.host"); - my $port=$Config->param("postgres.port"); - my $sslmode=$Config->param("postgres.ssl"); - if(!$sslmode) - { - $sslmode="prefer"; - } - my $dbadmin=$Config->param("postgres.dbadmin"); - my $x2goadmin="x2godbuser"; - my $x2goadminpass=`makepasswd`; - chomp($x2goadminpass); - my $db="x2go_sessions"; - - if(!$host) - { - $host='localhost'; - } - if(!$port) - { - $port='5432'; - } - if(!$dbadmin) - { - $dbadmin='postgres'; - } - - open (FL,"< /etc/x2go/x2gosql/passwords/pgadmin ") or die "Can't read password file /etc/x2go/x2gosql/passwords/pgadmin"; - my $dbadminpass=<FL>; - close(FL); - chomp($dbadminpass); - - my $dbh; - if($createdb) - { - $dbh=DBI->connect("dbi:Pg:dbname=postgres;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; - create_database(); - $dbh->disconnect(); - $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; - create_tables(); - $dbh->disconnect(); - exit(0); - } - - if($listusers) - { - $dbh=DBI->connect("dbi:Pg:dbname=postgres;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; - list_users(); - $dbh->disconnect(); - exit(0); - } - - $dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; - if($adduser) - { +$dbh=DBI->connect("dbi:Pg:dbname=$db;host=$host;port=$port;sslmode=$sslmode", "$dbadmin", "$dbadminpass",{AutoCommit => 1}) or die $_; +if ($adduser) +{ add_user($adduser); - } - - if($addgroup) - { - my ($name, $passwd, $gid, $members) = getgrnam( $addgroup); - my @grp_members=split(' ',$members); - foreach (@grp_members) - { - chomp($_); - add_user($_); - } - } - - if($rmuser) - { - rm_user($rmuser); - } - - if($rmgroup) - { - my ($name, $passwd, $gid, $members) = getgrnam( $rmgroup); - my @grp_members=split(' ',$members); - foreach (@grp_members) - { - chomp($_); - rm_user($_); - } - } - $dbh->disconnect(); +} + +if ($addgroup) +{ + my ($name, $passwd, $gid, $members) = getgrnam( $addgroup); + my @grp_members=split(' ',$members); + foreach (@grp_members) + { + chomp($_); + add_user($_); + } +} + +if ($rmuser) +{ + rm_user($rmuser); +} + +if ($rmgroup) +{ + my ($name, $passwd, $gid, $members) = getgrnam( $rmgroup); + my @grp_members=split(' ',$members); + foreach (@grp_members) + { + chomp($_); + rm_user($_); + } +} +$dbh->disconnect(); sub list_users() { - my $sth=$dbh->prepare("select rolname from pg_roles where rolname like 'x2gouser_%'"); - $sth->execute()or die; - printf ("%-20s DB user\n","UNIX user"); - print "---------------------------------------\n"; - my @data; - while (@data = $sth->fetchrow_array) - { - @data[0]=~s/x2gouser_//; - printf ("%-20s x2gouser_@data[0]\n",@data[0]); - } - $sth->finish(); + my $sth=$dbh->prepare("select rolname from pg_roles where rolname like 'x2gouser_%'"); + $sth->execute()or die; + printf ("%-20s DB user\n","UNIX user"); + print "---------------------------------------\n"; + my @data; + while (@data = $sth->fetchrow_array) + { + @data[0]=~s/x2gouser_//; + printf ("%-20s x2gouser_@data[0]\n",@data[0]); + } + $sth->finish(); } sub rm_user() { - my $user=shift; - - print ("rm DB user x2gouser_$user\n"); - - my $sth=$dbh->prepare("DROP OWNED BY x2gouser_$user"); - $sth->execute(); - - my $sth=$dbh->prepare("drop USER if exists x2gouser_$user"); - $sth->execute(); - $sth->finish(); - - my ($name, $pass, $uid, $pgid, $quota, $comment, $gcos, $dir, $shell, $expire) = getpwnam($user); - if(! $uid) - { - return; - } - if ( -e "$dir/.x2go/sqlpass" ) - { - unlink("$dir/.x2go/sqlpass"); - } + my $user=shift; + + print ("rm DB user x2gouser_$user\n"); + + my $sth=$dbh->prepare("DROP OWNED BY x2gouser_$user"); + $sth->execute(); + + my $sth=$dbh->prepare("drop USER if exists x2gouser_$user"); + $sth->execute(); + $sth->finish(); + + my ($name, $pass, $uid, $pgid, $quota, $comment, $gcos, $dir, $shell, $expire) = getpwnam($user); + if (! $uid) + { + return; + } + if ( -e "$dir/.x2go/sqlpass" ) + { + unlink("$dir/.x2go/sqlpass"); + } } - sub add_user() { - my $user=shift; - my ($name, $pass, $uid, $pgid, $quota, $comment, $gcos, $dir, $shell, $expire) = getpwnam($user); - if(! $uid) - { - print "Can not find user ($user)\n"; - return; - } - $pass=`makepasswd`; - chomp($pass); - - my $sth=$dbh->prepare("DROP OWNED BY x2gouser_$user"); - $sth->{Warn}=0; - $sth->{PrintError}=0; - $sth->execute(); - - $sth=$dbh->prepare("drop USER if exists x2gouser_$user"); - $sth->{Warn}=0; - $sth->{PrintError}=0; - $sth->execute(); - - print ("create DB user x2gouser_$user\n"); - $sth=$dbh->prepare("create USER x2gouser_$user WITH ENCRYPTED PASSWORD '$pass'"); - $sth->execute(); - - $sth=$dbh->prepare("GRANT INSERT, UPDATE, DELETE ON sessions, used_ports, mounts TO x2gouser_$user"); - $sth->execute(); - - $sth=$dbh->prepare("GRANT SELECT, UPDATE, DELETE ON sessions_view, mounts_view, servers_view, ports_view TO x2gouser_$user"); - $sth->execute(); - $sth->finish(); - - if (! -d "$dir/.x2go" ) - { - mkdir("$dir/.x2go"); - } - #save user password - open (FL,"> $dir/.x2go/sqlpass") or die "Can't open password file $dir/.x2go/sqlpass"; - print FL $pass; - close(FL); - chmod(0700,"$dir/.x2go"); - chown($uid,$pgid,"$dir/.x2go"); - chmod(0600,"$dir/.x2go/sqlpass"); - chown($uid,$pgid,"$dir/.x2go/sqlpass"); + my $user=shift; + my ($name, $pass, $uid, $pgid, $quota, $comment, $gcos, $dir, $shell, $expire) = getpwnam($user); + if (! $uid) + { + print "Can not find user ($user)\n"; + return; + } + $pass=`makepasswd`; + chomp($pass); + + my $sth=$dbh->prepare("DROP OWNED BY x2gouser_$user"); + $sth->{Warn}=0; + $sth->{PrintError}=0; + $sth->execute(); + + $sth=$dbh->prepare("drop USER if exists x2gouser_$user"); + $sth->{Warn}=0; + $sth->{PrintError}=0; + $sth->execute(); + + print ("create DB user x2gouser_$user\n"); + $sth=$dbh->prepare("create USER x2gouser_$user WITH ENCRYPTED PASSWORD '$pass'"); + $sth->execute(); + + $sth=$dbh->prepare("GRANT INSERT, UPDATE, DELETE ON sessions, used_ports, mounts TO x2gouser_$user"); + $sth->execute(); + + $sth=$dbh->prepare("GRANT SELECT, UPDATE, DELETE ON sessions_view, mounts_view, servers_view, ports_view TO x2gouser_$user"); + $sth->execute(); + $sth->finish(); + + if (! -d "$dir/.x2go" ) + { + mkdir("$dir/.x2go"); + } + + #save user password + open (FL,"> $dir/.x2go/sqlpass") or die "Can't open password file $dir/.x2go/sqlpass"; + print FL $pass; + close(FL); + chmod(0700,"$dir/.x2go"); + chown($uid,$pgid,"$dir/.x2go"); + chmod(0600,"$dir/.x2go/sqlpass"); + chown($uid,$pgid,"$dir/.x2go/sqlpass"); } sub create_tables() { - my $sth=$dbh->prepare(" - create table sessions( - session_id text primary key, - display integer not null, - uname text not null, - server text not null, - client inet, - status char(1) not null default 'R', - init_time timestamp not null default now(), - last_time timestamp not null default now(), - cookie char(33), - agent_pid int, - gr_port int, - sound_port int, - fs_port int, - creator_id text NOT NULL default current_user, - unique(display)) - "); - $sth->execute() or die; - - $sth=$dbh->prepare(" - create VIEW sessions_view as - SELECT - agent_pid, session_id, display, server, status, init_time, cookie, client, gr_port, - sound_port, last_time, uname, fs_port from sessions - where creator_id = current_user"); - $sth->execute() or die; - - $sth=$dbh->prepare(" - create VIEW servers_view as - SELECT - server, display, status from sessions"); - $sth->execute() or die; - - - - $sth=$dbh->prepare("create or replace RULE update_sess_priv AS ON UPDATE - TO sessions where (OLD.creator_id <> current_user or OLD.creator_id <> NEW.creator_id) and current_user <> '$x2goadmin' - DO INSTEAD NOTHING"); - $sth->execute() or die; - - $sth=$dbh->prepare("create or replace RULE insert_sess_priv AS ON INSERT - TO sessions where NEW.creator_id <> current_user and current_user <> '$x2goadmin' - DO INSTEAD NOTHING"); - $sth->execute() or die; - - $sth=$dbh->prepare("create or replace RULE delete_sess_priv AS ON DELETE - TO sessions where OLD.creator_id <> current_user and current_user <> '$x2goadmin' - DO INSTEAD NOTHING"); - $sth->execute() or die; - - $sth=$dbh->prepare("create or replace RULE update_sess_view AS ON UPDATE - TO sessions_view DO INSTEAD - update sessions set - status=NEW.status, - last_time=NEW.last_time, - cookie=NEW.cookie, - agent_pid=NEW.agent_pid, - client=NEW.client, - gr_port=NEW.gr_port, - sound_port=NEW.sound_port, - fs_port=NEW.fs_port - where session_id=OLD.session_id and creator_id=current_user"); - $sth->execute() or die; - - $sth=$dbh->prepare("create table messages(mess_id varchar(20) primary key, message text)"); - $sth->execute() or die; - - $sth=$dbh->prepare("create table user_messages( - mess_id text not null, - uname text not null)"); - $sth->execute() or die; - - $sth=$dbh->prepare("create table used_ports( - server text not null, - session_id text references sessions on delete cascade, - creator_id text NOT NULL default current_user, - port integer primary key)"); - $sth->execute() or die; - - $sth=$dbh->prepare(" - create VIEW ports_view as - SELECT - server, port from used_ports"); - $sth->execute() or die; - - - $sth=$dbh->prepare("create or replace RULE insert_port_priv AS ON INSERT - TO used_ports where NEW.creator_id <> current_user and current_user <> '$x2goadmin' - DO INSTEAD NOTHING"); - $sth->execute() or die; - - $sth=$dbh->prepare("create or replace RULE update_port_priv AS ON UPDATE - TO used_ports where (NEW.creator_id <> current_user or OLD.creator_id <> current_user) and current_user <> '$x2goadmin' - DO INSTEAD NOTHING"); - $sth->execute() or die; - - $sth=$dbh->prepare("create or replace RULE delete_port_priv AS ON DELETE - TO used_ports where OLD.creator_id <> current_user and current_user <> '$x2goadmin' - DO INSTEAD NOTHING "); - $sth->execute() or die; - - $sth=$dbh->prepare("create table mounts( - session_id text references sessions on delete restrict, - path text not null, - client inet not null, - creator_id text NOT NULL default current_user, - primary key(path,client))"); - $sth->execute() or die; - - - $sth=$dbh->prepare(" - create VIEW mounts_view as - SELECT - client,path, session_id from mounts - where creator_id = current_user"); - $sth->execute() or die; - - $sth=$dbh->prepare("create or replace RULE delete_mounts_view AS ON DELETE - TO mounts_view DO INSTEAD - delete from mounts - where session_id=OLD.session_id and creator_id=current_user and path=OLD.path"); - $sth->execute() or die; - - - $sth=$dbh->prepare("create or replace RULE insert_mount_priv AS ON INSERT - TO mounts where NEW.creator_id <> current_user and current_user <> '$x2goadmin' - DO INSTEAD NOTHING"); - $sth->execute() or die; - - $sth=$dbh->prepare(" create or replace RULE update_mount_priv AS ON UPDATE - TO mounts where (NEW.creator_id <> current_user or OLD.creator_id <> current_user) and current_user <> '$x2goadmin' - DO INSTEAD NOTHING"); - $sth->execute() or die; - - $sth=$dbh->prepare(" create or replace RULE delete_mount_priv AS ON DELETE - TO mounts where OLD.creator_id <> current_user and current_user <> '$x2goadmin' - DO INSTEAD NOTHING"); - $sth->execute() or die; - - $sth=$dbh->prepare("GRANT ALL PRIVILEGES ON sessions, messages, user_messages, used_ports, mounts TO $x2goadmin"); - $sth->execute() or die; - $sth->finish(); + my $sth=$dbh->prepare(" + create table sessions( + session_id text primary key, + display integer not null, + uname text not null, + server text not null, + client inet, + status char(1) not null default 'R', + init_time timestamp not null default now(), + last_time timestamp not null default now(), + cookie char(33), + agent_pid int, + gr_port int, + sound_port int, + fs_port int, + creator_id text NOT NULL default current_user, + unique(display)) + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create VIEW sessions_view as + SELECT + agent_pid, session_id, display, server, status, init_time, cookie, client, gr_port, + sound_port, last_time, uname, fs_port from sessions + where creator_id = current_user + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create VIEW servers_view as + SELECT + server, display, status from sessions + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create or replace RULE update_sess_priv AS ON UPDATE + TO sessions where (OLD.creator_id <> current_user or OLD.creator_id <> NEW.creator_id) and current_user <> '$x2goadmin' + DO INSTEAD NOTHING + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create or replace RULE insert_sess_priv AS ON INSERT + TO sessions where NEW.creator_id <> current_user and current_user <> '$x2goadmin' + DO INSTEAD NOTHING + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create or replace RULE delete_sess_priv AS ON DELETE + TO sessions where OLD.creator_id <> current_user and current_user <> '$x2goadmin' + DO INSTEAD NOTHING + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create or replace RULE update_sess_view AS ON UPDATE + TO sessions_view DO INSTEAD + update sessions set + status=NEW.status, + last_time=NEW.last_time, + cookie=NEW.cookie, + agent_pid=NEW.agent_pid, + client=NEW.client, + gr_port=NEW.gr_port, + sound_port=NEW.sound_port, + fs_port=NEW.fs_port + where session_id=OLD.session_id and creator_id=current_user + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create table messages(mess_id varchar(20) primary key, message text) + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create table user_messages( + mess_id text not null, + uname text not null) + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create table used_ports( + server text not null, + session_id text references sessions on delete cascade, + creator_id text NOT NULL default current_user, + port integer primary key) + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create VIEW ports_view as + SELECT + server, port from used_ports + "); + $sth->execute() or die; + + + $sth=$dbh->prepare(" + create or replace RULE insert_port_priv AS ON INSERT + TO used_ports where NEW.creator_id <> current_user and current_user <> '$x2goadmin' + DO INSTEAD NOTHING + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create or replace RULE update_port_priv AS ON UPDATE + TO used_ports where (NEW.creator_id <> current_user or OLD.creator_id <> current_user) and current_user <> '$x2goadmin' + DO INSTEAD NOTHING + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create or replace RULE delete_port_priv AS ON DELETE + TO used_ports where OLD.creator_id <> current_user and current_user <> '$x2goadmin' + DO INSTEAD NOTHING + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create table mounts( + session_id text references sessions on delete restrict, + path text not null, + client inet not null, + creator_id text NOT NULL default current_user, + primary key(path,client)) + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create VIEW mounts_view as + SELECT + client,path, session_id from mounts + where creator_id = current_user + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create or replace RULE delete_mounts_view AS ON DELETE + TO mounts_view DO INSTEAD + delete from mounts + where session_id=OLD.session_id and creator_id=current_user and path=OLD.path + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create or replace RULE insert_mount_priv AS ON INSERT + TO mounts where NEW.creator_id <> current_user and current_user <> '$x2goadmin' + DO INSTEAD NOTHING + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create or replace RULE update_mount_priv AS ON UPDATE + TO mounts where (NEW.creator_id <> current_user or OLD.creator_id <> current_user) and current_user <> '$x2goadmin' + DO INSTEAD NOTHING + "); + $sth->execute() or die; + + $sth=$dbh->prepare(" + create or replace RULE delete_mount_priv AS ON DELETE + TO mounts where OLD.creator_id <> current_user and current_user <> '$x2goadmin' + DO INSTEAD NOTHING + "); + $sth->execute() or die; + + $sth=$dbh->prepare("GRANT ALL PRIVILEGES ON sessions, messages, user_messages, used_ports, mounts TO $x2goadmin"); + $sth->execute() or die; + $sth->finish(); } sub create_database { - #drop db if exists - my $sth=$dbh->prepare("drop database if exists x2go_sessions"); - $sth->execute(); - #drop x2goadmin - $sth=$dbh->prepare("drop user if exists $x2goadmin"); - $sth->execute(); - #create db - $sth=$dbh->prepare("create database $db"); - $sth->execute() or die; - #create x2goadmin - $sth=$dbh->prepare("create USER $x2goadmin WITH ENCRYPTED PASSWORD '$x2goadminpass'"); - $sth->execute() or die; - #save x2goadmin password - open (FL,"> /etc/x2go/x2gosql/passwords/x2goadmin ") or die "Can't write password file /etc/x2go/x2gosql/passwords/x2goadmin"; - print FL $x2goadminpass; - close(FL); - $sth->finish(); -} \ No newline at end of file + #drop db if exists + my $sth=$dbh->prepare("drop database if exists x2go_sessions"); + $sth->execute(); + #drop x2goadmin + $sth=$dbh->prepare("drop user if exists $x2goadmin"); + $sth->execute(); + #create db + $sth=$dbh->prepare("create database $db"); + $sth->execute() or die; + #create x2goadmin + $sth=$dbh->prepare("create USER $x2goadmin WITH ENCRYPTED PASSWORD '$x2goadminpass'"); + $sth->execute() or die; + #save x2goadmin password + open (FL,"> /etc/x2go/x2gosql/passwords/x2goadmin ") or die "Can't write password file /etc/x2go/x2gosql/passwords/x2goadmin"; + print FL $x2goadminpass; + close(FL); + $sth->finish(); +} diff --git a/x2goserver/bin/x2golistsessions_root b/x2goserver/sbin/x2golistsessions_root similarity index 55% rename from x2goserver/bin/x2golistsessions_root rename to x2goserver/sbin/x2golistsessions_root index 0df7249..6f4a510 100755 --- a/x2goserver/bin/x2golistsessions_root +++ b/x2goserver/sbin/x2golistsessions_root @@ -1,5 +1,4 @@ #!/usr/bin/perl - # Copyright (C) 2007-2011 X2go Project - http://wiki.x2go.org # # This program is free software; you can redistribute it and/or modify @@ -20,54 +19,61 @@ # Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> # Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -use Sys::Hostname; use strict; +use Sys::Hostname; +use Sys::Syslog qw( :standard :macros ); + +use lib `echo -n \$(x2gobasepath)/lib/x2go`; +use x2gologlevel; + +openlog($0,'cons,pid','user'); +setlogmask( LOG_UPTO(x2gologlevel()) ); sub check_stat { - my $sess=shift; - my $user=shift; - my $log="~$user/.x2go/C-$sess/session.log"; - my $text=`tail -1 $log`; - if($text =~ m/Session suspended/) - { - return 0; - } - return 1; + my $sess=shift; + my $user=shift; + my $log="~$user/.x2go/C-$sess/session.log"; + my $text=`tail -1 $log`; + if ($text =~ m/Session suspended/) + { + return 0; + } + return 1; } +my $x2go_lib_path=`echo -n \$(x2gobasepath)/lib/x2go`; my $uname; my $serv=shift; -if( ! $serv) +if ( ! $serv) { - $serv=hostname; + $serv=hostname; } -my $outp=`x2golistsessions_sql $serv 2>/dev/null`; - +my $outp=`$x2go_lib_path/x2golistsessions_sql $serv 2>/dev/null`; my @outp=split("\n","$outp"); -for(my $i=0;$i<@outp;$i++) +for (my $i=0;$i<@outp;$i++) { - my @sinfo=split('\\|',"@outp[$i]"); - if(@sinfo[4]eq 'F') - { - print "@outp[$i]\n"; - } - else - { - if(@sinfo[4]eq 'R') - { - if(!check_stat(@sinfo[1],@sinfo[11])) - { - system("su - @sinfo[11] -c \"x2gochangestatus 'S' @sinfo[1]\" > /dev/null"); - @outp[$i] =~ s/\|R\|/\|S\|/; - } - } - print "@outp[$i]\n"; - } + my @sinfo=split('\\|',"@outp[$i]"); + if (@sinfo[4]eq 'F') + { + print "@outp[$i]\n"; + } + else + { + if (@sinfo[4]eq 'R') + { + if (!check_stat(@sinfo[1],@sinfo[11])) + { + system("su - @sinfo[11] -c \"$x2go_lib_path/x2gochangestatus 'S' @sinfo[1]\" > /dev/null"); + @outp[$i] =~ s/\|R\|/\|S\|/; + } + } + print "@outp[$i]\n"; + } } diff --git a/x2goserver/bin/x2gosuspend-session b/x2goserver/share/x2gofeature.d/x2goserver.features similarity index 57% copy from x2goserver/bin/x2gosuspend-session copy to x2goserver/share/x2gofeature.d/x2goserver.features index 1f4084c..44458d9 100755 --- a/x2goserver/bin/x2gosuspend-session +++ b/x2goserver/share/x2gofeature.d/x2goserver.features @@ -17,27 +17,23 @@ # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # -# Copyright (C) 2007-2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> -# Copyright (C) 2007-2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> +# Copyright (C) 2011 Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de> +# Copyright (C) 2011 Heinz-Markus Graesing <heinz-m.graesing@obviously-nice.de> -if [ $# -eq 1 ]; then - SESSION_NAME=$1 -else - SESSION_NAME=$X2GO_SESSION -fi +X2GO_LIB_PATH=`echo -n \$(x2gobasepath)/lib/x2go` +$X2GO_LIB_PATH/x2gosyslog "$0" "info" "$(basename $0) called with options: $@" -X2GO_AGENT_PID=`x2gogetagent $SESSION_NAME` -X2GO_AGENT_PID=`echo "$X2GO_AGENT_PID"| awk {'print $1'}` +X2GO_FEATURE=$1 +# check for X2go server core features +case "$X2GO_FEATURE" in -#workaround for knotify -killall -HUP knotify + "X2GO_LIST_DESKTOPS") echo "ok"; exit 0;; + "X2GO_MOUNTDIRS") echo "ok"; exit 0;; + "X2GO_UMOUNTSESSION_ALL") echo "ok"; exit 0;; + "X2GO_UMOUNTSESSION_ONLYPATH") echo "ok"; exit 0;; + *) exit -1;; -x2gochangestatus 'S' $SESSION_NAME > /dev/null +esac - -kill -HUP $X2GO_AGENT_PID - -export HOSTNAME -x2goumount-session $SESSION_NAME diff --git a/x2goserver/x2gosqlitewrapper.c b/x2goserver/x2gosqlitewrapper.c new file mode 100644 index 0000000..2b66245 --- /dev/null +++ b/x2goserver/x2gosqlitewrapper.c @@ -0,0 +1,78 @@ +/* + * This file is part of the X2go Project - http://www.x2go.org + * Copyright (C) 2011 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + * Copyright (C) 2011 Moritz 'Morty' Strübe <morty@gmx.net> + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <libgen.h> +#include <errno.h> + +int main( int argc, char *argv[] ) { + char * x2gosqlitewrapper = NULL; + size_t path_max; + +/* + The following snippet is taken from the realpath manpage +*/ +#ifdef PATH_MAX + path_max = PATH_MAX; +#else + path_max = pathconf (".", _PC_PATH_MAX); + if (path_max <= 0){ + path_max = 4096; + } +#endif + { + // allocate dynamic buffer in stack: this needs C99 or gnu?? + char buffer[path_max]; + ssize_t rvrl; + int rvap; + + // resolve link of /proc/self/exe to find out where we are + rvrl = readlink("/proc/self/exe", buffer, path_max); + if(rvrl == -1){ + perror("readlink(\"/proc/self/exe\",buffer,path_max)"); + exit(EXIT_FAILURE); + } + if(rvrl >= path_max){ + fprintf(stderr, "Could not resolve the path of this file using \"/proc/self/exe\". The path is too long (> %i)", path_max); + exit(EXIT_FAILURE); + } + + // derive the full path of x2gosqlitewrapper.pl from path of this binary + rvap = asprintf(&x2gosqlitewrapper, "%s/%s", dirname(buffer), "x2gosqlitewrapper.pl"); + if(rvap == -1){ + fprintf(stderr, "Failed to allocate memory calling asprintf\n"); + exit(EXIT_FAILURE); + } + + // execute the script, running with user-rights of this binary + execv(x2gosqlitewrapper, argv); + + } + + // ...fail + fprintf(stderr, "Failed to execute %s: %s\n", x2gosqlitewrapper, strerror(errno)); + return EXIT_FAILURE; + +} hooks/post-receive -- x2goserver.git (X2go Server) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "x2goserver.git" (X2go Server).