summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorMike Pritchard <mpp@FreeBSD.org>1999-07-30 10:08:21 +0000
committerMike Pritchard <mpp@FreeBSD.org>1999-07-30 10:08:21 +0000
commit07677e5025b5268de9deb822911f90d9faefe664 (patch)
tree4a93e7d1eb54d08f1a2ae41885308c9ef152050e /lib/libc
parent38cf40702df38f9a999e5972caf5bd5374a5887a (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/Makefile.inc4
-rw-r--r--lib/libc/sys/chmod.242
2 files changed, 29 insertions, 17 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 11f80e00157c..342fbed5deac 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -1,5 +1,5 @@
# @(#)Makefile.inc 8.3 (Berkeley) 10/24/94
-# $Id: Makefile.inc,v 1.62 1999/04/28 11:38:32 phk Exp $
+# $Id: Makefile.inc,v 1.63 1999/07/30 09:01:45 mpp Exp $
# sys sources
.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys ${.CURDIR}/../libc/sys
@@ -106,7 +106,7 @@ MLINKS+=brk.2 sbrk.2
MLINKS+=dup.2 dup2.2
MLINKS+=chdir.2 fchdir.2
MLINKS+=chflags.2 fchflags.2
-MLINKS+=chmod.2 fchmod.2
+MLINKS+=chmod.2 fchmod.2 chmod.2 lchmod.2
MLINKS+=chown.2 fchown.2 chown.2 lchown.2
MLINKS+=clock_gettime.2 clock_getres.2 clock_gettime.2 clock_settime.2
MLINKS+=getgid.2 getegid.2
diff --git a/lib/libc/sys/chmod.2 b/lib/libc/sys/chmod.2
index 9670629d1bd5..94f4ebd8bf3b 100644
--- a/lib/libc/sys/chmod.2
+++ b/lib/libc/sys/chmod.2
@@ -30,14 +30,15 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)chmod.2 8.1 (Berkeley) 6/4/93
-.\" $Id: chmod.2,v 1.11 1997/11/13 00:28:48 julian Exp $
+.\" $Id: chmod.2,v 1.12 1998/01/11 17:49:51 alex Exp $
.\"
.Dd June 4, 1993
.Dt CHMOD 2
.Os BSD 4
.Sh NAME
.Nm chmod ,
-.Nm fchmod
+.Nm fchmod ,
+.Nm lchmod
.Nd change mode of file
.Sh SYNOPSIS
.Fd #include <sys/stat.h>
@@ -45,27 +46,34 @@
.Fn chmod "const char *path" "mode_t mode"
.Ft int
.Fn fchmod "int fd" "mode_t mode"
+.Ft int
+.Fn lchmod "const char *path" "mode_t mode"
.Sh DESCRIPTION
-The function
-.Fn chmod
-sets the file permission bits
-of the file
-specified by the pathname
+The file permission bits of the file named specified by
.Fa path
-to
+or referenced by the file descriptor
+.Fa fd
+are changed to
.Fa mode .
-.Fn Fchmod
-sets the permission bits of the specified
-file descriptor
-.Fa fd .
-.Fn Chmod
-verifies that the process owner (user) either owns
+The
+.Fn chmod
+function verifies that the process owner (user) either owns
the file specified by
.Fa path
(or
.Fa fd ) ,
or
is the super-user.
+.The chmod
+function follows symbolic links to operate on the target of the link
+rather than the link itself.
+.Pp
+The
+.Fa lchmod
+function is similar to
+.Fn chmod
+but does not follow symbolic links.
+.Pp
A mode is created from
.Em or'd
permission bit masks
@@ -120,7 +128,7 @@ created within this directory are set
to be the same as the owner of that directory.
If this function is enabled, new directories will inherit
the bit from their parents. Execute bits are removed from
-the file, and it will not be given to root. This behaviour does not change the
+the file, and it will not be given to root. This behavior does not change the
requirements for the user to be allowed to write the file, but only the eventual
owner after it has been created. Group inheritance is not effected.
.Pp
@@ -208,3 +216,7 @@ The
function call
appeared in
.Bx 4.2 .
+The
+.Fn lchmod
+function call appeared in
+.Fx 3.0 .