diff options
Diffstat (limited to 'ja_JP.eucJP/man/man9/VOP_ACCESS.9')
-rw-r--r-- | ja_JP.eucJP/man/man9/VOP_ACCESS.9 | 150 |
1 files changed, 0 insertions, 150 deletions
diff --git a/ja_JP.eucJP/man/man9/VOP_ACCESS.9 b/ja_JP.eucJP/man/man9/VOP_ACCESS.9 deleted file mode 100644 index cfa40cc692..0000000000 --- a/ja_JP.eucJP/man/man9/VOP_ACCESS.9 +++ /dev/null @@ -1,150 +0,0 @@ -.\" -*- nroff -*- -.\" -.\" Copyright (c) 1996 Doug Rabson -.\" -.\" All rights reserved. -.\" -.\" This program is free software. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" %FreeBSD: src/share/man/man9/VOP_ACCESS.9,v 1.7.2.3 2001/07/21 09:16:54 schweikh Exp % -.\" -.\" $FreeBSD: doc/ja_JP.eucJP/man/man9/VOP_ACCESS.9,v 1.4 2001/07/23 02:27:01 horikawa Exp $ -.Dd July 24, 1996 -.Os -.Dt VOP_ACCESS 9 -.Sh 名称 -.Nm VOP_ACCESS -.Nd ファイルまたは UNIX ドメインソケットのアクセス許可の調査 -.Sh 書式 -.Fd #include <sys/param.h> -.Fd #include <sys/vnode.h> -.Ft int -.Fn VOP_ACCESS "struct vnode *vp" "int mode" "struct ucred *cred" "struct proc *p" -.Sh 解説 -このエントリポイントは、与えられた証明に対する、ファイルの -アクセス許可を調査します。 -.Pp -引数は以下の通りです。 -.Bl -tag -width mode -.It Ar vp -調査対象ファイルの vnode。 -.It Ar mode -要求されたアクセスのタイプ。 -.It Ar cred -調査対象のユーザ証明。 -.It Ar p -調査しているプロセス。 -.El -.Pp -.Fa mode -は -.Dv VREAD , -.Dv VWRITE -または -.Dv VEXEC -を含むマスクです。 -.Sh ロック -vnode は、入る時にロックされ、戻る時にもロックされ続けます。 -.Sh 戻り値 -ファイルが指定された方法でアクセス可能な場合には、0 が返されます。 -そうでない場合には、適切なエラーコードが返されます。 -.Sh 疑似コード -.Bd -literal -int -vop_access(struct vnode *vp, int mode, struct ucred *cred, struct proc *p) -{ - int error; - - /* - * ファイルがソケット、FIFO、またはファイルシステムに存在する - * ブロック型または文字型デバイスでない場合には、読み込み専用 - * ファイルシステムへの書き込みは認められません。 - */ - if (mode & VWRITE) { - switch (vp->v_type) { - case VDIR: - case VLNK: - case VREG: - if (vp->v_mount->mnt_flag & MNT_RDONLY) - return EROFS; - - break; - } - } - - /* 不変ビットが設定されていれば、誰も書き込めません。 */ - if ((mode & VWRITE) && vp has immutable bit set) - return EPERM; - - /* そうでなければ、uid が 0 ならば常に許可。 */ - if (cred->cr_uid == 0) - return 0; - - mask = 0; - - /* そうでなければ、所有者を調べます。 */ - if (cred->cr_uid == owner of vp) { - if (mode & VEXEC) - mask |= S_IXUSR; - if (mode & VREAD) - mask |= S_IRUSR; - if (mode & VWRITE) - mask |= S_IWUSR; - return (((mode of vp) & mask) == mask ? 0 : EACCES); - } - - /* そうでなければ、グループを調べます。 */ - for (i = 0, gp = cred->cr_groups; i < cred->cr_ngroups; i++, gp++) - if (group of vp == *gp) { - if (mode & VEXEC) - mask |= S_IXGRP; - if (mode & VREAD) - mask |= S_IRGRP; - if (mode & VWRITE) - mask |= S_IWGRP; - return (((mode of vp) & mask) == mask ? 0 : EACCES); - } - - /* そうでなければ、その他を調べます。 */ - if (mode & VEXEC) - mask |= S_IXOTH; - if (mode & VREAD) - mask |= S_IROTH; - if (mode & VWRITE) - mask |= S_IWOTH; - return (((mode of vp) & mask) == mask ? 0 : EACCES); -} -.Ed -.Sh エラー -.Bl -tag -width Er -.It Bq Er EPERM -不変ファイルを変更しようとしました。 -.It Bq Er EACCES -許可されません。 -.El -.Sh 関連項目 -.Xr vnode 9 -.Sh 作者 -このマニュアルページは -.An Doug Rabson -が書きました。 |