Annotation of src/usr.bin/chflags/chflags.1, Revision 1.9
1.9 ! aaron 1: .\" $OpenBSD: chflags.1,v 1.8 1999/12/09 00:39:50 aaron Exp $
1.1 deraadt 2: .\" $NetBSD: chflags.1,v 1.4 1995/08/31 22:50:22 jtc Exp $
3: .\"
4: .\" Copyright (c) 1989, 1990, 1993, 1994
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" This code is derived from software contributed to Berkeley by
8: .\" the Institute of Electrical and Electronics Engineers, Inc.
9: .\"
10: .\" Redistribution and use in source and binary forms, with or without
11: .\" modification, are permitted provided that the following conditions
12: .\" are met:
13: .\" 1. Redistributions of source code must retain the above copyright
14: .\" notice, this list of conditions and the following disclaimer.
15: .\" 2. Redistributions in binary form must reproduce the above copyright
16: .\" notice, this list of conditions and the following disclaimer in the
17: .\" documentation and/or other materials provided with the distribution.
18: .\" 3. All advertising materials mentioning features or use of this software
19: .\" must display the following acknowledgement:
20: .\" This product includes software developed by the University of
21: .\" California, Berkeley and its contributors.
22: .\" 4. Neither the name of the University nor the names of its contributors
23: .\" may be used to endorse or promote products derived from this software
24: .\" without specific prior written permission.
25: .\"
26: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36: .\" SUCH DAMAGE.
37: .\"
38: .\" @(#)chflags.1 8.4 (Berkeley) 5/2/95
39: .\"
40: .Dd May 2, 1995
41: .Dt CHFLAGS 1
42: .Os
43: .Sh NAME
44: .Nm chflags
45: .Nd change file flags
46: .Sh SYNOPSIS
47: .Nm chflags
48: .Oo
49: .Fl R
50: .Op Fl H | Fl L | Fl P
51: .Oc
52: .Ar flags
1.4 aaron 53: .Ar file Op Ar ...
1.1 deraadt 54: .Sh DESCRIPTION
55: The
1.5 aaron 56: .Nm
1.1 deraadt 57: utility modifies the file flags of the listed files
58: as specified by the
59: .Ar flags
60: operand.
1.7 aaron 61: The
62: .Ar flags
63: of a file dictate special restrictions beyond those enforced by its
64: mode/permissions.
1.1 deraadt 65: .Pp
66: The options are as follows:
67: .Bl -tag -width Ds
1.7 aaron 68: .It Fl R
69: Recursively descend through any specified directory arguments.
70: Change the flags of the file hierarchies rooted
71: in the files instead of just the files themselves.
1.1 deraadt 72: .It Fl H
73: If the
74: .Fl R
1.7 aaron 75: option is also specified, symbolic links on the command line are followed.
1.1 deraadt 76: (Symbolic links encountered in the tree traversal are not followed.)
77: .It Fl L
78: If the
79: .Fl R
1.7 aaron 80: option is also specified, all symbolic links are followed.
1.1 deraadt 81: .It Fl P
82: If the
83: .Fl R
1.7 aaron 84: option is also specified, no symbolic links are followed.
1.1 deraadt 85: .El
86: .Pp
87: Flags are a comma separated list of keywords.
88: The following keywords are currently defined:
89: .Bd -literal -offset indent compact
90: arch set the archived flag
91: opaque set the opaque flag (owner or super-user only)
92: nodump set the nodump flag (owner or super-user only)
93: sappnd set the system append-only flag (super-user only)
94: schg set the system immutable flag (super-user only)
95: uappnd set the user append-only flag (owner or super-user only)
96: uchg set the user immutable flag (owner or super-user only)
97: .Ed
98: .Pp
1.9 ! aaron 99: An immutable file may not be changed, moved, or deleted.
! 100: An append-only file is immutable except that data may be appended to it.
! 101: .Pp
1.1 deraadt 102: Putting the letters
103: .Dq no
1.9 ! aaron 104: before a flag name causes the flag to be turned off.
1.1 deraadt 105: For example:
106: .Bd -literal -offset indent compact
107: nouchg the immutable bit should be cleared
108: .Ed
1.8 aaron 109: .Pp
110: The
1.9 ! aaron 111: superuser-settable
1.8 aaron 112: .Dq sappnd
113: and
114: .Dq schg
1.9 ! aaron 115: flags can be set at any time, but may only be cleared when the system is
! 116: running at security level 0 or -1 (insecure or permanently insecure mode,
! 117: respectively).
! 118: The securelevel is normally set to 0, for example, when
! 119: running in single-user mode.
1.1 deraadt 120: .Pp
121: Symbolic links do not have flags, so unless the
122: .Fl H
123: or
124: .Fl L
125: option is set,
1.5 aaron 126: .Nm
1.1 deraadt 127: on a symbolic link always succeeds and has no effect.
128: The
129: .Fl H ,
130: .Fl L
131: and
132: .Fl P
133: options are ignored unless the
134: .Fl R
135: option is specified.
136: In addition, these options override each other and the
137: command's actions are determined by the last one specified.
1.6 deraadt 138: .Pp
139: Only the super-user can change the user flags on block and
140: character devices.
1.1 deraadt 141: .Pp
1.3 deraadt 142: You can use "ls -lo" to see the flags of existing files.
143: .Pp
1.1 deraadt 144: The
1.5 aaron 145: .Nm
1.4 aaron 146: utility exits 0 on success or >0 if an error occurred.
1.1 deraadt 147: .Sh SEE ALSO
1.3 deraadt 148: .Xr ls 1 ,
1.1 deraadt 149: .Xr chflags 2 ,
150: .Xr stat 2 ,
151: .Xr fts 3 ,
152: .Xr symlink 7