add Openmadriva patches

This commit is contained in:
Mario Fetka
2026-04-20 09:42:39 +02:00
parent cc3229e6b3
commit 33f6dbfc96
70 changed files with 49901 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
AUX ncpfs-2.2.6-CVE-2011-1679+1680.diff 1560 BLAKE2B c8c846c772d34c4dcbc13f91b900561fcbeeb2bf660174cbced3420e379edf14970b68dbd32f4363912bcfca57deb3cc2712f5e5ea9bd5773d881ca10779978b SHA512 ed0a122fd8df607006dc35b71501ec67b21839ade8cc01f4c74b5c02692a24065b9db7559cd2c2748e272082ae2004a38d00f1629782f4e4765642f5c67efe3c
AUX ncpfs-2.2.6-align-fix.patch 421 BLAKE2B 6c701b37f0ed63014cbd0553189610c8bac9863721a764e6459bc405fe1a175bf4e388e3198d3b5511a2e08eb11691e6a7794af5971ed209ef5c1a6ef4aff468 SHA512 cf76a9866926048a0792e315c1296cb144432f8d576d9e7d68004f5eb7e10a19ff097ea4d450d2f36da05d97650f1a3411cb6a45bd88b44f6050d5b6df254528
AUX ncpfs-2.2.6-drop-kernel-check.patch 728 BLAKE2B 562d33007d23f8b2792b7d3e4f77187fab364f1107c723cbf6ae8ab8698b83f4a06d18cdeb0642afff3caa5c6ff1d0c03d40c28898fa9ffcd1498736127d0219 SHA512 6433bd1df6e9d830b0e23882dd4d00afddbd9780d994de0ca480155d817e077b88ae7f46538855631e14a62cc52ec8c1fc5c230b1b64687ada5f2cccb61e392a
AUX ncpfs-2.2.6-drop-mtab-support.patch 7196 BLAKE2B 2f932599c5dea7c071c6d29f00dd2a88bc0e961ad435b3dc3a59153e8e2643f94ccedeced389a3f73648dfe1b527c3299866a51e1ed9727941bb93a0f88a2add SHA512 a7498d8927c251f882f5d63c2250a8ef2ec72191531bd95bdd1c65aad1f8600602dd2ae54fc0ed6ca95c431fe330168abe972d3d3acad8e71733dde1452eed0b
@@ -9,17 +10,84 @@ AUX ncpfs-2.2.6-ldflags-support.patch 5974 BLAKE2B 21fac3888dd7e2feb1322f14fcee2
AUX ncpfs-2.2.6-makefile-fix-ldconfig.patch 421 BLAKE2B f36125214f1654968428f4b5fb396ac31870354ed791fd266b625c29d93b757b0e3eb6fc257f385a53b181e9a0be5831b14827d32e17c7c0068cf9c9f5a6ed80 SHA512 31f4be5654b2633f279425c8e601c67612ed36c523575620a5a258de0d81e767de2f2e4e2855021ead4a9c8b295cd6383ec69a0f0bd1d7350d5a280deb6be91d
AUX ncpfs-2.2.6-makefile-fix-soname-link.patch 771 BLAKE2B b7c8e970cf1fd4416a0f211eb37bf80325521aa45efe26fae262b25ea069827eafb7abfa2401e80d3d0dca4c63e821a890260b8227c04c3627611be99102b7a9 SHA512 0f5f6143e6e66a7f2562c8db7a184df0a507cb1d19c32cda787ba989d0827175d198f400c6402ef399436fb4538ee067e432c5dd5b64509e0cddc4a4aef3f0dd
AUX ncpfs-2.2.6-missing-includes.patch 758 BLAKE2B dd250f53198444500f15faad84b2a40a3a1d352f184b01b113e54c3d01f929200e4f2deb80534a130c851ba49653720cefa9ee5ba8a4ca304e939daa7a704a3e SHA512 4fab8be6c46d494721d6186055b03b6274d77f8e5a2e1bb1a28a73e8ec57805e4ca32b4a0ea4c853c8ebf023b88cc09a50307b04f97d42d5ecffd486c8a4892e
AUX ncpfs-2.2.6-mount-issue-ver2.patch 7945 BLAKE2B 561a6a6ac02eaf329cf2cfd076c9a420eef158d65b32cc6296a65b364f9bbe06791925c0ac83c999ce7e2c0e02c7d6bc24646f5b6343693e279a7824deefaea3 SHA512 714a639c4bdfd74765e9039ca57c2a700a266afa71a8f615f17ea3585650924167b89a1b86e38863e6e54470f4fef6c8c5644a34838983a3a9cfa04bc3ab628a
AUX ncpfs-2.2.6-multiple-vulns.patch 14138 BLAKE2B 6f612b14d194b595a8c5baa5cd1e5a6af9e43873a3b437d004c212934ac2f0bbc638abe8bf0d7aef91c8d5084e2514f03bb9c0999e57dcc6bf210b7bf1cc3a8e SHA512 a58a3d5f4ff7540a880e064bfe7602d38671ddd737bc8e4a9e48ef52f0864de8e0ae51f0fea2ae0be82cc6910d4a47ff8562f9a730dd1930a37fd870bc2823c9
AUX ncpfs-2.2.6-no-suid-root.patch 544 BLAKE2B 7e5b15d524cba691cd5266d2eaaf579c2180d870235254c8a77caa07e9c72dee36b6215a5681eef16e1a30274862d6bab01b2ca824571de3ac39ecd863c84364 SHA512 697d577aab12c94cbdb36c2f9f2cd51b82e3ab5efb4a9e8246a7c93b7004d004e7d4fdb1ec003585daf1a11f9f559fd65ea86fe8933f2a7d89b0ce810f21c975
AUX ncpfs-2.2.6-pam_ncp_auth-fix.patch 556 BLAKE2B 66289abdd6b8adc0a53538365c03f30eda980c3eaeaf2c6d7105757b3bdb69c3a53d7b12bc7a06dc9d1f91bcdfbcdd81b4e027fdd5054979aaf872851ac8b148 SHA512 3c20c36bb2b8c72440e359bb3f66d5a91bc91132accc518bae8db0fbc77aaf966e676f494c8add959178e315513aaddc9f627a05b9e0c376cf7ece5bba0b0dde
AUX ncpfs-2.2.6-php-install-root.patch 479 BLAKE2B 6d7aa6c8dfbace020b933a3c23d594ff6b98f3c01a1aed2aed499c2f54c8321c932058c4b588b1638bb6bb7bb658a0c5ee8e7c48e3d7a2a7c237ccac126ef71a SHA512 9038d701583157591109cfec8c10bfae5df20f5d8af6f9eafdd4c103169d6c00f9018eaf11fa14d5acaa61ec25f217d3b09222dea3eb659cd820c964e6a3d699
AUX ncpfs-2.2.6-php5x.patch 400 BLAKE2B 14147adf99435c144f3d1ed221e9d6796a2ce493423556ff8abe34e6527e5d3b86f5cfc14de1a97dc26732c88fa3705e4fa50649ad6c885f635617360266df4f SHA512 893d90e60b3ace99080ba0ae343c6dcab2ecaad9e2b6bb1082b63190833e1b3b3aa398efc204d5161517b6737b2b6fe8407e148da01ecb0a5f5c71ce3b83d35e
AUX ncpfs-2.2.6-php_auth_nds-php8.patch 9935 BLAKE2B 22e0105a8d09713dd054cebcaa1455d01433aa5176b7a21757aaec3a4902e888a1b9d1e25561530a93cf43e0efe7824c4439a9191011ff037ba5bfd639b1c655 SHA512 5430eb4162bc1c46ed41ec6185c4934ae0fb67387a3c2f4f3080cb8a457903366259180715fe720ec562b792864de6706bf10160e9f5de4a357c6e1c95bad800
AUX ncpfs-2.2.6-r5-nds-null-name.patch 832 BLAKE2B cdc2d547bb68ea8d8ab50c93d05d10a5dc324ce0f7a7a06de363495b1b382bb0a815e2580a70f135988b959811b2058a261cad1664dab5a80103cf5df10a51e3 SHA512 58cf502ce61c42f239ab4358283cad816d46d69b146c0bd49a3ea560b1f2f46ba95f75ae2063c5a6d08328ca5ded853e212ca3a2cb55ddfb1087df4cb54f0de0
AUX ncpfs-2.2.6-r6-drop-mtab-support.patch 7547 BLAKE2B 27c8430665ce12db203771bf11b734bf9c4b808319c7fcb74fe90cff1c844b18be1db80222ed0a8cea1d4f2681ae76b409075bb50fee16af39fa6396a26afcad SHA512 755a10d5916df2fd8d548168f4647cf634e31f942e609e4d5eb10ab622817b1f328870d52c11160abe65d9bfe4427ac2884783805193b2386e96dd08783838fc
AUX ncpfs-2.2.6-r6-ldflags-support.patch 5638 BLAKE2B a44c89d6de19e23d43a609e0f65812470ad844f4787d70383dc3e308f16be2350a38a9755a4cc5ca41292b8e584a01a388d76d30cea2208217cef19815b9a972 SHA512 efc97eb1b9ff69b5a3b81b26fb2cb82d4dbc00878cc311449e079b8fd4b33c4f8fbcdd08a9daca5b26982a7fa8b25687685cf77925718f2118ef5d795238f62f
AUX ncpfs-2.2.6-r6-servername-array-fix.patch 500 BLAKE2B 032bcd88fd24c2844510c1283de088e1b830d1b48b0482edb9b7a86e813b963aec522de0e9010c3425d4bde8d9373ffc10ba1ce48c867a9c199834467e136d45 SHA512 09188090bf130772d32afc05cf7b40a91e29a6e993fb1b2072227969e3e9bb47b30302a092cfd9598050bcd16da4d8b507d38eb61b10fc0ceac150def21df902
AUX ncpfs-2.2.6-remove-libncp_atomic-header.patch 572 BLAKE2B 17d8bf08a9cfa63a0ace4f9f3a7983ec70a7c5ed3ad5d83a61383408c8b350a0f25368bb271658a4ac7e26ed0f2ea62d82322a55d4e02f6f0d8d3b6e995367cf SHA512 07689c979e8e6a40aca410ac8211c6af9fa640679c34ab3431e70c849e9f3c42d26b204310a697ef1494f33b5296e642b977dfc56453f680527ee54d697abe1c
AUX ncpfs-2.2.6-remove-packed-attrib.patch 10312 BLAKE2B 9fe98d402ec9e4435128ff903c6cf6eec7144cfa5ba75b1732707e5f50bcdd12ce693cb156d6a1d7c90b947ab52380bd1ff6d1ba44b282cb0f68319838030aa7 SHA512 efd11c2cf08f3b7b1458b836ee863f31e3ae470986a02a3d2db0ec6fbb7a984e2d33643765d7223b797732d80187412a907a9ca971233eb0f95ed4744ef6f44a
AUX ncpfs-2.2.6-servername-array-fix.patch 523 BLAKE2B 6cf9c27ae7bda17722a74f550beb8a2f027517db264a4f895977c05b78609cf818d88fa79e2264a99e99ea09e6de626eb209c394d286b9cae84fd4636db3de47 SHA512 10c8a0b7c6d715018acf77ea3bcca2e50add48d479cc0ee07035f3f8fb910069c2c508a25ab3de945ef19c78add6d8192f0cb484e756d9a15ceb3afcd8195a69
AUX ncpfs-2.2.6-usr-merge.patch 514 BLAKE2B 44873b8731d062b2fe802f9ecc145509d12625be4e62b1025738a6076cb003d5577c2d5c21e338ff5fade6e0bea844a254509287a82aabc0bb92db20b0c7ec5d SHA512 cf05a0b2e41c45a8215bf1b150b79a16cdaa040c4e41ab6f361fffaa2a937fb792b464b1a9b49ecde18ae5df8e58e1887b1e965ff39adf1f05a2418f89efca11
AUX ncpfs-2.2.6-zend_function_entry.patch 296 BLAKE2B 3bb6db87517e0fb086e95462e9b567628ede7fbeef77b5d6e101dec8a316f2a5185cad8846bbaf37dada789acfedf6f6bbc75dafa92f3eb140cfde4eb038e1eb SHA512 c96723a840cb1b0cdddb91ebe74620b87a32350be084f21b741bda4e399a7648fd00522e9f2ec8404d5a98835d3f5a343dd588f4279848cc031de5bed01680e0
AUX ncpfs-2_2_6_partial.patch 5136 BLAKE2B 0c9955d4988f9b3ad3c6aa68d4881c41afc576243f9a8725eb49f01cffa881532658162cd5d33419d3e9b7b730ff76f340bd4d3c11c76a0e59ff06c316efad3d SHA512 806dfb1a0509f09530b19423ad57449b5359ee50a232b8a89dbef63729d2b7a3850eacea213051bf96cd4d95763d4676b5c94a26d54558ea74167dc523459ad9
AUX ncpfs-hg-commit-403.patch 704 BLAKE2B dfa0de67fc5c1465d17f994675faf7f4c23507c71de31c84930b249ff1b45aa5cbde91cdbe256c1d310fc50afef4ec540697c5bd6cef1619faaa15e9bcd58dca SHA512 be247b909a9a8aa73a156513e6da72c47f8373e15c3f50f8506ab0e0c91630fa4a6d176b214fcab7b55f7018225e73d0dc3f134869022a12ce3e40c60703a751
AUX ncpfs-hg-commit-404.patch 19849 BLAKE2B 24d1b7629b6938438f446fec748ffa90f1ece2c9604c90881f5ac79c695375b09a7c1b4a930993b3a8c45e849e7143be5e64115cd652d48bd9ab8700d304b3fb SHA512 353ebcb0a7245fb8967f45260fe5539bdcae235cd0db37af70224a1da070cd557dc87f8da714c425fc2cf53d7b6af2b01ee5aea9a70adc1f632bcf1337a25569
AUX ncpfs-hg-commit-405.patch 3626 BLAKE2B 5a97f1ed2712e0834750a409fde42a5b4acd268aa83dde5a1223aedb515b4e9370779325672bdf9d216f023625eef9badd274a823d63f35e9a76388b64b508d9 SHA512 ccc543cc70ffa22718715b6d2c9010c4ad8a897dac87045d521470c3cac7485340738f1fdd54e61c5df99a286467c35c16398739ad1bb9f0e3d44128fd589ece
AUX ncpfs-hg-commit-406.patch 2562 BLAKE2B ddff79f62a29927c560cf16da1d007d6bb7b48c6e88ee67fb20e65e70517a996ec51b512813a823be30d40c111e3ad45e37821944c8585f825d2fdf5ca1b8a9e SHA512 ca106af3e4cdfcddb2570980a517bc4924354ccf1b760d797eee34db94022ec8d6e9f67497fbf17177e473593e68dac2619fb3d5384d2e113faaeece35d70c53
AUX ncpfs-hg-commit-407.patch 3414 BLAKE2B e212475960aaccb23297051a39c678797cef023070cc555eceb0ab3177a94e42439f07ef20c308df42676da5e5dad1084d019e93a77e70759da153f2b6e6d861 SHA512 655d0b3d07117197d0734a4e9dc06de7d51a860adbca70efccc0a48a88828cf5c4eb45bc17c316f8afb4b4855f144aad278fcd866bd74946e7658afa8f674caf
AUX ncpfs-hg-commit-408.patch 748 BLAKE2B c5e0cfb4466d3eef07a623e375a7e2a5265b38a2d783818d75badf512e6a5f4526d57b0e6b51f950b34c14af7c2fce44be32409a6956f5c8a2c99f903ac0d783 SHA512 1574f8e189ae3bf9d0a8d73f477127370c44dd2ae9e6dd3b5bec9a557dda35713bf30f5c90cc7ed5216cf959de59e2191cc8f823e6f59bc28cb2e8c40084ad0e
AUX ncpfs-hg-commit-409.patch 4542 BLAKE2B fddd4cee8877848b3411effea5c298b90825707f370b7c277e5969d833f1e54fdc54029cf3433b86c18570137ece30df9cf260eabf463766a80d7a5db3f57be6 SHA512 188fc0e950a735d276b52db59bd6b4323ee4099c513d4e6cf215ff76e98c4227e2596a7a52d69d3cdd9005e3102e8f745679a3997a976993181b2f427e3970a5
AUX ncpfs-hg-commit-410.patch 1833 BLAKE2B 66335e54e42406168d7ed9046ba5db67dd39f3afccc56e7f856407d1cb784c6dad21711d062943afd247fe570d39ed29dc4d836ac3c3179ca954db25a5ac3619 SHA512 6767f57cdb72896e0682e8dd5b56204a57fe122471ad297edb876733fa28d54e2ae4375e3302177f2539876d22bffbfe42af1d265748641b960b47ff5081e0c7
AUX ncpfs-hg-commit-411.patch 341808 BLAKE2B 4fa36aa74bc50910a7695ab0ff3fbd2ead5f84e6d0da85b462db14e36a2ce6e1ad44c09a51a9dbaea25eff3db62cd78405b0a658463e62294fb2457528639daf SHA512 414bdcd200f097b84b52cd536a7f5215ec9a7ee07df2c0d120c93c0f7e8224cba673b2442d976b1a4422b61414f9ece989245d9062fd82c646793e6d2af5d97e
AUX ncpfs-hg-commit-412.patch 601 BLAKE2B 61027b901741c0f098916d25e6c45a100739a456a90b1d20f17637a4ffaadc800f4576e8d75718a525a615a8ac86a1df3ec637b187e9d4c15845581882382f6e SHA512 eda8858f4cad0efb2d2c67ebac800b10847e62e395b0ab9f750b676bf47d1c01ff822988112d77169deec2f65697a8699f5ab6a5f7f9043776aad5aba59e2898
AUX ncpfs-hg-commit-413.patch 523 BLAKE2B 31fe77cfa7b292912298572983e663880422273e0595aaa81d11073b8b846c98a5485c97577fcf074a740df9d8d7af07cc65bd1ce21443933e08af914954cd41 SHA512 85056d73bdd196f077dfadf4d696c288318199c47cc4bd1e39088a7c08d8d0ad55cf3832616af2ce0f12f1d63267fe72fcd63e54ce54e2973d5ff918d6301116
AUX ncpfs-hg-commit-414.patch 1476 BLAKE2B e1d05f883b0f8e72bf4fe5bd8777dac627195535bc1ff6ea78d5ddff598d29a5f1004d4740efba9638d766f9b55bd482a0af8def6f55ee840f12a6671ed529c6 SHA512 bfcfaeb5da22cc33d35a5347ce183f3253d03d23473aeef790f32f3f9d6b6ebdeb3fd2d3e5f959e725ef58e4356bed9fe548e2e8c9740b74cff0f48450ef1caf
AUX ncpfs-hg-commit-415.patch 3117 BLAKE2B 599cd316d92c80a973d2f3684761d00510aa8cea229c5e383a7dc68602e9d97efaa21f63fd313a1121e0561df0dd4608d982bbe3670cd0da6d00fe97941a8642 SHA512 9dbaf04023cbdea602706ce16b57126fe44f9fbc7b0c9f16ce567e11e990c2a3b937b6ff1b4238f245885c449f63f670429bbcdd3cb42ee3a085a5017259c23d
AUX ncpfs-hg-commit-416.patch 7944 BLAKE2B 02cd2e42fa150e760ab121e70bac4e61d9f1d4750428376b040556f86293b87b08ff539acdcb6f8c3375c90d047d600034409dab51d9845589fd047c93624b56 SHA512 9558a0b43188dca3aa8e07b5b651ba902c99aac627f4c09f53a3ca4cf344c3c6abeeb7b6c75c502e2dd141a8a928b0c6ede66c3435dbcb44c4bf582eaaf306b3
AUX ncpfs-hg-commit-417.patch 262217 BLAKE2B 13a8da41b27429d3b1d24c64b0d4f60a3c5eb160edbc990586d6b5d56f462c2445da690061e9d1a062d2d7d053be8baa055f58dd6b3b2b078fcc6a65382c3a33 SHA512 5fe2189156a1ee09f51fb6a2855018f7e0f2033740ea48d0d380d3d381f51d651ff87ea24394a4971d45b57dffd92ea8cec85dfdc82f5d6d92d81aa94177e7e2
AUX ncpfs-hg-commit-419.patch 1037 BLAKE2B 6d875a2248bbd0bd3c7756fe3ccdafbe81c08197b2a543ce413e8681b7ba9b939a932e4499cd46e5dfc19cb17a85534e9caf55104273f279b2761fb48e214944 SHA512 9920c9bbf2c758a69eb5feda751452d81fa65b14a0a184bac12d1971ccf0a26ab38ba789567a975fb5503614673c54d0ed4c83c7a046bd0d2899d53713fd91b7
AUX ncpfs-hg-commit-420.patch 1508 BLAKE2B d301731dd97c68512ebc74c8b1f6f9d1c541e6ef82e524ffd839af9b57166ccd54b43145f845be3bbef0e293bcdaa5727098fa4a26de107d484ede008c8baa37 SHA512 a2578dde8287565f8c1416960c2891533de12a91129082b019dbfc1008d0631ea57df16f16e7f27d9dafa38ef824871b6687aa002493dc51601b8998de254022
AUX ncpfs-hg-commit-421.patch 909 BLAKE2B 21a91301dca90d906811820ef7863a824eb142929cd45580c64b72c250e6f2c8364b7c5d1587829b81d678cb13dcdef49f4a9fa5c8af7755cd4aac9783e39d26 SHA512 fd813eab4e73460c98fc26f6539c383dad54e4756f230cae75775ad19a5494aa873aba69ed9454b47dce3ff7669e02a8d4cec4bc0d5d322f37db0eaf10e58ebe
AUX ncpfs-hg-commit-422.patch 8918 BLAKE2B 31e3692e704cc6a3ee4186053c893ce48ddc09583536f03ceb8a2f314c63c9a159e3995442ee66d886206202717debcb4f123b965391a050c667cd516c641f8b SHA512 f950ccc69a25a2916c829e241e53747822ecd1e88af6f810fd2765ef793ebf114b4b58b33e114c90677e832f4dc1ad72cab6f6f89df5013614f7c396fa619385
AUX ncpfs-hg-commit-423.patch 12257 BLAKE2B 41796cd7cf1573a4fdea329e03bf4cf1b342627abf4ce7a8b36de79733d0c766cda4b1c7094fa44835645a30fa2a5622dd6ec1b000176c35d45f506f83f50f2a SHA512 3e792e12e35741fd9abdb776642584aaa79975627678f48b9f640a076056a4f0464d5ee14a4ca032703ec2fb1a3576ab9c03edb5e10e5e016985390534e04823
AUX ncpfs-hg-commit-424.patch 773 BLAKE2B d8710bf904c49ff73b5b31b375ec5ec1e6fcfdc336d8a138f9ba60b85b8d61e173643818a6fc7db5bdbb800d955e74bbc44880ea0d687e89dc6fca59d3472f35 SHA512 e94a444ca7e39912315e2b1def72e8cab89c89d26a8a6bee78bdf6e068519a9cbe0797537c3116cb4f43d78043834b0de94d7f417d7df86915c3a7cb95a28cd1
AUX ncpfs-hg-commit-425.patch 97688 BLAKE2B f6047ffdd85943f025a69431d95fd866884543116a1902cbd8e3eb27aed6cc3cac95856ae4ec7694aee74ca8bd18c9b02842a1170c7b805221e88c252d2589cb SHA512 b18c55dbc86070ddfe8ef7c3c955107fd781b99e78f1b3aeba89980350f7f50e4af21d1affb00b6850c98749169fb8873d04c40f7197af43bda6050b032de69b
AUX ncpfs-hg-commit-426.patch 8714 BLAKE2B 311b51d95fef6aa7052e3a199839fff1920afa517fefa62be8d34cfb9dd5deee16fcabba65425e4359655023aa984fb7c4068e5a6cd224e22de65c938d62871d SHA512 21a8e0fa868ff8bb43897de35588706da396fef16a1e3aeec23a47cd10ce1609ac0b8275ed163dae5773023350e6777960ef141b1cede17c383969f6de970f18
AUX ncpfs-hg-commit-427.patch 2704 BLAKE2B 3914562ef8c7e55bbc8eb664ac8d51650af18fafb96a1ee2e592decec9fe931759baffff2cbb3042a5848762d34dfbc5438c057dcc48eda379ac24fae0f655f9 SHA512 bc5d63230e2a06c9b5f03acf1d8b87428d2a32ec6212909b4d93d859b6fe62615d1f2b933d534d9b389d826a608822ffa41158010cca76a7dbe2079feea5cfe3
AUX ncpfs-hg-commit-428.patch 596 BLAKE2B 271e4c41faca9d8a224edd705b1f62b24f56627a47603f1ffcc2a794f0cafc94e8e67c285a8289d44e2ac886cfe5b844bb513f01082f3d3810bbc725fd6f0c7a SHA512 b117c493c6faa3d18beb29b51f067c0dc4ede85310cbc4eacdcf885f5ef36a0b7fbb391b5cce3b1720d94f70d2c8bfdd6efbd1c47032c1f01d3d84ea7099b24c
AUX ncpfs-hg-commit-429.patch 5643 BLAKE2B c99a937edb969509f17673bfcf0fa3a4106e0c0cf0442acfe500b45135f99ebbcdb66603bfa434a4269b2cacc7dfff9ef0cbcd552c397e65090a42d0d4cc9a25 SHA512 edd87e04c70b81b149c03c69da8069ad710a96a81ee89ad08441d5eca6a956fcb230f4cd9a5e6b373738fc29faae2dbd356389a13274014a4c3bdf8edfeac6d8
AUX ncpfs-hg-commit-430.patch 707 BLAKE2B fc55fa9d863102b0cff14d7ead7aa7d57adc5a52ad8dcee03c291c9e1c041bc22d0e5bf157a55b3434b5f5b73a44dc101a8e59c9f14569a952ff5ba554028f15 SHA512 9f44f7d7ea8ea4b488d6007a689eba73fbf99432fb96b6524eb0258f0560f416f9aa0128ea4f8f1bc6aacb5852ca54e578e1ef0807a0618bf05d0a79c01344ea
AUX ncpfs-hg-commit-431.patch 105346 BLAKE2B eed86ec79877e65ba8caf51fc04095d9978623fc18ccf82e03e62f9441bd425330132d783be62114d8e657dc1b08eaac7549fbe6453c7416edaac61cdb3ebf08 SHA512 09541e37f0b425f794478703570e6f563c1168e83d6af92b8de142b54aa23a089b599fcaa8ec007e7addd53fd809871de82c4a87873b50c9c50206a8b3823d99
AUX ncpfs-hg-commit-432.patch 4341 BLAKE2B 89ffdf605a387805096e9508ce3920d721a70d2c47760d14fd6cc280907f5b2877b423c6b1c9cdf79b603ddcf9c52f87c986309e27046ce5fe29e5be9d582ab3 SHA512 4021f63774113c9291f1ab8ed9ecb14c817841f219a97cc3230ebfeed7ea59beecd0507c45d64e78a0e1e153b1627d869559cfccccb8bc236f9c96c1fdb91260
AUX ncpfs-hg-commit-433.patch 4629 BLAKE2B a49f635039c38b991fb1f521d9326ff2fcf3b928af9b7294405b9ce7d0b05a201f5054dff7f49fef8dbbc6ff2bf1471445f4f6d0cbdef8b0a6cda6216f7cb5ba SHA512 fb6fc86d4ef79956efc5ce935c33ab35487407824d1f23c0ec81736112555fbb3681c5f066d55ee0c04a9546645adeb52cf1ff5860b9be827e6b04aeecdbccd8
AUX ncpfs-hg-commit-434.patch 807 BLAKE2B 7e78bfbd3ccc1cbeb0fc4bd8633030cbaa794288cf55419c7cd523e83850f7c9f781f3d5825fa10411d118e21186133b5024bcef23ff0b98b1b1c41b37b54754 SHA512 fd9357e4ec7398812a4561859c53dc346c3ca23a02ac372549c01df9c1570829332bd2ce004165fdb49dad7a401eee8d235741057d7abd8c84c1ef7ac544f37a
AUX ncpfs-hg-commit-435.patch 1035 BLAKE2B 72d3d3f520a659eb7367b521c60169fbc130f009a549fa10997946458dedbd9d2c75971a960ca5cc332586ee4e49f72ceefe88b95871081bbdfd1343b970823c SHA512 08f75e3b5d4a7c17a125029784f39ddb8cecf5c4bc6eeba6f1a0c85a9afa800b3be06883a8ac1a1bbba4faa0c1afc6809d65082cf7ae154621f96ccb45eddd61
AUX ncpfs-hg-commit-436.patch 62641 BLAKE2B 66014cdc61740095250568e61930654105c384d51c0ee7515bb16440d93716743345a8ded92eca15048bace7cc1d38528e8e257a7a77857d8b0bb6ed8a7dd246 SHA512 879fd76b3a9eea693729f3d7e0a4ab80229e310403ece02059b944d5480774b935fa9d1c8f0b39125256f50fc25e9e37cf0b5c329c22ed398367501779897914
AUX ncpfs-hg-commit-437.patch 80713 BLAKE2B 2f7446224c820edaf336e543361ee500c3296fc88637db03f09720bd35a1a9060e607bf2f57a5d6d94f024ab27993db45fa68db1a6e911db19ccbc047628d766 SHA512 da55d8f1fec8c3a5a6e7922019bce02ab7a785f2cdb111cb52f36e649cecf13f8ce61e605e3b5bc45fbf17c3bc981128a62be62f659318c5b02e7c979e5252ca
AUX ncpfs-hg-commit-438.patch 643 BLAKE2B 900a8aef6d576ffbaaf1af3efd64019f531751eda3b9048aebf97a5a2e551150561daefcad0653b8dc644d8f8d0cfb97f475b65ba83381ceb9dd36efc1b52046 SHA512 33f64d8b2a2d0d51cda139e23049da6449cc5fafd41b91cb32f96088bcef6b8b5ae7783a779a57576ac339cc97f563417ef76f711768fd5f1acbe3cd51a2a7df
AUX ncpfs-hg-commit-439.patch 5152 BLAKE2B 9fb4a047d6fccea5a4615362e0ce498a0d3608e16ddba71782ec1bbbf8af8b059c4363d80d452a8343bfccf36263ef77405474c6a8c2d6848bbe84e9408ef180 SHA512 c5e35fefb929fdcc6ba8acc3435bb48cc1fec6f8a6f483bbd3ad9110aa71502e3afb506a2257d1ab1a3f07a79bf7c2d369c127180ec35feeb3d4a0163d44f665
AUX ncpfs-hg-commit-440.patch 2446 BLAKE2B a596ad9ca9a7f8a55b1c33b428d012185cdcb5edb50c3dd4e0d050d9ad63c2fced3b8dd540fe50532c816bf3effd798a32ecfbc55c6555957c96dfb88f88a438 SHA512 49bac8b27ff376f92b247e1071003fedb3e3a0d0433816b44e4fe7463d69fbf1d81642a9eb9bada8d456c5880a1e7e1c68d2f2c31d46ad7b25977cdebe899e55
AUX ncpfs-hg-commit-441.patch 40771 BLAKE2B b5d53665422345493c67cd53919c1667f1a01c1a31e944bde2d9c4861d76fc2b5d6284f5a8c23f53117a22bc2764c561b125cb950650bb8f1d5733c98cff3c39 SHA512 4013eeda1408f79268ad2cdc1fa6bdcdf721800dc917f7b52ce3f817f31b8e72fa09c478c927099ae213bee50f9df05203166e014368ee9e7aba8505bbdf9656
AUX ncpfs-hg-commit-442.patch 2162 BLAKE2B 5be0a3a8d6ae9a6d66d135a20318ec4d85cc9ab67912674d2df1de1d0990cef183b7e55a9332271091449d37bc81f959ef5f556f05559815cd6f21d9429ca65c SHA512 124327ecbf44e114ecc9294aa35d81ceb63fd931ac254ce5c3a8f126a34580ca4f9b98a9dd78b18d06e16cff2ae0cf6e8a41925ceb0240699ae6df13b3ce133f
AUX ncpfs-hg-commit-443.patch 3405 BLAKE2B 854d2cdc11b4cbd63cb0466044b369bcde586923af91e88a49167e6d94c4b9743591411f16b13000391d918c2514a3da9089c239d3d5ce211097d0bdcebc1efc SHA512 40e0383656b72e2f470703f2f2f65f7fc3a2a187296a8e746cddd6766eb187b8d9d0a3061f3f682cbef98262216289e2d897455ff1f1064de7306cc51bc525f4
AUX ncpfs-hg-commit-444.patch 1065 BLAKE2B 2d433393f1a6fd1427b6da555ffaeb4c4d702a5b1141f10c030b80ed391a6506d34013f5e2932b94462545d9492973b90b79b08f289af9efc9ac9767523d4a96 SHA512 ec11ff359c71ede3bbf6fd7282d1654dbbeab949a962edc50cfdb89210baf6f4e6a43468c75de9f8225e974d3b3a999e2a5b53e9ebae690723cee728bc45d53b
AUX ncpfs-hg-commit-445.patch 3583 BLAKE2B 5d598bd914ef6206be8ba498f7677bac11aecff5426ed5d98597cdddf2ef83e3f7af357247b6dcc93756b9cd76f136a76fbac30c0ea2908e9d7ca6f0f0700619 SHA512 b24549fa1d9e73f5a4272c748745e21dad2fadc1e69c2ee8c963625e22ba242cb242846c55e1cba8e410b4e51b30b2989e44fa4058b222533ae19302df16310b
AUX ncpfs-hg-commit-446.patch 11110 BLAKE2B 48f1b1a7b34208bf7ea82f8cc06bb906c8ee0a54670535e49731b24d0f1f7b4c77ede1d3cc91053975ca9eeb623ce2f4dc8a6c5f4b7511ba2ba17ce8c256ea3c SHA512 7447d09e899890fc8ae82af0620111b48ae04ec9e31f8d7b772b3cb55ea7b031336b70b410b3746c0d215676efe90d06c21c932be3d459c404bc3e4d3bb76d95
AUX ncpfs-hg-commit-447.patch 1146 BLAKE2B e383aac1538aac1e6c057e84c3924450fea41c768c4bb4ffadee56c12785e34895693db1fa1b1f198b5d89a36cf8358364fc46d2947e5f09dd00da96fe044cc9 SHA512 ad64fc870ff0454f8c56b5ba9a447b28a5bdb507d7c2aab515e97a81f6c5d72b692d39be4b863c81e7f34979f2654c7bae5d2b8cb747fc2528f7c87a24ae7c1d
AUX ncpfs-hg-commit-448.patch 124770 BLAKE2B f7966221bad7617ee14dfe741df7a4381c2f43bb78f9d3a55ff4e57dc3516b86ce0c7c4e34fb18f8402ee458c0fbc05b3dfe98e203fcea55005b8494de242fa8 SHA512 1d924f2a532d9dfcf9c2879b3475045fe7c0cbd24cbd2a93d14ca68caed39cfbcf70f961aa2bc46797df55fb91b7ced9a5257ca2067e144b5dfe482bb13e881a
AUX ncpfs-hg-commit-449.patch 635 BLAKE2B c2db3382ae1aaa52bd0eaf4de568c6ab9fd6491178ea948546b390a66bcfa97578f0f64de5e42db599814b07b05e329ad58f62fcc46897e61bf438bf67a477c2 SHA512 01e305c2bde3cba145ffa328f70c981f2d3f6f1dca60422abb3e1559e07e7d412831a59719b07e262c8cad8140265bba363574ee5370a200ebd4021c27b38e28
AUX ncpfs-hg-commit-450.patch 3034 BLAKE2B dc08fcc2be45d306cea5d972e8fa0ad7f89a44e888ba051f819182e7b341408410f7bb56dbd8f361738a716aa0d49df3aa81c5cfa65ece92ca7c2be8b5af1f53 SHA512 94237a76c72b15c807ba09c859e826bcfa8db961cd532ba5ddc9b03ea77d7529a79e267462de94054d98e031ee8a1bc24cacb04d40923083a8097621367f844a
AUX ncpfs-hg-commit-451.patch 19505 BLAKE2B 07b94265f047046feea312253e00d0ea222970f62cb8513d7c21566b21ff867d0fdb02bd18464c1a23c0b6bc5092155c171e980d2c5cc40f516af1ad38796752 SHA512 c4d60e1c31c533bbbd12b75378960bdce2083d59ac26c04189b94aebe9b929cb06b14313ac2bebe843ba9552a23386c2f2a76ec7e35118437bb37b78d49fe22c
AUX ncpfs-hg-commit-452.patch 1351 BLAKE2B 89ccf642e736a0017c7d7e3eca491f17051107a54de3bbef9b8f57bc07936647157f18c917690e74454ad4bf1b6273a5fc8628a01de28efb557179e85ebf5bc9 SHA512 f90a20baa32171b4bb330c3869cad3780402d0e1a029c36650ef611010dba2a7e1a3eceb0537df654bb992ebe7daf616e96cc39e461c51b818641f23d59e1761
AUX ncpfs-hg-commit-453.patch 1032 BLAKE2B a6845ee44be3640be6c401cdc892bf593848d18483ce1ef803064cd6491b12552aababaf7a221af416009b5e23a5b38b4014d47c48a8f8dbb3c18d180c2a0ccc SHA512 312892a13528759ad9dc8ac3ca8e26a0703f817fab1368fa7228f4b23a68fbbba9c5bee8a73d2dd6f96de3c219f5723b7f24bd730931196ac66688f7d2db8e73
AUX ncpfs-hg-commit-454.patch 10814 BLAKE2B 4dc88e9123462153a543a7bbedc245fbe3cb7bcef418f3f8900f5eb5c3e84a7063915f51bd3971d27a3fcf0a966fb2cf2d872703ae94d49c2b6c507c4c27b266 SHA512 bf01865232e9f67f290c6b36b004e99c7a4e43dcc51877c8d1c781045afd544f507d2ebc5830d9981c4bf8d75e86ec5bffb41fab88b9b38215b252c05dd22dd5
AUX ncpfs-hg-commit-455.patch 2386 BLAKE2B c2f8b6eb875ed0cadc2e9fab077fa2fe8ccb2fa019d5fa7879309e8dea61d370616204c7fab520862f7079a7151d45ecc719ec0b9172d5408b8b0ce51b731b5c SHA512 8bb11e4e54b107a10b90e1290723842a345b9d99459f476c481a0ecbccae5c04a9e5ffbb4ad292447549e4711f2e23d379938d9c6f803fc153c5e3caee91f28d
AUX ncpfs-hg-commit-456.patch 6891 BLAKE2B 835fdc4853f0329f68ba0625907c1315f1baafa471d0aab73b01ff27c9c98e274757db3ad5074e2a12df761738b703e118000780b96f986f8ebd11c0c9041afc SHA512 7e926c078a07c0f88162840b0f3c802befefa65d24d64b5c79a438cd4014bcddb2329f4d38b64c288663cf8548cef71f9c63ca038170dfd7e2eeb7ca1c647e08
AUX ncpfs-hg-commit-457.patch 11125 BLAKE2B 2bfa8f2908d42112a72bb0f522e2cf0b228993924a0e1e4cddc40a97ce84cc62be5129c24f895324fd3fa8abd8853f6e0992159150c31f039fff2b0350b6384f SHA512 4e5c834fb387d270954b7a03a6e2291af7f8ce8096f7c7b8d6f2e507de099caeb05b610ccf05b10ed0e7115d914970d70561b230ff0b0da5e672a785a6a50e77
AUX ncpfs-hg-commit-458.patch 7133 BLAKE2B e1be5e33b7fbef8a04ed5127601875dca66e07f002ea742397e934afe6558bd2f0574714230d4aee0ece73ce5d4e09c88a46c6f2bf7b8a312e3895dd59e8659e SHA512 8ae443672592972a5905ac729a5b6f46c1a7649ed6fd35a4fdd891a19feb350cc5a45ab658335cf2885b5ef54597095ef690ce35321c9575e80a69915dd082bc
AUX ncpfs.LDFLAGS.patch 2823 BLAKE2B ac37368cb53c255b4afb2236a040a8b4672233de4779267ca3a9ba26b0c3a3e1b0136333a1edb269ac11df2200b7fc0650caed4966ecd1d5eea36c59e7ada9ef SHA512 f707d78bedb45f7b6d095d7af9701649dff78eb35e8c343602ec9ed6289aebb60531cd031e6167f351fa6d37ae189f9678e52cb7591b08eea1e6275c91262683
AUX ncpfs.mount_hang.patch 1388 BLAKE2B 7d5461322cb74f37f27c27b3733a98dfe6f4100fd0ab207c6a05472a8ee007359cf1e86e0e90916df9ccf928d2fa5b0fbe7dc15676ab5e8d9a03f5690afd2d96 SHA512 5b00f2f831d77573cf25c82fa63b9b44731bd96ea0de89705d50fb904d5e390eeef7021d8030d8d15f8826df4d7f3fb5dc9db0a5039a6ff1889e233eebcfde3c
AUX ncpfs.offsetof.patch 566 BLAKE2B 779f2684f0b7f68c86451b2eff3660c3ff1d18c9587c8d6ab47b6e6b57afcfd7abac542fb2360a9405bddfad2069d948fc271a0c7b053e388688f2e9ac505aa0 SHA512 8e396c8a47d87bdb4b039bd7ec082284b8e41e0d91c6cf898c021c73a43c1dd419004bb4cd3275e89e012da78582935c97f00140d44e0504260cfdc7a962696f
AUX ncpfs.pam_ncp_auth.syslog.patch 602 BLAKE2B 90df886933b6c12f9f2194d0a94da2858c0a86ab7d472bb34662f97778c7aef5d572b5d01cdba7d643c14a74da8f419d296f1f56758c57e9771a03e684614951 SHA512 2222d205ccbfcb89ef812c63ee7d30f5a1fd978ad4977165b2228467711a2bec1776f657338ed90a473d26d5ae5dae0177cb4e68157df60eebff546ca2cf4dc0
AUX nwnet.fixed.c 156996 BLAKE2B adec07313c197b65468c9981fd2a04fc0bd6e3dbaffe61b5ebb2dddc773ca8bc15b61a1cdd7879cc81a6fb0f311396e877137e2bd23ea45109709f583c23e2f2 SHA512 a23646fb20b7f29e15b52daf5af22a4f07ec53149d9538c68deec166de36048e4a5a967ea88a3d48876704d40160267d5452538c2c72ec5df3879c8fe92e57fc
AUX php_auth_nds.fixed.c 29651 BLAKE2B 6b0e6b56547d152c6e9cc327374d1b492c912bca85e87fca6b5e244d61cb09f71cb0e8dcaf0f9bb6d7224132842c3a2cfe4170c67d0035c0e0ddd5e80e7ec83f SHA512 78dbe6b636281ac6540cce996b8983fdd9d689781c984555eb09b95f479467326f82d8d164618f5a210a89c817ac8cbd13ca79afa1b11be3ea721703eceba62c
DIST ncpfs-2.2.6.tar.gz 2100545 BLAKE2B b95c8c0b097227c7b9e526e978efdca2234cdd0833468be99abaa68b0feba09794be26ebcb3a1c3371bc99f6c9d007eee164fa5f918aaee3eca44aeb1420211f SHA512 51f85eaae85deb66cea2ff434974699f6aa45ed1ed75217ef6176ac0b7d0f9f1c4fb186afc64c1b495474d5bad9ac7614033128c0bec39c05de723a9b29c8602
EBUILD ncpfs-2.2.6-r5.ebuild 2985 BLAKE2B 4440b4336f6cc88bed084104cb438f8b19b63e89c84f7747eaac501a47eb6e053d72d212fc77914a2273862e3f03d83b14edd9d12ea5485774fe775eb5084ee9 SHA512 82f27d1e03bca4511dd6baccf87e40b01a81b637a61db46f52a3efc8861924751aaa569eff4b71d932364f2487971c29a24ea62b8f115b30b0045163e3064174
EBUILD ncpfs-2.2.6-r5.ebuild 2990 BLAKE2B 28d7aab7221744a7d012ca38bc3f337d07b6e9907f50100fe0eabb9c59893411462bc82a3b9dd336eb42d5f28a903783bbe96e27ab8b5bee9012cee9b74592d5 SHA512 c5da7db358d061ae97975ff8beacc3c27f240d2fd47cf4c88bb90b52ef0e2e3ff051252e4641bb16b11c10c337b9c3e2e6aeab7294b8ff8f95b9b7633dd38b9d
EBUILD ncpfs-2.2.6-r6.ebuild 5028 BLAKE2B fdeee2293399c71113f6303fda87e367f36c89e3ab85be5c2cc71d7c5ee3b8fe6bac2697453166e1aa1f8bd96225d207c0e26f761e46f3944ea9577be34822f0 SHA512 0d02725d006688b548b320a9e3ecf4237c4f62d2cfa9781895ec78949d4a3538de42f58aa8744ea626aa744529052bad41b836f3357560608ee75b05c4d43b6d

View File

@@ -0,0 +1,54 @@
diff -Naur ncpfs-2.2.6.orig/sutil/ncpumount.c ncpfs-2.2.6/sutil/ncpumount.c
--- ncpfs-2.2.6.orig/sutil/ncpm_common.c 2012-08-31 11:12:54.372652698 +0400
+++ ncpfs-2.2.6/sutil/ncpm_common.c 2012-08-31 11:13:12.235236366 +0400
@@ -1446,6 +1446,7 @@
struct mntent ment;
int fd;
FILE* mtab;
+ off_t goodoffset;
if (check_name(mount_name) == -1 || check_name(mpnt) == -1)
errexit(107, _("Illegal character in mount entry\n"));
@@ -1480,14 +1481,25 @@
if ((mtab = setmntent(MOUNTED, "a+")) == NULL)
{
+ unlink(MOUNTED "~");
errexit(59, _("Can't open %s\n"), MOUNTED);
}
+ fseek (mtab, 0, SEEK_END);
+ goodoffset = ftell(mtab);
if (addmntent(mtab, &ment) == 1)
{
+ /* restore good state */
+ ftruncate(fileno(mtab), goodoffset);
+ endmntent(mtab);
+ unlink(MOUNTED "~");
errexit(60, _("Can't write mount entry\n"));
}
if (fchmod(fileno(mtab), 0644) == -1)
{
+ /* restore good state */
+ ftruncate(fileno(mtab), goodoffset);
+ endmntent(mtab);
+ unlink(MOUNTED "~");
errexit(61, _("Can't set perms on %s\n"), MOUNTED);
}
endmntent(mtab);
diff -Naur ncpfs-2.2.6.orig/sutil/ncpumount.c ncpfs-2.2.6/sutil/ncpumount.c
--- ncpfs-2.2.6.orig/sutil/ncpumount.c 2012-08-31 11:12:54.372652698 +0400
+++ ncpfs-2.2.6/sutil/ncpumount.c 2012-08-31 11:13:12.235236366 +0400
@@ -163,7 +163,12 @@
i++;
}
if (!found) {
- addmntent(new_mtab, mnt);
+ if (addmntent(new_mtab, mnt)) {
+ eprintf(_("Can't addmntent to %s: %s\n"), MOUNTED_TMP,
+ strerror(errno));
+ endmntent(mtab);
+ return 1;
+ }
}
}

View File

@@ -0,0 +1,329 @@
Index: ncpfs-2.2.6/sutil/ncpm_common.c
===================================================================
--- ncpfs-2.2.6.orig/sutil/ncpm_common.c
+++ ncpfs-2.2.6/sutil/ncpm_common.c
@@ -444,7 +444,7 @@ static int ncp_mount_v2(const char* moun
}
datav2.file_mode = data->file_mode;
datav2.dir_mode = data->dir_mode;
- err = proc_ncpm_mount(mount_name, data->mount_point, "ncpfs", flags, (void*) &datav2);
+ err = proc_ncpm_mount(mount_name, ".", "ncpfs", flags, (void*) &datav2);
if (err)
return errno;
return 0;
@@ -508,7 +508,7 @@ static int ncp_mount_v3(const char* moun
exit(0); /* Should not return from process_connection */
}
close(pp[0]);
- err=proc_ncpm_mount(mount_name, data->mount_point, "ncpfs", flags, (void*) &datav3);
+ err=proc_ncpm_mount(mount_name, ".", "ncpfs", flags, (void*) &datav3);
if (err) {
err = errno;
/* Mount unsuccesful so we have to kill daemon */
@@ -559,7 +559,7 @@ static int ncp_mount_v4(const char* moun
sprintf(mountopts, "version=%u,flags=%u,owner=%u,uid=%u,gid=%u,mode=%u,dirmode=%u,timeout=%u,retry=%u,wdogpid=%u,ncpfd=%u,infofd=%u",
NCP_MOUNT_VERSION_V5, ncpflags, data->mounted_uid, data->uid, data->gid, data->file_mode,
data->dir_mode, data->time_out, data->retry_count, wdog_pid, data->ncp_fd, pp[1]);
- err=proc_ncpm_mount(mount_name, data->mount_point, "ncpfs", flags, mountopts);
+ err=proc_ncpm_mount(mount_name, ".", "ncpfs", flags, mountopts);
} else {
err=-1;
}
@@ -577,7 +577,7 @@ static int ncp_mount_v4(const char* moun
datav4.file_mode = data->file_mode;
datav4.dir_mode = data->dir_mode;
datav4.wdog_pid = wdog_pid;
- err = proc_ncpm_mount(mount_name, data->mount_point, "ncpfs", flags, (void*)&datav4);
+ err = proc_ncpm_mount(mount_name, ".", "ncpfs", flags, (void*)&datav4);
if (err) {
err = errno;
/* Mount unsuccesful so we have to kill daemon */
@@ -1395,6 +1395,17 @@ process_connection (const struct ncp_mou
}
#endif /* MOUNT3 */
+static int check_name(const char *name)
+{
+ char *s;
+ for (s = "\n\t\\"; *s; s++) {
+ if (strchr(name, *s)) {
+ return -1;
+ }
+ }
+ return 0;
+}
+
static const struct smntflags {
unsigned int flag;
const char* name;
@@ -1416,6 +1427,9 @@ void add_mnt_entry(char* mount_name, cha
int fd;
FILE* mtab;
+ if (check_name(mount_name) == -1 || check_name(mpnt) == -1)
+ errexit(107, _("Illegal character in mount entry\n"));
+
ment.mnt_fsname = mount_name;
ment.mnt_dir = mpnt;
ment.mnt_type = (char*)"ncpfs";
Index: ncpfs-2.2.6/sutil/ncpmount.c
===================================================================
--- ncpfs-2.2.6.orig/sutil/ncpmount.c
+++ ncpfs-2.2.6/sutil/ncpmount.c
@@ -359,11 +359,17 @@ main(int argc, char *argv[])
usage();
return -1;
}
+
realpath(argv[optind], mount_point);
- if (stat(mount_point, &st) == -1)
+ if (chdir(mount_point))
+ {
+ errexit(31, _("Could not change directory into mount target %s: %s\n"),
+ mount_point, strerror(errno));
+ }
+ if (stat(".", &st) == -1)
{
- errexit(31, _("Could not find mount point %s: %s\n"),
+ errexit(31, _("Mount point %s does not exist: %s\n"),
mount_point, strerror(errno));
}
if (mount_ok(&st) != 0)
Index: ncpfs-2.2.6/sutil/ncpumount.c
===================================================================
--- ncpfs-2.2.6.orig/sutil/ncpumount.c
+++ ncpfs-2.2.6/sutil/ncpumount.c
@@ -61,6 +61,8 @@
#include <ctype.h>
#include <stdarg.h>
#include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
#include <sys/errno.h>
#include <ncp/nwcalls.h>
@@ -70,10 +72,19 @@
#include <mntent.h>
#include <pwd.h>
+#include <sched.h>
+
#include "private/libintl.h"
#define _(X) X
+#ifndef MS_REC
+#define MS_REC 16384
+#endif
+#ifndef MS_SLAVE
+#define MS_SLAVE (1<<19)
+#endif
+
static char *progname;
static int is_ncplogout = 0;
@@ -229,11 +240,188 @@ static int clearMtab (const char* mount_
return err;
}
+
+int ncp_mnt_umount(const char *abs_mnt, const char *rel_mnt)
+{
+ if (umount(rel_mnt) != 0) {
+ eprintf(_("Could not umount %s: %s\n"),
+ abs_mnt, strerror(errno));
+ return -1;
+ }
+ return 0;
+}
+
+
+static int check_is_mount_child(void *p)
+{
+ const char **a = p;
+ const char *last = a[0];
+ const char *mnt = a[1];
+ int res;
+ const char *procmounts = "/proc/mounts";
+ int found;
+ FILE *fp;
+ struct mntent *entp;
+
+ res = mount("", "/", "", MS_SLAVE | MS_REC, NULL);
+ if (res == -1) {
+ eprintf(_("Failed to mark mounts slave: %s\n"),
+ strerror(errno));
+ return 1;
+ }
+
+ res = mount(".", "/tmp", "", MS_BIND | MS_REC, NULL);
+ if (res == -1) {
+ eprintf(_("Failed to bind parent to /tmp: %s\n"),
+ strerror(errno));
+ return 1;
+ }
+
+ fp = setmntent(procmounts, "r");
+ if (fp == NULL) {
+ eprintf(_("Failed to open %s: %s\n"),
+ procmounts, strerror(errno));
+ return 1;
+ }
+
+ found = 0;
+ while ((entp = getmntent(fp)) != NULL) {
+ if (strncmp(entp->mnt_dir, "/tmp/", 5) == 0 &&
+ strcmp(entp->mnt_dir + 5, last) == 0) {
+ found = 1;
+ break;
+ }
+ }
+ endmntent(fp);
+
+ if (!found) {
+ eprintf(_("%s not mounted\n"), mnt);
+ return 1;
+ }
+
+ return 0;
+}
+
+
+static int check_is_mount(const char *last, const char *mnt)
+{
+ char buf[131072];
+ pid_t pid, p;
+ int status;
+ const char *a[2] = { last, mnt };
+
+ pid = clone(check_is_mount_child, buf + 65536, CLONE_NEWNS, (void *) a);
+ if (pid == (pid_t) -1) {
+ eprintf(_("Failed to clone namespace: %s\n"),
+ strerror(errno));
+ return -1;
+ }
+ p = waitpid(pid, &status, __WCLONE);
+ if (p == (pid_t) -1) {
+ eprintf(_("Waitpid failed: %s\n"),
+ strerror(errno));
+ return -1;
+ }
+ if (!WIFEXITED(status)) {
+ eprintf(_("Child terminated abnormally (status %i)\n"),
+ status);
+ return -1;
+ }
+ if (WEXITSTATUS(status) != 0)
+ return -1;
+
+ return 0;
+}
+
+
+static int chdir_to_parent(char *copy, const char **lastp, int *currdir_fd)
+{
+ char *tmp;
+ const char *parent;
+ char buf[PATH_MAX];
+ int res;
+
+ tmp = strrchr(copy, '/');
+ if (tmp == NULL || tmp[1] == '\0') {
+ eprintf(_("Internal error: invalid abs path: <%s>\n"),
+ copy);
+ return -1;
+ }
+ if (tmp != copy) {
+ *tmp = '\0';
+ parent = copy;
+ *lastp = tmp + 1;
+ } else if (tmp[1] != '\0') {
+ *lastp = tmp + 1;
+ parent = "/";
+ } else {
+ *lastp = ".";
+ parent = "/";
+ }
+ *currdir_fd = open(".", O_RDONLY);
+ if (*currdir_fd == -1) {
+ eprintf(_("Failed to open current directory: %s\n"),
+ strerror(errno));
+ return -1;
+ }
+ res = chdir(parent);
+ if (res == -1) {
+ eprintf(_("Failed to chdir to %s: %s\n"),
+ parent, strerror(errno));
+ return -1;
+ }
+ if (getcwd(buf, sizeof(buf)) == NULL) {
+ eprintf(_("Failed to obtain current directory: %s\n"),
+ strerror(errno));
+ return -1;
+ }
+ if (strcmp(buf, parent) != 0) {
+ eprintf(_("Mountpoint moved (%s -> %s)\n"),
+ parent, buf);
+ return -1;
+
+ }
+
+ return 0;
+}
+
+
+static int unmount_ncp(const char *mount_point)
+{
+ int currdir_fd = -1;
+ char *copy;
+ const char *last;
+ int res;
+
+ copy = strdup(mount_point);
+ if (copy == NULL) {
+ eprintf(_("Failed to allocate memory\n"));
+ return -1;
+ }
+ res = chdir_to_parent(copy, &last, &currdir_fd);
+ if (res == -1)
+ goto out;
+ res = check_is_mount(last, mount_point);
+ if (res == -1)
+ goto out;
+ res = ncp_mnt_umount(mount_point, last);
+
+out:
+ free(copy);
+ if (currdir_fd != -1) {
+ fchdir(currdir_fd);
+ close(currdir_fd);
+ }
+
+ return res;
+}
+
static int
do_umount(const char *mount_point)
{
int fid = open(mount_point, O_RDONLY, 0);
uid_t mount_uid;
+ int res;
if (fid == -1) {
eprintf(_("Could not open %s: %s\n"),
@@ -253,12 +441,8 @@ do_umount(const char *mount_point)
return -1;
}
close(fid);
- if (umount(mount_point) != 0) {
- eprintf(_("Could not umount %s: %s\n"),
- mount_point, strerror(errno));
- return -1;
- }
- return 0;
+ res = unmount_ncp(mount_point);
+ return res;
}

View File

@@ -0,0 +1,45 @@
--- a/lib/nwnet.c
+++ b/lib/nwnet.c
@@ -212,6 +212,15 @@
char *o;
size_t ol;
int ret;
+
+ if (inp == NULL || inl == NULL || outp == NULL || outl == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+ if (*inp == NULL || *outp == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
ret = 0;
ol = *outl;
@@ -324,6 +333,15 @@
char *o;
size_t ol;
int ret;
+
+ if (inp == NULL || inl == NULL || outp == NULL || outl == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+ if (*inp == NULL || *outp == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
ret = 0;
ol = *outl;
@@ -2303,6 +2321,10 @@
static inline NWDSCCODE NWDSPutAttrVal_DIST_NAME(NWDSContextHandle ctx, Buf_T* buffer,
const NWDSChar* name) {
+ if (name == NULL) {
+ errno = EINVAL;
+ return ERR_NULL_POINTER;
+ }
return NWDSCtxBufDN(ctx, buffer, name);
}

View File

@@ -0,0 +1,286 @@
diff '--color=auto' -uNr ncpfs-2.2.6.orig/sutil/ncplogin.c ncpfs-2.2.6/sutil/ncplogin.c
--- ncpfs-2.2.6.orig/sutil/ncplogin.c 2026-04-20 09:34:55.755759467 +0200
+++ ncpfs-2.2.6/sutil/ncplogin.c 2026-04-20 09:35:09.639058852 +0200
@@ -111,7 +111,6 @@
#include <stdlib.h>
#include <stdarg.h>
#include <sys/mount.h>
-#include <mntent.h>
#include <ncp/kernel/ipx.h>
#include <sys/ioctl.h>
#ifdef CONFIG_NATIVE_UNIX
@@ -935,12 +934,6 @@
}
NWCCCloseConn(conn);
NWDSFreeContext(ctx);
- /* ncpmap, ncplogin must write in /etc/mtab */
- {
- block_sigs();
- add_mnt_entry(mount_name, mount_point, info.flags);
- unblock_sigs();
- }
free(mount_name);
if (info.echo_mnt_pnt) {
printf(_("mounted on:%s\n"),mount_point);
diff '--color=auto' -uNr ncpfs-2.2.6.orig/sutil/ncpm_common.c ncpfs-2.2.6/sutil/ncpm_common.c
--- ncpfs-2.2.6.orig/sutil/ncpm_common.c 2026-04-20 09:34:55.755759467 +0200
+++ ncpfs-2.2.6/sutil/ncpm_common.c 2026-04-20 09:36:33.722507846 +0200
@@ -104,7 +104,6 @@
#include <stdlib.h>
#include <stdarg.h>
#include <sys/mount.h>
-#include <mntent.h>
#include <ncp/kernel/ipx.h>
#include <sys/ioctl.h>
#if MOUNT3
@@ -1423,80 +1422,6 @@
{MS_NODIRATIME, "nodiratime"},
{0, NULL}};
-void add_mnt_entry(char* mount_name, char* mpnt, unsigned long flags) {
- const struct smntflags* sf;
- char mnt_opts[80];
- char* p;
- struct mntent ment;
- int fd;
- FILE* mtab;
- off_t goodoffset;
-
- if (check_name(mount_name) == -1 || check_name(mpnt) == -1)
- errexit(107, _("Illegal character in mount entry\n"));
-
- ment.mnt_fsname = mount_name;
- ment.mnt_dir = mpnt;
- ment.mnt_type = (char*)"ncpfs";
- ment.mnt_opts = mnt_opts;
- ment.mnt_freq = 0;
- ment.mnt_passno = 0;
-
- p = mnt_opts;
- *p++ = 'r';
- *p++ = (flags & MS_RDONLY)?'o':'w';
- for (sf = mntflags; sf->flag; sf++) {
- if (flags & sf->flag) {
- *p++ = ',';
- strcpy(p, sf->name);
- p += strlen(p);
- }
- }
- *p = 0;
-
- if (ncpm_suser()) {
- errexit(91, _("Cannot switch to superuser: %s\n"), strerror(errno));
- }
- if ((fd = open(MOUNTED "~", O_RDWR | O_CREAT | O_EXCL, 0600)) == -1)
- {
- errexit(58, _("Can't get %s~ lock file\n"), MOUNTED);
- }
- close(fd);
-
- if ((mtab = setmntent(MOUNTED, "a+")) == NULL)
- {
- unlink(MOUNTED "~");
- errexit(59, _("Can't open %s\n"), MOUNTED);
- }
- fseek (mtab, 0, SEEK_END);
- goodoffset = ftell(mtab);
- if (addmntent(mtab, &ment) == 1)
- {
- /* restore good state */
- ftruncate(fileno(mtab), goodoffset);
- endmntent(mtab);
- unlink(MOUNTED "~");
- errexit(60, _("Can't write mount entry\n"));
- }
- if (fchmod(fileno(mtab), 0644) == -1)
- {
- /* restore good state */
- ftruncate(fileno(mtab), goodoffset);
- endmntent(mtab);
- unlink(MOUNTED "~");
- errexit(61, _("Can't set perms on %s\n"), MOUNTED);
- }
- endmntent(mtab);
-
- if (unlink(MOUNTED "~") == -1)
- {
- errexit(62, _("Can't remove %s~\n"), MOUNTED);
- }
- if (ncpm_normal()) {
- errexit(90, _("Cannot relinquish superuser rights: %s\n"), strerror(EPERM));
- }
-}
-
static int __proc_option(const struct optinfo* opts, struct ncp_mount_info* info, const char* opt, const char* param) {
const struct optinfo* optr;
diff '--color=auto' -uNr ncpfs-2.2.6.orig/sutil/ncpm_common.h ncpfs-2.2.6/sutil/ncpm_common.h
--- ncpfs-2.2.6.orig/sutil/ncpm_common.h 2026-04-20 09:34:55.755759467 +0200
+++ ncpfs-2.2.6/sutil/ncpm_common.h 2026-04-20 09:35:09.639471098 +0200
@@ -60,7 +60,6 @@
int ncp_mount_specific(struct ncp_conn* conn, int pathNS, const unsigned char* NWpath, int pathlen);
int mount_ok(struct stat *st);
void mycom_err(int, const char*, ...);
-void add_mnt_entry(char* mount_name, char* mpoint, unsigned long flags);
struct ncp_mount_info {
struct ncp_mount_data_independent mdata;
diff '--color=auto' -uNr ncpfs-2.2.6.orig/sutil/ncpmount.c ncpfs-2.2.6/sutil/ncpmount.c
--- ncpfs-2.2.6.orig/sutil/ncpmount.c 2026-04-20 09:34:55.755759467 +0200
+++ ncpfs-2.2.6/sutil/ncpmount.c 2026-04-20 09:35:09.639544688 +0200
@@ -114,7 +114,6 @@
#include <stdlib.h>
#include <stdarg.h>
#include <sys/mount.h>
-#include <mntent.h>
#include <ncp/kernel/ipx.h>
#include <ncp/nwclient.h>
#include <sys/ioctl.h>
@@ -719,11 +718,6 @@
}
ncp_close(conn);
- if (!opt_n) {
- block_sigs();
- add_mnt_entry(mount_name, mount_point, info.flags);
- unblock_sigs();
- }
return 0;
}
diff '--color=auto' -uNr ncpfs-2.2.6.orig/sutil/ncpumount.c ncpfs-2.2.6/sutil/ncpumount.c
--- ncpfs-2.2.6.orig/sutil/ncpumount.c 2026-04-20 09:34:55.755759467 +0200
+++ ncpfs-2.2.6/sutil/ncpumount.c 2026-04-20 09:38:20.648618497 +0200
@@ -184,113 +184,6 @@
sigprocmask(SIG_UNBLOCK, &sa.sa_mask, NULL);
}
-static int __clearMtab (const char* mount_points[], unsigned int numEntries) {
-// main logic from ncpumount.c
- struct mntent *mnt;
- FILE *mtab;
- FILE *new_mtab;
-
-#define MOUNTED_TMP MOUNTED".tmp"
-
- if ((mtab = setmntent(MOUNTED, "r")) == NULL){
- eprintf(_("Can't open %s: %s\n"), MOUNTED,
- strerror(errno));
- return 1;
- }
-
- if ((new_mtab = setmntent(MOUNTED_TMP, "w")) == NULL){
- eprintf(_("Can't open %s: %s\n"), MOUNTED_TMP,
- strerror(errno));
- endmntent(mtab);
- return 1;
- }
- while ((mnt = getmntent(mtab)) != NULL) {
- unsigned int i=0;
- int found=0;
-
- while (i<numEntries && !found) {
- found=!strcmp(mnt->mnt_dir, mount_points[i]);
- i++;
- }
- if (!found) {
- if (addmntent(new_mtab, mnt)) {
- eprintf(_("Can't addmntent to %s: %s\n"), MOUNTED_TMP,
- strerror(errno));
- endmntent(mtab);
- return 1;
- }
- }
- }
-
- endmntent(mtab);
-
- if (fchmod(fileno(new_mtab), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) < 0){
- eprintf(_("Error changing mode of %s: %s\n"),
- MOUNTED_TMP, strerror(errno));
- return 1;
- }
- endmntent(new_mtab);
-
- if (rename(MOUNTED_TMP, MOUNTED) < 0){
- eprintf(_("Cannot rename %s to %s: %s\n"),
- MOUNTED, MOUNTED_TMP, strerror(errno));
- return 1;
- }
- return 0;
-}
-
-static int clearMtab (const char* mount_points[], unsigned int numEntries) {
- int fd;
- int err;
- int retries = 10;
-
- if (!numEntries)
- return 0; /* don't waste time ! */
-
- block_sigs();
-
- while ((fd = open(MOUNTED "~", O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) {
- struct timespec tm;
-
- if (errno != EEXIST || retries == 0) {
- unblock_sigs();
- eprintf(_("Can't get %s~ lock file: %s\n"), MOUNTED, strerror(errno));
- return 1;
- }
- fd = open(MOUNTED "~", O_RDWR);
- if (fd != -1) {
- alarm(10);
- err = lockf(fd, F_LOCK, 0);
- alarm(0);
- close(fd);
- if (err) {
- unblock_sigs();
- eprintf(_("Can't lock lock file %s~: %s\n"), MOUNTED, _("Lock timed out"));
- return 1;
- }
- tm.tv_sec = 0;
- tm.tv_nsec = 20000000;
- nanosleep(&tm, NULL);
- }
- retries--;
- }
- alarm(1);
- lockf(fd, F_LOCK, 0);
- alarm(0);
- close(fd);
-
- err = __clearMtab(mount_points, numEntries);
-
- if ((unlink(MOUNTED "~") == -1) && (err == 0)){
- unblock_sigs();
- eprintf(_("Can't remove %s~"), MOUNTED);
- return 1;
- }
- unblock_sigs();
- return err;
-}
-
-
int ncp_mnt_umount(const char *abs_mnt, const char *rel_mnt)
{
if (umount(rel_mnt) != 0) {
@@ -627,10 +520,6 @@
ret = 1;
continue;
}
- if (clearMtab(&mount_point, 1)) {
- ret = 1;
- continue;
- }
}
return ret;
}
@@ -749,7 +638,6 @@
if (serverName || allConns) {
processBindServers(conns,curEntries,serverName,umountTable,&mountEntries);
}
- clearMtab(umountTable, mountEntries);
} else if (treeName) {
eprintf(_("No NCP connections to tree %s.\n"),treeName);
} else if (serverName) {

View File

@@ -0,0 +1,153 @@
diff '--color=auto' -uNr ncpfs-2.2.6.orig/contrib/pam/Makefile.in ncpfs-2.2.6/contrib/pam/Makefile.in
--- ncpfs-2.2.6.orig/contrib/pam/Makefile.in 2026-04-20 08:53:18.696719714 +0200
+++ ncpfs-2.2.6/contrib/pam/Makefile.in 2026-04-20 08:53:35.912413754 +0200
@@ -17,6 +17,7 @@
PAM_OBJECTS = pam_ncp_auth.do support.do
CFLAGS_pam_ncp_auth.do := -DNCPMOUNT_PATH=\"$(bindir)/ncpmount\" -DNCPUMOUNT_PATH=\"$(bindir)/ncpumount\"
+LDFLAGS = @LDFLAGS@
.PHONY : all install install-dev dep clean mrproper distclean
.PHONY : default
@@ -45,7 +46,7 @@
$(PAM_LIBRARY): $(PAM_OBJECTS)
- $(CC) $(CFLAGS) -shared -o $@ $(PAM_OBJECTS) -L$(NCPLIB_DIR) -lncp -lpam ${LIBS}
+ $(CC) $(CFLAGS) -shared $(LDFLAGS) -o $@ $(PAM_OBJECTS) -L$(NCPLIB_DIR) -lncp -lpam ${LIBS}
dep:
diff '--color=auto' -uNr ncpfs-2.2.6.orig/ipx-1.0/Makefile.in ncpfs-2.2.6/ipx-1.0/Makefile.in
--- ncpfs-2.2.6.orig/ipx-1.0/Makefile.in 2026-04-20 08:53:18.706476360 +0200
+++ ncpfs-2.2.6/ipx-1.0/Makefile.in 2026-04-20 08:53:35.912536606 +0200
@@ -9,6 +9,7 @@
vpath %.8 ${this_srcdir}
LIBS = @INTLLIBS@ @LIBS@
+LDFLAGS = @LDFLAGS@
O_UTILS = ipx_configure.o ipx_cmd.o
O_UTIIPX = ipx_interface.o ipx_internal_net.o ipx_route.o
@@ -33,7 +34,7 @@
[ -s $@ ] || rm -f $@
$(UTIIPX): %: %.o ipxutil.o
- $(CC) $(CFLAGS) -o $@ $(addsuffix .o,$@) ipxutil.o ${LIBS}
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(addsuffix .o,$@) ipxutil.o ${LIBS}
$(UTILS): %: %.o
$(CC) $(CFLAGS) -o $@ $(addsuffix .o,$@) ${LIBS}
diff '--color=auto' -uNr ncpfs-2.2.6.orig/ipxdump/Makefile.in ncpfs-2.2.6/ipxdump/Makefile.in
--- ncpfs-2.2.6.orig/ipxdump/Makefile.in 2026-04-20 08:53:18.707193602 +0200
+++ ncpfs-2.2.6/ipxdump/Makefile.in 2026-04-20 08:53:35.912613993 +0200
@@ -11,6 +11,7 @@
OBJECTS= ipxutil.o
ALL_OBJECTS := $(EXEC:%=%.o) $(OBJECTS)
+LDFLAGS = @LDFLAGS@
.PHONY : all install dep clean mrproper distclean
.PHONY : dist tgz
@@ -24,7 +25,7 @@
ifeq ($(ncp_if_ether_support),yes)
$(EXEC): %: %.o $(OBJECTS)
- $(CC) $(CFLAGS) -o $@ $(addsuffix .o,$@) $(OBJECTS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(addsuffix .o,$@) $(OBJECTS)
else
.PHONY ipxdump ipxparse
diff '--color=auto' -uNr ncpfs-2.2.6.orig/lib/Makefile.in ncpfs-2.2.6/lib/Makefile.in
--- ncpfs-2.2.6.orig/lib/Makefile.in 2026-04-20 08:53:18.705915997 +0200
+++ ncpfs-2.2.6/lib/Makefile.in 2026-04-20 08:53:35.912711256 +0200
@@ -24,6 +24,7 @@
PIE_FLAGS := -fpie
PIC_FLAGS := -fPIC
NWCOMPAT := 1
+LDFLAGS := @LDFLAGS@
SHARED_VLINK :=
SHARED_VLINK_CFLAGS :=
@@ -128,7 +129,7 @@
ln -sf $< $@
$(SHARED_NCPLIB_BIN): $(SHARED_O_OBJ) ${this_srcdir}/libncp.vers
- $(CC) -shared -o $@ -Wl,-soname=$(SHARED_NCPLIB_SONAME) $(SHARED_VLINK) $(SHARED_O_OBJ) ${LIBS}
+ $(CC) -shared -o $@ -Wl,-soname=$(SHARED_NCPLIB_SONAME) $(LDFLAGS) $(SHARED_VLINK) $(SHARED_O_OBJ) ${LIBS}
install_static: $(STATIC_NCPLIB_BIN)
$(INSTALL) -d $(DESTDIR)$(libadir)
diff '--color=auto' -uNr ncpfs-2.2.6.orig/Make.rules.in ncpfs-2.2.6/Make.rules.in
--- ncpfs-2.2.6.orig/Make.rules.in 2026-04-20 08:53:18.707387153 +0200
+++ ncpfs-2.2.6/Make.rules.in 2026-04-20 08:53:35.912827011 +0200
@@ -43,6 +43,7 @@
CFLAGS_DEFINES := -DN_PLAT_LINUX -DLOCALEDIR=\"${localedir}\" -DNCPFS_VERSION=\"${VERSION}\" -DNCPFS_PACKAGE=\"${PACKAGE}\"
CCFLAGS := $(CFLAGS_DEFINES) $(CFLAGS_OPTIONS) $(INCLUDES)
+LDFLAGS := @LDFLAGS@
# If your system is ELF, either also do a 'make install', or append the util/
# directory where the dynamic library resides to the environment
diff '--color=auto' -uNr ncpfs-2.2.6.orig/sutil/Makefile.in ncpfs-2.2.6/sutil/Makefile.in
--- ncpfs-2.2.6.orig/sutil/Makefile.in 2026-04-20 08:53:18.703038614 +0200
+++ ncpfs-2.2.6/sutil/Makefile.in 2026-04-20 08:56:37.504553558 +0200
@@ -14,6 +14,7 @@
NDS_SUPPORT = @NDS_SUPPORT@
LIBS = @INTLLIBS@ @LIBICONV@ @LIBS@
+LDFLAGS := @LDFLAGS@
# environ in ncpmount
CCFLAGS += -D_GNU_SOURCE
@@ -73,7 +74,7 @@
ncpmap: ncpm_common.o
ncpmap.o: %.o: ncplogin.c
- $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) $(PIE_CFLAGS) -o $@ -c $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(CCFLAGS) $(CFLAGS_$@) $(PIE_CFLAGS) -o $@ -c $<
ncpmap.d: %.d: ncplogin.c
set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \
@@ -89,7 +90,7 @@
[ -s $@ ] || rm -f $@
$(UTILS): %: %.o ../lib/libncp.$(libext)
- $(CC) @GC_SECTIONS@-o $@ $^ $(PIE_LDFLAGS) ${LIBS}
+ $(CC) @GC_SECTIONS@-o $@ $^ $(LDFLAGS) $(PIE_LDFLAGS) ${LIBS}
../lib/libncp.$(libext):
make -C ../lib libncp.$(libext)
diff '--color=auto' -uNr ncpfs-2.2.6.orig/util/Makefile.in ncpfs-2.2.6/util/Makefile.in
--- ncpfs-2.2.6.orig/util/Makefile.in 2026-04-20 08:53:18.695846760 +0200
+++ ncpfs-2.2.6/util/Makefile.in 2026-04-20 08:57:24.020465257 +0200
@@ -15,6 +15,7 @@
MOUNT2 = @MOUNT2@
LIBS = @INTLLIBS@ @LIBICONV@ @LIBS@
+LDFLAGS = @LDFLAGS@
O_OTHER = dsqueue.o
O_USERUTILS = slist.o pqlist.o nwfsinfo.o pserver.o nprint.o nsend.o \
@@ -81,7 +82,7 @@
make -C $(NCPLIB_DIR) libncp.$(shlibext)
$(O_USERUTILS) $(O_SBINUTILS) $(O_OTHER) ncptest.o: %.o: %.c
- $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
+ $(CC) $(CFLAGS) $(LDFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
%.d: %.c
set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \
@@ -92,10 +93,10 @@
pqstat nwpqjob nprint: dsqueue.o
$(UTILS): %: %.o $(LIBDEP)
- $(CC) $(CFLAGS) -o $@ $(addsuffix .o,$@) $(ADDOBJS_$@) -L$(NCPLIB_DIR) -lncp ${LIBS}
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(addsuffix .o,$@) $(ADDOBJS_$@) -L$(NCPLIB_DIR) -lncp ${LIBS}
ipx_probe: ipx_probe.c
- $(CC) $(CFLAGS) $(CCFLAGS) -o ipx_probe ipx_probe.c ${LIBS}
+ $(CC) $(CFLAGS) $(LDFLAGS) $(CCFLAGS) -o ipx_probe ipx_probe.c ${LIBS}
dep:

View File

@@ -0,0 +1,15 @@
diff '--color=auto' -uNr ncpfs-2.2.6.orig/include/ncp/ncplib.h ncpfs-2.2.6/include/ncp/ncplib.h
--- ncpfs-2.2.6.orig/include/ncp/ncplib.h 2026-04-20 08:16:19.372014966 +0200
+++ ncpfs-2.2.6/include/ncp/ncplib.h 2026-04-20 08:16:31.492427392 +0200
@@ -500,9 +500,9 @@
struct ncp_file_server_info_2 {
#ifdef SWIG
- fixedArray ServerName[49];
+ fixedArray ServerName[50];
#else
- char ServerName[49];
+ char ServerName[50];
#endif
u_int8_t FileServiceVersion;
u_int8_t FileServiceSubVersion;

View File

@@ -0,0 +1,203 @@
Index: ncpfs-2.2.6/sutil/ncplogin.c
===================================================================
--- ncpfs-2.2.6.orig/sutil/ncplogin.c
+++ ncpfs-2.2.6/sutil/ncplogin.c
@@ -934,7 +934,9 @@ ncpipx:;
NWDSFreeContext(ctx);
/* ncpmap, ncplogin must write in /etc/mtab */
{
+ block_sigs();
add_mnt_entry(mount_name, mount_point, info.flags);
+ unblock_sigs();
}
free(mount_name);
if (info.echo_mnt_pnt) {
Index: ncpfs-2.2.6/sutil/ncpm_common.c
===================================================================
--- ncpfs-2.2.6.orig/sutil/ncpm_common.c
+++ ncpfs-2.2.6/sutil/ncpm_common.c
@@ -360,7 +360,7 @@ void verify_argv(int argc, char* argv[])
#endif
static inline int ncpm_suser(void) {
- return setreuid(-1, 0);
+ return setresuid(0, 0, myuid);
}
static int ncpm_normal(void) {
@@ -368,11 +368,31 @@ static int ncpm_normal(void) {
int v;
e = errno;
- v = setreuid(-1, myuid);
+ v = setresuid(myuid, myuid, 0);
errno = e;
return v;
}
+void block_sigs(void) {
+
+ sigset_t mask, orig_mask;
+ sigfillset(&mask);
+
+ if(sigprocmask(SIG_SETMASK, &mask, &orig_mask) < 0) {
+ errexit(-1, _("Blocking signals failed.\n"));
+ }
+}
+
+void unblock_sigs(void) {
+
+ sigset_t mask, orig_mask;
+ sigemptyset(&mask);
+
+ if (sigprocmask(SIG_SETMASK, &mask, &orig_mask) < 0) {
+ errexit(-1, _("Un-blocking signals failed.\n"));
+ }
+}
+
static int proc_ncpm_mount(const char* source, const char* target, const char* filesystem, unsigned long mountflags, const void* data) {
int v;
int e;
Index: ncpfs-2.2.6/sutil/ncpm_common.h
===================================================================
--- ncpfs-2.2.6.orig/sutil/ncpm_common.h
+++ ncpfs-2.2.6/sutil/ncpm_common.h
@@ -121,6 +121,9 @@ int proc_buildconn(struct ncp_mount_info
int proc_aftermount(const struct ncp_mount_info* info, NWCONN_HANDLE* conn);
int proc_ncpm_umount(const char* dir);
+void block_sigs(void);
+void unblock_sigs(void);
+
#define UNUSED(x) x __attribute__((unused))
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
Index: ncpfs-2.2.6/sutil/ncpmount.c
===================================================================
--- ncpfs-2.2.6.orig/sutil/ncpmount.c
+++ ncpfs-2.2.6/sutil/ncpmount.c
@@ -720,7 +720,9 @@ ncpipx:;
ncp_close(conn);
if (!opt_n) {
+ block_sigs();
add_mnt_entry(mount_name, mount_point, info.flags);
+ unblock_sigs();
}
return 0;
}
Index: ncpfs-2.2.6/sutil/ncpumount.c
===================================================================
--- ncpfs-2.2.6.orig/sutil/ncpumount.c
+++ ncpfs-2.2.6/sutil/ncpumount.c
@@ -86,6 +86,8 @@
static char *progname;
static int is_ncplogout = 0;
+uid_t uid;
+
static void
usage(void)
{
@@ -126,6 +128,40 @@ static void eprintf(const char* message,
va_end(ap);
}
+/* Mostly copied from ncpm_common.c */
+void block_sigs(void) {
+
+ sigset_t mask, orig_mask;
+ sigfillset(&mask);
+ sigdelset(&mask, SIGALRM); /* Need SIGALRM for ncpumount */
+
+ if(setresuid(0, 0, uid) < 0) {
+ eprintf("Failed to raise privileges.\n");
+ exit(-1);
+ }
+
+ if(sigprocmask(SIG_SETMASK, &mask, &orig_mask) < 0) {
+ eprintf("Blocking signals failed.\n");
+ exit(-1);
+ }
+}
+
+void unblock_sigs(void) {
+
+ sigset_t mask, orig_mask;
+ sigemptyset(&mask);
+
+ if(setresuid(uid, uid, 0) < 0) {
+ eprintf("Failed to drop privileges.\n");
+ exit(-1);
+ }
+
+ if(sigprocmask(SIG_SETMASK, &mask, &orig_mask) < 0) {
+ eprintf("Un-blocking signals failed.\n");
+ exit(-1);
+ }
+}
+
static void alarmSignal(int sig) {
(void)sig;
}
@@ -201,10 +237,13 @@ static int clearMtab (const char* mount_
if (!numEntries)
return 0; /* don't waste time ! */
+ block_sigs();
+
while ((fd = open(MOUNTED "~", O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) {
struct timespec tm;
if (errno != EEXIST || retries == 0) {
+ unblock_sigs();
eprintf(_("Can't get %s~ lock file: %s\n"), MOUNTED, strerror(errno));
return 1;
}
@@ -215,6 +254,7 @@ static int clearMtab (const char* mount_
alarm(0);
close(fd);
if (err) {
+ unblock_sigs();
eprintf(_("Can't lock lock file %s~: %s\n"), MOUNTED, _("Lock timed out"));
return 1;
}
@@ -232,9 +272,11 @@ static int clearMtab (const char* mount_
err = __clearMtab(mount_points, numEntries);
if ((unlink(MOUNTED "~") == -1) && (err == 0)){
+ unblock_sigs();
eprintf(_("Can't remove %s~"), MOUNTED);
return 1;
}
+ unblock_sigs();
return err;
}
@@ -422,13 +464,13 @@ do_umount(const char *mount_point)
int res;
if (fid == -1) {
- eprintf(_("Could not open %s: %s\n"),
- mount_point, strerror(errno));
+ eprintf(_("Invalid or unauthorized mountpoint %s\n"),
+ mount_point);
return -1;
}
if (ncp_get_mount_uid(fid, &mount_uid) != 0) {
close(fid);
- eprintf(_("%s probably not ncp-filesystem\n"),
+ eprintf(_("Invalid or unauthorized mountpoint %s\n"),
mount_point);
return -1;
}
@@ -591,7 +633,8 @@ main(int argc, char *argv[])
int allConns = 0;
const char *serverName = NULL;
const char *treeName = NULL;
- uid_t uid = getuid();
+
+ uid = getuid();
progname = strrchr(argv[0], '/');
if (progname) {

View File

@@ -0,0 +1,21 @@
changeset: 403:08f41478a208
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Apr 10 10:36:35 2005 +0000
files: man/ncpmount.8
description:
Change charset from iso-8859-1 to iso8859-1 in ncpmount manpage.
diff -r 722e35906cab -r 08f41478a208 man/ncpmount.8
--- a/man/ncpmount.8 Thu Jan 27 16:35:36 2005 +0000
+++ b/man/ncpmount.8 Sun Apr 10 10:36:35 2005 +0000
@@ -282,7 +282,7 @@ You can specify character translation ru
You can specify character translation rules for converting names from
unicode to your desktop (it works together with \fB-p\fP).
.I iocharset
-is charset name, for example \fIiso-8859-1\fP.
+is charset name, for example \fIiso8859-1\fP.
.RE
.B -p

View File

@@ -0,0 +1,691 @@
changeset: 404:fc77f4249198
user: Scott Bentley <bentleys@hhangus.com>
date: Wed May 11 20:46:55 2005 +0000
files: BitKeeper/etc/ignore include/ncp/ncplib.h lib/filemgmt.c lib/libncp.vers lib/ltrace/ncplib.conf util/Makefile.in util/nwlistsalvage.c util/nwsalvage.c
description:
Add ncp_ns_scan_salvageable_file2 and ncp_ns_salvage_file to libncp.
Add nwlistsalvage and nwsalvage utilities. By Scott Bentley.
diff -r 08f41478a208 -r fc77f4249198 include/ncp/ncplib.h
--- a/include/ncp/ncplib.h Sun Apr 10 10:36:35 2005 +0000
+++ b/include/ncp/ncplib.h Wed May 11 20:46:55 2005 +0000
@@ -2,6 +2,7 @@
ncplib.h
Copyright (C) 1995, 1996 by Volker Lendecke
Copyright (C) 1997-2001 Petr Vandrovec
+ Copyright (C) 2005 Scott Bentley
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
@@ -51,6 +52,10 @@
1.05 2001, December 12 Hans Grobler <grobh@sun.ac.za>
Added NCP_PERM_ALL, ncp_ns_delete_entry and full NET_ADDRESS_TYPE
definition.
+
+ 1.06 2005, May Scott Bentley
+ Added ncp_ns_scan_salvageable_file2().
+ Added ncp_ns_salvage_file().
*/
@@ -1124,6 +1129,10 @@ ncp_ns_scan_salvageable_file(NWCONN_HAND
const unsigned char* encpath, int pathlen,
struct ncp_deleted_file* finfo,
char* retname, int retname_maxlen);
+
+long
+ncp_ns_salvage_file(NWCONN_HANDLE conn, u_int8_t src_ns, const struct ncp_deleted_file* finfo,
+ const char* newfname);
long
ncp_ns_purge_file(NWCONN_HANDLE conn, const struct ncp_deleted_file* finfo);
@@ -1341,6 +1350,17 @@ struct nw_info_struct3 {
size_t len;
void* data;
};
+
+long
+ncp_ns_scan_salvageable_file2(NWCONN_HANDLE conn, u_int8_t src_ns,
+ int dirstyle, u_int8_t vol_num,
+ u_int32_t dir_base,
+ const unsigned char* encpath, int pathlen,
+ struct ncp_deleted_file* finfo,
+ struct NSI_Change* dinfo,/* Defined above */
+ u_int32_t rim,
+ void* target, size_t sizeoftarget);
+
struct ncp_dos_info_rights {
u_int16_t Grant;
diff -r 08f41478a208 -r fc77f4249198 lib/filemgmt.c
--- a/lib/filemgmt.c Sun Apr 10 10:36:35 2005 +0000
+++ b/lib/filemgmt.c Wed May 11 20:46:55 2005 +0000
@@ -3,6 +3,7 @@
Copyright (C) 1995, 1996 by Volker Lendecke
Copyright (C) 1999-2001 Petr Vandrovec
Copyright (C) 1999 Roumen Petrov
+ Copyright (C) 2005 Scott Bentley
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
@@ -70,6 +71,9 @@
Added NULL parameter checks.
Added checks for legal reply sizes from server.
+ 1.11 2005, May Scott Bentley
+ Added ncp_ns_scan_salvageable_file2.
+ Added ncp_ns_salvage_file.
*/
#include "config.h"
@@ -1698,6 +1702,34 @@ quit:;
memcpy(name, ncp_reply_data(conn, 0x61), namelen);
name[namelen] = 0;
}
+ ncp_unlock_conn(conn);
+ return result;
+}
+
+long
+ncp_ns_salvage_file(struct ncp_conn* conn,
+ u_int8_t src_ns,
+ const struct ncp_deleted_file* finfo,
+ const char* newfname)
+{
+ long result;
+
+ if (!finfo) {
+ return ERR_NULL_POINTER;
+ }
+
+ ncp_init_request(conn);
+ ncp_add_byte(conn, 17); //subfunction: Recover Salvageable File
+ ncp_add_byte(conn, src_ns); //Namespace to use
+ ncp_add_byte(conn, 0); //Reserved
+ ncp_add_dword_lh(conn, finfo->seq);//File id
+ ncp_add_dword_lh(conn, finfo->vol);//Volume id
+ ncp_add_dword_lh(conn, finfo->base);//Directory id
+ ncp_add_pstring(conn, newfname);
+
+ //ncp_add_pstring(conn, newfname);//Not used because it has 255 char limit
+ /* fn: 87 , subfn: 17 */
+ result = ncp_request(conn, 87);
ncp_unlock_conn(conn);
return result;
}
@@ -2514,6 +2546,56 @@ static NWCCODE ncp_ns_extract_file_info(
dest);
}
return NWE_BUFFER_INVALID_LEN;
+}
+
+long
+ncp_ns_scan_salvageable_file2(struct ncp_conn* conn, u_int8_t src_ns,
+ int dirstyle,
+ u_int8_t vol_num, u_int32_t dir_base,
+ const unsigned char *encpath, int pathlen,
+ struct ncp_deleted_file* finfo,
+ struct NSI_Change* dinfo,
+ u_int32_t rim,
+ void *target, size_t sizeoftarget)
+{
+ long result;
+ NWCCODE err;
+
+ ncp_init_request(conn);
+ ncp_add_byte(conn, 0x10);
+ ncp_add_byte(conn, src_ns);
+ ncp_add_byte(conn, 0);
+ ncp_add_dword_lh(conn, rim);
+ ncp_add_dword_lh(conn, finfo->seq);
+ result = ncp_add_handle_path2(conn, vol_num, dir_base, dirstyle, encpath, pathlen);
+ if (result) {
+ ncp_unlock_conn(conn);
+ return result;
+ }
+ result = ncp_request(conn, 0x57);
+ if (result) {
+ ncp_unlock_conn(conn);
+ return result;
+ }
+ if (conn->ncp_reply_size < 0x61) {
+ ncp_unlock_conn(conn);
+ return NWE_INVALID_NCP_PACKET_LENGTH;
+ }
+
+ finfo->seq = ncp_reply_dword_lh(conn, 0x00);
+ finfo->vol = ncp_reply_dword_lh(conn, 0x0C);
+ finfo->base = ncp_reply_dword_lh(conn, 0x10);
+
+ dinfo->Time = ncp_reply_word_lh(conn, 0x04);
+ dinfo->Date = ncp_reply_word_lh(conn, 0x06);
+ dinfo->ID = ncp_reply_dword_hl(conn, 0x08);
+
+ err = ncp_ns_extract_file_info(NULL, rim,
+ ncp_reply_data(conn, 20), conn->ncp_reply_size - 20,
+ target, sizeoftarget);
+
+ ncp_unlock_conn(conn);
+ return result;
}
static const size_t field_sizes[32] = {
diff -r 08f41478a208 -r fc77f4249198 lib/libncp.vers
--- a/lib/libncp.vers Sun Apr 10 10:36:35 2005 +0000
+++ b/lib/libncp.vers Wed May 11 20:46:55 2005 +0000
@@ -617,3 +617,8 @@ NCPFS_2.2.4 {
NCPFS_2.2.4 {
ncp_change_job_position;
};
+
+NCPFS_2.2.7 {
+ ncp_ns_salvage_file;
+ ncp_ns_scan_salvageable_file2;
+};
diff -r 08f41478a208 -r fc77f4249198 lib/ltrace/ncplib.conf
--- a/lib/ltrace/ncplib.conf Sun Apr 10 10:36:35 2005 +0000
+++ b/lib/ltrace/ncplib.conf Wed May 11 20:46:55 2005 +0000
@@ -94,6 +94,8 @@ int ncp_get_effective_dir_rights(addr, a
int ncp_get_effective_dir_rights(addr, addr, addr);
int ncp_add_trustee_set(addr, uint, uint, uint, int, addr);
int ncp_ns_scan_salvageable_file(addr, uint, int, uint, uint, addr, uint, addr, addr, uint);
+int ncp_ns_scan_salvageable_file2(addr, uint, int, uint, uint, addr, int, addr, addr, uint, addr, uint);
+int ncp_ns_salvage_file(addr, uint, addr, addr);
int ncp_ns_purge_file(addr, addr);
int ncp_ns_get_full_name(addr, uint, uint, int, uint, uint, addr, uint, addr, uint);
int ncp_get_conn_type(addr);
diff -r 08f41478a208 -r fc77f4249198 util/Makefile.in
--- a/util/Makefile.in Sun Apr 10 10:36:35 2005 +0000
+++ b/util/Makefile.in Wed May 11 20:46:55 2005 +0000
@@ -22,7 +22,7 @@ O_USERUTILS = slist.o pqlist.o nwfsinfo.
pqstat.o nwpqjob.o nwbpcreate.o nwbprm.o nwbpvalues.o nwbpadd.o \
nwbpset.o nwgrant.o nwrevoke.o nwuserlist.o nwauth.o \
nwfstime.o nwvolinfo.o nwtrustee.o nwdir.o \
- nwfsctrl.o nwpjmv.o
+ nwfsctrl.o nwpjmv.o nwsalvage.o nwlistsalvage.o
O_SBINUTILS =
ifeq ($(USE_KERNEL),1)
O_USERUTILS += ncopy.o nwtrustee2.o nwpurge.o nwrights.o
diff -r 08f41478a208 -r fc77f4249198 util/nwlistsalvage.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/util/nwlistsalvage.c Wed May 11 20:46:55 2005 +0000
@@ -0,0 +1,302 @@
+/*
+ nwlistsalvage.c - Utility to list information about salvageagle files
+ on NetWare volumes
+ Copyright (c) 2005 Scott Bentley
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Revision history:
+
+ 0.00 2005 Scott Bentley
+ Initial revision.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <ncp/nwcalls.h>
+#include <ncp/nwnet.h>
+#include <ncp/eas.h>
+
+#include "private/libintl.h"
+#define _(X) gettext(X)
+
+#ifdef N_PLAT_DOS
+#ifndef NTYPES_H
+typedef unsigned int nuint16;
+#endif
+typedef unsigned long nuint32;
+typedef unsigned int nuint;
+#else
+#endif
+
+static inline size_t my_strftime(char *s, size_t max, const char *fmt, const struct tm *tm) {
+ return strftime(s, max, fmt, tm);
+}
+
+static void doID(NWCONN_HANDLE conn, nuint32 id) {
+ NWCCODE err;
+ char user[MAX_DN_BYTES];
+ nuint16 type;
+
+ if (!id) {
+ printf(_("Nobody"));
+ } else {
+#ifdef N_PLAT_DOS
+ id = ntohl(id);
+#endif
+ err = NWGetObjectName(conn, id, user, &type);
+ if (err) {
+ NWDSContextHandle ctx;
+
+ sprintf(user, _("Unknown:N/A"));
+ err = NWDSCreateContextHandle(&ctx);
+ if (!err) {
+ NWDSAddConnection(ctx, conn);
+ err = NWDSMapIDToName(ctx, conn, id, user);
+ if (err)
+ sprintf(user, _("Unknown:<%s>"), strnwerror(err));
+ NWDSFreeContext(ctx);
+ }
+ } else {
+ switch (type) {
+ case OT_USER: printf(_("User:"));break;
+ case OT_USER_GROUP: printf(_("Group:"));break;
+ case OT_FILE_SERVER:printf(_("FileServer:"));break;
+ default: printf(_("Unknown(%04X):"), type);break;
+ }
+ }
+ printf("%s", user);
+ }
+}
+
+static void dodate(nuint date) {
+ static const time_t zero_time_t = 0;
+ struct tm* tm;
+ char text[100];
+
+ tm = gmtime(&zero_time_t);
+ tm->tm_year = (date>>9)+80;
+ tm->tm_mon = ((date>>5) & 0xF) - 1;
+ tm->tm_mday = date & 0x1F;
+ tm->tm_isdst = 0;
+ my_strftime(text, sizeof(text), "%x", tm);
+ printf("%s", text);
+}
+
+static void dotime(nuint dtime) {
+ static const time_t zero_time_t = 0;
+ struct tm* tm;
+ char text[100];
+
+ tm = gmtime(&zero_time_t);
+ tm->tm_hour = dtime >> 11;
+ tm->tm_min = (dtime >> 5) & 0x3F;
+ tm->tm_sec = (dtime << 1) & 0x3F;
+ tm->tm_isdst = 0;
+ my_strftime(text, sizeof(text), "%X", tm);
+ printf("%s", text);
+}
+
+static void dodatesTimesID(NWCONN_HANDLE conn, nuint dtime, nuint date, nuint32 id) {
+ if (dtime || date) {
+ dodate(date);
+ printf(" ");
+ dotime(dtime);
+ } else {
+ printf("%-17s", _("never"));
+ }
+ if (id) {
+ printf("%10s","");
+ doID(conn, id);
+ }
+ printf("\n");
+}
+
+static void usage(void) {
+ printf(_(
+"usage: nwlistsalvage [options] [directory]\n"
+"\n"
+"-h Print this help text\n"
+"-n <namespace> Namespace for file access.\n"
+" DOS\n"
+" LONG - Default\n"
+" MAC\n"
+" NFS\n"
+" FTAM\n"
+"-v Verbose\n"
+"\n"
+"directory Directory to examine for salvageable files. Default is ./\n"
+"\n"
+));
+}
+
+static int g_verbose = 0;
+static int g_files = 0;
+static int g_nwns = NW_NS_LONG;
+
+static void print_file_info(NWCONN_HANDLE conn, const struct ncp_deleted_file info, const struct NSI_Change deleted, const struct nw_info_struct3* vinfo) {
+ NWCCODE err;
+ struct NSI_Attributes attr;
+ struct NSI_Name name;
+ struct NSI_Modify modify;
+ struct NSI_Change created;
+ const char* type;
+
+ //Get attributes
+ err = ncp_ns_extract_info_field(vinfo,NSIF_ATTRIBUTES,&attr,sizeof(attr));
+ if (err) {
+ printf("Cannot retrieve file attributes: %s\n",strnwerror(err));
+ return;
+ }
+ if (attr.Attributes & A_DIRECTORY) {
+ type = "D";
+ } else {
+ type = "F";
+ }
+
+ //Get name
+ err = ncp_ns_extract_info_field(vinfo,NSIF_NAME,&name,sizeof(name));
+ if (err) {
+ printf(_("Cannot retrieve file name: %s\n"),strnwerror(err));
+ return;
+ }
+
+ // Show standard set of info
+ printf("%2s%s %d %s\n", "", type, info.seq, name.Name);
+
+ // Show verbose info
+ if(g_verbose) {
+ printf("%5sDeleted:\t\t","");
+ dodatesTimesID(conn,deleted.Time,deleted.Date,deleted.ID);
+
+ printf("%5sCreated:\t\t","");
+ err = ncp_ns_extract_info_field(vinfo,NSIF_CREATION,&created,sizeof(created));
+ if (err) {
+ printf(_("Cannot retrieve creation info: %s\n"),strnwerror(err));
+ return;
+ } else {
+ dodatesTimesID(conn,created.Time,created.Date,created.ID);
+ }
+
+ printf("%5sLast Modified:\t","");
+ err = ncp_ns_extract_info_field(vinfo,NSIF_MODIFY,&modify,sizeof(modify));
+ if (err) {
+ printf(_("Cannot retrieve modified info: %s\n"),strnwerror(err));
+ return;
+ } else {
+ dodatesTimesID(conn,modify.Modify.Time,modify.Modify.Date,modify.Modify.ID);
+ }
+ }
+}
+
+static void list_salvageable_files(struct ncp_conn* conn, int volume, u_int32_t directory_id) {
+ struct ncp_deleted_file info;//file info
+ struct nw_info_struct3 vinfo;//verbose file info
+ struct NSI_Change deleted;
+
+ vinfo.len =0;
+ vinfo.data = NULL;
+
+ info.seq = -1;//Initialize the file id to start with first file
+ while (!ncp_ns_scan_salvageable_file2(conn, g_nwns,
+ 1, volume, directory_id, NULL, 0,
+ &info, &deleted,
+ IM_ALL, &vinfo, sizeof(vinfo)
+ )) {
+
+ print_file_info(conn,info,deleted,&vinfo);
+
+ vinfo.len = 0;
+ free(vinfo.data);
+ vinfo.data = NULL;
+
+ g_files++;
+ }
+ printf("\n");
+}
+
+int main(int argc, char* argv[]) {
+ struct NWCCRootEntry root;
+ const char* mount_path;
+ const char* opt_n;
+ struct ncp_conn* conn;
+ int err;
+ int c;
+
+ setlocale(LC_ALL, "");
+ bindtextdomain(NCPFS_PACKAGE, LOCALEDIR);
+ textdomain(NCPFS_PACKAGE);
+
+ while ((c = getopt(argc, argv, "hnv")) != -1) {
+ switch (c) {
+ case '?':
+ case ':':
+ case 'h':usage(); exit(2);
+ case 'n':
+ opt_n = argv[optind++];
+ if (strcasecmp(opt_n, "DOS") == 0) {
+ g_nwns = NW_NS_DOS;
+ } else if (strcasecmp(opt_n, "MAC") == 0) {
+ g_nwns = NW_NS_MAC;
+ } else if (strcasecmp(opt_n, "NFS") == 0) {
+ g_nwns = NW_NS_NFS;
+ } else if (strcasecmp(opt_n, "FTAM") == 0) {
+ g_nwns = NW_NS_FTAM;
+ } else if (strcasecmp(opt_n, "LONG") == 0) {
+ g_nwns = NW_NS_LONG;
+ } else {
+ fprintf(stderr, _("Unrecognized namespace for option '-%c'\n"), c);
+ exit(1);
+ }
+ break;
+ case 'v':g_verbose = 1;
+ break;
+ default: fprintf(stderr, _("Unexpected option `-%c'\n"), c);
+ break;
+ }
+ }
+ if (optind < argc) {
+ mount_path = argv[optind++];
+ } else {
+ mount_path = ".";
+ }
+ err = ncp_open_mount(mount_path, &conn);
+ if (err) {
+ com_err("nwlistsalvage", err, _("in ncp_open_mount"));
+ exit(1);
+ }
+ err = NWCCGetConnInfo(conn, NWCC_INFO_ROOT_ENTRY, sizeof(root), &root);
+ if (err) {
+ com_err("nwlistsalvage", err, _("when retrieving root entry"));
+ ncp_close(conn);
+ return 0;
+ }
+
+ list_salvageable_files(conn, root.volume, root.dirEnt);
+
+ if (!g_files) {
+ printf(_("No salvageable files were found.\n"));
+ } else if (g_files == 1) {
+ printf(_("1 salvageable file was found.\n"));
+ } else {
+ printf(_("%d salvageable files were found.\n"), g_files);
+ }
+
+ ncp_close(conn);
+ return 0;
+}
+
diff -r 08f41478a208 -r fc77f4249198 util/nwsalvage.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/util/nwsalvage.c Wed May 11 20:46:55 2005 +0000
@@ -0,0 +1,171 @@
+/*
+ nwsalvage.c - Utility for salvaging deleted files from NetWare volumes
+ Copyright (c) 2005 Scott Bentley
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Revision history:
+
+ 0.00 2005 Scott Bentley
+ Initial revision.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <ncp/nwcalls.h>
+#include <unistd.h>
+
+#include "private/libintl.h"
+#define _(X) gettext(X)
+
+static void usage(void) {
+ printf(_(
+"usage: nwsalvage [options] directory file_id\n"
+"\n"
+"-h Print this help text.\n"
+"-s Silent mode.\n"
+"-n <namespace> Namespace for accessing files\n"
+" DOS\n"
+" LONG - Default\n"
+" MAC\n"
+" FTAM\n"
+" NFS\n"
+"\n"
+"directory Directory in which salvageable file(s) resides.\n"
+" Default is current directory.\n"
+"\n"
+"file_id The file identified by file_id will be salvaged.\n"
+" Numeric file_id is obtained from nwlistsalvage.\n"
+"\n"
+));
+}
+
+static int g_silent = 0;
+static int g_nwns = NW_NS_LONG;
+
+static void process_salvage(struct ncp_conn* conn, int volume, u_int32_t directory_id, int file_id) {
+ struct ncp_deleted_file info;
+ int found;
+ char dirname[1024];
+ char filename[1024];
+ char name[1024];
+
+ if (!ncp_ns_get_full_name(conn, g_nwns, g_nwns,
+ 1, volume, directory_id, NULL, 0,
+ dirname, sizeof(dirname))) {
+ }
+ strcat(dirname,"/");
+
+ NWCCODE err;
+
+ found = 0;
+ info.seq = -1;
+ while (!ncp_ns_scan_salvageable_file(conn, g_nwns,
+ 1, volume, directory_id, NULL, 0,
+ &info, filename, sizeof(filename))){
+
+ strcpy(name,dirname);
+ strcat(name,filename);
+
+ if (info.seq == file_id) {
+ found++;
+ if ((err = ncp_ns_salvage_file(conn, g_nwns, &info, name)) != 0) {
+ if (!g_silent) {
+ if (err == 0x89FE) {
+ printf(_("%8s%d -- failed (File already exists, or path inaccessible)\n"), "", info.seq);
+ } else {
+ printf(_("%8s%d %s -- failed (%s)\n"), "", info.seq, name, strnwerror(err));
+ }
+ }
+ } else {
+ if (!g_silent) {
+ printf(_("%8s%d %s -- salvaged \n"), "", info.seq, name);
+ }
+ }
+ break;
+ }
+ }
+ if (!found) {
+ printf(_("%8sFile with scan ID '%d' was not found in directory '%s'."), "", file_id, dirname);
+ }
+ printf("\n");
+}
+
+int main(int argc, char* argv[]) {
+ struct NWCCRootEntry root;
+ const char* mount_path;
+ int file_id;
+ struct ncp_conn* conn;
+ int err;
+ int c;
+ char* opt_n;
+
+ setlocale(LC_ALL, "");
+ bindtextdomain(NCPFS_PACKAGE, LOCALEDIR);
+ textdomain(NCPFS_PACKAGE);
+
+ while ((c = getopt(argc, argv, "hsn")) != -1) {
+ switch (c) {
+ case '?':
+ case ':':break;
+ case 'h':usage(); exit(2);
+ case 's':g_silent=1;
+ break;
+ case 'n':
+ opt_n = argv[optind++];
+ if (strcasecmp(opt_n, "DOS") == 0) {
+ g_nwns = NW_NS_DOS;
+ } else if (strcasecmp(opt_n, "MAC") == 0) {
+ g_nwns = NW_NS_MAC;
+ } else if (strcasecmp(opt_n, "NFS") == 0) {
+ g_nwns = NW_NS_NFS;
+ } else if (strcasecmp(opt_n, "FTAM") == 0) {
+ g_nwns = NW_NS_FTAM;
+ } else if (strcasecmp(opt_n, "LONG") == 0) {
+ g_nwns = NW_NS_LONG;
+ } else {
+ fprintf(stderr, _("Unrecognized namespace for option '-%c'\n"), c);
+ exit(1);
+ }
+ break;
+ default: fprintf(stderr, _("Unexpected option `-%c'\n"), c);
+ break;
+ }
+ }
+ if (optind < argc) {
+ mount_path = argv[optind++];
+ file_id = atoi(argv[optind++]);
+ } else {
+ usage();
+ exit(2);
+ }
+ err = ncp_open_mount(mount_path, &conn);
+ if (err) {
+ com_err("nwsalvage", err, _("in ncp_open_mount"));
+ exit(1);
+ }
+ err = NWCCGetConnInfo(conn, NWCC_INFO_ROOT_ENTRY, sizeof(root), &root);
+ if (err) {
+ com_err("nwsalvage", err, _("when retrieving root entry"));
+ ncp_close(conn);
+ return 0;
+ }
+
+ process_salvage(conn, root.volume, root.dirEnt, file_id);
+
+ ncp_close(conn);
+ return 0;
+}
+

View File

@@ -0,0 +1,133 @@
changeset: 405:8aededcd3e6a
user: Scott Bentley <bentleys@hhangus.com>
date: Sun May 22 23:35:00 2005 +0000
files: man/Makefile.in man/nwlistsalvage.1 man/nwsalvage.1
description:
Add nwsalvage and nwlistsalvage manpages.
diff -r fc77f4249198 -r 8aededcd3e6a man/Makefile.in
--- a/man/Makefile.in Wed May 11 20:46:55 2005 +0000
+++ b/man/Makefile.in Sun May 22 23:35:00 2005 +0000
@@ -16,7 +16,8 @@ MAN1 := nprint.1 nsend.1 nwauth.1 nwbols
MAN1 := nprint.1 nsend.1 nwauth.1 nwbols.1 nwboprops.1 nwbpset.1 \
nwbpvalues.1 nwdir.1 nwfsinfo.1 nwfstime.1 nwpasswd.1 nwpurge.1 \
nwrights.1 nwsfind.1 nwtrustee.1 nwuserlist.1 nwvolinfo.1 pqlist.1 \
- nwpqjob.1 pqstat.1 pserver.1 slist.1 nwpjmv.1
+ nwpqjob.1 pqstat.1 pserver.1 slist.1 nwpjmv.1 \
+ nwsalvage.1 nwlistsalvage.1
MAN3 := $(notdir $(wildcard ${this_srcdir}/*.3ncp))
MAN5 := nwclient.5
MAN8 := nwbocreate.8 nwborm.8 nwbpadd.8 nwbpcreate.8 nwbprm.8 nwfsctrl.8 \
diff -r fc77f4249198 -r 8aededcd3e6a man/nwlistsalvage.1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/man/nwlistsalvage.1 Sun May 22 23:35:00 2005 +0000
@@ -0,0 +1,49 @@
+.TH NWLISTSALVAGE 1 11/05/2005 nwlistsalvage nwlistsalvage
+.SH NAME
+nwlistsalvage
+.SH SYNOPSIS
+.B nwlistsalvage
+[ \fB-h\fP ] [ \fB-n\fP \fInamespace\fP ] [ \fB-v\fP ] \fBdirectory\fP
+
+.SH DESCRIPTION
+.B nwlistsalvage
+lists all salvageable files in the specified NetWare directory.
+
+.SH OPTIONS
+
+.B -h
+.RS 3
+Print out a short help text.
+.RE
+
+.B -n
+.RS 3
+Specify a different NetWare file namespace. Possible options include DOS,
+MAC, NFS, FTAM, LONG. Default is LONG.
+.RE
+
+.B -v
+.RS 3
+List verbose file information.
+.RE
+
+.B directory
+.RS 3
+The directory to scan for salvageable files. Current
+working directory is used by default. You have to specify path in
+Linux format, not in NetWare format.
+.RE
+
+.SH EXAMPLES
+
+nwlistsalvage /mnt/NetWare/server/volume/directory/
+
+This example will return the file-type, file-id (see \fBnwsalvage\fP)
+and file-name of all salvageable files found in /mnt/NetWare/server/volume/directory/
+
+.SH AUTHORS
+nwlistsalvage was written by Scott Bentley. See the Changes file of ncpfs
+for other contributors.
+
+.SH SEE ALSO
+nwsalvage
diff -r fc77f4249198 -r 8aededcd3e6a man/nwsalvage.1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/man/nwsalvage.1 Sun May 22 23:35:00 2005 +0000
@@ -0,0 +1,54 @@
+.TH NWSALVAGE 1 11/05/2005 nwsalvage nwsalvage
+.SH NAME
+nwsalvage
+.SH SYNOPSIS
+.B nwsalvage
+[ \fB-h\fP ] [ \fB-s\fP ] [ \fB-n\fP \fInamespace\fP ] [ \fBdirectory\fP ] [ \fBfile_id\fP ]
+
+.SH DESCRIPTION
+.B nwsalvage
+recovers a file from the specified NetWare directory.
+
+.SH OPTIONS
+
+.B -h
+.RS 3
+Print out a short help text.
+.RE
+
+.B -n
+.RS 3
+Specify a different NetWare file namespace. Possible options include DOS,
+MAC, NFS, FTAM, LONG. Default is LONG.
+.RE
+
+.B -s
+.RS 3
+Silent mode
+.RE
+
+.B directory
+.RS 3
+The directory from which the file to be salvaged was deleted. Current
+working directory is used by default. You have to specify path in
+Linux format, not in NetWare format.
+.RE
+
+.B file_id
+.RS 3
+The numeric file identifier specifying the file you want to salvage.
+This number is obtained from \fBnwlistsalvage\fP.
+
+.SH EXAMPLES
+
+nwsalvage /mnt/NetWare/server/volume/directory/ 123456
+
+With this example, the file identified by 123456 deleted from the
+directory /mnt/NetWare/server/volume/directory/ will be recovered.
+
+.SH AUTHORS
+nwsalvage was written by Scott Bentley. See the Changes file of ncpfs
+for other contributors.
+
+.SH SEE ALSO
+nwlistsalvage

View File

@@ -0,0 +1,86 @@
changeset: 406:6af6a89be103
user: Scott Bentley <bentleys@hhangus.com>
date: Sun May 22 23:37:08 2005 +0000
files: util/nwsalvage.c
description:
Do not use absolute path in nwsalvage. Salvage limits filename to
256 characters.
diff -r 8aededcd3e6a -r 6af6a89be103 util/nwsalvage.c
--- a/util/nwsalvage.c Sun May 22 23:35:00 2005 +0000
+++ b/util/nwsalvage.c Sun May 22 23:37:08 2005 +0000
@@ -23,7 +23,6 @@
*/
#include <stdlib.h>
-#include <string.h>
#include <ncp/nwcalls.h>
#include <unistd.h>
@@ -58,15 +57,8 @@ static void process_salvage(struct ncp_c
static void process_salvage(struct ncp_conn* conn, int volume, u_int32_t directory_id, int file_id) {
struct ncp_deleted_file info;
int found;
- char dirname[1024];
- char filename[1024];
- char name[1024];
-
- if (!ncp_ns_get_full_name(conn, g_nwns, g_nwns,
- 1, volume, directory_id, NULL, 0,
- dirname, sizeof(dirname))) {
- }
- strcat(dirname,"/");
+ char oldfilename[256];
+ char newfilename[256];
NWCCODE err;
@@ -74,31 +66,29 @@ static void process_salvage(struct ncp_c
info.seq = -1;
while (!ncp_ns_scan_salvageable_file(conn, g_nwns,
1, volume, directory_id, NULL, 0,
- &info, filename, sizeof(filename))){
-
- strcpy(name,dirname);
- strcat(name,filename);
+ &info, oldfilename, sizeof(oldfilename))) {
if (info.seq == file_id) {
+ strcpy(newfilename, oldfilename);
found++;
- if ((err = ncp_ns_salvage_file(conn, g_nwns, &info, name)) != 0) {
+ if ((err = ncp_ns_salvage_file(conn, g_nwns, &info, newfilename)) != 0) {
if (!g_silent) {
if (err == 0x89FE) {
printf(_("%8s%d -- failed (File already exists, or path inaccessible)\n"), "", info.seq);
} else {
- printf(_("%8s%d %s -- failed (%s)\n"), "", info.seq, name, strnwerror(err));
+ printf(_("%8s%d %s -- failed (%s)\n"), "", info.seq, newfilename, strnwerror(err));
}
}
} else {
if (!g_silent) {
- printf(_("%8s%d %s -- salvaged \n"), "", info.seq, name);
+ printf(_("%8s%d %s -- salvaged \n"), "", info.seq, newfilename);
}
}
break;
}
}
if (!found) {
- printf(_("%8sFile with scan ID '%d' was not found in directory '%s'."), "", file_id, dirname);
+ printf(_("%8sFile with scan ID '%d' was not found."), "", file_id);
}
printf("\n");
}
@@ -121,7 +111,7 @@ int main(int argc, char* argv[]) {
case '?':
case ':':break;
case 'h':usage(); exit(2);
- case 's':g_silent=1;
+ case 's':g_silent = 1;
break;
case 'n':
opt_n = argv[optind++];

View File

@@ -0,0 +1,110 @@
changeset: 407:8a41f32f7288
user: Scott Bentley <bentleys@hhangus.com>
date: Sun May 22 23:50:08 2005 +0000
files: util/nwsalvage.c
description:
Add `-r' option for renaming file while salvaging it.
diff -r 6af6a89be103 -r 8a41f32f7288 util/nwsalvage.c
--- a/util/nwsalvage.c Sun May 22 23:37:08 2005 +0000
+++ b/util/nwsalvage.c Sun May 22 23:50:08 2005 +0000
@@ -35,14 +35,15 @@ static void usage(void) {
"\n"
"-h Print this help text.\n"
"-s Silent mode.\n"
-"-n <namespace> Namespace for accessing files\n"
+"-n <namespace> Namespace for accessing files.\n"
" DOS\n"
" LONG - Default\n"
" MAC\n"
" FTAM\n"
" NFS\n"
+"-r <newname> Rename the salvaged file. 255 chars max."
"\n"
-"directory Directory in which salvageable file(s) resides.\n"
+"directory Directory in which salvageable file resides.\n"
" Default is current directory.\n"
"\n"
"file_id The file identified by file_id will be salvaged.\n"
@@ -52,13 +53,14 @@ static void usage(void) {
}
static int g_silent = 0;
+static int g_rename = 0;
+static char* g_newname;
static int g_nwns = NW_NS_LONG;
static void process_salvage(struct ncp_conn* conn, int volume, u_int32_t directory_id, int file_id) {
struct ncp_deleted_file info;
int found;
- char oldfilename[256];
- char newfilename[256];
+ char filename[256];
NWCCODE err;
@@ -66,22 +68,26 @@ static void process_salvage(struct ncp_c
info.seq = -1;
while (!ncp_ns_scan_salvageable_file(conn, g_nwns,
1, volume, directory_id, NULL, 0,
- &info, oldfilename, sizeof(oldfilename))) {
+ &info, filename, sizeof(filename))) {
if (info.seq == file_id) {
- strcpy(newfilename, oldfilename);
found++;
- if ((err = ncp_ns_salvage_file(conn, g_nwns, &info, newfilename)) != 0) {
+
+ if (g_rename) {
+ strcpy(filename, g_newname);
+ }
+
+ if ((err = ncp_ns_salvage_file(conn, g_nwns, &info, filename)) != 0) {
if (!g_silent) {
if (err == 0x89FE) {
printf(_("%8s%d -- failed (File already exists, or path inaccessible)\n"), "", info.seq);
} else {
- printf(_("%8s%d %s -- failed (%s)\n"), "", info.seq, newfilename, strnwerror(err));
+ printf(_("%8s%d %s -- failed (%s)\n"), "", info.seq, filename, strnwerror(err));
}
}
} else {
if (!g_silent) {
- printf(_("%8s%d %s -- salvaged \n"), "", info.seq, newfilename);
+ printf(_("%8s%d %s -- salvaged \n"), "", info.seq, filename);
}
}
break;
@@ -101,12 +107,13 @@ int main(int argc, char* argv[]) {
int err;
int c;
char* opt_n;
+ char* opt_r;
setlocale(LC_ALL, "");
bindtextdomain(NCPFS_PACKAGE, LOCALEDIR);
textdomain(NCPFS_PACKAGE);
- while ((c = getopt(argc, argv, "hsn")) != -1) {
+ while ((c = getopt(argc, argv, "hsnr")) != -1) {
switch (c) {
case '?':
case ':':break;
@@ -130,6 +137,15 @@ int main(int argc, char* argv[]) {
exit(1);
}
break;
+ case 'r':
+ opt_r = argv[optind++];
+ if (strlen(opt_r) > 255 || strlen(opt_r) < 1) {
+ fprintf(stderr, _("Filename for option '-%c' has invalid length."), c);
+ exit(1);
+ }
+ g_rename = 1;
+ g_newname = opt_r;
+ break;
default: fprintf(stderr, _("Unexpected option `-%c'\n"), c);
break;
}

View File

@@ -0,0 +1,22 @@
changeset: 408:3ad605e1e151
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 13:36:26 2005 +0000
files: contrib/php/php_auth_nds.c
description:
There are no localized strings in php_auth_nds, so no need for
including <libintl.h>.
diff -r 8a41f32f7288 -r 3ad605e1e151 contrib/php/php_auth_nds.c
--- a/contrib/php/php_auth_nds.c Sun May 22 23:50:08 2005 +0000
+++ b/contrib/php/php_auth_nds.c Sat May 28 13:36:26 2005 +0000
@@ -110,8 +110,6 @@ for more examples see /contrib/php/site
#include <wchar.h>
#include <string.h>
#include <syslog.h>
-#include <libintl.h>
-#define _(X) gettext(X)
static int is_member_of_group_bind( char* errstr,NWCONN_HANDLE conn,const char* user,const char* group) {
int err;

View File

@@ -0,0 +1,186 @@
changeset: 409:0cc3f7f08de0
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 13:38:37 2005 +0000
files: mkinstalldirs
description:
New mkinstalldirs.
diff -r 3ad605e1e151 -r 0cc3f7f08de0 mkinstalldirs
--- a/mkinstalldirs Sat May 28 13:36:26 2005 +0000
+++ b/mkinstalldirs Sat May 28 13:38:37 2005 +0000
@@ -1,40 +1,150 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+
+scriptversion=2004-02-15.20
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
-# Public domain
-
-# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage"
+ exit 0
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --version)
+ echo "$0 $scriptversion"
+ exit 0
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
for file
do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
+case $# in
+ 0) exit 0 ;;
+esac
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
+# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error. This is a problem when calling mkinstalldirs
+# from a parallel make. We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+ '')
+ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ test -d ./-p && rmdir ./-p
+ test -d ./--version && rmdir ./--version
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+ test ! -d ./--version; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ else
+ # Clean up after NextStep and OpenStep mkdir.
+ for d in ./-m ./-p ./--version "./$dirmode";
+ do
+ test -d $d && rmdir $d
+ done
+ fi
+ ;;
+esac
- mkdir "$pathcomp" || lasterr=$?
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- fi
- fi
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
- pathcomp="$pathcomp/"
- done
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=""
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
done
exit $errstatus
-# mkinstalldirs ends here
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:

View File

@@ -0,0 +1,55 @@
changeset: 410:4216c218ee44
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 13:40:15 2005 +0000
files: include/ncp/ncplib.h
description:
Prefer off_t over __off_t unless _FILE_OFFSET_BITS=64 is defined. Needed
for building on Darwin.
diff -r 0cc3f7f08de0 -r 4216c218ee44 include/ncp/ncplib.h
--- a/include/ncp/ncplib.h Sat May 28 13:38:37 2005 +0000
+++ b/include/ncp/ncplib.h Sat May 28 13:40:15 2005 +0000
@@ -94,6 +94,13 @@ typedef enum NET_ADDRESS_TYPE {
NT_URL = 13,
NT_COUNT = 14
} NET_ADDRESS_TYPE;
+
+#if !defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64
+typedef off_t ncp_off_t;
+#else
+/* Maintain unchanged ABI - these functions use 32bit off_t... */
+typedef __off_t ncp_off_t;
+#endif
#ifdef SWIG
/* ncp_off64_t is defined to double by Perl interface */
@@ -872,11 +879,11 @@ long
#ifdef SWIG
long
ncp_read(NWCONN_HANDLE conn, const char fileHandle[6],
- __off_t offset, size_t count, char *RETBUFFER_LENPREV);
+ ncp_off_t offset, size_t count, char *RETBUFFER_LENPREV);
long
ncp_write(NWCONN_HANDLE conn, const char fileHandle[6],
- __off_t offset, size_t IGNORE, const char *STRING_LENPREV);
+ ncp_off_t offset, size_t IGNORE, const char *STRING_LENPREV);
long
ncp_copy_file(NWCONN_HANDLE conn,
@@ -889,11 +896,11 @@ long
#else
long
ncp_read(NWCONN_HANDLE conn, const char fileHandle[6],
- __off_t offset, size_t count, char *target);
+ ncp_off_t offset, size_t count, char *target);
long
ncp_write(NWCONN_HANDLE conn, const char fileHandle[6],
- __off_t offset, size_t count, const char *source);
+ ncp_off_t offset, size_t count, const char *source);
NWCCODE ncp_read64(NWCONN_HANDLE conn, const char fileHandle[6],
ncp_off64_t offset, size_t count, void *target, size_t *bytesread);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
changeset: 412:b4b6191b3d97
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 13:46:29 2005 +0000
files: lib/nwclient.c
description:
Define ENOPKG error as ENOSYS if ENOPKG does not exist. Needed for
Darwin.
diff -r e04165992166 -r b4b6191b3d97 lib/nwclient.c
--- a/lib/nwclient.c Sat May 28 13:45:22 2005 +0000
+++ b/lib/nwclient.c Sat May 28 13:46:29 2005 +0000
@@ -88,6 +88,10 @@
#endif
#include <pwd.h>
#include <sys/stat.h>
+
+#ifndef ENOPKG
+#define ENOPKG ENOSYS
+#endif
/*should be in ndslib.h ?*/
#define NWE_BIND_NO_SUCH_PROP NWE_NCP_NOT_SUPPORTED

View File

@@ -0,0 +1,21 @@
changeset: 413:94680aa0251a
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 13:47:31 2005 +0000
files: lib/rdn.c
description:
Do not include <sys/mman.h> in lib/rdn.h. It is not needed there.
diff -r b4b6191b3d97 -r 94680aa0251a lib/rdn.c
--- a/lib/rdn.c Sat May 28 13:46:29 2005 +0000
+++ b/lib/rdn.c Sat May 28 13:47:31 2005 +0000
@@ -30,8 +30,6 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
-
-#include <sys/mman.h>
#include "nwnet_i.h"
#include "ncplib_i.h"

View File

@@ -0,0 +1,52 @@
changeset: 414:5e027b02f28c
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 13:49:58 2005 +0000
files: lib/resolve.c
description:
Properly wrap sockaddr_ipx accesses with NCP_IPX_SUPPORT and sockaddr_in
with NCP_IN_SUPPORT. Needed on IPX-less architectures.
diff -r 94680aa0251a -r 5e027b02f28c lib/resolve.c
--- a/lib/resolve.c Sat May 28 13:47:31 2005 +0000
+++ b/lib/resolve.c Sat May 28 13:49:58 2005 +0000
@@ -875,7 +875,9 @@ NWCCODE ncp_find_server_addr(const char
err = NWCCGetConnInfo(conn, NWCC_INFO_TRAN_ADDR, sizeof(ta), &ta);
if (!err) {
- if (ta.type == NT_IPX) {
+ switch (ta.type) {
+#ifdef NCP_IPX_SUPPORT
+ case NT_IPX: {
struct sockaddr_ipx* ipx = (struct sockaddr_ipx*)addr;
if (len < sizeof(*ipx)) {
@@ -887,7 +889,12 @@ NWCCODE ncp_find_server_addr(const char
memcpy(&ipx->sipx_port, buffer + 10, 2);
ipx->sipx_type = 0x11;
}
- } else if (ta.type == NT_UDP || ta.type == NT_TCP) {
+ break;
+ }
+#endif
+#ifdef NCP_IN_SUPPORT
+ case NT_UDP:
+ case NT_TCP: {
struct sockaddr_in* in = (struct sockaddr_in*)addr;
if (len < sizeof(*in)) {
@@ -897,8 +904,12 @@ NWCCODE ncp_find_server_addr(const char
memcpy(&in->sin_addr.s_addr, buffer + 2, 4);
memcpy(&in->sin_port, buffer, 2);
}
- } else {
+ break;
+ }
+#endif
+ default:
err = EINVAL;
+ break;
}
if (!err) {
err = NWGetFileServerName(conn, sname);

View File

@@ -0,0 +1,90 @@
changeset: 415:005801e1fd28
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 15:07:13 2005 +0000
files: include/private/list.h lib/ncplib.c lib/nwnet.c
description:
Rename LIST_HEAD to NCP_LIST_HEAD. LIST_HEAD exists on Darwin.
diff -r 5e027b02f28c -r 005801e1fd28 include/private/list.h
--- a/include/private/list.h Sat May 28 13:49:58 2005 +0000
+++ b/include/private/list.h Sat May 28 15:07:13 2005 +0000
@@ -16,10 +16,10 @@ struct list_head {
struct list_head *next, *prev;
};
-#define LIST_HEAD(name) \
+#define NCP_LIST_HEAD(name) \
struct list_head name = { &name, &name }
-#define INIT_LIST_HEAD(ptr) do { \
+#define NCP_INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
@@ -64,7 +64,7 @@ static __inline__ void list_del(struct l
static __inline__ void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
- INIT_LIST_HEAD(entry);
+ NCP_INIT_LIST_HEAD(entry);
}
static __inline__ int list_empty(struct list_head *head)
diff -r 5e027b02f28c -r 005801e1fd28 lib/ncplib.c
--- a/lib/ncplib.c Sat May 28 13:49:58 2005 +0000
+++ b/lib/ncplib.c Sat May 28 15:07:13 2005 +0000
@@ -194,7 +194,7 @@ int in_options = 0;
#endif
static ncpt_mutex_t conn_lock = NCPT_MUTEX_INITIALIZER;
-static LIST_HEAD(conn_list);
+static NCP_LIST_HEAD(conn_list);
ncpt_mutex_t nds_ring_lock = NCPT_MUTEX_INITIALIZER;
/* return number of bytes in packet */
@@ -775,9 +775,9 @@ static struct ncp_conn *ncp_alloc_conn(v
memset(conn, 0, sizeof(*conn));
ncpt_atomic_set(&conn->use_count, 1);
ncpt_atomic_set(&conn->store_count, 0);
- INIT_LIST_HEAD(&conn->nds_ring);
+ NCP_INIT_LIST_HEAD(&conn->nds_ring);
// conn->nds_conn = NULL;
- INIT_LIST_HEAD(&conn->conn_ring);
+ NCP_INIT_LIST_HEAD(&conn->conn_ring);
ncpt_mutex_init(&conn->buffer_mutex);
ncpt_mutex_init(&conn->serverInfo.mutex);
// conn->serverInfo.valid = 0;
diff -r 5e027b02f28c -r 005801e1fd28 lib/nwnet.c
--- a/lib/nwnet.c Sat May 28 13:49:58 2005 +0000
+++ b/lib/nwnet.c Sat May 28 15:07:13 2005 +0000
@@ -943,8 +943,8 @@ static NWDSCCODE __NWDSCreateDSConnectio
memset(tmp, 0, sizeof(*tmp));
tmp->dck.tree_name = NULL;
- INIT_LIST_HEAD(&tmp->contexts);
- INIT_LIST_HEAD(&tmp->conns);
+ NCP_INIT_LIST_HEAD(&tmp->contexts);
+ NCP_INIT_LIST_HEAD(&tmp->conns);
*dsh = tmp;
return 0;
}
@@ -1172,7 +1172,7 @@ NWDSCCODE NWDSCreateContextHandle(NWDSCo
return ERR_NOT_ENOUGH_MEMORY;
}
memset(tmp, 0, sizeof(*tmp));
- INIT_LIST_HEAD(&tmp->context_ring);
+ NCP_INIT_LIST_HEAD(&tmp->context_ring);
tmp->dck.flags = DCV_DEREF_ALIASES | DCV_XLATE_STRINGS | DCV_CANONICALIZE_NAMES;
tmp->dck.name_form = 0;
tmp->dck.last_connection.conn = NULL;
@@ -1237,7 +1237,7 @@ NWDSCCODE NWDSDuplicateContextHandleInt(
return ERR_NOT_ENOUGH_MEMORY;
memset(tmp, 0, sizeof(*tmp));
- INIT_LIST_HEAD(&tmp->context_ring);
+ NCP_INIT_LIST_HEAD(&tmp->context_ring);
/* return typed absolute names */
tmp->dck.flags = srcctx->dck.flags & ~(DCV_CANONICALIZE_NAMES | DCV_TYPELESS_NAMES);
tmp->dck.name_form = srcctx->dck.name_form;

View File

@@ -0,0 +1,303 @@
changeset: 416:48879aeab0b6
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 15:42:43 2005 +0000
files: configure.ac lib/ds/filter.c lib/ds/iterhandle.c lib/ds/request.c lib/ds/search.c lib/ds/setkeys.c lib/fs/eas.c lib/fs/filelock.c lib/ncpext.c lib/ncplib.c lib/ncplib_i.h lib/nwcalls.c lib/nwtime.c lib/queue.c lib/rdn.c
description:
Add support for SO_NOSIGPIPE (Darwin) in addition to MSG_NOSIGNAL.
diff -r 005801e1fd28 -r 48879aeab0b6 configure.ac
--- a/configure.ac Sat May 28 15:07:13 2005 +0000
+++ b/configure.ac Sat May 28 15:42:43 2005 +0000
@@ -495,6 +495,38 @@ else
socklen_t="typedef $ncp_cv_socklen_t socklen_t;"
fi
AC_SUBST(socklen_t)
+
+AC_CACHE_CHECK(whether SO_NOSIGPIPE exists,
+ ncp_cv_so_nosigpipe,
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#include <sys/types.h>
+#include <sys/socket.h>]]],
+ [[[int s;
+ int o = 0;
+ s = socket(0, 0, 0);
+ setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, &o, sizeof(o))]]])],
+ [ncp_cv_so_nosigpipe="yes"],
+ [ncp_cv_so_nosigpipe="no"]
+ )
+)
+if test "$ncp_cv_so_nosigpipe" = "yes"
+then
+ AC_DEFINE(HAVE_SO_NOSIGPIPE, 1, [Define when SO_NOSIGPIPE exists])
+fi
+
+AC_CACHE_CHECK(whether MSG_NOSIGNAL exists,
+ ncp_cv_msg_nosignal,
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#include <sys/types.h>
+#include <sys/socket.h>
+struct msghdr msg;]]],
+ [[[sendmsg(0, &msg, MSG_NOSIGNAL)]]])],
+ [ncp_cv_msg_nosignal="yes"],
+ [ncp_cv_msg_nosignal="no"]
+ )
+)
+if test "$ncp_cv_msg_nosignal" = "yes"
+then
+ AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Define when MSG_NOSIGNAL exists])
+fi
dnl UNICODE
AC_CHECK_TYPE([wchar_t], , [AC_DEFINE([wchar_t], [unsigned int], [Define to 'unsigned int' if wchar_t is not defined.])])
diff -r 005801e1fd28 -r 48879aeab0b6 lib/ds/filter.c
--- a/lib/ds/filter.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/ds/filter.c Sat May 28 15:42:43 2005 +0000
@@ -26,6 +26,8 @@
Fix coredumps, endless loops and so on in NWDSPutFilter.
*/
+
+#include "config.h"
#include <stddef.h>
#include <stdlib.h>
diff -r 005801e1fd28 -r 48879aeab0b6 lib/ds/iterhandle.c
--- a/lib/ds/iterhandle.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/ds/iterhandle.c Sat May 28 15:42:43 2005 +0000
@@ -22,6 +22,8 @@
Initial release.
*/
+
+#include "config.h"
#include "iterhandle.h"
diff -r 005801e1fd28 -r 48879aeab0b6 lib/ds/request.c
--- a/lib/ds/request.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/ds/request.c Sat May 28 15:42:43 2005 +0000
@@ -22,6 +22,8 @@
Initial release
*/
+
+#include "config.h"
#include <stddef.h>
#include <stdlib.h>
diff -r 005801e1fd28 -r 48879aeab0b6 lib/ds/search.c
--- a/lib/ds/search.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/ds/search.c Sat May 28 15:42:43 2005 +0000
@@ -32,6 +32,8 @@
to NWDSSearch.
*/
+
+#include "config.h"
#include <stddef.h>
#include <stdlib.h>
diff -r 005801e1fd28 -r 48879aeab0b6 lib/ds/setkeys.c
--- a/lib/ds/setkeys.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/ds/setkeys.c Sat May 28 15:42:43 2005 +0000
@@ -35,6 +35,8 @@
Modified nds_login to use unaliased name in NWDSSetKeys.
*/
+
+#include "config.h"
#include <stddef.h>
#include <stdlib.h>
diff -r 005801e1fd28 -r 48879aeab0b6 lib/fs/eas.c
--- a/lib/fs/eas.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/fs/eas.c Sat May 28 15:42:43 2005 +0000
@@ -23,6 +23,7 @@
*/
+#include "config.h"
#include <ncp/eas.h>
#include "ncplib_i.h"
diff -r 005801e1fd28 -r 48879aeab0b6 lib/fs/filelock.c
--- a/lib/fs/filelock.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/fs/filelock.c Sat May 28 15:42:43 2005 +0000
@@ -23,6 +23,7 @@
*/
+#include "config.h"
#include "ncplib_i.h"
#include <ncp/nwnet.h>
diff -r 005801e1fd28 -r 48879aeab0b6 lib/ncpext.c
--- a/lib/ncpext.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/ncpext.c Sat May 28 15:42:43 2005 +0000
@@ -22,6 +22,8 @@
Initial version.
*/
+
+#include "config.h"
#include <ncp/nwcalls.h>
#include <ncp/nwnet.h>
diff -r 005801e1fd28 -r 48879aeab0b6 lib/ncplib.c
--- a/lib/ncplib.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/ncplib.c Sat May 28 15:42:43 2005 +0000
@@ -460,6 +460,18 @@ restart:
return 0;
}
+int
+ncp_fd_nosigpipe(UNUSED(int fd))
+{
+#ifdef HAVE_SO_NOSIGPIPE
+ static const int one = 1;
+
+ return setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(one));
+#else
+ return 0;
+#endif
+}
+
#ifdef CONFIG_NATIVE_IPX
static int
exec_nwsfind(const char* request[]) {
@@ -521,8 +533,11 @@ ipx_make_reachable_rip(const struct sock
memset(&rip, 0, sizeof(rip));
sock = socket(PF_IPX, SOCK_DGRAM, IPXPROTO_IPX);
-
if (sock == -1) {
+ return errno;
+ }
+ if (ncp_fd_nosigpipe(sock)) {
+ close(sock);
return errno;
}
opt = 1;
@@ -1291,7 +1306,16 @@ ncp_connect_ipx_addr(struct ncp_conn *co
if ((ncp_sock = socket(PF_IPX, SOCK_DGRAM, IPXPROTO_IPX)) == -1) {
return errno;
}
+ if (ncp_fd_nosigpipe(ncp_sock)) {
+ close(ncp_sock);
+ return errno;
+ }
if ((wdog_sock = socket(PF_IPX, SOCK_DGRAM, IPXPROTO_IPX)) == -1) {
+ close(ncp_sock);
+ return errno;
+ }
+ if (ncp_fd_nosigpipe(wdog_sock)) {
+ close(wdog_sock);
close(ncp_sock);
return errno;
}
@@ -1385,6 +1409,10 @@ ncp_connect_in_addr(struct ncp_conn *con
if ((ncp_sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
return errno;
}
+ if (ncp_fd_nosigpipe(ncp_sock)) {
+ close(ncp_sock);
+ return errno;
+ }
addr.sin_family = AF_INET;
addr.sin_port = htons(0x0);
addr.sin_addr.s_addr = INADDR_ANY;
@@ -1444,6 +1472,10 @@ ncp_connect_tcp_addr(struct ncp_conn *co
if ((ncp_sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
return errno;
}
+ if (ncp_fd_nosigpipe(ncp_sock)) {
+ close(ncp_sock);
+ return errno;
+ }
addr.sin_family = AF_INET;
addr.sin_port = htons(0x0);
addr.sin_addr.s_addr = INADDR_ANY;
@@ -1503,6 +1535,10 @@ ncp_connect_un_addr(struct ncp_conn *con
conn->verbose = 0;
if ((fd = socket(PF_UNIX, SOCK_DGRAM, 0)) == -1) {
+ return errno;
+ }
+ if (ncp_fd_nosigpipe(fd)) {
+ close(fd);
return errno;
}
addr.sun_family = AF_UNIX;
diff -r 005801e1fd28 -r 48879aeab0b6 lib/ncplib_i.h
--- a/lib/ncplib_i.h Sat May 28 15:07:13 2005 +0000
+++ b/lib/ncplib_i.h Sat May 28 15:42:43 2005 +0000
@@ -62,6 +62,10 @@ extern "C" {
#include "private/ncp_fs.h"
#include <string.h>
+
+#ifndef HAVE_MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0
+#endif
#define UNUSED(x) x __attribute__((unused))
@@ -328,6 +332,8 @@ static inline NWCCODE x_recv(int sock, v
NWCCODE __NWReadFileServerInfo(struct ncp_conn* conn);
+int ncp_fd_nosigpipe(int fd);
+
#ifdef __cplusplus
}
#endif
diff -r 005801e1fd28 -r 48879aeab0b6 lib/nwcalls.c
--- a/lib/nwcalls.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/nwcalls.c Sat May 28 15:42:43 2005 +0000
@@ -343,6 +343,10 @@ retryLoop:;
}
fd = socket(PF_UNIX, SOCK_STREAM, 0);
if (fd < 0) {
+ goto errquit;
+ }
+ if (ncp_fd_nosigpipe(fd)) {
+ close(fd);
goto errquit;
}
sunlen = offsetof(struct sockaddr_un, sun_path) + sprintf(sun.sun_path, "%cncpfs.permanent.mount.%lu", 0,
diff -r 005801e1fd28 -r 48879aeab0b6 lib/nwtime.c
--- a/lib/nwtime.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/nwtime.c Sat May 28 15:42:43 2005 +0000
@@ -22,6 +22,8 @@
Initial version - NWGetFileServerUTCTime moved from nwcalls.c.
*/
+
+#include "config.h"
#include <errno.h>
#include <string.h>
diff -r 005801e1fd28 -r 48879aeab0b6 lib/queue.c
--- a/lib/queue.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/queue.c Sat May 28 15:42:43 2005 +0000
@@ -29,6 +29,8 @@
1.00 1999, November 20 Petr Vandrovec <vandrove@vc.cvut.cz>
Added license.
*/
+
+#include "config.h"
#include "ncplib_i.h"
diff -r 005801e1fd28 -r 48879aeab0b6 lib/rdn.c
--- a/lib/rdn.c Sat May 28 15:07:13 2005 +0000
+++ b/lib/rdn.c Sat May 28 15:42:43 2005 +0000
@@ -25,6 +25,8 @@
DN length check in __NWDSExtractRDN and NWDSRemoveAllTypesW
*/
+
+#include "config.h"
#include <stddef.h>
#include <stdlib.h>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,33 @@
changeset: 419:56ca340a8425
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 18:48:12 2005 +0000
files: sutil/Makefile.in util/Makefile.in
description:
Link utils with LIBICONV in addition to INTLLIBS...
diff -r 9bf8cc97936c -r 56ca340a8425 sutil/Makefile.in
--- a/sutil/Makefile.in Sat May 28 15:48:03 2005 +0000
+++ b/sutil/Makefile.in Sat May 28 18:48:12 2005 +0000
@@ -13,7 +13,7 @@ USE_KERNEL = @USE_KERNEL@
USE_KERNEL = @USE_KERNEL@
NDS_SUPPORT = @NDS_SUPPORT@
-LIBS = @INTLLIBS@ @LIBS@
+LIBS = @INTLLIBS@ @LIBICONV@ @LIBS@
# environ in ncpmount
CCFLAGS += -D_GNU_SOURCE
diff -r 9bf8cc97936c -r 56ca340a8425 util/Makefile.in
--- a/util/Makefile.in Sat May 28 15:48:03 2005 +0000
+++ b/util/Makefile.in Sat May 28 18:48:12 2005 +0000
@@ -14,7 +14,7 @@ NDS_SUPPORT = @NDS_SUPPORT@
NDS_SUPPORT = @NDS_SUPPORT@
MOUNT2 = @MOUNT2@
-LIBS = @INTLLIBS@ @LIBS@
+LIBS = @INTLLIBS@ @LIBICONV@ @LIBS@
O_OTHER = dsqueue.o
O_USERUTILS = slist.o pqlist.o nwfsinfo.o pserver.o nprint.o nsend.o \

View File

@@ -0,0 +1,44 @@
changeset: 420:c7f1c54278c9
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 18:54:50 2005 +0000
files: sutil/Makefile.in
description:
Fix build failure while building with --disable-kernel.
diff -r 56ca340a8425 -r c7f1c54278c9 sutil/Makefile.in
--- a/sutil/Makefile.in Sat May 28 18:48:12 2005 +0000
+++ b/sutil/Makefile.in Sat May 28 18:54:50 2005 +0000
@@ -36,9 +36,6 @@ CFLAGS_ncpmap.o = -DNCPMAP=1 -DMAKE_NCPL
CFLAGS_ncpmap.o = -DNCPMAP=1 -DMAKE_NCPLIB
CFLAGS_ncplogin.o = -DMAKE_NCPLIB
CFLAGS_ncpm_common.o = -DNWMSG=\"$(sbindir)/nwmsg\"
-LDFLAGS_ncpmount = ncpm_common.o mount_login.o
-LDFLAGS_ncplogin = ncpm_common.o mount_login.o
-LDFLAGS_ncpmap = ncpm_common.o
.PHONY : all install install-dev dep clean mrproper distclean
.PHONY : default
@@ -68,6 +65,10 @@ install-dev:
| sed 's,\($*\)\.o[ :]*,\1.o \1.do \1.to $@ : ,g' > $@; \
[ -s $@ ] || rm -f $@
+ncpmount: ncpm_common.o mount_login.o
+ncplogin: ncpm_common.o mount_login.o
+ncpmap: ncpm_common.o
+
ncpmap.o: %.o: ncplogin.c
$(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
@@ -84,8 +85,8 @@ ncpm_common.d mount_login.d: %.d: %.c
| sed 's,\($*\)\.o[ :]*,\1.o \1.do \1.to $@ : ,g' > $@; \
[ -s $@ ] || rm -f $@
-$(UTILS): %: %.o ../lib/libncp.a ncpm_common.o mount_login.o
- $(CC) @GC_SECTIONS@-o $@ $(addsuffix .o,$@) $(LDFLAGS_$@) ../lib/libncp.a ${LIBS}
+$(UTILS): %: %.o ../lib/libncp.a
+ $(CC) @GC_SECTIONS@-o $@ $^ ${LIBS}
../lib/libncp.a:
make -C ../lib libncp.a

View File

@@ -0,0 +1,31 @@
changeset: 421:50351d213ba9
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 18:57:50 2005 +0000
files: Make.rules.in lib/Makefile.in
description:
Perform ranlib on static library after build.
diff -r c7f1c54278c9 -r 50351d213ba9 Make.rules.in
--- a/Make.rules.in Sat May 28 18:54:50 2005 +0000
+++ b/Make.rules.in Sat May 28 18:57:50 2005 +0000
@@ -2,6 +2,7 @@ INSTALL := @INSTALL@
INSTALL := @INSTALL@
INSTALL_DATA := @INSTALL_DATA@
CC := @CC@
+RANLIB := @RANLIB@
prefix := @prefix@
exec_prefix := @exec_prefix@
diff -r c7f1c54278c9 -r 50351d213ba9 lib/Makefile.in
--- a/lib/Makefile.in Sat May 28 18:54:50 2005 +0000
+++ b/lib/Makefile.in Sat May 28 18:57:50 2005 +0000
@@ -130,6 +130,7 @@ install_static: $(STATIC_NCPLIB_BIN)
$(STATIC_NCPLIB): $(STATIC_O_OBJ)
ar r $@ $(STATIC_O_OBJ)
+ $(RANLIB) $@
ifeq ($(NEED_DEP),yes)
include $(STATIC_O_OBJ:.o=.d)

View File

@@ -0,0 +1,196 @@
changeset: 422:bda42d4b9cf1
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 19:21:17 2005 +0000
files: Make.rules.in Makefile.in configure configure.ac contrib/tcl-utils/Makefile.in contrib/tknwmsg/Makefile.in lib/Makefile.in util/Makefile.in
description:
Add support for disabling build of shared library with --disable-shared.
diff -r 50351d213ba9 -r bda42d4b9cf1 Make.rules.in
--- a/Make.rules.in Sat May 28 18:57:50 2005 +0000
+++ b/Make.rules.in Sat May 28 19:21:17 2005 +0000
@@ -48,6 +48,7 @@ CCFLAGS := $(CFLAGS_DEFINES) $(CFLAGS_OP
# directory where the dynamic library resides to the environment
# variable LD_LIBRARY_PATH
HAVE_ELF := @ELF_TARGET@
+BUILD_SHARED := @BUILD_SHARED@
VERSION_SOLIB := 2.3.0
VERSION_SONAME := 2.3
diff -r 50351d213ba9 -r bda42d4b9cf1 Makefile.in
--- a/Makefile.in Sat May 28 18:57:50 2005 +0000
+++ b/Makefile.in Sat May 28 19:21:17 2005 +0000
@@ -19,11 +19,11 @@ CLEAN_SUBDIRS := lib sutil util man intl
contrib/testing/pp contrib/tests contrib/libtrace contrib/nss64 \
contrib/tcl-utils contrib/php contrib/pam
-export INCLUDES VERSION HAVE_ELF CFLAGS
+export INCLUDES VERSION BUILD_SHARED CFLAGS
all:
set -e; for i in $(EXECSUBDIRS); do make -C $$i all; done
- @if [ "$(HAVE_ELF)" = yes ] ;\
+ @if [ "$(BUILD_SHARED)" = yes ] ;\
then \
echo ; echo ; echo ;\
echo Please add \'`pwd`/lib\' to the environment ; \
diff -r 50351d213ba9 -r bda42d4b9cf1 configure
--- a/configure Sat May 28 18:57:50 2005 +0000
+++ b/configure Sat May 28 19:21:17 2005 +0000
@@ -313,7 +313,7 @@ ac_includes_default="\
#endif"
ac_subdirs_all="$ac_subdirs_all contrib/php"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC_WARNINGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S PACKAGE VERSION MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CPP EGREP GLIBC2 RANLIB ac_ct_RANLIB ALLOCA GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB localedir ncp_ipx_headers_1 ncp_ipx_headers_2 ncp_ipx_defsiocprotoprivate ncp_ipx_defsiocaipx ncp_sys_mount_h ncp_linux_fs_h ncp_net_if_h ncp_net_route_h ncp_if_ether_support ncp_sys_select_h stdint_types socklen_t wchar_h LIB_PAM_SECURITY php_found REENTRANT_CFLAGS ncphost ELF_TARGET VERSIONED_LINK ncp_in_support ncp_ipx_support NDS_SUPPORT SIGNATURES MOUNT2 MOUNT3 USE_KERNEL ADDON_SUBDIRS ADDON_DEV_SUBDIRS FFUNCTION_SECTIONS GC_SECTIONS subdirs LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC_WARNINGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S PACKAGE VERSION MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CPP EGREP GLIBC2 RANLIB ac_ct_RANLIB ALLOCA GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB localedir ncp_ipx_headers_1 ncp_ipx_headers_2 ncp_ipx_defsiocprotoprivate ncp_ipx_defsiocaipx ncp_sys_mount_h ncp_linux_fs_h ncp_net_if_h ncp_net_route_h ncp_if_ether_support ncp_sys_select_h stdint_types socklen_t wchar_h LIB_PAM_SECURITY php_found REENTRANT_CFLAGS ncphost ELF_TARGET VERSIONED_LINK ncp_in_support ncp_ipx_support NDS_SUPPORT SIGNATURES MOUNT2 MOUNT3 USE_KERNEL ADDON_SUBDIRS ADDON_DEV_SUBDIRS FFUNCTION_SECTIONS GC_SECTIONS BUILD_SHARED subdirs LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -864,6 +864,7 @@ Optional Features:
--disable-reentrant do not compile threading support into library
--disable-versions do not use version symbols in library
--disable-function-sections do not use -ffunction-sections for static libraries
+ --disable-shared disable build/use of shared libncp
--enable-trace enable trace of ncp calls
--enable-ncp-debug enable builtin debugging support
--disable-nls do not use Native Language Support
@@ -1432,6 +1433,12 @@ fi;
# Check whether --enable-function_sections or --disable-function_sections was given.
if test "${enable_function_sections+set}" = set; then
enableval="$enable_function_sections"
+
+fi;
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
fi;
@@ -14049,6 +14056,16 @@ ELF_TARGET="$ncp_cv_elf_target"
ELF_TARGET="$ncp_cv_elf_target"
+BUILD_SHARED="$ELF_TARGET"
+if test "$enable_shared" = "no"
+then
+ BUILD_SHARED="no"
+fi
+if test "$enable_shared" = "yes"
+then
+ BUILD_SHARED="yes"
+fi
+
FFUNCTION_SECTIONS=""
GC_SECTIONS=""
if test "$function_sections" = "yes"
@@ -14174,6 +14191,7 @@ fi
ADDON_SUBDIRS="$ADDON_SUBDIRS $ADDON_DEV_SUBDIRS"
+
@@ -14944,6 +14962,7 @@ s,@ADDON_DEV_SUBDIRS@,$ADDON_DEV_SUBDIRS
s,@ADDON_DEV_SUBDIRS@,$ADDON_DEV_SUBDIRS,;t t
s,@FFUNCTION_SECTIONS@,$FFUNCTION_SECTIONS,;t t
s,@GC_SECTIONS@,$GC_SECTIONS,;t t
+s,@BUILD_SHARED@,$BUILD_SHARED,;t t
s,@subdirs@,$subdirs,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
diff -r 50351d213ba9 -r bda42d4b9cf1 configure.ac
--- a/configure.ac Sat May 28 18:57:50 2005 +0000
+++ b/configure.ac Sat May 28 19:21:17 2005 +0000
@@ -50,6 +50,9 @@ AC_ARG_ENABLE(versions,
AC_ARG_ENABLE(function_sections,
[ --disable-function-sections do not use -ffunction-sections for static libraries])
+
+AC_ARG_ENABLE(shared,
+[ --disable-shared disable build/use of shared libncp])
AC_ARG_ENABLE(trace,
[ --enable-trace enable trace of ncp calls])
@@ -892,6 +895,16 @@ ELF_TARGET="$ncp_cv_elf_target"
ELF_TARGET="$ncp_cv_elf_target"
AC_SUBST(ELF_TARGET)
+BUILD_SHARED="$ELF_TARGET"
+if test "$enable_shared" = "no"
+then
+ BUILD_SHARED="no"
+fi
+if test "$enable_shared" = "yes"
+then
+ BUILD_SHARED="yes"
+fi
+
FFUNCTION_SECTIONS=""
GC_SECTIONS=""
if test "$function_sections" = "yes"
@@ -999,6 +1012,7 @@ AC_SUBST(ADDON_DEV_SUBDIRS)
AC_SUBST(ADDON_DEV_SUBDIRS)
AC_SUBST(FFUNCTION_SECTIONS)
AC_SUBST(GC_SECTIONS)
+AC_SUBST(BUILD_SHARED)
AC_CONFIG_FILES([
Make.rules
diff -r 50351d213ba9 -r bda42d4b9cf1 contrib/tcl-utils/Makefile.in
--- a/contrib/tcl-utils/Makefile.in Sat May 28 18:57:50 2005 +0000
+++ b/contrib/tcl-utils/Makefile.in Sat May 28 19:21:17 2005 +0000
@@ -26,7 +26,7 @@ SBINUTILS = $(O_SBINUTILS:%.o=%)
UTILS = $(USERUTILS) $(SBINUTILS)
-ifeq ($(HAVE_ELF),yes)
+ifeq ($(BUILD_SHARED),yes)
NCP_LIB := libncp.so
else
NCP_LIB := libncp.a
diff -r 50351d213ba9 -r bda42d4b9cf1 contrib/tknwmsg/Makefile.in
--- a/contrib/tknwmsg/Makefile.in Sat May 28 18:57:50 2005 +0000
+++ b/contrib/tknwmsg/Makefile.in Sat May 28 19:21:17 2005 +0000
@@ -19,7 +19,7 @@ SBINUTILS = $(O_SBINUTILS:%.o=%)
UTILS = $(USERUTILS) $(SBINUTILS)
-ifeq ($(HAVE_ELF),yes)
+ifeq ($(BUILD_SHARED),yes)
NCP_LIB = libncp.so
NCPLIB_DIR = ../../lib
LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB)
diff -r 50351d213ba9 -r bda42d4b9cf1 lib/Makefile.in
--- a/lib/Makefile.in Sat May 28 18:57:50 2005 +0000
+++ b/lib/Makefile.in Sat May 28 19:21:17 2005 +0000
@@ -63,9 +63,14 @@ SHARED_CFLAGS := $(CFLAGS) $(CCFLAGS)
.PHONY : all dep install install-dev clean mrproper distclean
.PHONY : install_shared install_static install_static_su
+
+ifeq ($(BUILD_SHARED),yes)
all: $(STATIC_NCPLIB) $(SHARED_NCPLIB)
-
install: install_shared
+else
+all: $(STATIC_NCPLIB)
+install:
+endif
%.d: %.c
set -e; $(CC) -M $(STATIC_CFLAGS) $(CFLAGS_$(@:.d=.o)) $(BASE_CFLAGS) $< \
diff -r 50351d213ba9 -r bda42d4b9cf1 util/Makefile.in
--- a/util/Makefile.in Sat May 28 18:57:50 2005 +0000
+++ b/util/Makefile.in Sat May 28 19:21:17 2005 +0000
@@ -37,7 +37,7 @@ SBINUTILS = $(O_SBINUTILS:%.o=%)
UTILS = $(USERUTILS) $(SBINUTILS) ncptest
-ifeq ($(HAVE_ELF),yes)
+ifeq ($(BUILD_SHARED),yes)
NCP_LIB = libncp.so
NCPLIB_DIR = ../lib
LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB)

View File

@@ -0,0 +1,313 @@
changeset: 423:bef6bf5896d3
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 19:42:20 2005 +0000
files: Make.rules.in configure configure.ac contrib/pam/Makefile.in contrib/tcl-utils/Makefile.in contrib/tknwmsg/Makefile.in lib/Makefile.in sutil/Makefile.in util/Makefile.in
description:
Do not hardwire library .a/.so extension.
diff -r bda42d4b9cf1 -r bef6bf5896d3 Make.rules.in
--- a/Make.rules.in Sat May 28 19:21:17 2005 +0000
+++ b/Make.rules.in Sat May 28 19:42:20 2005 +0000
@@ -50,6 +50,9 @@ HAVE_ELF := @ELF_TARGET@
HAVE_ELF := @ELF_TARGET@
BUILD_SHARED := @BUILD_SHARED@
+libext := @libext@
+shlibext := @shlibext@
+
VERSION_SOLIB := 2.3.0
VERSION_SONAME := 2.3
diff -r bda42d4b9cf1 -r bef6bf5896d3 configure
--- a/configure Sat May 28 19:21:17 2005 +0000
+++ b/configure Sat May 28 19:42:20 2005 +0000
@@ -313,7 +313,7 @@ ac_includes_default="\
#endif"
ac_subdirs_all="$ac_subdirs_all contrib/php"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC_WARNINGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S PACKAGE VERSION MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CPP EGREP GLIBC2 RANLIB ac_ct_RANLIB ALLOCA GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB localedir ncp_ipx_headers_1 ncp_ipx_headers_2 ncp_ipx_defsiocprotoprivate ncp_ipx_defsiocaipx ncp_sys_mount_h ncp_linux_fs_h ncp_net_if_h ncp_net_route_h ncp_if_ether_support ncp_sys_select_h stdint_types socklen_t wchar_h LIB_PAM_SECURITY php_found REENTRANT_CFLAGS ncphost ELF_TARGET VERSIONED_LINK ncp_in_support ncp_ipx_support NDS_SUPPORT SIGNATURES MOUNT2 MOUNT3 USE_KERNEL ADDON_SUBDIRS ADDON_DEV_SUBDIRS FFUNCTION_SECTIONS GC_SECTIONS BUILD_SHARED subdirs LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC_WARNINGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S PACKAGE VERSION MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CPP EGREP GLIBC2 RANLIB ac_ct_RANLIB ALLOCA GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB localedir ncp_ipx_headers_1 ncp_ipx_headers_2 ncp_ipx_defsiocprotoprivate ncp_ipx_defsiocaipx ncp_sys_mount_h ncp_linux_fs_h ncp_net_if_h ncp_net_route_h ncp_if_ether_support ncp_sys_select_h stdint_types socklen_t wchar_h LIB_PAM_SECURITY php_found REENTRANT_CFLAGS ncphost ELF_TARGET VERSIONED_LINK ncp_in_support ncp_ipx_support NDS_SUPPORT SIGNATURES MOUNT2 MOUNT3 USE_KERNEL ADDON_SUBDIRS ADDON_DEV_SUBDIRS FFUNCTION_SECTIONS GC_SECTIONS BUILD_SHARED shlibext libext subdirs LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -14106,6 +14106,39 @@ then
GC_SECTIONS="-Wl,--gc-sections "
fi
+
+
+ echo "$as_me:$LINENO: checking for shared library run path origin" >&5
+echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6
+if test "${acl_cv_rpath+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+
+fi
+echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5
+echo "${ECHO_T}$acl_cv_rpath" >&6
+ wl="$acl_cv_wl"
+ libext="$acl_cv_libext"
+ shlibext="$acl_cv_shlibext"
+ hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ hardcode_direct="$acl_cv_hardcode_direct"
+ hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ # Check whether --enable-rpath or --disable-rpath was given.
+if test "${enable_rpath+set}" = set; then
+ enableval="$enable_rpath"
+ :
+else
+ enable_rpath=yes
+fi;
+
+
if test "$VERSIONED_LINK" = "yes"
then
echo "$as_me:$LINENO: checking for working versioned link" >&5
@@ -14126,7 +14159,7 @@ void lsym(void) { };
void lsym(void) { };
void gsym(void) { };
EOF
- if ${CC} -shared -Wl,-version-script=conftest.vers -o conftest.so conftest.c -lc >/dev/null 2>&1
+ if ${CC} -shared -Wl,-version-script=conftest.vers -o conftest.${shlibext} conftest.c -lc >/dev/null 2>&1
then
ncp_cv_versioned_link=yes
fi
@@ -14134,7 +14167,7 @@ fi
fi
echo "$as_me:$LINENO: result: $ncp_cv_versioned_link" >&5
echo "${ECHO_T}$ncp_cv_versioned_link" >&6
- rm -f conftest.c conftest.vers conftest.so
+ rm -f conftest.c conftest.vers conftest.${shlibext}
if test "$ncp_cv_versioned_link" = "no"
then
if test "$versions_forced" = "yes"
@@ -14191,6 +14224,8 @@ fi
ADDON_SUBDIRS="$ADDON_SUBDIRS $ADDON_DEV_SUBDIRS"
+
+
@@ -14963,6 +14998,8 @@ s,@FFUNCTION_SECTIONS@,$FFUNCTION_SECTIO
s,@FFUNCTION_SECTIONS@,$FFUNCTION_SECTIONS,;t t
s,@GC_SECTIONS@,$GC_SECTIONS,;t t
s,@BUILD_SHARED@,$BUILD_SHARED,;t t
+s,@shlibext@,$shlibext,;t t
+s,@libext@,$libext,;t t
s,@subdirs@,$subdirs,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
diff -r bda42d4b9cf1 -r bef6bf5896d3 configure.ac
--- a/configure.ac Sat May 28 19:21:17 2005 +0000
+++ b/configure.ac Sat May 28 19:42:20 2005 +0000
@@ -937,6 +937,8 @@ then
GC_SECTIONS="-Wl,--gc-sections "
fi
+AC_LIB_RPATH
+
if test "$VERSIONED_LINK" = "yes"
then
AC_CACHE_CHECK(for working versioned link,
@@ -954,12 +956,12 @@ void lsym(void) { };
void lsym(void) { };
void gsym(void) { };
EOF
- if ${CC} -shared -Wl,-version-script=conftest.vers -o conftest.so conftest.c -lc >/dev/null 2>&1
+ if ${CC} -shared -Wl,-version-script=conftest.vers -o conftest.${shlibext} conftest.c -lc >/dev/null 2>&1
then
ncp_cv_versioned_link=yes
fi]
)
- rm -f conftest.c conftest.vers conftest.so
+ rm -f conftest.c conftest.vers conftest.${shlibext}
if test "$ncp_cv_versioned_link" = "no"
then
if test "$versions_forced" = "yes"
@@ -1013,6 +1015,8 @@ AC_SUBST(FFUNCTION_SECTIONS)
AC_SUBST(FFUNCTION_SECTIONS)
AC_SUBST(GC_SECTIONS)
AC_SUBST(BUILD_SHARED)
+AC_SUBST(shlibext)
+AC_SUBST(libext)
AC_CONFIG_FILES([
Make.rules
diff -r bda42d4b9cf1 -r bef6bf5896d3 contrib/pam/Makefile.in
--- a/contrib/pam/Makefile.in Sat May 28 19:21:17 2005 +0000
+++ b/contrib/pam/Makefile.in Sat May 28 19:42:20 2005 +0000
@@ -10,10 +10,10 @@ LIBS = @INTLLIBS@ @LIBS@
LIBS = @INTLLIBS@ @LIBS@
LIB_PAM_SECURITY = @LIB_PAM_SECURITY@
-NCP_LIB = libncp.so
+NCP_LIB = libncp.$(shlibext)
NCPLIB_DIR = ../../lib
-PAM_LIBRARY = pam_ncp_auth.so
+PAM_LIBRARY = pam_ncp_auth.$(shlibext)
PAM_OBJECTS = pam_ncp_auth.do support.do
CFLAGS_pam_ncp_auth.do := -DNCPMOUNT_PATH=\"$(bindir)/ncpmount\" -DNCPUMOUNT_PATH=\"$(bindir)/ncpumount\"
diff -r bda42d4b9cf1 -r bef6bf5896d3 contrib/tcl-utils/Makefile.in
--- a/contrib/tcl-utils/Makefile.in Sat May 28 19:21:17 2005 +0000
+++ b/contrib/tcl-utils/Makefile.in Sat May 28 19:42:20 2005 +0000
@@ -27,9 +27,9 @@ UTILS = $(USERUTILS) $(SBINUTILS)
UTILS = $(USERUTILS) $(SBINUTILS)
ifeq ($(BUILD_SHARED),yes)
-NCP_LIB := libncp.so
+NCP_LIB := libncp.$(shlibext)
else
-NCP_LIB := libncp.a
+NCP_LIB := libncp.$(libext)
endif
NCPLIB_DIR := ${top_builddir}/lib
LIBDEP := $(NCPLIB_DIR)/$(NCP_LIB)
@@ -49,11 +49,11 @@ install: all
install-dev:
-${NCPLIB_DIR}/libncp.a:
- make -C ${NCPLIB_DIR} libncp.a
+${NCPLIB_DIR}/libncp.$(libext):
+ make -C ${NCPLIB_DIR} libncp.$(libext)
-${NCPLIB_DIR}/libncp.so:
- make -C ${NCPLIB_DIR} libncp.so
+${NCPLIB_DIR}/libncp.$(shlibext):
+ make -C ${NCPLIB_DIR} libncp.$(shlibext)
$(O_USERUTILS) $(O_SBINUTILS) $(O_OTHER): %.o: %.c
$(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
diff -r bda42d4b9cf1 -r bef6bf5896d3 contrib/tknwmsg/Makefile.in
--- a/contrib/tknwmsg/Makefile.in Sat May 28 19:21:17 2005 +0000
+++ b/contrib/tknwmsg/Makefile.in Sat May 28 19:42:20 2005 +0000
@@ -20,14 +20,12 @@ UTILS = $(USERUTILS) $(SBINUTILS)
UTILS = $(USERUTILS) $(SBINUTILS)
ifeq ($(BUILD_SHARED),yes)
-NCP_LIB = libncp.so
-NCPLIB_DIR = ../../lib
+NCP_LIB = libncp.$(shlibext)
+else
+NCP_LIB = libncp.$(libext)
+endif
+NCPLIB_DIR = $(top_builddir)/lib
LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB)
-else
-NCP_LIB = libncp.a
-NCPLIB_DIR = ../../lib
-LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB)
-endif
.PHONY : all install install-dev dep clean mrproper distclean
.PHONY : default
@@ -46,11 +44,11 @@ install: all
install-dev:
-../../lib/libncp.a:
- make -C ../../lib libncp.a
+../../lib/libncp.$(libext):
+ make -C ../../lib libncp.$(libext)
-../../lib/libncp.so:
- make -C ../../lib libncp.so
+../../lib/libncp.$(shlibext):
+ make -C ../../lib libncp.$(shlibext)
$(O_USERUTILS) $(O_SBINUTILS): %.o: %.c
$(CC) $(CFLAGS) $(CCFLAGS) -o $@ -c $<
diff -r bda42d4b9cf1 -r bef6bf5896d3 lib/Makefile.in
--- a/lib/Makefile.in Sat May 28 19:21:17 2005 +0000
+++ b/lib/Makefile.in Sat May 28 19:42:20 2005 +0000
@@ -14,10 +14,10 @@ REENTRANT_CFLAGS := @REENTRANT_CFLAGS@
REENTRANT_CFLAGS := @REENTRANT_CFLAGS@
VERSIONED_LINK := @VERSIONED_LINK@
-SHARED_NCPLIB := libncp.so
+SHARED_NCPLIB := libncp.$(shlibext)
SHARED_NCPLIB_BIN := $(SHARED_NCPLIB).$(VERSION_SOLIB)
SHARED_NCPLIB_SONAME := $(SHARED_NCPLIB).$(VERSION_SONAME)
-STATIC_NCPLIB := libncp.a
+STATIC_NCPLIB := libncp.$(libext)
STATIC_NCPLIB_BIN := $(STATIC_NCPLIB)
CCFLAGS += -I.
@@ -93,7 +93,7 @@ dep:
clean:
rm -f *.o *.do *.to *~ ds/*.o ds/*.do ds/*.to ds/*~ fs/*.o fs/*.do fs/*.to fs/*~
- rm -f libncp.a libncp.so* libncpsu.*
+ rm -f $(STATIC_NCPLIB) libncp.$(shlibext)*
mrproper: clean
rm -f $(UTILS) $(DISTFILE) *.d fs/*.d ds/*.d
diff -r bda42d4b9cf1 -r bef6bf5896d3 sutil/Makefile.in
--- a/sutil/Makefile.in Sat May 28 19:21:17 2005 +0000
+++ b/sutil/Makefile.in Sat May 28 19:42:20 2005 +0000
@@ -85,11 +85,11 @@ ncpm_common.d mount_login.d: %.d: %.c
| sed 's,\($*\)\.o[ :]*,\1.o \1.do \1.to $@ : ,g' > $@; \
[ -s $@ ] || rm -f $@
-$(UTILS): %: %.o ../lib/libncp.a
+$(UTILS): %: %.o ../lib/libncp.$(libext)
$(CC) @GC_SECTIONS@-o $@ $^ ${LIBS}
-../lib/libncp.a:
- make -C ../lib libncp.a
+../lib/libncp.$(libext):
+ make -C ../lib libncp.$(libext)
dep:
diff -r bda42d4b9cf1 -r bef6bf5896d3 util/Makefile.in
--- a/util/Makefile.in Sat May 28 19:21:17 2005 +0000
+++ b/util/Makefile.in Sat May 28 19:42:20 2005 +0000
@@ -38,14 +38,12 @@ UTILS = $(USERUTILS) $(SBINUTILS) ncptes
UTILS = $(USERUTILS) $(SBINUTILS) ncptest
ifeq ($(BUILD_SHARED),yes)
-NCP_LIB = libncp.so
+NCP_LIB = libncp.$(shlibext)
+else
+NCP_LIB = libncp.$(libext)
+endif
NCPLIB_DIR = ../lib
LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB)
-else
-NCP_LIB = libncp.a
-NCPLIB_DIR = ../lib
-LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB)
-endif
CFLAGS_ncopy.o = -D_GNU_SOURCE
ADDOBJS_pqstat = dsqueue.o
@@ -76,11 +74,11 @@ endif
install-dev:
-../lib/libncp.a:
- make -C ../lib libncp.a
+../lib/libncp.$(libext):
+ make -C $(NCPLIB_DIR) libncp.$(libext)
-../lib/libncp.so:
- make -C ../lib libncp.so
+../lib/libncp.$(shlibext):
+ make -C $(NCPLIB_DIR) libncp.$(shlibext)
$(O_USERUTILS) $(O_SBINUTILS) $(O_OTHER) ncptest.o: %.o: %.c
$(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<

View File

@@ -0,0 +1,30 @@
changeset: 424:81e0853d48a9
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat May 28 19:59:35 2005 +0000
files: include/ncp/kernel/types.h.in
description:
Use stdint.h when possible. Fixes problems on Darwin.
diff -r bef6bf5896d3 -r 81e0853d48a9 include/ncp/kernel/types.h.in
--- a/include/ncp/kernel/types.h.in Sat May 28 19:42:20 2005 +0000
+++ b/include/ncp/kernel/types.h.in Sat May 28 19:59:35 2005 +0000
@@ -7,6 +7,9 @@
@ncp_in_support@
@ncp_ipx_support@
+#if @stdint_types@
+#include <stdint.h>
+#else
/* FIXME: What about configure?! */
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__ 1
@@ -26,6 +29,7 @@ typedef signed long long int64_t;
#endif
#endif /* __BIT_TYPES_DEFINED__ */
+#endif
#if @USE_KERNEL@

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,257 @@
changeset: 426:08cd551d8c1c
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jun 05 14:23:57 2005 +0000
files: include/ncp/ipxlib.h include/ncp/kernel/ncp.h include/ncp/ncplib.h ipx-1.0/Samples/rip.c ipx-1.0/Samples/sap.c ipx-1.0/ipx_cmd.c ipxdump/ipxparse.c lib/ncplib.c
description:
Add __attribute__((packed)) at structure level too. Darwin's gcc-3.3
needs that, otherwise it (at least) adds one byte to ncp_request_header,
completely mangling sent packet.
diff -r 8341fcd1dc86 -r 08cd551d8c1c include/ncp/ipxlib.h
--- a/include/ncp/ipxlib.h Sat May 28 20:02:00 2005 +0000
+++ b/include/ncp/ipxlib.h Sun Jun 05 14:23:57 2005 +0000
@@ -73,7 +73,7 @@ struct sap_server_ident
#endif
IPXPort server_port __attribute__((packed));
u_int16_t intermediate_network __attribute__((packed));
-};
+} __attribute__((packed));
#define IPX_RIP_REQUEST (0x1)
#define IPX_RIP_RESPONSE (0x2)
@@ -82,13 +82,13 @@ struct ipx_rt_def {
u_int32_t network __attribute__((packed));
u_int16_t hops __attribute__((packed));
u_int16_t ticks __attribute__((packed));
-};
+} __attribute__((packed));
struct ipx_rip_packet
{
u_int16_t operation __attribute__((packed));
struct ipx_rt_def rt[1] __attribute__((packed));
-};
+} __attribute__((packed));
#ifdef SWIG
#define IPX_BROADCAST_NODE "\xff\xff\xff\xff\xff\xff"
diff -r 8341fcd1dc86 -r 08cd551d8c1c include/ncp/kernel/ncp.h
--- a/include/ncp/kernel/ncp.h Sat May 28 20:02:00 2005 +0000
+++ b/include/ncp/kernel/ncp.h Sun Jun 05 14:23:57 2005 +0000
@@ -59,7 +59,7 @@ struct ncp_request_header {
u_int8_t conn_high __attribute__((packed));
u_int8_t function __attribute__((packed));
u_int8_t data[0] __attribute__((packed));
-};
+} __attribute__((packed));
#define NCP_REPLY (0x3333)
#define NCP_POSITIVE_ACK (0x9999)
@@ -73,7 +73,7 @@ struct ncp_reply_header {
u_int8_t completion_code __attribute__((packed));
u_int8_t connection_state __attribute__((packed));
u_int8_t data[0] __attribute__((packed));
-};
+} __attribute__((packed));
#define NCP_VOLNAME_LEN (16)
#define NCP_NUMBER_OF_VOLUMES (64)
@@ -232,7 +232,7 @@ struct nw_info_struct {
u_int32_t NSCreator __attribute__((packed));
u_int8_t nameLen __attribute__((packed));
u_int8_t entryName[256] __attribute__((packed));
-};
+} __attribute__((packed));
#endif
/* modify mask - use with MODIFY_DOS_INFO structure */
@@ -265,7 +265,7 @@ struct nw_modify_dos_info {
u_int16_t inheritanceGrantMask __attribute__((packed));
u_int16_t inheritanceRevokeMask __attribute__((packed));
u_int32_t maximumSpace __attribute__((packed));
-};
+} __attribute__((packed));
#ifdef SWIG
struct nw_file_info {
@@ -284,13 +284,13 @@ struct nw_file_info {
u_int32_t server_file_handle __attribute__((packed));
u_int8_t open_create_action __attribute__((packed));
u_int8_t file_handle[6] __attribute__((packed));
-};
+} __attribute__((packed));
#endif
struct nw_search_sequence {
u_int8_t volNumber __attribute__((packed));
u_int32_t dirBase __attribute__((packed));
u_int32_t sequence __attribute__((packed));
-};
+} __attribute__((packed));
#endif /* _LINUX_NCP_H */
diff -r 8341fcd1dc86 -r 08cd551d8c1c include/ncp/ncplib.h
--- a/include/ncp/ncplib.h Sat May 28 20:02:00 2005 +0000
+++ b/include/ncp/ncplib.h Sun Jun 05 14:23:57 2005 +0000
@@ -492,7 +492,7 @@ struct ncp_file_server_info
u_int8_t RestrictionLevel __attribute__((packed));
u_int8_t InternetBridge __attribute__((packed));
u_int8_t Reserved[60] __attribute__((packed));
-};
+} __attribute__((packed));
#endif
struct ncp_file_server_info_2 {
@@ -607,7 +607,7 @@ struct ncp_station_addr
u_int8_t Node[6] __attribute__((packed));
#endif
u_int16_t Socket __attribute__((packed));
-};
+} __attribute__((packed));
struct ncp_prop_login_control
{
@@ -640,7 +640,7 @@ struct ncp_prop_login_control
u_int16_t BadLoginCount __attribute__((packed));
u_int32_t BadLoginCountDown __attribute__((packed));
struct ncp_station_addr LastIntruder __attribute__((packed));
-};
+} __attribute__((packed));
NWCCODE NWReadPropertyValue(NWCONN_HANDLE conn, const char *objName,
NWObjectType objType, const char *propertyName,
diff -r 8341fcd1dc86 -r 08cd551d8c1c ipx-1.0/Samples/rip.c
--- a/ipx-1.0/Samples/rip.c Sat May 28 20:02:00 2005 +0000
+++ b/ipx-1.0/Samples/rip.c Sun Jun 05 14:23:57 2005 +0000
@@ -5,7 +5,7 @@ struct rip_data
u_int32_t rip_net __attribute__((packed));
u_int16_t rip_hops __attribute__((packed));
u_int16_t rip_ticks __attribute__((packed));
-};
+} __attribute__((packed));
int
main(int argc, char **argv)
diff -r 8341fcd1dc86 -r 08cd551d8c1c ipx-1.0/Samples/sap.c
--- a/ipx-1.0/Samples/sap.c Sat May 28 20:02:00 2005 +0000
+++ b/ipx-1.0/Samples/sap.c Sun Jun 05 14:23:57 2005 +0000
@@ -8,7 +8,7 @@ struct sap_data
u_int8_t sap_node[6] __attribute__((packed));
u_int16_t sap_sock __attribute__((packed));
u_int16_t sap_hops __attribute__((packed));
-};
+} __attribute__((packed));
int
main(int argc, char **argv)
diff -r 8341fcd1dc86 -r 08cd551d8c1c ipx-1.0/ipx_cmd.c
--- a/ipx-1.0/ipx_cmd.c Sat May 28 20:02:00 2005 +0000
+++ b/ipx-1.0/ipx_cmd.c Sun Jun 05 14:23:57 2005 +0000
@@ -66,8 +66,8 @@ struct {
u_int8_t dst[6] __attribute__((packed));
u_int8_t src[6] __attribute__((packed));
u_int16_t type __attribute__((packed));
- u_int8_t ipx[16384];
- } buffer;
+ u_int8_t ipx[16384] __attribute__((packed));
+ } __attribute__((packed)) buffer;
static int getiflist(int fd, struct ifconf* ifc) {
int i;
diff -r 8341fcd1dc86 -r 08cd551d8c1c ipxdump/ipxparse.c
--- a/ipxdump/ipxparse.c Sat May 28 20:02:00 2005 +0000
+++ b/ipxdump/ipxparse.c Sun Jun 05 14:23:57 2005 +0000
@@ -60,7 +60,7 @@ struct ipx_address
IPXNet net __attribute__((packed));
IPXNode node __attribute__((packed));
IPXPort sock __attribute__((packed));
-};
+} __attribute__((packed));
struct ipx_packet
{
@@ -77,7 +77,7 @@ struct ipx_packet
#define IPX_TYPE_PPROP 0x14 /* complicated flood fill brdcast [Not supported] */
struct ipx_address ipx_dest __attribute__((packed));
struct ipx_address ipx_source __attribute__((packed));
-};
+} __attribute__((packed));
#define NCP_ALLOC_SLOT_REQUEST (0x1111)
#define NCP_REQUEST (0x2222)
@@ -92,7 +92,7 @@ struct ncp_request_header
u_int8_t conn_high __attribute__((packed));
u_int8_t function __attribute__((packed));
u_int8_t data[0] __attribute__((packed));
-};
+} __attribute__((packed));
#define NCP_REPLY (0x3333)
#define NCP_POSITIVE_ACK (0x9999)
@@ -107,7 +107,7 @@ struct ncp_reply_header
u_int8_t completion_code __attribute__((packed));
u_int8_t connection_state __attribute__((packed));
u_int8_t data[0] __attribute__((packed));
-};
+} __attribute__((packed));
#define NCP_BURST_PACKET (0x7777)
@@ -126,7 +126,7 @@ struct ncp_burst_header
u_int32_t data_offset __attribute__((packed));
u_int16_t data_bytes __attribute__((packed));
u_int16_t missing_frags __attribute__((packed));
-};
+} __attribute__((packed));
void handle_ipx(unsigned char *buf, int length, char *frame, int no);
void handle_ncp(struct sockaddr_ipx *source,
@@ -149,7 +149,7 @@ typedef struct saps
u_int8_t serverName[SAP_MAX_SERVER_NAME_LENGTH] __attribute__((packed));
struct ipx_address serverAddress __attribute__((packed));
u_int16_t serverHops __attribute__((packed)); /* NBO */
-}
+} __attribute__((packed))
SAPS;
/* General Service/Nearest Server Response SAP packet */
@@ -160,14 +160,14 @@ union sap_packet
{
u_int16_t sapOperation __attribute__((packed));
u_int16_t serverType __attribute__((packed));
- }
+ } __attribute__((packed))
query;
struct sap_response
{
u_int16_t sapOperation __attribute__((packed));
/* each SAP can has a max of SAP_MAX_SAPS_PER_PACKET packets */
SAPS sap[SAP_MAX_SAPS_PER_PACKET] __attribute__((packed));
- }
+ } __attribute__((packed))
response;
};
@@ -356,7 +356,7 @@ handle_burst(struct sockaddr_ipx *source
u_int8_t reserved[8] __attribute__((packed));
u_int32_t file_offset __attribute__((packed));
u_int32_t number_of_bytes __attribute__((packed));
- }
+ } __attribute__((packed))
*brq = (struct ncp_burst_request *) rq;
printf("Assuming Burst Request:\n");
diff -r 8341fcd1dc86 -r 08cd551d8c1c lib/ncplib.c
--- a/lib/ncplib.c Sat May 28 20:02:00 2005 +0000
+++ b/lib/ncplib.c Sun Jun 05 14:23:57 2005 +0000
@@ -2627,7 +2627,7 @@ struct nw_time_buffer
u_int8_t minute __attribute__((packed));
u_int8_t second __attribute__((packed));
u_int8_t wday __attribute__((packed));
-};
+} __attribute__((packed));
static time_t
nw_to_ctime(struct nw_time_buffer *source)

View File

@@ -0,0 +1,94 @@
changeset: 427:225fa587c2d8
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jun 05 14:35:13 2005 +0000
files: ipx-1.0/Samples/rip.c ipx-1.0/Samples/sap.c
description:
Fix problems in ipx samples when packet with zero or 1 byte received.
diff -r 08cd551d8c1c -r 225fa587c2d8 ipx-1.0/Samples/rip.c
--- a/ipx-1.0/Samples/rip.c Sun Jun 05 14:23:57 2005 +0000
+++ b/ipx-1.0/Samples/rip.c Sun Jun 05 14:35:13 2005 +0000
@@ -36,6 +36,8 @@ main(int argc, char **argv)
}
while (1)
{
+ size_t rclen;
+
len = sizeof(sipx);
result = recvfrom(s, msg, sizeof(msg), 0,
(struct sockaddr *) &sipx, &len);
@@ -44,8 +46,12 @@ main(int argc, char **argv)
perror("IPX: recvfrom");
exit(-1);
}
+ if (result < 2) {
+ fprintf(stderr, "Received packet is too short to be RIP packet (%d bytes)\n", result);
+ continue;
+ }
+ rclen = result - 2;
bptr = msg;
- result -= 2;
printf("RIP packet from: %08X:%02X%02X%02X%02X%02X%02X\n",
(u_int32_t)htonl(sipx.sipx_network),
sipx.sipx_node[0], sipx.sipx_node[1],
@@ -53,11 +59,11 @@ main(int argc, char **argv)
sipx.sipx_node[6], sipx.sipx_node[5]);
bptr += 2;
rp = (struct rip_data *) bptr;
- while (result >= sizeof(struct rip_data))
+ while (rclen >= sizeof(struct rip_data))
{
printf("\tNET: %08X HOPS: %d\n", (u_int32_t)ntohl(rp->rip_net),
ntohs(rp->rip_hops));
- result -= sizeof(struct rip_data);
+ rclen -= sizeof(struct rip_data);
rp++;
}
}
diff -r 08cd551d8c1c -r 225fa587c2d8 ipx-1.0/Samples/sap.c
--- a/ipx-1.0/Samples/sap.c Sun Jun 05 14:23:57 2005 +0000
+++ b/ipx-1.0/Samples/sap.c Sun Jun 05 14:35:13 2005 +0000
@@ -47,6 +47,8 @@ main(int argc, char **argv)
}
while (1)
{
+ size_t rclen;
+
len = 1024;
result = recvfrom(s, msg, sizeof(msg), 0,
(struct sockaddr *) &sipx, &len);
@@ -55,16 +57,20 @@ main(int argc, char **argv)
perror("IPX: recvfrom: ");
exit(-1);
}
+ if (result < 2) {
+ fprintf(stderr, "Received packet is too short to be SAP packet (%d bytes)\n", result);
+ continue;
+ }
+ rclen = result - 2;
bptr = msg;
- result -= 2;
printf("SAP: OP is %x %x\n", bptr[0], bptr[1]);
- printf("Length is %d\n", result);
+ printf("Length is %u\n", rclen);
if (bptr[1] != 2)
continue;
bptr += 2;
sp = (struct sap_data *) bptr;
- while (result >= sizeof(struct sap_data))
+ while (rclen >= sizeof(struct sap_data))
{
int i;
@@ -83,7 +89,7 @@ main(int argc, char **argv)
sp->sap_node[4],
sp->sap_node[5],
ntohs(sp->sap_sock));
- result -= sizeof(struct sap_data);
+ rclen -= sizeof(struct sap_data);
sp++;
}
}

View File

@@ -0,0 +1,19 @@
changeset: 428:cccdaf2ce097
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jun 05 14:35:46 2005 +0000
files: ipx-1.0/Samples/samples.h
description:
Include <stdlib.h> into samples, to get rid of warning about exit() not
having a prototype.
diff -r 225fa587c2d8 -r cccdaf2ce097 ipx-1.0/Samples/samples.h
--- a/ipx-1.0/Samples/samples.h Sun Jun 05 14:35:13 2005 +0000
+++ b/ipx-1.0/Samples/samples.h Sun Jun 05 14:35:46 2005 +0000
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <ncp/kernel/ipx.h>
#include <netinet/in.h>

View File

@@ -0,0 +1,158 @@
changeset: 429:776dc4052e39
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jun 05 14:36:28 2005 +0000
files: ipxdump/ipxparse.c
description:
Remove warnings about shadowing variables in ipxparse. Also add
__attribute__((packed)) into ipxparse as needed.
diff -r cccdaf2ce097 -r 776dc4052e39 ipxdump/ipxparse.c
--- a/ipxdump/ipxparse.c Sun Jun 05 14:35:46 2005 +0000
+++ b/ipxdump/ipxparse.c Sun Jun 05 14:36:28 2005 +0000
@@ -636,43 +636,43 @@ handle_ncp(struct sockaddr_ipx *source,
{
struct INPUT
{
- u_int16_t proposed_max_size;
- u_int8_t security_flag;
- }
- *i = (struct INPUT *) data;
+ u_int16_t proposed_max_size __attribute__((packed));
+ u_int8_t security_flag __attribute__((packed));
+ } __attribute__((packed))
+ *d = (struct INPUT *) data;
printf("fn: %-3d\n", rq->function);
printf("Get Big Packet NCP Max Packet Size\n");
printf("proposed_max_size: %x\n",
- ntohs(i->proposed_max_size));
+ ntohs(d->proposed_max_size));
printf("security_flag: %x\n",
- i->security_flag);
+ d->security_flag);
break;
}
case 101:
{
struct INPUT
{
- u_int32_t local_conn_id;
- u_int32_t local_max_packet_size;
- u_int16_t local_target_socket;
- u_int32_t local_max_send_size;
- u_int32_t local_max_recv_size;
- }
- *i = (struct INPUT *) data;
+ u_int32_t local_conn_id __attribute__((packed));
+ u_int32_t local_max_packet_size __attribute__((packed));
+ u_int16_t local_target_socket __attribute__((packed));
+ u_int32_t local_max_send_size __attribute__((packed));
+ u_int32_t local_max_recv_size __attribute__((packed));
+ } __attribute__((packed))
+ *d = (struct INPUT *) data;
printf("fn: %-3d\n", rq->function);
printf("Packet Burst Connection Request\n");
printf("local_conn_id: %x\n",
- (u_int32_t)ntohl(i->local_conn_id));
+ (u_int32_t)ntohl(d->local_conn_id));
printf("local_max_packet_size: %x\n",
- (u_int32_t)ntohl(i->local_max_packet_size));
+ (u_int32_t)ntohl(d->local_max_packet_size));
printf("local_target_socket: %x\n",
- (u_int32_t)ntohl(i->local_target_socket));
+ (u_int32_t)ntohl(d->local_target_socket));
printf("local_max_send_size: %x\n",
- (u_int32_t)ntohl(i->local_max_send_size));
+ (u_int32_t)ntohl(d->local_max_send_size));
printf("local_max_recv_size: %x\n",
- (u_int32_t)ntohl(i->local_max_recv_size));
+ (u_int32_t)ntohl(d->local_max_recv_size));
}
break;
case 104:
@@ -700,26 +700,26 @@ handle_ncp(struct sockaddr_ipx *source,
{
struct INPUT
{
- u_int8_t subfunction_code;
- u_int32_t fragger_handle;
- u_int32_t max_fragment_size;
- u_int32_t message_size;
- u_int32_t fragment_flag;
- u_int32_t verb;
- }
- *i = (struct INPUT *) data;
+ u_int8_t subfunction_code __attribute__((packed));
+ u_int32_t fragger_handle __attribute__((packed));
+ u_int32_t max_fragment_size __attribute__((packed));
+ u_int32_t message_size __attribute__((packed));
+ u_int32_t fragment_flag __attribute__((packed));
+ u_int32_t verb __attribute__((packed));
+ } __attribute__((packed))
+ *d = (struct INPUT *) data;
printf("Send NDS Fragment Request/Reply\n");
printf("fragger_handle: %lx\n",
- (unsigned long) i->fragger_handle);
+ (unsigned long) d->fragger_handle);
printf("max_fragment_size: %lx\n",
- (unsigned long) i->max_fragment_size);
+ (unsigned long) d->max_fragment_size);
printf("message_size: %lx\n",
- (unsigned long) i->message_size);
+ (unsigned long) d->message_size);
printf("fragment_flag: %lx\n",
- (unsigned long) i->fragment_flag);
- printf("verb: %d\n", i->verb);
-
- switch (i->verb)
+ (unsigned long) d->fragment_flag);
+ printf("verb: %d\n", d->verb);
+
+ switch (d->verb)
{
case 1:
printf("Resolve Name\n");
@@ -1001,9 +1001,9 @@ handle_ncp(struct sockaddr_ipx *source,
{
struct XDATA
{
- u_int8_t new_directory_handle;
- u_int8_t access_rights_mask;
- }
+ u_int8_t new_directory_handle __attribute__((packed));
+ u_int8_t access_rights_mask __attribute__((packed));
+ } __attribute__((packed))
*x = (struct XDATA *) data;
printf("new_directory_handle: %x\n",
x->new_directory_handle);
@@ -1021,10 +1021,10 @@ handle_ncp(struct sockaddr_ipx *source,
{
struct XDATA
{
- u_int16_t accepted_max_size;
- u_int16_t echo_socket;
- u_int8_t security_flag;
- }
+ u_int16_t accepted_max_size __attribute__((packed));
+ u_int16_t echo_socket __attribute__((packed));
+ u_int8_t security_flag __attribute__((packed));
+ } __attribute__((packed))
*x = (struct XDATA *) data;
printf("accepted_max_size: %x\n",
ntohs(x->accepted_max_size));
@@ -1038,9 +1038,9 @@ handle_ncp(struct sockaddr_ipx *source,
{
struct XDATA
{
- u_int8_t completion_code;
- u_int32_t remote_target_id;
- u_int32_t remote_max_packet_size;
+ u_int8_t completion_code __attribute__((packed));
+ u_int32_t remote_target_id __attribute__((packed));
+ u_int32_t remote_max_packet_size __attribute__((packed));
}
*x = (struct XDATA *) data;
printf("completion_code: %x\n",

View File

@@ -0,0 +1,21 @@
changeset: 430:3fc1f5c9c744
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jun 05 21:25:42 2005 +0000
files: lib/ncplib.c
description:
Set tm_isdst to -1 (unknown DST state) when converting date/time from
NetWare to Unix format. It should give better results when DST is active.
diff -r 776dc4052e39 -r 3fc1f5c9c744 lib/ncplib.c
--- a/lib/ncplib.c Sun Jun 05 14:36:28 2005 +0000
+++ b/lib/ncplib.c Sun Jun 05 21:25:42 2005 +0000
@@ -2641,6 +2641,7 @@ nw_to_ctime(struct nw_time_buffer *sourc
u_time.tm_mday = source->day;
u_time.tm_mon = source->month - 1;
u_time.tm_year = source->year;
+ u_time.tm_isdst = -1;
if (u_time.tm_year < 80) {
u_time.tm_year += 100;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,83 @@
changeset: 432:93a411983bcc
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jul 03 20:34:45 2005 +0100
files: contrib/php/libtool
description:
Regenerate php's libtool with gcc instead of gcc-4.0
diff -r 06020cf028e1 -r 93a411983bcc contrib/php/libtool
--- a/contrib/php/libtool Sat Jun 11 19:59:00 2005 +0000
+++ b/contrib/php/libtool Sun Jul 03 20:34:45 2005 +0100
@@ -76,10 +76,10 @@ AR_FLAGS="cru"
AR_FLAGS="cru"
# A C compiler.
-LTCC="gcc-4.0"
+LTCC="gcc"
# A language-specific compiler.
-CC="gcc-4.0"
+CC="gcc"
# Is the compiler the GNU C compiler?
with_gcc=yes
@@ -316,11 +316,10 @@ link_all_deplibs=unknown
link_all_deplibs=unknown
# Compile-time system search path for libraries
-sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux/4.0.1/ /usr/lib/gcc/i486-linux/4.0.1/ /usr/lib/gcc/i486-linux/4.0.1/../../../../i486-linux/lib/i486-linux/4.0.1/ /usr/lib/gcc/i486-linux/4.0.1/../../../../i486-linux/lib/ /usr/lib/gcc/i486-linux/4.0.1/../../../i486-linux/4.0.1/ /usr/lib/gcc/i486-linux/4.0.1/../../../ /lib/i486-linux/4.0.1/ /lib/ /usr/lib/i486-linux/4.0.1/ /usr/lib/"
+sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/ /usr/lib/gcc/i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../../i486-linux-gnu/lib/i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../../i486-linux-gnu/lib/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../ /lib/i486-linux-gnu/3.3.6/ /lib/ /usr/lib/i486-linux-gnu/3.3.6/ /usr/lib/"
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib
-
/usr/lib/libc5-compat
/lib/libc5-compat
/usr/i486-linuxlibc1/lib
@@ -6740,7 +6739,7 @@ AR_FLAGS="cru"
AR_FLAGS="cru"
# A C compiler.
-LTCC="gcc-4.0"
+LTCC="gcc"
# A language-specific compiler.
CC="g++"
@@ -6881,11 +6880,11 @@ striplib="strip --strip-unneeded"
# Dependencies to place before the objects being linked to create a
# shared library.
-predep_objects="/usr/lib/gcc-lib/i486-linux/3.3.6/../../../crti.o /usr/lib/gcc-lib/i486-linux/3.3.6/crtbeginS.o"
+predep_objects="/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../crti.o /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtbeginS.o"
# Dependencies to place after the objects being linked to create a
# shared library.
-postdep_objects="/usr/lib/gcc-lib/i486-linux/3.3.6/crtendS.o /usr/lib/gcc-lib/i486-linux/3.3.6/../../../crtn.o"
+postdep_objects="/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtendS.o /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../crtn.o"
# Dependencies to place before the objects being linked to create a
# shared library.
@@ -6897,7 +6896,7 @@ postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc
# The library search path used internally by the compiler when linking
# a shared library.
-compiler_lib_search_path="-L/usr/lib/gcc-lib/i486-linux/3.3.6 -L/usr/lib/gcc-lib/i486-linux/3.3.6/../../.."
+compiler_lib_search_path="-L/usr/lib/gcc-lib/i486-linux-gnu/3.3.6 -L/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../.."
# Method to check whether dependent libraries are shared objects.
deplibs_check_method="pass_all"
@@ -6977,11 +6976,10 @@ link_all_deplibs=unknown
link_all_deplibs=unknown
# Compile-time system search path for libraries
-sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-linux/3.3.6/ /usr/lib/gcc/i486-linux/3.3.6/ /usr/lib/gcc-lib/i486-linux/3.3.6/../../../../i486-linux/lib/i486-linux/3.3.6/ /usr/lib/gcc-lib/i486-linux/3.3.6/../../../../i486-linux/lib/ /usr/lib/gcc-lib/i486-linux/3.3.6/../../../i486-linux/3.3.6/ /usr/lib/gcc-lib/i486-linux/3.3.6/../../../ /lib/i486-linux/3.3.6/ /lib/ /usr/lib/i486-linux/3.3.6/ /usr/lib/"
+sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/ /usr/lib/gcc/i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../../i486-linux-gnu/lib/i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../../i486-linux-gnu/lib/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../ /lib/i486-linux-gnu/3.3.6/ /lib/ /usr/lib/i486-linux-gnu/3.3.6/ /usr/lib/"
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib
-
/usr/lib/libc5-compat
/lib/libc5-compat
/usr/i486-linuxlibc1/lib

View File

@@ -0,0 +1,192 @@
changeset: 433:6a7c398b04a7
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jul 03 20:36:50 2005 +0100
files: .hgignore
description:
Switch from BitKeeper to Mercurial. Get rid of BitKeeper config
files, and introduce Mercurial's .hgignore.
diff -r 93a411983bcc -r 6a7c398b04a7 .hgignore
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore Sun Jul 03 20:36:50 2005 +0100
@@ -0,0 +1,179 @@
+\.a$
+\.d$
+\.do$
+\.la$
+\.lo$
+\.o$
+\.so$
+^Make\.rules$
+^Makefile$
+^autom4te.cache/
+^config\.log$
+^config\.status$
+^contrib/pam/Makefile$
+^contrib/php/Makefile$
+^contrib/php/Makefile\.in$
+^contrib/php/\.deps$
+^contrib/php/\.libs/
+^contrib/php/config\.h$
+^contrib/php/config\.log$
+^contrib/php/config\.nice$
+^contrib/php/config\.status$
+^contrib/php/config_vars\.mk$
+^contrib/php/libs\.mk$
+^contrib/php/php_auth_nds\.slo$
+^contrib/tcl-utils/Makefile$
+^contrib/testing/Makefile$
+^contrib/testing/abbrev$
+^contrib/testing/canon$
+^contrib/testing/chgpwd$
+^contrib/testing/cmpattr$
+^contrib/testing/copyauth$
+^contrib/testing/dirlimit$
+^contrib/testing/dirlist2$
+^contrib/testing/dssearch$
+^contrib/testing/dsstream$
+^contrib/testing/eaops$
+^contrib/testing/effright$
+^contrib/testing/fileinfo$
+^contrib/testing/large$
+^contrib/testing/lic$
+^contrib/testing/mkattr$
+^contrib/testing/mkclass$
+^contrib/testing/mkfile$
+^contrib/testing/mkobj$
+^contrib/testing/modclass$
+^contrib/testing/modobj$
+^contrib/testing/mvobj$
+^contrib/testing/nfssetinfo$
+^contrib/testing/nsfileinfo$
+^contrib/testing/nwbcast$
+^contrib/testing/nwdsgethost$
+^contrib/testing/nwdsgetstat$
+^contrib/testing/nwdsgetvi$
+^contrib/testing/nwdslist$
+^contrib/testing/nwdspartjoin$
+^contrib/testing/nwdspartlist$
+^contrib/testing/nwdspartrm$
+^contrib/testing/nwdspartsplit$
+^contrib/testing/nwdsresetstat$
+^contrib/testing/nwgettime$
+^contrib/testing/partroot$
+^contrib/testing/physlock$
+^contrib/testing/pp/Makefile$
+^contrib/testing/pp/bcastmd$
+^contrib/testing/pp/getconn_addr$
+^contrib/testing/pp/getsynt$
+^contrib/testing/pp/nwc_next_object$
+^contrib/testing/pp/nwgetconnlist$
+^contrib/testing/pp/nwwhoami$
+^contrib/testing/pp/open_conn_by_name$
+^contrib/testing/pp/readsdef$
+^contrib/testing/pp/readsynt$
+^contrib/testing/pp/return_block_of_tree$
+^contrib/testing/pp/scantree$
+^contrib/testing/pp/scanvolr$
+^contrib/testing/pp/semaphor$
+^contrib/testing/pp/treelist$
+^contrib/testing/pp/vlist$
+^contrib/testing/pp/volres$
+^contrib/testing/readaddr$
+^contrib/testing/readadef$
+^contrib/testing/readattr$
+^contrib/testing/readcc$
+^contrib/testing/readcls$
+^contrib/testing/readsynt$
+^contrib/testing/reloadds$
+^contrib/testing/renobj$
+^contrib/testing/replops$
+^contrib/testing/resint$
+^contrib/testing/resolve$
+^contrib/testing/rmattr$
+^contrib/testing/rmclass$
+^contrib/testing/rmobj$
+^contrib/testing/schsync$
+^contrib/testing/semaphore$
+^contrib/testing/setkeys$
+^contrib/testing/time$
+^contrib/testing/timegv$
+^contrib/testing/timeinfo$
+^contrib/testing/verpwd$
+^contrib/testing/verunix$
+^contrib/testing/vollist$
+^contrib/testing/wcsmbs-tst1$
+^contrib/tests/Makefile$
+^contrib/tknwmsg/Makefile$
+^include/config\.h$
+^include/ncp/ext/socket\.h$
+^include/ncp/ext/stdint\.h$
+^include/ncp/kernel/fs\.h$
+^include/ncp/kernel/if\.h$
+^include/ncp/kernel/ipx\.h$
+^include/ncp/kernel/route\.h$
+^include/ncp/kernel/types\.h$
+^include/ncp/nwnet\.h$
+^intl/Makefile$
+^ipx-1\.0/.*\.gz$
+^ipx-1\.0/Makefile$
+^ipx-1\.0/Samples/Makefile$
+^ipx-1\.0/Samples/ipxrcv$
+^ipx-1\.0/Samples/ipxsend$
+^ipx-1\.0/Samples/rip$
+^ipx-1\.0/Samples/sap$
+^ipx-1\.0/ipx_cmd$
+^ipx-1\.0/ipx_configure$
+^ipx-1\.0/ipx_interface$
+^ipx-1\.0/ipx_internal_net$
+^ipx-1\.0/ipx_route$
+^ipxdump/Makefile$
+^lib/Makefile$
+^lib/libncp\.so\..*$
+^man/.*\.gz$
+^man/Makefile$
+^po/Makefile$
+^po/Makefile\.in$
+^po/POTFILES$
+^sutil/Makefile$
+^sutil/ncplogin$
+^sutil/ncpmap$
+^sutil/ncpmount$
+^sutil/ncpumount$
+^sutil/nwsfind$
+^util/Makefile$
+^util/ncopy$
+^util/ncptest$
+^util/nprint$
+^util/nsend$
+^util/nwauth$
+^util/nwbocreate$
+^util/nwbols$
+^util/nwboprops$
+^util/nwborm$
+^util/nwbpadd$
+^util/nwbpcreate$
+^util/nwbprm$
+^util/nwbpset$
+^util/nwbpvalues$
+^util/nwdir$
+^util/nwdpvalues$
+^util/nwfsctrl$
+^util/nwfsinfo$
+^util/nwfstime$
+^util/nwgrant$
+^util/nwlistsalvage$
+^util/nwmsg$
+^util/nwpasswd$
+^util/nwpjmv$
+^util/nwpqjob$
+^util/nwpurge$
+^util/nwrevoke$
+^util/nwrights$
+^util/nwsalvage$
+^util/nwtrustee$
+^util/nwtrustee2$
+^util/nwuserlist$
+^util/nwvolinfo$
+^util/pqlist$
+^util/pqstat$
+^util/pserver$
+^util/slist$

View File

@@ -0,0 +1,25 @@
changeset: 434:5eb60dbc36bd
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jul 03 21:43:04 2005 +0100
files: include/ncp/ncplib.h
description:
Fix compilation with gcc 3.1 and older - no always_inline attribute
available.
diff -r 6a7c398b04a7 -r 5eb60dbc36bd include/ncp/ncplib.h
--- a/include/ncp/ncplib.h Sun Jul 03 20:36:50 2005 +0100
+++ b/include/ncp/ncplib.h Sun Jul 03 21:43:04 2005 +0100
@@ -181,7 +181,10 @@ DSET_HL(void * buf, int pos, dword val)
DSET_LH(buf, pos, htonl(val));
}
-static inline __attribute__((always_inline)) void
+static inline void
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+__attribute__((always_inline))
+#endif
QSET_HL(void * buf, int pos, u_int64_t val) {
DSET_HL(buf, pos, val >> 32);
DSET_HL(buf, pos + 4, val);

View File

@@ -0,0 +1,42 @@
changeset: 435:12722b2b7268
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jul 03 21:44:37 2005 +0100
files: util/nwauth.c
description:
Rename daemon to daemon_auth in util/nwauth.c
Fix a warning in nwauth.c build that global daemon() function
is shadowed by daemon variable in nwauth.c.
diff -r 5eb60dbc36bd -r 12722b2b7268 util/nwauth.c
--- a/util/nwauth.c Sun Jul 03 21:43:04 2005 +0100
+++ b/util/nwauth.c Sun Jul 03 21:44:37 2005 +0100
@@ -82,7 +82,7 @@ main(int argc, char *argv[])
char *str;
int opt;
- int daemon = 0;
+ int daemon_auth = 0;
setlocale(LC_ALL, "");
bindtextdomain(NCPFS_PACKAGE, LOCALEDIR);
@@ -114,7 +114,7 @@ main(int argc, char *argv[])
#endif
break;
case 'D':
- daemon = 1;
+ daemon_auth = 1;
break;
case 'h':
case '?':
@@ -127,7 +127,7 @@ main(int argc, char *argv[])
}
err = ncp_find_conn_spec3(server, object_name, "",
- 1, daemon ? ~0U : getuid(), 0, &spec);
+ 1, daemon_auth ? ~0U : getuid(), 0, &spec);
if (err)
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
changeset: 438:e635f8099d50
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jul 03 22:46:56 2005 +0100
files: po/cs.gmo po/cs.po
description:
Fix typo in Czech translations.
diff -r 06067530cbec -r e635f8099d50 po/cs.gmo
Binary file po/cs.gmo has changed
diff -r 06067530cbec -r e635f8099d50 po/cs.po
--- a/po/cs.po Sun Jul 03 21:50:24 2005 +0100
+++ b/po/cs.po Sun Jul 03 22:46:56 2005 +0100
@@ -2137,7 +2137,7 @@ msgstr "chyba při vytváření\n"
#: util/ncptest.c:134
#, c-format
msgid "dealloc error\n"
-msgstr "chyba při dealokaci"
+msgstr "chyba při dealokaci\n"
#: util/ncptest.c:137
#, c-format

View File

@@ -0,0 +1,162 @@
changeset: 439:0ba24cdb345c
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Jul 03 23:57:27 2005 +0100
files: lib/ndslib.c
description:
Convert some unsigned char* to const unsigned char* in lib/ndslib.c.
Constify some pointers in the RSA computations, so we do not see
any ugly warnings during build.
diff -r e635f8099d50 -r 0ba24cdb345c lib/ndslib.c
--- a/lib/ndslib.c Sun Jul 03 22:46:56 2005 +0100
+++ b/lib/ndslib.c Sun Jul 03 23:57:27 2005 +0100
@@ -233,7 +233,7 @@ static void fillrandom(nuint8 *buf, size
}
#endif
-static int countbits_l(unsigned char *buf, int bufsize) {
+static int countbits_l(const unsigned char *buf, int bufsize) {
unsigned char b;
while ((--bufsize) && (!buf[bufsize]));
@@ -253,7 +253,7 @@ static void copyfill(void *outbuf, int o
static char keyprefix[] = {1, 0, 0, 0, 3, 0, 1, 0};
-static int initkey(const unsigned char *key, unsigned char **keyptr, size_t *keylen) { /* 1=ok, 0=err */
+static int initkey(const unsigned char *key, const unsigned char **keyptr, size_t *keylen) { /* 1=ok, 0=err */
if (!memcmp(key, keyprefix, 8)) {
if (keylen) *keylen = WVAL_LH(key, 8);
if (keyptr) *keyptr = key + 10;
@@ -263,14 +263,14 @@ static int initkey(const unsigned char *
}
static void clearkey(unsigned char *key) {
- unsigned char *keyptr;
+ const unsigned char *keyptr;
size_t keylen;
if (initkey(key, &keyptr, &keylen))
memset(key, 0, keylen + 10);
}
-static int findchunk(const unsigned char *keyptr, size_t keylen, const char *chunk, unsigned char **chunkptr) {
+static int findchunk(const unsigned char *keyptr, size_t keylen, const char *chunk, const unsigned char **chunkptr) {
const unsigned char *p;
if ((p = keyptr)) {
@@ -278,7 +278,7 @@ static int findchunk(const unsigned char
if ((p[0] != chunk[0]) || (p[1] != chunk[1])) {
p += 4 + p[2] + p[3];
} else {
- if (chunkptr) *chunkptr = (unsigned char*)p + 4;
+ if (chunkptr) *chunkptr = p + 4;
return p[2] + p[3];
}
}
@@ -332,7 +332,7 @@ static void dumpkey(const nuint8 *key, s
static int checkkey(const unsigned char *key) { /* 0 - wrong key, != 0 - key ok */
unsigned char temp[8];
- unsigned char *keyptr, *p;
+ const unsigned char *keyptr, *p;
size_t keylen;
if ((initkey(key, &keyptr, &keylen)) &&
@@ -350,12 +350,12 @@ static ncpt_mutex_t mpilock = NCPT_MUTEX
static ncpt_mutex_t mpilock = NCPT_MUTEX_INITIALIZER;
static long modexpkey(const unsigned char *s_key, unsigned char *buf, unsigned char *outbuf, int bufsize) {
- unsigned char *s_keyptr;
+ const unsigned char *s_keyptr;
size_t s_keylen;
int i, nbits, nblocksize;
int err = -1;
unitptr nmod, nexp, nin, nout;
- unsigned char *p;
+ const unsigned char *p;
nmod = nexp = nin = nout = NULL;
@@ -402,7 +402,7 @@ end1:
/* ctx must be in WCHAR_T mode, without DCV_CANONICALIZE_NAMES */
static NWDSCCODE get_public_key(NWDSContextHandle ctx, const wchar_t* objname, nuint8 **key) {
- unsigned char *keybuf, *kptr;
+ const unsigned char *keybuf, *kptr;
NWDSCCODE err;
size_t keylen, ofs, klen;
Octet_String_T* ost;
@@ -420,12 +420,14 @@ static NWDSCCODE get_public_key(NWDSCont
goto err_exit;
}
if (key) {
- if (!(kptr = malloc(klen + 10))) {
+ unsigned char *kbuf;
+
+ if (!(kbuf = malloc(klen + 10))) {
err = ENOMEM;
goto err_exit;
}
- memcpy(kptr, keybuf + ofs, klen + 10);
- *key = kptr;
+ memcpy(kbuf, keybuf + ofs, klen + 10);
+ *key = kbuf;
}
err = 0;
err_exit:
@@ -1073,7 +1075,8 @@ err_exit:
static unsigned char *allocfillchunk(const unsigned char *keyptr, int keylen,
const char *chunk, int destsize) {
- unsigned char *p, *p2;
+ const unsigned char *p;
+ unsigned char *p2;
int i;
i = findchunk(keyptr, keylen, chunk, &p);
@@ -1108,7 +1111,7 @@ static NWDSCCODE gen_auth_data(
const nuint8* authid,
nuint8 *loginstrc,
int loginstrc_len) {
- nuint8 *keyptr;
+ const unsigned char *keyptr;
size_t keylen;
int i, j;
int nbits, nblocksize, nbytes, nblocksize_nw;
@@ -1117,6 +1120,7 @@ static NWDSCCODE gen_auth_data(
unitptr n_key_dp, n_key_dq;
unitptr up, up2;
unitptr randbuf;
+ const unsigned char *pkey;
nuint8 *p;
nuint8 *tempbuf;
nuint8 hashbuf[0x42];
@@ -1127,12 +1131,12 @@ static NWDSCCODE gen_auth_data(
ISRPrint("Initkey failed\n");
return ERR_INVALID_SERVER_RESPONSE;
}
- i = findchunk(keyptr, keylen, "NN", &p);
- if (!p) {
+ i = findchunk(keyptr, keylen, "NN", &pkey);
+ if (!pkey) {
ISRPrint("NN chunk not found\n");
return ERR_INVALID_SERVER_RESPONSE;
}
- nbits = countbits_l(p, i);
+ nbits = countbits_l(pkey, i);
nbytes = (nbits + 7) >> 3;
nmask = (unsigned char)(255 >> (8 - (nbits & 7)));
/* we really want (x + 31) & ~15... I'm sorry, but Novell thinks that way */
@@ -1828,7 +1832,7 @@ NWDSCCODE __NWGenerateKeyPair(
void* privkey,
size_t* privkey_len
) {
- nuint8 def_exp[] = { 1, 0, 1};
+ static const nuint8 def_exp[] = { 1, 0, 1};
struct keyparam kp;
NWDSCCODE err;
size_t bits;

View File

@@ -0,0 +1,66 @@
changeset: 440:7f46ab032bd8
user: Petr Vandrovec <petr@vandrovec.name>
date: Mon Jul 04 00:01:49 2005 +0100
files: lib/ndslib.c lib/ndslib_i.h
description:
Rename exp argument to n_exp in ndslib.
Rename exp to n_exp (and exp_len to n_exp_len) to get rid
of warning that exp argument shadows exp() mathematic
function. Although we do not use exp() function anywhere,
it is gcc builtin internal, and exists in the namespace
since compilation start.
diff -r 0ba24cdb345c -r 7f46ab032bd8 lib/ndslib.c
--- a/lib/ndslib.c Sun Jul 03 23:57:27 2005 +0100
+++ b/lib/ndslib.c Mon Jul 04 00:01:49 2005 +0100
@@ -1825,8 +1825,8 @@ static int ComputeKey(struct keyparam *k
NWDSCCODE __NWGenerateKeyPair(
size_t key_len,
- const void* exp,
- size_t exp_len,
+ const void* n_exp,
+ size_t n_exp_len,
void* pubkey,
size_t* pubkey_len,
void* privkey,
@@ -1839,19 +1839,19 @@ NWDSCCODE __NWGenerateKeyPair(
size_t words; /* netware native units */
if (!pubkey || !pubkey_len || !privkey || !privkey_len) return -2;
- if (!key_len || !exp || !exp_len) {
- exp = def_exp;
- exp_len = sizeof(def_exp);
+ if (!key_len || !n_exp || !n_exp_len) {
+ n_exp = def_exp;
+ n_exp_len = sizeof(def_exp);
key_len = 420; /* well, at least 620 does work too */
} else {
- if ((key_len > 760) || (key_len < 256) || (key_len & 1) || (exp_len > 16)) {
+ if ((key_len > 760) || (key_len < 256) || (key_len & 1) || (n_exp_len > 16)) {
return NWE_PARAM_INVALID;
}
}
memset(&kp, 0, sizeof(kp));
kp.BA = 48;
kp.BL = key_len;
- memcpy(kp.n_exp, exp, exp_len);
+ memcpy(kp.n_exp, n_exp, n_exp_len);
ncpt_mutex_lock(&mpilock);
set_precision(bits2units(kp.BL) + SLOP_BITS);
if ((countbits(kp.n_exp) > kp.BL) || !(kp.n_exp[0] & 1)) {
diff -r 0ba24cdb345c -r 7f46ab032bd8 lib/ndslib_i.h
--- a/lib/ndslib_i.h Sun Jul 03 23:57:27 2005 +0100
+++ b/lib/ndslib_i.h Mon Jul 04 00:01:49 2005 +0100
@@ -38,7 +38,7 @@ NWDSCCODE NWDSGetKeys(NWDSContextHandle
/* ctx must be in wchar_t mode */
NWDSCCODE __NWDSGetPublicKeyFromConnection(NWDSContextHandle ctx,
NWCONN_HANDLE conn, nuint8 **skey);
-NWDSCCODE __NWGenerateKeyPair(size_t key_len, const void* exp, size_t exp_len,
+NWDSCCODE __NWGenerateKeyPair(size_t key_len, const void* n_exp, size_t n_exp_len,
void* pubkey, size_t* pubkey_len,
void* privkey, size_t* privkey_len);
NWDSCCODE __NWEncryptWithSK(const void* hashsrc, size_t hashsrclen,

View File

@@ -0,0 +1,977 @@
changeset: 441:fbfcfbb3c88d
user: Petr Vandrovec <petr@vandrovec.name>
date: Mon Jul 11 00:42:47 2005 +0100
files: contrib/testing/dirlimit.c contrib/testing/dssearch.c contrib/testing/eaops.c contrib/testing/fileinfo.c contrib/testing/large.c contrib/testing/mkfile.c contrib/testing/nsfileinfo.c contrib/testing/nwdsgethost.c contrib/testing/nwdspartlist.c contrib/testing/pp/getconn_addr.c contrib/testing/pp/nwgetconnlist.c contrib/testing/readaddr.c contrib/testing/readadef.c contrib/testing/readcls.c contrib/testing/resint.c contrib/testing/timeinfo.c contrib/testing/wcsmbs-tst1.c ipx-1.0/Samples/ipxrcv.c ipx-1.0/Samples/ipxsend.c ipx-1.0/Samples/rip.c ipx-1.0/Samples/sap.c lib/ncplib.c lib/nwclient.c sutil/ncpm_common.c util/nwdir.c util/nwuserlist.c
description:
Fix printf argument mismatches revealed by gcc-4.0 on amd64.
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/dirlimit.c
--- a/contrib/testing/dirlimit.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/dirlimit.c Mon Jul 11 00:42:47 2005 +0100
@@ -146,9 +146,9 @@ int main(int argc, char *argv[]) {
} else {
size_t c;
- printf("%u entries returned\n", x.numEntries);
+ printf("%zu entries returned\n", x.numEntries);
for (c = 0; c < x.numEntries; c++) {
- printf("Entry %u: Level: %u\n", c, x.list[c].level);
+ printf("Entry %zu: Level: %u\n", c, x.list[c].level);
printf(" Max: %u\n", x.list[c].max);
printf(" Current: %u\n", x.list[c].current);
printf(" Used: %u\n", x.list[c].max - x.list[c].current);
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/dssearch.c
--- a/contrib/testing/dssearch.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/dssearch.c Mon Jul 11 00:42:47 2005 +0100
@@ -163,7 +163,7 @@ static void prtattr(NWDSContextHandle ct
size_t rl = sizeof(name);
while ((rl > 0) && (name[rl - 1] == '\xEE')) rl--;
if (cs != rl) {
- printf("SYNT %d: computed: %u, real: %u\n", synt, cs, rl);
+ printf("SYNT %d: computed: %zu, real: %zu\n", synt, cs, rl);
}
}
switch (synt) {
@@ -181,7 +181,7 @@ static void prtattr(NWDSContextHandle ct
Octet_String_T* os = (Octet_String_T*)name;
size_t i;
- printf("%s Value: length=%u\n", pref, os->length);
+ printf("%s Value: length=%zu\n", pref, os->length);
printf("%s ", pref);
for (i = 0; i < os->length; i++)
printf("%02X ", os->data[i]);
@@ -214,7 +214,7 @@ static void prtattr(NWDSContextHandle ct
size_t z;
printf("%s Type: %u\n", pref, na->addressType);
- printf("%s Length: %u\n", pref, na->addressLength);
+ printf("%s Length: %zu\n", pref, na->addressLength);
printf("%s Data: ", pref);
for (z = 0; z < na->addressLength; z++)
printf("%02X ", na->address[z]);
@@ -231,12 +231,12 @@ static void prtattr(NWDSContextHandle ct
printf("%s Server Name: '%s'\n", pref, rp->serverName);
printf("%s Replica Type: %u\n", pref, rp->replicaType);
printf("%s Replica Number: %u\n", pref, rp->replicaNumber);
- printf("%s Address Count: %u\n", pref, rp->count);
+ printf("%s Address Count: %zu\n", pref, rp->count);
for (cntv = rp->count, qp = rp->replicaAddressHint; cntv--; qp++) {
size_t z;
printf("%s Type: %u\n", pref, qp->addressType);
- printf("%s Length: %u\n", pref, qp->addressLength);
+ printf("%s Length: %zu\n", pref, qp->addressLength);
printf("%s Data: ", pref);
for (z = 0; z < qp->addressLength; z++)
printf("%02X ", qp->address[z]);
@@ -292,7 +292,7 @@ static void prtattr(NWDSContextHandle ct
for (; ol; ol = ol->next) {
size_t i;
- printf("%s Value: Length: %u\n", pref, ol->length);
+ printf("%s Value: Length: %zu\n", pref, ol->length);
printf("%s ", pref);
for (i = 0; i < ol->length; i++)
printf("%02X ", ol->data[i]);
@@ -313,7 +313,7 @@ static void prtattr(NWDSContextHandle ct
Fax_Number_T* fn = (Fax_Number_T*)name;
printf("%s Fax Number: '%s'\n", pref, fn->telephoneNumber);
- printf("%s Parameter bits: %u\n", pref, fn->parameters.numOfBits);
+ printf("%s Parameter bits: %zu\n", pref, fn->parameters.numOfBits);
}
break;
case SYN_EMAIL_ADDRESS:
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/eaops.c
--- a/contrib/testing/eaops.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/eaops.c Mon Jul 11 00:42:47 2005 +0100
@@ -90,10 +90,10 @@ static void eaenum0(NWCONN_HANDLE conn,
fprintf(stderr, "Enumeration extended fail: %s\n",
strnwerror((winfo.errorCode & 0xFF) | NWE_SERVER_ERROR));
} else {
- printf("Total EAs: %u\n", winfo.totalEAs);
- printf("DataSize: %u\n", winfo.totalEAsDataSize);
- printf("KeySize: %u\n", winfo.totalEAsKeySize);
- printf("New EA handle: %08X\n", winfo.newEAhandle);
+ printf("Total EAs: %lu\n", (unsigned long)winfo.totalEAs);
+ printf("DataSize: %lu\n", (unsigned long)winfo.totalEAsDataSize);
+ printf("KeySize: %lu\n", (unsigned long)winfo.totalEAsKeySize);
+ printf("New EA handle: %08lX\n", (unsigned long)winfo.newEAhandle);
}
if (winfo.newEAhandle) {
/* should not happen as we used NWEA_FL_CLOSE_IMM */
@@ -111,7 +111,7 @@ static void eaenum1(NWCONN_HANDLE conn,
struct ncp_ea_enumerate_info winfo;
NWCCODE err;
int sawtitle = 0;
- size_t eaid = 1;
+ unsigned int eaid = 1;
winfo.enumSequence = 0;
err = ncp_ea_enumerate(conn,
@@ -134,15 +134,15 @@ static void eaenum1(NWCONN_HANDLE conn,
}
if (!sawtitle) {
- printf("Total EAs: %u\n", winfo.totalEAs);
- printf("DataSize: %u\n", winfo.totalEAsDataSize);
- printf("KeySize: %u\n", winfo.totalEAsKeySize);
+ printf("Total EAs: %lu\n", (unsigned long)winfo.totalEAs);
+ printf("DataSize: %lu\n", (unsigned long)winfo.totalEAsDataSize);
+ printf("KeySize: %lu\n", (unsigned long)winfo.totalEAsKeySize);
sawtitle = 1;
}
- printf("New EA handle: %08X\n", winfo.newEAhandle);
- printf("New search seq: %u\n", winfo.enumSequence);
- printf("Returned items: %u\n", winfo.returnedItems);
- printf("Size: %u\n", pos);
+ printf("New EA handle: %08lX\n", (unsigned long)winfo.newEAhandle);
+ printf("New search seq: %lu\n", (unsigned long)winfo.enumSequence);
+ printf("Returned items: %lu\n", (unsigned long)winfo.returnedItems);
+ printf("Size: %zu\n", pos);
p = vv;
for (rinfo = 0; rinfo < winfo.returnedItems; rinfo++) {
@@ -156,8 +156,8 @@ static void eaenum1(NWCONN_HANDLE conn,
else {
printf(" Key %u:\n", eaid);
printf(" Name: %s\n", ppp.key);
- printf(" Access Flag: %08X\n", ppp.accessFlag);
- printf(" Value Length: %u\n", ppp.valueLength);
+ printf(" Access Flag: %08lX\n", (unsigned long)ppp.accessFlag);
+ printf(" Value Length: %lu\n", (unsigned long)ppp.valueLength);
}
eaid++;
}
@@ -183,7 +183,7 @@ static void eaenum6(NWCONN_HANDLE conn,
size_t pos;
struct ncp_ea_enumerate_info winfo;
NWCCODE err;
- size_t eaid = 1;
+ unsigned int eaid = 1;
winfo.enumSequence = 0;
err = ncp_ea_enumerate(conn,
@@ -202,13 +202,13 @@ static void eaenum6(NWCONN_HANDLE conn,
size_t rinfo;
const unsigned char* p;
- printf("Total EAs: %u\n", winfo.totalEAs);
- printf("DataSize: %u\n", winfo.totalEAsDataSize);
- printf("KeySize: %u\n", winfo.totalEAsKeySize);
- printf("New EA handle: %08X\n", winfo.newEAhandle);
- printf("New search seq: %u\n", winfo.enumSequence);
- printf("Returned items: %u\n", winfo.returnedItems);
- printf("Size: %u\n", pos);
+ printf("Total EAs: %lu\n", (unsigned long)winfo.totalEAs);
+ printf("DataSize: %lu\n", (unsigned long)winfo.totalEAsDataSize);
+ printf("KeySize: %lu\n", (unsigned long)winfo.totalEAsKeySize);
+ printf("New EA handle: %08lX\n", (unsigned long)winfo.newEAhandle);
+ printf("New search seq: %lu\n", (unsigned long)winfo.enumSequence);
+ printf("Returned items: %lu\n", (unsigned long)winfo.returnedItems);
+ printf("Size: %zu\n", pos);
p = vv;
for (rinfo = 0; rinfo < winfo.returnedItems; rinfo++) {
@@ -222,10 +222,10 @@ static void eaenum6(NWCONN_HANDLE conn,
else {
printf(" Key %u:\n", eaid);
printf(" Name: %s\n", ppp.key);
- printf(" Access Flag: %08X\n", ppp.accessFlag);
- printf(" Value Length: %u\n", ppp.valueLength);
- printf(" Key Extants: %u\n", ppp.keyExtants);
- printf(" Value Extants: %u\n", ppp.valueExtants);
+ printf(" Access Flag: %08lX\n", (unsigned long)ppp.accessFlag);
+ printf(" Value Length: %lu\n", (unsigned long)ppp.valueLength);
+ printf(" Key Extants: %lu\n", (unsigned long)ppp.keyExtants);
+ printf(" Value Extants: %lu\n", (unsigned long)ppp.valueExtants);
}
eaid++;
}
@@ -246,7 +246,7 @@ static void eaenum7(NWCONN_HANDLE conn,
struct ncp_ea_enumerate_info winfo;
NWCCODE err;
int sawtitle = 0;
- size_t eaid = 1;
+ unsigned int eaid = 1;
winfo.enumSequence = 0;
err = ncp_ea_enumerate(conn,
@@ -269,15 +269,15 @@ static void eaenum7(NWCONN_HANDLE conn,
}
if (!sawtitle) {
- printf("Total EAs: %u\n", winfo.totalEAs);
- printf("DataSize: %u\n", winfo.totalEAsDataSize);
- printf("KeySize: %u\n", winfo.totalEAsKeySize);
+ printf("Total EAs: %lu\n", (unsigned long)winfo.totalEAs);
+ printf("DataSize: %lu\n", (unsigned long)winfo.totalEAsDataSize);
+ printf("KeySize: %lu\n", (unsigned long)winfo.totalEAsKeySize);
sawtitle = 1;
}
- printf("New EA handle: %08X\n", winfo.newEAhandle);
- printf("New search seq: %u\n", winfo.enumSequence);
- printf("Returned items: %u\n", winfo.returnedItems);
- printf("Size: %u\n", pos);
+ printf("New EA handle: %08lX\n", (unsigned long)winfo.newEAhandle);
+ printf("New search seq: %lu\n", (unsigned long)winfo.enumSequence);
+ printf("Returned items: %lu\n", (unsigned long)winfo.returnedItems);
+ printf("Size: %zu\n", pos);
p = vv;
for (rinfo = 0; rinfo < winfo.returnedItems; rinfo++) {
@@ -335,13 +335,13 @@ static void eaenumX(NWCONN_HANDLE conn,
break;
}
- printf("Total EAs: %u\n", winfo.totalEAs);
- printf("DataSize: %u\n", winfo.totalEAsDataSize);
- printf("KeySize: %u\n", winfo.totalEAsKeySize);
- printf("New EA handle: %08X\n", winfo.newEAhandle);
- printf("New search seq: %u\n", winfo.enumSequence);
- printf("Returned items: %u\n", winfo.returnedItems);
- printf("Size: %u\n", pos);
+ printf("Total EAs: %lu\n", (unsigned long)winfo.totalEAs);
+ printf("DataSize: %lu\n", (unsigned long)winfo.totalEAsDataSize);
+ printf("KeySize: %lu\n", (unsigned long)winfo.totalEAsKeySize);
+ printf("New EA handle: %08lX\n", (unsigned long)winfo.newEAhandle);
+ printf("New search seq: %lu\n", (unsigned long)winfo.enumSequence);
+ printf("Returned items: %lu\n", (unsigned long)winfo.returnedItems);
+ printf("Size: %zu\n", pos);
printf("Returned data: ");
p = vv;
@@ -396,16 +396,16 @@ static void eawritebuf(NWCONN_HANDLE con
break;
}
if (winfo.written != tbs) {
- fprintf(stderr, "Partial write: %u instead of %u\n",
- winfo.written, tbs);
+ fprintf(stderr, "Partial write: %lu instead of %zu\n",
+ (unsigned long)winfo.written, tbs);
break;
}
cpos += winfo.written;
if (cpos >= buflen) {
- printf("Successfully written %u bytes\n", cpos);
- break;
- }
- printf("%u\r", cpos); fflush(stdout);
+ printf("Successfully written %zu bytes\n", cpos);
+ break;
+ }
+ printf("%zu\r", cpos); fflush(stdout);
attrname = "";
dirent = 0;
@@ -459,7 +459,7 @@ static void eawrite(NWCONN_HANDLE conn,
if (!nb) {
fprintf(stderr, "Cannot allocate memory: %s\n",
strerror(errno));
- printf("Continuing with %u bytes read\n",
+ printf("Continuing with %zu bytes read\n",
used);
break;
}
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/fileinfo.c
--- a/contrib/testing/fileinfo.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/fileinfo.c Mon Jul 11 00:42:47 2005 +0100
@@ -69,21 +69,21 @@ help(void)
static void printstruct2(u_int32_t rim, struct nw_info_struct2* info) {
if (rim & RIM_SPACE_ALLOCATED) {
- printf("Space Allocated: %08LX (%Ld)\n", info->SpaceAllocated,
- info->SpaceAllocated);
+ printf("Space Allocated: %08llX (%lld)\n", (unsigned long long)info->SpaceAllocated,
+ (unsigned long long)info->SpaceAllocated);
}
if (rim & RIM_ATTRIBUTES) {
printf("Attributes: %08X\n", info->Attributes.Attributes);
printf("Flags: %04X\n", info->Attributes.Flags);
}
if (rim & (RIM_DATA_SIZE | RIM_SIZE64)) {
- printf("Data Size: %08LX (%Ld)\n", info->DataSize,
- info->DataSize);
+ printf("Data Size: %08llX (%lld)\n", (unsigned long long)info->DataSize,
+ (unsigned long long)info->DataSize);
}
if (rim & RIM_TOTAL_SIZE) {
printf("Total Size: %08X (%d)\n", info->TotalSize.TotalAllocated,
info->TotalSize.TotalAllocated);
- printf("Datastreams: %d\n", info->TotalSize.Datastreams);
+ printf("Datastreams: %zd\n", info->TotalSize.Datastreams);
}
if (rim & RIM_EXT_ATTR_INFO) {
printf("ExtAttrInfo.DataSize: %08X (%d)\n", info->ExtAttrInfo.DataSize,
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/large.c
--- a/contrib/testing/large.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/large.c Mon Jul 11 00:42:47 2005 +0100
@@ -64,21 +64,21 @@ help(void)
static void printstruct2(u_int32_t rim, struct nw_info_struct2* info) {
if (rim & RIM_SPACE_ALLOCATED) {
- printf("Space Allocated: %08LX (%Ld)\n", info->SpaceAllocated,
- info->SpaceAllocated);
+ printf("Space Allocated: %08llX (%lld)\n", (unsigned long long)info->SpaceAllocated,
+ (unsigned long long)info->SpaceAllocated);
}
if (rim & RIM_ATTRIBUTES) {
printf("Attributes: %08X\n", info->Attributes.Attributes);
printf("Flags: %04X\n", info->Attributes.Flags);
}
if (rim & RIM_DATA_SIZE) {
- printf("Data Size: %08LX (%Ld)\n", info->DataSize,
- info->DataSize);
+ printf("Data Size: %08llX (%lld)\n", (unsigned long long)info->DataSize,
+ (unsigned long long)info->DataSize);
}
if (rim & RIM_TOTAL_SIZE) {
printf("Total Size: %08X (%d)\n", info->TotalSize.TotalAllocated,
info->TotalSize.TotalAllocated);
- printf("Datastreams: %d\n", info->TotalSize.Datastreams);
+ printf("Datastreams: %zd\n", info->TotalSize.Datastreams);
}
if (rim & RIM_EXT_ATTR_INFO) {
printf("ExtAttrInfo.DataSize: %08X (%d)\n", info->ExtAttrInfo.DataSize,
@@ -272,7 +272,7 @@ int main(int argc, char *argv[]) {
dserr = ncp_write64(conn, fh, offs, length, databuffer, &lnw);
printf("64-bit write request done with %s\n", strnwerror(dserr));
if (dserr == 0) {
- printf("%u bytes written\n", lnw);
+ printf("%zu bytes written\n", lnw);
}
} else if (dolen) {
u_int64_t ln;
@@ -280,7 +280,7 @@ int main(int argc, char *argv[]) {
dserr = ncp_get_file_size(conn, fh, &ln);
printf("64-bit file length request done with %s\n", strnwerror(dserr));
if (dserr == 0) {
- printf("%llu bytes (0x%016llX)\n", ln, ln);
+ printf("%llu bytes (0x%016llX)\n", (unsigned long long)ln, (unsigned long long)ln);
}
} else {
size_t lnr;
@@ -288,7 +288,7 @@ int main(int argc, char *argv[]) {
dserr = ncp_read64(conn, fh, offs, length, databuffer, &lnr);
printf("64-bit read request done with %s\n", strnwerror(dserr));
if (dserr == 0) {
- printf("%u bytes read\n", lnr);
+ printf("%zu bytes read\n", lnr);
#if 0
fwrite(databuffer, 1, lnr, stdout);
#else
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/mkfile.c
--- a/contrib/testing/mkfile.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/mkfile.c Mon Jul 11 00:42:47 2005 +0100
@@ -61,21 +61,21 @@ help(void)
static void printstruct2(u_int32_t rim, struct nw_info_struct2* info) {
if (rim & RIM_SPACE_ALLOCATED) {
- printf("Space Allocated: %08LX (%Ld)\n", info->SpaceAllocated,
- info->SpaceAllocated);
+ printf("Space Allocated: %08llX (%lld)\n", (unsigned long long)info->SpaceAllocated,
+ (unsigned long long)info->SpaceAllocated);
}
if (rim & RIM_ATTRIBUTES) {
printf("Attributes: %08X\n", info->Attributes.Attributes);
printf("Flags: %04X\n", info->Attributes.Flags);
}
if (rim & RIM_DATA_SIZE) {
- printf("Data Size: %08LX (%Ld)\n", info->DataSize,
- info->DataSize);
+ printf("Data Size: %08llX (%lld)\n", (unsigned long long)info->DataSize,
+ (unsigned long long)info->DataSize);
}
if (rim & RIM_TOTAL_SIZE) {
printf("Total Size: %08X (%d)\n", info->TotalSize.TotalAllocated,
info->TotalSize.TotalAllocated);
- printf("Datastreams: %d\n", info->TotalSize.Datastreams);
+ printf("Datastreams: %zd\n", info->TotalSize.Datastreams);
}
if (rim & RIM_EXT_ATTR_INFO) {
printf("ExtAttrInfo.DataSize: %08X (%d)\n", info->ExtAttrInfo.DataSize,
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/nsfileinfo.c
--- a/contrib/testing/nsfileinfo.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/nsfileinfo.c Mon Jul 11 00:42:47 2005 +0100
@@ -64,14 +64,14 @@ static void printstruct2(struct ncp_name
static void printstruct2(struct ncp_namespace_format* info) {
int i;
- printf("Bits: Fixed: %08X, count %d\n", info->BitMask.fixed, info->BitsDefined.fixed);
- printf("Bits: Variable: %08X, count %d\n", info->BitMask.variable, info->BitsDefined.variable);
- printf("Bits: Huge: %08X, count %d\n", info->BitMask.huge, info->BitsDefined.huge);
+ printf("Bits: Fixed: %08X, count %zd\n", info->BitMask.fixed, info->BitsDefined.fixed);
+ printf("Bits: Variable: %08X, count %zd\n", info->BitMask.variable, info->BitsDefined.variable);
+ printf("Bits: Huge: %08X, count %zd\n", info->BitMask.huge, info->BitsDefined.huge);
for (i = 0; i < 32; i++) {
int prt = 0;
- int mask = 1 << i;
+ unsigned int mask = 1 << i;
- printf("Field %02X: %d bytes (", i, info->FieldsLength[i]);
+ printf("Field %02X: %zd bytes (", i, info->FieldsLength[i]);
if (info->BitMask.fixed & mask) {
printf("fixed");
prt = 1;
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/nwdsgethost.c
--- a/contrib/testing/nwdsgethost.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/nwdsgethost.c Mon Jul 11 00:42:47 2005 +0100
@@ -273,7 +273,7 @@ int main(int argc, char *argv[]) {
size_t rl = sizeof(name);
while ((rl > 0) && (name[rl - 1] == '\xEE')) rl--;
if (cs != rl) {
- printf("SYNT %d: computed: %u, real: %u\n", synt, cs, rl);
+ printf("SYNT %d: computed: %zu, real: %zu\n", synt, cs, rl);
}
}
switch (synt) {
@@ -291,7 +291,7 @@ int main(int argc, char *argv[]) {
Octet_String_T* os = (Octet_String_T*)name;
size_t i;
- printf(" Value: length=%u\n", os->length);
+ printf(" Value: length=%zu\n", os->length);
printf(" ");
for (i = 0; i < os->length; i++)
printf("%02X ", os->data[i]);
@@ -324,7 +324,7 @@ int main(int argc, char *argv[]) {
size_t z;
printf(" Type: %u\n", na->addressType);
- printf(" Length: %u\n", na->addressLength);
+ printf(" Length: %zu\n", na->addressLength);
printf(" Data: ");
for (z = 0; z < na->addressLength; z++)
printf("%02X ", na->address[z]);
@@ -341,12 +341,12 @@ int main(int argc, char *argv[]) {
printf(" Server Name: '%s'\n", rp->serverName);
printf(" Replica Type: %u\n", rp->replicaType);
printf(" Replica Number: %u\n", rp->replicaNumber);
- printf(" Address Count: %u\n", rp->count);
+ printf(" Address Count: %zu\n", rp->count);
for (rpcnt = rp->count, qp = rp->replicaAddressHint; rpcnt--; qp++) {
size_t z;
printf(" Type: %u\n", qp->addressType);
- printf(" Length: %u\n", qp->addressLength);
+ printf(" Length: %zu\n", qp->addressLength);
printf(" Data: ");
for (z = 0; z < qp->addressLength; z++)
printf("%02X ", qp->address[z]);
@@ -402,7 +402,7 @@ int main(int argc, char *argv[]) {
for (; ol; ol = ol->next) {
size_t i;
- printf(" Value: Length: %u\n", ol->length);
+ printf(" Value: Length: %zu\n", ol->length);
printf(" ");
for (i = 0; i < ol->length; i++)
printf("%02X ", ol->data[i]);
@@ -423,7 +423,7 @@ int main(int argc, char *argv[]) {
Fax_Number_T* fn = (Fax_Number_T*)name;
printf(" Fax Number: '%s'\n", fn->telephoneNumber);
- printf(" Parameter bits: %u\n", fn->parameters.numOfBits);
+ printf(" Parameter bits: %zu\n", fn->parameters.numOfBits);
}
break;
case SYN_EMAIL_ADDRESS:
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/nwdspartlist.c
--- a/contrib/testing/nwdspartlist.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/nwdspartlist.c Mon Jul 11 00:42:47 2005 +0100
@@ -252,7 +252,7 @@ int main(int argc, char *argv[]) {
printf("Server %s holds %u partitions\n",
sn, cnt);
while (!dserr && cnt--) {
- printf("Partition #%u\n", pcnt++);
+ printf("Partition #%zu\n", pcnt++);
if (req_present) {
char* start;
char* end;
@@ -273,7 +273,7 @@ int main(int argc, char *argv[]) {
nuint32 bit;
size_t len;
- printf(" Partition info length: %10u\n", end - start);
+ printf(" Partition info length: %10zu\n", end - start);
if (req & DSP_OUTPUT_FIELDS) {
dserr = NWDSGetPartitionExtInfo(ctx, start, end, DSP_OUTPUT_FIELDS, &len, &pt);
if (dserr) {
@@ -281,7 +281,7 @@ int main(int argc, char *argv[]) {
strnwerror(dserr));
pt = req;
} else {
- printf(" Output fields: %08X (%u bytes)\n", pt, len);
+ printf(" Output fields: %08X (%zu bytes)\n", pt, len);
}
} else {
pt = req;
@@ -295,38 +295,38 @@ int main(int argc, char *argv[]) {
else {
switch (bit) {
case DSP_PARTITION_ID:
- printf(" Partition ID: %08X (%u bytes)\n", info.id, len);
+ printf(" Partition ID: %08X (%zu bytes)\n", info.id, len);
break;
case DSP_REPLICA_STATE:
- printf(" Replica state: %10u (%u bytes)\n", info.x32, len);
+ printf(" Replica state: %10u (%zu bytes)\n", info.x32, len);
break;
case DSP_MODIFICATION_TIMESTAMP:
- printf(" Modification timestamp: %10u.%u.%u (%u bytes)\n",
+ printf(" Modification timestamp: %10u.%u.%u (%zu bytes)\n",
info.ts.wholeSeconds, info.ts.replicaNum,
info.ts.eventID, len);
break;
case DSP_PURGE_TIME:
- printf(" Purge time: %10u (%u bytes)\n",
+ printf(" Purge time: %10u (%zu bytes)\n",
info.x32, len);
break;
case DSP_LOCAL_PARTITION_ID:
- printf(" Local partition ID: %10u (%u bytes)\n",
+ printf(" Local partition ID: %10u (%zu bytes)\n",
info.x32, len);
break;
case DSP_PARTITION_DN:
- printf(" Partition DN: %s (%u bytes)\n",
+ printf(" Partition DN: %s (%zu bytes)\n",
info.name, len);
break;
case DSP_REPLICA_TYPE:
- printf(" Replica type: %10u (%u bytes)\n",
+ printf(" Replica type: %10u (%zu bytes)\n",
info.x32, len);
break;
case DSP_PARTITION_BUSY:
- printf(" Partition busy: %10u (%u bytes)\n",
+ printf(" Partition busy: %10u (%zu bytes)\n",
info.x32, len);
break;
default:
- printf(" Unknown %08X: %10u (%u bytes)\n",
+ printf(" Unknown %08X: %10u (%zu bytes)\n",
bit, info.x32, len);
break;
}
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/pp/getconn_addr.c
--- a/contrib/testing/pp/getconn_addr.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/pp/getconn_addr.c Mon Jul 11 00:42:47 2005 +0100
@@ -129,7 +129,7 @@ int main(int argc, char *argv[]) {
printf (" got the following tran address: \n");
printf ("TYPE:%d \n",ta.type);
- printf ("LEN: %d \n",ta.len);
+ printf ("LEN: %zd \n",ta.len);
for (i=0; i<ta.len;i++)
printf ("%x ",myBuf[i]);
printf("\n");
@@ -155,7 +155,7 @@ int main(int argc, char *argv[]) {
printf (" got the following tran address: \n");
printf ("TYPE:%d \n",ta.type);
- printf ("LEN: %d \n",ta.len);
+ printf ("LEN: %zd \n",ta.len);
for (i=0; i<mySize;i++)
printf ("%x ",myBuf[i]);
printf("\n");
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/pp/nwgetconnlist.c
--- a/contrib/testing/pp/nwgetconnlist.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/pp/nwgetconnlist.c Mon Jul 11 00:42:47 2005 +0100
@@ -159,7 +159,7 @@ dump_hex(const char *_msg, const unsigne
dump_hex(const char *_msg, const unsigned char *_buf, size_t _len)
{
static char sym[] = "0123456789ABCDEF";
- printf( "len = %d:msg->%s", _len, _msg);
+ printf( "len = %zd:msg->%s", _len, _msg);
for (; _len > 0; _len--, _buf++) {
putc(sym[(*_buf) >> 4],stdout);
putc(sym[(*_buf) & 0x0F],stdout);
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/readaddr.c
--- a/contrib/testing/readaddr.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/readaddr.c Mon Jul 11 00:42:47 2005 +0100
@@ -182,7 +182,7 @@ int main(int argc, char *argv[]) {
}
p = (Net_Address_T*)malloc(len);
if (!p) {
- fprintf(stderr, "malloc(%u): Out of memory\n",
+ fprintf(stderr, "malloc(%zu): Out of memory\n",
len);
break;
}
@@ -231,7 +231,7 @@ int main(int argc, char *argv[]) {
break;
}
if (!printed) {
- printf("Address: %d, len: %d, content: ", p->addressType, p->addressLength);
+ printf("Address: %d, len: %zd, content: ", p->addressType, p->addressLength);
while (len--) {
printf("%02X ", *v++);
}
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/readadef.c
--- a/contrib/testing/readadef.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/readadef.c Mon Jul 11 00:42:47 2005 +0100
@@ -278,7 +278,7 @@ int main(int argc, char *argv[]) {
printf(" Syntax ID: %d\n", ainfo.attrSyntaxID);
printf(" Lower boundary: %d\n", ainfo.attrLower);
printf(" Upper boundary: %d\n", ainfo.attrUpper);
- printf(" ASN1: %d chars, ", ainfo.asn1ID.length);
+ printf(" ASN1: %zd chars, ", ainfo.asn1ID.length);
for (asnp = 0; asnp < ainfo.asn1ID.length; asnp++)
printf("%02X", ainfo.asn1ID.data[asnp]);
printf("\n");
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/readcls.c
--- a/contrib/testing/readcls.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/readcls.c Mon Jul 11 00:42:47 2005 +0100
@@ -297,7 +297,7 @@ int main(int argc, char *argv[]) {
}
printf(" Class: '%s'\n", name);
printf(" Flags: %08X\n", cinfo.classFlags);
- printf(" ASN1: %d chars, ", cinfo.asn1ID.length);
+ printf(" ASN1: %zd chars, ", cinfo.asn1ID.length);
for (asnp = 0; asnp < cinfo.asn1ID.length; asnp++)
printf("%02X", cinfo.asn1ID.data[asnp]);
printf("\n");
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/resint.c
--- a/contrib/testing/resint.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/resint.c Mon Jul 11 00:42:47 2005 +0100
@@ -242,7 +242,7 @@ lll:;
buff = buffT->curPos;
l = buffT->dataend - buff;
- printf("Resolved: %d bytes\n", l);
+ printf("Resolved: %zd bytes\n", l);
x = 0;
if (l < 4) goto dump;
val = DVAL_LH(buff, x);
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/timeinfo.c
--- a/contrib/testing/timeinfo.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/timeinfo.c Mon Jul 11 00:42:47 2005 +0100
@@ -138,7 +138,7 @@ static void DemoGetTime(NWCONN_HANDLE co
fprintf(stderr, "NCP 114.1 failed with %s\n", strnwerror(err));
return;
}
- printf("Returned data length (at least 28): %u\n", rp->fragSize);
+ printf("Returned data length (at least 28): %zu\n", rp->fragSize);
printf("Seconds: %u\n", *(u_int32_t*)rpbuff);
printf("Fractions: 0x%08X (%u)\n", *(u_int32_t*)(rpbuff + 4), *(u_int32_t*)(rpbuff + 4));
printf("Flags: 0x%08X\n", *(u_int32_t*)(rpbuff + 8));
@@ -160,7 +160,7 @@ static void DemoGetVersion(NWCONN_HANDLE
fprintf(stderr, "NCP 114.12 failed with %s\n", strnwerror(err));
return;
}
- printf("Returned data length (at least 4): %u\n", rp->fragSize);
+ printf("Returned data length (at least 4): %zu\n", rp->fragSize);
printf("Version: 0x%08X (%u)\n", *(u_int32_t*)rpbuff, *(u_int32_t*)rpbuff);
}
@@ -176,7 +176,7 @@ static void DemoGetGarbage(NWCONN_HANDLE
fprintf(stderr, "NCP 114.6 failed with %s\n", strnwerror(err));
return;
}
- printf("Returned data length: %u\n", rp->fragSize);
+ printf("Returned data length: %zu\n", rp->fragSize);
printf("Data: ");
for (i = 0; i < rp->fragSize; i++)
printf(" %02X", rpbuff[i]);
diff -r 7f46ab032bd8 -r fbfcfbb3c88d contrib/testing/wcsmbs-tst1.c
--- a/contrib/testing/wcsmbs-tst1.c Mon Jul 04 00:01:49 2005 +0100
+++ b/contrib/testing/wcsmbs-tst1.c Mon Jul 11 00:42:47 2005 +0100
@@ -20,7 +20,7 @@ main (void)
pchar= setlocale (LC_ALL, "");
printf ("locale : %s\n",pchar);
- printf ("MB_CUR_MAX %d\n", MB_CUR_MAX);
+ printf ("MB_CUR_MAX %zd\n", MB_CUR_MAX);
puts("---- test 1 ------");
test = mbstowcs (tmp, str, (strlen (str) + 1) * sizeof (char));
diff -r 7f46ab032bd8 -r fbfcfbb3c88d ipx-1.0/Samples/ipxrcv.c
--- a/ipx-1.0/Samples/ipxrcv.c Mon Jul 04 00:01:49 2005 +0100
+++ b/ipx-1.0/Samples/ipxrcv.c Mon Jul 11 00:42:47 2005 +0100
@@ -7,7 +7,7 @@ main(int argc, char **argv)
int s;
int result;
char msg[100];
- int len;
+ socklen_t len;
s = socket(AF_IPX, SOCK_DGRAM, AF_IPX);
if (s < 0)
@@ -19,7 +19,6 @@ main(int argc, char **argv)
sipx.sipx_network = 0;
sipx.sipx_port = htons(0x5000);
sipx.sipx_type = 17;
- len = sizeof(sipx);
result = bind(s, (struct sockaddr *) &sipx, sizeof(sipx));
if (result < 0)
{
@@ -27,6 +26,7 @@ main(int argc, char **argv)
exit(-1);
}
msg[0] = '\0';
+ len = sizeof(sipx);
result = recvfrom(s, msg, sizeof(msg), 0, (struct sockaddr *) &sipx,
&len);
if (result < 0)
diff -r 7f46ab032bd8 -r fbfcfbb3c88d ipx-1.0/Samples/ipxsend.c
--- a/ipx-1.0/Samples/ipxsend.c Mon Jul 04 00:01:49 2005 +0100
+++ b/ipx-1.0/Samples/ipxsend.c Mon Jul 11 00:42:47 2005 +0100
@@ -7,7 +7,7 @@ main(int argc, char **argv)
int s;
int result;
char msg[100] = "Hi Mom";
- int len = sizeof(sipx);
+ socklen_t len = sizeof(sipx);
s = socket(AF_IPX, SOCK_DGRAM, AF_IPX);
if (s < 0)
diff -r 7f46ab032bd8 -r fbfcfbb3c88d ipx-1.0/Samples/rip.c
--- a/ipx-1.0/Samples/rip.c Mon Jul 04 00:01:49 2005 +0100
+++ b/ipx-1.0/Samples/rip.c Mon Jul 11 00:42:47 2005 +0100
@@ -14,7 +14,6 @@ main(int argc, char **argv)
int result;
int s;
char msg[1024];
- int len;
char *bptr;
struct rip_data *rp;
@@ -36,6 +35,7 @@ main(int argc, char **argv)
}
while (1)
{
+ socklen_t len;
size_t rclen;
len = sizeof(sipx);
diff -r 7f46ab032bd8 -r fbfcfbb3c88d ipx-1.0/Samples/sap.c
--- a/ipx-1.0/Samples/sap.c Mon Jul 04 00:01:49 2005 +0100
+++ b/ipx-1.0/Samples/sap.c Mon Jul 11 00:42:47 2005 +0100
@@ -18,7 +18,6 @@ main(int argc, char **argv)
struct sockaddr_ipx sipx;
char msg[1024];
long val = 0;
- int len;
char *bptr;
struct sap_data *sp;
@@ -47,6 +46,7 @@ main(int argc, char **argv)
}
while (1)
{
+ socklen_t len;
size_t rclen;
len = 1024;
@@ -64,7 +64,7 @@ main(int argc, char **argv)
rclen = result - 2;
bptr = msg;
printf("SAP: OP is %x %x\n", bptr[0], bptr[1]);
- printf("Length is %u\n", rclen);
+ printf("Length is %zu\n", rclen);
if (bptr[1] != 2)
continue;
diff -r 7f46ab032bd8 -r fbfcfbb3c88d lib/ncplib.c
--- a/lib/ncplib.c Mon Jul 04 00:01:49 2005 +0100
+++ b/lib/ncplib.c Mon Jul 11 00:42:47 2005 +0100
@@ -665,7 +665,7 @@ static void run_wdog(struct ncp_conn *co
default:
if (pfd[0].revents & POLLIN) {
struct sockaddr_ipx sender;
- int sizeofaddr = sizeof(struct sockaddr_ipx);
+ socklen_t sizeofaddr = sizeof(struct sockaddr_ipx);
unsigned char buf[1024];
size_t pktsize;
NWCCODE err;
@@ -1016,7 +1016,7 @@ do_ncp_tcp_call(struct ncp_conn *conn, u
return ECONNABORTED;
}
if (ln > sizeof(conn->packet) - 2) {
- fprintf(stderr, "Too long reply: %u\n", ln);
+ fprintf(stderr, "Too long reply: %zu\n", ln);
return ECONNABORTED;
}
result = do_tcp_rcv(conn->ncp_sock, conn->packet + 2, ln);
diff -r 7f46ab032bd8 -r fbfcfbb3c88d lib/nwclient.c
--- a/lib/nwclient.c Mon Jul 04 00:01:49 2005 +0100
+++ b/lib/nwclient.c Mon Jul 11 00:42:47 2005 +0100
@@ -714,7 +714,7 @@ NWDSCCODE NWCXAttachToTreeByName( NWCONN
/* try to speed up search of all servers but first checking that treeName exists */
{
- nuint32 scanIndex=-1;
+ nint32 scanIndex=-1;
char myTreeName [MAX_DN_CHARS+1];
NWDSContextHandle ctx;
int found=0;
@@ -856,7 +856,7 @@ static NWDSCCODE __docopy_string (UNUSED
case SYN_FAX_NUMBER:{
const Fax_Number_T* fn = (const Fax_Number_T*)val;
- l = snprintf(result, maxSize, "%s,%u", fn->telephoneNumber, fn->parameters.numOfBits);
+ l = snprintf(result, maxSize, "%s,%zu", fn->telephoneNumber, fn->parameters.numOfBits);
}
break;
case SYN_EMAIL_ADDRESS:{
@@ -923,7 +923,7 @@ static NWDSCCODE __docopy_string (UNUSED
if (20 + (ol->length+1)*3+1 >=maxSize)
return NWE_BUFFER_OVERFLOW;
- sprintf(result, "%u", ol->length);
+ sprintf(result, "%zu", ol->length);
aux = result + strlen(result);
for (i = 0; i < ol->length; i++) {
sprintf(aux, ",%02X", ol->data[i]);
@@ -940,7 +940,7 @@ static NWDSCCODE __docopy_string (UNUSED
#endif
if (20 + (os->length+1)*3+1 >=maxSize)
return NWE_BUFFER_OVERFLOW;
- sprintf(result, "%u", os->length);
+ sprintf(result, "%zu", os->length);
aux = result + strlen(result);
for (i = 0; i < os->length; i++) {
sprintf(aux, ",%02X", os->data[i]);
@@ -956,7 +956,7 @@ static NWDSCCODE __docopy_string (UNUSED
z=na->addressLength;
if (40 + 3*(z+2)+1 >=maxSize)
return NWE_BUFFER_OVERFLOW;
- sprintf(result, "%u,%u", na->addressType, na->addressLength);
+ sprintf(result, "%u,%zu", na->addressType, na->addressLength);
aux = result + strlen(result);
for (z = 0; z < na->addressLength; z++) {
sprintf(aux, ",%02X", na->address[z]);
diff -r 7f46ab032bd8 -r fbfcfbb3c88d sutil/ncpm_common.c
--- a/sutil/ncpm_common.c Mon Jul 04 00:01:49 2005 +0100
+++ b/sutil/ncpm_common.c Mon Jul 11 00:42:47 2005 +0100
@@ -219,7 +219,7 @@ static int load_ncpfs(void)
return 1;
} else if (pid == 0)
{
- char *myenv[] = {
+ const char *myenv[] = {
"PATH=/sbin:/usr/sbin:/bin:/usr/bin",
NULL
};
@@ -875,7 +875,7 @@ static void ncp_ctl_cmd(unsigned int cmd
char xxx[1024]; /* "cmd=XXXXXXXXXXX, len=XXXXXXXXX, data:" + 3x300 chars */
char* p;
- sprintf(xxx, "cmd=%u, len=%u, data:", cmd, datalen);
+ sprintf(xxx, "cmd=%u, len=%zu, data:", cmd, datalen);
p = xxx + strlen(xxx);
if (datalen > 300) {
datalen = 300;
diff -r 7f46ab032bd8 -r fbfcfbb3c88d util/nwdir.c
--- a/util/nwdir.c Mon Jul 04 00:01:49 2005 +0100
+++ b/util/nwdir.c Mon Jul 11 00:42:47 2005 +0100
@@ -283,7 +283,7 @@ static void eaenum(NWCONN_HANDLE conn, u
struct ncp_ea_enumerate_info winfo;
NWCCODE err;
int sawtitle = 0;
- size_t eaid = 1;
+ unsigned int eaid = 1;
winfo.enumSequence = 0;
err = ncp_ea_enumerate(conn,
@@ -308,9 +308,9 @@ static void eaenum(NWCONN_HANDLE conn, u
if (!winfo.totalEAs)
break;
if (!sawtitle) {
- printf(_("Extended attributes: %u attributes\n"
- " %u bytes in keys, %u bytes in data\n"),
- winfo.totalEAs, winfo.totalEAsKeySize, winfo.totalEAsDataSize);
+ printf(_("Extended attributes: %lu attributes\n"
+ " %lu bytes in keys, %lu bytes in data\n"),
+ (unsigned long)winfo.totalEAs, (unsigned long)winfo.totalEAsKeySize, (unsigned long)winfo.totalEAsDataSize);
sawtitle = 1;
}
@@ -326,10 +326,10 @@ static void eaenum(NWCONN_HANDLE conn, u
else {
printf(_(" Key %u:\n"
" Name: %s\n"
- " Access Flag: 0x%08X\n"
- " Value Length: %u\n"),
+ " Access Flag: 0x%08zX\n"
+ " Value Length: %lu\n"),
eaid, ppp.key, ppp.accessFlag,
- ppp.valueLength);
+ (unsigned long)ppp.valueLength);
}
eaid++;
}
@@ -364,12 +364,12 @@ static void dumpDataSizes(const struct n
if (err) {
printf(_(" Cannot determine file size: %s\n"), strnwerror(err));
} else {
- printf(_(" File size: %10Lu"), off);
+ printf(_(" File size: %10llu"), (unsigned long long)off);
err = ncp_ns_extract_info_field(info, NSIF_SPACE_ALLOCATED,
&off, sizeof(off));
if (!err) {
- printf(_(" (allocated %Lu)"), off * 8ULL);
+ printf(_(" (allocated %llu)"), off * 8ULL);
}
printf("\n");
}
@@ -411,16 +411,16 @@ static void dumpDataSizes(const struct n
u_int32_t num = logical->ds[i].Number;
if (num) {
- printf(_(" Stream %3u size: %10Lu"), num,
- logical->ds[i].Size);
+ printf(_(" Stream %3u size: %10llu"), num,
+ (unsigned long long)logical->ds[i].Size);
} else {
- printf(_(" File size: %10Lu"),
- logical->ds[i].Size);
+ printf(_(" File size: %10llu"),
+ (unsigned long long)logical->ds[i].Size);
}
if (size) {
for (j = 0; j < size->NumberOfDatastreams; j++) {
if (size->ds[j].Number == num) {
- printf(_(" (allocated %Lu)"),
+ printf(_(" (allocated %llu)"),
((ncp_off64_t)size->ds[j].FATBlockSize) * 512ULL);
break;
}
@@ -774,7 +774,7 @@ static void dumpit(NWCONN_HANDLE conn, c
doID(conn, o.object_id);
}
printf("\n");
- printf(_(" Range: 0x%08LX-0x%08LX\n"), pl.recordStart, pl.recordEnd);
+ printf(_(" Range: 0x%08llX-0x%08llX\n"), (unsigned long long)pl.recordStart, (unsigned long long)pl.recordEnd);
}
}
if (!first) {
diff -r 7f46ab032bd8 -r fbfcfbb3c88d util/nwuserlist.c
--- a/util/nwuserlist.c Mon Jul 04 00:01:49 2005 +0100
+++ b/util/nwuserlist.c Mon Jul 11 00:42:47 2005 +0100
@@ -149,7 +149,7 @@ static void print_value(int format, cons
unsigned int div;
if (format == 0) {
- printf(_(" %-21s%llu %s\n"), title, value, units);
+ printf(_(" %-21s%llu %s\n"), title, (unsigned long long)value, units);
return;
}
if (format == 1) {
@@ -163,9 +163,9 @@ static void print_value(int format, cons
unitptr++;
}
if (unitptr == si_prefixes) {
- printf(_(" %-21s%5llu %s\n"), title, value, units);
+ printf(_(" %-21s%5llu %s\n"), title, (unsigned long long)value, units);
} else {
- printf(_(" %-21s%5llu %c%s\n"), title, value, *unitptr, units);
+ printf(_(" %-21s%5llu %c%s\n"), title, (unsigned long long)value, *unitptr, units);
}
}

View File

@@ -0,0 +1,60 @@
changeset: 442:093f842dbd98
user: Petr Vandrovec <petr@vandrovec.name>
date: Mon Jul 11 00:44:36 2005 +0100
files: include/ncp/ipxlib.h lib/resolve.c
description:
Fix few remaining unsigned char pointer <-> signed char pointer conversion warnings.
diff -r fbfcfbb3c88d -r 093f842dbd98 include/ncp/ipxlib.h
--- a/include/ncp/ipxlib.h Mon Jul 11 00:42:47 2005 +0100
+++ b/include/ncp/ipxlib.h Mon Jul 11 00:44:36 2005 +0100
@@ -94,8 +94,8 @@ struct ipx_rip_packet
#define IPX_BROADCAST_NODE "\xff\xff\xff\xff\xff\xff"
#define IPX_THIS_NODE "\0\0\0\0\0\0"
#else
-#define IPX_BROADCAST_NODE ("\xff\xff\xff\xff\xff\xff")
-#define IPX_THIS_NODE ("\0\0\0\0\0\0")
+#define IPX_BROADCAST_NODE ((const u_int8_t*)"\xff\xff\xff\xff\xff\xff")
+#define IPX_THIS_NODE ((const u_int8_t*)"\0\0\0\0\0\0")
#endif
#define IPX_THIS_NET (0)
diff -r fbfcfbb3c88d -r 093f842dbd98 lib/resolve.c
--- a/lib/resolve.c Mon Jul 11 00:42:47 2005 +0100
+++ b/lib/resolve.c Mon Jul 11 00:44:36 2005 +0100
@@ -429,13 +429,13 @@ static void sap_report(int fd, const str
}
}
-static int sap_name_cmp(const unsigned char *my, const unsigned char *net, size_t cmplen) {
+static int sap_name_cmp(const unsigned char *my, const char *net, size_t cmplen) {
if (memcmp(my, net, cmplen)) {
size_t ln;
/* If it is exact match, allow trailing spaces and garbage after
terminating zero. */
- ln = strnlen(my, cmplen);
+ ln = strnlen((const char*)my, cmplen);
if (memcmp(my, net, ln)) {
return 1;
}
@@ -635,7 +635,7 @@ static NWCCODE sap_start(void **prh, UNU
if (ln >= NW_MAX_SERVER_NAME_LEN) {
return ENAMETOOLONG;
}
- memcpy_toupper(sap_request + 4, name, ln);
+ memcpy_toupper((char*)sap_request + 4, name, ln);
if (ln < 48) {
memset(sap_request + 4 + ln, 0, 48 - ln);
}
@@ -650,7 +650,7 @@ static NWCCODE sap_start(void **prh, UNU
if (ln >= NW_MAX_SERVER_NAME_LEN) {
return ENAMETOOLONG;
}
- memcpy_toupper(sap_request + 4, name, ln);
+ memcpy_toupper((char*)sap_request + 4, name, ln);
if (ln <= 32) {
if (ln < 32) {
memset(sap_request + 4 + ln, '_', 32 - ln);

View File

@@ -0,0 +1,128 @@
changeset: 443:c943b66ae2f6
user: vana@ppc.vc.cvut.cz
date: Mon Jul 11 02:35:19 2005 +0100
files: util/nwfsinfo.c util/nwfstime.c
description:
Use NWGetFileServerUTCTime() instead of ncp_get_file_server_time()
in nwfsinfo and nwfstime. Fixes problems when server is in different
timezone than client (on NW3.x old ncp_get_file_server_time is still
used).
diff -r 093f842dbd98 -r c943b66ae2f6 util/nwfsinfo.c
--- a/util/nwfsinfo.c Mon Jul 11 00:44:36 2005 +0100
+++ b/util/nwfsinfo.c Mon Jul 11 02:35:19 2005 +0100
@@ -33,6 +33,7 @@
#include <string.h>
#include <ncp/nwcalls.h>
#include <ncp/nwfse.h>
+#include <ncp/nwnet.h>
#include "private/libintl.h"
#define _(X) gettext(X)
@@ -175,8 +176,14 @@ main(int argc, char **argv)
{
time_t t;
int err2;
-
- err2 = ncp_get_file_server_time(conn, &t);
+ nuint32 sec;
+
+ err2 = __NWGetFileServerUTCTime(conn, &sec, NULL, NULL, NULL, NULL, NULL, NULL);
+ if (err2) {
+ err2 = ncp_get_file_server_time(conn, &t);
+ } else {
+ t = sec;
+ }
if (err2) {
fprintf(stderr, "%s: %s\n", _("could not get server time"),
strnwerror(err2));
diff -r 093f842dbd98 -r c943b66ae2f6 util/nwfstime.c
--- a/util/nwfstime.c Mon Jul 11 00:44:36 2005 +0100
+++ b/util/nwfstime.c Mon Jul 11 02:35:19 2005 +0100
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <sys/time.h>
-#include <ncp/ncplib.h>
+#include <ncp/nwnet.h>
#include "private/libintl.h"
#define _(X) gettext(X)
@@ -124,32 +124,51 @@ main(int argc, char **argv)
ncp_close(conn);
return 1;
}
- } else
- { int offset;
- time_t last;
+ } else {
+ unsigned int offset;
+ nuint32 sec, xsec;
- if ((err = ncp_get_file_server_time(conn, &t)) != 0)
- {
- get_error: com_err(argv[0], err, _("when getting file server time"));
- ncp_close(conn);
- return 1;
+ err = __NWGetFileServerUTCTime(conn, &sec, &xsec, NULL, NULL, NULL, NULL, NULL);
+ if (err != 0) {
+ if ((err = ncp_get_file_server_time(conn, &t)) != 0) {
+ get_error: com_err(argv[0], err, _("when getting file server time"));
+ ncp_close(conn);
+ return 1;
+ }
+ if (accurate) {
+ time_t last;
+
+ do {
+ if ((err = ncp_get_file_server_time(conn, &last)) != 0)
+ goto get_error;
+ } while (last == t);
+ t = last;
+ offset = 0; /* we can read the time 1000s of times a second */
+ } else {
+ offset = 500000; /* if no accurate measure, then assume offset of 500ms */
+ }
+ } else {
+ if (accurate) {
+ nuint32 last;
+
+ do {
+ offset = (xsec * 1000000ULL) >> 32;
+ if (offset > 100) {
+ usleep(1000000 - offset);
+ }
+ if ((err = __NWGetFileServerUTCTime(conn, &last, &xsec, NULL, NULL, NULL, NULL, NULL)) != 0) {
+ goto get_error;
+ }
+ } while (last == sec);
+ t = last;
+ } else {
+ t = sec;
+ }
+ offset = (xsec * 1000000ULL) >> 32;
}
-
- if(accurate)
- {
- do
- { if ((err = ncp_get_file_server_time(conn, &last)) != 0)
- goto get_error;
- } while(last==t);
- t=last;
- offset=0; /* we can read the time 1000s of times a second */
- }
- else
- offset=500; /* if no accurate measure, then assume offset of 500ms */
-
- if(get)
- { timeval.tv_sec = t;
- timeval.tv_usec = offset*1000;
+ if (get) {
+ timeval.tv_sec = t;
+ timeval.tv_usec = offset;
settimeofday(&timeval, NULL);
}
{

View File

@@ -0,0 +1,32 @@
changeset: 444:34ddb26e48fa
user: vana@ppc.vc.cvut.cz
date: Mon Jul 11 02:36:37 2005 +0100
files: lib/ncplib.c
description:
Fix ncpfs against NW3.x servers. It was not possible to reuse
existing connection as connection to NW3.x server was never marked
as authenticated.
diff -r c943b66ae2f6 -r 34ddb26e48fa lib/ncplib.c
--- a/lib/ncplib.c Mon Jul 11 02:35:19 2005 +0100
+++ b/lib/ncplib.c Mon Jul 11 02:36:37 2005 +0100
@@ -1946,9 +1946,14 @@ static int ncp_do_open_fd(int fd, struct
#ifdef SIGNATURES
ncp_sign_init_perm(result);
#endif
- if (!ncp_get_private_key(result, NULL, &klen)) {
- if (klen > 10) {
- result->connState |= CONNECTION_AUTHENTICATED;
+ if (!ncp_get_private_key(result, NULL, &klen) && klen > 10) {
+ result->connState |= CONNECTION_AUTHENTICATED;
+ } else {
+ nuint8 level;
+ NWCCODE err = NWGetBinderyAccessLevel(result, &level, NULL);
+
+ if (err == 0 && level != 0) {
+ result->connState |= CONNECTION_AUTHENTICATED | CONNECTION_LICENSED;
}
}
result->bcast_state = NWCC_BCAST_PERMIT_UNKNOWN;

View File

@@ -0,0 +1,146 @@
changeset: 445:66c5f4287bbb
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat Jul 23 21:58:13 2005 +0100
files: lib/strops.c
description:
Improve ncp_str_to_perms - now it accepts both [RFA] and RFA,
and you can use both nothing, space and '-' for flags which
are not set.
diff -r 34ddb26e48fa -r 66c5f4287bbb lib/strops.c
--- a/lib/strops.c Mon Jul 11 02:36:37 2005 +0100
+++ b/lib/strops.c Sat Jul 23 21:58:13 2005 +0100
@@ -44,6 +44,7 @@
#include <string.h>
#include <stdarg.h>
+#include <ctype.h>
#include "private/libintl.h"
#define _(X) dgettext(NCPFS_PACKAGE, (X))
@@ -419,56 +420,79 @@ char* ncp_perms_to_str(char r[11], const
}
/* The following function converts a rights string of format [SRWCEMFA]
- into an integer. It will tolerate spaces, lower case and repeated
- letters, even if this takes the length well over 10 characters, but
- must be terminated with square brackets. If such a string containing
- spaces is given as a command line option it will have to be quoted. */
+ or SRWCEMFA into an integer. It will tolerate spaces, lower case and
+ repeated letters, even if this takes the length well over 10 characters.
+ For unset rights you can use spaces or dashes. For no rights you can
+ use either empty string, '-' or '[]' (or their combination, '[-]' or '[ ]'). */
int ncp_str_to_perms(const char *r, u_int16_t *rights)
{
u_int16_t result = 0;
-
- if (*r == '[') {
- do {
- ++r;
- switch (*r) {
- case ' ' :
- case ']' :
- break;
- case 's' :
- case 'S' :
- result |= NCP_PERM_SUPER; break;
- case 'r' :
- case 'R' :
- result |= NCP_PERM_READ; break;
- case 'w' :
- case 'W' :
- result |= NCP_PERM_WRITE; break;
- case 'c' :
- case 'C' :
- result |= NCP_PERM_CREATE; break;
- case 'e' :
- case 'E' :
- result |= NCP_PERM_DELETE; break;
- case 'm' :
- case 'M' :
- result |= NCP_PERM_MODIFY; break;
- case 'f' :
- case 'F' :
- result |= NCP_PERM_SEARCH; break;
- case 'a' :
- case 'A' :
- result |= NCP_PERM_OWNER; break;
- default :
+ int state = 0;
+
+ while (*r) {
+ int c = *r++;
+
+ c = toupper(c);
+ if (isspace(c)) {
+ continue;
+ }
+ switch (c) {
+ case '[':
+ if (state != 0) {
return -1;
- }
- } while (*r != ']');
- /* Now to be generous and ignore trailing spaces */
- do { ++r; } while (*r == ' ');
- if (*r == '\0') {
- *rights = result;
- return 0;
+ }
+ state = 2;
+ continue;
+ case ']':
+ if (state != 2 && state != 3) {
+ return -1;
+ }
+ state = 4;
+ continue;
+ case '-':
+ break;
+ case 'S':
+ result |= NCP_PERM_SUPER;
+ break;
+ case 'R':
+ result |= NCP_PERM_READ;
+ break;
+ case 'W':
+ result |= NCP_PERM_WRITE;
+ break;
+ case 'C':
+ result |= NCP_PERM_CREATE;
+ break;
+ case 'E':
+ result |= NCP_PERM_DELETE;
+ break;
+ case 'M':
+ result |= NCP_PERM_MODIFY;
+ break;
+ case 'F':
+ result |= NCP_PERM_SEARCH;
+ break;
+ case 'A':
+ result |= NCP_PERM_OWNER;
+ break;
+ default:
+ return -1;
}
+ state |= 1;
+ }
+ /* These states are illegal:
+ state == 2 => [
+ state == 3 => [SRWCEMFA
+ state == 5 => [SRWCEMFA]SRW
+ These states are allowed:
+ state == 0 => <whitespaces only>
+ state == 1 => SRWCEMFA
+ state == 4 => [SRWCEMFA]
+ */
+ if (state == 0 || state == 1 || state == 4) {
+ *rights = result;
+ return 0;
}
return -1;
}

View File

@@ -0,0 +1,413 @@
changeset: 446:07b8031b5209
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat Jul 23 22:22:26 2005 +0100
files: man/nwgrant.8 man/nwrevoke.8 util/nwgrant.c util/nwrevoke.c
description:
Add ability to specify object by its ID to nwgrant and nwrevoke.
To make long story short, upgrade from Netware5 to Netware6
kindly converted all rights granted to [Public] to rights
granted to non-existant object with ID 0xFFFFFFFF. And
patched nwrevoke was only tool willing to remove them.
diff -r 66c5f4287bbb -r 07b8031b5209 man/nwgrant.8
--- a/man/nwgrant.8 Sat Jul 23 21:58:13 2005 +0100
+++ b/man/nwgrant.8 Sat Jul 23 22:22:26 2005 +0100
@@ -2,42 +2,17 @@
.SH NAME
nwgrant \- Add Trustee Rights to a directory
.SH SYNOPSIS
-.B nwgrant
-[
-.B -h
-] [
-.B -S
-.I server
-] [
-.B -U
-.I user name
-] [
-.B -P
-.I password
-|
-.B -n
-] [
-.B -C
-] [
-.B -o
-.I object name
-] [
-.B -t
-.I type
-] [
-.B -r
-.I rights
-]
-.B file/directory
+\fBnwgrant\fP [ \fB-h\fP ] [ \fB-S\fP \fIserver\fP ]
+[ \fB-U\fP \fIuser name\fP ] [ \fB-P\fP \fIpassword\fP | \fB-n\fP ]
+[ \fB-C\fP ] [ \fB-o\fP \fIobject name\fP | \fB-O\fP \fIobject id\fP ]
+[ \fB-t\fP \fItype\fP ] [ \fB-r\fP \fIrights\fP ] \fBfile/directory\fP
.SH DESCRIPTION
.B nwgrant
adds the specified bindery object with the corresponding trustee
rights to the directory.
-.B nwgrant
-looks up the file
-.I $HOME/.nwclient
+\fBnwgrant\fP looks up the file \fI$HOME/.nwclient\fP
to find a file server, a user name and possibly a password. See
nwclient(5) for more information. Please note that the access
permissions of $HOME/.nwclient MUST be 600 for security reasons.
@@ -68,10 +43,7 @@ is the user name to use for login.
.I password
.RS 3
.B password
-is the password to use for login. If neither
-.B -n
-nor
-.B -P
+is the password to use for login. If neither \fB-n\fP nor \fB-P\fP
are given, and the user has no open connection to the server, nwgrant
prompts for a password.
.RE
@@ -96,11 +68,16 @@ The name of the object to be added as tr
The name of the object to be added as trustee.
.RE
+.B -O
+.I object id
+.RS 3
+The id of the object to be added as trustee.
+.RE
+
.B -t
.I object type
.RS 3
-The type of the object.
-.I Object type
+The type of the object. \fIObject type\fP
must be specified as a decimal value. Common values are 1 for user
objects, 2 for group objects and 3 for print queues. Other values are
allowed, but are usually used for specialized applications. If you
@@ -111,18 +88,13 @@ NDS name.
.B -r
.I rights
.RS 3
-You must tell
-.B nwgrant
-which rights it should grant to the bindery object.
-The new rights for the object is specified by
-.I rights,
+You must tell \fBnwgrant\fP which rights it should grant to the bindery
+object. The new rights for the object is specified by \fIrights\fP,
which can be either a hexadecimal number representing the sum of all
the individual rights to be granted or a string containing characters
-representing each right. If rights are represented in string format
-then the string must be bounded with square brackets. Characters
-within the brackets may be in any order and in either case. Spaces are
-allowed between the brackets - in which case the entire string should be
-quoted.
+representing each right. Characters within the brackets may be in
+any order and in either case. Spaces are allowed between the
+brackets - in which case the entire string should be quoted.
Hexadecimal and character values for the rights are shown in this table:
00 = no access
diff -r 66c5f4287bbb -r 07b8031b5209 man/nwrevoke.8
--- a/man/nwrevoke.8 Sat Jul 23 21:58:13 2005 +0100
+++ b/man/nwrevoke.8 Sat Jul 23 22:22:26 2005 +0100
@@ -2,33 +2,10 @@
.SH NAME
nwrevoke \- Revoke a Trustee Right from a directory
.SH SYNOPSIS
-.B nwrevoke
-[
-.B -h
-] [
-.B -S
-.I server
-] [
-.B -U
-.I user name
-] [
-.B -P
-.I password
-|
-.B -n
-] [
-.B -C
-] [
-.B -o
-.I object name
-] [
-.B -t
-.I type
-] [
-.B -r
-.I rights
-]
-.B file/directory
+\fBnwrevoke\fP [ \fB-h\fP ] [ \fB-S\fP \fIserver\fP ]
+[ \fB-U\fP \fIuser name\fP ] [ \fB-P\fP \fIpassword\fP | \fB-n\fP ]
+[ \fB-C\fP ] [ \fB-o\fP \fIobject name\fP | \fB-O\fP \fIobject ID\fP ]
+[ \fB-t\fP \fItype\fP ] \fBfile/directory\fP
.SH DESCRIPTION
.B nwrevoke
@@ -80,7 +57,12 @@ this conversion by \fB-C\fP.
\fB-o\fP \fIobject name\fP
.RS 3
-The name of the object to be added as trustee.
+The name of the object to be revoked as trustee.
+.RE
+
+\fB-O\fP \fIobject ID\fP
+.RS 3
+The ID of the object to be revoked as trustee.
.RE
\fB-t\fP \fIobject type\fP
diff -r 66c5f4287bbb -r 07b8031b5209 util/nwgrant.c
--- a/util/nwgrant.c Sat Jul 23 21:58:13 2005 +0100
+++ b/util/nwgrant.c Sat Jul 23 22:22:26 2005 +0100
@@ -46,6 +46,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include "private/libintl.h"
#define _(X) gettext(X)
@@ -73,6 +74,7 @@ help(void)
"\n"
"-o object_name Name of object added as trustee\n"
"-t type Object type (decimal value)\n"
+ "-O object_id Object identifier\n"
"-r rights Rights mask (see manual page)\n"
"\n"
"directory\n"
@@ -85,7 +87,6 @@ main(int argc, char *argv[])
struct ncp_conn *conn;
char *object_name = NULL;
int object_type = -1;
- struct ncp_bindery_object o;
u_int16_t rights = ~0;
int perr = 0;
const char *path = NULL;
@@ -98,6 +99,8 @@ main(int argc, char *argv[])
int enclen;
TRUSTEE_INFO tstinfo;
NWCCODE nwerr;
+ NWObjectID object_id;
+ int object_id_valid = 0;
setlocale(LC_ALL, "");
bindtextdomain(NCPFS_PACKAGE, LOCALEDIR);
@@ -109,10 +112,14 @@ main(int argc, char *argv[])
{
useConn = 1;
}
- while ((opt = getopt(argc, argv, "h?o:t:r:")) != EOF)
+ while ((opt = getopt(argc, argv, "h?O:o:t:r:")) != EOF)
{
switch (opt)
{
+ case 'O':
+ object_id = strtoul(optarg, NULL, 0);
+ object_id_valid = 1;
+ break;
case 'o':
object_name = optarg;
str_upper(object_name);
@@ -121,10 +128,14 @@ main(int argc, char *argv[])
object_type = atoi(optarg);
break;
case 'r':
- if (*optarg == '[') {
- perr = ncp_str_to_perms(optarg, &rights);
- } else {
- rights = strtol(optarg, NULL, 16);
+ perr = ncp_str_to_perms(optarg, &rights);
+ if (perr) {
+ char* end;
+
+ rights = strtol(optarg, &end, 16);
+ if (!*end || isspace(*end)) {
+ perr = 0;
+ }
}
break;
case 'h':
@@ -137,12 +148,6 @@ main(int argc, char *argv[])
}
}
- if (object_name == NULL)
- {
- fprintf(stderr, _("%s: You must specify an object name\n"),
- argv[0]);
- goto finished;
- }
if (perr < 0)
{
fprintf(stderr, _("%s: You must give a valid rights string\n"),
@@ -181,7 +186,13 @@ main(int argc, char *argv[])
path = volume;
}
- if (object_type < 0) {
+ if (object_id_valid) {
+ /* nothing */
+ } else if (object_name == NULL) {
+ fprintf(stderr, _("%s: You must specify an object name\n"),
+ argv[0]);
+ goto finished;
+ } else if (object_type < 0) {
#ifdef NDS_SUPPORT
u_int32_t flags;
NWDSContextHandle ctx;
@@ -201,7 +212,7 @@ failDS:;
flags |= DCV_XLATE_STRINGS | DCV_TYPELESS_NAMES;
NWDSSetContext(ctx, DCK_FLAGS, &flags);
}
- nwerr = NWDSMapNameToID(ctx, conn, object_name, &o.object_id);
+ nwerr = NWDSMapNameToID(ctx, conn, object_name, &object_id);
if (nwerr) {
goto failDS;
}
@@ -212,12 +223,15 @@ failDS:;
goto finished;
#endif
} else {
+ struct ncp_bindery_object o;
+
if ((nwerr = ncp_get_bindery_object_id(conn, object_type, object_name, &o)) != 0)
{
fprintf(stderr, _("%s: Could not find object %s: %s\n"),
progname, object_name, strnwerror(nwerr));
goto finished;
}
+ object_id = o.object_id;
}
enclen = ncp_path_to_NW_format(path, encpath, sizeof(encpath));
if (enclen < 0) {
@@ -225,7 +239,7 @@ failDS:;
progname, strerror(-enclen));
goto finished;
}
- tstinfo.objectID = o.object_id;
+ tstinfo.objectID = object_id;
tstinfo.objectRights = rights;
nwerr = ncp_ns_trustee_add(conn, NW_NS_DOS, SA_ALL,
NCP_DIRSTYLE_NOHANDLE, 0, 0, encpath, enclen, &tstinfo, 1, ~0);
diff -r 66c5f4287bbb -r 07b8031b5209 util/nwrevoke.c
--- a/util/nwrevoke.c Sat Jul 23 21:58:13 2005 +0100
+++ b/util/nwrevoke.c Sat Jul 23 22:22:26 2005 +0100
@@ -65,6 +65,7 @@ help(void)
"\n"
"-o object_name Name of object removed as trustee\n"
"-t type Object type (decimal value)\n"
+ "-O object_id Object identifier\n"
"\n"
"file/directory\n"
"\n"));
@@ -76,7 +77,6 @@ main(int argc, char *argv[])
struct ncp_conn *conn;
char *object_name = NULL;
int object_type = -1;
- struct ncp_bindery_object o;
const char *path = NULL;
long err;
int result = 1;
@@ -87,6 +87,8 @@ main(int argc, char *argv[])
TRUSTEE_INFO tstinfo;
int useConn = 0;
NWDSCCODE nwerr;
+ NWObjectID object_id;
+ int object_id_valid = 0;
setlocale(LC_ALL, "");
bindtextdomain(NCPFS_PACKAGE, LOCALEDIR);
@@ -98,10 +100,14 @@ main(int argc, char *argv[])
{
useConn = 1;
}
- while ((opt = getopt(argc, argv, "h?o:t:")) != EOF)
+ while ((opt = getopt(argc, argv, "h?o:t:O:")) != EOF)
{
switch (opt)
{
+ case 'O':
+ object_id = strtoul(optarg, NULL, 0);
+ object_id_valid = 1;
+ break;
case 'o':
object_name = optarg;
str_upper(object_name);
@@ -119,12 +125,6 @@ main(int argc, char *argv[])
}
}
- if (object_name == NULL)
- {
- fprintf(stderr, _("%s: You must specify an object name\n"),
- argv[0]);
- goto finished;
- }
if (!useConn) {
if (optind != argc - 1)
{
@@ -150,7 +150,13 @@ main(int argc, char *argv[])
strcat(volume, directory);
path = volume;
}
- if (object_type < 0) {
+ if (object_id_valid) {
+ /* nothing */
+ } else if (object_name == NULL) {
+ fprintf(stderr, _("%s: You must specify an object name\n"),
+ argv[0]);
+ goto finished;
+ } else if (object_type < 0) {
#ifdef NDS_SUPPORT
u_int32_t flags;
NWDSContextHandle ctx;
@@ -170,7 +176,7 @@ failDS:;
if (!NWDSGetContext(ctx, DCK_FLAGS, &flags)) {
flags |= DCV_XLATE_STRINGS | DCV_TYPELESS_NAMES;
}
- nwerr = NWDSMapNameToID(ctx, conn, object_name, &o.object_id);
+ nwerr = NWDSMapNameToID(ctx, conn, object_name, &object_id);
if (nwerr) {
NWDSFreeContext(ctx);
goto failDS;
@@ -182,19 +188,22 @@ failDS:;
goto finished;
#endif
} else {
+ struct ncp_bindery_object o;
+
nwerr = ncp_get_bindery_object_id(conn, object_type, object_name, &o);
if (nwerr != 0) {
fprintf(stderr, _("%s: Could not find object %s: %s\n"),
progname, object_name, strnwerror(nwerr));
goto finished;
}
+ object_id = o.object_id;
}
enclen = ncp_path_to_NW_format(path, encpath, sizeof(encpath));
if (enclen < 0) {
fprintf(stderr, _("%s: Invalid path: %s\n"), progname, strerror(-enclen));
goto finished;
}
- tstinfo.objectID = o.object_id;
+ tstinfo.objectID = object_id;
tstinfo.objectRights = 0;
nwerr = ncp_ns_trustee_del(conn, NW_NS_DOS, 0xFF, 0, 0,
encpath, enclen, &tstinfo, 1);

View File

@@ -0,0 +1,43 @@
changeset: 447:3143e61fb504
user: Petr Vandrovec <petr@vandrovec.name>
date: Thu Sep 29 23:06:24 2005 +0200
files: util/pserver.c
description:
Store ncp_read's result in ssize_t, otherwise errors returned from
ncp_read are treated as large positive integers. Somehow ncp_read
returns an error at the end of file on NetWare 6.5SP4.
Also log these errors to the syslog.
diff -r 07b8031b5209 -r 3143e61fb504 util/pserver.c
--- a/util/pserver.c Sat Jul 23 22:22:26 2005 +0100
+++ b/util/pserver.c Thu Sep 29 23:06:24 2005 +0200
@@ -248,7 +248,7 @@ poll_queue(struct nw_queue *q)
{
/* parent */
char buf[1024];
- size_t result;
+ ssize_t result;
off_t offset = 0;
close(fd[0]); /* close read end */
@@ -257,9 +257,16 @@ poll_queue(struct nw_queue *q)
sizeof(buf), buf)) > 0)
{
offset += result;
- if (write(fd[1], buf, result) != (int)result)
+ if (write(fd[1], buf, result) != result)
{
goto fail;
+ }
+ }
+ if (result < 0) {
+ if (result == -1) {
+ syslog(LOG_ERR, _("ncp_read: unknown error\n"));
+ } else {
+ syslog(LOG_ERR, _("ncp_read: %m\n"));
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,21 @@
changeset: 449:20cdebe39580
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Oct 16 02:44:08 2005 +0200
files: contrib/ncp_nss_lib/Makefile
description:
Update 'make clean' rule in ncp_nss_lib to remove all build products.
diff -r 1a8455ed3290 -r 20cdebe39580 contrib/ncp_nss_lib/Makefile
--- a/contrib/ncp_nss_lib/Makefile Sun Oct 16 02:40:25 2005 +0200
+++ b/contrib/ncp_nss_lib/Makefile Sun Oct 16 02:44:08 2005 +0200
@@ -87,7 +87,7 @@ dep:
dep:
clean:
- rm -f *.o *.do *.to *~
+ rm -f *.o *.do *.to $(SHARED_NSSLIB) $(SHARED_NSSLIB_BIN) $(UTILS1) *~
mrproper: clean
rm -f $(UTILS) $(DISTFILE)

View File

@@ -0,0 +1,94 @@
changeset: 450:f18f9f05b9b8
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Oct 16 02:52:35 2005 +0200
files: .hgignore contrib/ncp_nss_lib/Makefile contrib/ncp_nss_lib/nss_cfgfile.c
description:
Get ncp_nss_lib to build with gcc4.0. Also fix build process - libnss_ncp.so
is needed for development, libnss_ncp.so.2 is soname, and libnss_ncp.so.2.3 is
library version.
diff -r 20cdebe39580 -r f18f9f05b9b8 .hgignore
--- a/.hgignore Sun Oct 16 02:44:08 2005 +0200
+++ b/.hgignore Sun Oct 16 02:52:35 2005 +0200
@@ -10,7 +10,7 @@
^autom4te.cache/
^config\.log$
^config\.status$
-^contrib/ncp_nss_lib/libnss_ncp\.so\.2$
+^contrib/ncp_nss_lib/libnss_ncp\.so\.
^contrib/ncp_nss_lib/test_ncp_nss$
^contrib/pam/Makefile$
^contrib/php/Makefile$
diff -r 20cdebe39580 -r f18f9f05b9b8 contrib/ncp_nss_lib/Makefile
--- a/contrib/ncp_nss_lib/Makefile Sun Oct 16 02:44:08 2005 +0200
+++ b/contrib/ncp_nss_lib/Makefile Sun Oct 16 02:52:35 2005 +0200
@@ -8,8 +8,8 @@ this_srcdir = ${top_srcdir}/lib
include ${top_builddir}/Make.rules
-VERSION_SOLIB := 2
-VERSION_SONAME := 2.3
+VERSION_SOLIB := 2.3
+VERSION_SONAME := 2
vpath %.c ${this_srcdir}
@@ -80,8 +80,8 @@ install: install_shared
$(O_UTILS1) $(O_TMP1): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) $(CFLAGS_$@) -o $@ -c $<
-$(UTILS1):: %: %.o $(O_TMP1)
- $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(addsuffix .o,$@) $(OBJS_$@) -L$(top_builddir)/lib -lnss_ncp -lncp $(LDFLAGS_$@)
+$(UTILS1):: %: %.o $(O_TMP1) $(SHARED_NSSLIB)
+ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(addsuffix .o,$@) $(OBJS_$@) -L. -lnss_ncp -L$(top_builddir)/lib -lncp $(LDFLAGS_$@)
dep:
@@ -100,8 +100,11 @@ install_shared: $(SHARED_NCPLIB_BIN)
-ldconfig
-$(SHARED_NSSLIB): $(SHARED_NSSLIB_BIN)
+$(SHARED_NSSLIB): $(SHARED_NSSLIB_SONAME)
rm -f $@
+ ln -sf $< $@
+
+$(SHARED_NSSLIB_SONAME): $(SHARED_NSSLIB_BIN)
ln -sf $< $@
$(SHARED_NSSLIB_BIN): $(SHARED_O_OBJ) ${this_srcdir}/libncp.vers
diff -r 20cdebe39580 -r f18f9f05b9b8 contrib/ncp_nss_lib/nss_cfgfile.c
--- a/contrib/ncp_nss_lib/nss_cfgfile.c Sun Oct 16 02:44:08 2005 +0200
+++ b/contrib/ncp_nss_lib/nss_cfgfile.c Sun Oct 16 02:52:35 2005 +0200
@@ -175,13 +175,13 @@ static int process_line (char* cptr, str
}
*eptr = 0;
if (ptr->isNum) {
- (int *)*ptr->value_ptr=strtoul (sptr,&errPtr,0);
+ *(int**)ptr->value_ptr=strtoul (sptr,&errPtr,0);
ptr->found= ((*sptr) && !(*errPtr)); //not empty and no error
} else {
if (eptr>sptr) { // do not take an empty string value
char *v=strdup(sptr);
if (v) {
- (char*) *ptr->value_ptr=v;
+ *(char**)ptr->value_ptr=v;
ptr->found= TRUE;
}else
return 1;
@@ -201,11 +201,11 @@ static int fix_conf (struct check *resul
return 1;
}
if (ptr->isNum) {
- (int *)*ptr->value_ptr=strtoul (ptr->defValue,NULL,0);
+ *(int**)ptr->value_ptr=strtoul (ptr->defValue,NULL,0);
}else {
char * v=strdup(ptr->defValue);
if (v)
- (char*) *ptr->value_ptr=v;
+ *(char**)ptr->value_ptr=v;
else
return 1;
}

View File

@@ -0,0 +1,557 @@
changeset: 451:4d7bb63d7050
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Oct 16 04:07:06 2005 +0200
files: contrib/ncp_nss_lib/nss_cfgfile.c contrib/ncp_nss_lib/nss_cfgfile.h contrib/ncp_nss_lib/nss_ncp.c contrib/ncp_nss_lib/nss_ncp.h contrib/ncp_nss_lib/test_ncp_nss.c
description:
Fix warnings in the nss module. Tweak some functions to not take useless
arguments. Fix some bugs where long ints are printed by %d...
diff -r f18f9f05b9b8 -r 4d7bb63d7050 contrib/ncp_nss_lib/nss_cfgfile.c
--- a/contrib/ncp_nss_lib/nss_cfgfile.c Sun Oct 16 02:52:35 2005 +0200
+++ b/contrib/ncp_nss_lib/nss_cfgfile.c Sun Oct 16 04:07:06 2005 +0200
@@ -40,6 +40,7 @@
#include <sys/syslog.h>
#include "nss_cfgfile.h"
+#include "nss_ncp.h"
// temporary define (waiting for a better Makefile)
#define GLOBALCFGFILE "/etc/ncpfs.conf"
#ifndef GLOBALCFGFILE
@@ -49,7 +50,7 @@
// #define DEBUG 1
-static struct nss_ncp_conf* alloc_nss_ncp_conf (){
+static struct nss_ncp_conf* alloc_nss_ncp_conf (void){
struct nss_ncp_conf * conf;
conf= (struct nss_ncp_conf *)malloc(sizeof(*conf));
@@ -61,7 +62,7 @@ static struct nss_ncp_conf* alloc_nss_nc
void free_nss_ncp_conf (struct nss_ncp_conf *conf){
#define FREEFIELD(x) do if (conf->x) {free(conf->x) ; conf->x=NULL;} while (0);
- if (conf && conf !=&defConf) {
+ if (conf) {
FREEFIELD(server);
FREEFIELD(startCtx);
FREEFIELD(ctrlGroup);
@@ -107,7 +108,7 @@ struct check {
const char *option; /* configuration option */
int mandatory; /* can be empty or null */
int found; /*set to TRUE if found in cfg file */
- void ** value_ptr; /* temporary storage place */
+ char ** value_ptr; /* temporary storage place */
int isNum; /* 1 is numeric, 0 is string*/
const char* defValue;
};
@@ -120,10 +121,10 @@ void printResults (const char * infos,st
for (ptr=results; ptr->option; ptr++) {
if (ptr->isNum)
printf ("option=%s mandatory=%d found=%d value=%d isNum=%d defvalue=%s\n",
- ptr->option,ptr->mandatory,ptr->found,(int*)*ptr->value_ptr,ptr->isNum,ptr->defValue);
+ ptr->option,ptr->mandatory,ptr->found,*(int**)ptr->value_ptr,ptr->isNum,ptr->defValue);
else
printf ("option=%s mandatory=%d found=%d value=%s isNum=%d defvalue=%s\n",
- ptr->option,ptr->mandatory,ptr->found,(char*)*ptr->value_ptr,ptr->isNum,ptr->defValue);
+ ptr->option,ptr->mandatory,ptr->found,*ptr->value_ptr,ptr->isNum,ptr->defValue);
}
}
@@ -175,13 +176,13 @@ static int process_line (char* cptr, str
}
*eptr = 0;
if (ptr->isNum) {
- *(int**)ptr->value_ptr=strtoul (sptr,&errPtr,0);
+ *(int*)ptr->value_ptr=strtoul (sptr,&errPtr,0);
ptr->found= ((*sptr) && !(*errPtr)); //not empty and no error
} else {
if (eptr>sptr) { // do not take an empty string value
char *v=strdup(sptr);
if (v) {
- *(char**)ptr->value_ptr=v;
+ *ptr->value_ptr=v;
ptr->found= TRUE;
}else
return 1;
@@ -201,11 +202,11 @@ static int fix_conf (struct check *resul
return 1;
}
if (ptr->isNum) {
- *(int**)ptr->value_ptr=strtoul (ptr->defValue,NULL,0);
+ *(int*)ptr->value_ptr=strtoul (ptr->defValue,NULL,0);
}else {
char * v=strdup(ptr->defValue);
if (v)
- *(char**)ptr->value_ptr=v;
+ *ptr->value_ptr=v;
else
return 1;
}
@@ -223,22 +224,21 @@ static struct nss_ncp_conf *read_conf_fi
if (!conf)
return NULL;
{
- struct nss_ncp_conf * pconf=conf;
struct check check_confs[] = {
/*option mandat found value_ptr isNum defValue */
- {"debug", FALSE,FALSE,(void**)&conf->debug, TRUE, "0"},
- {"useTree", FALSE,FALSE,(void**)&conf->useTree, TRUE, "0"},
- {"server", TRUE,FALSE, (void**)&conf->server, FALSE, ""},
- {"startCtx", FALSE,FALSE,(void**)&conf->startCtx, FALSE, ""},
- {"ctrlGroup", FALSE,FALSE,(void**)&conf->ctrlGroup, FALSE, ""},
- {"defGid", FALSE,FALSE,(void**)&conf->defGid, TRUE, "100"},
- {"defShell", FALSE,FALSE,(void**)&conf->defShell, FALSE, "/bin/bash"},
- {"fallbackUid", FALSE,FALSE,(void**)&conf->fallbackUid, TRUE, "-1"},
- {"fallbackGid", FALSE,FALSE,(void**)&conf->fallbackGid, TRUE, "-1"},
- {"doPasswd", FALSE,FALSE,(void**)&conf->doPassword, TRUE, "0"},
- {"doGroup", FALSE,FALSE,(void**)&conf->doGroup, TRUE, "0"},
- {"doShadow", FALSE,FALSE,(void**)&conf->doShadow, TRUE, "0"},
- {NULL , FALSE,FALSE,NULL, FALSE, NULL}
+ {"debug", FALSE,FALSE,(char**)&conf->debug, TRUE, "0"},
+ {"useTree", FALSE,FALSE,(char**)&conf->useTree, TRUE, "0"},
+ {"server", TRUE, FALSE, &conf->server, FALSE, ""},
+ {"startCtx", FALSE,FALSE, &conf->startCtx, FALSE, ""},
+ {"ctrlGroup", FALSE,FALSE, &conf->ctrlGroup, FALSE, ""},
+ {"defGid", FALSE,FALSE,(char**)&conf->defGid, TRUE, "100"},
+ {"defShell", FALSE,FALSE, &conf->defShell, FALSE, "/bin/bash"},
+ {"fallbackUid", FALSE,FALSE,(char**)&conf->fallbackUid, TRUE, "-1"},
+ {"fallbackGid", FALSE,FALSE,(char**)&conf->fallbackGid, TRUE, "-1"},
+ {"doPasswd", FALSE,FALSE,(char**)&conf->doPassword, TRUE, "0"},
+ {"doGroup", FALSE,FALSE,(char**)&conf->doGroup, TRUE, "0"},
+ {"doShadow", FALSE,FALSE,(char**)&conf->doShadow, TRUE, "0"},
+ {NULL , FALSE,FALSE, NULL, FALSE, NULL}
};
char cfgline[16384];
@@ -259,7 +259,6 @@ static struct nss_ncp_conf *read_conf_fi
cptr++;
if (*cptr != '[')
continue;
-sstart:;
if (strncasecmp(++cptr, mySection, seclen))
continue;
if (cptr[seclen] != ']')
@@ -299,7 +298,6 @@ ssend:
return conf;
}
-error:
#ifdef DEBUG
printResults("after reading CFG error",check_confs);
#endif
@@ -310,14 +308,12 @@ error:
}
-struct nss_ncp_conf * parse_conf (char * confFile) {
-
+struct nss_ncp_conf* parse_conf(void) {
struct cfgFile *cfg;
struct nss_ncp_conf *conf;
#ifdef DEBUG
printf("entering parse_conf\n");
#endif
- //return &defConf;
cfg = cfgOpenFile(GLOBALCFGFILE, FALSE);
if (!cfg)
return NULL;
diff -r f18f9f05b9b8 -r 4d7bb63d7050 contrib/ncp_nss_lib/nss_cfgfile.h
--- a/contrib/ncp_nss_lib/nss_cfgfile.h Sun Oct 16 02:52:35 2005 +0200
+++ b/contrib/ncp_nss_lib/nss_cfgfile.h Sun Oct 16 04:07:06 2005 +0200
@@ -20,11 +20,7 @@ struct nss_ncp_conf {
int doShadow; // if 0, will return immediarly NSS_STATUS_UNAVAILABLE even if ncp is listed in /etc/nsswitch.conf
};
-
-
-static struct nss_ncp_conf defConf ={0,TRUE,"INSA_ROOT","[Root]",NULL,100,"/bin/bash",-1,-1,TRUE,TRUE,TRUE};
-
-struct nss_ncp_conf * parse_conf (char * confFile);
-void free_nss_ncp_conf (struct nss_ncp_conf *conf);
+struct nss_ncp_conf* parse_conf(void);
+void free_nss_ncp_conf(struct nss_ncp_conf *conf);
#endif
diff -r f18f9f05b9b8 -r 4d7bb63d7050 contrib/ncp_nss_lib/nss_ncp.c
--- a/contrib/ncp_nss_lib/nss_ncp.c Sun Oct 16 02:52:35 2005 +0200
+++ b/contrib/ncp_nss_lib/nss_ncp.c Sun Oct 16 04:07:06 2005 +0200
@@ -77,7 +77,7 @@
#include "nss_cfgfile.h"
// only if logfile has been opened by nss API functions (debug mode)
-void trace (int debugMode,int err,const char * format,... ) {
+static void trace (int debugMode,int err,const char * format,... ) {
va_list args;
if (debugMode) {
va_start(args,format);
@@ -219,7 +219,7 @@ static int fix_nw_user_info (struct nw_u
return 1;
}
}else {
- ui->uid== (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it !
+ ui->uid = (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it !
}
return 0;
}
@@ -343,7 +343,7 @@ static int fix_nw_group_info (struct nw_
}
}
}else {
- gi->gid== (gid_t)-1; // unable to read CN (NDS browse rights not set) , skip it !
+ gi->gid = (gid_t)-1; // unable to read CN (NDS browse rights not set) , skip it !
}
return 0;
}
@@ -514,7 +514,7 @@ static int fix_nw_shadow_info (struct nw
}
}else {
- si->uid== (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it !
+ si->uid = (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it !
}
return 0;
}
@@ -564,7 +564,7 @@ outnomem:
static void print_nw_shadow_info (struct nw_shadow_info si){
- printf("%s[%d]:%s:%d:%d:%d:%d:%d:%d:%d\n",si.cn,si.uid,si.passwd,si.lstchg,si.sp_min,si.sp_max,si.sp_warn,si.sp_inact,si.sp_expire,si.sp_flag);
+ printf("%s[%d]:%s:%ld:%ld:%ld:%ld:%ld:%ld:%ld\n",si.cn,si.uid,si.passwd,si.lstchg,si.sp_min,si.sp_max,si.sp_warn,si.sp_inact,si.sp_expire,si.sp_flag);
}
static void print_shadow (struct spwd spw){
@@ -579,8 +579,8 @@ struct nw_user_group_info {
uid_t uid;
gid_t* groups;
size_t used;
- size_t alloc;
- int qflag;
+ size_t alloc;
+ int qflag;
};
@@ -614,7 +614,7 @@ static int fix_nw_user_group_info (struc
if (ui->uid== (uid_t)-1)
ui->uid=conf->fallbackUid;
}else {
- ui->uid== (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it !
+ ui->uid = (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it !
}
return 0;
}
@@ -628,11 +628,11 @@ static enum nss_status nw_user_group_inf
long int *size, gid_t * groups,long int limit,int *errnop,struct nss_ncp_conf * conf) {
if (ui.uid != (uid_t)-1) {
- int i;
- for (i=0; i<ui.used; i++) {
+ size_t i;
+ for (i=0; i < ui.used; i++) {
gid_t gid=ui.groups[i];
if (gid != group) { // group number to skip
- if (*start == *size)
+ if (*start == *size) {
if (limit <=0) { // no more space, realloc if permitted (limit <=0)
gid_t* ngroups=realloc(groups, 2* *size * sizeof(*groups));
if (!ngroups) {
@@ -642,6 +642,7 @@ static enum nss_status nw_user_group_inf
*size *=2;
}else // no reallocation permitted, leave returning found groups so far
break;
+ }
groups[*start]=gid;
*start +=1;
if (*start ==limit) {
@@ -663,7 +664,7 @@ outnomem:
}
static void print_nw_user_group_info (struct nw_user_group_info ui){
- int i;
+ size_t i;
printf("%s:%d:%d:%d:",ui.cn,ui.uid,ui.used,ui.alloc);
for (i=0;i <ui.used;i++)
@@ -672,8 +673,8 @@ static void print_nw_user_group_info (st
}
static void print_user_groups(gid_t * groups, long int start, long int size){
- int i;
- printf("start=%d size=%d\n",start,size);
+ long int i;
+ printf("start=%ld size=%ld\n",start,size);
for (i=0; i<start; i++)
printf("%d ",groups[i]);
printf("\n");
@@ -1018,9 +1019,7 @@ static NWDSCCODE nds_user_location2(NWDS
static NWDSCCODE nds_user_location2(NWDSContextHandle ctx, const void *val, void *arg){
struct nw_user_info *ui = (struct nw_user_info *) arg;
const char *pt = (const char *) val;
- char *v;
int n;
- int err;
trace(ui->qflag,LOG_NOTICE, "start of NW location got %s\n ", pt);
@@ -1318,9 +1317,7 @@ static NWDSCCODE nds_shadow_location(NWD
struct nw_shadow_info *si = (struct nw_shadow_info *) arg;
const char *pt = (const char *) val;
- char *v;
int n;
- int err;
trace(si->qflag & QF_DEBUG,LOG_NOTICE, "shadow: start of NW location got %s\n ", pt);
@@ -1434,10 +1431,7 @@ static NWDSCCODE nds_user_location3(NWDS
static NWDSCCODE nds_user_location3(NWDSContextHandle ctx, const void *val, void *arg){
struct nw_user_group_info *ui = (struct nw_user_group_info *) arg;
const char *pt = (const char *) val;
- char *v;
int n;
- int err;
-
trace(ui->qflag & QF_DEBUG,LOG_NOTICE, "start of NW location got %s\n ", pt);
@@ -1814,7 +1808,6 @@ getgroupmembers(NWDSContextHandle *conte
{ ATTR_MEMBERS, nds_get_group_members, SYN_MEMBERS},
{ NULL, NULL, SYN_UNKNOWN }};
- NWDSCCODE err;
trace(conf->debug, LOG_NOTICE,"entering getgroupmembers for group %s",groupName);
ccode=CreateContextAndConn ( context,conn,conf);
if (ccode)
@@ -1834,12 +1827,12 @@ static struct ObjectList* ndsShadows=NUL
// description of a NDS class to be searched by getentbyxx
struct class_info {
- char * className;
- char * nds8Attribute; //name of ID attribute in NDS8
- char * LID1; // markers in L attribute for ID (U: or G:)
- char * LID2; // markers in L attribute for ID (u: or g:), may be in lower case
- char * LAlias1;// markers in L attribute for alias (N:)
- char * LAlias2; // markers in L attribute for alias (n:) may be in lower case
+ const char * className;
+ const char * nds8Attribute; // name of ID attribute in NDS8
+ const char * LID1; // markers in L attribute for ID (U: or G:)
+ const char * LID2; // markers in L attribute for ID (u: or g:), may be in lower case
+ const char * LAlias1; // markers in L attribute for alias (N:)
+ const char * LAlias2; // markers in L attribute for alias (n:) may be in lower case
};
@@ -1879,17 +1872,12 @@ static NWDSCCODE getentbyxx(
NWDSContextHandle context;
NWCONN_HANDLE conn;
NWDSCCODE ccode;
- nint32 iterationHandle= NO_MORE_ITERATIONS; // to be set as such at Exit4
- nint32 countObjectsSearched;
- nuint32 objCntr,attrCntr,valCntr;
+ nuint32 iterationHandle = NO_MORE_ITERATIONS; // to be set as such at Exit4
+ nuint32 countObjectsSearched;
+ nuint32 objCntr;
nuint32 objCount;
nuint32 attrCount;
char objectName[MAX_DN_CHARS+1];
- char attrName[MAX_SCHEMA_NAME_CHARS+1];
- nuint32 attrValCount;
- nuint32 syntaxID;
- nuint32 attrValSize;
- char* attrVal;
// buffers
pBuf_T searchFilter=NULL; // search filter
@@ -2259,14 +2247,14 @@ static NWDSCCODE getentbyxx(
}
}
trace(conf->debug, LOG_NOTICE,"callback return OK");
- } while ((nuint32)iterationHandle != NO_MORE_ITERATIONS);
+ } while (iterationHandle != NO_MORE_ITERATIONS);
trace(conf->debug, LOG_NOTICE,"End of iteration attrNamesOK");
Exit4:
- if ((nuint32)iterationHandle != NO_MORE_ITERATIONS){
+ if (iterationHandle != NO_MORE_ITERATIONS){
NWDSCCODE ccode2;
- if (ccode2=NWDSCloseIteration(context,iterationHandle,DSV_SEARCH)) {
+ if ((ccode2=NWDSCloseIteration(context,iterationHandle,DSV_SEARCH)) != 0) {
traceForce(conf->debug,LOG_WARNING,"NWDSCloseIteration returned: %d\n", ccode2);
}
}
@@ -2291,7 +2279,6 @@ Exit3:
}else
if (retConn)
*retConn=conn;
-Exit2:
if (ccode || !retContext) {
NWDSCCODE ccode2=NWDSFreeContext(context);
trace(conf->debug, LOG_NOTICE,"Freeing context");
@@ -2300,7 +2287,6 @@ Exit2:
}else
if (retContext)
*retContext=context;
-Exit1:
trace(conf->debug, LOG_NOTICE,"Leaving ...");
return ccode;
}
@@ -2417,7 +2403,7 @@ enum nss_status _nss_ncp_initgroups (con
struct nw_user_group_info inf;
NWDSCCODE err;
- struct nss_ncp_conf *conf= parse_conf(CNF_FILE);
+ struct nss_ncp_conf* conf = parse_conf();
if (!conf || !conf->doGroup)
return NSS_STATUS_UNAVAIL;
@@ -2460,7 +2446,7 @@ enum nss_status _nss_ncp_getpwnam_r (con
struct nw_user_info inf;
NWDSCCODE err;
- struct nss_ncp_conf *conf= parse_conf(CNF_FILE);
+ struct nss_ncp_conf* conf = parse_conf();
if (!conf || !conf->doPassword)
return NSS_STATUS_UNAVAIL;
@@ -2503,7 +2489,7 @@ enum nss_status _nss_ncp_getpwuid_r (uid
struct nw_user_info inf;
NWDSCCODE err;
- struct nss_ncp_conf *conf= parse_conf(CNF_FILE);
+ struct nss_ncp_conf* conf = parse_conf();
if (!conf || !conf->doPassword)
return NSS_STATUS_UNAVAIL;
@@ -2546,7 +2532,7 @@ enum nss_status _nss_ncp_getgrnam_r (con
struct nw_group_info inf;
NWDSCCODE err;
- struct nss_ncp_conf *conf= parse_conf(CNF_FILE);
+ struct nss_ncp_conf* conf = parse_conf();
if (!conf || !conf->doGroup)
return NSS_STATUS_UNAVAIL;
@@ -2588,7 +2574,7 @@ enum nss_status _nss_ncp_getspnam_r (con
char *buffer, size_t buflen,int * errnop) {
struct nw_shadow_info inf;
NWDSCCODE err;
- struct nss_ncp_conf *conf= parse_conf(CNF_FILE);
+ struct nss_ncp_conf* conf = parse_conf();
if (!conf || !conf->doShadow)
return NSS_STATUS_UNAVAIL;
@@ -2631,7 +2617,7 @@ enum nss_status _nss_ncp_getgrgid_r (gid
char * buffer, size_t buflen, int * errnop) {
struct nw_group_info inf;
NWDSCCODE err;
- struct nss_ncp_conf *conf= parse_conf(CNF_FILE);
+ struct nss_ncp_conf* conf = parse_conf();
if (!conf || !conf->doGroup)
return NSS_STATUS_UNAVAIL;
@@ -2673,7 +2659,7 @@ enum nss_status _nss_ncp_setpwent(void)
NWDSContextHandle context;
NWCONN_HANDLE conn;
NWDSCCODE ccode;
- struct nss_ncp_conf *conf= parse_conf(CNF_FILE);
+ struct nss_ncp_conf* conf = parse_conf();
if (!conf || !conf->doPassword)
return NSS_STATUS_UNAVAIL;
@@ -2715,7 +2701,7 @@ enum nss_status _nss_ncp_setgrent(void)
NWDSContextHandle context;
NWCONN_HANDLE conn;
enum nss_status ccode;
- struct nss_ncp_conf *conf= parse_conf(CNF_FILE);
+ struct nss_ncp_conf* conf = parse_conf();
if (!conf || !conf->doGroup)
return NSS_STATUS_UNAVAIL;
@@ -2753,7 +2739,7 @@ enum nss_status _nss_ncp_setspent (void)
NWDSContextHandle context;
NWCONN_HANDLE conn;
NWDSCCODE ccode;
- struct nss_ncp_conf *conf= parse_conf(CNF_FILE);
+ struct nss_ncp_conf* conf = parse_conf();
if (!conf || !conf->doShadow)
return NSS_STATUS_UNAVAIL;
diff -r f18f9f05b9b8 -r 4d7bb63d7050 contrib/ncp_nss_lib/nss_ncp.h
--- a/contrib/ncp_nss_lib/nss_ncp.h Sun Oct 16 02:52:35 2005 +0200
+++ b/contrib/ncp_nss_lib/nss_ncp.h Sun Oct 16 04:07:06 2005 +0200
@@ -121,6 +121,7 @@
+void traceForce(int debugMode, int err, const char* format, ...);
/******************************* NSS API ***************************************/
diff -r f18f9f05b9b8 -r 4d7bb63d7050 contrib/ncp_nss_lib/test_ncp_nss.c
--- a/contrib/ncp_nss_lib/test_ncp_nss.c Sun Oct 16 02:52:35 2005 +0200
+++ b/contrib/ncp_nss_lib/test_ncp_nss.c Sun Oct 16 04:07:06 2005 +0200
@@ -67,6 +67,7 @@
#include "nss_cfgfile.h"
+static struct nss_ncp_conf defConf ={0, TRUE, NULL, NULL, NULL, 100, NULL, -1, -1, TRUE, TRUE, TRUE};
/**************** TESTING ******************/
@@ -94,13 +95,13 @@ static void print_shadow (struct spwd sp
static void print_user_groups(gid_t * groups, long int start, long int size){
int i;
- printf("start=%d size=%d\n",start,size);
+ printf("start=%ld size=%ld\n",start,size);
for (i=0; i<start; i++)
printf("%d ",groups[i]);
printf("\n");
}
-void give_details_on_user_groups(gid_t *groups, long int start){
+static void give_details_on_user_groups(gid_t *groups, long int start){
struct group grp;
char buffer[65000];
long int i;
@@ -148,11 +149,6 @@ static void help(void)
exit (1);
}
-static void error ( char * s) {
- printf (_("\n%s\n"),s);
- exit (1);
-}
-
/*************************************************************************
** main
*/
@@ -174,7 +170,6 @@ int main (int argc, char** argv) {
struct passwd pwd;
struct group grp;
struct spwd spw;
- enum nss_status err;
progname = argv[0];
while ((opt = getopt(argc, argv, "h?u:n:g:i:s:m:T:B:C:O:f:UGSD2")) != EOF)
@@ -263,7 +258,7 @@ int main (int argc, char** argv) {
}
}
- if (userId != -1) {
+ if (userId != (uid_t)-1) {
printf ("searching in passwd for uid %d\n",userId);
if ( _nss_ncp_getpwuid_r (userId, &pwd,buffer,sizeof(buffer),&errno)==NSS_STATUS_SUCCESS)
print_passwd(pwd);
@@ -284,7 +279,7 @@ int main (int argc, char** argv) {
}
}
- if (groupId != -1) {
+ if (groupId != (gid_t)-1) {
printf ("searching in group for gid %d\n",groupId);
if ( _nss_ncp_getgrgid_r (groupId, &grp,buffer,sizeof(buffer),&errno)==NSS_STATUS_SUCCESS)
print_group(grp);

View File

@@ -0,0 +1,40 @@
changeset: 452:b2ec015c1689
user: Petr Vandrovec <petr@vandrovec.name>
date: Sun Oct 16 04:14:27 2005 +0200
files: contrib/ncp_nss_lib/nss_ncp.c
description:
Use %zd format when printing size_t arguments. Revealed on 64bit host.
diff -r 4d7bb63d7050 -r b2ec015c1689 contrib/ncp_nss_lib/nss_ncp.c
--- a/contrib/ncp_nss_lib/nss_ncp.c Sun Oct 16 04:07:06 2005 +0200
+++ b/contrib/ncp_nss_lib/nss_ncp.c Sun Oct 16 04:14:27 2005 +0200
@@ -666,7 +666,7 @@ static void print_nw_user_group_info (st
static void print_nw_user_group_info (struct nw_user_group_info ui){
size_t i;
- printf("%s:%d:%d:%d:",ui.cn,ui.uid,ui.used,ui.alloc);
+ printf("%s:%d:%zd:%zd:",ui.cn,ui.uid,ui.used,ui.alloc);
for (i=0;i <ui.used;i++)
printf("%d ",ui.groups[i]);
printf("\n");
@@ -1754,15 +1754,15 @@ static void print_nodes(struct TreeNode*
if (n) {
print_nodes(n->left,crlf);
if (crlf)
- printf ("%s [%d]\n",n->name,n->cnt);
+ printf ("%s [%zd]\n",n->name,n->cnt);
else
- printf ("%s [%d]",n->name,n->cnt);
+ printf ("%s [%zd]",n->name,n->cnt);
print_nodes(n->right,crlf);
}
}
static void print_tree(struct ObjectList* t, int crlf) {
- printf("total:%d unique:%d\n",t->totalObjects,t->uniqueObjects);
+ printf("total:%zd unique:%zd\n",t->totalObjects,t->uniqueObjects);
print_nodes (t->first,crlf);
}

View File

@@ -0,0 +1,29 @@
changeset: 453:329b32c7d8a6
user: Petr Vandrovec <petr@vandrovec.name>
date: Thu Apr 13 19:59:28 2006 +0200
files: lib/ndslib.c
description:
Fix nds_beginauth2 on Fedora
nds_beginauth2 was aliging pointer to be multiple of 4 bytes, instead of
aligning offset from start of buffer to the pointer to be multiple of 4
bytes. This was not problem before, as buffer itself was 4 byte aligned,
but Fedora's compiler has options which can misalign it...
See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=186683.
diff -r b2ec015c1689 -r 329b32c7d8a6 lib/ndslib.c
--- a/lib/ndslib.c Sun Oct 16 04:14:27 2005 +0200
+++ b/lib/ndslib.c Thu Apr 13 19:59:28 2006 +0200
@@ -1026,7 +1026,8 @@ static NWDSCCODE nds_beginauth2(
goto err_exit;
}
copyfill(n_temp, n1, p, n3a);
- p = (void*)(((unsigned long)k1end + 3) & ~3);
+ /* align p to the first 4 byte boundary beyond k1end */
+ p = k1end + ((p - k1end) & 3);
err = modexpkey(s_key, n_temp, n_temp, n1);
if (err) {
ISRPrint("modexpkey failed\n");

View File

@@ -0,0 +1,313 @@
changeset: 454:7783da47228e
user: Petr Vandrovec <petr@vandrovec.name>
date: Thu Apr 13 22:53:06 2006 +0200
files: include/ncp/ipxlib.h include/ncp/kernel/ncp.h include/ncp/ncp.h include/ncp/ncplib.h ipx-1.0/ipx_cmd.c lib/ncplib.c
description:
gcc-4.1 does not like packed characters/character arrays
gcc-4.1 does not like when element which itself is aligned
at 1 byte is tagged again with __attribute__((packed)). So
let's remove this attribute, it should not break older gcc...
diff -r 329b32c7d8a6 -r 7783da47228e include/ncp/ipxlib.h
--- a/include/ncp/ipxlib.h Thu Apr 13 19:59:28 2006 +0200
+++ b/include/ncp/ipxlib.h Thu Apr 13 22:53:06 2006 +0200
@@ -64,12 +64,12 @@ struct sap_server_ident
struct sap_server_ident
{
u_int16_t server_type __attribute__((packed));
- char server_name[48] __attribute__((packed));
+ char server_name[48];
IPXNet server_network __attribute__((packed));
#ifdef SWIG
u_int8_t server_node[6] __attribute__((packed));
#else
- IPXNode server_node __attribute__((packed));
+ IPXNode server_node;
#endif
IPXPort server_port __attribute__((packed));
u_int16_t intermediate_network __attribute__((packed));
@@ -87,7 +87,7 @@ struct ipx_rip_packet
struct ipx_rip_packet
{
u_int16_t operation __attribute__((packed));
- struct ipx_rt_def rt[1] __attribute__((packed));
+ struct ipx_rt_def rt[1];
} __attribute__((packed));
#ifdef SWIG
diff -r 329b32c7d8a6 -r 7783da47228e include/ncp/kernel/ncp.h
--- a/include/ncp/kernel/ncp.h Thu Apr 13 19:59:28 2006 +0200
+++ b/include/ncp/kernel/ncp.h Thu Apr 13 22:53:06 2006 +0200
@@ -53,12 +53,12 @@
struct ncp_request_header {
u_int16_t type __attribute__((packed));
- u_int8_t sequence __attribute__((packed));
- u_int8_t conn_low __attribute__((packed));
- u_int8_t task __attribute__((packed));
- u_int8_t conn_high __attribute__((packed));
- u_int8_t function __attribute__((packed));
- u_int8_t data[0] __attribute__((packed));
+ u_int8_t sequence;
+ u_int8_t conn_low;
+ u_int8_t task;
+ u_int8_t conn_high;
+ u_int8_t function;
+ u_int8_t data[0];
} __attribute__((packed));
#define NCP_REPLY (0x3333)
@@ -66,13 +66,13 @@ struct ncp_request_header {
struct ncp_reply_header {
u_int16_t type __attribute__((packed));
- u_int8_t sequence __attribute__((packed));
- u_int8_t conn_low __attribute__((packed));
- u_int8_t task __attribute__((packed));
- u_int8_t conn_high __attribute__((packed));
- u_int8_t completion_code __attribute__((packed));
- u_int8_t connection_state __attribute__((packed));
- u_int8_t data[0] __attribute__((packed));
+ u_int8_t sequence;
+ u_int8_t conn_low;
+ u_int8_t task;
+ u_int8_t conn_high;
+ u_int8_t completion_code;
+ u_int8_t connection_state;
+ u_int8_t data[0];
} __attribute__((packed));
#define NCP_VOLNAME_LEN (16)
@@ -230,8 +230,8 @@ struct nw_info_struct {
u_int32_t EAKeyCount __attribute__((packed));
u_int32_t EAKeySize __attribute__((packed));
u_int32_t NSCreator __attribute__((packed));
- u_int8_t nameLen __attribute__((packed));
- u_int8_t entryName[256] __attribute__((packed));
+ u_int8_t nameLen;
+ u_int8_t entryName[256];
} __attribute__((packed));
#endif
@@ -282,13 +282,13 @@ struct nw_file_info {
int opened;
int access;
u_int32_t server_file_handle __attribute__((packed));
- u_int8_t open_create_action __attribute__((packed));
- u_int8_t file_handle[6] __attribute__((packed));
+ u_int8_t open_create_action;
+ u_int8_t file_handle[6];
} __attribute__((packed));
#endif
struct nw_search_sequence {
- u_int8_t volNumber __attribute__((packed));
+ u_int8_t volNumber;
u_int32_t dirBase __attribute__((packed));
u_int32_t sequence __attribute__((packed));
} __attribute__((packed));
diff -r 329b32c7d8a6 -r 7783da47228e include/ncp/ncp.h
--- a/include/ncp/ncp.h Thu Apr 13 19:59:28 2006 +0200
+++ b/include/ncp/ncp.h Thu Apr 13 22:53:06 2006 +0200
@@ -95,7 +95,7 @@ struct prop_net_address {
#ifdef SWIG
fixedArray node[IPX_NODE_LEN];
#else
- u_int8_t node[IPX_NODE_LEN] __attribute__((packed));
+ u_int8_t node[IPX_NODE_LEN];
#endif
u_int16_t port __attribute__((packed));
};
@@ -163,20 +163,20 @@ struct nw_queue_job_entry {
u_int32_t ClientTask __attribute__((packed));
u_int32_t ClientObjectID __attribute__((packed));
u_int32_t TargetServerID __attribute__((packed));
- u_int8_t TargetExecTime[6] __attribute__((packed));
- u_int8_t JobEntryTime[6] __attribute__((packed));
+ u_int8_t TargetExecTime[6];
+ u_int8_t JobEntryTime[6];
u_int32_t JobNumber __attribute__((packed));
u_int16_t JobType __attribute__((packed));
u_int16_t JobPosition __attribute__((packed));
u_int16_t JobControlFlags __attribute__((packed));
- u_int8_t FileNameLen __attribute__((packed));
- char JobFileName[13] __attribute__((packed));
+ u_int8_t FileNameLen;
+ char JobFileName[13];
u_int32_t JobFileHandle __attribute__((packed));
u_int32_t ServerStation __attribute__((packed));
u_int32_t ServerTaskNumber __attribute__((packed));
u_int32_t ServerObjectID __attribute__((packed));
- char JobTextDescription[50] __attribute__((packed));
- char ClientRecordArea[152] __attribute__((packed));
+ char JobTextDescription[50];
+ char ClientRecordArea[152];
};
struct queue_job {
@@ -217,18 +217,18 @@ struct print_job_record {
};
#else
struct print_job_record {
- u_int8_t Version __attribute__((packed));
- u_int8_t TabSize __attribute__((packed));
+ u_int8_t Version;
+ u_int8_t TabSize;
u_int16_t Copies __attribute__((packed));
u_int16_t CtrlFlags __attribute__((packed));
u_int16_t Lines __attribute__((packed));
u_int16_t Rows __attribute__((packed));
- char FormName[16] __attribute__((packed));
- u_int8_t Reserved[6] __attribute__((packed));
- char BannerName[13] __attribute__((packed));
- char FnameBanner[13] __attribute__((packed));
- char FnameHeader[14] __attribute__((packed));
- char Path[80] __attribute__((packed));
+ char FormName[16];
+ u_int8_t Reserved[6];
+ char BannerName[13];
+ char FnameBanner[13];
+ char FnameHeader[14];
+ char Path[80];
};
#endif
diff -r 329b32c7d8a6 -r 7783da47228e include/ncp/ncplib.h
--- a/include/ncp/ncplib.h Thu Apr 13 19:59:28 2006 +0200
+++ b/include/ncp/ncplib.h Thu Apr 13 22:53:06 2006 +0200
@@ -477,24 +477,24 @@ struct ncp_file_server_info
#else
struct ncp_file_server_info
{
- char ServerName[48] __attribute__((packed));
- u_int8_t FileServiceVersion __attribute__((packed));
- u_int8_t FileServiceSubVersion __attribute__((packed));
+ char ServerName[48];
+ u_int8_t FileServiceVersion;
+ u_int8_t FileServiceSubVersion;
u_int16_t MaximumServiceConnections __attribute__((packed));
u_int16_t ConnectionsInUse __attribute__((packed));
u_int16_t NumberMountedVolumes __attribute__((packed));
- u_int8_t Revision __attribute__((packed));
- u_int8_t SFTLevel __attribute__((packed));
- u_int8_t TTSLevel __attribute__((packed));
+ u_int8_t Revision;
+ u_int8_t SFTLevel;
+ u_int8_t TTSLevel;
u_int16_t MaxConnectionsEverUsed __attribute__((packed));
- u_int8_t AccountVersion __attribute__((packed));
- u_int8_t VAPVersion __attribute__((packed));
- u_int8_t QueueVersion __attribute__((packed));
- u_int8_t PrintVersion __attribute__((packed));
- u_int8_t VirtualConsoleVersion __attribute__((packed));
- u_int8_t RestrictionLevel __attribute__((packed));
- u_int8_t InternetBridge __attribute__((packed));
- u_int8_t Reserved[60] __attribute__((packed));
+ u_int8_t AccountVersion;
+ u_int8_t VAPVersion;
+ u_int8_t QueueVersion;
+ u_int8_t PrintVersion;
+ u_int8_t VirtualConsoleVersion;
+ u_int8_t RestrictionLevel;
+ u_int8_t InternetBridge;
+ u_int8_t Reserved[60];
} __attribute__((packed));
#endif
@@ -607,7 +607,7 @@ struct ncp_station_addr
#ifdef SWIG
fixedArray Node[6];
#else
- u_int8_t Node[6] __attribute__((packed));
+ u_int8_t Node[6];
#endif
u_int16_t Socket __attribute__((packed));
} __attribute__((packed));
@@ -617,32 +617,32 @@ struct ncp_prop_login_control
#ifdef SWIG
fixedArray AccountExpireDate[3];
#else
- u_int8_t AccountExpireDate[3] __attribute__((packed));
+ u_int8_t AccountExpireDate[3];
#endif
- u_int8_t Disabled __attribute__((packed));
+ u_int8_t Disabled;
#ifdef SWIG
fixedArray PasswordExpireDate[3];
#else
- u_int8_t PasswordExpireDate[3] __attribute__((packed));
+ u_int8_t PasswordExpireDate[3];
#endif
- u_int8_t GraceLogins __attribute__((packed));
+ u_int8_t GraceLogins;
u_int16_t PasswordExpireInterval __attribute__((packed));
- u_int8_t MaxGraceLogins __attribute__((packed));
- u_int8_t MinPasswordLength __attribute__((packed));
+ u_int8_t MaxGraceLogins;
+ u_int8_t MinPasswordLength;
u_int16_t MaxConnections __attribute__((packed));
#ifdef SWIG
fixedArray ConnectionTimeMask[42] __attribute__((packed));
fixedArray LastLogin[6] __attribute__((packed));
#else
- u_int8_t ConnectionTimeMask[42] __attribute__((packed));
- u_int8_t LastLogin[6] __attribute__((packed));
+ u_int8_t ConnectionTimeMask[42];
+ u_int8_t LastLogin[6];
#endif
- u_int8_t RestrictionMask __attribute__((packed));
- u_int8_t reserved __attribute__((packed));
+ u_int8_t RestrictionMask;
+ u_int8_t reserved;
u_int32_t MaxDiskUsage __attribute__((packed));
u_int16_t BadLoginCount __attribute__((packed));
u_int32_t BadLoginCountDown __attribute__((packed));
- struct ncp_station_addr LastIntruder __attribute__((packed));
+ struct ncp_station_addr LastIntruder;
} __attribute__((packed));
NWCCODE NWReadPropertyValue(NWCONN_HANDLE conn, const char *objName,
diff -r 329b32c7d8a6 -r 7783da47228e ipx-1.0/ipx_cmd.c
--- a/ipx-1.0/ipx_cmd.c Thu Apr 13 19:59:28 2006 +0200
+++ b/ipx-1.0/ipx_cmd.c Thu Apr 13 22:53:06 2006 +0200
@@ -63,10 +63,10 @@
/* we are doing EthernetII... Any objections? */
struct {
u_int16_t unknown __attribute__((packed));
- u_int8_t dst[6] __attribute__((packed));
- u_int8_t src[6] __attribute__((packed));
+ u_int8_t dst[6];
+ u_int8_t src[6];
u_int16_t type __attribute__((packed));
- u_int8_t ipx[16384] __attribute__((packed));
+ u_int8_t ipx[16384];
} __attribute__((packed)) buffer;
static int getiflist(int fd, struct ifconf* ifc) {
diff -r 329b32c7d8a6 -r 7783da47228e lib/ncplib.c
--- a/lib/ncplib.c Thu Apr 13 19:59:28 2006 +0200
+++ b/lib/ncplib.c Thu Apr 13 22:53:06 2006 +0200
@@ -2627,13 +2627,13 @@ ncp_request(struct ncp_conn *conn, int f
struct nw_time_buffer
{
- u_int8_t year __attribute__((packed));
- u_int8_t month __attribute__((packed));
- u_int8_t day __attribute__((packed));
- u_int8_t hour __attribute__((packed));
- u_int8_t minute __attribute__((packed));
- u_int8_t second __attribute__((packed));
- u_int8_t wday __attribute__((packed));
+ u_int8_t year;
+ u_int8_t month;
+ u_int8_t day;
+ u_int8_t hour;
+ u_int8_t minute;
+ u_int8_t second;
+ u_int8_t wday;
} __attribute__((packed));
static time_t

View File

@@ -0,0 +1,72 @@
changeset: 455:69f23e25cc66
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat Apr 15 04:25:06 2006 +0200
files: lib/ds/filter.c lib/nwnet.c util/nwdir.c
description:
Fix some more gcc-4.1 warnings
gcc-4.1 is even more stupid than gcc-4.0 was when it comes to uninitialized
variables - if function either returns an error, or returns success and
modifies its argument, you can be almost 100% sure that gcc-4.1 will tag
this with warning if you call some other function between this one, before
you'll test function's return value. Just crap, probably it is time to
disable all warnings, as they are more than useless.
diff -r 7783da47228e -r 69f23e25cc66 lib/ds/filter.c
--- a/lib/ds/filter.c Thu Apr 13 22:53:06 2006 +0200
+++ b/lib/ds/filter.c Sat Apr 15 04:25:06 2006 +0200
@@ -303,7 +303,7 @@ static void _PutFilterFirstPass(
} else {
/* different operand: go to next node in created
chain */
- last_q = (struct _filter_node**)&q->value;
+ last_q = (struct _filter_node**)(void*)&q->value;
q = q->value;
}
}
diff -r 7783da47228e -r 69f23e25cc66 lib/nwnet.c
--- a/lib/nwnet.c Thu Apr 13 22:53:06 2006 +0200
+++ b/lib/nwnet.c Sat Apr 15 04:25:06 2006 +0200
@@ -1696,7 +1696,7 @@ restartLoop:;
NWCONN_HANDLE conn = list_entry(current, struct ncp_conn, nds_ring);
NWObjectCount connaddresses;
nuint8* conndata;
- NWCCODE err2;
+ NWDSCCODE err2;
/* compare addresses */
ncpt_mutex_unlock(&nds_ring_lock);
@@ -2808,6 +2808,8 @@ static NWDSCCODE NWDSGetAttrVal_OBJECT_A
if (err)
return err;
err = NWDSBufGetLE32(buffer, &priv);
+ if (err)
+ return err;
oacl->privileges = priv;
return err;
}
@@ -4149,6 +4151,8 @@ NWDSCCODE NWDSGetServerName(NWDSContextH
if (err)
return err;
err = NWDSBufGetLE32(buffer, &le32);
+ if (err)
+ return err;
if (partcount)
*partcount = le32;
return 0;
diff -r 7783da47228e -r 69f23e25cc66 util/nwdir.c
--- a/util/nwdir.c Thu Apr 13 22:53:06 2006 +0200
+++ b/util/nwdir.c Sat Apr 15 04:25:06 2006 +0200
@@ -521,7 +521,9 @@ static void dumpit(NWCONN_HANDLE conn, c
err = NWNSGetEffectiveRights(conn,
dir.volNumber, dir.DosDirNum, &eff);
- eff32 = eff;
+ if (!err) {
+ eff32 = eff;
+ }
}
printf(_(" Effective: "));
if (err) {

View File

@@ -0,0 +1,135 @@
changeset: 456:260a30abdb81
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat Apr 15 04:41:06 2006 +0200
files: contrib/ncp_nss_lib/nss_cfgfile.c contrib/ncp_nss_lib/nss_cfgfile.h
description:
Fix nss_ncp strict aliasing problems
It is bad idea to convert pointer to integer to pointer to char pointer,
and in addition this is also unnecessary. And removal of this typecast
revealed that we believe that 'int' and 'gid_t' and 'uid_t' have same
width. This is unreasonable assumption, I personally remember time
when uid_t was 16bit, while int was 32bit...
diff -r 69f23e25cc66 -r 260a30abdb81 contrib/ncp_nss_lib/nss_cfgfile.c
--- a/contrib/ncp_nss_lib/nss_cfgfile.c Sat Apr 15 04:25:06 2006 +0200
+++ b/contrib/ncp_nss_lib/nss_cfgfile.c Sat Apr 15 04:41:06 2006 +0200
@@ -108,9 +108,9 @@ struct check {
const char *option; /* configuration option */
int mandatory; /* can be empty or null */
int found; /*set to TRUE if found in cfg file */
- char ** value_ptr; /* temporary storage place */
- int isNum; /* 1 is numeric, 0 is string*/
- const char* defValue;
+ char ** char_ptr; /* where to store string value */
+ int * int_ptr; /* where to store integer value */
+ const char* defValue; /* default value */
};
@@ -119,12 +119,12 @@ void printResults (const char * infos,st
struct check* ptr;
printf ("%s\n",infos);
for (ptr=results; ptr->option; ptr++) {
- if (ptr->isNum)
- printf ("option=%s mandatory=%d found=%d value=%d isNum=%d defvalue=%s\n",
- ptr->option,ptr->mandatory,ptr->found,*(int**)ptr->value_ptr,ptr->isNum,ptr->defValue);
+ if (ptr->int_ptr)
+ printf ("option=%s mandatory=%d found=%d value=%d defvalue=%s\n",
+ ptr->option,ptr->mandatory,ptr->found,*ptr->int_ptr,ptr->defValue);
else
- printf ("option=%s mandatory=%d found=%d value=%s isNum=%d defvalue=%s\n",
- ptr->option,ptr->mandatory,ptr->found,*ptr->value_ptr,ptr->isNum,ptr->defValue);
+ printf ("option=%s mandatory=%d found=%d value=%s defvalue=%s\n",
+ ptr->option,ptr->mandatory,ptr->found,*ptr->char_ptr,ptr->defValue);
}
}
@@ -175,14 +175,14 @@ static int process_line (char* cptr, str
eptr++;
}
*eptr = 0;
- if (ptr->isNum) {
- *(int*)ptr->value_ptr=strtoul (sptr,&errPtr,0);
+ if (ptr->int_ptr) {
+ *ptr->int_ptr=strtoul (sptr,&errPtr,0);
ptr->found= ((*sptr) && !(*errPtr)); //not empty and no error
} else {
if (eptr>sptr) { // do not take an empty string value
char *v=strdup(sptr);
if (v) {
- *ptr->value_ptr=v;
+ *ptr->char_ptr=v;
ptr->found= TRUE;
}else
return 1;
@@ -201,12 +201,12 @@ static int fix_conf (struct check *resul
traceForce(0,LOG_ERR, "ncp_nss aborting :missing mandatory information '%s=' in config file %s ",ptr->option,GLOBALCFGFILE);
return 1;
}
- if (ptr->isNum) {
- *(int*)ptr->value_ptr=strtoul (ptr->defValue,NULL,0);
+ if (ptr->int_ptr) {
+ *ptr->int_ptr=strtoul (ptr->defValue,NULL,0);
}else {
char * v=strdup(ptr->defValue);
if (v)
- *ptr->value_ptr=v;
+ *ptr->char_ptr=v;
else
return 1;
}
@@ -225,20 +225,20 @@ static struct nss_ncp_conf *read_conf_fi
return NULL;
{
struct check check_confs[] = {
- /*option mandat found value_ptr isNum defValue */
- {"debug", FALSE,FALSE,(char**)&conf->debug, TRUE, "0"},
- {"useTree", FALSE,FALSE,(char**)&conf->useTree, TRUE, "0"},
- {"server", TRUE, FALSE, &conf->server, FALSE, ""},
- {"startCtx", FALSE,FALSE, &conf->startCtx, FALSE, ""},
- {"ctrlGroup", FALSE,FALSE, &conf->ctrlGroup, FALSE, ""},
- {"defGid", FALSE,FALSE,(char**)&conf->defGid, TRUE, "100"},
- {"defShell", FALSE,FALSE, &conf->defShell, FALSE, "/bin/bash"},
- {"fallbackUid", FALSE,FALSE,(char**)&conf->fallbackUid, TRUE, "-1"},
- {"fallbackGid", FALSE,FALSE,(char**)&conf->fallbackGid, TRUE, "-1"},
- {"doPasswd", FALSE,FALSE,(char**)&conf->doPassword, TRUE, "0"},
- {"doGroup", FALSE,FALSE,(char**)&conf->doGroup, TRUE, "0"},
- {"doShadow", FALSE,FALSE,(char**)&conf->doShadow, TRUE, "0"},
- {NULL , FALSE,FALSE, NULL, FALSE, NULL}
+ /*option mandat found char_ptr int_ptr defValue */
+ {"debug", FALSE,FALSE, NULL, &conf->debug, "0"},
+ {"useTree", FALSE,FALSE, NULL, &conf->useTree, "0"},
+ {"server", TRUE, FALSE, &conf->server, NULL, ""},
+ {"startCtx", FALSE,FALSE, &conf->startCtx, NULL, ""},
+ {"ctrlGroup", FALSE,FALSE, &conf->ctrlGroup, NULL, ""},
+ {"defGid", FALSE,FALSE, NULL, &conf->defGid, "100"},
+ {"defShell", FALSE,FALSE, &conf->defShell, NULL, "/bin/bash"},
+ {"fallbackUid", FALSE,FALSE, NULL, &conf->fallbackUid, "-1"},
+ {"fallbackGid", FALSE,FALSE, NULL, &conf->fallbackGid, "-1"},
+ {"doPasswd", FALSE,FALSE, NULL, &conf->doPassword, "0"},
+ {"doGroup", FALSE,FALSE, NULL, &conf->doGroup, "0"},
+ {"doShadow", FALSE,FALSE, NULL, &conf->doShadow, "0"},
+ {NULL , FALSE,FALSE, NULL, NULL, NULL}
};
char cfgline[16384];
diff -r 69f23e25cc66 -r 260a30abdb81 contrib/ncp_nss_lib/nss_cfgfile.h
--- a/contrib/ncp_nss_lib/nss_cfgfile.h Sat Apr 15 04:25:06 2006 +0200
+++ b/contrib/ncp_nss_lib/nss_cfgfile.h Sat Apr 15 04:41:06 2006 +0200
@@ -11,10 +11,10 @@ struct nss_ncp_conf {
char * server; // name of server or tree
char * startCtx; // start searching is this context (and below)
char * ctrlGroup; // limit search to members of this NDS group for passwd and shadow
- gid_t defGid; // if no primary group found in NDS use this value
+ int defGid; // if no primary group found in NDS use this value
char * defShell; // if no shell found in NDS use this value
- uid_t fallbackUid; // if no UID found in NDS use this one (-1= skip user, NFS_NOBODY= use this UID)
- gid_t fallbackGid; // if no GID found in NDS use this one (-1= skip group, NFS_NOBODY= use this GID)
+ int fallbackUid; // if no UID found in NDS use this one (-1= skip user, NFS_NOBODY= use this UID)
+ int fallbackGid; // if no GID found in NDS use this one (-1= skip group, NFS_NOBODY= use this GID)
int doPassword; // if 0, will return immediarly NSS_STATUS_UNAVAILABLE even if ncp is listed in /etc/nsswitch.conf
int doGroup; // if 0, will return immediarly NSS_STATUS_UNAVAILABLE even if ncp is listed in /etc/nsswitch.conf
int doShadow; // if 0, will return immediarly NSS_STATUS_UNAVAILABLE even if ncp is listed in /etc/nsswitch.conf

View File

@@ -0,0 +1,366 @@
changeset: 457:0e4dca2d0b0d
user: Petr Vandrovec <petr@vandrovec.name>
date: Sat Apr 15 05:02:48 2006 +0200
files: contrib/ncp_nss_lib/nss_cfgfile.c
description:
Fix nss_cfgfile.c formatting
Fix nss_cfgfile.c formatting a bit. And make some constant
arguments constant.
diff -r 260a30abdb81 -r 0e4dca2d0b0d contrib/ncp_nss_lib/nss_cfgfile.c
--- a/contrib/ncp_nss_lib/nss_cfgfile.c Sat Apr 15 04:41:06 2006 +0200
+++ b/contrib/ncp_nss_lib/nss_cfgfile.c Sat Apr 15 05:02:48 2006 +0200
@@ -50,18 +50,22 @@
// #define DEBUG 1
-static struct nss_ncp_conf* alloc_nss_ncp_conf (void){
+static struct nss_ncp_conf*
+alloc_nss_ncp_conf(void)
+{
struct nss_ncp_conf * conf;
- conf= (struct nss_ncp_conf *)malloc(sizeof(*conf));
+ conf = malloc(sizeof(*conf));
if (!conf)
return NULL;
return conf;
}
-void free_nss_ncp_conf (struct nss_ncp_conf *conf){
-#define FREEFIELD(x) do if (conf->x) {free(conf->x) ; conf->x=NULL;} while (0);
+void
+free_nss_ncp_conf(struct nss_ncp_conf *conf)
+{
+#define FREEFIELD(x) do if (conf->x) { free(conf->x); conf->x = NULL; } while (0);
if (conf) {
FREEFIELD(server);
FREEFIELD(startCtx);
@@ -77,12 +81,13 @@ struct cfgFile {
FILE* file;
};
-static struct cfgFile* cfgOpenFile(
- const char* path,
- int writeRequired) {
+static struct cfgFile*
+cfgOpenFile(const char* path,
+ int writeRequired)
+{
struct cfgFile* cfg;
- cfg = (struct cfgFile*)malloc(sizeof(*cfg));
+ cfg = malloc(sizeof(*cfg));
if (cfg) {
cfg->file = fopen(path, writeRequired ? "r+" : "r");
if (cfg->file) {
@@ -95,8 +100,9 @@ static struct cfgFile* cfgOpenFile(
return cfg;
}
-static void cfgClose(
- struct cfgFile* cfg) {
+static void
+cfgClose(struct cfgFile* cfg)
+{
ncpt_mutex_lock(&cfg->mutex);
fclose(cfg->file);
ncpt_mutex_destroy(&cfg->mutex);
@@ -105,46 +111,52 @@ static void cfgClose(
struct check {
- const char *option; /* configuration option */
- int mandatory; /* can be empty or null */
- int found; /*set to TRUE if found in cfg file */
- char ** char_ptr; /* where to store string value */
- int * int_ptr; /* where to store integer value */
- const char* defValue; /* default value */
+ const char *option; /* configuration option */
+ int mandatory; /* can be empty or null */
+ int found; /* set to TRUE if found in cfg file */
+ char **char_ptr; /* where to store string value */
+ int *int_ptr; /* where to store integer value */
+ const char *defValue; /* default value */
};
#ifdef DEBUG
-void printResults (const char * infos,struct check * results) {
- struct check* ptr;
- printf ("%s\n",infos);
- for (ptr=results; ptr->option; ptr++) {
+void
+printResults(const char *infos, const struct check *results)
+{
+ const struct check *ptr;
+
+ printf ("%s\n", infos);
+ for (ptr = results; ptr->option; ptr++) {
if (ptr->int_ptr)
printf ("option=%s mandatory=%d found=%d value=%d defvalue=%s\n",
- ptr->option,ptr->mandatory,ptr->found,*ptr->int_ptr,ptr->defValue);
+ ptr->option, ptr->mandatory, ptr->found, *ptr->int_ptr, ptr->defValue);
else
printf ("option=%s mandatory=%d found=%d value=%s defvalue=%s\n",
- ptr->option,ptr->mandatory,ptr->found,*ptr->char_ptr,ptr->defValue);
- }
-
-}
-
-void printConf (const char* infos,struct nss_ncp_conf * conf) {
- printf ("%s\n",infos);
- printf ("debug=%d useTree=%d server=%s startCtx=%s ctrlGroup=%s defGid=%d defShell=%s fallbackUid=%d fallbackGid=%d "
+ ptr->option, ptr->mandatory, ptr->found, *ptr->char_ptr, ptr->defValue);
+ }
+
+}
+
+void
+printConf(const char *infos, const struct nss_ncp_conf *conf)
+{
+ printf ("%s\n", infos);
+ printf ("debug=%d useTree=%d server=%s startCtx=%s ctrlGroup=%s defGid=%u defShell=%s fallbackUid=%u fallbackGid=%u "
"doPassword=%d doGroup=%d doShadow=%d\n",
- conf->debug,conf->useTree,conf->server,conf->startCtx,
- conf->ctrlGroup,conf->defGid,conf->defShell,conf->fallbackUid,conf->fallbackGid,
- conf->doPassword,conf->doGroup,conf->doShadow);
-}
-#endif
-
-
-static int process_line (char* cptr, struct check *ptr) {
-
- char* sptr; // start of real value
- char* eptr; // end of real value
- char* errPtr; // err
+ conf->debug, conf->useTree, conf->server, conf->startCtx,
+ conf->ctrlGroup, conf->defGid, conf->defShell, conf->fallbackUid, conf->fallbackGid,
+ conf->doPassword, conf->doGroup, conf->doShadow);
+}
+#endif
+
+
+static int
+process_line(const char *cptr, struct check *ptr)
+{
+
+ const char* sptr; // start of real value
+ const char* eptr; // end of real value
char ec;
char cc;
@@ -163,8 +175,8 @@ static int process_line (char* cptr, str
ec = *cptr++;
else
ec = 0;
- sptr=cptr;
- eptr=cptr;
+ sptr = cptr;
+ eptr = cptr;
while ((cc = *cptr++) != 0) {
if (cc == '\n')
break;
@@ -174,39 +186,43 @@ static int process_line (char* cptr, str
break;
eptr++;
}
- *eptr = 0;
- if (ptr->int_ptr) {
- *ptr->int_ptr=strtoul (sptr,&errPtr,0);
- ptr->found= ((*sptr) && !(*errPtr)); //not empty and no error
- } else {
- if (eptr>sptr) { // do not take an empty string value
- char *v=strdup(sptr);
+ if (eptr != sptr) {
+ if (ptr->int_ptr) {
+ char* errPtr; // err
+
+ *ptr->int_ptr = strtoul(sptr, &errPtr, 0);
+ ptr->found = errPtr == eptr;
+ } else {
+ char *v = malloc(eptr - sptr + 1);
if (v) {
- *ptr->char_ptr=v;
- ptr->found= TRUE;
- }else
+ memcpy(v, sptr, eptr - sptr);
+ v[eptr - sptr] = 0;
+ *ptr->char_ptr = v;
+ ptr->found = TRUE;
+ } else
return 1;
}
}
-
return 0;
}
-static int fix_conf (struct check *results) {
+static int
+fix_conf(struct check *results)
+{
struct check* ptr;
- for (ptr=results; ptr->option; ptr++) {
- if (! ptr->found) {
- if (ptr->mandatory) {
- traceForce(0,LOG_ERR, "ncp_nss aborting :missing mandatory information '%s=' in config file %s ",ptr->option,GLOBALCFGFILE);
+ for (ptr = results; ptr->option; ptr++) {
+ if (!ptr->found) {
+ if (ptr->mandatory) {
+ traceForce(0, LOG_ERR, "ncp_nss aborting :missing mandatory information '%s=' in config file %s", ptr->option, GLOBALCFGFILE);
return 1;
}
if (ptr->int_ptr) {
- *ptr->int_ptr=strtoul (ptr->defValue,NULL,0);
- }else {
- char * v=strdup(ptr->defValue);
+ *ptr->int_ptr = strtoul(ptr->defValue, NULL, 0);
+ } else {
+ char *v = strdup(ptr->defValue);
if (v)
- *ptr->char_ptr=v;
+ *ptr->char_ptr = v;
else
return 1;
}
@@ -216,38 +232,38 @@ static int fix_conf (struct check *resul
}
-static struct nss_ncp_conf *read_conf_file( const char * mySection, struct cfgFile *cfg) {
-
+static struct nss_ncp_conf *
+read_conf_file(const char * mySection, struct cfgFile *cfg)
+{
struct nss_ncp_conf *conf;
- conf=alloc_nss_ncp_conf ();
+ conf = alloc_nss_ncp_conf();
if (!conf)
return NULL;
{
struct check check_confs[] = {
- /*option mandat found char_ptr int_ptr defValue */
- {"debug", FALSE,FALSE, NULL, &conf->debug, "0"},
- {"useTree", FALSE,FALSE, NULL, &conf->useTree, "0"},
- {"server", TRUE, FALSE, &conf->server, NULL, ""},
- {"startCtx", FALSE,FALSE, &conf->startCtx, NULL, ""},
- {"ctrlGroup", FALSE,FALSE, &conf->ctrlGroup, NULL, ""},
- {"defGid", FALSE,FALSE, NULL, &conf->defGid, "100"},
- {"defShell", FALSE,FALSE, &conf->defShell, NULL, "/bin/bash"},
- {"fallbackUid", FALSE,FALSE, NULL, &conf->fallbackUid, "-1"},
- {"fallbackGid", FALSE,FALSE, NULL, &conf->fallbackGid, "-1"},
- {"doPasswd", FALSE,FALSE, NULL, &conf->doPassword, "0"},
- {"doGroup", FALSE,FALSE, NULL, &conf->doGroup, "0"},
- {"doShadow", FALSE,FALSE, NULL, &conf->doShadow, "0"},
- {NULL , FALSE,FALSE, NULL, NULL, NULL}
+ /*option mandati found char_ptr int_ptr defValue */
+ {"debug", FALSE, FALSE, NULL, &conf->debug, "0"},
+ {"useTree", FALSE, FALSE, NULL, &conf->useTree, "0"},
+ {"server", TRUE, FALSE, &conf->server, NULL, ""},
+ {"startCtx", FALSE, FALSE, &conf->startCtx, NULL, ""},
+ {"ctrlGroup", FALSE, FALSE, &conf->ctrlGroup, NULL, ""},
+ {"defGid", FALSE, FALSE, NULL, &conf->defGid, "100"},
+ {"defShell", FALSE, FALSE, &conf->defShell, NULL, "/bin/bash"},
+ {"fallbackUid", FALSE, FALSE, NULL, &conf->fallbackUid, "-1"},
+ {"fallbackGid", FALSE, FALSE, NULL, &conf->fallbackGid, "-1"},
+ {"doPasswd", FALSE, FALSE, NULL, &conf->doPassword, "0"},
+ {"doGroup", FALSE, FALSE, NULL, &conf->doGroup, "0"},
+ {"doShadow", FALSE, FALSE, NULL, &conf->doShadow, "0"},
+ {NULL, FALSE, FALSE, NULL, NULL, NULL}
};
char cfgline[16384];
size_t seclen = strlen(mySection);
-
#ifdef DEBUG
// DO NOT DO IT A a second call (using test_ncp_nss -2) coredump !!!
-// printResults("before reading CFG",check_confs);
+// printResults("before reading CFG", check_confs);
#endif
ncpt_mutex_lock(&cfg->mutex);
//rewind(cfg->file);
@@ -270,13 +286,13 @@ static struct nss_ncp_conf *read_conf_fi
cptr++;
if (!*cptr)
continue; //empty line
- if (*cptr == '[') // start of another section
+ if (*cptr == '[') // start of another section
goto ssend;
- for (ptr=check_confs; ptr->option; ptr++) {
- size_t keylen=strlen(ptr->option);
- if (!strncasecmp(cptr, ptr->option,keylen)) {
+ for (ptr = check_confs; ptr->option; ptr++) {
+ size_t keylen = strlen(ptr->option);
+ if (!strncasecmp(cptr, ptr->option, keylen)) {
cptr += keylen;
- process_line (cptr,ptr);
+ process_line(cptr, ptr);
}
}
}
@@ -284,22 +300,22 @@ static struct nss_ncp_conf *read_conf_fi
ssend:
#ifdef DEBUG
- printResults("after reading CFG no error",check_confs);
-#endif
-#ifdef DEBUG
- printConf("before fixing ",conf);
-#endif
-
- if (!fix_conf (check_confs)) { // fill in missing values with default,
-#ifdef DEBUG
- printConf("after fixing ",conf);
+ printResults("after reading CFG no error", check_confs);
+#endif
+#ifdef DEBUG
+ printConf("before fixing ", conf);
+#endif
+
+ if (!fix_conf (check_confs)) { // fill in missing values with default,
+#ifdef DEBUG
+ printConf("after fixing ", conf);
#endif
ncpt_mutex_unlock(&cfg->mutex);
return conf;
}
#ifdef DEBUG
- printResults("after reading CFG error",check_confs);
+ printResults("after reading CFG error", check_confs);
#endif
ncpt_mutex_unlock(&cfg->mutex);
free_nss_ncp_conf(conf);
@@ -308,7 +324,9 @@ ssend:
}
-struct nss_ncp_conf* parse_conf(void) {
+struct nss_ncp_conf*
+parse_conf(void)
+{
struct cfgFile *cfg;
struct nss_ncp_conf *conf;
#ifdef DEBUG
@@ -317,11 +335,11 @@ struct nss_ncp_conf* parse_conf(void) {
cfg = cfgOpenFile(GLOBALCFGFILE, FALSE);
if (!cfg)
return NULL;
- conf=read_conf_file(NSS_SECTION,cfg);
+ conf = read_conf_file(NSS_SECTION, cfg);
cfgClose(cfg);
#ifdef DEBUG
if (conf)
- printConf("final value ",conf);
+ printConf("final value ", conf);
#endif
return conf;

View File

@@ -0,0 +1,230 @@
changeset: 458:92f2133262a8
parent: 455:69f23e25cc66
user: Rodrigo Rubira Branco <rrbranco@br.ibm.com>
date: Wed Jun 21 23:24:15 2006 +0200
files: man/Makefile.in man/ncplogin.8 man/ncpmap.8
description:
Add ncpmap and ncplogin manpages
Provide manpages for ncpmap and ncplogin.
diff -r 69f23e25cc66 -r 92f2133262a8 man/Makefile.in
--- a/man/Makefile.in Sat Apr 15 04:25:06 2006 +0200
+++ b/man/Makefile.in Wed Jun 21 23:24:15 2006 +0200
@@ -24,7 +24,7 @@ MAN8 := nwbocreate.8 nwborm.8 nwbpadd.8
nwgrant.8 nwrevoke.8
ifeq ($(USE_KERNEL),1)
MAN1 += ncopy.1
-MAN8 += ncpmount.8 ncpumount.8
+MAN8 += ncpmount.8 ncpumount.8 ncplogin.8 ncpmap.8
endif
MAN8 += nwmsg.8
diff -r 69f23e25cc66 -r 92f2133262a8 man/ncplogin.8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/man/ncplogin.8 Wed Jun 21 23:24:15 2006 +0200
@@ -0,0 +1,104 @@
+.\" Copyright (c) International Business Machines Corp., 2006
+.\"
+.\" This file 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 file; if not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+.\" MA 02111-1307 USA
+.\"
+.\" HISTORY:
+.\" 2006-06-01, created by Rodrigo Rubira Branco <rrbranco@br.ibm.com>
+.TH ncplogin 8 "Jun, 01 2006" "NCPFS" "NCPFS"
+.SH NAME
+ncplogin \- establishes identity to the Netware server or tree
+.SH SYNOPSIS
+.nf
+.fam C
+\fBncplogin [OPTIONS]\fP
+.fam T
+.fi
+.SH DESCRIPTION
+\fBncplogin\fP and \fBncpmap\fP provide a way for you to split the ncpmount operation into halves, with \fBncplogin\fP establishing your identity to the server or tree. \fBncpmap\fP mounts it later.
+.SH OPTIONS
+.B -T tree
+Tree name to be used.
+
+.B -S server
+Server name to be used. The -S and -T options are mutually exclusive.
+
+\fB-X name_ctx\fP
+Default name context to be used.
+
+\fB-E\fP
+Echoes the value of final mount_point.
+
+\fB-U username\fP
+Username sent to server.
+
+\fB-u uid\fP
+Uid given the mounted files.
+
+\fB-g gid\fP
+Gid given the mounted files.
+
+\fB-c uid\fP
+Uid to identify the connection on which to mount. Only appropriate for root.
+
+\fB-C\fP
+Do not convert password to uppercase.
+
+\fB-P password\fP
+Use this password.
+
+\fB-n\fP
+Do not use any password.
+If neither -P nor -n is given, you are asked for a password.
+
+\fB-f mode\fP
+Permission given the files, in octal notation.
+
+\fB-d mode\fP
+Permission given the directories, in octal notation.
+
+\fB-t time_out\fP
+Time, in 1/100s of a second, to wait for an answer from the server. Default is 60.
+
+\fB-r retry_count\fP
+Number of retry attempts. Default is 5.
+
+\fB-s\fP
+Enable renaming and deletion of read-only files.
+
+\fB-h\fP
+Print the help text.
+
+\fB-v\fP
+Print ncpfs version number.
+
+\fB-i level\fP
+Signature level. 0 = never, 1 = supported, 2 = preferred, 3 = required.
+
+\fB-N os2,nfs\fP
+Do not use the specified namespaces on mounted volume.
+
+\fB-y charset\fP
+Character set used for input and display.
+
+\fB-p codepage\fP
+Codepage used on volume, including letters "cp."
+
+\fB-B bcast\fP
+Broadcast mode. 0 = all 1 = console 2 = none. Default is all.
+
+\fB-l\fP
+Autocreate mounting point if needed in /mnt/ncp/SERVER/VOLUME.
+.SH SECURITY
+\fBncplogin\fP must be setuid to permit non-root users use of it. In these cases, mounting ncpfs will enforce nodev and nosetuid mount options.
+.SH SEE ALSO
+\fBncpmap\fP(1), \fBncpmount\fP(8)
+.SH AUTHOR
+Manpage written by Rodrigo Rubira Branco <rrbranco@br.ibm.com> with help from Petr Vandrovec <petr@vandrovec.name>.
diff -r 69f23e25cc66 -r 92f2133262a8 man/ncpmap.8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/man/ncpmap.8 Wed Jun 21 23:24:15 2006 +0200
@@ -0,0 +1,94 @@
+.\" Copyright (c) International Business Machines Corp., 2006
+.\"
+.\" This file 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 file; if not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+.\" MA 02111-1307 USA
+.\"
+.\" HISTORY:
+.\" 2006-06-01, created by Rodrigo Rubira Branco <rrbranco@br.ibm.com>
+.TH ncpmap 8 "Jun, 01 2006" "NCPFS" "NCPFS"
+.SH NAME
+ncpmap \- mounts some resource from Netware server or tree previously connected with ncplogin
+.SH SYNOPSIS
+.nf
+.fam C
+\fBncpmap [OPTIONS] [-a] [mount-point]\fP
+.fam T
+.fi
+.SH DESCRIPTION
+\fBncplogin\fP and \fBncpmap\fP provide a way to split the ncpmount operation into halves, with \fBncpmap\fP mounting the resource previously authenticated with \fBncplogin\fP.
+.SH OPTIONS
+\fBmount_point\fP is optional if you specify the -a option.
+
+\fB-T tree\fP
+Tree name to be used.
+
+\fB-S server\fP
+Server name to be used. The -T and -S options are mutually exclusive.
+
+\fB-X name_ctx\fP
+Default name context to be used.
+
+\fB-E\fP
+Echo value of final mount_point.
+
+\fB-V volume\fP
+Volume to mount. This must be in binary format if -S server, or in NDS format if -T tree.
+
+\fB-R path\fP
+Path in volume to "map root."
+
+\fB-f mode\fP
+Permission given the files, in octal notation.
+
+\fB-d mode\fP
+Permission given the directories, in octal notation.
+
+\fB-t time_out\fP
+Waiting time, in 1/100s of a second, to wait for an answer from the server. Default is 60.
+
+\fB-r retry_count\fP
+Number of retry attempts. Default is 5.
+
+\fB-s\fP
+Enable renaming or deletion of read-only files.
+
+\fB-h\fP
+Print help text.
+
+\fB-v\fP
+Print ncpfs version number.
+
+\fB-i level\fP
+Signature level. 0 = never, 1 = supported, 2 = preferred, and 3 = required.
+
+\fB-N os2,nfs\fP
+Do not use specified namespaces on mounted volume.
+
+\fB-y charset\fP
+Character set used for input and display.
+
+\fB-p codepage\fP
+Codepage used on volume, including letters "cp."
+
+\fB-B bcast\fP
+Broadcast mode. 0 = all, 1 = console, and 2 = none. Default is all.
+
+\fB-a\fP
+Autocreate mounting point if needed in ~/ncp/SERVER/VOLUME.
+
+\fB-l\fP
+Autocreate mounting point if needed in /mnt/ncp/SERVER/VOLUME.
+
+.SH SECURITY
+\fBncpmap\fP must be setuid to permit non-root users use of it. In these cases, it will enforce nodev and nosetuid mount options.
+.SH SEE ALSO
+\fBncplogin\fP(1), \fBncpmount\fP(8)
+.SH AUTHOR
+Manpage written by Rodrigo Rubira Branco <rrbranco@br.ibm.com> with Petr Vandrovec <petr@vandrovec.name>.

View File

@@ -0,0 +1,80 @@
lib/Makefile.in | 5 +++--
sutil/Makefile.in | 11 +++++++----
2 files changed, 10 insertions(+), 6 deletions(-)
--- ncpfs-2.2.6.orig/lib/Makefile.in
+++ ncpfs-2.2.6/lib/Makefile.in
@@ -21,6 +21,7 @@ STATIC_NCPLIB := libncp.$(libext)
STATIC_NCPLIB_BIN := $(STATIC_NCPLIB)
CCFLAGS += -I.
+PIE_FLAGS := -fpie
PIC_FLAGS := -fPIC
NWCOMPAT := 1
@@ -57,7 +58,7 @@ NDS_CFLAGS := $(BASE_CFLAGS) -DPORTABLE
CFLAGS_ncplib.o := -DNWSFIND=\"$(bindir)/nwsfind\"
CFLAGS_cfgfile.o := -DGLOBALCFGFILE=\"$(sysconfdir)/ncpfs.conf\"
-STATIC_CFLAGS := $(CFLAGS) $(CCFLAGS) $(REENTRANT_CFLAGS) @FFUNCTION_SECTIONS@
+STATIC_CFLAGS := $(CFLAGS) $(CCFLAGS) $(REENTRANT_CFLAGS) $(PIE_FLAGS) @FFUNCTION_SECTIONS@
SHARED_CFLAGS := $(CFLAGS) $(CCFLAGS) $(REENTRANT_CFLAGS) $(PIC_FLAGS) $(SHARED_VLINK_CFLAGS)
.PHONY : all dep install install-dev clean mrproper distclean
@@ -127,7 +128,7 @@ $(SHARED_NCPLIB): $(SHARED_NCPLIB_BIN)
ln -sf $< $@
$(SHARED_NCPLIB_BIN): $(SHARED_O_OBJ) ${this_srcdir}/libncp.vers
- $(CC) -shared -o $@ -Wl,-soname=$(SHARED_NCPLIB_SONAME) $(SHARED_VLINK) $(SHARED_O_OBJ) ${LIBS} -lc
+ $(CC) -shared -o $@ -Wl,-soname=$(SHARED_NCPLIB_SONAME) $(SHARED_VLINK) $(SHARED_O_OBJ) ${LIBS}
install_static: $(STATIC_NCPLIB_BIN)
$(INSTALL) -d $(DESTDIR)$(libadir)
--- ncpfs-2.2.6.orig/sutil/Makefile.in
+++ ncpfs-2.2.6/sutil/Makefile.in
@@ -18,6 +18,9 @@ LIBS = @INTLLIBS@ @LIBICONV@ @LIBS@
# environ in ncpmount
CCFLAGS += -D_GNU_SOURCE
+PIE_CFLAGS = -fpie
+PIE_LDFLAGS = -pie
+
O_UTILS := nwsfind.o
ifeq ($(USE_KERNEL),1)
O_UTILS += ncpmount.o ncpumount.o
@@ -58,7 +61,7 @@ endif
install-dev:
$(O_UTILS): %.o: %.c
- $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
+ $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) $(PIE_CFLAGS) -o $@ -c $<
$(O_UTILS:.o=.d): %.d: %.c
set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \
@@ -70,7 +73,7 @@ ncplogin: ncpm_common.o mount_login.o
ncpmap: ncpm_common.o
ncpmap.o: %.o: ncplogin.c
- $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
+ $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) $(PIE_CFLAGS) -o $@ -c $<
ncpmap.d: %.d: ncplogin.c
set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \
@@ -78,7 +81,7 @@ ncpmap.d: %.d: ncplogin.c
[ -s $@ ] || rm -f $@
ncpm_common.o mount_login.o: %.o: %.c
- $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $<
+ $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) $(PIE_CFLAGS) -o $@ -c $<
ncpm_common.d mount_login.d: %.d: %.c
set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \
@@ -86,7 +89,7 @@ ncpm_common.d mount_login.d: %.d: %.c
[ -s $@ ] || rm -f $@
$(UTILS): %: %.o ../lib/libncp.$(libext)
- $(CC) @GC_SECTIONS@-o $@ $^ ${LIBS}
+ $(CC) @GC_SECTIONS@-o $@ $^ $(PIE_LDFLAGS) ${LIBS}
../lib/libncp.$(libext):
make -C ../lib libncp.$(libext)

View File

@@ -0,0 +1,56 @@
diff -ru ncpfs-2.2.6.orig/lib/ncplib.c ncpfs-2.2.6/lib/ncplib.c
--- ncpfs-2.2.6.orig/lib/ncplib.c 2005-01-27 10:35:59.000000000 -0700
+++ ncpfs-2.2.6/lib/ncplib.c 2009-10-19 14:27:14.019898870 -0600
@@ -188,7 +188,7 @@
#define NCP_MAX_BUFSIZE 1024
#ifdef SIGNATURES
-int in_options = 2;
+int in_options = 1; /* signatures supported - sign packets if NCP server requests it */
#else
int in_options = 0;
#endif
@@ -1255,7 +1255,6 @@
static NWCCODE ncp_finish_connect(struct ncp_conn *conn) {
NWCCODE err;
- conn->sequence = 0;
conn->i.connection = get_conn_from_reply(conn->ncp_reply);
conn->is_connected = CONN_TEMPORARY;
@@ -1321,7 +1320,7 @@
conn->ncp_sock = ncp_sock;
conn->wdog_sock = wdog_sock;
- conn->sequence = 0;
+ conn->sequence = 255;
conn->addr.ipx = *target;
conn->nt = NT_IPX;
@@ -1400,7 +1399,7 @@
conn->ncp_sock = ncp_sock;
conn->wdog_sock = -1;
- conn->sequence = 0;
+ conn->sequence = 255;
memcpy(&conn->addr, target, sizeof(*target));
conn->nt = NT_UDP;
@@ -1459,7 +1458,7 @@
conn->ncp_sock = ncp_sock;
conn->wdog_sock = -1;
- conn->sequence = 0;
+ conn->sequence = 255;
memcpy(&conn->addr, target, sizeof(*target));
conn->nt = NT_TCP;
@@ -1578,7 +1577,7 @@
conn->ncp_sock = ncp_sock;
conn->wdog_sock = -1;
- conn->sequence = 0;
+ conn->sequence = 255;
memset(&conn->addr, 0, sizeof(conn->addr));
#if 0

View File

@@ -0,0 +1,17 @@
linux/stddef.h was included by accident. use private offsetof macro
---
sutil/ncpm_common.h | 1 +
1 file changed, 1 insertion(+)
Index: ncpfs-2.2.6/sutil/ncpm_common.h
===================================================================
--- ncpfs-2.2.6.orig/sutil/ncpm_common.h
+++ ncpfs-2.2.6/sutil/ncpm_common.h
@@ -122,5 +122,6 @@ int proc_aftermount(const struct ncp_mou
int proc_ncpm_umount(const char* dir);
#define UNUSED(x) x __attribute__((unused))
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif /* __NCPM_COMMON_H__ */

View File

@@ -0,0 +1,19 @@
pam_ncp_auth.c: In function 'nw_cleanup_conn':
pam_ncp_auth.c:284: warning: implicit declaration of function 'syslog'
pam_ncp_auth.c:284: error: 'LOG_NOTICE' undeclared (first use in this function)
contrib/pam/pam_ncp_auth.c | 1 +
1 files changed, 1 insertion(+)
Index: ncpfs-2.2.6/contrib/pam/pam_ncp_auth.c
===================================================================
--- ncpfs-2.2.6.orig/contrib/pam/pam_ncp_auth.c
+++ ncpfs-2.2.6/contrib/pam/pam_ncp_auth.c
@@ -266,6 +266,7 @@
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
+#include <syslog.h>
#include "support.h"

File diff suppressed because it is too large Load Diff

View File

@@ -69,6 +69,9 @@ PATCHES=(
"${FILESDIR}"/${P}-php5x.patch
"${FILESDIR}"/${P}-php_auth_nds-php8.patch
"${FILESDIR}"/${P}-php-install-root.patch
"${FILESDIR}"/${P}-r5-nds-null-name.patch
)
DOCS=( FAQ README )

View File

@@ -0,0 +1,163 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit pam
DESCRIPTION="Provides access to Netware services using the NCP protocol"
HOMEPAGE="ftp://platan.vc.cvut.cz/pub/linux/ncpfs/"
SRC_URI="ftp://platan.vc.cvut.cz/pub/linux/${PN}/${P}.tar.gz
https://old-releases.ubuntu.com/ubuntu/pool/universe/n/ncpfs/ncpfs_${PV}.orig.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~mips ~ppc ~ppc64 ~x86"
IUSE="nls pam php"
DEPEND="
nls? ( sys-devel/gettext )
pam? ( sys-libs/pam )
php? ( dev-lang/php:* )"
RDEPEND="${DEPEND}
net-fs/ncpfs-modules
net-misc/ipx-utils"
PATCHES=(
"${FILESDIR}"/ncpfs-hg-commit-403.patch
"${FILESDIR}"/ncpfs-hg-commit-404.patch
"${FILESDIR}"/ncpfs-hg-commit-405.patch
"${FILESDIR}"/ncpfs-hg-commit-406.patch
"${FILESDIR}"/ncpfs-hg-commit-407.patch
"${FILESDIR}"/ncpfs-hg-commit-408.patch
"${FILESDIR}"/ncpfs-hg-commit-409.patch
"${FILESDIR}"/ncpfs-hg-commit-410.patch
"${FILESDIR}"/ncpfs-hg-commit-411.patch
"${FILESDIR}"/ncpfs-hg-commit-412.patch
"${FILESDIR}"/ncpfs-hg-commit-413.patch
"${FILESDIR}"/ncpfs-hg-commit-414.patch
"${FILESDIR}"/ncpfs-hg-commit-415.patch
"${FILESDIR}"/ncpfs-hg-commit-416.patch
"${FILESDIR}"/ncpfs-hg-commit-417.patch
"${FILESDIR}"/ncpfs-hg-commit-419.patch
"${FILESDIR}"/ncpfs-hg-commit-420.patch
"${FILESDIR}"/ncpfs-hg-commit-421.patch
"${FILESDIR}"/ncpfs-hg-commit-422.patch
"${FILESDIR}"/ncpfs-hg-commit-423.patch
"${FILESDIR}"/ncpfs-hg-commit-424.patch
"${FILESDIR}"/ncpfs-hg-commit-425.patch
"${FILESDIR}"/ncpfs-hg-commit-426.patch
"${FILESDIR}"/ncpfs-hg-commit-427.patch
"${FILESDIR}"/ncpfs-hg-commit-428.patch
"${FILESDIR}"/ncpfs-hg-commit-429.patch
"${FILESDIR}"/ncpfs-hg-commit-430.patch
"${FILESDIR}"/ncpfs-hg-commit-431.patch
"${FILESDIR}"/ncpfs-hg-commit-432.patch
"${FILESDIR}"/ncpfs-hg-commit-433.patch
"${FILESDIR}"/ncpfs-hg-commit-434.patch
"${FILESDIR}"/ncpfs-hg-commit-435.patch
"${FILESDIR}"/ncpfs-hg-commit-436.patch
"${FILESDIR}"/ncpfs-hg-commit-437.patch
"${FILESDIR}"/ncpfs-hg-commit-438.patch
"${FILESDIR}"/ncpfs-hg-commit-439.patch
"${FILESDIR}"/ncpfs-hg-commit-440.patch
"${FILESDIR}"/ncpfs-hg-commit-441.patch
"${FILESDIR}"/ncpfs-hg-commit-442.patch
"${FILESDIR}"/ncpfs-hg-commit-443.patch
"${FILESDIR}"/ncpfs-hg-commit-444.patch
"${FILESDIR}"/ncpfs-hg-commit-445.patch
"${FILESDIR}"/ncpfs-hg-commit-446.patch
"${FILESDIR}"/ncpfs-hg-commit-447.patch
"${FILESDIR}"/ncpfs-hg-commit-448.patch
"${FILESDIR}"/ncpfs-hg-commit-449.patch
"${FILESDIR}"/ncpfs-hg-commit-450.patch
"${FILESDIR}"/ncpfs-hg-commit-451.patch
"${FILESDIR}"/ncpfs-hg-commit-452.patch
"${FILESDIR}"/ncpfs-hg-commit-453.patch
"${FILESDIR}"/ncpfs-hg-commit-454.patch
"${FILESDIR}"/ncpfs-hg-commit-455.patch
"${FILESDIR}"/ncpfs-hg-commit-456.patch
"${FILESDIR}"/ncpfs-hg-commit-457.patch
"${FILESDIR}"/ncpfs-hg-commit-458.patch
"${FILESDIR}"/ncpfs.LDFLAGS.patch
"${FILESDIR}"/ncpfs.pam_ncp_auth.syslog.patch
"${FILESDIR}"/ncpfs.offsetof.patch
"${FILESDIR}"/ncpfs.mount_hang.patch
"${FILESDIR}"/ncpfs-2.2.6-mount-issue-ver2.patch
"${FILESDIR}"/ncpfs-2_2_6_partial.patch
"${FILESDIR}"/ncpfs-2.2.6-CVE-2011-1679+1680.diff
# Build fixes.
"${FILESDIR}"/${P}-missing-includes.patch
# Misc patches borrowed from Mageia.
"${FILESDIR}"/${P}-align-fix.patch
"${FILESDIR}"/${P}-getuid-fix.patch
"${FILESDIR}"/${P}-pam_ncp_auth-fix.patch
"${FILESDIR}"/${P}-r6-servername-array-fix.patch
# Misc patches borrowed from Debian.
# Fixes Bug #497278
"${FILESDIR}"/${P}-drop-kernel-check.patch
"${FILESDIR}"/${P}-r6-drop-mtab-support.patch
"${FILESDIR}"/${P}-no-suid-root.patch
"${FILESDIR}"/${P}-remove-libncp_atomic-header.patch
# Support LDFLAGS.
"${FILESDIR}"/${P}-r6-ldflags-support.patch
# Bug 446696. This might need re-diffing if additional Makefile
# fixes are added.
"${FILESDIR}"/${P}-makefile-fix-soname-link.patch
"${FILESDIR}"/${P}-usr-merge.patch
"${FILESDIR}"/${P}-fix-build-with-gcc14.patch
"${FILESDIR}"/${P}-php5x.patch
"${FILESDIR}"/${P}-php_auth_nds-php8.patch
"${FILESDIR}"/${P}-php-install-root.patch
"${FILESDIR}"/${P}-r5-nds-null-name.patch
)
DOCS=( FAQ README )
src_prepare() {
# Bug #273484.
sed -i '/ldconfig/d' lib/Makefile.in || die
append-cflags -fcommon -Wincompatible-pointer-types
default
}
src_configure() {
# PHP integration no longer supported in Gentoo, per Bug #582516.
econf \
--prefix="${EPREFIX}/usr" \
$(use_enable nls) \
$(use_enable pam pam "$(getpam_mod_dir)") \
$(use_enable php) \
--disable-ipx-tools \
--enable-ipx
}
src_install() {
dodir $(getpam_mod_dir) /usr/sbin
# Install main software and headers.
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install-dev
einstalldocs
}
pkg_postinst() {
if use php; then
elog "The bundled PHP extension php_auth_nds was built and installed."
elog "Make sure the matching PHP slot is installed and selected so that"
elog "the built module path matches your active php-config."
fi
}