Commit | Line | Data |
---|---|---|
05c50567 KM |
1 | .\" Copyright (c) 1993 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" This code is derived from software contributed to Berkeley by | |
5 | .\" Berkeley Software Design, Inc. | |
6 | .\" | |
7 | .\" %sccs.include.redist.man% | |
8 | .\" | |
9 | .\" @(#)revoke.2 6.1 (Berkeley) %G% | |
10 | .\" | |
11 | .Dd | |
12 | .Dt REVOKE 2 | |
13 | .Os | |
14 | .Sh NAME | |
15 | .Nm revoke | |
16 | .Nd revoke file access | |
17 | .Sh SYNOPSIS | |
18 | .Ft int | |
19 | .Fn revoke "char *path" | |
20 | .Sh DESCRIPTION | |
21 | The | |
22 | .Nm revoke | |
23 | function invalidates all current open file descriptors in the system | |
24 | for the file named by | |
25 | .Fa path . | |
26 | Subsequent operations on any such descriptors | |
27 | fail, with the exceptions that a | |
28 | .Fn read | |
29 | from a character device file which has been revoked | |
30 | returns a count of zero (end of file), | |
31 | and a | |
32 | .Fn close | |
33 | call will succeed. | |
34 | If the file is a special file for a device which is open, | |
35 | the device close function | |
36 | is called as if all open references to the file had been closed. | |
37 | .Pp | |
38 | Access to a file may be revoked only by its owner or the super user. | |
39 | The | |
40 | .Nm revoke | |
41 | function is currently supported only for block and character special | |
42 | device files. | |
43 | It is normally used to prepare a terminal device for a new login session, | |
44 | preventing any access by a previous user of the terminal. | |
45 | .Sh RETURN VALUES | |
46 | A 0 value indicated that the call succeeded. A \-1 return value | |
47 | indicates an error occurred and | |
48 | .Va errno | |
49 | is set to indicated the reason. | |
50 | .Sh ERRORS | |
51 | Access to the named file is revoked unless one of the following: | |
52 | .Bl -tag -width Er | |
53 | .It Bq Er ENOTDIR | |
54 | A component of the path prefix is not a directory. | |
55 | .It Bq Er ENAMETOOLONG | |
56 | A component of a pathname exceeded 255 characters, | |
57 | or an entire path name exceeded 1024 characters. | |
58 | .It Bq Er ENOENT | |
59 | The named file or a component of the path name does not exist. | |
60 | .It Bq Er EACCES | |
61 | Search permission is denied for a component of the path prefix. | |
62 | .It Bq Er ELOOP | |
63 | Too many symbolic links were encountered in translating the pathname. | |
64 | .It Bq Er EFAULT | |
65 | .Fa Path | |
66 | points outside the process's allocated address space. | |
67 | .It Bq Er EINVAL | |
68 | The named file is neither a character special or block | |
69 | special file. | |
70 | .It Bq Er EPERM | |
71 | The caller is neither the owner of the file nor the super user. | |
72 | .El | |
73 | .Sh SEE ALSO | |
74 | .Xr close 2 | |
75 | .Sh HISTORY | |
76 | The | |
77 | .Nm revoke | |
78 | function was introduced in | |
79 | .Bx 4.3 Reno . |