diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-fs/ncpfs |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-fs/ncpfs')
22 files changed, 1886 insertions, 0 deletions
diff --git a/net-fs/ncpfs/Manifest b/net-fs/ncpfs/Manifest new file mode 100644 index 000000000000..7d9908e1e03a --- /dev/null +++ b/net-fs/ncpfs/Manifest @@ -0,0 +1,24 @@ +AUX ipx.confd 604 SHA256 ae98222d9b94a86fad8f75303a084ee65599987f9681652118d1f014e74e9493 SHA512 b20a772fec2130054037f71a930e237baa33c264bf090568ad1a248c20680b994144d02d6488dad42c3643516f55da5171415b10aab9a908544f571c507d5690 WHIRLPOOL 531ac0c32a2e82160184e520fafdbcf11287ba212fb3619d98cdd28a24287ef68bd0c56931a765ec55ab8be300e3d979d3e878f729bf8bb852b9694594a50439 +AUX ipx.init 872 SHA256 d3b2855bda1227d1ef7a38f028c80c8072338b2e540ad82429c3384d9e69aeb9 SHA512 a64efeecfdb847ad16289ab5b5c4ebba8d6c910f50a378608db9aa0ef09210c4a054531abf2b4ee84b5c8ab440df61970172e7421ccdb4340127c2bb4c283ec5 WHIRLPOOL 99a62843b5a945f174a6ef47a5805516f29c36bffd716f0396cfe8fb8a984a8f6da2ea1234a605c2921f70d09b07ef2e9b336fb5a12008dfa55958b90b05cda2 +AUX ncpfs-2.2.5-php.patch 559 SHA256 240fa4b2eba421031e54242af11d270115f180ab9a2f39df5081a984aab7e14c SHA512 1c8509216b759df915f046c42dbb8a56d101ef9382f22f7830c089fc4f4310c75291c3984c1f079fe7b23f94717debb272c7d2b166619d415ea9df87168a52ca WHIRLPOOL 5fe06ae1208250184e2f14465914d6249759677ad11f23c399b4f6d01b023650e4d6f9e3aed2638fa6e1eefa5993c86c1cc4b3d3532765f7ea3c583ee26b0a0a +AUX ncpfs-2.2.6-align-fix.patch 421 SHA256 bc1b5e972b28a6ac6e3bf37730e7f69f91528f69aff1a98809938a3e054eb5e7 SHA512 cf76a9866926048a0792e315c1296cb144432f8d576d9e7d68004f5eb7e10a19ff097ea4d450d2f36da05d97650f1a3411cb6a45bd88b44f6050d5b6df254528 WHIRLPOOL 75b9f12ed0b01acbf11b5ce0ebdff7fef7b505fa23767059af7d1bc438453c5ab307bdc4e1e2688a20b9fd630b47595f0dac9a2009d62b0155b7cd57b6797891 +AUX ncpfs-2.2.6-drop-kernel-check.patch 728 SHA256 b695ab86896abebaa9cd4160c8273ff32b8eee932be2210114a36dd012af1811 SHA512 6433bd1df6e9d830b0e23882dd4d00afddbd9780d994de0ca480155d817e077b88ae7f46538855631e14a62cc52ec8c1fc5c230b1b64687ada5f2cccb61e392a WHIRLPOOL 53c4c55416c0471fae1a99a00066a41b5ce30a0bf3658e5efc31287c4348efe1a93403268634e0d1ec4618645ef7a559c314483f0bcb7911fca329a2d2dac39e +AUX ncpfs-2.2.6-drop-mtab-support.patch 7196 SHA256 6e6712b7ec51bfe71447a7cf94d6498245c73666ad69e6225bba4566fd6475cd SHA512 a7498d8927c251f882f5d63c2250a8ef2ec72191531bd95bdd1c65aad1f8600602dd2ae54fc0ed6ca95c431fe330168abe972d3d3acad8e71733dde1452eed0b WHIRLPOOL 9bf268cca881222550bc81bd352a9acd1feb43befd9732111ca622f2b8184b5eee1ae659331feeb12e146132832ff565f8c29b8b387309cbf3a35e9b17781a39 +AUX ncpfs-2.2.6-gcc4.patch 1271 SHA256 27e730a4bf83ed825f2c7128e0e660ad82d75378ee178731782dd55e71a3e460 SHA512 b67b3a8267a76ef1fe3a128443fa96831896c3cac8f41136d3932816dfe9ab5a4d55258b6f19288c543015e53e41b691577484abf57f9163c0e3bebb4742cdbe WHIRLPOOL 6b2c850231f3295e6a029ad7b9636ed3130bead9859d0ce4b0deb2ae70eac76832cc29d4ddfc7b1cca0151995f15147a9a5e2a0c6f71b2f6b9b5a9f2af9d8a77 +AUX ncpfs-2.2.6-getuid-fix.patch 5121 SHA256 67e61f5991f2a5c9f28661055ab23e3acec1c01a4fc45397fa014895e994e50b SHA512 46f02242198829dc615dd9d07ec7502e88d5738b5055e480758ddabe76b65432d436b24607a0131fd33724fa1cec95b90460b8b27c887d29c5c71a410d89edd8 WHIRLPOOL 233820039cf59f5da18c630040247da92389793a3b4da8f26e8e32405cf69a9557d38781dbee1b186e58131aa136fb0f1e282c881d24d0fb80d0ba077dc87369 +AUX ncpfs-2.2.6-ldflags-support.patch 5974 SHA256 078f3ceb155a7ab13d0be70079a09494343d738aa9ae0e7ca606e8a2c13047e2 SHA512 4d9d6ed8021b9a9a64622e3b2af63616c69ba77ee8b4d83930d34071ac4a1d2f273e02a7ef7051edc5f816a860f977ba6474710e9ced91ff89560739976b10f6 WHIRLPOOL afb0bc5d5a5668e84ce62046f2f1ac45d7d1e8d197ecb069d01fef7ca11b2474fd51ff8aab2902b2aff6c751adec5d3486eca14500a1b529b4b79e685424a00f +AUX ncpfs-2.2.6-makefile-fix-soname-link.patch 771 SHA256 db5f6c3bfa44de96c0ea7990dfef45bedd65d8008bdaac42749d391041b8b0d7 SHA512 0f5f6143e6e66a7f2562c8db7a184df0a507cb1d19c32cda787ba989d0827175d198f400c6402ef399436fb4538ee067e432c5dd5b64509e0cddc4a4aef3f0dd WHIRLPOOL a7327431ae01fdb5ee4f9fd822208e7b82568071114107278dd24574d6172f425412e1d68a5c68c6fdb973572dfd24a48e3d16b9620ad31eef58412b17993328 +AUX ncpfs-2.2.6-missing-includes.patch 758 SHA256 5231d7aaade8af5cec769150d2118d257930a371f6faf7bdde9c6427d2969571 SHA512 4fab8be6c46d494721d6186055b03b6274d77f8e5a2e1bb1a28a73e8ec57805e4ca32b4a0ea4c853c8ebf023b88cc09a50307b04f97d42d5ecffd486c8a4892e WHIRLPOOL d26795d392001d47a972d88b6b0c41a51dfd7fc5d7b7bb19c119beccdf212af125f724ba55f3644e45c32ae2ea176a8dc6d69eb0033533b627e17dcc0801efb8 +AUX ncpfs-2.2.6-multiple-vulns.patch 14138 SHA256 5603915028702fdf6b2b09be9da1e1efaf4283a6f09c8a56aaae783e40707605 SHA512 a58a3d5f4ff7540a880e064bfe7602d38671ddd737bc8e4a9e48ef52f0864de8e0ae51f0fea2ae0be82cc6910d4a47ff8562f9a730dd1930a37fd870bc2823c9 WHIRLPOOL 4f3d428ec4615f931368d8f277303caa3cebc6a796b47ddce179f6cd947b3c1f71e75ec6fd273051452c48acd7bb29558ff9c410e157020eae54308324390b26 +AUX ncpfs-2.2.6-no-suid-root.patch 544 SHA256 d743c2266f528ea592dade37279f0e2856948ddda1c839c8eff99faba9dda47c SHA512 697d577aab12c94cbdb36c2f9f2cd51b82e3ab5efb4a9e8246a7c93b7004d004e7d4fdb1ec003585daf1a11f9f559fd65ea86fe8933f2a7d89b0ce810f21c975 WHIRLPOOL b02ebf2006fc16b53eed6091be67692ccb80ac120d79e576114050afdfdeea72ead4ea396c4a092d42b9e1ed6c38bb055474fc5aa14169128b89f9394f6ba7ea +AUX ncpfs-2.2.6-pam_ncp_auth-fix.patch 556 SHA256 9cbf947dad700787e084c74d00a9a68ac0bddeb89568c6546816560c7255e93e SHA512 3c20c36bb2b8c72440e359bb3f66d5a91bc91132accc518bae8db0fbc77aaf966e676f494c8add959178e315513aaddc9f627a05b9e0c376cf7ece5bba0b0dde WHIRLPOOL 6cddf88d0b0aac79d8855a77fe7d2ffe36a6b18c17585927e84b2d084a234868e8eb4b86fbafa2521ccd0c19a6431fb909cfc860af4a5465f518dcf1efd46fe6 +AUX ncpfs-2.2.6-remove-libncp_atomic-header.patch 572 SHA256 881a5c6ebe5bed2563a69bec90c2bf19c4fbc14a7e0fb972ce44917610d5d946 SHA512 07689c979e8e6a40aca410ac8211c6af9fa640679c34ab3431e70c849e9f3c42d26b204310a697ef1494f33b5296e642b977dfc56453f680527ee54d697abe1c WHIRLPOOL 1cd8e5a1eddddbf4a370f1864b5a4294268dc609035ff6ab6451247d1c20287a2e2afbc4ad11c7d225b98cb30d7688f1a3c2e59d5b802ed79de6bb79806fbd83 +AUX ncpfs-2.2.6-remove-packed-attrib.patch 10312 SHA256 f1c587b329224f34f351e08b32333e854539223d337e6bb2fdadf28c2130673b SHA512 efd11c2cf08f3b7b1458b836ee863f31e3ae470986a02a3d2db0ec6fbb7a984e2d33643765d7223b797732d80187412a907a9ca971233eb0f95ed4744ef6f44a WHIRLPOOL 187d2c71547de0de2007f872a53a7c4545a2ace4d258fc93802283278202eb0db7fbef70c7a6f7210e8f037e65399c76fa57def0fe73591d8d24967432be9a4c +AUX ncpfs-2.2.6-servername-array-fix.patch 523 SHA256 8dd6be08b94259051c9cb8158a8375c4a7e35c5fc32301073ec174399458812c SHA512 10c8a0b7c6d715018acf77ea3bcca2e50add48d479cc0ee07035f3f8fb910069c2c508a25ab3de945ef19c78add6d8192f0cb484e756d9a15ceb3afcd8195a69 WHIRLPOOL ae9799b79681c8eadb5e5dc6c4c0f4e7fd4c5040fbaa84a166bf09d24e1e1fb6cdb0842acafefa3b6a9f0f6cb3e2ed1593898beb79fcee329b6a5e8f266b5d6c +AUX ncpfs-2.2.6-zend_function_entry.patch 296 SHA256 8b598b730a313181e7d1c3f26b3daf7342ff74f0a8ba1ad4dd8f7628047fe1e2 SHA512 c96723a840cb1b0cdddb91ebe74620b87a32350be084f21b741bda4e399a7648fd00522e9f2ec8404d5a98835d3f5a343dd588f4279848cc031de5bed01680e0 WHIRLPOOL 1c7ebde603741a0d157c7d8cbf4d0910758105cdff5a00074c6161983835f91b134a5bdb94782232a82403bc76e8ac67df145529352e162e10524782d1447e8c +DIST ncpfs-2.2.6.tar.gz 2100545 SHA256 2837046046bcdb46d77a80c1d17dbfd15e878700e879edab4cda9f080e0337f9 SHA512 51f85eaae85deb66cea2ff434974699f6aa45ed1ed75217ef6176ac0b7d0f9f1c4fb186afc64c1b495474d5bad9ac7614033128c0bec39c05de723a9b29c8602 WHIRLPOOL c0d4cca71fb3921e39fc6def9932d5a2500a65c7ca60f15ee09eef25637f7653df489c1947b9880f5c4eb3fab11cba663b8604fad8989170b3a74994cd4eb847 +EBUILD ncpfs-2.2.6-r3.ebuild 2604 SHA256 548c6982e15b1645d6ce915cc15722222861291ced326de57f3035b24a73f250 SHA512 c81d58564071787615b572ed360230ad2fa2d8030a2a8aefa778467b7be7d9726c5556bb7faad3f73e7a92341a33aebc61cb812a951d9f7c2970424ef733b976 WHIRLPOOL c71d98b4d73f7a779b69795cc732b81466634ce42564fe4f51232b5436800ff959a30e88a2a76fd964ae46c50c2773ecc6a9d7000d9f687feea2127d07e0315a +EBUILD ncpfs-2.2.6-r4.ebuild 2449 SHA256 2aba7d5e165e917b9efdccb2da65bb4820dded35d3f5d7a23a70bba1fc01728d SHA512 46cf6f9b1968528649df09596d097b7f775fb2ac61e69ebedce78bb7ae0c7c1622d3febc9d25245278de73c938edf488f99712dac5c7db4aa4a3f150e83830e8 WHIRLPOOL e9e71f4a7285bf560a3c554fe6936abb285e282a9ac1ad549c7bc08122fc85e177822e18ec8123faa895aaf063641b41a4384447584a3ea212de6fe92cdbbc13 +MISC ChangeLog 3198 SHA256 66998e5598e9a69af8e1a920ea855fa17a41a6b638e2b66f144da17fd8c827d8 SHA512 43aef9d35157e635d79e04cabc0629f2122138c750ac5ce1bb483691038551967b810ff2e941946dc21574bb00e364fa40600b2a0f2677c997ba11ed93f8decf WHIRLPOOL 53664864477bc393b34edd99d18c4d77e18a7d6e9782f4b91f6fc0ff278f452e384c4504ca5f8ba15293ad71c1ada117f716178a464556edaa5562b4d4612b65 +MISC ChangeLog-2015 6601 SHA256 81195998789b5a72a2a25c93192a47984ff6d6b482841749d4e0709f0c0c3fd3 SHA512 4e3bacb85d64cdd4b3240ea20c794e0354bfc85434ff3464a9d0f931ea04e2a90bfb17d2b13be3b67aa2208c99d89f492ae1478aa7664f034502ccbbf74a617e WHIRLPOOL 685e523ccc10cec4b95b205ee94134473c942e4b91c767635e03ac345e4b64ce1d8c713522202abbecc85d135aa016038c7f75c23c3b02c7f4cdc391fa8e1789 +MISC metadata.xml 376 SHA256 8f5abedbae70054852c88f3336a36bc4450b5dab797e6fb343b04fcea638a10d SHA512 dacdb06d762397d05a6ba195648173ddd13822bc020fd0c8ed12148003e9ee651636f162860c5aace8e1182111da4082d2c509a20e8523bd8ed05ef04c51afec WHIRLPOOL 8963090f9ff93add22124bd30c90b47ba11d3bf775bba3792c8a175e6f0ce065c67bb2f76c30350f9e923659fca920074021f1da07a09c76f225c2a569143074 diff --git a/net-fs/ncpfs/files/ipx.confd b/net-fs/ncpfs/files/ipx.confd new file mode 100644 index 000000000000..ca778f4e286a --- /dev/null +++ b/net-fs/ncpfs/files/ipx.confd @@ -0,0 +1,27 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Config file for /etc/init.d/ipx + +# Automatically selecting a primary interface. +IPX_AUTO_PRIMARY=on + +# Automatically creating interfaces. +IPX_AUTO_INTERFACE=on + +# Interface to which IPX sockets are bound. +IPX_DEVICE=eth0 + +# The IPX frame type to use. +# Valid values are: 802.2, 802.3, SNAP, & EtherII. +IPX_FRAME=802.2 + +# Create a special kind of IPX interface that does not +# have a physical device or frame type. +IPX_INTERNAL_NET=no + +# Network number +IPX_NETNUM=1 + +# Node number +IPX_NODENUM=1 diff --git a/net-fs/ncpfs/files/ipx.init b/net-fs/ncpfs/files/ipx.init new file mode 100644 index 000000000000..e4aa25716c5d --- /dev/null +++ b/net-fs/ncpfs/files/ipx.init @@ -0,0 +1,41 @@ +#!/sbin/openrc-run +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +#NB: Config is in /etc/conf.d/ipx + +depend() { + need net netmount +} + +start() { + local retval=0 + + ebegin "Bringing IPX up" + if [ ${IPX_INTERNAL_NET} = "yes" ] + then + /usr/bin/ipx_internal_net add ${IPX_NETNUM} ${IPX_NODENUM} + retval=$? + else + /usr/bin/ipx_interface add -p ${IPX_DEVICE} \ + ${IPX_FRAME} ${IPX_NETNUM} + retval=$? + fi + + /usr/bin/ipx_configure \ + --auto_primary=${IPX_AUTO_PRIMARY} \ + --auto_interface=${IPX_AUTO_INTERFACE} + retval=$(( $retval + $? )) + eend ${retval} "Failed to bring IPX up" +} + +stop() { + local retval=0 + + ebegin "Bringing IPX down" + /usr/bin/ipx_configure --auto_primary=off --auto_interface=off + retval=$? + /usr/bin/ipx_interface delall + retval=$(( $retval + $? )) + eend ${retval} "Failed to down IPX" +} diff --git a/net-fs/ncpfs/files/ncpfs-2.2.5-php.patch b/net-fs/ncpfs/files/ncpfs-2.2.5-php.patch new file mode 100644 index 000000000000..81908acd6c0b --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.5-php.patch @@ -0,0 +1,16 @@ +--- a/contrib/php/build/rules.mk.orig 2004-12-09 13:01:04.417854240 +0000 ++++ b/contrib/php/build/rules.mk 2004-12-09 13:01:42.460070944 +0000 +@@ -63,10 +63,10 @@ + + install-modules: + @test -d modules && \ +- $(mkinstalldirs) $(moduledir) && \ +- echo "installing shared modules into $(moduledir)" && \ ++ $(mkinstalldirs) $(DESTDIR)/$(moduledir) && \ ++ echo "installing shared modules into $(DESTDIR)/$(moduledir)" && \ + rm -f modules/*.la && \ +- cp modules/* $(moduledir) || true ++ cp modules/* $(DESTDIR)/$(moduledir) || true + + include $(builddir)/.deps + diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-align-fix.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-align-fix.patch new file mode 100644 index 000000000000..49d3c386d5a1 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-align-fix.patch @@ -0,0 +1,12 @@ +diff -Naurp ncpfs-2.2.6.orig/lib/ndslib.c ncpfs-2.2.6/lib/ndslib.c +--- a/lib/ndslib.c.orig 2005-01-27 12:35:59.000000000 -0500 ++++ b/lib/ndslib.c 2014-08-12 21:07:35.559190454 -0400 +@@ -957,7 +957,7 @@ static NWDSCCODE nds_beginauth2( + NWDSCCODE err; + int n1, n3; + u_int16_t n3a; +- char rpb_b[DEFAULT_MESSAGE_LEN]; ++ char rpb_b[DEFAULT_MESSAGE_LEN] __attribute__ ((aligned (4))); + Buf_T rpb; + size_t k1tl; + diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-drop-kernel-check.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-drop-kernel-check.patch new file mode 100644 index 000000000000..9348c08536e4 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-drop-kernel-check.patch @@ -0,0 +1,31 @@ +Description: Drop kernel version check +Author: Bastian Blank <waldi@debian.org> +Bug-Debian: http://bugs.debian.org/692472 + +--- a/sutil/ncpm_common.c.orig ++++ b/sutil/ncpm_common.c +@@ -243,23 +243,6 @@ static int load_ncpfs(void) + #endif /* MOUNT2 */ + + static int getmountver(void) { +- struct utsname name; +- int maj, mid, rev; +- int ver; +- +- if (uname(&name)) { +- errexit(1, _("Cannot get kernel release\n")); +- } +- if (sscanf(name.release, "%d.%d.%d", &maj, &mid, &rev) != 3) { +- errexit(2, _("Cannot convert kernel release \"%s\" to number\n"), name.release); +- } +- ver = maj*0x10000 + mid*0x100 + rev; +- if (ver < 0x20100) +- return 2; +- if (ver < 0x20328) +- return 3; +- if (ver < 0x2051F) +- return 4; + return 5; + } + + diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-drop-mtab-support.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-drop-mtab-support.patch new file mode 100644 index 000000000000..b9c39f51e4ed --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-drop-mtab-support.patch @@ -0,0 +1,269 @@ +diff -Naurp ncpfs-2.2.6.orig/sutil/ncplogin.c ncpfs-2.2.6/sutil/ncplogin.c +--- a/sutil/ncplogin.c.orig 2014-08-13 02:52:56.859067273 -0400 ++++ b/sutil/ncplogin.c 2014-08-13 02:53:42.699067001 -0400 +@@ -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 @@ ncpipx:; + } + 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 -Naurp 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 2014-08-13 02:52:56.959067273 -0400 ++++ ncpfs-2.2.6/sutil/ncpm_common.c 2014-08-13 02:55:38.349066313 -0400 +@@ -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,68 +1422,6 @@ static const struct smntflags { + {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; +- +- 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) +- { +- errexit(59, _("Can't open %s\n"), MOUNTED); +- } +- if (addmntent(mtab, &ment) == 1) +- { +- errexit(60, _("Can't write mount entry\n")); +- } +- if (fchmod(fileno(mtab), 0644) == -1) +- { +- 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 -Naurp 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 2014-08-13 02:52:56.749067274 -0400 ++++ ncpfs-2.2.6/sutil/ncpm_common.h 2014-08-13 02:53:42.699067001 -0400 +@@ -60,7 +60,6 @@ void verify_argv(int argc, char* argv[]) + 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 -Naurp ncpfs-2.2.6.orig/sutil/ncpmount.c ncpfs-2.2.6/sutil/ncpmount.c +--- ncpfs-2.2.6.orig/sutil/ncpmount.c 2014-08-13 02:52:56.749067274 -0400 ++++ ncpfs-2.2.6/sutil/ncpmount.c 2014-08-13 02:53:42.699067001 -0400 +@@ -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 @@ ncpipx:; + } + ncp_close(conn); + +- if (!opt_n) { +- block_sigs(); +- add_mnt_entry(mount_name, mount_point, info.flags); +- unblock_sigs(); +- } + return 0; + } + +diff -Naurp ncpfs-2.2.6.orig/sutil/ncpumount.c ncpfs-2.2.6/sutil/ncpumount.c +--- ncpfs-2.2.6.orig/sutil/ncpumount.c 2014-08-13 02:52:56.749067274 -0400 ++++ ncpfs-2.2.6/sutil/ncpumount.c 2014-08-13 02:55:10.369066480 -0400 +@@ -179,108 +179,6 @@ static void enableAlarm(void) { + 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) { +- addmntent(new_mtab, mnt); +- } +- } +- +- 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) { +@@ -617,10 +515,6 @@ static int old_ncpumount(int argc, char + ret = 1; + continue; + } +- if (clearMtab(&mount_point, 1)) { +- ret = 1; +- continue; +- } + } + return ret; + } +@@ -739,7 +633,6 @@ main(int argc, char *argv[]) + 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) { diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-gcc4.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-gcc4.patch new file mode 100644 index 000000000000..793aca6cbccd --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-gcc4.patch @@ -0,0 +1,36 @@ +diff -ur ncpfs-2.2.6-orig/lib/ncplib.c ncpfs-2.2.6/lib/ncplib.c +--- a/lib/ncplib.c.orig 2006-01-13 16:55:05.000000000 -0500 ++++ b/lib/ncplib.c 2006-01-13 16:56:08.000000000 -0500 +@@ -2421,7 +2421,7 @@ + int i = 1; + NWCCODE nwerr; + +- static int get_argument(int arg_no, const char **target) { ++ int get_argument(int arg_no, const char **target) { + int count = 1; + + if (target != NULL) { +diff -ur ncpfs-2.2.6-orig/util/nwpjmv.c ncpfs-2.2.6/util/nwpjmv.c +--- ncpfs-2.2.6-orig/util/nwpjmv.c 2006-01-13 16:55:05.000000000 -0500 ++++ ncpfs-2.2.6/util/nwpjmv.c 2006-01-13 16:55:50.000000000 -0500 +@@ -131,7 +131,7 @@ + char *s = q->command; + char *target_end = target + target_size; + +- static void add_string(const char *str) ++ void add_string(const char *str) + { + int len = strlen(str); + if (target + len + 1 > target_end) +diff -ur ncpfs-2.2.6-orig/util/pserver.c ncpfs-2.2.6/util/pserver.c +--- ncpfs-2.2.6-orig/util/pserver.c 2006-01-13 16:55:05.000000000 -0500 ++++ ncpfs-2.2.6/util/pserver.c 2006-01-13 16:55:36.000000000 -0500 +@@ -153,7 +153,7 @@ + char *s = q->command; + char *target_end = target + target_size; + +- static void add_string(const char *str) ++ void add_string(const char *str) + { + int len = strlen(str); + if (target + len + 1 > target_end) diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-getuid-fix.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-getuid-fix.patch new file mode 100644 index 000000000000..64193c22d052 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-getuid-fix.patch @@ -0,0 +1,124 @@ +diff -Naurp ncpfs-2.2.6.orig/contrib/tcl-utils/chgpwd.c ncpfs-2.2.6/contrib/tcl-utils/chgpwd.c +--- a/contrib/tcl-utils/chgpwd.c.orig 2005-01-27 12:35:59.000000000 -0500 ++++ b/contrib/tcl-utils/chgpwd.c 2014-08-12 21:08:25.779190155 -0400 +@@ -292,12 +292,12 @@ int main(int argc, char *argv[]) { + } + } else { + if (!treeName[0]) { +- NWCXGetPreferredDSTree(treeName,sizeof(treeName)); ++ dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName)); + + } + if (!treeName[0]) { + fprintf(stderr,"failed: You must specify a server or a tree\n"); +- dserr=114; ++ /*dserr=114;*/ + goto finished; + } + +diff -Naurp ncpfs-2.2.6.orig/contrib/tcl-utils/ncplist.c ncpfs-2.2.6/contrib/tcl-utils/ncplist.c +--- ncpfs-2.2.6.orig/contrib/tcl-utils/ncplist.c 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/contrib/tcl-utils/ncplist.c 2014-08-12 21:08:25.779190155 -0400 +@@ -299,7 +299,12 @@ int main(int argc, char *argv[]) { + }else { + + if (!treeName[0]) { +- NWCXGetPreferredDSTree(treeName,sizeof(treeName)); ++ dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName)); ++ if (dserr){ ++ fprintf(stderr, "failed: Cannot get preffered DS tree: %s\n", ++ strnwerror(dserr); ++ exit(106); ++ } + + } + if (!treeName[0]) { +diff -Naurp ncpfs-2.2.6.orig/contrib/tcl-utils/ncpreadprop.c ncpfs-2.2.6/contrib/tcl-utils/ncpreadprop.c +--- ncpfs-2.2.6.orig/contrib/tcl-utils/ncpreadprop.c 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/contrib/tcl-utils/ncpreadprop.c 2014-08-12 21:08:25.779190155 -0400 +@@ -470,7 +470,7 @@ main(int argc, char *argv[]) + } + } else { + if (!treeName[0]) { +- NWCXGetPreferredDSTree(treeName,sizeof(treeName)); ++ dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName)); + + } + if (!treeName[0]) { +diff -Naurp ncpfs-2.2.6.orig/contrib/tcl-utils/ncpreadprops.c ncpfs-2.2.6/contrib/tcl-utils/ncpreadprops.c +--- ncpfs-2.2.6.orig/contrib/tcl-utils/ncpreadprops.c 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/contrib/tcl-utils/ncpreadprops.c 2014-08-12 21:08:25.779190155 -0400 +@@ -507,7 +507,7 @@ main(int argc, char *argv[]) + } + } else { + if (!treeName[0]) { +- NWCXGetPreferredDSTree(treeName,sizeof(treeName)); ++ dserr=NWCXGetPreferredDSTree(treeName,sizeof(treeName)); + + } + if (!treeName[0]) { +diff -Naurp ncpfs-2.2.6.orig/lib/nwclient.c ncpfs-2.2.6/lib/nwclient.c +--- ncpfs-2.2.6.orig/lib/nwclient.c 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/lib/nwclient.c 2014-08-12 21:08:25.779190155 -0400 +@@ -481,6 +481,10 @@ static char* readnwinfosfile (char * use + *err = EACCES; + return NULL; + } ++ if (st.st_uid != getuid()) { ++ *err = EACCES; ++ return NULL; ++ } + if ((st.st_mode & (S_IRWXO | S_IRWXG)) != 0) { + *err = NCPLIB_INVALID_MODE; + return NULL; +@@ -560,7 +564,7 @@ NWDSCCODE NWCXGetPreferredDSTree (NWD + if (!res) + res=readnwinfosfile (NULL,NDS_PREFERRED_TREE,NULL, &err); + if (!res) +- return -1; ++ return err; + if (strlen (res)+1 >maxLen) + return NWE_BUFFER_OVERFLOW; + strcpy(preferTree,res); +@@ -581,7 +585,7 @@ NWDSCCODE NWCXGetDefaultNameContext (con + if (!res) + res=readnwinfosfile (NULL,NDS_PREFERRED_NAME_CTX,forTree,&err); + if (!res) +- return -1; ++ return err; + if (strlen (res)+1 >maxLen) + return NWE_BUFFER_OVERFLOW; + strcpy(nameContext,res); +@@ -603,7 +607,7 @@ NWDSCCODE NWCXGetPreferredServer (con + + res=readnwinfosfile (NULL, NDS_PREFERRED_SERVER, forTree, &err); + if (!res) { +- return -1; ++ return err; + } + } + /* test that this server DO belongs to tree forTree*/ +@@ -644,7 +648,7 @@ NWDSCCODE NWCXGetDefaultUserName (const + if (!res) + res=readnwinfosfile (NULL,NDS_USER,forTree, &err); + if (!res) +- return -1; ++ return err; + if (strlen (res)+1 >maxLen) + return NWE_BUFFER_OVERFLOW; + strcpy(defaultName,res); +diff -Naurp ncpfs-2.2.6.orig/sutil/ncplogin.c ncpfs-2.2.6/sutil/ncplogin.c +--- ncpfs-2.2.6.orig/sutil/ncplogin.c 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/sutil/ncplogin.c 2014-08-12 21:08:25.779190155 -0400 +@@ -588,7 +588,10 @@ main(int argc, char *argv[]) + int flags = 0; + + if (!info.tree) { +- NWCXGetPreferredDSTree(ntree, sizeof(ntree)); ++ err=NWCXGetPreferredDSTree(ntree, sizeof(ntree)); ++ if (err){ ++ errexit(104, _("Cannot get preffered DS tree: %s\n"),strnwerror(err)); ++ } + info.tree = ntree; + } + diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-ldflags-support.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-ldflags-support.patch new file mode 100644 index 000000000000..111e780ff520 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-ldflags-support.patch @@ -0,0 +1,153 @@ +diff -Naurp ncpfs-2.2.6.orig/contrib/pam/Makefile.in ncpfs-2.2.6/contrib/pam/Makefile.in +--- a/contrib/pam/Makefile.in.orig 2005-01-27 12:35:59.000000000 -0500 ++++ b/contrib/pam/Makefile.in 2014-08-12 21:06:42.369190770 -0400 +@@ -17,6 +17,7 @@ PAM_LIBRARY = pam_ncp_auth.so + 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_OBJECTS): %.do: %.c + + + $(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 -Naurp 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 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/ipx-1.0/Makefile.in 2014-08-12 21:06:42.369190770 -0400 +@@ -9,6 +9,7 @@ vpath %.c ${this_srcdir} + 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 @@ $(ALL_OBJECTS): %.o: %.c + [ -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 -Naurp ncpfs-2.2.6.orig/ipxdump/Makefile.in ncpfs-2.2.6/ipxdump/Makefile.in +--- ncpfs-2.2.6.orig/ipxdump/Makefile.in 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/ipxdump/Makefile.in 2014-08-12 21:06:42.369190770 -0400 +@@ -11,6 +11,7 @@ ncp_if_ether_support = @ncp_if_ether_sup + OBJECTS= ipxutil.o + + ALL_OBJECTS := $(EXEC:%=%.o) $(OBJECTS) ++LDFLAGS = @LDFLAGS@ + + .PHONY : all install dep clean mrproper distclean + .PHONY : dist tgz +@@ -24,7 +25,7 @@ install: $(EXEC) + 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 -Naurp ncpfs-2.2.6.orig/lib/Makefile.in ncpfs-2.2.6/lib/Makefile.in +--- ncpfs-2.2.6.orig/lib/Makefile.in 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/lib/Makefile.in 2014-08-12 21:06:42.369190770 -0400 +@@ -23,6 +23,7 @@ STATIC_NCPLIB_BIN := $(STATIC_NCPLIB) + CCFLAGS += -I. + PIC_FLAGS := -fPIC + NWCOMPAT := 1 ++LDFLAGS := @LDFLAGS@ + + SHARED_VLINK := + SHARED_VLINK_CFLAGS := +@@ -122,7 +123,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) $(LDFLAGS) $(SHARED_VLINK) $(SHARED_O_OBJ) ${LIBS} -lc + + install_static: $(STATIC_NCPLIB_BIN) + $(INSTALL) -d $(DESTDIR)$(libadir) +diff -Naurp ncpfs-2.2.6.orig/Make.rules.in ncpfs-2.2.6/Make.rules.in +--- ncpfs-2.2.6.orig/Make.rules.in 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/Make.rules.in 2014-08-12 21:06:42.369190770 -0400 +@@ -42,6 +42,7 @@ CFLAGS_OPTIONS += $(CWARN) + 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 -Naurp ncpfs-2.2.6.orig/sutil/Makefile.in ncpfs-2.2.6/sutil/Makefile.in +--- ncpfs-2.2.6.orig/sutil/Makefile.in 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/sutil/Makefile.in 2014-08-12 21:06:42.369190770 -0400 +@@ -14,6 +14,7 @@ USE_KERNEL = @USE_KERNEL@ + NDS_SUPPORT = @NDS_SUPPORT@ + + LIBS = @INTLLIBS@ @LIBS@ ++LDFLAGS := @LDFLAGS@ + + # environ in ncpmount + CCFLAGS += -D_GNU_SOURCE +@@ -69,7 +70,7 @@ $(O_UTILS:.o=.d): %.d: %.c + [ -s $@ ] || rm -f $@ + + ncpmap.o: %.o: ncplogin.c +- $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $< ++ $(CC) $(CFLAGS) $(LDFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $< + + ncpmap.d: %.d: ncplogin.c + set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \ +@@ -85,7 +86,7 @@ ncpm_common.d mount_login.d: %.d: %.c + [ -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} ++ $(CC) @GC_SECTIONS@-o $@ $(addsuffix .o,$@) $(LDFLAGS) $(LDFLAGS_$@) ../lib/libncp.a ${LIBS} + + ../lib/libncp.a: + make -C ../lib libncp.a +diff -Naurp ncpfs-2.2.6.orig/util/Makefile.in ncpfs-2.2.6/util/Makefile.in +--- ncpfs-2.2.6.orig/util/Makefile.in 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/util/Makefile.in 2014-08-12 21:06:42.369190770 -0400 +@@ -15,6 +15,7 @@ NDS_SUPPORT = @NDS_SUPPORT@ + MOUNT2 = @MOUNT2@ + + LIBS = @INTLLIBS@ @LIBS@ ++LDFLAGS = @LDFLAGS@ + + O_OTHER = dsqueue.o + O_USERUTILS = slist.o pqlist.o nwfsinfo.o pserver.o nprint.o nsend.o \ +@@ -83,7 +84,7 @@ install-dev: + make -C ../lib libncp.so + + $(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)) $< \ +@@ -94,10 +95,10 @@ $(O_USERUTILS) $(O_SBINUTILS) $(O_OTHER) + 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: + diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-makefile-fix-soname-link.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-makefile-fix-soname-link.patch new file mode 100644 index 000000000000..ece9fc720db6 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-makefile-fix-soname-link.patch @@ -0,0 +1,15 @@ +diff -Naurp ncpfs-2.2.6.orig/lib/Makefile.in ncpfs-2.2.6/lib/Makefile.in +--- a/lib/Makefile.in.orig 2014-08-12 23:23:27.149141996 -0400 ++++ b/lib/Makefile.in 2014-08-12 23:23:55.969141824 -0400 +@@ -99,9 +99,10 @@ distclean: mrproper + install_shared: $(SHARED_NCPLIB_BIN) + $(INSTALL) -d $(DESTDIR)$(libsodir) + $(INSTALL) $(SHARED_NCPLIB_BIN) $(DESTDIR)$(libsodir) ++ ln -sf $(SHARED_NCPLIB_BIN) $(DESTDIR)$(libsodir)/$(SHARED_NCPLIB) ++ ln -sf $(SHARED_NCPLIB_BIN) $(DESTDIR)$(libsodir)/$(SHARED_NCPLIB_SONAME) + + install-dev: install_shared install_static +- ln -sf $(SHARED_NCPLIB_SONAME) $(DESTDIR)$(libsodir)/$(SHARED_NCPLIB) + $(INSTALL) -d $(DESTDIR)$(includedir)/ncp + $(INSTALL) -d $(DESTDIR)$(includedir)/ncp/ext + $(INSTALL) -d $(DESTDIR)$(includedir)/ncp/kernel diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-missing-includes.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-missing-includes.patch new file mode 100644 index 000000000000..11258253af91 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-missing-includes.patch @@ -0,0 +1,22 @@ +diff -ruN ncpfs-2.2.6/contrib/pam/pam_ncp_auth.c ncpfs-2.2.6-fixed/contrib/pam/pam_ncp_auth.c +--- a/contrib/pam/pam_ncp_auth.c.orig 2005-01-27 18:35:59.000000000 +0100 ++++ a/contrib/pam/pam_ncp_auth.c 2007-05-11 21:38:05.143474750 +0200 +@@ -257,6 +257,7 @@ + #include <stdlib.h> + #include <stdio.h> + #include <string.h> ++#include <syslog.h> + #include <unistd.h> + #include <pwd.h> + #include <grp.h> +diff -ruN ncpfs-2.2.6/sutil/ncpm_common.c ncpfs-2.2.6-fixed/sutil/ncpm_common.c +--- ncpfs-2.2.6/sutil/ncpm_common.c 2005-01-27 18:35:59.000000000 +0100 ++++ ncpfs-2.2.6-fixed/sutil/ncpm_common.c 2007-05-11 21:38:29.609003750 +0200 +@@ -82,6 +82,7 @@ + + #include "ncpm_common.h" + ++#include <stddef.h> + #include <stdio.h> + #include <string.h> + #include <signal.h> diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-multiple-vulns.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-multiple-vulns.patch new file mode 100644 index 000000000000..def49a5fad65 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-multiple-vulns.patch @@ -0,0 +1,557 @@ +From: Dan Rosenberg <dan.j.rosenberg () gmail com> +Date: Fri, 5 Mar 2010 12:06:01 -0500 + +============================================ + ncpfs, Multiple Vulnerabilities + March 5, 2010 + CVE-2010-0788, CVE-2010-0790, CVE-2010-0791 +============================================ + +==Description== + +The ncpmount, ncpumount, and ncplogin utilities, installed as part of the ncpfs +package, contain several vulnerabilities. + +1. ncpmount, ncpumount, and ncplogin are vulnerable to race conditions that +allow a local attacker to unmount arbitrary mountpoints, causing +denial-of-service, or mount Netware shares to arbitrary directories, +potentially leading to root compromise. This issue was formerly assigned +CVE-2009-3297, but has since been re-assigned CVE-2010-0788 to avoid overlap +with related bugs in other packages. + +2. ncpumount is vulnerable to an information disclosure vulnerability that +allows a local attacker to verify the existence of arbitrary files, violating +directory permissions. This issue has been assigned CVE-2010-0790. + +3. ncpmount, ncpumount, and ncplogin create lockfiles insecurely, allowing a +local attacker to leave a stale lockfile at /etc/mtab~, causing other mount +utilities to fail and creating denial-of-service conditions. This issue has +been assigned CVE-2010-0791. + +==Workaround== + +If unprivileged users do not need the ability to mount and unmount Netware +shares, then the suid bit should be removed from these utilities. + +==Solution== + +A patch has been released that resolves these issues (attached to this +advisory). ncpfs-2.2.6.partial.patch is intended for ncpfs releases that have +already been patched against the first vulnerability in this report +(CVE-2010-0788, formerly CVE-2009-3297). It has been tested against the latest +ncpfs packages distributed by Fedora, Red Hat, and Mandriva. +ncpfs-2.2.6.full.patch is intended for ncpfs releases that have not been +patched against any of these vulnerabilities. It has been tested against the +latest ncpfs packages distributed by Debian, Ubuntu, and the upstream release +(ftp://platan.vc.cvut.cz/pub/linux/ncpfs/). + +Users are advised to recompile from source, or request updated packages from +downstream distributors. + +==Credits== + +These vulnerabilities were discovered by Dan Rosenberg +(dan.j.rosenberg () gmail com). +Thanks to Vitezslav Crhonek for the patch against the first issue. + +==References== + +CVE identifiers CVE-2010-0788, CVE-2010-0790, and CVE-2010-0791 have been +assigned to these issues. + +http://seclists.org/fulldisclosure/2010/Mar/122 + + +diff -ur ncpfs-2.2.6.orig/sutil/ncplogin.c ncpfs-2.2.6/sutil/ncplogin.c +--- a/sutil/ncplogin.c.orig 2010-03-03 16:18:59.000000000 -0500 ++++ b/sutil/ncplogin.c 2010-03-03 16:17:41.000000000 -0500 +@@ -934,7 +934,9 @@ + 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) { +diff -ur 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 2010-03-03 16:18:59.000000000 -0500 ++++ ncpfs-2.2.6/sutil/ncpm_common.c 2010-03-03 16:17:41.000000000 -0500 +@@ -360,7 +360,7 @@ + #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 @@ + 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; +@@ -444,7 +464,7 @@ + } + 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 +528,7 @@ + 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 +579,7 @@ + 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 +597,7 @@ + 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 +1415,17 @@ + } + #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 +1447,9 @@ + 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"; +diff -ur 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 2010-03-03 16:18:59.000000000 -0500 ++++ ncpfs-2.2.6/sutil/ncpm_common.h 2010-03-03 16:17:41.000000000 -0500 +@@ -121,6 +121,9 @@ + 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)) + + #endif /* __NCPM_COMMON_H__ */ +diff -ur ncpfs-2.2.6.orig/sutil/ncpmount.c ncpfs-2.2.6/sutil/ncpmount.c +--- ncpfs-2.2.6.orig/sutil/ncpmount.c 2010-03-03 16:18:59.000000000 -0500 ++++ ncpfs-2.2.6/sutil/ncpmount.c 2010-03-03 16:17:41.000000000 -0500 +@@ -359,11 +359,17 @@ + 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) +@@ -714,7 +720,9 @@ + ncp_close(conn); + + if (!opt_n) { ++ block_sigs(); + add_mnt_entry(mount_name, mount_point, info.flags); ++ unblock_sigs(); + } + return 0; + } +diff -ur ncpfs-2.2.6.orig/sutil/ncpumount.c ncpfs-2.2.6/sutil/ncpumount.c +--- ncpfs-2.2.6.orig/sutil/ncpumount.c 2010-03-03 16:18:59.000000000 -0500 ++++ ncpfs-2.2.6/sutil/ncpumount.c 2010-03-03 16:17:41.000000000 -0500 +@@ -70,13 +70,24 @@ + #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; + ++uid_t uid; ++ + static void + usage(void) + { +@@ -117,6 +128,40 @@ + 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; + } +@@ -192,10 +237,13 @@ + 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; + } +@@ -206,6 +254,7 @@ + alarm(0); + close(fd); + if (err) { ++ unblock_sigs(); + eprintf(_("Can't lock lock file %s~: %s\n"), MOUNTED, _("Lock timed out")); + return 1; + } +@@ -223,26 +272,205 @@ + 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) { ++ 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"), +- 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; + } +@@ -253,12 +481,8 @@ + 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; + } + + +@@ -409,7 +633,8 @@ + int allConns = 0; + const char *serverName = NULL; + const char *treeName = NULL; +- uid_t uid = getuid(); ++ ++ uid = getuid(); + + progname = strrchr(argv[0], '/'); + if (progname) { diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-no-suid-root.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-no-suid-root.patch new file mode 100644 index 000000000000..050de30b86b0 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-no-suid-root.patch @@ -0,0 +1,16 @@ +Description: Don't install utils as suid root +Author: Bastian Blank <waldi@debian.org> +Bug-Debian: http://bugs.debian.org/692929 + +--- ncpfs-2.2.6.orig/sutil/Makefile.in ++++ ncpfs-2.2.6/sutil/Makefile.in +@@ -51,7 +51,7 @@ all: $(UTILS) + install: all + ${INSTALL} -d $(DESTDIR)$(bindir) + ${INSTALL} -d $(DESTDIR)/sbin +- ${INSTALL} -m 4755 $(UTILS) $(DESTDIR)$(bindir) ++ ${INSTALL} $(UTILS) $(DESTDIR)$(bindir) + ifeq ($(USE_KERNEL),1) + ln -sf $(bindir)/ncpmount $(DESTDIR)/sbin/mount.ncp + ln -sf $(bindir)/ncpmount $(DESTDIR)/sbin/mount.ncpfs + diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-pam_ncp_auth-fix.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-pam_ncp_auth-fix.patch new file mode 100644 index 000000000000..2a9e0edd4b22 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-pam_ncp_auth-fix.patch @@ -0,0 +1,12 @@ +diff -Naurp ncpfs-2.2.6.orig/contrib/pam/pam_ncp_auth.c ncpfs-2.2.6/contrib/pam/pam_ncp_auth.c +--- ncpfs-2.2.6.orig/contrib/pam/pam_ncp_auth.c 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/contrib/pam/pam_ncp_auth.c 2014-08-12 21:02:33.229192251 -0400 +@@ -2534,7 +2534,7 @@ nw_retrieve_nds_user_info(struct nw_user + bailoutctx:; + NWDSFreeContext(ctx); + bailout:; +- if (!err & (ui->qflag & QF_DEBUG)) ++ if ((!err) && (ui->qflag & QF_DEBUG)) + syslog(LOG_NOTICE, "%u %u %s %s %s\n", ui->uid, ui->gid, ui->dir, ui->gecos, ui->shell); + return err; + } diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-remove-libncp_atomic-header.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-remove-libncp_atomic-header.patch new file mode 100644 index 000000000000..22768817045c --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-remove-libncp_atomic-header.patch @@ -0,0 +1,15 @@ +Description: Remove another generated file +Author: Bastian Blank <waldi@debian.org> +Bug-Debian: http://bugs.debian.org/692471 + +--- ncpfs-2.2.6.orig/Makefile.in ++++ ncpfs-2.2.6/Makefile.in +@@ -71,6 +71,7 @@ distclean: + rm -f intl/Makefile po/Makefile po/Makefile.in + rm -f lib/Makefile man/Makefile sutil/Makefile util/Makefile + rm -f include/config.h ++ rm -f include/private/libncp-atomic.h + rm -f include/ncp/ext/socket.h include/ncp/ext/stdint.h + rm -f include/ncp/kernel/fs.h + rm -f include/ncp/kernel/if.h include/ncp/kernel/route.h include/ncp/kernel/types.h + diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-remove-packed-attrib.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-remove-packed-attrib.patch new file mode 100644 index 000000000000..40267c728710 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-remove-packed-attrib.patch @@ -0,0 +1,297 @@ +diff -Naurp ncpfs-2.2.6.orig//include/ncp/ipxlib.h ncpfs-2.2.6//include/ncp/ipxlib.h +--- ncpfs-2.2.6.orig//include/ncp/ipxlib.h 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6//include/ncp/ipxlib.h 2011-02-10 02:38:18.822076000 -0500 +@@ -64,12 +64,12 @@ struct sap_query + 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_rt_def { + struct ipx_rip_packet + { + u_int16_t operation __attribute__((packed)); +- struct ipx_rt_def rt[1] __attribute__((packed)); ++ struct ipx_rt_def rt[1]; + }; + + #ifdef SWIG +diff -Naurp ncpfs-2.2.6.orig//include/ncp/kernel/ncp.h ncpfs-2.2.6//include/ncp/kernel/ncp.h +--- ncpfs-2.2.6.orig//include/ncp/kernel/ncp.h 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6//include/ncp/kernel/ncp.h 2011-02-10 02:38:18.822076000 -0500 +@@ -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]; + }; + + #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]; + }; + + #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]; + }; + #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]; + }; + #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)); + }; +diff -Naurp ncpfs-2.2.6.orig//include/ncp/ncp.h ncpfs-2.2.6//include/ncp/ncp.h +--- ncpfs-2.2.6.orig//include/ncp/ncp.h 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6//include/ncp/ncp.h 2011-02-10 02:38:18.822076000 -0500 +@@ -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 -Naurp 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 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6//include/ncp/ncplib.h 2011-02-10 02:38:18.822076000 -0500 +@@ -462,24 +462,24 @@ struct ncp_file_server_info + #else + struct ncp_file_server_info + { +- u_int8_t ServerName[48] __attribute__((packed)); +- u_int8_t FileServiceVersion __attribute__((packed)); +- u_int8_t FileServiceSubVersion __attribute__((packed)); ++ u_int8_t 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]; + }; + #endif + +@@ -592,7 +592,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)); + }; +@@ -602,32 +602,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; + }; + + NWCCODE NWReadPropertyValue(NWCONN_HANDLE conn, const char *objName, +diff -Naurp ncpfs-2.2.6.orig//ipx-1.0/ipx_cmd.c ncpfs-2.2.6//ipx-1.0/ipx_cmd.c +--- ncpfs-2.2.6.orig//ipx-1.0/ipx_cmd.c 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6//ipx-1.0/ipx_cmd.c 2011-02-10 02:40:19.222076002 -0500 +@@ -63,8 +63,8 @@ + /* 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]; + } buffer; +diff -Naurp ncpfs-2.2.6.orig//lib/ncplib.c ncpfs-2.2.6//lib/ncplib.c +--- ncpfs-2.2.6.orig//lib/ncplib.c 2011-02-10 02:38:05.000000000 -0500 ++++ ncpfs-2.2.6//lib/ncplib.c 2011-02-10 02:38:18.822076000 -0500 +@@ -2584,13 +2584,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; + }; + + static time_t diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-servername-array-fix.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-servername-array-fix.patch new file mode 100644 index 000000000000..3e96aac5b364 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-servername-array-fix.patch @@ -0,0 +1,15 @@ +diff -Naurp 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 2005-01-27 12:35:59.000000000 -0500 ++++ ncpfs-2.2.6/include/ncp/ncplib.h 2014-08-12 21:01:01.159192798 -0400 +@@ -485,9 +485,9 @@ struct ncp_file_server_info + + struct ncp_file_server_info_2 { + #ifdef SWIG +- fixedArray ServerName[49]; ++ fixedArray ServerName[50]; + #else +- u_int8_t ServerName[49]; ++ u_int8_t ServerName[50]; + #endif + u_int8_t FileServiceVersion; + u_int8_t FileServiceSubVersion; diff --git a/net-fs/ncpfs/files/ncpfs-2.2.6-zend_function_entry.patch b/net-fs/ncpfs/files/ncpfs-2.2.6-zend_function_entry.patch new file mode 100644 index 000000000000..648cb8f7f770 --- /dev/null +++ b/net-fs/ncpfs/files/ncpfs-2.2.6-zend_function_entry.patch @@ -0,0 +1,11 @@ +--- a/contrib/php/php_auth_nds.c ++++ b/contrib/php/php_auth_nds.c +@@ -1102,7 +1102,7 @@ + php_info_print_table_end(); + } + +-function_entry auth_nds_functions[] = { ++zend_function_entry auth_nds_functions[] = { + PHP_FE(auth_bindery, NULL) + PHP_FE(auth_nds, NULL) + PHP_FE(auth_tree, NULL) diff --git a/net-fs/ncpfs/metadata.xml b/net-fs/ncpfs/metadata.xml new file mode 100644 index 000000000000..494dcfa44647 --- /dev/null +++ b/net-fs/ncpfs/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>kumba@gentoo.org</email> + <name>Joshua Kinard</name> + </maintainer> + <longdescription>Provides Access to Netware services using the NCP protocol (Kernel support must be activated!)</longdescription> +</pkgmetadata> diff --git a/net-fs/ncpfs/ncpfs-2.2.6-r3.ebuild b/net-fs/ncpfs/ncpfs-2.2.6-r3.ebuild new file mode 100644 index 000000000000..f66a06347b88 --- /dev/null +++ b/net-fs/ncpfs/ncpfs-2.2.6-r3.ebuild @@ -0,0 +1,89 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +inherit eutils 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" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~mips ppc ppc64 x86" +IUSE="nls pam php" + +DEPEND="nls? ( sys-devel/gettext ) + pam? ( virtual/pam ) + php? ( || ( dev-lang/php virtual/httpd-php ) )" + +RDEPEND="${DEPEND}" + +src_prepare() { + # Add patch for PHP extension sandbox violation + epatch "${FILESDIR}"/${PN}-2.2.5-php.patch + epatch "${FILESDIR}"/${P}-gcc4.patch + epatch "${FILESDIR}"/${P}-missing-includes.patch + + # Add a patch to fix multiple vulnerabilities. + # CVE-2010-0788, CVE-2010-0790, & CVE-2010-0791. + # http://seclists.org/fulldisclosure/2010/Mar/122 + epatch "${FILESDIR}"/${P}-multiple-vulns.patch + + # Add a patch that removes the __attribute__((packed)); directive + # from several struct members in include/ncp/ncplib.h. This will + # cut down on a large number of compile warnings generated by modern + # gcc releases. + epatch "${FILESDIR}"/${P}-remove-packed-attrib.patch + + # Misc patches borrowed from Mageia. + epatch "${FILESDIR}"/${P}-align-fix.patch + epatch "${FILESDIR}"/${P}-getuid-fix.patch + epatch "${FILESDIR}"/${P}-pam_ncp_auth-fix.patch + epatch "${FILESDIR}"/${P}-servername-array-fix.patch + + # Misc patches borrowed from Debian. + # Fixes Bug #497278 + epatch "${FILESDIR}"/${P}-drop-kernel-check.patch + epatch "${FILESDIR}"/${P}-drop-mtab-support.patch + epatch "${FILESDIR}"/${P}-no-suid-root.patch + epatch "${FILESDIR}"/${P}-remove-libncp_atomic-header.patch + + # Bug #273484. + sed -i '/ldconfig/d' lib/Makefile.in + + # Support LDFLAGS. + epatch "${FILESDIR}"/${P}-ldflags-support.patch + + # Bug 446696. This might need re-diffing if additional Makefile + # fixes are added. + epatch "${FILESDIR}"/${P}-makefile-fix-soname-link.patch + + # bug 522444 + epatch "${FILESDIR}"/${P}-zend_function_entry.patch +} + +src_configure() { + econf \ + $(use_enable nls) \ + $(use_enable pam pam "$(getpam_mod_dir)") \ + $(use_enable php) +} + +src_install() { + dodir $(getpam_mod_dir) /usr/sbin /sbin + + # Bug #446696. + #ln -s "${D}"/usr/lib64/libncp.so.2.3 "${D}"/libncp.so.2.3.0 + + # Install the main programs, then the headers. + emake DESTDIR="${D}" install || die + emake DESTDIR="${D}" install-dev || die + + # Install a startup script in /etc/init.d and a conf file in /etc/conf.d + newconfd "${FILESDIR}"/ipx.confd ipx + newinitd "${FILESDIR}"/ipx.init ipx + + # Docs + dodoc FAQ README +} diff --git a/net-fs/ncpfs/ncpfs-2.2.6-r4.ebuild b/net-fs/ncpfs/ncpfs-2.2.6-r4.ebuild new file mode 100644 index 000000000000..481e43c3474f --- /dev/null +++ b/net-fs/ncpfs/ncpfs-2.2.6-r4.ebuild @@ -0,0 +1,95 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +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" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~mips ~ppc ~ppc64 ~x86" +IUSE="nls pam php" + +DEPEND=" + nls? ( sys-devel/gettext ) + pam? ( virtual/pam ) + php? ( || ( dev-lang/php:* virtual/httpd-php:* ) )" + +RDEPEND="${DEPEND}" + +MY_PATCHES=( + # PHP extension sandbox violation. + "${FILESDIR}"/${PN}-2.2.5-php.patch + "${FILESDIR}"/${P}-gcc4.patch + "${FILESDIR}"/${P}-missing-includes.patch + + # Add a patch to fix multiple vulnerabilities. + # CVE-2010-0788, CVE-2010-0790, & CVE-2010-0791. + # http://seclists.org/fulldisclosure/2010/Mar/122 + "${FILESDIR}"/${P}-multiple-vulns.patch + + # Add a patch that removes the __attribute__((packed)); directive + # from several struct members in include/ncp/ncplib.h. This will + # cut down on a large number of compile warnings generated by modern + # gcc releases. + "${FILESDIR}"/${P}-remove-packed-attrib.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}-servername-array-fix.patch + + # Misc patches borrowed from Debian. + # Fixes Bug #497278 + "${FILESDIR}"/${P}-drop-kernel-check.patch + "${FILESDIR}"/${P}-drop-mtab-support.patch + "${FILESDIR}"/${P}-no-suid-root.patch + "${FILESDIR}"/${P}-remove-libncp_atomic-header.patch + + # Support LDFLAGS. + "${FILESDIR}"/${P}-ldflags-support.patch + + # Bug 446696. This might need re-diffing if additional Makefile + # fixes are added. + "${FILESDIR}"/${P}-makefile-fix-soname-link.patch + + # bug 522444 + "${FILESDIR}"/${P}-zend_function_entry.patch +) + +DOCS=( FAQ README ) + +src_prepare() { + default + + # Bug #273484. + sed -i '/ldconfig/d' lib/Makefile.in || die + + epatch "${MY_PATCHES[@]}" +} + +src_configure() { + econf \ + $(use_enable nls) \ + $(use_enable pam pam "$(getpam_mod_dir)") \ + $(use_enable php) +} + +src_install() { + dodir $(getpam_mod_dir) /usr/sbin /sbin + + # Install main software and headers. + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install-dev + + # Install a startup script in /etc/init.d and a conf file in /etc/conf.d + newconfd "${FILESDIR}"/ipx.confd ipx + newinitd "${FILESDIR}"/ipx.init ipx + + einstalldocs +} |