]> Pileus Git - ~andy/sunrise/commitdiff
net-misc/autoupnp: Support installing setuid & setgid.
authorMichał Górny <mgorny@gentoo.org>
Wed, 25 Aug 2010 20:57:43 +0000 (20:57 +0000)
committerMichał Górny <mgorny@gentoo.org>
Wed, 25 Aug 2010 20:57:43 +0000 (20:57 +0000)
(Portage version: 2.2_rc69/git/Linux x86_64, unsigned Manifest commit)

svn path=/sunrise/; revision=11247

net-misc/autoupnp/ChangeLog
net-misc/autoupnp/Manifest
net-misc/autoupnp/autoupnp-0.4.3-r1.ebuild [moved from net-misc/autoupnp/autoupnp-0.4.3.ebuild with 58% similarity]
net-misc/autoupnp/metadata.xml

index 062aa7227f4d9d5dcaad6c284ef73246ae28775a..8672aa537e6e91372ce19c1d3ec34da677d6c25c 100644 (file)
@@ -2,6 +2,12 @@
 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+*autoupnp-0.4.3-r1 (25 Aug 2010)
+
+  25 Aug 2010; Michał Górny (sedzimir) <gentoo@mgorny.alt.pl>
+  -autoupnp-0.4.3.ebuild, +autoupnp-0.4.3-r1.ebuild, metadata.xml:
+  Support installing setuid & setgid.
+
 *autoupnp-0.4.3 (21 Aug 2010)
 
   21 Aug 2010; Michał Górny (sedzimir) <gentoo@mgorny.alt.pl>
index 773061d6c8aa93ad913b59d1e08047807d48a2ff..89dee4828d219dcf31c2252a1597922e632afb22 100644 (file)
@@ -1,4 +1,4 @@
 DIST autoupnp-0.4.3.tar.bz2 9381 RMD160 4e8795ebe53a78eab49e229b564732de2f119857 SHA1 074aaf5c9e1d3afe7057ba29d0433439ba8dc4d1 SHA256 a339655b53b51d210be9749fb9d0727627378dfcc5cde4d60027a79ad7fcde08
-EBUILD autoupnp-0.4.3.ebuild 1055 RMD160 9ed91efdd74d01e5bbe608996f23219d7b935eac SHA1 8428a51ae784fcad318e2644703589c2232d290a SHA256 c466126bd1e1ccad31fc6028761959efe2f3347e4b200228eed434db3c674b4f
-MISC ChangeLog 1014 RMD160 4b35acf829395c1a1c6583dfd6ec4b1ab6cdde77 SHA1 10ce7a75a67622f76de0cd8cf6f4677fa2b87d4c SHA256 37a869c0e2652ad6e89b63c0774d5f3bf98ddfb3d1bb63ceb4c9e9b6bd87636c
-MISC metadata.xml 231 RMD160 6aebfea93d789d2b96ea6d8259dc842dd1fdacd3 SHA1 e10a04c4c18a66af326abc1f40c61b28cc610fae SHA256 48054ea190d00518c1e035fc6663b2368854cdea5ff69a94830e4f9a38260987
+EBUILD autoupnp-0.4.3-r1.ebuild 1662 RMD160 0c083cb6fb347e8dcdcc078df2dd5daf4f1068bf SHA1 9911c88b7777d581a163499a86a23c6c98e63476 SHA256 a1e098d9c8b22517830fc389f4f9525f3f4a4c7bffadd4e2b9fe947beb7007c3
+MISC ChangeLog 1218 RMD160 4c73ba0b17d3cd18c19694166872a2325141e71b SHA1 c93d10210ff36e7591cf773cfa58ec9588b4805f SHA256 986e8b135f696a3d1105c8b115685f40f0f243baa5b1083dd48fd3860ab8044d
+MISC metadata.xml 377 RMD160 7635edaed612fe9ecc5b01fe986d5d60b27c055d SHA1 bd0de857fd4e40fbc5937f6118a9a5558d487997 SHA256 9338d81428ef9dc8fa32fe5f0f3da699513c74abc17a82bf9030157a1c01c7bc
similarity index 58%
rename from net-misc/autoupnp/autoupnp-0.4.3.ebuild
rename to net-misc/autoupnp/autoupnp-0.4.3-r1.ebuild
index 3f238854d9d2b329e8a869d3a7e1d78f3d40dd41..671fea0665a76bc7e56f423ff0cfd0273981d29c 100644 (file)
@@ -11,7 +11,7 @@ SRC_URI="http://github.com/downloads/mgorny/${PN}/${P}.tar.bz2"
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="libnotify"
+IUSE="libnotify suid"
 
 RDEPEND="net-misc/miniupnpc
        libnotify? ( x11-libs/libnotify )"
@@ -21,12 +21,24 @@ src_compile() {
        tc-export CC
        emake WANT_LIBNOTIFY=$(use libnotify && echo true || echo false) || die
 
+       # In order to run setuid, we need not to provide the full path.
+       # Otherwise, we shall do that to avoid ld.so complaining.
+       local libpath
+       if use suid; then
+               libpath=${PN}.so
+       else
+               libpath=/usr/$(get_libdir)/${PN}.so
+       fi
+
        # Generate the clean wrapper script.
-       sh ./autoupnp cleanup /usr/$(get_libdir)/${PN}.so "${T}"/${PN} || die
+       sh ./autoupnp cleanup ${libpath} "${T}"/${PN} || die
 }
 
 src_install() {
        dolib ${PN}.so || die
+       if use suid; then
+               fperms ug+s /usr/$(get_libdir)/${PN}.so || die
+       fi
        dobin "${T}"/${PN} || die
 
        dodoc NEWS README || die
@@ -37,4 +49,12 @@ pkg_postinst() {
        elog "library, and thus it has to be enabled for a particular program to have"
        elog "its ports redirected. To enable it for the current user, call:"
        elog "  $ autoupnp install"
+       if use suid; then
+               elog
+               ewarn "You have chosen to install ${PN}.so setuid & setgid. Please notice that this"
+               ewarn "is discouraged in the terms of security. You have been warned."
+
+               # need to work-around Portage behavior to make ld.so happy (bug #334473)
+               chmod o+r "${ROOT}"usr/$(get_libdir)/${PN}.so || die
+       fi
 }
index c6be5804609dd2d772c4e68523b5b1016dae322b..a1ead91cc8305cf9759ed6e18bba8d358c6ce90f 100644 (file)
@@ -3,4 +3,8 @@
 <pkgmetadata>
        <herd>no-herd</herd>
        <maintainer><email>maintainer-wanted@gentoo.org</email></maintainer>
+       <use>
+               <flag name="suid">Install the library setuid &amp; setgid
+                       (required in order to run setuid &amp; setgid applications).</flag>
+       </use>
 </pkgmetadata>