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
|
#! /bin/sh
if [ "$1" = "--version" ]
then
cat << EOF
ccs-setprofile 1.7.2
Copyright (C) 2005-2010 NTT DATA CORPORATION.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
EOF
elif [ "$1" = "--help" ]
then
cat << EOF
Usage: ccs-setprofile [-r] profile_index domainname [domainname ...]
This program assigns TOMOYO Linux's profile to domains.
-r Apply specified profile to all domains whose domainname starts with domainname given at command line.
profile_index Profile index to assign. Profile index is an integer between 0 and 255.
You can see list of profiles currently assigned via /proc/ccs/.domain_status .
Examples:
# ccs-setprofile -r 0 '<kernel>'
Assign profile 0 to all domains.
# ccs-setprofile 1 '<kernel> /usr/sbin/sshd' '<kernel> /usr/sbin/httpd'
Assign profile 1 to sshd and httpd domains.
EOF
else
cat << EOF | help2man -i - -N -s 8 -n "Assign TOMOYO Linux's profile to domains" $0 | gzip -9 > man8/ccs-setprofile.8.gz
[SEE ALSO]
ccs-ccstree (8)
[NOTES]
You need to register either path to this program ( /usr/sbin/ccs-setprofile ) or a domain for this program in /proc/ccs/manager before invoking this program.
Be sure to quote or escape appropriately when specifying domainnames.
[AUTHORS]
penguin-kernel _at_ I-love.SAKURA.ne.jp
EOF
fi
exit 0
|