summaryrefslogtreecommitdiff
blob: 5f984dea1187107ae5e26b31da8462eacb68c046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/sus/sus-2.0.2-r1.ebuild,v 1.2 2005/01/01 11:28:21 eradicator Exp $

inherit gcc

DESCRIPTION="allows certain users to run commands as root or other users"
HOMEPAGE="http://pdg.uow.edu.au/sus/"
SRC_URI="http://pdg.uow.edu.au/sus/${P}.tar.Z"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 sparc mips"
IUSE="pam"

DEPEND="virtual/libc
	pam? ( >=sys-libs/pam-0.73-r1 )"

src_unpack() {
	unpack ${A}
	cd ${S}

	# Fixes a local root vulnerability (Bug #63927)
	epatch ${FILESDIR}/${P}-syslog-vuln-fix.patch
}

src_compile() {
	local myconf
	local lflags
	myconf="-DDEBUG"
	use pam && myconf="${myconf} -DUSE_PAM" && lflags="-lpam"
	myconf="${myconf} -DPROMISCUOUS -DUSE_SHADOW \
		-DSUSERS=\\\"/etc/susers.cpp\\\""
	make \
		CC=$(gcc-getCC) \
		CFLAGS="${CFLAGS} ${myconf}" \
		LFLAGS="${lflags}" \
		sus || die
}

src_install() {
	dobin sus || die
	newman man/sus.1 sus.8
	dodoc INSTALL README susers.sample
	dodir /var/run/sus
	insinto /etc
	newins ${FILESDIR}/susers.cpp susers.cpp
	fperms 4755 /usr/bin/sus
	fperms 700 /var/run/sus
	insinto /etc
	doins ${FILESDIR}/susers.cpp
}

pkg_postinst() {
	einfo "A default configuration file has been installed as"
	einfo "/etc/susers.cpp.  It is best to read over it and"
	einfo "make any changes as necessary."
}