summaryrefslogtreecommitdiff
blob: 635a61d44d6fc6ad10f45849029e5c5b7759089d (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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/trustees/files/trustees.rc6,v 1.2 2004/07/15 01:00:55 agriffis Exp $

depend() {
	need checkfs
	before net
}

checkrules() {
	if [ ! -d /proc/trustee ] ; then
		eerror "Kernel does not have support for Trustee ACLs."
		return 1
	fi

	if [ -d "${TRUSTEE_FILES}" ] ; then
		TRUSTEE_FILES="${TRUSTEE_FILES}/*"
	fi

	for i in ${TRUSTEE_FILES} ; do
		if [ ! -f "${i}" ] ; then
			eerror "${i}: no such file."
			return 1
		fi
	done

	if [ -z "${i}" ] ; then
		eerror "No files specified in /etc/conf.d/trustees."
		return 1
	fi
}

start() {
	checkrules || return 1	
	ebegin "Purging trustee permissions from kernel memory"
	/usr/sbin/settrustee -D &>/dev/null
	eend $?

	einfo "Loading trustee permissions from:"
	for i in ${TRUSTEE_FILES} ; do
		ebegin "    ${i}"
		/usr/sbin/settrustee -f "${i}" &>/dev/null
		eend $?
	done
}

stop() {
	ebegin "Purging trustee permissions from kernel memory"
	/usr/sbin/settrustee -D &>/dev/null
	eend $?
}