chmod.2 (8269e7673cf033aba67dab8264fe719920c70f87) chmod.2 (bfd03046d18776ea70785ca1ef36dfc60822de3b)
1.\" Copyright (c) 1980, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 11 unchanged lines hidden (view full) ---

20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
1.\" Copyright (c) 1980, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 11 unchanged lines hidden (view full) ---

20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.Dd March 30, 2021
28.Dd October 31, 2024
29.Dt CHMOD 2
30.Os
31.Sh NAME
32.Nm chmod ,
33.Nm fchmod ,
34.Nm lchmod ,
35.Nm fchmodat
36.Nd change mode of file

--- 172 unchanged lines hidden (view full) ---

209.Pp
210Writing or changing the owner of a file
211turns off the set-user-id and set-group-id bits
212unless the user is the super-user.
213This makes the system somewhat more secure
214by protecting set-user-id (set-group-id) files
215from remaining set-user-id (set-group-id) if they are modified,
216at the expense of a degree of compatibility.
29.Dt CHMOD 2
30.Os
31.Sh NAME
32.Nm chmod ,
33.Nm fchmod ,
34.Nm lchmod ,
35.Nm fchmodat
36.Nd change mode of file

--- 172 unchanged lines hidden (view full) ---

209.Pp
210Writing or changing the owner of a file
211turns off the set-user-id and set-group-id bits
212unless the user is the super-user.
213This makes the system somewhat more secure
214by protecting set-user-id (set-group-id) files
215from remaining set-user-id (set-group-id) if they are modified,
216at the expense of a degree of compatibility.
217.Pp
218While it is normally an error to invoke
219.Fn fchmod
220on a socket, it is possible to do so on
221.Dv AF_LOCAL
222sockets before they are bound to a file name; see
223.Xr unix 4 .
217.Sh RETURN VALUES
218.Rv -std
219.Sh ERRORS
220The
221.Fn chmod
222system call
223will fail and the file mode will be unchanged if:
224.Bl -tag -width Er

--- 133 unchanged lines hidden ---
224.Sh RETURN VALUES
225.Rv -std
226.Sh ERRORS
227The
228.Fn chmod
229system call
230will fail and the file mode will be unchanged if:
231.Bl -tag -width Er

--- 133 unchanged lines hidden ---