#!/bin/sh # * # * setlabel # * # * Copyright (C) 2005 IBM Corporation # * # * Authors: # * Stefan Berger # * # * This program is free software; you can redistribute it and/or # * modify it under the terms of the GNU General Public License as # * published by the Free Software Foundation, version 2 of the # * License. # * # * 'setlabel' labels virtual machine (domain) configuration files with # * security identifiers that can be enforced in Xen. # * # * 'setlabel -?' shows the usage of the program # * # * 'setlabel -l vmconfig-file' lists all available labels (only VM # * labels are used right now) # * # * 'setlabel vmconfig-file security-label map-file' inserts the 'ssidref' # * that corresponds to the security-label under the # * current policy (if policy changes, 'label' # * must be re-run over the configuration files; # * map-file is created during policy translation and # * is found in the policy's directory # if [ -z "$runbash" ]; then runbash="1" export runbash exec sh -c "bash $0 $*" fi export PATH=$PATH:. source labelfuncs.sh usage () { echo "Use this tool to put the ssidref corresponding to a label of a policy into the VM configuration file, or use it to display all labels of a policy. Usage: $0 [Option]