svc-rbac revision 2
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen# CDDL HEADER START
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen# The contents of this file are subject to the terms of the
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen# Common Development and Distribution License (the "License").
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen# You may not use this file except in compliance with the License.
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen# See the License for the specific language governing permissions
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen# and limitations under the License.
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen# If applicable, add the following below this CDDL HEADER, with the
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen# CDDL HEADER END
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainenfiles='/etc/user_attr /etc/security/auth_attr /etc/security/exec_attr
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainenif [[ ! -x $irbac ]]; then
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen echo "${irbac}: not found."
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainenif [[ -z "$phrase" ]]; then
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen echo "${irbac}: can't determine \$phrase."
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen # The current library reads the fragments directly for all databases;
83b2368e64ca53712d80abcae9579bd22ef43c9eTimo Sirainen # in order to make upgrades possible, we need to run i.rbac only once
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen # to remove the older entries.
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen if ! grep -s "$phrase" $f > /dev/null 2>&1; then
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen # When we find one updated file, then the rest is also
aef538e8e43f1aaf3d44c18de5c74afa08b960f8Timo Sirainen # updated and we bail out.