17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 5*88422796SMark J. Nelson# Common Development and Distribution License (the "License"). 6*88422796SMark J. Nelson# You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate# 87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate# and limitations under the License. 127c478bd9Sstevel@tonic-gate# 137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate# 197c478bd9Sstevel@tonic-gate# CDDL HEADER END 207c478bd9Sstevel@tonic-gate# 217c478bd9Sstevel@tonic-gate 22*88422796SMark J. Nelson# 23*88422796SMark J. Nelson# Copyright 2010 Sun Microsystems, Inc. All rights reserved. 24*88422796SMark J. Nelson# Use is subject to license terms. 25*88422796SMark J. Nelson# 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gatePmodes is a program that updates pkgmap files or pkg prototype files. 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate 30*88422796SMark J. Nelson 31*88422796SMark J. NelsonApplicability: 32*88422796SMark J. Nelson 33*88422796SMark J. NelsonUse of pmodes has been deprecated in onnv-gate; instead, see 34*88422796SMark J. Nelsonvalidate_pkg, as delivered by developer/build/onbld, and 35*88422796SMark J. Nelsonexception_lists/pmodes. 36*88422796SMark J. Nelson 37*88422796SMark J. NelsonOther OSNet users (ie on10 patch gates and earlier) should use pmodes 38*88422796SMark J. Nelsonfrom their own workspace. 39*88422796SMark J. Nelson 40*88422796SMark J. NelsonThe information here is suitable for pmodes users in other 41*88422796SMark J. Nelsonconsolidations, using tools from onnv-tools. 42*88422796SMark J. Nelson 43*88422796SMark J. Nelson 44*88422796SMark J. Nelson 457c478bd9Sstevel@tonic-gateUsage: pmodes [-somwDeNndvqP] [-r file] directory .. proto/pkgmap file.... 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gateOptions that modify what is changed: 507c478bd9Sstevel@tonic-gate 517c478bd9Sstevel@tonic-gate -s Strip read and write permissions from setgid/setuid executables. 527c478bd9Sstevel@tonic-gate -o Do not change ownership to root 537c478bd9Sstevel@tonic-gate -m Do not change file permissions (modes) 547c478bd9Sstevel@tonic-gate -w Do not strip owner write permissions from non-root owned 557c478bd9Sstevel@tonic-gate binaries 567c478bd9Sstevel@tonic-gate -e Do not change 'e' or 'v' (editable or volatile) files 577c478bd9Sstevel@tonic-gate (they are only affected when owned by bin) 587c478bd9Sstevel@tonic-gate -D Limit changes to directories only. 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gateOptions that modify the output: 617c478bd9Sstevel@tonic-gate -n Create a <file>.new file 627c478bd9Sstevel@tonic-gate -N Overwrite the original pkgmap/proto file with the new file; 637c478bd9Sstevel@tonic-gate old pkgmap/proto file saved as file.old 647c478bd9Sstevel@tonic-gate -d Produce "diff-style" output 657c478bd9Sstevel@tonic-gate -P Ignore pkgmap files in directories. 667c478bd9Sstevel@tonic-gate -q Do not produce error messages about directories w/ pkginfo* 677c478bd9Sstevel@tonic-gate files 687c478bd9Sstevel@tonic-gate -v Preceed the output caused by each processed file by a 697c478bd9Sstevel@tonic-gate shortened version of the filename. 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gate -r file Restrict the test to the pathnames listed in "file" 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gateIn default mode of operation, pmodes processes each argument. 757c478bd9Sstevel@tonic-gateIf an argument is a directory, it will first look for a pkginfo or 767c478bd9Sstevel@tonic-gatepkginfo.tmpl file n order to learn the BASEDIR; it will than process 777c478bd9Sstevel@tonic-gatethe directory converting either the pkgmap file or, if the pkgmap file 787c478bd9Sstevel@tonic-gatedoesn't exist or the -P option is specified, the prototype_* files 797c478bd9Sstevel@tonic-gateNames that contain .old or .new will be ignored. If an argument is a file, 807c478bd9Sstevel@tonic-gatethe pkginfo* file in the same directory is used to learn the BASEDIR. 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gatePmodes outputs a line for each change made: 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gatee m 0664 -> 0644 /var/adm/wtmpx 857c478bd9Sstevel@tonic-gated m 0775 -> 0755 /usr/lib 867c478bd9Sstevel@tonic-gated o bin -> root /usr/include/sys [755] 877c478bd9Sstevel@tonic-gatef o bin -> root /usr/include/sys/cg6reg.h [0644] 887c478bd9Sstevel@tonic-gatef o bin -> root /usr/include/sys/cg6var.h [0644] 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gateThe first field is the "pkgmap" file type; the second field is the type 917c478bd9Sstevel@tonic-gateof modification (m for mode, o for ownership). This is followed by the 927c478bd9Sstevel@tonic-gatechange mode and the pathname. 937c478bd9Sstevel@tonic-gate 947c478bd9Sstevel@tonic-gateWhen ownership is changed, the file permissions are printed in square 957c478bd9Sstevel@tonic-gatebrackets. 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gateMultiple lines of output can be produced for a single file. 987c478bd9Sstevel@tonic-gate 997c478bd9Sstevel@tonic-gateWith the -d option, output looks like: 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gate< d 0775 root sys /usr 1027c478bd9Sstevel@tonic-gate> d 0755 root sys /usr 1037c478bd9Sstevel@tonic-gate< d 0775 root bin /usr/include 1047c478bd9Sstevel@tonic-gate> d 0755 root bin /usr/include 1057c478bd9Sstevel@tonic-gate< d 1777 bin bin /var/preserve 1067c478bd9Sstevel@tonic-gate> d 1777 root bin /var/preserve 1077c478bd9Sstevel@tonic-gate< e 0664 root sys /etc/vfstab 1087c478bd9Sstevel@tonic-gate> e 0644 root sys /etc/vfstab 1097c478bd9Sstevel@tonic-gate 1107c478bd9Sstevel@tonic-gateAnd only one line per file is produced. 1117c478bd9Sstevel@tonic-gate 112*88422796SMark J. Nelson 113*88422796SMark J. Nelson 114*88422796SMark J. NelsonExceptions 115*88422796SMark J. Nelson 116*88422796SMark J. NelsonIf pmodes insists on flagging errors that you believe must be 117*88422796SMark J. Nelsonintegrated as-is, you may update the inline initializers for either 118*88422796SMark J. Nelsonexceptions or exempt_pkgs in pmodes.c. If you do this, make sure that 119*88422796SMark J. Nelsonthe bug report and your RTI include a justification for the exception. 120