xref: /titanic_51/usr/src/tools/pmodes/README.pmodes (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate#
2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate#
4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate# with the License.
8*7c478bd9Sstevel@tonic-gate#
9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate# and limitations under the License.
13*7c478bd9Sstevel@tonic-gate#
14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate#
20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate#
22*7c478bd9Sstevel@tonic-gate/*
23*7c478bd9Sstevel@tonic-gate * Copyright (c) 1999-2001 by Sun Microsystems, Inc.
24*7c478bd9Sstevel@tonic-gate * All rights reserved.
25*7c478bd9Sstevel@tonic-gate */
26*7c478bd9Sstevel@tonic-gate
27*7c478bd9Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"
28*7c478bd9Sstevel@tonic-gate
29*7c478bd9Sstevel@tonic-gatePmodes is a program that updates pkgmap files or pkg prototype files.
30*7c478bd9Sstevel@tonic-gate
31*7c478bd9Sstevel@tonic-gate
32*7c478bd9Sstevel@tonic-gateUsage: pmodes [-somwDeNndvqP] [-r file] directory  .. proto/pkgmap file....
33*7c478bd9Sstevel@tonic-gate
34*7c478bd9Sstevel@tonic-gate
35*7c478bd9Sstevel@tonic-gate
36*7c478bd9Sstevel@tonic-gateOptions that modify what is changed:
37*7c478bd9Sstevel@tonic-gate
38*7c478bd9Sstevel@tonic-gate	-s 	Strip read and write permissions from setgid/setuid executables.
39*7c478bd9Sstevel@tonic-gate	-o	Do not change ownership to root
40*7c478bd9Sstevel@tonic-gate	-m	Do not change file permissions (modes)
41*7c478bd9Sstevel@tonic-gate	-w 	Do not strip owner write permissions from non-root owned
42*7c478bd9Sstevel@tonic-gate		binaries
43*7c478bd9Sstevel@tonic-gate	-e	Do not change 'e' or 'v' (editable or volatile) files
44*7c478bd9Sstevel@tonic-gate		(they are only affected when owned by bin)
45*7c478bd9Sstevel@tonic-gate	-D	Limit changes to directories only.
46*7c478bd9Sstevel@tonic-gate
47*7c478bd9Sstevel@tonic-gateOptions that modify the output:
48*7c478bd9Sstevel@tonic-gate	-n	Create a <file>.new file
49*7c478bd9Sstevel@tonic-gate	-N	Overwrite the original pkgmap/proto file with the new file;
50*7c478bd9Sstevel@tonic-gate		old pkgmap/proto file saved as file.old
51*7c478bd9Sstevel@tonic-gate	-d	Produce "diff-style" output
52*7c478bd9Sstevel@tonic-gate	-P	Ignore pkgmap files in directories.
53*7c478bd9Sstevel@tonic-gate	-q	Do not produce error messages about directories w/ pkginfo*
54*7c478bd9Sstevel@tonic-gate		files
55*7c478bd9Sstevel@tonic-gate	-v	Preceed the output caused by each processed file by a
56*7c478bd9Sstevel@tonic-gate		shortened version of the filename.
57*7c478bd9Sstevel@tonic-gate
58*7c478bd9Sstevel@tonic-gate	-r file	Restrict the test to the pathnames listed in "file"
59*7c478bd9Sstevel@tonic-gate
60*7c478bd9Sstevel@tonic-gate
61*7c478bd9Sstevel@tonic-gateIn default mode of operation, pmodes processes each argument.
62*7c478bd9Sstevel@tonic-gateIf an argument is a directory, it will first look for a pkginfo or
63*7c478bd9Sstevel@tonic-gatepkginfo.tmpl file n order to learn the BASEDIR; it will than process
64*7c478bd9Sstevel@tonic-gatethe directory converting either the pkgmap file or, if the pkgmap file
65*7c478bd9Sstevel@tonic-gatedoesn't exist or the -P option is specified, the prototype_* files
66*7c478bd9Sstevel@tonic-gateNames that contain .old or .new will be ignored.  If an argument is a file,
67*7c478bd9Sstevel@tonic-gatethe pkginfo* file in the same directory is used to learn the BASEDIR.
68*7c478bd9Sstevel@tonic-gate
69*7c478bd9Sstevel@tonic-gatePmodes outputs a line for each change made:
70*7c478bd9Sstevel@tonic-gate
71*7c478bd9Sstevel@tonic-gatee m 0664 -> 0644 /var/adm/wtmpx
72*7c478bd9Sstevel@tonic-gated m 0775 -> 0755 /usr/lib
73*7c478bd9Sstevel@tonic-gated o bin -> root /usr/include/sys [755]
74*7c478bd9Sstevel@tonic-gatef o bin -> root /usr/include/sys/cg6reg.h [0644]
75*7c478bd9Sstevel@tonic-gatef o bin -> root /usr/include/sys/cg6var.h [0644]
76*7c478bd9Sstevel@tonic-gate
77*7c478bd9Sstevel@tonic-gateThe first field is the "pkgmap" file type; the second field is the type
78*7c478bd9Sstevel@tonic-gateof modification (m for mode, o for ownership).  This is followed by the
79*7c478bd9Sstevel@tonic-gatechange mode and the pathname.
80*7c478bd9Sstevel@tonic-gate
81*7c478bd9Sstevel@tonic-gateWhen ownership is changed, the file permissions are printed in square
82*7c478bd9Sstevel@tonic-gatebrackets.
83*7c478bd9Sstevel@tonic-gate
84*7c478bd9Sstevel@tonic-gateMultiple lines of output can be produced for a single file.
85*7c478bd9Sstevel@tonic-gate
86*7c478bd9Sstevel@tonic-gateWith the -d option, output looks like:
87*7c478bd9Sstevel@tonic-gate
88*7c478bd9Sstevel@tonic-gate< d 0775 root sys /usr
89*7c478bd9Sstevel@tonic-gate> d 0755 root sys /usr
90*7c478bd9Sstevel@tonic-gate< d 0775 root bin /usr/include
91*7c478bd9Sstevel@tonic-gate> d 0755 root bin /usr/include
92*7c478bd9Sstevel@tonic-gate< d 1777 bin bin /var/preserve
93*7c478bd9Sstevel@tonic-gate> d 1777 root bin /var/preserve
94*7c478bd9Sstevel@tonic-gate< e 0664 root sys /etc/vfstab
95*7c478bd9Sstevel@tonic-gate> e 0644 root sys /etc/vfstab
96*7c478bd9Sstevel@tonic-gate
97*7c478bd9Sstevel@tonic-gateAnd only one line per file is produced.
98*7c478bd9Sstevel@tonic-gate
99