#!/bin/sh
#
# Backup RSBAC attributes
#
# This script generates a backup of most RSBAC settings on stdout.
#
# Current exceptions: PM data structures, ADF log levels
#
# Please make sure you have READ right in all Directories and
# READ_ATTRIBUTES for all objects,
# e.g. use setuid 0, RC force_role 'Role Admin', etc.,
# or ( switch off all modules | start Maintenance kernel ) and run as root
#

echo "#!/bin/sh"
echo "#"
echo "# RSBAC Backup of all attributes"
echo "#"
echo "# `date`"
echo "#"

# PM
# Sorry, no backup yet. Boot non-RSBAC kernel and copy /rsbac/pm* to backup
# dir. To restore copy back.

# AUTH
auth_back_cap -r - /

# RC
rc_get_item backup

# ACL
acl_tlist -br FD :DEFAULT: /
acl_tlist -br DEV :DEFAULT: /dev
acl_tlist -br IPC :DEFAULT:
acl_tlist -br SCD :DEFAULT: `acl_tlist -n`
acl_tlist -br PROCESS :DEFAULT:
acl_mask -br FD /
acl_mask -br DEV /dev
acl_mask -b SCD `acl_tlist -n`

# General attributes (last because of RC types at restore time - if RC is active)
attr_back_fd -r -m - /
attr_back_dev - /dev/*
attr_back_user -a -
