Browse Source

Use Dq/Sq and friends.

OPENBSD_2_7
aaron 25 years ago
parent
commit
a74b2e14eb
1 changed files with 29 additions and 16 deletions
  1. +29
    -16
      src/lib/libc/string/strmode.3

+ 29
- 16
src/lib/libc/string/strmode.3 View File

@ -1,4 +1,4 @@
.\" $OpenBSD: strmode.3,v 1.6 1998/06/15 17:55:13 mickey Exp $
.\" $OpenBSD: strmode.3,v 1.7 2000/02/29 03:45:12 aaron Exp $
.\" .\"
.\" Copyright (c) 1990, 1991, 1993 .\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -53,8 +53,7 @@ converts a file
.Xr stat 2 ) .Xr stat 2 )
into a symbolic string which is stored in the location referenced by into a symbolic string which is stored in the location referenced by
.Fa bp . .Fa bp .
This stored string is eleven characters in length plus a trailing
.Dv NUL .
This stored string is eleven characters in length plus a trailing null byte.
.Pp .Pp
The first character is the inode type, and will be one of the following: The first character is the inode type, and will be one of the following:
.Pp .Pp
@ -83,46 +82,58 @@ The next nine characters encode three sets of permissions, in three
characters each. characters each.
The first three characters are the permissions for the owner of the The first three characters are the permissions for the owner of the
file, the second three for the group the file belongs to, and the file, the second three for the group the file belongs to, and the
third for the ``other'', or default, set of users.
third for the
.Dq other ,
or default, set of users.
.Pp .Pp
Permission checking is done as specifically as possible. Permission checking is done as specifically as possible.
If read permission is denied to the owner of a file in the first set If read permission is denied to the owner of a file in the first set
of permissions, the owner of the file will not be able to read the file. of permissions, the owner of the file will not be able to read the file.
This is true even if the owner is in the file's group and the group This is true even if the owner is in the file's group and the group
permissions allow reading or the ``other'' permissions allow reading.
permissions allow reading or the
.Dq other
permissions allow reading.
.Pp .Pp
If the first character of the three character set is an ``r'', the file is
readable for that set of users; if a dash ``\-'', it is not readable.
If the first character of the three character set is an
.Sq r ,
the file is readable for that set of users; if a dash
.Pq Ql - ,
it is not readable.
.Pp .Pp
If the second character of the three character set is a ``w'', the file is
writable for that set of users; if a dash ``\-'', it is not writable.
If the second character of the three character set is a
.Sq w ,
the file is writable for that set of users; if a dash
.Pq Ql - ,
it is not writable.
.Pp .Pp
The third character is the first of the following characters that apply: The third character is the first of the following characters that apply:
.Bl -tag -width xxxx .Bl -tag -width xxxx
.It S .It S
If the character is part of the owner permissions and the file is not If the character is part of the owner permissions and the file is not
executable or the directory is not searchable by the owner, and the executable or the directory is not searchable by the owner, and the
set-user-id bit is set.
set-user-ID bit is set.
.It S .It S
If the character is part of the group permissions and the file is not If the character is part of the group permissions and the file is not
executable or the directory is not searchable by the group, and the executable or the directory is not searchable by the group, and the
set-group-id bit is set.
set-group-ID bit is set.
.It T .It T
If the character is part of the other permissions and the file is not If the character is part of the other permissions and the file is not
executable or the directory is not searchable by others, and the ``sticky''
executable or the directory is not searchable by others, and the
.Dq sticky
.Pq Dv S_ISVTX .Pq Dv S_ISVTX
bit is set. bit is set.
.It s .It s
If the character is part of the owner permissions and the file is If the character is part of the owner permissions and the file is
executable or the directory searchable by the owner, and the set-user-id
executable or the directory searchable by the owner, and the set-user-ID
bit is set. bit is set.
.It s .It s
If the character is part of the group permissions and the file is If the character is part of the group permissions and the file is
executable or the directory searchable by the group, and the set-group-id
executable or the directory searchable by the group, and the set-group-ID
bit is set. bit is set.
.It t .It t
If the character is part of the other permissions and the file is If the character is part of the other permissions and the file is
executable or the directory searchable by others, and the ``sticky''
executable or the directory searchable by others, and the
.Dq sticky
.Pq Dv S_ISVTX .Pq Dv S_ISVTX
bit is set. bit is set.
.It x .It x
@ -131,7 +142,9 @@ The file is executable or the directory is searchable.
None of the above apply. None of the above apply.
.El .El
.Pp .Pp
The last character is a plus sign ``+'' if there are any alternate
The last character is a plus sign
.Pq Ql +
if there are any alternate
or additional access control methods associated with the inode, otherwise or additional access control methods associated with the inode, otherwise
it will be a space. it will be a space.
.Sh RETURN VALUES .Sh RETURN VALUES


Loading…
Cancel
Save