svc-rbac revision 8d0bff0b85e6c35d0d862cff1607cded58bf2341
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# CDDL HEADER START
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# The contents of this file are subject to the terms of the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# Common Development and Distribution License (the "License").
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# You may not use this file except in compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# See the License for the specific language governing permissions
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# When distributing Covered Code, include this CDDL HEADER in each
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# If applicable, add the following below this CDDL HEADER, with the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# fields enclosed by brackets "[]" replaced with your own identifying
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# information: Portions Copyright [yyyy] [name of copyright owner]
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# CDDL HEADER END
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterfiles='/etc/user_attr /etc/security/auth_attr /etc/security/exec_attr
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster echo "${irbac}: not found."
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster echo "Usage: $0 { start | refresh | stop }"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster echo "Could not create temporary directory."
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster if [ ! -d ${d} ]
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # No directory, nothing to do
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # cache user/owner of file to update
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ownergroup=`ls -ln $f | awk '{printf("%s:%s\n", $3, $4);'}`
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # List all the files in the directory and the destination file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # in the order of their timestamp. Older files are displayed
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # first. If a fragment file is listed before the destination
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # file, it is an older fragment that has already been processed.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # If a fragment file is listed after the destination file, it is
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # new, and the destination file must be updated.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # Comments are processed separately from the other file contents.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # For new fragments only, the comments are processed as they are
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # encountered. For all fragments, the non-comment contents are
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # saved in a temporary file. After all fragments have been
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # processed, and only if new fragments were found, the contents
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # of the temporary file are processed. This ensures that older
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster # but still valid entries are retained in the destination file.